@codeyam/codeyam-cli 0.1.0-staging.596f0eb → 0.1.0-staging.76566f9
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 +2 -1
- package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +2 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +22 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.ts +23 -1
- package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +401 -106
- package/analyzer-template/packages/ai/src/lib/astScopes/types.ts +60 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +734 -45
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.ts +2 -1
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.ts +715 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.ts +233 -75
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.ts +19 -1
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.ts +34 -1
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.ts +23 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertNullToUndefinedBySchema.ts +98 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.ts +34 -1
- package/analyzer-template/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.ts +236 -24
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityKeyAttributes.ts +18 -1
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarioData.ts +41 -0
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarios.ts +37 -4
- package/analyzer-template/packages/ai/src/lib/generateEntityDataStructure.ts +5 -0
- package/analyzer-template/packages/ai/src/lib/generateEntityKeyAttributes.ts +213 -12
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +36 -25
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarios.ts +114 -11
- package/analyzer-template/packages/ai/src/lib/getConditionalUsagesFromCode.ts +143 -31
- package/analyzer-template/packages/ai/src/lib/guessScenarioDataFromDescription.ts +8 -2
- package/analyzer-template/packages/ai/src/lib/promptGenerators/gatherAttributesMap.ts +7 -0
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.ts +42 -2
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.ts +38 -2
- package/analyzer-template/packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.ts +28 -2
- package/analyzer-template/packages/ai/src/lib/worker/SerializableDataStructure.ts +5 -0
- package/analyzer-template/packages/ai/src/lib/worker/analyzeScopeWorker.ts +8 -1
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +127 -43
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.ts +158 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +405 -45
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateChangesScenarioData.ts +1 -1
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +260 -133
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.ts +10 -5
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarioData.ts +77 -83
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarios.ts +2 -5
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +196 -86
- package/analyzer-template/packages/aws/dist/src/lib/s3/checkS3ObjectExists.d.ts +15 -0
- package/analyzer-template/packages/aws/dist/src/lib/s3/checkS3ObjectExists.d.ts.map +1 -0
- package/analyzer-template/packages/aws/dist/src/lib/s3/checkS3ObjectExists.js +31 -0
- package/analyzer-template/packages/aws/dist/src/lib/s3/checkS3ObjectExists.js.map +1 -0
- package/analyzer-template/packages/aws/package.json +1 -1
- package/analyzer-template/packages/aws/s3/index.ts +1 -0
- package/analyzer-template/packages/aws/src/lib/s3/checkS3ObjectExists.ts +47 -0
- package/analyzer-template/packages/database/src/lib/kysely/db.ts +4 -4
- package/analyzer-template/packages/database/src/lib/kysely/tableRelations.ts +2 -2
- package/analyzer-template/packages/database/src/lib/kysely/tables/debugReportsTable.ts +20 -9
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.ts +9 -4
- package/analyzer-template/packages/generate/src/lib/deepMerge.ts +26 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts +2 -2
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js +2 -2
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tableRelations.d.ts +2 -2
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/analysesTable.d.ts +8 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/analysesTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.d.ts +14 -7
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.js +9 -3
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/debugReportsTable.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +8 -4
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/deepMerge.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/deepMerge.js +27 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/deepMerge.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/index.d.ts +4 -3
- package/analyzer-template/packages/github/dist/types/index.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/index.js +1 -0
- package/analyzer-template/packages/github/dist/types/index.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/Analysis.d.ts +31 -1
- package/analyzer-template/packages/github/dist/types/src/types/Analysis.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts +51 -1
- package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/Scenario.js +21 -1
- package/analyzer-template/packages/github/dist/types/src/types/Scenario.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts +48 -0
- package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/lightweightEntityExtractor.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/lightweightEntityExtractor.js +25 -0
- package/analyzer-template/packages/github/dist/utils/src/lib/lightweightEntityExtractor.js.map +1 -1
- package/analyzer-template/packages/types/index.ts +8 -0
- package/analyzer-template/packages/types/src/types/Analysis.ts +32 -1
- package/analyzer-template/packages/types/src/types/Scenario.ts +75 -6
- package/analyzer-template/packages/types/src/types/ScenariosDataStructure.ts +49 -0
- package/analyzer-template/packages/ui-components/src/components/ScenarioDetailInteractiveView.tsx +23 -7
- package/analyzer-template/packages/utils/dist/types/index.d.ts +4 -3
- package/analyzer-template/packages/utils/dist/types/index.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/index.js +1 -0
- package/analyzer-template/packages/utils/dist/types/index.js.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/Analysis.d.ts +31 -1
- package/analyzer-template/packages/utils/dist/types/src/types/Analysis.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts +51 -1
- package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/Scenario.js +21 -1
- package/analyzer-template/packages/utils/dist/types/src/types/Scenario.js.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts +48 -0
- package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/lightweightEntityExtractor.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/lightweightEntityExtractor.js +25 -0
- package/analyzer-template/packages/utils/dist/utils/src/lib/lightweightEntityExtractor.js.map +1 -1
- package/analyzer-template/packages/utils/src/lib/lightweightEntityExtractor.ts +27 -0
- package/analyzer-template/playwright/takeElementScreenshot.ts +26 -11
- package/analyzer-template/playwright/takeScreenshot.ts +9 -7
- package/analyzer-template/project/constructMockCode.ts +286 -84
- package/analyzer-template/project/orchestrateCapture/SequentialCaptureTaskRunner.ts +77 -37
- package/analyzer-template/project/reconcileMockDataKeys.ts +5 -2
- package/analyzer-template/project/runMultiScenarioServer.ts +11 -10
- package/analyzer-template/project/serverOnlyModules.ts +71 -23
- package/analyzer-template/project/start.ts +10 -0
- package/analyzer-template/project/startScenarioCapture.ts +73 -41
- package/analyzer-template/project/writeMockDataTsx.ts +115 -54
- package/analyzer-template/project/writeScenarioComponents.ts +571 -162
- package/analyzer-template/project/writeSimpleRoot.ts +11 -13
- package/background/src/lib/virtualized/project/constructMockCode.js +265 -75
- package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js +67 -32
- package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js.map +1 -1
- package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +5 -2
- package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
- package/background/src/lib/virtualized/project/runMultiScenarioServer.js +11 -9
- package/background/src/lib/virtualized/project/runMultiScenarioServer.js.map +1 -1
- package/background/src/lib/virtualized/project/serverOnlyModules.js +62 -25
- package/background/src/lib/virtualized/project/serverOnlyModules.js.map +1 -1
- package/background/src/lib/virtualized/project/start.js +6 -0
- package/background/src/lib/virtualized/project/start.js.map +1 -1
- package/background/src/lib/virtualized/project/startScenarioCapture.js +54 -31
- package/background/src/lib/virtualized/project/startScenarioCapture.js.map +1 -1
- package/background/src/lib/virtualized/project/writeMockDataTsx.js +106 -46
- package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
- package/background/src/lib/virtualized/project/writeScenarioComponents.js +399 -106
- package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
- package/background/src/lib/virtualized/project/writeSimpleRoot.js +11 -11
- package/background/src/lib/virtualized/project/writeSimpleRoot.js.map +1 -1
- package/codeyam-cli/src/cli.js +2 -0
- package/codeyam-cli/src/cli.js.map +1 -1
- package/codeyam-cli/src/commands/debug.js +14 -2
- package/codeyam-cli/src/commands/debug.js.map +1 -1
- package/codeyam-cli/src/commands/recapture.js +215 -0
- package/codeyam-cli/src/commands/recapture.js.map +1 -0
- package/codeyam-cli/src/commands/report.js +26 -23
- package/codeyam-cli/src/commands/report.js.map +1 -1
- package/codeyam-cli/src/utils/backgroundServer.js +2 -2
- package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/utils/generateReport.js +252 -106
- package/codeyam-cli/src/utils/generateReport.js.map +1 -1
- package/codeyam-cli/src/utils/install-skills.js +2 -2
- package/codeyam-cli/src/utils/install-skills.js.map +1 -1
- package/codeyam-cli/src/utils/queue/__tests__/manager.test.js +38 -0
- package/codeyam-cli/src/utils/queue/__tests__/manager.test.js.map +1 -1
- package/codeyam-cli/src/utils/queue/job.js +140 -16
- package/codeyam-cli/src/utils/queue/job.js.map +1 -1
- package/codeyam-cli/src/utils/queue/manager.js +19 -7
- package/codeyam-cli/src/utils/queue/manager.js.map +1 -1
- package/codeyam-cli/src/utils/queue/persistence.js.map +1 -1
- package/codeyam-cli/src/webserver/app/lib/database.js +47 -0
- package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
- package/codeyam-cli/src/webserver/app/lib/dbNotifier.js.map +1 -1
- package/codeyam-cli/src/webserver/backgroundServer.js +5 -10
- package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/webserver/bootstrap.js +9 -0
- package/codeyam-cli/src/webserver/bootstrap.js.map +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/EntityItem-wXL1Z2Aq.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-efWKDYMr.js → EntityTypeBadge-CzGX-miz.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-CXFKsCOD.js +41 -0
- package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-D-9pXIaY.js +25 -0
- package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-CBQPrpT0.js +3 -0
- package/codeyam-cli/src/webserver/build/client/assets/LoadingDots-D1CdlbrV.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/LogViewer-wDPcZNKx.js +3 -0
- package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-4lcOlid-.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-BfmDgXxG.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-CUxUNEEC.js +15 -0
- package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-COPstp9J.js → TruncatedFilePath-6J7zDUD5.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/_index-DHImXdXq.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-CVP_WGQ3.js +32 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.link-scenario-value-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.update-key-attributes-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.update-valid-values-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/chevron-down-BYimnrHg.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/chunk-JMJ3UQ3L-BambyYE_.js +51 -0
- package/codeyam-cli/src/webserver/build/client/assets/circle-check-CaVsIRxt.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-CgUsG7ib.js +21 -0
- package/codeyam-cli/src/webserver/build/client/assets/cy-logo-cli-CKnwPCDr.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-DW_hdGUc.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha._-Dt-SjPsw.js +23 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-DyB90fWk.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-D_3ero5o.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.edit._scenarioId-CfLCUi9S.js +5 -0
- package/codeyam-cli/src/webserver/build/client/assets/entry.client-DKJyZfAY.js +29 -0
- package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-DAtOlaWE.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/files-ClR0d32A.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/git-D62Lxxmv.js +15 -0
- package/codeyam-cli/src/webserver/build/client/assets/globals-C9s7Lhdl.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/html2canvas-pro.esm-fmIEn3Bc.js +9 -0
- package/codeyam-cli/src/webserver/build/client/assets/index-BosqDOlH.js +3 -0
- package/codeyam-cli/src/webserver/build/client/assets/index-CzNNiTkw.js +9 -0
- package/codeyam-cli/src/webserver/build/client/assets/keyAttributeCoverage-CTlFMihX.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/loader-circle-CNp9QFCX.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/manifest-0d27da29.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/preload-helper-ckwbz45p.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/root-B_wIKCIf.js +56 -0
- package/codeyam-cli/src/webserver/build/client/assets/scenarioStatus-B_8jpV3e.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/search-DDGjYAMJ.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/settings-DgTyB-Wg.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/simulations-CoNWGt0K.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/triangle-alert-CBc5dE1s.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-BMIGFP-m.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/useInteractiveMode-Dk_FQqWJ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-3pmpUQB-.js → useLastLogLine-BqPPNjAl.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/useReportContext-DsJbgMY9.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{useToast-DEyawJ8r.js → useToast-DWHcCcl1.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/index-CU58-Ttc.js +1 -0
- package/codeyam-cli/src/webserver/build/server/assets/server-build-D35o2uae.js +175 -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/devServer.js +1 -3
- package/codeyam-cli/src/webserver/devServer.js.map +1 -1
- package/codeyam-cli/templates/codeyam-setup-skill.md +138 -3
- package/codeyam-cli/templates/debug-codeyam.md +625 -0
- package/package.json +14 -14
- package/packages/ai/src/lib/analyzeScope.js +2 -0
- package/packages/ai/src/lib/analyzeScope.js.map +1 -1
- package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js +16 -0
- package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js.map +1 -1
- package/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.js +16 -0
- package/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.js.map +1 -1
- package/packages/ai/src/lib/astScopes/processExpression.js +305 -88
- package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +582 -41
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js +2 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js +454 -0
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js.map +1 -0
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js +173 -55
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js +16 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js +30 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js +20 -0
- package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/convertNullToUndefinedBySchema.js +86 -0
- package/packages/ai/src/lib/dataStructure/helpers/convertNullToUndefinedBySchema.js.map +1 -0
- package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js +28 -2
- package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js.map +1 -1
- package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js +179 -17
- package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js.map +1 -1
- package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js +6 -0
- package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js.map +1 -1
- package/packages/ai/src/lib/generateChangesEntityScenarioData.js +41 -0
- package/packages/ai/src/lib/generateChangesEntityScenarioData.js.map +1 -1
- package/packages/ai/src/lib/generateChangesEntityScenarios.js +37 -4
- package/packages/ai/src/lib/generateChangesEntityScenarios.js.map +1 -1
- package/packages/ai/src/lib/generateEntityDataStructure.js +4 -0
- package/packages/ai/src/lib/generateEntityDataStructure.js.map +1 -1
- package/packages/ai/src/lib/generateEntityKeyAttributes.js +176 -9
- package/packages/ai/src/lib/generateEntityKeyAttributes.js.map +1 -1
- package/packages/ai/src/lib/generateEntityScenarioData.js +29 -25
- package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
- package/packages/ai/src/lib/generateEntityScenarios.js +105 -9
- package/packages/ai/src/lib/generateEntityScenarios.js.map +1 -1
- package/packages/ai/src/lib/getConditionalUsagesFromCode.js +84 -14
- package/packages/ai/src/lib/getConditionalUsagesFromCode.js.map +1 -1
- package/packages/ai/src/lib/guessScenarioDataFromDescription.js +2 -1
- package/packages/ai/src/lib/guessScenarioDataFromDescription.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js +6 -0
- package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js +38 -2
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.js +38 -2
- package/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.js +16 -3
- package/packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.js.map +1 -1
- package/packages/ai/src/lib/worker/SerializableDataStructure.js.map +1 -1
- package/packages/ai/src/lib/worker/analyzeScopeWorker.js +4 -0
- package/packages/ai/src/lib/worker/analyzeScopeWorker.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +100 -23
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js +125 -0
- package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js.map +1 -0
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js +298 -45
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateChangesScenarioData.js +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateChangesScenarioData.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +201 -80
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js +10 -5
- package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js +55 -69
- package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateScenarios.js +2 -5
- package/packages/analyze/src/lib/files/scenarios/generateScenarios.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +171 -81
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
- package/packages/database/src/lib/kysely/db.js +2 -2
- package/packages/database/src/lib/kysely/tables/debugReportsTable.js +9 -3
- package/packages/database/src/lib/kysely/tables/debugReportsTable.js.map +1 -1
- package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +8 -4
- package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
- package/packages/generate/src/lib/deepMerge.js +27 -1
- package/packages/generate/src/lib/deepMerge.js.map +1 -1
- package/packages/types/index.js +1 -0
- package/packages/types/index.js.map +1 -1
- package/packages/types/src/types/Scenario.js +21 -1
- package/packages/types/src/types/Scenario.js.map +1 -1
- package/packages/utils/src/lib/lightweightEntityExtractor.js +25 -0
- package/packages/utils/src/lib/lightweightEntityExtractor.js.map +1 -1
- package/scripts/finalize-analyzer.cjs +3 -1
- package/codeyam-cli/scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.js +0 -238
- package/codeyam-cli/scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.js.map +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityItem-CVbSvOjo.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-DcwcHyl5.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-WgwC1GfJ.js +0 -26
- package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-IEKom9O2.js +0 -3
- package/codeyam-cli/src/webserver/build/client/assets/LogViewer-BYnfxbUG.js +0 -3
- package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-_lBPJCzG.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-lHVhvsu_.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-d_TBk4GQ.js +0 -5
- package/codeyam-cli/src/webserver/build/client/assets/_index-kGT7VUqj.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-DDGmhu7P.js +0 -7
- package/codeyam-cli/src/webserver/build/client/assets/chevron-down-n_HPRfM_.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/chunk-WWGJGFF6-CbVoyx1U.js +0 -26
- package/codeyam-cli/src/webserver/build/client/assets/circle-check-D1VOYveA.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-YR8jjAlu.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-B8vP3V_s.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha._-CN6aLCT1.js +0 -16
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-DA5Jeu2P.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.edit._scenarioId-BTeitalf.js +0 -5
- package/codeyam-cli/src/webserver/build/client/assets/entry.client-du6UEYD-.js +0 -13
- package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-BpjkhMoi.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/files-BQGvk4lJ.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/git-DVdYRT-I.js +0 -12
- package/codeyam-cli/src/webserver/build/client/assets/globals-CO-U8Bpo.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/html2canvas-pro.esm-XQCGvadH.js +0 -5
- package/codeyam-cli/src/webserver/build/client/assets/index-DCG-vks0.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/loader-circle-GazdNeLl.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-0b694d28.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-D3tQP7hx.js +0 -16
- package/codeyam-cli/src/webserver/build/client/assets/search-CIY6XmtE.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/server-build-CMKNK2uU.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/settings-CoMDgElu.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/simulations-agkniXp2.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/triangle-alert-B2VUcygF.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useReportContext-EvdK-zXP.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/index-DGVHQEXD.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-CghkTkIL.js +0 -166
- package/codeyam-cli/templates/debug-command.md +0 -303
- /package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-CMKNK2uU.css → styles-CMKNK2uU.css} +0 -0
|
@@ -31,19 +31,6 @@ export default async function prepareEntityDataStructures(
|
|
|
31
31
|
projectAnalyzer: ProjectAnalyzer,
|
|
32
32
|
options: AnalysisOptions,
|
|
33
33
|
): Promise<void> {
|
|
34
|
-
console.log(
|
|
35
|
-
'CodeYam: prepareEntityDataStructures RUNNING (server-only-detection-v3)',
|
|
36
|
-
);
|
|
37
|
-
console.log(
|
|
38
|
-
`CodeYam: prepareEntityDataStructures processing ${allEntities.size} entities`,
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
// Log all entity names for debugging
|
|
42
|
-
const entityNames = Array.from(allEntities).map((e) => e.name);
|
|
43
|
-
console.log(
|
|
44
|
-
`CodeYam: prepareEntityDataStructures entity names: ${entityNames.join(', ')}`,
|
|
45
|
-
);
|
|
46
|
-
|
|
47
34
|
// Process entities in parallel for speed
|
|
48
35
|
await Promise.all(
|
|
49
36
|
Array.from(allEntities).map(async (entity) => {
|
|
@@ -117,6 +104,13 @@ export default async function prepareEntityDataStructures(
|
|
|
117
104
|
}
|
|
118
105
|
}
|
|
119
106
|
|
|
107
|
+
// LOGGING: Track dependencySchemas entity names for debugging :: format issues
|
|
108
|
+
const allEntityNames: string[] = [];
|
|
109
|
+
for (const filePath in clonedDependencySchemas) {
|
|
110
|
+
for (const entityName in clonedDependencySchemas[filePath]) {
|
|
111
|
+
allEntityNames.push(`${filePath}:${entityName}`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
120
114
|
entity.metadata.isolatedDataStructure = {
|
|
121
115
|
signatureSchema: deduplicateFunctionSchemas(
|
|
122
116
|
isolatedDataStructure.signatureSchema,
|
|
@@ -131,6 +125,9 @@ export default async function prepareEntityDataStructures(
|
|
|
131
125
|
isolatedDataStructure.environmentVariables,
|
|
132
126
|
// Use enriched conditional usages with source tracing from analysis
|
|
133
127
|
conditionalUsages: isolatedDataStructure.conditionalUsages,
|
|
128
|
+
// Include root entity's equivalencies for merge step
|
|
129
|
+
usageEquivalencies: isolatedDataStructure.usageEquivalencies,
|
|
130
|
+
sourceEquivalencies: isolatedDataStructure.sourceEquivalencies,
|
|
134
131
|
};
|
|
135
132
|
|
|
136
133
|
// Detect wrapper requirements (Context providers, etc.)
|
|
@@ -187,10 +184,6 @@ export default async function prepareEntityDataStructures(
|
|
|
187
184
|
// This runs for ALL entities, even those with cached data structures
|
|
188
185
|
// because server-only detection may have been added after the entity was cached
|
|
189
186
|
const importedExports = entity.metadata?.importedExports ?? [];
|
|
190
|
-
console.log(
|
|
191
|
-
`CodeYam: [${entity.name}] Processing ${importedExports.length} importedExports for isMocked determination (cached: ${hasCache})`,
|
|
192
|
-
);
|
|
193
|
-
|
|
194
187
|
const mockedDependencies = determineMockedDependencies(entity);
|
|
195
188
|
for (const importedExport of importedExports) {
|
|
196
189
|
// Skip if already has a definitive isMocked value (true or false, not null)
|
|
@@ -271,9 +264,14 @@ export default async function prepareEntityDataStructures(
|
|
|
271
264
|
if (alwaysMockedBrowserGlobals.includes(path)) {
|
|
272
265
|
info.isMocked = true;
|
|
273
266
|
} else {
|
|
267
|
+
// Check if this dependency should be mocked
|
|
268
|
+
// Match both exact entityName and variable-qualified entityNames
|
|
269
|
+
// e.g., "useFetcher" matches "useFetcher" OR "useFetcher::userFetcher"
|
|
274
270
|
info.isMocked = mockedDependencies.some(
|
|
275
271
|
(dep) =>
|
|
276
|
-
dep.filePath === path &&
|
|
272
|
+
dep.filePath === path &&
|
|
273
|
+
(dep.entityName === info.name ||
|
|
274
|
+
dep.entityName.startsWith(info.name + '::')),
|
|
277
275
|
);
|
|
278
276
|
}
|
|
279
277
|
}
|
|
@@ -362,6 +360,108 @@ async function getEntityDataStructureAndFunctionCalls({
|
|
|
362
360
|
getSourceEquivalencies(dataStructure, importedExport.name) ?? {},
|
|
363
361
|
};
|
|
364
362
|
|
|
363
|
+
// Also create variable-qualified entries to preserve distinct return type schemas
|
|
364
|
+
// when the same function is called multiple times with different type parameters
|
|
365
|
+
// (e.g., useFetcher<UserData>() vs useFetcher<ReportData>()).
|
|
366
|
+
//
|
|
367
|
+
// Each parameterized call is a SEPARATE entry in externalFunctionCalls, so we need
|
|
368
|
+
// to iterate over ALL matching calls (not just the first one).
|
|
369
|
+
const matchingCalls = dataStructure.externalFunctionCalls.filter(
|
|
370
|
+
(fc) =>
|
|
371
|
+
fc.name === importedExport.name ||
|
|
372
|
+
fc.name.startsWith(importedExport.name + '<'),
|
|
373
|
+
);
|
|
374
|
+
|
|
375
|
+
for (const efc of matchingCalls) {
|
|
376
|
+
// Check if this call has perVariableSchemas (multiple calls with same signature)
|
|
377
|
+
// This is the destructuring case: const { a, b, c } = useLoaderData()
|
|
378
|
+
// Instead of creating ::variable qualified keys, merge into a single entry
|
|
379
|
+
// with the call signature as key and named properties in the schema
|
|
380
|
+
if (efc?.perVariableSchemas) {
|
|
381
|
+
// Use the call signature as the key (e.g., "useLoaderData<typeof loader>()")
|
|
382
|
+
const callSignatureKey = efc.callSignature;
|
|
383
|
+
|
|
384
|
+
// Merge all variable schemas by prepending the call signature to each path.
|
|
385
|
+
// perVariableSchemas paths are like "functionCallReturnValue.entities.sha"
|
|
386
|
+
// We need to prefix them with the call signature to get:
|
|
387
|
+
// "useLoaderData<typeof loader>().functionCallReturnValue.entities.sha"
|
|
388
|
+
const mergedReturnValueSchema: Record<string, string> = {};
|
|
389
|
+
|
|
390
|
+
// Set the top-level return value as object since it contains named properties
|
|
391
|
+
mergedReturnValueSchema[
|
|
392
|
+
`${callSignatureKey}.functionCallReturnValue`
|
|
393
|
+
] = 'object';
|
|
394
|
+
|
|
395
|
+
for (const [varName, perVarSchema] of Object.entries(
|
|
396
|
+
efc.perVariableSchemas,
|
|
397
|
+
)) {
|
|
398
|
+
for (const [path, type] of Object.entries(perVarSchema)) {
|
|
399
|
+
// Prepend the call signature to the path
|
|
400
|
+
// Input: "functionCallReturnValue.entities.sha"
|
|
401
|
+
// Output: "useLoaderData<typeof loader>().functionCallReturnValue.entities.sha"
|
|
402
|
+
const rewrittenPath = `${callSignatureKey}.${path}`;
|
|
403
|
+
mergedReturnValueSchema[rewrittenPath] = type;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
acc[importedExport.filePath][callSignatureKey] = {
|
|
408
|
+
signatureSchema: deduplicateFunctionSchemas({
|
|
409
|
+
...signatureSchema,
|
|
410
|
+
}),
|
|
411
|
+
returnValueSchema: deduplicateFunctionSchemas(
|
|
412
|
+
mergedReturnValueSchema,
|
|
413
|
+
),
|
|
414
|
+
usageEquivalencies:
|
|
415
|
+
getUsageEquivalencies(dataStructure, importedExport.name) ?? {},
|
|
416
|
+
sourceEquivalencies:
|
|
417
|
+
getSourceEquivalencies(dataStructure, importedExport.name) ?? {},
|
|
418
|
+
};
|
|
419
|
+
} else if (efc?.receivingVariableNames?.length === 1) {
|
|
420
|
+
// For parameterized calls like useFetcher<UserData>(), each is a separate entry
|
|
421
|
+
// with a single receivingVariableName. Use the call signature as the key.
|
|
422
|
+
const varName = efc.receivingVariableNames[0];
|
|
423
|
+
|
|
424
|
+
// Use the call signature as the key (e.g., "useFetcher<UserData>()")
|
|
425
|
+
const callSignatureKey = efc.callSignature;
|
|
426
|
+
|
|
427
|
+
// PREFER perVariableSchemas over getReturnValue() when available
|
|
428
|
+
// perVariableSchemas has the SPECIFIC schema for this parameterized call,
|
|
429
|
+
// while getReturnValue() may return merged schemas from multiple calls
|
|
430
|
+
let parameterizedReturnValue: Record<string, string> | null = null;
|
|
431
|
+
|
|
432
|
+
if (efc.perVariableSchemas && efc.perVariableSchemas[varName]) {
|
|
433
|
+
// Use the specific schema from perVariableSchemas
|
|
434
|
+
parameterizedReturnValue = efc.perVariableSchemas[varName] ?? null;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
// Fallback to getReturnValue if perCallSignatureSchemas not available
|
|
438
|
+
if (!parameterizedReturnValue) {
|
|
439
|
+
parameterizedReturnValue = getReturnValue(dataStructure, {
|
|
440
|
+
functionName: efc.name, // Use the full parameterized name
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
if (
|
|
445
|
+
parameterizedReturnValue &&
|
|
446
|
+
Object.keys(parameterizedReturnValue).length > 0
|
|
447
|
+
) {
|
|
448
|
+
acc[importedExport.filePath][callSignatureKey] = {
|
|
449
|
+
signatureSchema: deduplicateFunctionSchemas({
|
|
450
|
+
...signatureSchema,
|
|
451
|
+
}),
|
|
452
|
+
returnValueSchema: deduplicateFunctionSchemas({
|
|
453
|
+
...parameterizedReturnValue,
|
|
454
|
+
}),
|
|
455
|
+
usageEquivalencies:
|
|
456
|
+
getUsageEquivalencies(dataStructure, importedExport.name) ?? {},
|
|
457
|
+
sourceEquivalencies:
|
|
458
|
+
getSourceEquivalencies(dataStructure, importedExport.name) ??
|
|
459
|
+
{},
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
|
|
365
465
|
return acc;
|
|
366
466
|
},
|
|
367
467
|
{} as {
|
|
@@ -394,6 +494,9 @@ async function getEntityDataStructureAndFunctionCalls({
|
|
|
394
494
|
// Get enriched conditional usages with source tracing
|
|
395
495
|
const conditionalUsages = getConditionalUsages(dataStructure);
|
|
396
496
|
|
|
497
|
+
const rawUsageEquivalencies = getUsageEquivalencies(dataStructure);
|
|
498
|
+
const rawSourceEquivalencies = getSourceEquivalencies(dataStructure);
|
|
499
|
+
|
|
397
500
|
const isolatedDataStructure = {
|
|
398
501
|
signatureSchema: deduplicateFunctionSchemas(clonedRawSignature),
|
|
399
502
|
returnValueSchema: deduplicateFunctionSchemas(clonedRawReturnValue),
|
|
@@ -403,6 +506,11 @@ async function getEntityDataStructureAndFunctionCalls({
|
|
|
403
506
|
environmentVariables: dataStructure.environmentVariables,
|
|
404
507
|
conditionalUsages:
|
|
405
508
|
Object.keys(conditionalUsages).length > 0 ? conditionalUsages : undefined,
|
|
509
|
+
// Include root entity's equivalencies so they can be used during merge.
|
|
510
|
+
// These show how the parent's data flows to/from child components.
|
|
511
|
+
// E.g., for SurveysList, usageEquivalencies shows surveys[] → SurveyCard().signature[0].survey
|
|
512
|
+
usageEquivalencies: rawUsageEquivalencies ?? {},
|
|
513
|
+
sourceEquivalencies: rawSourceEquivalencies ?? {},
|
|
406
514
|
};
|
|
407
515
|
|
|
408
516
|
const functionCalls: Record<string, string[]> = {};
|
|
@@ -415,31 +523,6 @@ async function getEntityDataStructureAndFunctionCalls({
|
|
|
415
523
|
efc.callSignature.startsWith(entityName),
|
|
416
524
|
);
|
|
417
525
|
|
|
418
|
-
// DEBUG: Log external function calls info for useFetcher
|
|
419
|
-
if (entityName === 'useFetcher' || entityName.includes('Fetcher')) {
|
|
420
|
-
console.log(
|
|
421
|
-
'CodeYam DEBUG prepareDataStructures:',
|
|
422
|
-
JSON.stringify(
|
|
423
|
-
{
|
|
424
|
-
entityName,
|
|
425
|
-
filePath,
|
|
426
|
-
totalExternalFunctionCalls:
|
|
427
|
-
dataStructure.externalFunctionCalls.length,
|
|
428
|
-
matchingCallsCount: matchingCalls.length,
|
|
429
|
-
matchingCalls: matchingCalls.map((efc) => ({
|
|
430
|
-
name: efc.name,
|
|
431
|
-
callSignature: efc.callSignature,
|
|
432
|
-
allCallSignatures: efc.allCallSignatures,
|
|
433
|
-
receivingVariableNames: efc.receivingVariableNames,
|
|
434
|
-
callSignatureToVariable: efc.callSignatureToVariable,
|
|
435
|
-
})),
|
|
436
|
-
},
|
|
437
|
-
null,
|
|
438
|
-
2,
|
|
439
|
-
),
|
|
440
|
-
);
|
|
441
|
-
}
|
|
442
|
-
|
|
443
526
|
// Collect all call signatures from all matching efc entries
|
|
444
527
|
// Each efc may have just one callSignature, or allCallSignatures if merged
|
|
445
528
|
const allSignatures: string[] = [];
|
|
@@ -485,6 +568,7 @@ async function getEntityDataStructureAndFunctionCalls({
|
|
|
485
568
|
) {
|
|
486
569
|
variableNames.push(...aggregatedReceivingVariableNames);
|
|
487
570
|
}
|
|
571
|
+
|
|
488
572
|
if (variableNames.length > 0) {
|
|
489
573
|
callVariableNames[entityName] = variableNames;
|
|
490
574
|
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { DataStructure } from '~codeyam/types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Enriches mocked dependency array types with fields from child component signatures.
|
|
5
|
+
*
|
|
6
|
+
* When a mocked dependency (e.g., getSurveysAction) returns an array, and elements
|
|
7
|
+
* from that array are passed to child components (e.g., SurveyCard), the child's
|
|
8
|
+
* signatureSchema specifies required fields (e.g., survey.updatedAt). This function
|
|
9
|
+
* enriches the mocked dependency's returnValueSchema so the LLM knows what fields
|
|
10
|
+
* to generate for array elements.
|
|
11
|
+
*
|
|
12
|
+
* Example:
|
|
13
|
+
* - getSurveysAction returns { data: array }
|
|
14
|
+
* - SurveyCard expects signature[0].survey.updatedAt: date
|
|
15
|
+
* - After enrichment: getSurveysAction().data[]: object, data[].updatedAt: date
|
|
16
|
+
*/
|
|
17
|
+
export default function enrichArrayTypesFromChildSignatures(
|
|
18
|
+
importedExports: {
|
|
19
|
+
filePath?: string;
|
|
20
|
+
name: string;
|
|
21
|
+
isMocked?: boolean;
|
|
22
|
+
}[],
|
|
23
|
+
dependencySchemas: DataStructure['dependencySchemas'],
|
|
24
|
+
): void {
|
|
25
|
+
// Find all mocked dependencies with array return types
|
|
26
|
+
const mockedArrayPaths: {
|
|
27
|
+
filePath: string;
|
|
28
|
+
entityName: string;
|
|
29
|
+
arrayPath: string; // e.g., "getSurveysAction().functionCallReturnValue.data"
|
|
30
|
+
}[] = [];
|
|
31
|
+
|
|
32
|
+
for (const importedExport of importedExports) {
|
|
33
|
+
if (!importedExport.isMocked || !importedExport.filePath) continue;
|
|
34
|
+
|
|
35
|
+
const schema =
|
|
36
|
+
dependencySchemas?.[importedExport.filePath]?.[importedExport.name]
|
|
37
|
+
?.returnValueSchema;
|
|
38
|
+
if (!schema) continue;
|
|
39
|
+
|
|
40
|
+
// Find paths that are top-level data arrays (not deeply nested, not direct returns)
|
|
41
|
+
// We only want to enrich arrays that likely contain objects passed to children
|
|
42
|
+
// e.g., getSurveysAction().data but NOT:
|
|
43
|
+
// - wrapThrows().data.createdBy (deeply nested)
|
|
44
|
+
// - getStatusOptions().functionCallReturnValue (direct array return - usually options/primitives)
|
|
45
|
+
for (const [path, type] of Object.entries(schema)) {
|
|
46
|
+
if (type !== 'array') continue;
|
|
47
|
+
|
|
48
|
+
// Skip paths with computed property patterns like [key], [i], [0], etc.
|
|
49
|
+
// These represent dynamic access patterns, not simple data arrays
|
|
50
|
+
// We only match brackets with content (not empty [] which indicates array element type)
|
|
51
|
+
if (/\[[^\]]+\]/.test(path)) {
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Skip direct array returns (e.g., getStatusOptions().functionCallReturnValue)
|
|
56
|
+
// These are typically specialized arrays like [{label, value}], not entity arrays
|
|
57
|
+
if (path.endsWith('.functionCallReturnValue')) {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Check if this is a top-level array (at most one property after functionCallReturnValue)
|
|
62
|
+
// e.g., "foo().functionCallReturnValue.data" is top-level
|
|
63
|
+
// e.g., "foo().functionCallReturnValue.data.createdBy" is nested (skip)
|
|
64
|
+
const returnValueMatch = path.match(/\.functionCallReturnValue\.(.+)$/);
|
|
65
|
+
if (returnValueMatch) {
|
|
66
|
+
const afterReturnValue = returnValueMatch[1];
|
|
67
|
+
// If there's more than one property access, it's nested
|
|
68
|
+
const propertyCount = afterReturnValue.split('.').length;
|
|
69
|
+
if (propertyCount > 1) {
|
|
70
|
+
continue; // Skip deeply nested arrays
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
mockedArrayPaths.push({
|
|
75
|
+
filePath: importedExport.filePath,
|
|
76
|
+
entityName: importedExport.name,
|
|
77
|
+
arrayPath: path,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (mockedArrayPaths.length === 0) return;
|
|
83
|
+
|
|
84
|
+
// Find all non-mocked child components and extract their signature fields
|
|
85
|
+
const childSignatureFields: {
|
|
86
|
+
filePath: string;
|
|
87
|
+
entityName: string;
|
|
88
|
+
// Map of prop paths to types, e.g., { "survey.id": "string", "survey.updatedAt": "date" }
|
|
89
|
+
propFields: Record<string, string>;
|
|
90
|
+
}[] = [];
|
|
91
|
+
|
|
92
|
+
for (const importedExport of importedExports) {
|
|
93
|
+
// Skip mocked dependencies - we want child components
|
|
94
|
+
if (importedExport.isMocked || !importedExport.filePath) continue;
|
|
95
|
+
|
|
96
|
+
const schema =
|
|
97
|
+
dependencySchemas?.[importedExport.filePath]?.[importedExport.name]
|
|
98
|
+
?.signatureSchema;
|
|
99
|
+
if (!schema) continue;
|
|
100
|
+
|
|
101
|
+
// Extract signature[0].* fields (first prop of child component)
|
|
102
|
+
const propFields: Record<string, string> = {};
|
|
103
|
+
for (const [path, type] of Object.entries(schema)) {
|
|
104
|
+
// Match signature[0].propName.field patterns
|
|
105
|
+
const match = path.match(/^signature\[0\]\.(\w+)\.(.+)$/);
|
|
106
|
+
if (match) {
|
|
107
|
+
const [, propName, fieldPath] = match;
|
|
108
|
+
// Store as "fieldPath" without the prop name prefix
|
|
109
|
+
// e.g., signature[0].survey.updatedAt -> updatedAt
|
|
110
|
+
propFields[fieldPath] = type;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (Object.keys(propFields).length > 0) {
|
|
115
|
+
childSignatureFields.push({
|
|
116
|
+
filePath: importedExport.filePath,
|
|
117
|
+
entityName: importedExport.name,
|
|
118
|
+
propFields,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (childSignatureFields.length === 0) return;
|
|
124
|
+
|
|
125
|
+
// Enrich mocked dependency arrays with child signature fields
|
|
126
|
+
// Only enrich arrays that don't already have element types defined
|
|
127
|
+
// A more sophisticated approach would trace the data flow to match specific arrays to specific children
|
|
128
|
+
for (const { filePath, entityName, arrayPath } of mockedArrayPaths) {
|
|
129
|
+
const schema = dependencySchemas[filePath][entityName].returnValueSchema;
|
|
130
|
+
|
|
131
|
+
// Check if this array already has element type definitions
|
|
132
|
+
// If so, skip it - it's likely a specialized array like [null] for refs
|
|
133
|
+
const elementPathPrefix = `${arrayPath}[`;
|
|
134
|
+
const hasExistingElementType = Object.keys(schema).some((path) =>
|
|
135
|
+
path.startsWith(elementPathPrefix),
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
if (hasExistingElementType) {
|
|
139
|
+
// Array already has element type info (e.g., useAutoAnimate()[0]: null)
|
|
140
|
+
// Don't override it with child signature fields
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Add array element type
|
|
145
|
+
const elementPath = `${arrayPath}[]`;
|
|
146
|
+
schema[elementPath] = 'object';
|
|
147
|
+
|
|
148
|
+
// Add fields from all child signatures to the array element
|
|
149
|
+
for (const { propFields } of childSignatureFields) {
|
|
150
|
+
for (const [fieldPath, type] of Object.entries(propFields)) {
|
|
151
|
+
const fullPath = `${elementPath}.${fieldPath}`;
|
|
152
|
+
if (!schema[fullPath]) {
|
|
153
|
+
schema[fullPath] = type;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|