Skip to content

Commit 354679d

Browse files
Merge branch 'main' into fix/issue-16183
2 parents e5bc390 + 8acbefe commit 354679d

279 files changed

Lines changed: 17758 additions & 10183 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.
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ jobs:
253253
run: python3 -B .github/scripts/stage-preview-bundle.test.py
254254

255255
- name: Test release checks
256-
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
257257

258258
- name: Finish installing browser secret helper build libraries
259259
timeout-minutes: 5

‎.github/workflows/release-desktop.yml‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -253,18 +253,13 @@ jobs:
253253
if [[ "${{ inputs.version }}" =~ -nightly\.[0-9]{8}\.[0-9]+$ ]]; then brand=nightly; fi
254254
node scripts/apply-web-brand-assets.ts "$brand" apps/server/dist/client
255255
256-
# The single-executable is built with a Node that supports --build-sea
257-
# (25.7+); the repo itself stays on the engines.node version. A native
258-
# build injects into the runner's own Node; a Windows target downloads its
259-
# node.exe.
256+
# Setup Vite+ selects the exact engines.node version from package.json.
257+
# Native builds embed that executable; cross-target builds download the
258+
# same version for their target.
260259
- name: Build CLI single-executable
261260
if: inputs.cli_archive
262261
shell: bash
263262
env:
264-
# The exact version, not a major: vp downloads it from nodejs.org/dist on
265-
# the runner, and only exact versions have a dist directory. Keep in
266-
# step with SEA_NODE_VERSION in apps/server/vite.config.ts.
267-
VP_NODE_VERSION: "26.8.2"
268263
# The executable bundles the server again, so it needs the same stamp
269264
# as release.yml's JS bundle.
270265
T3CODE_TELEMETRY_CHANNEL: ${{ github.repository == 'pingdotgg/t3code' && inputs.release_channel || 'dev' }}

‎.github/workflows/release.yml‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ jobs:
10721072
fi
10731073
10741074
echo "Building hosted web app for $channel_name channel."
1075-
deployment_url="$(
1075+
deployment_output="$(
10761076
vp dlx [email protected] deploy \
10771077
--archive=tgz \
10781078
--prod \
@@ -1091,6 +1091,13 @@ jobs:
10911091
--build-env "VITE_HOSTED_APP_URL=$router_url" \
10921092
--build-env "VITE_HOSTED_APP_CHANNEL=$channel_name"
10931093
)"
1094+
printf '%s\n' "$deployment_output"
1095+
# Vercel can print lockfile warnings to stdout before the deployment URL.
1096+
deployment_url="$(printf '%s\n' "$deployment_output" | grep -E '^https://[[:alnum:].-]+\.vercel\.app$')"
1097+
if [[ "$deployment_url" == *$'\n'* ]]; then
1098+
echo "Vercel returned multiple deployment URLs." >&2
1099+
exit 1
1100+
fi
10941101
echo "Staged $deployment_url."
10951102
echo "deployment_url=$deployment_url" >> "$GITHUB_OUTPUT"
10961103
@@ -1219,7 +1226,7 @@ jobs:
12191226
)"
12201227
export VERCEL_PROJECT_ID
12211228
1222-
deployment_url="$(
1229+
deployment_output="$(
12231230
vp dlx [email protected] deploy \
12241231
--archive=tgz \
12251232
--prod \
@@ -1228,6 +1235,13 @@ jobs:
12281235
--token "$VERCEL_TOKEN" \
12291236
--scope "${VERCEL_TEAM_SLUG:-$VERCEL_ORG_ID}"
12301237
)"
1238+
printf '%s\n' "$deployment_output"
1239+
# Vercel can print lockfile warnings to stdout before the deployment URL.
1240+
deployment_url="$(printf '%s\n' "$deployment_output" | grep -E '^https://[[:alnum:].-]+\.vercel\.app$')"
1241+
if [[ "$deployment_url" == *$'\n'* ]]; then
1242+
echo "Vercel returned multiple deployment URLs." >&2
1243+
exit 1
1244+
fi
12311245
echo "Staged $deployment_url."
12321246
echo "deployment_url=$deployment_url" >> "$GITHUB_OUTPUT"
12331247
echo "project_id=$VERCEL_PROJECT_ID" >> "$GITHUB_OUTPUT"

