@wyw-in-js/transform 1.1.0 → 2.0.0-alpha.1

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 (801) hide show
  1. package/esm/cache.js +433 -289
  2. package/esm/cache.js.map +1 -1
  3. package/esm/debug/fileReporter.js +171 -134
  4. package/esm/debug/fileReporter.js.map +1 -1
  5. package/esm/eval/broker.js +2275 -0
  6. package/esm/eval/broker.js.map +1 -0
  7. package/esm/eval/lru.js +36 -0
  8. package/esm/eval/lru.js.map +1 -0
  9. package/esm/eval/prepareModuleOnDemand.js +21 -0
  10. package/esm/eval/prepareModuleOnDemand.js.map +1 -0
  11. package/esm/eval/protocol.js +2 -0
  12. package/esm/eval/protocol.js.map +1 -0
  13. package/esm/eval/runner.js +1878 -0
  14. package/esm/eval/runner.js.map +1 -0
  15. package/esm/eval/serialize.js +333 -0
  16. package/esm/eval/serialize.js.map +1 -0
  17. package/esm/eval/writeQueue.js +81 -0
  18. package/esm/eval/writeQueue.js.map +1 -0
  19. package/esm/evaluators/index.js +11 -12
  20. package/esm/evaluators/index.js.map +1 -1
  21. package/esm/index.js +25 -29
  22. package/esm/index.js.map +1 -1
  23. package/esm/module.js +923 -520
  24. package/esm/module.js.map +1 -1
  25. package/esm/shaker.js +14 -80
  26. package/esm/shaker.js.map +1 -1
  27. package/esm/transform/BaseEntrypoint.js +162 -164
  28. package/esm/transform/BaseEntrypoint.js.map +1 -1
  29. package/esm/transform/Entrypoint.helpers.js +96 -253
  30. package/esm/transform/Entrypoint.helpers.js.map +1 -1
  31. package/esm/transform/Entrypoint.js +336 -270
  32. package/esm/transform/Entrypoint.js.map +1 -1
  33. package/esm/transform/Entrypoint.types.js +1 -1
  34. package/esm/transform/Entrypoint.types.js.map +1 -1
  35. package/esm/transform/EvaluatedEntrypoint.js +10 -4
  36. package/esm/transform/EvaluatedEntrypoint.js.map +1 -1
  37. package/esm/transform/actions/AbortError.js +6 -6
  38. package/esm/transform/actions/AbortError.js.map +1 -1
  39. package/esm/transform/actions/BaseAction.js +140 -136
  40. package/esm/transform/actions/BaseAction.js.map +1 -1
  41. package/esm/transform/actions/UnprocessedEntrypointError.js +6 -6
  42. package/esm/transform/actions/UnprocessedEntrypointError.js.map +1 -1
  43. package/esm/transform/actions/actionRunner.js +63 -66
  44. package/esm/transform/actions/actionRunner.js.map +1 -1
  45. package/esm/transform/actions/types.js +1 -1
  46. package/esm/transform/actions/types.js.map +1 -1
  47. package/esm/transform/barrelManifest.types.js +2 -0
  48. package/esm/transform/barrelManifest.types.js.map +1 -0
  49. package/esm/transform/generators/baseProcessingHandlers.js +15 -17
  50. package/esm/transform/generators/baseProcessingHandlers.js.map +1 -1
  51. package/esm/transform/generators/collect.js +27 -55
  52. package/esm/transform/generators/collect.js.map +1 -1
  53. package/esm/transform/generators/createStylisPreprocessor.js +353 -321
  54. package/esm/transform/generators/createStylisPreprocessor.js.map +1 -1
  55. package/esm/transform/generators/evalFile.js +48 -47
  56. package/esm/transform/generators/evalFile.js.map +1 -1
  57. package/esm/transform/generators/extract.js +78 -90
  58. package/esm/transform/generators/extract.js.map +1 -1
  59. package/esm/transform/generators/getExports.js +57 -74
  60. package/esm/transform/generators/getExports.js.map +1 -1
  61. package/esm/transform/generators/index.js +11 -11
  62. package/esm/transform/generators/index.js.map +1 -1
  63. package/esm/transform/generators/processEntrypoint.js +93 -67
  64. package/esm/transform/generators/processEntrypoint.js.map +1 -1
  65. package/esm/transform/generators/processImports.js +102 -67
  66. package/esm/transform/generators/processImports.js.map +1 -1
  67. package/esm/transform/generators/resolveImports.js +212 -197
  68. package/esm/transform/generators/resolveImports.js.map +1 -1
  69. package/esm/transform/generators/resolveStaticOxcValues/cache.js +182 -0
  70. package/esm/transform/generators/resolveStaticOxcValues/cache.js.map +1 -0
  71. package/esm/transform/generators/resolveStaticOxcValues/candidateResolver.js +146 -0
  72. package/esm/transform/generators/resolveStaticOxcValues/candidateResolver.js.map +1 -0
  73. package/esm/transform/generators/resolveStaticOxcValues/dependencies.js +33 -0
  74. package/esm/transform/generators/resolveStaticOxcValues/dependencies.js.map +1 -0
  75. package/esm/transform/generators/resolveStaticOxcValues/environment.js +29 -0
  76. package/esm/transform/generators/resolveStaticOxcValues/environment.js.map +1 -0
  77. package/esm/transform/generators/resolveStaticOxcValues/exportResolver.js +351 -0
  78. package/esm/transform/generators/resolveStaticOxcValues/exportResolver.js.map +1 -0
  79. package/esm/transform/generators/resolveStaticOxcValues/exportTargets.js +253 -0
  80. package/esm/transform/generators/resolveStaticOxcValues/exportTargets.js.map +1 -0
  81. package/esm/transform/generators/resolveStaticOxcValues/objectAssign.js +310 -0
  82. package/esm/transform/generators/resolveStaticOxcValues/objectAssign.js.map +1 -0
  83. package/esm/transform/generators/resolveStaticOxcValues/objectAssignStaticExport.js +74 -0
  84. package/esm/transform/generators/resolveStaticOxcValues/objectAssignStaticExport.js.map +1 -0
  85. package/esm/transform/generators/resolveStaticOxcValues/opaqueRuntime.js +229 -0
  86. package/esm/transform/generators/resolveStaticOxcValues/opaqueRuntime.js.map +1 -0
  87. package/esm/transform/generators/resolveStaticOxcValues/processorStaticExport.js +172 -0
  88. package/esm/transform/generators/resolveStaticOxcValues/processorStaticExport.js.map +1 -0
  89. package/esm/transform/generators/resolveStaticOxcValues/processorStaticModel.js +476 -0
  90. package/esm/transform/generators/resolveStaticOxcValues/processorStaticModel.js.map +1 -0
  91. package/esm/transform/generators/resolveStaticOxcValues/processorTarget.js +55 -0
  92. package/esm/transform/generators/resolveStaticOxcValues/processorTarget.js.map +1 -0
  93. package/esm/transform/generators/resolveStaticOxcValues/programAnalysis.js +123 -0
  94. package/esm/transform/generators/resolveStaticOxcValues/programAnalysis.js.map +1 -0
  95. package/esm/transform/generators/resolveStaticOxcValues/prune.js +186 -0
  96. package/esm/transform/generators/resolveStaticOxcValues/prune.js.map +1 -0
  97. package/esm/transform/generators/resolveStaticOxcValues/resolveStaticOxcPreevalValues.js +183 -0
  98. package/esm/transform/generators/resolveStaticOxcValues/resolveStaticOxcPreevalValues.js.map +1 -0
  99. package/esm/transform/generators/resolveStaticOxcValues/staticExpression.js +298 -0
  100. package/esm/transform/generators/resolveStaticOxcValues/staticExpression.js.map +1 -0
  101. package/esm/transform/generators/resolveStaticOxcValues/staticExpressionDependencies.js +298 -0
  102. package/esm/transform/generators/resolveStaticOxcValues/staticExpressionDependencies.js.map +1 -0
  103. package/esm/transform/generators/resolveStaticOxcValues/types.js +3 -0
  104. package/esm/transform/generators/resolveStaticOxcValues/types.js.map +1 -0
  105. package/esm/transform/generators/resolveStaticOxcValues/zeroArgFunctionStaticExport.js +59 -0
  106. package/esm/transform/generators/resolveStaticOxcValues/zeroArgFunctionStaticExport.js.map +1 -0
  107. package/esm/transform/generators/resolveStaticOxcValues.js +2 -0
  108. package/esm/transform/generators/resolveStaticOxcValues.js.map +1 -0
  109. package/esm/transform/generators/rewriteOxcBarrelImports.js +822 -0
  110. package/esm/transform/generators/rewriteOxcBarrelImports.js.map +1 -0
  111. package/esm/transform/generators/transform.js +251 -248
  112. package/esm/transform/generators/transform.js.map +1 -1
  113. package/esm/transform/generators/workflow.js +87 -90
  114. package/esm/transform/generators/workflow.js.map +1 -1
  115. package/esm/transform/helpers/loadWywOptions.js +183 -74
  116. package/esm/transform/helpers/loadWywOptions.js.map +1 -1
  117. package/esm/transform/helpers/withDefaultServices.js +13 -22
  118. package/esm/transform/helpers/withDefaultServices.js.map +1 -1
  119. package/esm/transform/isStaticallyEvaluatableModule.js +140 -152
  120. package/esm/transform/isStaticallyEvaluatableModule.js.map +1 -1
  121. package/esm/transform/oxcBarrelManifest.js +349 -0
  122. package/esm/transform/oxcBarrelManifest.js.map +1 -0
  123. package/esm/transform/rootLog.js +3 -3
  124. package/esm/transform/rootLog.js.map +1 -1
  125. package/esm/transform/syntax.js +2 -0
  126. package/esm/transform/syntax.js.map +1 -0
  127. package/esm/transform/types.js +2 -2
  128. package/esm/transform/types.js.map +1 -1
  129. package/esm/transform.js +125 -147
  130. package/esm/transform.js.map +1 -1
  131. package/esm/types.js +4 -1
  132. package/esm/types.js.map +1 -1
  133. package/esm/utils/EventEmitter.js +79 -48
  134. package/esm/utils/EventEmitter.js.map +1 -1
  135. package/esm/utils/ShakerMetadata.js +2 -2
  136. package/esm/utils/ShakerMetadata.js.map +1 -1
  137. package/esm/utils/TransformDiagnostics.js +9 -9
  138. package/esm/utils/TransformDiagnostics.js.map +1 -1
  139. package/esm/utils/TransformMetadata.js +24 -26
  140. package/esm/utils/TransformMetadata.js.map +1 -1
  141. package/esm/utils/applyOxcProcessors/applyOxcProcessors.js +160 -0
  142. package/esm/utils/applyOxcProcessors/applyOxcProcessors.js.map +1 -0
  143. package/esm/utils/applyOxcProcessors/cleanupBindings.js +157 -0
  144. package/esm/utils/applyOxcProcessors/cleanupBindings.js.map +1 -0
  145. package/esm/utils/applyOxcProcessors/cleanupRemovals.js +431 -0
  146. package/esm/utils/applyOxcProcessors/cleanupRemovals.js.map +1 -0
  147. package/esm/utils/applyOxcProcessors/displayName.js +93 -0
  148. package/esm/utils/applyOxcProcessors/displayName.js.map +1 -0
  149. package/esm/utils/applyOxcProcessors/expressionValues.js +152 -0
  150. package/esm/utils/applyOxcProcessors/expressionValues.js.map +1 -0
  151. package/esm/utils/applyOxcProcessors/processorFactory.js +62 -0
  152. package/esm/utils/applyOxcProcessors/processorFactory.js.map +1 -0
  153. package/esm/utils/applyOxcProcessors/processorUsages.js +143 -0
  154. package/esm/utils/applyOxcProcessors/processorUsages.js.map +1 -0
  155. package/esm/utils/applyOxcProcessors/sameFileStaticValues.js +207 -0
  156. package/esm/utils/applyOxcProcessors/sameFileStaticValues.js.map +1 -0
  157. package/esm/utils/applyOxcProcessors/shared.js +29 -0
  158. package/esm/utils/applyOxcProcessors/shared.js.map +1 -0
  159. package/esm/utils/applyOxcProcessors/types.js +2 -0
  160. package/esm/utils/applyOxcProcessors/types.js.map +1 -0
  161. package/esm/utils/applyOxcProcessors.js +2 -0
  162. package/esm/utils/applyOxcProcessors.js.map +1 -0
  163. package/esm/utils/collectOxcExportsAndImports.js +934 -0
  164. package/esm/utils/collectOxcExportsAndImports.js.map +1 -0
  165. package/esm/utils/collectOxcRuntime/normalizeRuntimeCode.js +157 -0
  166. package/esm/utils/collectOxcRuntime/normalizeRuntimeCode.js.map +1 -0
  167. package/esm/utils/collectOxcRuntime/sourceMap.js +36 -0
  168. package/esm/utils/collectOxcRuntime/sourceMap.js.map +1 -0
  169. package/esm/utils/collectOxcRuntime/types.js +2 -0
  170. package/esm/utils/collectOxcRuntime/types.js.map +1 -0
  171. package/esm/utils/collectOxcRuntime.js +32 -0
  172. package/esm/utils/collectOxcRuntime.js.map +1 -0
  173. package/esm/utils/collectOxcTemplateDependencies/expressionExtraction.js +496 -0
  174. package/esm/utils/collectOxcTemplateDependencies/expressionExtraction.js.map +1 -0
  175. package/esm/utils/collectOxcTemplateDependencies/expressionReplacements.js +113 -0
  176. package/esm/utils/collectOxcTemplateDependencies/expressionReplacements.js.map +1 -0
  177. package/esm/utils/collectOxcTemplateDependencies/scopeAnalysis.js +387 -0
  178. package/esm/utils/collectOxcTemplateDependencies/scopeAnalysis.js.map +1 -0
  179. package/esm/utils/collectOxcTemplateDependencies/staticBindings.js +17 -0
  180. package/esm/utils/collectOxcTemplateDependencies/staticBindings.js.map +1 -0
  181. package/esm/utils/collectOxcTemplateDependencies/staticEvaluator.js +540 -0
  182. package/esm/utils/collectOxcTemplateDependencies/staticEvaluator.js.map +1 -0
  183. package/esm/utils/collectOxcTemplateDependencies/types.js +2 -0
  184. package/esm/utils/collectOxcTemplateDependencies/types.js.map +1 -0
  185. package/esm/utils/collectOxcTemplateDependencies.js +4 -0
  186. package/esm/utils/collectOxcTemplateDependencies.js.map +1 -0
  187. package/esm/utils/dispose-polyfill.js +3 -4
  188. package/esm/utils/dispose-polyfill.js.map +1 -1
  189. package/esm/utils/getFileIdx.js +6 -6
  190. package/esm/utils/getFileIdx.js.map +1 -1
  191. package/esm/utils/getPluginKey.js +12 -12
  192. package/esm/utils/getPluginKey.js.map +1 -1
  193. package/esm/utils/getVisitorKeys.js +9 -3
  194. package/esm/utils/getVisitorKeys.js.map +1 -1
  195. package/esm/utils/hasCachedWywPrevalExport.js +23 -0
  196. package/esm/utils/hasCachedWywPrevalExport.js.map +1 -0
  197. package/esm/utils/hasWywPreval.js +5 -5
  198. package/esm/utils/hasWywPreval.js.map +1 -1
  199. package/esm/utils/importOverrides.js +75 -90
  200. package/esm/utils/importOverrides.js.map +1 -1
  201. package/esm/utils/isNode.js +2 -2
  202. package/esm/utils/isNode.js.map +1 -1
  203. package/esm/utils/isNotNull.js +2 -2
  204. package/esm/utils/isNotNull.js.map +1 -1
  205. package/esm/utils/isSerializable.js +11 -11
  206. package/esm/utils/isSerializable.js.map +1 -1
  207. package/esm/utils/nativeResolver.js +93 -0
  208. package/esm/utils/nativeResolver.js.map +1 -0
  209. package/esm/utils/oxc/ast.js +28 -0
  210. package/esm/utils/oxc/ast.js.map +1 -0
  211. package/esm/utils/oxc/parse.js +3 -0
  212. package/esm/utils/oxc/parse.js.map +1 -0
  213. package/esm/utils/oxc/replacements.js +14 -0
  214. package/esm/utils/oxc/replacements.js.map +1 -0
  215. package/esm/utils/oxc/sourceLocations.js +59 -0
  216. package/esm/utils/oxc/sourceLocations.js.map +1 -0
  217. package/esm/utils/oxcAstService.js +121 -0
  218. package/esm/utils/oxcAstService.js.map +1 -0
  219. package/esm/utils/oxcEmit.js +447 -0
  220. package/esm/utils/oxcEmit.js.map +1 -0
  221. package/esm/utils/oxcPreevalStage/evalStrategy.js +3 -0
  222. package/esm/utils/oxcPreevalStage/evalStrategy.js.map +1 -0
  223. package/esm/utils/oxcPreevalStage/prepareCode.js +21 -0
  224. package/esm/utils/oxcPreevalStage/prepareCode.js.map +1 -0
  225. package/esm/utils/oxcPreevalStage/prevalExport.js +23 -0
  226. package/esm/utils/oxcPreevalStage/prevalExport.js.map +1 -0
  227. package/esm/utils/oxcPreevalStage/processors.js +17 -0
  228. package/esm/utils/oxcPreevalStage/processors.js.map +1 -0
  229. package/esm/utils/oxcPreevalStage/staticOverlay.js +18 -0
  230. package/esm/utils/oxcPreevalStage/staticOverlay.js.map +1 -0
  231. package/esm/utils/oxcPreevalStage/types.js +2 -0
  232. package/esm/utils/oxcPreevalStage/types.js.map +1 -0
  233. package/esm/utils/oxcPreevalStage.js +41 -0
  234. package/esm/utils/oxcPreevalStage.js.map +1 -0
  235. package/esm/utils/oxcPreevalTransforms.js +1065 -0
  236. package/esm/utils/oxcPreevalTransforms.js.map +1 -0
  237. package/esm/utils/oxcShaker.js +662 -0
  238. package/esm/utils/oxcShaker.js.map +1 -0
  239. package/esm/utils/parseOxc.js +37 -0
  240. package/esm/utils/parseOxc.js.map +1 -0
  241. package/esm/utils/parseRequest.js +27 -27
  242. package/esm/utils/parseRequest.js.map +1 -1
  243. package/esm/utils/peek.js +1 -1
  244. package/esm/utils/peek.js.map +1 -1
  245. package/esm/utils/processorLookup.js +125 -0
  246. package/esm/utils/processorLookup.js.map +1 -0
  247. package/esm/utils/processorStaticSemantics.js +157 -0
  248. package/esm/utils/processorStaticSemantics.js.map +1 -0
  249. package/esm/utils/resolveWithConditions.js +99 -0
  250. package/esm/utils/resolveWithConditions.js.map +1 -0
  251. package/esm/vm/createVmContext.js +140 -141
  252. package/esm/vm/createVmContext.js.map +1 -1
  253. package/esm/vm/process.js +11 -13
  254. package/esm/vm/process.js.map +1 -1
  255. package/package.json +19 -26
  256. package/types/cache.d.ts +17 -8
  257. package/types/cache.js +245 -95
  258. package/types/debug/fileReporter.js +68 -23
  259. package/types/eval/broker.d.ts +92 -0
  260. package/types/eval/broker.js +2411 -0
  261. package/types/eval/lru.d.ts +10 -0
  262. package/types/eval/lru.js +36 -0
  263. package/types/eval/prepareModuleOnDemand.d.ts +7 -0
  264. package/types/eval/prepareModuleOnDemand.js +24 -0
  265. package/types/eval/protocol.d.ts +111 -0
  266. package/types/eval/protocol.js +1 -0
  267. package/types/eval/serialize.d.ts +78 -0
  268. package/types/eval/serialize.js +357 -0
  269. package/types/eval/writeQueue.d.ts +13 -0
  270. package/types/eval/writeQueue.js +80 -0
  271. package/types/evaluators/index.d.ts +2 -2
  272. package/types/evaluators/index.js +6 -9
  273. package/types/index.d.ts +3 -6
  274. package/types/index.js +24 -82
  275. package/types/module.d.ts +38 -7
  276. package/types/module.js +613 -192
  277. package/types/shaker.d.ts +2 -10
  278. package/types/shaker.js +10 -100
  279. package/types/transform/BaseEntrypoint.js +6 -11
  280. package/types/transform/Entrypoint.d.ts +15 -15
  281. package/types/transform/Entrypoint.helpers.d.ts +2 -5
  282. package/types/transform/Entrypoint.helpers.js +43 -203
  283. package/types/transform/Entrypoint.js +130 -53
  284. package/types/transform/Entrypoint.types.d.ts +31 -6
  285. package/types/transform/Entrypoint.types.js +1 -2
  286. package/types/transform/EvaluatedEntrypoint.d.ts +13 -2
  287. package/types/transform/EvaluatedEntrypoint.js +7 -6
  288. package/types/transform/actions/AbortError.js +2 -7
  289. package/types/transform/actions/BaseAction.js +4 -8
  290. package/types/transform/actions/UnprocessedEntrypointError.js +2 -7
  291. package/types/transform/actions/actionRunner.js +8 -12
  292. package/types/transform/actions/types.d.ts +2 -2
  293. package/types/transform/actions/types.js +1 -2
  294. package/types/transform/{barrelManifest.d.ts → barrelManifest.types.d.ts} +0 -2
  295. package/types/transform/barrelManifest.types.js +1 -0
  296. package/types/transform/generators/baseProcessingHandlers.d.ts +4 -5
  297. package/types/transform/generators/baseProcessingHandlers.js +10 -14
  298. package/types/transform/generators/collect.js +13 -39
  299. package/types/transform/generators/createStylisPreprocessor.js +19 -60
  300. package/types/transform/generators/evalFile.d.ts +2 -2
  301. package/types/transform/generators/evalFile.js +26 -28
  302. package/types/transform/generators/extract.js +5 -8
  303. package/types/transform/generators/getExports.js +23 -30
  304. package/types/transform/generators/index.d.ts +2 -2
  305. package/types/transform/generators/index.js +11 -14
  306. package/types/transform/generators/processEntrypoint.d.ts +2 -2
  307. package/types/transform/generators/processEntrypoint.js +60 -26
  308. package/types/transform/generators/processImports.d.ts +0 -3
  309. package/types/transform/generators/processImports.js +60 -20
  310. package/types/transform/generators/resolveImports.d.ts +3 -1
  311. package/types/transform/generators/resolveImports.js +66 -23
  312. package/types/transform/generators/resolveStaticOxcValues/cache.d.ts +25 -0
  313. package/types/transform/generators/resolveStaticOxcValues/cache.js +182 -0
  314. package/types/transform/generators/resolveStaticOxcValues/candidateResolver.d.ts +5 -0
  315. package/types/transform/generators/resolveStaticOxcValues/candidateResolver.js +149 -0
  316. package/types/transform/generators/resolveStaticOxcValues/dependencies.d.ts +6 -0
  317. package/types/transform/generators/resolveStaticOxcValues/dependencies.js +37 -0
  318. package/types/transform/generators/resolveStaticOxcValues/environment.d.ts +12 -0
  319. package/types/transform/generators/resolveStaticOxcValues/environment.js +32 -0
  320. package/types/transform/generators/resolveStaticOxcValues/exportResolver.d.ts +4 -0
  321. package/types/transform/generators/resolveStaticOxcValues/exportResolver.js +358 -0
  322. package/types/transform/generators/resolveStaticOxcValues/exportTargets.d.ts +20 -0
  323. package/types/transform/generators/resolveStaticOxcValues/exportTargets.js +285 -0
  324. package/types/transform/generators/resolveStaticOxcValues/objectAssign.d.ts +41 -0
  325. package/types/transform/generators/resolveStaticOxcValues/objectAssign.js +352 -0
  326. package/types/transform/generators/resolveStaticOxcValues/objectAssignStaticExport.d.ts +6 -0
  327. package/types/transform/generators/resolveStaticOxcValues/objectAssignStaticExport.js +88 -0
  328. package/types/transform/generators/resolveStaticOxcValues/opaqueRuntime.d.ts +13 -0
  329. package/types/transform/generators/resolveStaticOxcValues/opaqueRuntime.js +263 -0
  330. package/types/transform/generators/resolveStaticOxcValues/processorStaticExport.d.ts +4 -0
  331. package/types/transform/generators/resolveStaticOxcValues/processorStaticExport.js +191 -0
  332. package/types/transform/generators/resolveStaticOxcValues/processorStaticModel.d.ts +40 -0
  333. package/types/transform/generators/resolveStaticOxcValues/processorStaticModel.js +516 -0
  334. package/types/transform/generators/resolveStaticOxcValues/processorTarget.d.ts +5 -0
  335. package/types/transform/generators/resolveStaticOxcValues/processorTarget.js +62 -0
  336. package/types/transform/generators/resolveStaticOxcValues/programAnalysis.d.ts +11 -0
  337. package/types/transform/generators/resolveStaticOxcValues/programAnalysis.js +133 -0
  338. package/types/transform/generators/resolveStaticOxcValues/prune.d.ts +15 -0
  339. package/types/transform/generators/resolveStaticOxcValues/prune.js +220 -0
  340. package/types/transform/generators/resolveStaticOxcValues/resolveStaticOxcPreevalValues.d.ts +2 -0
  341. package/types/transform/generators/resolveStaticOxcValues/resolveStaticOxcPreevalValues.js +197 -0
  342. package/types/transform/generators/resolveStaticOxcValues/staticExpression.d.ts +25 -0
  343. package/types/transform/generators/resolveStaticOxcValues/staticExpression.js +391 -0
  344. package/types/transform/generators/resolveStaticOxcValues/staticExpressionDependencies.d.ts +14 -0
  345. package/types/transform/generators/resolveStaticOxcValues/staticExpressionDependencies.js +304 -0
  346. package/types/transform/generators/resolveStaticOxcValues/types.d.ts +99 -0
  347. package/types/transform/generators/resolveStaticOxcValues/types.js +2 -0
  348. package/types/transform/generators/resolveStaticOxcValues/zeroArgFunctionStaticExport.d.ts +7 -0
  349. package/types/transform/generators/resolveStaticOxcValues/zeroArgFunctionStaticExport.js +64 -0
  350. package/types/transform/generators/resolveStaticOxcValues.d.ts +1 -0
  351. package/types/transform/generators/resolveStaticOxcValues.js +1 -0
  352. package/types/transform/generators/{rewriteBarrelImports.d.ts → rewriteOxcBarrelImports.d.ts} +2 -3
  353. package/types/transform/generators/{rewriteBarrelImports.js → rewriteOxcBarrelImports.js} +282 -225
  354. package/types/transform/generators/transform.d.ts +3 -7
  355. package/types/transform/generators/transform.js +217 -199
  356. package/types/transform/generators/workflow.js +62 -45
  357. package/types/transform/helpers/loadWywOptions.js +115 -21
  358. package/types/transform/helpers/withDefaultServices.d.ts +1 -1
  359. package/types/transform/helpers/withDefaultServices.js +6 -44
  360. package/types/transform/isStaticallyEvaluatableModule.d.ts +1 -2
  361. package/types/transform/isStaticallyEvaluatableModule.js +125 -126
  362. package/types/transform/oxcBarrelManifest.d.ts +2 -0
  363. package/types/transform/{barrelManifest.js → oxcBarrelManifest.js} +156 -97
  364. package/types/transform/rootLog.js +2 -5
  365. package/types/transform/syntax.d.ts +38 -0
  366. package/types/transform/syntax.js +1 -0
  367. package/types/transform/types.d.ts +9 -6
  368. package/types/transform/types.js +1 -4
  369. package/types/transform.d.ts +2 -2
  370. package/types/transform.js +90 -101
  371. package/types/types.d.ts +0 -23
  372. package/types/types.js +1 -2
  373. package/types/utils/EventEmitter.d.ts +16 -1
  374. package/types/utils/EventEmitter.js +47 -18
  375. package/types/utils/ShakerMetadata.js +1 -5
  376. package/types/utils/TransformDiagnostics.js +3 -7
  377. package/types/utils/TransformMetadata.js +8 -16
  378. package/types/utils/applyOxcProcessors/applyOxcProcessors.d.ts +8 -0
  379. package/types/utils/applyOxcProcessors/applyOxcProcessors.js +167 -0
  380. package/types/utils/applyOxcProcessors/cleanupBindings.d.ts +12 -0
  381. package/types/utils/applyOxcProcessors/cleanupBindings.js +189 -0
  382. package/types/utils/applyOxcProcessors/cleanupRemovals.d.ts +16 -0
  383. package/types/utils/applyOxcProcessors/cleanupRemovals.js +482 -0
  384. package/types/utils/applyOxcProcessors/displayName.d.ts +9 -0
  385. package/types/utils/applyOxcProcessors/displayName.js +113 -0
  386. package/types/utils/applyOxcProcessors/expressionValues.d.ts +11 -0
  387. package/types/utils/applyOxcProcessors/expressionValues.js +170 -0
  388. package/types/utils/applyOxcProcessors/processorFactory.d.ts +7 -0
  389. package/types/utils/applyOxcProcessors/processorFactory.js +70 -0
  390. package/types/utils/applyOxcProcessors/processorUsages.d.ts +16 -0
  391. package/types/utils/applyOxcProcessors/processorUsages.js +163 -0
  392. package/types/utils/applyOxcProcessors/sameFileStaticValues.d.ts +23 -0
  393. package/types/utils/applyOxcProcessors/sameFileStaticValues.js +211 -0
  394. package/types/utils/applyOxcProcessors/shared.d.ts +10 -0
  395. package/types/utils/applyOxcProcessors/shared.js +37 -0
  396. package/types/utils/applyOxcProcessors/types.d.ts +88 -0
  397. package/types/utils/applyOxcProcessors/types.js +1 -0
  398. package/types/utils/applyOxcProcessors.d.ts +1 -0
  399. package/types/utils/applyOxcProcessors.js +1 -0
  400. package/types/utils/collectOxcExportsAndImports.d.ts +35 -0
  401. package/types/utils/collectOxcExportsAndImports.js +957 -0
  402. package/types/utils/collectOxcRuntime/normalizeRuntimeCode.d.ts +1 -0
  403. package/types/utils/collectOxcRuntime/normalizeRuntimeCode.js +185 -0
  404. package/types/utils/collectOxcRuntime/sourceMap.d.ts +2 -0
  405. package/types/utils/collectOxcRuntime/sourceMap.js +37 -0
  406. package/types/utils/collectOxcRuntime/types.d.ts +16 -0
  407. package/types/utils/collectOxcRuntime/types.js +1 -0
  408. package/types/utils/collectOxcRuntime.d.ts +4 -0
  409. package/types/utils/collectOxcRuntime.js +31 -0
  410. package/types/utils/collectOxcTemplateDependencies/expressionExtraction.d.ts +6 -0
  411. package/types/utils/collectOxcTemplateDependencies/expressionExtraction.js +550 -0
  412. package/types/utils/collectOxcTemplateDependencies/expressionReplacements.d.ts +11 -0
  413. package/types/utils/collectOxcTemplateDependencies/expressionReplacements.js +131 -0
  414. package/types/utils/collectOxcTemplateDependencies/scopeAnalysis.d.ts +20 -0
  415. package/types/utils/collectOxcTemplateDependencies/scopeAnalysis.js +434 -0
  416. package/types/utils/collectOxcTemplateDependencies/staticBindings.d.ts +7 -0
  417. package/types/utils/collectOxcTemplateDependencies/staticBindings.js +13 -0
  418. package/types/utils/collectOxcTemplateDependencies/staticEvaluator.d.ts +13 -0
  419. package/types/utils/collectOxcTemplateDependencies/staticEvaluator.js +626 -0
  420. package/types/utils/collectOxcTemplateDependencies/types.d.ts +116 -0
  421. package/types/utils/collectOxcTemplateDependencies/types.js +1 -0
  422. package/types/utils/collectOxcTemplateDependencies.d.ts +4 -0
  423. package/types/utils/collectOxcTemplateDependencies.js +3 -0
  424. package/types/utils/getFileIdx.js +1 -4
  425. package/types/utils/getPluginKey.d.ts +5 -2
  426. package/types/utils/getPluginKey.js +2 -6
  427. package/types/utils/getVisitorKeys.d.ts +4 -4
  428. package/types/utils/getVisitorKeys.js +9 -6
  429. package/types/utils/hasCachedWywPrevalExport.d.ts +14 -0
  430. package/types/utils/hasCachedWywPrevalExport.js +30 -0
  431. package/types/utils/hasWywPreval.js +1 -4
  432. package/types/utils/importOverrides.js +17 -27
  433. package/types/utils/isNode.d.ts +2 -2
  434. package/types/utils/isNode.js +2 -6
  435. package/types/utils/isNotNull.js +1 -4
  436. package/types/utils/isSerializable.js +3 -6
  437. package/types/utils/nativeResolver.d.ts +13 -0
  438. package/types/utils/nativeResolver.js +91 -0
  439. package/types/utils/oxc/ast.d.ts +4 -0
  440. package/types/utils/oxc/ast.js +37 -0
  441. package/types/utils/oxc/parse.d.ts +3 -0
  442. package/types/utils/oxc/parse.js +2 -0
  443. package/types/utils/oxc/replacements.d.ts +12 -0
  444. package/types/utils/oxc/replacements.js +18 -0
  445. package/types/utils/oxc/sourceLocations.d.ts +5 -0
  446. package/types/utils/oxc/sourceLocations.js +63 -0
  447. package/types/utils/oxcAstService.d.ts +11 -0
  448. package/types/utils/oxcAstService.js +79 -0
  449. package/types/utils/oxcEmit.d.ts +19 -0
  450. package/types/utils/oxcEmit.js +506 -0
  451. package/types/utils/oxcPreevalStage/evalStrategy.d.ts +3 -0
  452. package/types/utils/oxcPreevalStage/evalStrategy.js +2 -0
  453. package/types/utils/oxcPreevalStage/prepareCode.d.ts +3 -0
  454. package/types/utils/oxcPreevalStage/prepareCode.js +20 -0
  455. package/types/utils/oxcPreevalStage/prevalExport.d.ts +1 -0
  456. package/types/utils/oxcPreevalStage/prevalExport.js +22 -0
  457. package/types/utils/oxcPreevalStage/processors.d.ts +10 -0
  458. package/types/utils/oxcPreevalStage/processors.js +16 -0
  459. package/types/utils/oxcPreevalStage/staticOverlay.d.ts +3 -0
  460. package/types/utils/oxcPreevalStage/staticOverlay.js +23 -0
  461. package/types/utils/oxcPreevalStage/types.d.ts +22 -0
  462. package/types/utils/oxcPreevalStage/types.js +1 -0
  463. package/types/utils/oxcPreevalStage.d.ts +4 -0
  464. package/types/utils/oxcPreevalStage.js +40 -0
  465. package/types/utils/oxcPreevalTransforms.d.ts +13 -0
  466. package/types/utils/oxcPreevalTransforms.js +1192 -0
  467. package/types/utils/oxcShaker.d.ts +13 -0
  468. package/types/utils/oxcShaker.js +751 -0
  469. package/types/utils/parseOxc.d.ts +11 -0
  470. package/types/utils/parseOxc.js +38 -0
  471. package/types/utils/parseRequest.js +2 -7
  472. package/types/utils/peek.js +1 -5
  473. package/types/utils/processorLookup.d.ts +8 -0
  474. package/types/utils/processorLookup.js +135 -0
  475. package/types/utils/processorStaticSemantics.d.ts +13 -0
  476. package/types/utils/processorStaticSemantics.js +191 -0
  477. package/types/utils/resolveWithConditions.d.ts +12 -0
  478. package/types/utils/resolveWithConditions.js +103 -0
  479. package/types/vm/createVmContext.d.ts +2 -2
  480. package/types/vm/createVmContext.js +25 -62
  481. package/types/vm/process.js +20 -26
  482. package/esm/babel.js +0 -2
  483. package/esm/babel.js.map +0 -1
  484. package/esm/options/buildOptions.js +0 -168
  485. package/esm/options/buildOptions.js.map +0 -1
  486. package/esm/options/buildOptions.test.js +0 -138
  487. package/esm/options/buildOptions.test.js.map +0 -1
  488. package/esm/options/loadBabelOptions.js +0 -24
  489. package/esm/options/loadBabelOptions.js.map +0 -1
  490. package/esm/plugins/babel-transform.js +0 -53
  491. package/esm/plugins/babel-transform.js.map +0 -1
  492. package/esm/plugins/collector.js +0 -60
  493. package/esm/plugins/collector.js.map +0 -1
  494. package/esm/plugins/dynamic-import.js +0 -56
  495. package/esm/plugins/dynamic-import.js.map +0 -1
  496. package/esm/plugins/preeval.js +0 -73
  497. package/esm/plugins/preeval.js.map +0 -1
  498. package/esm/plugins/shaker.js +0 -680
  499. package/esm/plugins/shaker.js.map +0 -1
  500. package/esm/transform/barrelManifest.js +0 -291
  501. package/esm/transform/barrelManifest.js.map +0 -1
  502. package/esm/transform/generators/explodeReexports.js +0 -64
  503. package/esm/transform/generators/explodeReexports.js.map +0 -1
  504. package/esm/transform/generators/rewriteBarrelImports.js +0 -733
  505. package/esm/transform/generators/rewriteBarrelImports.js.map +0 -1
  506. package/esm/utils/addIdentifierToWywPreval.js +0 -68
  507. package/esm/utils/addIdentifierToWywPreval.js.map +0 -1
  508. package/esm/utils/collectExportsAndImports.js +0 -1157
  509. package/esm/utils/collectExportsAndImports.js.map +0 -1
  510. package/esm/utils/collectTemplateDependencies.js +0 -228
  511. package/esm/utils/collectTemplateDependencies.js.map +0 -1
  512. package/esm/utils/createId.js +0 -6
  513. package/esm/utils/createId.js.map +0 -1
  514. package/esm/utils/findIdentifiers.js +0 -62
  515. package/esm/utils/findIdentifiers.js.map +0 -1
  516. package/esm/utils/getConstantStringValue.js +0 -58
  517. package/esm/utils/getConstantStringValue.js.map +0 -1
  518. package/esm/utils/getMemberExpressionPropertyName.js +0 -11
  519. package/esm/utils/getMemberExpressionPropertyName.js.map +0 -1
  520. package/esm/utils/getScope.js +0 -6
  521. package/esm/utils/getScope.js.map +0 -1
  522. package/esm/utils/getSource.js +0 -15
  523. package/esm/utils/getSource.js.map +0 -1
  524. package/esm/utils/getTagProcessor.js +0 -404
  525. package/esm/utils/getTagProcessor.js.map +0 -1
  526. package/esm/utils/isExports.js +0 -22
  527. package/esm/utils/isExports.js.map +0 -1
  528. package/esm/utils/isGlobal.js +0 -6
  529. package/esm/utils/isGlobal.js.map +0 -1
  530. package/esm/utils/isNodePath.js +0 -4
  531. package/esm/utils/isNodePath.js.map +0 -1
  532. package/esm/utils/isRemoved.js +0 -46
  533. package/esm/utils/isRemoved.js.map +0 -1
  534. package/esm/utils/isRequire.js +0 -13
  535. package/esm/utils/isRequire.js.map +0 -1
  536. package/esm/utils/isTypedNode.js +0 -6
  537. package/esm/utils/isTypedNode.js.map +0 -1
  538. package/esm/utils/isUnnecessaryReactCall.js +0 -72
  539. package/esm/utils/isUnnecessaryReactCall.js.map +0 -1
  540. package/esm/utils/removeDangerousCode.js +0 -276
  541. package/esm/utils/removeDangerousCode.js.map +0 -1
  542. package/esm/utils/replaceImportMetaEnv.js +0 -44
  543. package/esm/utils/replaceImportMetaEnv.js.map +0 -1
  544. package/esm/utils/scopeHelpers.js +0 -527
  545. package/esm/utils/scopeHelpers.js.map +0 -1
  546. package/esm/utils/traversalCache.js +0 -23
  547. package/esm/utils/traversalCache.js.map +0 -1
  548. package/esm/utils/unwrapExpression.js +0 -18
  549. package/esm/utils/unwrapExpression.js.map +0 -1
  550. package/esm/utils/unwrapSequence.js +0 -14
  551. package/esm/utils/unwrapSequence.js.map +0 -1
  552. package/esm/utils/valueToLiteral.js +0 -59
  553. package/esm/utils/valueToLiteral.js.map +0 -1
  554. package/esm/utils/visitors/JSXElementsRemover.js +0 -51
  555. package/esm/utils/visitors/JSXElementsRemover.js.map +0 -1
  556. package/lib/babel.js +0 -2
  557. package/lib/babel.js.map +0 -1
  558. package/lib/cache.js +0 -308
  559. package/lib/cache.js.map +0 -1
  560. package/lib/debug/fileReporter.js +0 -153
  561. package/lib/debug/fileReporter.js.map +0 -1
  562. package/lib/evaluators/index.js +0 -20
  563. package/lib/evaluators/index.js.map +0 -1
  564. package/lib/index.js +0 -286
  565. package/lib/index.js.map +0 -1
  566. package/lib/module.js +0 -552
  567. package/lib/module.js.map +0 -1
  568. package/lib/options/buildOptions.js +0 -176
  569. package/lib/options/buildOptions.js.map +0 -1
  570. package/lib/options/buildOptions.test.js +0 -141
  571. package/lib/options/buildOptions.test.js.map +0 -1
  572. package/lib/options/loadBabelOptions.js +0 -31
  573. package/lib/options/loadBabelOptions.js.map +0 -1
  574. package/lib/plugins/babel-transform.js +0 -60
  575. package/lib/plugins/babel-transform.js.map +0 -1
  576. package/lib/plugins/collector.js +0 -70
  577. package/lib/plugins/collector.js.map +0 -1
  578. package/lib/plugins/dynamic-import.js +0 -61
  579. package/lib/plugins/dynamic-import.js.map +0 -1
  580. package/lib/plugins/preeval.js +0 -81
  581. package/lib/plugins/preeval.js.map +0 -1
  582. package/lib/plugins/shaker.js +0 -691
  583. package/lib/plugins/shaker.js.map +0 -1
  584. package/lib/shaker.js +0 -95
  585. package/lib/shaker.js.map +0 -1
  586. package/lib/transform/BaseEntrypoint.js +0 -179
  587. package/lib/transform/BaseEntrypoint.js.map +0 -1
  588. package/lib/transform/Entrypoint.helpers.js +0 -279
  589. package/lib/transform/Entrypoint.helpers.js.map +0 -1
  590. package/lib/transform/Entrypoint.js +0 -289
  591. package/lib/transform/Entrypoint.js.map +0 -1
  592. package/lib/transform/Entrypoint.types.js +0 -2
  593. package/lib/transform/Entrypoint.types.js.map +0 -1
  594. package/lib/transform/EvaluatedEntrypoint.js +0 -13
  595. package/lib/transform/EvaluatedEntrypoint.js.map +0 -1
  596. package/lib/transform/actions/AbortError.js +0 -16
  597. package/lib/transform/actions/AbortError.js.map +0 -1
  598. package/lib/transform/actions/BaseAction.js +0 -150
  599. package/lib/transform/actions/BaseAction.js.map +0 -1
  600. package/lib/transform/actions/UnprocessedEntrypointError.js +0 -16
  601. package/lib/transform/actions/UnprocessedEntrypointError.js.map +0 -1
  602. package/lib/transform/actions/actionRunner.js +0 -82
  603. package/lib/transform/actions/actionRunner.js.map +0 -1
  604. package/lib/transform/actions/types.js +0 -2
  605. package/lib/transform/actions/types.js.map +0 -1
  606. package/lib/transform/barrelManifest.js +0 -300
  607. package/lib/transform/barrelManifest.js.map +0 -1
  608. package/lib/transform/generators/baseProcessingHandlers.js +0 -27
  609. package/lib/transform/generators/baseProcessingHandlers.js.map +0 -1
  610. package/lib/transform/generators/collect.js +0 -66
  611. package/lib/transform/generators/collect.js.map +0 -1
  612. package/lib/transform/generators/createStylisPreprocessor.js +0 -372
  613. package/lib/transform/generators/createStylisPreprocessor.js.map +0 -1
  614. package/lib/transform/generators/evalFile.js +0 -57
  615. package/lib/transform/generators/evalFile.js.map +0 -1
  616. package/lib/transform/generators/explodeReexports.js +0 -71
  617. package/lib/transform/generators/explodeReexports.js.map +0 -1
  618. package/lib/transform/generators/extract.js +0 -102
  619. package/lib/transform/generators/extract.js.map +0 -1
  620. package/lib/transform/generators/getExports.js +0 -85
  621. package/lib/transform/generators/getExports.js.map +0 -1
  622. package/lib/transform/generators/index.js +0 -19
  623. package/lib/transform/generators/index.js.map +0 -1
  624. package/lib/transform/generators/processEntrypoint.js +0 -76
  625. package/lib/transform/generators/processEntrypoint.js.map +0 -1
  626. package/lib/transform/generators/processImports.js +0 -82
  627. package/lib/transform/generators/processImports.js.map +0 -1
  628. package/lib/transform/generators/resolveImports.js +0 -221
  629. package/lib/transform/generators/resolveImports.js.map +0 -1
  630. package/lib/transform/generators/rewriteBarrelImports.js +0 -743
  631. package/lib/transform/generators/rewriteBarrelImports.js.map +0 -1
  632. package/lib/transform/generators/transform.js +0 -272
  633. package/lib/transform/generators/transform.js.map +0 -1
  634. package/lib/transform/generators/workflow.js +0 -100
  635. package/lib/transform/generators/workflow.js.map +0 -1
  636. package/lib/transform/helpers/loadWywOptions.js +0 -88
  637. package/lib/transform/helpers/loadWywOptions.js.map +0 -1
  638. package/lib/transform/helpers/withDefaultServices.js +0 -31
  639. package/lib/transform/helpers/withDefaultServices.js.map +0 -1
  640. package/lib/transform/isStaticallyEvaluatableModule.js +0 -159
  641. package/lib/transform/isStaticallyEvaluatableModule.js.map +0 -1
  642. package/lib/transform/rootLog.js +0 -9
  643. package/lib/transform/rootLog.js.map +0 -1
  644. package/lib/transform/types.js +0 -8
  645. package/lib/transform/types.js.map +0 -1
  646. package/lib/transform.js +0 -160
  647. package/lib/transform.js.map +0 -1
  648. package/lib/types.js +0 -2
  649. package/lib/types.js.map +0 -1
  650. package/lib/utils/EventEmitter.js +0 -61
  651. package/lib/utils/EventEmitter.js.map +0 -1
  652. package/lib/utils/ShakerMetadata.js +0 -9
  653. package/lib/utils/ShakerMetadata.js.map +0 -1
  654. package/lib/utils/TransformDiagnostics.js +0 -20
  655. package/lib/utils/TransformDiagnostics.js.map +0 -1
  656. package/lib/utils/TransformMetadata.js +0 -45
  657. package/lib/utils/TransformMetadata.js.map +0 -1
  658. package/lib/utils/addIdentifierToWywPreval.js +0 -75
  659. package/lib/utils/addIdentifierToWywPreval.js.map +0 -1
  660. package/lib/utils/collectExportsAndImports.js +0 -1173
  661. package/lib/utils/collectExportsAndImports.js.map +0 -1
  662. package/lib/utils/collectTemplateDependencies.js +0 -242
  663. package/lib/utils/collectTemplateDependencies.js.map +0 -1
  664. package/lib/utils/createId.js +0 -13
  665. package/lib/utils/createId.js.map +0 -1
  666. package/lib/utils/dispose-polyfill.js +0 -9
  667. package/lib/utils/dispose-polyfill.js.map +0 -1
  668. package/lib/utils/findIdentifiers.js +0 -73
  669. package/lib/utils/findIdentifiers.js.map +0 -1
  670. package/lib/utils/getConstantStringValue.js +0 -66
  671. package/lib/utils/getConstantStringValue.js.map +0 -1
  672. package/lib/utils/getFileIdx.js +0 -16
  673. package/lib/utils/getFileIdx.js.map +0 -1
  674. package/lib/utils/getMemberExpressionPropertyName.js +0 -18
  675. package/lib/utils/getMemberExpressionPropertyName.js.map +0 -1
  676. package/lib/utils/getPluginKey.js +0 -21
  677. package/lib/utils/getPluginKey.js.map +0 -1
  678. package/lib/utils/getScope.js +0 -12
  679. package/lib/utils/getScope.js.map +0 -1
  680. package/lib/utils/getSource.js +0 -24
  681. package/lib/utils/getSource.js.map +0 -1
  682. package/lib/utils/getTagProcessor.js +0 -424
  683. package/lib/utils/getTagProcessor.js.map +0 -1
  684. package/lib/utils/getVisitorKeys.js +0 -11
  685. package/lib/utils/getVisitorKeys.js.map +0 -1
  686. package/lib/utils/hasWywPreval.js +0 -13
  687. package/lib/utils/hasWywPreval.js.map +0 -1
  688. package/lib/utils/importOverrides.js +0 -119
  689. package/lib/utils/importOverrides.js.map +0 -1
  690. package/lib/utils/isExports.js +0 -27
  691. package/lib/utils/isExports.js.map +0 -1
  692. package/lib/utils/isGlobal.js +0 -13
  693. package/lib/utils/isGlobal.js.map +0 -1
  694. package/lib/utils/isNode.js +0 -9
  695. package/lib/utils/isNode.js.map +0 -1
  696. package/lib/utils/isNodePath.js +0 -10
  697. package/lib/utils/isNodePath.js.map +0 -1
  698. package/lib/utils/isNotNull.js +0 -10
  699. package/lib/utils/isNotNull.js.map +0 -1
  700. package/lib/utils/isRemoved.js +0 -52
  701. package/lib/utils/isRemoved.js.map +0 -1
  702. package/lib/utils/isRequire.js +0 -18
  703. package/lib/utils/isRequire.js.map +0 -1
  704. package/lib/utils/isSerializable.js +0 -19
  705. package/lib/utils/isSerializable.js.map +0 -1
  706. package/lib/utils/isTypedNode.js +0 -13
  707. package/lib/utils/isTypedNode.js.map +0 -1
  708. package/lib/utils/isUnnecessaryReactCall.js +0 -81
  709. package/lib/utils/isUnnecessaryReactCall.js.map +0 -1
  710. package/lib/utils/parseRequest.js +0 -37
  711. package/lib/utils/parseRequest.js.map +0 -1
  712. package/lib/utils/peek.js +0 -9
  713. package/lib/utils/peek.js.map +0 -1
  714. package/lib/utils/removeDangerousCode.js +0 -284
  715. package/lib/utils/removeDangerousCode.js.map +0 -1
  716. package/lib/utils/replaceImportMetaEnv.js +0 -50
  717. package/lib/utils/replaceImportMetaEnv.js.map +0 -1
  718. package/lib/utils/scopeHelpers.js +0 -557
  719. package/lib/utils/scopeHelpers.js.map +0 -1
  720. package/lib/utils/traversalCache.js +0 -31
  721. package/lib/utils/traversalCache.js.map +0 -1
  722. package/lib/utils/unwrapExpression.js +0 -25
  723. package/lib/utils/unwrapExpression.js.map +0 -1
  724. package/lib/utils/unwrapSequence.js +0 -20
  725. package/lib/utils/unwrapSequence.js.map +0 -1
  726. package/lib/utils/valueToLiteral.js +0 -65
  727. package/lib/utils/valueToLiteral.js.map +0 -1
  728. package/lib/utils/visitors/JSXElementsRemover.js +0 -57
  729. package/lib/utils/visitors/JSXElementsRemover.js.map +0 -1
  730. package/lib/vm/createVmContext.js +0 -166
  731. package/lib/vm/createVmContext.js.map +0 -1
  732. package/lib/vm/process.js +0 -38
  733. package/lib/vm/process.js.map +0 -1
  734. package/types/babel.d.ts +0 -2
  735. package/types/babel.js +0 -2
  736. package/types/options/buildOptions.d.ts +0 -6
  737. package/types/options/buildOptions.js +0 -178
  738. package/types/options/loadBabelOptions.d.ts +0 -3
  739. package/types/options/loadBabelOptions.js +0 -26
  740. package/types/plugins/babel-transform.d.ts +0 -4
  741. package/types/plugins/babel-transform.js +0 -49
  742. package/types/plugins/collector.d.ts +0 -23
  743. package/types/plugins/collector.js +0 -62
  744. package/types/plugins/dynamic-import.d.ts +0 -6
  745. package/types/plugins/dynamic-import.js +0 -60
  746. package/types/plugins/preeval.d.ts +0 -16
  747. package/types/plugins/preeval.js +0 -69
  748. package/types/plugins/shaker.d.ts +0 -14
  749. package/types/plugins/shaker.js +0 -724
  750. package/types/transform/generators/explodeReexports.d.ts +0 -7
  751. package/types/transform/generators/explodeReexports.js +0 -65
  752. package/types/utils/addIdentifierToWywPreval.d.ts +0 -4
  753. package/types/utils/addIdentifierToWywPreval.js +0 -74
  754. package/types/utils/collectExportsAndImports.d.ts +0 -31
  755. package/types/utils/collectExportsAndImports.js +0 -1147
  756. package/types/utils/collectTemplateDependencies.d.ts +0 -17
  757. package/types/utils/collectTemplateDependencies.js +0 -220
  758. package/types/utils/createId.d.ts +0 -2
  759. package/types/utils/createId.js +0 -9
  760. package/types/utils/findIdentifiers.d.ts +0 -6
  761. package/types/utils/findIdentifiers.js +0 -67
  762. package/types/utils/getConstantStringValue.d.ts +0 -2
  763. package/types/utils/getConstantStringValue.js +0 -94
  764. package/types/utils/getMemberExpressionPropertyName.d.ts +0 -2
  765. package/types/utils/getMemberExpressionPropertyName.js +0 -46
  766. package/types/utils/getScope.d.ts +0 -2
  767. package/types/utils/getScope.js +0 -10
  768. package/types/utils/getSource.d.ts +0 -2
  769. package/types/utils/getSource.js +0 -22
  770. package/types/utils/getTagProcessor.d.ts +0 -13
  771. package/types/utils/getTagProcessor.js +0 -411
  772. package/types/utils/isExports.d.ts +0 -6
  773. package/types/utils/isExports.js +0 -19
  774. package/types/utils/isGlobal.d.ts +0 -2
  775. package/types/utils/isGlobal.js +0 -9
  776. package/types/utils/isNodePath.d.ts +0 -3
  777. package/types/utils/isNodePath.js +0 -6
  778. package/types/utils/isRemoved.d.ts +0 -5
  779. package/types/utils/isRemoved.js +0 -41
  780. package/types/utils/isRequire.d.ts +0 -6
  781. package/types/utils/isRequire.js +0 -14
  782. package/types/utils/isTypedNode.d.ts +0 -5
  783. package/types/utils/isTypedNode.js +0 -9
  784. package/types/utils/isUnnecessaryReactCall.d.ts +0 -3
  785. package/types/utils/isUnnecessaryReactCall.js +0 -75
  786. package/types/utils/removeDangerousCode.d.ts +0 -4
  787. package/types/utils/removeDangerousCode.js +0 -326
  788. package/types/utils/replaceImportMetaEnv.d.ts +0 -3
  789. package/types/utils/replaceImportMetaEnv.js +0 -39
  790. package/types/utils/scopeHelpers.d.ts +0 -12
  791. package/types/utils/scopeHelpers.js +0 -580
  792. package/types/utils/traversalCache.d.ts +0 -4
  793. package/types/utils/traversalCache.js +0 -27
  794. package/types/utils/unwrapExpression.d.ts +0 -2
  795. package/types/utils/unwrapExpression.js +0 -57
  796. package/types/utils/unwrapSequence.d.ts +0 -8
  797. package/types/utils/unwrapSequence.js +0 -16
  798. package/types/utils/valueToLiteral.d.ts +0 -3
  799. package/types/utils/valueToLiteral.js +0 -63
  800. package/types/utils/visitors/JSXElementsRemover.d.ts +0 -3
  801. package/types/utils/visitors/JSXElementsRemover.js +0 -51
