@prisma/composer 0.39.0-dev.1 → 0.39.0-dev.3
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-UeKFBma7-CohaMmWp.d.mts → app-config-CxdIiCvU-7vQWECm1.d.mts} +23 -21
- package/dist/app-config-CxdIiCvU-7vQWECm1.d.mts.map +1 -0
- package/dist/{app-configuration-file-CeJvBAti-D3uDlheX.mjs → app-configuration-file-Cw9autUL-DebaEvDz.mjs} +20 -25
- package/dist/app-configuration-file-Cw9autUL-DebaEvDz.mjs.map +1 -0
- package/dist/arktype.d.mts +1 -1
- package/dist/arktype.mjs +1 -1
- package/dist/arktype.mjs.map +1 -1
- package/dist/config-BcT6edff.d.mts +1 -0
- package/dist/config.d.mts +3 -3
- package/dist/config.mjs +1 -1
- package/dist/control.d.mts +7 -7
- package/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +3 -3
- package/dist/control.mjs.map +1 -1
- package/dist/{deploy-3EXLVrtG.mjs → deploy-BzRRAmns.mjs} +8 -25
- package/dist/deploy-BzRRAmns.mjs.map +1 -0
- package/dist/deploy-D7NHGXag.d.mts +2 -0
- package/dist/deploy.d.mts +3 -3
- package/dist/deploy.mjs +2 -2
- package/dist/{deployment-summary-D74WrJX7-DQ3LDUuO.mjs → deployment-summary-B6rYxEZe-E4IIcngK.mjs} +3 -3
- package/dist/{deployment-summary-D74WrJX7-DQ3LDUuO.mjs.map → deployment-summary-B6rYxEZe-E4IIcngK.mjs.map} +1 -1
- package/dist/{deployment-summary-p88NV5m5-SgniM8TX.d.mts → deployment-summary-p88NV5m5-3Ga91LRH.d.mts} +3 -3
- package/dist/{deployment-summary-p88NV5m5-SgniM8TX.d.mts.map → deployment-summary-p88NV5m5-3Ga91LRH.d.mts.map} +1 -1
- package/dist/{describe-kind-Cpm_euxo-CkhlGJUL.mjs → describe-kind-Cpm_euxo-D9WDxl5C.mjs} +3 -3
- package/dist/describe-kind-Cpm_euxo-D9WDxl5C.mjs.map +1 -0
- package/dist/{dev-current-wD5YDLjA-CzyFYXni.mjs → dev-current-D8GwJQex-C8F3EUBY.mjs} +5 -5
- package/dist/{dev-current-wD5YDLjA-CzyFYXni.mjs.map → dev-current-D8GwJQex-C8F3EUBY.mjs.map} +1 -1
- package/dist/{dev-environment-name-6eEr5PW8-BwusWVKi.mjs → dev-environment-name-6eEr5PW8-6sPgQZG3.mjs} +2 -2
- package/dist/{dev-environment-name-6eEr5PW8-BwusWVKi.mjs.map → dev-environment-name-6eEr5PW8-6sPgQZG3.mjs.map} +1 -1
- package/dist/{dist-ynqBR6y8.mjs → dist-BN9EXWWX.mjs} +4 -26
- package/dist/dist-BN9EXWWX.mjs.map +1 -0
- package/dist/errors-0e8IVwzi.mjs.map +1 -1
- package/dist/{execute-deploy-destroy-DOzo2Psp-DmS5miT4.mjs → execute-deploy-destroy-1SIH5uAu-DVRY18xU.mjs} +12 -11
- package/dist/{execute-deploy-destroy-DOzo2Psp-DmS5miT4.mjs.map → execute-deploy-destroy-1SIH5uAu-DVRY18xU.mjs.map} +1 -1
- package/dist/{execute-dev-current-CKOzjWuO-BPecs6Lf.mjs → execute-dev-current-DsAsDBB1-DwfOidWf.mjs} +6 -6
- package/dist/{execute-dev-current-CKOzjWuO-BPecs6Lf.mjs.map → execute-dev-current-DsAsDBB1-DwfOidWf.mjs.map} +1 -1
- package/dist/{execute-dev-BIyOI3Ys-BbDOLlV4.mjs → execute-dev-xPaS5SAl-BUeHjmYV.mjs} +81 -19
- package/dist/execute-dev-xPaS5SAl-BUeHjmYV.mjs.map +1 -0
- package/dist/{execute-log-BDdHor71-B2p8Zae2.mjs → execute-log-Be9DYRI6-WnytA3d7.mjs} +6 -6
- package/dist/{execute-log-BDdHor71-B2p8Zae2.mjs.map → execute-log-Be9DYRI6-WnytA3d7.mjs.map} +1 -1
- package/dist/{graph-C7mdtisq-RnKiwVsx.d.mts → graph-DU0omY5O-BHO71z0F.d.mts} +3 -3
- package/dist/graph-DU0omY5O-BHO71z0F.d.mts.map +1 -0
- package/dist/{graph-BzPLUUsB-D7EnB1F5.mjs → graph-K7VOpCAj-D6UHSltu.mjs} +135 -101
- package/dist/graph-K7VOpCAj-D6UHSltu.mjs.map +1 -0
- package/dist/{graph-types-s5V7pGj2-BxSqB1ZH.d.mts → graph-types-Bzj1fahC-C8rOVj0c.d.mts} +90 -89
- package/dist/graph-types-Bzj1fahC-C8rOVj0c.d.mts.map +1 -0
- package/dist/http.d.mts +2 -2
- package/dist/http.mjs +2 -2
- package/dist/{index-DyuwxTtd.d.mts → index-B8s0bLZY.d.mts} +3 -3
- package/dist/{index-DyuwxTtd.d.mts.map → index-B8s0bLZY.d.mts.map} +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +4 -4
- package/dist/internal-app-configuration-file.d.mts +8 -7
- package/dist/internal-app-configuration-file.d.mts.map +1 -1
- package/dist/internal-app-configuration-file.mjs +1 -1
- package/dist/{local-target-Dd8FJEb5.mjs → local-target-COdS1iNs.mjs} +3 -3
- package/dist/{local-target-Dd8FJEb5.mjs.map → local-target-COdS1iNs.mjs.map} +1 -1
- package/dist/local-target.d.mts +3 -3
- package/dist/local-target.d.mts.map +1 -1
- package/dist/local-target.mjs +1 -1
- package/dist/{nextjs-DLyeRR7M-0lw_cBIr.d.mts → nextjs-DLyeRR7M-Z_xX74Cp.d.mts} +3 -3
- package/dist/{nextjs-DLyeRR7M-0lw_cBIr.d.mts.map → nextjs-DLyeRR7M-Z_xX74Cp.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/{pointer-CyQZZugO-D7k3vibs.d.mts → pointer-DclJZFQi-DJa4t8Wa.d.mts} +3 -3
- package/dist/{pointer-CyQZZugO-D7k3vibs.d.mts.map → pointer-DclJZFQi-DJa4t8Wa.d.mts.map} +1 -1
- package/dist/{preflight-transport-DmmtoFPH-CnDWufmu.mjs → preflight-transport-DJjTWvyH-CEJ9WlaN.mjs} +4 -6
- package/dist/preflight-transport-DJjTWvyH-CEJ9WlaN.mjs.map +1 -0
- package/dist/{redaction-DXung4ip-bBoNomi3.mjs → redaction-C-NnlVUh-B1nJc6rb.mjs} +3 -9
- package/dist/redaction-C-NnlVUh-B1nJc6rb.mjs.map +1 -0
- package/dist/{redaction-Bf8FvTFH-D_HvoMrf.d.mts → redaction-CqdeMBKw-BECjU4HR.d.mts} +15 -8
- package/dist/{redaction-Bf8FvTFH-D_HvoMrf.d.mts.map → redaction-CqdeMBKw-BECjU4HR.d.mts.map} +1 -1
- package/dist/report.d.mts +3 -3
- package/dist/report.mjs +2 -2
- package/dist/report.mjs.map +1 -1
- package/dist/{run-alchemy-CRLAyOtt-CBUV28We.mjs → run-alchemy-CyciV8i0-BxPAyrch.mjs} +3 -3
- package/dist/{run-alchemy-CRLAyOtt-CBUV28We.mjs.map → run-alchemy-CyciV8i0-BxPAyrch.mjs.map} +1 -1
- package/dist/service-rpc.d.mts +2 -2
- package/dist/service-rpc.mjs +2 -2
- package/dist/testing.d.mts +1 -1
- package/dist/{validate-environment-D1BTCkTs-BQprjyNP.mjs → validate-environment-DyW59rJ7-u8hQkzuY.mjs} +7 -7
- package/dist/{validate-environment-D1BTCkTs-BQprjyNP.mjs.map → validate-environment-DyW59rJ7-u8hQkzuY.mjs.map} +1 -1
- package/dist/zod.d.mts +1 -1
- package/dist/zod.mjs +1 -1
- package/dist/zod.mjs.map +1 -1
- package/package.json +11 -11
- package/skills/prisma-composer-core-concepts/SKILL.md +32 -40
- package/dist/app-config-UeKFBma7-CohaMmWp.d.mts.map +0 -1
- package/dist/app-configuration-file-CeJvBAti-D3uDlheX.mjs.map +0 -1
- package/dist/config-BeZEgGCg.d.mts +0 -1
- package/dist/deploy-3EXLVrtG.mjs.map +0 -1
- package/dist/deploy-Xi4_JrtE.d.mts +0 -2
- package/dist/describe-kind-Cpm_euxo-CkhlGJUL.mjs.map +0 -1
- package/dist/dist-ynqBR6y8.mjs.map +0 -1
- package/dist/execute-dev-BIyOI3Ys-BbDOLlV4.mjs.map +0 -1
- package/dist/graph-BzPLUUsB-D7EnB1F5.mjs.map +0 -1
- package/dist/graph-C7mdtisq-RnKiwVsx.d.mts.map +0 -1
- package/dist/graph-types-s5V7pGj2-BxSqB1ZH.d.mts.map +0 -1
- package/dist/preflight-transport-DmmtoFPH-CnDWufmu.mjs.map +0 -1
- package/dist/redaction-DXung4ip-bBoNomi3.mjs.map +0 -1
package/dist/{execute-dev-current-CKOzjWuO-BPecs6Lf.mjs → execute-dev-current-DsAsDBB1-DwfOidWf.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-
|
|
5
|
-
import { r as resolveLocalTargets } from "./local-target-
|
|
6
|
-
import { i as validateEnvironmentName, n as resolveAppIdentity, t as checkConfigSource } from "./validate-environment-
|
|
7
|
-
import { n as requireDevEnvironmentName } from "./dev-environment-name-6eEr5PW8-
|
|
4
|
+
import { c as toStructured, l as notOk, u as ok } from "./dev-current-D8GwJQex-C8F3EUBY.mjs";
|
|
5
|
+
import { r as resolveLocalTargets } from "./local-target-COdS1iNs.mjs";
|
|
6
|
+
import { i as validateEnvironmentName, n as resolveAppIdentity, t as checkConfigSource } from "./validate-environment-DyW59rJ7-u8hQkzuY.mjs";
|
|
7
|
+
import { n as requireDevEnvironmentName } from "./dev-environment-name-6eEr5PW8-6sPgQZG3.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-DsAsDBB1.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-DsAsDBB1-DwfOidWf.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute-dev-current-CKOzjWuO-BPecs6Lf.mjs","names":["path"],"sources":["../../../0-framework/3-tooling/cli/dist/execute-dev-current-CKOzjWuO.mjs"],"sourcesContent":["import { n as checkConfigSource, r as resolveAppIdentity, t as validateEnvironmentName } from \"./validate-environment-D1BTCkTs.mjs\";\nimport { d as toStructured } from \"./dev-current-wD5YDLjA.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-CKOzjWuO.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;E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s","names":["path"],"sources":["../../../0-framework/3-tooling/cli/dist/execute-dev-current-DsAsDBB1.mjs"],"sourcesContent":["import { n as checkConfigSource, r as resolveAppIdentity, t as validateEnvironmentName } from \"./validate-environment-DyW59rJ7.mjs\";\nimport { d as toStructured } from \"./dev-current-D8GwJQex.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-DsAsDBB1.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;GACA;GACA;EACD,CAAC,CAAC;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,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,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as secretsKeys, _ as nodeAddresses } from "./graph-K7VOpCAj-D6UHSltu.mjs";
|
|
2
2
|
import { t as CliStructuredError } from "./errors-0e8IVwzi.mjs";
|
|
3
|
-
import { c as preflightFindingsEnv, n as containerEnv, o as preflightEnv, s as preflightEnvVarName } from "./preflight-transport-
|
|
3
|
+
import { c as preflightFindingsEnv, n as containerEnv, o as preflightEnv, s as preflightEnvVarName } from "./preflight-transport-DJjTWvyH-CEJ9WlaN.mjs";
|
|
4
4
|
import { i as devEnvironmentDir } from "./app-config-CErnR6NK-D9NgSBH4.mjs";
|
|
5
|
-
import { i as prepareSecondProcess, n as devAppConfigurationFile, o as removeLeftoverAppConfigurationFiles } from "./app-configuration-file-
|
|
6
|
-
import { c as toStructured, l as notOk, s as requireContainerForEnvironment, u as ok } from "./dev-current-
|
|
7
|
-
import "./deploy-
|
|
8
|
-
import { r as resolveLocalTargets } from "./local-target-
|
|
9
|
-
import { a as redactDevEvent, c as redactThrown, o as redactError, t as SecretRedaction } from "./redaction-
|
|
10
|
-
import { a as noComposerExportMessage, i as validateEnvironmentName, r as runPipeline } from "./validate-environment-
|
|
11
|
-
import { n as reproduceCommand, r as spawnAlchemy, t as alchemyInvocation } from "./run-alchemy-
|
|
12
|
-
import { n as requireDevEnvironmentName, t as claimDevEnvironmentName } from "./dev-environment-name-6eEr5PW8-
|
|
5
|
+
import { i as prepareSecondProcess, n as devAppConfigurationFile, o as removeLeftoverAppConfigurationFiles } from "./app-configuration-file-Cw9autUL-DebaEvDz.mjs";
|
|
6
|
+
import { c as toStructured, l as notOk, s as requireContainerForEnvironment, u as ok } from "./dev-current-D8GwJQex-C8F3EUBY.mjs";
|
|
7
|
+
import "./deploy-BzRRAmns.mjs";
|
|
8
|
+
import { r as resolveLocalTargets } from "./local-target-COdS1iNs.mjs";
|
|
9
|
+
import { a as redactDevEvent, c as redactThrown, o as redactError, t as SecretRedaction } from "./redaction-C-NnlVUh-B1nJc6rb.mjs";
|
|
10
|
+
import { a as noComposerExportMessage, i as validateEnvironmentName, r as runPipeline } from "./validate-environment-DyW59rJ7-u8hQkzuY.mjs";
|
|
11
|
+
import { n as reproduceCommand, r as spawnAlchemy, t as alchemyInvocation } from "./run-alchemy-CyciV8i0-BxPAyrch.mjs";
|
|
12
|
+
import { n as requireDevEnvironmentName, t as claimDevEnvironmentName } from "./dev-environment-name-6eEr5PW8-6sPgQZG3.mjs";
|
|
13
13
|
import { t as withEmulatorRetry } from "./emulator-retry-CV8rl69G-BgUzkxc-.mjs";
|
|
14
14
|
import * as path$1 from "node:path";
|
|
15
15
|
import { join, relative, resolve, sep } from "node:path";
|
|
@@ -24,7 +24,7 @@ import { type } from "os";
|
|
|
24
24
|
import { EventEmitter } from "events";
|
|
25
25
|
import { createHash } from "node:crypto";
|
|
26
26
|
import { lstat as lstat$1, open, readdir as readdir$1, realpath as realpath$1, stat as stat$2 } from "fs/promises";
|
|
27
|
-
//#region ../../0-framework/3-tooling/cli/dist/generate-dev-stack-
|
|
27
|
+
//#region ../../0-framework/3-tooling/cli/dist/generate-dev-stack-BEpqJ3AH.mjs
|
|
28
28
|
/**
|
|
29
29
|
* Local-dev spec § 6 `generate-dev-stack.ts`: like generate-stack.ts but in
|
|
30
30
|
* the environment's folder, `.prisma-composer/dev/<environment>/alchemy.run.ts`,
|
|
@@ -65,7 +65,7 @@ function renderOptions(input) {
|
|
|
65
65
|
lines.push(" },");
|
|
66
66
|
const unassembled = Object.keys(input.assembled.devServers);
|
|
67
67
|
if (unassembled.length > 0) lines.push(` unassembled: [${unassembled.map(quote).join(", ")}],`);
|
|
68
|
-
lines.push(" providers: localTargetProviders(resolved, containers, devDir, file.
|
|
68
|
+
lines.push(" providers: localTargetProviders(resolved, containers, devDir, file.plainVariableText, namedSecrets),");
|
|
69
69
|
lines.push(" state: devState(),");
|
|
70
70
|
return lines.join("\n");
|
|
71
71
|
}
|
|
@@ -89,7 +89,7 @@ function renderDevStackFile(input) {
|
|
|
89
89
|
// <node> <bin of the alchemy @prisma/composer depends on> deploy ${devStackRelativePath(input.environment)} --yes --stage ${input.environment}
|
|
90
90
|
//
|
|
91
91
|
// bisects a CLI bug from an Alchemy bug (deploy-cli.md § Implementation decisions).
|
|
92
|
-
// It runs no config or secrets adapter: it reads what the first process's Load read from the app configuration file named in PRISMA_COMPOSER_APP_CONFIGURATION_FILE, and the named secrets from PRISMA_COMPOSER_NAMED_SECRETS.
|
|
92
|
+
// It runs no config or secrets adapter: it reads what the first process's Load read, and the text of each plain platform variable, from the app configuration file named in PRISMA_COMPOSER_APP_CONFIGURATION_FILE, and the named secrets from PRISMA_COMPOSER_NAMED_SECRETS.
|
|
93
93
|
${imports}
|
|
94
94
|
|
|
95
95
|
const config = prismaConfig.composer;
|
|
@@ -1665,7 +1665,48 @@ var esm_default = {
|
|
|
1665
1665
|
FSWatcher
|
|
1666
1666
|
};
|
|
1667
1667
|
//#endregion
|
|
1668
|
-
//#region ../../0-framework/3-tooling/cli/dist/execute-dev-
|
|
1668
|
+
//#region ../../0-framework/3-tooling/cli/dist/execute-dev-xPaS5SAl.mjs
|
|
1669
|
+
const readKey = (read) => JSON.stringify([
|
|
1670
|
+
read.reader,
|
|
1671
|
+
read.resource,
|
|
1672
|
+
read.path
|
|
1673
|
+
]);
|
|
1674
|
+
function readsByResource(graph) {
|
|
1675
|
+
const byResource = /* @__PURE__ */ new Map();
|
|
1676
|
+
for (const read of graph.valueReads) {
|
|
1677
|
+
const keys = byResource.get(read.resource) ?? /* @__PURE__ */ new Set();
|
|
1678
|
+
keys.add(readKey(read));
|
|
1679
|
+
byResource.set(read.resource, keys);
|
|
1680
|
+
}
|
|
1681
|
+
return byResource;
|
|
1682
|
+
}
|
|
1683
|
+
function propsAt(graph, address) {
|
|
1684
|
+
const found = graph.nodes.find((entry) => entry.id === address)?.node;
|
|
1685
|
+
return found?.kind === "resource" ? found.props : void 0;
|
|
1686
|
+
}
|
|
1687
|
+
const hasMemberNotIn = (keys, other) => [...keys].some((key) => !other.has(key));
|
|
1688
|
+
function valueReadsChange(started, rebuilt) {
|
|
1689
|
+
const before = readsByResource(started);
|
|
1690
|
+
const after = readsByResource(rebuilt);
|
|
1691
|
+
const added = [];
|
|
1692
|
+
const removed = [];
|
|
1693
|
+
const changed = [];
|
|
1694
|
+
for (const address of /* @__PURE__ */ new Set([...before.keys(), ...after.keys()])) {
|
|
1695
|
+
const was = before.get(address) ?? /* @__PURE__ */ new Set();
|
|
1696
|
+
const is = after.get(address) ?? /* @__PURE__ */ new Set();
|
|
1697
|
+
const gained = hasMemberNotIn(is, was);
|
|
1698
|
+
const lost = hasMemberNotIn(was, is);
|
|
1699
|
+
if (was.size > 0 && is.size > 0 && !isDeepStrictEqual(propsAt(started, address), propsAt(rebuilt, address)) || gained && lost) changed.push(address);
|
|
1700
|
+
else if (gained) added.push(address);
|
|
1701
|
+
else if (lost) removed.push(address);
|
|
1702
|
+
}
|
|
1703
|
+
if (added.length + removed.length + changed.length === 0) return void 0;
|
|
1704
|
+
return {
|
|
1705
|
+
added,
|
|
1706
|
+
removed,
|
|
1707
|
+
changed
|
|
1708
|
+
};
|
|
1709
|
+
}
|
|
1669
1710
|
/**
|
|
1670
1711
|
* Local-dev spec § 6 `watch.ts`: watches each assembled bundle's declared
|
|
1671
1712
|
* `watch` paths and every authoring module (ADR-0056) — a directory watched
|
|
@@ -1854,7 +1895,6 @@ function assertDevServersSupported(graph, devServers, config, attachments) {
|
|
|
1854
1895
|
if (attachments.get(node.extension)?.serve === void 0) throw devServerUnsupported(address, "its target's local attachment has no `serve`", node.extension);
|
|
1855
1896
|
}
|
|
1856
1897
|
}
|
|
1857
|
-
/** Runs the full dev pipeline; resolves to a running session or a structured failure. */
|
|
1858
1898
|
/** The file's content hash; undefined when it cannot be read, which counts as a change. */
|
|
1859
1899
|
function contentHash(file) {
|
|
1860
1900
|
try {
|
|
@@ -1866,6 +1906,14 @@ function contentHash(file) {
|
|
|
1866
1906
|
function sameValues(started, now) {
|
|
1867
1907
|
return isDeepStrictEqual(started.configuration, now.configuration) && isDeepStrictEqual(started.secrets, now.secrets);
|
|
1868
1908
|
}
|
|
1909
|
+
function isDevPreflightResult(value) {
|
|
1910
|
+
if (typeof value !== "object" || value === null) return false;
|
|
1911
|
+
if (!("payload" in value) || !("plainVariableText" in value)) return false;
|
|
1912
|
+
const { payload, plainVariableText } = value;
|
|
1913
|
+
return (payload === void 0 || typeof payload === "string") && typeof plainVariableText === "object" && plainVariableText !== null && Object.values(plainVariableText).every((text) => typeof text === "string");
|
|
1914
|
+
}
|
|
1915
|
+
const olderLocalTargetError = (id) => /* @__PURE__ */ new Error(`The extension "${id}" returned a dev preflight result prisma dev cannot read: its local target was built for an older @prisma/composer. Upgrade "${id}" to a version built for the @prisma/composer this app uses.`);
|
|
1916
|
+
/** Runs the full dev pipeline; resolves to a running session or a structured failure. */
|
|
1869
1917
|
async function executeDev(input, deps, cwd) {
|
|
1870
1918
|
const redaction = new SecretRedaction(process.env);
|
|
1871
1919
|
try {
|
|
@@ -1885,6 +1933,7 @@ async function executeDevInner(input, deps, cwd, redaction) {
|
|
|
1885
1933
|
let resolved;
|
|
1886
1934
|
const containers = /* @__PURE__ */ new Map();
|
|
1887
1935
|
let preflightTransportEnv = {};
|
|
1936
|
+
const plainVariableText = {};
|
|
1888
1937
|
const attachmentsById = /* @__PURE__ */ new Map();
|
|
1889
1938
|
const emit = (event) => {
|
|
1890
1939
|
try {
|
|
@@ -1932,7 +1981,7 @@ async function executeDevInner(input, deps, cwd, redaction) {
|
|
|
1932
1981
|
for (const [id, dev] of resolved) {
|
|
1933
1982
|
if (dev.preflight === void 0) continue;
|
|
1934
1983
|
try {
|
|
1935
|
-
const
|
|
1984
|
+
const found = await dev.preflight({
|
|
1936
1985
|
graph,
|
|
1937
1986
|
container: containers.get(id),
|
|
1938
1987
|
environment,
|
|
@@ -1943,7 +1992,9 @@ async function executeDevInner(input, deps, cwd, redaction) {
|
|
|
1943
1992
|
message
|
|
1944
1993
|
})
|
|
1945
1994
|
});
|
|
1946
|
-
if (
|
|
1995
|
+
if (!isDevPreflightResult(found)) throw olderLocalTargetError(id);
|
|
1996
|
+
if (found.payload !== void 0) preflightPayloads.set(id, found.payload);
|
|
1997
|
+
Object.assign(plainVariableText, found.plainVariableText);
|
|
1947
1998
|
} catch (error) {
|
|
1948
1999
|
throw toStructured("DEV.PREFLIGHT_FAILED", error);
|
|
1949
2000
|
}
|
|
@@ -1991,6 +2042,7 @@ async function executeDevInner(input, deps, cwd, redaction) {
|
|
|
1991
2042
|
const handover = prepareSecondProcess({
|
|
1992
2043
|
file: devAppConfigurationFile(devDir),
|
|
1993
2044
|
appConfigurationRead: p.graph.appConfigurationRead,
|
|
2045
|
+
plainVariableText,
|
|
1994
2046
|
nodeAddresses: nodeAddresses(p.graph),
|
|
1995
2047
|
secretsKeys: secretsKeys(p.graph),
|
|
1996
2048
|
knownSecrets: redaction.knownSecrets,
|
|
@@ -2176,8 +2228,9 @@ async function executeDevInner(input, deps, cwd, redaction) {
|
|
|
2176
2228
|
const startedConfig = contentHash(configFile);
|
|
2177
2229
|
let configChanged = false;
|
|
2178
2230
|
let valuesChanged = false;
|
|
2231
|
+
let readsChanged = false;
|
|
2179
2232
|
const paused = () => {
|
|
2180
|
-
if (valuesChanged) return true;
|
|
2233
|
+
if (valuesChanged || readsChanged) return true;
|
|
2181
2234
|
if (!configChanged && contentHash(configFile) === startedConfig) return false;
|
|
2182
2235
|
configChanged = true;
|
|
2183
2236
|
emit({
|
|
@@ -2198,6 +2251,15 @@ async function executeDevInner(input, deps, cwd, redaction) {
|
|
|
2198
2251
|
valuesChanged = true;
|
|
2199
2252
|
return;
|
|
2200
2253
|
}
|
|
2254
|
+
const change = valueReadsChange(pipeline.graph, rePipeline.graph);
|
|
2255
|
+
if (change !== void 0) {
|
|
2256
|
+
if (!readsChanged) emit({
|
|
2257
|
+
kind: "value-reads-changed",
|
|
2258
|
+
...change
|
|
2259
|
+
});
|
|
2260
|
+
readsChanged = true;
|
|
2261
|
+
return;
|
|
2262
|
+
}
|
|
2201
2263
|
const { outcome, stackPath, invocation } = await converge(rePipeline);
|
|
2202
2264
|
if (outcome.signal !== null || outcome.exitCode !== 0) {
|
|
2203
2265
|
emit({
|
|
@@ -2291,4 +2353,4 @@ async function executeDevInner(input, deps, cwd, redaction) {
|
|
|
2291
2353
|
//#endregion
|
|
2292
2354
|
export { executeDev };
|
|
2293
2355
|
|
|
2294
|
-
//# sourceMappingURL=execute-dev-
|
|
2356
|
+
//# sourceMappingURL=execute-dev-xPaS5SAl-BUeHjmYV.mjs.map
|