From b2d4f8f77fa5c1e9a813b8550d31ffd37a3f20d6 Mon Sep 17 00:00:00 2001 From: Jack Herrington Date: Mon, 30 Nov 2026 09:16:51 -0800 Subject: [PATCH 1/4] chore(ci): fix latent onboarding type error and raise integration-test timeouts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two pre-existing CI problems, surfaced whenever a PR made app/base or core "affected" (e.g. #58): 1. app/base & app/prm onboarding account-setup.ts passed `kind`/`persistence` to defineOnboarding — fields OnboardingFlowDef never had and nothing reads (dead scaffold metadata from #11). This failed base/prm test:types, which is green on main only because nothing there touches those apps. Remove the fields; no runtime behavior changes. 2. Integration suites that boot a full CMS + PGlite (search-cms, ui-react, the example parity tests, and all 13 starter seam/contract tests) ran at the 5s vitest default and flaked under CI load. Raise testTimeout to 20_000 — the same fix already applied to core/base/prm/cli/api. For config-less starters, pass --testTimeout=20000 on the test:starter script. A higher timeout is a ceiling, never a delay, so passing tests are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) --- app/base/src/onboarding/account-setup.ts | 2 -- app/prm/src/onboarding/account-setup.ts | 2 -- examples/astro-starlight-after/vitest.config.ts | 2 ++ examples/emdash-after/vitest.config.ts | 2 ++ examples/payload-after/vitest.config.ts | 2 ++ examples/picks/vitest.config.ts | 6 +++++- examples/wordpress-after/vitest.config.ts | 2 ++ packages/search-cms/vitest.config.ts | 2 ++ packages/ui-react/vitest.config.ts | 2 ++ starters/admin-only/package.json | 2 +- starters/contact-cards/package.json | 2 +- starters/directory-listings/package.json | 2 +- starters/documentation-kb/package.json | 2 +- starters/ecommerce-storefront/package.json | 2 +- starters/editorial-publication/package.json | 2 +- starters/existing-app/package.json | 2 +- starters/headless-api/package.json | 2 +- starters/membership-course/package.json | 2 +- starters/multi-tenant-fleet/package.json | 2 +- starters/runtime-tables/package.json | 2 +- starters/team-ops/package.json | 2 +- starters/themed-smb-site/package.json | 2 +- 22 files changed, 30 insertions(+), 18 deletions(-) diff --git a/app/base/src/onboarding/account-setup.ts b/app/base/src/onboarding/account-setup.ts index a6ba0165..0d843c09 100644 --- a/app/base/src/onboarding/account-setup.ts +++ b/app/base/src/onboarding/account-setup.ts @@ -7,8 +7,6 @@ import { defineOnboarding, formStep } from '@tanstack/onboarding-core' */ export const baseAccountSetup = defineOnboarding({ id: 'base-account-setup', - kind: 'account', - persistence: 'none', steps: [ formStep({ id: 'owner', diff --git a/app/prm/src/onboarding/account-setup.ts b/app/prm/src/onboarding/account-setup.ts index 9546a95f..ede1ea24 100644 --- a/app/prm/src/onboarding/account-setup.ts +++ b/app/prm/src/onboarding/account-setup.ts @@ -7,8 +7,6 @@ import { defineOnboarding, formStep } from '@tanstack/onboarding-core' */ export const prmAccountSetup = defineOnboarding({ id: 'prm-account-setup', - kind: 'account', - persistence: 'none', steps: [ formStep({ id: 'owner', diff --git a/examples/astro-starlight-after/vitest.config.ts b/examples/astro-starlight-after/vitest.config.ts index 373a851b..6abedf3e 100644 --- a/examples/astro-starlight-after/vitest.config.ts +++ b/examples/astro-starlight-after/vitest.config.ts @@ -5,6 +5,8 @@ import { defineConfig } from 'vitest/config' export default defineConfig({ test: { environment: 'node', + // Parity tests boot a full CMS + PGlite; 5s flakes on loaded CI runners. + testTimeout: 20_000, include: ['src/**/*.test.ts'], }, }) diff --git a/examples/emdash-after/vitest.config.ts b/examples/emdash-after/vitest.config.ts index 373a851b..6abedf3e 100644 --- a/examples/emdash-after/vitest.config.ts +++ b/examples/emdash-after/vitest.config.ts @@ -5,6 +5,8 @@ import { defineConfig } from 'vitest/config' export default defineConfig({ test: { environment: 'node', + // Parity tests boot a full CMS + PGlite; 5s flakes on loaded CI runners. + testTimeout: 20_000, include: ['src/**/*.test.ts'], }, }) diff --git a/examples/payload-after/vitest.config.ts b/examples/payload-after/vitest.config.ts index 373a851b..6abedf3e 100644 --- a/examples/payload-after/vitest.config.ts +++ b/examples/payload-after/vitest.config.ts @@ -5,6 +5,8 @@ import { defineConfig } from 'vitest/config' export default defineConfig({ test: { environment: 'node', + // Parity tests boot a full CMS + PGlite; 5s flakes on loaded CI runners. + testTimeout: 20_000, include: ['src/**/*.test.ts'], }, }) diff --git a/examples/picks/vitest.config.ts b/examples/picks/vitest.config.ts index 97bfc706..4fb966b9 100644 --- a/examples/picks/vitest.config.ts +++ b/examples/picks/vitest.config.ts @@ -1,4 +1,8 @@ import { defineConfig } from 'vitest/config' export default defineConfig({ - test: { environment: 'node', include: ['tests/**/*.test.ts'] }, + test: { + environment: 'node', + testTimeout: 20_000, + include: ['tests/**/*.test.ts'], + }, }) diff --git a/examples/wordpress-after/vitest.config.ts b/examples/wordpress-after/vitest.config.ts index 373a851b..6abedf3e 100644 --- a/examples/wordpress-after/vitest.config.ts +++ b/examples/wordpress-after/vitest.config.ts @@ -5,6 +5,8 @@ import { defineConfig } from 'vitest/config' export default defineConfig({ test: { environment: 'node', + // Parity tests boot a full CMS + PGlite; 5s flakes on loaded CI runners. + testTimeout: 20_000, include: ['src/**/*.test.ts'], }, }) diff --git a/packages/search-cms/vitest.config.ts b/packages/search-cms/vitest.config.ts index 59de50df..b32ee4a1 100644 --- a/packages/search-cms/vitest.config.ts +++ b/packages/search-cms/vitest.config.ts @@ -5,6 +5,8 @@ export default defineConfig({ test: { name: packageJson.name, environment: 'node', + // Integration suites boot a full CMS + PGlite; 5s flakes on loaded CI runners. + testTimeout: 20_000, include: ['tests/**/*.test.{ts,tsx}'], }, }) diff --git a/packages/ui-react/vitest.config.ts b/packages/ui-react/vitest.config.ts index e2dfd863..9ba03467 100644 --- a/packages/ui-react/vitest.config.ts +++ b/packages/ui-react/vitest.config.ts @@ -7,6 +7,8 @@ export default defineConfig({ dir: './', watch: false, environment: 'node', + // Integration suites boot a full CMS + PGlite; 5s flakes on loaded CI runners. + testTimeout: 20_000, include: ['tests/**/*.test.{ts,tsx}'], coverage: { provider: 'v8', diff --git a/starters/admin-only/package.json b/starters/admin-only/package.json index ecf7f38f..894822c7 100644 --- a/starters/admin-only/package.json +++ b/starters/admin-only/package.json @@ -5,7 +5,7 @@ "description": "TanStack CMS Starter #2 — Admin-only CMS mode (the canned admin over a representative schema: search, filter, bulk edit, relations, and S1 dogfood baseline).", "scripts": { "dev": "tsx src/cms.config.ts", - "test:starter": "vitest run", + "test:starter": "vitest run --testTimeout=20000", "test:types": "tsc --noEmit" }, "dependencies": { diff --git a/starters/contact-cards/package.json b/starters/contact-cards/package.json index e02ed67a..93c042bc 100644 --- a/starters/contact-cards/package.json +++ b/starters/contact-cards/package.json @@ -5,7 +5,7 @@ "description": "TanStack CMS Starter #10 — Contact Cards (bespoke domain app on the CMS database, starter-scale companion to PRM).", "scripts": { "dev": "tsx src/cms.config.ts", - "test:starter": "vitest run", + "test:starter": "vitest run --testTimeout=20000", "test:types": "tsc --noEmit" }, "dependencies": { diff --git a/starters/directory-listings/package.json b/starters/directory-listings/package.json index 67487b28..4db0e189 100644 --- a/starters/directory-listings/package.json +++ b/starters/directory-listings/package.json @@ -5,7 +5,7 @@ "description": "TanStack CMS Starter #13 — Directory / listings / marketplace (untrusted front-end submissions into S3 moderation, listing claim flow, and faceted + location search).", "scripts": { "dev": "tsx src/cms.config.ts", - "test:starter": "vitest run", + "test:starter": "vitest run --testTimeout=20000", "test:types": "tsc --noEmit" }, "dependencies": { diff --git a/starters/documentation-kb/package.json b/starters/documentation-kb/package.json index 22bd7cb2..1d132976 100644 --- a/starters/documentation-kb/package.json +++ b/starters/documentation-kb/package.json @@ -5,7 +5,7 @@ "description": "TanStack CMS Starter #7 — Documentation / knowledge base / help centre (two product versions, hierarchical nav, and cross-version search).", "scripts": { "dev": "tsx src/cms.config.ts", - "test:starter": "vitest run", + "test:starter": "vitest run --testTimeout=20000", "test:types": "tsc --noEmit" }, "dependencies": { diff --git a/starters/ecommerce-storefront/package.json b/starters/ecommerce-storefront/package.json index a00ebef1..13f50393 100644 --- a/starters/ecommerce-storefront/package.json +++ b/starters/ecommerce-storefront/package.json @@ -5,7 +5,7 @@ "description": "TanStack CMS Starter #8 — E-commerce / storefront & catalog (native commerce: products, variants, persisted cart, customer != staff auth, checkout & order creation).", "scripts": { "dev": "tsx src/cms.config.ts", - "test:starter": "vitest run", + "test:starter": "vitest run --testTimeout=20000", "test:types": "tsc --noEmit" }, "dependencies": { diff --git a/starters/editorial-publication/package.json b/starters/editorial-publication/package.json index 7f3e5359..4b2d32cf 100644 --- a/starters/editorial-publication/package.json +++ b/starters/editorial-publication/package.json @@ -5,7 +5,7 @@ "description": "TanStack CMS Starter #6 — Editorial publication (multi-author workflow, member != staff auth, paywall gating, and email issue delivery).", "scripts": { "dev": "tsx src/cms.config.ts", - "test:starter": "vitest run", + "test:starter": "vitest run --testTimeout=20000", "test:types": "tsc --noEmit" }, "dependencies": { diff --git a/starters/existing-app/package.json b/starters/existing-app/package.json index fee9aa71..8c13a159 100644 --- a/starters/existing-app/package.json +++ b/starters/existing-app/package.json @@ -5,7 +5,7 @@ "description": "TanStack CMS Starter #3 — Existing app adds CMS later (non-colonizing boundary S7: shared DB, shared host session, embedded admin routes, and URL redirect preservation).", "scripts": { "dev": "tsx src/cms.config.ts", - "test:starter": "vitest run", + "test:starter": "vitest run --testTimeout=20000", "test:types": "tsc --noEmit" }, "dependencies": { diff --git a/starters/headless-api/package.json b/starters/headless-api/package.json index fc4058da..d830b1a8 100644 --- a/starters/headless-api/package.json +++ b/starters/headless-api/package.json @@ -5,7 +5,7 @@ "description": "TanStack CMS Starter #1 — Headless / API-only backend (REST, typed client, and MCP over one schema with token auth).", "scripts": { "dev": "tsx src/server.ts", - "test:starter": "vitest run", + "test:starter": "vitest run --testTimeout=20000", "test:types": "tsc --noEmit" }, "dependencies": { diff --git a/starters/membership-course/package.json b/starters/membership-course/package.json index e53d6c6e..283dfe29 100644 --- a/starters/membership-course/package.json +++ b/starters/membership-course/package.json @@ -5,7 +5,7 @@ "description": "TanStack CMS Starter #14 — Gated membership, course & community (enrolment, drip unlock, per-member lesson progress state machine, and quiz/certificate).", "scripts": { "dev": "tsx src/cms.config.ts", - "test:starter": "vitest run", + "test:starter": "vitest run --testTimeout=20000", "test:types": "tsc --noEmit" }, "dependencies": { diff --git a/starters/multi-tenant-fleet/package.json b/starters/multi-tenant-fleet/package.json index aa8fb71d..f35f4d30 100644 --- a/starters/multi-tenant-fleet/package.json +++ b/starters/multi-tenant-fleet/package.json @@ -5,7 +5,7 @@ "description": "TanStack CMS Starter #9 — Multi-site / multi-tenant / agency fleet (query-level tenant isolation, template provisioning, and S8 cross-tenant leak suite).", "scripts": { "dev": "tsx src/cms.config.ts", - "test:starter": "vitest run", + "test:starter": "vitest run --testTimeout=20000", "test:types": "tsc --noEmit" }, "dependencies": { diff --git a/starters/runtime-tables/package.json b/starters/runtime-tables/package.json index e06300ef..94f8f3c4 100644 --- a/starters/runtime-tables/package.json +++ b/starters/runtime-tables/package.json @@ -5,7 +5,7 @@ "description": "TanStack CMS Starter #12 — Runtime Tables (user/AI-defined runtime schema, generated forms & views, and reviewed schema mutations; starter-scale companion to Data / app/base).", "scripts": { "dev": "tsx src/cms.config.ts", - "test:starter": "vitest run", + "test:starter": "vitest run --testTimeout=20000", "test:types": "tsc --noEmit" }, "dependencies": { diff --git a/starters/team-ops/package.json b/starters/team-ops/package.json index 7793b7c1..574546dc 100644 --- a/starters/team-ops/package.json +++ b/starters/team-ops/package.json @@ -5,7 +5,7 @@ "description": "TanStack CMS Starter #11 — Team internal / ops app (field-level RBAC, multi-step approval chain, immutable audit trail, and zero public surface).", "scripts": { "dev": "tsx src/cms.config.ts", - "test:starter": "vitest run", + "test:starter": "vitest run --testTimeout=20000", "test:types": "tsc --noEmit" }, "dependencies": { diff --git a/starters/themed-smb-site/package.json b/starters/themed-smb-site/package.json index c70ecbe6..fac7907f 100644 --- a/starters/themed-smb-site/package.json +++ b/starters/themed-smb-site/package.json @@ -5,7 +5,7 @@ "description": "TanStack CMS Starter #4 — Themed marketing / SMB site (one theme, brochure pages, contact form intake, preview, and SEO basics).", "scripts": { "dev": "tsx src/cms.config.ts", - "test:starter": "vitest run", + "test:starter": "vitest run --testTimeout=20000", "test:types": "tsc --noEmit" }, "dependencies": { From 9758465e47aca750f69cbdacd4f61d348e861cd7 Mon Sep 17 00:00:00 2001 From: Jack Herrington Date: Mon, 30 Nov 2026 09:23:42 -0800 Subject: [PATCH 2/4] fix(base,prm,picks): ship embedded PGlite runtime assets in production builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The embedded PGlite engine loads its WASM db image (pglite.data), runtime (pglite.wasm), and contrib bundles (pg_trgm.tar.gz, …) as binary files at runtime; nitro doesn't trace them, so a bare `vite build` leaves them out of .output/server. The runtime then can't open PGlite and floods "Extension bundle not found" / "ENOENT pglite.data" — surfacing downstream as "CMS Postgres connection acquisition timed out" (the single client never materializes) and the production runtime never becomes healthy. This is why the Base Docker E2E smoke failed on every run. The fix already exists — scripts/copy-pglite-assets.mjs, applied to 5 starters in #56 — but app/base, app/prm, and examples/picks (all embedded-PGlite production builds) never got it. Append it to their build scripts. The four other bare-`vite build` projects don't embed PGlite, so they're left unchanged. Verified by building app/base and running the production server: healthy on the first request with zero PGlite errors (was: 500 flood, never healthy). Co-Authored-By: Claude Opus 4.8 (1M context) --- app/base/package.json | 2 +- app/prm/package.json | 2 +- examples/picks/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/base/package.json b/app/base/package.json index 48f3c9d7..d6ad9ef8 100644 --- a/app/base/package.json +++ b/app/base/package.json @@ -5,7 +5,7 @@ "description": "TanStack Base — a self-hosted coffee-shop database appliance.", "scripts": { "dev": "vite dev --port 3000", - "build": "vite build", + "build": "vite build && node ../../scripts/copy-pglite-assets.mjs", "serve": "vite preview", "start": "node .output/server/index.mjs", "test:types": "tsc --noEmit", diff --git a/app/prm/package.json b/app/prm/package.json index 9981aec5..9c5dcd7b 100644 --- a/app/prm/package.json +++ b/app/prm/package.json @@ -8,7 +8,7 @@ }, "scripts": { "dev": "vite dev --port 3024", - "build": "vite build", + "build": "vite build && node ../../scripts/copy-pglite-assets.mjs", "serve": "vite preview", "start": "node .output/server/index.mjs", "prm": "tsx bin/prm.ts", diff --git a/examples/picks/package.json b/examples/picks/package.json index f8b0167a..25e9db52 100644 --- a/examples/picks/package.json +++ b/examples/picks/package.json @@ -5,7 +5,7 @@ "description": "Faceted guitar-pick search with TanStack Search and the CMS SQLite adapter.", "scripts": { "dev": "vite dev --port 3023", - "build": "vite build", + "build": "vite build && node ../../scripts/copy-pglite-assets.mjs", "test:build": "node ../../scripts/smoke-ssr.mjs", "serve": "vite preview", "start": "node .output/server/index.mjs", From be748115a5b3c905cecc6cc9fa60cdb7c8016157 Mon Sep 17 00:00:00 2001 From: Jack Herrington Date: Mon, 30 Nov 2026 13:00:03 -0800 Subject: [PATCH 3/4] fix(store-postgres): raise embedded PGlite connection-acquisition timeout to 30s MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PGlite is a single in-process connection served FIFO, so a cold WASM/initdb start or a concurrent holder (an open SSE stream, the cron snapshot worker, a request transaction) can make the next checkout wait several seconds. The server's 5s acquire cap then turned that normal contention into spurious "CMS Postgres connection acquisition timed out" failures under load. This surfaced once the vitest testTimeout bump let integration suites run past 5s: ui-react s2-blog-propagation and several starter seam tests then failed at ~5.3–5.9s (exactly the acquire cap, not a hang), and the Base Docker E2E's SSE step timed out because the dispatcher couldn't acquire a client to deliver the save event while the scheduled worker held it. Default the embedded engine to a 30s acquire window (server/networked Postgres is unchanged at 5s); callers can still override via PgliteStorageOptions. Co-Authored-By: Claude Opus 4.8 (1M context) --- packages/store-postgres/src/pglite.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/store-postgres/src/pglite.ts b/packages/store-postgres/src/pglite.ts index 6a3a48c0..27fa5de9 100644 --- a/packages/store-postgres/src/pglite.ts +++ b/packages/store-postgres/src/pglite.ts @@ -18,6 +18,15 @@ export interface PgliteStorageOptions { dataDir?: string /** Table/function name prefix, to share one database across CMS instances. */ prefix?: string + /** + * How long a client checkout may wait before failing. Defaults to 30s for the + * embedded engine (vs the server default of 5s): PGlite is a single in-process + * connection served FIFO, so a cold WASM/initdb start or a concurrent holder + * (SSE stream, scheduled snapshot worker, a request transaction) can legitimately + * make the next waiter wait several seconds — a 5s cap turns that contention into + * spurious "acquisition timed out" failures under load. + */ + acquisitionTimeoutMs?: number } /** @@ -116,6 +125,7 @@ export function createPgliteStorage( return createPostgresStorage({ pool, migrationPool: pool, + acquisitionTimeoutMs: options.acquisitionTimeoutMs ?? 30_000, ...(options.prefix ? { prefix: options.prefix } : {}), }) } From 7a0dd0285e620fd3be96077ff37940a8a86fb5b8 Mon Sep 17 00:00:00 2001 From: Jack Herrington Date: Mon, 30 Nov 2026 14:32:22 -0800 Subject: [PATCH 4/4] chore(ci): clear pre-existing latent lint/knip/timeout debt exposed by the stabilization diff MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Widening nx's "affected" set surfaced dormant failures unrelated to the fixes — they only run when a project is pulled in, which main rarely does: - store-postgres oxlint: two `as unknown as` casts bridging PGlite's result shapes to the engine row type — scoped oxlint-disable with reasons. - cms-api oxlint: a non-null assertion in runAgent that the guard above already proves safe — scoped oxlint-disable with the invariant spelled out. - knip: ignore the kody/ spike (unused-by-design) and @electric-sql/pglite, which copy-pglite-assets.mjs resolves from each app's deps, not the root. - vitest: raise testTimeout to 20s across every remaining package config (cms-client's coverage run timed out at 5s; others are at risk under load). A ceiling, never a delay. - smoke-docker: raise the request and SSE-read tolerances from 10s to 30s; the embedded single-client PGlite engine legitimately lags under the cron snapshot worker's concurrent load. Verified locally: store-postgres/cms-api oxlint and knip exit 0; cms-client coverage 37/37 with thresholds met; cms-api type-checks. Co-Authored-By: Claude Opus 4.8 (1M context) --- app/base/scripts/smoke-docker.mjs | 14 +++++++++++--- app/docs-preview/vitest.config.ts | 1 + knip.json | 9 +++++++-- packages/api/src/ops.ts | 4 +++- packages/client/vitest.config.ts | 1 + packages/cms-compat-wp/vitest.config.ts | 1 + packages/cms-connect-atproto/vitest.config.ts | 1 + packages/cms-migrate-wp/vitest.config.ts | 1 + packages/cms-skills/vitest.config.ts | 1 + packages/media-s3/vitest.config.ts | 1 + packages/search-ai/vitest.config.ts | 1 + packages/search-core/vitest.config.ts | 1 + packages/search-headless/vitest.config.ts | 1 + packages/search-ui-react/vitest.config.ts | 1 + packages/store-postgres/src/pglite.ts | 2 ++ packages/store-postgres/vitest.config.ts | 1 + packages/ui-dom/vitest.config.ts | 1 + 17 files changed, 36 insertions(+), 6 deletions(-) diff --git a/app/base/scripts/smoke-docker.mjs b/app/base/scripts/smoke-docker.mjs index ee150bbe..f3264880 100644 --- a/app/base/scripts/smoke-docker.mjs +++ b/app/base/scripts/smoke-docker.mjs @@ -52,7 +52,10 @@ async function request(path, data, credential = cookie) { ...(credential ? { Cookie: credential } : {}), }, body: data === undefined ? undefined : JSON.stringify(data), - signal: AbortSignal.timeout(10000), + // 30s, not 10s: the embedded PGlite engine serves one client at a time, so + // under the cron snapshot worker's load a request can wait several seconds + // for the connection before its own work even starts. + signal: AbortSignal.timeout(30000), }) return response } @@ -343,7 +346,10 @@ try { method: 'tools/call', params: { name: 'list_collections', arguments: {} }, }), - signal: AbortSignal.timeout(10000), + // 30s, not 10s: the embedded PGlite engine serves one client at a time, so + // under the cron snapshot worker's load a request can wait several seconds + // for the connection before its own work even starts. + signal: AbortSignal.timeout(30000), }) assert.equal(mcp.status, 200) const mcpText = await mcp.text() @@ -489,7 +495,9 @@ try { const decoder = new TextDecoder() let frames = '' const readUntil = async (predicate) => { - const timedAbort = setTimeout(() => abort.abort(), 10000) + // 30s: event delivery can lag when the single PGlite client is briefly held + // by the concurrent cron snapshot worker. + const timedAbort = setTimeout(() => abort.abort(), 30000) try { while (!predicate(frames)) { const frame = await reader.read() diff --git a/app/docs-preview/vitest.config.ts b/app/docs-preview/vitest.config.ts index 98edca39..861d4829 100644 --- a/app/docs-preview/vitest.config.ts +++ b/app/docs-preview/vitest.config.ts @@ -4,6 +4,7 @@ import { defineConfig } from 'vitest/config' // (TanStack Start, Nitro) from vite.config.ts. export default defineConfig({ test: { + testTimeout: 20_000, environment: 'node', include: ['src/**/*.test.ts', 'tests/**/*.test.ts'], }, diff --git a/knip.json b/knip.json index 40d2b00c..81f857cb 100644 --- a/knip.json +++ b/knip.json @@ -3,13 +3,18 @@ "rules": { "duplicates": "off" }, - "ignoreDependencies": ["sharp", "@tanstack/router-core"], + "ignoreDependencies": [ + "sharp", + "@tanstack/router-core", + "@electric-sql/pglite" + ], "ignoreWorkspaces": ["examples/**", "starters/**"], "ignore": [ "kiira.config.ts", ".claude/skills/**", "scripts/codemods/__fixtures__/**", - "scripts/__fixtures__/**" + "scripts/__fixtures__/**", + "kody/**" ], "ignoreExportsUsedInFile": true, "workspaces": { diff --git a/packages/api/src/ops.ts b/packages/api/src/ops.ts index ef8ad9cf..fafc38d2 100644 --- a/packages/api/src/ops.ts +++ b/packages/api/src/ops.ts @@ -2058,7 +2058,9 @@ export async function runAgent( } const session = options?.access?.session ?? options?.session const access = - options?.access ?? accessContext({ session: session!, mode: 'edit' }) + options?.access ?? + // oxlint-disable-next-line typescript/no-non-null-assertion -- this branch runs only when options.access is absent, and the guard above then guarantees options.session (so `session`) is present. + accessContext({ session: session!, mode: 'edit' }) const actor = (name ? getCmsConfig().ai?.agents?.[name]?.actor : undefined) ?? name ?? diff --git a/packages/client/vitest.config.ts b/packages/client/vitest.config.ts index d88b614a..b613aef6 100644 --- a/packages/client/vitest.config.ts +++ b/packages/client/vitest.config.ts @@ -3,6 +3,7 @@ import packageJson from './package.json' with { type: 'json' } export default defineConfig({ test: { + testTimeout: 20_000, name: packageJson.name, dir: './', watch: false, diff --git a/packages/cms-compat-wp/vitest.config.ts b/packages/cms-compat-wp/vitest.config.ts index 5ce2c264..19f18214 100644 --- a/packages/cms-compat-wp/vitest.config.ts +++ b/packages/cms-compat-wp/vitest.config.ts @@ -3,6 +3,7 @@ import packageJson from './package.json' with { type: 'json' } export default defineConfig({ test: { + testTimeout: 20_000, name: packageJson.name, dir: './', watch: false, diff --git a/packages/cms-connect-atproto/vitest.config.ts b/packages/cms-connect-atproto/vitest.config.ts index 5ce2c264..19f18214 100644 --- a/packages/cms-connect-atproto/vitest.config.ts +++ b/packages/cms-connect-atproto/vitest.config.ts @@ -3,6 +3,7 @@ import packageJson from './package.json' with { type: 'json' } export default defineConfig({ test: { + testTimeout: 20_000, name: packageJson.name, dir: './', watch: false, diff --git a/packages/cms-migrate-wp/vitest.config.ts b/packages/cms-migrate-wp/vitest.config.ts index 5ce2c264..19f18214 100644 --- a/packages/cms-migrate-wp/vitest.config.ts +++ b/packages/cms-migrate-wp/vitest.config.ts @@ -3,6 +3,7 @@ import packageJson from './package.json' with { type: 'json' } export default defineConfig({ test: { + testTimeout: 20_000, name: packageJson.name, dir: './', watch: false, diff --git a/packages/cms-skills/vitest.config.ts b/packages/cms-skills/vitest.config.ts index 5ce2c264..19f18214 100644 --- a/packages/cms-skills/vitest.config.ts +++ b/packages/cms-skills/vitest.config.ts @@ -3,6 +3,7 @@ import packageJson from './package.json' with { type: 'json' } export default defineConfig({ test: { + testTimeout: 20_000, name: packageJson.name, dir: './', watch: false, diff --git a/packages/media-s3/vitest.config.ts b/packages/media-s3/vitest.config.ts index 3487e232..5e4c8017 100644 --- a/packages/media-s3/vitest.config.ts +++ b/packages/media-s3/vitest.config.ts @@ -3,6 +3,7 @@ import packageJson from './package.json' with { type: 'json' } export default defineConfig({ test: { + testTimeout: 20_000, name: packageJson.name, dir: './', watch: false, diff --git a/packages/search-ai/vitest.config.ts b/packages/search-ai/vitest.config.ts index 59de50df..5bd1392d 100644 --- a/packages/search-ai/vitest.config.ts +++ b/packages/search-ai/vitest.config.ts @@ -3,6 +3,7 @@ import packageJson from './package.json' with { type: 'json' } export default defineConfig({ test: { + testTimeout: 20_000, name: packageJson.name, environment: 'node', include: ['tests/**/*.test.{ts,tsx}'], diff --git a/packages/search-core/vitest.config.ts b/packages/search-core/vitest.config.ts index 59de50df..5bd1392d 100644 --- a/packages/search-core/vitest.config.ts +++ b/packages/search-core/vitest.config.ts @@ -3,6 +3,7 @@ import packageJson from './package.json' with { type: 'json' } export default defineConfig({ test: { + testTimeout: 20_000, name: packageJson.name, environment: 'node', include: ['tests/**/*.test.{ts,tsx}'], diff --git a/packages/search-headless/vitest.config.ts b/packages/search-headless/vitest.config.ts index 59de50df..5bd1392d 100644 --- a/packages/search-headless/vitest.config.ts +++ b/packages/search-headless/vitest.config.ts @@ -3,6 +3,7 @@ import packageJson from './package.json' with { type: 'json' } export default defineConfig({ test: { + testTimeout: 20_000, name: packageJson.name, environment: 'node', include: ['tests/**/*.test.{ts,tsx}'], diff --git a/packages/search-ui-react/vitest.config.ts b/packages/search-ui-react/vitest.config.ts index 8d04db35..c836e9da 100644 --- a/packages/search-ui-react/vitest.config.ts +++ b/packages/search-ui-react/vitest.config.ts @@ -3,6 +3,7 @@ import packageJson from './package.json' with { type: 'json' } export default defineConfig({ test: { + testTimeout: 20_000, name: packageJson.name, environment: 'happy-dom', include: ['tests/**/*.test.{ts,tsx}'], diff --git a/packages/store-postgres/src/pglite.ts b/packages/store-postgres/src/pglite.ts index 27fa5de9..e8f668e7 100644 --- a/packages/store-postgres/src/pglite.ts +++ b/packages/store-postgres/src/pglite.ts @@ -82,11 +82,13 @@ export function createPglitePool( // "cannot insert multiple commands into a prepared statement". if (!values || values.length === 0) { const results = await instance.exec(sql) + // oxlint-disable-next-line eslint-js/no-restricted-syntax -- PGlite's exec() returns its own Results[] shape with no structural overlap with R; narrow to the engine's row type. const last = results[results.length - 1] as unknown as | { rows?: Array; command?: string } | undefined return { rows: last?.rows ?? [], command: last?.command } } + // oxlint-disable-next-line eslint-js/no-restricted-syntax -- PGlite's query() result type doesn't structurally overlap with R; narrow to the engine's row type. const result = (await instance.query( sql, values as Array, diff --git a/packages/store-postgres/vitest.config.ts b/packages/store-postgres/vitest.config.ts index 77d9a3ef..6a764cf5 100644 --- a/packages/store-postgres/vitest.config.ts +++ b/packages/store-postgres/vitest.config.ts @@ -3,6 +3,7 @@ import packageJson from './package.json' with { type: 'json' } export default defineConfig({ test: { + testTimeout: 20_000, name: packageJson.name, dir: './', watch: false, diff --git a/packages/ui-dom/vitest.config.ts b/packages/ui-dom/vitest.config.ts index 369f0fd2..9b7496cb 100644 --- a/packages/ui-dom/vitest.config.ts +++ b/packages/ui-dom/vitest.config.ts @@ -3,6 +3,7 @@ import packageJson from './package.json' with { type: 'json' } export default defineConfig({ test: { + testTimeout: 20_000, name: packageJson.name, dir: './', watch: false,