@ogygie/cli 0.4.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 +55 -2
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -14962,6 +14962,45 @@ function initProject(deps, productName2) {
14962
14962
  return { writtenFiles: writtenFiles.sort() };
14963
14963
  }
14964
14964
 
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
+ }
14974
+ async function runStudio(deps) {
14975
+ const importStudio = deps.importStudio ?? loadPublishedStudio;
14976
+ let studioServer;
14977
+ try {
14978
+ studioServer = await importStudio();
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
+ }
14990
+ throwOgygieError({
14991
+ code: "OGYGIE_STUDIO_LOAD_FAILED",
14992
+ message: "The studio is installed but could not be loaded.",
14993
+ file: "package.json",
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)."
14996
+ });
14997
+ }
14998
+ await studioServer.startStudio({
14999
+ repoRoot: deps.projectRoot,
15000
+ openBrowser: deps.openBrowser
15001
+ });
15002
+ }
15003
+
14965
15004
  // src/commands/upgrade.ts
14966
15005
  import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "node:fs";
14967
15006
  import { dirname as dirname2, join as join4 } from "node:path";
@@ -15361,6 +15400,18 @@ var governedChecksumsByVersion = {
15361
15400
  "AGENTS.md": "c7d51a0cd97b67343b486bdb7c54914da68d96409eaa985959d2a525c65549fd",
15362
15401
  "CLAUDE.md": "785ee8d90e368806d8cf0b4d84a15f29d1dc961168bda86cf1a6c60a923c8c9b",
15363
15402
  "tsconfig.base.json": "0f8919e9ed8bbc88e0308fa2fa91471dabb18d1df721bd78c04076597eba89a2"
15403
+ },
15404
+ "0.5.0": {
15405
+ ".github/workflows/ogygie-gates.yml": "48c40efe9fe66dd0f9c3b94287026d80eae9afd6782b5833fdf8846d8662babf",
15406
+ "AGENTS.md": "c7d51a0cd97b67343b486bdb7c54914da68d96409eaa985959d2a525c65549fd",
15407
+ "CLAUDE.md": "785ee8d90e368806d8cf0b4d84a15f29d1dc961168bda86cf1a6c60a923c8c9b",
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"
15364
15415
  }
15365
15416
  };
15366
15417
 
@@ -15458,14 +15509,16 @@ ogygie verify-vocabulary \u2014 ${problems.length} probl\xE8me(s).`);
15458
15509
  process.exit(1);
15459
15510
  }
15460
15511
  console.log("ogygie verify-vocabulary \u2014 OK, le vocabulaire d\xE9clar\xE9 est respect\xE9.");
15512
+ } else if (command === "studio") {
15513
+ await runStudio({ projectRoot: process.cwd(), cliVersion: cliVersion() });
15461
15514
  } else {
15462
15515
  printError(
15463
15516
  ogygieError({
15464
15517
  code: "OGYGIE_CLI_USAGE",
15465
15518
  message: `Unknown command ${JSON.stringify(command ?? "")}.`,
15466
15519
  file: null,
15467
- cause: `expected one of: init <product-name>, upgrade, check, verify-vocabulary (flags: --json, --yes)`,
15468
- suggestedFix: "Run `ogygie init <product-name>`, `ogygie upgrade`, `ogygie check` or `ogygie verify-vocabulary`."
15520
+ cause: `expected one of: init <product-name>, upgrade, check, verify-vocabulary, studio (flags: --json, --yes)`,
15521
+ suggestedFix: "Run `ogygie init <product-name>`, `ogygie upgrade`, `ogygie check`, `ogygie verify-vocabulary` or `ogygie studio`."
15469
15522
  })
15470
15523
  );
15471
15524
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ogygie/cli",
3
- "version": "0.4.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.4.0"
25
+ "@ogygie/core": "0.5.1"
26
26
  },
27
27
  "scripts": {
28
28
  "typecheck": "tsc -p tsconfig.json",