@powerhousedao/ph-cli 6.2.3-dev.101 → 6.2.3-dev.103

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.
Files changed (72) hide show
  1. package/dist/{build-CojYJHNn.mjs → build-CxaXbGFz.mjs} +63 -11
  2. package/dist/build-CxaXbGFz.mjs.map +1 -0
  3. package/dist/build-pOI4h7Mm.mjs +4 -0
  4. package/dist/{check-DWvobZrP.mjs → check-D-Ieo-Xn.mjs} +32 -11
  5. package/dist/check-D-Ieo-Xn.mjs.map +1 -0
  6. package/dist/{check-BBd5xzUi.mjs → check-p5QqYXKY.mjs} +3 -3
  7. package/dist/cli.mjs +3 -3
  8. package/dist/{connect-build-B9Btboix.mjs → connect-build-CWR-WRE1.mjs} +4 -4
  9. package/dist/{connect-build-B9Btboix.mjs.map → connect-build-CWR-WRE1.mjs.map} +1 -1
  10. package/dist/definitions-worker.d.mts.map +1 -1
  11. package/dist/definitions-worker.mjs +5 -5
  12. package/dist/definitions-worker.mjs.map +1 -1
  13. package/dist/{evidence-Dchpoogs.mjs → evidence-CavwC5YV.mjs} +23 -9
  14. package/dist/evidence-CavwC5YV.mjs.map +1 -0
  15. package/dist/{generate-all-_7S0Iii2.mjs → generate-all-cgygbYEX.mjs} +5 -5
  16. package/dist/generate-all-cgygbYEX.mjs.map +1 -0
  17. package/dist/{generate-document-model-DCjzz3Sa.mjs → generate-document-model-OQPfeHs-.mjs} +25 -21
  18. package/dist/generate-document-model-OQPfeHs-.mjs.map +1 -0
  19. package/dist/{generate-editor-DdoapkEK.mjs → generate-editor-DBj_Pxwa.mjs} +7 -7
  20. package/dist/generate-editor-DBj_Pxwa.mjs.map +1 -0
  21. package/dist/{generate-subgraph-CrHbYK91.mjs → generate-subgraph-DJZCr0Tk.mjs} +34 -12
  22. package/dist/generate-subgraph-DJZCr0Tk.mjs.map +1 -0
  23. package/dist/{get-version-DUG29IeG.mjs → get-version-CMI7e-aF.mjs} +4 -4
  24. package/dist/{get-version-DUG29IeG.mjs.map → get-version-CMI7e-aF.mjs.map} +1 -1
  25. package/dist/{inspect-BpVHe9vz.mjs → inspect-CulIpVsF.mjs} +13 -7
  26. package/dist/inspect-CulIpVsF.mjs.map +1 -0
  27. package/dist/{mcp-DEBeM-ZV.mjs → mcp-BXt2elBt.mjs} +4 -4
  28. package/dist/{mcp-DEBeM-ZV.mjs.map → mcp-BXt2elBt.mjs.map} +1 -1
  29. package/dist/migrate-subgraphs-Cm7DDcDd.mjs +214 -0
  30. package/dist/migrate-subgraphs-Cm7DDcDd.mjs.map +1 -0
  31. package/dist/module-dir-1avCXsBi.mjs +2 -2
  32. package/dist/module-dir-1avCXsBi.mjs.map +1 -1
  33. package/dist/ph-cli-commands-3gef5MBB.mjs +4 -0
  34. package/dist/{ph-cli-commands-BG9deyv9.mjs → ph-cli-commands-BakV37_D.mjs} +43 -22
  35. package/dist/ph-cli-commands-BakV37_D.mjs.map +1 -0
  36. package/dist/render-3M3DwFzO.mjs +4 -0
  37. package/dist/{render-BO-Nwn2H.mjs → render-SVfj3m8A.mjs} +19 -13
  38. package/dist/render-SVfj3m8A.mjs.map +1 -0
  39. package/dist/{run-DEKE4MJY.mjs → run--de_-WAz.mjs} +5 -4
  40. package/dist/run--de_-WAz.mjs.map +1 -0
  41. package/dist/{run-DP3fNgPv.mjs → run-LRGy7zGo.mjs} +3 -3
  42. package/dist/runners/connect.mjs +1 -1
  43. package/dist/runners/switchboard.mjs +1 -1
  44. package/dist/subgraph-gate-BJ2PWXVY.mjs +26 -0
  45. package/dist/subgraph-gate-BJ2PWXVY.mjs.map +1 -0
  46. package/dist/subgraph-gate-j9ywj6KA.mjs +4 -0
  47. package/dist/subgraphs-7OYWwP-C.mjs +134 -0
  48. package/dist/subgraphs-7OYWwP-C.mjs.map +1 -0
  49. package/dist/{switchboard-migrate-Docb8Cjv.mjs → switchboard-migrate-BqSdKJ7u.mjs} +3 -4
  50. package/dist/switchboard-migrate-BqSdKJ7u.mjs.map +1 -0
  51. package/dist/{verify-CT24vch8.mjs → verify-B33saw-g.mjs} +4 -4
  52. package/dist/{verify-CT24vch8.mjs.map → verify-B33saw-g.mjs.map} +1 -1
  53. package/dist/{vetra-DSFzAl_1.mjs → vetra-DjNt0-L6.mjs} +4 -4
  54. package/dist/{vetra-DSFzAl_1.mjs.map → vetra-DjNt0-L6.mjs.map} +1 -1
  55. package/package.json +16 -16
  56. package/dist/authoring-mode-DWbbsuWh.mjs +0 -23
  57. package/dist/authoring-mode-DWbbsuWh.mjs.map +0 -1
  58. package/dist/build-CojYJHNn.mjs.map +0 -1
  59. package/dist/build-CsUTeki9.mjs +0 -4
  60. package/dist/check-DWvobZrP.mjs.map +0 -1
  61. package/dist/evidence-Dchpoogs.mjs.map +0 -1
  62. package/dist/generate-all-_7S0Iii2.mjs.map +0 -1
  63. package/dist/generate-document-model-DCjzz3Sa.mjs.map +0 -1
  64. package/dist/generate-editor-DdoapkEK.mjs.map +0 -1
  65. package/dist/generate-subgraph-CrHbYK91.mjs.map +0 -1
  66. package/dist/inspect-BpVHe9vz.mjs.map +0 -1
  67. package/dist/ph-cli-commands-BG9deyv9.mjs.map +0 -1
  68. package/dist/ph-cli-commands-Dn56Erg5.mjs +0 -4
  69. package/dist/render-BO-Nwn2H.mjs.map +0 -1
  70. package/dist/render-DdieUjtg.mjs +0 -4
  71. package/dist/run-DEKE4MJY.mjs.map +0 -1
  72. package/dist/switchboard-migrate-Docb8Cjv.mjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4a64887f-8f42-5b69-bbd4-b905759a6ef4")}catch(e){}}();
