Skip to content

docs(skills): run the CI dev server in production mode - #28

Merged
kevinccbsg merged 1 commit into
mainfrom
docs/ci-production-mode
Oct 19, 2026
Merged

kevinccbsg merged 1 commit into
mainfrom
docs/ci-production-mode

Conversation

@kevinccbsg

Copy link
Copy Markdown
Member

Summary

TWD runs against the dev server. In CI, starting it with NODE_ENV=production makes Vite serve the framework's production build (for React: no StrictMode double render, no dev-only checks). On a 322-test React app: 258s → 133s, same coverage.

Local development and the AI flow (agent ↔ twd-relay / twd-cli on npm run dev) are unchanged. This only touches what /twd:ci-setup generates.

Changes

  • dev:ci for every Vite project: NODE_ENV=production vite, or CI=true NODE_ENV=production vite with coverage. It copies any flags from dev. The test, custom and recording workflows start the server with it.
  • istanbul: the snippet adds checkProd: false, so coverage stays on in production mode. The plugin still applies only to vite serve, so vite build never instruments. The skill forbids forceBuildInstrument: true, which instruments vite build too, and offers to replace it if a project already has it.
  • Guard: in production mode import.meta.env.DEV is false, even on vite serve. The twd() plugin (apply: 'serve') still loads, but an initTWD( block behind import.meta.env.DEV does not. The skill now detects that case, skips production mode, and suggests /twd:setup.
  • Next steps: the summary tells the user to run dev:ci + test:ci locally once.
  • README bullet. Plugin version bumped to 1.3.6.

- ci-setup: add dev:ci (NODE_ENV=production vite) for every Vite project and start the workflows with it
- ci-setup: istanbul gets checkProd: false so coverage stays on there; never forceBuildInstrument, which instruments vite build
- ci-setup: skip production mode when TWD loads from an initTWD block behind import.meta.env.DEV
- bump plugin to 1.3.6
@kevinccbsg
kevinccbsg merged commit 3a31541 into main Oct 19, 2026
1 check passed
@kevinccbsg
kevinccbsg deleted the docs/ci-production-mode branch October 19, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant