@prisma-next/cli 0.16.0-dev.20 → 0.16.0-dev.22
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/README.md +13 -13
- package/dist/cli.mjs +11 -11
- package/dist/{client-DeJvLD2h.mjs → client-CMusjGV5.mjs} +23 -23
- package/dist/client-CMusjGV5.mjs.map +1 -0
- package/dist/command-helpers-CVn3U9Uz.mjs.map +1 -1
- package/dist/commands/contract-emit.mjs +1 -1
- package/dist/commands/contract-infer.mjs +1 -1
- package/dist/commands/db-init.mjs +2 -2
- package/dist/commands/db-schema.mjs +1 -1
- package/dist/commands/db-sign.mjs +3 -3
- package/dist/commands/db-sign.mjs.map +1 -1
- package/dist/commands/db-update.mjs +3 -3
- package/dist/commands/db-verify.mjs +1 -1
- package/dist/commands/migrate.d.mts +1 -1
- package/dist/commands/migrate.mjs +7 -7
- package/dist/commands/migrate.mjs.map +1 -1
- package/dist/commands/migration-check.d.mts +1 -1
- package/dist/commands/migration-check.mjs +1 -1
- package/dist/commands/migration-graph.d.mts +1 -1
- package/dist/commands/migration-graph.mjs +2 -2
- package/dist/commands/migration-list.d.mts +1 -1
- package/dist/commands/migration-list.mjs +1 -1
- package/dist/commands/migration-log.d.mts +1 -1
- package/dist/commands/migration-log.mjs +1 -1
- package/dist/commands/migration-new.mjs +3 -3
- package/dist/commands/migration-new.mjs.map +1 -1
- package/dist/commands/migration-plan.mjs +1 -1
- package/dist/commands/migration-show.mjs +2 -2
- package/dist/commands/migration-show.mjs.map +1 -1
- package/dist/commands/migration-status.d.mts +1 -1
- package/dist/commands/migration-status.mjs +1 -1
- package/dist/commands/ref.d.mts +1 -1
- package/dist/commands/ref.mjs +1 -1
- package/dist/{contract-emit-DJ8SRI7L.mjs → contract-emit-CfIbTnsR.mjs} +5 -5
- package/dist/{contract-emit-DJ8SRI7L.mjs.map → contract-emit-CfIbTnsR.mjs.map} +1 -1
- package/dist/{contract-emit-BMJiefhy.mjs → contract-emit-PaY3qRdN.mjs} +2 -2
- package/dist/{contract-emit-BMJiefhy.mjs.map → contract-emit-PaY3qRdN.mjs.map} +1 -1
- package/dist/{contract-enrichment-gn9sWbPw.mjs → contract-enrichment-JUhLv-BX.mjs} +8 -8
- package/dist/{contract-enrichment-gn9sWbPw.mjs.map → contract-enrichment-JUhLv-BX.mjs.map} +1 -1
- package/dist/{contract-infer-_tstfy3k.mjs → contract-infer-DCju2fTk.mjs} +2 -2
- package/dist/{contract-infer-_tstfy3k.mjs.map → contract-infer-DCju2fTk.mjs.map} +1 -1
- package/dist/{contract-space-aggregate-loader-hPVymNLw.mjs → contract-space-aggregate-loader-B6E9LGa6.mjs} +13 -13
- package/dist/contract-space-aggregate-loader-B6E9LGa6.mjs.map +1 -0
- package/dist/{db-verify-3WM8y323.mjs → db-verify-B_dKu6Yp.mjs} +3 -3
- package/dist/db-verify-B_dKu6Yp.mjs.map +1 -0
- package/dist/exports/control-api.d.mts +4 -4
- package/dist/exports/control-api.d.mts.map +1 -1
- package/dist/exports/control-api.mjs +3 -3
- package/dist/exports/index.mjs +2 -2
- package/dist/{format-CFLZv_zU.mjs → format-cCyDfmRE.mjs} +3 -3
- package/dist/format-cCyDfmRE.mjs.map +1 -0
- package/dist/{framework-components-VMQJbAwl.mjs → framework-components-DUN-TYDg.mjs} +2 -2
- package/dist/framework-components-DUN-TYDg.mjs.map +1 -0
- package/dist/{init-XycYREvA.mjs → init-C9U3ffHH.mjs} +2 -2
- package/dist/{init-XycYREvA.mjs.map → init-C9U3ffHH.mjs.map} +1 -1
- package/dist/{inspect-live-schema-xS6VqjHE.mjs → inspect-live-schema-DHXE7skX.mjs} +3 -3
- package/dist/{inspect-live-schema-xS6VqjHE.mjs.map → inspect-live-schema-DHXE7skX.mjs.map} +1 -1
- package/dist/{migration-check-C_4gozCn.mjs → migration-check-W5XEx4d-.mjs} +6 -6
- package/dist/migration-check-W5XEx4d-.mjs.map +1 -0
- package/dist/{migration-command-scaffold-D9JkLq_M.mjs → migration-command-scaffold-hI5cnoGe.mjs} +3 -3
- package/dist/{migration-command-scaffold-D9JkLq_M.mjs.map → migration-command-scaffold-hI5cnoGe.mjs.map} +1 -1
- package/dist/{migration-list-BwEwRv25.mjs → migration-list-ClkEaoL8.mjs} +2 -2
- package/dist/{migration-list-BwEwRv25.mjs.map → migration-list-ClkEaoL8.mjs.map} +1 -1
- package/dist/{migration-log-C3RMIsUI.mjs → migration-log-CjafbZ2Z.mjs} +3 -3
- package/dist/{migration-log-C3RMIsUI.mjs.map → migration-log-CjafbZ2Z.mjs.map} +1 -1
- package/dist/{migration-plan-BzxmK_do.mjs → migration-plan-Pc4hCF1H.mjs} +9 -9
- package/dist/migration-plan-Pc4hCF1H.mjs.map +1 -0
- package/dist/{migration-status-ChQKA6Jf.mjs → migration-status-CqAdRzs8.mjs} +5 -5
- package/dist/migration-status-CqAdRzs8.mjs.map +1 -0
- package/dist/{types-D4r_HI9-.d.mts → types-DgXprE3w.d.mts} +3 -3
- package/dist/types-DgXprE3w.d.mts.map +1 -0
- package/package.json +21 -21
- package/src/commands/db-sign.ts +1 -1
- package/src/commands/db-verify.ts +1 -1
- package/src/commands/format.ts +1 -1
- package/src/commands/inspect-live-schema.ts +1 -1
- package/src/commands/migrate.ts +4 -4
- package/src/commands/migration-check.ts +1 -1
- package/src/commands/migration-log.ts +1 -1
- package/src/commands/migration-new.ts +1 -1
- package/src/commands/migration-plan.ts +5 -5
- package/src/commands/migration-show.ts +1 -1
- package/src/commands/migration-status.ts +1 -1
- package/src/control-api/client.ts +7 -7
- package/src/control-api/contract-enrichment.ts +7 -7
- package/src/control-api/operations/contract-emit.ts +2 -2
- package/src/control-api/operations/db-init.ts +3 -3
- package/src/control-api/operations/db-run.ts +6 -6
- package/src/control-api/operations/db-update.ts +2 -2
- package/src/control-api/operations/db-verify.ts +4 -4
- package/src/control-api/operations/format.ts +1 -1
- package/src/control-api/operations/migrate.ts +3 -3
- package/src/control-api/types.ts +1 -1
- package/src/utils/cli-errors.ts +2 -2
- package/src/utils/contract-space-aggregate-loader.ts +8 -8
- package/src/utils/contract-space-seed-phase.ts +3 -3
- package/src/utils/extension-pack-inputs.ts +8 -8
- package/src/utils/framework-components.ts +9 -9
- package/src/utils/integrity-violation-to-check-failure.ts +3 -3
- package/src/utils/migration-command-scaffold.ts +1 -1
- package/dist/client-DeJvLD2h.mjs.map +0 -1
- package/dist/contract-space-aggregate-loader-hPVymNLw.mjs.map +0 -1
- package/dist/db-verify-3WM8y323.mjs.map +0 -1
- package/dist/format-CFLZv_zU.mjs.map +0 -1
- package/dist/framework-components-VMQJbAwl.mjs.map +0 -1
- package/dist/migration-check-C_4gozCn.mjs.map +0 -1
- package/dist/migration-plan-BzxmK_do.mjs.map +0 -1
- package/dist/migration-status-ChQKA6Jf.mjs.map +0 -1
- package/dist/types-D4r_HI9-.d.mts.map +0 -1
package/README.md
CHANGED
|
@@ -52,7 +52,7 @@ Commands that enforce wiring validation:
|
|
|
52
52
|
- **`db init`**
|
|
53
53
|
- **`db update`**
|
|
54
54
|
|
|
55
|
-
If you hit a wiring validation error: add the required descriptors to `config.
|
|
55
|
+
If you hit a wiring validation error: add the required descriptors to `config.extensions` (matched by descriptor `id`) and re-run the command.
|
|
56
56
|
|
|
57
57
|
**Note**: Control plane domain actions (database verification, contract emission) are implemented in `@prisma-next/emitter` and `@prisma-next/framework-components/control`. The CLI uses the control plane domain actions programmatically but does not define control plane types itself.
|
|
58
58
|
|
|
@@ -92,7 +92,7 @@ export default defineConfig({
|
|
|
92
92
|
family: sql,
|
|
93
93
|
target: postgres,
|
|
94
94
|
adapter: postgresAdapter,
|
|
95
|
-
|
|
95
|
+
extensions: [],
|
|
96
96
|
contract: typescriptContract(contract, 'src/prisma/contract.json'),
|
|
97
97
|
});
|
|
98
98
|
```
|
|
@@ -181,7 +181,7 @@ export default defineConfig({
|
|
|
181
181
|
target: postgres,
|
|
182
182
|
adapter: postgresAdapter,
|
|
183
183
|
driver: postgresDriver,
|
|
184
|
-
|
|
184
|
+
extensions: [],
|
|
185
185
|
contract: typescriptContract(contract, 'src/prisma/contract.json'),
|
|
186
186
|
db: {
|
|
187
187
|
connection: process.env.DATABASE_URL, // Optional: can also use --db flag
|
|
@@ -297,7 +297,7 @@ interface ControlStack<TFamilyId, TTargetId> {
|
|
|
297
297
|
readonly target: ControlTargetDescriptor<TFamilyId, TTargetId>;
|
|
298
298
|
readonly adapter: ControlAdapterDescriptor<TFamilyId, TTargetId>;
|
|
299
299
|
readonly driver: ControlDriverDescriptor<TFamilyId, TTargetId> | undefined;
|
|
300
|
-
readonly
|
|
300
|
+
readonly extensions: readonly ControlExtensionDescriptor<TFamilyId, TTargetId>[];
|
|
301
301
|
}
|
|
302
302
|
|
|
303
303
|
interface ControlFamilyInstance {
|
|
@@ -311,7 +311,7 @@ interface ControlFamilyInstance {
|
|
|
311
311
|
}
|
|
312
312
|
```
|
|
313
313
|
|
|
314
|
-
Use `createControlStack()` from `@prisma-next/framework-components/control` to create the stack with sensible defaults (`driver` defaults to `undefined`, `
|
|
314
|
+
Use `createControlStack()` from `@prisma-next/framework-components/control` to create the stack with sensible defaults (`driver` defaults to `undefined`, `extensions` defaults to `[]`).
|
|
315
315
|
|
|
316
316
|
The SQL family provides this via `@prisma-next/family-sql/control`. The `verify()` method handles marker checks, full `db verify` follows it with `schemaVerify()`, `--marker-only` skips that schema step, and `--schema-only` runs `schemaVerify()` without marker checks.
|
|
317
317
|
|
|
@@ -404,7 +404,7 @@ export default defineConfig({
|
|
|
404
404
|
target: postgres,
|
|
405
405
|
adapter: postgresAdapter,
|
|
406
406
|
driver: postgresDriver,
|
|
407
|
-
|
|
407
|
+
extensions: [],
|
|
408
408
|
db: {
|
|
409
409
|
connection: process.env.DATABASE_URL, // Optional: can also use --db flag
|
|
410
410
|
},
|
|
@@ -555,7 +555,7 @@ export default defineConfig({
|
|
|
555
555
|
target: postgres,
|
|
556
556
|
adapter: postgresAdapter,
|
|
557
557
|
driver: postgresDriver,
|
|
558
|
-
|
|
558
|
+
extensions: [],
|
|
559
559
|
contract: typescriptContract(contract, 'src/prisma/contract.json'),
|
|
560
560
|
db: {
|
|
561
561
|
connection: process.env.DATABASE_URL, // Optional: can also use --db flag
|
|
@@ -761,7 +761,7 @@ export default defineConfig({
|
|
|
761
761
|
target: postgres,
|
|
762
762
|
adapter: postgresAdapter,
|
|
763
763
|
driver: postgresDriver,
|
|
764
|
-
|
|
764
|
+
extensions: [],
|
|
765
765
|
contract: typescriptContract(contract, 'src/prisma/contract.json'),
|
|
766
766
|
db: {
|
|
767
767
|
connection: process.env.DATABASE_URL, // Optional: can also use --db flag
|
|
@@ -778,7 +778,7 @@ export default defineConfig({
|
|
|
778
778
|
5. **Validate wiring**: Ensures the contract is compatible with the CLI config:
|
|
779
779
|
- `contract.targetFamily` matches `config.family.familyId`
|
|
780
780
|
- `contract.target` matches `config.target.targetId`
|
|
781
|
-
- `contract.
|
|
781
|
+
- `contract.extensions` (if present) are provided by `config.extensions` (matched by descriptor `id`)
|
|
782
782
|
6. **Create Planner/Runner**: Uses `config.target.migrations.createPlanner()` and `config.target.migrations.createRunner()`
|
|
783
783
|
7. **Plan Migration**: Calls `planner.plan()` with the contract, schema IR, additive-only policy, and `frameworkComponents` (the active target/adapter/extension descriptors)
|
|
784
784
|
- On conflict: Returns a structured failure with conflict list
|
|
@@ -891,7 +891,7 @@ prisma-next db update [--db <url>] [--config <path>] [--dry-run] [-y|--yes] [--i
|
|
|
891
891
|
|
|
892
892
|
**Config File (`prisma-next.config.ts`):**
|
|
893
893
|
|
|
894
|
-
The CLI uses a config file to specify the target family, target, adapter,
|
|
894
|
+
The CLI uses a config file to specify the target family, target, adapter, extensions, and contract.
|
|
895
895
|
|
|
896
896
|
**Config Discovery:**
|
|
897
897
|
- `--config <path>`: Explicit path (relative or absolute)
|
|
@@ -912,7 +912,7 @@ export default defineConfig({
|
|
|
912
912
|
family: sql,
|
|
913
913
|
target: postgres,
|
|
914
914
|
adapter: postgresAdapter,
|
|
915
|
-
|
|
915
|
+
extensions: [],
|
|
916
916
|
contract: typescriptContract(contract, 'src/prisma/contract.json'),
|
|
917
917
|
});
|
|
918
918
|
```
|
|
@@ -1294,7 +1294,7 @@ import exampleExtension from '@prisma-next/extension-example/control';
|
|
|
1294
1294
|
|
|
1295
1295
|
export default defineConfig({
|
|
1296
1296
|
// family/target/adapter/driver omitted for brevity
|
|
1297
|
-
|
|
1297
|
+
extensions: [exampleExtension],
|
|
1298
1298
|
});
|
|
1299
1299
|
```
|
|
1300
1300
|
|
|
@@ -1389,7 +1389,7 @@ const client = createControlClient({
|
|
|
1389
1389
|
target: postgres,
|
|
1390
1390
|
adapter: postgresAdapter,
|
|
1391
1391
|
driver: postgresDriver,
|
|
1392
|
-
|
|
1392
|
+
extensions: [],
|
|
1393
1393
|
});
|
|
1394
1394
|
|
|
1395
1395
|
try {
|
package/dist/cli.mjs
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { D as isCI, O as formatCommandHelp, g as parseGlobalFlagsOrExit, h as parseGlobalFlags, k as formatRootHelp, l as setCommandDescriptions, m as deriveCanPrompt, t as addGlobalOptions, u as setCommandExamples, v as installShutdownHandlers } from "./command-helpers-CVn3U9Uz.mjs";
|
|
3
|
-
import { t as createContractEmitCommand } from "./contract-emit-
|
|
4
|
-
import { t as createContractInferCommand } from "./contract-infer-
|
|
3
|
+
import { t as createContractEmitCommand } from "./contract-emit-PaY3qRdN.mjs";
|
|
4
|
+
import { t as createContractInferCommand } from "./contract-infer-DCju2fTk.mjs";
|
|
5
5
|
import { createDbInitCommand } from "./commands/db-init.mjs";
|
|
6
6
|
import { createDbSchemaCommand } from "./commands/db-schema.mjs";
|
|
7
7
|
import { createDbSignCommand } from "./commands/db-sign.mjs";
|
|
8
8
|
import { createDbUpdateCommand } from "./commands/db-update.mjs";
|
|
9
|
-
import { t as createDbVerifyCommand } from "./db-verify-
|
|
10
|
-
import { t as createFormatCommand } from "./format-
|
|
11
|
-
import { t as createMigrationListCommand } from "./migration-list-
|
|
9
|
+
import { t as createDbVerifyCommand } from "./db-verify-B_dKu6Yp.mjs";
|
|
10
|
+
import { t as createFormatCommand } from "./format-cCyDfmRE.mjs";
|
|
11
|
+
import { t as createMigrationListCommand } from "./migration-list-ClkEaoL8.mjs";
|
|
12
12
|
import { createMigrateCommand } from "./commands/migrate.mjs";
|
|
13
|
-
import { t as createMigrationCheckCommand } from "./migration-check-
|
|
13
|
+
import { t as createMigrationCheckCommand } from "./migration-check-W5XEx4d-.mjs";
|
|
14
14
|
import { createMigrationGraphCommand } from "./commands/migration-graph.mjs";
|
|
15
|
-
import { t as createMigrationLogCommand } from "./migration-log-
|
|
15
|
+
import { t as createMigrationLogCommand } from "./migration-log-CjafbZ2Z.mjs";
|
|
16
16
|
import { createMigrationNewCommand } from "./commands/migration-new.mjs";
|
|
17
|
-
import { t as createMigrationPlanCommand } from "./migration-plan-
|
|
17
|
+
import { t as createMigrationPlanCommand } from "./migration-plan-Pc4hCF1H.mjs";
|
|
18
18
|
import { createMigrationShowCommand } from "./commands/migration-show.mjs";
|
|
19
|
-
import { r as createMigrationStatusCommand } from "./migration-status-
|
|
19
|
+
import { r as createMigrationStatusCommand } from "./migration-status-CqAdRzs8.mjs";
|
|
20
20
|
import { createRefCommand } from "./commands/ref.mjs";
|
|
21
21
|
import { t as createTelemetryCommand } from "./telemetry-BEyNMfco.mjs";
|
|
22
22
|
import { Command } from "commander";
|
|
@@ -25,7 +25,7 @@ import { ensureInstallationId, readUserConfig, resolveGating, runTelemetry, user
|
|
|
25
25
|
import { distance } from "closest-match";
|
|
26
26
|
import { fileURLToPath } from "node:url";
|
|
27
27
|
//#region package.json
|
|
28
|
-
var version = "0.16.0-dev.
|
|
28
|
+
var version = "0.16.0-dev.22";
|
|
29
29
|
//#endregion
|
|
30
30
|
//#region src/commands/init/templates/code-templates.ts
|
|
31
31
|
function targetPackageName(target) {
|
|
@@ -294,7 +294,7 @@ Exit codes (see CLI Style Guide § Exit Codes):
|
|
|
294
294
|
"prisma-next init --no-skill # skip the skills install (air-gapped / restricted env)"
|
|
295
295
|
]);
|
|
296
296
|
return addGlobalOptions(command).option("--target <db>", "Database target: postgres or mongodb").option("--authoring <style>", "Schema authoring style: psl or typescript").option("--schema-path <path>", `Where to write the starter schema (default: ${defaultSchemaPath("psl")})`).option("--force", "Overwrite an existing scaffold without prompting").option("--write-env", "Write a .env file from .env.example (gitignored; default: only .env.example)").option("--probe-db", "Connect to DATABASE_URL once and check the server version against the target minimum (opt-in; off by default)").option("--strict-probe", "Treat a failed --probe-db as fatal (no-op without --probe-db; init is offline-by-default)").option("--no-install", "Skip dependency installation and contract emission").option("--no-skill", "Skip Prisma Next skills install (air-gapped CI, restricted registries, etc.)").action(async (options) => {
|
|
297
|
-
const { runInit } = await import("./init-
|
|
297
|
+
const { runInit } = await import("./init-C9U3ffHH.mjs");
|
|
298
298
|
const flags = parseGlobalFlagsOrExit(options);
|
|
299
299
|
const canPrompt = deriveCanPrompt({
|
|
300
300
|
flagsInteractive: flags.interactive,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { F as CliStructuredError } from "./command-helpers-CVn3U9Uz.mjs";
|
|
2
|
-
import { t as assertFrameworkComponentsCompatible } from "./framework-components-
|
|
3
|
-
import { t as enrichContract } from "./contract-enrichment-
|
|
4
|
-
import { t as buildContractSpaceAggregate } from "./contract-space-aggregate-loader-
|
|
2
|
+
import { t as assertFrameworkComponentsCompatible } from "./framework-components-DUN-TYDg.mjs";
|
|
3
|
+
import { t as enrichContract } from "./contract-enrichment-JUhLv-BX.mjs";
|
|
4
|
+
import { t as buildContractSpaceAggregate } from "./contract-space-aggregate-loader-B6E9LGa6.mjs";
|
|
5
5
|
import { emit } from "@prisma-next/emitter";
|
|
6
6
|
import { ifDefined } from "@prisma-next/utils/defined";
|
|
7
7
|
import { notOk, ok } from "@prisma-next/utils/result";
|
|
@@ -206,12 +206,12 @@ const SPAN_IDS$1 = {
|
|
|
206
206
|
* every space's writes.
|
|
207
207
|
*/
|
|
208
208
|
async function executeRun(options) {
|
|
209
|
-
const { driver, adapter, familyInstance, contract, mode, migrations, frameworkComponents, migrationsDir,
|
|
209
|
+
const { driver, adapter, familyInstance, contract, mode, migrations, frameworkComponents, migrationsDir, extensions, targetId, policy, action, onProgress } = options;
|
|
210
210
|
const loaded = await buildContractSpaceAggregate({
|
|
211
211
|
targetId,
|
|
212
212
|
migrationsDir,
|
|
213
213
|
appContract: contract,
|
|
214
|
-
|
|
214
|
+
extensions,
|
|
215
215
|
deserializeContract: (json) => familyInstance.deserializeContract(json)
|
|
216
216
|
});
|
|
217
217
|
if (!loaded.ok) throw loaded.failure;
|
|
@@ -327,7 +327,7 @@ function aggregatePlannerWarnings(orderedResolutions) {
|
|
|
327
327
|
* Compare the live `_prisma_marker` rows against the aggregate's
|
|
328
328
|
* declared contract spaces. Any marker row whose `space` is not a space of
|
|
329
329
|
* the aggregate is an "orphan" — typically a marker left behind by
|
|
330
|
-
* an extension that was removed from `
|
|
330
|
+
* an extension that was removed from `extensions` without first
|
|
331
331
|
* cleaning up its on-disk migrations / database tables.
|
|
332
332
|
*
|
|
333
333
|
* Returns a {@link CliStructuredError} envelope (code
|
|
@@ -345,8 +345,8 @@ function detectOrphanMarkers(aggregate, markerRows) {
|
|
|
345
345
|
if (orphans.length === 0) return null;
|
|
346
346
|
orphans.sort((a, b) => a.localeCompare(b));
|
|
347
347
|
return new CliStructuredError("MIGRATION.CONTRACT_SPACE_VIOLATION", orphans.length === 1 ? `Orphan contract-space marker detected for "${orphans[0]}"` : `Orphan contract-space markers detected for ${orphans.length} spaces`, {
|
|
348
|
-
why: `The database has \`_prisma_marker\` rows for spaces (${orphans.map((s) => `"${s}"`).join(", ")}) that are not declared in the project's \`
|
|
349
|
-
fix: "Either re-declare the missing extension(s) in `
|
|
348
|
+
why: `The database has \`_prisma_marker\` rows for spaces (${orphans.map((s) => `"${s}"`).join(", ")}) that are not declared in the project's \`extensions\`. The aggregate pipeline refuses to advance markers it cannot account for.`,
|
|
349
|
+
fix: "Either re-declare the missing extension(s) in `extensions` (so the aggregate owns them again), or remove the orphan marker row(s) from `_prisma_marker` once you have confirmed the corresponding tables can be safely retired.",
|
|
350
350
|
docsUrl: "https://pris.ly/contract-spaces",
|
|
351
351
|
meta: { violations: orphans.map((spaceId) => ({
|
|
352
352
|
kind: "orphanMarker",
|
|
@@ -451,7 +451,7 @@ async function executeDbInit(options) {
|
|
|
451
451
|
frameworkComponents: options.frameworkComponents,
|
|
452
452
|
migrationsDir: options.migrationsDir,
|
|
453
453
|
targetId: options.targetId,
|
|
454
|
-
|
|
454
|
+
extensions: options.extensions ?? [],
|
|
455
455
|
policy: { allowedOperationClasses: ["additive"] },
|
|
456
456
|
action: "dbInit",
|
|
457
457
|
...ifDefined("onProgress", options.onProgress)
|
|
@@ -483,7 +483,7 @@ async function executeDbUpdate(options) {
|
|
|
483
483
|
frameworkComponents: options.frameworkComponents,
|
|
484
484
|
migrationsDir: options.migrationsDir,
|
|
485
485
|
targetId: options.targetId,
|
|
486
|
-
|
|
486
|
+
extensions: options.extensions ?? [],
|
|
487
487
|
policy: DB_UPDATE_POLICY,
|
|
488
488
|
action: "dbUpdate",
|
|
489
489
|
...ifDefined("onProgress", options.onProgress)
|
|
@@ -585,7 +585,7 @@ function buildLoadInputs(options) {
|
|
|
585
585
|
targetId: options.targetId,
|
|
586
586
|
migrationsDir: options.migrationsDir,
|
|
587
587
|
appContract: options.contract,
|
|
588
|
-
|
|
588
|
+
extensions: options.extensions,
|
|
589
589
|
deserializeContract: (json) => options.familyInstance.deserializeContract(json)
|
|
590
590
|
};
|
|
591
591
|
}
|
|
@@ -725,12 +725,12 @@ function mapMarkerCheckFailures(appSpaceId, section) {
|
|
|
725
725
|
for (const orphan of section.orphanMarkers) violations.push({
|
|
726
726
|
kind: "orphanMarker",
|
|
727
727
|
spaceId: orphan.spaceId,
|
|
728
|
-
remediation: `Add the corresponding extension to \`
|
|
728
|
+
remediation: `Add the corresponding extension to \`extensions\` in \`prisma-next.config.ts\`, or delete the orphan marker row for "${orphan.spaceId}".`
|
|
729
729
|
});
|
|
730
730
|
if (violations.length === 0) return null;
|
|
731
731
|
const lines = violations.map((v) => `- [${v.kind}] ${v.spaceId}: ${v.remediation}`);
|
|
732
732
|
return new CliStructuredError("MIGRATION.CONTRACT_SPACE_VIOLATION", violations.length === 1 ? "Contract-space verifier found a violation" : `Contract-space verifier found violations (${violations.length})`, {
|
|
733
|
-
why: `The on-disk \`migrations/\` directory, the \`
|
|
733
|
+
why: `The on-disk \`migrations/\` directory, the \`extensions\` declaration, and the live database marker rows are not in agreement.\n${lines.join("\n")}`,
|
|
734
734
|
fix: violations[0]?.remediation ?? "Review and reconcile the violations listed above.",
|
|
735
735
|
docsUrl: "https://pris.ly/contract-spaces",
|
|
736
736
|
meta: { violations }
|
|
@@ -764,12 +764,12 @@ function mapMarkerCheckFailures(appSpaceId, section) {
|
|
|
764
764
|
* authored migration graph on disk before this operation can advance it.
|
|
765
765
|
*/
|
|
766
766
|
async function executeMigrate(options) {
|
|
767
|
-
const { driver, familyInstance, contract, migrations, frameworkComponents, migrationsDir,
|
|
767
|
+
const { driver, familyInstance, contract, migrations, frameworkComponents, migrationsDir, extensions, targetId, refHash, refInvariants, refName, onProgress } = options;
|
|
768
768
|
const loaded = await buildContractSpaceAggregate({
|
|
769
769
|
targetId,
|
|
770
770
|
migrationsDir,
|
|
771
771
|
appContract: contract,
|
|
772
|
-
|
|
772
|
+
extensions,
|
|
773
773
|
deserializeContract: (json) => familyInstance.deserializeContract(json)
|
|
774
774
|
});
|
|
775
775
|
if (!loaded.ok) throw loaded.failure;
|
|
@@ -1139,13 +1139,13 @@ var ControlClientImpl = class {
|
|
|
1139
1139
|
target: this.options.target,
|
|
1140
1140
|
adapter: this.options.adapter,
|
|
1141
1141
|
driver: this.options.driver,
|
|
1142
|
-
|
|
1142
|
+
extensions: this.options.extensions
|
|
1143
1143
|
});
|
|
1144
1144
|
this.familyInstance = this.options.family.create(this.stack);
|
|
1145
1145
|
const rawComponents = [
|
|
1146
1146
|
this.options.target,
|
|
1147
1147
|
this.options.adapter,
|
|
1148
|
-
...this.options.
|
|
1148
|
+
...this.options.extensions ?? []
|
|
1149
1149
|
];
|
|
1150
1150
|
this.frameworkComponents = assertFrameworkComponentsCompatible(this.options.family.familyId, this.options.target.targetId, rawComponents);
|
|
1151
1151
|
this.initialized = true;
|
|
@@ -1358,7 +1358,7 @@ var ControlClientImpl = class {
|
|
|
1358
1358
|
frameworkComponents,
|
|
1359
1359
|
migrationsDir: options.migrationsDir,
|
|
1360
1360
|
targetId: this.options.target.targetId,
|
|
1361
|
-
|
|
1361
|
+
extensions: this.options.extensions ?? [],
|
|
1362
1362
|
...ifDefined("onProgress", onProgress)
|
|
1363
1363
|
});
|
|
1364
1364
|
}
|
|
@@ -1384,7 +1384,7 @@ var ControlClientImpl = class {
|
|
|
1384
1384
|
frameworkComponents,
|
|
1385
1385
|
migrationsDir: options.migrationsDir,
|
|
1386
1386
|
targetId: this.options.target.targetId,
|
|
1387
|
-
|
|
1387
|
+
extensions: this.options.extensions ?? [],
|
|
1388
1388
|
...ifDefined("acceptDataLoss", options.acceptDataLoss),
|
|
1389
1389
|
...ifDefined("onProgress", onProgress)
|
|
1390
1390
|
});
|
|
@@ -1399,7 +1399,7 @@ var ControlClientImpl = class {
|
|
|
1399
1399
|
contract: options.contract,
|
|
1400
1400
|
migrationsDir: options.migrationsDir,
|
|
1401
1401
|
targetId: this.options.target.targetId,
|
|
1402
|
-
|
|
1402
|
+
extensions: this.options.extensions ?? [],
|
|
1403
1403
|
frameworkComponents,
|
|
1404
1404
|
mode: options.strict ? "strict" : "lenient",
|
|
1405
1405
|
skipSchema: options.skipSchema,
|
|
@@ -1444,7 +1444,7 @@ var ControlClientImpl = class {
|
|
|
1444
1444
|
migrations: this.options.target.migrations,
|
|
1445
1445
|
frameworkComponents,
|
|
1446
1446
|
migrationsDir: options.migrationsDir,
|
|
1447
|
-
|
|
1447
|
+
extensions: this.options.extensions ?? [],
|
|
1448
1448
|
targetId: this.options.target.targetId,
|
|
1449
1449
|
...ifDefined("refHash", options.refHash),
|
|
1450
1450
|
...ifDefined("refInvariants", options.refInvariants),
|
|
@@ -1512,7 +1512,7 @@ var ControlClientImpl = class {
|
|
|
1512
1512
|
try {
|
|
1513
1513
|
const stack = this.stack;
|
|
1514
1514
|
const sourceContext = {
|
|
1515
|
-
|
|
1515
|
+
composedExtensions: stack.extensions.map((p) => p.id),
|
|
1516
1516
|
composedExtensionContracts: stack.extensionContracts,
|
|
1517
1517
|
authoringContributions: stack.authoringContributions,
|
|
1518
1518
|
codecLookup: stack.codecLookup,
|
|
@@ -1624,4 +1624,4 @@ var ControlClientImpl = class {
|
|
|
1624
1624
|
//#endregion
|
|
1625
1625
|
export { executeDbInit as a, executeDbUpdate as i, planSpacePath as n, ContractValidationError as o, executeDbVerify as r, createControlClient as t };
|
|
1626
1626
|
|
|
1627
|
-
//# sourceMappingURL=client-
|
|
1627
|
+
//# sourceMappingURL=client-CMusjGV5.mjs.map
|