@prisma-next/migration-tools 0.3.0-dev.99 → 0.3.0
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 +10 -8
- package/dist/constants-9f-bCq8Y.mjs +10 -0
- package/dist/constants-9f-bCq8Y.mjs.map +1 -0
- package/dist/{errors-CqLiJwqA.mjs → errors-CSAAto11.mjs} +17 -17
- package/dist/errors-CSAAto11.mjs.map +1 -0
- package/dist/exports/attestation.d.mts +1 -1
- package/dist/exports/attestation.d.mts.map +1 -1
- package/dist/exports/attestation.mjs +4 -7
- package/dist/exports/attestation.mjs.map +1 -1
- package/dist/exports/constants.d.mts +9 -0
- package/dist/exports/constants.d.mts.map +1 -0
- package/dist/exports/constants.mjs +3 -0
- package/dist/exports/dag.d.mts +9 -9
- package/dist/exports/dag.mjs +18 -18
- package/dist/exports/dag.mjs.map +1 -1
- package/dist/exports/io.d.mts +6 -4
- package/dist/exports/io.d.mts.map +1 -1
- package/dist/exports/io.mjs +2 -2
- package/dist/exports/migration-ts.d.mts +34 -0
- package/dist/exports/migration-ts.d.mts.map +1 -0
- package/dist/exports/migration-ts.mjs +125 -0
- package/dist/exports/migration-ts.mjs.map +1 -0
- package/dist/exports/refs.mjs +1 -1
- package/dist/exports/types.d.mts +3 -3
- package/dist/exports/types.mjs +5 -2
- package/dist/exports/types.mjs.map +1 -1
- package/dist/{io-afog-e8J.mjs → io-LsuurzNb.mjs} +10 -4
- package/dist/io-LsuurzNb.mjs.map +1 -0
- package/dist/{types-9YQfIg6N.d.mts → types-BW_pJEe8.d.mts} +13 -9
- package/dist/types-BW_pJEe8.d.mts.map +1 -0
- package/package.json +12 -4
- package/src/attestation.ts +3 -5
- package/src/constants.ts +5 -0
- package/src/dag.ts +21 -21
- package/src/errors.ts +35 -27
- package/src/exports/constants.ts +1 -0
- package/src/exports/io.ts +2 -0
- package/src/exports/migration-ts.ts +6 -0
- package/src/exports/types.ts +5 -3
- package/src/io.ts +16 -5
- package/src/migration-ts.ts +199 -0
- package/src/types.ts +15 -7
- package/dist/errors-CqLiJwqA.mjs.map +0 -1
- package/dist/io-afog-e8J.mjs.map +0 -1
- package/dist/types-9YQfIg6N.d.mts.map +0 -1
package/src/exports/io.ts
CHANGED
package/src/exports/types.ts
CHANGED
|
@@ -2,13 +2,15 @@ export { MigrationToolsError } from '../errors';
|
|
|
2
2
|
export type {
|
|
3
3
|
AttestedMigrationBundle,
|
|
4
4
|
AttestedMigrationManifest,
|
|
5
|
+
BaseMigrationBundle,
|
|
6
|
+
BaseMigrationBundle as MigrationBundle,
|
|
7
|
+
BaseMigrationBundle as MigrationPackage,
|
|
8
|
+
DraftMigrationBundle,
|
|
5
9
|
DraftMigrationManifest,
|
|
6
|
-
MigrationBundle,
|
|
7
|
-
MigrationBundle as MigrationPackage,
|
|
8
10
|
MigrationChainEntry,
|
|
9
11
|
MigrationGraph,
|
|
10
12
|
MigrationHints,
|
|
11
13
|
MigrationManifest,
|
|
12
14
|
MigrationOps,
|
|
13
15
|
} from '../types';
|
|
14
|
-
export { isAttested } from '../types';
|
|
16
|
+
export { isAttested, isDraft } from '../types';
|
package/src/io.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
errorInvalidSlug,
|
|
9
9
|
errorMissingFile,
|
|
10
10
|
} from './errors';
|
|
11
|
-
import type {
|
|
11
|
+
import type { BaseMigrationBundle, MigrationManifest, MigrationOps } from './types';
|
|
12
12
|
|
|
13
13
|
const MANIFEST_FILE = 'migration.json';
|
|
14
14
|
const OPS_FILE = 'ops.json';
|
|
@@ -48,7 +48,7 @@ const MigrationManifestSchema = type({
|
|
|
48
48
|
const MigrationOpSchema = type({
|
|
49
49
|
id: 'string',
|
|
50
50
|
label: 'string',
|
|
51
|
-
operationClass: "'additive' | 'widening' | 'destructive'",
|
|
51
|
+
operationClass: "'additive' | 'widening' | 'destructive' | 'data'",
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
// Intentionally shallow: operation-specific payload validation is owned by planner/runner layers.
|
|
@@ -74,7 +74,18 @@ export async function writeMigrationPackage(
|
|
|
74
74
|
await writeFile(join(dir, OPS_FILE), JSON.stringify(ops, null, 2), { flag: 'wx' });
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
export async function
|
|
77
|
+
export async function writeMigrationManifest(
|
|
78
|
+
dir: string,
|
|
79
|
+
manifest: MigrationManifest,
|
|
80
|
+
): Promise<void> {
|
|
81
|
+
await writeFile(join(dir, MANIFEST_FILE), `${JSON.stringify(manifest, null, 2)}\n`);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export async function writeMigrationOps(dir: string, ops: MigrationOps): Promise<void> {
|
|
85
|
+
await writeFile(join(dir, OPS_FILE), `${JSON.stringify(ops, null, 2)}\n`);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export async function readMigrationPackage(dir: string): Promise<BaseMigrationBundle> {
|
|
78
89
|
const manifestPath = join(dir, MANIFEST_FILE);
|
|
79
90
|
const opsPath = join(dir, OPS_FILE);
|
|
80
91
|
|
|
@@ -142,7 +153,7 @@ function validateOps(ops: unknown, filePath: string): asserts ops is MigrationOp
|
|
|
142
153
|
|
|
143
154
|
export async function readMigrationsDir(
|
|
144
155
|
migrationsRoot: string,
|
|
145
|
-
): Promise<readonly
|
|
156
|
+
): Promise<readonly BaseMigrationBundle[]> {
|
|
146
157
|
let entries: string[];
|
|
147
158
|
try {
|
|
148
159
|
entries = await readdir(migrationsRoot);
|
|
@@ -153,7 +164,7 @@ export async function readMigrationsDir(
|
|
|
153
164
|
throw error;
|
|
154
165
|
}
|
|
155
166
|
|
|
156
|
-
const packages:
|
|
167
|
+
const packages: BaseMigrationBundle[] = [];
|
|
157
168
|
|
|
158
169
|
for (const entry of entries.sort()) {
|
|
159
170
|
const entryPath = join(migrationsRoot, entry);
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utilities for scaffolding and evaluating migration.ts files.
|
|
3
|
+
*
|
|
4
|
+
* - scaffoldMigrationTs: writes a migration.ts file with boilerplate
|
|
5
|
+
* - evaluateMigrationTs: loads migration.ts via native Node import, returns descriptors
|
|
6
|
+
*
|
|
7
|
+
* Shared by migration plan (scaffold), migration new (scaffold), and
|
|
8
|
+
* migration verify (evaluate).
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { stat, writeFile } from 'node:fs/promises';
|
|
12
|
+
import type { OperationDescriptor } from '@prisma-next/framework-components/control';
|
|
13
|
+
import { join, relative, resolve } from 'pathe';
|
|
14
|
+
|
|
15
|
+
const MIGRATION_TS_FILE = 'migration.ts';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Options for scaffolding a migration.ts file.
|
|
19
|
+
*/
|
|
20
|
+
export interface ScaffoldOptions {
|
|
21
|
+
/** Operation descriptors to serialize as builder calls. */
|
|
22
|
+
readonly descriptors?: readonly OperationDescriptor[];
|
|
23
|
+
/** Absolute path to contract.json — used to derive contract.d.ts import for typed builders. */
|
|
24
|
+
readonly contractJsonPath?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function serializeQueryInput(input: unknown): string {
|
|
28
|
+
if (typeof input === 'boolean') return String(input);
|
|
29
|
+
if (typeof input === 'symbol') return 'TODO /* fill in using db.sql.from(...) */';
|
|
30
|
+
if (input === null || input === undefined) return 'null';
|
|
31
|
+
if (Array.isArray(input)) {
|
|
32
|
+
if (input.length === 0) return '[]';
|
|
33
|
+
if (input.every((item) => typeof item === 'symbol'))
|
|
34
|
+
return '[TODO /* fill in using db.sql.from(...) */]';
|
|
35
|
+
return `[${input.map(serializeQueryInput).join(', ')}]`;
|
|
36
|
+
}
|
|
37
|
+
return JSON.stringify(input);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function descriptorToBuilderCall(desc: OperationDescriptor): string {
|
|
41
|
+
switch (desc.kind) {
|
|
42
|
+
case 'createTable':
|
|
43
|
+
return `createTable(${JSON.stringify(desc['table'])})`;
|
|
44
|
+
case 'dropTable':
|
|
45
|
+
return `dropTable(${JSON.stringify(desc['table'])})`;
|
|
46
|
+
case 'addColumn': {
|
|
47
|
+
const args = [JSON.stringify(desc['table']), JSON.stringify(desc['column'])];
|
|
48
|
+
if (desc['overrides']) {
|
|
49
|
+
args.push(JSON.stringify(desc['overrides']));
|
|
50
|
+
}
|
|
51
|
+
return `addColumn(${args.join(', ')})`;
|
|
52
|
+
}
|
|
53
|
+
case 'dropColumn':
|
|
54
|
+
return `dropColumn(${JSON.stringify(desc['table'])}, ${JSON.stringify(desc['column'])})`;
|
|
55
|
+
case 'alterColumnType': {
|
|
56
|
+
const opts: Record<string, unknown> = {};
|
|
57
|
+
if (desc['using']) opts['using'] = desc['using'];
|
|
58
|
+
if (desc['toType']) opts['toType'] = desc['toType'];
|
|
59
|
+
const hasOpts = Object.keys(opts).length > 0;
|
|
60
|
+
return hasOpts
|
|
61
|
+
? `alterColumnType(${JSON.stringify(desc['table'])}, ${JSON.stringify(desc['column'])}, ${JSON.stringify(opts)})`
|
|
62
|
+
: `alterColumnType(${JSON.stringify(desc['table'])}, ${JSON.stringify(desc['column'])})`;
|
|
63
|
+
}
|
|
64
|
+
case 'setNotNull':
|
|
65
|
+
return `setNotNull(${JSON.stringify(desc['table'])}, ${JSON.stringify(desc['column'])})`;
|
|
66
|
+
case 'dropNotNull':
|
|
67
|
+
return `dropNotNull(${JSON.stringify(desc['table'])}, ${JSON.stringify(desc['column'])})`;
|
|
68
|
+
case 'setDefault':
|
|
69
|
+
return `setDefault(${JSON.stringify(desc['table'])}, ${JSON.stringify(desc['column'])})`;
|
|
70
|
+
case 'dropDefault':
|
|
71
|
+
return `dropDefault(${JSON.stringify(desc['table'])}, ${JSON.stringify(desc['column'])})`;
|
|
72
|
+
case 'addPrimaryKey':
|
|
73
|
+
return `addPrimaryKey(${JSON.stringify(desc['table'])})`;
|
|
74
|
+
case 'addUnique':
|
|
75
|
+
return `addUnique(${JSON.stringify(desc['table'])}, ${JSON.stringify(desc['columns'])})`;
|
|
76
|
+
case 'addForeignKey':
|
|
77
|
+
return `addForeignKey(${JSON.stringify(desc['table'])}, ${JSON.stringify(desc['columns'])})`;
|
|
78
|
+
case 'dropConstraint':
|
|
79
|
+
return `dropConstraint(${JSON.stringify(desc['table'])}, ${JSON.stringify(desc['constraintName'])})`;
|
|
80
|
+
case 'createIndex':
|
|
81
|
+
return `createIndex(${JSON.stringify(desc['table'])}, ${JSON.stringify(desc['columns'])})`;
|
|
82
|
+
case 'dropIndex':
|
|
83
|
+
return `dropIndex(${JSON.stringify(desc['table'])}, ${JSON.stringify(desc['indexName'])})`;
|
|
84
|
+
case 'createEnumType':
|
|
85
|
+
return desc['values']
|
|
86
|
+
? `createEnumType(${JSON.stringify(desc['typeName'])}, ${JSON.stringify(desc['values'])})`
|
|
87
|
+
: `createEnumType(${JSON.stringify(desc['typeName'])})`;
|
|
88
|
+
case 'addEnumValues':
|
|
89
|
+
return `addEnumValues(${JSON.stringify(desc['typeName'])}, ${JSON.stringify(desc['values'])})`;
|
|
90
|
+
case 'dropEnumType':
|
|
91
|
+
return `dropEnumType(${JSON.stringify(desc['typeName'])})`;
|
|
92
|
+
case 'renameType':
|
|
93
|
+
return `renameType(${JSON.stringify(desc['fromName'])}, ${JSON.stringify(desc['toName'])})`;
|
|
94
|
+
case 'createDependency':
|
|
95
|
+
return `createDependency(${JSON.stringify(desc['dependencyId'])})`;
|
|
96
|
+
case 'dataTransform':
|
|
97
|
+
return `dataTransform(${JSON.stringify(desc['name'])}, {\n check: ${serializeQueryInput(desc['check'])},\n run: ${serializeQueryInput(desc['run'])},\n })`;
|
|
98
|
+
default:
|
|
99
|
+
throw new Error(`Unknown descriptor kind: ${desc.kind}`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Scaffolds a migration.ts file in the given package directory.
|
|
105
|
+
* Serializes operation descriptors as builder calls that the user can edit.
|
|
106
|
+
* On verify, this file is re-evaluated to produce the final ops.
|
|
107
|
+
*/
|
|
108
|
+
export async function scaffoldMigrationTs(
|
|
109
|
+
packageDir: string,
|
|
110
|
+
options: ScaffoldOptions = {},
|
|
111
|
+
): Promise<void> {
|
|
112
|
+
const filePath = join(packageDir, MIGRATION_TS_FILE);
|
|
113
|
+
|
|
114
|
+
const descriptors = options.descriptors ?? [];
|
|
115
|
+
const hasDataTransform = descriptors.some((d) => d.kind === 'dataTransform');
|
|
116
|
+
|
|
117
|
+
const lines: string[] = [];
|
|
118
|
+
|
|
119
|
+
if (hasDataTransform && options.contractJsonPath) {
|
|
120
|
+
const relativeContractDts = relative(packageDir, options.contractJsonPath).replace(
|
|
121
|
+
/\.json$/,
|
|
122
|
+
'.d',
|
|
123
|
+
);
|
|
124
|
+
lines.push(`import type { Contract } from "${relativeContractDts}"`);
|
|
125
|
+
lines.push(`import { createBuilders } from "@prisma-next/target-postgres/migration-builders"`);
|
|
126
|
+
lines.push('');
|
|
127
|
+
const importList = [...new Set(descriptors.map((d) => d.kind))];
|
|
128
|
+
importList.push('TODO');
|
|
129
|
+
lines.push(`const { ${importList.join(', ')} } = createBuilders<Contract>()`);
|
|
130
|
+
} else {
|
|
131
|
+
const importList = [...new Set(descriptors.map((d) => d.kind))];
|
|
132
|
+
if (importList.length === 0) {
|
|
133
|
+
importList.push('createTable');
|
|
134
|
+
}
|
|
135
|
+
if (hasDataTransform) {
|
|
136
|
+
importList.push('TODO');
|
|
137
|
+
}
|
|
138
|
+
lines.push(
|
|
139
|
+
`import { ${importList.join(', ')} } from "@prisma-next/target-postgres/migration-builders"`,
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const calls = descriptors.map((d) => ` ${descriptorToBuilderCall(d)},`).join('\n');
|
|
144
|
+
const body = calls.length > 0 ? `\n${calls}\n` : '';
|
|
145
|
+
|
|
146
|
+
lines.push('');
|
|
147
|
+
lines.push(`export default () => [${body}]`);
|
|
148
|
+
lines.push('');
|
|
149
|
+
|
|
150
|
+
await writeFile(filePath, lines.join('\n'));
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Checks whether a migration.ts file exists in the package directory.
|
|
155
|
+
*/
|
|
156
|
+
export async function hasMigrationTs(packageDir: string): Promise<boolean> {
|
|
157
|
+
try {
|
|
158
|
+
const s = await stat(join(packageDir, MIGRATION_TS_FILE));
|
|
159
|
+
return s.isFile();
|
|
160
|
+
} catch {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Evaluates a migration.ts file by loading it via native Node import.
|
|
167
|
+
* Returns the result of calling the default export (expected to be a
|
|
168
|
+
* function returning an array of operation descriptors).
|
|
169
|
+
*
|
|
170
|
+
* Requires Node ≥24 for native TypeScript support.
|
|
171
|
+
*/
|
|
172
|
+
export async function evaluateMigrationTs(packageDir: string): Promise<readonly unknown[]> {
|
|
173
|
+
const filePath = resolve(join(packageDir, MIGRATION_TS_FILE));
|
|
174
|
+
|
|
175
|
+
try {
|
|
176
|
+
await stat(filePath);
|
|
177
|
+
} catch {
|
|
178
|
+
throw new Error(`migration.ts not found at "${filePath}"`);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Use native Node TS import (Node ≥24, stable type stripping)
|
|
182
|
+
const mod = (await import(filePath)) as { default?: unknown };
|
|
183
|
+
|
|
184
|
+
if (typeof mod.default !== 'function') {
|
|
185
|
+
throw new Error(
|
|
186
|
+
`migration.ts must export a default function returning an operation list. Got: ${typeof mod.default}`,
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const result: unknown = mod.default();
|
|
191
|
+
|
|
192
|
+
if (!Array.isArray(result)) {
|
|
193
|
+
throw new Error(
|
|
194
|
+
`migration.ts default export must return an array of operations. Got: ${typeof result}`,
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return result;
|
|
199
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { MigrationPlanOperation } from '@prisma-next/
|
|
1
|
+
import type { Contract } from '@prisma-next/contract/types';
|
|
2
|
+
import type { MigrationPlanOperation } from '@prisma-next/framework-components/control';
|
|
3
3
|
|
|
4
4
|
export interface MigrationHints {
|
|
5
5
|
readonly used: readonly string[];
|
|
@@ -15,8 +15,8 @@ interface MigrationManifestBase {
|
|
|
15
15
|
readonly from: string;
|
|
16
16
|
readonly to: string;
|
|
17
17
|
readonly kind: 'regular' | 'baseline';
|
|
18
|
-
readonly fromContract:
|
|
19
|
-
readonly toContract:
|
|
18
|
+
readonly fromContract: Contract | null;
|
|
19
|
+
readonly toContract: Contract;
|
|
20
20
|
readonly hints: MigrationHints;
|
|
21
21
|
readonly labels: readonly string[];
|
|
22
22
|
readonly authorship?: { readonly author?: string; readonly email?: string };
|
|
@@ -54,7 +54,7 @@ export type MigrationOps = readonly MigrationPlanOperation[];
|
|
|
54
54
|
* An on-disk migration directory containing a manifest and operations.
|
|
55
55
|
* The manifest may be draft or attested.
|
|
56
56
|
*/
|
|
57
|
-
export interface
|
|
57
|
+
export interface BaseMigrationBundle {
|
|
58
58
|
readonly dirName: string;
|
|
59
59
|
readonly dirPath: string;
|
|
60
60
|
readonly manifest: MigrationManifest;
|
|
@@ -65,10 +65,14 @@ export interface MigrationBundle {
|
|
|
65
65
|
* A bundle known to be attested (migrationId is a string).
|
|
66
66
|
* Use this after filtering bundles to attested-only.
|
|
67
67
|
*/
|
|
68
|
-
export interface AttestedMigrationBundle extends
|
|
68
|
+
export interface AttestedMigrationBundle extends BaseMigrationBundle {
|
|
69
69
|
readonly manifest: AttestedMigrationManifest;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
export interface DraftMigrationBundle extends BaseMigrationBundle {
|
|
73
|
+
readonly manifest: DraftMigrationManifest;
|
|
74
|
+
}
|
|
75
|
+
|
|
72
76
|
/**
|
|
73
77
|
* An entry in the migration graph. Only attested migrations appear in the
|
|
74
78
|
* graph, so `migrationId` is always a string.
|
|
@@ -93,6 +97,10 @@ export interface MigrationGraph {
|
|
|
93
97
|
* Type guard that narrows a MigrationBundle to an AttestedMigrationBundle.
|
|
94
98
|
* Use with `.filter(isAttested)` to get a typed array of attested bundles.
|
|
95
99
|
*/
|
|
96
|
-
export function isAttested(bundle:
|
|
100
|
+
export function isAttested(bundle: BaseMigrationBundle): bundle is AttestedMigrationBundle {
|
|
97
101
|
return typeof bundle.manifest.migrationId === 'string';
|
|
98
102
|
}
|
|
103
|
+
|
|
104
|
+
export function isDraft(bundle: BaseMigrationBundle): bundle is DraftMigrationBundle {
|
|
105
|
+
return bundle.manifest.migrationId === null;
|
|
106
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors-CqLiJwqA.mjs","names":[],"sources":["../src/errors.ts"],"sourcesContent":["/**\n * Structured error for migration tooling operations.\n *\n * Follows the NAMESPACE.SUBCODE convention from ADR 027. All codes live under\n * the MIGRATION namespace. These are tooling-time errors (file I/O, attestation,\n * migration-chain reconstruction), distinct from the runtime MIGRATION.* codes for apply-time\n * failures (PRECHECK_FAILED, POSTCHECK_FAILED, etc.).\n *\n * Fields:\n * - code: Stable machine-readable code (MIGRATION.SUBCODE)\n * - category: Always 'MIGRATION'\n * - why: Explains the cause in plain language\n * - fix: Actionable remediation step\n * - details: Machine-readable structured data for agents\n */\nexport class MigrationToolsError extends Error {\n readonly code: string;\n readonly category = 'MIGRATION' as const;\n readonly why: string;\n readonly fix: string;\n readonly details: Record<string, unknown> | undefined;\n\n constructor(\n code: string,\n summary: string,\n options: {\n readonly why: string;\n readonly fix: string;\n readonly details?: Record<string, unknown>;\n },\n ) {\n super(summary);\n this.name = 'MigrationToolsError';\n this.code = code;\n this.why = options.why;\n this.fix = options.fix;\n this.details = options.details;\n }\n\n static is(error: unknown): error is MigrationToolsError {\n if (!(error instanceof Error)) return false;\n const candidate = error as MigrationToolsError;\n return candidate.name === 'MigrationToolsError' && typeof candidate.code === 'string';\n }\n}\n\nexport function errorDirectoryExists(dir: string): MigrationToolsError {\n return new MigrationToolsError('MIGRATION.DIR_EXISTS', 'Migration directory already exists', {\n why: `The directory \"${dir}\" already exists. Each migration must have a unique directory.`,\n fix: 'Use --name to pick a different name, or delete the existing directory and re-run.',\n details: { dir },\n });\n}\n\nexport function errorMissingFile(file: string, dir: string): MigrationToolsError {\n return new MigrationToolsError('MIGRATION.FILE_MISSING', `Missing ${file}`, {\n why: `Expected \"${file}\" in \"${dir}\" but the file does not exist.`,\n fix: 'Ensure the migration directory contains both migration.json and ops.json. If the directory is corrupt, delete it and re-run migration plan.',\n details: { file, dir },\n });\n}\n\nexport function errorInvalidJson(filePath: string, parseError: string): MigrationToolsError {\n return new MigrationToolsError('MIGRATION.INVALID_JSON', 'Invalid JSON in migration file', {\n why: `Failed to parse \"${filePath}\": ${parseError}`,\n fix: 'Fix the JSON syntax error, or delete the migration directory and re-run migration plan.',\n details: { filePath, parseError },\n });\n}\n\nexport function errorInvalidManifest(filePath: string, reason: string): MigrationToolsError {\n return new MigrationToolsError('MIGRATION.INVALID_MANIFEST', 'Invalid migration manifest', {\n why: `Manifest at \"${filePath}\" is invalid: ${reason}`,\n fix: 'Ensure the manifest has all required fields (from, to, kind, toContract). If corrupt, delete and re-plan.',\n details: { filePath, reason },\n });\n}\n\nexport function errorInvalidSlug(slug: string): MigrationToolsError {\n return new MigrationToolsError('MIGRATION.INVALID_NAME', 'Invalid migration name', {\n why: `The slug \"${slug}\" contains no valid characters after sanitization (only a-z, 0-9 are kept).`,\n fix: 'Provide a name with at least one alphanumeric character, e.g. --name add_users.',\n details: { slug },\n });\n}\n\nexport function errorSelfLoop(dirName: string, hash: string): MigrationToolsError {\n return new MigrationToolsError('MIGRATION.SELF_LOOP', 'Self-loop in migration graph', {\n why: `Migration \"${dirName}\" has from === to === \"${hash}\". A migration must transition between two different contract states.`,\n fix: 'Delete the invalid migration directory and re-run migration plan.',\n details: { dirName, hash },\n });\n}\n\nexport function errorAmbiguousLeaf(\n leaves: readonly string[],\n context?: {\n divergencePoint: string;\n branches: readonly {\n leaf: string;\n edges: readonly { dirName: string; from: string; to: string }[];\n }[];\n },\n): MigrationToolsError {\n const divergenceInfo = context\n ? `\\nDivergence point: ${context.divergencePoint}\\nBranches:\\n${context.branches.map((b) => ` → ${b.leaf} (${b.edges.length} edge(s): ${b.edges.map((e) => e.dirName).join(' → ') || 'direct'})`).join('\\n')}`\n : '';\n return new MigrationToolsError('MIGRATION.AMBIGUOUS_LEAF', 'Ambiguous migration graph', {\n why: `Multiple leaf nodes found: ${leaves.join(', ')}. The migration graph has diverged — this typically happens when two developers plan migrations from the same starting point.${divergenceInfo}`,\n fix: 'Use `migration ref set <name> <hash>` to target a specific branch, delete one of the conflicting migration directories and re-run `migration plan`, or use --from <hash> to explicitly select a starting point.',\n details: {\n leaves,\n ...(context ? { divergencePoint: context.divergencePoint, branches: context.branches } : {}),\n },\n });\n}\n\nexport function errorNoRoot(nodes: readonly string[]): MigrationToolsError {\n return new MigrationToolsError('MIGRATION.NO_ROOT', 'Migration graph has no root', {\n why: `No root migration found in the migration graph (nodes: ${nodes.join(', ')}). No migration starts from the empty contract hash, or all edges form a disconnected subgraph.`,\n fix: 'Inspect the migrations directory for corrupted migration.json files. At least one migration must start from the empty contract hash.',\n details: { nodes },\n });\n}\n\nexport function errorInvalidRefs(refsPath: string, reason: string): MigrationToolsError {\n return new MigrationToolsError('MIGRATION.INVALID_REFS', 'Invalid refs.json', {\n why: `refs.json at \"${refsPath}\" is invalid: ${reason}`,\n fix: 'Ensure refs.json is a flat object mapping valid ref names to contract hash strings.',\n details: { path: refsPath, reason },\n });\n}\n\nexport function errorInvalidRefName(refName: string): MigrationToolsError {\n return new MigrationToolsError('MIGRATION.INVALID_REF_NAME', 'Invalid ref name', {\n why: `Ref name \"${refName}\" is invalid. Names must be lowercase alphanumeric with hyphens or forward slashes (no \".\" or \"..\" segments).`,\n fix: `Use a valid ref name (e.g., \"staging\", \"envs/production\").`,\n details: { refName },\n });\n}\n\nexport function errorNoResolvableLeaf(reachableNodes: readonly string[]): MigrationToolsError {\n return new MigrationToolsError(\n 'MIGRATION.NO_RESOLVABLE_LEAF',\n 'Migration graph has no resolvable leaf',\n {\n why: `The migration graph contains cycles and no node has zero outgoing edges (reachable nodes: ${reachableNodes.join(', ')}). This typically happens after rollback migrations (e.g., C1→C2→C1).`,\n fix: 'Use --from <hash> to specify the planning origin explicitly.',\n details: { reachableNodes },\n },\n );\n}\n\nexport function errorInvalidRefValue(value: string): MigrationToolsError {\n return new MigrationToolsError('MIGRATION.INVALID_REF_VALUE', 'Invalid ref value', {\n why: `Ref value \"${value}\" is not a valid contract hash. Values must be in the format \"sha256:<64 hex chars>\" or \"sha256:empty\".`,\n fix: 'Use a valid storage hash from `prisma-next contract emit` output or an existing migration.',\n details: { value },\n });\n}\n\nexport function errorDuplicateMigrationId(migrationId: string): MigrationToolsError {\n return new MigrationToolsError(\n 'MIGRATION.DUPLICATE_MIGRATION_ID',\n 'Duplicate migrationId in migration graph',\n {\n why: `Multiple migrations share migrationId \"${migrationId}\". Each migration must have a unique content-addressed identity.`,\n fix: 'Regenerate one of the conflicting migrations so each migrationId is unique, then re-run migration commands.',\n details: { migrationId },\n },\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,IAAa,sBAAb,cAAyC,MAAM;CAC7C,AAAS;CACT,AAAS,WAAW;CACpB,AAAS;CACT,AAAS;CACT,AAAS;CAET,YACE,MACA,SACA,SAKA;AACA,QAAM,QAAQ;AACd,OAAK,OAAO;AACZ,OAAK,OAAO;AACZ,OAAK,MAAM,QAAQ;AACnB,OAAK,MAAM,QAAQ;AACnB,OAAK,UAAU,QAAQ;;CAGzB,OAAO,GAAG,OAA8C;AACtD,MAAI,EAAE,iBAAiB,OAAQ,QAAO;EACtC,MAAM,YAAY;AAClB,SAAO,UAAU,SAAS,yBAAyB,OAAO,UAAU,SAAS;;;AA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|
|
1
|
-
{"version":3,"file":"io-afog-e8J.mjs","names":["manifestRaw: string","opsRaw: string","manifest: MigrationManifest","ops: MigrationOps","entries: string[]","packages: MigrationBundle[]"],"sources":["../src/io.ts"],"sourcesContent":["import { mkdir, readdir, readFile, stat, writeFile } from 'node:fs/promises';\nimport { type } from 'arktype';\nimport { basename, dirname, join } from 'pathe';\nimport {\n errorDirectoryExists,\n errorInvalidJson,\n errorInvalidManifest,\n errorInvalidSlug,\n errorMissingFile,\n} from './errors';\nimport type { MigrationBundle, MigrationManifest, MigrationOps } from './types';\n\nconst MANIFEST_FILE = 'migration.json';\nconst OPS_FILE = 'ops.json';\nconst MAX_SLUG_LENGTH = 64;\n\nfunction hasErrnoCode(error: unknown, code: string): boolean {\n return error instanceof Error && (error as { code?: string }).code === code;\n}\n\nconst MigrationHintsSchema = type({\n used: 'string[]',\n applied: 'string[]',\n plannerVersion: 'string',\n planningStrategy: 'string',\n});\n\nconst MigrationManifestSchema = type({\n from: 'string',\n to: 'string',\n migrationId: 'string | null',\n kind: \"'regular' | 'baseline'\",\n fromContract: 'object | null',\n toContract: 'object',\n hints: MigrationHintsSchema,\n labels: 'string[]',\n 'authorship?': type({\n 'author?': 'string',\n 'email?': 'string',\n }),\n 'signature?': type({\n keyId: 'string',\n value: 'string',\n }).or('null'),\n createdAt: 'string',\n});\n\nconst MigrationOpSchema = type({\n id: 'string',\n label: 'string',\n operationClass: \"'additive' | 'widening' | 'destructive'\",\n});\n\n// Intentionally shallow: operation-specific payload validation is owned by planner/runner layers.\nconst MigrationOpsSchema = MigrationOpSchema.array();\n\nexport async function writeMigrationPackage(\n dir: string,\n manifest: MigrationManifest,\n ops: MigrationOps,\n): Promise<void> {\n await mkdir(dirname(dir), { recursive: true });\n\n try {\n await mkdir(dir);\n } catch (error) {\n if (hasErrnoCode(error, 'EEXIST')) {\n throw errorDirectoryExists(dir);\n }\n throw error;\n }\n\n await writeFile(join(dir, MANIFEST_FILE), JSON.stringify(manifest, null, 2), { flag: 'wx' });\n await writeFile(join(dir, OPS_FILE), JSON.stringify(ops, null, 2), { flag: 'wx' });\n}\n\nexport async function readMigrationPackage(dir: string): Promise<MigrationBundle> {\n const manifestPath = join(dir, MANIFEST_FILE);\n const opsPath = join(dir, OPS_FILE);\n\n let manifestRaw: string;\n try {\n manifestRaw = await readFile(manifestPath, 'utf-8');\n } catch (error) {\n if (hasErrnoCode(error, 'ENOENT')) {\n throw errorMissingFile(MANIFEST_FILE, dir);\n }\n throw error;\n }\n\n let opsRaw: string;\n try {\n opsRaw = await readFile(opsPath, 'utf-8');\n } catch (error) {\n if (hasErrnoCode(error, 'ENOENT')) {\n throw errorMissingFile(OPS_FILE, dir);\n }\n throw error;\n }\n\n let manifest: MigrationManifest;\n try {\n manifest = JSON.parse(manifestRaw);\n } catch (e) {\n throw errorInvalidJson(manifestPath, e instanceof Error ? e.message : String(e));\n }\n\n let ops: MigrationOps;\n try {\n ops = JSON.parse(opsRaw);\n } catch (e) {\n throw errorInvalidJson(opsPath, e instanceof Error ? e.message : String(e));\n }\n\n validateManifest(manifest, manifestPath);\n validateOps(ops, opsPath);\n\n return {\n dirName: basename(dir),\n dirPath: dir,\n manifest,\n ops,\n };\n}\n\nfunction validateManifest(\n manifest: unknown,\n filePath: string,\n): asserts manifest is MigrationManifest {\n const result = MigrationManifestSchema(manifest);\n if (result instanceof type.errors) {\n throw errorInvalidManifest(filePath, result.summary);\n }\n}\n\nfunction validateOps(ops: unknown, filePath: string): asserts ops is MigrationOps {\n const result = MigrationOpsSchema(ops);\n if (result instanceof type.errors) {\n throw errorInvalidManifest(filePath, result.summary);\n }\n}\n\nexport async function readMigrationsDir(\n migrationsRoot: string,\n): Promise<readonly MigrationBundle[]> {\n let entries: string[];\n try {\n entries = await readdir(migrationsRoot);\n } catch (error) {\n if (hasErrnoCode(error, 'ENOENT')) {\n return [];\n }\n throw error;\n }\n\n const packages: MigrationBundle[] = [];\n\n for (const entry of entries.sort()) {\n const entryPath = join(migrationsRoot, entry);\n const entryStat = await stat(entryPath);\n if (!entryStat.isDirectory()) continue;\n\n const manifestPath = join(entryPath, MANIFEST_FILE);\n try {\n await stat(manifestPath);\n } catch {\n continue; // skip non-migration directories\n }\n\n packages.push(await readMigrationPackage(entryPath));\n }\n\n return packages;\n}\n\nexport function formatMigrationDirName(timestamp: Date, slug: string): string {\n const sanitized = slug\n .toLowerCase()\n .replace(/[^a-z0-9]/g, '_')\n .replace(/_+/g, '_')\n .replace(/^_|_$/g, '');\n\n if (sanitized.length === 0) {\n throw errorInvalidSlug(slug);\n }\n\n const truncated = sanitized.slice(0, MAX_SLUG_LENGTH);\n\n const y = timestamp.getUTCFullYear();\n const mo = String(timestamp.getUTCMonth() + 1).padStart(2, '0');\n const d = String(timestamp.getUTCDate()).padStart(2, '0');\n const h = String(timestamp.getUTCHours()).padStart(2, '0');\n const mi = String(timestamp.getUTCMinutes()).padStart(2, '0');\n\n return `${y}${mo}${d}T${h}${mi}_${truncated}`;\n}\n"],"mappings":";;;;;;AAYA,MAAM,gBAAgB;AACtB,MAAM,WAAW;AACjB,MAAM,kBAAkB;AAExB,SAAS,aAAa,OAAgB,MAAuB;AAC3D,QAAO,iBAAiB,SAAU,MAA4B,SAAS;;AAUzE,MAAM,0BAA0B,KAAK;CACnC,MAAM;CACN,IAAI;CACJ,aAAa;CACb,MAAM;CACN,cAAc;CACd,YAAY;CACZ,OAd2B,KAAK;EAChC,MAAM;EACN,SAAS;EACT,gBAAgB;EAChB,kBAAkB;EACnB,CAAC;CAUA,QAAQ;CACR,eAAe,KAAK;EAClB,WAAW;EACX,UAAU;EACX,CAAC;CACF,cAAc,KAAK;EACjB,OAAO;EACP,OAAO;EACR,CAAC,CAAC,GAAG,OAAO;CACb,WAAW;CACZ,CAAC;AASF,MAAM,qBAPoB,KAAK;CAC7B,IAAI;CACJ,OAAO;CACP,gBAAgB;CACjB,CAAC,CAG2C,OAAO;AAEpD,eAAsB,sBACpB,KACA,UACA,KACe;AACf,OAAM,MAAM,QAA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