Files
suaveplan/openspec/archive/2026-05-02-testing-integration-vite-entry-fix/tasks.md
2026-05-27 23:29:53 +01:00

3.6 KiB

Tasks — testing-integration-vite-entry-fix

1. Patch the six broken vite configs

For each package, add output.entryFileNames: "[name].js" to build.rollupOptions.output. The block already contains preserveModules: true and preserveModulesRoot: "src"; only the new line is added. Then rebuild and verify dist/index.js exists.

  • 1.1 packages/dev/testing-integration-mailpit/vite.config.ts
  • 1.2 packages/dev/testing-integration-postgres/vite.config.ts
  • 1.3 packages/dev/testing-integration-redis/vite.config.ts
  • 1.4 packages/dev/testing-integration-step-ca/vite.config.ts
  • 1.5 packages/dev/testing-integration-surrealdb/vite.config.ts
  • 1.6 packages/dev/testing-integration-typesense/vite.config.ts
  • 1.7 Run bunx turbo build --filter=@suaveplan/testing-integration-* and verify dist/index.js is present in all six.

2. Repo-level resolve smoke test

  • 2.1 Create scripts/check-fixture-resolves.ts — for each of the seven testing-integration-* package names, dynamic-import() the package; collect failures; exit non-zero if any failed; print a summary table.
  • 2.2 Add the script invocation to the root package.json as "check:fixture-resolves": "bun scripts/check-fixture-resolves.ts".
  • 2.3 Add a check:fixture-resolves task to turbo.json with dependsOn: ["^build"], cache: false, outputs: [].

3. Verify each fixture's own unit suite still passes

Coverage and behavioural tests of the fixtures themselves rely on relative imports inside src/ and should be unaffected. Re-run them as a regression check.

  • 3.1 bunx turbo test:coverage --filter=@suaveplan/testing-integration-mailpit
  • 3.2 bunx turbo test:coverage --filter=@suaveplan/testing-integration-postgres
  • 3.3 bunx turbo test:coverage --filter=@suaveplan/testing-integration-redis
  • 3.4 bunx turbo test:coverage --filter=@suaveplan/testing-integration-step-ca
  • 3.5 bunx turbo test:coverage --filter=@suaveplan/testing-integration-surrealdb
  • 3.6 bunx turbo test:coverage --filter=@suaveplan/testing-integration-typesense

4. Cross-package resolve from a real consumer

  • 4.1 In packages/database/surrealdb (already wired with the surrealdb-integration-tests scaffolding), run bunx turbo typecheck --filter=@suaveplan/surrealdb — must stay green.
  • 4.2 In packages/database/surrealdb, attempt bun run test:integration with docker down. The expectation here is NOT a green pass; it is that the runner reaches the global-setup phase rather than failing on Failed to resolve entry for package. (Subsequent skip-when-unavailable behaviour is owned by the surrealdb-integration-tests change, not this one.)

5. CI integration

  • 5.1 Add bun run check:fixture-resolves as an early step in CI, before any integration suite invocation. Failure exits the job with a clear message naming the offending package.

6. Documentation

  • 6.1 Add a short paragraph to docker/README.md (or packages/dev/testing-integration/README.md) noting that adding a new testing-integration-<service> package requires output.entryFileNames: "[name].js" in its vite.config.ts. Cross-reference the resolve check.

7. OpenSpec gate

  • 7.1 Run openspec validate testing-integration-vite-entry-fix --strict; resolve any errors.
  • 7.2 On ship: fold each MODIFIED Requirements delta into openspec/specs/testing-integration-<name>/spec.md, fold the new testing-integration-resolve-check spec into openspec/specs/testing-integration-resolve-check/spec.md, and move the change folder to openspec/archive/<yyyy-mm-dd>-testing-integration-vite-entry-fix/.