@prisma/composer 0.6.0-dev.17 → 0.6.0-dev.19
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/{app-config-aIrriqVU-D6lJHzh2.d.mts → app-config-aIrriqVU-Dpj1RqnY.d.mts} +3 -2
- package/dist/app-config-aIrriqVU-Dpj1RqnY.d.mts.map +1 -0
- package/dist/config-BeBRB-6m.d.mts +1 -0
- package/dist/config.d.mts +2 -2
- package/dist/control.d.mts +219 -3
- package/dist/control.d.mts.map +1 -0
- package/dist/control.mjs +69 -1
- package/dist/control.mjs.map +1 -0
- package/dist/deploy-BeBRB-6m.d.mts +1 -0
- package/dist/deploy.d.mts +2 -2
- package/dist/deploy.mjs +1 -1
- package/dist/{dist-C0dNEgS-.mjs → dist-C5rZnr4n.mjs} +2 -2
- package/dist/{dist-C0dNEgS-.mjs.map → dist-C5rZnr4n.mjs.map} +1 -1
- package/dist/{errors-DkXcnjPx.mjs → errors-0e8IVwzi.mjs} +2 -3
- package/dist/{errors-DkXcnjPx.mjs.map → errors-0e8IVwzi.mjs.map} +1 -1
- package/dist/{execute-deploy-destroy-DfVJUICu-AMM8CwgV.mjs → execute-deploy-destroy-DfVJUICu-Dbgn1GR_.mjs} +5 -6
- package/dist/{execute-deploy-destroy-DfVJUICu-AMM8CwgV.mjs.map → execute-deploy-destroy-DfVJUICu-Dbgn1GR_.mjs.map} +1 -1
- package/dist/{execute-dev-BMTFWfFc-BoKbcFVF.mjs → execute-dev-BMTFWfFc-CGDFqR4w.mjs} +6 -7
- package/dist/{execute-dev-BMTFWfFc-BoKbcFVF.mjs.map → execute-dev-BMTFWfFc-CGDFqR4w.mjs.map} +1 -1
- package/dist/{execute-log-Cay9hlKW-B0tmRtrY.mjs → execute-log-Cay9hlKW-ChlIv192.mjs} +5 -6
- package/dist/{execute-log-Cay9hlKW-DrMeVOXq.mjs.map → execute-log-Cay9hlKW-ChlIv192.mjs.map} +1 -1
- package/dist/{graph-BJgUfGB0-7fmubS_y.mjs → graph-BJgUfGB0-kvgFzT4q.mjs} +2 -2
- package/dist/{graph-BJgUfGB0-7fmubS_y.mjs.map → graph-BJgUfGB0-kvgFzT4q.mjs.map} +1 -1
- package/dist/graph-DqklX5Sf-BNS2aO1j.d.mts +18 -0
- package/dist/graph-DqklX5Sf-BNS2aO1j.d.mts.map +1 -0
- package/dist/{graph-DqklX5Sf-CdNH3lA7.d.mts → graph-types-N6brq1zY-1VMNwtkJ.d.mts} +2 -17
- package/dist/graph-types-N6brq1zY-1VMNwtkJ.d.mts.map +1 -0
- package/dist/{index-DuF5iI3i.d.mts → index-DryPyF9U.d.mts} +3 -2
- package/dist/index-DryPyF9U.d.mts.map +1 -0
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +2 -2
- package/dist/{local-target-D3u_wuNF.mjs → local-target-DnA2E8IN.mjs} +2 -2
- package/dist/{local-target-D3u_wuNF.mjs.map → local-target-DnA2E8IN.mjs.map} +1 -1
- package/dist/local-target.d.mts +1 -1
- package/dist/local-target.mjs +1 -1
- package/dist/{nextjs-DLyeRR7M-BfUbLXwr.d.mts → nextjs-DLyeRR7M-DZODs9tk.d.mts} +3 -3
- package/dist/{nextjs-DLyeRR7M-BfUbLXwr.d.mts.map → nextjs-DLyeRR7M-DZODs9tk.d.mts.map} +1 -1
- package/dist/nextjs-control.d.mts +4 -4
- package/dist/nextjs.d.mts +1 -1
- package/dist/node-control.d.mts +3 -3
- package/dist/node.d.mts +2 -2
- package/dist/{pipeline-AoW8zq4I-DM74ygtH.mjs → pipeline-AoW8zq4I-CUon5KZH.mjs} +5 -5
- package/dist/{pipeline-AoW8zq4I-DM74ygtH.mjs.map → pipeline-AoW8zq4I-CUon5KZH.mjs.map} +1 -1
- package/dist/report.d.mts +2 -2
- package/dist/{log-DfT2hHqi-CDp9nfI5.mjs → result-CY_TB7bn.mjs} +84 -63
- package/dist/result-CY_TB7bn.mjs.map +1 -0
- package/dist/{run-alchemy-D44OZlyB-DA7s331N.mjs → run-alchemy-D44OZlyB-gVq_0gf4.mjs} +3 -3
- package/dist/{run-alchemy-D44OZlyB-DA7s331N.mjs.map → run-alchemy-D44OZlyB-gVq_0gf4.mjs.map} +1 -1
- package/dist/service-rpc.d.mts +2 -2
- package/dist/service-rpc.mjs +2 -2
- package/dist/testing.d.mts +2 -54
- package/dist/testing.d.mts.map +1 -1
- package/dist/testing.mjs +1 -150
- package/dist/testing.mjs.map +1 -1
- package/package.json +11 -16
- package/src/exports/testing.ts +5 -1
- package/dist/app-config-aIrriqVU-D6lJHzh2.d.mts.map +0 -1
- package/dist/bin.mjs +0 -1344
- package/dist/bin.mjs.map +0 -1
- package/dist/config-CL7Jbve2.d.mts +0 -1
- package/dist/container-transport-DKmKg5JQ-CoY4XPma.mjs +0 -30
- package/dist/container-transport-DKmKg5JQ-CoY4XPma.mjs.map +0 -1
- package/dist/deploy-CL7Jbve2.d.mts +0 -1
- package/dist/execute-deploy-destroy-DfVJUICu-quUQ08T8.mjs +0 -316
- package/dist/execute-deploy-destroy-DfVJUICu-quUQ08T8.mjs.map +0 -1
- package/dist/execute-dev-BMTFWfFc-B1whS-Rr.mjs +0 -2011
- package/dist/execute-dev-BMTFWfFc-B1whS-Rr.mjs.map +0 -1
- package/dist/execute-log-Cay9hlKW-B0tmRtrY.mjs.map +0 -1
- package/dist/execute-log-Cay9hlKW-DrMeVOXq.mjs +0 -157
- package/dist/family-DkH0si4D-Uov_MuHV.d.mts +0 -27
- package/dist/family-DkH0si4D-Uov_MuHV.d.mts.map +0 -1
- package/dist/family.d.mts +0 -53
- package/dist/family.d.mts.map +0 -1
- package/dist/family.mjs +0 -1226
- package/dist/family.mjs.map +0 -1
- package/dist/graph-DqklX5Sf-CdNH3lA7.d.mts.map +0 -1
- package/dist/index-DuF5iI3i.d.mts.map +0 -1
- package/dist/local-target-H0IWu_FM.mjs +0 -68
- package/dist/local-target-H0IWu_FM.mjs.map +0 -1
- package/dist/log-DRnnWupy-9jbzL64M.d.mts +0 -324
- package/dist/log-DRnnWupy-9jbzL64M.d.mts.map +0 -1
- package/dist/log-DfT2hHqi-CDp9nfI5.mjs.map +0 -1
- package/dist/pipeline-AoW8zq4I-C6Qe0VaZ.mjs +0 -976
- package/dist/pipeline-AoW8zq4I-C6Qe0VaZ.mjs.map +0 -1
- package/dist/result-B4XjxVK6.mjs +0 -384
- package/dist/result-B4XjxVK6.mjs.map +0 -1
- package/dist/result-wonf1deB.mjs +0 -92
- package/dist/result-wonf1deB.mjs.map +0 -1
- package/dist/run-alchemy-D44OZlyB-DeDTFsB6.mjs +0 -93
- package/dist/run-alchemy-D44OZlyB-DeDTFsB6.mjs.map +0 -1
- package/src/exports/family.ts +0 -14
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"result-B4XjxVK6.mjs","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/casts-DpaahrlC.mjs","../../../0-framework/0-foundation/foundation/dist/internal-error-BIc-ehme.mjs","../../../0-framework/0-foundation/foundation/dist/errors.mjs","../../../0-framework/3-tooling/cli/dist/shared-BTnATsqm.mjs","../../../0-framework/0-foundation/foundation/dist/result.mjs"],"sourcesContent":["//#region src/casts.ts\n/**\n* **Last-resort escape hatch for unsafe type assertions. Not a sanctioned tool to reach for.**\n*\n* Before reaching for `blindCast`, **rewrite the surrounding code so the cast becomes\n* unnecessary**: tighten an input type, add a runtime check that narrows via a type\n* predicate, restructure a generic so the compiler can see the relationship you're\n* asserting, or use {@link castAs} when the value already satisfies the target type.\n* Only when no rewrite is feasible does `blindCast` become the right answer — and at\n* that point, the `Reason` literal you supply must articulate the compromise in\n* language a reviewer can evaluate.\n*\n* The reviewer **will** validate the `Reason`. If it doesn't hold up under scrutiny,\n* that is not a signal to soften the reason; it is a signal to go back and solve the\n* underlying type-system problem properly. An unconvincing justification is rework,\n* not a free pass.\n*\n* `blindCast` is the auditable form of `as Foo` / `as unknown as Foo`: it bypasses\n* the compiler's checks (the input type is `unknown`, the output type is whatever the\n* caller asks for), but it forces the unsafety to be named at the call site instead of\n* smuggled in via a bare `as`. The `Reason` type parameter exists only at compile\n* time — it is not present in the emitted JavaScript — but it is grep-able and\n* visible to future readers.\n*\n* @example\n* ```typescript\n* const stringValue = blindCast<\n* string,\n* \"JSON.parse returns `unknown`; this field is documented to be a string in the API contract\"\n* >(parsed[key]);\n* ```\n*\n* @typeParam TargetType - The type the caller is asserting the input has.\n* @typeParam _Reason - A string literal describing why bypassing the type system is necessary here.\n* Only meaningful at compile time. The reviewer evaluates whether it justifies the unsafety.\n*/\nfunction blindCast(input) {\n\treturn input;\n}\n/**\n* Type-checked, runtime pass-through alternative to a bare `as Type` cast.\n*\n* Use `castAs` when the value already satisfies the target type but you want to make\n* the type assertion explicit at the call site — for example, when an inferred type is\n* wider than the type you want to publish, or when a literal object should be tagged\n* with its nominal interface. Unlike {@link blindCast}, the compiler still checks that\n* the value is assignable to the target type, so this helper cannot smuggle in an\n* unsafe assertion.\n*\n* `castAs` exists alongside `blindCast` so authors pick the right name at the call\n* site: a `castAs` is type-checked and benign; a `blindCast` is the unsafe escape\n* hatch. The split makes review faster — readers know which casts to scrutinize and\n* which are pure annotations.\n*\n* @example\n* ```typescript\n* interface FancyObject {\n* key: string;\n* keyTwo: {\n* subKey: string;\n* subKeyTwo: number;\n* };\n* }\n*\n* const typedObject = castAs<FancyObject>({\n* key: 'Chookede',\n* keyTwo: {\n* subKey: 'Choookeeeee',\n* subKeyTwo: 2,\n* },\n* });\n* ```\n*\n* @typeParam Type - The type to constrain and tag the value with. The value must be assignable to `Type`.\n*/\nfunction castAs(value) {\n\treturn value;\n}\n//#endregion\nexport { castAs as n, blindCast as t };\n\n//# sourceMappingURL=casts-DpaahrlC.mjs.map","//#region src/internal-error.ts\n/**\n* A bug in Prisma Next, not a user error. Never catch this except at the\n* outermost boundary for crash reporting — an InternalError means an invariant\n* broke and the process cannot reliably continue. User-facing failures use\n* `structuredError` with a dotted code instead.\n*/\nvar InternalError = class extends Error {\n\tisPrismaInternalError = true;\n\tconstructor(message, options) {\n\t\tsuper(message, options?.cause !== void 0 ? { cause: options.cause } : void 0);\n\t\tthis.name = \"InternalError\";\n\t}\n};\nfunction isInternalError(e) {\n\treturn typeof e === \"object\" && e !== null && \"isPrismaInternalError\" in e && e.isPrismaInternalError === true;\n}\nfunction assertNever(value, message) {\n\tthrow new InternalError(message ?? `Unreachable: unexpected value ${String(value)}`);\n}\n//#endregion\nexport { assertNever as n, isInternalError as r, InternalError as t };\n\n//# sourceMappingURL=internal-error-BIc-ehme.mjs.map","import { t as blindCast } from \"./casts-DpaahrlC.mjs\";\nimport { n as assertNever, r as isInternalError, t as InternalError } from \"./internal-error-BIc-ehme.mjs\";\n//#region src/defined.ts\n/**\n* Returns an object with the key/value if value is defined, otherwise an empty object.\n*\n* Use with spread to conditionally include optional properties while satisfying\n* exactOptionalPropertyTypes. This is explicit about which properties are optional\n* and won't inadvertently strip other undefined values.\n*\n* @example\n* ```typescript\n* // Instead of:\n* const obj = {\n* required: 'value',\n* ...(optional ? { optional } : {}),\n* };\n*\n* // Use:\n* const obj = {\n* required: 'value',\n* ...ifDefined('optional', optional),\n* };\n* ```\n*/\nfunction ifDefined(key, value) {\n\treturn value !== void 0 ? blindCast({ [key]: value }) : {};\n}\n//#endregion\n//#region src/cli-structured-error.ts\n/**\n* Structured CLI error that contains all information needed for error envelopes.\n* Call sites throw these errors with full context.\n*\n* A `CliStructuredError` is a `StructuredError` (see\n* `./structured-error.ts`): `code` is a dotted\n* `NAMESPACE.SUBCODE` string, and the namespace prefix is the error's\n* category — there is no separate `domain` field. See ADR 239 in\n* prisma/prisma and composer's ADR-0044 for the namespace taxonomy.\n*/\nvar CliStructuredError = class extends Error {\n\tcode;\n\tseverity;\n\tconstructor(code, summary, options) {\n\t\tsuper(summary, options?.cause !== void 0 ? { cause: options.cause } : void 0);\n\t\tthis.name = \"CliStructuredError\";\n\t\tthis.code = code;\n\t\tthis.severity = options?.severity ?? \"error\";\n\t\tconst fix = options?.fix === options?.why ? void 0 : options?.fix;\n\t\tconst where = options?.where ? {\n\t\t\t...ifDefined(\"path\", options.where.path),\n\t\t\t...ifDefined(\"line\", options.where.line)\n\t\t} : void 0;\n\t\tObject.assign(this, {\n\t\t\t...ifDefined(\"why\", options?.why),\n\t\t\t...ifDefined(\"fix\", fix),\n\t\t\t...ifDefined(\"where\", where),\n\t\t\t...ifDefined(\"meta\", options?.meta),\n\t\t\t...ifDefined(\"docsUrl\", options?.docsUrl)\n\t\t});\n\t}\n\t/**\n\t* Converts this error to a CLI error envelope for output formatting.\n\t*/\n\ttoEnvelope() {\n\t\treturn {\n\t\t\tok: false,\n\t\t\tcode: this.code,\n\t\t\tseverity: this.severity,\n\t\t\tsummary: this.message,\n\t\t\t...ifDefined(\"why\", this.why),\n\t\t\t...ifDefined(\"fix\", this.fix),\n\t\t\t...ifDefined(\"where\", this.where),\n\t\t\t...ifDefined(\"meta\", this.meta),\n\t\t\t...ifDefined(\"docsUrl\", this.docsUrl)\n\t\t};\n\t}\n\t/**\n\t* Type guard to check if an error is a CliStructuredError.\n\t* Uses duck-typing to work across module boundaries where instanceof may fail.\n\t*/\n\tstatic is(error) {\n\t\tif (!(error instanceof Error)) return false;\n\t\tconst candidate = blindCast(error);\n\t\treturn candidate.name === \"CliStructuredError\" && typeof candidate.code === \"string\" && typeof candidate.toEnvelope === \"function\";\n\t}\n};\n//#endregion\n//#region src/structured-error.ts\nconst STRUCTURED_CODE_RE = /^[A-Z][A-Z0-9]*\\.[A-Z][A-Z0-9_]*$/;\nfunction isStructuredError(e) {\n\treturn typeof e === \"object\" && e !== null && \"code\" in e && typeof e.code === \"string\" && STRUCTURED_CODE_RE.test(e.code) && \"message\" in e && typeof e.message === \"string\";\n}\nfunction structuredError(code, message, options) {\n\tconst error = options?.cause !== void 0 ? new Error(message, { cause: options.cause }) : new Error(message);\n\tObject.defineProperty(error, \"name\", {\n\t\tvalue: \"StructuredError\",\n\t\tconfigurable: true\n\t});\n\treturn Object.assign(error, {\n\t\tcode,\n\t\t...ifDefined(\"why\", options?.why),\n\t\t...ifDefined(\"fix\", options?.fix),\n\t\t...ifDefined(\"where\", options?.where),\n\t\t...ifDefined(\"severity\", options?.severity),\n\t\t...ifDefined(\"meta\", options?.meta),\n\t\t...ifDefined(\"docsUrl\", options?.docsUrl)\n\t});\n}\nconst DOCS_BASE = `https://docs.prisma.io/docs/orm/next/reference/error-reference`;\nfunction docsUrlFor(code) {\n\treturn `${DOCS_BASE}#${code}`;\n}\n//#endregion\nexport { CliStructuredError, DOCS_BASE, InternalError, assertNever, docsUrlFor, isInternalError, isStructuredError, structuredError };\n\n//# sourceMappingURL=errors.mjs.map","import { createRequire } from \"node:module\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { blindCast } from \"@internal/foundation/casts\";\n//#region src/check-effect-resolution.ts\n/**\n* Deploy preflight (TML-3158): verify that alchemy resolves the exact `effect`\n* version @prisma/composer pins. Package managers cannot be made to enforce\n* this — alchemy's own peer range accepts newer effect betas, and npm resolves\n* transitive peer conflicts with a warning, not a failure — so a floating\n* `@effect/*` range anywhere in the consumer's tree can hoist a newer effect\n* to the root, where alchemy picks it up and crashes mid-deploy\n* (`TypeError: Schedule.either is not a function`). This check turns that\n* silent break into a start-up error naming the fix.\n*/\n/** Walks up from `startDir` looking for `node_modules/alchemy` (mirrors resolveAlchemyBin). Undefined when absent — the check skips rather than second-guessing later, clearer failures. */\nfunction findAlchemyPackageDir(startDir) {\n\tlet dir = startDir;\n\twhile (true) {\n\t\tconst candidate = path.join(dir, \"node_modules\", \"alchemy\");\n\t\tif (fs.existsSync(path.join(candidate, \"package.json\"))) return candidate;\n\t\tconst parent = path.dirname(dir);\n\t\tif (parent === dir) return void 0;\n\t\tdir = parent;\n\t}\n}\n/**\n* The `effect` version Node gives `packageDir`'s code, resolved exactly as\n* Node would: from the package's real path (so pnpm symlink layouts resolve\n* from the package's own store position, like at runtime). Undefined when\n* `effect` is not resolvable from there.\n*/\nfunction resolveEffectVersionFrom(packageDir) {\n\tlet entry;\n\ttry {\n\t\tentry = createRequire(path.join(fs.realpathSync(packageDir), \"noop.js\")).resolve(\"effect\");\n\t} catch {\n\t\treturn;\n\t}\n\tlet dir = path.dirname(entry);\n\twhile (!fs.existsSync(path.join(dir, \"package.json\"))) {\n\t\tconst parent = path.dirname(dir);\n\t\tif (parent === dir) return void 0;\n\t\tdir = parent;\n\t}\n\tconst version = JSON.parse(fs.readFileSync(path.join(dir, \"package.json\"), \"utf-8\")).version;\n\treturn typeof version === \"string\" ? version : void 0;\n}\n/**\n* The `effect` version @prisma/composer pins, read from its own installed\n* package.json — the single source of truth; never hardcoded here. Undefined\n* when @prisma/composer is not resolvable from `startDir` (e.g. the CLI is\n* driven some other way), in which case the check skips.\n*\n* Assumes the pin is an exact version — effectMismatchError compares with\n* `===`, which scripts/check-npm-effect-resolution.mjs enforces in CI;\n* relaxing the pin to a range means revisiting that comparison.\n*/\nfunction requiredEffectVersion(startDir) {\n\tlet manifestPath;\n\ttry {\n\t\tmanifestPath = createRequire(path.join(startDir, \"noop.js\")).resolve(\"@prisma/composer/package.json\");\n\t} catch {\n\t\treturn;\n\t}\n\tconst manifest = JSON.parse(fs.readFileSync(manifestPath, \"utf-8\"));\n\tif (typeof manifest !== \"object\" || manifest === null || !(\"dependencies\" in manifest)) return;\n\tconst dependencies = manifest.dependencies;\n\tif (typeof dependencies !== \"object\" || dependencies === null || !(\"effect\" in dependencies)) return;\n\tconst version = dependencies.effect;\n\treturn typeof version === \"string\" ? version : void 0;\n}\n/** Pure comparison + parts rendering, separated so tests cover the rule without a filesystem. Returns the structured error parts, or undefined when the tree is healthy or either side is unknown. */\nfunction effectMismatchError(found, required) {\n\tif (found === void 0 || required === void 0 || found === required) return void 0;\n\treturn {\n\t\tsummary: `Dependency conflict: alchemy resolves effect@${found}, but @prisma/composer requires effect@${required}.`,\n\t\twhy: \"Your package manager installed a second effect that alchemy picks up; deploying with it would crash inside alchemy.\",\n\t\tfix: `Add this to your app's package.json, then reinstall:\n\n \"overrides\": { \"effect\": \"${required}\" }\\n\\n(npm uses \"overrides\"; yarn calls it \"resolutions\", pnpm \"pnpm.overrides\".)`,\n\t\tmeta: {\n\t\t\tfound,\n\t\t\trequired\n\t\t}\n\t};\n}\n/**\n* Runs the preflight from the app's directory and RETURNS the\n* DEPS.EFFECT_VERSION_CONFLICT error for a mismatched tree; undefined when the\n* tree is healthy or alchemy is not installed.\n*\n* This is the form the config-load machinery uses. The check belongs on the\n* config-load path rather than at import time because that is the first moment\n* anything actually loads alchemy's provider tree — the break it explains —\n* and because a check that runs at import time takes out commands that never\n* touch alchemy at all, help among them.\n*/\nfunction effectResolutionDiagnostic(cwd) {\n\tconst alchemyDir = findAlchemyPackageDir(cwd);\n\tif (alchemyDir === void 0) return void 0;\n\tconst parts = effectMismatchError(resolveEffectVersionFrom(alchemyDir), requiredEffectVersion(cwd));\n\tif (parts === void 0) return void 0;\n\treturn new CliStructuredError(\"DEPS.EFFECT_VERSION_CONFLICT\", parts.summary, {\n\t\twhy: parts.why,\n\t\tfix: parts.fix,\n\t\tmeta: parts.meta\n\t});\n}\n/** The throwing form, used by the executor-load diagnosis — the one caller left now that the bin runs no start-up preflight of its own. */\nfunction checkEffectResolution(cwd) {\n\tconst diagnostic = effectResolutionDiagnostic(cwd);\n\tif (diagnostic !== void 0) throw diagnostic;\n}\n//#endregion\n//#region src/operations/shared.ts\n/**\n* Reads the execution diagnostics an engine-failure error carries in\n* `meta.diagnostics`; undefined for every other failure.\n*/\nfunction executionDiagnostics(f) {\n\tconst diagnostics = f.meta?.[\"diagnostics\"];\n\tif (typeof diagnostics !== \"object\" || diagnostics === null) return void 0;\n\tconst candidate = blindCast(diagnostics);\n\tif (candidate[\"exitCode\"] !== void 0 && typeof candidate[\"exitCode\"] !== \"number\" || candidate[\"signal\"] !== void 0 && typeof candidate[\"signal\"] !== \"string\" || typeof candidate[\"stackFilePath\"] !== \"string\" || typeof candidate[\"reproduceCommand\"] !== \"string\" || typeof candidate[\"cwd\"] !== \"string\") return;\n\treturn blindCast(diagnostics);\n}\n/**\n* Site-specific wrap for foreign extension/environment causes — passthrough\n* when already structured; never a boundary fallback (base-type rule 6(ii)).\n*/\nfunction toStructured(code, error) {\n\treturn CliStructuredError.is(error) ? error : new CliStructuredError(code, error instanceof Error ? error.message : String(error), { cause: error });\n}\n/** Diagnoses a failed executor import: when the app's tree resolves a\n* mismatched `effect` (the known way that import breaks), the failure is the\n* fix-naming DEPS.EFFECT_VERSION_CONFLICT from checkEffectResolution with the\n* import error riding as cause; otherwise DEPS.EXECUTOR_UNLOADABLE — an\n* environmental failure of the consumer's installed tree, not a bug here. */\nfunction executorLoadFailure(operation, error, cwd) {\n\ttry {\n\t\tcheckEffectResolution(cwd);\n\t} catch (diagnostic) {\n\t\tif (CliStructuredError.is(diagnostic)) return new CliStructuredError(diagnostic.code, diagnostic.message, {\n\t\t\t...diagnostic.why !== void 0 ? { why: diagnostic.why } : {},\n\t\t\t...diagnostic.fix !== void 0 ? { fix: diagnostic.fix } : {},\n\t\t\t...diagnostic.meta !== void 0 ? { meta: diagnostic.meta } : {},\n\t\t\tcause: error\n\t\t});\n\t}\n\treturn new CliStructuredError(\"DEPS.EXECUTOR_UNLOADABLE\", `Could not load the ${operation} executor: ${error instanceof Error ? error.message : String(error)}`, {\n\t\twhy: `The ${operation} operation's executor imports the deploy engine's provider tree from your app's installed dependencies, and that import failed.`,\n\t\tfix: \"Reinstall your dependencies, and check that `alchemy` is installed and loadable from your app.\",\n\t\tcause: error\n\t});\n}\n//#endregion\nexport { effectResolutionDiagnostic as i, executorLoadFailure as n, toStructured as r, executionDiagnostics as t };\n\n//# sourceMappingURL=shared-BTnATsqm.mjs.map","import { t as blindCast } from \"./casts-DpaahrlC.mjs\";\nimport { t as InternalError } from \"./internal-error-BIc-ehme.mjs\";\n//#region src/result.ts\n/**\n* Generic Result type for representing success or failure outcomes.\n*\n* This is the standard way to return \"expected failures\" as values rather than\n* throwing exceptions. See docs/Error Handling.md for the full taxonomy.\n*\n* Naming rationale:\n* - `Ok<T>` / `NotOk<F>` mirror the `ok: true/false` discriminator\n* - `NotOk` avoids collision with domain types like \"Failure\" or \"Error\"\n* - `failure` property distinguishes from JS Error semantics\n*/\n/**\n* Result class that implements both Ok and NotOk variants.\n*/\nvar ResultImpl = class ResultImpl {\n\tok;\n\t_value;\n\t_failure;\n\tconstructor(ok, valueOrFailure) {\n\t\tthis.ok = ok;\n\t\tif (ok) this._value = blindCast(valueOrFailure);\n\t\telse this._failure = blindCast(valueOrFailure);\n\t\tObject.freeze(this);\n\t}\n\tget value() {\n\t\tif (!this.ok) throw new InternalError(\"Cannot access value on NotOk result\");\n\t\treturn this._value;\n\t}\n\tget failure() {\n\t\tif (this.ok) throw new InternalError(\"Cannot access failure on Ok result\");\n\t\treturn this._failure;\n\t}\n\t/**\n\t* Creates a successful result.\n\t*/\n\tstatic ok(value) {\n\t\treturn blindCast(new ResultImpl(true, value));\n\t}\n\t/**\n\t* Creates an unsuccessful result.\n\t*/\n\tstatic notOk(failure) {\n\t\treturn blindCast(new ResultImpl(false, failure));\n\t}\n\t/**\n\t* Asserts that this result is Ok and returns the value.\n\t* Throws if the result is NotOk.\n\t*/\n\tassertOk() {\n\t\tif (!this.ok) throw new InternalError(\"Expected Ok result but got NotOk\");\n\t\treturn this.value;\n\t}\n\t/**\n\t* Asserts that this result is NotOk and returns the failure.\n\t* Throws if the result is Ok.\n\t*/\n\tassertNotOk() {\n\t\tif (this.ok) throw new InternalError(\"Expected NotOk result but got Ok\");\n\t\treturn this.failure;\n\t}\n};\n/**\n* Creates a successful result.\n*/\nfunction ok(value) {\n\treturn ResultImpl.ok(value);\n}\n/**\n* Creates an unsuccessful result.\n*/\nfunction notOk(failure) {\n\treturn ResultImpl.notOk(failure);\n}\n/**\n* Singleton for void success results.\n* Use this for validation checks that don't produce a value.\n*/\nconst OK_VOID = ResultImpl.ok(void 0);\n/**\n* Returns a successful void result.\n* Use this for validation checks that don't produce a value.\n*/\nfunction okVoid() {\n\treturn OK_VOID;\n}\n//#endregion\nexport { notOk, ok, okVoid };\n\n//# sourceMappingURL=result.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,SAAS,UAAU,OAAO;CACzB,OAAO;AACR;;;;;;;;;AC/BA,IAAI,gBAAgB,cAAc,MAAM;CACvC,wBAAwB;CACxB,YAAY,SAAS,SAAS;EAC7B,MAAM,SAAS,SAAS,UAAU,KAAK,IAAI,EAAE,OAAO,QAAQ,MAAM,IAAI,KAAK,CAAC;EAC5E,KAAK,OAAO;CACb;AACD;;;;;;;;;;;;;;;;;;;;;;;;;ACYA,SAAS,UAAU,KAAK,OAAO;CAC9B,OAAO,UAAU,KAAK,IAAI,UAAU,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC;AAC1D;;;;;;;;;;;AAaA,IAAI,qBAAqB,cAAc,MAAM;CAC5C;CACA;CACA,YAAY,MAAM,SAAS,SAAS;EACnC,MAAM,SAAS,SAAS,UAAU,KAAK,IAAI,EAAE,OAAO,QAAQ,MAAM,IAAI,KAAK,CAAC;EAC5E,KAAK,OAAO;EACZ,KAAK,OAAO;EACZ,KAAK,WAAW,SAAS,YAAY;EACrC,MAAM,MAAM,SAAS,QAAQ,SAAS,MAAM,KAAK,IAAI,SAAS;EAC9D,MAAM,QAAQ,SAAS,QAAQ;GAC9B,GAAG,UAAU,QAAQ,QAAQ,MAAM,IAAI;GACvC,GAAG,UAAU,QAAQ,QAAQ,MAAM,IAAI;EACxC,IAAI,KAAK;EACT,OAAO,OAAO,MAAM;GACnB,GAAG,UAAU,OAAO,SAAS,GAAG;GAChC,GAAG,UAAU,OAAO,GAAG;GACvB,GAAG,UAAU,SAAS,KAAK;GAC3B,GAAG,UAAU,QAAQ,SAAS,IAAI;GAClC,GAAG,UAAU,WAAW,SAAS,OAAO;EACzC,CAAC;CACF;;;;CAIA,aAAa;EACZ,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OACzC,KAAK,WAAW,UAAU,cAAc;EAC7C,OAAO,OAAO,IAAI;CACnB;CACA,IAAI,QAAQ;EACX,IAAI,CAAC,KAAK,IAAI,MAAM,IAAI,cAAc,qCAAqC;EAC3E,OAAO,KAAK;CACb;CACA,IAAI,UAAU;EACb,IAAI,KAAK,IAAI,MAAM,IAAI,cAAc,oCAAoC;EACzE,OAAO,KAAK;CACb;;;;CAIA,OAAO,GAAG,OAAO;EAChB,OAAO,UAAU,IAAI,WAAW,MAAM,KAAK,CAAC;CAC7C;;;;CAIA,OAAO,MAAM,SAAS;EACrB,OAAO,UAAU,IAAI,WAAW,OAAO,OAAO,CAAC;CAChD;;;;;CAKA,WAAW;EACV,IAAI,CAAC,KAAK,IAAI,MAAM,IAAI,cAAc,kCAAkC;EACxE,OAAO,KAAK;CACb;;;;;CAKA,cAAc;EACb,IAAI,KAAK,IAAI,MAAM,IAAI,cAAc,kCAAkC;EACvE,OAAO,KAAK;CACb;AACD;;;;AAIA,SAAS,GAAG,OAAO;CAClB,OAAO,WAAW,GAAG,KAAK;AAC3B;;;;AAIA,SAAS,MAAM,SAAS;CACvB,OAAO,WAAW,MAAM,OAAO;AAChC;;;;;AAKA,MAAM,UAAU,WAAW,GAAG,KAAK,CAAC;;;;;AAKpC,SAAS,SAAS;CACjB,OAAO;AACR"}
|
package/dist/result-wonf1deB.mjs
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { t as blindCast } from "./casts-DpaahrlC-C5XMnP9S.mjs";
|
|
2
|
-
import { t as InternalError } from "./internal-error-BIc-ehme-Ck_lgxD_.mjs";
|
|
3
|
-
//#region ../../0-framework/0-foundation/foundation/dist/result.mjs
|
|
4
|
-
/**
|
|
5
|
-
* Generic Result type for representing success or failure outcomes.
|
|
6
|
-
*
|
|
7
|
-
* This is the standard way to return "expected failures" as values rather than
|
|
8
|
-
* throwing exceptions. See docs/Error Handling.md for the full taxonomy.
|
|
9
|
-
*
|
|
10
|
-
* Naming rationale:
|
|
11
|
-
* - `Ok<T>` / `NotOk<F>` mirror the `ok: true/false` discriminator
|
|
12
|
-
* - `NotOk` avoids collision with domain types like "Failure" or "Error"
|
|
13
|
-
* - `failure` property distinguishes from JS Error semantics
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* Result class that implements both Ok and NotOk variants.
|
|
17
|
-
*/
|
|
18
|
-
var ResultImpl = class ResultImpl {
|
|
19
|
-
ok;
|
|
20
|
-
_value;
|
|
21
|
-
_failure;
|
|
22
|
-
constructor(ok, valueOrFailure) {
|
|
23
|
-
this.ok = ok;
|
|
24
|
-
if (ok) this._value = blindCast(valueOrFailure);
|
|
25
|
-
else this._failure = blindCast(valueOrFailure);
|
|
26
|
-
Object.freeze(this);
|
|
27
|
-
}
|
|
28
|
-
get value() {
|
|
29
|
-
if (!this.ok) throw new InternalError("Cannot access value on NotOk result");
|
|
30
|
-
return this._value;
|
|
31
|
-
}
|
|
32
|
-
get failure() {
|
|
33
|
-
if (this.ok) throw new InternalError("Cannot access failure on Ok result");
|
|
34
|
-
return this._failure;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Creates a successful result.
|
|
38
|
-
*/
|
|
39
|
-
static ok(value) {
|
|
40
|
-
return blindCast(new ResultImpl(true, value));
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Creates an unsuccessful result.
|
|
44
|
-
*/
|
|
45
|
-
static notOk(failure) {
|
|
46
|
-
return blindCast(new ResultImpl(false, failure));
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Asserts that this result is Ok and returns the value.
|
|
50
|
-
* Throws if the result is NotOk.
|
|
51
|
-
*/
|
|
52
|
-
assertOk() {
|
|
53
|
-
if (!this.ok) throw new InternalError("Expected Ok result but got NotOk");
|
|
54
|
-
return this.value;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Asserts that this result is NotOk and returns the failure.
|
|
58
|
-
* Throws if the result is Ok.
|
|
59
|
-
*/
|
|
60
|
-
assertNotOk() {
|
|
61
|
-
if (this.ok) throw new InternalError("Expected NotOk result but got Ok");
|
|
62
|
-
return this.failure;
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* Creates a successful result.
|
|
67
|
-
*/
|
|
68
|
-
function ok(value) {
|
|
69
|
-
return ResultImpl.ok(value);
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Creates an unsuccessful result.
|
|
73
|
-
*/
|
|
74
|
-
function notOk(failure) {
|
|
75
|
-
return ResultImpl.notOk(failure);
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Singleton for void success results.
|
|
79
|
-
* Use this for validation checks that don't produce a value.
|
|
80
|
-
*/
|
|
81
|
-
const OK_VOID = ResultImpl.ok(void 0);
|
|
82
|
-
/**
|
|
83
|
-
* Returns a successful void result.
|
|
84
|
-
* Use this for validation checks that don't produce a value.
|
|
85
|
-
*/
|
|
86
|
-
function okVoid() {
|
|
87
|
-
return OK_VOID;
|
|
88
|
-
}
|
|
89
|
-
//#endregion
|
|
90
|
-
export { ok as n, okVoid as r, notOk as t };
|
|
91
|
-
|
|
92
|
-
//# sourceMappingURL=result-wonf1deB.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"result-wonf1deB.mjs","names":[],"sources":["../../../0-framework/0-foundation/foundation/dist/result.mjs"],"sourcesContent":["import { t as blindCast } from \"./casts-DpaahrlC.mjs\";\nimport { t as InternalError } from \"./internal-error-BIc-ehme.mjs\";\n//#region src/result.ts\n/**\n* Generic Result type for representing success or failure outcomes.\n*\n* This is the standard way to return \"expected failures\" as values rather than\n* throwing exceptions. See docs/Error Handling.md for the full taxonomy.\n*\n* Naming rationale:\n* - `Ok<T>` / `NotOk<F>` mirror the `ok: true/false` discriminator\n* - `NotOk` avoids collision with domain types like \"Failure\" or \"Error\"\n* - `failure` property distinguishes from JS Error semantics\n*/\n/**\n* Result class that implements both Ok and NotOk variants.\n*/\nvar ResultImpl = class ResultImpl {\n\tok;\n\t_value;\n\t_failure;\n\tconstructor(ok, valueOrFailure) {\n\t\tthis.ok = ok;\n\t\tif (ok) this._value = blindCast(valueOrFailure);\n\t\telse this._failure = blindCast(valueOrFailure);\n\t\tObject.freeze(this);\n\t}\n\tget value() {\n\t\tif (!this.ok) throw new InternalError(\"Cannot access value on NotOk result\");\n\t\treturn this._value;\n\t}\n\tget failure() {\n\t\tif (this.ok) throw new InternalError(\"Cannot access failure on Ok result\");\n\t\treturn this._failure;\n\t}\n\t/**\n\t* Creates a successful result.\n\t*/\n\tstatic ok(value) {\n\t\treturn blindCast(new ResultImpl(true, value));\n\t}\n\t/**\n\t* Creates an unsuccessful result.\n\t*/\n\tstatic notOk(failure) {\n\t\treturn blindCast(new ResultImpl(false, failure));\n\t}\n\t/**\n\t* Asserts that this result is Ok and returns the value.\n\t* Throws if the result is NotOk.\n\t*/\n\tassertOk() {\n\t\tif (!this.ok) throw new InternalError(\"Expected Ok result but got NotOk\");\n\t\treturn this.value;\n\t}\n\t/**\n\t* Asserts that this result is NotOk and returns the failure.\n\t* Throws if the result is Ok.\n\t*/\n\tassertNotOk() {\n\t\tif (this.ok) throw new InternalError(\"Expected NotOk result but got Ok\");\n\t\treturn this.failure;\n\t}\n};\n/**\n* Creates a successful result.\n*/\nfunction ok(value) {\n\treturn ResultImpl.ok(value);\n}\n/**\n* Creates an unsuccessful result.\n*/\nfunction notOk(failure) {\n\treturn ResultImpl.notOk(failure);\n}\n/**\n* Singleton for void success results.\n* Use this for validation checks that don't produce a value.\n*/\nconst OK_VOID = ResultImpl.ok(void 0);\n/**\n* Returns a successful void result.\n* Use this for validation checks that don't produce a value.\n*/\nfunction okVoid() {\n\treturn OK_VOID;\n}\n//#endregion\nexport { notOk, ok, okVoid };\n\n//# sourceMappingURL=result.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,IAAI,aAAa,MAAM,WAAW;CACjC;CACA;CACA;CACA,YAAY,IAAI,gBAAgB;EAC/B,KAAK,KAAK;EACV,IAAI,IAAI,KAAK,SAAS,UAAU,cAAc;OACzC,KAAK,WAAW,UAAU,cAAc;EAC7C,OAAO,OAAO,IAAI;CACnB;CACA,IAAI,QAAQ;EACX,IAAI,CAAC,KAAK,IAAI,MAAM,IAAI,cAAc,qCAAqC;EAC3E,OAAO,KAAK;CACb;CACA,IAAI,UAAU;EACb,IAAI,KAAK,IAAI,MAAM,IAAI,cAAc,oCAAoC;EACzE,OAAO,KAAK;CACb;;;;CAIA,OAAO,GAAG,OAAO;EAChB,OAAO,UAAU,IAAI,WAAW,MAAM,KAAK,CAAC;CAC7C;;;;CAIA,OAAO,MAAM,SAAS;EACrB,OAAO,UAAU,IAAI,WAAW,OAAO,OAAO,CAAC;CAChD;;;;;CAKA,WAAW;EACV,IAAI,CAAC,KAAK,IAAI,MAAM,IAAI,cAAc,kCAAkC;EACxE,OAAO,KAAK;CACb;;;;;CAKA,cAAc;EACb,IAAI,KAAK,IAAI,MAAM,IAAI,cAAc,kCAAkC;EACvE,OAAO,KAAK;CACb;AACD;;;;AAIA,SAAS,GAAG,OAAO;CAClB,OAAO,WAAW,GAAG,KAAK;AAC3B;;;;AAIA,SAAS,MAAM,SAAS;CACvB,OAAO,WAAW,MAAM,OAAO;AAChC;;;;;AAKA,MAAM,UAAU,WAAW,GAAG,KAAK,CAAC;;;;;AAKpC,SAAS,SAAS;CACjB,OAAO;AACR"}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { t as CliStructuredError } from "./errors-DkXcnjPx.mjs";
|
|
2
|
-
import * as fs from "node:fs";
|
|
3
|
-
import * as path from "node:path";
|
|
4
|
-
import { spawn } from "node:child_process";
|
|
5
|
-
//#region ../../0-framework/3-tooling/cli/dist/run-alchemy-D44OZlyB.mjs
|
|
6
|
-
/**
|
|
7
|
-
* Pipeline step 7 (deploy-cli.md § The pipeline; design-notes.md's "Driving
|
|
8
|
-
* Alchemy" call): hand the terminal to the generated stack file. Resolves the
|
|
9
|
-
* workspace's own installed `alchemy` bin (walking up `node_modules/.bin`
|
|
10
|
-
* from the generated file's package dir) rather than going through
|
|
11
|
-
* `bunx`/`npx`, so this works the same under node and bun — the resolved
|
|
12
|
-
* bin's own launcher (`alchemy/bin/cli.js`) does its own node/bun dispatch
|
|
13
|
-
* from there, driven by the env it inherits.
|
|
14
|
-
*
|
|
15
|
-
* This module composes the invocation; it does not decide how the child is
|
|
16
|
-
* started. Under the CLI the engine starts it (`ctx.spawn`), which is what
|
|
17
|
-
* makes Ctrl-C reach the child natively and keeps signal policy in one place.
|
|
18
|
-
* `spawnAlchemy` is the default for programmatic hosts driving
|
|
19
|
-
* `@prisma/composer/control`, which have no engine to borrow.
|
|
20
|
-
*/
|
|
21
|
-
/** Walks up from `startDir` looking for `node_modules/.bin/alchemy`. */
|
|
22
|
-
function resolveAlchemyBin(startDir) {
|
|
23
|
-
let dir = startDir;
|
|
24
|
-
while (true) {
|
|
25
|
-
const candidate = path.join(dir, "node_modules", ".bin", "alchemy");
|
|
26
|
-
if (fs.existsSync(candidate)) return candidate;
|
|
27
|
-
const parent = path.dirname(dir);
|
|
28
|
-
if (parent === dir) throw new CliStructuredError("DEPLOY.ALCHEMY_BIN_MISSING", `Could not find an installed \`alchemy\` bin above "${startDir}".`, { fix: "Add \"alchemy\" as a dependency of your app." });
|
|
29
|
-
dir = parent;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Resolves the invocation against this machine — the step every adapter takes
|
|
34
|
-
* and no caller should. Raises DEPLOY.ALCHEMY_BIN_MISSING when the app has no
|
|
35
|
-
* alchemy installed.
|
|
36
|
-
*/
|
|
37
|
-
function alchemyCommandLine(invocation) {
|
|
38
|
-
return {
|
|
39
|
-
command: resolveAlchemyBin(invocation.cwd),
|
|
40
|
-
args: [
|
|
41
|
-
invocation.action,
|
|
42
|
-
invocation.stackFileRelativePath,
|
|
43
|
-
"--yes",
|
|
44
|
-
"--stage",
|
|
45
|
-
invocation.stage
|
|
46
|
-
],
|
|
47
|
-
cwd: invocation.cwd,
|
|
48
|
-
env: invocation.env
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
/** What becomes `alchemy deploy|destroy <stack file> --yes --stage <stage>`. */
|
|
52
|
-
function alchemyInvocation(input) {
|
|
53
|
-
return {
|
|
54
|
-
action: input.command,
|
|
55
|
-
stackFileRelativePath: input.stackFileRelativePath,
|
|
56
|
-
cwd: input.cwd,
|
|
57
|
-
stage: input.stage,
|
|
58
|
-
env: {
|
|
59
|
-
...input.containerEnv,
|
|
60
|
-
...input.env
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* The default runner for hosts with no engine: inherited stdio, the caller's
|
|
66
|
-
* own process group, and the child's status returned verbatim. It does not
|
|
67
|
-
* collapse a signal into an exit code — that collapse is what made a
|
|
68
|
-
* Ctrl-C'd deploy report itself as a failure.
|
|
69
|
-
*/
|
|
70
|
-
const spawnAlchemy = async (invocation) => {
|
|
71
|
-
const line = alchemyCommandLine(invocation);
|
|
72
|
-
return new Promise((resolve, reject) => {
|
|
73
|
-
const child = spawn(line.command, [...line.args], {
|
|
74
|
-
cwd: line.cwd,
|
|
75
|
-
stdio: "inherit",
|
|
76
|
-
env: {
|
|
77
|
-
...process.env,
|
|
78
|
-
...line.env
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
child.on("error", reject);
|
|
82
|
-
child.on("close", (exitCode, signal) => {
|
|
83
|
-
resolve({
|
|
84
|
-
exitCode,
|
|
85
|
-
signal
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
};
|
|
90
|
-
//#endregion
|
|
91
|
-
export { alchemyInvocation as n, spawnAlchemy as r, alchemyCommandLine as t };
|
|
92
|
-
|
|
93
|
-
//# sourceMappingURL=run-alchemy-D44OZlyB-DeDTFsB6.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run-alchemy-D44OZlyB-DeDTFsB6.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/run-alchemy-D44OZlyB.mjs"],"sourcesContent":["import { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { spawn } from \"node:child_process\";\n//#region src/run-alchemy.ts\n/**\n* Pipeline step 7 (deploy-cli.md § The pipeline; design-notes.md's \"Driving\n* Alchemy\" call): hand the terminal to the generated stack file. Resolves the\n* workspace's own installed `alchemy` bin (walking up `node_modules/.bin`\n* from the generated file's package dir) rather than going through\n* `bunx`/`npx`, so this works the same under node and bun — the resolved\n* bin's own launcher (`alchemy/bin/cli.js`) does its own node/bun dispatch\n* from there, driven by the env it inherits.\n*\n* This module composes the invocation; it does not decide how the child is\n* started. Under the CLI the engine starts it (`ctx.spawn`), which is what\n* makes Ctrl-C reach the child natively and keeps signal policy in one place.\n* `spawnAlchemy` is the default for programmatic hosts driving\n* `@prisma/composer/control`, which have no engine to borrow.\n*/\n/** Walks up from `startDir` looking for `node_modules/.bin/alchemy`. */\nfunction resolveAlchemyBin(startDir) {\n\tlet dir = startDir;\n\twhile (true) {\n\t\tconst candidate = path.join(dir, \"node_modules\", \".bin\", \"alchemy\");\n\t\tif (fs.existsSync(candidate)) return candidate;\n\t\tconst parent = path.dirname(dir);\n\t\tif (parent === dir) throw new CliStructuredError(\"DEPLOY.ALCHEMY_BIN_MISSING\", `Could not find an installed \\`alchemy\\` bin above \"${startDir}\".`, { fix: \"Add \\\"alchemy\\\" as a dependency of your app.\" });\n\t\tdir = parent;\n\t}\n}\n/**\n* Resolves the invocation against this machine — the step every adapter takes\n* and no caller should. Raises DEPLOY.ALCHEMY_BIN_MISSING when the app has no\n* alchemy installed.\n*/\nfunction alchemyCommandLine(invocation) {\n\treturn {\n\t\tcommand: resolveAlchemyBin(invocation.cwd),\n\t\targs: [\n\t\t\tinvocation.action,\n\t\t\tinvocation.stackFileRelativePath,\n\t\t\t\"--yes\",\n\t\t\t\"--stage\",\n\t\t\tinvocation.stage\n\t\t],\n\t\tcwd: invocation.cwd,\n\t\tenv: invocation.env\n\t};\n}\n/** What becomes `alchemy deploy|destroy <stack file> --yes --stage <stage>`. */\nfunction alchemyInvocation(input) {\n\treturn {\n\t\taction: input.command,\n\t\tstackFileRelativePath: input.stackFileRelativePath,\n\t\tcwd: input.cwd,\n\t\tstage: input.stage,\n\t\tenv: {\n\t\t\t...input.containerEnv,\n\t\t\t...input.env\n\t\t}\n\t};\n}\n/**\n* The default runner for hosts with no engine: inherited stdio, the caller's\n* own process group, and the child's status returned verbatim. It does not\n* collapse a signal into an exit code — that collapse is what made a\n* Ctrl-C'd deploy report itself as a failure.\n*/\nconst spawnAlchemy = async (invocation) => {\n\tconst line = alchemyCommandLine(invocation);\n\treturn new Promise((resolve, reject) => {\n\t\tconst child = spawn(line.command, [...line.args], {\n\t\t\tcwd: line.cwd,\n\t\t\tstdio: \"inherit\",\n\t\t\tenv: {\n\t\t\t\t...process.env,\n\t\t\t\t...line.env\n\t\t\t}\n\t\t});\n\t\tchild.on(\"error\", reject);\n\t\tchild.on(\"close\", (exitCode, signal) => {\n\t\t\tresolve({\n\t\t\t\texitCode,\n\t\t\t\tsignal\n\t\t\t});\n\t\t});\n\t});\n};\n//#endregion\nexport { spawnAlchemy as i, alchemyInvocation as n, resolveAlchemyBin as r, alchemyCommandLine as t };\n\n//# sourceMappingURL=run-alchemy-D44OZlyB.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBA,SAAS,kBAAkB,UAAU;CACpC,IAAI,MAAM;CACV,OAAO,MAAM;EACZ,MAAM,YAAY,KAAK,KAAK,KAAK,gBAAgB,QAAQ,SAAS;EAClE,IAAI,GAAG,WAAW,SAAS,GAAG,OAAO;EACrC,MAAM,SAAS,KAAK,QAAQ,GAAG;EAC/B,IAAI,WAAW,KAAK,MAAM,IAAI,mBAAmB,8BAA8B,sDAAsD,SAAS,KAAK,EAAE,KAAK,+CAA+C,CAAC;EAC1M,MAAM;CACP;AACD;;;;;;AAMA,SAAS,mBAAmB,YAAY;CACvC,OAAO;EACN,SAAS,kBAAkB,WAAW,GAAG;EACzC,MAAM;GACL,WAAW;GACX,WAAW;GACX;GACA;GACA,WAAW;EACZ;EACA,KAAK,WAAW;EAChB,KAAK,WAAW;CACjB;AACD;;AAEA,SAAS,kBAAkB,OAAO;CACjC,OAAO;EACN,QAAQ,MAAM;EACd,uBAAuB,MAAM;EAC7B,KAAK,MAAM;EACX,OAAO,MAAM;EACb,KAAK;GACJ,GAAG,MAAM;GACT,GAAG,MAAM;EACV;CACD;AACD;;;;;;;AAOA,MAAM,eAAe,OAAO,eAAe;CAC1C,MAAM,OAAO,mBAAmB,UAAU;CAC1C,OAAO,IAAI,SAAS,SAAS,WAAW;EACvC,MAAM,QAAQ,MAAM,KAAK,SAAS,CAAC,GAAG,KAAK,IAAI,GAAG;GACjD,KAAK,KAAK;GACV,OAAO;GACP,KAAK;IACJ,GAAG,QAAQ;IACX,GAAG,KAAK;GACT;EACD,CAAC;EACD,MAAM,GAAG,SAAS,MAAM;EACxB,MAAM,GAAG,UAAU,UAAU,WAAW;GACvC,QAAQ;IACP;IACA;GACD,CAAC;EACF,CAAC;CACF,CAAC;AACF"}
|
package/src/exports/family.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Public surface (the `./family` subpath): composer's engine `CommandFamily`,
|
|
3
|
-
* for hosts that mount composer's commands into their own CLI — the `prisma`
|
|
4
|
-
* bin does exactly this.
|
|
5
|
-
*
|
|
6
|
-
* Kept apart from `./control` on purpose. `./control` is the programmatic
|
|
7
|
-
* deploy pipeline; this is the command surface: grammar, help and arg
|
|
8
|
-
* validation belong to the engine, and the handlers behind them are the same
|
|
9
|
-
* operations `./control` exposes.
|
|
10
|
-
*
|
|
11
|
-
* Its static graph is alchemy-free and effect-free, so importing it costs a
|
|
12
|
-
* host nothing until a composer command actually runs.
|
|
13
|
-
*/
|
|
14
|
-
export * from '@internal/cli/family';
|