@happyvertical/smrt-vitest 0.43.5 → 0.43.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +22 -0
- package/README.md +1 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/test-db.d.ts +3 -0
- package/dist/test-db.d.ts.map +1 -1
- package/dist/test-db.js +247 -46
- package/dist/test-db.js.map +1 -1
- package/package.json +3 -3
package/AGENTS.md
CHANGED
|
@@ -88,6 +88,28 @@ string is a CREATE TABLE preview and is merged in only for a table whose
|
|
|
88
88
|
contributors expose no `columns` (hand-authored manifests). Do not add a
|
|
89
89
|
private DDL/index renderer here; extend the core strategy instead.
|
|
90
90
|
|
|
91
|
+
When `includeObjects` names an object that is not in the package-local manifest,
|
|
92
|
+
the helper resolves that explicitly requested object from dependency manifests
|
|
93
|
+
already registered by `smrtVitestPlugin()`. It does not materialize every
|
|
94
|
+
registered dependency implicitly. PostgreSQL serializes schema preparation with
|
|
95
|
+
a transaction-scoped advisory lock, executes the core renderer's ordered,
|
|
96
|
+
constraint-free `CREATE TABLE IF NOT EXISTS` statements exactly, reconciles
|
|
97
|
+
structured missing columns through the core `SchemaManager`, and executes core
|
|
98
|
+
index statements directly. This preserves valid delimited identifiers that the
|
|
99
|
+
generic SQL synchronizer cannot parse. It then applies every physical foreign
|
|
100
|
+
key through `SchemaManager.ensurePostgresForeignKey()` after all tables exist,
|
|
101
|
+
so existing rows receive the canonical exact orphan preflight before an absent
|
|
102
|
+
constraint is added `NOT VALID` and explicitly validated. Renderer-owned named
|
|
103
|
+
constraints and structured manifest DDL must never be fed back through the
|
|
104
|
+
generic SQL schema parser.
|
|
105
|
+
SQLite keeps its existing schema-template and synchronizer path.
|
|
106
|
+
|
|
107
|
+
The package's PostgreSQL integration lane reads the built commerce and
|
|
108
|
+
marketing manifests as multi-package fixtures. Its package-specific Turbo task
|
|
109
|
+
therefore builds both fixture packages explicitly; do not rely on pre-existing
|
|
110
|
+
`dist/manifest.json` files in a developer worktree or add dependency cycles to
|
|
111
|
+
`@happyvertical/smrt-vitest`.
|
|
112
|
+
|
|
91
113
|
On PostgreSQL, the isolated factories provision the canonical change-feed
|
|
92
114
|
table and `_smrt_append_change` helper on the base connection before opening
|
|
93
115
|
the test transaction. Transaction handles are treated as already initialized
|
package/README.md
CHANGED
|
@@ -96,7 +96,7 @@ The manifest is generated once at vitest startup. Restart vitest after adding ne
|
|
|
96
96
|
|
|
97
97
|
| Export | Description |
|
|
98
98
|
|--------|-------------|
|
|
99
|
-
| `createIsolatedTestDbFromManifest(options?)` | Create DB from manifest with FK ordering and STI dedup (recommended) |
|
|
99
|
+
| `createIsolatedTestDbFromManifest(options?)` | Create DB from local + explicitly requested registered dependency manifest objects, with FK ordering and STI dedup (recommended) |
|
|
100
100
|
| `createIsolatedTestDb(options?)` | Create DB with raw DDL schema and transaction isolation |
|
|
101
101
|
| `createTestDb(prefix?)` | Create DB with cleanup function (no transaction isolation) |
|
|
102
102
|
| `getTestDbConfig(prefix?)` | Get DB config for current environment |
|