Skip to content

Commit d074c09

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/thread-find-touch
Conflicts: apps/web/src/components/ChatView.tsx
2 parents c456223 + 5ffe045 commit d074c09

1,144 files changed

Lines changed: 55467 additions & 61607 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.

‎.github/scripts/ci-changes.cjs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// node ci-changes.cjs --paths <file> --full run every Linux job, gate only the macOS lint
66
// node ci-changes.cjs changed paths unknown: run everything
77
//
8+
// scripts/check-changed.ts requires the same decisions so local runs match CI.
9+
//
810
// Every changed path maps to workspace packages, which then pull in their
911
// dependents from package.json. A path this file does not recognize runs
1012
// everything, so a new root file or directory can only cost minutes.
@@ -201,4 +203,6 @@ function main() {
201203
for (const [key, value] of Object.entries(outputs)) console.log(`${key}=${value}`);
202204
}
203205

204-
main();
206+
module.exports = { readWorkspace, decide };
207+
208+
if (require.main === module) main();

‎.github/scripts/ci-changes.d.cts‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
interface WorkspacePackage {
2+
readonly name: string;
3+
readonly dir: string;
4+
readonly hasTest: boolean;
5+
readonly deps: ReadonlyArray<string>;
6+
}
7+
8+
export function readWorkspace(): Array<WorkspacePackage>;
9+
10+
export function decide(
11+
files: ReadonlyArray<string> | null,
12+
packages: ReadonlyArray<WorkspacePackage>,
13+
full: boolean,
14+
): {
15+
affected: Array<string>;
16+
outputs: {
17+
typecheck: boolean;
18+
build: boolean;
19+
test: boolean;
20+
test_packages: string;
21+
test_web: boolean;
22+
test_server: boolean;
23+
rust: boolean;
24+
release_smoke: boolean;
25+
mobile_native: boolean;
26+
};
27+
};
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
const assert = require("node:assert/strict");
2+
const { spawnSync } = require("node:child_process");
3+
const { mkdtempSync, readFileSync, rmSync, existsSync } = require("node:fs");
4+
const { tmpdir } = require("node:os");
5+
const { join } = require("node:path");
6+
const { test } = require("node:test");
7+
8+
const release = readFileSync(join(__dirname, "../workflows/release.yml"), "utf8");
9+
const preview = readFileSync(join(__dirname, "../workflows/web-preview.yml"), "utf8");
10+
const stepPattern =
11+
/ name: (?:Build staged deployment|Deploy preview)\n shell: bash\n run: \|\n((?: .*\n|\n)+)/g;
12+
const steps = [
13+
...Array.from(release.matchAll(stepPattern), (match, index) => [
14+
index === 0 ? "hosted web" : "marketing",
15+
match[1],
16+
]),
17+
...Array.from(preview.matchAll(stepPattern), (match) => ["web preview", match[1]]),
18+
];
19+
assert.equal(steps.length, 3, "Expected both release steps and the preview step");
20+
21+
const url = "https://t3code-fixture-pinglabs.vercel.app";
22+
const warning = 'Error while parsing config file: "/runner/t3code/pnpm-lock.yaml"';
23+
24+
function runStep(script, stdout, exitCode = 0) {
25+
const directory = mkdtempSync(join(tmpdir(), "t3-vercel-output-"));
26+
const outputFile = join(directory, "output");
27+
try {
28+
const result = spawnSync(
29+
"bash",
30+
[
31+
"-c",
32+
'vp() { printf "%s\\n" "$FIXTURE_STDOUT"; return "$FIXTURE_EXIT"; }\n' +
33+
'curl() { printf \'{"id":"fixture-project"}\\n\'; }\n' +
34+
script.replace(/^ /gm, "").replace(/\$\{\{.*?\}\}/g, "fixture"),
35+
],
36+
{
37+
encoding: "utf8",
38+
env: {
39+
PATH: process.env.PATH,
40+
VERCEL_TOKEN: "fixture-token",
41+
VERCEL_ORG_ID: "fixture-org",
42+
VERCEL_PROJECT_ID: "fixture-project",
43+
GITHUB_OUTPUT: outputFile,
44+
FIXTURE_STDOUT: stdout,
45+
FIXTURE_EXIT: String(exitCode),
46+
},
47+
},
48+
);
49+
assert.ifError(result.error);
50+
return {
51+
...result,
52+
output: existsSync(outputFile) ? readFileSync(outputFile, "utf8") : "",
53+
};
54+
} finally {
55+
rmSync(directory, { recursive: true, force: true });
56+
}
57+
}
58+
59+
for (const [name, script] of steps) {
60+
for (const [label, stdout] of [
61+
["plain URL", url],
62+
["lockfile warning", `${warning}\n${url}`],
63+
["trailing diagnostic", `${url}\nDone`],
64+
]) {
65+
test(`${name}: saves one deployment URL after ${label}`, () => {
66+
const result = runStep(script, stdout);
67+
assert.equal(result.status, 0, result.stderr);
68+
assert.deepEqual(
69+
result.output.split("\n").filter((line) => !line.startsWith("project_id=")),
70+
[`deployment_url=${url}`, ""],
71+
);
72+
});
73+
}
74+
75+
for (const [label, stdout, exitCode] of [
76+
["missing URL", warning, 0],
77+
["invalid URL", "https://example.invalid/deployment", 0],
78+
["multiple URLs", `${url}\nhttps://other.vercel.app`, 0],
79+
["failed deployment", url, 1],
80+
]) {
81+
test(`${name}: rejects ${label} without saving output`, () => {
82+
const result = runStep(script, stdout, exitCode);
83+
assert.notEqual(result.status, 0);
84+
assert.equal(result.output, "");
85+
});
86+
}
87+
}

