@codeyam/codeyam-cli 0.1.22 → 0.1.23

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 (52) hide show
  1. package/analyzer-template/.build-info.json +7 -7
  2. package/analyzer-template/log.txt +3 -3
  3. package/analyzer-template/packages/ai/src/lib/astScopes/methodSemantics.ts +135 -0
  4. package/analyzer-template/packages/ai/src/lib/astScopes/nodeToSource.ts +19 -0
  5. package/analyzer-template/packages/ai/src/lib/astScopes/paths.ts +11 -4
  6. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +5 -1
  7. package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +1632 -1554
  8. package/codeyam-cli/src/commands/__tests__/editor.analyzeImportsArgs.test.js +47 -0
  9. package/codeyam-cli/src/commands/__tests__/editor.analyzeImportsArgs.test.js.map +1 -0
  10. package/codeyam-cli/src/commands/__tests__/editor.auditNoAutoAnalysis.test.js +17 -9
  11. package/codeyam-cli/src/commands/__tests__/editor.auditNoAutoAnalysis.test.js.map +1 -1
  12. package/codeyam-cli/src/commands/editor.js +135 -18
  13. package/codeyam-cli/src/commands/editor.js.map +1 -1
  14. package/codeyam-cli/src/commands/editorAnalyzeImportsArgs.js +23 -0
  15. package/codeyam-cli/src/commands/editorAnalyzeImportsArgs.js.map +1 -0
  16. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +103 -1
  17. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -1
  18. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +140 -1
  19. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -1
  20. package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js +50 -1
  21. package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js.map +1 -1
  22. package/codeyam-cli/src/utils/editorAudit.js +38 -2
  23. package/codeyam-cli/src/utils/editorAudit.js.map +1 -1
  24. package/codeyam-cli/src/utils/editorScenarios.js +60 -0
  25. package/codeyam-cli/src/utils/editorScenarios.js.map +1 -1
  26. package/codeyam-cli/src/utils/editorSeedAdapter.js +42 -2
  27. package/codeyam-cli/src/utils/editorSeedAdapter.js.map +1 -1
  28. package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js +30 -11
  29. package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js.map +1 -1
  30. package/codeyam-cli/src/webserver/build/client/assets/{editor.entity.(_sha)-aIHKLB-m.js → editor.entity.(_sha)-DMv5ESGo.js} +18 -18
  31. package/codeyam-cli/src/webserver/build/client/assets/{manifest-bcbb3d49.js → manifest-1a45e154.js} +1 -1
  32. package/codeyam-cli/src/webserver/build/server/assets/{analysisRunner-DjF-soOH.js → analysisRunner-By5slFjw.js} +1 -1
  33. package/codeyam-cli/src/webserver/build/server/assets/{index-nAvHGWbz.js → index-DXaOwBnm.js} +1 -1
  34. package/codeyam-cli/src/webserver/build/server/assets/{init-XhpIt-OT.js → init-CLG1LjQM.js} +1 -1
  35. package/codeyam-cli/src/webserver/build/server/assets/{server-build-DVwiibFu.js → server-build-NZmUqQv6.js} +155 -111
  36. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  37. package/codeyam-cli/src/webserver/build-info.json +5 -5
  38. package/codeyam-cli/src/webserver/editorProxy.js +55 -3
  39. package/codeyam-cli/src/webserver/editorProxy.js.map +1 -1
  40. package/codeyam-cli/templates/codeyam-editor-reference.md +8 -6
  41. package/codeyam-cli/templates/nextjs-prisma-sqlite/seed-adapter.ts +42 -34
  42. package/package.json +1 -1
  43. package/packages/ai/src/lib/astScopes/methodSemantics.js +99 -0
  44. package/packages/ai/src/lib/astScopes/methodSemantics.js.map +1 -1
  45. package/packages/ai/src/lib/astScopes/nodeToSource.js +16 -0
  46. package/packages/ai/src/lib/astScopes/nodeToSource.js.map +1 -1
  47. package/packages/ai/src/lib/astScopes/paths.js +12 -3
  48. package/packages/ai/src/lib/astScopes/paths.js.map +1 -1
  49. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +5 -1
  50. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
  51. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +1330 -1270
  52. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Parse file path arguments for `codeyam editor analyze-imports`.