3
- import { t as getVersion } from "./get-version-DUG29IeG.mjs";
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f937dfd7-baea-5db4-acf7-9c8a39172704")}catch(e){}}();
3
+ import { t as getVersion } from "./get-version-CMI7e-aF.mjs";
4
4
  import { _ as pendingPrefix, a as writeReleaseApproval, c as PH_CLI_BINDING, d as listed, g as LOCK_FILE, h as BUILD_DIRECTORY, i as revisionFiles, l as RELEASE_APPROVAL_PATH, m as packageRevision, o as packRelease, p as changedPaths, s as packedDigests, t as packagePath, v as takeoverPrefix } from "./files-D6_euBBn.mjs";
5
5
  import { d as object, f as record, g as union, i as boolean, l as looseObject, m as string, r as array, s as json } from "./schemas-DzgKfQIx.mjs";
6
6
  import { n as OFFERED_ROUTES_MODULE, r as syncProjectConnectRoutes, t as HOST_ROUTES_DIR } from "./sync-connect-routes-t0Slg-P6.mjs";
@@ -2265,8 +2265,9 @@ function checkInChild(projectRoot, profile, session, timeoutMs) {
2265
2265
  /**
2266
2266
  * Checks the package's definitions after tsc and before any bundle, when
2267
2267
  * `ph build` asks or with `--release`. Without `--release` it checks the
2268
- * code-first sources the package selects, never stops the build, and skips
2269
- * without a word a package that selects none. With `--release`
2268
+ * package when discovery finds a code-first model directory or cannot read
2269
+ * the models directory, never stops the build, and skips without a word a
2270
+ * package with no code-first model. With `--release`
2270
2271
  * (experimental) it runs the release profile over every model, stored ones
2271
2272
  * included, and stops the build when the check is invalid or cannot run, a
2272
2273
  * configuration error included. The package's modules load only in the
@@ -2280,13 +2281,12 @@ function definitionsStepWithin(timeoutMs) {
2280
2281
  if (!args.release && !checkDefinitions) return;
2281
2282
  if (!args.release) {
2282
2283
  const { resolveDefinitionSelection } = await import("document-model/tooling");
2283
- const selection = resolveDefinitionSelection({
2284
+ if (resolveDefinitionSelection({
2284
2285
  configFile: join(projectRoot, "powerhouse.config.json"),
2285
2286
  allowMissingConfig: true
2286
- });
2287
- if (selection.status !== "ready" || selection.sourceSet.sources.length === 0) return;
2287
+ }).status === "skipped") return;
2288
2288
  }
2289
- const { renderCheckReport } = await import("./render-DdieUjtg.mjs");
2289
+ const { renderCheckReport } = await import("./render-3M3DwFzO.mjs");
2290
2290
  const printReport = (report) => {
2291
2291
  const text = renderCheckReport(report);
2292
2292
  if (report.diagnostics.length > 0) console.warn(`⚠ The definition check reported problems; the build goes on:\n${text}`);
@@ -2985,8 +2985,60 @@ async function buildPackage(args, options = {}) {
2985
2985
  }
2986
2986
  }
2987
2987
  //#endregion
2988
+ //#region src/services/subgraph-build-step.ts
2989
+ /** The definitions step checks the package, subgraphs included, unless
2990
+ * discovery skips it, as it does for a package with no document model. */
2991
+ async function definitionsStepCoversSubgraphs(projectRoot) {
2992
+ const { resolveDefinitionSelection } = await import("document-model/tooling");
2993
+ return resolveDefinitionSelection({
2994
+ configFile: join(projectRoot, "powerhouse.config.json"),
2995
+ allowMissingConfig: true
2996
+ }).status !== "skipped";
2997
+ }
2998
+ /**
2999
+ * Checks a package's code-first subgraphs in `ph build`'s edit profile when
3000
+ * the definitions step does not: a package where discovery skips it. Under `--release` the definitions
3001
+ * step runs the release profile, which carries the subgraph checks and
3002
+ * refuses on their errors.
3003
+ */
3004
+ function subgraphStepWithin(timeoutMs) {
3005
+ return {
3006
+ id: "subgraphs",
3007
+ after: ["definitions"],
3008
+ run: async ({ args, checkDefinitions, projectRoot, session }) => {
3009
+ if (args.release || !checkDefinitions) return;
3010
+ if (await definitionsStepCoversSubgraphs(projectRoot)) return;
3011
+ const { renderCheckReport } = await import("./render-3M3DwFzO.mjs");
3012
+ console.log("\n▶ Checking subgraph definitions...");
3013
+ const edit = await checkInChild(projectRoot, "edit", session, timeoutMs);
3014
+ if (!edit.ok) {
3015
+ console.warn(`⚠ The subgraph check could not run: ${edit.message}`);
3016
+ return;
3017
+ }
3018
+ const text = renderCheckReport(edit.result);
3019
+ if (edit.result.diagnostics.length > 0) console.warn(`⚠ The subgraph check reported problems; the build goes on:\n${text}`);
3020
+ else console.log(`✔ ${text}`);
3021
+ }
3022
+ };
3023
+ }
3024
+ const subgraphStep = subgraphStepWithin(3e5);
3025
+ //#endregion
2988
3026
  //#region src/services/build.ts
2989
3027
  /**
3028
+ * The gate loads codegen, so a build without `checkDefinitions` or without a
3029
+ * `subgraphs/` directory never imports it.
3030
+ */
3031
+ async function withSubgraphStep(options) {
3032
+ if (!options.checkDefinitions) return options;
3033
+ if (!existsSync(join(process.cwd(), "subgraphs"))) return options;
3034
+ const { hasCodeFirstSubgraph } = await import("./subgraph-gate-j9ywj6KA.mjs");
3035
+ if (!hasCodeFirstSubgraph(process.cwd())) return options;
3036
+ return {
3037
+ ...options,
3038
+ steps: [...options.steps ?? standardBuildSteps, subgraphStep]
3039
+ };
3040
+ }
3041
+ /**
2990
3042
  * `ph build`, and the package build `ph connect build` and the switchboard
2991
3043
  * runner start from. A refusal (missing tsc or tailwindcss, type errors not
2992
3044
  * accepted, a release check that fails) prints its message and exits 1 once
@@ -2997,7 +3049,7 @@ async function buildPackage(args, options = {}) {
2997
3049
  */
2998
3050
  async function runBuild(args, options = {}) {
2999
3051
  try {
3000
- return await buildPackage(args, options);
3052
+ return await buildPackage(args, await withSubgraphStep(options));
3001
3053
  } catch (error) {
3002
3054
  if (!(error instanceof BuildRefusal)) throw error;
3003
3055
  console.error(error.message);
@@ -3007,5 +3059,5 @@ async function runBuild(args, options = {}) {
3007
3059
  //#endregion
3008
3060
  export { assertExternalDependenciesDeclared as i, createTraceFiles as n, assertManifestNameMatchesPackage as r, runBuild as t };
3009
3061
 
3010
- //# sourceMappingURL=build-CojYJHNn.mjs.map
3011
- //# debugId=4a64887f-8f42-5b69-bbd4-b905759a6ef4
3062
+ //# sourceMappingURL=build-CxaXbGFz.mjs.map
3063
+ //# debugId=f937dfd7-baea-5db4-acf7-9c8a39172704