@prisma-next/cli 0.5.0 → 0.5.1
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 +1 -1
- package/dist/cli.mjs +4 -4
- package/dist/{client-qVH-rEgd.mjs → client-BCnP7cHo.mjs} +9 -119
- package/dist/client-BCnP7cHo.mjs.map +1 -0
- package/dist/commands/contract-infer.mjs +1 -1
- package/dist/commands/db-init.mjs +3 -3
- package/dist/commands/db-schema.mjs +1 -1
- package/dist/commands/db-sign.mjs +1 -1
- package/dist/commands/db-update.mjs +3 -3
- package/dist/commands/db-verify.mjs +1 -1
- package/dist/commands/migration-apply.d.mts +1 -1
- package/dist/commands/migration-apply.mjs +2 -2
- package/dist/commands/migration-plan.d.mts.map +1 -1
- package/dist/commands/migration-plan.mjs +1 -1
- package/dist/commands/migration-show.d.mts +55 -7
- package/dist/commands/migration-show.d.mts.map +1 -1
- package/dist/commands/migration-show.mjs +153 -46
- package/dist/commands/migration-show.mjs.map +1 -1
- package/dist/commands/migration-status.d.mts.map +1 -1
- package/dist/commands/migration-status.mjs +1 -1
- package/dist/{contract-infer-BK9YFGEG.mjs → contract-infer-ByxhPjpW.mjs} +2 -2
- package/dist/{contract-infer-BK9YFGEG.mjs.map → contract-infer-ByxhPjpW.mjs.map} +1 -1
- package/dist/contract-space-aggregate-loader-BrwKK6Q6.mjs +160 -0
- package/dist/contract-space-aggregate-loader-BrwKK6Q6.mjs.map +1 -0
- package/dist/{db-verify-C0y1PCO2.mjs → db-verify-Czm5T-J4.mjs} +2 -2
- package/dist/{db-verify-C0y1PCO2.mjs.map → db-verify-Czm5T-J4.mjs.map} +1 -1
- package/dist/exports/control-api.d.mts +1 -1
- package/dist/exports/control-api.mjs +1 -1
- package/dist/{inspect-live-schema-CWYxGKlb.mjs → inspect-live-schema-DxdBd4Er.mjs} +2 -2
- package/dist/{inspect-live-schema-CWYxGKlb.mjs.map → inspect-live-schema-DxdBd4Er.mjs.map} +1 -1
- package/dist/{migration-command-scaffold-B5dORFEv.mjs → migration-command-scaffold-BdV8JYXV.mjs} +2 -2
- package/dist/{migration-command-scaffold-B5dORFEv.mjs.map → migration-command-scaffold-BdV8JYXV.mjs.map} +1 -1
- package/dist/{migration-plan-C6lVaHsO.mjs → migration-plan-mRu5K81L.mjs} +89 -149
- package/dist/migration-plan-mRu5K81L.mjs.map +1 -0
- package/dist/{migration-status-CZ-D5k7k.mjs → migration-status-By9G5p2H.mjs} +6 -8
- package/dist/{migration-status-CZ-D5k7k.mjs.map → migration-status-By9G5p2H.mjs.map} +1 -1
- package/dist/{migrations-D_UJnpuW.mjs → migrations-CTsyBXCA.mjs} +42 -29
- package/dist/migrations-CTsyBXCA.mjs.map +1 -0
- package/dist/{types-D7x-IFLO.d.mts → types-LItU7E4l.d.mts} +7 -9
- package/dist/{types-D7x-IFLO.d.mts.map → types-LItU7E4l.d.mts.map} +1 -1
- package/package.json +14 -14
- package/src/commands/migration-plan.ts +45 -47
- package/src/commands/migration-show.ts +245 -60
- package/src/commands/migration-status.ts +17 -9
- package/src/control-api/operations/db-apply-aggregate.ts +12 -10
- package/src/control-api/operations/migration-apply.ts +7 -1
- package/src/control-api/types.ts +6 -8
- package/src/utils/contract-space-aggregate-loader.ts +7 -34
- package/src/utils/contract-space-seed-phase.ts +201 -0
- package/src/utils/extension-pack-inputs.ts +47 -55
- package/src/utils/formatters/migrations.ts +80 -38
- package/dist/client-qVH-rEgd.mjs.map +0 -1
- package/dist/extension-pack-inputs-C7xgE-vv.mjs +0 -74
- package/dist/extension-pack-inputs-C7xgE-vv.mjs.map +0 -1
- package/dist/migration-plan-C6lVaHsO.mjs.map +0 -1
- package/dist/migrations-D_UJnpuW.mjs.map +0 -1
- package/src/utils/contract-space-extension-migrations-pass.ts +0 -120
- package/src/utils/contract-space-migrate-pass.ts +0 -156
|
@@ -3,9 +3,9 @@ import { cyan, green, yellow } from "colorette";
|
|
|
3
3
|
//#region src/utils/formatters/migrations.ts
|
|
4
4
|
/**
|
|
5
5
|
* Render a single statement of an `OperationPreview` for the human-readable
|
|
6
|
-
* preview block. SQL statements get a trailing `;` if missing
|
|
7
|
-
* legacy `string[]`-based renderer
|
|
8
|
-
* languages (`'mongodb-shell'`) render verbatim.
|
|
6
|
+
* preview block. SQL statements get a trailing `;` if missing so the rendered
|
|
7
|
+
* preview is byte-identical to the legacy `string[]`-based renderer for SQL
|
|
8
|
+
* targets. Other languages (`'mongodb-shell'`) render verbatim.
|
|
9
9
|
*/
|
|
10
10
|
function renderPreviewStatement(text, language) {
|
|
11
11
|
const trimmed = text.trim();
|
|
@@ -15,9 +15,10 @@ function renderPreviewStatement(text, language) {
|
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Choose the header label for a preview block. SQL-only previews keep the
|
|
18
|
-
* legacy `DDL preview` label
|
|
19
|
-
*
|
|
20
|
-
* non-SQL language — use the family-agnostic `Operation preview`
|
|
18
|
+
* legacy `DDL preview` label so the rendered output is byte-identical to the
|
|
19
|
+
* pre-aggregate SQL CLI; previews from any other family — or a mix that
|
|
20
|
+
* includes any non-SQL language — use the family-agnostic `Operation preview`
|
|
21
|
+
* label.
|
|
21
22
|
*
|
|
22
23
|
* An empty `statements` array deliberately renders as `Operation preview`
|
|
23
24
|
* rather than `DDL preview`: `Array.prototype.every` is vacuously true for
|
|
@@ -29,10 +30,9 @@ function previewBlockHeader(preview) {
|
|
|
29
30
|
}
|
|
30
31
|
/**
|
|
31
32
|
* Render the shared per-space execution block consumed by the `db init`
|
|
32
|
-
* / `db update` / `migration apply` summaries
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* hash (when known).
|
|
33
|
+
* / `db update` / `migration apply` summaries. Always shows: space
|
|
34
|
+
* label (`Extension space: <id>` or `App space`) → per-op lines under
|
|
35
|
+
* each space → per-space marker hash (when known).
|
|
36
36
|
*
|
|
37
37
|
* `mode` controls the marker label phrasing — `'apply'` shows
|
|
38
38
|
* `marker → <hash>` (post-apply), `'plan'` omits the marker line
|
|
@@ -136,42 +136,55 @@ function formatMigrationApplyCommandOutput(result, flags) {
|
|
|
136
136
|
}
|
|
137
137
|
return lines.join("\n");
|
|
138
138
|
}
|
|
139
|
-
function
|
|
140
|
-
if (flags.quiet) return "";
|
|
141
|
-
const lines = [];
|
|
142
|
-
const useColor = flags.color !== false;
|
|
139
|
+
function formatSpaceShowBlock(space, useColor) {
|
|
143
140
|
const formatGreen = createColorFormatter(useColor, green);
|
|
144
141
|
const formatYellow = createColorFormatter(useColor, yellow);
|
|
145
142
|
const formatDimText = (text) => formatDim(useColor, text);
|
|
146
|
-
lines
|
|
147
|
-
lines.push(`${
|
|
148
|
-
lines.push(`${formatDimText(`
|
|
149
|
-
lines.push(`${formatDimText(`
|
|
150
|
-
lines.push(`${formatDimText(`
|
|
143
|
+
const lines = [];
|
|
144
|
+
lines.push(`${formatGreen("✔")} ${space.dirName}`);
|
|
145
|
+
lines.push(`${formatDimText(` from: ${space.from ?? "(baseline)"}`)}`);
|
|
146
|
+
lines.push(`${formatDimText(` to: ${space.to}`)}`);
|
|
147
|
+
lines.push(`${formatDimText(` migrationHash: ${space.migrationHash}`)}`);
|
|
148
|
+
lines.push(`${formatDimText(` created: ${space.createdAt}`)}`);
|
|
151
149
|
lines.push("");
|
|
152
|
-
lines.push(`${
|
|
153
|
-
if (
|
|
150
|
+
lines.push(`${space.operations.length} operation(s)`);
|
|
151
|
+
if (space.operations.length > 0) {
|
|
154
152
|
lines.push(`${formatDimText("│")}`);
|
|
155
|
-
for (let i = 0; i <
|
|
156
|
-
const op =
|
|
157
|
-
const treeChar = i ===
|
|
153
|
+
for (let i = 0; i < space.operations.length; i++) {
|
|
154
|
+
const op = space.operations[i];
|
|
155
|
+
const treeChar = i === space.operations.length - 1 ? "└" : "├";
|
|
158
156
|
const destructiveMarker = op.operationClass === "destructive" ? ` ${formatYellow("(destructive)")}` : "";
|
|
159
157
|
lines.push(`${formatDimText(treeChar)}─ ${op.label}${destructiveMarker}`);
|
|
160
158
|
}
|
|
161
|
-
if (
|
|
159
|
+
if (space.operations.some((op) => op.operationClass === "destructive")) {
|
|
162
160
|
lines.push("");
|
|
163
161
|
lines.push(`${formatYellow("⚠")} This migration contains destructive operations that may cause data loss.`);
|
|
164
162
|
}
|
|
165
163
|
}
|
|
166
|
-
if (
|
|
164
|
+
if (space.preview.statements.length > 0) {
|
|
167
165
|
lines.push("");
|
|
168
|
-
lines.push(`${formatDimText(previewBlockHeader(
|
|
166
|
+
lines.push(`${formatDimText(previewBlockHeader(space.preview))}`);
|
|
169
167
|
lines.push("");
|
|
170
|
-
for (const statement of
|
|
168
|
+
for (const statement of space.preview.statements) {
|
|
171
169
|
const rendered = renderPreviewStatement(statement.text, statement.language);
|
|
172
170
|
if (rendered) lines.push(rendered);
|
|
173
171
|
}
|
|
174
172
|
}
|
|
173
|
+
return lines;
|
|
174
|
+
}
|
|
175
|
+
function formatMigrationShowOutput(result, flags) {
|
|
176
|
+
if (flags.quiet) return "";
|
|
177
|
+
const useColor = flags.color !== false;
|
|
178
|
+
const formatDimText = (text) => formatDim(useColor, text);
|
|
179
|
+
const multipleSpaces = result.spaces.length > 1;
|
|
180
|
+
const lines = [];
|
|
181
|
+
for (let i = 0; i < result.spaces.length; i++) {
|
|
182
|
+
const space = result.spaces[i];
|
|
183
|
+
if (multipleSpaces) lines.push(formatDimText(`── ${space.spaceId} ──`));
|
|
184
|
+
if (space.kind === "missing") lines.push(formatDimText(` ${space.summary}`));
|
|
185
|
+
else for (const line of formatSpaceShowBlock(space, useColor)) lines.push(line);
|
|
186
|
+
if (i < result.spaces.length - 1) lines.push("");
|
|
187
|
+
}
|
|
175
188
|
return lines.join("\n");
|
|
176
189
|
}
|
|
177
190
|
/**
|
|
@@ -213,4 +226,4 @@ function formatMigrationJson(result) {
|
|
|
213
226
|
//#endregion
|
|
214
227
|
export { formatMigrationShowOutput as a, formatMigrationPlanOutput as i, formatMigrationApplyOutput as n, formatMigrationJson as r, formatMigrationApplyCommandOutput as t };
|
|
215
228
|
|
|
216
|
-
//# sourceMappingURL=migrations-
|
|
229
|
+
//# sourceMappingURL=migrations-CTsyBXCA.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrations-CTsyBXCA.mjs","names":[],"sources":["../src/utils/formatters/migrations.ts"],"sourcesContent":["import type { OperationPreview } from '@prisma-next/framework-components/control';\nimport { cyan, green, yellow } from 'colorette';\n\nimport type { AggregatePerSpaceExecutionEntry } from '../../control-api/types';\nimport type { GlobalFlags } from '../global-flags';\nimport { createColorFormatter, formatDim, isVerbose } from './helpers';\n\n/**\n * Render a single statement of an `OperationPreview` for the human-readable\n * preview block. SQL statements get a trailing `;` if missing so the rendered\n * preview is byte-identical to the legacy `string[]`-based renderer for SQL\n * targets. Other languages (`'mongodb-shell'`) render verbatim.\n */\nfunction renderPreviewStatement(text: string, language: string): string | undefined {\n const trimmed = text.trim();\n if (!trimmed) return undefined;\n if (language === 'sql') {\n return trimmed.endsWith(';') ? trimmed : `${trimmed};`;\n }\n return trimmed;\n}\n\n/**\n * Choose the header label for a preview block. SQL-only previews keep the\n * legacy `DDL preview` label so the rendered output is byte-identical to the\n * pre-aggregate SQL CLI; previews from any other family — or a mix that\n * includes any non-SQL language — use the family-agnostic `Operation preview`\n * label.\n *\n * An empty `statements` array deliberately renders as `Operation preview`\n * rather than `DDL preview`: `Array.prototype.every` is vacuously true for\n * empty arrays, but we have no evidence the preview is SQL-only when no\n * statements are present, so the family-agnostic label is the safer default.\n */\nexport function previewBlockHeader(preview: OperationPreview): string {\n const allSql =\n preview.statements.length > 0 && preview.statements.every((s) => s.language === 'sql');\n return allSql ? 'DDL preview' : 'Operation preview';\n}\n\n// ============================================================================\n// Migration Command Output Formatters (shared by db init and db update)\n// ============================================================================\n\n/**\n * Shared CLI output type for migration commands (db init, db update).\n */\nexport interface MigrationCommandResult {\n readonly ok: true;\n readonly mode: 'plan' | 'apply';\n readonly plan: {\n readonly targetId: string;\n readonly destination: {\n readonly storageHash: string;\n readonly profileHash?: string;\n };\n readonly operations: readonly {\n readonly id: string;\n readonly label: string;\n readonly operationClass: string;\n }[];\n /**\n * Family-agnostic textual preview of the planned operations. Replaces the\n * previous `sql?: readonly string[]`. Consumers should read\n * `plan.preview?.statements`.\n */\n readonly preview?: OperationPreview;\n };\n readonly execution?: {\n readonly operationsPlanned: number;\n readonly operationsExecuted: number;\n };\n readonly marker?: {\n readonly storageHash: string;\n readonly profileHash?: string;\n };\n /**\n * Per-space execution breakdown in canonical schedule order\n * (extensions alphabetically, then app). Surfaces per-space markers\n * and the ops grouped by space, so the CLI summary can name which\n * space each op and marker belongs to instead of flattening them\n * into a single ambiguous list. See {@link AggregatePerSpaceExecutionEntry}.\n */\n readonly perSpace?: ReadonlyArray<AggregatePerSpaceExecutionEntry>;\n readonly summary: string;\n readonly timings: {\n readonly total: number;\n };\n}\n\n/**\n * Render the shared per-space execution block consumed by the `db init`\n * / `db update` / `migration apply` summaries. Always shows: space\n * label (`Extension space: <id>` or `App space`) → per-op lines under\n * each space → per-space marker hash (when known).\n *\n * `mode` controls the marker label phrasing — `'apply'` shows\n * `marker → <hash>` (post-apply), `'plan'` omits the marker line\n * entirely (no marker has been written yet).\n */\nexport function formatPerSpaceBlock(\n perSpace: ReadonlyArray<AggregatePerSpaceExecutionEntry>,\n mode: 'plan' | 'apply',\n useColor: boolean,\n): readonly string[] {\n const formatYellow = createColorFormatter(useColor, yellow);\n const formatCyan = createColorFormatter(useColor, cyan);\n const formatDimText = (text: string) => formatDim(useColor, text);\n\n const lines: string[] = [];\n for (let s = 0; s < perSpace.length; s++) {\n const space = perSpace[s]!;\n if (s > 0) lines.push('');\n const header =\n space.kind === 'app'\n ? formatCyan('App space')\n : formatCyan(`Extension space: ${space.spaceId}`);\n lines.push(header);\n if (space.operations.length === 0) {\n lines.push(` ${formatDimText('(no operations)')}`);\n } else {\n for (let i = 0; i < space.operations.length; i++) {\n const op = space.operations[i]!;\n const isLast = i === space.operations.length - 1;\n const treeChar = isLast ? '└' : '├';\n const destructiveMarker =\n op.operationClass === 'destructive' ? ` ${formatYellow('(destructive)')}` : '';\n lines.push(` ${formatDimText(treeChar)}─ ${op.label}${destructiveMarker}`);\n }\n }\n if (mode === 'apply' && space.marker) {\n lines.push(` ${formatDimText(`marker: ${space.marker.storageHash}`)}`);\n }\n }\n return lines;\n}\n\n/**\n * Formats human-readable output for migration commands (db init, db update) in plan mode.\n */\nexport function formatMigrationPlanOutput(\n result: MigrationCommandResult,\n flags: GlobalFlags,\n): string {\n if (flags.quiet) {\n return '';\n }\n\n const lines: string[] = [];\n\n const useColor = flags.color !== false;\n const formatGreen = createColorFormatter(useColor, green);\n const formatDimText = (text: string) => formatDim(useColor, text);\n\n // Plan summary\n const operationCount = result.plan?.operations.length ?? 0;\n const spaceCount = result.perSpace?.length ?? 0;\n if (spaceCount > 0) {\n lines.push(\n `${formatGreen('✔')} Planned ${operationCount} operation(s) across ${spaceCount} contract space${spaceCount === 1 ? '' : 's'}`,\n );\n } else {\n lines.push(`${formatGreen('✔')} Planned ${operationCount} operation(s)`);\n }\n\n const formatYellow = createColorFormatter(useColor, yellow);\n\n // Per-space breakdown takes precedence over the flat ops tree when\n // the aggregate flow surfaced one.\n if (result.perSpace && result.perSpace.length > 0) {\n lines.push('');\n lines.push(...formatPerSpaceBlock(result.perSpace, 'plan', useColor));\n const hasDestructive = result.perSpace.some((s) =>\n s.operations.some((op) => op.operationClass === 'destructive'),\n );\n if (hasDestructive) {\n lines.push('');\n lines.push(\n `${formatYellow('⚠')} This migration contains destructive operations that may cause data loss.`,\n );\n }\n } else if (result.plan?.operations && result.plan.operations.length > 0) {\n // Single-space fallback (no aggregate breakdown). Same flat tree\n // we've always rendered.\n lines.push(`${formatDimText('│')}`);\n for (let i = 0; i < result.plan.operations.length; i++) {\n const op = result.plan.operations[i];\n if (!op) continue;\n const isLast = i === result.plan.operations.length - 1;\n const treeChar = isLast ? '└' : '├';\n const destructiveMarker =\n op.operationClass === 'destructive' ? ` ${formatYellow('(destructive)')}` : '';\n lines.push(`${formatDimText(treeChar)}─ ${op.label}${destructiveMarker}`);\n }\n\n const hasDestructive = result.plan.operations.some((op) => op.operationClass === 'destructive');\n if (hasDestructive) {\n lines.push('');\n lines.push(\n `${formatYellow('⚠')} This migration contains destructive operations that may cause data loss.`,\n );\n }\n }\n\n // Destination hash\n if (result.plan?.destination) {\n lines.push('');\n lines.push(`${formatDimText(`Destination hash: ${result.plan.destination.storageHash}`)}`);\n }\n\n // Statement preview (any family that implements OperationPreviewCapable)\n const preview = result.plan?.preview;\n if (preview) {\n lines.push('');\n lines.push(`${formatDimText(previewBlockHeader(preview))}`);\n if (preview.statements.length === 0) {\n lines.push(`${formatDimText('No operations.')}`);\n } else {\n lines.push('');\n for (const statement of preview.statements) {\n const rendered = renderPreviewStatement(statement.text, statement.language);\n if (rendered) {\n lines.push(rendered);\n }\n }\n }\n }\n\n // Timings in verbose mode\n if (isVerbose(flags, 1)) {\n lines.push(`${formatDimText(`Total time: ${result.timings.total}ms`)}`);\n }\n\n // Note about dry run\n lines.push('');\n lines.push(`${formatDimText('This is a dry run. No changes were applied.')}`);\n lines.push(`${formatDimText('Run without --dry-run to apply changes.')}`);\n\n return lines.join('\\n');\n}\n\nexport interface MigrationApplyCommandOutputResult {\n readonly migrationsApplied: number;\n readonly markerHash: string;\n readonly applied: readonly {\n readonly spaceId: string;\n readonly dirName?: string;\n readonly migrationHash?: string;\n readonly from?: string;\n readonly to?: string;\n readonly operationsExecuted: number;\n }[];\n readonly summary: string;\n /**\n * Per-space breakdown in canonical schedule order (extensions\n * alphabetically, then app). Always present for the aggregate-walking\n * `migration apply` command.\n */\n readonly perSpace: readonly AggregatePerSpaceExecutionEntry[];\n readonly timings?: {\n readonly total: number;\n };\n}\n\nexport function formatMigrationApplyCommandOutput(\n result: MigrationApplyCommandOutputResult,\n flags: GlobalFlags,\n): string {\n if (flags.quiet) {\n return '';\n }\n\n const lines: string[] = [];\n const useColor = flags.color !== false;\n const formatGreen = createColorFormatter(useColor, green);\n const formatDimText = (text: string) => formatDim(useColor, text);\n\n lines.push(`${formatGreen('✔')} ${result.summary}`);\n\n if (result.perSpace.length > 0) {\n lines.push('');\n for (const line of formatPerSpaceBlock(result.perSpace, 'apply', useColor)) {\n lines.push(line);\n }\n }\n\n lines.push('');\n lines.push(formatDimText('Next: prisma-next migration status'));\n\n if (isVerbose(flags, 1) && result.timings) {\n lines.push('');\n lines.push(formatDimText(`Total time: ${result.timings.total}ms`));\n }\n\n return lines.join('\\n');\n}\n\ninterface MigrationShowSpacePresent {\n readonly kind: 'present';\n readonly spaceId: string;\n readonly dirName: string;\n readonly dirPath: string;\n readonly from: string | null;\n readonly to: string;\n readonly migrationHash: string;\n readonly createdAt: string;\n readonly operations: readonly {\n readonly id: string;\n readonly label: string;\n readonly operationClass: string;\n }[];\n readonly preview: OperationPreview;\n readonly summary: string;\n}\n\ninterface MigrationShowSpaceMissing {\n readonly kind: 'missing';\n readonly spaceId: string;\n readonly summary: string;\n}\n\ntype MigrationShowSpaceResult = MigrationShowSpacePresent | MigrationShowSpaceMissing;\n\ninterface MigrationShowResult {\n readonly spaces: readonly MigrationShowSpaceResult[];\n}\n\nfunction formatSpaceShowBlock(\n space: MigrationShowSpacePresent,\n useColor: boolean,\n): readonly string[] {\n const formatGreen = createColorFormatter(useColor, green);\n const formatYellow = createColorFormatter(useColor, yellow);\n const formatDimText = (text: string) => formatDim(useColor, text);\n\n const lines: string[] = [];\n lines.push(`${formatGreen('✔')} ${space.dirName}`);\n lines.push(`${formatDimText(` from: ${space.from ?? '(baseline)'}`)}`);\n lines.push(`${formatDimText(` to: ${space.to}`)}`);\n lines.push(`${formatDimText(` migrationHash: ${space.migrationHash}`)}`);\n lines.push(`${formatDimText(` created: ${space.createdAt}`)}`);\n\n lines.push('');\n lines.push(`${space.operations.length} operation(s)`);\n\n if (space.operations.length > 0) {\n lines.push(`${formatDimText('│')}`);\n for (let i = 0; i < space.operations.length; i++) {\n const op = space.operations[i]!;\n const isLast = i === space.operations.length - 1;\n const treeChar = isLast ? '└' : '├';\n const destructiveMarker =\n op.operationClass === 'destructive' ? ` ${formatYellow('(destructive)')}` : '';\n lines.push(`${formatDimText(treeChar)}─ ${op.label}${destructiveMarker}`);\n }\n\n const hasDestructive = space.operations.some((op) => op.operationClass === 'destructive');\n if (hasDestructive) {\n lines.push('');\n lines.push(\n `${formatYellow('⚠')} This migration contains destructive operations that may cause data loss.`,\n );\n }\n }\n\n if (space.preview.statements.length > 0) {\n lines.push('');\n lines.push(`${formatDimText(previewBlockHeader(space.preview))}`);\n lines.push('');\n for (const statement of space.preview.statements) {\n const rendered = renderPreviewStatement(statement.text, statement.language);\n if (rendered) {\n lines.push(rendered);\n }\n }\n }\n\n return lines;\n}\n\nexport function formatMigrationShowOutput(result: MigrationShowResult, flags: GlobalFlags): string {\n if (flags.quiet) {\n return '';\n }\n\n const useColor = flags.color !== false;\n const formatDimText = (text: string) => formatDim(useColor, text);\n const multipleSpaces = result.spaces.length > 1;\n const lines: string[] = [];\n\n for (let i = 0; i < result.spaces.length; i++) {\n const space = result.spaces[i]!;\n if (multipleSpaces) {\n lines.push(formatDimText(`── ${space.spaceId} ──`));\n }\n if (space.kind === 'missing') {\n lines.push(formatDimText(` ${space.summary}`));\n } else {\n for (const line of formatSpaceShowBlock(space, useColor)) {\n lines.push(line);\n }\n }\n if (i < result.spaces.length - 1) {\n lines.push('');\n }\n }\n\n return lines.join('\\n');\n}\n\n/**\n * Formats human-readable output for migration commands (db init, db update) in apply mode.\n */\nexport function formatMigrationApplyOutput(\n result: MigrationCommandResult,\n flags: GlobalFlags,\n): string {\n if (flags.quiet) {\n return '';\n }\n\n const lines: string[] = [];\n\n const useColor = flags.color !== false;\n const formatGreen = createColorFormatter(useColor, green);\n const formatDimText = (text: string) => formatDim(useColor, text);\n\n if (result.ok) {\n // Success summary\n const executed = result.execution?.operationsExecuted ?? 0;\n const spaceCount = result.perSpace?.length ?? 0;\n\n if (executed === 0) {\n const acrossClause =\n spaceCount > 0 ? ` across ${spaceCount} contract space${spaceCount === 1 ? '' : 's'}` : '';\n lines.push(`${formatGreen('✔')} Database already matches contract${acrossClause}`);\n } else if (spaceCount > 0) {\n lines.push(\n `${formatGreen('✔')} Applied ${executed} operation(s) across ${spaceCount} contract space${spaceCount === 1 ? '' : 's'}`,\n );\n } else {\n lines.push(`${formatGreen('✔')} Applied ${executed} operation(s)`);\n }\n\n // Per-space breakdown — replaces the single ambiguous `Signature:`\n // line with a per-space marker + ops listing.\n if (result.perSpace && result.perSpace.length > 0) {\n lines.push('');\n lines.push(...formatPerSpaceBlock(result.perSpace, 'apply', useColor));\n lines.push('');\n lines.push(\n formatDimText(\n `Run 'prisma-next migration status' to confirm ${\n spaceCount === 1 ? 'the space is' : 'all spaces are'\n } up to date.`,\n ),\n );\n } else if (result.marker) {\n // Single-space fallback (no aggregate breakdown surfaced — e.g.\n // older callers / non-aggregate code paths). The label is\n // `App-space marker` (not `Signature`) so that when only one\n // marker is observable we still name what it covers explicitly.\n lines.push(`${formatDimText(` App-space marker: ${result.marker.storageHash}`)}`);\n if (result.marker.profileHash) {\n lines.push(`${formatDimText(` Profile hash: ${result.marker.profileHash}`)}`);\n }\n }\n\n // Timings in verbose mode\n if (isVerbose(flags, 1)) {\n lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n }\n }\n\n return lines.join('\\n');\n}\n\n/**\n * Formats JSON output for migration commands (db init, db update).\n */\nexport function formatMigrationJson(result: MigrationCommandResult): string {\n return JSON.stringify(result, null, 2);\n}\n"],"mappings":";;;;;;;;;AAaA,SAAS,uBAAuB,MAAc,UAAsC;CAClF,MAAM,UAAU,KAAK,MAAM;CAC3B,IAAI,CAAC,SAAS,OAAO,KAAA;CACrB,IAAI,aAAa,OACf,OAAO,QAAQ,SAAS,IAAI,GAAG,UAAU,GAAG,QAAQ;CAEtD,OAAO;;;;;;;;;;;;;;AAeT,SAAgB,mBAAmB,SAAmC;CAGpE,OADE,QAAQ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IAAI,aAAa,GACtB,MAAM,KACJ,GAAG,YAAY,IAAI,CAAC,WAAW,SAAS,uBAAuB,WAAW,iBAAiB,eAAe,IAAI,KAAK,MACpH;OAED,MAAM,KAAK,GAAG,YAAY,IAAI,CAAC,WAAW,SAAS,eAAe;EAKpE,IAAI,OAAO,YAAY,OAAO,SAAS,SAAS,GAAG;GACjD,MAAM,KAAK,GAAG;GACd,MAAM,KAAK,GAAG,oBAAoB,OAAO,UAAU,SAAS,SAAS,CAAC;GACtE,MAAM,KAAK,GAAG;GACd,MAAM,KACJ,cACE,iDACE,eAAe,IAAI,iBAAiB,iBACrC,cACF,CACF;SACI,IAAI,OAAO,QAAQ;GAKxB,MAAM,KAAK,GAAG,cAAc,uBAAuB,OAAO,OAAO,cAAc,GAAG;GAClF,IAAI,OAAO,OAAO,aAChB,MAAM,KAAK,GAAG,cAAc,mBAAmB,OAAO,OAAO,cAAc,GAAG;;EAKlF,IAAI,UAAU,OAAO,EAAE,EACrB,MAAM,KAAK,GAAG,cAAc,iBAAiB,OAAO,QAAQ,MAAM,IAAI,GAAG;;CAI7E,OAAO,MAAM,KAAK,KAAK;;;;;AAMzB,SAAgB,oBAAoB,QAAwC;CAC1E,OAAO,KAAK,UAAU,QAAQ,MAAM,EAAE"}
|
|
@@ -316,10 +316,10 @@ interface EmitOptions {
|
|
|
316
316
|
* then app — together with the operations attributed to each space and,
|
|
317
317
|
* when the run was applied, the resulting per-space marker hash.
|
|
318
318
|
*
|
|
319
|
-
*
|
|
320
|
-
*
|
|
321
|
-
*
|
|
322
|
-
*
|
|
319
|
+
* Every space involved in a run is observable in the success summary,
|
|
320
|
+
* including its post-apply marker — the per-space marker is visible
|
|
321
|
+
* to the user instead of being collapsed into a single ambiguous
|
|
322
|
+
* top-level hash.
|
|
323
323
|
*/
|
|
324
324
|
interface AggregatePerSpaceExecutionEntry {
|
|
325
325
|
readonly spaceId: string;
|
|
@@ -516,8 +516,6 @@ type EmitResult = Result<EmitSuccess, EmitFailure>;
|
|
|
516
516
|
* through the shared `applyAggregate` primitive. The CLI command
|
|
517
517
|
* just resolves the descriptor surface (config, refs, contract
|
|
518
518
|
* envelope, app-space migration packages) and hands the inputs in.
|
|
519
|
-
*
|
|
520
|
-
* Sub-spec § `migration apply` semantics + § Required changes 1.
|
|
521
519
|
*/
|
|
522
520
|
interface MigrationApplyOptions {
|
|
523
521
|
/** Already-validated app contract (the canonical "where we are heading" hash). */
|
|
@@ -582,8 +580,8 @@ interface MigrationApplyAppliedEntry {
|
|
|
582
580
|
* Successful migrationApply result. Carries both the legacy
|
|
583
581
|
* single-space fields (`markerHash` is the **app member's** post-apply
|
|
584
582
|
* marker, surfaced for back-compat with single-space callers) and the
|
|
585
|
-
* per-space breakdown (`perSpace` — markers / operations
|
|
586
|
-
* order
|
|
583
|
+
* per-space breakdown (`perSpace` — markers / operations in canonical
|
|
584
|
+
* schedule order).
|
|
587
585
|
*/
|
|
588
586
|
/**
|
|
589
587
|
* Path-decision summary for the **app member** post-apply. Surfaced
|
|
@@ -855,4 +853,4 @@ interface ControlClient {
|
|
|
855
853
|
}
|
|
856
854
|
//#endregion
|
|
857
855
|
export { ExecuteDbVerifyOptions as A, EmitSuccess as C, SchemaVerifyOptions as D, OnControlProgress as E, executeDbVerify as M, SignOptions as O, EmitResult as S, MigrationApplyPathDecision as T, DbUpdateSuccess as _, ControlClient as a, EmitFailureCode as b, DbInitFailure as c, DbInitResult as d, DbInitSuccess as f, DbUpdateResult as g, DbUpdateOptions as h, ControlActionName as i, ExecuteDbVerifyResult as j, VerifyOptions as k, DbInitFailureCode as l, DbUpdateFailureCode as m, ContractEmitOptions as n, ControlClientOptions as o, DbUpdateFailure as p, ContractEmitResult as r, ControlProgressEvent as s, AggregatePerSpaceExecutionEntry as t, DbInitOptions as u, EmitContractConfig as v, IntrospectOptions as w, EmitOptions as x, EmitFailure as y };
|
|
858
|
-
//# sourceMappingURL=types-
|
|
856
|
+
//# sourceMappingURL=types-LItU7E4l.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-LItU7E4l.d.mts","names":[],"sources":["../src/control-api/operations/db-verify.ts","../src/control-api/types.ts"],"mappings":";;;;;;;;;;;;;;AAwCA;;;;;UAAiB,sBAAA;EAAA,SACN,MAAA,EAAQ,qBAAA,CAAsB,SAAA,EAAW,SAAA;EAAA,SACzC,cAAA,EAAgB,qBAAA,CAAsB,SAAA;EAAA,SACtC,QAAA,EAAU,QAAA;EAAA,SACV,aAAA;EAAA,SACA,QAAA,EAAU,SAAA;EAAA,SACV,cAAA,EAAgB,aAAA,CAAc,0BAAA,CAA2B,SAAA,EAAW,SAAA;EAAA,SACpE,mBAAA,EAAqB,aAAA,CAAc,8BAAA,CAA+B,SAAA,EAAW,SAAA;EAAA,SAC7E,IAAA;EAAA,SACA,UAAA;EAAA,SACA,UAAA;EAAA,SACA,UAAA,GAAa,iBAAA;AAAA;;;;;;;;;;;;;UAeP,sBAAA;EAAA,SACN,aAAA,EAAe,WAAA,SAAoB,0BAAA;EAAA,SACnC,WAAA;EAAA,SACA,UAAA;AAAA;AAAA,KAGC,qBAAA,GAAwB,MAAA,CAAO,sBAAA,EAAwB,kBAAA;;;;;;;;;;;;;;;;;iBAkB7C,eAAA,oDAAA,CACpB,OAAA,EAAS,sBAAA,CAAuB,SAAA,EAAW,SAAA,IAC1C,OAAA,CAAQ,qBAAA;;;;;;AApDX;;;;;;;;UCDiB,oBAAA;EAAA,SAEN,MAAA,EAAQ,uBAAA;EAAA,SAER,MAAA,EAAQ,uBAAA;EAAA,SAER,OAAA,EAAS,wBAAA;EDCqB;EAAA,SCE9B,MAAA,GAAS,uBAAA;EAAA,SAET,cAAA,GAAiB,aAAA,CAAc,0BAAA;EDH8C;;;;;EAAA,SCS7E,UAAA;AAAA;;;;KAUC,iBAAA;;;;;;;;;;;;;;KAwBA,oBAAA;EAAA,SAEG,MAAA,EAAQ,iBAAA;EAAA,SACR,IAAA;EAA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cAAA;;;;;;;;;EAUrC,kBAAA,CAAmB,UAAA,WAAqB,sBAAA,KAA2B,gBAAA;;;;;;;;EASnE,IAAA,CAAK,OAAA,EAAS,WAAA,GAAc,OAAA,CAAQ,UAAA;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma-next/cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -27,26 +27,26 @@
|
|
|
27
27
|
"string-width": "^8.2.1",
|
|
28
28
|
"strip-ansi": "^7.2.0",
|
|
29
29
|
"wrap-ansi": "^10.0.0",
|
|
30
|
-
"@prisma-next/
|
|
31
|
-
"@prisma-next/
|
|
32
|
-
"@prisma-next/
|
|
33
|
-
"@prisma-next/errors": "0.5.
|
|
34
|
-
"@prisma-next/
|
|
35
|
-
"@prisma-next/
|
|
36
|
-
"@prisma-next/
|
|
37
|
-
"@prisma-next/
|
|
30
|
+
"@prisma-next/config": "0.5.1",
|
|
31
|
+
"@prisma-next/contract": "0.5.1",
|
|
32
|
+
"@prisma-next/emitter": "0.5.1",
|
|
33
|
+
"@prisma-next/errors": "0.5.1",
|
|
34
|
+
"@prisma-next/framework-components": "0.5.1",
|
|
35
|
+
"@prisma-next/migration-tools": "0.5.1",
|
|
36
|
+
"@prisma-next/psl-printer": "0.5.1",
|
|
37
|
+
"@prisma-next/utils": "0.5.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/node": "24.10.4",
|
|
41
41
|
"tsdown": "0.22.0",
|
|
42
42
|
"typescript": "5.9.3",
|
|
43
43
|
"vitest": "4.1.5",
|
|
44
|
-
"@prisma-next/sql-contract": "0.5.
|
|
45
|
-
"@prisma-next/sql-contract-emitter": "0.5.
|
|
46
|
-
"@prisma-next/sql-contract-ts": "0.5.
|
|
47
|
-
"@prisma-next/sql-operations": "0.5.
|
|
48
|
-
"@prisma-next/sql-runtime": "0.5.0",
|
|
44
|
+
"@prisma-next/sql-contract": "0.5.1",
|
|
45
|
+
"@prisma-next/sql-contract-emitter": "0.5.1",
|
|
46
|
+
"@prisma-next/sql-contract-ts": "0.5.1",
|
|
47
|
+
"@prisma-next/sql-operations": "0.5.1",
|
|
49
48
|
"@prisma-next/test-utils": "0.0.1",
|
|
49
|
+
"@prisma-next/sql-runtime": "0.5.1",
|
|
50
50
|
"@prisma-next/tsconfig": "0.0.0",
|
|
51
51
|
"@prisma-next/tsdown": "0.0.0"
|
|
52
52
|
},
|
|
@@ -2,7 +2,6 @@ import { readFile } from 'node:fs/promises';
|
|
|
2
2
|
import type { Contract } from '@prisma-next/contract/types';
|
|
3
3
|
import { getEmittedArtifactPaths } from '@prisma-next/emitter';
|
|
4
4
|
import {
|
|
5
|
-
APP_SPACE_ID,
|
|
6
5
|
createControlStack,
|
|
7
6
|
hasOperationPreview,
|
|
8
7
|
type MigrationPlanOperation,
|
|
@@ -43,16 +42,9 @@ import {
|
|
|
43
42
|
setCommandDescriptions,
|
|
44
43
|
setCommandExamples,
|
|
45
44
|
} from '../utils/command-helpers';
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
|
|
49
|
-
runContractSpaceMigratePass,
|
|
50
|
-
} from '../utils/contract-space-migrate-pass';
|
|
51
|
-
import {
|
|
52
|
-
toExtensionInputs,
|
|
53
|
-
toExtensionMigrationsInputs,
|
|
54
|
-
toMigratePassInputs,
|
|
55
|
-
} from '../utils/extension-pack-inputs';
|
|
45
|
+
import { buildContractSpaceAggregate } from '../utils/contract-space-aggregate-loader';
|
|
46
|
+
import { runContractSpaceSeedPhase } from '../utils/contract-space-seed-phase';
|
|
47
|
+
import { toExtensionInputs } from '../utils/extension-pack-inputs';
|
|
56
48
|
import { formatStyledHeader } from '../utils/formatters/styled';
|
|
57
49
|
import { assertFrameworkComponentsCompatible } from '../utils/framework-components';
|
|
58
50
|
import type { CommonCommandOptions } from '../utils/global-flags';
|
|
@@ -241,41 +233,30 @@ async function executeMigrationPlanCommand(
|
|
|
241
233
|
);
|
|
242
234
|
}
|
|
243
235
|
|
|
244
|
-
//
|
|
245
|
-
//
|
|
246
|
-
//
|
|
247
|
-
//
|
|
248
|
-
//
|
|
249
|
-
// and the user is notified that the bump is being captured.
|
|
250
|
-
// Single descriptor-import boundary: every consumer of `extensionPacks`
|
|
251
|
-
// goes through `toExtensionInputs` + a per-consumer adapter. AC11.
|
|
236
|
+
// Phase 1 — seed: unconditionally re-emit per-space pinned artefacts
|
|
237
|
+
// (contract.json / contract.d.ts / refs/head.json) and materialise any
|
|
238
|
+
// descriptor-shipped migration packages not yet on disk. Runs before
|
|
239
|
+
// the no-op check so that an extension bump alone (with no structural
|
|
240
|
+
// app-space change) still re-pins extension artefacts on disk.
|
|
252
241
|
const canonicalExtensionInputs = toExtensionInputs(config.extensionPacks ?? []);
|
|
253
|
-
const
|
|
242
|
+
const seedResult = await runContractSpaceSeedPhase({
|
|
254
243
|
migrationsDir,
|
|
255
|
-
extensionPacks:
|
|
244
|
+
extensionPacks: canonicalExtensionInputs,
|
|
256
245
|
});
|
|
257
246
|
if (!flags.json && !flags.quiet) {
|
|
258
|
-
for (const
|
|
259
|
-
if (
|
|
260
|
-
|
|
247
|
+
for (const record of seedResult.seeded) {
|
|
248
|
+
if (record.action === 'updated') {
|
|
249
|
+
const pkgSuffix =
|
|
250
|
+
record.newMigrationDirs.length > 0
|
|
251
|
+
? `; ${record.newMigrationDirs.length} new migration package(s) materialised`
|
|
252
|
+
: '';
|
|
253
|
+
ui.step(`Updated ${record.spaceId} to ${record.newHash}${pkgSuffix}`);
|
|
261
254
|
}
|
|
262
255
|
}
|
|
263
256
|
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
// Idempotent (existing dirs are left untouched).
|
|
268
|
-
// Uses `planAllSpaces` for deterministic ordering + duplicate-spaceId
|
|
269
|
-
// detection.
|
|
270
|
-
const extensionMigrationsResult = await runContractSpaceExtensionMigrationsPass({
|
|
271
|
-
migrationsDir,
|
|
272
|
-
extensionPacks: toExtensionMigrationsInputs(canonicalExtensionInputs),
|
|
273
|
-
});
|
|
274
|
-
if (!flags.json && !flags.quiet) {
|
|
275
|
-
for (const entry of extensionMigrationsResult.emitted) {
|
|
276
|
-
ui.step(`Emitted ${entry.spaceId}/${entry.dirName}`);
|
|
277
|
-
}
|
|
278
|
-
}
|
|
257
|
+
const emittedExtensionDirs = seedResult.seeded.flatMap((r) =>
|
|
258
|
+
r.newMigrationDirs.map((dirName) => ({ spaceId: r.spaceId, dirName })),
|
|
259
|
+
);
|
|
279
260
|
|
|
280
261
|
// Check for no-op (same hash means no changes)
|
|
281
262
|
if (fromHash === toStorageHash) {
|
|
@@ -285,7 +266,7 @@ async function executeMigrationPlanCommand(
|
|
|
285
266
|
from: fromHash,
|
|
286
267
|
to: toStorageHash,
|
|
287
268
|
operations: [],
|
|
288
|
-
emittedExtensionDirs
|
|
269
|
+
emittedExtensionDirs,
|
|
289
270
|
summary: 'No changes detected between contracts',
|
|
290
271
|
timings: { total: Date.now() - startTime },
|
|
291
272
|
};
|
|
@@ -301,6 +282,25 @@ async function executeMigrationPlanCommand(
|
|
|
301
282
|
}),
|
|
302
283
|
);
|
|
303
284
|
}
|
|
285
|
+
|
|
286
|
+
// Phase 2 — load: build the aggregate against the now-consistent disk
|
|
287
|
+
// state that phase 1 just seeded. The seed phase guarantees every
|
|
288
|
+
// declared extension has its head ref pinned, so the loader's
|
|
289
|
+
// declaredButUnmigrated precheck always passes here.
|
|
290
|
+
const stack = createControlStack(config);
|
|
291
|
+
const familyInstance = config.family.create(stack);
|
|
292
|
+
const aggregateResult = await buildContractSpaceAggregate({
|
|
293
|
+
targetId: config.target.targetId,
|
|
294
|
+
migrationsDir,
|
|
295
|
+
appContract: toContractJson,
|
|
296
|
+
extensionPacks: config.extensionPacks ?? [],
|
|
297
|
+
validateContract: (json: unknown) => familyInstance.validateContract(json),
|
|
298
|
+
});
|
|
299
|
+
if (!aggregateResult.ok) {
|
|
300
|
+
return notOk(aggregateResult.failure);
|
|
301
|
+
}
|
|
302
|
+
const aggregate = aggregateResult.value;
|
|
303
|
+
|
|
304
304
|
const frameworkComponents = assertFrameworkComponentsCompatible(
|
|
305
305
|
config.family.familyId,
|
|
306
306
|
config.target.targetId,
|
|
@@ -328,17 +328,15 @@ async function executeMigrationPlanCommand(
|
|
|
328
328
|
};
|
|
329
329
|
|
|
330
330
|
try {
|
|
331
|
-
const stack = createControlStack(config);
|
|
332
|
-
const familyInstance = config.family.create(stack);
|
|
333
331
|
const planner = migrations.createPlanner(familyInstance);
|
|
334
332
|
const fromSchema = migrations.contractToSchema(fromContract, frameworkComponents);
|
|
335
333
|
const plannerResult = planner.plan({
|
|
336
|
-
contract:
|
|
334
|
+
contract: aggregate.app.contract,
|
|
337
335
|
schema: fromSchema,
|
|
338
336
|
policy: { allowedOperationClasses: ['additive', 'widening', 'destructive', 'data'] },
|
|
339
337
|
fromContract,
|
|
340
338
|
frameworkComponents,
|
|
341
|
-
spaceId:
|
|
339
|
+
spaceId: aggregate.app.spaceId,
|
|
342
340
|
});
|
|
343
341
|
if (plannerResult.kind === 'failure') {
|
|
344
342
|
return notOk(
|
|
@@ -421,7 +419,7 @@ async function executeMigrationPlanCommand(
|
|
|
421
419
|
to: toStorageHash,
|
|
422
420
|
dir: relative(process.cwd(), packageDir),
|
|
423
421
|
operations: [],
|
|
424
|
-
emittedExtensionDirs
|
|
422
|
+
emittedExtensionDirs,
|
|
425
423
|
pendingPlaceholders: true,
|
|
426
424
|
summary:
|
|
427
425
|
'Planned migration with placeholder(s) — edit migration.ts then run `node migration.ts` to self-emit',
|
|
@@ -444,9 +442,9 @@ async function executeMigrationPlanCommand(
|
|
|
444
442
|
label: op.label,
|
|
445
443
|
operationClass: op.operationClass,
|
|
446
444
|
})),
|
|
447
|
-
emittedExtensionDirs
|
|
445
|
+
emittedExtensionDirs,
|
|
448
446
|
...(preview !== undefined ? { preview } : {}),
|
|
449
|
-
summary: buildPlanSummary(plannedOps.length,
|
|
447
|
+
summary: buildPlanSummary(plannedOps.length, emittedExtensionDirs.length),
|
|
450
448
|
timings: { total: Date.now() - startTime },
|
|
451
449
|
};
|
|
452
450
|
return ok(result);
|