‎.github/workflows/web-preview.yml‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,20 @@ jobs:
7777
7878
vercel_scope="${VERCEL_TEAM_SLUG:-$VERCEL_ORG_ID}"
7979
80-
deployment_url="$(
80+
deployment_output="$(
8181
vp dlx [email protected] deploy \
8282
--archive=tgz \
8383
--yes \
8484
--token "$VERCEL_TOKEN" \
8585
--scope "$vercel_scope"
8686
)"
87+
printf '%s\n' "$deployment_output"
88+
# Vercel can print lockfile warnings to stdout before the deployment URL.
89+
deployment_url="$(printf '%s\n' "$deployment_output" | grep -E '^https://[[:alnum:].-]+\.vercel\.app$')"
90+
if [[ "$deployment_url" == *$'\n'* ]]; then
91+
echo "Vercel returned multiple deployment URLs." >&2
92+
exit 1
93+
fi
8794
8895
echo "Deployed $deployment_url"
8996
echo "deployment_url=$deployment_url" >> "$GITHUB_OUTPUT"

‎.vercelignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Vercel's default .pnp* rule also excludes pnpm's hook, whose checksum is in the lockfile.
2+
!/.pnpmfile.cjs

‎AGENTS.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ An empty database is a bad test. Seed your worktree's `.t3` with a copy of real
105105
- Test meaningful logic or observable behavior. Do not render components to static markup to assert props or attributes, or add tests that merely assert callback wiring or mirror the implementation.
106106
- **Do not run repo-wide checks.** No `vp check`, no `vp run -r test`, no `vp run -r typecheck` unless I ask. CI owns the full suite.
107107
- Backend behavior changes ship with focused tests for that behavior.
108+
- Proof for a bug fix depends on the bug. Logic, data, state, and protocol bugs get a failing test first (the fewest that fail on `main` for that reason, in the module's existing test file), then the fix. Purely visual bugs (spacing, colour, alignment, a layout shift) get before/after captures as their proof and no test: do not add UI tests for nitpicks, and do not ask for one in review when a capture already shows it. A server-only fix with no visible surface ships the test plus a short runtime transcript.
108109
- The server is event-sourced, and side effects run after the command commits. In tests, drain the effect worker (`OrchestrationEffectWorkerV2.drain`) or await the specific persisted event or `Deferred` that marks the milestone. Never wait on sleeps or polling. A test that needs a timeout to pass is wrong. Concretely:
109110
- `it.effect` runs on a `TestClock`; `Effect.sleep` only advances through `TestClock.adjust`. `it.live` is wall-clock and only for subprocess or network fixtures.
110111
- No `yieldNow` or `sleep` polling loops. Await the `Deferred`, take from the `Queue`, or drain the worker.
-765 KB
Binary file not shown.
769 KB
Binary file not shown.

‎apps/mobile/modules/t3-native-controls/ios/T3LayoutMetricsView.swift‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ final class T3LayoutMetricsView: ExpoView {
6969
}
7070
var verticalBarEdge = "none"
7171
var regions: [[String: Any]] = []
72+
var bottomBarInset: CGFloat?
7273
#if canImport(UIKit, _version: 9127.0.85)
7374
if #available(iOS 27.1, *) {
7475
let rtl = effectiveUserInterfaceLayoutDirection == .rightToLeft
@@ -77,6 +78,8 @@ final class T3LayoutMetricsView: ExpoView {
7778
case .trailing: verticalBarEdge = rtl ? "left" : "right"
7879
default: break
7980
}
81+
// Where UIKit floats a bar as tall as the app's bottom controls, level with its tab bar.
82+
bottomBarInset = edgeInsets(for: .bar(onEdge: UIRectEdge.bottom, extent: 48)).bottom
8083
for kind in [UIView.ReservedRegion.Kind.division, .occlusion] {
8184
for region in reservedRegions(kind: kind) where region.isActive {
8285
let frame = region.frame.intersection(bounds)
@@ -90,7 +93,7 @@ final class T3LayoutMetricsView: ExpoView {
9093
}
9194
}
9295
#endif
93-
let metrics: [String: Any] = [
96+
var metrics: [String: Any] = [
9497
"width": bounds.width, "height": bounds.height,
9598
"hasHinge": hasHinge,
9699
"horizontalSizeClass": traitCollection.horizontalSizeClass == .regular ? "regular" : "compact",
@@ -101,6 +104,7 @@ final class T3LayoutMetricsView: ExpoView {
101104
],
102105
"reservedRegions": regions,
103106
]
107+
metrics["bottomBarInset"] = bottomBarInset
104108
let next = metrics as NSDictionary
105109
guard lastMetrics?.isEqual(next) != true else { return }
106110
lastMetrics = next

0 commit comments

Comments
 (0)