Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
e33a029
refactor(cli): share platform request helper and trim auth slop
Brooooooklyn Oct 11, 2026
f82a2e1
test(void): drop duplicate client and auth tests
Brooooooklyn Oct 11, 2026
11d35d9
test(void): drop unused registry fixture from login tests
Brooooooklyn Oct 11, 2026
12ced83
refactor(cli): trim managed deploy barrel, dead options and essays
Brooooooklyn Oct 11, 2026
a22237e
test(void): drop duplicate deploy and manifest tests
Brooooooklyn Oct 11, 2026
c2f4d8d
refactor(cli): inline asset hash wrapper and drop test-only exports
Brooooooklyn Oct 11, 2026
c4f700e
refactor(email): trim runtime comments and share deadline helpers
Brooooooklyn Oct 11, 2026
74eb10b
test(email): drop duplicate tests and trim history comments
Brooooooklyn Oct 11, 2026
0d608c2
docs(email): correct default sender and capture cap notes
Brooooooklyn Oct 11, 2026
222713c
refactor(void): trim routing dead code, duplicate templates and comments
Brooooooklyn Oct 11, 2026
cda5625
test(void): drop duplicate routing tests and trim test comments
Brooooooklyn Oct 11, 2026
f0f7e98
refactor(cli): trim gen, github and headers comments and duplicate code
Brooooooklyn Oct 11, 2026
5e11317
test(void): drop duplicate gen, domain, github and routing tests
Brooooooklyn Oct 11, 2026
7194705
fix(cli): keep github connect from probing git when --branch is set
Brooooooklyn Oct 11, 2026
f1fd5dd
refactor(cli): share platform ownership checks and trim plan helpers
Brooooooklyn Oct 11, 2026
ab9ab81
test(cli): share platform plan fixtures and drop duplicate tests
Brooooooklyn Oct 11, 2026
c4ad944
refactor(cli): drop dead email --subdomain path and trim comments
Brooooooklyn Oct 11, 2026
36a3c34
test(void): drop duplicate email tests and history comments
Brooooooklyn Oct 11, 2026
20b487e
refactor(cli): keep the add-only --subdomain message and fix MX comment
Brooooooklyn Oct 11, 2026
a9d5472
refactor(void): trim auth runtime plumbing and unused ai option
Brooooooklyn Oct 11, 2026
c518bb9
test(void): drop duplicate auth, ai and config tests
Brooooooklyn Oct 11, 2026
0b07249
test(void): assert exact authorization header per ai provider
Brooooooklyn Oct 11, 2026
0c4b72f
refactor(void): trim db codegen and migration helper slop
Brooooooklyn Oct 11, 2026
212eb95
test(void): trim duplicate migration and codegen tests
Brooooooklyn Oct 11, 2026
a0ef049
refactor(cli): trim platform installer seams and duplicate helpers
Brooooooklyn Oct 11, 2026
38789b9
test(void): split installer upgrade scenarios and share fixtures
Brooooooklyn Oct 11, 2026
6fe827d
refactor(cli): drop dead paths and duplicate helpers in core commands
Brooooooklyn Oct 11, 2026
c980117
test(void): drop duplicate cli and deploy tests
Brooooooklyn Oct 11, 2026
8a7d74b
refactor(cli): keep team output sanitizer unchanged
Brooooooklyn Oct 11, 2026
dc0b9fd
refactor(void): share live naming helpers and trim runtime comments
Brooooooklyn Oct 11, 2026
803cacb
test(void): drop duplicate runtime tests and narration
Brooooooklyn Oct 11, 2026
0eb0322
refactor(void): keep live naming helpers out of the void/live exports
Brooooooklyn Oct 11, 2026
a860504
refactor(void): trim plugin module comments and dead inputs
Brooooooklyn Oct 11, 2026
f0a9e02
test(void): drop duplicate plugin module tests and stale comments
Brooooooklyn Oct 11, 2026
580bf57
fix(void): re-import env.ts on each build start
Brooooooklyn Oct 11, 2026
d112c30
refactor(deploy): dedupe manifest checks and trim version helpers
Brooooooklyn Oct 11, 2026
88bb3bf
test(deploy): drop duplicate cases and share trigger test helpers
Brooooooklyn Oct 11, 2026
48ea5fb
refactor(isr): trim isr and edge comments and needless request copies
Brooooooklyn Oct 11, 2026
be2c1af
test(isr): drop duplicate isr cache and key tests
Brooooooklyn Oct 11, 2026
548edd1
refactor(cli): trim init comments and dead scaffold helpers
Brooooooklyn Oct 11, 2026
fb14798
test(void): fold duplicate init tests and trim test comments
Brooooooklyn Oct 11, 2026
62c5451
refactor(cli): drop no-op post-demo install flags in init
Brooooooklyn Oct 11, 2026
7e75284
refactor(cli): trim wrangler writer comments and dead sandbox sync
Brooooooklyn Oct 11, 2026
8355aee
test(void): trim duplicate wrangler and cf build output tests
Brooooooklyn Oct 11, 2026
e7b921e
refactor(void): drop unused framework sandbox input
Brooooooklyn Oct 11, 2026
01bc708
refactor(pages): dedupe script escaping and drop dead helpers
Brooooooklyn Oct 11, 2026
81106a7
test(pages): drop duplicate pages tests and share test setup
Brooooooklyn Oct 11, 2026
c535b0d
refactor(pages): keep script escaper out of the pages-server entry
Brooooooklyn Oct 11, 2026
c1ce8da
refactor(cli): share cf helpers and drop unused cloudflare options
Brooooooklyn Oct 11, 2026
cf6c5d9
test(cli): share cloudflare test helpers and drop duplicate cases
Brooooooklyn Oct 11, 2026
6242633
refactor(cli): make cloudflare output echo helper module-private
Brooooooklyn Oct 11, 2026
e651f26
refactor(cli): dedupe db command helpers and trim db comments
Brooooooklyn Oct 11, 2026
5f0dfe7
test(void): drop duplicate db command tests and trim comments
Brooooooklyn Oct 11, 2026
3eec102
fix(cli): keep db migrate read fallback and local studio tests
Brooooooklyn Oct 11, 2026
d9d58c3
refactor(cli): trim env gate comments and unused error payloads
Brooooooklyn Oct 11, 2026
363dccc
test(void): drop duplicate env gate and env proxy tests
Brooooooklyn Oct 11, 2026
9d33102
refactor(cli): fix stale env probe and empty-var test comments
Brooooooklyn Oct 11, 2026
cf52130
refactor(cli): trim platform client and recovery slop
Brooooooklyn Oct 11, 2026
93cd2fb
test(cli): drop duplicate platform client and teardown tests
Brooooooklyn Oct 11, 2026
8cd2c57
test(cli): drop no-op recovery call from platform plan test
Brooooooklyn Oct 11, 2026
13001c0
refactor(react,solid): trim adapter plugin slop and restating comments
Brooooooklyn Oct 11, 2026
68e323e
test(react,solid): drop duplicate adapter tests and step comments
Brooooooklyn Oct 11, 2026
9ebe88b
test(void): drop unit tests of repo test and ci tooling
Brooooooklyn Oct 11, 2026
716a4fc
refactor(ci): drop unused fetch option from production baseline
Brooooooklyn Oct 11, 2026
e66fa74
refactor(vue,svelte): drop dead island css and page errors plumbing
Brooooooklyn Oct 11, 2026
6fd01fe
test(vue,svelte): drop duplicate island and deferred tests
Brooooooklyn Oct 11, 2026
688f09a
refactor(md): merge island emitters and drop dead options
Brooooooklyn Oct 11, 2026
2dd244c
test(md): drop duplicate and no-op markdown tests
Brooooooklyn Oct 11, 2026
5ed8c82
refactor(md): keep public type exports of the plugin entry
Brooooooklyn Oct 11, 2026
368129b
refactor(cli): trim duplicate platform access and protection checks
Brooooooklyn Oct 11, 2026
901439c
test(void): drop duplicate platform auth and access tests
Brooooooklyn Oct 11, 2026
dc22436
refactor(void): trim remote binding and env helpers
Brooooooklyn Oct 11, 2026
44de21f
test(void): drop duplicate env and remote binding tests
Brooooooklyn Oct 11, 2026
cda8de0
test(void): drop stale default wording from dotenv test name
Brooooooklyn Oct 11, 2026
b9b2563
refactor(cli): trim provision comments and dead helpers
Brooooooklyn Oct 11, 2026
b2012d1
test(void): split provision cases and drop duplicate tests
Brooooooklyn Oct 11, 2026
f02cfae
refactor(cli): restore lock release ordering note and drop stale env …
Brooooooklyn Oct 11, 2026
fc01f7b
refactor(void): trim config validator, plugin comments and dead fields
Brooooooklyn Oct 11, 2026
74dd4c3
test(void): drop duplicate plugin tests and long test notes
Brooooooklyn Oct 11, 2026
fd77bf1
test(void): assert ai and email binding overrides in analysis
Brooooooklyn Oct 11, 2026
caa55f5
refactor(cli): trim cloudflare deploy comments and share stage plumbing
Brooooooklyn Oct 11, 2026
7395bf6
test(void): drop duplicate cloudflare deploy tests and trim comments
Brooooooklyn Oct 11, 2026
6e58f8e
test(void): pin preview_urls in the whole-object verifier table
Brooooooklyn Oct 11, 2026
7307aec
test(void): drop duplicate integration tests and trim comments
Brooooooklyn Oct 11, 2026
29c76a0
test(void): check inferred name label in info output
Brooooooklyn Oct 11, 2026
53e0800
refactor(cli): share platform worker deploy callbacks and trim dead code
Brooooooklyn Oct 11, 2026
1021532
test(cli): drop duplicate platform setup and login tests
Brooooooklyn Oct 11, 2026
82b05d3
refactor(platform): share contract validators and trim duplicate checks
Brooooooklyn Oct 11, 2026
3448739
test(platform): share worker config fixture and drop redundant tests
Brooooooklyn Oct 11, 2026
90e03cc
refactor(void): drop async cron/queue scanners and dead scan code
Brooooooklyn Oct 11, 2026
ee5ca46
test(void): fold duplicate scan and inference tests into tables
Brooooooklyn Oct 11, 2026
a73e26e
refactor(cli): share installer run state and drop no-op route removal
Brooooooklyn Oct 11, 2026
6912a01
refactor(cli): share platform config hashes and installation test hel…
Brooooooklyn Oct 11, 2026
7a80667
refactor(void): share config readers, record guard and routing lint
Brooooooklyn Oct 11, 2026
11d8759
refactor(void): drop unused auth database and migration dialect args
Brooooooklyn Oct 11, 2026
f07ca5b
refactor(cli): share project-id lookup and drop stale labels
Brooooooklyn Oct 11, 2026
41235a6
test(api): drop leftover labels from check-run comments
Brooooooklyn Oct 11, 2026
1c1940b
test(pages): share adapter dev SSR, island HMR and server start
Brooooooklyn Oct 11, 2026
008fa48
test(pages): keep adapter server child from spawn time
Brooooooklyn Oct 11, 2026
40a2d24
refactor(void): share runtime base64 and scanner helpers
Brooooooklyn Oct 11, 2026
b04b2fc
refactor(adapters): drop dead island css modules and unused exports
Brooooooklyn Oct 11, 2026
8a5b7fb
test(void): share plugin test helpers and drop duplicate tests
Brooooooklyn Oct 11, 2026
b54a243
revert(void): keep md.d.ts detection in project tsconfig
Brooooooklyn Oct 11, 2026
df74ee1
chore(ci): typecheck repo tooling and drop test-only script seams
Brooooooklyn Oct 11, 2026
6f3f6de
refactor(ci): require the production baseline environment
Brooooooklyn Oct 11, 2026
e8c2b33
refactor(cli): drop lazy provision loader and dead deploy seams
Brooooooklyn Oct 11, 2026
c77875d
docs(void): drop stale leaf-module note on dotenv key scan
Brooooooklyn Oct 11, 2026
8ef7f17
refactor(void): share duplicated cli helpers
Brooooooklyn Oct 11, 2026
f71618e
fix(cli): keep base platform timing and installer error wording
Brooooooklyn Oct 11, 2026
3764882
fix(email): keep base email error text and subdomain checks
Brooooooklyn Oct 11, 2026
4b8a38d
fix(void): restore base config, journal and workspace behavior
Brooooooklyn Oct 11, 2026
561c196
test(void): seed a stale table in the previous migration snapshot
Brooooooklyn Oct 11, 2026
86d27e9
test: restore coverage dropped by the cleanup
Brooooooklyn Oct 11, 2026
0bbd875
fix(pages): keep the router export on generated client entries
Brooooooklyn Oct 11, 2026
2fdd2ef
test(cli): pass explicit access in the Sandbox setup page test
Brooooooklyn Oct 11, 2026
6338a52
test: restore four tests that held unique coverage
Brooooooklyn Oct 11, 2026
790151a
fix(edge): match path patterns with a parser instead of RegExp
Brooooooklyn Oct 11, 2026
a46de00
test: restore manifest.revalidate key order coverage
Brooooooklyn Oct 12, 2026
a866943
test: restore dev trigger token and queue suffix order coverage
Brooooooklyn Oct 12, 2026
15f1ce4
test: restore unfenced migration attempt status coverage
Brooooooklyn Oct 12, 2026
cec7d95
test: restore restarting page return path coverage
Brooooooklyn Oct 12, 2026
29ded00
test: restore handleIsr corrupt KV entry coverage
Brooooooklyn Oct 12, 2026
286ab42
test: restore browser OAuth coverage for clearing custom domains
Brooooooklyn Oct 12, 2026
8596161
test: restore commented island import coverage for Markdown scripts
Brooooooklyn Oct 12, 2026
e3a1a12
test: restore platform browser login coverage
Brooooooklyn Oct 12, 2026
03e436c
test: restore account-mismatch config coverage
Brooooooklyn Oct 12, 2026
411a962
test: restore remote binding endpoint path coverage
Brooooooklyn Oct 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 12 additions & 14 deletions .github/scripts/postgres-concurrency-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { spawnSync } from 'node:child_process';
import { readFileSync } from 'node:fs';
// eslint-disable-next-line no-restricted-imports -- Native filesystem paths are never embedded in source.
import { join } from 'node:path';
import { fileURLToPath, pathToFileURL } from 'node:url';
import { fileURLToPath } from 'node:url';
import { parseSync } from 'vite';
import { isRecord } from '../../packages/deploy-core/src/is-record.ts';
import { compatibilityTestFiles } from './schema-compat-tests.ts';
Expand Down Expand Up @@ -38,7 +38,7 @@ function usesPostgresEnvironment(node: unknown): boolean {
}

