Skip to content

Commit b0676a2

Browse files
authored
Merge branch 'main' into fix/chat-markdown-noopener
2 parents da0bc1e + 9403429 commit b0676a2

233 files changed

Lines changed: 33324 additions & 7948 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.docs/scripts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
- `bun run dev:web` — Starts just the Vite dev server for the web app.
66
- Dev commands default `T3CODE_STATE_DIR` to `~/.t3/dev` to keep dev state isolated from desktop/prod state.
77
- Override server CLI-equivalent flags from root dev commands with `--`, for example:
8-
`bun run dev -- --state-dir ~/.t3/another-dev-state`
8+
`bun run dev -- --base-dir ~/.t3-2`
99
- `bun run start` — Runs the production server (serves built web app as static files).
1010
- `bun run build` — Builds contracts, web app, and server through Turbo.
1111
- `bun run typecheck` — Strict TypeScript checks for all packages.

.github/workflows/pr-size.yml

Lines changed: 64 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,32 +24,32 @@ jobs:
2424
{
2525
name: "size:XS",
2626
color: "0e8a16",
27-
description: "0-9 changed lines (additions + deletions).",
27+
description: "0-9 effective changed lines (test files excluded in mixed PRs).",
2828
},
2929
{
3030
name: "size:S",
3131
color: "5ebd3e",
32-
description: "10-29 changed lines (additions + deletions).",
32+
description: "10-29 effective changed lines (test files excluded in mixed PRs).",
3333
},
3434
{
3535
name: "size:M",
3636
color: "fbca04",
37-
description: "30-99 changed lines (additions + deletions).",
37+
description: "30-99 effective changed lines (test files excluded in mixed PRs).",
3838
},
3939
{
4040
name: "size:L",
4141
color: "fe7d37",
42-
description: "100-499 changed lines (additions + deletions).",
42+
description: "100-499 effective changed lines (test files excluded in mixed PRs).",
4343
},
4444
{
4545
name: "size:XL",
4646
color: "d93f0b",
47-
description: "500-999 changed lines (additions + deletions).",
47+
description: "500-999 effective changed lines (test files excluded in mixed PRs).",
4848
},
4949
{
5050
name: "size:XXL",
5151
color: "b60205",
52-
description: "1,000+ changed lines (additions + deletions).",
52+
description: "1,000+ effective changed lines (test files excluded in mixed PRs).",
5353
},
5454
];
5555
@@ -131,12 +131,18 @@ jobs:
131131
with:
132132
script: |
133133
const issueNumber = context.payload.pull_request.number;
134-
const additions = context.payload.pull_request.additions ?? 0;
135-
const deletions = context.payload.pull_request.deletions ?? 0;
136-
const changedLines = additions + deletions;
137134
const managedLabels = JSON.parse(process.env.PR_SIZE_LABELS_JSON ?? "[]");
138-
139135
const managedLabelNames = new Set(managedLabels.map((label) => label.name));
136+
// Keep this aligned with the repo's test entrypoints and test-only support files.
137+
const testFilePatterns = [
138+
/(^|\/)__tests__(\/|$)/,
139+
/(^|\/)tests?(\/|$)/,
140+
/^apps\/server\/integration\//,
141+
/\.(test|spec|browser|integration)\.[^.\/]+$/,
142+
];
143+
144+
const isTestFile = (filename) =>
145+
testFilePatterns.some((pattern) => pattern.test(filename));
140146
141147
const resolveSizeLabel = (totalChangedLines) => {
142148
if (totalChangedLines < 10) {
@@ -162,6 +168,42 @@ jobs:
162168
return "size:XXL";
163169
};
164170
171+
const files = await github.paginate(
172+
github.rest.pulls.listFiles,
173+
{
174+
owner: context.repo.owner,
175+
repo: context.repo.repo,
176+
pull_number: issueNumber,
177+
per_page: 100,
178+
},
179+
(response) => response.data,
180+
);
181+
182+
if (files.length >= 3000) {
183+
core.warning(
184+
"The GitHub pull request files API may truncate results at 3,000 files; PR size may be undercounted.",
185+
);
186+
}
187+
188+
let testChangedLines = 0;
189+
let nonTestChangedLines = 0;
190+
191+
for (const file of files) {
192+
const changedLinesForFile = (file.additions ?? 0) + (file.deletions ?? 0);
193+
194+
if (changedLinesForFile === 0) {
195+
continue;
196+
}
197+
198+
if (isTestFile(file.filename)) {
199+
testChangedLines += changedLinesForFile;
200+
continue;
201+
}
202+
203+
nonTestChangedLines += changedLinesForFile;
204+
}
205+
206+
const changedLines = nonTestChangedLines === 0 ? testChangedLines : nonTestChangedLines;
165207
const nextLabelName = resolveSizeLabel(changedLines);
166208
167209
const { data: currentLabels } = await github.rest.issues.listLabelsOnIssue({
@@ -199,4 +241,15 @@ jobs:
199241
});
200242
}
201243
202-
core.info(`PR #${issueNumber}: ${changedLines} changed lines -> ${nextLabelName}`);
244+
const classification =
245+
nonTestChangedLines === 0
246+
? testChangedLines > 0
247+
? "test-only PR"
248+
: "no line changes"
249+
: testChangedLines > 0
250+
? "test lines excluded"
251+
: "all non-test changes";
252+
253+
core.info(
254+
`PR #${issueNumber}: ${nonTestChangedLines} non-test lines, ${testChangedLines} test lines, ${changedLines} effective lines -> ${nextLabelName} (${classification})`,
255+
);

.github/workflows/release.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,31 @@ jobs:
308308
needs: [preflight, release]
309309
runs-on: ubuntu-24.04
310310
steps:
311+
- id: app_token
312+
name: Mint release app token
313+
uses: actions/create-github-app-token@v2
314+
with:
315+
app-id: ${{ secrets.RELEASE_APP_ID }}
316+
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
317+
owner: ${{ github.repository_owner }}
318+
311319
- name: Checkout
312320
uses: actions/checkout@v6
313321
with:
314322
ref: main
315323
fetch-depth: 0
324+
token: ${{ steps.app_token.outputs.token }}
325+
persist-credentials: true
326+
327+
- id: app_bot
328+
name: Resolve GitHub App bot identity
329+
env:
330+
GH_TOKEN: ${{ steps.app_token.outputs.token }}
331+
APP_SLUG: ${{ steps.app_token.outputs.app-slug }}
332+
run: |
333+
user_id="$(gh api "/users/${APP_SLUG}[bot]" --jq .id)"
334+
echo "name=${APP_SLUG}[bot]" >> "$GITHUB_OUTPUT"
335+
echo "email=${user_id}+${APP_SLUG}[bot]@users.noreply.github.com" >> "$GITHUB_OUTPUT"
316336
317337
- name: Setup Bun
318338
uses: oven-sh/setup-bun@v2
@@ -349,8 +369,8 @@ jobs:
349369
exit 0
350370
fi
351371
352-
git config user.name "github-actions[bot]"
353-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
372+
git config user.name "${{ steps.app_bot.outputs.name }}"
373+
git config user.email "${{ steps.app_bot.outputs.email }}"
354374
355375
git add apps/server/package.json apps/desktop/package.json apps/web/package.json packages/contracts/package.json bun.lock
356376
git commit -m "chore(release): prepare $RELEASE_TAG"

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ release/
1717
apps/web/.playwright
1818
apps/web/playwright-report
1919
apps/web/src/components/__screenshots__
20+
.vitest-*
21+
__screenshots__/
22+
.tanstack

0 commit comments

Comments
 (0)