@codeyam/codeyam-cli 0.1.16 → 0.1.17

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 (35) hide show
  1. package/analyzer-template/.build-info.json +6 -6
  2. package/analyzer-template/log.txt +3 -3
  3. package/codeyam-cli/src/commands/editor.js +64 -2
  4. package/codeyam-cli/src/commands/editor.js.map +1 -1
  5. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +150 -9
  6. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -1
  7. package/codeyam-cli/src/utils/__tests__/editorCaptureScenarioSeeding.test.js +137 -0
  8. package/codeyam-cli/src/utils/__tests__/editorCaptureScenarioSeeding.test.js.map +1 -0
  9. package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js +70 -0
  10. package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js.map +1 -1
  11. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +51 -1
  12. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -1
  13. package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js +20 -1
  14. package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js.map +1 -1
  15. package/codeyam-cli/src/utils/__tests__/glossaryAdd.test.js +177 -0
  16. package/codeyam-cli/src/utils/__tests__/glossaryAdd.test.js.map +1 -0
  17. package/codeyam-cli/src/utils/editorAudit.js +27 -11
  18. package/codeyam-cli/src/utils/editorAudit.js.map +1 -1
  19. package/codeyam-cli/src/utils/editorScenarioSwitch.js +24 -2
  20. package/codeyam-cli/src/utils/editorScenarioSwitch.js.map +1 -1
  21. package/codeyam-cli/src/utils/editorScenarios.js +28 -1
  22. package/codeyam-cli/src/utils/editorScenarios.js.map +1 -1
  23. package/codeyam-cli/src/utils/entityChangeStatus.js +1 -1
  24. package/codeyam-cli/src/utils/entityChangeStatus.js.map +1 -1
  25. package/codeyam-cli/src/utils/glossaryAdd.js +74 -0
  26. package/codeyam-cli/src/utils/glossaryAdd.js.map +1 -0
  27. package/codeyam-cli/src/webserver/build/client/assets/{editor.entity.(_sha)-DN5ouXAl.js → editor.entity.(_sha)-Bnx7yUP0.js} +1 -1
  28. package/codeyam-cli/src/webserver/build/client/assets/{manifest-389033be.js → manifest-3157d6b8.js} +1 -1
  29. package/codeyam-cli/src/webserver/build/server/assets/{analysisRunner-D_1MSYeW.js → analysisRunner-BMmkgAkg.js} +1 -1
  30. package/codeyam-cli/src/webserver/build/server/assets/{index-ckWaCf_v.js → index-DxB0pOSt.js} +1 -1
  31. package/codeyam-cli/src/webserver/build/server/assets/{init-ld124R4Z.js → init-DLYLaqqP.js} +1 -1
  32. package/codeyam-cli/src/webserver/build/server/assets/{server-build-DzzNZGv_.js → server-build-CcyitQLQ.js} +109 -109
  33. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  34. package/codeyam-cli/src/webserver/build-info.json +5 -5
  35. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
1
  {
2
- "buildTimestamp": "2026-03-19T01:18:46.592Z",
3
- "buildTime": 1773883126592,
4
- "gitCommit": "27da20c7d41586bf9567c2e2ac63312ba9fb9057",
2
+ "buildTimestamp": "2026-03-19T11:57:18.299Z",
3
+ "buildTime": 1773921438299,
4
+ "gitCommit": "471e1bd5c0e64ab79e5aae1965797f9cc293303d",
5
5
  "nodeVersion": "v20.20.1",
6
6
  "contentHash": "b046e014847d5b02d10d6795839ccd0d5117627cbd0be413260824610596a63d",
7
- "buildNumber": 1104,
8
- "semanticVersion": "0.1.1104",
9
- "version": "0.1.1104 (2026-03-19T01:18+b046e01)"
7
+ "buildNumber": 1105,
8
+ "semanticVersion": "0.1.1105",
9
+ "version": "0.1.1105 (2026-03-19T11:57+b046e01)"
10
10
  }
@@ -1,7 +1,7 @@
1
1
 
2
- [3/19/2026, 1:18:46 AM] > codeyam-combo@1.0.0 mergeDependencies
3
- [3/19/2026, 1:18:46 AM] > node ./scripts/mergePackageJsonFiles.cjs
2
+ [3/19/2026, 11:57:18 AM] > codeyam-combo@1.0.0 mergeDependencies
3
+ [3/19/2026, 11:57:18 AM] > node ./scripts/mergePackageJsonFiles.cjs
4
4
 
5
5
 
6
- [3/19/2026, 1:18:46 AM] Merged dependencies into root package.json
6
+ [3/19/2026, 11:57:18 AM] Merged dependencies into root package.json
7
7
 
@@ -2709,6 +2709,53 @@ async function handleRegister(jsonArg) {
2709
2709
  process.exit(1);
2710
2710
  }
2711
2711
  }