/** Select real PostgreSQL cases without repeating the whole in-memory API suite. */
export function postgresConcurrencyTestFiles(root: string): Array<string> {
function postgresConcurrencyTestFiles(root: string): Array<string> {
const files = compatibilityTestFiles(root).filter((file) => {
const parsed = parseSync(file, readFileSync(join(root, file), 'utf8'));
if (parsed.errors.length > 0) {
Expand All @@ -52,16 +52,14 @@ export function postgresConcurrencyTestFiles(root: string): Array<string> {
return files;
}

if (process.argv[1] && pathToFileURL(process.argv[1]).href === import.meta.url) {
const files = postgresConcurrencyTestFiles(process.cwd());
// Reuse the bounded runner's independent database clones and cleanup for every file.
const result = spawnSync(
process.execPath,
[fileURLToPath(new URL('./schema-compat-tests.ts', import.meta.url)), ...files],
{ stdio: 'inherit' },
);
if (result.error) {
throw result.error;
}
process.exitCode = result.status ?? 1;
const files = postgresConcurrencyTestFiles(process.cwd());
// Reuse the bounded runner's independent database clones and cleanup for every file.
const result = spawnSync(
process.execPath,
[fileURLToPath(new URL('./schema-compat-tests.ts', import.meta.url)), ...files],
{ stdio: 'inherit' },
);
if (result.error) {
throw result.error;
}
process.exitCode = result.status ?? 1;
31 changes: 13 additions & 18 deletions .github/scripts/production-baseline.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { appendFileSync } from 'node:fs';
import { pathToFileURL } from 'node:url';

export async function productionBaseline(options: {
async function productionBaseline(options: {
configuredSha?: string;
repository: string;
token?: string;
environment?: string;
request?: typeof fetch;
environment: string;
}): Promise<string> {
if (options.configuredSha) {
if (options.configuredSha.length !== 40 || !/^[0-9a-f]{40}$/i.test(options.configuredSha)) {
Expand All @@ -21,11 +19,10 @@ export async function productionBaseline(options: {
'Provide a GitHub repository and read token, or set VOID_PLATFORM_PRODUCTION_REF to the deployed SHA.',
);
}
const request = options.request ?? fetch;
const signal = AbortSignal.timeout(60_000);
const environment = options.environment ?? 'Prod';
const { environment } = options;
const get = async (path: string): Promise<unknown> => {
const response = await request(`https://api.github.com/repos/${options.repository}/${path}`, {
const response = await fetch(`https://api.github.com/repos/${options.repository}/${path}`, {
headers: {
Accept: 'application/vnd.github+json',
Authorization: `Bearer ${options.token}`,
Expand Down Expand Up @@ -70,15 +67,13 @@ export async function productionBaseline(options: {
);
}

if (process.argv[1] && pathToFileURL(process.argv[1]).href === import.meta.url) {
const sha = await productionBaseline({
configuredSha: process.env.PRODUCTION_REF,
repository: process.env.GITHUB_REPOSITORY ?? '',
token: process.env.GITHUB_TOKEN,
environment: process.env.PRODUCTION_ENVIRONMENT || 'Prod',
});
if (process.env.GITHUB_OUTPUT) {
appendFileSync(process.env.GITHUB_OUTPUT, `sha=${sha}\n`);
}
console.log(`Previous production runtime: ${sha}`);
const sha = await productionBaseline({
configuredSha: process.env.PRODUCTION_REF,
repository: process.env.GITHUB_REPOSITORY ?? '',
token: process.env.GITHUB_TOKEN,
environment: process.env.PRODUCTION_ENVIRONMENT || 'Prod',
});
if (process.env.GITHUB_OUTPUT) {
appendFileSync(process.env.GITHUB_OUTPUT, `sha=${sha}\n`);
}
console.log(`Previous production runtime: ${sha}`);
26 changes: 11 additions & 15 deletions .github/scripts/schema-compat-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { createRequire } from 'node:module';
import { join, relative, resolve } from 'node:path';
import { pathToFileURL } from 'node:url';

export const legacyZoneFixture = ` const second = await createTestProject(env.db, user.id, 'concurrent-zone-second');
const legacyZoneFixture = ` const second = await createTestProject(env.db, user.id, 'concurrent-zone-second');
stubCustomerCf({ zones });`;
export const correctedZoneFixture = ` const second = await createTestProject(env.db, user.id, 'concurrent-zone-second');
const correctedZoneFixture = ` const second = await createTestProject(env.db, user.id, 'concurrent-zone-second');
const mx: Record<string, Array<string>> = {
'concurrent-one.example.com': [],
'concurrent-two.example.com': [],
Expand All @@ -32,13 +32,13 @@ export const correctedZoneFixture = ` const second = await createTestProjec
},
});`;

export const legacyZoneProvision = ` await runEmailOperation(env.db, bindings(), accepted.value.operationId);`;
export const correctedZoneProvision = ` provisionedDomain = (await env.db.select().from(emailDomainRoutes))[0]!.domain;
const legacyZoneProvision = ` await runEmailOperation(env.db, bindings(), accepted.value.operationId);`;
const correctedZoneProvision = ` provisionedDomain = (await env.db.select().from(emailDomainRoutes))[0]!.domain;
await runEmailOperation(env.db, bindings(), accepted.value.operationId);`;

export const legacyDeployBodyFixture = ` expect(res.status).not.toBe(413);
const legacyDeployBodyFixture = ` expect(res.status).not.toBe(413);
});`;
export const correctedDeployBodyFixture = ` expect(res.status).not.toBe(413);
const correctedDeployBodyFixture = ` expect(res.status).not.toBe(413);
// Finish the deployment's database work before the next fixture resets its tables.
await res.text();
});`;
Expand All @@ -63,7 +63,7 @@ function correctKnownFixture(
}

/** Correct only the known deployed test fixture; runtime code and every assertion stay intact. */
export function correctLegacyEmailFixture(source: string): string {
function correctLegacyEmailFixture(source: string): string {
return correctKnownFixture(
source,
'bf3ec4cd84c85a9e2cd01c7906ca6952dce5d7b957dc38487d6cfe99e9257eed',
Expand All @@ -74,7 +74,7 @@ export function correctLegacyEmailFixture(source: string): string {
);
}

export function correctLegacyDeployFixture(source: string): string {
function correctLegacyDeployFixture(source: string): string {
return correctKnownFixture(
source,
'a62cdbc79573bba09da2212c441ebdcec74569d5ec4193d494f54fad98722f33',
Expand All @@ -83,7 +83,7 @@ export function correctLegacyDeployFixture(source: string): string {
}

/** Only the disposable CI database may be used as a template. */
export function compatibilityTemplate(value: string): URL {
function compatibilityTemplate(value: string): URL {
let url: URL;
try {
url = new URL(value);
Expand Down Expand Up @@ -120,18 +120,14 @@ export function compatibilityTestFiles(root: string): Array<string> {
}

/** Keep the deployed runtime/tests intact, with one upgraded database snapshot per file. */
export async function runIsolatedCompatibilityTests(options: {
async function runIsolatedCompatibilityTests(options: {
templateUrl: string;
files: ReadonlyArray<string>;
query: (statement: string) => Promise<unknown>;
runTest: (file: string, databaseUrl: string) => Promise<number>;
concurrency?: number;
}): Promise<Array<string>> {
const template = compatibilityTemplate(options.templateUrl);
const concurrency = options.concurrency ?? 2;
if (!Number.isInteger(concurrency) || concurrency < 1 || concurrency > 4) {
throw new Error('Compatibility concurrency must be between 1 and 4.');
}
const concurrency = 2;
if (!options.files.length || new Set(options.files).size !== options.files.length) {
throw new Error('Compatibility tests must contain unique test files.');
}
Expand Down
18 changes: 8 additions & 10 deletions .github/scripts/schema-fixture.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ const PROJECT_MODE_MIGRATION = {
timestamp: 1790841384175,
};

export function isProjectModeMigrationApplied(rows) {
function isProjectModeMigrationApplied(rows) {
return (
rows.length === 1 &&
rows[0].hash === PROJECT_MODE_MIGRATION.hash &&
String(rows[0].created_at) === String(PROJECT_MODE_MIGRATION.timestamp)
);
}

export function assertSchemaFixturePreserved(original, rows, projectModeMigrationApplied = false) {
function assertSchemaFixturePreserved(original, rows, projectModeMigrationApplied = false) {
for (const [table, row] of Object.entries(original)) {
for (const [key, value] of Object.entries(row)) {
// 0054 deliberately normalizes the obsolete Worker mode to the public
Expand All @@ -40,11 +40,11 @@ export function assertSchemaFixturePreserved(original, rows, projectModeMigratio
}
}

export async function runSchemaFixture(command, env = process.env) {
async function runSchemaFixture(command) {
const snapshot =
env.COMPAT_FIXTURE_PATH ??
(env.RUNNER_TEMP ? `${env.RUNNER_TEMP}/void-schema-fixture.json` : undefined);
if (!snapshot || !env.COMPAT_DATABASE_URL) {
process.env.COMPAT_FIXTURE_PATH ??
(process.env.RUNNER_TEMP ? `${process.env.RUNNER_TEMP}/void-schema-fixture.json` : undefined);
if (!snapshot || !process.env.COMPAT_DATABASE_URL) {
throw new Error('A disposable compatibility database and fixture path are required.');
}
if (command !== 'seed' && command !== 'verify') {
Expand All @@ -55,7 +55,7 @@ export async function runSchemaFixture(command, env = process.env) {
const { Pool } = createRequire(
pathToFileURL(`${process.cwd()}/platform/packages/api/package.json`),
)('pg');
const pool = new Pool({ connectionString: env.COMPAT_DATABASE_URL });
const pool = new Pool({ connectionString: process.env.COMPAT_DATABASE_URL });
try {
if (command === 'seed') {
await pool.query(
Expand Down Expand Up @@ -104,6 +104,4 @@ export async function runSchemaFixture(command, env = process.env) {
}
}

if (process.argv[1] && pathToFileURL(process.argv[1]).href === import.meta.url) {
await runSchemaFixture(process.argv[2]);
}
await runSchemaFixture(process.argv[2]);
19 changes: 8 additions & 11 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ The runner adds coverage that imports cannot describe:
`--list` does not refresh builds, so built-export coverage can expand when the command executes.
Affected selection is conservative, not a proof that all behavior is covered: computed imports,
filesystem reads, generated artifacts, and external services can introduce additional dependencies.
Explicitly run a known consumer when changing one of those boundaries, and add a selector regression
when introducing a new fixture layout. Changes to packaging still need the packed checks below;
changes to metaframework output still need `build:all` and the artifact check.
Explicitly run a known consumer when changing one of those boundaries. Changes to packaging still
need the packed checks below; changes to metaframework output still need `build:all` and the
artifact check.

For a leaf-module edit with known import-based consumers, Vitest's native related command is useful:

Expand Down Expand Up @@ -143,16 +143,14 @@ repeat those production builds. `vpr test:all` runs the same artifact check loca

Integration sharding uses [measured duration estimates](test/integration-timings.ts), rather than
filename hashes. [The sequencer](test/sequencer.ts) packs the longest files first and starts costly
fixtures early. Estimates affect scheduling only: new files receive a fallback estimate, and
membership tests ensure every discovered file appears exactly once. Refresh the estimates when
the suite's costs change materially. Seeded file shuffling remains available for isolation checks.
fixtures early. Estimates affect scheduling only: new files receive a fallback estimate. Refresh
the estimates when the suite's costs change materially. Seeded file shuffling remains available
for isolation checks.

The four adapter suites share their client and island test definitions in `test/`. Each runs the
full browser behavior contract against its production preview build, plus a dev-mode navigation,
island hydration/interaction smoke check, SSR/protocol assertions, and HMR checks. This keeps both
runtime modes covered without repeating the full browser matrix. Before integrations start,
their sources are snapshotted so another test cloning a fixture cannot capture an in-flight HMR
edit. Dependencies stay linked to the installed workspace, and snapshots are removed afterward.
runtime modes covered without repeating the full browser matrix.

Use production functions in unit tests. A copy of a hook's implementation inside a test cannot
catch regressions in the real hook. Shared form-value equality has one direct suite, and actual
Expand Down Expand Up @@ -247,8 +245,7 @@ VOID_TEST_BROWSER=webkit vp test run packages/react/test/integration packages/vu
Use `waitForIslandsHydrated` from `test/browser-helpers.ts` before asserting island state or
interacting with islands. Pass the expected minimum count when checking a multi-island fixture.
Each island imports and hydrates independently, so a selector matching one hydrated island does
not establish that its siblings are ready. The helper rejects empty or partially hydrated pages;
`packages/void/test/integration/browser-helpers.test.ts` covers these cases.
not establish that its siblings are ready. The helper rejects empty or partially hydrated pages.

For SPA navigation, wait for a client readiness signal before setting the document marker and
clicking. The Nuxt and SvelteKit playgrounds expose `h1[data-hydrated="true"]` after client startup.
Expand Down
2 changes: 1 addition & 1 deletion packages/create-void/src/pm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { join } from 'pathslash';

export type PM = 'npm' | 'pnpm' | 'yarn' | 'bun';

export const VOID_PNPM_ALLOWED_BUILDS = ['esbuild', 'sharp', 'workerd'] as const;
const VOID_PNPM_ALLOWED_BUILDS = ['esbuild', 'sharp', 'workerd'] as const;

/** Write the explicit build-script policy required by a new pnpm project. */
export function writePnpmBuildPolicy(root: string, pm: PM): void {
Expand Down
20 changes: 2 additions & 18 deletions packages/create-void/test/unit/pm.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { existsSync, mkdtempSync, readFileSync, rmSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { afterEach, describe, expect, it } from 'vite-plus/test';
import { VOID_PNPM_ALLOWED_BUILDS, writePnpmBuildPolicy } from '../../src/pm.ts';
import { writePnpmBuildPolicy } from '../../src/pm.ts';

const temporaryDirectories: Array<string> = [];

Expand All @@ -20,7 +20,7 @@ describe('create-void package manager bootstrap', () => {
writePnpmBuildPolicy(root, 'pnpm');

expect(readFileSync(join(root, 'pnpm-workspace.yaml'), 'utf-8')).toBe(
`allowBuilds:\n better-sqlite3: false\n${VOID_PNPM_ALLOWED_BUILDS.map((name) => ` ${name}: true`).join('\n')}\n`,
'allowBuilds:\n better-sqlite3: false\n esbuild: true\n sharp: true\n workerd: true\n',
);
});

Expand All @@ -34,20 +34,4 @@ describe('create-void package manager bootstrap', () => {
expect(existsSync(join(root, 'pnpm-workspace.yaml'))).toBe(false);
}
});

it('stays aligned with the policy written by void init', () => {
const initSource = readFileSync(
join(import.meta.dirname, '../../../void/src/cli/init.ts'),
'utf-8',
);
const declaration = initSource.match(
/const PNPM_ALLOWED_BUILDS = \[([\s\S]*?)\] as const;/,
)?.[1];
if (!declaration) {
throw new Error('Could not find the void init pnpm build policy.');
}
const initAllowedBuilds = [...declaration.matchAll(/'([^']+)'/g)].map((match) => match[1]);

expect(VOID_PNPM_ALLOWED_BUILDS).toEqual(initAllowedBuilds);
});
});
10 changes: 9 additions & 1 deletion packages/deploy-cloudflare/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { existsSync, readFileSync } from 'node:fs';
import { parse as parseJsoncConfig, type ParseError } from 'jsonc-parser';
import { applyEdits, modify, parse as parseJsoncConfig, type ParseError } from 'jsonc-parser';

/** Parse a root Wrangler JSON/JSONC config without accepting a partial parse. */
export function parseRootWranglerConfig(configPath: string): Record<string, unknown> {
Expand All @@ -21,6 +21,14 @@ export function parseRootWranglerConfig(configPath: string): Record<string, unkn
return parsed as Record<string, unknown>;
}

/** Set one value in JSONC text, keeping comments and formatting elsewhere. */
export function setJsoncValue(text: string, path: Array<string>, value: unknown): string {
return applyEdits(
text,
modify(text, path, value, { formattingOptions: { insertSpaces: true, tabSize: 2, eol: '\n' } }),
);
}

export function readWranglerTopLevelString(
config: Record<string, unknown>,
field: string,
Expand Down
10 changes: 3 additions & 7 deletions packages/deploy-cloudflare/src/framework.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
import { applyEdits, modify, parse } from 'jsonc-parser';
import { parse } from 'jsonc-parser';
import { dirname, join, relative } from 'pathslash';
import { setJsoncValue } from './config.ts';

export type CloudflareFrameworkDeployConfig = Readonly<{
configPath: string;
Expand Down Expand Up @@ -33,12 +34,7 @@ export function writeCloudflareFrameworkDeployConfig(
: '{}\n';
let content = initial;
const upsert = (path: Array<string>, value: unknown): void => {
content = applyEdits(
content,
modify(content, path, value, {
formattingOptions: { insertSpaces: true, tabSize: 2, eol: '\n' },
}),
);
content = setJsoncValue(content, path, value);
};

upsert(['name'], options.name);
Expand Down
8 changes: 2 additions & 6 deletions packages/deploy-cloudflare/src/static.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import { cpSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
import type { AssetConfig, HeaderRule, RedirectRule } from '@void/deploy-core';
import {
applyEdits,
createScanner,
modify,
parse,
parseTree,
type Node,
type ParseError,
SyntaxKind,
} from 'jsonc-parser';
import { dirname, join, relative, resolve } from 'pathslash';
import { setJsoncValue } from './config.ts';

export type CloudflareStaticDeployConfig = Readonly<{
configPath: string;
Expand Down Expand Up @@ -100,10 +99,7 @@ export function writeCloudflareStaticDeployConfig(options: CloudflareStaticDeplo
const originalComments = extractCommentTokens(source);
let content = source;
const upsert = (path: Array<string>, value: unknown): void => {
const edits = modify(content, path, value, {
formattingOptions: { insertSpaces: true, tabSize: 2, eol: '\n' },
});
content = applyEdits(content, edits);
content = setJsoncValue(content, path, value);
};

upsert(['name'], options.name);
Expand Down
Loading
Loading