@prisma/composer 0.36.0-dev.1 → 0.36.0-dev.2
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-DNnd7Zu--BQ1vHaMK.d.mts → app-config-CWm3wlNA-BVGreP8x.d.mts} +4 -2
- package/dist/{app-config-DNnd7Zu--BQ1vHaMK.d.mts.map → app-config-CWm3wlNA-BVGreP8x.d.mts.map} +1 -1
- package/dist/config-BSdGEsYV.d.mts +1 -0
- package/dist/config.d.mts +2 -2
- package/dist/control.d.mts +10 -5
- package/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +3 -3
- package/dist/control.mjs.map +1 -1
- package/dist/deploy-BSdGEsYV.d.mts +1 -0
- package/dist/deploy.d.mts +2 -2
- package/dist/{deployment-summary-p88NV5m5-SaPCCX2C.d.mts → deployment-summary-p88NV5m5-C2gLUQ8l.d.mts} +3 -3
- package/dist/{deployment-summary-p88NV5m5-SaPCCX2C.d.mts.map → deployment-summary-p88NV5m5-C2gLUQ8l.d.mts.map} +1 -1
- package/dist/{dev-current-Brb4qugP-CG0_96FZ.mjs → dev-current-BNoPkDRU-CtQMfn60.mjs} +5 -5
- package/dist/{dev-current-Brb4qugP-CG0_96FZ.mjs.map → dev-current-BNoPkDRU-CtQMfn60.mjs.map} +1 -1
- package/dist/{execute-deploy-destroy-CNt-xpE7-CYaa3sYk.mjs → execute-deploy-destroy-BIqwt1RF-CP2mVGW_.mjs} +3 -3
- package/dist/{execute-deploy-destroy-CNt-xpE7-CYaa3sYk.mjs.map → execute-deploy-destroy-BIqwt1RF-CP2mVGW_.mjs.map} +1 -1
- package/dist/{execute-dev-BUk-XWBJ-ZHX5A8cR.mjs → execute-dev-DIEyloWn-C0jgWe-M.mjs} +8 -4
- package/dist/{execute-dev-BUk-XWBJ-ZHX5A8cR.mjs.map → execute-dev-DIEyloWn-C0jgWe-M.mjs.map} +1 -1
- package/dist/{execute-dev-current-BdEqeKAB-BLUs2eQv.mjs → execute-dev-current-CeKI-tiC-DVTy30tU.mjs} +3 -3
- package/dist/{execute-dev-current-BdEqeKAB-BLUs2eQv.mjs.map → execute-dev-current-CeKI-tiC-DVTy30tU.mjs.map} +1 -1
- package/dist/{execute-log-aiHhujIh-C_aXmb6j.mjs → execute-log-DA5AAQAA-ByUrxpMJ.mjs} +3 -3
- package/dist/{execute-log-aiHhujIh-C_aXmb6j.mjs.map → execute-log-DA5AAQAA-ByUrxpMJ.mjs.map} +1 -1
- package/dist/local-target.d.mts +1 -1
- package/dist/nextjs-control.d.mts +3 -3
- package/dist/node-control.d.mts +3 -3
- package/dist/report.d.mts +3 -3
- package/package.json +11 -11
- package/skills/prisma-composer-core-concepts/SKILL.md +26 -4
- package/dist/config-RKyUvtGC.d.mts +0 -1
- package/dist/deploy-RKyUvtGC.d.mts +0 -1
package/dist/{execute-dev-current-BdEqeKAB-BLUs2eQv.mjs → execute-dev-current-CeKI-tiC-DVTy30tU.mjs}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as InternalError } from "./internal-error-Dfur7Zqt-D96dWHZK.mjs";
|
|
2
2
|
import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
|
|
3
3
|
import { i as devEnvironmentDir } from "./app-config-CErnR6NK-D9NgSBH4.mjs";
|
|
4
|
-
import { c as toStructured, l as notOk, u as ok } from "./dev-current-
|
|
4
|
+
import { c as toStructured, l as notOk, u as ok } from "./dev-current-BNoPkDRU-CtQMfn60.mjs";
|
|
5
5
|
import { r as resolveLocalTargets } from "./local-target-DySKw61w.mjs";
|
|
6
6
|
import { i as validateEnvironmentName, n as resolveAppIdentity, t as checkConfigSource } from "./validate-environment-CEhUSEg2-DmAtiQhe.mjs";
|
|
7
7
|
import { n as requireDevEnvironmentName } from "./dev-environment-name-6eEr5PW8-CGk1ijP7.mjs";
|
|
8
8
|
import * as path$1 from "node:path";
|
|
9
|
-
//#region ../../0-framework/3-tooling/cli/dist/execute-dev-current-
|
|
9
|
+
//#region ../../0-framework/3-tooling/cli/dist/execute-dev-current-CeKI-tiC.mjs
|
|
10
10
|
/**
|
|
11
11
|
* The `devUrl` and `devStop` executor: config → each extension's local
|
|
12
12
|
* target → the app's local copy in the environment, read from that
|
|
@@ -163,4 +163,4 @@ async function executeDevStop(input, cwd) {
|
|
|
163
163
|
//#endregion
|
|
164
164
|
export { executeDevStop, executeDevUrl };
|
|
165
165
|
|
|
166
|
-
//# sourceMappingURL=execute-dev-current-
|
|
166
|
+
//# sourceMappingURL=execute-dev-current-CeKI-tiC-DVTy30tU.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute-dev-current-BdEqeKAB-BLUs2eQv.mjs","names":["path"],"sources":["../../../0-framework/3-tooling/cli/dist/execute-dev-current-BdEqeKAB.mjs"],"sourcesContent":["import { n as checkConfigSource, r as resolveAppIdentity, t as validateEnvironmentName } from \"./validate-environment-CEhUSEg2.mjs\";\nimport { d as toStructured } from \"./dev-current-Brb4qugP.mjs\";\nimport { n as requireDevEnvironmentName } from \"./dev-environment-name-6eEr5PW8.mjs\";\nimport * as path from \"node:path\";\nimport { CliStructuredError, InternalError } from \"@internal/foundation/errors\";\nimport { notOk, ok } from \"@internal/foundation/result\";\nimport { devEnvironmentDir, resolveLocalTargets } from \"@internal/core/local-target\";\n//#region src/operations/execute-dev-current.ts\n/**\n* The `devUrl` and `devStop` executor: config → each extension's local\n* target → the app's local copy in the environment, read from that\n* environment's dev state. Reached only by lazy import from dev-current.ts —\n* resolving the local targets loads their descriptors, whose graphs reach\n* alchemy's provider tree.\n*/\nfunction platformUnsupported() {\n\treturn new CliStructuredError(\"DEV.PLATFORM_UNSUPPORTED\", \"local dev is not supported on Windows yet.\");\n}\n/** The `prisma dev` command that runs `environment`. */\nfunction runDev(environment) {\n\treturn environment === \"dev\" ? \"`prisma dev`\" : `\\`prisma dev --environment ${environment}\\``;\n}\n/** A call into an extension's local target; its failures that carry no code are the emulator's. */\nasync function fromTarget(call) {\n\ttry {\n\t\treturn await call();\n\t} catch (error) {\n\t\tthrow toStructured(\"DEV.EMULATOR_FAILED\", error);\n\t}\n}\n/** Every extension's record of the app in the environment; fails when none recorded it. */\nasync function currentApps(copy, cwd) {\n\tconst { app, environment } = copy;\n\tconst { value } = checkConfigSource(copy.config, cwd);\n\tconst devDir = path.join(cwd, devEnvironmentDir(environment));\n\trequireDevEnvironmentName(devDir, environment);\n\tconst apps = [];\n\tfor (const target of (await resolveLocalTargets(value)).values()) {\n\t\tconst current = await fromTarget(async () => target.current?.({\n\t\t\tdevDir,\n\t\t\tapp,\n\t\t\tenvironment\n\t\t}));\n\t\tif (current !== void 0) apps.push(current);\n\t}\n\tif (apps.length === 0) throw new CliStructuredError(\"DEV.NOT_STARTED_HERE\", `\\`prisma dev\\` has not run ${app} in the environment ${environment} in ${cwd}.`, {\n\t\twhy: `The local services, databases and buckets of an app are recorded in ${devDir} when \\`prisma dev\\` runs it in the environment ${environment}, and ${app} has no such record.`,\n\t\tfix: `Run ${runDev(environment)} for ${app} in this directory.`,\n\t\tmeta: {\n\t\t\tcwd,\n\t\t\tapp,\n\t\t\tenvironment\n\t\t}\n\t});\n\treturn apps;\n}\n/** The app a full address starts with: `shop.api` belongs to `shop`. */\nfunction appOfAddress(address) {\n\tconst dot = address.indexOf(\".\");\n\treturn dot === -1 ? address : address.slice(0, dot);\n}\nasync function locate(input, cwd) {\n\tconst environment = input.environment ?? \"dev\";\n\tvalidateEnvironmentName(environment);\n\tconst app = appOfAddress(input.address);\n\tconst apps = await currentApps({\n\t\tconfig: input.config,\n\t\tapp,\n\t\tenvironment\n\t}, cwd);\n\tconst recorded = apps.find((candidate) => candidate.addresses.includes(input.address));\n\tif (recorded === void 0) {\n\t\tconst known = apps.flatMap((candidate) => candidate.addresses).sort();\n\t\tthrow new CliStructuredError(\"DEV.ADDRESS_UNKNOWN\", `\"${app}\" has no node at \"${input.address}\" in the environment ${environment}.`, {\n\t\t\twhy: `The addresses recorded for ${app} in the environment ${environment} are: ${known.join(\", \")}.`,\n\t\t\tfix: \"Pass one of those addresses. A nested node has a dotted address, such as `shop.catalog.database`.\",\n\t\t\tmeta: {\n\t\t\t\taddress: input.address,\n\t\t\t\tknown\n\t\t\t}\n\t\t});\n\t}\n\tconst location = await fromTarget(() => recorded.locate(input.address));\n\tif (location === void 0) throw new InternalError(`the local target recorded \"${input.address}\" but cannot locate it`);\n\tif (location.emulator === \"not-running\") throw new CliStructuredError(\"DEV.EMULATOR_UNREACHABLE\", `The local ${location.kind} emulator that runs \"${input.address}\" is not running.`, {\n\t\twhy: \"The local emulators run your services, databases and buckets on this machine; `prisma dev` starts the ones an app needs.\",\n\t\tfix: `Run ${runDev(environment)} in this directory.`,\n\t\tmeta: {\n\t\t\taddress: input.address,\n\t\t\tkind: location.kind\n\t\t}\n\t});\n\tif (location.condition !== \"running\") throw notRunning(input.address, environment, location);\n\tif (location.url === void 0) throw new InternalError(`the local target reports \"${input.address}\" running with no URL`);\n\tconst runs = location.command !== void 0 ? \"dev-server\" : location.kind === \"service\" ? \"artifact\" : void 0;\n\treturn {\n\t\taddress: input.address,\n\t\tkind: location.kind,\n\t\turl: location.url,\n\t\tstate: location.state,\n\t\t...runs !== void 0 ? { runs } : {}\n\t};\n}\nfunction notRunning(address, environment, location) {\n\tconst rerun = `Run ${runDev(environment)} in this directory.`;\n\tconst { kind, state, condition, logPath } = location;\n\tconst meta = {\n\t\taddress,\n\t\tkind,\n\t\tstate,\n\t\t...logPath === void 0 ? {} : { logPath }\n\t};\n\tconst message = `The ${kind} \"${address}\" is not running (${state}).`;\n\tif (condition === \"crashing\") return new CliStructuredError(\"DEV.NOT_RUNNING\", message, {\n\t\twhy: \"It exited after it started, and it is being restarted or was held after repeated crashes.\",\n\t\tfix: logPath === void 0 ? \"Read its output in the `prisma dev` terminal, fix the cause, and rebuild.\" : `Read its log at ${logPath}, fix the cause, and rebuild.`,\n\t\tmeta\n\t});\n\tif (condition === \"missing\") return new CliStructuredError(\"DEV.NOT_RUNNING\", message, {\n\t\twhy: \"The local emulator no longer has it, for example because a Composer upgrade discarded the emulator’s state.\",\n\t\tfix: `${rerun} It creates the ${kind} again, empty.`,\n\t\tmeta\n\t});\n\treturn new CliStructuredError(\"DEV.NOT_RUNNING\", `The ${kind} \"${address}\" is stopped.`, {\n\t\twhy: \"`prisma dev stop` and `prisma dev` ending both stop an app's services and database servers, and a stopped node has no URL that answers.\",\n\t\tfix: rerun,\n\t\tmeta\n\t});\n}\nasync function executeDevUrl(input, cwd) {\n\tif (process.platform === \"win32\") return notOk(platformUnsupported());\n\ttry {\n\t\treturn ok(await locate(input, cwd));\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n}\nasync function executeDevStop(input, cwd) {\n\tif (process.platform === \"win32\") return notOk(platformUnsupported());\n\ttry {\n\t\tconst environment = input.environment ?? \"dev\";\n\t\tvalidateEnvironmentName(environment);\n\t\tconst { name: app } = await resolveAppIdentity(input.entry, input.name, cwd, input.config);\n\t\tconst apps = await currentApps({\n\t\t\tconfig: input.config,\n\t\t\tapp,\n\t\t\tenvironment\n\t\t}, cwd);\n\t\tconst stopped = [];\n\t\tfor (const recorded of apps) stopped.push(...await fromTarget(() => recorded.stop()));\n\t\treturn ok({\n\t\t\tapp,\n\t\t\tenvironment,\n\t\t\tstopped\n\t\t});\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n}\n//#endregion\nexport { executeDevStop, executeDevUrl };\n\n//# sourceMappingURL=execute-dev-current-BdEqeKAB.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAeA,SAAS,sBAAsB;CAC9B,OAAO,IAAI,mBAAmB,4BAA4B,4CAA4C;AACvG;;AAEA,SAAS,OAAO,aAAa;CAC5B,OAAO,gBAAgB,QAAQ,iBAAiB,8BAA8B,YAAY;AAC3F;;AAEA,eAAe,WAAW,MAAM;CAC/B,IAAI;EACH,OAAO,MAAM,K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-CeKI-tiC-DVTy30tU.mjs","names":["path"],"sources":["../../../0-framework/3-tooling/cli/dist/execute-dev-current-CeKI-tiC.mjs"],"sourcesContent":["import { n as checkConfigSource, r as resolveAppIdentity, t as validateEnvironmentName } from \"./validate-environment-CEhUSEg2.mjs\";\nimport { d as toStructured } from \"./dev-current-BNoPkDRU.mjs\";\nimport { n as requireDevEnvironmentName } from \"./dev-environment-name-6eEr5PW8.mjs\";\nimport * as path from \"node:path\";\nimport { CliStructuredError, InternalError } from \"@internal/foundation/errors\";\nimport { notOk, ok } from \"@internal/foundation/result\";\nimport { devEnvironmentDir, resolveLocalTargets } from \"@internal/core/local-target\";\n//#region src/operations/execute-dev-current.ts\n/**\n* The `devUrl` and `devStop` executor: config → each extension's local\n* target → the app's local copy in the environment, read from that\n* environment's dev state. Reached only by lazy import from dev-current.ts —\n* resolving the local targets loads their descriptors, whose graphs reach\n* alchemy's provider tree.\n*/\nfunction platformUnsupported() {\n\treturn new CliStructuredError(\"DEV.PLATFORM_UNSUPPORTED\", \"local dev is not supported on Windows yet.\");\n}\n/** The `prisma dev` command that runs `environment`. */\nfunction runDev(environment) {\n\treturn environment === \"dev\" ? \"`prisma dev`\" : `\\`prisma dev --environment ${environment}\\``;\n}\n/** A call into an extension's local target; its failures that carry no code are the emulator's. */\nasync function fromTarget(call) {\n\ttry {\n\t\treturn await call();\n\t} catch (error) {\n\t\tthrow toStructured(\"DEV.EMULATOR_FAILED\", error);\n\t}\n}\n/** Every extension's record of the app in the environment; fails when none recorded it. */\nasync function currentApps(copy, cwd) {\n\tconst { app, environment } = copy;\n\tconst { value } = checkConfigSource(copy.config, cwd);\n\tconst devDir = path.join(cwd, devEnvironmentDir(environment));\n\trequireDevEnvironmentName(devDir, environment);\n\tconst apps = [];\n\tfor (const target of (await resolveLocalTargets(value)).values()) {\n\t\tconst current = await fromTarget(async () => target.current?.({\n\t\t\tdevDir,\n\t\t\tapp,\n\t\t\tenvironment\n\t\t}));\n\t\tif (current !== void 0) apps.push(current);\n\t}\n\tif (apps.length === 0) throw new CliStructuredError(\"DEV.NOT_STARTED_HERE\", `\\`prisma dev\\` has not run ${app} in the environment ${environment} in ${cwd}.`, {\n\t\twhy: `The local services, databases and buckets of an app are recorded in ${devDir} when \\`prisma dev\\` runs it in the environment ${environment}, and ${app} has no such record.`,\n\t\tfix: `Run ${runDev(environment)} for ${app} in this directory.`,\n\t\tmeta: {\n\t\t\tcwd,\n\t\t\tapp,\n\t\t\tenvironment\n\t\t}\n\t});\n\treturn apps;\n}\n/** The app a full address starts with: `shop.api` belongs to `shop`. */\nfunction appOfAddress(address) {\n\tconst dot = address.indexOf(\".\");\n\treturn dot === -1 ? address : address.slice(0, dot);\n}\nasync function locate(input, cwd) {\n\tconst environment = input.environment ?? \"dev\";\n\tvalidateEnvironmentName(environment);\n\tconst app = appOfAddress(input.address);\n\tconst apps = await currentApps({\n\t\tconfig: input.config,\n\t\tapp,\n\t\tenvironment\n\t}, cwd);\n\tconst recorded = apps.find((candidate) => candidate.addresses.includes(input.address));\n\tif (recorded === void 0) {\n\t\tconst known = apps.flatMap((candidate) => candidate.addresses).sort();\n\t\tthrow new CliStructuredError(\"DEV.ADDRESS_UNKNOWN\", `\"${app}\" has no node at \"${input.address}\" in the environment ${environment}.`, {\n\t\t\twhy: `The addresses recorded for ${app} in the environment ${environment} are: ${known.join(\", \")}.`,\n\t\t\tfix: \"Pass one of those addresses. A nested node has a dotted address, such as `shop.catalog.database`.\",\n\t\t\tmeta: {\n\t\t\t\taddress: input.address,\n\t\t\t\tknown\n\t\t\t}\n\t\t});\n\t}\n\tconst location = await fromTarget(() => recorded.locate(input.address));\n\tif (location === void 0) throw new InternalError(`the local target recorded \"${input.address}\" but cannot locate it`);\n\tif (location.emulator === \"not-running\") throw new CliStructuredError(\"DEV.EMULATOR_UNREACHABLE\", `The local ${location.kind} emulator that runs \"${input.address}\" is not running.`, {\n\t\twhy: \"The local emulators run your services, databases and buckets on this machine; `prisma dev` starts the ones an app needs.\",\n\t\tfix: `Run ${runDev(environment)} in this directory.`,\n\t\tmeta: {\n\t\t\taddress: input.address,\n\t\t\tkind: location.kind\n\t\t}\n\t});\n\tif (location.condition !== \"running\") throw notRunning(input.address, environment, location);\n\tif (location.url === void 0) throw new InternalError(`the local target reports \"${input.address}\" running with no URL`);\n\tconst runs = location.command !== void 0 ? \"dev-server\" : location.kind === \"service\" ? \"artifact\" : void 0;\n\treturn {\n\t\taddress: input.address,\n\t\tkind: location.kind,\n\t\turl: location.url,\n\t\tstate: location.state,\n\t\t...runs !== void 0 ? { runs } : {}\n\t};\n}\nfunction notRunning(address, environment, location) {\n\tconst rerun = `Run ${runDev(environment)} in this directory.`;\n\tconst { kind, state, condition, logPath } = location;\n\tconst meta = {\n\t\taddress,\n\t\tkind,\n\t\tstate,\n\t\t...logPath === void 0 ? {} : { logPath }\n\t};\n\tconst message = `The ${kind} \"${address}\" is not running (${state}).`;\n\tif (condition === \"crashing\") return new CliStructuredError(\"DEV.NOT_RUNNING\", message, {\n\t\twhy: \"It exited after it started, and it is being restarted or was held after repeated crashes.\",\n\t\tfix: logPath === void 0 ? \"Read its output in the `prisma dev` terminal, fix the cause, and rebuild.\" : `Read its log at ${logPath}, fix the cause, and rebuild.`,\n\t\tmeta\n\t});\n\tif (condition === \"missing\") return new CliStructuredError(\"DEV.NOT_RUNNING\", message, {\n\t\twhy: \"The local emulator no longer has it, for example because a Composer upgrade discarded the emulator’s state.\",\n\t\tfix: `${rerun} It creates the ${kind} again, empty.`,\n\t\tmeta\n\t});\n\treturn new CliStructuredError(\"DEV.NOT_RUNNING\", `The ${kind} \"${address}\" is stopped.`, {\n\t\twhy: \"`prisma dev stop` and `prisma dev` ending both stop an app's services and database servers, and a stopped node has no URL that answers.\",\n\t\tfix: rerun,\n\t\tmeta\n\t});\n}\nasync function executeDevUrl(input, cwd) {\n\tif (process.platform === \"win32\") return notOk(platformUnsupported());\n\ttry {\n\t\treturn ok(await locate(input, cwd));\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n}\nasync function executeDevStop(input, cwd) {\n\tif (process.platform === \"win32\") return notOk(platformUnsupported());\n\ttry {\n\t\tconst environment = input.environment ?? \"dev\";\n\t\tvalidateEnvironmentName(environment);\n\t\tconst { name: app } = await resolveAppIdentity(input.entry, input.name, cwd, input.config);\n\t\tconst apps = await currentApps({\n\t\t\tconfig: input.config,\n\t\t\tapp,\n\t\t\tenvironment\n\t\t}, cwd);\n\t\tconst stopped = [];\n\t\tfor (const recorded of apps) stopped.push(...await fromTarget(() => recorded.stop()));\n\t\treturn ok({\n\t\t\tapp,\n\t\t\tenvironment,\n\t\t\tstopped\n\t\t});\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n}\n//#endregion\nexport { executeDevStop, executeDevUrl };\n\n//# sourceMappingURL=execute-dev-current-CeKI-tiC.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAeA,SAAS,sBAAsB;CAC9B,OAAO,IAAI,mBAAmB,4BAA4B,4CAA4C;AACvG;;AAEA,SAAS,OAAO,aAAa;CAC5B,OAAO,gBAAgB,QAAQ,iBAAiB,8BAA8B,YAAY;AAC3F;;AAEA,eAAe,WAAW,MAAM;CAC/B,IAAI;EACH,OAAO,MAAM,KAAK;CACnB,SAAS,OAAO;EACf,MAAM,aAAa,uBAAuB,KAAK;CAChD;AACD;;AAEA,eAAe,YAAY,MAAM,KAAK;CACrC,MAAM,EAAE,KAAK,gBAAgB;CAC7B,MAAM,EAAE,UAAU,kBAAkB,KAAK,QAAQ,GAAG;CACpD,MAAM,SAASA,OAAK,KAAK,KAAK,kBAAkB,WAAW,CAAC;CAC5D,0BAA0B,QAAQ,WAAW;CAC7C,MAAM,OAAO,CAAC;CACd,KAAK,MAAM,WAAW,MAAM,oBAAoB,KAAK,EAAA,CAAG,OAAO,GAAG;EACjE,MAAM,UAAU,MAAM,WAAW,YAAY,OAAO,UAAU;GAC7D;G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O,KAAK;CACxC,IAAI,QAAQ,aAAa,SAAS,OAAO,MAAM,oBAAoB,CAAC;CACpE,IAAI;EACH,OAAO,GAAG,MAAM,OAAO,OAAO,GAAG,CAAC;CACnC,SAAS,OAAO;EACf,IAAI,mBAAmB,GAAG,KAAK,GAAG,OAAO,MAAM,KAAK;EACpD,MAAM;CACP;AACD;AACA,eAAe,eAAe,OAAO,KAAK;CACzC,IAAI,QAAQ,aAAa,SAAS,OAAO,MAAM,oBAAoB,CAAC;CACpE,IAAI;EACH,MAAM,cAAc,MAAM,eAAe;EACzC,wBAAwB,WAAW;EACnC,MAAM,EAAE,MAAM,QAAQ,MAAM,mBAAmB,MAAM,OAAO,MAAM,MAAM,KAAK,MAAM,MAAM;EACzF,MAAM,OAAO,MAAM,YAAY;GAC9B,QAAQ,MAAM;GACd;GACA;EACD,GAAG,GAAG;EACN,MAAM,UAAU,CAAC;EACjB,KAAK,MAAM,YAAY,MAAM,QAAQ,KAAK,GAAG,MAAM,iBAAiB,SAAS,KAAK,CAAC,CAAC;EACpF,OAAO,GAAG;GACT;GACA;GACA;EACD,CAAC;CACF,SAAS,OAAO;EACf,IAAI,mBAAmB,GAAG,KAAK,GAAG,OAAO,MAAM,KAAK;EACpD,MAAM;CACP;AACD"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
|
|
2
2
|
import { i as devEnvironmentDir } from "./app-config-CErnR6NK-D9NgSBH4.mjs";
|
|
3
|
-
import { c as toStructured, l as notOk, u as ok } from "./dev-current-
|
|
3
|
+
import { c as toStructured, l as notOk, u as ok } from "./dev-current-BNoPkDRU-CtQMfn60.mjs";
|
|
4
4
|
import { r as resolveLocalTargets } from "./local-target-DySKw61w.mjs";
|
|
5
5
|
import { i as validateEnvironmentName, n as resolveAppIdentity } from "./validate-environment-CEhUSEg2-DmAtiQhe.mjs";
|
|
6
6
|
import { n as requireDevEnvironmentName } from "./dev-environment-name-6eEr5PW8-CGk1ijP7.mjs";
|
|
7
7
|
import { t as withEmulatorRetry } from "./emulator-retry-CV8rl69G-BgUzkxc-.mjs";
|
|
8
8
|
import * as path$1 from "node:path";
|
|
9
|
-
//#region ../../0-framework/3-tooling/cli/dist/execute-log-
|
|
9
|
+
//#region ../../0-framework/3-tooling/cli/dist/execute-log-DA5AAQAA.mjs
|
|
10
10
|
/**
|
|
11
11
|
* The log executor — run-log.ts's attach-and-tail (config → localTarget →
|
|
12
12
|
* container → attach → logs) with console and signal handling removed: the
|
|
@@ -158,4 +158,4 @@ async function executeLog(input, deps, cwd) {
|
|
|
158
158
|
//#endregion
|
|
159
159
|
export { LOG_QUEUE_LIMIT, executeLog };
|
|
160
160
|
|
|
161
|
-
//# sourceMappingURL=execute-log-
|
|
161
|
+
//# sourceMappingURL=execute-log-DA5AAQAA-ByUrxpMJ.mjs.map
|
package/dist/{execute-log-aiHhujIh-C_aXmb6j.mjs.map → execute-log-DA5AAQAA-ByUrxpMJ.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute-log-
|
|
1
|
+
{"version":3,"file":"execute-log-DA5AAQAA-ByUrxpMJ.mjs","names":["path"],"sources":["../../../0-framework/3-tooling/cli/dist/execute-log-DA5AAQAA.mjs"],"sourcesContent":["import { r as resolveAppIdentity, t as validateEnvironmentName } from \"./validate-environment-CEhUSEg2.mjs\";\nimport { d as toStructured } from \"./dev-current-BNoPkDRU.mjs\";\nimport { n as requireDevEnvironmentName } from \"./dev-environment-name-6eEr5PW8.mjs\";\nimport { t as withEmulatorRetry } from \"./emulator-retry-CV8rl69G.mjs\";\nimport * as path from \"node:path\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport { notOk, ok } from \"@internal/foundation/result\";\nimport { devEnvironmentDir, resolveLocalTargets } from \"@internal/core/local-target\";\n//#region src/operations/execute-log.ts\n/**\n* The log executor — run-log.ts's attach-and-tail (config → localTarget →\n* container → attach → logs) with console and signal handling removed: the\n* merged stream comes back as an AsyncIterable, ended by the caller's\n* AbortSignal. Reached only by lazy import from log.ts — this module's\n* static graph transitively loads alchemy's provider tree, so the control\n* entry must never import it statically.\n*/\nfunction failureMessage(error) {\n\treturn error instanceof Error ? error.message : String(error);\n}\n/** The merge queue's bound: past this, the oldest line is dropped and the\n* consumer is told via a `lines-dropped` event — a log viewer tolerates loss\n* better than the host tolerates unbounded memory growth. Exported so tests\n* can size their floods relative to the bound. */\nconst LOG_QUEUE_LIMIT = 1e4;\n/**\n* Merges every attachment's log stream into one iterable: one pump per\n* attachment pushing into a shared bounded queue. A pump's throw becomes a\n* `stream-failed` event and ends that pump only; the merged iterable ends\n* when `input.signal` aborts, when every pump ends, or when the consumer\n* stops iterating (an early `break` aborts an internal controller so the\n* pumps tear down — the generator never waits on a source that will not\n* end). No event is delivered after the iterable has ended. Address\n* filtering and `tail` apply exactly as the CLI always has.\n*/\nasync function* mergeLogStreams(attachments, input) {\n\tconst controller = new AbortController();\n\tconst { signal } = controller;\n\tconst abortInternal = () => controller.abort();\n\tif (input.signal?.aborted === true) controller.abort();\n\tinput.signal?.addEventListener(\"abort\", abortInternal, { once: true });\n\tconst queue = [];\n\tlet dropped = 0;\n\tlet done = false;\n\tlet active = attachments.length;\n\tlet wake;\n\tconst notify = () => {\n\t\twake?.();\n\t\twake = void 0;\n\t};\n\tsignal.addEventListener(\"abort\", notify, { once: true });\n\tconst emit = (event) => {\n\t\tif (done) return;\n\t\ttry {\n\t\t\tinput.onEvent?.(event);\n\t\t} catch {}\n\t};\n\tconst pump = async (attachment) => {\n\t\ttry {\n\t\t\tfor await (const { service, line } of attachment.logs(signal, { tail: input.tail ?? 0 })) {\n\t\t\t\tif (signal.aborted) return;\n\t\t\t\tif (input.address !== void 0 && service !== input.address) continue;\n\t\t\t\tif (queue.length >= 1e4) {\n\t\t\t\t\tqueue.shift();\n\t\t\t\t\tdropped += 1;\n\t\t\t\t}\n\t\t\t\tqueue.push({\n\t\t\t\t\tservice,\n\t\t\t\t\tline\n\t\t\t\t});\n\t\t\t\tnotify();\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tif (!signal.aborted) emit({\n\t\t\t\tkind: \"stream-failed\",\n\t\t\t\tmessage: failureMessage(error)\n\t\t\t});\n\t\t} finally {\n\t\t\tactive -= 1;\n\t\t\tnotify();\n\t\t}\n\t};\n\tfor (const attachment of attachments) pump(attachment);\n\ttry {\n\t\twhile (true) {\n\t\t\tlet next = queue.shift();\n\t\t\twhile (next !== void 0) {\n\t\t\t\tif (dropped > 0) {\n\t\t\t\t\tconst count = dropped;\n\t\t\t\t\tdropped = 0;\n\t\t\t\t\temit({\n\t\t\t\t\t\tkind: \"lines-dropped\",\n\t\t\t\t\t\tcount\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tyield next;\n\t\t\t\tnext = queue.shift();\n\t\t\t}\n\t\t\tif (signal.aborted || active === 0) break;\n\t\t\tawait new Promise((resolve) => {\n\t\t\t\twake = resolve;\n\t\t\t});\n\t\t}\n\t} finally {\n\t\tdone = true;\n\t\tcontroller.abort();\n\t\tsignal.removeEventListener(\"abort\", notify);\n\t\tinput.signal?.removeEventListener(\"abort\", abortInternal);\n\t}\n}\n/** Resolves the running app and attaches to its log streams; the caller consumes `lines`. */\nasync function executeLog(input, deps, cwd) {\n\tif (process.platform === \"win32\") return notOk(new CliStructuredError(\"LOG.PLATFORM_UNSUPPORTED\", \"local dev is not supported on Windows yet.\"));\n\tconst environment = input.environment ?? \"dev\";\n\tconst devDir = path.join(cwd, devEnvironmentDir(environment));\n\tlet name;\n\tconst attachments = [];\n\tlet services;\n\ttry {\n\t\tvalidateEnvironmentName(environment);\n\t\trequireDevEnvironmentName(devDir, environment);\n\t\tconst identity = deps.identity ?? await resolveAppIdentity(input.entry, input.name, cwd, input.config);\n\t\tname = identity.name;\n\t\tconst resolved = await resolveLocalTargets(identity.config);\n\t\tfor (const target of resolved.values()) try {\n\t\t\tconst container = await target.container.ensure({\n\t\t\t\tappName: name,\n\t\t\t\tenvironment\n\t\t\t});\n\t\t\tattachments.push(await withEmulatorRetry(() => target.attach({\n\t\t\t\tcontainer,\n\t\t\t\tdevDir\n\t\t\t})));\n\t\t} catch (error) {\n\t\t\tthrow toStructured(\"LOG.ATTACH_FAILED\", error);\n\t\t}\n\t\ttry {\n\t\t\tservices = (await Promise.all(attachments.map((a) => withEmulatorRetry(() => a.endpoints())))).flat();\n\t\t} catch (error) {\n\t\t\tthrow toStructured(\"LOG.ATTACH_FAILED\", error);\n\t\t}\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n\tif (services.length === 0) return ok({\n\t\tappName: name,\n\t\tservices: [],\n\t\tlines: mergeLogStreams([], input)\n\t});\n\tif (input.address !== void 0 && !services.some((s) => s.address === input.address)) return notOk(new CliStructuredError(\"LOG.ADDRESS_UNKNOWN\", `no service \"${input.address}\" in \"${name}\" — running services: ${services.map((s) => s.address).join(\", \")}.`));\n\treturn ok({\n\t\tappName: name,\n\t\tservices,\n\t\tlines: mergeLogStreams(attachments, input)\n\t});\n}\n//#endregion\nexport { LOG_QUEUE_LIMIT, executeLog };\n\n//# sourceMappingURL=execute-log-DA5AAQAA.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,SAAS,eAAe,OAAO;CAC9B,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC7D;;;;;AAKA,MAAM,kBAAkB;;;;;;;;;;;AAWxB,gBAAgB,gBAAgB,aAAa,OAAO;CACnD,MAAM,aAAa,IAAI,gBAAgB;CACvC,MAAM,EAAE,WAAW;CACnB,MAAM,sBAAsB,WAAW,MAAM;CAC7C,IAAI,MAAM,QAAQ,YAAY,MAAM,WAAW,MAAM;CACrD,MAAM,QAAQ,iBAAiB,SAAS,eAAe,EAAE,MAAM,KAAK,CAAC;CACrE,MAAM,QAAQ,CAAC;CACf,IAAI,UAAU;CACd,IAAI,OAAO;CACX,IAAI,SAAS,YAAY;CACzB,IA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E,OAAO,CAAC,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC;CAC9P,OAAO,GAAG;EACT,SAAS;EACT;EACA,OAAO,gBAAgB,aAAa,KAAK;CAC1C,CAAC;AACF"}
|
package/dist/local-target.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as LocalTargetDescriptor, L as PrismaAppConfig, S as LocalTargetCurrentInput, T as LocalTargetProvidersInput, _ as LocalNodeLocation, b as LocalTargetAttachment, c as ContainerInstance, g as LocalNodeCondition, l as DEV_DIR, t as AlchemyStateLayer, tt as devEnvironmentDir, u as DEV_ENVIRONMENT_NAME_FILE, v as LocalNodeStopped, w as LocalTargetEmulatorsInput, x as LocalTargetCurrentApp, y as LocalTargetAttachInput } from "./app-config-
|
|
1
|
+
import { C as LocalTargetDescriptor, L as PrismaAppConfig, S as LocalTargetCurrentInput, T as LocalTargetProvidersInput, _ as LocalNodeLocation, b as LocalTargetAttachment, c as ContainerInstance, g as LocalNodeCondition, l as DEV_DIR, t as AlchemyStateLayer, tt as devEnvironmentDir, u as DEV_ENVIRONMENT_NAME_FILE, v as LocalNodeStopped, w as LocalTargetEmulatorsInput, x as LocalTargetCurrentApp, y as LocalTargetAttachInput } from "./app-config-CWm3wlNA-BVGreP8x.mjs";
|
|
2
2
|
import * as Layer from "effect/Layer";
|
|
3
3
|
//#region ../../0-framework/1-core/core/dist/local-target.d.mts
|
|
4
4
|
//#region src/control/local-target.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { G as ServeInput, a as Bundle, h as ExtensionDescriptor, i as AssembleInput, m as DevServer } from "./app-config-
|
|
2
|
-
import "./config-
|
|
3
|
-
import "./deploy-
|
|
1
|
+
import { G as ServeInput, a as Bundle, h as ExtensionDescriptor, i as AssembleInput, m as DevServer } from "./app-config-CWm3wlNA-BVGreP8x.mjs";
|
|
2
|
+
import "./config-BSdGEsYV.mjs";
|
|
3
|
+
import "./deploy-BSdGEsYV.mjs";
|
|
4
4
|
import { t as NextjsBuildAdapter } from "./nextjs-DLyeRR7M-BeiYsLuZ.mjs";
|
|
5
5
|
//#region ../../0-framework/2-authoring/nextjs/dist/control.d.mts
|
|
6
6
|
//#region src/control/build.d.ts
|
package/dist/node-control.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { G as ServeInput, a as Bundle, h as ExtensionDescriptor, i as AssembleInput, m as DevServer } from "./app-config-
|
|
2
|
-
import "./config-
|
|
3
|
-
import "./deploy-
|
|
1
|
+
import { G as ServeInput, a as Bundle, h as ExtensionDescriptor, i as AssembleInput, m as DevServer } from "./app-config-CWm3wlNA-BVGreP8x.mjs";
|
|
2
|
+
import "./config-BSdGEsYV.mjs";
|
|
3
|
+
import "./deploy-BSdGEsYV.mjs";
|
|
4
4
|
//#region ../../0-framework/2-authoring/node/dist/control.d.mts
|
|
5
5
|
//#region src/control/build.d.ts
|
|
6
6
|
declare function assemble(input: AssembleInput): Promise<Bundle>;
|
package/dist/report.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { p as DeploymentResult } from "./app-config-
|
|
2
|
-
import "./deploy-
|
|
3
|
-
import { r as captureEngineFailure } from "./deployment-summary-p88NV5m5-
|
|
1
|
+
import { p as DeploymentResult } from "./app-config-CWm3wlNA-BVGreP8x.mjs";
|
|
2
|
+
import "./deploy-BSdGEsYV.mjs";
|
|
3
|
+
import { r as captureEngineFailure } from "./deployment-summary-p88NV5m5-C2gLUQ8l.mjs";
|
|
4
4
|
//#region ../../0-framework/3-tooling/cli/dist/report.d.mts
|
|
5
5
|
//#region src/render-deployment.d.ts
|
|
6
6
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/composer",
|
|
3
|
-
"version": "0.36.0-dev.
|
|
3
|
+
"version": "0.36.0-dev.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Prisma Composer — build a Prisma App by composing Modules. Core authoring, deploy pipeline, and the service-rpc/http/node/nextjs authoring surfaces. The command family the `prisma` CLI mounts lives in @prisma/composer-cli.",
|
|
6
6
|
"exports": {
|
|
@@ -40,16 +40,16 @@
|
|
|
40
40
|
"@prisma/management-api-sdk": "^1.80.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@internal/assemble": "0.36.0-dev.
|
|
44
|
-
"@internal/cli": "0.36.0-dev.
|
|
45
|
-
"@internal/core": "0.36.0-dev.
|
|
46
|
-
"@internal/foundation": "0.36.0-dev.
|
|
47
|
-
"@internal/http": "0.36.0-dev.
|
|
48
|
-
"@internal/lowering": "0.36.0-dev.
|
|
49
|
-
"@internal/nextjs": "0.36.0-dev.
|
|
50
|
-
"@internal/node": "0.36.0-dev.
|
|
51
|
-
"@internal/service-rpc": "0.36.0-dev.
|
|
52
|
-
"@internal/tsdown-config": "0.36.0-dev.
|
|
43
|
+
"@internal/assemble": "0.36.0-dev.2",
|
|
44
|
+
"@internal/cli": "0.36.0-dev.2",
|
|
45
|
+
"@internal/core": "0.36.0-dev.2",
|
|
46
|
+
"@internal/foundation": "0.36.0-dev.2",
|
|
47
|
+
"@internal/http": "0.36.0-dev.2",
|
|
48
|
+
"@internal/lowering": "0.36.0-dev.2",
|
|
49
|
+
"@internal/nextjs": "0.36.0-dev.2",
|
|
50
|
+
"@internal/node": "0.36.0-dev.2",
|
|
51
|
+
"@internal/service-rpc": "0.36.0-dev.2",
|
|
52
|
+
"@internal/tsdown-config": "0.36.0-dev.2",
|
|
53
53
|
"@types/node": "^26.0.1",
|
|
54
54
|
"tsdown": "^0.22.7",
|
|
55
55
|
"typescript": "^6.0.3"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: prisma-composer-core-concepts
|
|
3
3
|
metadata:
|
|
4
4
|
library: "@prisma/composer"
|
|
5
|
-
library_version: "0.36.0-dev.
|
|
5
|
+
library_version: "0.36.0-dev.2"
|
|
6
6
|
version: 2026.9.1
|
|
7
7
|
description: >-
|
|
8
8
|
Use when deploying or managing an app that uses Prisma Composer
|
|
@@ -47,6 +47,7 @@ app, executing nothing when imported. Three node kinds exist:
|
|
|
47
47
|
| --- | --- | --- |
|
|
48
48
|
| Service | `compute()` | A running unit of your code; atomic, Composer sees only its boundary |
|
|
49
49
|
| Resource | `rawPostgres()`, `bucket()` | A stateful managed dependency |
|
|
50
|
+
| Resource: public URL | `publicUrl()` | Makes one service reachable from the internet at one hostname; depends on the service's exposed HTTP interface and exposes nothing |
|
|
50
51
|
| Module | `module()` | A grouping boundary; runs no code of its own, depends on and exposes typed interfaces; its builder receives `deps`, `secrets`, `params`, `environment` and `provision` |
|
|
51
52
|
|
|
52
53
|
Nodes connect through typed **interfaces**: `deps` declares what a node depends on,
|
|
@@ -75,8 +76,8 @@ Composer itself is target-agnostic: `@prisma/composer` carries authoring,
|
|
|
75
76
|
testing, and the CLI, coupled to no platform. A deploy target is an extension
|
|
76
77
|
registered in the deploy config; `@prisma/composer-prisma-cloud` is the
|
|
77
78
|
Prisma Cloud target and the one this skill's deploy sections assume. Its
|
|
78
|
-
root exports `compute`, `rawPostgres`, `bucket`, `envSecret`,
|
|
79
|
-
`envParam`; the ORM vocabulary (`postgres`, `dataContract`) lives under the
|
|
79
|
+
root exports `compute`, `rawPostgres`, `bucket`, `publicUrl`, `envSecret`,
|
|
80
|
+
and `envParam`; the ORM vocabulary (`postgres`, `dataContract`) lives under the
|
|
80
81
|
`/orm` subpath, alongside the shared `/cron`, `/storage`, `/streams`,
|
|
81
82
|
`/auth`, and `/email` modules. These are the only two Composer packages a
|
|
82
83
|
basic Prisma Cloud app needs, and nothing installs them for you: a fresh
|
|
@@ -169,7 +170,7 @@ The graph is the same in every environment; only configuration may differ.
|
|
|
169
170
|
|
|
170
171
|
- The module body receives `environment`; `environment.name` is a value standing for the name `--environment` gave (`production` for `prisma deploy`, `dev` for `prisma dev` by default).
|
|
171
172
|
- `resolve([deps], ([values]) => …)` from `@prisma/composer` returns a computed value; `fn` receives the dependencies' real values as one tuple.
|
|
172
|
-
- A value is accepted as a leaf of a service's `input` binding, at any depth,
|
|
173
|
+
- A value is accepted as a leaf of a service's `input` binding, at any depth, as a service param, or as a public URL's `url`. Never as a provision id, a `deps` entry, or a module's `secrets` or `params` binding.
|
|
173
174
|
- A value is opaque in the body: you cannot read, compare or branch on it. List it as a `resolve()` dependency instead.
|
|
174
175
|
- Calling `provision()` inside `fn` fails the load: `fn` computes configuration, never graph structure.
|
|
175
176
|
- `fn` is pure and synchronous and returns plain data (no `undefined`, Promise, value, `envParam()` or `envSecret()`); a deploy and `destroy` both run it, in two processes. To retire an environment, keep its case in every `fn` until `destroy` for it has finished.
|
|
@@ -228,6 +229,27 @@ through module boundaries; a URL passed as `input` (`serviceOrigin()`)
|
|
|
228
229
|
does not, so declare a dependency for every service you call. The auth
|
|
229
230
|
module's `api` port is a raw HTTP port: wire it with `rawHttp()`.
|
|
230
231
|
|
|
232
|
+
**Public URLs.** A service is reachable from the internet only through a
|
|
233
|
+
public URL the app declares:
|
|
234
|
+
`provision(publicUrl({ name: 'site', url, target: web.http }))`, where
|
|
235
|
+
`web` exposes `http: rawHttpContract` (an RPC interface as `target` fails
|
|
236
|
+
`tsc`; a module's forwarded HTTP interface lands on the service inside it).
|
|
237
|
+
`url` is required and is one of two strategies: `publicUrl.prismaBuild()`
|
|
238
|
+
serves at the service's `prisma.build` hostname and creates nothing;
|
|
239
|
+
`publicUrl.hostname('shop.com')`, or the bare string `'shop.com'`, attaches
|
|
240
|
+
that hostname to the service as a custom domain. One hostname per public URL.
|
|
241
|
+
A per-environment `url` is a `resolve()` value returning either strategy or a
|
|
242
|
+
string; anything else fails deploy and dev before any of the app's resources
|
|
243
|
+
are created or changed. Before
|
|
244
|
+
a deploy names a hostname, the TXT record `_prisma-verification.<hostname>`
|
|
245
|
+
and a CNAME to the platform must be published, or the deploy fails with the
|
|
246
|
+
platform's error (`domain-ownership-required` for the TXT record); don't
|
|
247
|
+
work around it, publish the records or use `publicUrl.prismaBuild()` there. A
|
|
248
|
+
change from a serving hostname to one that is not ready fails the deploy and
|
|
249
|
+
the old hostname keeps serving. `prisma dev` ignores a named hostname and
|
|
250
|
+
warns once per public URL that names a hostname. A service with no public URL is still reachable at
|
|
251
|
+
its `prisma.build` hostname today.
|
|
252
|
+
|
|
231
253
|
## Builds are yours
|
|
232
254
|
|
|
233
255
|
You build, the framework assembles. For a plain server process, `entry`
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./app-config-DNnd7Zu--BQ1vHaMK.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./app-config-DNnd7Zu--BQ1vHaMK.mjs";
|