@ogygie/cli 0.3.0 → 0.5.0

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/cli.js CHANGED
@@ -14667,7 +14667,20 @@ var OgygieManifestSchema = external_exports.object({
14667
14667
  name: external_exports.string(),
14668
14668
  path: external_exports.string(),
14669
14669
  type: external_exports.enum(["api", "front", "gateway"]),
14670
- entryPoint: external_exports.string()
14670
+ entryPoint: external_exports.string(),
14671
+ /**
14672
+ * Code the product HOSTS without maintaining it — imported as-is from
14673
+ * elsewhere, the framework's own dev tooling being the typical case.
14674
+ * A vendored app is skipped by the vocabulary gate: a product's business
14675
+ * vocabulary has no claim over code it will never rename.
14676
+ *
14677
+ * A literal `true`, like `shared` on a table: an app is either vendored
14678
+ * (and says so) or the product's own (and stays silent) — no third
14679
+ * state. The derogation is declared here, machine-readably, and the gate
14680
+ * ANNOUNCES it on every run — one that stops being visible is one that
14681
+ * gets forgotten.
14682
+ */
14683
+ vendored: external_exports.literal(true).optional()
14671
14684
  })
14672
14685
  ),
14673
14686
  features: external_exports.array(FeatureManifestSchema),
@@ -14949,6 +14962,29 @@ function initProject(deps, productName2) {
14949
14962
  return { writtenFiles: writtenFiles.sort() };
14950
14963
  }
14951
14964
 
14965
+ // src/commands/studio.ts
14966
+ 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"));
14970
+ let studioServer;
14971
+ try {
14972
+ studioServer = await importStudio();
14973
+ } catch (thrown) {
14974
+ throwOgygieError({
14975
+ code: "OGYGIE_STUDIO_NOT_INSTALLED",
14976
+ message: "The studio is not installed in this project.",
14977
+ 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}`
14980
+ });
14981
+ }
14982
+ await studioServer.startStudio({
14983
+ repoRoot: deps.projectRoot,
14984
+ openBrowser: deps.openBrowser
14985
+ });
14986
+ }
14987
+
14952
14988
  // src/commands/upgrade.ts
14953
14989
  import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync as readFileSync4, writeFileSync as writeFileSync3 } from "node:fs";
14954
14990
  import { dirname as dirname2, join as join4 } from "node:path";
@@ -15279,13 +15315,22 @@ function collectCodeFiles(projectRoot, folder) {
15279
15315
  }
15280
15316
  function productCodeFoldersOf(manifest) {
15281
15317
  return [
15282
- ...manifest.apps.map((app) => app.path),
15318
+ ...manifest.apps.filter((app) => app.vendored !== true).map((app) => app.path),
15283
15319
  ...(manifest.framework?.packages ?? []).map((packageEntry) => packageEntry.path)
15284
15320
  ];
15285
15321
  }
15322
+ function vendoredAppsOf(manifest) {
15323
+ return manifest.apps.filter((app) => app.vendored === true).map((app) => ({ name: app.name, path: app.path }));
15324
+ }
15286
15325
  function verifyVocabulary(deps) {
15287
15326
  const manifest = readManifest(deps.projectRoot);
15288
15327
  if (manifest.vocabulary === void 0) return [];
15328
+ const vendored = vendoredAppsOf(manifest);
15329
+ if (vendored.length > 0 && deps.log !== void 0) {
15330
+ deps.log(
15331
+ `${vendored.length} app(s) hors du scan (vendored \u2014 code h\xE9berg\xE9, non maintenu par le produit) : ${vendored.map((app) => `${app.name} (${app.path})`).join(", ")}`
15332
+ );
15333
+ }
15289
15334
  const sourceFiles = productCodeFoldersOf(manifest).flatMap(
15290
15335
  (folder) => collectCodeFiles(deps.projectRoot, folder)
15291
15336
  );
@@ -15333,6 +15378,18 @@ var governedChecksumsByVersion = {
15333
15378
  "AGENTS.md": "ca73ab619d8c55fac11858d815bf5fbab6537ecebe7ae4123cbdeb3e3e36bf1a",
15334
15379
  "CLAUDE.md": "785ee8d90e368806d8cf0b4d84a15f29d1dc961168bda86cf1a6c60a923c8c9b",
15335
15380
  "tsconfig.base.json": "0f8919e9ed8bbc88e0308fa2fa91471dabb18d1df721bd78c04076597eba89a2"
15381
+ },
15382
+ "0.4.0": {
15383
+ ".github/workflows/ogygie-gates.yml": "48c40efe9fe66dd0f9c3b94287026d80eae9afd6782b5833fdf8846d8662babf",
15384
+ "AGENTS.md": "c7d51a0cd97b67343b486bdb7c54914da68d96409eaa985959d2a525c65549fd",
15385
+ "CLAUDE.md": "785ee8d90e368806d8cf0b4d84a15f29d1dc961168bda86cf1a6c60a923c8c9b",
15386
+ "tsconfig.base.json": "0f8919e9ed8bbc88e0308fa2fa91471dabb18d1df721bd78c04076597eba89a2"
15387
+ },
15388
+ "0.5.0": {
15389
+ ".github/workflows/ogygie-gates.yml": "48c40efe9fe66dd0f9c3b94287026d80eae9afd6782b5833fdf8846d8662babf",
15390
+ "AGENTS.md": "c7d51a0cd97b67343b486bdb7c54914da68d96409eaa985959d2a525c65549fd",
15391
+ "CLAUDE.md": "785ee8d90e368806d8cf0b4d84a15f29d1dc961168bda86cf1a6c60a923c8c9b",
15392
+ "tsconfig.base.json": "0f8919e9ed8bbc88e0308fa2fa91471dabb18d1df721bd78c04076597eba89a2"
15336
15393
  }
15337
15394
  };
15338
15395
 
@@ -15419,7 +15476,10 @@ ogygie check \u2014 ${problems.length} probl\xE8me(s).`);
15419
15476
  `ogygie check \u2014 OK, lockstep ${cliVersion()} et fichiers gouvern\xE9s intacts.`
15420
15477
  );
