@codeyam/codeyam-cli 0.1.0-staging.ad31e3e → 0.1.0-staging.bbe4da9

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.
Files changed (161) hide show
  1. package/analyzer-template/.build-info.json +7 -7
  2. package/analyzer-template/log.txt +3 -3
  3. package/analyzer-template/packages/ai/index.ts +4 -1
  4. package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +18 -0
  5. package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +56 -0
  6. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.ts +64 -1
  7. package/analyzer-template/packages/ai/src/lib/worker/SerializableDataStructure.ts +2 -0
  8. package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +29 -2
  9. package/analyzer-template/packages/analyze/src/lib/asts/nodes/getNodeType.ts +1 -1
  10. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllExportedNodes.ts +4 -2
  11. package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllExports.ts +5 -3
  12. package/analyzer-template/packages/analyze/src/lib/files/analyzeRemixRoute.ts +21 -33
  13. package/analyzer-template/packages/analyze/src/lib/files/getImportedExports.ts +75 -10
  14. package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +26 -0
  15. package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.ts +12 -2
  16. package/analyzer-template/packages/aws/dist/src/lib/s3/getPresignedUrl.d.ts.map +1 -1
  17. package/analyzer-template/packages/aws/dist/src/lib/s3/getPresignedUrl.js +2 -2
  18. package/analyzer-template/packages/aws/dist/src/lib/s3/getPresignedUrl.js.map +1 -1
  19. package/analyzer-template/packages/aws/src/lib/s3/getPresignedUrl.ts +2 -2
  20. package/analyzer-template/packages/github/dist/supabase/src/lib/scenarioToDb.d.ts.map +1 -1
  21. package/analyzer-template/packages/github/dist/supabase/src/lib/scenarioToDb.js +1 -1
  22. package/analyzer-template/packages/github/dist/supabase/src/lib/scenarioToDb.js.map +1 -1
  23. package/analyzer-template/packages/github/dist/utils/src/lib/applyUniversalMocks.d.ts.map +1 -1
  24. package/analyzer-template/packages/github/dist/utils/src/lib/applyUniversalMocks.js +39 -5
  25. package/analyzer-template/packages/github/dist/utils/src/lib/applyUniversalMocks.js.map +1 -1
  26. package/analyzer-template/packages/github/dist/utils/src/lib/lightweightEntityExtractor.d.ts.map +1 -1
  27. package/analyzer-template/packages/github/dist/utils/src/lib/lightweightEntityExtractor.js +17 -0
  28. package/analyzer-template/packages/github/dist/utils/src/lib/lightweightEntityExtractor.js.map +1 -1
  29. package/analyzer-template/packages/supabase/src/lib/scenarioToDb.ts +1 -0
  30. package/analyzer-template/packages/utils/dist/utils/src/lib/applyUniversalMocks.d.ts.map +1 -1
  31. package/analyzer-template/packages/utils/dist/utils/src/lib/applyUniversalMocks.js +39 -5
  32. package/analyzer-template/packages/utils/dist/utils/src/lib/applyUniversalMocks.js.map +1 -1
  33. package/analyzer-template/packages/utils/dist/utils/src/lib/lightweightEntityExtractor.d.ts.map +1 -1
  34. package/analyzer-template/packages/utils/dist/utils/src/lib/lightweightEntityExtractor.js +17 -0
  35. package/analyzer-template/packages/utils/dist/utils/src/lib/lightweightEntityExtractor.js.map +1 -1
  36. package/analyzer-template/packages/utils/src/lib/applyUniversalMocks.ts +46 -7
  37. package/analyzer-template/packages/utils/src/lib/lightweightEntityExtractor.ts +16 -0
  38. package/analyzer-template/project/constructMockCode.ts +29 -3
  39. package/analyzer-template/project/runMultiScenarioServer.ts +0 -4
  40. package/analyzer-template/project/runScenarioServer.ts +0 -4
  41. package/analyzer-template/project/start.ts +1 -11
  42. package/analyzer-template/project/startServer.ts +50 -70
  43. package/analyzer-template/project/writeMockDataTsx.ts +66 -3
  44. package/analyzer-template/project/writeScenarioComponents.ts +451 -25
  45. package/analyzer-template/scripts/postbuild.cjs +12 -1
  46. package/background/src/lib/virtualized/project/constructMockCode.js +25 -4
  47. package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
  48. package/background/src/lib/virtualized/project/runMultiScenarioServer.js +0 -3
  49. package/background/src/lib/virtualized/project/runMultiScenarioServer.js.map +1 -1
  50. package/background/src/lib/virtualized/project/start.js +1 -8
  51. package/background/src/lib/virtualized/project/start.js.map +1 -1
  52. package/background/src/lib/virtualized/project/startServer.js +40 -68
  53. package/background/src/lib/virtualized/project/startServer.js.map +1 -1
  54. package/background/src/lib/virtualized/project/writeMockDataTsx.js +61 -3
  55. package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
  56. package/background/src/lib/virtualized/project/writeScenarioComponents.js +296 -20
  57. package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
  58. package/codeyam-cli/src/commands/debug.js +3 -2
  59. package/codeyam-cli/src/commands/debug.js.map +1 -1
  60. package/codeyam-cli/src/commands/setup-sandbox.js +2 -1
  61. package/codeyam-cli/src/commands/setup-sandbox.js.map +1 -1
  62. package/codeyam-cli/src/commands/test-startup.js +14 -5
  63. package/codeyam-cli/src/commands/test-startup.js.map +1 -1
  64. package/codeyam-cli/src/utils/analysisRunner.js +2 -1
  65. package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
  66. package/codeyam-cli/src/utils/analyzer.js +8 -16
  67. package/codeyam-cli/src/utils/analyzer.js.map +1 -1
  68. package/codeyam-cli/src/utils/generateReport.js +12 -6
  69. package/codeyam-cli/src/utils/generateReport.js.map +1 -1
  70. package/codeyam-cli/src/utils/queue/job.js +5 -4
  71. package/codeyam-cli/src/utils/queue/job.js.map +1 -1
  72. package/codeyam-cli/src/utils/sandbox.js +190 -0
  73. package/codeyam-cli/src/utils/sandbox.js.map +1 -0
  74. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-D5ZHFomX.js → EntityTypeIcon-Dp_FTAs1.js} +1 -1
  75. package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-TlHocYno.js +26 -0
  76. package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-BYVx9KFp.js → LibraryFunctionPreview-CVMmGuIc.js} +1 -1
  77. package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-CRcT5fOZ.js → LogViewer-JkfQ-VaI.js} +1 -1
  78. package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-Cqce0_KG.js +1 -0
  79. package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-Bual6h18.js → SafeScreenshot-BrMAP1nP.js} +1 -1
  80. package/codeyam-cli/src/webserver/build/client/assets/ScenarioPreview-Bi-__7HT.js +6 -0
  81. package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-4D2vLLJz.js → ScenarioViewer-XmIpHcLJ.js} +1 -1
  82. package/codeyam-cli/src/webserver/build/client/assets/_index-BmfhU6CA.js +1 -0
  83. package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-Dm8lM73z.js +10 -0
  84. package/codeyam-cli/src/webserver/build/client/assets/{chart-column-B8fb6wnw.js → chart-column-kA4jn9if.js} +1 -1
  85. package/codeyam-cli/src/webserver/build/client/assets/{chunk-WWGJGFF6-De6i8FUT.js → chunk-WWGJGFF6-CgXbbZRx.js} +1 -1
  86. package/codeyam-cli/src/webserver/build/client/assets/{circle-check-BACUUf75.js → circle-check-B2oHQ-zo.js} +1 -1
  87. package/codeyam-cli/src/webserver/build/client/assets/{clock-vWeoCemX.js → clock-BAfbP_iK.js} +1 -1
  88. package/codeyam-cli/src/webserver/build/client/assets/codeyam-name-logo-CvKwUgHo.svg +9 -0
  89. package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-CS7XDrKv.js → createLucideIcon-BBYuR56H.js} +1 -1
  90. package/codeyam-cli/src/webserver/build/client/assets/{dev.empty-DIOEw_3i.js → dev.empty-BgPXZbm0.js} +1 -1
  91. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-C6fctQ5v.js → entity._sha._-BkoAXaOa.js} +10 -10
  92. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-C3FZJx1w.js → entity._sha_.create-scenario-Bj5GHkhb.js} +1 -1
  93. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-YJz_igar.js → entity._sha_.edit._scenarioId-eW5z9AyZ.js} +1 -1
  94. package/codeyam-cli/src/webserver/build/client/assets/{entityStatus-BEqj2qBy.js → entityStatus-C5Okl18j.js} +1 -1
  95. package/codeyam-cli/src/webserver/build/client/assets/{entityVersioning-Bk_YB1jM.js → entityVersioning-CU_Lchhc.js} +1 -1
  96. package/codeyam-cli/src/webserver/build/client/assets/{entry.client-DiP0q291.js → entry.client-B9tSboXM.js} +2 -2
  97. package/codeyam-cli/src/webserver/build/client/assets/{file-text-LM0mgxXE.js → file-text-18aYHZGd.js} +1 -1
  98. package/codeyam-cli/src/webserver/build/client/assets/files-Df79EyEb.js +1 -0
  99. package/codeyam-cli/src/webserver/build/client/assets/git-CDEwTVH_.js +12 -0
  100. package/codeyam-cli/src/webserver/build/client/assets/globals-DXRB6jBc.css +1 -0
  101. package/codeyam-cli/src/webserver/build/client/assets/{index-D-zYbzFZ.js → index-_LjBsTxX.js} +1 -1
  102. package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-BXPKbHEb.js → loader-circle-D_EGChhq.js} +1 -1
  103. package/codeyam-cli/src/webserver/build/client/assets/manifest-3e0ffbcc.js +1 -0
  104. package/codeyam-cli/src/webserver/build/client/assets/{root-D0s7DnXb.js → root-CGyT4J4b.js} +3 -3
  105. package/codeyam-cli/src/webserver/build/client/assets/{settings-5zF_GOcS.js → settings-CEPbAsom.js} +1 -1
  106. package/codeyam-cli/src/webserver/build/client/assets/settings-R8QF_mHX.js +1 -0
  107. package/codeyam-cli/src/webserver/build/client/assets/simulations-B_PXvFom.js +1 -0
  108. package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-D7k-ArFa.js → triangle-alert-BthANBVv.js} +1 -1
  109. package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-AlhS7g5F.js → useLastLogLine-Blr5oZDE.js} +1 -1
  110. package/codeyam-cli/src/webserver/build/client/assets/useReportContext-CANr3QJ5.js +1 -0
  111. package/codeyam-cli/src/webserver/build/client/assets/{useToast-Ddo4UQv7.js → useToast-Bbf4Hokd.js} +1 -1
  112. package/codeyam-cli/src/webserver/build/server/assets/{index-iaMjuNME.js → index-vf1FETCO.js} +1 -1
  113. package/codeyam-cli/src/webserver/build/server/assets/server-build-B5s58TvB.js +169 -0
  114. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  115. package/codeyam-cli/src/webserver/build-info.json +5 -5
  116. package/package.json +1 -1
  117. package/packages/ai/index.js +1 -1
  118. package/packages/ai/index.js.map +1 -1
  119. package/packages/ai/src/lib/astScopes/processExpression.js +12 -0
  120. package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
  121. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +38 -0
  122. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
  123. package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js +55 -1
  124. package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js.map +1 -1
  125. package/packages/ai/src/lib/worker/SerializableDataStructure.js.map +1 -1
  126. package/packages/analyze/src/lib/FileAnalyzer.js +22 -2
  127. package/packages/analyze/src/lib/FileAnalyzer.js.map +1 -1
  128. package/packages/analyze/src/lib/asts/nodes/getNodeType.js +1 -1
  129. package/packages/analyze/src/lib/asts/nodes/getNodeType.js.map +1 -1
  130. package/packages/analyze/src/lib/asts/sourceFiles/getAllExportedNodes.js +3 -2
  131. package/packages/analyze/src/lib/asts/sourceFiles/getAllExportedNodes.js.map +1 -1
  132. package/packages/analyze/src/lib/asts/sourceFiles/getAllExports.js +4 -3
  133. package/packages/analyze/src/lib/asts/sourceFiles/getAllExports.js.map +1 -1
  134. package/packages/analyze/src/lib/files/analyzeRemixRoute.js +18 -23
  135. package/packages/analyze/src/lib/files/analyzeRemixRoute.js.map +1 -1
  136. package/packages/analyze/src/lib/files/getImportedExports.js +56 -4
  137. package/packages/analyze/src/lib/files/getImportedExports.js.map +1 -1
  138. package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js +24 -0
  139. package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
  140. package/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.js +8 -2
  141. package/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.js.map +1 -1
  142. package/packages/supabase/src/lib/scenarioToDb.js +1 -1
  143. package/packages/supabase/src/lib/scenarioToDb.js.map +1 -1
  144. package/packages/utils/src/lib/applyUniversalMocks.js +39 -5
  145. package/packages/utils/src/lib/applyUniversalMocks.js.map +1 -1
  146. package/packages/utils/src/lib/lightweightEntityExtractor.js +17 -0
  147. package/packages/utils/src/lib/lightweightEntityExtractor.js.map +1 -1
  148. package/codeyam-cli/src/webserver/build/client/assets/InteractivePreview-XDSzQLOY.js +0 -26
  149. package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-BORLgi0X.js +0 -1
  150. package/codeyam-cli/src/webserver/build/client/assets/ScenarioPreview-Bi-YUMa-.js +0 -6
  151. package/codeyam-cli/src/webserver/build/client/assets/_index-BC200mfN.js +0 -1
  152. package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-CxvZPkCv.js +0 -10
  153. package/codeyam-cli/src/webserver/build/client/assets/circle-alert-IdsgAK39.js +0 -1
  154. package/codeyam-cli/src/webserver/build/client/assets/files-Dxh9CcaV.js +0 -1
  155. package/codeyam-cli/src/webserver/build/client/assets/git-BXmqrWCH.js +0 -12
  156. package/codeyam-cli/src/webserver/build/client/assets/globals-BGS74ED-.css +0 -1
  157. package/codeyam-cli/src/webserver/build/client/assets/manifest-e039ab42.js +0 -1
  158. package/codeyam-cli/src/webserver/build/client/assets/settings-Dc4MlMpK.js +0 -1
  159. package/codeyam-cli/src/webserver/build/client/assets/simulations-BQ-02-jB.js +0 -1
  160. package/codeyam-cli/src/webserver/build/client/assets/zap-_jw-9DCp.js +0 -1
  161. package/codeyam-cli/src/webserver/build/server/assets/server-build-CpyX1FZX.js +0 -169
