@prisma/orm-toolchain 8.0.0-rc.1-dev.34 → 8.0.0-rc.1-dev.36

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.
@@ -1,3 +1,3 @@
1
1
  import { t as migrationCheckResultSchema } from "./schemas-BMkqaqvM-CLaqlat4.mjs";
2
- import { t as createMigrationCheckCommand } from "./migration-check-aoZ8kXNA-DX2J84Cv.mjs";
2
+ import { t as createMigrationCheckCommand } from "./migration-check-BHiINj74-CVazN1LV.mjs";
3
3
  export { createMigrationCheckCommand, migrationCheckResultSchema };
@@ -1,3 +1,3 @@
1
1
  import { n as migrationStatusJsonResultSchema } from "./schemas-BMkqaqvM-CLaqlat4.mjs";
2
- import { a as formatStatusHumanOutput, i as executeMigrationStatusCommand, n as buildStatusHeadline, o as formatStatusSummary, r as createMigrationStatusCommand, t as buildNoPathSummary } from "./migration-status-DCAQ3_C1-ofDvCvUk.mjs";
2
+ import { a as formatStatusHumanOutput, i as executeMigrationStatusCommand, n as buildStatusHeadline, o as formatStatusSummary, r as createMigrationStatusCommand, t as buildNoPathSummary } from "./migration-status-BZ6gOxyJ-sbhPgABr.mjs";
3
3
  export { buildNoPathSummary, buildStatusHeadline, createMigrationStatusCommand, executeMigrationStatusCommand, formatStatusHumanOutput, formatStatusSummary, migrationStatusJsonResultSchema };
@@ -10,10 +10,10 @@ import { t as executeMigrateShowPlan } from "./migrate-show-bdXjSFgh-CQxl5yNp.mj
10
10
  import { n as resolveMigrationRef, t as resolveContractRef } from "./ref-resolution-D4fAdXo8-Dfaky0yw.mjs";
11
11
  import { n as migrationSpaceListEntriesFromAggregate, r as runMigrationList, t as listRefsByContractHash } from "./migration-list-W0dqabIj-Dc2NH_LY.mjs";
12
12
  import { t as buildMigrationSpaceGraphEntries } from "./migration-graph-DmdVVJoZ-DDBKjUMz.mjs";
13
+ import { n as executeRefListCommand, r as executeRefSetCommand, t as executeRefDeleteCommand } from "./ref-CVD6j3jA-BAgpZLNM.mjs";
13
14
  import { t as resolveContractRefToSnapshot } from "./contract-snapshot-resolution-BUUdIcgG-8mbs6-OD.mjs";
14
15
  import { t as executeMigrationNewCommand } from "./migration-new-YSdtJTRp-Dc06LNJe.mjs";
15
16
  import { i as runContractSpaceSeedPhase, n as resolveFromForPlan, r as resolveToForPlan, t as executeMigrationPlanCommand } from "./migration-plan-CZY8HVCh-BbfQvxnb.mjs";
16
17
  import { a as statusForMigrationHash, i as readMigrationRefs, n as deriveStatusEdgeAnnotations, r as originHashForStatus, t as appliedHashesFromLedger } from "./refs-fQLFcMoq-aTBeUU9H.mjs";
17
18
  import { i as runMigrationCheck, n as enumerateCheckSpaces, r as loadAggregateIntegrityViolations, t as checkSingleTarget } from "./migration-check-of-RPYRk-HuXtDO8i.mjs";
18
- import { n as executeRefListCommand, r as executeRefSetCommand, t as executeRefDeleteCommand } from "./ref-CVD6j3jA-BAgpZLNM.mjs";
19
19
  export { advanceRefSafely, appContractStandInFromIdentity, appliedHashesFromLedger, buildContractSpaceAggregate, buildMigrationSpaceGraphEntries, buildReadAggregate, buildRefAdvancementFields, checkSingleTarget, computeRefAdvancementName, createControlClient, deriveStatusEdgeAnnotations, disposeEmitQueue, enrichContract, enumerateCheckSpaces, executeContractEmit, executeDbInit, executeDbUpdate, executeDbVerify, executeMigrateShowPlan, executeMigrationNewCommand, executeMigrationPlanCommand, executeRefAdvancement, executeRefDeleteCommand, executeRefListCommand, executeRefSetCommand, hasMigrationPath, listRefsByContractHash, loadAggregateIntegrityViolations, loadContractRawSafely, loadContractSpaceAggregateForCli, mapCaughtMigrationError, mapContractAtError, mapIntegrityViolations, migrationSpaceListEntriesFromAggregate, originHashForStatus, readContractIR, readMigrationRefs, refuseContractSpaceIntegrity, refuseDeclaredExtensionTargetMismatch, refuseMarkerOutsideGraph, refuseMissingInvariantPath, refusePackageCorruptionOnAggregate, refuseUnknownInvariants, resolveContractRef, resolveContractRefToSnapshot, resolveFromForPlan, resolveMigrationRef, resolveRefAdvancementFields, resolveToForPlan, runContractSpaceSeedPhase, runMigrationCheck, runMigrationList, statusForMigrationHash };