3
+ *
4
+ * Supports multiple calling conventions:
5
+ * codeyam editor analyze-imports path/to/file.tsx → json="path/to/file.tsx", extras=[]
6
+ * codeyam editor analyze-imports file1.tsx file2.tsx → json="file1.tsx", extras=["editor","file2.tsx"]
7
+ * codeyam editor analyze-imports → json=undefined, extras=[] → empty (all entities)
8
+ */
9
+ export function parseAnalyzeImportsArgs(json, extras) {
10
+ const paths = [];
11
+ if (json) {
12
+ paths.push(json);
13
+ }
14
+ // Collect extra positional args, filtering out "editor" and non-strings
15
+ for (const arg of extras) {
16
+ if (typeof arg === 'string' && arg !== 'editor') {
17
+ paths.push(arg);
18
+ }
19
+ }
20
+ // Deduplicate while preserving order
21
+ return [...new Set(paths)];
22
+ }
23
+ //# sourceMappingURL=editorAnalyzeImportsArgs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editorAnalyzeImportsArgs.js","sourceRoot":"","sources":["../../../../src/commands/editorAnalyzeImportsArgs.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,uBAAuB,CACrC,IAAwB,EACxB,MAA2B;IAE3B,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,IAAI,IAAI,EAAE,CAAC;QACT,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;IAED,wEAAwE;IACxE,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;YAChD,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IAED,qCAAqC;IACrC,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;AAC7B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import Database from 'better-sqlite3';
2
2
  import { Kysely, SqliteDialect } from 'kysely';