@@ -203,6 +203,20 @@ const jsonToCode = (json, level = 1, mergedDataStructure, currentKey) => {
203
203
  // Track normalized function names to avoid duplicate keys in output
204
204
  // e.g., submit({ a }) and submit({ b }) should both become "submit" once
205
205
  const seenNormalizedFuncNames = new Set();
206
+ // Pre-scan to identify plain keys that have function-call versions
207
+ // These plain keys should be skipped because the function-call version
208
+ // will be normalized to the same key name
209
+ // e.g., if both "push" and "push(`/path`)" exist, skip the plain "push"
210
+ const plainKeysWithFunctionCallVersions = new Set();
211
+ for (const key of Object.keys(jsonObj)) {
212
+ if (key.includes('(') && key.endsWith(')')) {
213
+ const funcName = key.split('(')[0];
214
+ // Check if a plain key with this name exists
215
+ if (funcName in jsonObj && !funcName.includes('(')) {
216
+ plainKeysWithFunctionCallVersions.add(funcName);
217
+ }
218
+ }
219
+ }
206
220
  for (const key of Object.keys(jsonObj)) {
207
221
  if (jsonObj[key] === undefined || jsonObj[key] === null)
208
222
  continue;
@@ -368,10 +382,23 @@ const jsonToCode = (json, level = 1, mergedDataStructure, currentKey) => {
368
382
  keyStrings.push(`${levelSpacing}"${safeString(funcName, level)}": ${outputValue}`);
369
383
  }
370
384
  else {
385
+ // Skip plain keys that have function-call versions (at the same nesting level where
386
+ // function-call keys get normalized). The function-call version will be output instead.
387
+ // e.g., if both "push" and "push(`/path`)" exist, skip "push" - the other normalizes to "push"
388
+ if (level > 2 && plainKeysWithFunctionCallVersions.has(key)) {
389
+ console.log(`CodeYam: Skipping plain key "${key}" (has function-call version that will be normalized)`);
390
+ continue;
391
+ }
371
392
  keyStrings.push(`${levelSpacing}"${safeString(key, level)}": "${safeString(stringValue, level)}"`);
372
393
  }
373
394
  }
374
395
  else {
396
+ // Skip plain keys that have function-call versions (at the same nesting level where
397
+ // function-call keys get normalized)
398
+ if (level > 2 && plainKeysWithFunctionCallVersions.has(key)) {
399
+ console.log(`CodeYam: Skipping plain key "${key}" (has function-call version that will be normalized)`);
400
+ continue;
401
+ }
375
402
  keyStrings.push(`${levelSpacing}"${safeString(key, level)}": ${safeString(String(jsonObj[key]), level)}`);
376
403
  }
377
404
  }
