@ogygie/cli 0.5.0 → 0.5.1

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 (2) hide show
  1. package/dist/cli.js +29 -7
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -14963,20 +14963,36 @@ function initProject(deps, productName2) {
14963
14963
  }
14964
14964
 
14965
14965
  // src/commands/studio.ts
14966
+ var PUBLISHED_STUDIO_SERVER = "@ogygie/studio/server";
14967
+ async function loadPublishedStudio() {
14968
+ return await import(PUBLISHED_STUDIO_SERVER);
14969
+ }
14970
+ function isModuleNotFound(thrown) {
14971
+ const code = thrown?.code;
14972
+ return code === "ERR_MODULE_NOT_FOUND" || code === "MODULE_NOT_FOUND" || code === "ERR_PACKAGE_PATH_NOT_EXPORTED" || typeof thrown === "object" && thrown !== null && thrown instanceof Error && /Cannot find (package|module)/i.test(thrown.message);
14973
+ }
14966
14974
  async function runStudio(deps) {
14967
- const importStudio = deps.importStudio ?? // Kept as a bare specifier so the bundler leaves it alone: it is resolved
14968
- // in the CONSUMER's node_modules, at run time.
14969
- (async () => await import("@ogygie/studio/server"));
14975
+ const importStudio = deps.importStudio ?? loadPublishedStudio;
14970
14976
  let studioServer;
14971
14977
  try {
14972
14978
  studioServer = await importStudio();
14973
14979
  } catch (thrown) {
14980
+ const reason = thrown instanceof Error ? thrown.message : String(thrown);
14981
+ if (isModuleNotFound(thrown)) {
14982
+ throwOgygieError({
14983
+ code: "OGYGIE_STUDIO_NOT_INSTALLED",
14984
+ message: "The studio is not installed in this project.",
14985
+ file: "package.json",
14986
+ cause: `@ogygie/studio/server cannot be resolved: ${reason}`,
14987
+ suggestedFix: `Install it as a dev dependency, at the framework's own version (lockstep D2): pnpm add -Dw @ogygie/studio@${deps.cliVersion}`
14988
+ });
14989
+ }
14974
14990
  throwOgygieError({
14975
- code: "OGYGIE_STUDIO_NOT_INSTALLED",
14976
- message: "The studio is not installed in this project.",
14991
+ code: "OGYGIE_STUDIO_LOAD_FAILED",
14992
+ message: "The studio is installed but could not be loaded.",
14977
14993
  file: "package.json",
14978
- cause: thrown instanceof Error ? `import of @ogygie/studio/server failed: ${thrown.message}` : "import of @ogygie/studio/server failed",
14979
- suggestedFix: `Install it as a dev dependency, at the framework's own version (lockstep D2): pnpm add -D @ogygie/studio@${deps.cliVersion}`
14994
+ cause: reason,
14995
+ suggestedFix: "Reinstalling will not help: this is a framework defect. Report it with this cause, and check that @ogygie/studio matches @ogygie/cli (lockstep D2)."
14980
14996
  });
14981
14997
  }
14982
14998
  await studioServer.startStudio({
@@ -15390,6 +15406,12 @@ var governedChecksumsByVersion = {
15390
15406
  "AGENTS.md": "c7d51a0cd97b67343b486bdb7c54914da68d96409eaa985959d2a525c65549fd",
15391
15407
  "CLAUDE.md": "785ee8d90e368806d8cf0b4d84a15f29d1dc961168bda86cf1a6c60a923c8c9b",
15392
15408
  "tsconfig.base.json": "0f8919e9ed8bbc88e0308fa2fa91471dabb18d1df721bd78c04076597eba89a2"
15409
+ },
15410
+ "0.5.1": {
15411
+ ".github/workflows/ogygie-gates.yml": "48c40efe9fe66dd0f9c3b94287026d80eae9afd6782b5833fdf8846d8662babf",
15412
+ "AGENTS.md": "c7d51a0cd97b67343b486bdb7c54914da68d96409eaa985959d2a525c65549fd",
15413
+ "CLAUDE.md": "785ee8d90e368806d8cf0b4d84a15f29d1dc961168bda86cf1a6c60a923c8c9b",
15414
+ "tsconfig.base.json": "0f8919e9ed8bbc88e0308fa2fa91471dabb18d1df721bd78c04076597eba89a2"
15393
15415
  }
15394
15416
  };
15395
15417
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ogygie/cli",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Ogygie framework CLI: deterministic scaffolding (init), governed-file upgrades (upgrade) and lockstep verification (check) for Ogygie products.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -22,7 +22,7 @@
22
22
  "tsx": "^4.20.0",
23
23
  "typescript": "^5.8.0",
24
24
  "zod": "^4.0.0",
25
- "@ogygie/core": "0.5.0"
25
+ "@ogygie/core": "0.5.1"
26
26
  },
27
27
  "scripts": {
28
28
  "typecheck": "tsc -p tsconfig.json",