package/lib/module.js DELETED
@@ -1,552 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Module = exports.DefaultModuleImplementation = void 0;
7
- var _fs = _interopRequireDefault(require("fs"));
8
- var _module = _interopRequireDefault(require("module"));
9
- var _path = _interopRequireDefault(require("path"));
10
- var _vm = _interopRequireDefault(require("vm"));
11
- var _tsInvariant = require("ts-invariant");
12
- var _shared = require("@wyw-in-js/shared");
13
- require("./utils/dispose-polyfill");
14
- var _Entrypoint = require("./transform/Entrypoint");
15
- var _Entrypoint2 = require("./transform/Entrypoint.helpers");
16
- var _UnprocessedEntrypointError = require("./transform/actions/UnprocessedEntrypointError");
17
- var _importOverrides = require("./utils/importOverrides");
18
- var _parseRequest = require("./utils/parseRequest");
19
- var _createVmContext = require("./vm/createVmContext");
20
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
21
- /**
22
- * This is a custom implementation for the module system for evaluating code,
23
- * used for resolving values for dependencies interpolated in `css` or `styled`.
24
- *
25
- * This serves 2 purposes:
26
- * - Avoid leakage from evaluated code to module cache in current context, e.g. `babel-register`
27
- * - Allow us to invalidate the module cache without affecting other stuff, necessary for rebuilds
28
- *
29
- * We also use it to transpile the code with Babel by default.
30
- * We also store source maps for it to provide correct error stacktraces.
31
- *
32
- */
33
-
34
- const CJS_DEFAULT_CONDITIONS = ['require', 'node', 'default'];
35
- function expandConditions(conditionNames) {
36
- const result = new Set();
37
- for (const name of conditionNames) {
38
- if (name === '...') {
39
- for (const d of CJS_DEFAULT_CONDITIONS) result.add(d);
40
- } else {
41
- result.add(name);
42
- }
43
- }
44
- return result;
45
- }
46
- function isBarePackageSubpath(id) {
47
- if (id.startsWith('.') || _path.default.isAbsolute(id)) {
48
- return false;
49
- }
50
- if (id.startsWith('@')) {
51
- return id.split('/').length > 2;
52
- }
53
- return id.includes('/');
54
- }
55
- const DefaultModuleImplementation = exports.DefaultModuleImplementation = _module.default;
56
-
57
- // Supported node builtins based on the modules polyfilled by webpack
58
- // `true` means module is polyfilled, `false` means module is empty
59
- const builtins = {
60
- assert: true,
61
- buffer: true,
62
- child_process: false,
63
- cluster: false,
64
- console: true,
65
- constants: true,
66
- crypto: true,
67
- dgram: false,
68
- dns: false,
69
- domain: true,
70
- events: true,
71
- fs: false,
72
- http: true,
73
- https: true,
74
- module: false,
75
- net: false,
76
- os: true,
77
- path: true,
78
- punycode: true,
79
- process: true,
80
- querystring: true,
81
- readline: false,
82
- repl: false,
83
- stream: true,
84
- string_decoder: true,
85
- sys: true,
86
- timers: true,
87
- tls: false,
88
- tty: true,
89
- url: true,
90
- util: true,
91
- vm: true,
92
- zlib: true
93
- };
94
- const VITE_VIRTUAL_PREFIX = '/@';
95
- const REACT_REFRESH_VIRTUAL_ID = '/@react-refresh';
96
- const reactRefreshRuntime = {
97
- createSignatureFunctionForTransform: () => () => {}
98
- };
99
- const NOOP = () => {};
100
- const browserOnlyEvalHintTriggers = ['window is not defined', "evaluating 'window", 'document is not defined', "evaluating 'document", 'navigator is not defined', "evaluating 'navigator", 'self is not defined', "evaluating 'self"];
101
- const getBrowserOnlyEvalHint = error => {
102
- const message = error instanceof Error ? error.message : String(error);
103
- const looksLikeBrowserOnly = browserOnlyEvalHintTriggers.some(trigger => message.includes(trigger));
104
- if (!looksLikeBrowserOnly) return null;
105
- return ['', '[wyw-in-js] Evaluation hint:', 'This usually means browser-only code ran during build-time evaluation.', 'Move browser-only initialization out of evaluated modules, or mock the import via `importOverrides`.', "Example: importOverrides: { 'msw/browser': { mock: './src/__mocks__/msw-browser.js' } }"].join('\n');
106
- };
107
- const warnedUnknownImportsByServices = new WeakMap();
108
- function emitWarning(services, message) {
109
- if (services.emitWarning) {
110
- services.emitWarning(message);
111
- return;
112
- }
113
-
114
- // eslint-disable-next-line no-console
115
- console.warn(message);
116
- }
117
- function getWarnedUnknownImports(services) {
118
- const cached = warnedUnknownImportsByServices.get(services);
119
- if (cached) {
120
- return cached;
121
- }
122
- const created = new Set();
123
- warnedUnknownImportsByServices.set(services, created);
124
- return created;
125
- }
126
- function getUncached(cached, test) {
127
- const cachedSet = new Set(typeof cached === 'string' ? cached.split(',') : cached);
128
- if (cachedSet.has('*')) {
129
- return [];
130
- }
131
- return test.filter(t => !cachedSet.has(t));
132
- }
133
- function resolve(id) {
134
- const {
135
- resolved
136
- } = this.resolveDependency(id);
137
- (0, _tsInvariant.invariant)(resolved, `Unable to resolve "${id}"`);
138
- return resolved;
139
- }
140
- const defaultImportLoaders = {
141
- raw: 'raw',
142
- url: 'url'
143
- };
144
- class Module {
145
- callstack = [];
146
- isEvaluated = false;
147
- require = Object.assign(id => {
148
- if (id === REACT_REFRESH_VIRTUAL_ID) {
149
- this.dependencies.push(id);
150
- this.debug('require', `vite virtual '${id}'`);
151
- return reactRefreshRuntime;
152
- }
153
- if (id.startsWith(VITE_VIRTUAL_PREFIX)) {
154
- this.dependencies.push(id);
155
- this.debug('require', `vite virtual '${id}'`);
156
- return {};
157
- }
158
- if (id in builtins) {
159
- // The module is in the allowed list of builtin node modules
160
- // Ideally we should prevent importing them, but webpack polyfills some
161
- // So we check for the list of polyfills to determine which ones to support
162
- if (builtins[id]) {
163
- this.debug('require', `builtin '${id}'`);
164
- return require(id);
165
- }
166
- return null;
167
- }
168
-
169
- // Resolve module id (and filename) relatively to parent module
170
- const dependency = this.resolveDependency(id);
171
- if (dependency.resolved === id && !_path.default.isAbsolute(id)) {
172
- // The module is a builtin node modules, but not in the allowed list
173
- throw new Error(`Unable to import "${id}". Importing Node builtins is not supported in the sandbox.`);
174
- }
175
- (0, _tsInvariant.invariant)(dependency.resolved, `Dependency ${dependency.source} cannot be resolved`);
176
- const loaded = this.loadByImportLoaders(id, dependency.resolved);
177
- if (loaded.handled) {
178
- this.dependencies.push(id);
179
- this.debug('require', `${id} -> ${dependency.resolved} (loader)`);
180
- return loaded.value;
181
- }
182
- this.dependencies.push(id);
183
- this.debug('require', `${id} -> ${dependency.resolved}`);
184
- const entrypoint = this.getEntrypoint(dependency.resolved, dependency.only, this.debug);
185
- if (entrypoint === null) {
186
- return dependency.resolved;
187
- }
188
- if (entrypoint.evaluated || (0, _Entrypoint2.isSuperSet)(entrypoint.evaluatedOnly, dependency.only)) {
189
- return entrypoint.exports;
190
- }
191
- const m = this.createChild(entrypoint);
192
- m.evaluate();
193
- return entrypoint.exports;
194
- }, {
195
- ensure: NOOP,
196
- resolve: resolve.bind(this)
197
- });
198
- resolve = resolve.bind(this);
199
- #entrypointRef;
200
- constructor(services, entrypoint, parentModule, moduleImpl = DefaultModuleImplementation) {
201
- var _parentModule$ignored, _entrypoint$ignored;
202
- this.services = services;
203
- this.moduleImpl = moduleImpl;
204
- this.cache = services.cache;
205
- this.#entrypointRef = (0, _shared.isFeatureEnabled)(services.options.pluginOptions.features, 'useWeakRefInEval', entrypoint.name) ? new WeakRef(entrypoint) : entrypoint;
206
- this.idx = entrypoint.idx;
207
- this.id = entrypoint.name;
208
- this.filename = entrypoint.name;
209
- this.dependencies = [];
210
- this.debug = entrypoint.log.extend('module');
211
- this.parentIsIgnored = (_parentModule$ignored = parentModule === null || parentModule === void 0 ? void 0 : parentModule.ignored) !== null && _parentModule$ignored !== void 0 ? _parentModule$ignored : false;
212
- this.ignored = (_entrypoint$ignored = entrypoint.ignored) !== null && _entrypoint$ignored !== void 0 ? _entrypoint$ignored : this.parentIsIgnored;
213
- if (parentModule) {
214
- this.callstack = [entrypoint.name, ...parentModule.callstack];
215
- } else {
216
- this.callstack = [entrypoint.name];
217
- }
218
- this.extensions = services.options.pluginOptions.extensions;
219
- this.debug('init', entrypoint.name);
220
- }
221
- get exports() {
222
- return this.entrypoint.exports;
223
- }
224
- set exports(value) {
225
- this.entrypoint.exports = value;
226
- this.debug('the whole exports was overridden with %O', value);
227
- }
228
- get entrypoint() {
229
- const entrypoint = this.#entrypointRef instanceof WeakRef ? this.#entrypointRef.deref() : this.#entrypointRef;
230
- (0, _tsInvariant.invariant)(entrypoint, `Module ${this.idx} is disposed`);
231
- return entrypoint;
232
- }
233
- evaluate() {
234
- const {
235
- entrypoint
236
- } = this;
237
- entrypoint.assertTransformed();
238
- const cached = this.cache.get('entrypoints', entrypoint.name);
239
- let evaluatedCreated = false;
240
- if (!entrypoint.supersededWith) {
241
- this.cache.add('entrypoints', entrypoint.name, entrypoint.createEvaluated());
242
- evaluatedCreated = true;
243
- }
244
- const {
245
- transformedCode: source
246
- } = entrypoint;
247
- const {
248
- pluginOptions
249
- } = this.services.options;
250
- if (!source) {
251
- this.debug(`evaluate`, 'there is nothing to evaluate');
252
- return;
253
- }
254
- if (this.isEvaluated) {
255
- this.debug('evaluate', `is already evaluated`);
256
- return;
257
- }
258
- this.debug('evaluate');
259
- this.debug.extend('source')('%s', source);
260
- this.isEvaluated = true;
261
- const filename = (0, _parseRequest.stripQueryAndHash)(this.filename);
262
- if (/\.json$/.test(filename)) {
263
- // For JSON files, parse it to a JS object similar to Node
264
- this.exports = JSON.parse(source);
265
- return;
266
- }
267
- const {
268
- context,
269
- teardown
270
- } = (0, _createVmContext.createVmContext)(filename, pluginOptions.features, {
271
- module: this,
272
- exports: entrypoint.exports,
273
- require: this.require,
274
- __wyw_dynamic_import: async id => this.require(String(id)),
275
- __dirname: _path.default.dirname(filename)
276
- }, pluginOptions.overrideContext);
277
- try {
278
- const script = new _vm.default.Script(`(function (exports) { ${source}\n})(exports);`, {
279
- filename
280
- });
281
- script.runInContext(context);
282
- } catch (e) {
283
- this.isEvaluated = false;
284
- if (evaluatedCreated) {
285
- this.cache.add('entrypoints', entrypoint.name, cached);
286
- }
287
- if ((0, _UnprocessedEntrypointError.isUnprocessedEntrypointError)(e)) {
288
- // It will be handled by evalFile scenario
289
- throw e;
290
- }
291
- if (e instanceof EvalError) {
292
- this.debug('%O', e);
293
- throw e;
294
- }
295
- this.debug('%O\n%O', e, this.callstack);
296
- const baseMessage = `${e.message} in${this.callstack.join('\n| ')}\n`;
297
- const hint = getBrowserOnlyEvalHint(e);
298
- throw new EvalError(hint ? `${baseMessage}${hint}\n` : baseMessage);
299
- } finally {
300
- teardown();
301
- }
302
- }
303
- getEntrypoint(filename, only, log) {
304
- var _entrypoint$evaluated, _entrypoint;
305
- const strippedFilename = (0, _parseRequest.stripQueryAndHash)(filename);
306
- const extension = _path.default.extname(strippedFilename);
307
- if (extension !== '.json' && !this.extensions.includes(extension)) {
308
- return null;
309
- }
310
- let entrypoint = this.cache.get('entrypoints', filename);
311
- if (entrypoint && (0, _Entrypoint2.isSuperSet)((_entrypoint$evaluated = entrypoint.evaluatedOnly) !== null && _entrypoint$evaluated !== void 0 ? _entrypoint$evaluated : [], only)) {
312
- if (this.cache.checkFreshness(filename, strippedFilename)) {
313
- entrypoint = undefined;
314
- }
315
- if (entrypoint) {
316
- log('✅ file has been already evaluated');
317
- return entrypoint;
318
- }
319
- }
320
- if ((_entrypoint = entrypoint) !== null && _entrypoint !== void 0 && _entrypoint.ignored) {
321
- log('✅ file has been ignored during prepare stage. Original code will be used');
322
- return entrypoint;
323
- }
324
- if (this.ignored) {
325
- log('✅ one of the parent files has been ignored during prepare stage. Original code will be used');
326
- const newEntrypoint = this.entrypoint.createChild(filename, ['*'], _fs.default.readFileSync(strippedFilename, 'utf-8'));
327
- if (newEntrypoint === 'loop') {
328
- const stack = (0, _Entrypoint2.getStack)(this.entrypoint);
329
- throw new Error(`Circular dependency detected: ${stack.join(' -> ')} -> ${filename}`);
330
- }
331
- return newEntrypoint;
332
- }
333
- let uncachedExports = null;
334
- let reprocessOnly = only;
335
- // Requested file can be already prepared for evaluation on the stage 1
336
- if (only && entrypoint) {
337
- var _entrypoint$evaluated2, _entrypoint$only, _entrypoint$evaluated3;
338
- const evaluatedExports = ((_entrypoint$evaluated2 = entrypoint.evaluatedOnly) === null || _entrypoint$evaluated2 === void 0 ? void 0 : _entrypoint$evaluated2.length) !== 0 ? entrypoint.evaluatedOnly : (_entrypoint$only = entrypoint.only) !== null && _entrypoint$only !== void 0 ? _entrypoint$only : [];
339
- uncachedExports = getUncached(evaluatedExports, only);
340
- if (uncachedExports.length === 0) {
341
- log('✅ ready for evaluation');
342
- return entrypoint;
343
- }
344
- if ((_entrypoint$evaluated3 = entrypoint.evaluatedOnly) !== null && _entrypoint$evaluated3 !== void 0 && _entrypoint$evaluated3.length) {
345
- reprocessOnly = (0, _Entrypoint2.mergeOnly)(evaluatedExports, only);
346
- }
347
- log('❌ file has been processed during prepare stage but %o is not evaluated yet (evaluated: %o)', uncachedExports, evaluatedExports);
348
- } else {
349
- log('❌ file has not been processed during prepare stage');
350
- }
351
-
352
- // If code wasn't extracted from cache, it indicates that we were unable
353
- // to process some of the imports on stage1. Let's try to reprocess.
354
- const code = _fs.default.readFileSync(strippedFilename, 'utf-8');
355
- const newEntrypoint = _Entrypoint.Entrypoint.createRoot(this.services, filename, reprocessOnly, code);
356
- if (newEntrypoint.evaluated) {
357
- log('✅ file has been already evaluated');
358
- return newEntrypoint;
359
- }
360
- if (newEntrypoint.ignored) {
361
- log('✅ file has been ignored during prepare stage. Original code will be used');
362
- return newEntrypoint;
363
- }
364
- return newEntrypoint;
365
- }
366
- resolveWithConditions(id, parent, conditions) {
367
- const resolveOptions = conditions ? {
368
- conditions
369
- } : undefined;
370
- const shouldRetryWithExtensions = conditions && _path.default.extname(id) === '' && (id.startsWith('.') || _path.default.isAbsolute(id) || isBarePackageSubpath(id));
371
- try {
372
- return this.moduleImpl._resolveFilename(id, parent, false, resolveOptions);
373
- } catch (e) {
374
- if (shouldRetryWithExtensions && e instanceof Error && e.code === 'MODULE_NOT_FOUND') {
375
- // Extensionless subpath requests (e.g. "pkg/src/*" or "./src/*") may
376
- // resolve to extensionless targets via conditional exports. Retry with
377
- // each known extension, but never rewrite already explicit specifiers.
378
- for (const ext of this.extensions) {
379
- try {
380
- return this.moduleImpl._resolveFilename(id + ext, parent, false, resolveOptions);
381
- } catch {
382
- // try next extension
383
- }
384
- }
385
- }
386
- throw e;
387
- }
388
- }
389
- resolveDependency = id => {
390
- const cached = this.entrypoint.getDependency(id);
391
- (0, _tsInvariant.invariant)(!(cached instanceof Promise), 'Dependency is not resolved yet');
392
- if (cached) {
393
- return cached;
394
- }
395
- if (!this.ignored) {
396
- this.debug('❌ import has not been resolved during prepare stage. Fallback to Node.js resolver');
397
- }
398
- const extensions = this.moduleImpl._extensions;
399
- const added = [];
400
- try {
401
- var _override$unknown;
402
- // Check for supported extensions
403
- this.extensions.forEach(ext => {
404
- if (ext in extensions) {
405
- return;
406
- }
407
-
408
- // When an extension is not supported, add it
409
- // And keep track of it to clean it up after resolving
410
- // Use noop for the transform function since we handle it
411
- extensions[ext] = NOOP;
412
- added.push(ext);
413
- });
414
- const {
415
- filename
416
- } = this;
417
- const strippedId = (0, _parseRequest.stripQueryAndHash)(id);
418
- const parent = {
419
- id: filename,
420
- filename,
421
- paths: this.moduleImpl._nodeModulePaths(_path.default.dirname(filename))
422
- };
423
- const {
424
- conditionNames
425
- } = this.services.options.pluginOptions;
426
- const conditions = conditionNames !== null && conditionNames !== void 0 && conditionNames.length ? expandConditions(conditionNames) : undefined;
427
- let resolved = this.resolveWithConditions(strippedId, parent, conditions);
428
- const isFileSpecifier = strippedId.startsWith('.') || _path.default.isAbsolute(strippedId);
429
- if (isFileSpecifier && _path.default.extname(strippedId) === '' && resolved.endsWith('.cjs') && _fs.default.existsSync(`${resolved.slice(0, -4)}.js`)) {
430
- // When both `.cjs` and `.js` exist for an extensionless specifier, the
431
- // resolver may pick `.cjs` depending on the environment/extensions.
432
- // Prefer `.js` to keep resolved paths stable (e.g. importOverrides keys).
433
- resolved = `${resolved.slice(0, -4)}.js`;
434
- }
435
- const {
436
- root
437
- } = this.services.options;
438
- const keyInfo = (0, _importOverrides.toImportKey)({
439
- source: id,
440
- resolved,
441
- root
442
- });
443
- const override = (0, _importOverrides.getImportOverride)(this.services.options.pluginOptions.importOverrides, keyInfo.key);
444
- const policy = (_override$unknown = override === null || override === void 0 ? void 0 : override.unknown) !== null && _override$unknown !== void 0 ? _override$unknown : override !== null && override !== void 0 && override.mock ? 'allow' : 'warn';
445
- const shouldWarn = !this.ignored && policy === 'warn';
446
- let finalResolved = resolved;
447
- if (override !== null && override !== void 0 && override.mock) {
448
- try {
449
- finalResolved = (0, _importOverrides.resolveMockSpecifier)({
450
- mock: override.mock,
451
- importer: filename,
452
- root,
453
- stack: this.callstack
454
- });
455
- } catch (e) {
456
- var _message;
457
- const errorMessage = String((_message = e === null || e === void 0 ? void 0 : e.message) !== null && _message !== void 0 ? _message : e);
458
- throw new Error(`[wyw-in-js] Failed to resolve import mock for "${keyInfo.key}" (${id} from ${filename}): ${errorMessage}`);
459
- }
460
- }
461
- if (policy === 'error') {
462
- throw new Error([`[wyw-in-js] Unknown import reached during eval (Node resolver fallback)`, ``, `importer: ${filename}`, `source: ${id}`, `resolved: ${resolved}`, override !== null && override !== void 0 && override.mock ? `mock: ${override.mock} -> ${finalResolved}` : ``, ``, `callstack:`, ...this.callstack.map(item => ` ${item}`), ``, `config key: ${keyInfo.key}`].filter(Boolean).join('\n'));
463
- }
464
- const warnedUnknownImports = getWarnedUnknownImports(this.services);
465
- if (shouldWarn && !warnedUnknownImports.has(keyInfo.key)) {
466
- warnedUnknownImports.add(keyInfo.key);
467
- emitWarning(this.services, [`[wyw-in-js] Unknown import reached during eval (Node resolver fallback)`, ``, `importer: ${filename}`, `source: ${id}`, `resolved: ${resolved}`, override !== null && override !== void 0 && override.mock ? `mock: ${override.mock} -> ${finalResolved}` : ``, ``, `callstack:`, ...this.callstack.map(item => ` ${item}`), ``, `config key: ${keyInfo.key}`, `hint: add { importOverrides: { ${JSON.stringify(keyInfo.key)}: { unknown: 'allow' } } } to silence warnings, or use { mock } / { noShake: true } overrides.`].filter(Boolean).join('\n'));
468
- }
469
- return {
470
- source: id,
471
- only: (0, _importOverrides.applyImportOverrideToOnly)(['*'], override),
472
- resolved: finalResolved
473
- };
474
- } finally {
475
- // Cleanup the extensions we added to restore previous behaviour
476
- added.forEach(ext => delete extensions[ext]);
477
- }
478
- };
479
- createChild(entrypoint) {
480
- return new Module(this.services, entrypoint, this, this.moduleImpl);
481
- }
482
- loadByImportLoaders(request, resolved) {
483
- const {
484
- pluginOptions
485
- } = this.services.options;
486
- const importLoaders = pluginOptions.importLoaders === undefined ? defaultImportLoaders : {
487
- ...defaultImportLoaders,
488
- ...pluginOptions.importLoaders
489
- };
490
- const {
491
- query,
492
- hash
493
- } = (0, _parseRequest.parseRequest)(request);
494
- if (!query) return {
495
- handled: false,
496
- value: undefined
497
- };
498
- const params = new URLSearchParams(query);
499
- const matchedKey = Array.from(params.keys()).find(key => importLoaders[key] !== undefined && importLoaders[key] !== false);
500
- if (!matchedKey) return {
501
- handled: false,
502
- value: undefined
503
- };
504
- const loader = importLoaders[matchedKey];
505
- const filename = (0, _parseRequest.stripQueryAndHash)(resolved);
506
- const importer = (0, _parseRequest.stripQueryAndHash)(this.filename);
507
- const importerDir = _path.default.dirname(importer);
508
- const toUrl = () => {
509
- const relative = _path.default.relative(importerDir, filename).replace(/\\/g, _path.default.posix.sep);
510
- if (relative.startsWith('.') || _path.default.isAbsolute(relative)) {
511
- return relative;
512
- }
513
- return `./${relative}`;
514
- };
515
- const readFile = () => _fs.default.readFileSync(filename, 'utf-8');
516
- const context = {
517
- importer,
518
- request,
519
- resolved,
520
- filename,
521
- query,
522
- hash,
523
- emitWarning: message => emitWarning(this.services, message),
524
- readFile,
525
- toUrl
526
- };
527
- if (loader === 'raw') {
528
- return {
529
- handled: true,
530
- value: context.readFile()
531
- };
532
- }
533
- if (loader === 'url') {
534
- return {
535
- handled: true,
536
- value: context.toUrl()
537
- };
538
- }
539
- if (typeof loader === 'function') {
540
- return {
541
- handled: true,
542
- value: loader(context)
543
- };
544
- }
545
- return {
546
- handled: false,
547
- value: undefined
548
- };
549
- }
550
- }
551
- exports.Module = Module;
552
- //# sourceMappingURL=module.js.map
package/lib/module.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"module.js","names":["_fs","_interopRequireDefault","require","_module","_path","_vm","_tsInvariant","_shared","_Entrypoint","_Entrypoint2","_UnprocessedEntrypointError","_importOverrides","_parseRequest","_createVmContext","e","__esModule","default","CJS_DEFAULT_CONDITIONS","expandConditions","conditionNames","result","Set","name","d","add","isBarePackageSubpath","id","startsWith","path","isAbsolute","split","length","includes","DefaultModuleImplementation","exports","NativeModule","builtins","assert","buffer","child_process","cluster","console","constants","crypto","dgram","dns","domain","events","fs","http","https","module","net","os","punycode","process","querystring","readline","repl","stream","string_decoder","sys","timers","tls","tty","url","util","vm","zlib","VITE_VIRTUAL_PREFIX","REACT_REFRESH_VIRTUAL_ID","reactRefreshRuntime","createSignatureFunctionForTransform","NOOP","browserOnlyEvalHintTriggers","getBrowserOnlyEvalHint","error","message","Error","String","looksLikeBrowserOnly","some","trigger","join","warnedUnknownImportsByServices","WeakMap","emitWarning","services","warn","getWarnedUnknownImports","cached","get","created","set","getUncached","test","cachedSet","has","filter","t","resolve","resolved","resolveDependency","invariant","defaultImportLoaders","raw","Module","callstack","isEvaluated","Object","assign","dependencies","push","debug","dependency","source","loaded","loadByImportLoaders","handled","value","entrypoint","getEntrypoint","only","evaluated","isSuperSet","evaluatedOnly","m","createChild","evaluate","ensure","bind","entrypointRef","constructor","parentModule","moduleImpl","_parentModule$ignored","_entrypoint$ignored","cache","isFeatureEnabled","options","pluginOptions","features","WeakRef","idx","filename","log","extend","parentIsIgnored","ignored","extensions","deref","assertTransformed","evaluatedCreated","supersededWith","createEvaluated","transformedCode","stripQueryAndHash","JSON","parse","context","teardown","createVmContext","__wyw_dynamic_import","__dirname","dirname","overrideContext","script","Script","runInContext","isUnprocessedEntrypointError","EvalError","baseMessage","hint","_entrypoint$evaluated","_entrypoint","strippedFilename","extension","extname","checkFreshness","undefined","newEntrypoint","readFileSync","stack","getStack","uncachedExports","reprocessOnly","_entrypoint$evaluated2","_entrypoint$only","_entrypoint$evaluated3","evaluatedExports","mergeOnly","code","Entrypoint","createRoot","resolveWithConditions","parent","conditions","resolveOptions","shouldRetryWithExtensions","_resolveFilename","ext","getDependency","Promise","_extensions","added","_override$unknown","forEach","strippedId","paths","_nodeModulePaths","isFileSpecifier","endsWith","existsSync","slice","root","keyInfo","toImportKey","override","getImportOverride","importOverrides","key","policy","unknown","mock","shouldWarn","finalResolved","resolveMockSpecifier","importer","_message","errorMessage","map","item","Boolean","warnedUnknownImports","stringify","applyImportOverrideToOnly","request","importLoaders","query","hash","parseRequest","params","URLSearchParams","matchedKey","Array","from","keys","find","loader","importerDir","toUrl","relative","replace","posix","sep","readFile"],"sources":["../src/module.ts"],"sourcesContent":["/**\n * This is a custom implementation for the module system for evaluating code,\n * used for resolving values for dependencies interpolated in `css` or `styled`.\n *\n * This serves 2 purposes:\n * - Avoid leakage from evaluated code to module cache in current context, e.g. `babel-register`\n * - Allow us to invalidate the module cache without affecting other stuff, necessary for rebuilds\n *\n * We also use it to transpile the code with Babel by default.\n * We also store source maps for it to provide correct error stacktraces.\n *\n */\n\nimport fs from 'fs';\nimport NativeModule from 'module';\nimport path from 'path';\nimport vm from 'vm';\n\nimport { invariant } from 'ts-invariant';\n\nimport {\n isFeatureEnabled,\n type Debugger,\n type ImportLoaderContext,\n type ImportLoaders,\n} from '@wyw-in-js/shared';\n\nimport './utils/dispose-polyfill';\nimport type { TransformCacheCollection } from './cache';\nimport { Entrypoint } from './transform/Entrypoint';\nimport {\n getStack,\n isSuperSet,\n mergeOnly,\n} from './transform/Entrypoint.helpers';\nimport type { IEntrypointDependency } from './transform/Entrypoint.types';\nimport type { IEvaluatedEntrypoint } from './transform/EvaluatedEntrypoint';\nimport { isUnprocessedEntrypointError } from './transform/actions/UnprocessedEntrypointError';\nimport type { Services } from './transform/types';\nimport {\n applyImportOverrideToOnly,\n getImportOverride,\n resolveMockSpecifier,\n toImportKey,\n} from './utils/importOverrides';\nimport { parseRequest, stripQueryAndHash } from './utils/parseRequest';\nimport { createVmContext } from './vm/createVmContext';\n\ntype HiddenModuleMembers = {\n _extensions: Record<string, () => void>;\n _resolveFilename: (\n id: string,\n options: { filename: string; id: string; paths: string[] },\n isMain?: boolean,\n resolveOptions?: { conditions?: Set<string> }\n ) => string;\n _nodeModulePaths(filename: string): string[];\n};\n\nconst CJS_DEFAULT_CONDITIONS = ['require', 'node', 'default'] as const;\n\nfunction expandConditions(conditionNames: string[]): Set<string> {\n const result = new Set<string>();\n for (const name of conditionNames) {\n if (name === '...') {\n for (const d of CJS_DEFAULT_CONDITIONS) result.add(d);\n } else {\n result.add(name);\n }\n }\n return result;\n}\n\nfunction isBarePackageSubpath(id: string): boolean {\n if (id.startsWith('.') || path.isAbsolute(id)) {\n return false;\n }\n\n if (id.startsWith('@')) {\n return id.split('/').length > 2;\n }\n\n return id.includes('/');\n}\n\nexport const DefaultModuleImplementation = NativeModule as typeof NativeModule &\n HiddenModuleMembers;\n\n// Supported node builtins based on the modules polyfilled by webpack\n// `true` means module is polyfilled, `false` means module is empty\nconst builtins = {\n assert: true,\n buffer: true,\n child_process: false,\n cluster: false,\n console: true,\n constants: true,\n crypto: true,\n dgram: false,\n dns: false,\n domain: true,\n events: true,\n fs: false,\n http: true,\n https: true,\n module: false,\n net: false,\n os: true,\n path: true,\n punycode: true,\n process: true,\n querystring: true,\n readline: false,\n repl: false,\n stream: true,\n string_decoder: true,\n sys: true,\n timers: true,\n tls: false,\n tty: true,\n url: true,\n util: true,\n vm: true,\n zlib: true,\n};\n\nconst VITE_VIRTUAL_PREFIX = '/@';\nconst REACT_REFRESH_VIRTUAL_ID = '/@react-refresh';\nconst reactRefreshRuntime = {\n createSignatureFunctionForTransform: () => () => {},\n};\n\nconst NOOP = () => {};\n\nconst browserOnlyEvalHintTriggers = [\n 'window is not defined',\n \"evaluating 'window\",\n 'document is not defined',\n \"evaluating 'document\",\n 'navigator is not defined',\n \"evaluating 'navigator\",\n 'self is not defined',\n \"evaluating 'self\",\n];\n\nconst getBrowserOnlyEvalHint = (error: unknown): string | null => {\n const message = error instanceof Error ? error.message : String(error);\n const looksLikeBrowserOnly = browserOnlyEvalHintTriggers.some((trigger) =>\n message.includes(trigger)\n );\n if (!looksLikeBrowserOnly) return null;\n\n return [\n '',\n '[wyw-in-js] Evaluation hint:',\n 'This usually means browser-only code ran during build-time evaluation.',\n 'Move browser-only initialization out of evaluated modules, or mock the import via `importOverrides`.',\n \"Example: importOverrides: { 'msw/browser': { mock: './src/__mocks__/msw-browser.js' } }\",\n ].join('\\n');\n};\n\nconst warnedUnknownImportsByServices = new WeakMap<Services, Set<string>>();\n\nfunction emitWarning(services: Services, message: string) {\n if (services.emitWarning) {\n services.emitWarning(message);\n return;\n }\n\n // eslint-disable-next-line no-console\n console.warn(message);\n}\n\nfunction getWarnedUnknownImports(services: Services): Set<string> {\n const cached = warnedUnknownImportsByServices.get(services);\n if (cached) {\n return cached;\n }\n\n const created = new Set<string>();\n warnedUnknownImportsByServices.set(services, created);\n return created;\n}\n\nfunction getUncached(cached: string | string[], test: string[]): string[] {\n const cachedSet = new Set(\n typeof cached === 'string' ? cached.split(',') : cached\n );\n\n if (cachedSet.has('*')) {\n return [];\n }\n\n return test.filter((t) => !cachedSet.has(t));\n}\n\nfunction resolve(\n this: { resolveDependency: (id: string) => IEntrypointDependency },\n id: string\n): string {\n const { resolved } = this.resolveDependency(id);\n invariant(resolved, `Unable to resolve \"${id}\"`);\n return resolved;\n}\n\nconst defaultImportLoaders: ImportLoaders = {\n raw: 'raw',\n url: 'url',\n};\n\nexport class Module {\n public readonly callstack: string[] = [];\n\n public readonly debug: Debugger;\n\n public readonly dependencies: string[];\n\n public readonly extensions: string[];\n\n public readonly filename: string;\n\n public id: string;\n\n public readonly idx: string;\n\n public readonly ignored: boolean;\n\n public isEvaluated: boolean = false;\n\n public readonly parentIsIgnored: boolean;\n\n public require: {\n (id: string): unknown;\n ensure: () => void;\n resolve: (id: string) => string;\n } = Object.assign(\n (id: string) => {\n if (id === REACT_REFRESH_VIRTUAL_ID) {\n this.dependencies.push(id);\n this.debug('require', `vite virtual '${id}'`);\n return reactRefreshRuntime;\n }\n\n if (id.startsWith(VITE_VIRTUAL_PREFIX)) {\n this.dependencies.push(id);\n this.debug('require', `vite virtual '${id}'`);\n return {};\n }\n\n if (id in builtins) {\n // The module is in the allowed list of builtin node modules\n // Ideally we should prevent importing them, but webpack polyfills some\n // So we check for the list of polyfills to determine which ones to support\n if (builtins[id as keyof typeof builtins]) {\n this.debug('require', `builtin '${id}'`);\n return require(id);\n }\n\n return null;\n }\n\n // Resolve module id (and filename) relatively to parent module\n const dependency = this.resolveDependency(id);\n if (dependency.resolved === id && !path.isAbsolute(id)) {\n // The module is a builtin node modules, but not in the allowed list\n throw new Error(\n `Unable to import \"${id}\". Importing Node builtins is not supported in the sandbox.`\n );\n }\n\n invariant(\n dependency.resolved,\n `Dependency ${dependency.source} cannot be resolved`\n );\n\n const loaded = this.loadByImportLoaders(id, dependency.resolved);\n if (loaded.handled) {\n this.dependencies.push(id);\n this.debug('require', `${id} -> ${dependency.resolved} (loader)`);\n return loaded.value;\n }\n\n this.dependencies.push(id);\n\n this.debug('require', `${id} -> ${dependency.resolved}`);\n\n const entrypoint = this.getEntrypoint(\n dependency.resolved,\n dependency.only,\n this.debug\n );\n\n if (entrypoint === null) {\n return dependency.resolved;\n }\n\n if (\n entrypoint.evaluated ||\n isSuperSet(entrypoint.evaluatedOnly, dependency.only)\n ) {\n return entrypoint.exports;\n }\n\n const m = this.createChild(entrypoint);\n m.evaluate();\n\n return entrypoint.exports;\n },\n {\n ensure: NOOP,\n resolve: resolve.bind(this),\n }\n );\n\n public resolve = resolve.bind(this);\n\n private cache: TransformCacheCollection;\n\n #entrypointRef: WeakRef<Entrypoint> | Entrypoint;\n\n constructor(\n private services: Services,\n entrypoint: Entrypoint,\n parentModule?: Module,\n private moduleImpl: HiddenModuleMembers = DefaultModuleImplementation\n ) {\n this.cache = services.cache;\n this.#entrypointRef = isFeatureEnabled(\n services.options.pluginOptions.features,\n 'useWeakRefInEval',\n entrypoint.name\n )\n ? new WeakRef(entrypoint)\n : entrypoint;\n this.idx = entrypoint.idx;\n this.id = entrypoint.name;\n this.filename = entrypoint.name;\n this.dependencies = [];\n this.debug = entrypoint.log.extend('module');\n this.parentIsIgnored = parentModule?.ignored ?? false;\n this.ignored = entrypoint.ignored ?? this.parentIsIgnored;\n\n if (parentModule) {\n this.callstack = [entrypoint.name, ...parentModule.callstack];\n } else {\n this.callstack = [entrypoint.name];\n }\n\n this.extensions = services.options.pluginOptions.extensions;\n\n this.debug('init', entrypoint.name);\n }\n\n public get exports() {\n return this.entrypoint.exports;\n }\n\n public set exports(value) {\n this.entrypoint.exports = value;\n\n this.debug('the whole exports was overridden with %O', value);\n }\n\n protected get entrypoint(): Entrypoint {\n const entrypoint =\n this.#entrypointRef instanceof WeakRef\n ? this.#entrypointRef.deref()\n : this.#entrypointRef;\n invariant(entrypoint, `Module ${this.idx} is disposed`);\n return entrypoint;\n }\n\n evaluate(): void {\n const { entrypoint } = this;\n entrypoint.assertTransformed();\n\n const cached = this.cache.get('entrypoints', entrypoint.name)!;\n let evaluatedCreated = false;\n if (!entrypoint.supersededWith) {\n this.cache.add(\n 'entrypoints',\n entrypoint.name,\n entrypoint.createEvaluated()\n );\n evaluatedCreated = true;\n }\n\n const { transformedCode: source } = entrypoint;\n const { pluginOptions } = this.services.options;\n\n if (!source) {\n this.debug(`evaluate`, 'there is nothing to evaluate');\n return;\n }\n\n if (this.isEvaluated) {\n this.debug('evaluate', `is already evaluated`);\n return;\n }\n\n this.debug('evaluate');\n this.debug.extend('source')('%s', source);\n\n this.isEvaluated = true;\n\n const filename = stripQueryAndHash(this.filename);\n\n if (/\\.json$/.test(filename)) {\n // For JSON files, parse it to a JS object similar to Node\n this.exports = JSON.parse(source);\n return;\n }\n\n const { context, teardown } = createVmContext(\n filename,\n pluginOptions.features,\n {\n module: this,\n exports: entrypoint.exports,\n require: this.require,\n __wyw_dynamic_import: async (id: unknown) => this.require(String(id)),\n __dirname: path.dirname(filename),\n },\n pluginOptions.overrideContext\n );\n\n try {\n const script = new vm.Script(\n `(function (exports) { ${source}\\n})(exports);`,\n {\n filename,\n }\n );\n\n script.runInContext(context);\n } catch (e) {\n this.isEvaluated = false;\n if (evaluatedCreated) {\n this.cache.add('entrypoints', entrypoint.name, cached);\n }\n\n if (isUnprocessedEntrypointError(e)) {\n // It will be handled by evalFile scenario\n throw e;\n }\n\n if (e instanceof EvalError) {\n this.debug('%O', e);\n\n throw e;\n }\n\n this.debug('%O\\n%O', e, this.callstack);\n const baseMessage = `${(e as Error).message} in${this.callstack.join(\n '\\n| '\n )}\\n`;\n const hint = getBrowserOnlyEvalHint(e);\n\n throw new EvalError(hint ? `${baseMessage}${hint}\\n` : baseMessage);\n } finally {\n teardown();\n }\n }\n\n getEntrypoint(\n filename: string,\n only: string[],\n log: Debugger\n ): Entrypoint | IEvaluatedEntrypoint | null {\n const strippedFilename = stripQueryAndHash(filename);\n const extension = path.extname(strippedFilename);\n if (extension !== '.json' && !this.extensions.includes(extension)) {\n return null;\n }\n\n let entrypoint = this.cache.get('entrypoints', filename);\n if (entrypoint && isSuperSet(entrypoint.evaluatedOnly ?? [], only)) {\n if (this.cache.checkFreshness(filename, strippedFilename)) {\n entrypoint = undefined;\n }\n\n if (entrypoint) {\n log('✅ file has been already evaluated');\n return entrypoint;\n }\n }\n\n if (entrypoint?.ignored) {\n log(\n '✅ file has been ignored during prepare stage. Original code will be used'\n );\n return entrypoint;\n }\n\n if (this.ignored) {\n log(\n '✅ one of the parent files has been ignored during prepare stage. Original code will be used'\n );\n\n const newEntrypoint = this.entrypoint.createChild(\n filename,\n ['*'],\n fs.readFileSync(strippedFilename, 'utf-8')\n );\n\n if (newEntrypoint === 'loop') {\n const stack = getStack(this.entrypoint);\n throw new Error(\n `Circular dependency detected: ${stack.join(' -> ')} -> ${filename}`\n );\n }\n\n return newEntrypoint;\n }\n\n let uncachedExports: string[] | null = null;\n let reprocessOnly: string[] = only;\n // Requested file can be already prepared for evaluation on the stage 1\n if (only && entrypoint) {\n const evaluatedExports =\n entrypoint.evaluatedOnly?.length !== 0\n ? entrypoint.evaluatedOnly\n : entrypoint.only ?? [];\n uncachedExports = getUncached(evaluatedExports, only);\n if (uncachedExports.length === 0) {\n log('✅ ready for evaluation');\n return entrypoint;\n }\n\n if (entrypoint.evaluatedOnly?.length) {\n reprocessOnly = mergeOnly(evaluatedExports, only);\n }\n\n log(\n '❌ file has been processed during prepare stage but %o is not evaluated yet (evaluated: %o)',\n uncachedExports,\n evaluatedExports\n );\n } else {\n log('❌ file has not been processed during prepare stage');\n }\n\n // If code wasn't extracted from cache, it indicates that we were unable\n // to process some of the imports on stage1. Let's try to reprocess.\n const code = fs.readFileSync(strippedFilename, 'utf-8');\n const newEntrypoint = Entrypoint.createRoot(\n this.services,\n filename,\n reprocessOnly,\n code\n );\n\n if (newEntrypoint.evaluated) {\n log('✅ file has been already evaluated');\n return newEntrypoint;\n }\n\n if (newEntrypoint.ignored) {\n log(\n '✅ file has been ignored during prepare stage. Original code will be used'\n );\n return newEntrypoint;\n }\n\n return newEntrypoint;\n }\n\n private resolveWithConditions(\n id: string,\n parent: { id: string; filename: string; paths: string[] },\n conditions?: Set<string>\n ): string {\n const resolveOptions = conditions ? { conditions } : undefined;\n const shouldRetryWithExtensions =\n conditions &&\n path.extname(id) === '' &&\n (id.startsWith('.') || path.isAbsolute(id) || isBarePackageSubpath(id));\n try {\n return this.moduleImpl._resolveFilename(\n id,\n parent,\n false,\n resolveOptions\n );\n } catch (e: unknown) {\n if (\n shouldRetryWithExtensions &&\n e instanceof Error &&\n (e as NodeJS.ErrnoException).code === 'MODULE_NOT_FOUND'\n ) {\n // Extensionless subpath requests (e.g. \"pkg/src/*\" or \"./src/*\") may\n // resolve to extensionless targets via conditional exports. Retry with\n // each known extension, but never rewrite already explicit specifiers.\n for (const ext of this.extensions) {\n try {\n return this.moduleImpl._resolveFilename(\n id + ext,\n parent,\n false,\n resolveOptions\n );\n } catch {\n // try next extension\n }\n }\n }\n throw e;\n }\n }\n\n resolveDependency = (id: string): IEntrypointDependency => {\n const cached = this.entrypoint.getDependency(id);\n invariant(!(cached instanceof Promise), 'Dependency is not resolved yet');\n\n if (cached) {\n return cached;\n }\n\n if (!this.ignored) {\n this.debug(\n '❌ import has not been resolved during prepare stage. Fallback to Node.js resolver'\n );\n }\n\n const extensions = this.moduleImpl._extensions;\n const added: string[] = [];\n\n try {\n // Check for supported extensions\n this.extensions.forEach((ext) => {\n if (ext in extensions) {\n return;\n }\n\n // When an extension is not supported, add it\n // And keep track of it to clean it up after resolving\n // Use noop for the transform function since we handle it\n extensions[ext] = NOOP;\n added.push(ext);\n });\n\n const { filename } = this;\n const strippedId = stripQueryAndHash(id);\n\n const parent = {\n id: filename,\n filename,\n paths: this.moduleImpl._nodeModulePaths(path.dirname(filename)),\n };\n const { conditionNames } = this.services.options.pluginOptions;\n const conditions = conditionNames?.length\n ? expandConditions(conditionNames)\n : undefined;\n\n let resolved = this.resolveWithConditions(strippedId, parent, conditions);\n\n const isFileSpecifier =\n strippedId.startsWith('.') || path.isAbsolute(strippedId);\n\n if (\n isFileSpecifier &&\n path.extname(strippedId) === '' &&\n resolved.endsWith('.cjs') &&\n fs.existsSync(`${resolved.slice(0, -4)}.js`)\n ) {\n // When both `.cjs` and `.js` exist for an extensionless specifier, the\n // resolver may pick `.cjs` depending on the environment/extensions.\n // Prefer `.js` to keep resolved paths stable (e.g. importOverrides keys).\n resolved = `${resolved.slice(0, -4)}.js`;\n }\n\n const { root } = this.services.options;\n const keyInfo = toImportKey({\n source: id,\n resolved,\n root,\n });\n\n const override = getImportOverride(\n this.services.options.pluginOptions.importOverrides,\n keyInfo.key\n );\n\n const policy = override?.unknown ?? (override?.mock ? 'allow' : 'warn');\n const shouldWarn = !this.ignored && policy === 'warn';\n\n let finalResolved = resolved;\n if (override?.mock) {\n try {\n finalResolved = resolveMockSpecifier({\n mock: override.mock,\n importer: filename,\n root,\n stack: this.callstack,\n });\n } catch (e) {\n const errorMessage = String((e as Error)?.message ?? e);\n throw new Error(\n `[wyw-in-js] Failed to resolve import mock for \"${keyInfo.key}\" (${id} from ${filename}): ${errorMessage}`\n );\n }\n }\n\n if (policy === 'error') {\n throw new Error(\n [\n `[wyw-in-js] Unknown import reached during eval (Node resolver fallback)`,\n ``,\n `importer: ${filename}`,\n `source: ${id}`,\n `resolved: ${resolved}`,\n override?.mock\n ? `mock: ${override.mock} -> ${finalResolved}`\n : ``,\n ``,\n `callstack:`,\n ...this.callstack.map((item) => ` ${item}`),\n ``,\n `config key: ${keyInfo.key}`,\n ]\n .filter(Boolean)\n .join('\\n')\n );\n }\n\n const warnedUnknownImports = getWarnedUnknownImports(this.services);\n\n if (shouldWarn && !warnedUnknownImports.has(keyInfo.key)) {\n warnedUnknownImports.add(keyInfo.key);\n emitWarning(\n this.services,\n [\n `[wyw-in-js] Unknown import reached during eval (Node resolver fallback)`,\n ``,\n `importer: ${filename}`,\n `source: ${id}`,\n `resolved: ${resolved}`,\n override?.mock\n ? `mock: ${override.mock} -> ${finalResolved}`\n : ``,\n ``,\n `callstack:`,\n ...this.callstack.map((item) => ` ${item}`),\n ``,\n `config key: ${keyInfo.key}`,\n `hint: add { importOverrides: { ${JSON.stringify(\n keyInfo.key\n )}: { unknown: 'allow' } } } to silence warnings, or use { mock } / { noShake: true } overrides.`,\n ]\n .filter(Boolean)\n .join('\\n')\n );\n }\n\n return {\n source: id,\n only: applyImportOverrideToOnly(['*'], override),\n resolved: finalResolved,\n };\n } finally {\n // Cleanup the extensions we added to restore previous behaviour\n added.forEach((ext) => delete extensions[ext]);\n }\n };\n\n protected createChild(entrypoint: Entrypoint): Module {\n return new Module(this.services, entrypoint, this, this.moduleImpl);\n }\n\n private loadByImportLoaders(\n request: string,\n resolved: string\n ): { handled: boolean; value: unknown } {\n const { pluginOptions } = this.services.options;\n const importLoaders =\n pluginOptions.importLoaders === undefined\n ? defaultImportLoaders\n : { ...defaultImportLoaders, ...pluginOptions.importLoaders };\n\n const { query, hash } = parseRequest(request);\n if (!query) return { handled: false, value: undefined };\n\n const params = new URLSearchParams(query);\n const matchedKey = Array.from(params.keys()).find(\n (key) => importLoaders[key] !== undefined && importLoaders[key] !== false\n );\n\n if (!matchedKey) return { handled: false, value: undefined };\n\n const loader = importLoaders[matchedKey];\n\n const filename = stripQueryAndHash(resolved);\n const importer = stripQueryAndHash(this.filename);\n const importerDir = path.dirname(importer);\n\n const toUrl = () => {\n const relative = path\n .relative(importerDir, filename)\n .replace(/\\\\/g, path.posix.sep);\n\n if (relative.startsWith('.') || path.isAbsolute(relative)) {\n return relative;\n }\n\n return `./${relative}`;\n };\n\n const readFile = () => fs.readFileSync(filename, 'utf-8');\n\n const context: ImportLoaderContext = {\n importer,\n request,\n resolved,\n filename,\n query,\n hash,\n emitWarning: (message) => emitWarning(this.services, message),\n readFile,\n toUrl,\n };\n\n if (loader === 'raw') {\n return { handled: true, value: context.readFile() };\n }\n\n if (loader === 'url') {\n return { handled: true, value: context.toUrl() };\n }\n\n if (typeof loader === 'function') {\n return { handled: true, value: loader(context) };\n }\n\n return { handled: false, value: undefined };\n }\n}\n"],"mappings":";;;;;;AAaA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,GAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAAI,YAAA,GAAAJ,OAAA;AAEA,IAAAK,OAAA,GAAAL,OAAA;AAOAA,OAAA;AAEA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAOA,IAAAQ,2BAAA,GAAAR,OAAA;AAEA,IAAAS,gBAAA,GAAAT,OAAA;AAMA,IAAAU,aAAA,GAAAV,OAAA;AACA,IAAAW,gBAAA,GAAAX,OAAA;AAAuD,SAAAD,uBAAAa,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AA9CvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgDA,MAAMG,sBAAsB,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,CAAU;AAEtE,SAASC,gBAAgBA,CAACC,cAAwB,EAAe;EAC/D,MAAMC,MAAM,GAAG,IAAIC,GAAG,CAAS,CAAC;EAChC,KAAK,MAAMC,IAAI,IAAIH,cAAc,EAAE;IACjC,IAAIG,IAAI,KAAK,KAAK,EAAE;MACl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