@codeyam/codeyam-cli 0.1.0-staging.15d0f46 → 0.1.0-staging.1669d45
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/common/execAsync.ts +1 -1
- package/analyzer-template/log.txt +3 -3
- package/analyzer-template/package.json +9 -5
- package/analyzer-template/packages/ai/index.ts +5 -3
- package/analyzer-template/packages/ai/package.json +1 -1
- package/analyzer-template/packages/ai/src/lib/__mocks__/completionCall.ts +122 -0
- package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +152 -6
- package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +107 -1
- package/analyzer-template/packages/ai/src/lib/astScopes/conditionalEffectsExtractor.ts +644 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/methodSemantics.ts +42 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/patterns/ifStatementHandler.ts +18 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.ts +38 -1
- package/analyzer-template/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.ts +301 -1
- package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +972 -106
- package/analyzer-template/packages/ai/src/lib/astScopes/types.ts +232 -0
- package/analyzer-template/packages/ai/src/lib/checkAllAttributes.ts +29 -10
- package/analyzer-template/packages/ai/src/lib/completionCall.ts +18 -2
- package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +1409 -138
- 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 +771 -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 +39 -4
- 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 +42 -2
- package/analyzer-template/packages/ai/src/lib/deepEqual.ts +30 -0
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarioData.ts +74 -7
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityScenarios.ts +89 -112
- package/analyzer-template/packages/ai/src/lib/generateEntityDataStructure.ts +6 -0
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +486 -86
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarios.ts +182 -104
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +201 -0
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.ts +528 -0
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionals.ts +1019 -0
- 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/isolateScopes.ts +276 -3
- package/analyzer-template/packages/ai/src/lib/mergeStatements.ts +33 -3
- package/analyzer-template/packages/ai/src/lib/promptGenerators/gatherAttributesMap.ts +7 -0
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.ts +1 -1
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.ts +32 -102
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.ts +71 -4
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.ts +14 -53
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateMissingKeysPrompt.ts +58 -0
- package/analyzer-template/packages/ai/src/lib/promptGenerators/guessNewScenarioDataFromDescriptionGenerator.ts +28 -2
- package/analyzer-template/packages/ai/src/lib/resolvePathToControllable.ts +690 -0
- package/analyzer-template/packages/ai/src/lib/splitOutsideParentheses.ts +5 -1
- package/analyzer-template/packages/ai/src/lib/validateExecutionFlowPaths.ts +531 -0
- package/analyzer-template/packages/ai/src/lib/worker/SerializableDataStructure.ts +102 -0
- package/analyzer-template/packages/ai/src/lib/worker/analyzeScopeWorker.ts +8 -1
- package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +14 -0
- package/analyzer-template/packages/analyze/src/lib/asts/nodes/index.ts +1 -0
- package/analyzer-template/packages/analyze/src/lib/asts/nodes/isAsyncFunction.ts +67 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +458 -267
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +18 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/findOrCreateEntity.ts +3 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyzeChange.ts +31 -15
- package/analyzer-template/packages/analyze/src/lib/files/analyzeEntity.ts +11 -7
- package/analyzer-template/packages/analyze/src/lib/files/analyzeInitial.ts +11 -12
- package/analyzer-template/packages/analyze/src/lib/files/enums/steps.ts +1 -1
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.ts +196 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichUnknownTypesFromSourceEquivalencies.ts +102 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +588 -52
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateChangesScenarioData.ts +1 -1
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.ts +28 -62
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +299 -133
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts +156 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarioData.ts +78 -83
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateScenarios.ts +4 -8
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +384 -94
- package/analyzer-template/packages/aws/codebuild/index.ts +1 -0
- package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.d.ts +11 -1
- package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.d.ts.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.js +29 -18
- package/analyzer-template/packages/aws/dist/src/lib/codebuild/waitForBuild.js.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.d.ts +2 -2
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.d.ts.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.js +2 -2
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsDefineContainer.js.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.d.ts +8 -18
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.d.ts.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.js +17 -61
- package/analyzer-template/packages/aws/dist/src/lib/ecs/ecsTaskFactory.js.map +1 -1
- 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/dist/src/lib/s3/uploadFileToS3.d.ts.map +1 -1
- package/analyzer-template/packages/aws/dist/src/lib/s3/uploadFileToS3.js +8 -1
- package/analyzer-template/packages/aws/dist/src/lib/s3/uploadFileToS3.js.map +1 -1
- package/analyzer-template/packages/aws/package.json +2 -2
- package/analyzer-template/packages/aws/s3/index.ts +1 -0
- package/analyzer-template/packages/aws/src/lib/codebuild/waitForBuild.ts +43 -19
- package/analyzer-template/packages/aws/src/lib/ecs/ecsDefineContainer.ts +3 -3
- package/analyzer-template/packages/aws/src/lib/ecs/ecsTaskFactory.ts +17 -69
- package/analyzer-template/packages/aws/src/lib/s3/checkS3ObjectExists.ts +47 -0
- package/analyzer-template/packages/aws/src/lib/s3/uploadFileToS3.ts +8 -1
- 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 +36 -9
- package/analyzer-template/packages/database/src/lib/loadReadyToBeCapturedAnalyses.ts +7 -3
- package/analyzer-template/packages/generate/index.ts +3 -0
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.ts +17 -1
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.ts +193 -0
- package/analyzer-template/packages/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.ts +73 -0
- 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/scenarioComponentForServer.ts +114 -0
- 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 +1 -11
- 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 +30 -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/entitiesTable.d.ts +1 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/entitiesTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts +2 -6
- 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 +7 -4
- package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/index.d.ts +3 -0
- package/analyzer-template/packages/github/dist/generate/index.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/index.js +3 -0
- package/analyzer-template/packages/github/dist/generate/index.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js +16 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js.map +1 -1
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.d.ts +9 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.d.ts.map +1 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +189 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.d.ts +20 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.d.ts.map +1 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js +53 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js.map +1 -0
- 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/scenarioComponentForServer.d.ts +8 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.d.ts.map +1 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.js +89 -0
- package/analyzer-template/packages/github/dist/generate/src/lib/scenarioComponentForServer.js.map +1 -0
- package/analyzer-template/packages/github/dist/github/src/lib/loadOrCreateCommit.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/github/src/lib/loadOrCreateCommit.js +10 -0
- package/analyzer-template/packages/github/dist/github/src/lib/loadOrCreateCommit.js.map +1 -1
- package/analyzer-template/packages/github/dist/github/src/lib/syncPrimaryBranch.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/github/src/lib/syncPrimaryBranch.js +3 -0
- package/analyzer-template/packages/github/dist/github/src/lib/syncPrimaryBranch.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/index.d.ts +2 -2
- package/analyzer-template/packages/github/dist/types/index.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/index.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/Analysis.d.ts +63 -13
- package/analyzer-template/packages/github/dist/types/src/types/Analysis.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/Entity.d.ts +2 -0
- package/analyzer-template/packages/github/dist/types/src/types/Entity.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts +11 -6
- package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts +146 -0
- package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/StatementInfo.d.ts +2 -0
- package/analyzer-template/packages/github/dist/types/src/types/StatementInfo.d.ts.map +1 -1
- package/analyzer-template/packages/github/src/lib/loadOrCreateCommit.ts +14 -0
- package/analyzer-template/packages/github/src/lib/syncPrimaryBranch.ts +2 -0
- package/analyzer-template/packages/process/index.ts +2 -0
- package/analyzer-template/packages/process/package.json +12 -0
- package/analyzer-template/packages/process/tsconfig.json +8 -0
- package/analyzer-template/packages/types/index.ts +4 -0
- package/analyzer-template/packages/types/src/types/Analysis.ts +79 -13
- package/analyzer-template/packages/types/src/types/Entity.ts +2 -0
- package/analyzer-template/packages/types/src/types/Scenario.ts +11 -10
- package/analyzer-template/packages/types/src/types/ScenariosDataStructure.ts +161 -0
- package/analyzer-template/packages/types/src/types/StatementInfo.ts +2 -0
- package/analyzer-template/packages/utils/dist/types/index.d.ts +2 -2
- package/analyzer-template/packages/utils/dist/types/index.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/index.js.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/Analysis.d.ts +63 -13
- package/analyzer-template/packages/utils/dist/types/src/types/Analysis.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/Entity.d.ts +2 -0
- package/analyzer-template/packages/utils/dist/types/src/types/Entity.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts +11 -6
- package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts +146 -0
- package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/StatementInfo.d.ts +2 -0
- package/analyzer-template/packages/utils/dist/types/src/types/StatementInfo.d.ts.map +1 -1
- package/analyzer-template/playwright/capture.ts +37 -18
- package/analyzer-template/playwright/getCodeYamInfo.ts +12 -7
- package/analyzer-template/playwright/takeElementScreenshot.ts +26 -11
- package/analyzer-template/playwright/waitForServer.ts +21 -6
- package/analyzer-template/project/analyzeBaselineCommit.ts +4 -0
- package/analyzer-template/project/analyzeBranchCommit.ts +4 -0
- package/analyzer-template/project/analyzeFileEntities.ts +4 -0
- package/analyzer-template/project/analyzeRegularCommit.ts +4 -0
- package/analyzer-template/project/constructMockCode.ts +868 -132
- package/analyzer-template/project/controller/startController.ts +16 -1
- package/analyzer-template/project/executeLibraryFunctionDirect.ts +7 -3
- package/analyzer-template/project/mocks/analyzeFileMock.ts +8 -7
- package/analyzer-template/project/orchestrateCapture/KyselyAnalysisLoader.ts +3 -6
- package/analyzer-template/project/orchestrateCapture/SequentialCaptureTaskRunner.ts +49 -33
- package/analyzer-template/project/orchestrateCapture.ts +10 -3
- package/analyzer-template/project/reconcileMockDataKeys.ts +102 -2
- package/analyzer-template/project/runAnalysis.ts +7 -0
- package/analyzer-template/project/serverOnlyModules.ts +127 -2
- package/analyzer-template/project/start.ts +26 -4
- package/analyzer-template/project/startScenarioCapture.ts +72 -40
- package/analyzer-template/project/writeMockDataTsx.ts +118 -55
- package/analyzer-template/project/writeScenarioClientWrapper.ts +21 -0
- package/analyzer-template/project/writeScenarioComponents.ts +263 -92
- package/analyzer-template/project/writeScenarioFiles.ts +26 -0
- package/analyzer-template/project/writeSimpleRoot.ts +13 -15
- package/analyzer-template/scripts/comboWorkerLoop.cjs +1 -0
- package/analyzer-template/scripts/defaultCmd.sh +9 -0
- package/analyzer-template/tsconfig.json +2 -1
- package/background/src/lib/local/createLocalAnalyzer.js +1 -29
- package/background/src/lib/local/createLocalAnalyzer.js.map +1 -1
- package/background/src/lib/local/execAsync.js +1 -1
- package/background/src/lib/local/execAsync.js.map +1 -1
- package/background/src/lib/virtualized/common/execAsync.js +1 -1
- package/background/src/lib/virtualized/common/execAsync.js.map +1 -1
- package/background/src/lib/virtualized/project/analyzeBaselineCommit.js +2 -1
- package/background/src/lib/virtualized/project/analyzeBaselineCommit.js.map +1 -1
- package/background/src/lib/virtualized/project/analyzeBranchCommit.js +2 -1
- package/background/src/lib/virtualized/project/analyzeBranchCommit.js.map +1 -1
- package/background/src/lib/virtualized/project/analyzeFileEntities.js +2 -1
- package/background/src/lib/virtualized/project/analyzeFileEntities.js.map +1 -1
- package/background/src/lib/virtualized/project/analyzeRegularCommit.js +2 -1
- package/background/src/lib/virtualized/project/analyzeRegularCommit.js.map +1 -1
- package/background/src/lib/virtualized/project/constructMockCode.js +799 -121
- package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
- package/background/src/lib/virtualized/project/controller/startController.js +11 -1
- package/background/src/lib/virtualized/project/controller/startController.js.map +1 -1
- package/background/src/lib/virtualized/project/executeLibraryFunctionDirect.js +6 -3
- package/background/src/lib/virtualized/project/executeLibraryFunctionDirect.js.map +1 -1
- package/background/src/lib/virtualized/project/mocks/analyzeFileMock.js +7 -7
- package/background/src/lib/virtualized/project/mocks/analyzeFileMock.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture/KyselyAnalysisLoader.js +3 -2
- package/background/src/lib/virtualized/project/orchestrateCapture/KyselyAnalysisLoader.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js +42 -28
- package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture.js +7 -4
- package/background/src/lib/virtualized/project/orchestrateCapture.js.map +1 -1
- package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +87 -2
- package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
- package/background/src/lib/virtualized/project/runAnalysis.js +6 -0
- package/background/src/lib/virtualized/project/runAnalysis.js.map +1 -1
- package/background/src/lib/virtualized/project/serverOnlyModules.js +106 -3
- package/background/src/lib/virtualized/project/serverOnlyModules.js.map +1 -1
- package/background/src/lib/virtualized/project/start.js +21 -4
- package/background/src/lib/virtualized/project/start.js.map +1 -1
- package/background/src/lib/virtualized/project/startScenarioCapture.js +56 -30
- package/background/src/lib/virtualized/project/startScenarioCapture.js.map +1 -1
- package/background/src/lib/virtualized/project/writeMockDataTsx.js +110 -48
- package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
- package/background/src/lib/virtualized/project/writeScenarioClientWrapper.js +15 -0
- package/background/src/lib/virtualized/project/writeScenarioClientWrapper.js.map +1 -0
- package/background/src/lib/virtualized/project/writeScenarioComponents.js +211 -75
- package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
- package/background/src/lib/virtualized/project/writeScenarioFiles.js +19 -0
- package/background/src/lib/virtualized/project/writeScenarioFiles.js.map +1 -1
- package/background/src/lib/virtualized/project/writeSimpleRoot.js +13 -13
- package/background/src/lib/virtualized/project/writeSimpleRoot.js.map +1 -1
- package/codeyam-cli/src/cli.js +5 -1
- package/codeyam-cli/src/cli.js.map +1 -1
- package/codeyam-cli/src/commands/analyze.js +1 -1
- package/codeyam-cli/src/commands/analyze.js.map +1 -1
- package/codeyam-cli/src/commands/baseline.js +174 -0
- package/codeyam-cli/src/commands/baseline.js.map +1 -0
- package/codeyam-cli/src/commands/debug.js +28 -18
- package/codeyam-cli/src/commands/debug.js.map +1 -1
- package/codeyam-cli/src/commands/default.js +0 -15
- package/codeyam-cli/src/commands/default.js.map +1 -1
- package/codeyam-cli/src/commands/recapture.js +44 -23
- package/codeyam-cli/src/commands/recapture.js.map +1 -1
- package/codeyam-cli/src/commands/report.js +72 -24
- package/codeyam-cli/src/commands/report.js.map +1 -1
- package/codeyam-cli/src/commands/start.js +8 -12
- package/codeyam-cli/src/commands/start.js.map +1 -1
- package/codeyam-cli/src/commands/status.js +23 -1
- package/codeyam-cli/src/commands/status.js.map +1 -1
- package/codeyam-cli/src/commands/test-startup.js +1 -1
- package/codeyam-cli/src/commands/test-startup.js.map +1 -1
- package/codeyam-cli/src/commands/wipe.js +108 -0
- package/codeyam-cli/src/commands/wipe.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/serverVersionStaleness.test.js +81 -0
- package/codeyam-cli/src/utils/__tests__/serverVersionStaleness.test.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +27 -27
- package/codeyam-cli/src/utils/analysisRunner.js +8 -13
- package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
- package/codeyam-cli/src/utils/backgroundServer.js +12 -2
- package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/utils/database.js +91 -5
- package/codeyam-cli/src/utils/database.js.map +1 -1
- package/codeyam-cli/src/utils/generateReport.js +253 -106
- package/codeyam-cli/src/utils/generateReport.js.map +1 -1
- package/codeyam-cli/src/utils/git.js +79 -0
- package/codeyam-cli/src/utils/git.js.map +1 -0
- package/codeyam-cli/src/utils/install-skills.js +11 -11
- 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 +239 -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/utils/serverState.js.map +1 -1
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +5 -5
- package/codeyam-cli/src/utils/versionInfo.js +25 -19
- package/codeyam-cli/src/utils/versionInfo.js.map +1 -1
- package/codeyam-cli/src/utils/wipe.js +128 -0
- package/codeyam-cli/src/utils/wipe.js.map +1 -0
- package/codeyam-cli/src/webserver/app/lib/database.js +96 -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 +2 -5
- package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityItem-vauWK972.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-DKdsUF7Y.js → EntityTypeBadge-COi5OvsN.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-BwdQv49w.js +41 -0
- package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-CEleMv_j.js +34 -0
- package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-D68KarMg.js +25 -0
- package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-L75Wvqgw.js +3 -0
- package/codeyam-cli/src/webserver/build/client/assets/LoadingDots-C53WM8qn.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/LogViewer-CrNkmy4i.js +3 -0
- package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-DzJRkCkr.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-CQifa1n-.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-CyaBFX7l.js +20 -0
- package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-CWjSsLqY.js → TruncatedFilePath-D36O1rzU.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/_index-Be83mo_j.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-BN6wu6Y-.js +37 -0
- package/codeyam-cli/src/webserver/build/client/assets/chevron-down-DgTPh8H-.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/chunk-EPOLDU6W-DdQKK6on.js +51 -0
- package/codeyam-cli/src/webserver/build/client/assets/circle-check-Dmr2bb1R.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-Do4ZLUYa.js +21 -0
- package/codeyam-cli/src/webserver/build/client/assets/{cy-logo-cli-C1gnJVOL.svg → cy-logo-cli-CCKUIm0S.svg} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/cy-logo-cli-DcX-ZS3p.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-Bn6aCAy_.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha._-CbdFyxZh.js +23 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-B4iCfs5M.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-wDWZZO1W.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.edit._scenarioId-BMbl7MeQ.js +5 -0
- package/codeyam-cli/src/webserver/build/client/assets/entry.client-5wRKRIH9.js +29 -0
- package/codeyam-cli/src/webserver/build/client/assets/executionFlowCoverage-BWhdfn70.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-DD3SDH7t.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/files-DKyMFI90.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/git-zXjT7J0G.js +15 -0
- package/codeyam-cli/src/webserver/build/client/assets/globals-DTTQ3gY7.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-DLbXwndH.js +9 -0
- package/codeyam-cli/src/webserver/build/client/assets/index-gPZ-lad1.js +3 -0
- package/codeyam-cli/src/webserver/build/client/assets/loader-circle-BsPXJ81F.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/manifest-22590fcf.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-BsAarjAM.js +57 -0
- package/codeyam-cli/src/webserver/build/client/assets/scenarioStatus-B_8jpV3e.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/search-P2FKIUql.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/settings-B2eDuBj8.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/simulations-L18M6-kN.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/triangle-alert-BDz7kbVA.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-29dDmbH8.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-CmrTPlIB.js → useLastLogLine-BUm0UVJm.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/useReportContext-CkIOKTrZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{useToast-C1ig_BmP.js → useToast-KKw5kTn-.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/index-BND5I5fv.js +1 -0
- package/codeyam-cli/src/webserver/build/server/assets/server-build-CFXnd7MG.js +228 -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/src/webserver/server.js +35 -25
- package/codeyam-cli/src/webserver/server.js.map +1 -1
- package/codeyam-cli/templates/{codeyam-debug-skill.md → codeyam:debug.md} +1 -1
- package/codeyam-cli/templates/codeyam:diagnose.md +625 -0
- package/codeyam-cli/templates/{codeyam-setup-skill.md → codeyam:setup.md} +139 -4
- package/codeyam-cli/templates/{codeyam-sim-skill.md → codeyam:sim.md} +1 -1
- package/codeyam-cli/templates/{codeyam-test-skill.md → codeyam:test.md} +1 -1
- package/codeyam-cli/templates/{codeyam-verify-skill.md → codeyam:verify.md} +1 -1
- package/package.json +8 -8
- package/packages/ai/index.js +2 -4
- package/packages/ai/index.js.map +1 -1
- package/packages/ai/src/lib/analyzeScope.js +107 -0
- package/packages/ai/src/lib/analyzeScope.js.map +1 -1
- package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js +76 -1
- package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js.map +1 -1
- package/packages/ai/src/lib/astScopes/conditionalEffectsExtractor.js +435 -0
- package/packages/ai/src/lib/astScopes/conditionalEffectsExtractor.js.map +1 -0
- package/packages/ai/src/lib/astScopes/methodSemantics.js +29 -0
- package/packages/ai/src/lib/astScopes/methodSemantics.js.map +1 -1
- package/packages/ai/src/lib/astScopes/patterns/ifStatementHandler.js +8 -0
- package/packages/ai/src/lib/astScopes/patterns/ifStatementHandler.js.map +1 -1
- package/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.js +23 -0
- package/packages/ai/src/lib/astScopes/patterns/switchStatementHandler.js.map +1 -1
- package/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.js +239 -1
- package/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.js.map +1 -1
- package/packages/ai/src/lib/astScopes/processExpression.js +728 -87
- package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
- package/packages/ai/src/lib/checkAllAttributes.js +24 -9
- package/packages/ai/src/lib/checkAllAttributes.js.map +1 -1
- package/packages/ai/src/lib/completionCall.js +17 -1
- package/packages/ai/src/lib/completionCall.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +1126 -82
- 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 +482 -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 +35 -2
- 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 +34 -3
- package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js.map +1 -1
- package/packages/ai/src/lib/deepEqual.js +32 -0
- package/packages/ai/src/lib/deepEqual.js.map +1 -0
- package/packages/ai/src/lib/generateChangesEntityScenarioData.js +62 -5
- package/packages/ai/src/lib/generateChangesEntityScenarioData.js.map +1 -1
- package/packages/ai/src/lib/generateChangesEntityScenarios.js +81 -90
- package/packages/ai/src/lib/generateChangesEntityScenarios.js.map +1 -1
- package/packages/ai/src/lib/generateEntityDataStructure.js +5 -0
- package/packages/ai/src/lib/generateEntityDataStructure.js.map +1 -1
- package/packages/ai/src/lib/generateEntityScenarioData.js +398 -81
- package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
- package/packages/ai/src/lib/generateEntityScenarios.js +168 -82
- package/packages/ai/src/lib/generateEntityScenarios.js.map +1 -1
- package/packages/ai/src/lib/generateExecutionFlows.js +123 -0
- package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.js +380 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.js.map +1 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js +742 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js.map +1 -0
- 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/isolateScopes.js +231 -4
- package/packages/ai/src/lib/isolateScopes.js.map +1 -1
- package/packages/ai/src/lib/mergeStatements.js +26 -3
- package/packages/ai/src/lib/mergeStatements.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/generateChangesEntityScenarioDataGenerator.js +1 -1
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenarioDataGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js +21 -64
- package/packages/ai/src/lib/promptGenerators/generateChangesEntityScenariosGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js +58 -4
- package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.js +10 -34
- package/packages/ai/src/lib/promptGenerators/generateEntityScenariosGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateMissingKeysPrompt.js +45 -0
- package/packages/ai/src/lib/promptGenerators/generateMissingKeysPrompt.js.map +1 -0
- 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/resolvePathToControllable.js +563 -0
- package/packages/ai/src/lib/resolvePathToControllable.js.map +1 -0
- package/packages/ai/src/lib/splitOutsideParentheses.js +3 -1
- package/packages/ai/src/lib/splitOutsideParentheses.js.map +1 -1
- package/packages/ai/src/lib/worker/SerializableDataStructure.js +22 -0
- 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/FileAnalyzer.js +15 -0
- package/packages/analyze/src/lib/FileAnalyzer.js.map +1 -1
- package/packages/analyze/src/lib/asts/nodes/index.js +1 -0
- package/packages/analyze/src/lib/asts/nodes/index.js.map +1 -1
- package/packages/analyze/src/lib/asts/nodes/isAsyncFunction.js +52 -0
- package/packages/analyze/src/lib/asts/nodes/isAsyncFunction.js.map +1 -0
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +214 -50
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +10 -0
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js +2 -0
- package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeChange.js +21 -11
- package/packages/analyze/src/lib/files/analyzeChange.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeEntity.js +9 -8
- package/packages/analyze/src/lib/files/analyzeEntity.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeInitial.js +9 -10
- package/packages/analyze/src/lib/files/analyzeInitial.js.map +1 -1
- package/packages/analyze/src/lib/files/enums/steps.js +1 -1
- package/packages/analyze/src/lib/files/enums/steps.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js +159 -0
- package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js.map +1 -0
- package/packages/analyze/src/lib/files/scenarios/enrichUnknownTypesFromSourceEquivalencies.js +85 -0
- package/packages/analyze/src/lib/files/scenarios/enrichUnknownTypesFromSourceEquivalencies.js.map +1 -0
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js +458 -48
- 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/generateChangesScenarios.js +29 -34
- package/packages/analyze/src/lib/files/scenarios/generateChangesScenarios.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +235 -81
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js +96 -0
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js.map +1 -0
- package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js +56 -69
- package/packages/analyze/src/lib/files/scenarios/generateScenarioData.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateScenarios.js +4 -8
- package/packages/analyze/src/lib/files/scenarios/generateScenarios.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +307 -89
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
- package/packages/aws/src/lib/ecs/ecsDefineContainer.js +2 -2
- package/packages/aws/src/lib/ecs/ecsDefineContainer.js.map +1 -1
- package/packages/aws/src/lib/ecs/ecsTaskFactory.js +17 -61
- package/packages/aws/src/lib/ecs/ecsTaskFactory.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 +7 -4
- package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
- package/packages/generate/index.js +3 -0
- package/packages/generate/index.js.map +1 -1
- package/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js +16 -1
- package/packages/generate/src/lib/componentScenarioPage/componentScenarioPageNext.js.map +1 -1
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +189 -0
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -0
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js +53 -0
- package/packages/generate/src/lib/componentScenarioPage/generateScenarioServerComponent.js.map +1 -0
- 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/scenarioComponentForServer.js +89 -0
- package/packages/generate/src/lib/scenarioComponentForServer.js.map +1 -0
- package/packages/github/src/lib/loadOrCreateCommit.js +10 -0
- package/packages/github/src/lib/loadOrCreateCommit.js.map +1 -1
- package/packages/github/src/lib/syncPrimaryBranch.js +3 -0
- package/packages/github/src/lib/syncPrimaryBranch.js.map +1 -1
- package/packages/process/index.js +3 -0
- package/packages/process/index.js.map +1 -0
- package/packages/process/src/GlobalProcessManager.js.map +1 -0
- package/{background/src/lib/process → packages/process/src}/ProcessManager.js +1 -1
- package/packages/process/src/ProcessManager.js.map +1 -0
- package/packages/process/src/index.js.map +1 -0
- package/packages/process/src/managedExecAsync.js.map +1 -0
- package/packages/types/index.js.map +1 -1
- package/scripts/finalize-analyzer.cjs +3 -1
- package/analyzer-template/packages/ai/src/lib/findMatchingAttribute.ts +0 -102
- package/analyzer-template/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.ts +0 -197
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityKeyAttributes.ts +0 -271
- package/analyzer-template/packages/ai/src/lib/generateEntityKeyAttributes.ts +0 -294
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityKeyAttributesGenerator.ts +0 -67
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.ts +0 -115
- package/analyzer-template/process/INTEGRATION_COMPLETE.md +0 -333
- package/analyzer-template/process/INTEGRATION_EXAMPLE.md +0 -525
- package/analyzer-template/process/README.md +0 -507
- package/background/src/lib/process/GlobalProcessManager.js.map +0 -1
- package/background/src/lib/process/ProcessManager.js.map +0 -1
- package/background/src/lib/process/index.js.map +0 -1
- package/background/src/lib/process/managedExecAsync.js.map +0 -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-D0VW1-W7.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-BAk4S4pI.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-Y756iZxZ.js +0 -25
- package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-zzrrjW1p.js +0 -3
- package/codeyam-cli/src/webserver/build/client/assets/LogViewer-QMn7bJg6.js +0 -3
- package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-DmP5mRxX.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/SafeScreenshot-BXwvsbLw.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-DAmUX_1y.js +0 -5
- package/codeyam-cli/src/webserver/build/client/assets/_index-Df-nk4J5.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-_ZUyFdie.js +0 -7
- package/codeyam-cli/src/webserver/build/client/assets/chevron-down-Eoh0PhcW.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/chunk-WWGJGFF6-CZgPLy5i.js +0 -26
- package/codeyam-cli/src/webserver/build/client/assets/circle-check-DI-p9ZLZ.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-DvyV2x6y.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-DURu2qlF.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha._-DDobn9Xh.js +0 -16
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-CGdWnLD_.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.edit._scenarioId-DgMmzrKs.js +0 -5
- package/codeyam-cli/src/webserver/build/client/assets/entry.client-DEVXuhkn.js +0 -13
- package/codeyam-cli/src/webserver/build/client/assets/fileTableUtils-WPRQyc68.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/files-B9u3lJer.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/git-YGnKIuHU.js +0 -11
- package/codeyam-cli/src/webserver/build/client/assets/globals-28lrWTTo.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-CJ0uPJjV.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/index-CfqeA2XG.js +0 -3
- package/codeyam-cli/src/webserver/build/client/assets/loader-circle-DIjSvh6B.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-8125c15c.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/preload-helper-BXl3LOEh.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-C-g286WP.js +0 -16
- package/codeyam-cli/src/webserver/build/client/assets/search-xBKWfOxd.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/settings-DVY_wGOx.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/simulations-Be1pJo5A.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/triangle-alert-CR-FkSvx.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useReportContext-DABetnSj.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/index-DcR7DH9q.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-BDBrfp7e.js +0 -175
- package/codeyam-cli/templates/debug-codeyam.md +0 -527
- package/packages/ai/src/lib/findMatchingAttribute.js +0 -77
- package/packages/ai/src/lib/findMatchingAttribute.js.map +0 -1
- package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js +0 -136
- package/packages/ai/src/lib/gatherRelevantDependentKeyAttributes.js.map +0 -1
- package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js +0 -220
- package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js.map +0 -1
- package/packages/ai/src/lib/generateEntityKeyAttributes.js +0 -241
- package/packages/ai/src/lib/generateEntityKeyAttributes.js.map +0 -1
- package/packages/ai/src/lib/isFrontend.js +0 -5
- package/packages/ai/src/lib/isFrontend.js.map +0 -1
- package/packages/ai/src/lib/promptGenerators/generateEntityKeyAttributesGenerator.js +0 -40
- package/packages/ai/src/lib/promptGenerators/generateEntityKeyAttributesGenerator.js.map +0 -1
- package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js +0 -72
- package/packages/analyze/src/lib/files/scenarios/generateKeyAttributes.js.map +0 -1
- /package/analyzer-template/{process → packages/process/src}/GlobalProcessManager.ts +0 -0
- /package/analyzer-template/{process → packages/process/src}/ProcessManager.ts +0 -0
- /package/analyzer-template/{process → packages/process/src}/index.ts +0 -0
- /package/analyzer-template/{process → packages/process/src}/managedExecAsync.ts +0 -0
- /package/{background/src/lib/process → packages/process/src}/GlobalProcessManager.js +0 -0
- /package/{background/src/lib/process → packages/process/src}/index.js +0 -0
- /package/{background/src/lib/process → packages/process/src}/managedExecAsync.js +0 -0
|
@@ -97,11 +97,15 @@ function resetDebugTiming(): void {
|
|
|
97
97
|
*/
|
|
98
98
|
function findEndOfImports(content: string): number {
|
|
99
99
|
try {
|
|
100
|
+
// Use temp.tsx to enable JSX parsing - otherwise TypeScript may misparse
|
|
101
|
+
// JSX content containing the word "import" (e.g., "Entities that import this")
|
|
102
|
+
// as an import statement, causing mock code to be inserted in the wrong location.
|
|
100
103
|
const sourceFile = ts.createSourceFile(
|
|
101
|
-
'temp.
|
|
104
|
+
'temp.tsx',
|
|
102
105
|
content,
|
|
103
106
|
ts.ScriptTarget.Latest,
|
|
104
107
|
true,
|
|
108
|
+
ts.ScriptKind.TSX,
|
|
105
109
|
);
|
|
106
110
|
|
|
107
111
|
let lastImportEnd = 0;
|
|
@@ -710,11 +714,13 @@ function extractInternalImportPathsAst(fileContent: string): string[] {
|
|
|
710
714
|
const importPaths: string[] = [];
|
|
711
715
|
|
|
712
716
|
try {
|
|
717
|
+
// Use temp.tsx to enable JSX parsing for consistent handling of JSX files
|
|
713
718
|
const sourceFile = ts.createSourceFile(
|
|
714
|
-
'temp.
|
|
719
|
+
'temp.tsx',
|
|
715
720
|
fileContent,
|
|
716
721
|
ts.ScriptTarget.Latest,
|
|
717
722
|
true,
|
|
723
|
+
ts.ScriptKind.TSX,
|
|
718
724
|
);
|
|
719
725
|
|
|
720
726
|
for (const statement of sourceFile.statements) {
|
|
@@ -864,22 +870,72 @@ function addMockToContent(
|
|
|
864
870
|
|
|
865
871
|
// Check if we have multiple calls with different variable names
|
|
866
872
|
// This requires generating separate mock functions for each call site
|
|
873
|
+
//
|
|
874
|
+
// IMPORTANT: calls array may contain BOTH base hook calls (e.g., "useFetcher<Type>()")
|
|
875
|
+
// AND method chain usages (e.g., "useFetcher().functionCallReturnValue.submit(...)").
|
|
876
|
+
// We only want to count base hook calls for the length comparison with callVariableNames.
|
|
877
|
+
// A "base call" is one that ends with "()" possibly preceded by a type annotation,
|
|
878
|
+
// without any subsequent method chains like ".functionCallReturnValue" or ".submit(...)".
|
|
879
|
+
const baseHookCalls = importedExport.calls?.filter((call) => {
|
|
880
|
+
// Base hook calls match patterns like:
|
|
881
|
+
// - "useFetcher()"
|
|
882
|
+
// - "useFetcher<Type>()"
|
|
883
|
+
// - "useFetcher<{ complex: Type }>()"
|
|
884
|
+
// They end with "()" and don't have method chains after the call.
|
|
885
|
+
// Method chains contain ".functionCallReturnValue" or have property access after "()".
|
|
886
|
+
return (
|
|
887
|
+
call.endsWith('()') &&
|
|
888
|
+
!call.includes('.functionCallReturnValue') &&
|
|
889
|
+
// Also exclude method chains like "hook().something" or "hook().method()"
|
|
890
|
+
!call.match(/\(\)\.[a-zA-Z]/)
|
|
891
|
+
);
|
|
892
|
+
});
|
|
893
|
+
|
|
894
|
+
// Determine if we can generate unique mock functions for multiple variables.
|
|
895
|
+
// We need:
|
|
896
|
+
// 1. Multiple variable names (callVariableNames.length > 1)
|
|
897
|
+
// 2. Base hook calls to match them (baseHookCalls.length > 0)
|
|
898
|
+
// Note: We use min(baseHookCalls.length, callVariableNames.length) for iteration
|
|
899
|
+
// to handle cases where data might be slightly out of sync (stale entries).
|
|
867
900
|
const hasMultipleCallsWithVariables =
|
|
868
|
-
|
|
869
|
-
|
|
901
|
+
baseHookCalls &&
|
|
902
|
+
baseHookCalls.length > 1 &&
|
|
870
903
|
importedExport.callVariableNames &&
|
|
871
|
-
importedExport.callVariableNames.length
|
|
904
|
+
importedExport.callVariableNames.length > 1 &&
|
|
905
|
+
// Only proceed if we have at least as many base calls as variable names,
|
|
906
|
+
// OR they're close enough (within 1) to handle minor sync issues
|
|
907
|
+
Math.abs(baseHookCalls.length - importedExport.callVariableNames.length) <=
|
|
908
|
+
1;
|
|
872
909
|
|
|
873
910
|
let mockCode: string | undefined;
|
|
874
911
|
const variableMockCodes: string[] = [];
|
|
875
912
|
|
|
876
913
|
if (hasMultipleCallsWithVariables) {
|
|
877
914
|
// Generate separate mock functions for each variable-qualified call
|
|
878
|
-
//
|
|
879
|
-
|
|
915
|
+
// Look up canonical keys from dataForMocks and track variable names for function naming
|
|
916
|
+
|
|
917
|
+
// Get all call signature keys for this hook from dataForMocks
|
|
918
|
+
const dataForMocks =
|
|
919
|
+
rootAnalysis.metadata?.scenariosDataStructure?.dataForMocks;
|
|
920
|
+
// Match keys that start with the hook name (e.g., "useFetcher" matches "useFetcher<User>()")
|
|
921
|
+
const callSignatureKeysForHook = dataForMocks
|
|
922
|
+
? Object.keys(dataForMocks).filter((key) => {
|
|
923
|
+
const hookBaseName = importedExport.name.split(/[<(]/)[0];
|
|
924
|
+
const keyBaseName = key.split(/[<(]/)[0];
|
|
925
|
+
return keyBaseName === hookBaseName;
|
|
926
|
+
})
|
|
927
|
+
: [];
|
|
928
|
+
|
|
929
|
+
// Track variable name occurrences for unique function naming
|
|
880
930
|
const variableNameCounts: Record<string, number> = {};
|
|
881
931
|
|
|
882
|
-
|
|
932
|
+
// Use the minimum of both array lengths to handle slight mismatches
|
|
933
|
+
// (e.g., stale data from previous analysis runs)
|
|
934
|
+
const iterationLimit = Math.min(
|
|
935
|
+
baseHookCalls!.length,
|
|
936
|
+
importedExport.callVariableNames!.length,
|
|
937
|
+
);
|
|
938
|
+
for (let i = 0; i < iterationLimit; i++) {
|
|
883
939
|
const variableName = importedExport.callVariableNames![i];
|
|
884
940
|
if (!variableName) continue;
|
|
885
941
|
|
|
@@ -887,18 +943,37 @@ function addMockToContent(
|
|
|
887
943
|
const occurrence = variableNameCounts[variableName] ?? 0;
|
|
888
944
|
variableNameCounts[variableName] = occurrence + 1;
|
|
889
945
|
|
|
890
|
-
//
|
|
891
|
-
// e.g., "fetcher[1] <- useFetcher" for the second usage of "fetcher"
|
|
946
|
+
// Build indexed variable name for function naming
|
|
892
947
|
const indexedVariableName =
|
|
893
948
|
occurrence > 0 ? `${variableName}[${occurrence}]` : variableName;
|
|
894
949
|
|
|
895
|
-
//
|
|
896
|
-
//
|
|
897
|
-
const
|
|
950
|
+
// Use safe function name with underscores instead of brackets
|
|
951
|
+
// e.g., fetcher[1] -> fetcher_1
|
|
952
|
+
const safeFunctionName = indexedVariableName.replace(/\[(\d+)\]/g, '_$1');
|
|
953
|
+
// Compute unique mock function name for call site replacement
|
|
954
|
+
// e.g., useFetcher_entityDiffFetcher, useFetcher_reportFetcher
|
|
955
|
+
const mockFunctionName = `${importedExport.name}_${safeFunctionName}`;
|
|
956
|
+
|
|
957
|
+
// Use the call signature from baseHookCalls[i] as the data key
|
|
958
|
+
// This matches what's stored in dataForMocks
|
|
959
|
+
const callSignature = baseHookCalls![i];
|
|
960
|
+
|
|
961
|
+
// Generate mock code using the call signature directly
|
|
962
|
+
// This prevents "symbol already declared" errors when multiple calls exist
|
|
963
|
+
// Check if this is a package import that won't have scenario copies
|
|
964
|
+
const isPackageImportForMock = importPath?.startsWith('@');
|
|
898
965
|
const variableMockCode = constructMockCode(
|
|
899
|
-
|
|
966
|
+
callSignature, // Use call signature format for data lookup
|
|
900
967
|
dependencySchemas,
|
|
901
968
|
importedExport.entityType,
|
|
969
|
+
undefined, // No need for separate canonical key
|
|
970
|
+
{
|
|
971
|
+
uniqueFunctionSuffix: safeFunctionName, // Use variable name for unique function naming
|
|
972
|
+
// For node_modules or package imports, skip spreading from __cyOriginal
|
|
973
|
+
// since those packages/files don't export *__cyOriginal variants
|
|
974
|
+
skipOriginalSpread:
|
|
975
|
+
importedExport.isNodeModule || isPackageImportForMock,
|
|
976
|
+
},
|
|
902
977
|
);
|
|
903
978
|
|
|
904
979
|
if (variableMockCode) {
|
|
@@ -907,8 +982,6 @@ function addMockToContent(
|
|
|
907
982
|
// Replace the call site with the variable-specific mock function
|
|
908
983
|
// e.g., useFetcher<BranchEntityDiffResult>() -> useFetcher_entityDiffFetcher()
|
|
909
984
|
// e.g., useFetcher() -> useFetcher_reportFetcher()
|
|
910
|
-
// For indexed variables: useFetcher() -> useFetcher_fetcher_1()
|
|
911
|
-
const callSignature = importedExport.calls![i];
|
|
912
985
|
// Escape special regex characters in the call signature
|
|
913
986
|
const escapedCallSignature = callSignature.replace(
|
|
914
987
|
/[.*+?^${}()|[\]\\]/g,
|
|
@@ -919,13 +992,6 @@ function addMockToContent(
|
|
|
919
992
|
escapedCallSignature.replace(/\s+/g, '\\s*'),
|
|
920
993
|
'g',
|
|
921
994
|
);
|
|
922
|
-
// Use safe function name with underscores instead of brackets
|
|
923
|
-
// e.g., fetcher[1] -> fetcher_1
|
|
924
|
-
const safeFunctionName = indexedVariableName.replace(
|
|
925
|
-
/\[(\d+)\]/g,
|
|
926
|
-
'_$1',
|
|
927
|
-
);
|
|
928
|
-
const mockFunctionName = `${importedExport.name}_${safeFunctionName}`;
|
|
929
995
|
fileContent = fileContent.replace(callRegex, `${mockFunctionName}()`);
|
|
930
996
|
}
|
|
931
997
|
}
|
|
@@ -941,83 +1007,133 @@ function addMockToContent(
|
|
|
941
1007
|
: undefined;
|
|
942
1008
|
|
|
943
1009
|
if (singleCallVariableName) {
|
|
944
|
-
// For single variable assignments, use the
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
//
|
|
1010
|
+
// For single variable assignments, use the call signature directly from dataForMocks
|
|
1011
|
+
const dataForMocks =
|
|
1012
|
+
rootAnalysis.metadata?.scenariosDataStructure?.dataForMocks;
|
|
1013
|
+
|
|
1014
|
+
// Find matching call signature key in dataForMocks
|
|
1015
|
+
const hookBaseName = importedExport.name.split(/[<(]/)[0];
|
|
1016
|
+
const callSignatureKey = dataForMocks
|
|
1017
|
+
? Object.keys(dataForMocks).find((key) => {
|
|
1018
|
+
// Split on ., <, or ( to get the true base name
|
|
1019
|
+
// This handles both "useFlags()" -> "useFlags" and "trpc.useUtils()" -> "trpc"
|
|
1020
|
+
const keyBaseName = key.split(/[.<(]/)[0];
|
|
1021
|
+
return keyBaseName === hookBaseName;
|
|
1022
|
+
})
|
|
1023
|
+
: undefined;
|
|
1024
|
+
|
|
1025
|
+
// Use the call signature if found, otherwise construct it
|
|
1026
|
+
const dataKey =
|
|
1027
|
+
callSignatureKey ??
|
|
1028
|
+
importedExport.calls?.[0] ??
|
|
1029
|
+
`${importedExport.name}()`;
|
|
1030
|
+
|
|
1031
|
+
// IMPORTANT: If the dataKey is a method chain (e.g., "trpc.useUtils()"), we should
|
|
1032
|
+
// use the base name (e.g., "trpc") when calling constructMockCode. This ensures
|
|
1033
|
+
// constructMockCode generates a complete nested mock from the schema without
|
|
1034
|
+
// referencing __cyOriginal variables.
|
|
1035
|
+
const dataKeyBaseName = dataKey.split(/[.<(]/)[0];
|
|
1036
|
+
const isMethodChainDataKey =
|
|
1037
|
+
dataKeyBaseName === importedExport.name &&
|
|
1038
|
+
dataKey !== importedExport.name &&
|
|
1039
|
+
dataKey.includes('.');
|
|
1040
|
+
const mockNameToUse = isMethodChainDataKey
|
|
1041
|
+
? importedExport.name
|
|
1042
|
+
: dataKey;
|
|
1043
|
+
|
|
1044
|
+
// Keep the original function name since there's only one call
|
|
1045
|
+
// Check if this is a package import that won't have scenario copies
|
|
1046
|
+
const isPackageImportForSingleCall = importPath?.startsWith('@');
|
|
949
1047
|
mockCode = constructMockCode(
|
|
950
|
-
|
|
1048
|
+
mockNameToUse,
|
|
951
1049
|
dependencySchemas,
|
|
952
1050
|
importedExport.entityType,
|
|
953
|
-
|
|
1051
|
+
undefined,
|
|
1052
|
+
{
|
|
1053
|
+
keepOriginalFunctionName: true,
|
|
1054
|
+
// For node_modules or package imports, skip spreading from __cyOriginal
|
|
1055
|
+
// since those packages/files don't export *__cyOriginal variants
|
|
1056
|
+
skipOriginalSpread:
|
|
1057
|
+
importedExport.isNodeModule || isPackageImportForSingleCall,
|
|
1058
|
+
},
|
|
954
1059
|
);
|
|
955
1060
|
// If constructMockCode didn't generate code, fall back to simple return
|
|
1061
|
+
// IMPORTANT: We inline scenarios().data() inside the function rather than
|
|
1062
|
+
// storing in a const - see comment in constructMockCode.ts for why.
|
|
956
1063
|
if (!mockCode) {
|
|
957
|
-
mockCode = `
|
|
958
|
-
|
|
959
|
-
function ${importedExport.name}() {
|
|
960
|
-
return ${importedExport.name}ReturnValue;
|
|
1064
|
+
mockCode = `function ${importedExport.name}(...args) {
|
|
1065
|
+
return scenarios().data()?.["${dataKey}"];
|
|
961
1066
|
}`;
|
|
962
1067
|
}
|
|
963
1068
|
} else {
|
|
964
|
-
//
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
});
|
|
978
|
-
if (variableQualifiedKey) {
|
|
979
|
-
break;
|
|
980
|
-
}
|
|
981
|
-
}
|
|
982
|
-
}
|
|
1069
|
+
// Helper to find matching call signature key from dataForMocks
|
|
1070
|
+
const hookBaseName = importedExport.name.split(/[<(]/)[0];
|
|
1071
|
+
const findMatchingKey = (
|
|
1072
|
+
dataForMocks: Record<string, unknown> | undefined,
|
|
1073
|
+
): string | undefined => {
|
|
1074
|
+
if (!dataForMocks) return undefined;
|
|
1075
|
+
return Object.keys(dataForMocks).find((key) => {
|
|
1076
|
+
// Split on ., <, or ( to get the true base name
|
|
1077
|
+
// This handles both "useFlags()" -> "useFlags" and "trpc.useUtils()" -> "trpc"
|
|
1078
|
+
const keyBaseName = key.split(/[.<(]/)[0];
|
|
1079
|
+
return keyBaseName === hookBaseName;
|
|
1080
|
+
});
|
|
1081
|
+
};
|
|
983
1082
|
|
|
984
|
-
//
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
1083
|
+
// Check rootAnalysis FIRST for matching keys.
|
|
1084
|
+
// The mock DATA is generated from rootAnalysis, so the mock CODE must
|
|
1085
|
+
// also use rootAnalysis keys to ensure the lookup succeeds.
|
|
1086
|
+
let dataKey = findMatchingKey(
|
|
1087
|
+
rootAnalysis.metadata?.scenariosDataStructure?.dataForMocks,
|
|
1088
|
+
);
|
|
1089
|
+
|
|
1090
|
+
// If not found in rootAnalysis, fall back to fileAnalyses
|
|
1091
|
+
if (!dataKey) {
|
|
1092
|
+
for (const analysis of fileAnalyses) {
|
|
1093
|
+
dataKey = findMatchingKey(
|
|
1094
|
+
analysis.metadata?.scenariosDataStructure?.dataForMocks,
|
|
1095
|
+
);
|
|
1096
|
+
if (dataKey) break;
|
|
993
1097
|
}
|
|
994
1098
|
}
|
|
995
1099
|
|
|
996
|
-
if
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1100
|
+
// Use the data key if found, otherwise use call signature or function name.
|
|
1101
|
+
// IMPORTANT: If the dataKey is a method chain (e.g., "trpc.useUtils()"), we should
|
|
1102
|
+
// use the base name (e.g., "trpc") when calling constructMockCode. This ensures
|
|
1103
|
+
// constructMockCode generates a complete nested mock from the schema without
|
|
1104
|
+
// referencing __cyOriginal variables. The __cyOriginal pattern is only needed
|
|
1105
|
+
// for partial mocking where we preserve some original methods, not for complete
|
|
1106
|
+
// method-chain mocks where we provide all implementations.
|
|
1107
|
+
const dataKeyBaseName = dataKey?.split(/[.<(]/)[0];
|
|
1108
|
+
const isMethodChainDataKey =
|
|
1109
|
+
dataKey &&
|
|
1110
|
+
dataKeyBaseName === importedExport.name &&
|
|
1111
|
+
dataKey !== importedExport.name &&
|
|
1112
|
+
dataKey.includes('.');
|
|
1113
|
+
const mockNameToUse = isMethodChainDataKey
|
|
1114
|
+
? importedExport.name
|
|
1115
|
+
: (dataKey ?? importedExport.calls?.[0] ?? `${importedExport.name}()`);
|
|
1009
1116
|
|
|
1010
|
-
|
|
1011
|
-
|
|
1117
|
+
mockCode = constructMockCode(
|
|
1118
|
+
mockNameToUse,
|
|
1119
|
+
dependencySchemas,
|
|
1120
|
+
importedExport.entityType,
|
|
1121
|
+
undefined,
|
|
1122
|
+
{
|
|
1123
|
+
keepOriginalFunctionName: true,
|
|
1124
|
+
// For node_modules or package imports, skip spreading from __cyOriginal
|
|
1125
|
+
// since those packages/files don't export *__cyOriginal variants
|
|
1126
|
+
skipOriginalSpread:
|
|
1127
|
+
importedExport.isNodeModule || importPath?.startsWith('@'),
|
|
1128
|
+
},
|
|
1129
|
+
);
|
|
1130
|
+
// If constructMockCode didn't generate code, fall back to simple return
|
|
1131
|
+
// IMPORTANT: We inline scenarios().data() inside the function rather than
|
|
1132
|
+
// storing in a const - see comment in constructMockCode.ts for why.
|
|
1133
|
+
if (!mockCode && dataKey) {
|
|
1134
|
+
mockCode = `function ${importedExport.name}(...args) {
|
|
1135
|
+
return scenarios().data()?.["${dataKey}"];
|
|
1012
1136
|
}`;
|
|
1013
|
-
}
|
|
1014
|
-
} else {
|
|
1015
|
-
// Original behavior for calls without variable names
|
|
1016
|
-
mockCode = constructMockCode(
|
|
1017
|
-
importedExport.name,
|
|
1018
|
-
dependencySchemas,
|
|
1019
|
-
importedExport.entityType,
|
|
1020
|
-
);
|
|
1021
1137
|
}
|
|
1022
1138
|
}
|
|
1023
1139
|
}
|
|
@@ -1048,12 +1164,39 @@ function ${importedExport.name}() {
|
|
|
1048
1164
|
/[.*+?^${}()|[\]\\]/g,
|
|
1049
1165
|
'\\$&',
|
|
1050
1166
|
);
|
|
1167
|
+
// Use a simpler, more robust regex pattern that matches the fallback path.
|
|
1168
|
+
// Key improvements:
|
|
1169
|
+
// 1. Uses escapeRegExp(firstPart) to handle special characters in function names
|
|
1170
|
+
// 2. Uses word boundaries (\b) to prevent partial matches
|
|
1171
|
+
// 3. Handles comma BEFORE or AFTER the name: (?:,\s*|\s*,)?
|
|
1172
|
+
// 4. Matches specific import path (escapedImportPath)
|
|
1051
1173
|
const importRegExp = new RegExp(
|
|
1052
|
-
`(import
|
|
1174
|
+
`(import\\s*\\{[^}]*?)\\b${escapeRegExp(firstPart)}\\b(?:,\\s*|\\s*,)?((?:[^}]*\\}\\s*from\\s*['"]${escapedImportPath}['"];?))`,
|
|
1053
1175
|
'm',
|
|
1054
1176
|
);
|
|
1055
1177
|
|
|
1056
|
-
if (
|
|
1178
|
+
// Check if any call signature has multiple parts (e.g., "logger.error(error)")
|
|
1179
|
+
// If so, the mock code will spread from __cyOriginal, so we need to rename the import
|
|
1180
|
+
// EXCEPT:
|
|
1181
|
+
// 1. For node_module imports, the __cyOriginal pattern doesn't work because
|
|
1182
|
+
// the original package doesn't export *__cyOriginal variants.
|
|
1183
|
+
// 2. For package imports (starting with @), the __cyOriginal pattern doesn't work
|
|
1184
|
+
// because scenario copies aren't created for package files - they keep the
|
|
1185
|
+
// original import path which doesn't export *__cyOriginal.
|
|
1186
|
+
const anyCallHasMultipleParts = importedExport.calls?.some((call) => {
|
|
1187
|
+
const callParts = splitOutsideParenthesesAndArrays(call);
|
|
1188
|
+
return callParts.length > 1;
|
|
1189
|
+
});
|
|
1190
|
+
|
|
1191
|
+
// Package imports (starting with @) don't get scenario copies, so __cyOriginal won't exist
|
|
1192
|
+
const isPackageImport = importPath.startsWith('@');
|
|
1193
|
+
|
|
1194
|
+
const shouldRenameToOriginal =
|
|
1195
|
+
!importedExport.isNodeModule &&
|
|
1196
|
+
!isPackageImport &&
|
|
1197
|
+
(importedExportNameParts.length > 1 || anyCallHasMultipleParts);
|
|
1198
|
+
|
|
1199
|
+
if (shouldRenameToOriginal) {
|
|
1057
1200
|
fileContent = fileContent.replace(
|
|
1058
1201
|
importRegExp,
|
|
1059
1202
|
`$1${firstPart}__cyOriginal$2`,
|
|
@@ -1086,7 +1229,20 @@ function ${importedExport.name}() {
|
|
|
1086
1229
|
'm',
|
|
1087
1230
|
);
|
|
1088
1231
|
|
|
1089
|
-
if (
|
|
1232
|
+
// Check if any call signature has multiple parts (e.g., "logger.error(error)")
|
|
1233
|
+
// If so, the mock code will spread from __cyOriginal, so we need to rename the import
|
|
1234
|
+
// EXCEPT: For node_module imports, the __cyOriginal pattern doesn't work because
|
|
1235
|
+
// the original package doesn't export *__cyOriginal variants.
|
|
1236
|
+
const anyCallHasMultipleParts = importedExport.calls?.some((call) => {
|
|
1237
|
+
const callParts = splitOutsideParenthesesAndArrays(call);
|
|
1238
|
+
return callParts.length > 1;
|
|
1239
|
+
});
|
|
1240
|
+
|
|
1241
|
+
const shouldRenameToOriginal =
|
|
1242
|
+
!importedExport.isNodeModule &&
|
|
1243
|
+
(importedExportNameParts.length > 1 || anyCallHasMultipleParts);
|
|
1244
|
+
|
|
1245
|
+
if (shouldRenameToOriginal) {
|
|
1090
1246
|
// Rename the import instead of removing (for destructured access patterns)
|
|
1091
1247
|
fileContent = fileContent.replace(
|
|
1092
1248
|
namedImportRegExp,
|
|
@@ -2105,9 +2261,28 @@ ${exportKeyword}const ${functionName} = new Proxy(() => scenarios().data()?.["${
|
|
|
2105
2261
|
}
|
|
2106
2262
|
}
|
|
2107
2263
|
|
|
2264
|
+
// Collect universal mocks BEFORE processing nodeModuleImports
|
|
2265
|
+
// This is needed to check if a node module import is handled by a universal mock
|
|
2266
|
+
const universalMocks = project.metadata?.universalMocks ?? [];
|
|
2267
|
+
const nodeModuleUniversalMocks = universalMocks.filter(
|
|
2268
|
+
(mock) => mock.nodeModule && mock.content,
|
|
2269
|
+
);
|
|
2270
|
+
|
|
2271
|
+
// Create a set of import paths that have universal mocks for quick lookup
|
|
2272
|
+
const universalMockPaths = new Set(
|
|
2273
|
+
nodeModuleUniversalMocks.map((mock) => mock.filePath),
|
|
2274
|
+
);
|
|
2275
|
+
|
|
2108
2276
|
for (const nodeModuleImport of nodeModuleImports) {
|
|
2109
2277
|
if (!nodeModuleImport.isMocked) continue;
|
|
2110
2278
|
|
|
2279
|
+
// Skip generating local mock functions for imports that have universal mocks.
|
|
2280
|
+
// Universal mocks provide the exports via rewritten import paths (handled below).
|
|
2281
|
+
// Generating a local mock function would cause "name defined multiple times" errors.
|
|
2282
|
+
if (universalMockPaths.has(nodeModuleImport.filePath)) {
|
|
2283
|
+
continue;
|
|
2284
|
+
}
|
|
2285
|
+
|
|
2111
2286
|
fileContent = addMockToContent(
|
|
2112
2287
|
fileContent,
|
|
2113
2288
|
nodeModuleImport,
|
|
@@ -2123,10 +2298,6 @@ ${exportKeyword}const ${functionName} = new Proxy(() => scenarios().data()?.["${
|
|
|
2123
2298
|
// Universal mocks create mock files at __codeyamMocks__/{safeFileName}.tsx
|
|
2124
2299
|
// We need to rewrite imports like `import { logger } from "@formbricks/logger"`
|
|
2125
2300
|
// to `import { logger } from "../__codeyamMocks__/_formbricks_logger"`
|
|
2126
|
-
const universalMocks = project.metadata?.universalMocks ?? [];
|
|
2127
|
-
const nodeModuleUniversalMocks = universalMocks.filter(
|
|
2128
|
-
(mock) => mock.nodeModule && mock.content,
|
|
2129
|
-
);
|
|
2130
2301
|
|
|
2131
2302
|
for (const universalMock of nodeModuleUniversalMocks) {
|
|
2132
2303
|
const originalPath = universalMock.filePath;
|
|
@@ -12,6 +12,7 @@ import writeLibComponent from './writeLibComponent';
|
|
|
12
12
|
import writeMockDataTsx from './writeMockDataTsx';
|
|
13
13
|
import writeScenarioComponents from './writeScenarioComponents';
|
|
14
14
|
import writeScenarioPage from './writeScenarioPage';
|
|
15
|
+
import writeScenarioClientWrapper from './writeScenarioClientWrapper';
|
|
15
16
|
import { LazyFileStore } from './LazyFileStore';
|
|
16
17
|
|
|
17
18
|
export interface WriteSimulatorFilesArgs {
|
|
@@ -62,6 +63,31 @@ export default async function writeScenarioFiles({
|
|
|
62
63
|
);
|
|
63
64
|
generatedFiles.push(mockDataFilePath);
|
|
64
65
|
|
|
66
|
+
// Determine if entity is async (Server Component)
|
|
67
|
+
// First check metadata, then fall back to source code detection for existing analyses
|
|
68
|
+
let isAsync = entity.metadata?.isAsync;
|
|
69
|
+
if (isAsync === undefined) {
|
|
70
|
+
const fileAnalyzer = projectAnalyzer.getFileAnalyzerByPath(file.path);
|
|
71
|
+
if (fileAnalyzer) {
|
|
72
|
+
const localEntityName =
|
|
73
|
+
entity.name === 'default' ? 'default' : entity.name;
|
|
74
|
+
isAsync = fileAnalyzer.isEntityAsync(localEntityName);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// For async components (Server Components), write the client wrapper
|
|
79
|
+
// and update entity metadata so page generation knows to use Server Component format
|
|
80
|
+
if (isAsync) {
|
|
81
|
+
entity.metadata = entity.metadata || {};
|
|
82
|
+
entity.metadata.isAsync = true;
|
|
83
|
+
|
|
84
|
+
const clientWrapperPath = await writeScenarioClientWrapper(
|
|
85
|
+
scenario,
|
|
86
|
+
mocksDir,
|
|
87
|
+
);
|
|
88
|
+
generatedFiles.push(clientWrapperPath);
|
|
89
|
+
}
|
|
90
|
+
|
|
65
91
|
// For library files create components that allow you to interact with them
|
|
66
92
|
const libComponentPath = await writeLibComponent(
|
|
67
93
|
project,
|
|
@@ -255,19 +255,19 @@ export default async function writeSimpleRoot(
|
|
|
255
255
|
|
|
256
256
|
if (!newContent.match(importRegex)) continue;
|
|
257
257
|
|
|
258
|
-
// Find the correct
|
|
259
|
-
// The mock data is stored under keys like "
|
|
260
|
-
// For root.tsx, we need to find the key that corresponds to ROOT's usage,
|
|
261
|
-
// NOT the route's (Settings') usage.
|
|
258
|
+
// Find the correct mock key for ROOT's usage
|
|
259
|
+
// The mock data is stored under call signature keys like "useLoaderData()"
|
|
262
260
|
const dataForMocks =
|
|
263
261
|
options.routeAnalysis?.metadata?.scenariosDataStructure
|
|
264
262
|
?.dataForMocks;
|
|
265
263
|
|
|
266
|
-
// Find all keys that
|
|
264
|
+
// Find all keys that match this entity/hook by base name
|
|
265
|
+
const entityBaseName = entityName.split(/[<(]/)[0];
|
|
267
266
|
const matchingKeys = dataForMocks
|
|
268
|
-
? Object.keys(dataForMocks).filter((key) =>
|
|
269
|
-
key.
|
|
270
|
-
|
|
267
|
+
? Object.keys(dataForMocks).filter((key) => {
|
|
268
|
+
const keyBaseName = key.split(/[<(]/)[0];
|
|
269
|
+
return keyBaseName === entityBaseName;
|
|
270
|
+
})
|
|
271
271
|
: [];
|
|
272
272
|
|
|
273
273
|
// If there are multiple keys (e.g., one for root.tsx and one for Settings),
|
|
@@ -302,11 +302,9 @@ export default async function writeSimpleRoot(
|
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
-
// Find a key that
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
return rootPropertyNames.includes(varName);
|
|
309
|
-
});
|
|
305
|
+
// Find a key that matches by call signature
|
|
306
|
+
// For call signature format (e.g., "useLoaderData()"), just use the first match
|
|
307
|
+
mockKey = matchingKeys[0];
|
|
310
308
|
|
|
311
309
|
// Fallback: if no match found but there are multiple keys,
|
|
312
310
|
// exclude the route's key (which we can identify from mockedImports variable names)
|
|
@@ -347,11 +345,11 @@ export default async function writeSimpleRoot(
|
|
|
347
345
|
...scenarios().data()?.["${mockKey}"]
|
|
348
346
|
};
|
|
349
347
|
|
|
350
|
-
function ${entityName}() {
|
|
348
|
+
function ${entityName}(...args) {
|
|
351
349
|
return ${entityName}ReturnValue;
|
|
352
350
|
}`;
|
|
353
351
|
} else {
|
|
354
|
-
mockCode = `const ${entityName}ReturnValue = scenarios().data()?.["${mockKey}"];\n\nfunction ${entityName}() {\n return ${entityName}ReturnValue;\n}`;
|
|
352
|
+
mockCode = `const ${entityName}ReturnValue = scenarios().data()?.["${mockKey}"];\n\nfunction ${entityName}(...args) {\n return ${entityName}ReturnValue;\n}`;
|
|
355
353
|
}
|
|
356
354
|
} else {
|
|
357
355
|
// Fallback to constructMockCode for simple cases
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
echo "Error: No command specified for this container."
|
|
3
|
+
echo ""
|
|
4
|
+
echo "This image requires an explicit command override in the ECS task definition:"
|
|
5
|
+
echo " - Analysis tasks: node --enable-source-maps ./dist/project/start.js ..."
|
|
6
|
+
echo " - Orchestration workers: node scripts/comboWorkerLoop.cjs"
|
|
7
|
+
echo ""
|
|
8
|
+
echo "If you're seeing this, the task definition is misconfigured."
|
|
9
|
+
exit 1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import copyFolderToArchive from "../copyFolderToArchive.js";
|
|
2
2
|
import writeFile from "../writeFile.js";
|
|
3
|
-
import execAsync, { execAsyncWithProcess } from "./execAsync.js";
|
|
3
|
+
import execAsync, { execAsyncWithProcess, } from "./execAsync.js";
|
|
4
4
|
import buildCliArgs from "../virtualized/project/buildCliArgs.js";
|
|
5
5
|
import * as fs from 'fs';
|
|
6
6
|
/**
|
|
@@ -20,34 +20,6 @@ export async function createAnalyzerTemplate(absoluteCodeyamRootPath) {
|
|
|
20
20
|
recursive: true,
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
-
// Copy the process management system at the root level
|
|
24
|
-
await copyFolderToArchive({
|
|
25
|
-
source: './src/lib/process',
|
|
26
|
-
destination: `${absoluteCodeyamRootPath}/process`,
|
|
27
|
-
exclude: ['__tests__'],
|
|
28
|
-
recursive: true,
|
|
29
|
-
});
|
|
30
|
-
// Fix the import path in common/execAsync.ts for the flat template structure
|
|
31
|
-
const execAsyncPath = `${absoluteCodeyamRootPath}/common/execAsync.ts`;
|
|
32
|
-
if (fs.existsSync(execAsyncPath)) {
|
|
33
|
-
let content = fs.readFileSync(execAsyncPath, 'utf8');
|
|
34
|
-
// Change ../../process to ../process to match the flat structure
|
|
35
|
-
// Use template literals to avoid postbuild.cjs modifying these strings
|
|
36
|
-
const oldImport = `from ${String.fromCharCode(39)}../../process${String.fromCharCode(39)}`;
|
|
37
|
-
const newImport = `from ${String.fromCharCode(39)}../process${String.fromCharCode(39)}`;
|
|
38
|
-
content = content.replace(oldImport, newImport);
|
|
39
|
-
fs.writeFileSync(execAsyncPath, content);
|
|
40
|
-
}
|
|
41
|
-
// Fix the import path in project/start.ts for the flat template structure
|
|
42
|
-
const startPath = `${absoluteCodeyamRootPath}/project/start.ts`;
|
|
43
|
-
if (fs.existsSync(startPath)) {
|
|
44
|
-
let content = fs.readFileSync(startPath, 'utf8');
|
|
45
|
-
// Change ../../process to ../process to match the flat structure
|
|
46
|
-
const oldImport = `from ${String.fromCharCode(39)}../../process${String.fromCharCode(39)}`;
|
|
47
|
-
const newImport = `from ${String.fromCharCode(39)}../process${String.fromCharCode(39)}`;
|
|
48
|
-
content = content.replace(oldImport, newImport);
|
|
49
|
-
fs.writeFileSync(startPath, content);
|
|
50
|
-
}
|
|
51
23
|
await copyFolderToArchive({
|
|
52
24
|
source: '../packages',
|
|
53
25
|
destination: `${absoluteCodeyamRootPath}/packages`,
|