@codeyam/codeyam-cli 0.1.0-staging.8e7b1bd → 0.1.0-staging.b8a55ba
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 +7 -6
- package/analyzer-template/packages/ai/package.json +1 -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 +661 -50
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.ts +14 -2
- 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 +123 -1
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.ts +19 -1
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.ts +23 -1
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.ts +23 -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/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 +11 -15
- 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 +339 -145
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +20 -0
- package/analyzer-template/packages/analyze/src/lib/files/getImportedExports.ts +8 -1
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.ts +158 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +107 -18
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateChangesScenarioData.ts +1 -1
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +223 -103
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.ts +10 -5
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarioData.ts +172 -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 +97 -27
- 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/database/src/lib/loadReadyToBeCapturedAnalyses.ts +3 -2
- 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/generate/src/lib/getComponentScenarioPath.ts +8 -3
- 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/database/src/lib/loadReadyToBeCapturedAnalyses.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js +4 -2
- package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js.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/generate/src/lib/getComponentScenarioPath.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/getComponentScenarioPath.js +7 -3
- package/analyzer-template/packages/github/dist/generate/src/lib/getComponentScenarioPath.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/applyUniversalMocks.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/applyUniversalMocks.js +26 -2
- package/analyzer-template/packages/github/dist/utils/src/lib/applyUniversalMocks.js.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/package.json +4 -4
- 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/applyUniversalMocks.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/applyUniversalMocks.js +26 -2
- package/analyzer-template/packages/utils/dist/utils/src/lib/applyUniversalMocks.js.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/applyUniversalMocks.ts +28 -2
- 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/TESTING.md +83 -0
- package/analyzer-template/project/constructMockCode.ts +151 -30
- package/analyzer-template/project/loadReadyToBeCaptured.ts +17 -1
- package/analyzer-template/project/orchestrateCapture/KyselyAnalysisLoader.ts +16 -9
- package/analyzer-template/project/orchestrateCapture/SequentialCaptureTaskRunner.ts +77 -37
- package/analyzer-template/project/reconcileMockDataKeys.ts +104 -3
- package/analyzer-template/project/runMultiScenarioServer.ts +11 -10
- package/analyzer-template/project/serverOnlyModules.ts +288 -0
- package/analyzer-template/project/start.ts +10 -0
- package/analyzer-template/project/startScenarioCapture.ts +73 -41
- package/analyzer-template/project/writeMockDataTsx.ts +103 -40
- package/analyzer-template/project/writeScenarioComponents.ts +1162 -203
- package/analyzer-template/project/writeSimpleRoot.ts +26 -4
- package/analyzer-template/project/writeUniversalMocks.ts +32 -11
- package/background/src/lib/virtualized/project/constructMockCode.js +132 -25
- package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
- package/background/src/lib/virtualized/project/loadReadyToBeCaptured.js +15 -1
- package/background/src/lib/virtualized/project/loadReadyToBeCaptured.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture/KyselyAnalysisLoader.js +11 -6
- package/background/src/lib/virtualized/project/orchestrateCapture/KyselyAnalysisLoader.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 +65 -4
- 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 +235 -0
- package/background/src/lib/virtualized/project/serverOnlyModules.js.map +1 -0
- 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 +87 -34
- package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
- package/background/src/lib/virtualized/project/writeScenarioComponents.js +852 -133
- package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
- package/background/src/lib/virtualized/project/writeSimpleRoot.js +25 -2
- package/background/src/lib/virtualized/project/writeSimpleRoot.js.map +1 -1
- package/background/src/lib/virtualized/project/writeUniversalMocks.js +27 -12
- package/background/src/lib/virtualized/project/writeUniversalMocks.js.map +1 -1
- package/codeyam-cli/scripts/fixtures/formbricks/universal-mocks/apps/web/lib/instance/service.js +7 -0
- package/codeyam-cli/scripts/fixtures/formbricks/universal-mocks/apps/web/lib/instance/service.js.map +1 -0
- 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 -7
- 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-DQeyk25_.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-ayCJdUAc.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)-2mG6mjVb.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._-FHOVOgFN.js → entity._sha._-zUEpfPsu.js} +22 -15
- 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-C6vQASxy.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-09d684be.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-BxJUvKau.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-DOGXmJcI.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-C07gRg7Z.js → useToast-DWHcCcl1.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/index-CV6i1S1A.js +1 -0
- package/codeyam-cli/src/webserver/build/server/assets/server-build-BDlyhfrv.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/debug-codeyam.md +620 -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 +523 -42
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/JavascriptFrameworkManager.js +12 -2
- 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 +103 -1
- 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 +19 -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/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/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 +11 -15
- 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 +258 -110
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +18 -0
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
- package/packages/analyze/src/lib/files/getImportedExports.js +6 -1
- package/packages/analyze/src/lib/files/getImportedExports.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 +74 -19
- 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 +175 -58
- 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 +127 -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 +74 -23
- 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/database/src/lib/loadReadyToBeCapturedAnalyses.js +4 -2
- package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.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/generate/src/lib/getComponentScenarioPath.js +7 -3
- package/packages/generate/src/lib/getComponentScenarioPath.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/applyUniversalMocks.js +26 -2
- package/packages/utils/src/lib/applyUniversalMocks.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/src/webserver/build/client/assets/EntityItem-CWKV2GEz.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-D2hFeDeg.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-C8K-4kKP.js +0 -26
- package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-DgXLv61M.js +0 -3
- package/codeyam-cli/src/webserver/build/client/assets/LogViewer-DFdLQbPS.js +0 -3
- package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-DlRDjT4h.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-7UkVL-UI.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-XjtsGuPo.js +0 -5
- package/codeyam-cli/src/webserver/build/client/assets/_index-D2eJjWLf.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-w6sbwlOd.js +0 -7
- package/codeyam-cli/src/webserver/build/client/assets/chevron-down-BBNQ8hup.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/chunk-WWGJGFF6-Bex4RrGs.js +0 -26
- package/codeyam-cli/src/webserver/build/client/assets/circle-check-cdhjVtom.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-DkgmwwRC.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-CwLmCS0J.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-YZ-kM3ZG.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.edit._scenarioId-BeQlz94_.js +0 -5
- package/codeyam-cli/src/webserver/build/client/assets/entry.client-DN2XXM7Z.js +0 -5
- package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-CUeAIQNI.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/files-ccMQfhGf.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/git-JmESAHx5.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-DsL9BiOc.js +0 -8
- package/codeyam-cli/src/webserver/build/client/assets/loader-circle-COYCR2oZ.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-90adba57.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-DfbVEEjF.js +0 -16
- package/codeyam-cli/src/webserver/build/client/assets/search-DvK9iMBu.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-9LTbit4Z.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/simulations-BrxN5ZtV.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/triangle-alert-Iv0p8T-1.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useReportContext-BWmSRPH6.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/index-CE_1qXCG.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-BY_VDhiD.js +0 -166
- package/codeyam-cli/templates/debug-command.md +0 -141
- /package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-CMKNK2uU.css → styles-CMKNK2uU.css} +0 -0
|
@@ -9,6 +9,40 @@ import { safeFileName } from '~codeyam/utils';
|
|
|
9
9
|
import { cleanOutBoundary } from '~codeyam/ai';
|
|
10
10
|
import { reconcileMockDataKeys } from './reconcileMockDataKeys';
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Normalize useParams mock data by fixing the React Router splat param (*).
|
|
14
|
+
* The LLM often generates random string values for `*` (the splat param),
|
|
15
|
+
* but this param represents the URL path suffix after the matched route
|
|
16
|
+
* and should typically be empty string for default scenarios.
|
|
17
|
+
*
|
|
18
|
+
* Example: For route `/entity/:sha/*`, the `*` param contains everything
|
|
19
|
+
* after `/entity/:sha/`. An empty string means the default tab/view.
|
|
20
|
+
*/
|
|
21
|
+
function normalizeParamsMockData(
|
|
22
|
+
mockData: Record<string, unknown>,
|
|
23
|
+
): Record<string, unknown> {
|
|
24
|
+
const result: Record<string, unknown> = {};
|
|
25
|
+
|
|
26
|
+
for (const [key, value] of Object.entries(mockData)) {
|
|
27
|
+
// Check if this is a useParams mock data entry
|
|
28
|
+
if (key.includes('useParams') && value && typeof value === 'object') {
|
|
29
|
+
const paramsObj = value as Record<string, unknown>;
|
|
30
|
+
// If there's a `*` key (splat param), default it to empty string
|
|
31
|
+
// The splat param represents URL path suffix and is typically empty for default views
|
|
32
|
+
if ('*' in paramsObj) {
|
|
33
|
+
result[key] = {
|
|
34
|
+
...paramsObj,
|
|
35
|
+
'*': '', // Default splat to empty string for default tab/view
|
|
36
|
+
};
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
result[key] = value;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
|
|
12
46
|
/**
|
|
13
47
|
* Return true when `markup` contains 0 or >1 meaningful
|
|
14
48
|
* top-level nodes (element *or* non-blank text), so React
|
|
@@ -124,35 +158,6 @@ const normalizeKey = (key: string): string => {
|
|
|
124
158
|
return key;
|
|
125
159
|
};
|
|
126
160
|
|
|
127
|
-
/**
|
|
128
|
-
* Deep merge two objects, with source values taking precedence.
|
|
129
|
-
* Arrays are replaced, not merged.
|
|
130
|
-
*/
|
|
131
|
-
const deepMergeObjects = (
|
|
132
|
-
target: Record<string, unknown>,
|
|
133
|
-
source: Record<string, unknown>,
|
|
134
|
-
): Record<string, unknown> => {
|
|
135
|
-
const result = { ...target };
|
|
136
|
-
for (const key of Object.keys(source)) {
|
|
137
|
-
if (
|
|
138
|
-
source[key] &&
|
|
139
|
-
typeof source[key] === 'object' &&
|
|
140
|
-
!Array.isArray(source[key]) &&
|
|
141
|
-
target[key] &&
|
|
142
|
-
typeof target[key] === 'object' &&
|
|
143
|
-
!Array.isArray(target[key])
|
|
144
|
-
) {
|
|
145
|
-
result[key] = deepMergeObjects(
|
|
146
|
-
target[key] as Record<string, unknown>,
|
|
147
|
-
source[key] as Record<string, unknown>,
|
|
148
|
-
);
|
|
149
|
-
} else {
|
|
150
|
-
result[key] = source[key];
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
return result;
|
|
154
|
-
};
|
|
155
|
-
|
|
156
161
|
/**
|
|
157
162
|
* Extract all keys from a JsonTypeDefinition recursively.
|
|
158
163
|
* Used to get expected mock data keys from dataForMocks structure.
|
|
@@ -269,7 +274,7 @@ const normalizeMockData = (
|
|
|
269
274
|
typeof mergedValue === 'object' &&
|
|
270
275
|
!Array.isArray(mergedValue)
|
|
271
276
|
) {
|
|
272
|
-
mergedValue =
|
|
277
|
+
mergedValue = deepMerge(
|
|
273
278
|
mergedValue as Record<string, unknown>,
|
|
274
279
|
value as Record<string, unknown>,
|
|
275
280
|
);
|
|
@@ -310,8 +315,11 @@ const jsonToCode = (
|
|
|
310
315
|
if (Array.isArray(json)) {
|
|
311
316
|
const arrayStrings: string[] = [];
|
|
312
317
|
for (const item of json) {
|
|
313
|
-
|
|
314
|
-
if (
|
|
318
|
+
// Skip undefined but preserve null (important for ref props)
|
|
319
|
+
if (item === undefined) continue;
|
|
320
|
+
if (item === null) {
|
|
321
|
+
arrayStrings.push('null');
|
|
322
|
+
} else if (typeof item === 'object') {
|
|
315
323
|
arrayStrings.push(jsonToCode(item, level + 1, mergedDataStructure));
|
|
316
324
|
} else {
|
|
317
325
|
arrayStrings.push(`"${safeString(item, level)}"`);
|
|
@@ -465,30 +473,53 @@ const jsonToCode = (
|
|
|
465
473
|
objKeys[0].endsWith(')')
|
|
466
474
|
) {
|
|
467
475
|
const signatureKey = objKeys[0];
|
|
468
|
-
// Extract arguments without parentheses for the
|
|
476
|
+
// Extract arguments without parentheses for the function name
|
|
469
477
|
const args = signatureKey.slice(1, -1);
|
|
470
|
-
const flattenedKey = `${key}(${args})`;
|
|
471
478
|
const unwrappedValue = (jsonObj[key] as Record<string, unknown>)[
|
|
472
479
|
signatureKey
|
|
473
480
|
];
|
|
474
|
-
|
|
481
|
+
|
|
482
|
+
// Handle null values - generate arrow function stubs for function signatures with null
|
|
483
|
+
if (unwrappedValue === null) {
|
|
484
|
+
const funcName = key;
|
|
485
|
+
const argsString = args
|
|
486
|
+
.split(',')
|
|
487
|
+
.map((arg, i) => `${arg.trim()}: any`)
|
|
488
|
+
.join(', ');
|
|
489
|
+
keyStrings.push(
|
|
490
|
+
`${levelSpacing}"${safeString(funcName, level)}": (${argsString}) => {}`,
|
|
491
|
+
);
|
|
492
|
+
} else if (typeof unwrappedValue === 'string') {
|
|
493
|
+
const flattenedKey = `${key}(${args})`;
|
|
475
494
|
keyStrings.push(
|
|
476
495
|
`${levelSpacing}"${safeString(flattenedKey, level)}": "${safeString(unwrappedValue, level)}"`,
|
|
477
496
|
);
|
|
478
497
|
} else if (typeof unwrappedValue === 'object') {
|
|
498
|
+
const flattenedKey = `${key}(${args})`;
|
|
479
499
|
keyStrings.push(
|
|
480
500
|
`${levelSpacing}"${safeString(flattenedKey, level)}": ${jsonToCode(unwrappedValue, level + 1, mergedDataStructure)}`,
|
|
481
501
|
);
|
|
482
502
|
} else if (typeof unwrappedValue === 'boolean') {
|
|
503
|
+
const flattenedKey = `${key}(${args})`;
|
|
483
504
|
keyStrings.push(
|
|
484
505
|
`${levelSpacing}"${safeString(flattenedKey, level)}": ${unwrappedValue}`,
|
|
485
506
|
);
|
|
486
507
|
} else {
|
|
508
|
+
const flattenedKey = `${key}(${args})`;
|
|
487
509
|
keyStrings.push(
|
|
488
510
|
`${levelSpacing}"${safeString(flattenedKey, level)}": ${safeString(String(unwrappedValue), level)}`,
|
|
489
511
|
);
|
|
490
512
|
}
|
|
491
513
|
} else {
|
|
514
|
+
// Skip plain keys that have function-call versions (at deeper nesting levels)
|
|
515
|
+
// e.g., if both "t" and "t('common.close')" exist, skip the plain "t" object
|
|
516
|
+
// because the function-call version will be normalized to "t"
|
|
517
|
+
if (level > 2 && plainKeysWithFunctionCallVersions.has(key)) {
|
|
518
|
+
console.log(
|
|
519
|
+
`CodeYam: Skipping plain object key "${key}" (has function-call version that will be normalized)`,
|
|
520
|
+
);
|
|
521
|
+
continue;
|
|
522
|
+
}
|
|
492
523
|
keyStrings.push(
|
|
493
524
|
`${levelSpacing}"${safeString(key, level)}": ${jsonToCode(jsonObj[key], level + 1, mergedDataStructure)}`,
|
|
494
525
|
);
|
|
@@ -518,6 +549,25 @@ const jsonToCode = (
|
|
|
518
549
|
if (key.includes('(') && key.endsWith(')') && level > 2) {
|
|
519
550
|
const funcName = key.split('(')[0];
|
|
520
551
|
|
|
552
|
+
// Extract the function arguments to check if they're string literals
|
|
553
|
+
const argsMatch = key.match(/\((.+)\)$/);
|
|
554
|
+
const args = argsMatch ? argsMatch[1].trim() : '';
|
|
555
|
+
// Check if the argument is a simple string literal like "common.close" or 'common.close'
|
|
556
|
+
// These are static lookup keys (e.g., translation functions) and should NOT be normalized
|
|
557
|
+
const isStringLiteralArg = /^["'][^"']*["']$/.test(args);
|
|
558
|
+
|
|
559
|
+
if (isStringLiteralArg) {
|
|
560
|
+
// DON'T normalize - preserve the full key for static lookups (e.g., translations)
|
|
561
|
+
// This allows constructMockCode to generate a dispatch function that looks up by key
|
|
562
|
+
keyStrings.push(
|
|
563
|
+
`${levelSpacing}"${safeString(key, level)}": "${safeString(stringValue, level)}"`,
|
|
564
|
+
);
|
|
565
|
+
console.log(
|
|
566
|
+
`CodeYam: Preserving string-literal function key for lookup: "${key}": "${stringValue}"`,
|
|
567
|
+
);
|
|
568
|
+
continue;
|
|
569
|
+
}
|
|
570
|
+
|
|
521
571
|
// Skip if we've already added this normalized function name
|
|
522
572
|
if (seenNormalizedFuncNames.has(funcName)) {
|
|
523
573
|
continue;
|
|
@@ -536,10 +586,13 @@ const jsonToCode = (
|
|
|
536
586
|
seenNormalizedFuncNames.add(funcName);
|
|
537
587
|
|
|
538
588
|
// Check if the string value looks like a function expression
|
|
589
|
+
// Be careful not to match descriptive strings like "function listening" -
|
|
590
|
+
// a valid function expression must have parentheses like function(), function name(), or function (
|
|
539
591
|
const looksLikeFunction =
|
|
540
592
|
stringValue.includes('=>') ||
|
|
541
|
-
stringValue
|
|
542
|
-
stringValue
|
|
593
|
+
/^function\s*[\w]*\s*\(/.test(stringValue) ||
|
|
594
|
+
/^async\s+function\s*[\w]*\s*\(/.test(stringValue) ||
|
|
595
|
+
/^async\s*\(/.test(stringValue);
|
|
543
596
|
|
|
544
597
|
// Check if the string value looks like a Promise expression
|
|
545
598
|
// e.g., "Promise.resolve()", "new Promise(...)", etc.
|
|
@@ -663,10 +716,12 @@ export default async function writeMockDataTsx(
|
|
|
663
716
|
const expectedKeys = extractAllKeys(dataForMocks);
|
|
664
717
|
|
|
665
718
|
// Reconcile mock data keys to match expected keys from dataForMocks
|
|
666
|
-
// This handles cases where LLM generated literal values instead of variable references
|
|
719
|
+
// This handles cases where LLM generated literal values instead of variable references,
|
|
720
|
+
// and remaps old variable-based keys to canonical keys
|
|
667
721
|
const defaultMockData = reconcileMockDataKeys(
|
|
668
722
|
rawDefaultMockData,
|
|
669
723
|
expectedKeys,
|
|
724
|
+
analysis.entityName,
|
|
670
725
|
);
|
|
671
726
|
|
|
672
727
|
const mockDataComment = `// This file is auto-generated by CodeYam. Do not edit this file manually.
|
|
@@ -686,10 +741,13 @@ import React from 'react';
|
|
|
686
741
|
if (mockScenario.name === DEFAULT_SCENARIO_NAME) {
|
|
687
742
|
// Normalize mock data to merge entries with same normalized function name
|
|
688
743
|
const normalizedMockData = normalizeMockData(defaultMockData);
|
|
744
|
+
// Fix useParams splat param (*) to default to empty string
|
|
745
|
+
const paramsNormalizedMockData =
|
|
746
|
+
normalizeParamsMockData(normalizedMockData);
|
|
689
747
|
dataCode = jsonToCode(
|
|
690
748
|
{
|
|
691
749
|
arguments: defaultArguments,
|
|
692
|
-
...
|
|
750
|
+
...paramsNormalizedMockData,
|
|
693
751
|
},
|
|
694
752
|
2,
|
|
695
753
|
mergedDataStructure,
|
|
@@ -703,9 +761,11 @@ import React from 'react';
|
|
|
703
761
|
};
|
|
704
762
|
|
|
705
763
|
// Reconcile scenario-specific mock data keys as well
|
|
764
|
+
// Pass entityName for canonical key remapping
|
|
706
765
|
const scenarioMockData = reconcileMockDataKeys(
|
|
707
766
|
rawScenarioMockData,
|
|
708
767
|
expectedKeys,
|
|
768
|
+
analysis.entityName,
|
|
709
769
|
);
|
|
710
770
|
|
|
711
771
|
const mergedArguments = defaultArguments.map((defaultArg, index) => {
|
|
@@ -718,10 +778,13 @@ import React from 'react';
|
|
|
718
778
|
const normalizedMockData = normalizeMockData(
|
|
719
779
|
mergedMockData as Record<string, unknown>,
|
|
720
780
|
);
|
|
781
|
+
// Fix useParams splat param (*) to default to empty string
|
|
782
|
+
const paramsNormalizedMockData =
|
|
783
|
+
normalizeParamsMockData(normalizedMockData);
|
|
721
784
|
|
|
722
785
|
const mergedData = {
|
|
723
786
|
arguments: mergedArguments,
|
|
724
|
-
...
|
|
787
|
+
...paramsNormalizedMockData,
|
|
725
788
|
};
|
|
726
789
|
// Use level=2 (same as default scenario) for consistent key formatting.
|
|
727
790
|
// This ensures nested function arguments are kept (e.g., "from('workouts')")
|