feat: optional Jest/Vitest TEMPLATE mode adapters - #14
Merged
Conversation
simoncrypta
force-pushed
the
feat/jest-vitest-template-mode
branch
from
August 3, 2026 14:41
9a226fb to
e5810a9
Compare
simoncrypta
marked this pull request as draft
August 3, 2026 15:27
simoncrypta
force-pushed
the
feat/jest-vitest-template-mode
branch
from
August 3, 2026 22:50
e5810a9 to
3e5e092
Compare
simoncrypta
marked this pull request as ready for review
August 4, 2026 16:02
simoncrypta
force-pushed
the
feat/jest-vitest-template-mode
branch
2 times, most recently
from
August 4, 2026 16:21
1664237 to
f14db35
Compare
simoncrypta
disabled the stack merge
August 4, 2026 16:37
simoncrypta
disabled the stack merge
August 4, 2026 16:45
simoncrypta
force-pushed
the
feat/jest-vitest-template-mode
branch
from
August 5, 2026 03:13
f14db35 to
662e8c9
Compare
Orchestrate ensure → app migrate → markTemplate → per-worker clone so stock ensure/dispose adapters are not mistaken for migrate-once isolation.
Make setupTemplateMode always migrate+mark, fail default hooks without CEDAR_PG_MIGRATE, and drop barrel re-exports that duplicated the API.
Inline Jest createGlobalSetup and make CEDAR_PG_MIGRATE loading require-only so the shared module is orchestration only.
Pack emits CJS+ESM; top-level await broke smoke. Match the Jest pattern with a tiny app setupFiles file that awaits ensureWorkerDatabase.
Unify skip/env injection, drop duplicate Jest teardown export, and tighten markTemplate/dispose contracts for role-scoped TEMPLATE teardown.
Keep migrate+markTemplate all-or-nothing after ensure, move worker skip policy into cloneFromTemplateIfNeeded, and collapse template worker package entries into the jest/vitest template adapters.
Unify cloneFromTemplateIfNeeded setEnv defaults with ensureIfNeeded and keep lease lifecycle free of the TEMPLATE protocol.
simoncrypta
force-pushed
the
feat/jest-vitest-template-mode
branch
from
August 5, 2026 03:15
662e8c9 to
eb95e07
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@cedarjs/pg/jest/templateand@cedarjs/pg/vitest/templateadapters that orchestrate ensure → app migrate →markTemplate→ per-workercloneFromTemplate→ dispose.CEDAR_PG_MIGRATEorcreateGlobalSetup({ migrate }); stock@cedarjs/pg/jest/vitestremain single shared test DB.Fixes #8
Test plan
pnpm checkpnpm test(includestests/template-mode.test.ts)vp run smoke(pack dual CJS/ESM exports)feat/test-template-clone-api