@codeyam/codeyam-cli 0.1.0-staging.dbc742d → 0.1.0-staging.df25827
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/analyzer-template/.build-info.json +8 -8
- package/analyzer-template/log.txt +3 -3
- package/analyzer-template/package.json +6 -6
- package/analyzer-template/packages/ai/package.json +1 -1
- package/analyzer-template/packages/ai/src/lib/astScopes/methodSemantics.ts +135 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/nodeToSource.ts +19 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/paths.ts +11 -4
- package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +36 -9
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/ParentScopeManager.ts +10 -3
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.ts +16 -6
- package/analyzer-template/packages/analyze/index.ts +4 -1
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +28 -2
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +5 -36
- package/analyzer-template/packages/analyze/src/lib/files/analyze/findOrCreateEntity.ts +10 -6
- package/analyzer-template/packages/analyze/src/lib/files/analyze/gatherEntityMap.ts +9 -12
- package/analyzer-template/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.ts +21 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.ts +82 -10
- package/analyzer-template/packages/analyze/src/lib/files/analyzeChange.ts +4 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyzeInitial.ts +4 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyzeNextRoute.ts +8 -3
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +239 -58
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +1684 -1462
- package/analyzer-template/packages/aws/package.json +7 -7
- package/analyzer-template/packages/database/package.json +3 -3
- package/analyzer-template/packages/database/src/lib/kysely/tables/editorScenariosTable.ts +77 -6
- package/analyzer-template/packages/database/src/lib/loadAnalysis.ts +25 -15
- package/analyzer-template/packages/database/src/lib/loadEntity.ts +19 -8
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts +5 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js +79 -6
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.js +7 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntity.d.ts +4 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntity.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntity.js +5 -5
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntity.js.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.d.ts +3 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js +22 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js.map +1 -1
- package/analyzer-template/packages/utils/src/lib/fs/rsyncCopy.ts +27 -0
- package/analyzer-template/project/analyzeFileEntities.ts +26 -0
- package/analyzer-template/project/runMultiScenarioServer.ts +26 -3
- package/background/src/lib/virtualized/project/analyzeFileEntities.js +22 -0
- package/background/src/lib/virtualized/project/analyzeFileEntities.js.map +1 -1
- package/background/src/lib/virtualized/project/runMultiScenarioServer.js +23 -3
- package/background/src/lib/virtualized/project/runMultiScenarioServer.js.map +1 -1
- package/codeyam-cli/src/cli.js +24 -0
- package/codeyam-cli/src/cli.js.map +1 -1
- package/codeyam-cli/src/commands/__tests__/editor.analyzeImportsArgs.test.js +47 -0
- package/codeyam-cli/src/commands/__tests__/editor.analyzeImportsArgs.test.js.map +1 -0
- package/codeyam-cli/src/commands/__tests__/editor.auditNoAutoAnalysis.test.js +71 -0
- package/codeyam-cli/src/commands/__tests__/editor.auditNoAutoAnalysis.test.js.map +1 -0
- package/codeyam-cli/src/commands/__tests__/editor.designSystem.test.js +30 -0
- package/codeyam-cli/src/commands/__tests__/editor.designSystem.test.js.map +1 -0
- package/codeyam-cli/src/commands/__tests__/editor.isolateArgs.test.js +51 -0
- package/codeyam-cli/src/commands/__tests__/editor.isolateArgs.test.js.map +1 -0
- package/codeyam-cli/src/commands/__tests__/editor.statePersistence.test.js +55 -0
- package/codeyam-cli/src/commands/__tests__/editor.statePersistence.test.js.map +1 -0
- package/codeyam-cli/src/commands/__tests__/editor.stepDispatch.test.js +56 -0
- package/codeyam-cli/src/commands/__tests__/editor.stepDispatch.test.js.map +1 -0
- package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js +39 -3
- package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js.map +1 -1
- package/codeyam-cli/src/commands/editor.js +3819 -624
- package/codeyam-cli/src/commands/editor.js.map +1 -1
- package/codeyam-cli/src/commands/editorAnalyzeImportsArgs.js +23 -0
- package/codeyam-cli/src/commands/editorAnalyzeImportsArgs.js.map +1 -0
- package/codeyam-cli/src/commands/editorIsolateArgs.js +25 -0
- package/codeyam-cli/src/commands/editorIsolateArgs.js.map +1 -0
- package/codeyam-cli/src/commands/init.js +22 -0
- package/codeyam-cli/src/commands/init.js.map +1 -1
- package/codeyam-cli/src/commands/telemetry.js +37 -0
- package/codeyam-cli/src/commands/telemetry.js.map +1 -0
- package/codeyam-cli/src/data/designSystems.js +27 -0
- package/codeyam-cli/src/data/designSystems.js.map +1 -0
- package/codeyam-cli/src/data/techStacks.js +1 -1
- package/codeyam-cli/src/utils/__tests__/analyzerFinalization.test.js +173 -0
- package/codeyam-cli/src/utils/__tests__/analyzerFinalization.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/devServerState.test.js +93 -1
- package/codeyam-cli/src/utils/__tests__/devServerState.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorApi.test.js +62 -8
- package/codeyam-cli/src/utils/__tests__/editorApi.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +3526 -1
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorBroadcastViewport.test.js +76 -0
- package/codeyam-cli/src/utils/__tests__/editorBroadcastViewport.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorCaptureScenarioSeeding.test.js +137 -0
- package/codeyam-cli/src/utils/__tests__/editorCaptureScenarioSeeding.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorDeleteScenario.test.js +100 -0
- package/codeyam-cli/src/utils/__tests__/editorDeleteScenario.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js +76 -3
- package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorEntityHelpers.test.js +381 -0
- package/codeyam-cli/src/utils/__tests__/editorEntityHelpers.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorGuardMiddleware.test.js +67 -0
- package/codeyam-cli/src/utils/__tests__/editorGuardMiddleware.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js +75 -1
- package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorMigration.test.js +435 -0
- package/codeyam-cli/src/utils/__tests__/editorMigration.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorPreview.test.js +73 -1
- package/codeyam-cli/src/utils/__tests__/editorPreview.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js +98 -1
- package/codeyam-cli/src/utils/__tests__/editorProxySession.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorRoadmap.test.js +1108 -0
- package/codeyam-cli/src/utils/__tests__/editorRoadmap.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js +190 -0
- package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +936 -9
- package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js +201 -1
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapterPrismaValidation.test.js +143 -0
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapterPrismaValidation.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorSessionFilter.test.js +66 -0
- package/codeyam-cli/src/utils/__tests__/editorSessionFilter.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorShouldRevalidate.test.js +53 -0
- package/codeyam-cli/src/utils/__tests__/editorShouldRevalidate.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js +390 -11
- package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/envFile.test.js +125 -0
- package/codeyam-cli/src/utils/__tests__/envFile.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/glossaryAdd.test.js +177 -0
- package/codeyam-cli/src/utils/__tests__/glossaryAdd.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/handoffContext.test.js +500 -0
- package/codeyam-cli/src/utils/__tests__/handoffContext.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js +16 -1
- package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/manualEntityAnalysis.test.js +302 -0
- package/codeyam-cli/src/utils/__tests__/manualEntityAnalysis.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js +30 -2
- package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/registerScenarioResult.test.js +127 -0
- package/codeyam-cli/src/utils/__tests__/registerScenarioResult.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/routePatternMatching.test.js +118 -0
- package/codeyam-cli/src/utils/__tests__/routePatternMatching.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/scenarioCoverage.test.js +57 -0
- package/codeyam-cli/src/utils/__tests__/scenarioCoverage.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js +373 -1
- package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/screenshotHash.test.js +84 -0
- package/codeyam-cli/src/utils/__tests__/screenshotHash.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +1 -0
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/telemetry.test.js +159 -0
- package/codeyam-cli/src/utils/__tests__/telemetry.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/testRunner.test.js +216 -0
- package/codeyam-cli/src/utils/__tests__/testRunner.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/webappDetection.test.js +6 -0
- package/codeyam-cli/src/utils/__tests__/webappDetection.test.js.map +1 -1
- package/codeyam-cli/src/utils/analysisRunner.js +39 -8
- package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
- package/codeyam-cli/src/utils/analyzer.js +11 -1
- package/codeyam-cli/src/utils/analyzer.js.map +1 -1
- package/codeyam-cli/src/utils/analyzerFinalization.js +100 -0
- package/codeyam-cli/src/utils/analyzerFinalization.js.map +1 -0
- package/codeyam-cli/src/utils/backgroundServer.js +1 -1
- package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/utils/designSystemShowcase.js +810 -0
- package/codeyam-cli/src/utils/designSystemShowcase.js.map +1 -0
- package/codeyam-cli/src/utils/devServerState.js +32 -0
- package/codeyam-cli/src/utils/devServerState.js.map +1 -1
- package/codeyam-cli/src/utils/editorApi.js +27 -5
- package/codeyam-cli/src/utils/editorApi.js.map +1 -1
- package/codeyam-cli/src/utils/editorAudit.js +700 -10
- package/codeyam-cli/src/utils/editorAudit.js.map +1 -1
- package/codeyam-cli/src/utils/editorBroadcastViewport.js +26 -0
- package/codeyam-cli/src/utils/editorBroadcastViewport.js.map +1 -0
- package/codeyam-cli/src/utils/editorDeleteScenario.js +67 -0
- package/codeyam-cli/src/utils/editorDeleteScenario.js.map +1 -0
- package/codeyam-cli/src/utils/editorEntityChangeStatus.js +13 -7
- package/codeyam-cli/src/utils/editorEntityChangeStatus.js.map +1 -1
- package/codeyam-cli/src/utils/editorEntityHelpers.js +144 -0
- package/codeyam-cli/src/utils/editorEntityHelpers.js.map +1 -0
- package/codeyam-cli/src/utils/editorGuard.js +36 -0
- package/codeyam-cli/src/utils/editorGuard.js.map +1 -0
- package/codeyam-cli/src/utils/editorLoaderHelpers.js +40 -1
- package/codeyam-cli/src/utils/editorLoaderHelpers.js.map +1 -1
- package/codeyam-cli/src/utils/editorMigration.js +224 -0
- package/codeyam-cli/src/utils/editorMigration.js.map +1 -0
- package/codeyam-cli/src/utils/editorPreview.js +33 -0
- package/codeyam-cli/src/utils/editorPreview.js.map +1 -1
- package/codeyam-cli/src/utils/editorRecapture.js +109 -0
- package/codeyam-cli/src/utils/editorRecapture.js.map +1 -0
- package/codeyam-cli/src/utils/editorRoadmap.js +574 -0
- package/codeyam-cli/src/utils/editorRoadmap.js.map +1 -0
- package/codeyam-cli/src/utils/editorScenarioSwitch.js +39 -2
- package/codeyam-cli/src/utils/editorScenarioSwitch.js.map +1 -1
- package/codeyam-cli/src/utils/editorScenarios.js +375 -16
- package/codeyam-cli/src/utils/editorScenarios.js.map +1 -1
- package/codeyam-cli/src/utils/editorSeedAdapter.js +308 -6
- package/codeyam-cli/src/utils/editorSeedAdapter.js.map +1 -1
- package/codeyam-cli/src/utils/editorShouldRevalidate.js +21 -0
- package/codeyam-cli/src/utils/editorShouldRevalidate.js.map +1 -0
- package/codeyam-cli/src/utils/entityChangeStatus.js +50 -5
- package/codeyam-cli/src/utils/entityChangeStatus.js.map +1 -1
- package/codeyam-cli/src/utils/entityChangeStatus.server.js +72 -3
- package/codeyam-cli/src/utils/entityChangeStatus.server.js.map +1 -1
- package/codeyam-cli/src/utils/envFile.js +90 -0
- package/codeyam-cli/src/utils/envFile.js.map +1 -0
- package/codeyam-cli/src/utils/fileWatcher.js +38 -0
- package/codeyam-cli/src/utils/fileWatcher.js.map +1 -1
- package/codeyam-cli/src/utils/glossaryAdd.js +74 -0
- package/codeyam-cli/src/utils/glossaryAdd.js.map +1 -0
- package/codeyam-cli/src/utils/handoffContext.js +257 -0
- package/codeyam-cli/src/utils/handoffContext.js.map +1 -0
- package/codeyam-cli/src/utils/install-skills.js +50 -6
- package/codeyam-cli/src/utils/install-skills.js.map +1 -1
- package/codeyam-cli/src/utils/manualEntityAnalysis.js +196 -0
- package/codeyam-cli/src/utils/manualEntityAnalysis.js.map +1 -0
- package/codeyam-cli/src/utils/parseRegisterArg.js.map +1 -1
- package/codeyam-cli/src/utils/progress.js +2 -2
- package/codeyam-cli/src/utils/progress.js.map +1 -1
- package/codeyam-cli/src/utils/queue/__tests__/job.interactiveStart.test.js +159 -0
- package/codeyam-cli/src/utils/queue/__tests__/job.interactiveStart.test.js.map +1 -0
- package/codeyam-cli/src/utils/queue/job.js +35 -6
- package/codeyam-cli/src/utils/queue/job.js.map +1 -1
- package/codeyam-cli/src/utils/registerScenarioResult.js +52 -0
- package/codeyam-cli/src/utils/registerScenarioResult.js.map +1 -0
- package/codeyam-cli/src/utils/routePatternMatching.js +129 -0
- package/codeyam-cli/src/utils/routePatternMatching.js.map +1 -0
- package/codeyam-cli/src/utils/scenarioCoverage.js +12 -10
- package/codeyam-cli/src/utils/scenarioCoverage.js.map +1 -1
- package/codeyam-cli/src/utils/scenariosManifest.js +154 -0
- package/codeyam-cli/src/utils/scenariosManifest.js.map +1 -1
- package/codeyam-cli/src/utils/screenshotHash.js +26 -0
- package/codeyam-cli/src/utils/screenshotHash.js.map +1 -0
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +1 -0
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
- package/codeyam-cli/src/utils/simulationGateMiddleware.js +9 -0
- package/codeyam-cli/src/utils/simulationGateMiddleware.js.map +1 -1
- package/codeyam-cli/src/utils/techStackConfig.js +38 -0
- package/codeyam-cli/src/utils/techStackConfig.js.map +1 -0
- package/codeyam-cli/src/utils/techStackConfig.test.js +85 -0
- package/codeyam-cli/src/utils/techStackConfig.test.js.map +1 -0
- package/codeyam-cli/src/utils/telemetry.js +106 -0
- package/codeyam-cli/src/utils/telemetry.js.map +1 -0
- package/codeyam-cli/src/utils/telemetryMiddleware.js +22 -0
- package/codeyam-cli/src/utils/telemetryMiddleware.js.map +1 -0
- package/codeyam-cli/src/utils/testResultCache.js +53 -0
- package/codeyam-cli/src/utils/testResultCache.js.map +1 -0
- package/codeyam-cli/src/utils/testResultCache.server.js +81 -0
- package/codeyam-cli/src/utils/testResultCache.server.js.map +1 -0
- package/codeyam-cli/src/utils/testResultCache.server.test.js +187 -0
- package/codeyam-cli/src/utils/testResultCache.server.test.js.map +1 -0
- package/codeyam-cli/src/utils/testResultCache.test.js +230 -0
- package/codeyam-cli/src/utils/testResultCache.test.js.map +1 -0
- package/codeyam-cli/src/utils/testRunner.js +193 -1
- package/codeyam-cli/src/utils/testRunner.js.map +1 -1
- package/codeyam-cli/src/utils/webappDetection.js +4 -2
- package/codeyam-cli/src/utils/webappDetection.js.map +1 -1
- package/codeyam-cli/src/webserver/__tests__/api.interactive-switch-scenario.test.js +99 -0
- package/codeyam-cli/src/webserver/__tests__/api.interactive-switch-scenario.test.js.map +1 -0
- package/codeyam-cli/src/webserver/__tests__/buildPtyEnv.test.js +153 -0
- package/codeyam-cli/src/webserver/__tests__/buildPtyEnv.test.js.map +1 -0
- package/codeyam-cli/src/webserver/__tests__/clientErrors.test.js +68 -1
- package/codeyam-cli/src/webserver/__tests__/clientErrors.test.js.map +1 -1
- package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js +454 -4
- package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js.map +1 -1
- package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js +315 -0
- package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js.map +1 -0
- package/codeyam-cli/src/webserver/__tests__/stripClaudeCommand.test.js +135 -0
- package/codeyam-cli/src/webserver/__tests__/stripClaudeCommand.test.js.map +1 -0
- package/codeyam-cli/src/webserver/app/lib/clientErrors.js +22 -1
- package/codeyam-cli/src/webserver/app/lib/clientErrors.js.map +1 -1
- package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
- package/codeyam-cli/src/webserver/app/lib/git.js +3 -2
- package/codeyam-cli/src/webserver/app/lib/git.js.map +1 -1
- package/codeyam-cli/src/webserver/app/routes/api.interactive-switch-scenario.js +34 -0
- package/codeyam-cli/src/webserver/app/routes/api.interactive-switch-scenario.js.map +1 -0
- package/codeyam-cli/src/webserver/app/types/editor.js +8 -0
- package/codeyam-cli/src/webserver/app/types/editor.js.map +1 -0
- package/codeyam-cli/src/webserver/backgroundServer.js +60 -61
- package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/CopyButton-DTBZZfSk.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-BcgbViKV.js → EntityItem-BxclONWq.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeBadge-CQgyEGV-.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-CQIG2qda.js → EntityTypeIcon-BsnEOJZ_.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-ByaELMbv.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-6WjVfhxX.js +25 -0
- package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-ChX-Hp7W.js +3 -0
- package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-BU_OAEMP.js → LoadingDots-By5zI316.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-ceAyBX-H.js → LogViewer-C-9zQdXg.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/MiniClaudeChat-Bs2_Oua4.js +36 -0
- package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-BzHcG7SE.js → ReportIssueModal-DQsceHVv.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-DThcm_9M.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-0DY_NKil.js → ScenarioViewer-Cl4oOA3A.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/Spinner-CIil5-gb.js +34 -0
- package/codeyam-cli/src/webserver/build/client/assets/TruncatedFilePath-CK7-NaPZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/ViewportInspectBar-BqkA9zyZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{_index-DLxKhri3.js → _index-DnOgyseQ.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-BcY3q6nt.js → activity.(_tab)-DqM9hbNE.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/{addon-web-links-Duc5hnl7.js → addon-web-links-C58dYPwR.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{agent-transcripts-Bni3iiUj.js → agent-transcripts-B8NCeOrm.js} +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-database-verify-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-github-verify-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-handoff-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-hosting-verify-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-recapture-stale-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-rename-scenario-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-roadmap-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-save-scenario-data-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-save-seed-state-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-prompt-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-schema-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-session-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.editor-verify-routes-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.interactive-switch-scenario-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{book-open-BYOypzCa.js → book-open-BFSIqZgO.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-C_Pmso5S.js → chevron-down-B9fDzFVh.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/chunk-UVKPFVEO-Bmq2apuh.js +43 -0
- package/codeyam-cli/src/webserver/build/client/assets/{circle-check-BVMi9VA5.js → circle-check-DLPObLUx.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{copy-n2FB0_Sw.js → copy-DXEmO0TD.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-CC6AbExI.js → createLucideIcon-BwyFiRot.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/cy-logo-cli-Coe5NhbS.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{cy-logo-cli-CCKUIm0S.svg → cy-logo-cli-DoA97ML3.svg} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-iRhRIFlp.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/editor._tab-BZPBzV73.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/editor.entity.(_sha)-DhtVC4aI.js +161 -0
- package/codeyam-cli/src/webserver/build/client/assets/editorPreview-C6fEYHrh.js +41 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-BF4oLwaE.js → entity._sha._-pc-vc6wO.js} +13 -12
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-C8AyYgYT.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-DziaVQX1.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-BTcpgIpC.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-BMvVHNXU.js → entity._sha_.edit._scenarioId-D_O_ajfZ.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{entry.client-DTvKq3TY.js → entry.client-j1Vi0bco.js} +6 -6
- package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-Daa96Fr1.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/files-kuny2Q_s.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/git-DgCZPMie.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/globals-L-aUIeux.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{index-BcvgDzbZ.js → index-BliGSSpl.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{index-yHOVb4rc.js → index-SqjQKTdH.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{index-10oVnAAH.js → index-vyrZD2g4.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/jsx-runtime-D_zvdyIk.js +9 -0
- package/codeyam-cli/src/webserver/build/client/assets/labs-c3yLxSEp.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-DaAZ_H2w.js → loader-circle-D-q28GLF.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-b0d69c06.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{memory-9gnxSZlb.js → memory-CEWIUC4t.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{pause-f5-1lKBt.js → pause-BP6fitdh.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-CLedrjXQ.js +80 -0
- package/codeyam-cli/src/webserver/build/client/assets/{search-Di64LWVb.js → search-BooqacKS.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/settings-BM0nbryO.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/simulations-ovy6FjRY.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{terminal-Br7MOqts.js → terminal-DHemCJIs.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-BLdiCuG-.js → triangle-alert-D87ekDl8.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-Dk0Tciqg.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-C8QvIe05.js +2 -0
- package/codeyam-cli/src/webserver/build/client/assets/useReportContext-jkCytuYz.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/useToast-BgqkixU9.js +1 -0
- package/codeyam-cli/src/webserver/build/client/sound-test.html +98 -0
- package/codeyam-cli/src/webserver/build/server/assets/analysisRunner-DPUEhrWo.js +16 -0
- package/codeyam-cli/src/webserver/build/server/assets/{index-BWoRb5RY.js → index-oF2amaGI.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/init-C42BvUGp.js +14 -0
- package/codeyam-cli/src/webserver/build/server/assets/progress-CHTtrxFG.js +1 -0
- package/codeyam-cli/src/webserver/build/server/assets/server-build-DiCdDL5d.js +853 -0
- package/codeyam-cli/src/webserver/build/server/index.js +1 -1
- package/codeyam-cli/src/webserver/build-info.json +5 -5
- package/codeyam-cli/src/webserver/editorProxy.js +443 -35
- package/codeyam-cli/src/webserver/editorProxy.js.map +1 -1
- package/codeyam-cli/src/webserver/idleDetector.js +130 -0
- package/codeyam-cli/src/webserver/idleDetector.js.map +1 -0
- package/codeyam-cli/src/webserver/mockStateEvents.js +28 -0
- package/codeyam-cli/src/webserver/mockStateEvents.js.map +1 -0
- package/codeyam-cli/src/webserver/public/sound-test.html +98 -0
- package/codeyam-cli/src/webserver/scripts/journalCapture.ts +53 -0
- package/codeyam-cli/src/webserver/server.js +192 -4
- package/codeyam-cli/src/webserver/server.js.map +1 -1
- package/codeyam-cli/src/webserver/terminalServer.js +369 -52
- package/codeyam-cli/src/webserver/terminalServer.js.map +1 -1
- package/codeyam-cli/templates/__tests__/editor-step-hook.prompt-capture.test.ts +118 -0
- package/codeyam-cli/templates/codeyam-editor-claude.md +3 -1
- package/codeyam-cli/templates/codeyam-editor-codex.md +61 -0
- package/codeyam-cli/templates/codeyam-editor-gemini.md +59 -0
- package/codeyam-cli/templates/codeyam-editor-reference.md +216 -0
- package/codeyam-cli/templates/design-systems/clean-dashboard-design-system.md +255 -0
- package/codeyam-cli/templates/design-systems/editorial-design-system.md +267 -0
- package/codeyam-cli/templates/design-systems/mono-brutalist-design-system.md +256 -0
- package/codeyam-cli/templates/design-systems/neo-brutalist-design-system.md +294 -0
- package/codeyam-cli/templates/editor-step-hook.py +193 -56
- package/codeyam-cli/templates/expo-react-native/MOBILE_SETUP.md +204 -5
- package/codeyam-cli/templates/expo-react-native/__tests__/.gitkeep +0 -0
- package/codeyam-cli/templates/expo-react-native/app/_layout.tsx +6 -3
- package/codeyam-cli/templates/expo-react-native/app/index.tsx +36 -0
- package/codeyam-cli/templates/expo-react-native/app.json +11 -0
- package/codeyam-cli/templates/expo-react-native/babel.config.js +1 -0
- package/codeyam-cli/templates/expo-react-native/gitignore +2 -0
- package/codeyam-cli/templates/expo-react-native/global.css +7 -0
- package/codeyam-cli/templates/expo-react-native/lib/theme.ts +73 -0
- package/codeyam-cli/templates/expo-react-native/package.json +32 -16
- package/codeyam-cli/templates/expo-react-native/patches/expo-modules-autolinking+3.0.24.patch +29 -0
- package/codeyam-cli/templates/isolation-route/expo-router.tsx.template +54 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/gitignore +1 -0
- package/codeyam-cli/templates/nextjs-prisma-sqlite/package.json +1 -1
- package/codeyam-cli/templates/nextjs-prisma-sqlite/seed-adapter.ts +88 -40
- package/codeyam-cli/templates/nextjs-prisma-supabase/package.json +1 -1
- package/codeyam-cli/templates/seed-adapters/supabase.ts +475 -0
- package/codeyam-cli/templates/skills/codeyam-editor/SKILL.md +106 -10
- package/package.json +2 -1
- package/packages/ai/src/lib/astScopes/methodSemantics.js +99 -0
- package/packages/ai/src/lib/astScopes/methodSemantics.js.map +1 -1
- package/packages/ai/src/lib/astScopes/nodeToSource.js +16 -0
- package/packages/ai/src/lib/astScopes/nodeToSource.js.map +1 -1
- package/packages/ai/src/lib/astScopes/paths.js +12 -3
- package/packages/ai/src/lib/astScopes/paths.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +27 -10
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/ParentScopeManager.js +9 -2
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/ParentScopeManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js +14 -4
- package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js.map +1 -1
- package/packages/analyze/index.js +1 -1
- package/packages/analyze/index.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +16 -2
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +6 -26
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js +3 -2
- package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js +9 -7
- package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.js +14 -0
- package/packages/analyze/src/lib/files/analyze/trackEntityCircularDependencies.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js +44 -11
- package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeChange.js +1 -0
- package/packages/analyze/src/lib/files/analyzeChange.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeInitial.js +1 -0
- package/packages/analyze/src/lib/files/analyzeInitial.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeNextRoute.js +5 -1
- package/packages/analyze/src/lib/files/analyzeNextRoute.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +120 -28
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +1368 -1193
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
- package/packages/database/src/lib/kysely/tables/editorScenariosTable.js +79 -6
- package/packages/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -1
- package/packages/database/src/lib/loadAnalysis.js +7 -1
- package/packages/database/src/lib/loadAnalysis.js.map +1 -1
- package/packages/database/src/lib/loadEntity.js +5 -5
- package/packages/database/src/lib/loadEntity.js.map +1 -1
- package/packages/utils/src/lib/fs/rsyncCopy.js +22 -1
- package/packages/utils/src/lib/fs/rsyncCopy.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/CopyButton-BPXZwM4t.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeBadge-g3saevPb.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-Bu6c6aDe.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-DYFW3lDD.js +0 -25
- package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-DLeucoVX.js +0 -3
- package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-BED4B6sP.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/Spinner-Bb5uFQ5V.js +0 -34
- package/codeyam-cli/src/webserver/build/client/assets/TruncatedFilePath-C8OKAR5x.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/ViewportInspectBar-oAf2Kqsf.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/chunk-JZWAC4HX-C4pqxYJB.js +0 -51
- package/codeyam-cli/src/webserver/build/client/assets/cy-logo-cli-DcX-ZS3p.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-Csi0_PMl.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/editor-BBAGP_mE.js +0 -10
- package/codeyam-cli/src/webserver/build/client/assets/editorPreview-BLQMSKZa.js +0 -41
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-C7YX6r3H.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-CF164ouH.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-p9hhkjJM.js +0 -6
- package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-cPo8LiG3.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/files-BZrlFE1F.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/git-DdZcvjGh.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/globals-COUSHTyZ.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/labs-Zk7ryIM1.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-9c70d1f3.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-CHOdrM6Y.js +0 -67
- package/codeyam-cli/src/webserver/build/client/assets/settings-0OrEMU6J.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/simulations-DWT-CvLy.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-CrAK28Bc.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-C14nCb1q.js +0 -2
- package/codeyam-cli/src/webserver/build/client/assets/useReportContext-O-jkvSPx.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useToast-9FIWuYfK.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/init-DbChSUQP.js +0 -10
- package/codeyam-cli/src/webserver/build/server/assets/server-build-BtbLQkKd.js +0 -433
- package/codeyam-cli/templates/expo-react-native/app/(tabs)/_layout.tsx +0 -33
- package/codeyam-cli/templates/expo-react-native/app/(tabs)/index.tsx +0 -12
- package/codeyam-cli/templates/expo-react-native/app/(tabs)/settings.tsx +0 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { buildReverseDependencyGraph, classifyDirectChanges, computeEntityChangeStatus, buildChangedFilesMap, pageNameFromUrl, scenarioEntityName, buildEntityInfosFromScenarios, buildEntityInfosFromGlossary, filterGroupsByChangeStatus, filterGlossaryByChangeStatus, filterScenarioScreenshotsByChangeStatus, } from "../entityChangeStatus.js";
|
|
2
|
-
import { scanPageFilePaths, detectFirstFeature, readFeatureStartedAt, } from "../entityChangeStatus.server.js";
|
|
1
|
+
import { buildReverseDependencyGraph, classifyDirectChanges, computeEntityChangeStatus, buildChangedFilesMap, pageNameFromUrl, isIsolationUrl, scenarioEntityName, buildEntityInfosFromScenarios, buildEntityInfosFromGlossary, filterGroupsByChangeStatus, filterGlossaryByChangeStatus, filterScenarioScreenshotsByChangeStatus, } from "../entityChangeStatus.js";
|
|
2
|
+
import { scanPageFilePaths, detectFirstFeature, readFeatureStartedAt, readEditorStep, readEditorSessionId, readSavedActiveScenarioId, } from "../entityChangeStatus.server.js";
|
|
3
3
|
import * as fsModule from 'fs';
|
|
4
4
|
import * as pathModule from 'path';
|
|
5
5
|
import * as os from 'os';
|
|
@@ -137,6 +137,11 @@ describe('entityChangeStatus', () => {
|
|
|
137
137
|
expect(pageNameFromUrl('/drinks/[id]')).toBe('Drinks');
|
|
138
138
|
expect(pageNameFromUrl('/users/[userId]/posts')).toBe('Users');
|
|
139
139
|
});
|
|
140
|
+
it('should strip file extensions from URL segments', () => {
|
|
141
|
+
expect(pageNameFromUrl('/library.html')).toBe('Library');
|
|
142
|
+
expect(pageNameFromUrl('/about.htm')).toBe('About');
|
|
143
|
+
expect(pageNameFromUrl('/library.html?article=a1')).toBe('Library');
|
|
144
|
+
});
|
|
140
145
|
});
|
|
141
146
|
// ── buildEntityInfosFromScenarios ─────────────────────────────────────
|
|
142
147
|
describe('buildEntityInfosFromScenarios', () => {
|
|
@@ -1049,6 +1054,34 @@ describe('entityChangeStatus', () => {
|
|
|
1049
1054
|
expect(result).toHaveLength(1);
|
|
1050
1055
|
expect(result[0].importedBy).toBeDefined();
|
|
1051
1056
|
});
|
|
1057
|
+
it('should use displayName for non-app/ pageFilePath instead of collapsing to Home', () => {
|
|
1058
|
+
// Margo bug: Chrome extension has two entry points:
|
|
1059
|
+
// "/" → src/popup/App.tsx (Home)
|
|
1060
|
+
// "/library.html" → src/library/FullPageLibrary.tsx (Library)
|
|
1061
|
+
// Without displayName, buildRoutePattern('src/library/FullPageLibrary.tsx')
|
|
1062
|
+
// returns '/' since it doesn't start with 'app/', collapsing both to "Home".
|
|
1063
|
+
const scenarios = [
|
|
1064
|
+
{
|
|
1065
|
+
componentName: null,
|
|
1066
|
+
componentPath: null,
|
|
1067
|
+
url: '/',
|
|
1068
|
+
pageFilePath: 'src/popup/App.tsx',
|
|
1069
|
+
displayName: 'Home',
|
|
1070
|
+
},
|
|
1071
|
+
{
|
|
1072
|
+
componentName: null,
|
|
1073
|
+
componentPath: null,
|
|
1074
|
+
url: '/library.html',
|
|
1075
|
+
pageFilePath: 'src/library/FullPageLibrary.tsx',
|
|
1076
|
+
displayName: 'Library',
|
|
1077
|
+
},
|
|
1078
|
+
];
|
|
1079
|
+
const result = buildEntityInfosFromScenarios(scenarios, {}, []);
|
|
1080
|
+
expect(result).toHaveLength(2);
|
|
1081
|
+
expect(result.map((e) => e.name).sort()).toEqual(['Home', 'Library']);
|
|
1082
|
+
expect(result.find((e) => e.name === 'Home')?.filePath).toBe('src/popup/App.tsx');
|
|
1083
|
+
expect(result.find((e) => e.name === 'Library')?.filePath).toBe('src/library/FullPageLibrary.tsx');
|
|
1084
|
+
});
|
|
1052
1085
|
});
|
|
1053
1086
|
// ── Full pipeline regression tests ───────────────────────────────
|
|
1054
1087
|
describe('full pipeline regression tests', () => {
|
|
@@ -1596,7 +1629,7 @@ describe('entityChangeStatus', () => {
|
|
|
1596
1629
|
});
|
|
1597
1630
|
fsModule.writeFileSync(pathModule.join(appDir, 'settings', 'profile', 'page.tsx'), '');
|
|
1598
1631
|
const result = scanPageFilePaths(tempDir);
|
|
1599
|
-
expect(result).toEqual({
|
|
1632
|
+
expect(result.map).toEqual({
|
|
1600
1633
|
Home: 'app/page.tsx',
|
|
1601
1634
|
Drinks: 'app/drinks/page.tsx',
|
|
1602
1635
|
Settings: 'app/settings/profile/page.tsx',
|
|
@@ -1607,7 +1640,7 @@ describe('entityChangeStatus', () => {
|
|
|
1607
1640
|
fsModule.mkdirSync(appDir, { recursive: true });
|
|
1608
1641
|
fsModule.writeFileSync(pathModule.join(appDir, 'page.js'), '');
|
|
1609
1642
|
const result = scanPageFilePaths(tempDir);
|
|
1610
|
-
expect(result).toEqual({ Home: 'app/page.js' });
|
|
1643
|
+
expect(result.map).toEqual({ Home: 'app/page.js' });
|
|
1611
1644
|
});
|
|
1612
1645
|
it('should skip isolated-components directories', () => {
|
|
1613
1646
|
const appDir = pathModule.join(tempDir, 'app');
|
|
@@ -1616,11 +1649,11 @@ describe('entityChangeStatus', () => {
|
|
|
1616
1649
|
});
|
|
1617
1650
|
fsModule.writeFileSync(pathModule.join(appDir, 'isolated-components', 'test', 'page.tsx'), '');
|
|
1618
1651
|
const result = scanPageFilePaths(tempDir);
|
|
1619
|
-
expect(result).toEqual({});
|
|
1652
|
+
expect(result.map).toEqual({});
|
|
1620
1653
|
});
|
|
1621
1654
|
it('should return empty map when app/ does not exist', () => {
|
|
1622
1655
|
const result = scanPageFilePaths(tempDir);
|
|
1623
|
-
expect(result).toEqual({});
|
|
1656
|
+
expect(result.map).toEqual({});
|
|
1624
1657
|
});
|
|
1625
1658
|
// ── Expo Router support ──────────────────────────────────────────────
|
|
1626
1659
|
it('should find index.tsx as Home page (Expo Router)', () => {
|
|
@@ -1628,7 +1661,7 @@ describe('entityChangeStatus', () => {
|
|
|
1628
1661
|
fsModule.mkdirSync(appDir, { recursive: true });
|
|
1629
1662
|
fsModule.writeFileSync(pathModule.join(appDir, 'index.tsx'), '');
|
|
1630
1663
|
const result = scanPageFilePaths(tempDir);
|
|
1631
|
-
expect(result).toEqual({ Home: 'app/index.tsx' });
|
|
1664
|
+
expect(result.map).toEqual({ Home: 'app/index.tsx' });
|
|
1632
1665
|
});
|
|
1633
1666
|
it('should find named route files as pages (Expo Router)', () => {
|
|
1634
1667
|
const appDir = pathModule.join(tempDir, 'app');
|
|
@@ -1638,7 +1671,7 @@ describe('entityChangeStatus', () => {
|
|
|
1638
1671
|
fsModule.mkdirSync(pathModule.join(appDir, 'tea'), { recursive: true });
|
|
1639
1672
|
fsModule.writeFileSync(pathModule.join(appDir, 'tea', '[id].tsx'), '');
|
|
1640
1673
|
const result = scanPageFilePaths(tempDir);
|
|
1641
|
-
expect(result).toEqual({
|
|
1674
|
+
expect(result.map).toEqual({
|
|
1642
1675
|
Home: 'app/index.tsx',
|
|
1643
1676
|
'Add-tea': 'app/add-tea.tsx',
|
|
1644
1677
|
Tea: 'app/tea/[id].tsx',
|
|
@@ -1650,7 +1683,7 @@ describe('entityChangeStatus', () => {
|
|
|
1650
1683
|
fsModule.writeFileSync(pathModule.join(appDir, '_layout.tsx'), '');
|
|
1651
1684
|
fsModule.writeFileSync(pathModule.join(appDir, 'index.tsx'), '');
|
|
1652
1685
|
const result = scanPageFilePaths(tempDir);
|
|
1653
|
-
expect(result).toEqual({ Home: 'app/index.tsx' });
|
|
1686
|
+
expect(result.map).toEqual({ Home: 'app/index.tsx' });
|
|
1654
1687
|
});
|
|
1655
1688
|
it('should handle route groups like (tabs) transparently (Expo Router)', () => {
|
|
1656
1689
|
const appDir = pathModule.join(tempDir, 'app');
|
|
@@ -1660,7 +1693,7 @@ describe('entityChangeStatus', () => {
|
|
|
1660
1693
|
fsModule.writeFileSync(pathModule.join(tabsDir, 'index.tsx'), '');
|
|
1661
1694
|
fsModule.writeFileSync(pathModule.join(tabsDir, 'settings.tsx'), '');
|
|
1662
1695
|
const result = scanPageFilePaths(tempDir);
|
|
1663
|
-
expect(result).toEqual({
|
|
1696
|
+
expect(result.map).toEqual({
|
|
1664
1697
|
Home: 'app/(tabs)/index.tsx',
|
|
1665
1698
|
Settings: 'app/(tabs)/settings.tsx',
|
|
1666
1699
|
});
|
|
@@ -1671,7 +1704,32 @@ describe('entityChangeStatus', () => {
|
|
|
1671
1704
|
fsModule.writeFileSync(pathModule.join(appDir, 'page.tsx'), '');
|
|
1672
1705
|
fsModule.writeFileSync(pathModule.join(appDir, 'index.tsx'), '');
|
|
1673
1706
|
const result = scanPageFilePaths(tempDir);
|
|
1674
|
-
expect(result).toEqual({ Home: 'app/page.tsx' });
|
|
1707
|
+
expect(result.map).toEqual({ Home: 'app/page.tsx' });
|
|
1708
|
+
});
|
|
1709
|
+
it('should include all page files in allFiles when multiple routes share a page name', () => {
|
|
1710
|
+
const appDir = pathModule.join(tempDir, 'app');
|
|
1711
|
+
fsModule.mkdirSync(appDir, { recursive: true });
|
|
1712
|
+
fsModule.writeFileSync(pathModule.join(appDir, 'page.tsx'), '');
|
|
1713
|
+
fsModule.mkdirSync(pathModule.join(appDir, 'feedback', '[id]', 'edit'), {
|
|
1714
|
+
recursive: true,
|
|
1715
|
+
});
|
|
1716
|
+
fsModule.mkdirSync(pathModule.join(appDir, 'feedback', 'new'), {
|
|
1717
|
+
recursive: true,
|
|
1718
|
+
});
|
|
1719
|
+
fsModule.writeFileSync(pathModule.join(appDir, 'feedback', '[id]', 'page.tsx'), '');
|
|
1720
|
+
fsModule.writeFileSync(pathModule.join(appDir, 'feedback', '[id]', 'edit', 'page.tsx'), '');
|
|
1721
|
+
fsModule.writeFileSync(pathModule.join(appDir, 'feedback', 'new', 'page.tsx'), '');
|
|
1722
|
+
const result = scanPageFilePaths(tempDir);
|
|
1723
|
+
// Map picks one canonical file per page name
|
|
1724
|
+
expect(result.map['Home']).toBe('app/page.tsx');
|
|
1725
|
+
expect(result.map['Feedback']).toBeDefined();
|
|
1726
|
+
// allFiles includes ALL page files, even those that collided on page name
|
|
1727
|
+
expect(result.allFiles.sort()).toEqual([
|
|
1728
|
+
'app/feedback/[id]/edit/page.tsx',
|
|
1729
|
+
'app/feedback/[id]/page.tsx',
|
|
1730
|
+
'app/feedback/new/page.tsx',
|
|
1731
|
+
'app/page.tsx',
|
|
1732
|
+
]);
|
|
1675
1733
|
});
|
|
1676
1734
|
});
|
|
1677
1735
|
// ── detectFirstFeature ─────────────────────────────────────────────────
|
|
@@ -1738,5 +1796,326 @@ describe('entityChangeStatus', () => {
|
|
|
1738
1796
|
expect(readFeatureStartedAt(tempDir)).toBeNull();
|
|
1739
1797
|
});
|
|
1740
1798
|
});
|
|
1799
|
+
// ── readEditorStep ──────────────────────────────────────────────────────
|
|
1800
|
+
describe('readEditorStep', () => {
|
|
1801
|
+
let tempDir;
|
|
1802
|
+
beforeEach(() => {
|
|
1803
|
+
tempDir = fsModule.mkdtempSync(pathModule.join(os.tmpdir(), 'editorstep-test-'));
|
|
1804
|
+
fsModule.mkdirSync(pathModule.join(tempDir, '.codeyam'), {
|
|
1805
|
+
recursive: true,
|
|
1806
|
+
});
|
|
1807
|
+
});
|
|
1808
|
+
afterEach(() => {
|
|
1809
|
+
fsModule.rmSync(tempDir, { recursive: true, force: true });
|
|
1810
|
+
});
|
|
1811
|
+
it('should return step and label from editor-step.json', () => {
|
|
1812
|
+
fsModule.writeFileSync(pathModule.join(tempDir, '.codeyam', 'editor-step.json'), JSON.stringify({ step: 3, label: 'Confirm', feature: 'Add login' }));
|
|
1813
|
+
expect(readEditorStep(tempDir)).toEqual({ step: 3, label: 'Confirm' });
|
|
1814
|
+
});
|
|
1815
|
+
it('should return null when file does not exist', () => {
|
|
1816
|
+
expect(readEditorStep(tempDir)).toBeNull();
|
|
1817
|
+
});
|
|
1818
|
+
it('should return null when step field is missing', () => {
|
|
1819
|
+
fsModule.writeFileSync(pathModule.join(tempDir, '.codeyam', 'editor-step.json'), JSON.stringify({ feature: 'Add login' }));
|
|
1820
|
+
expect(readEditorStep(tempDir)).toBeNull();
|
|
1821
|
+
});
|
|
1822
|
+
it('should return null for invalid JSON', () => {
|
|
1823
|
+
fsModule.writeFileSync(pathModule.join(tempDir, '.codeyam', 'editor-step.json'), 'not json');
|
|
1824
|
+
expect(readEditorStep(tempDir)).toBeNull();
|
|
1825
|
+
});
|
|
1826
|
+
});
|
|
1827
|
+
// ── readEditorSessionId ─────────────────────────────────────────────────
|
|
1828
|
+
describe('readEditorSessionId', () => {
|
|
1829
|
+
let tempDir;
|
|
1830
|
+
beforeEach(() => {
|
|
1831
|
+
tempDir = fsModule.mkdtempSync(pathModule.join(os.tmpdir(), 'sessionid-test-'));
|
|
1832
|
+
fsModule.mkdirSync(pathModule.join(tempDir, '.codeyam'), {
|
|
1833
|
+
recursive: true,
|
|
1834
|
+
});
|
|
1835
|
+
});
|
|
1836
|
+
afterEach(() => {
|
|
1837
|
+
fsModule.rmSync(tempDir, { recursive: true, force: true });
|
|
1838
|
+
});
|
|
1839
|
+
it('should return session ID from claude-session-id.txt', () => {
|
|
1840
|
+
const uuid = '550e8400-e29b-41d4-a716-446655440000';
|
|
1841
|
+
fsModule.writeFileSync(pathModule.join(tempDir, '.codeyam', 'claude-session-id.txt'), uuid);
|
|
1842
|
+
expect(readEditorSessionId(tempDir)).toBe(uuid);
|
|
1843
|
+
});
|
|
1844
|
+
it('should trim whitespace from session ID', () => {
|
|
1845
|
+
fsModule.writeFileSync(pathModule.join(tempDir, '.codeyam', 'claude-session-id.txt'), ' abc-123 \n');
|
|
1846
|
+
expect(readEditorSessionId(tempDir)).toBe('abc-123');
|
|
1847
|
+
});
|
|
1848
|
+
it('should return null when file does not exist', () => {
|
|
1849
|
+
expect(readEditorSessionId(tempDir)).toBeNull();
|
|
1850
|
+
});
|
|
1851
|
+
it('should return null when file is empty', () => {
|
|
1852
|
+
fsModule.writeFileSync(pathModule.join(tempDir, '.codeyam', 'claude-session-id.txt'), '');
|
|
1853
|
+
expect(readEditorSessionId(tempDir)).toBeNull();
|
|
1854
|
+
});
|
|
1855
|
+
});
|
|
1856
|
+
describe('isIsolationUrl', () => {
|
|
1857
|
+
it('should return true for /isolated-components/ URLs', () => {
|
|
1858
|
+
expect(isIsolationUrl('/isolated-components/Foo')).toBe(true);
|
|
1859
|
+
expect(isIsolationUrl('/isolated-components/Foo?s=Default')).toBe(true);
|
|
1860
|
+
});
|
|
1861
|
+
it('should return true for /codeyam-isolate/ URLs', () => {
|
|
1862
|
+
expect(isIsolationUrl('/codeyam-isolate/Foo')).toBe(true);
|
|
1863
|
+
expect(isIsolationUrl('/codeyam-isolate/Foo?s=Default')).toBe(true);
|
|
1864
|
+
});
|
|
1865
|
+
it('should return false for regular page URLs', () => {
|
|
1866
|
+
expect(isIsolationUrl('/library')).toBe(false);
|
|
1867
|
+
expect(isIsolationUrl('/drinks/1')).toBe(false);
|
|
1868
|
+
expect(isIsolationUrl('/')).toBe(false);
|
|
1869
|
+
});
|
|
1870
|
+
it('should return false for null/undefined', () => {
|
|
1871
|
+
expect(isIsolationUrl(null)).toBe(false);
|
|
1872
|
+
expect(isIsolationUrl(undefined)).toBe(false);
|
|
1873
|
+
});
|
|
1874
|
+
});
|
|
1875
|
+
// ── buildReverseDependencyGraph: filePath-based importer resolution ────
|
|
1876
|
+
describe('buildReverseDependencyGraph — filePath-based resolution', () => {
|
|
1877
|
+
it('should resolve importer via filePath when DB name differs from display name', () => {
|
|
1878
|
+
// In Margo Reader: ArticleTable's importedBy lists "LibraryPage" as importer name
|
|
1879
|
+
// under filePath "app/library/page.tsx". But the entity list has name "Library"
|
|
1880
|
+
// with filePath "app/library/page.tsx". The reverse graph should map
|
|
1881
|
+
// ArticleTable → {"Library"} (not "LibraryPage").
|
|
1882
|
+
const entities = [
|
|
1883
|
+
{
|
|
1884
|
+
name: 'ArticleTable',
|
|
1885
|
+
filePath: 'app/components/ArticleTable.tsx',
|
|
1886
|
+
importedBy: {
|
|
1887
|
+
'app/library/page.tsx': {
|
|
1888
|
+
LibraryPage: { shas: ['sha1'] },
|
|
1889
|
+
},
|
|
1890
|
+
},
|
|
1891
|
+
},
|
|
1892
|
+
{
|
|
1893
|
+
name: 'Library',
|
|
1894
|
+
filePath: 'app/library/page.tsx',
|
|
1895
|
+
},
|
|
1896
|
+
];
|
|
1897
|
+
const graph = buildReverseDependencyGraph(entities);
|
|
1898
|
+
expect(graph.get('ArticleTable')).toEqual(new Set(['Library']));
|
|
1899
|
+
});
|
|
1900
|
+
it('should fall back to DB importer name when filePath has no matching entity', () => {
|
|
1901
|
+
// When the importer filePath doesn't match any entity in the list,
|
|
1902
|
+
// fall back to the DB's importer name.
|
|
1903
|
+
const entities = [
|
|
1904
|
+
{
|
|
1905
|
+
name: 'Button',
|
|
1906
|
+
filePath: 'components/Button.tsx',
|
|
1907
|
+
importedBy: {
|
|
1908
|
+
'components/UnknownPage.tsx': {
|
|
1909
|
+
SomeComponent: { shas: ['sha1'] },
|
|
1910
|
+
},
|
|
1911
|
+
},
|
|
1912
|
+
},
|
|
1913
|
+
];
|
|
1914
|
+
const graph = buildReverseDependencyGraph(entities);
|
|
1915
|
+
expect(graph.get('Button')).toEqual(new Set(['SomeComponent']));
|
|
1916
|
+
});
|
|
1917
|
+
it('should resolve multiple importers via filePath correctly', () => {
|
|
1918
|
+
const entities = [
|
|
1919
|
+
{
|
|
1920
|
+
name: 'ArticleTableRow',
|
|
1921
|
+
filePath: 'app/components/ArticleTableRow.tsx',
|
|
1922
|
+
importedBy: {
|
|
1923
|
+
'app/components/ArticleTable.tsx': {
|
|
1924
|
+
ArticleTable: { shas: ['sha1'] },
|
|
1925
|
+
},
|
|
1926
|
+
'app/library/page.tsx': {
|
|
1927
|
+
LibraryPage: { shas: ['sha2'] },
|
|
1928
|
+
},
|
|
1929
|
+
},
|
|
1930
|
+
},
|
|
1931
|
+
{
|
|
1932
|
+
name: 'ArticleTable',
|
|
1933
|
+
filePath: 'app/components/ArticleTable.tsx',
|
|
1934
|
+
},
|
|
1935
|
+
{
|
|
1936
|
+
name: 'Library',
|
|
1937
|
+
filePath: 'app/library/page.tsx',
|
|
1938
|
+
},
|
|
1939
|
+
];
|
|
1940
|
+
const graph = buildReverseDependencyGraph(entities);
|
|
1941
|
+
expect(graph.get('ArticleTableRow')).toEqual(new Set(['ArticleTable', 'Library']));
|
|
1942
|
+
});
|
|
1943
|
+
});
|
|
1944
|
+
// ── buildEntityInfosFromScenarios: filePath-based metadata matching ────
|
|
1945
|
+
describe('buildEntityInfosFromScenarios — filePath-based metadata matching', () => {
|
|
1946
|
+
it('should attach importedBy metadata when entity names differ but filePaths match', () => {
|
|
1947
|
+
// Page scenario with displayName "Library" but DB entity named "LibraryPage"
|
|
1948
|
+
// with filePath "app/library/page.tsx". The metadata lookup should match by
|
|
1949
|
+
// filePath and attach importedBy.
|
|
1950
|
+
const scenarios = [
|
|
1951
|
+
{
|
|
1952
|
+
componentName: null,
|
|
1953
|
+
componentPath: null,
|
|
1954
|
+
pageFilePath: 'app/library/page.tsx',
|
|
1955
|
+
url: '/library',
|
|
1956
|
+
displayName: 'Library',
|
|
1957
|
+
},
|
|
1958
|
+
];
|
|
1959
|
+
const entitiesWithMetadata = [
|
|
1960
|
+
{
|
|
1961
|
+
name: 'LibraryPage',
|
|
1962
|
+
filePath: 'app/library/page.tsx',
|
|
1963
|
+
metadata: {
|
|
1964
|
+
importedBy: {
|
|
1965
|
+
'app/layout.tsx': {
|
|
1966
|
+
RootLayout: { shas: ['sha1'] },
|
|
1967
|
+
},
|
|
1968
|
+
},
|
|
1969
|
+
},
|
|
1970
|
+
},
|
|
1971
|
+
];
|
|
1972
|
+
const result = buildEntityInfosFromScenarios(scenarios, {}, entitiesWithMetadata);
|
|
1973
|
+
expect(result).toHaveLength(1);
|
|
1974
|
+
expect(result[0].name).toBe('Library');
|
|
1975
|
+
expect(result[0].importedBy).toEqual({
|
|
1976
|
+
'app/layout.tsx': {
|
|
1977
|
+
RootLayout: { shas: ['sha1'] },
|
|
1978
|
+
},
|
|
1979
|
+
});
|
|
1980
|
+
});
|
|
1981
|
+
it('should prefer name match over filePath match in multi-entity files', () => {
|
|
1982
|
+
// Bug: app/components/ArticleTable.tsx exports both Props (rowid 33) and
|
|
1983
|
+
// ArticleTable (rowid 34). find() with OR condition matches Props first
|
|
1984
|
+
// via filePath, so ArticleTable gets Props' importedBy (missing the
|
|
1985
|
+
// critical ArticleTable → LibraryPage edge). Fix: try name match first.
|
|
1986
|
+
const scenarios = [
|
|
1987
|
+
{
|
|
1988
|
+
componentName: 'ArticleTable',
|
|
1989
|
+
componentPath: 'app/components/ArticleTable.tsx',
|
|
1990
|
+
},
|
|
1991
|
+
];
|
|
1992
|
+
const entitiesWithMetadata = [
|
|
1993
|
+
{
|
|
1994
|
+
name: 'Props',
|
|
1995
|
+
filePath: 'app/components/ArticleTable.tsx',
|
|
1996
|
+
metadata: {
|
|
1997
|
+
importedBy: {
|
|
1998
|
+
'app/components/ArticleTable.tsx': {
|
|
1999
|
+
ArticleTable: { shas: ['sha-internal'] },
|
|
2000
|
+
},
|
|
2001
|
+
},
|
|
2002
|
+
},
|
|
2003
|
+
},
|
|
2004
|
+
{
|
|
2005
|
+
name: 'ArticleTable',
|
|
2006
|
+
filePath: 'app/components/ArticleTable.tsx',
|
|
2007
|
+
metadata: {
|
|
2008
|
+
importedBy: {
|
|
2009
|
+
'app/library/page.tsx': {
|
|
2010
|
+
LibraryPage: { shas: ['sha1'] },
|
|
2011
|
+
},
|
|
2012
|
+
},
|
|
2013
|
+
},
|
|
2014
|
+
},
|
|
2015
|
+
];
|
|
2016
|
+
const result = buildEntityInfosFromScenarios(scenarios, {}, entitiesWithMetadata);
|
|
2017
|
+
expect(result).toHaveLength(1);
|
|
2018
|
+
expect(result[0].name).toBe('ArticleTable');
|
|
2019
|
+
// Must get ArticleTable's importedBy (LibraryPage), NOT Props' importedBy
|
|
2020
|
+
expect(result[0].importedBy).toEqual({
|
|
2021
|
+
'app/library/page.tsx': {
|
|
2022
|
+
LibraryPage: { shas: ['sha1'] },
|
|
2023
|
+
},
|
|
2024
|
+
});
|
|
2025
|
+
});
|
|
2026
|
+
it('should still match by name when names are identical', () => {
|
|
2027
|
+
const scenarios = [
|
|
2028
|
+
{
|
|
2029
|
+
componentName: 'ArticleTable',
|
|
2030
|
+
componentPath: 'app/components/ArticleTable.tsx',
|
|
2031
|
+
},
|
|
2032
|
+
];
|
|
2033
|
+
const entitiesWithMetadata = [
|
|
2034
|
+
{
|
|
2035
|
+
name: 'ArticleTable',
|
|
2036
|
+
filePath: 'app/components/ArticleTable.tsx',
|
|
2037
|
+
metadata: {
|
|
2038
|
+
importedBy: {
|
|
2039
|
+
'app/library/page.tsx': {
|
|
2040
|
+
LibraryPage: { shas: ['sha1'] },
|
|
2041
|
+
},
|
|
2042
|
+
},
|
|
2043
|
+
},
|
|
2044
|
+
},
|
|
2045
|
+
];
|
|
2046
|
+
const result = buildEntityInfosFromScenarios(scenarios, {}, entitiesWithMetadata);
|
|
2047
|
+
expect(result[0].importedBy).toBeDefined();
|
|
2048
|
+
});
|
|
2049
|
+
});
|
|
2050
|
+
// ── End-to-end: filePath resolution enables impact propagation ────
|
|
2051
|
+
describe('end-to-end: filePath resolution enables page impact detection', () => {
|
|
2052
|
+
it('should detect Library page as impacted when ArticleTable is edited', () => {
|
|
2053
|
+
// This is the Margo Reader bug: ArticleTable is edited, Library page
|
|
2054
|
+
// should be detected as impacted because ArticleTable's importedBy
|
|
2055
|
+
// metadata shows it's imported by "app/library/page.tsx" → "Library".
|
|
2056
|
+
const changedFiles = new Map([
|
|
2057
|
+
['app/components/ArticleTable.tsx', 'edited'],
|
|
2058
|
+
]);
|
|
2059
|
+
const entities = [
|
|
2060
|
+
{
|
|
2061
|
+
name: 'ArticleTable',
|
|
2062
|
+
filePath: 'app/components/ArticleTable.tsx',
|
|
2063
|
+
importedBy: {
|
|
2064
|
+
'app/library/page.tsx': {
|
|
2065
|
+
LibraryPage: { shas: ['sha1'] },
|
|
2066
|
+
},
|
|
2067
|
+
},
|
|
2068
|
+
},
|
|
2069
|
+
{
|
|
2070
|
+
name: 'Library',
|
|
2071
|
+
filePath: 'app/library/page.tsx',
|
|
2072
|
+
},
|
|
2073
|
+
];
|
|
2074
|
+
const result = computeEntityChangeStatus(changedFiles, entities);
|
|
2075
|
+
expect(result['ArticleTable']).toEqual({ status: 'edited' });
|
|
2076
|
+
expect(result['Library']).toEqual({
|
|
2077
|
+
status: 'impacted',
|
|
2078
|
+
impactedBy: [
|
|
2079
|
+
{
|
|
2080
|
+
name: 'ArticleTable',
|
|
2081
|
+
filePath: 'app/components/ArticleTable.tsx',
|
|
2082
|
+
changeType: 'edited',
|
|
2083
|
+
},
|
|
2084
|
+
],
|
|
2085
|
+
});
|
|
2086
|
+
});
|
|
2087
|
+
});
|
|
2088
|
+
// ── readSavedActiveScenarioId ─────────────────────────────────────────
|
|
2089
|
+
describe('readSavedActiveScenarioId', () => {
|
|
2090
|
+
let tempDir;
|
|
2091
|
+
beforeEach(() => {
|
|
2092
|
+
tempDir = fsModule.mkdtempSync(pathModule.join(os.tmpdir(), 'activescenario-test-'));
|
|
2093
|
+
fsModule.mkdirSync(pathModule.join(tempDir, '.codeyam'), {
|
|
2094
|
+
recursive: true,
|
|
2095
|
+
});
|
|
2096
|
+
});
|
|
2097
|
+
afterEach(() => {
|
|
2098
|
+
fsModule.rmSync(tempDir, { recursive: true, force: true });
|
|
2099
|
+
});
|
|
2100
|
+
it('should return scenarioId from valid active-scenario.json', () => {
|
|
2101
|
+
fsModule.writeFileSync(pathModule.join(tempDir, '.codeyam', 'active-scenario.json'), JSON.stringify({
|
|
2102
|
+
scenarioSlug: 'my-scenario',
|
|
2103
|
+
scenarioId: 'abc-123',
|
|
2104
|
+
type: 'application',
|
|
2105
|
+
}));
|
|
2106
|
+
expect(readSavedActiveScenarioId(tempDir)).toBe('abc-123');
|
|
2107
|
+
});
|
|
2108
|
+
it('should return null when file does not exist', () => {
|
|
2109
|
+
expect(readSavedActiveScenarioId(tempDir)).toBeNull();
|
|
2110
|
+
});
|
|
2111
|
+
it('should return null when scenarioId field is missing', () => {
|
|
2112
|
+
fsModule.writeFileSync(pathModule.join(tempDir, '.codeyam', 'active-scenario.json'), JSON.stringify({ scenarioSlug: 'my-scenario', type: 'application' }));
|
|
2113
|
+
expect(readSavedActiveScenarioId(tempDir)).toBeNull();
|
|
2114
|
+
});
|
|
2115
|
+
it('should return null for malformed JSON', () => {
|
|
2116
|
+
fsModule.writeFileSync(pathModule.join(tempDir, '.codeyam', 'active-scenario.json'), 'not json{{');
|
|
2117
|
+
expect(readSavedActiveScenarioId(tempDir)).toBeNull();
|
|
2118
|
+
});
|
|
2119
|
+
});
|
|
1741
2120
|
});
|
|
1742
2121
|
//# sourceMappingURL=entityChangeStatus.test.js.map
|