@@ -9,7 +9,7 @@ import { notOk, ok } from "@prisma/orm-framework/utils/result";
9
9
  import { Command } from "commander";
10
10
  import { EOL } from "node:os";
11
11
  import { format } from "@prisma/orm-framework/psl-parser/format";
12
- //#region ../../../1-framework/3-tooling/cli/dist/format-D5x0jz7q.mjs
12
+ //#region ../../../1-framework/3-tooling/cli/dist/format-B-3QEUOd.mjs
13
13
  function resolveNewline(formatterNewline, eol) {
14
14
  if (formatterNewline !== void 0) return formatterNewline;
15
15
  return eol === "\r\n" ? "CRLF" : "LF";
@@ -19,8 +19,9 @@ async function executeFormat(options) {
19
19
  const config = options.config;
20
20
  const source = config.contract?.source;
21
21
  if (source?.format !== "psl") return ok({ formatted: false });
22
- const inputPath = source.inputs?.[0];
23
- if (inputPath === void 0) return ok({ formatted: false });
22
+ const declaredPath = source.inputs?.[0];
23
+ if (declaredPath === void 0) return ok({ formatted: false });
24
+ const inputPath = resolve(options.cwd, declaredPath);
24
25
  let contents;
25
26
  try {
26
27
  contents = await readFile(inputPath, "utf-8");
@@ -61,6 +62,8 @@ async function executeFormat(options) {
61
62
  path: inputPath
62
63
  });
63
64
  }
65
+ //#endregion
66
+ //#region ../../../1-framework/3-tooling/cli/dist/format-DceifGAK.mjs
64
67
  async function runFormat(options) {
65
68
  const configResult = await loadConfigForSections(options.config, ["contract", "formatter"]);
66
69
  if (!configResult.ok) return configResult;
@@ -102,6 +105,6 @@ function createFormatCommand() {
102
105
  return command;
103
106
  }
104
107
  //#endregion
105
- export { createFormatCommand as t };
108
+ export { executeFormat as n, createFormatCommand as t };
106
109
 
107
- //# sourceMappingURL=format-D5x0jz7q-xalz6Fkn.mjs.map
110
+ //# sourceMappingURL=format-DceifGAK-BJhTdkcO.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-DceifGAK-BJhTdkcO.mjs","names":["errorRuntime"],"sources":["../../../../1-framework/3-tooling/cli/dist/format-B-3QEUOd.mjs","../../../../1-framework/3-tooling/cli/dist/format-DceifGAK.mjs"],"sourcesContent":["import { D as errorRuntime, M as errorUnexpected } from \"./cli-errors-C6_pH59O.mjs\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { resolve } from \"pathe\";\nimport { readFile, writeFile } from \"node:fs/promises\";\nimport { isStructuredError } from \"@internal/utils/structured-error\";\nimport { EOL } from \"node:os\";\nimport { format } from \"@internal/psl-parser/format\";\n//#region src/control-api/operations/format.ts\nfunction resolveNewline(formatterNewline, eol) {\n\tif (formatterNewline !== void 0) return formatterNewline;\n\treturn eol === \"\\r\\n\" ? \"CRLF\" : \"LF\";\n}\nasync function executeFormat(options) {\n\tconst eol = options.eol ?? EOL;\n\tconst config = options.config;\n\tconst source = config.contract?.source;\n\tif (source?.format !== \"psl\") return ok({ formatted: false });\n\tconst declaredPath = source.inputs?.[0];\n\tif (declaredPath === void 0) return ok({ formatted: false });\n\tconst inputPath = resolve(options.cwd, declaredPath);\n\tlet contents;\n\ttry {\n\t\tcontents = await readFile(inputPath, \"utf-8\");\n\t} catch (error) {\n\t\treturn notOk(errorRuntime(\"CONTRACT.SOURCE_LOAD_FAILED\", \"Failed to read contract source file\", {\n\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\tfix: `Check that ${inputPath} exists and is readable.`,\n\t\t\tcause: error\n\t\t}));\n\t}\n\tconst formatOptions = {\n\t\tindent: config.formatter?.indent ?? 2,\n\t\tnewline: resolveNewline(config.formatter?.newline, eol)\n\t};\n\tlet formatted;\n\ttry {\n\t\tformatted = format(contents, formatOptions);\n\t} catch (error) {\n\t\tif (isStructuredError(error) && error.code === \"PSL.PARSE_FAILED\") return notOk(errorRuntime(\"PSL.PARSE_FAILED\", \"Cannot format PSL with parse errors\", {\n\t\t\twhy: error.message,\n\t\t\tfix: \"Fix the parse errors in your schema and try again.\",\n\t\t\tmeta: { diagnostics: error.meta?.[\"diagnostics\"] },\n\t\t\tcause: error\n\t\t}));\n\t\treturn notOk(errorUnexpected(error instanceof Error ? error.message : String(error)));\n\t}\n\ttry {\n\t\tawait writeFile(inputPath, formatted, \"utf-8\");\n\t} catch (error) {\n\t\treturn notOk(errorRuntime(\"CLI.FILE_WRITE_FAILED\", \"Failed to write formatted contract source file\", {\n\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\tfix: `Check that ${inputPath} is writable.`,\n\t\t\tcause: error\n\t\t}));\n\t}\n\treturn ok({\n\t\tformatted: true,\n\t\tpath: inputPath\n\t});\n}\n//#endregion\nexport { executeFormat as t };\n\n//# sourceMappingURL=format-B-3QEUOd.mjs.map","import { t as createTerminalUI } from \"./terminal-ui-Cqz4LVL7.mjs\";\nimport { S as formatStyledHeader, _ as parseGlobalFlagsOrExit, d as setCommandExamples, t as addGlobalOptions, u as setCommandDescriptions, v as handleResult } from \"./command-helpers-kD9CO1hd.mjs\";\nimport { t as executeFormat } from \"./format-B-3QEUOd.mjs\";\nimport { Command } from \"commander\";\nimport { loadConfigForSections } from \"@internal/config-loader\";\nimport { relative, resolve } from \"pathe\";\n//#region src/commands/format.ts\nasync function runFormat(options) {\n\tconst configResult = await loadConfigForSections(options.config, [\"contract\", \"formatter\"]);\n\tif (!configResult.ok) return configResult;\n\treturn executeFormat({\n\t\tconfig: configResult.value,\n\t\tcwd: process.cwd()\n\t});\n}\nfunction createFormatCommand() {\n\tconst command = new Command(\"format\");\n\tsetCommandDescriptions(command, \"Format your PSL contract source\", \"Formats the Prisma schema (PSL) contract source declared in your config\\n(contract.source.inputs[0]) in place. Only runs when contract.source.format\\nis 'psl'; a TypeScript or unset source is left untouched. Indent and newline are\\nread from the optional formatter config section, defaulting to two spaces and the\\nsystem newline.\");\n\tsetCommandExamples(command, [\"prisma-next format\", \"prisma-next format --config ./custom-config.ts\"]);\n\taddGlobalOptions(command).option(\"--config <path>\", \"Path to prisma-next.config.ts\").action(async (options) => {\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\tconst ui = createTerminalUI(flags);\n\t\tif (!flags.json && !flags.quiet) {\n\t\t\tconst displayConfigPath = options.config ? relative(process.cwd(), resolve(options.config)) : \"prisma-next.config.ts\";\n\t\t\tui.stderr(formatStyledHeader({\n\t\t\t\tcommand: \"format\",\n\t\t\t\tdescription: \"Format your PSL contract source\",\n\t\t\t\tdetails: [{\n\t\t\t\t\tlabel: \"config\",\n\t\t\t\t\tvalue: displayConfigPath\n\t\t\t\t}],\n\t\t\t\tflags\n\t\t\t}));\n\t\t}\n\t\tconst exitCode = handleResult(await runFormat(options), flags, ui, (value) => {\n\t\t\tif (flags.json) {\n\t\t\t\tui.output(JSON.stringify(value));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (flags.quiet) return;\n\t\t\tif (value.formatted) ui.success(`Formatted ${relative(process.cwd(), value.path ?? \"\")}`);\n\t\t\telse ui.info(\"Nothing to format (contract source is not PSL).\");\n\t\t});\n\t\tprocess.exit(exitCode);\n\t});\n\treturn command;\n}\n//#endregion\nexport { createFormatCommand as t };\n\n//# sourceMappingURL=format-DceifGAK.mjs.map"],"mappings":";;;;;;;;;;;;AAQA,SAAS,eAAe,kBAAkB,KAAK;CAC9C,IAAI,qBAAqB,KAAK,GAAG,OAAO;CACxC,OAAO,QAAQ,SAAS,SAAS;AAClC;AACA,eAAe,cAAc,SAAS;CACrC,MAAM,MAAM,QAAQ,OAAO;CAC3B,MAAM,SAAS,QAAQ;CACvB,MAAM,SAAS,OAAO,UAAU;CAChC,IAAI,QAAQ,WAAW,OAAO,OAAO,GAAG,EAAE,WAAW,MAAM,CAAC;CAC5D,MAAM,eAAe,OAAO,SAAS;CACrC,IAAI,iBAAiB,KAAK,GAAG,OAAO,GAAG,EAAE,WAAW,MAAM,CAAC;CAC3D,MAAM,YAAY,QAAQ,QAAQ,KAAK,YAAY;CACnD,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,SAAS,WAAW,OAAO;CAC7C,SAAS,OAAO;EACf,OAAO,MAAMA,eAAa,+BAA+B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OAAO,mBAAmB,+BAA+B,CAAC,CAAC,OAAO,OAAO,YAAY;EAC9G,MAAM,QAAQ,uBAAuB,OAAO;EAC5C,MAAM,KAAK,iBAAiB,KAAK;EACjC,IAAI,CAAC,MAAM,QAAQ,CAAC,MAAM,OAAO;GAChC,MAAM,oBAAoB,QAAQ,SAAS,SAAS,QAAQ,IAAI,GAAG,QAAQ,QAAQ,MAAM,CAAC,IAAI;GAC9F,GAAG,OAAO,mBAAmB;IAC5B,SAAS;IACT,aAAa;IACb,SAAS,CAAC;KACT,OAAO;KACP,OAAO;IACR,CAAC;IACD;GACD,CAAC,CAAC;EACH;EACA,MAAM,WAAW,aAAa,MAAM,UAAU,OAAO,GAAG,OAAO,KAAK,UAAU;GAC7E,IAAI,MAAM,MAAM;IACf,GAAG,OAAO,KAAK,UAAU,KAAK,CAAC;IAC/B;GACD;GACA,IAAI,MAAM,OAAO;GACjB,IAAI,MAAM,WAAW,GAAG,QAAQ,aAAa,SAAS,QAAQ,IAAI,GAAG,MAAM,QAAQ,EAAE,GAAG;QACnF,GAAG,KAAK,iDAAiD;EAC/D,CAAC;EACD,QAAQ,KAAK,QAAQ;CACtB,CAAC;CACD,OAAO;AACR"}
@@ -15,7 +15,7 @@ import { execFile } from "node:child_process";
15
15
  import { promisify } from "node:util";
16
16
  import { detect, getUserAgent } from "package-manager-detector/detect";
17
17
  import { applyEdits, modify, parse, printParseErrorCode } from "jsonc-parser";
18
- //#region ../../../1-framework/3-tooling/cli/dist/init-BvLCfVjC.mjs
18
+ //#region ../../../1-framework/3-tooling/cli/dist/init-SY01IBU-.mjs
19
19
  const KNOWN = /* @__PURE__ */ new Set([
20
20
  "pnpm",
21
21
  "npm",
@@ -2249,4 +2249,4 @@ function sanitisePackageName(raw) {
2249
2249
  //#endregion
2250
2250
  export { runInit };
2251
2251
 
2252
- //# sourceMappingURL=init-BvLCfVjC-DOPO-TLF.mjs.map
2252
+ //# sourceMappingURL=init-SY01IBU--CQFYh2As.mjs.map