15421
15478
  } else if (command === "verify-vocabulary") {
15422
- const problems = verifyVocabulary({ projectRoot: process.cwd() });
15479
+ const problems = verifyVocabulary({
15480
+ projectRoot: process.cwd(),
15481
+ log: (line) => console.log(line)
15482
+ });
15423
15483
  if (problems.length > 0) {
15424
15484
  for (const problem of problems) printError(problem);
15425
15485
  console.error(`
@@ -15427,14 +15487,16 @@ ogygie verify-vocabulary \u2014 ${problems.length} probl\xE8me(s).`);
15427
15487
  process.exit(1);
15428
15488
  }
15429
15489
  console.log("ogygie verify-vocabulary \u2014 OK, le vocabulaire d\xE9clar\xE9 est respect\xE9.");
15490
+ } else if (command === "studio") {
15491
+ await runStudio({ projectRoot: process.cwd(), cliVersion: cliVersion() });
15430
15492
  } else {
15431
15493
  printError(
15432
15494
  ogygieError({
15433
15495
  code: "OGYGIE_CLI_USAGE",
15434
15496
  message: `Unknown command ${JSON.stringify(command ?? "")}.`,
15435
15497
  file: null,
15436
- cause: `expected one of: init <product-name>, upgrade, check, verify-vocabulary (flags: --json, --yes)`,
15437
- suggestedFix: "Run `ogygie init <product-name>`, `ogygie upgrade`, `ogygie check` or `ogygie verify-vocabulary`."
15498
+ cause: `expected one of: init <product-name>, upgrade, check, verify-vocabulary, studio (flags: --json, --yes)`,
15499
+ suggestedFix: "Run `ogygie init <product-name>`, `ogygie upgrade`, `ogygie check`, `ogygie verify-vocabulary` or `ogygie studio`."
15438
15500
  })
15439
15501
  );
15440
15502
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ogygie/cli",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
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.3.0"
25
+ "@ogygie/core": "0.5.0"
26
26
  },
27
27
  "scripts": {
28
28
  "typecheck": "tsc -p tsconfig.json",
@@ -272,6 +272,14 @@ se fait PAR RACINE, donc une racine trop courte attrape des mots génériques
272
272
  (déclarer `memo` interdit fait tomber `memory`, `createInMemoryDb`…). Une racine
273
273
  se déclare assez longue pour ne nommer que le concept.
274
274
 
275
+ **Le code que le produit héberge sans le maintenir** — l'outil de dev du
276
+ framework propagé dans le dépôt en est le cas type — se déclare
277
+ `"vendored": true` sur son entrée d'`apps[]`, et sort du scan : un vocabulaire
278
+ métier n'a pas de prise sur du code que le produit ne renommera jamais. La
279
+ dérogation se déclare au manifeste, comme celle d'une table partagée, et le
280
+ gate l'ANNONCE à chaque exécution — une dérogation qu'on ne voit plus est une
281
+ dérogation qui s'oublie. Elle ne couvre JAMAIS le code du produit lui-même.
282
+
275
283
  ## Front (apps/web) — règles et templates canoniques
276
284
 
277
285
  ### Stack imposée (toute autre lib = amendement DECISIONS.md d'abord)