‎.github/workflows/ci.yml‎

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ jobs:
8383
- name: Setup Vite+
8484
uses: ./.github/actions/setup-ci-deps
8585

86+
# electron's install.js (run by ensure:electron) reads this cache before it
87+
# downloads from GitHub. The key changes only with the Electron version.
88+
- name: Cache Electron download
89+
uses: actions/cache@v6
90+
with:
91+
path: ~/.cache/electron
92+
key: electron-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('node_modules/.pnpm/electron@*/node_modules/electron/package.json') }}
93+
8694
- name: Ensure Electron runtime is installed
8795
run: vp run --filter @t3tools/desktop ensure:electron
8896

@@ -132,6 +140,14 @@ jobs:
132140
- name: Setup Vite+
133141
uses: ./.github/actions/setup-ci-deps
134142

143+
# electron's install.js (run by ensure:electron) reads this cache before it
144+
# downloads from GitHub. The key changes only with the Electron version.
145+
- name: Cache Electron download
146+
uses: actions/cache@v6
147+
with:
148+
path: ~/.cache/electron
149+
key: electron-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('node_modules/.pnpm/electron@*/node_modules/electron/package.json') }}
150+
135151
- name: Ensure Electron runtime is installed
136152
id: electron
137153
run: vp run --filter @t3tools/desktop ensure:electron
@@ -222,14 +238,22 @@ jobs:
222238
- name: Setup Vite+
223239
uses: ./.github/actions/setup-ci-deps
224240

241+
# electron's install.js (run by ensure:electron) reads this cache before it
242+
# downloads from GitHub. The key changes only with the Electron version.
243+
- name: Cache Electron download
244+
uses: actions/cache@v6
245+
with:
246+
path: ~/.cache/electron
247+
key: electron-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('node_modules/.pnpm/electron@*/node_modules/electron/package.json') }}
248+
225249
- name: Ensure Electron runtime is installed
226250
run: vp run --filter @t3tools/desktop ensure:electron
227251

228252
- name: Test preview artifact validation
229253
run: python3 -B .github/scripts/stage-preview-bundle.test.py
230254

231255
- name: Test release checks
232-
run: node --test .github/scripts/check-nightly-release.test.cjs
256+
run: node --test .github/scripts/check-nightly-release.test.cjs .github/scripts/vercel-deployment-output.test.cjs
233257

234258
- name: Finish installing browser secret helper build libraries
235259
timeout-minutes: 5

‎.github/workflows/cursor-hygiene-webhook.yml‎

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)