@prisma-next/cli 0.1.0-pr.57.3 → 0.1.0-pr.58.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/dist/{chunk-ZKEJZ3NU.js → chunk-JLA4BH74.js} +1 -2
- package/dist/{chunk-VWAVGWUP.js → chunk-XS2KZ6CJ.js} +2 -2
- package/dist/cli.js +4 -75
- package/dist/cli.js.map +1 -1
- package/dist/commands/contract-emit.js +2 -2
- package/dist/commands/db-init.js +3 -14
- package/dist/commands/db-init.js.map +1 -1
- package/dist/commands/db-introspect.js +1 -1
- package/dist/commands/db-schema-verify.js +2 -12
- package/dist/commands/db-schema-verify.js.map +1 -1
- package/dist/commands/db-sign.js +2 -12
- package/dist/commands/db-sign.js.map +1 -1
- package/dist/commands/db-verify.js +1 -1
- package/dist/index.js +2 -2
- package/package.json +11 -11
- package/dist/chunk-YDE4ILKH.js +0 -55
- package/dist/chunk-YDE4ILKH.js.map +0 -1
- /package/dist/{chunk-ZKEJZ3NU.js.map → chunk-JLA4BH74.js.map} +0 -0
- /package/dist/{chunk-VWAVGWUP.js.map → chunk-XS2KZ6CJ.js.map} +0 -0
|
@@ -961,7 +961,6 @@ export {
|
|
|
961
961
|
formatStyledHeader,
|
|
962
962
|
formatSuccessMessage,
|
|
963
963
|
formatCommandHelp,
|
|
964
|
-
errorConfigValidation,
|
|
965
964
|
errorDatabaseUrlRequired,
|
|
966
965
|
errorDriverRequired,
|
|
967
966
|
errorFileNotFound,
|
|
@@ -973,4 +972,4 @@ export {
|
|
|
973
972
|
handleResult,
|
|
974
973
|
withSpinner
|
|
975
974
|
};
|
|
976
|
-
//# sourceMappingURL=chunk-
|
|
975
|
+
//# sourceMappingURL=chunk-JLA4BH74.js.map
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
performAction,
|
|
10
10
|
setCommandDescriptions,
|
|
11
11
|
withSpinner
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-JLA4BH74.js";
|
|
13
13
|
import {
|
|
14
14
|
loadConfig
|
|
15
15
|
} from "./chunk-HWYQOCAJ.js";
|
|
@@ -131,4 +131,4 @@ function createContractEmitCommand() {
|
|
|
131
131
|
export {
|
|
132
132
|
createContractEmitCommand
|
|
133
133
|
};
|
|
134
|
-
//# sourceMappingURL=chunk-
|
|
134
|
+
//# sourceMappingURL=chunk-XS2KZ6CJ.js.map
|
package/dist/cli.js
CHANGED
|
@@ -1176,55 +1176,6 @@ function createContractEmitCommand() {
|
|
|
1176
1176
|
import { readFile } from "fs/promises";
|
|
1177
1177
|
import { relative as relative3, resolve as resolve3 } from "path";
|
|
1178
1178
|
import { Command as Command2 } from "commander";
|
|
1179
|
-
|
|
1180
|
-
// src/utils/framework-components.ts
|
|
1181
|
-
function assertFrameworkComponentsCompatible(expectedFamilyId, expectedTargetId, frameworkComponents) {
|
|
1182
|
-
for (let i = 0; i < frameworkComponents.length; i++) {
|
|
1183
|
-
const component = frameworkComponents[i];
|
|
1184
|
-
if (typeof component !== "object" || component === null) {
|
|
1185
|
-
throw errorConfigValidation("frameworkComponents[]", {
|
|
1186
|
-
why: `Framework component at index ${i} must be an object`
|
|
1187
|
-
});
|
|
1188
|
-
}
|
|
1189
|
-
const record = component;
|
|
1190
|
-
if (!Object.hasOwn(record, "kind")) {
|
|
1191
|
-
throw errorConfigValidation("frameworkComponents[].kind", {
|
|
1192
|
-
why: `Framework component at index ${i} must have 'kind' property`
|
|
1193
|
-
});
|
|
1194
|
-
}
|
|
1195
|
-
const kind = record["kind"];
|
|
1196
|
-
if (kind !== "target" && kind !== "adapter" && kind !== "extension" && kind !== "driver") {
|
|
1197
|
-
throw errorConfigValidation("frameworkComponents[].kind", {
|
|
1198
|
-
why: `Framework component at index ${i} has invalid kind '${String(kind)}' (must be 'target', 'adapter', 'extension', or 'driver')`
|
|
1199
|
-
});
|
|
1200
|
-
}
|
|
1201
|
-
if (!Object.hasOwn(record, "familyId")) {
|
|
1202
|
-
throw errorConfigValidation("frameworkComponents[].familyId", {
|
|
1203
|
-
why: `Framework component at index ${i} (kind: ${String(kind)}) must have 'familyId' property`
|
|
1204
|
-
});
|
|
1205
|
-
}
|
|
1206
|
-
const familyId = record["familyId"];
|
|
1207
|
-
if (familyId !== expectedFamilyId) {
|
|
1208
|
-
throw errorConfigValidation("frameworkComponents[].familyId", {
|
|
1209
|
-
why: `Framework component at index ${i} (kind: ${String(kind)}) has familyId '${String(familyId)}' but expected '${expectedFamilyId}'`
|
|
1210
|
-
});
|
|
1211
|
-
}
|
|
1212
|
-
if (!Object.hasOwn(record, "targetId")) {
|
|
1213
|
-
throw errorConfigValidation("frameworkComponents[].targetId", {
|
|
1214
|
-
why: `Framework component at index ${i} (kind: ${String(kind)}) must have 'targetId' property`
|
|
1215
|
-
});
|
|
1216
|
-
}
|
|
1217
|
-
const targetId = record["targetId"];
|
|
1218
|
-
if (targetId !== expectedTargetId) {
|
|
1219
|
-
throw errorConfigValidation("frameworkComponents[].targetId", {
|
|
1220
|
-
why: `Framework component at index ${i} (kind: ${String(kind)}) has targetId '${String(targetId)}' but expected '${expectedTargetId}'`
|
|
1221
|
-
});
|
|
1222
|
-
}
|
|
1223
|
-
}
|
|
1224
|
-
return frameworkComponents;
|
|
1225
|
-
}
|
|
1226
|
-
|
|
1227
|
-
// src/commands/db-init.ts
|
|
1228
1179
|
function createDbInitCommand() {
|
|
1229
1180
|
const command = new Command2("init");
|
|
1230
1181
|
setCommandDescriptions(
|
|
@@ -1311,12 +1262,6 @@ function createDbInitCommand() {
|
|
|
1311
1262
|
driver: driverDescriptor,
|
|
1312
1263
|
extensions: config.extensions ?? []
|
|
1313
1264
|
});
|
|
1314
|
-
const rawComponents = [config.target, config.adapter, ...config.extensions ?? []];
|
|
1315
|
-
const frameworkComponents = assertFrameworkComponentsCompatible(
|
|
1316
|
-
config.family.familyId,
|
|
1317
|
-
config.target.targetId,
|
|
1318
|
-
rawComponents
|
|
1319
|
-
);
|
|
1320
1265
|
const contractIR = familyInstance.validateContractIR(contractJson);
|
|
1321
1266
|
const planner = migrations.createPlanner(familyInstance);
|
|
1322
1267
|
const runner = migrations.createRunner(familyInstance);
|
|
@@ -1329,8 +1274,7 @@ function createDbInitCommand() {
|
|
|
1329
1274
|
async () => planner.plan({
|
|
1330
1275
|
contract: contractIR,
|
|
1331
1276
|
schema: schemaIR,
|
|
1332
|
-
policy
|
|
1333
|
-
frameworkComponents
|
|
1277
|
+
policy
|
|
1334
1278
|
}),
|
|
1335
1279
|
{
|
|
1336
1280
|
message: "Planning migration...",
|
|
@@ -1374,8 +1318,7 @@ function createDbInitCommand() {
|
|
|
1374
1318
|
driver,
|
|
1375
1319
|
destinationContract: contractIR,
|
|
1376
1320
|
policy,
|
|
1377
|
-
callbacks
|
|
1378
|
-
frameworkComponents
|
|
1321
|
+
callbacks
|
|
1379
1322
|
}),
|
|
1380
1323
|
{
|
|
1381
1324
|
message: "Applying migration plan...",
|
|
@@ -1673,12 +1616,6 @@ function createDbSchemaVerifyCommand() {
|
|
|
1673
1616
|
driver: driverDescriptor,
|
|
1674
1617
|
extensions: config.extensions ?? []
|
|
1675
1618
|
});
|
|
1676
|
-
const rawComponents = [config.target, config.adapter, ...config.extensions ?? []];
|
|
1677
|
-
const frameworkComponents = assertFrameworkComponentsCompatible(
|
|
1678
|
-
config.family.familyId,
|
|
1679
|
-
config.target.targetId,
|
|
1680
|
-
rawComponents
|
|
1681
|
-
);
|
|
1682
1619
|
const contractIR = familyInstance.validateContractIR(contractJson);
|
|
1683
1620
|
let schemaVerifyResult;
|
|
1684
1621
|
try {
|
|
@@ -1688,8 +1625,7 @@ function createDbSchemaVerifyCommand() {
|
|
|
1688
1625
|
contractIR,
|
|
1689
1626
|
strict: options.strict ?? false,
|
|
1690
1627
|
contractPath: contractPathAbsolute,
|
|
1691
|
-
configPath
|
|
1692
|
-
frameworkComponents
|
|
1628
|
+
configPath
|
|
1693
1629
|
}),
|
|
1694
1630
|
{
|
|
1695
1631
|
message: "Verifying database schema...",
|
|
@@ -1805,12 +1741,6 @@ function createDbSignCommand() {
|
|
|
1805
1741
|
driver: driverDescriptor,
|
|
1806
1742
|
extensions: config.extensions ?? []
|
|
1807
1743
|
});
|
|
1808
|
-
const rawComponents = [config.target, config.adapter, ...config.extensions ?? []];
|
|
1809
|
-
const frameworkComponents = assertFrameworkComponentsCompatible(
|
|
1810
|
-
config.family.familyId,
|
|
1811
|
-
config.target.targetId,
|
|
1812
|
-
rawComponents
|
|
1813
|
-
);
|
|
1814
1744
|
const contractIR = familyInstance.validateContractIR(contractJson);
|
|
1815
1745
|
let schemaVerifyResult;
|
|
1816
1746
|
try {
|
|
@@ -1820,8 +1750,7 @@ function createDbSignCommand() {
|
|
|
1820
1750
|
contractIR,
|
|
1821
1751
|
strict: false,
|
|
1822
1752
|
contractPath: contractPathAbsolute,
|
|
1823
|
-
configPath
|
|
1824
|
-
frameworkComponents
|
|
1753
|
+
configPath
|
|
1825
1754
|
}),
|
|
1826
1755
|
{
|
|
1827
1756
|
message: "Verifying database satisfies contract",
|