3
- import { isComponent, classifyGlossaryEntries, computeAudit, filterGlossaryByChangeStatus, resolveAuditSessionScope, queryScenarioCounts, queryPageScenarioCounts, queryIncompleteEntities, queryMiscategorizedScenarios, queryUnassociatedScenarios, isOnlyIncompleteEntities, isOnlyPreExistingIncomplete, isAutoRemediable, identifyScenariosNeedingRecapture, detectDuplicateNames, aggregateClientErrorsByComponent, } from "../editorAudit.js";
3
+ import { isComponent, classifyGlossaryEntries, computeAudit, filterGlossaryByChangeStatus, resolveAuditSessionScope, queryScenarioCounts, queryPageScenarioCounts, queryIncompleteEntities, queryMiscategorizedScenarios, queryUnassociatedScenarios, isOnlyIncompleteEntities, isOnlyPreExistingIncomplete, isAutoRemediable, identifyScenariosNeedingRecapture, detectDuplicateNames, aggregateClientErrorsByComponent, determineTargetedAnalysisPaths, shouldAutoRecapture, } from "../editorAudit.js";
4
4
  describe('editorAudit', () => {
5
5
  describe('isComponent', () => {
6
6
  it('should return true for JSX.Element return type', () => {
@@ -3908,5 +3908,107 @@ describe('editorAudit', () => {
3908
3908
  expect(result['Home']).toEqual(['ReferenceError: window is not defined']);
3909
3909
  });
3910
3910
  });
3911
+ // ── determineTargetedAnalysisPaths ──────────────────────────────────
3912
+ describe('determineTargetedAnalysisPaths', () => {
3913
+ it('should return unique file paths from unassociated scenarios', () => {
3914
+ const result = determineTargetedAnalysisPaths({
3915
+ unassociatedScenarios: [
3916
+ { filePath: 'app/components/CreateFromFiltersButton.tsx' },
3917
+ { filePath: 'app/components/StaleDismissedBanner.tsx' },
3918
+ ],
3919
+ incompleteEntities: [],
3920
+ });
3921
+ expect(result).toEqual([
3922
+ 'app/components/CreateFromFiltersButton.tsx',
3923
+ 'app/components/StaleDismissedBanner.tsx',
3924
+ ]);
3925
+ });
3926
+ it('should include file paths from incomplete entities', () => {
3927
+ const result = determineTargetedAnalysisPaths({
3928
+ unassociatedScenarios: [{ filePath: 'app/components/TaskCard.tsx' }],
3929
+ incompleteEntities: [{ filePath: 'app/components/Dashboard.tsx' }],
3930
+ });
3931
+ expect(result).toEqual([
3932
+ 'app/components/TaskCard.tsx',
3933
+ 'app/components/Dashboard.tsx',
3934
+ ]);
3935
+ });
3936
+ it('should deduplicate file paths across both sources', () => {
3937
+ const result = determineTargetedAnalysisPaths({
3938
+ unassociatedScenarios: [{ filePath: 'app/components/TaskCard.tsx' }],
3939
+ incompleteEntities: [{ filePath: 'app/components/TaskCard.tsx' }],
3940
+ });
3941
+ expect(result).toEqual(['app/components/TaskCard.tsx']);
3942
+ });
3943
+ it('should return empty array when no issues', () => {
3944
+ const result = determineTargetedAnalysisPaths({
3945
+ unassociatedScenarios: [],
3946
+ incompleteEntities: [],
3947
+ });
3948
+ expect(result).toEqual([]);
3949
+ });
3950
+ it('should filter out entries with empty file paths', () => {
3951
+ const result = determineTargetedAnalysisPaths({
3952
+ unassociatedScenarios: [{ filePath: '' }],
3953
+ incompleteEntities: [],
3954
+ });
3955
+ expect(result).toEqual([]);
3956
+ });
3957
+ it('should handle incomplete entities with undefined filePath', () => {
3958
+ const result = determineTargetedAnalysisPaths({
3959
+ unassociatedScenarios: [{ filePath: 'app/components/Good.tsx' }],
3960
+ incompleteEntities: [
3961
+ {
3962
+ /* no filePath at all */
3963
+ },
3964
+ { filePath: undefined },
3965
+ { filePath: 'app/components/AlsoGood.tsx' },
3966
+ ],
3967
+ });
3968
+ expect(result).toEqual([
3969
+ 'app/components/Good.tsx',
3970
+ 'app/components/AlsoGood.tsx',
3971
+ ]);
3972
+ });
3973
+ });
3974
+ // ── shouldAutoRecapture ─────────────────────────────────────────────
3975
+ describe('shouldAutoRecapture', () => {
3976
+ it('should return true when fix flag is set and stale scenarios exist', () => {
3977
+ expect(shouldAutoRecapture({
3978
+ fix: true,
3979
+ scenariosNeedingRecapture: [
3980
+ {
3981
+ scenarioName: 'Default',
3982
+ entityName: 'TaskCard',
3983
+ status: { status: 'edited' },
3984
+ },
3985
+ ],
3986
+ })).toBe(true);
3987
+ });
3988
+ it('should return false when fix flag is not set', () => {
3989
+ expect(shouldAutoRecapture({
3990
+ fix: false,
3991
+ scenariosNeedingRecapture: [
3992
+ {
3993
+ scenarioName: 'Default',
3994
+ entityName: 'TaskCard',
3995
+ status: { status: 'edited' },
3996
+ },
3997
+ ],
3998
+ })).toBe(false);
3999
+ });
4000
+ it('should return false when fix is set but no stale scenarios', () => {
4001
+ expect(shouldAutoRecapture({
4002
+ fix: true,
4003
+ scenariosNeedingRecapture: [],
4004
+ })).toBe(false);
4005
+ });
4006
+ it('should return false when both are falsy', () => {
4007
+ expect(shouldAutoRecapture({
4008
+ fix: false,
4009
+ scenariosNeedingRecapture: [],
4010
+ })).toBe(false);
4011
+ });
4012
+ });
3911
4013
  });
3912
4014
  //# sourceMappingURL=editorAudit.test.js.map