@codeyam/codeyam-cli 0.1.0-staging.b8b17a5 → 0.1.0-staging.b8ee127
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 +7 -7
- package/analyzer-template/log.txt +3 -3
- package/analyzer-template/package.json +4 -4
- 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 +6 -6
- package/analyzer-template/packages/database/package.json +2 -2
- 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/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 +15 -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.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 +9 -9
- package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js +38 -3
- package/codeyam-cli/src/commands/__tests__/init.gitignore.test.js.map +1 -1
- package/codeyam-cli/src/commands/editor.js +2207 -467
- 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/init.js +20 -0
- package/codeyam-cli/src/commands/init.js.map +1 -1
- 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__/editorApi.test.js +44 -0
- package/codeyam-cli/src/utils/__tests__/editorApi.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +2232 -52
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -1
- 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__/editorEntityHelpers.test.js +66 -0
- package/codeyam-cli/src/utils/__tests__/editorEntityHelpers.test.js.map +1 -1
- 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__/editorPreview.test.js +11 -3
- 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 +398 -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 +249 -1
- package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js +134 -1
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js +266 -2
- package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js.map +1 -1
- 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__/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__/registerScenarioResult.test.js +127 -0
- package/codeyam-cli/src/utils/__tests__/registerScenarioResult.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 +180 -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__/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 +36 -7
- 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/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/editorApi.js +16 -0
- package/codeyam-cli/src/utils/editorApi.js.map +1 -1
- package/codeyam-cli/src/utils/editorAudit.js +504 -43
- package/codeyam-cli/src/utils/editorAudit.js.map +1 -1
- package/codeyam-cli/src/utils/editorGuard.js +36 -0
- package/codeyam-cli/src/utils/editorGuard.js.map +1 -0
- package/codeyam-cli/src/utils/editorPreview.js +5 -3
- 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 +301 -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 +141 -7
- package/codeyam-cli/src/utils/editorScenarios.js.map +1 -1
- package/codeyam-cli/src/utils/editorSeedAdapter.js +69 -16
- package/codeyam-cli/src/utils/editorSeedAdapter.js.map +1 -1
- package/codeyam-cli/src/utils/entityChangeStatus.js +31 -3
- package/codeyam-cli/src/utils/entityChangeStatus.js.map +1 -1
- package/codeyam-cli/src/utils/entityChangeStatus.server.js +31 -0
- package/codeyam-cli/src/utils/entityChangeStatus.server.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/install-skills.js +32 -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/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/scenarioCoverage.js +4 -1
- package/codeyam-cli/src/utils/scenarioCoverage.js.map +1 -1
- package/codeyam-cli/src/utils/scenariosManifest.js +66 -2
- 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/simulationGateMiddleware.js +9 -0
- package/codeyam-cli/src/utils/simulationGateMiddleware.js.map +1 -1
- 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__/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 +145 -11
- package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js.map +1 -1
- package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js +190 -21
- package/codeyam-cli/src/webserver/__tests__/idleDetector.test.js.map +1 -1
- 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/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/backgroundServer.js +42 -57
- package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{CopyButton-CzTDWkF2.js → CopyButton-DTBZZfSk.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-BFbq6iFk.js → EntityItem-BxclONWq.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-B6OMi58N.js → EntityTypeIcon-BsnEOJZ_.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{InlineSpinner-DuYodzo1.js → InlineSpinner-ByaELMbv.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-CXo9EeCl.js → InteractivePreview-6WjVfhxX.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-DYCNb2It.js → LibraryFunctionPreview-ChX-Hp7W.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-CZgY3sxX.js → LogViewer-C-9zQdXg.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/MiniClaudeChat-BusrvT2F.js +36 -0
- package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-CnYYwRDw.js → ReportIssueModal-DQsceHVv.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-CDoF7ZpU.js → SafeScreenshot-DThcm_9M.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-DrnfvaLL.js → ScenarioViewer-Cl4oOA3A.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/Spinner-CIil5-gb.js +34 -0
- package/codeyam-cli/src/webserver/build/client/assets/{ViewportInspectBar-DRKR9T0U.js → ViewportInspectBar-BqkA9zyZ.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{_index-ClR-g3tY.js → _index-DnOgyseQ.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-DTH6ydEA.js → activity.(_tab)-DqM9hbNE.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{addon-web-links-74hnHF59.js → addon-web-links-C58dYPwR.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{agent-transcripts-B8CYhCO9.js → agent-transcripts-B8NCeOrm.js} +1 -1
- 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-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-schema-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-CLaoh4ac.js → book-open-BFSIqZgO.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-BZ2DZxbW.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-CT4unAk-.js → circle-check-DLPObLUx.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{copy-zK0B6Nu-.js → copy-DXEmO0TD.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-DJB0YQJL.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-CkXFP_i-.js → dev.empty-iRhRIFlp.js} +1 -1
- 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)-CsYVRiNH.js +147 -0
- package/codeyam-cli/src/webserver/build/client/assets/editorPreview-C6fEYHrh.js +41 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-BqAN7hyG.js → entity._sha._-Ce1s4OQ1.js} +13 -12
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.dev-D1eikpe1.js → entity._sha.scenarios._scenarioId.dev-C8AyYgYT.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.fullscreen-Dg1NhIms.js → entity._sha.scenarios._scenarioId.fullscreen-DziaVQX1.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-CJX6kkkV.js → entity._sha_.create-scenario-BTcpgIpC.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-BhVjZhKg.js → entity._sha_.edit._scenarioId-D_O_ajfZ.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entry.client-_gzKltPN.js → entry.client-j1Vi0bco.js} +6 -6
- package/codeyam-cli/src/webserver/build/client/assets/{files-CV_17tZS.js → files-kuny2Q_s.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{git-D-YXmMbR.js → git-DgCZPMie.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/globals-Gp2o-NMc.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{index-CCrgCshv.js → index-BliGSSpl.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{index-Blo6EK8G.js → index-SqjQKTdH.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{index-BsX0F-9C.js → index-vyrZD2g4.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{labs-Byazq8Pv.js → labs-c3yLxSEp.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-DVQ0oHR7.js → loader-circle-D-q28GLF.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-ef0f624d.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{memory-b-VmA2Vj.js → memory-CEWIUC4t.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{pause-DGcndCAa.js → pause-BP6fitdh.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-Didv9PLi.js +80 -0
- package/codeyam-cli/src/webserver/build/client/assets/{search-C0Uw0bcK.js → search-BooqacKS.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{settings-OoNgHIfW.js → settings-BM0nbryO.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{simulations-Bcemfu8a.js → simulations-ovy6FjRY.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{terminal-BgMmG7R9.js → terminal-DHemCJIs.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-Cs87hJYK.js → triangle-alert-D87ekDl8.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useCustomSizes-BR3Rs7JY.js → useCustomSizes-Dk0Tciqg.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-C8QvIe05.js +2 -0
- package/codeyam-cli/src/webserver/build/client/assets/{useReportContext-BermyNU5.js → useReportContext-jkCytuYz.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useToast-a_QN_W9_.js → useToast-BgqkixU9.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/analysisRunner-BKMsxwqe.js +16 -0
- package/codeyam-cli/src/webserver/build/server/assets/{index-CHymws6l.js → index-CvuvIPEn.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/init-B3gVLAAJ.js +14 -0
- package/codeyam-cli/src/webserver/build/server/assets/server-build-B4LxStYP.js +741 -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 +132 -7
- package/codeyam-cli/src/webserver/editorProxy.js.map +1 -1
- package/codeyam-cli/src/webserver/idleDetector.js +65 -8
- package/codeyam-cli/src/webserver/idleDetector.js.map +1 -1
- package/codeyam-cli/src/webserver/scripts/journalCapture.ts +53 -0
- package/codeyam-cli/src/webserver/server.js +119 -14
- package/codeyam-cli/src/webserver/server.js.map +1 -1
- package/codeyam-cli/src/webserver/terminalServer.js +174 -32
- 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 +2 -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 +93 -46
- 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/seed-adapter.ts +47 -34
- package/codeyam-cli/templates/seed-adapters/supabase.ts +133 -52
- package/codeyam-cli/templates/skills/codeyam-editor/SKILL.md +34 -1
- package/package.json +1 -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/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/Spinner-Df3UCi8k.js +0 -34
- package/codeyam-cli/src/webserver/build/client/assets/chunk-JZWAC4HX-BBXArFPl.js +0 -43
- package/codeyam-cli/src/webserver/build/client/assets/cy-logo-cli-DcX-ZS3p.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/editor._tab-DPw7NZHc.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/editor.entity.(_sha)-DYqG1D_d.js +0 -58
- package/codeyam-cli/src/webserver/build/client/assets/editorPreview-DggyRwOr.js +0 -41
- package/codeyam-cli/src/webserver/build/client/assets/globals-DRvOjyO3.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-f4212c17.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-F-k2uYj5.js +0 -67
- package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-BxxP_XF9.js +0 -2
- package/codeyam-cli/src/webserver/build/server/assets/analysisRunner-if8kM_1Q.js +0 -13
- package/codeyam-cli/src/webserver/build/server/assets/init-D3HkMDbI.js +0 -10
- package/codeyam-cli/src/webserver/build/server/assets/server-build-DTCzJQiH.js +0 -551
- 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
|
@@ -7,32 +7,48 @@
|
|
|
7
7
|
"setup": "npm install",
|
|
8
8
|
"dev": "expo start --web",
|
|
9
9
|
"start": "expo start",
|
|
10
|
-
"android": "expo
|
|
11
|
-
"ios": "expo
|
|
12
|
-
"build:web": "expo export --platform web"
|
|
10
|
+
"android": "expo run:android",
|
|
11
|
+
"ios": "expo run:ios",
|
|
12
|
+
"build:web": "expo export --platform web",
|
|
13
|
+
"test": "jest",
|
|
14
|
+
"postinstall": "patch-package"
|
|
13
15
|
},
|
|
14
16
|
"dependencies": {
|
|
15
|
-
"expo": "~
|
|
16
|
-
"expo-router": "~
|
|
17
|
-
"expo-status-bar": "~
|
|
18
|
-
"expo-linking": "~
|
|
19
|
-
"expo-constants": "~
|
|
20
|
-
"
|
|
21
|
-
"react
|
|
22
|
-
"react-
|
|
17
|
+
"expo": "~54.0.0",
|
|
18
|
+
"expo-router": "~6.0.23",
|
|
19
|
+
"expo-status-bar": "~3.0.9",
|
|
20
|
+
"expo-linking": "~8.0.11",
|
|
21
|
+
"expo-constants": "~18.0.13",
|
|
22
|
+
"expo-font": "~14.0.11",
|
|
23
|
+
"react": "19.1.0",
|
|
24
|
+
"react-dom": "19.1.0",
|
|
25
|
+
"react-native": "0.81.5",
|
|
23
26
|
"react-native-web": "^0.21.0",
|
|
24
27
|
"react-native-safe-area-context": "~5.6.2",
|
|
25
|
-
"react-native-screens": "~4.
|
|
28
|
+
"react-native-screens": "~4.16.0",
|
|
29
|
+
"react-native-reanimated": "^4.3.0",
|
|
30
|
+
"react-native-worklets": "^0.8.1",
|
|
31
|
+
"react-refresh": "^0.18.0",
|
|
26
32
|
"@react-navigation/native": "^7.1.33",
|
|
27
33
|
"@expo/vector-icons": "^15.0.2",
|
|
28
34
|
"@react-native-async-storage/async-storage": "2.2.0",
|
|
29
35
|
"nativewind": "^4.2.2",
|
|
30
36
|
"tailwindcss": "^3.4.19",
|
|
31
|
-
"
|
|
37
|
+
"patch-package": "^8.0.0"
|
|
32
38
|
},
|
|
33
39
|
"devDependencies": {
|
|
34
|
-
"@types/react": "~19.
|
|
35
|
-
"babel-preset-expo": "
|
|
36
|
-
"
|
|
40
|
+
"@types/react": "~19.1.10",
|
|
41
|
+
"babel-preset-expo": "~54.0.10",
|
|
42
|
+
"sharp": "^0.33.0",
|
|
43
|
+
"typescript": "~5.9.2",
|
|
44
|
+
"jest": "^29.7.0",
|
|
45
|
+
"jest-expo": "~54.0.17",
|
|
46
|
+
"@testing-library/react-native": "^13.2.0"
|
|
47
|
+
},
|
|
48
|
+
"jest": {
|
|
49
|
+
"preset": "jest-expo",
|
|
50
|
+
"transformIgnorePatterns": [
|
|
51
|
+
"node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|nativewind|react-native-reanimated|react-native-worklets)"
|
|
52
|
+
]
|
|
37
53
|
}
|
|
38
54
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
diff --git a/node_modules/expo-modules-autolinking/build/platforms/apple/apple.js b/node_modules/expo-modules-autolinking/build/platforms/apple/apple.js
|
|
2
|
+
index 47487c0..58a6069 100644
|
|
3
|
+
--- a/node_modules/expo-modules-autolinking/build/platforms/apple/apple.js
|
|
4
|
+
+++ b/node_modules/expo-modules-autolinking/build/platforms/apple/apple.js
|
|
5
|
+
@@ -113,7 +113,7 @@ async function generatePackageListFileContentAsync(modules, className, entitleme
|
|
6
|
+
* but only these that are written in Swift and use the new API for creating Expo modules.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
-import ExpoModulesCore
|
|
10
|
+
+public import ExpoModulesCore
|
|
11
|
+
${generateCommonImportList(swiftModules)}
|
|
12
|
+
${generateDebugOnlyImportList(debugOnlySwiftModules)}
|
|
13
|
+
@objc(${className})
|
|
14
|
+
@@ -137,13 +137,13 @@ ${generateReactDelegateHandlers(reactDelegateHandlerModules, debugOnlyReactDeleg
|
|
15
|
+
`;
|
|
16
|
+
}
|
|
17
|
+
function generateCommonImportList(swiftModules) {
|
|
18
|
+
- return swiftModules.map((moduleName) => `import ${moduleName}`).join('\n');
|
|
19
|
+
+ return swiftModules.map((moduleName) => `public import ${moduleName}`).join('\n');
|
|
20
|
+
}
|
|
21
|
+
function generateDebugOnlyImportList(swiftModules) {
|
|
22
|
+
if (!swiftModules.length) {
|
|
23
|
+
return '';
|
|
24
|
+
}
|
|
25
|
+
- return (wrapInDebugConfigurationCheck(0, swiftModules.map((moduleName) => `import ${moduleName}`).join('\n')) + '\n');
|
|
26
|
+
+ return (wrapInDebugConfigurationCheck(0, swiftModules.map((moduleName) => `public import ${moduleName}`).join('\n')) + '\n');
|
|
27
|
+
}
|
|
28
|
+
function generateModuleClasses(classNames, debugOnlyClassName) {
|
|
29
|
+
const commonClassNames = formatArrayOfClassNames(classNames);
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CodeYam Isolation Route — Expo Router
|
|
3
|
+
*
|
|
4
|
+
* Place this file at: app/isolated-components/ComponentName.tsx
|
|
5
|
+
* URL: /isolated-components/ComponentName?s=ScenarioName
|
|
6
|
+
*
|
|
7
|
+
* This route renders a single component with scenario-specific props,
|
|
8
|
+
* enabling isolated component preview and screenshot capture.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { useLocalSearchParams } from 'expo-router';
|
|
12
|
+
import { View, Text } from 'react-native';
|
|
13
|
+
import { theme } from '@/lib/theme';
|
|
14
|
+
// import YourComponent from '@/app/components/YourComponent';
|
|
15
|
+
|
|
16
|
+
// Define scenarios: map scenario names to component props
|
|
17
|
+
const scenarios: Record<string, Record<string, unknown>> = {
|
|
18
|
+
Default: {
|
|
19
|
+
// props for the default scenario
|
|
20
|
+
},
|
|
21
|
+
// Add more scenarios here
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default function ComponentIsolation() {
|
|
25
|
+
const { s } = useLocalSearchParams<{ s: string }>();
|
|
26
|
+
const scenarioName = s || 'Default';
|
|
27
|
+
const props = scenarios[scenarioName];
|
|
28
|
+
|
|
29
|
+
if (!props) {
|
|
30
|
+
return (
|
|
31
|
+
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
|
32
|
+
<Text style={{ fontFamily: theme.fontFamily.mono, color: '#e74c3c' }}>
|
|
33
|
+
Unknown scenario: {scenarioName}
|
|
34
|
+
</Text>
|
|
35
|
+
</View>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<View
|
|
41
|
+
style={{
|
|
42
|
+
flex: 1,
|
|
43
|
+
justifyContent: 'center',
|
|
44
|
+
alignItems: 'center',
|
|
45
|
+
backgroundColor: theme.colors.bgBase,
|
|
46
|
+
}}
|
|
47
|
+
>
|
|
48
|
+
<View nativeID="codeyam-capture" style={{ maxWidth: 384 }}>
|
|
49
|
+
{/* <YourComponent {...props} /> */}
|
|
50
|
+
<Text>Replace with your component</Text>
|
|
51
|
+
</View>
|
|
52
|
+
</View>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
@@ -37,49 +37,62 @@ async function main() {
|
|
|
37
37
|
const data = JSON.parse(raw);
|
|
38
38
|
const seed = data.seed || data;
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
// Discover ALL models from the Prisma schema — not just the tables in the seed data.
|
|
41
|
+
// This ensures FK-dependent tables (e.g., Passenger → Flight) are cleared even when
|
|
42
|
+
// the seed only contains the parent table's data.
|
|
43
|
+
const allModels = Prisma.dmmf.datamodel.models.map(
|
|
44
|
+
(m) => m.name.charAt(0).toLowerCase() + m.name.slice(1),
|
|
45
|
+
);
|
|
41
46
|
|
|
42
|
-
//
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
// Run everything in a single transaction for atomicity and speed.
|
|
48
|
+
// SQLite auto-commits each statement by default — wrapping in a transaction
|
|
49
|
+
// avoids per-statement fsync and is significantly faster for bulk operations.
|
|
50
|
+
await prisma.$transaction(async (tx) => {
|
|
51
|
+
// Disable foreign key checks during wipe+insert — allows deleting in any
|
|
52
|
+
// order and avoids FK constraint errors during the brief window between
|
|
53
|
+
// clearing parent and child tables.
|
|
54
|
+
await tx.$executeRawUnsafe('PRAGMA foreign_keys = OFF');
|
|
55
|
+
|
|
56
|
+
// Wipe ALL tables in the schema (not just seeded ones)
|
|
57
|
+
for (const table of [...allModels].reverse()) {
|
|
58
|
+
try {
|
|
59
|
+
await (tx as any)[table].deleteMany();
|
|
60
|
+
} catch {
|
|
61
|
+
// Table may not exist in current schema — skip
|
|
62
|
+
}
|
|
52
63
|
}
|
|
53
|
-
}
|
|
54
64
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
65
|
+
// Batch-reset auto-increment counters for ALL tables.
|
|
66
|
+
// Without this, SQLite IDs keep climbing across scenario switches,
|
|
67
|
+
// causing hardcoded URLs like /drinks/1 to 404.
|
|
68
|
+
const seqNames = allModels
|
|
69
|
+
.flatMap((t) => [`'${t}'`, `'${t.charAt(0).toUpperCase() + t.slice(1)}'`])
|
|
70
|
+
.join(', ');
|
|
59
71
|
try {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
await prisma.$executeRawUnsafe(
|
|
63
|
-
`DELETE FROM sqlite_sequence WHERE name = '${table}' OR name = '${table.charAt(0).toUpperCase() + table.slice(1)}'`,
|
|
72
|
+
await tx.$executeRawUnsafe(
|
|
73
|
+
`DELETE FROM sqlite_sequence WHERE name IN (${seqNames})`,
|
|
64
74
|
);
|
|
65
75
|
} catch {
|
|
66
|
-
// sqlite_sequence may not exist
|
|
76
|
+
// sqlite_sequence may not exist — safe to ignore
|
|
67
77
|
}
|
|
68
|
-
}
|
|
69
78
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
// Insert seed data
|
|
80
|
+
for (const [table, rows] of Object.entries(seed)) {
|
|
81
|
+
if (!Array.isArray(rows) || rows.length === 0) continue;
|
|
82
|
+
try {
|
|
83
|
+
await (tx as any)[table].createMany({ data: rows });
|
|
84
|
+
console.log(` Seeded ${rows.length} rows into ${table}`);
|
|
85
|
+
} catch (err) {
|
|
86
|
+
console.error(
|
|
87
|
+
` Failed to seed ${table}: ${err instanceof Error ? err.message : err}`,
|
|
88
|
+
);
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
81
91
|
}
|
|
82
|
-
|
|
92
|
+
|
|
93
|
+
// Re-enable foreign key checks
|
|
94
|
+
await tx.$executeRawUnsafe('PRAGMA foreign_keys = ON');
|
|
95
|
+
});
|
|
83
96
|
|
|
84
97
|
console.log('Seed complete');
|
|
85
98
|
}
|
|
@@ -10,16 +10,19 @@
|
|
|
10
10
|
* "tableName": [{ "column": "value", ... }, ...],
|
|
11
11
|
* "_auth": { // optional
|
|
12
12
|
* "email": "alice@example.com",
|
|
13
|
-
* "password": "test123"
|
|
13
|
+
* "password": "test123" // optional — default used if omitted
|
|
14
14
|
* }
|
|
15
15
|
* }
|
|
16
16
|
*
|
|
17
17
|
* When _auth is present, the adapter:
|
|
18
18
|
* 1. Creates the user if they don't exist (auto-confirms email)
|
|
19
|
-
* 2.
|
|
20
|
-
* 3. Writes session cookies to .codeyam/tmp/seed-session.json
|
|
19
|
+
* 2. Builds a synthetic JWT with far-future expiry (no real sign-in needed)
|
|
20
|
+
* 3. Writes session cookies + auth mocks to .codeyam/tmp/seed-session.json
|
|
21
21
|
* so the CodeYam proxy can inject them into the browser
|
|
22
22
|
*
|
|
23
|
+
* The password field is optional — if omitted, a default dev password is used.
|
|
24
|
+
* No real JWTs are stored; the preload module intercepts all auth API calls.
|
|
25
|
+
*
|
|
23
26
|
* Requirements:
|
|
24
27
|
* - A Supabase project URL (https://<ref>.supabase.co) in any env var
|
|
25
28
|
* - A secret key (sb_secret_... or legacy eyJ... service_role JWT) in any env var
|
|
@@ -28,6 +31,7 @@
|
|
|
28
31
|
*/
|
|
29
32
|
|
|
30
33
|
import { createClient } from '@supabase/supabase-js';
|
|
34
|
+
import { Prisma } from '@prisma/client';
|
|
31
35
|
import * as fs from 'fs';
|
|
32
36
|
import * as path from 'path';
|
|
33
37
|
|
|
@@ -65,7 +69,6 @@ const supabaseUrl = findAllEnvByPattern(
|
|
|
65
69
|
|
|
66
70
|
// New-format keys are unambiguous by prefix
|
|
67
71
|
const newSecretKey = findAllEnvByPattern(/^sb_secret_/)[0];
|
|
68
|
-
const newAnonKey = findAllEnvByPattern(/^sb_publishable_/)[0];
|
|
69
72
|
|
|
70
73
|
// Legacy JWT keys — disambiguate by decoding the role claim
|
|
71
74
|
const legacyJwts = findAllEnvByPattern(
|
|
@@ -74,10 +77,8 @@ const legacyJwts = findAllEnvByPattern(
|
|
|
74
77
|
const legacyServiceRole = legacyJwts.find(
|
|
75
78
|
(jwt) => getJwtRole(jwt) === 'service_role',
|
|
76
79
|
);
|
|
77
|
-
const legacyAnon = legacyJwts.find((jwt) => getJwtRole(jwt) === 'anon');
|
|
78
80
|
|
|
79
81
|
const secretKey = newSecretKey || legacyServiceRole;
|
|
80
|
-
const anonKey = newAnonKey || legacyAnon;
|
|
81
82
|
|
|
82
83
|
if (!supabaseUrl || !secretKey) {
|
|
83
84
|
console.error(
|
|
@@ -108,14 +109,42 @@ function getProjectRef(): string {
|
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Build a mapping from lowercased seed-data keys to actual PostgreSQL table names.
|
|
114
|
+
* Prisma creates tables with the model name (PascalCase) unless @@map is used.
|
|
115
|
+
* PostgREST requires the exact table name, so we need this translation.
|
|
116
|
+
*/
|
|
117
|
+
function buildTableNameMap(): Record<string, string> {
|
|
118
|
+
const map: Record<string, string> = {};
|
|
119
|
+
for (const model of Prisma.dmmf.datamodel.models) {
|
|
120
|
+
// dbName is set when @@map is used, otherwise null → use model name
|
|
121
|
+
const dbName = (model as any).dbName || model.name;
|
|
122
|
+
// Map lowercased model name → actual table name
|
|
123
|
+
const lowered = model.name.charAt(0).toLowerCase() + model.name.slice(1);
|
|
124
|
+
map[lowered] = dbName;
|
|
125
|
+
map[model.name] = dbName; // Also map PascalCase for safety
|
|
126
|
+
}
|
|
127
|
+
return map;
|
|
128
|
+
}
|
|
129
|
+
|
|
111
130
|
async function seedTables(seed: Record<string, unknown[]>) {
|
|
112
|
-
|
|
113
|
-
|
|
131
|
+
if (Object.keys(seed).length === 0) return;
|
|
132
|
+
|
|
133
|
+
const tableMap = buildTableNameMap();
|
|
134
|
+
|
|
135
|
+
// Discover ALL models from the Prisma schema — not just the tables in the seed data.
|
|
136
|
+
// This ensures FK-dependent tables are cleared even when the seed only contains
|
|
137
|
+
// the parent table's data. Every editor project has Prisma installed.
|
|
138
|
+
const allTables = Prisma.dmmf.datamodel.models.map(
|
|
139
|
+
(m) => (m as any).dbName || m.name,
|
|
140
|
+
);
|
|
114
141
|
|
|
115
|
-
console.log(
|
|
142
|
+
console.log(
|
|
143
|
+
`Clearing ${allTables.length} tables, seeding: ${Object.keys(seed).join(', ')}`,
|
|
144
|
+
);
|
|
116
145
|
|
|
117
|
-
//
|
|
118
|
-
for (const table of [...
|
|
146
|
+
// Clear ALL tables in reverse order (children before parents for FK safety)
|
|
147
|
+
for (const table of [...allTables].reverse()) {
|
|
119
148
|
const { error } = await supabase.from(table).delete().gte('id', 0);
|
|
120
149
|
if (error) {
|
|
121
150
|
const { error: error2 } = await supabase
|
|
@@ -132,9 +161,10 @@ async function seedTables(seed: Record<string, unknown[]>) {
|
|
|
132
161
|
}
|
|
133
162
|
}
|
|
134
163
|
|
|
135
|
-
// Insert seed data
|
|
136
|
-
for (const [
|
|
164
|
+
// Insert seed data — translate seed keys to actual table names
|
|
165
|
+
for (const [seedKey, rows] of Object.entries(seed)) {
|
|
137
166
|
if (!Array.isArray(rows) || rows.length === 0) continue;
|
|
167
|
+
const table = tableMap[seedKey] || seedKey;
|
|
138
168
|
const { error } = await supabase.from(table).insert(rows);
|
|
139
169
|
if (error) {
|
|
140
170
|
console.error(` Failed to seed ${table}: ${error.message}`);
|
|
@@ -145,16 +175,60 @@ async function seedTables(seed: Record<string, unknown[]>) {
|
|
|
145
175
|
}
|
|
146
176
|
|
|
147
177
|
/**
|
|
148
|
-
*
|
|
178
|
+
* Build a minimal JWT with a far-future expiry.
|
|
179
|
+
* The signature is fake — it doesn't matter because the CodeYam preload module
|
|
180
|
+
* intercepts the Supabase auth validation endpoint and returns mock data.
|
|
181
|
+
*/
|
|
182
|
+
function buildFakeJwt(userId: string, email: string): string {
|
|
183
|
+
const header = { alg: 'HS256', typ: 'JWT' };
|
|
184
|
+
const payload = {
|
|
185
|
+
sub: userId,
|
|
186
|
+
email,
|
|
187
|
+
role: 'authenticated',
|
|
188
|
+
aud: 'authenticated',
|
|
189
|
+
exp: 9999999999,
|
|
190
|
+
iat: Math.floor(Date.now() / 1000),
|
|
191
|
+
};
|
|
192
|
+
const encode = (obj: object) =>
|
|
193
|
+
Buffer.from(JSON.stringify(obj)).toString('base64url');
|
|
194
|
+
return `${encode(header)}.${encode(payload)}.codeyam-mock-signature`;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Build a Supabase user response object matching the /auth/v1/user endpoint format.
|
|
199
|
+
*/
|
|
200
|
+
function buildUserResponse(user: { id: string; email?: string }) {
|
|
201
|
+
return {
|
|
202
|
+
id: user.id,
|
|
203
|
+
aud: 'authenticated',
|
|
204
|
+
role: 'authenticated',
|
|
205
|
+
email: user.email || '',
|
|
206
|
+
email_confirmed_at: new Date().toISOString(),
|
|
207
|
+
app_metadata: { provider: 'email', providers: ['email'] },
|
|
208
|
+
user_metadata: {},
|
|
209
|
+
created_at: new Date().toISOString(),
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
const DEFAULT_AUTH_PASSWORD = 'codeyam-dev-password-123!';
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Handle auth: create user, build synthetic session, write session cookies.
|
|
149
217
|
* Returns the user ID so callers can replace __AUTH_USER_ID__ placeholders in seed data.
|
|
218
|
+
*
|
|
219
|
+
* No real sign-in is performed — the session cookie uses a synthetic JWT with
|
|
220
|
+
* far-future expiry, and externalApis mocks intercept all Supabase auth API calls.
|
|
221
|
+
* This avoids storing real tokens (security risk + expiration) in scenario files.
|
|
150
222
|
*/
|
|
151
223
|
async function handleAuth(auth: {
|
|
152
224
|
email: string;
|
|
153
|
-
password
|
|
225
|
+
password?: string;
|
|
154
226
|
}): Promise<string> {
|
|
155
|
-
const
|
|
227
|
+
const email = auth.email;
|
|
228
|
+
const password = auth.password || DEFAULT_AUTH_PASSWORD;
|
|
156
229
|
|
|
157
|
-
// Create user if they don't exist (auto-confirm email
|
|
230
|
+
// Create user if they don't exist (auto-confirm email)
|
|
231
|
+
// We still need the auth.users row for PostgREST FK relationships.
|
|
158
232
|
const { data: createData, error: createError } =
|
|
159
233
|
await supabase.auth.admin.createUser({
|
|
160
234
|
email,
|
|
@@ -162,72 +236,79 @@ async function handleAuth(auth: {
|
|
|
162
236
|
email_confirm: true,
|
|
163
237
|
});
|
|
164
238
|
|
|
239
|
+
let userId: string;
|
|
240
|
+
|
|
165
241
|
if (createError) {
|
|
166
242
|
if (createError.message.includes('already been registered')) {
|
|
167
|
-
// User exists —
|
|
168
|
-
// scenario specifies a different password than a previous run.
|
|
243
|
+
// User exists — look up their ID
|
|
169
244
|
const { data: listData } = await supabase.auth.admin.listUsers();
|
|
170
245
|
const existingUser = listData?.users?.find((u) => u.email === email);
|
|
171
246
|
if (existingUser) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
console.
|
|
247
|
+
userId = existingUser.id;
|
|
248
|
+
console.log(` Found existing user ${email} (user: ${userId})`);
|
|
249
|
+
} else {
|
|
250
|
+
console.error(
|
|
251
|
+
` User ${email} reported as registered but not found in listUsers`,
|
|
252
|
+
);
|
|
253
|
+
process.exit(1);
|
|
176
254
|
}
|
|
177
255
|
} else {
|
|
178
256
|
console.error(` Failed to create auth user: ${createError.message}`);
|
|
179
257
|
process.exit(1);
|
|
180
258
|
}
|
|
259
|
+
} else {
|
|
260
|
+
userId = createData!.user.id;
|
|
261
|
+
console.log(` Created user ${email} (user: ${userId})`);
|
|
181
262
|
}
|
|
182
263
|
|
|
183
|
-
//
|
|
184
|
-
//
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
auth: { autoRefreshToken: false, persistSession: false },
|
|
189
|
-
})
|
|
190
|
-
: supabase;
|
|
191
|
-
|
|
192
|
-
const { data: signInData, error: signInError } =
|
|
193
|
-
await signInClient.auth.signInWithPassword({ email, password });
|
|
194
|
-
|
|
195
|
-
if (signInError || !signInData.session) {
|
|
196
|
-
console.error(
|
|
197
|
-
` Failed to sign in as ${email}: ${signInError?.message || 'no session returned'}`,
|
|
198
|
-
);
|
|
199
|
-
process.exit(1);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
const userId = signInData.user.id;
|
|
203
|
-
console.log(` Signed in as ${email} (user: ${userId})`);
|
|
264
|
+
// Build synthetic JWT and mock responses — no real sign-in needed.
|
|
265
|
+
// The preload module intercepts server-side getUser() calls so Next.js
|
|
266
|
+
// middleware returns the mock user without hitting real Supabase.
|
|
267
|
+
const fakeJwt = buildFakeJwt(userId!, email);
|
|
268
|
+
const userResponse = buildUserResponse({ id: userId!, email });
|
|
204
269
|
|
|
205
|
-
// Write session cookies for the proxy to inject
|
|
206
270
|
const projectRef = getProjectRef();
|
|
207
271
|
const sessionOutput = {
|
|
208
272
|
cookies: [
|
|
209
273
|
{
|
|
210
274
|
name: `sb-${projectRef}-auth-token`,
|
|
211
275
|
value: JSON.stringify({
|
|
212
|
-
access_token:
|
|
213
|
-
refresh_token:
|
|
276
|
+
access_token: fakeJwt,
|
|
277
|
+
refresh_token: 'codeyam-mock-refresh-token',
|
|
214
278
|
token_type: 'bearer',
|
|
215
|
-
expires_in:
|
|
216
|
-
expires_at:
|
|
279
|
+
expires_in: 315360000,
|
|
280
|
+
expires_at: 9999999999,
|
|
217
281
|
}),
|
|
218
282
|
path: '/',
|
|
219
283
|
sameSite: 'Lax' as const,
|
|
220
284
|
},
|
|
221
285
|
],
|
|
286
|
+
externalApis: {
|
|
287
|
+
[`${supabaseUrl}/auth/v1/user`]: {
|
|
288
|
+
body: userResponse,
|
|
289
|
+
status: 200,
|
|
290
|
+
},
|
|
291
|
+
[`${supabaseUrl}/auth/v1/token`]: {
|
|
292
|
+
body: {
|
|
293
|
+
access_token: fakeJwt,
|
|
294
|
+
token_type: 'bearer',
|
|
295
|
+
expires_in: 315360000,
|
|
296
|
+
expires_at: 9999999999,
|
|
297
|
+
refresh_token: 'codeyam-mock-refresh-token',
|
|
298
|
+
user: userResponse,
|
|
299
|
+
},
|
|
300
|
+
status: 200,
|
|
301
|
+
},
|
|
302
|
+
},
|
|
222
303
|
};
|
|
223
304
|
|
|
224
305
|
const outputDir = path.join(process.cwd(), '.codeyam', 'tmp');
|
|
225
306
|
fs.mkdirSync(outputDir, { recursive: true });
|
|
226
307
|
const outputPath = path.join(outputDir, 'seed-session.json');
|
|
227
308
|
fs.writeFileSync(outputPath, JSON.stringify(sessionOutput, null, 2));
|
|
228
|
-
console.log(` Session cookies written to ${outputPath}`);
|
|
309
|
+
console.log(` Session cookies + auth mocks written to ${outputPath}`);
|
|
229
310
|
|
|
230
|
-
return userId
|
|
311
|
+
return userId!;
|
|
231
312
|
}
|
|
232
313
|
|
|
233
314
|
/**
|
|
@@ -266,7 +347,7 @@ async function main() {
|
|
|
266
347
|
// in seed data (e.g. for user_id foreign key columns with Supabase RLS)
|
|
267
348
|
if (auth) {
|
|
268
349
|
const userId = await handleAuth(
|
|
269
|
-
auth as { email: string; password
|
|
350
|
+
auth as { email: string; password?: string },
|
|
270
351
|
);
|
|
271
352
|
seed = replaceAuthPlaceholders(seed, userId);
|
|
272
353
|
}
|
|
@@ -16,6 +16,15 @@ You MUST follow a step-by-step workflow driven by `codeyam editor` commands. Eac
|
|
|
16
16
|
|
|
17
17
|
**The rule:** After completing what a command tells you to do, run the NEXT command it specifies. The commands are your instructions — follow them one at a time.
|
|
18
18
|
|
|
19
|
+
## TASK Directive
|
|
20
|
+
|
|
21
|
+
Some `codeyam editor N` commands output a `━━━ TASK ━━━` section with an `EXACT_TASK_TITLE:` line. When you see one:
|
|
22
|
+
|
|
23
|
+
1. Delete ALL existing tasks: run TaskList, then run TaskUpdate with status "deleted" for every task returned
|
|
24
|
+
2. Run TaskCreate with the EXACT title from the `EXACT_TASK_TITLE:` line — copy it character-for-character, do NOT paraphrase
|
|
25
|
+
|
|
26
|
+
This ensures only one task is ever visible. Do NOT create tasks on your own. Only create them when a `━━━ TASK ━━━` directive tells you to.
|
|
27
|
+
|
|
19
28
|
## Migration Mode
|
|
20
29
|
|
|
21
30
|
When `codeyam editor steps` shows **"Project Migration"** instead of "Feature Cycle", the project is being migrated from an existing codebase. Follow the `codeyam editor migrate` commands instead of the normal 13-step cycle.
|
|
@@ -117,6 +126,9 @@ This command gives you the post-change checklist (re-register scenarios, re-run
|
|
|
117
126
|
## Key Rules
|
|
118
127
|
|
|
119
128
|
- **Run the commands** — they ARE your instructions, not suggestions
|
|
129
|
+
- **One step at a time** — run each `codeyam editor N` command, read its FULL output, complete every checklist item, then advance. The CLI enforces a minimum time per step.
|
|
130
|
+
- **NEVER batch-run steps** — `for step in 5 6 7 8; do codeyam editor $step; done` or piping to `head` defeats the entire workflow. Each step has unique instructions you must read and follow.
|
|
131
|
+
- **NEVER delegate multiple steps to a subagent** — each step must be run, read, and completed in the main conversation. You MAY use subagents for parallelizable work _within_ a single step (e.g. extracting components + writing tests in step 5).
|
|
120
132
|
- **Every feature gets scenarios** — this is the core value of CodeYam
|
|
121
133
|
- **Always scaffold with a database** (Prisma + SQLite)
|
|
122
134
|
- **Build real API routes** — the proxy handles scenario data transparently
|
|
@@ -163,6 +175,21 @@ Isolation routes are committed to git (not gitignored). They are protected by a
|
|
|
163
175
|
|
|
164
176
|
When a collaborator clones the repo and runs `codeyam editor`, scenarios are auto-imported from `scenarios-manifest.json`. Run `codeyam editor sync` to manually re-sync after pulling new changes.
|
|
165
177
|
|
|
178
|
+
## Expo / React Native Projects
|
|
179
|
+
|
|
180
|
+
When working with an Expo project (tech stack `expo-react-native`):
|
|
181
|
+
|
|
182
|
+
- Use `<View>`, `<Text>`, `<ScrollView>`, `<Pressable>` from `react-native` — **never use HTML elements** (`<div>`, `<span>`, `<h1>`, etc.)
|
|
183
|
+
- Do NOT use `'use client'` — this is a Next.js directive that has no meaning in Expo
|
|
184
|
+
- Do NOT import from `next/navigation`, `next/router`, or any `next/*` package
|
|
185
|
+
- Use `expo-router` for navigation: `useRouter()`, `useLocalSearchParams()`, `<Link>`
|
|
186
|
+
- Use `@/lib/theme` for all design tokens — not CSS custom properties (`var(--token)` does not work in React Native)
|
|
187
|
+
- AsyncStorage maps to localStorage on web — CodeYam's `localStorage` injection in scenarios works automatically
|
|
188
|
+
- Test with `npx jest`, not `npx vitest`
|
|
189
|
+
- Isolation routes use Expo Router: `app/isolated-components/ComponentName.tsx` (not a `/page.tsx` subdirectory)
|
|
190
|
+
- Capture wrappers use `nativeID="codeyam-capture"` (not `id="codeyam-capture"`) — `nativeID` maps to `id` on web
|
|
191
|
+
- The preview renders via react-native-web in a browser — some visual differences from native devices are expected (fonts, SafeAreaView, shadows). See `MOBILE_SETUP.md` for details.
|
|
192
|
+
|
|
166
193
|
## Quick Reference
|
|
167
194
|
|
|
168
195
|
```bash
|
|
@@ -176,7 +203,13 @@ codeyam editor register '{"name":"Full Catalog","type":"application","url":"/","
|
|
|
176
203
|
# Register app scenario with localStorage (for apps using client-side storage instead of a database)
|
|
177
204
|
codeyam editor register '{"name":"Full Library","type":"application","url":"/","dimensions":["<name from screenSizes>"],"localStorage":{"articles":[...],"collections":[...]}}'
|
|
178
205
|
|
|
179
|
-
#
|
|
206
|
+
# BULK REGISTRATION (preferred — register all scenarios at once):
|
|
207
|
+
# Write an array of scenarios to a temp file, then register with @ prefix.
|
|
208
|
+
# This is faster and avoids repeated screenshot capture overhead.
|
|
209
|
+
# File format: [{"name":"...","type":"...","url":"...","seed":{...}}, ...]
|
|
210
|
+
codeyam editor register @.codeyam/tmp/scenarios.json
|
|
211
|
+
|
|
212
|
+
# Single scenario from file (for large seed/localStorage data):
|
|
180
213
|
codeyam editor register @/tmp/scenario-data.json
|
|
181
214
|
|
|
182
215
|
# Journal entry (one per feature, references scenario names)
|