2712
+ // ─── Glossary-add subcommand ──────────────────────────────────────────
2713
+ /**
2714
+ * `codeyam editor glossary-add '{"name":"...", "filePath":"...", "description":"..."}'`
2715
+ *
2716
+ * Safely adds/updates entries in .codeyam/glossary.json via the CLI,
2717
+ * avoiding hand-editing that breaks on unicode characters.
2718
+ */
2719
+ async function handleGlossaryAdd(jsonArg) {
2720
+ if (!jsonArg) {
2721
+ console.error(chalk.red('Error: JSON argument required.'));
2722
+ console.error(chalk.dim(' Usage: codeyam editor glossary-add \'{"name":"DrinkCard","filePath":"app/components/DrinkCard.tsx","description":"Displays a drink item"}\''));
2723
+ console.error(chalk.dim(' For large payloads: codeyam editor glossary-add @.codeyam/tmp/entry.json'));
2724
+ process.exit(1);
2725
+ }
2726
+ const parsed = parseRegisterArg(jsonArg);
2727
+ if (parsed.error) {
2728
+ console.error(chalk.red(`Error: ${parsed.error}`));
2729
+ process.exit(1);
2730
+ }
2731
+ // Normalize to array
2732
+ const items = Array.isArray(parsed.body) ? parsed.body : [parsed.body];
2733
+ // Read existing glossary
2734
+ const root = getProjectRoot();
2735
+ const glossaryPath = path.join(root, '.codeyam', 'glossary.json');
2736
+ let existing = [];
2737
+ try {
2738
+ const raw = JSON.parse(fs.readFileSync(glossaryPath, 'utf8'));
2739
+ existing = sanitizeGlossaryEntries(raw);
2740
+ }
2741
+ catch {
2742
+ // Glossary doesn't exist yet or can't be parsed — start fresh
2743
+ }
2744
+ // Merge
2745
+ const { validateGlossaryEntry, mergeGlossaryEntries } = await import('../utils/glossaryAdd.js');
2746
+ const result = mergeGlossaryEntries(existing, items);
2747
+ // Report validation errors
2748
+ for (const err of result.errors) {
2749
+ console.error(chalk.red(`Error at index ${err.index}: ${err.message}`));
2750
+ }
2751
+ if (result.added === 0 && result.updated === 0 && result.errors.length > 0) {
2752
+ process.exit(1);
2753
+ }
2754
+ // Write back with utf8 encoding to safely handle unicode
2755
+ fs.mkdirSync(path.dirname(glossaryPath), { recursive: true });
2756
+ fs.writeFileSync(glossaryPath, JSON.stringify(result.entries, null, 2), 'utf8');
2757
+ console.log(`added=${result.added} updated=${result.updated} total=${result.entries.length}`);
2758
+ }
2712
2759
  // ─── Dependents subcommand ────────────────────────────────────────────
2713
2760
  /**
2714
2761
  * `codeyam editor dependents <EntityName>`
@@ -3041,8 +3088,18 @@ function printAuditGateFailures(data) {
3041
3088
  }
3042
3089
  if (s.missingFromGlossary > 0)
3043
3090
  issues.push(`${s.missingFromGlossary} file(s) with scenarios not in glossary`);
3044
- if (s.incompleteEntities > 0)
3045
- issues.push(`${s.incompleteEntities} entity/entities need import analysis`);
3091
+ if (s.incompleteEntities > 0) {
3092
+ const preCount = s.preExistingIncompleteEntities || 0;
3093
+ if (preCount > 0 && preCount === s.incompleteEntities) {
3094
+ issues.push(`${s.incompleteEntities} entity/entities need import analysis (pre-existing — not caused by your current changes, but must be fixed before proceeding)`);
3095
+ }
3096
+ else if (preCount > 0) {
3097
+ issues.push(`${s.incompleteEntities} entity/entities need import analysis (${preCount} pre-existing — not from your changes)`);
3098
+ }
3099
+ else {
3100
+ issues.push(`${s.incompleteEntities} entity/entities need import analysis`);
3101
+ }
3102
+ }
3046
3103
  if (s.miscategorizedScenarios > 0)
3047
3104
  issues.push(`${s.miscategorizedScenarios} component(s) using page URLs instead of isolation routes`);
3048
3105
  if (s.scenariosNeedingRecapture > 0)
@@ -4032,6 +4089,11 @@ const editorCommand = {
4032
4089
  await handleRegister(argv.json || '');
4033
4090
  return;
4034
4091
  }
4092
+ // Subcommand: codeyam editor glossary-add '{"name":"...", ...}'
4093
+ if (argv.step === 'glossary-add') {
4094
+ await handleGlossaryAdd(argv.json || '');
4095
+ return;
4096
+ }
4035
4097
  // Subcommand: codeyam editor analyze-imports
4036
4098
  if (argv.step === 'analyze-imports') {
4037
4099
  await handleAnalyzeImports();