@@ -502,13 +529,44 @@ function serialize(obj) {
502
529
 
503
530
  // Handle functions
504
531
  if (typeof value === 'function') {
505
- const fnStr = value.toString();
532
+ let fnStr;
533
+ try {
534
+ fnStr = value.toString();
535
+ } catch (toStringErr) {
536
+ console.warn('CodeYam: Function.toString() threw error:', toStringErr, 'function name:', value.name);
537
+ return {
538
+ __type: TYPE_MARKERS.FUNCTION,
539
+ value: '() => {}',
540
+ name: value.name || 'anonymous'
541
+ };
542
+ }
543
+
544
+ // Defensive check: ensure fnStr is actually a string
545
+ if (typeof fnStr !== 'string') {
546
+ console.warn('CodeYam: Function.toString() returned non-string:', typeof fnStr, fnStr, 'function name:', value.name);
547
+ return {
548
+ __type: TYPE_MARKERS.FUNCTION,
549
+ value: '() => {}',
550
+ name: value.name || 'anonymous'
551
+ };
552
+ }
553
+
506
554
  // Check if it's an arrow function
507
555
  if (fnStr.includes('=>')) {
556
+ const arrowIndex = fnStr.indexOf('=>');
557
+ // Extra safety: verify indexOf returned a valid index
558
+ if (arrowIndex === -1) {
559
+ console.warn('CodeYam: Arrow function detection inconsistency - includes found => but indexOf returned -1. fnStr:', fnStr);
560
+ return {
561
+ __type: TYPE_MARKERS.FUNCTION,
562
+ value: fnStr,
563
+ name: value.name
564
+ };
565
+ }
508
566
  return {
509
567
  __type: TYPE_MARKERS.ARROW_FUNCTION,
510
- params: fnStr.substring(0, fnStr.indexOf('=>')).trim(),
511
- body: fnStr.substring(fnStr.indexOf('=>') + 2).trim()
568
+ params: fnStr.substring(0, arrowIndex).trim(),
569
+ body: fnStr.substring(arrowIndex + 2).trim()
512
570
  };
513
571
  }
514
572
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"writeMockDataTs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AAyC,CAC1C,CAAC;QAEF,MAAM,UAAU,GAAG;YACjB,SAAS,EAAE,eAAe;YAC1B,GAAG,kBAAkB;SACtB,CAAC;QACF,wEAAwE;QACxE,6EAA6E;QAC7E,qDAAqD;QACrD,QAAQ,GAAG,UAAU,CAAC,UAAU,EAAE,CAAC,EAAE,mBAAmB,CAAC,CAAC;IAC5D,CAAC;IAED,YAAY,IAAI,yBAAyB,QAAQ,GAAG,CAAC;IAErD,YAAY,IAAI,OAAO,kBAAkB,EAAE,CAAC;IAE5C,6EAA6E;IAC7E,MAAM,gBAAgB,GAAG,YAAY,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC;IAC3E,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;IAClE,MAAM,SAAS,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;IAE/C,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAE5D,OAAO,eAAe,CAAC;AACzB,CAAC;AAED,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmRzB,CAAC"}
1
+ {"version":3,"file":"writeMockDataTsx.js","sourceRoot":"","sources":["../../../../../../../background/src/lib/virtualized/project/writeMockDataTsx.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAC5C,OAAO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,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC;IAC3E,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;IAClE,MAAM,SAAS,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;IAE/C,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAE5D,OAAO,eAAe,CAAC;AACzB,CAAC;AAED,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkTzB,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { ProjectFramework, } from "../../../../../packages/types/index.js";
1
2
  import writeFile from "../common/writeFile.js";
2
3
  import { isFrameworkRoute, getFrameworkRoutePath, safeFileName, PROJECT_RELATIVE_PATH, } from "../../../../../packages/utils/index.js";
3
4
  import { getRelativePath, safeFolder } from "../../../../../packages/generate/index.js";
@@ -6,11 +7,18 @@ import { splitOutsideParenthesesAndArrays } from "../../../../../packages/ai/ind
6
7
  import { loadEntities } from "../../../../../packages/supabase/index.js";
7
8
  import * as fs from 'fs';
8
9
  import * as path from 'path';
10
+ /**
11
+ * Escape special regex characters in a string so it can be used as a literal pattern.
12
+ * This prevents characters like . * + ? ^ $ { } ( ) | [ ] \ from being interpreted as regex metacharacters.
13
+ */
14
+ function escapeRegExp(str) {
15
+ return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
16
+ }
9
17
  function hasMockStructure(importedExport, fileAnalyses) {
10
18
  if (!fileAnalyses?.some((a) => a.entity.metadata?.isolatedDataStructure?.dependencySchemas)) {
11
19
  return false;
12
20
  }
13
- return !!constructMockCode(importedExport.name, fileAnalyses.find((a) => !!a.metadata?.mergedDataStructure?.dependencySchemas?.[importedExport.filePath]?.[importedExport.name])?.metadata?.mergedDataStructure?.dependencySchemas);
21
+ return !!constructMockCode(importedExport.name, fileAnalyses.find((a) => !!a.metadata?.mergedDataStructure?.dependencySchemas?.[importedExport.filePath]?.[importedExport.name])?.metadata?.mergedDataStructure?.dependencySchemas, importedExport.entityType);
14
22
  }
15
23
  function isIndexPath(filePath) {
16
24
  if (!filePath)
@@ -18,6 +26,56 @@ function isIndexPath(filePath) {
18
26
  const fileName = filePath.split('/').pop();
19
27
  return fileName.startsWith('index.');
20
28
  }
29
+ /**
30
+ * Convert .d.ts type declaration content to stub implementations.
31
+ * .d.ts files only have type declarations which don't provide runtime exports.
32
+ * This function converts them to actual stub implementations.
33
+ *
34
+ * @param content - The .d.ts file content
35
+ * @param entityName - The name of the entity we're generating for (used to ensure it's exported)
36
+ * @returns The converted content with stub implementations
37
+ */
38
+ function convertDtsToStubs(content, entityName) {
39
+ let result = content;
40
+ // Handle object types FIRST (before simple types) since they span multiple lines
41
+ // and contain semicolons that would incorrectly terminate the simple type regex
42
+ // Convert "export declare const NAME: { ... };" (object type) to "export const NAME = {} as any;"
43
+ result = result.replace(/export\s+declare\s+const\s+(\w+)\s*:\s*\{[^}]*\}\s*;/gs, 'export const $1 = {} as any;');
44
+ // Convert "export declare let NAME: { ... };" (object type) to "export let NAME = {} as any;"
45
+ result = result.replace(/export\s+declare\s+let\s+(\w+)\s*:\s*\{[^}]*\}\s*;/gs, 'export let $1 = {} as any;');
46
+ // Convert "export declare var NAME: { ... };" (object type) to "export var NAME = {} as any;"
47
+ result = result.replace(/export\s+declare\s+var\s+(\w+)\s*:\s*\{[^}]*\}\s*;/gs, 'export var $1 = {} as any;');
48
+ // Now handle simple types (non-object types)
49
+ // Convert "export declare const NAME: TYPE;" to "export const NAME = {} as any;"
50
+ result = result.replace(/export\s+declare\s+const\s+(\w+)\s*:\s*[^;]+;/g, 'export const $1 = {} as any;');
51
+ // Convert "export declare let NAME: TYPE;" to "export let NAME = {} as any;"
52
+ result = result.replace(/export\s+declare\s+let\s+(\w+)\s*:\s*[^;]+;/g, 'export let $1 = {} as any;');
53
+ // Convert "export declare var NAME: TYPE;" to "export var NAME = {} as any;"
54
+ result = result.replace(/export\s+declare\s+var\s+(\w+)\s*:\s*[^;]+;/g, 'export var $1 = {} as any;');
55
+ // Convert "export declare function NAME(...): TYPE;" to "export function NAME() { return {} as any; }"
56
+ result = result.replace(/export\s+declare\s+function\s+(\w+)\s*\([^)]*\)\s*:\s*[^;]+;/g, 'export function $1(...args: any[]) { return {} as any; }');
57
+ // Convert "export declare class NAME { ... }" to "export class NAME {}"
58
+ // This is tricky because class bodies can span multiple lines
59
+ result = result.replace(/export\s+declare\s+class\s+(\w+)\s*(?:extends\s+[^{]+)?\{[^}]*\}/gs, 'export class $1 {}');
60
+ // Convert "declare const NAME: { ... }" (object type, non-exported) to "const NAME = {} as any;"
61
+ // Object types can span multiple lines and contain semicolons, so we handle them separately
62
+ // The 's' flag makes . match newlines, so this matches the entire object type block
63
+ result = result.replace(/^declare\s+const\s+(\w+)\s*:\s*\{[^}]*\}\s*;/gms, 'const $1 = {} as any;');
64
+ // Convert "declare const NAME: TYPE;" (simple type, non-exported) to "const NAME = {} as any;"
65
+ // These are often used with "export { NAME }" at the end
66
+ // This must come AFTER the object type handler above
67
+ result = result.replace(/^declare\s+const\s+(\w+)\s*:\s*[^;]+;/gm, 'const $1 = {} as any;');
68
+ // Convert "declare function NAME" (non-exported) to "function NAME() { return {} as any; }"
69
+ result = result.replace(/^declare\s+function\s+(\w+)\s*\([^)]*\)\s*:\s*[^;]+;/gm, 'function $1(...args: any[]) { return {} as any; }');
70
+ // Convert "declare class NAME" (non-exported) to "class NAME {}"
71
+ result = result.replace(/^declare\s+class\s+(\w+)\s*(?:extends\s+[^{]+)?\{[^}]*\}/gm, 'class $1 {}');
72
+ // Remove "export { }" at the end (empty export statement that marks module as having no exports)
73
+ result = result.replace(/export\s*\{\s*\}\s*;?\s*$/g, '');
74
+ // Keep export type and export interface statements as-is (they're valid in .ts)
75
+ // No transformation needed for these
76
+ console.log(`CodeYam: Converted .d.ts content for entity "${entityName}". Result length: ${result.length}`);
77
+ return result;
78
+ }
21
79
  /**
22
80
  * Rewrite relative asset paths to correct locations when a file is moved.
23
81
  *
@@ -59,6 +117,137 @@ function rewriteAssetImports(fileContent, originalFilePath, newFilePath) {
59
117
  return `${quote}${newRelativePath}${quote}`;
60
118
  });
61
119
  }
120
+ /**
121
+ * Rewrite relative TypeScript/JavaScript module imports when a file is moved.
122
+ *
123
+ * When a file is moved from one location to another (e.g., from [environmentId]/
124
+ * to _environmentId_/), relative imports like "./lib/organization" need to be
125
+ * rewritten to point to the correct location from the new path.
126
+ *
127
+ * This is similar to rewriteAssetImports but handles TypeScript/JavaScript modules
128
+ * instead of asset files (CSS, images, etc.).
129
+ */
130
+ function rewriteRelativeModuleImports(fileContent, originalFilePath, newFilePath) {
131
+ // Module file extensions that should have their relative paths rewritten
132
+ const moduleExtensions = 'ts|tsx|js|jsx|mjs|cjs';
133
+ // Match import statements with relative paths (starting with ./ or ../)
134
+ // This matches:
135
+ // - import { foo } from "./path.js"
136
+ // - import foo from "../path.js"
137
+ // - import * as foo from "./path/index.js"
138
+ // - import "./path" (side-effect imports)
139
+ // The path may or may not have a file extension
140
+ const relativeImportRegex = new RegExp(`(from\\s+)(['"])(\\.\\.?\\/[^'"]+?)(?:\\.(?:${moduleExtensions}))?\\2`, 'g');
141
+ // Get the directory part of the original file path (relative to project root)
142
+ const originalDirParts = originalFilePath.split('/').slice(0, -1);
143
+ return fileContent.replace(relativeImportRegex, (match, fromKeyword, quote, importPath) => {
144
+ // Skip imports that already point to generated CodeYam files:
145
+ // 1. Scenario component files with SHA hashes (64 hex chars) and scenario name suffixes
146
+ // e.g., "abc123def_EnvironmentLayout_Empty_Survey_No_Responses"
147
+ // 2. Mock data files in __codeyamMocks__ directory
148
+ // e.g., "../__codeyamMocks__/MockData_Empty_Survey_No_Responses"
149
+ const scenarioFilePattern = /[a-f0-9]{64}_\w+_[A-Z][a-zA-Z_]+$/;
150
+ const mockDataPattern = /__codeyamMocks__\//;
151
+ if (scenarioFilePattern.test(importPath) ||
152
+ mockDataPattern.test(importPath)) {
153
+ // This import already points to a generated file, don't rewrite it
154
+ return match;
155
+ }
156
+ // Resolve the import path relative to the original file's directory
157
+ const pathParts = importPath.split('/');
158
+ const resolvedParts = [...originalDirParts];
159
+ for (const part of pathParts) {
160
+ if (part === '..') {
161
+ resolvedParts.pop();
162
+ }
163
+ else if (part !== '.') {
164
+ resolvedParts.push(part);
165
+ }
166
+ }
167
+ // Build the project-relative path to the module
168
+ const absoluteModulePath = resolvedParts.join('/');
169
+ // Calculate the new relative path from new file location
170
+ const newRelativePath = getRelativePath(newFilePath, absoluteModulePath);
171
+ // Replace the path in the original match, preserving the quote style
172
+ return `${fromKeyword}${quote}${newRelativePath}${quote}`;
173
+ });
174
+ }
175
+ /**
176
+ * Strip <html> and <body> tags from root layout files for Next.js App Router.
177
+ *
178
+ * When a root layout (app/layout.tsx) is generated as a scenario component and placed
179
+ * under the /static/ route, it becomes nested under the real app root layout. Having
180
+ * two layouts with <html> and <body> tags causes hydration errors:
181
+ *
182
+ * "In HTML, <html> cannot be a child of <body>"
183
+ * "You are mounting a new html component when a previous one has not first unmounted"
184
+ *
185
+ * This function removes the <html> and <body> wrapper tags while preserving the inner
186
+ * content, allowing the scenario layout to work correctly when nested.
187
+ *
188
+ * Before: <html lang="en"><body className={...}><main>{children}</main></body></html>
189
+ * After: <div className={...}><main>{children}</main></div>
190
+ */
191
+ function stripHtmlBodyTags(fileContent, filePath, framework) {
192
+ // Only apply to Next.js App Router root layouts
193
+ if (framework !== ProjectFramework.Next) {
194
+ return fileContent;
195
+ }
196
+ // Check if this is a root layout file (typically app/layout.tsx or apps/*/app/layout.tsx)
197
+ // Root layouts are at the app directory level, not in subdirectories like (app)/ or routes/
198
+ const pathParts = filePath.split('/');
199
+ const fileName = pathParts[pathParts.length - 1];
200
+ // Must be a layout file
201
+ if (!fileName?.startsWith('layout.')) {
202
+ return fileContent;
203
+ }
204
+ // Check if it's at the app root level (parent directory is 'app')
205
+ const parentDir = pathParts[pathParts.length - 2];
206
+ if (parentDir !== 'app') {
207
+ return fileContent;
208
+ }
209
+ // Check if this file actually contains <html> and <body> tags
210
+ if (!/<html[^>]*>/.test(fileContent) || !/<body[^>]*>/.test(fileContent)) {
211
+ return fileContent;
212
+ }
213
+ console.log(`CodeYam: Stripping <html> and <body> tags from root layout: ${filePath}`);
214
+ // Extract the body className/attributes if any, to preserve styling
215
+ const bodyMatch = fileContent.match(/<body([^>]*)>/);
216
+ const bodyAttributes = bodyMatch?.[1]?.trim() || '';
217
+ // Replace the JSX structure:
218
+ // <html ...><body ...>CONTENT</body></html>
219
+ // With: <div ...>CONTENT</div>
220
+ //
221
+ // This regex handles:
222
+ // 1. Opening <html> tag with any attributes
223
+ // 2. Opening <body> tag with any attributes (captured for the wrapper div)
224
+ // 3. Content between body tags (captured)
225
+ // 4. Closing </body> and </html> tags
226
+ const htmlBodyRegex = /(<html[^>]*>\s*<body)([^>]*)(>)([\s\S]*?)(<\/body>\s*<\/html>)/g;
227
+ let result = fileContent.replace(htmlBodyRegex, (match, _htmlBody, bodyAttrs, closeBracket, content, _closing) => {
228
+ // Create a wrapper div with the body's attributes
229
+ const attrs = bodyAttrs?.trim() || '';
230
+ if (attrs) {
231
+ return `(<div${bodyAttrs}${closeBracket}${content}</div>)`;
232
+ }
233
+ else {
234
+ return `(<>${content}</>)`;
235
+ }
236
+ });
237
+ // If the regex didn't match (perhaps due to different formatting),
238
+ // try a more lenient approach - just remove the tags
239
+ if (result === fileContent) {
240
+ // Remove <html ...> opening tag
241
+ result = result.replace(/<html[^>]*>\s*/g, '');
242
+ // Remove </html> closing tag
243
+ result = result.replace(/\s*<\/html>/g, '');
244
+ // Replace <body ...> with <div ...> to preserve attributes
245
+ result = result.replace(/<body([^>]*)>/g, '<div$1>');
246
+ // Replace </body> with </div>
247
+ result = result.replace(/<\/body>/g, '</div>');
248
+ }
249
+ return result;
250
+ }
62
251
  function addMockToContent(fileContent, importedExport, fileAnalyses, rootAnalysis, relativeMocksDir, scenarioName, importPath) {
63
252
  // First try to find dependency schemas in fileAnalyses (for same-file dependencies)
64
253
  let dependencySchemas = fileAnalyses.find((a) => !!a.metadata?.mergedDataStructure?.dependencySchemas?.[importedExport.filePath]?.[importedExport.name])?.metadata?.mergedDataStructure?.dependencySchemas;
@@ -68,7 +257,7 @@ function addMockToContent(fileContent, importedExport, fileAnalyses, rootAnalysi
68
257
  dependencySchemas =
69
258
  rootAnalysis.metadata?.mergedDataStructure?.dependencySchemas;
70
259
  }
71
- const mockCode = constructMockCode(importedExport.name, dependencySchemas);
260
+ const mockCode = constructMockCode(importedExport.name, dependencySchemas, importedExport.entityType);
72
261
  if (!mockCode) {
73
262
  console.log('CodeYam Error: Mock code not found', JSON.stringify({
74
263
  importedExportFilePath: importedExport.filePath,
@@ -93,7 +282,9 @@ function addMockToContent(fileContent, importedExport, fileAnalyses, rootAnalysi
93
282
  fileContent = fileContent.replace(entireImportRegExp, '');
94
283
  }
95
284
  else {
96
- const importRegExp = new RegExp(`(import(?:(?!${firstPart}|from|import)[\\s\\S])*?)${firstPart}(?:,\\s*)?((?:(?!import)[\\s\\S])*?from\\s+['"]${importPath}['"])`, 'm');
285
+ // Escape regex special characters in importPath (e.g., brackets in [environmentId])
286
+ const escapedImportPath = importPath.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
287
+ const importRegExp = new RegExp(`(import(?:(?!${firstPart}|from|import)[\\s\\S])*?)${firstPart}(?:,\\s*)?((?:(?!import)[\\s\\S])*?from\\s+['"]${escapedImportPath}['"])`, 'm');
97
288
  if (importedExportNameParts.length > 1) {
98
289
  fileContent = fileContent.replace(importRegExp, `$1${firstPart}__cyOriginal$2`);
99
290
  }
@@ -105,6 +296,26 @@ function addMockToContent(fileContent, importedExport, fileAnalyses, rootAnalysi
105
296
  fileContent = fileContent.replace(/import\s*\{\s*\}\s*from\s+['"][^'"]*['"];?\s*\n?/g, '');
106
297
  }
107
298
  }
299
+ else {
300
+ // Fallback: When importPath is undefined (e.g., path alias not in mapping),
301
+ // we still need to remove the import to avoid "name defined multiple times" errors.
302
+ // Search for the entity name in any import statement and remove it.
303
+ const importedExportNameParts = splitOutsideParenthesesAndArrays(importedExport.name);
304
+ const firstPart = importedExportNameParts[0];
305
+ // Match the entity name in any named import and remove just that name
306
+ // This handles imports like: import { useEnvironment, otherThing } from "any/path"
307
+ // Removes useEnvironment but keeps otherThing
308
+ const namedImportRegExp = new RegExp(`(import\\s*\\{[^}]*?)\\b${escapeRegExp(firstPart)}\\b(?:,\\s*|\\s*,)?((?:[^}]*\\}\\s*from\\s*['"][^'"]*['"];?))`, 'm');
309
+ if (importedExportNameParts.length > 1) {
310
+ // Rename the import instead of removing (for destructured access patterns)
311
+ fileContent = fileContent.replace(namedImportRegExp, `$1${firstPart}__cyOriginal$2`);
312
+ }
313
+ else {
314
+ fileContent = fileContent.replace(namedImportRegExp, '$1$2');
315
+ }
316
+ // Clean up empty imports that might result from removing the only import
317
+ fileContent = fileContent.replace(/import\s*\{\s*\}\s*from\s+['"][^'"]*['"];?\s*\n?/g, '');
318
+ }
108
319
  if (fileContent.indexOf('import { scenarios } from') === -1) {
109
320
  // Use scenario-specific MockData file to allow multiple scenarios to coexist
110
321
  const mockDataPath = `${relativeMocksDir}/MockData_${safeFileName(scenarioName)}`;
@@ -324,6 +535,22 @@ export default async function writeScenarioComponents({ project, file, entity, r
324
535
  const nodeModuleImports = allImportedExports.filter((nodeModuleImport, index, self) => nodeModuleImport.isNodeModule &&
325
536
  index === self.findIndex((nmi) => nmi.name === nodeModuleImport.name));
326
537
  let fileContent = file.content;
538
+ // Handle .d.ts files: convert type declarations to stub implementations
539
+ // .d.ts files only have type declarations (e.g., "export declare const logger")
540
+ // which don't provide runtime exports. We need to generate actual stub implementations.
541
+ if (file.path.endsWith('.d.ts')) {
542
+ console.log(`CodeYam: Converting .d.ts file to stub implementations: ${file.path}`);
543
+ fileContent = convertDtsToStubs(fileContent, entity.name);
544
+ }
545
+ // Extract "use client" or "use server" directive FIRST, before any modifications
546
+ // This ensures the directive isn't buried by prepended imports
547
+ const directiveMatch = fileContent.match(/^(\s*["']use (client|server)["'];?\s*\n?)/);
548
+ let extractedDirective = null;
549
+ if (directiveMatch) {
550
+ extractedDirective = directiveMatch[1].trim();
551
+ // Remove the directive from fileContent - we'll add it back at the very end
552
+ fileContent = fileContent.slice(directiveMatch[0].length);
553
+ }
327
554
  const fileAnalyzer = projectAnalyzer.getFileAnalyzer(file);
328
555
  const importMapping = fileAnalyzer.getRelativeImportMappings();
329
556
  let filePath = file.path;
@@ -464,26 +691,56 @@ export default async function writeScenarioComponents({ project, file, entity, r
464
691
  else if (importedExport.filePath === file.path &&
465
692
  importedExport.name !== entity.name) {
466
693
  // For same-file dependencies:
467
- // - Strip if isMocked is true (e.g., Remix/Next loaders, server-side code)
468
- // - Strip if we have a mock structure we can generate
469
- // - Only add mock code if we have a mock structure
470
- const shouldStrip = importedExport.isMocked ||
471
- hasMockStructure(importedExport, fileAnalyses);
472
- if (shouldStrip) {
694
+ // - Strip and replace if we have a mock structure we can generate
695
+ // - Strip and stub if isMocked is true AND it's a callable entity (visual, library, functionCall)
696
+ // - Preserve as-is for data entities (like Zod schemas) that need their methods
697
+ const hasMock = hasMockStructure(importedExport, fileAnalyses);
698
+ const entityType = importedExport.entityType;
699
+ // Data and type entities should be preserved - they're not callable and may have methods
700
+ // that stubbing would break (e.g., Zod schemas with .superRefine())
701
+ const isDataEntity = entityType === 'data' || entityType === 'type';
702
+ // Heuristic: Zod schemas are often misclassified as 'library' but should be preserved
703
+ // Detect by: name starts with Z + uppercase letter, AND has Zod method calls
704
+ const looksLikeZodSchema = entityType === 'library' &&
705
+ /^Z[A-Z]/.test(importedExport.name) &&
706
+ importedExport.calls?.some((call) => /\.(superRefine|refine|transform|default|optional|nullable|array|object|string|number|boolean|parse|safeParse)\s*\(/.test(call));
707
+ if (looksLikeZodSchema) {
708
+ console.log(`CodeYam: Detected Zod schema "${importedExport.name}" (misclassified as library) - will preserve`);
709
+ }
710
+ // Callable entities can be safely stubbed (but not Zod schemas)
711
+ const isCallable = !isDataEntity && !looksLikeZodSchema && entityType !== undefined;
712
+ // Determine what action to take
713
+ const shouldStripAndReplace = hasMock;
714
+ const shouldStripAndStub = !hasMock && importedExport.isMocked && isCallable;
715
+ const shouldPreserve = !hasMock && importedExport.isMocked && !isCallable;
716
+ // Log warning if entityType is undefined for a mocked same-file dependency
717
+ // This could indicate an analysis issue where entityType wasn't properly set
718
+ if (importedExport.isMocked && entityType === undefined) {
719
+ console.warn(`CodeYam: WARNING - Same-file dependency "${importedExport.name}" is isMocked but has no entityType. ` +
720
+ `Treating as non-callable (will preserve). File: ${file.path}`);
721
+ }
722
+ if (shouldPreserve) {
723
+ // For data entities (like Zod schemas), don't strip or stub - preserve the original
724
+ // This ensures schema methods like .superRefine() continue to work
725
+ console.log(`CodeYam: Preserving ${importedExport.name} (entityType: ${entityType}) - not stripping data entities`);
726
+ // Don't modify fileContent - keep the original code
727
+ }
728
+ else if (shouldStripAndReplace || shouldStripAndStub) {
729
+ // Strip the original code
473
730
  const entityCode = fileAnalyzer.getEntityCode(importedExport.name);
474
731
  if (entityCode) {
475
732
  fileContent = fileContent.replace(entityCode, '');
476
733
  }
477
- // Only add mock if we have a mock structure to generate
478
- if (hasMockStructure(importedExport, fileAnalyses)) {
734
+ if (shouldStripAndReplace) {
735
+ // Add mock from mock structure
479
736
  fileContent = addMockToContent(fileContent, importedExport, fileAnalyses, rootAnalysis, relativeMocksDir, scenario.name);
480
737
  }
481
- else if (importedExport.isMocked) {
482
- // No mock structure available, but isMocked is true.
738
+ else if (shouldStripAndStub) {
483
739
  // Generate a simple stub mock that returns scenario data.
484
740
  // This prevents ReferenceError at runtime when the stripped
485
741
  // function is called (e.g., local helper functions like getInitialProps).
486
742
  const functionName = importedExport.name;
743
+ console.log(`CodeYam: Generating stub mock for ${functionName} (entityType: ${entityType}) in ${file.path}`);
487
744
  // Add scenarios import if not present
488
745
  if (fileContent.indexOf('import { scenarios } from') === -1) {
489
746
  const mockDataPath = `${relativeMocksDir}/MockData_${safeFileName(scenario.name)}`;
@@ -582,7 +839,7 @@ export default async function writeScenarioComponents({ project, file, entity, r
582
839
  // If we have an import mapping, use it to find the import string to replace
583
840
  // Otherwise, skip rewriting (we can't find the import statement without knowing what to search for)
584
841
  if (mockImportMapping) {
585
- const importRegExp = new RegExp(`${mockImportMapping.replace(/([$()])/g, '\\$1')}(['"])`, 'g');
842
+ const importRegExp = new RegExp(`${escapeRegExp(mockImportMapping)}(['"])`, 'g');
586
843
  // Check if the original import path still exists in the file
587
844
  // If it was already rewritten by another entity from the same module,
588
845
  // we need to add a separate import statement for this entity
@@ -598,9 +855,11 @@ export default async function writeScenarioComponents({ project, file, entity, r
598
855
  // First, try to remove this entity from the already-rewritten grouped import
599
856
  // This prevents duplicate/conflicting imports
600
857
  // Match patterns like "EntityName," or ", EntityName" or "EntityName" (if only one)
858
+ // Note: entityImportName needs escaping since JS identifiers can contain $ (a regex metacharacter)
859
+ const escapedEntityName = escapeRegExp(entityImportName);
601
860
  const removeFromGroupedImportPatterns = [
602
- new RegExp(`\\b${entityImportName}\\s*,\\s*`, 'g'), // "EntityName, "
603
- new RegExp(`\\s*,\\s*${entityImportName}\\b`, 'g'), // ", EntityName"
861
+ new RegExp(`\\b${escapedEntityName}\\s*,\\s*`, 'g'), // "EntityName, "
862
+ new RegExp(`\\s*,\\s*${escapedEntityName}\\b`, 'g'), // ", EntityName"
604
863
  ];
605
864
  for (const pattern of removeFromGroupedImportPatterns) {
606
865
  fileContent = fileContent.replace(pattern, '');
@@ -631,9 +890,9 @@ export default async function writeScenarioComponents({ project, file, entity, r
631
890
  const nodeModuleUniversalMocks = universalMocks.filter((mock) => mock.nodeModule && mock.content);
632
891
  for (const universalMock of nodeModuleUniversalMocks) {
633
892
  const originalPath = universalMock.filePath;
634
- // Create the mock file name using the same pattern as applyUniversalMocks
635
- const safeFileName = originalPath.replace(/[^a-zA-Z0-9_\-./]/g, '_');
636
- const mockFileRelativePath = `${relativeMocksDir}/${safeFileName}`;
893
+ // Create the mock file name using the same safeFileName function as writeUniversalMocks
894
+ const safeMockFileName = safeFileName(originalPath);
895
+ const mockFileRelativePath = `${relativeMocksDir}/${safeMockFileName}`;
637
896
  // Match both single and double quotes, and handle both named and default imports
638
897
  // Pattern 1: import { x, y } from "module"
639
898
  // Pattern 2: import x from "module"
@@ -676,9 +935,16 @@ export default async function writeScenarioComponents({ project, file, entity, r
676
935
  scenario,
677
936
  });
678
937
  }
938
+ // Strip <html> and <body> tags from root layout files for Next.js
939
+ // These tags cause hydration errors when the scenario layout is nested under the real root
940
+ fileContent = stripHtmlBodyTags(fileContent, file.path, framework);
679
941
  // Rewrite asset imports (CSS, images, fonts, etc.) to correct relative paths
680
942
  // The original file path is relative to PROJECT_RELATIVE_PATH, the new path is scenarioComponentPath
681
943
  fileContent = rewriteAssetImports(fileContent, `${PROJECT_RELATIVE_PATH}/${file.path}`, scenarioComponentPath);
944
+ // Rewrite relative TypeScript/JavaScript module imports to correct relative paths
945
+ // This handles cases where the file is moved (e.g., from [environmentId]/ to _environmentId_/)
946
+ // and relative imports like "./lib/organization" need to be rewritten
947
+ fileContent = rewriteRelativeModuleImports(fileContent, `${PROJECT_RELATIVE_PATH}/${file.path}`, scenarioComponentPath);
682
948
  console.log('Writing scenario component', file.path, entity.name, scenarioComponentPath, fileContent.length);
683
949
  const scenarioComponentComment = `// This file is auto-generated by CodeYam. Do not edit this file manually.
684
950
  // This file contains content for a scenario component:
@@ -690,7 +956,17 @@ export default async function writeScenarioComponents({ project, file, entity, r
690
956
  // Entity: ${rootAnalysis.entitySha} ${rootAnalysis.entityName}
691
957
  // Scenario: ${scenario.id} - ${scenario.name}
692
958
  `;
693
- await writeFile(scenarioComponentPath, `${scenarioComponentComment}\n\n${fileContent}`);
959
+ // Use the directive that was extracted at the beginning of processing
960
+ // This ensures it stays at the very top even after imports are prepended
961
+ let finalContent;
962
+ if (extractedDirective) {
963
+ finalContent = `${extractedDirective}\n\n${scenarioComponentComment}\n\n${fileContent}`;
964
+ console.log(`CodeYam: Placed "${extractedDirective}" directive at top of file: ${scenarioComponentPath}`);
965
+ }
966
+ else {
967
+ finalContent = `${scenarioComponentComment}\n\n${fileContent}`;
968
+ }
969
+ await writeFile(scenarioComponentPath, finalContent);
694
970
  scenarioComponentPaths.push(scenarioComponentPath);
695
971
  console.log('CodeYam [writeScenarioComponents]: Generated scenario files', {
696
972
  entityName: entity.name,