@prisma/composer 0.6.0-dev.13 → 0.6.0-dev.15
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-CFsSXEVj-B242oUnm.d.mts → app-config-aIrriqVU-D6lJHzh2.d.mts} +42 -17
- package/dist/app-config-aIrriqVU-D6lJHzh2.d.mts.map +1 -0
- package/dist/bin.mjs +950 -12
- package/dist/bin.mjs.map +1 -1
- package/dist/config-CL7Jbve2.d.mts +1 -0
- package/dist/config.d.mts +3 -3
- package/dist/container-transport-DKmKg5JQ-CoY4XPma.mjs +30 -0
- package/dist/container-transport-DKmKg5JQ-CoY4XPma.mjs.map +1 -0
- package/dist/control.d.mts +3 -216
- package/dist/control.mjs +1 -69
- package/dist/deploy-CL7Jbve2.d.mts +1 -0
- package/dist/deploy.d.mts +2 -2
- package/dist/deploy.mjs +1 -1
- package/dist/{deployment-summary-r47O6kFr-CcMYVOn5.mjs → deployment-summary-DswOl_9E-C03NJ98H.mjs} +2 -2
- package/dist/{deployment-summary-r47O6kFr-CcMYVOn5.mjs.map → deployment-summary-DswOl_9E-C03NJ98H.mjs.map} +1 -1
- package/dist/{dist-C5rZnr4n.mjs → dist-C0dNEgS-.mjs} +2 -2
- package/dist/{dist-C5rZnr4n.mjs.map → dist-C0dNEgS-.mjs.map} +1 -1
- package/dist/{errors-0e8IVwzi.mjs → errors-DkXcnjPx.mjs} +3 -2
- package/dist/{errors-0e8IVwzi.mjs.map → errors-DkXcnjPx.mjs.map} +1 -1
- package/dist/{execute-deploy-destroy-IT4vGkMc-oO8yjHPH.mjs → execute-deploy-destroy-DfVJUICu-AMM8CwgV.mjs} +30 -19
- package/dist/execute-deploy-destroy-DfVJUICu-AMM8CwgV.mjs.map +1 -0
- package/dist/{execute-deploy-destroy-IT4vGkMc-YM1Cv6cu.mjs → execute-deploy-destroy-DfVJUICu-quUQ08T8.mjs} +29 -19
- package/dist/execute-deploy-destroy-DfVJUICu-quUQ08T8.mjs.map +1 -0
- package/dist/{execute-dev-DLYyduEM-88uyvrbj.mjs → execute-dev-BMTFWfFc-B1whS-Rr.mjs} +25 -23
- package/dist/{execute-dev-DLYyduEM-88uyvrbj.mjs.map → execute-dev-BMTFWfFc-B1whS-Rr.mjs.map} +1 -1
- package/dist/{execute-dev-DLYyduEM-BuUGTm0g.mjs → execute-dev-BMTFWfFc-BoKbcFVF.mjs} +29 -20
- package/dist/{execute-dev-DLYyduEM-BuUGTm0g.mjs.map → execute-dev-BMTFWfFc-BoKbcFVF.mjs.map} +1 -1
- package/dist/{execute-log-VIOL4DBz-DBPH8By4.mjs → execute-log-Cay9hlKW-B0tmRtrY.mjs} +11 -7
- package/dist/execute-log-Cay9hlKW-B0tmRtrY.mjs.map +1 -0
- package/dist/{execute-log-VIOL4DBz-DKodBrxS.mjs → execute-log-Cay9hlKW-DrMeVOXq.mjs} +9 -7
- package/dist/execute-log-Cay9hlKW-DrMeVOXq.mjs.map +1 -0
- package/dist/family-DkH0si4D-Uov_MuHV.d.mts +27 -0
- package/dist/family-DkH0si4D-Uov_MuHV.d.mts.map +1 -0
- package/dist/family.d.mts +53 -0
- package/dist/family.d.mts.map +1 -0
- package/dist/family.mjs +839 -0
- package/dist/family.mjs.map +1 -0
- package/dist/{graph-BJgUfGB0-kvgFzT4q.mjs → graph-BJgUfGB0-7fmubS_y.mjs} +2 -2
- package/dist/{graph-BJgUfGB0-kvgFzT4q.mjs.map → graph-BJgUfGB0-7fmubS_y.mjs.map} +1 -1
- package/dist/{graph-types-N6brq1zY-1VMNwtkJ.d.mts → graph-DqklX5Sf-CdNH3lA7.d.mts} +17 -2
- package/dist/graph-DqklX5Sf-CdNH3lA7.d.mts.map +1 -0
- package/dist/{index-DryPyF9U.d.mts → index-DuF5iI3i.d.mts} +2 -3
- package/dist/index-DuF5iI3i.d.mts.map +1 -0
- package/dist/index.d.mts +2 -3
- package/dist/index.mjs +2 -2
- package/dist/{local-target-DnA2E8IN.mjs → local-target-D3u_wuNF.mjs} +2 -2
- package/dist/{local-target-DnA2E8IN.mjs.map → local-target-D3u_wuNF.mjs.map} +1 -1
- package/dist/{local-target-DuSyWeYc.mjs → local-target-H0IWu_FM.mjs} +2 -2
- package/dist/{local-target-DuSyWeYc.mjs.map → local-target-H0IWu_FM.mjs.map} +1 -1
- package/dist/local-target.d.mts +1 -1
- package/dist/local-target.mjs +1 -1
- package/dist/log-DRnnWupy-9jbzL64M.d.mts +324 -0
- package/dist/log-DRnnWupy-9jbzL64M.d.mts.map +1 -0
- package/dist/{result-CzGChwbZ.mjs → log-DfT2hHqi-CDp9nfI5.mjs} +85 -90
- package/dist/log-DfT2hHqi-CDp9nfI5.mjs.map +1 -0
- package/dist/{nextjs-DLyeRR7M-DZODs9tk.d.mts → nextjs-DLyeRR7M-BfUbLXwr.d.mts} +3 -3
- package/dist/{nextjs-DLyeRR7M-DZODs9tk.d.mts.map → nextjs-DLyeRR7M-BfUbLXwr.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-D3QoVzAB-D_ufjg3N.mjs → pipeline-AoW8zq4I-C6Qe0VaZ.mjs} +161 -42
- package/dist/{pipeline-D3QoVzAB-D_ufjg3N.mjs.map → pipeline-AoW8zq4I-C6Qe0VaZ.mjs.map} +1 -1
- package/dist/{pipeline-D3QoVzAB-Ci2aJ2mE.mjs → pipeline-AoW8zq4I-DM74ygtH.mjs} +164 -43
- package/dist/pipeline-AoW8zq4I-DM74ygtH.mjs.map +1 -0
- package/dist/report.d.mts +2 -2
- package/dist/report.mjs +1 -1
- package/dist/report.mjs.map +1 -1
- package/dist/{shared-CCaR42wo-BvegvmA_.mjs → result-B4XjxVK6.mjs} +127 -8
- package/dist/result-B4XjxVK6.mjs.map +1 -0
- package/dist/{result-CFqJKiqg.mjs → result-wonf1deB.mjs} +4 -18
- package/dist/result-wonf1deB.mjs.map +1 -0
- package/dist/run-alchemy-D44OZlyB-DA7s331N.mjs +93 -0
- package/dist/run-alchemy-D44OZlyB-DA7s331N.mjs.map +1 -0
- package/dist/run-alchemy-D44OZlyB-DeDTFsB6.mjs +93 -0
- package/dist/run-alchemy-D44OZlyB-DeDTFsB6.mjs.map +1 -0
- package/dist/service-rpc.d.mts +2 -2
- package/dist/service-rpc.mjs +2 -2
- package/dist/testing.d.mts +54 -2
- package/dist/testing.d.mts.map +1 -1
- package/dist/testing.mjs +150 -1
- package/dist/testing.mjs.map +1 -1
- package/package.json +12 -11
- package/src/exports/family.ts +14 -0
- package/src/exports/testing.ts +1 -0
- package/dist/app-config-CFsSXEVj-B242oUnm.d.mts.map +0 -1
- package/dist/cli-B3sWzFlb-CxEIzKsQ.mjs +0 -401
- package/dist/cli-B3sWzFlb-CxEIzKsQ.mjs.map +0 -1
- package/dist/config-ku5b_2YD.d.mts +0 -1
- package/dist/container-transport-DKmKg5JQ-BMRhx5w-.mjs +0 -75
- package/dist/container-transport-DKmKg5JQ-BMRhx5w-.mjs.map +0 -1
- package/dist/control.d.mts.map +0 -1
- package/dist/control.mjs.map +0 -1
- package/dist/deploy-ku5b_2YD.d.mts +0 -1
- package/dist/execute-deploy-destroy-IT4vGkMc-YM1Cv6cu.mjs.map +0 -1
- package/dist/execute-deploy-destroy-IT4vGkMc-oO8yjHPH.mjs.map +0 -1
- package/dist/execute-log-VIOL4DBz-DBPH8By4.mjs.map +0 -1
- package/dist/execute-log-VIOL4DBz-DKodBrxS.mjs.map +0 -1
- package/dist/graph-DqklX5Sf-BNS2aO1j.d.mts +0 -18
- package/dist/graph-DqklX5Sf-BNS2aO1j.d.mts.map +0 -1
- package/dist/graph-types-N6brq1zY-1VMNwtkJ.d.mts.map +0 -1
- package/dist/index-DryPyF9U.d.mts.map +0 -1
- package/dist/pipeline-D3QoVzAB-Ci2aJ2mE.mjs.map +0 -1
- package/dist/render-error-DsPN5qfr-CkVGj9uP.mjs +0 -30
- package/dist/render-error-DsPN5qfr-CkVGj9uP.mjs.map +0 -1
- package/dist/result-CFqJKiqg.mjs.map +0 -1
- package/dist/result-CzGChwbZ.mjs.map +0 -1
- package/dist/run-alchemy-hghRtddF-CQHOzlrW.mjs +0 -48
- package/dist/run-alchemy-hghRtddF-CQHOzlrW.mjs.map +0 -1
- package/dist/shared-CCaR42wo-BvegvmA_.mjs.map +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as InternalError } from "./result-CFqJKiqg.mjs";
|
|
1
|
+
import { c as CliStructuredError, d as blindCast, i as effectResolutionDiagnostic, u as InternalError } from "./result-B4XjxVK6.mjs";
|
|
3
2
|
import * as fs from "node:fs";
|
|
4
3
|
import * as path from "node:path";
|
|
5
4
|
import { pathToFileURL } from "node:url";
|
|
@@ -532,7 +531,7 @@ function Load(root, opts) {
|
|
|
532
531
|
}
|
|
533
532
|
blindCast(Symbol.for("prisma:secret-box"));
|
|
534
533
|
//#endregion
|
|
535
|
-
//#region ../../0-framework/3-tooling/cli/dist/load-entry-
|
|
534
|
+
//#region ../../0-framework/3-tooling/cli/dist/load-entry-BYBSCuWg.mjs
|
|
536
535
|
/**
|
|
537
536
|
* `loadEntry` imports a user's topology with the host runtime's own module
|
|
538
537
|
* loader — under node (the CLI's shebang runtime), that loader strips
|
|
@@ -653,7 +652,7 @@ async function assembleServices(graph, config, cwd, run) {
|
|
|
653
652
|
return { bundles };
|
|
654
653
|
}
|
|
655
654
|
//#endregion
|
|
656
|
-
//#region ../../0-framework/3-tooling/cli/dist/pipeline-
|
|
655
|
+
//#region ../../0-framework/3-tooling/cli/dist/pipeline-AoW8zq4I.mjs
|
|
657
656
|
/**
|
|
658
657
|
* Pipeline step: find and load `prisma-composer.config.ts` (ADR-0017) — the ONE
|
|
659
658
|
* file that imports control-plane code. Discovery is the standard walk-up
|
|
@@ -661,8 +660,19 @@ async function assembleServices(graph, config, cwd, run) {
|
|
|
661
660
|
* loading is c12 with that explicit path (rc/global/package.json lookups
|
|
662
661
|
* disabled), so the config file's own static imports resolve from the app
|
|
663
662
|
* root by whatever package manager runs — no specifier construction, no
|
|
664
|
-
* anchoring.
|
|
665
|
-
*
|
|
663
|
+
* anchoring.
|
|
664
|
+
*
|
|
665
|
+
* Two shapes of the same machinery:
|
|
666
|
+
*
|
|
667
|
+
* loadAppConfigDiagnostics — returns the evaluated value together with
|
|
668
|
+
* EVERY problem found, and never throws. This is the shape the engine
|
|
669
|
+
* command family consumes: the engine renders diagnostics itself and
|
|
670
|
+
* decides per command whether a broken section is fatal, so a loader that
|
|
671
|
+
* threw on the first bad field would both hide the rest and bypass that
|
|
672
|
+
* rendering.
|
|
673
|
+
*
|
|
674
|
+
* loadAppConfig — the same load, throwing its first diagnostic. The
|
|
675
|
+
* clipanion CLI still runs on it; it goes when clipanion does.
|
|
666
676
|
*/
|
|
667
677
|
const CONFIG_FILENAME = "prisma-composer.config.ts";
|
|
668
678
|
/** Walks UP from the entry file's directory looking for the literal CONFIG_FILENAME; undefined when the walk hits the filesystem root. */
|
|
@@ -696,34 +706,52 @@ function isRecord(value) {
|
|
|
696
706
|
/**
|
|
697
707
|
* Field-by-field validation of the loaded default export — deliberately no
|
|
698
708
|
* schema library: each check is a structured error naming the offending field.
|
|
699
|
-
*
|
|
709
|
+
*
|
|
710
|
+
* Collects rather than throws, so one bad config reports every bad field
|
|
711
|
+
* instead of only the first. The `extensions` and `state` checks are
|
|
712
|
+
* independent, and within `extensions` each entry is judged on its own; a
|
|
713
|
+
* field whose own shape check already failed is not probed further, because
|
|
714
|
+
* anything derived from it would be noise rather than a second finding.
|
|
700
715
|
*/
|
|
701
|
-
function
|
|
702
|
-
if (!isRecord(loaded) || Object.keys(loaded).length === 0)
|
|
716
|
+
function configShapeDiagnostics(loaded, configPath) {
|
|
717
|
+
if (!isRecord(loaded) || Object.keys(loaded).length === 0) return [new CliStructuredError("CONFIG.EXPORT_INVALID", `"${configPath}" exported no config.`, {
|
|
703
718
|
fix: "It must default-export defineConfig({ extensions: [...], state: ... }) from '@prisma/composer/config'.",
|
|
704
719
|
where: { path: configPath }
|
|
705
|
-
});
|
|
720
|
+
})];
|
|
721
|
+
const diagnostics = [];
|
|
706
722
|
const extensions = loaded["extensions"];
|
|
707
|
-
if (!Array.isArray(extensions))
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
723
|
+
if (!Array.isArray(extensions)) diagnostics.push(fieldError("extensions", "must be an array"));
|
|
724
|
+
else {
|
|
725
|
+
const seen = /* @__PURE__ */ new Set();
|
|
726
|
+
for (const [index, entry] of extensions.entries()) {
|
|
727
|
+
if (!isRecord(entry)) {
|
|
728
|
+
diagnostics.push(fieldError(`extensions[${index}]`, "must be an extension descriptor object"));
|
|
729
|
+
continue;
|
|
730
|
+
}
|
|
731
|
+
const id = entry["id"];
|
|
732
|
+
if (typeof id !== "string" || id.length === 0) diagnostics.push(fieldError(`extensions[${index}].id`, "must be a non-empty string (the extension package name)"));
|
|
733
|
+
else if (seen.has(id)) diagnostics.push(new CliStructuredError("CONFIG.EXTENSION_DUPLICATE", `${CONFIG_FILENAME}: extension "${id}" is listed more than once in \`extensions\`.`));
|
|
734
|
+
else seen.add(id);
|
|
735
|
+
if (!isRecord(entry["nodes"])) diagnostics.push(fieldError(`extensions[${index}].nodes`, "must be an object (the node-ID → control registry)"));
|
|
736
|
+
}
|
|
716
737
|
}
|
|
717
738
|
const state = loaded["state"];
|
|
718
|
-
if (!isRecord(state) || typeof state["extension"] !== "string" || typeof state["create"] !== "function")
|
|
739
|
+
if (!isRecord(state) || typeof state["extension"] !== "string" || typeof state["create"] !== "function") diagnostics.push(fieldError("state", "must be a state descriptor (e.g. prismaState())"));
|
|
740
|
+
return diagnostics;
|
|
741
|
+
}
|
|
742
|
+
/** The throwing form of configShapeDiagnostics: raises the first finding, returns the same object typed. Used by the clipanion pipeline. */
|
|
743
|
+
function validateConfigShape(loaded, configPath) {
|
|
744
|
+
const [first] = configShapeDiagnostics(loaded, configPath);
|
|
745
|
+
if (first !== void 0) throw first;
|
|
719
746
|
return blindCast(loaded);
|
|
720
747
|
}
|
|
721
748
|
/**
|
|
722
|
-
*
|
|
723
|
-
*
|
|
724
|
-
*
|
|
749
|
+
* Evaluates `configPath` with c12 (explicit file; rc / global-rc /
|
|
750
|
+
* package.json lookups disabled). `verifySamePath` runs the same-file check
|
|
751
|
+
* against the discovered path — see loadAppConfigDiagnostics for when it does
|
|
752
|
+
* not apply.
|
|
725
753
|
*/
|
|
726
|
-
async function
|
|
754
|
+
async function evaluateConfig(configPath, verifySamePath) {
|
|
727
755
|
let result;
|
|
728
756
|
try {
|
|
729
757
|
result = await c12.loadConfig({
|
|
@@ -735,19 +763,99 @@ async function loadAppConfig(configPath) {
|
|
|
735
763
|
packageJson: false
|
|
736
764
|
});
|
|
737
765
|
} catch (error) {
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
766
|
+
return {
|
|
767
|
+
value: void 0,
|
|
768
|
+
diagnostics: [new CliStructuredError("CONFIG.EVALUATION_FAILED", `Evaluating "${configPath}" failed: ${error instanceof Error ? error.message : String(error)}`, {
|
|
769
|
+
where: { path: configPath },
|
|
770
|
+
cause: error
|
|
771
|
+
})]
|
|
772
|
+
};
|
|
742
773
|
}
|
|
743
774
|
const loadedFile = result.configFile;
|
|
744
|
-
if (typeof loadedFile !== "string" || fs.realpathSync(loadedFile) !== fs.realpathSync(configPath))
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
775
|
+
if (verifySamePath && (typeof loadedFile !== "string" || fs.realpathSync(loadedFile) !== fs.realpathSync(configPath))) return {
|
|
776
|
+
value: result.config,
|
|
777
|
+
diagnostics: [new CliStructuredError("CONFIG.PATH_MISMATCH", `Config loading resolved "${String(loadedFile)}" instead of the discovered "${configPath}".`, {
|
|
778
|
+
why: "Refusing to deploy against a different file.",
|
|
779
|
+
where: { path: configPath }
|
|
780
|
+
})]
|
|
781
|
+
};
|
|
782
|
+
return {
|
|
783
|
+
value: result.config,
|
|
784
|
+
diagnostics: configShapeDiagnostics(result.config, configPath)
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
/**
|
|
788
|
+
* The front of every config load, shared by the throwing and the
|
|
789
|
+
* diagnostics-list shapes: verify the installed tree can evaluate a config at
|
|
790
|
+
* all, then settle which file to load — the section's path, or the
|
|
791
|
+
* entry-anchored walk.
|
|
792
|
+
*
|
|
793
|
+
* The effect-resolution check comes first because evaluating a config imports
|
|
794
|
+
* alchemy's provider tree: in a tree where alchemy resolves an `effect` we did
|
|
795
|
+
* not pin, nothing downstream can load, so the dependency conflict is the
|
|
796
|
+
* finding with the fix in it and every later failure is its symptom.
|
|
797
|
+
*/
|
|
798
|
+
function configSource(request) {
|
|
799
|
+
const resolvedEntry = path.resolve(request.entryPath);
|
|
800
|
+
const cwd = request.cwd ?? path.dirname(resolvedEntry);
|
|
801
|
+
const effectConflict = effectResolutionDiagnostic(cwd);
|
|
802
|
+
if (effectConflict !== void 0) return {
|
|
803
|
+
ok: false,
|
|
804
|
+
path: void 0,
|
|
805
|
+
diagnostic: effectConflict
|
|
806
|
+
};
|
|
807
|
+
if (request.configPath === void 0) {
|
|
808
|
+
const discovered = findConfigPathForEntry(resolvedEntry);
|
|
809
|
+
return discovered === void 0 ? {
|
|
810
|
+
ok: false,
|
|
811
|
+
path: void 0,
|
|
812
|
+
diagnostic: missingConfigError(resolvedEntry)
|
|
813
|
+
} : {
|
|
814
|
+
ok: true,
|
|
815
|
+
path: discovered,
|
|
816
|
+
explicit: false
|
|
817
|
+
};
|
|
818
|
+
}
|
|
819
|
+
const configPath = path.resolve(cwd, request.configPath);
|
|
820
|
+
if (!fs.existsSync(configPath)) return {
|
|
821
|
+
ok: false,
|
|
822
|
+
path: configPath,
|
|
823
|
+
diagnostic: new CliStructuredError("CONFIG.FILE_MISSING", `The \`composer\` config section points at "${configPath}", which does not exist.`, {
|
|
824
|
+
why: "An explicit configPath is used as given — there is no walk to fall back on.",
|
|
825
|
+
fix: "Correct `configPath` in the `composer` section of prisma.config.ts, or remove it to search upward from the entry.",
|
|
826
|
+
where: { path: configPath }
|
|
827
|
+
})
|
|
828
|
+
};
|
|
748
829
|
return {
|
|
830
|
+
ok: true,
|
|
749
831
|
path: configPath,
|
|
750
|
-
|
|
832
|
+
explicit: true
|
|
833
|
+
};
|
|
834
|
+
}
|
|
835
|
+
/**
|
|
836
|
+
* The throwing form of that front, for the pipeline: the file the load will
|
|
837
|
+
* use, or the finding raised. `explicit` says the section named the file,
|
|
838
|
+
* which is what retires the same-file check for that case.
|
|
839
|
+
*/
|
|
840
|
+
function resolveConfigFile(request) {
|
|
841
|
+
const source = configSource(request);
|
|
842
|
+
if (!source.ok) throw source.diagnostic;
|
|
843
|
+
return {
|
|
844
|
+
path: source.path,
|
|
845
|
+
explicit: source.explicit
|
|
846
|
+
};
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* Loads + validates the config at `configPath`, throwing its first diagnostic.
|
|
850
|
+
* The clipanion CLI's pipeline runs on this; it goes when clipanion does.
|
|
851
|
+
*/
|
|
852
|
+
async function loadAppConfig(configPath, verifySamePath = true) {
|
|
853
|
+
const { value, diagnostics } = await evaluateConfig(configPath, verifySamePath);
|
|
854
|
+
const [first] = diagnostics;
|
|
855
|
+
if (first !== void 0) throw first;
|
|
856
|
+
return {
|
|
857
|
+
path: configPath,
|
|
858
|
+
config: validateConfigShape(value, configPath)
|
|
751
859
|
};
|
|
752
860
|
}
|
|
753
861
|
function lookup(extensions, extension, type, expectedKind, what) {
|
|
@@ -797,6 +905,23 @@ function validateRegistryCoverage(graph, config) {
|
|
|
797
905
|
* cannot drift.
|
|
798
906
|
*/
|
|
799
907
|
/**
|
|
908
|
+
* The config step both pipelines share: the effect-resolution check and the
|
|
909
|
+
* choice of config file (load-config.ts's shared front), then evaluation —
|
|
910
|
+
* unless the caller substituted a config, which replaces the evaluation and
|
|
911
|
+
* nothing before it.
|
|
912
|
+
*/
|
|
913
|
+
async function loadConfigStep(entryPath, cwd, deps) {
|
|
914
|
+
const { path: configPath, explicit } = resolveConfigFile({
|
|
915
|
+
entryPath,
|
|
916
|
+
configPath: deps.configPath,
|
|
917
|
+
cwd
|
|
918
|
+
});
|
|
919
|
+
return {
|
|
920
|
+
configPath,
|
|
921
|
+
config: deps.config ?? (await loadAppConfig(configPath, !explicit)).config
|
|
922
|
+
};
|
|
923
|
+
}
|
|
924
|
+
/**
|
|
800
925
|
* The pipeline's front — config discovery/load, entry load, name resolution —
|
|
801
926
|
* WITHOUT Load, coverage, or assemble. `log` needs only who the app is (its
|
|
802
927
|
* config and resolved name) to reach the already-running local instance; it
|
|
@@ -804,10 +929,7 @@ function validateRegistryCoverage(graph, config) {
|
|
|
804
929
|
* output the way the full pipeline does.
|
|
805
930
|
*/
|
|
806
931
|
async function resolveAppIdentity(entry, overrideName, cwd, deps = {}) {
|
|
807
|
-
const
|
|
808
|
-
const configPath = findConfigPathForEntry(resolvedEntryPath);
|
|
809
|
-
if (configPath === void 0) throw missingConfigError(resolvedEntryPath);
|
|
810
|
-
const config = deps.config ?? (await loadAppConfig(configPath)).config;
|
|
932
|
+
const { configPath, config } = await loadConfigStep(path.resolve(cwd, entry), cwd, deps);
|
|
811
933
|
const entryModule = await loadEntry(entry, cwd);
|
|
812
934
|
const name = overrideName ?? entryModule.root.name;
|
|
813
935
|
if (name.length === 0) throw new CliStructuredError("COMPOSE.NAME_MISSING", "The root node has no name.", { fix: "Name it at authoring, or pass --name." });
|
|
@@ -825,10 +947,7 @@ async function resolveAppIdentity(entry, overrideName, cwd, deps = {}) {
|
|
|
825
947
|
* about any one command.
|
|
826
948
|
*/
|
|
827
949
|
async function runPipeline(entry, overrideName, cwd, deps = {}, onAssembleError) {
|
|
828
|
-
const
|
|
829
|
-
const configPath = findConfigPathForEntry(resolvedEntryPath);
|
|
830
|
-
if (configPath === void 0) throw missingConfigError(resolvedEntryPath);
|
|
831
|
-
const config = deps.config ?? (await loadAppConfig(configPath)).config;
|
|
950
|
+
const { configPath, config } = await loadConfigStep(path.resolve(cwd, entry), cwd, deps);
|
|
832
951
|
const entryModule = await loadEntry(entry, cwd);
|
|
833
952
|
const graph = Load(entryModule.root);
|
|
834
953
|
if (graph.root.node.kind !== "module") throw new CliStructuredError("COMPOSE.ROOT_NOT_MODULE", "The deploy root must be a module.", { fix: "Wrap your service, e.g. export default module('name', ({ provision }) => { provision(service); })." });
|
|
@@ -854,4 +973,4 @@ async function runPipeline(entry, overrideName, cwd, deps = {}, onAssembleError)
|
|
|
854
973
|
//#endregion
|
|
855
974
|
export { runPipeline as n, resolveAppIdentity as t };
|
|
856
975
|
|
|
857
|
-
//# sourceMappingURL=pipeline-
|
|
976
|
+
//# sourceMappingURL=pipeline-AoW8zq4I-C6Qe0VaZ.mjs.map
|