@wyw-in-js/transform 0.1.0

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 (480) hide show
  1. package/LICENSE +21 -0
  2. package/esm/babel.js +2 -0
  3. package/esm/babel.js.map +1 -0
  4. package/esm/cache.js +80 -0
  5. package/esm/cache.js.map +1 -0
  6. package/esm/debug/fileReporter.js +144 -0
  7. package/esm/debug/fileReporter.js.map +1 -0
  8. package/esm/evaluators/index.js +14 -0
  9. package/esm/evaluators/index.js.map +1 -0
  10. package/esm/index.js +24 -0
  11. package/esm/index.js.map +1 -0
  12. package/esm/module.js +316 -0
  13. package/esm/module.js.map +1 -0
  14. package/esm/options/babel-merge.d.js +2 -0
  15. package/esm/options/babel-merge.d.js.map +1 -0
  16. package/esm/options/buildOptions.js +28 -0
  17. package/esm/options/buildOptions.js.map +1 -0
  18. package/esm/options/loadBabelOptions.js +24 -0
  19. package/esm/options/loadBabelOptions.js.map +1 -0
  20. package/esm/plugins/babel-transform.js +53 -0
  21. package/esm/plugins/babel-transform.js.map +1 -0
  22. package/esm/plugins/collector.js +66 -0
  23. package/esm/plugins/collector.js.map +1 -0
  24. package/esm/plugins/dynamic-import.js +28 -0
  25. package/esm/plugins/dynamic-import.js.map +1 -0
  26. package/esm/plugins/preeval.js +75 -0
  27. package/esm/plugins/preeval.js.map +1 -0
  28. package/esm/plugins/shaker.js +296 -0
  29. package/esm/plugins/shaker.js.map +1 -0
  30. package/esm/shaker.js +50 -0
  31. package/esm/shaker.js.map +1 -0
  32. package/esm/transform/BaseEntrypoint.js +164 -0
  33. package/esm/transform/BaseEntrypoint.js.map +1 -0
  34. package/esm/transform/Entrypoint.helpers.js +168 -0
  35. package/esm/transform/Entrypoint.helpers.js.map +1 -0
  36. package/esm/transform/Entrypoint.js +212 -0
  37. package/esm/transform/Entrypoint.js.map +1 -0
  38. package/esm/transform/Entrypoint.types.js +2 -0
  39. package/esm/transform/Entrypoint.types.js.map +1 -0
  40. package/esm/transform/EvaluatedEntrypoint.js +6 -0
  41. package/esm/transform/EvaluatedEntrypoint.js.map +1 -0
  42. package/esm/transform/actions/AbortError.js +8 -0
  43. package/esm/transform/actions/AbortError.js.map +1 -0
  44. package/esm/transform/actions/BaseAction.js +134 -0
  45. package/esm/transform/actions/BaseAction.js.map +1 -0
  46. package/esm/transform/actions/UnprocessedEntrypointError.js +8 -0
  47. package/esm/transform/actions/UnprocessedEntrypointError.js.map +1 -0
  48. package/esm/transform/actions/actionRunner.js +73 -0
  49. package/esm/transform/actions/actionRunner.js.map +1 -0
  50. package/esm/transform/actions/types.js +2 -0
  51. package/esm/transform/actions/types.js.map +1 -0
  52. package/esm/transform/generators/baseProcessingHandlers.js +22 -0
  53. package/esm/transform/generators/baseProcessingHandlers.js.map +1 -0
  54. package/esm/transform/generators/collect.js +58 -0
  55. package/esm/transform/generators/collect.js.map +1 -0
  56. package/esm/transform/generators/evalFile.js +50 -0
  57. package/esm/transform/generators/evalFile.js.map +1 -0
  58. package/esm/transform/generators/explodeReexports.js +63 -0
  59. package/esm/transform/generators/explodeReexports.js.map +1 -0
  60. package/esm/transform/generators/extract.js +120 -0
  61. package/esm/transform/generators/extract.js.map +1 -0
  62. package/esm/transform/generators/getExports.js +73 -0
  63. package/esm/transform/generators/getExports.js.map +1 -0
  64. package/esm/transform/generators/index.js +13 -0
  65. package/esm/transform/generators/index.js.map +1 -0
  66. package/esm/transform/generators/processEntrypoint.js +43 -0
  67. package/esm/transform/generators/processEntrypoint.js.map +1 -0
  68. package/esm/transform/generators/processImports.js +23 -0
  69. package/esm/transform/generators/processImports.js.map +1 -0
  70. package/esm/transform/generators/resolveImports.js +148 -0
  71. package/esm/transform/generators/resolveImports.js.map +1 -0
  72. package/esm/transform/generators/transform.js +117 -0
  73. package/esm/transform/generators/transform.js.map +1 -0
  74. package/esm/transform/generators/workflow.js +82 -0
  75. package/esm/transform/generators/workflow.js.map +1 -0
  76. package/esm/transform/helpers/loadLinariaOptions.js +66 -0
  77. package/esm/transform/helpers/loadLinariaOptions.js.map +1 -0
  78. package/esm/transform/helpers/withDefaultServices.js +21 -0
  79. package/esm/transform/helpers/withDefaultServices.js.map +1 -0
  80. package/esm/transform/rootLog.js +3 -0
  81. package/esm/transform/rootLog.js.map +1 -0
  82. package/esm/transform/types.js +2 -0
  83. package/esm/transform/types.js.map +1 -0
  84. package/esm/transform.js +121 -0
  85. package/esm/transform.js.map +1 -0
  86. package/esm/types.js +2 -0
  87. package/esm/types.js.map +1 -0
  88. package/esm/utils/EventEmitter.js +52 -0
  89. package/esm/utils/EventEmitter.js.map +1 -0
  90. package/esm/utils/ShakerMetadata.js +2 -0
  91. package/esm/utils/ShakerMetadata.js.map +1 -0
  92. package/esm/utils/TransformMetadata.js +11 -0
  93. package/esm/utils/TransformMetadata.js.map +1 -0
  94. package/esm/utils/addIdentifierToLinariaPreval.js +68 -0
  95. package/esm/utils/addIdentifierToLinariaPreval.js.map +1 -0
  96. package/esm/utils/collectExportsAndImports.js +974 -0
  97. package/esm/utils/collectExportsAndImports.js.map +1 -0
  98. package/esm/utils/collectTemplateDependencies.js +219 -0
  99. package/esm/utils/collectTemplateDependencies.js.map +1 -0
  100. package/esm/utils/createId.js +6 -0
  101. package/esm/utils/createId.js.map +1 -0
  102. package/esm/utils/dispose-polyfill.js +6 -0
  103. package/esm/utils/dispose-polyfill.js.map +1 -0
  104. package/esm/utils/findIdentifiers.js +62 -0
  105. package/esm/utils/findIdentifiers.js.map +1 -0
  106. package/esm/utils/findPackageJSON.js +22 -0
  107. package/esm/utils/findPackageJSON.js.map +1 -0
  108. package/esm/utils/getFileIdx.js +10 -0
  109. package/esm/utils/getFileIdx.js.map +1 -0
  110. package/esm/utils/getPluginKey.js +13 -0
  111. package/esm/utils/getPluginKey.js.map +1 -0
  112. package/esm/utils/getScope.js +6 -0
  113. package/esm/utils/getScope.js.map +1 -0
  114. package/esm/utils/getSource.js +15 -0
  115. package/esm/utils/getSource.js.map +1 -0
  116. package/esm/utils/getTagProcessor.js +304 -0
  117. package/esm/utils/getTagProcessor.js.map +1 -0
  118. package/esm/utils/getVisitorKeys.js +5 -0
  119. package/esm/utils/getVisitorKeys.js.map +1 -0
  120. package/esm/utils/hasLinariaPreval.js +7 -0
  121. package/esm/utils/hasLinariaPreval.js.map +1 -0
  122. package/esm/utils/isExports.js +22 -0
  123. package/esm/utils/isExports.js.map +1 -0
  124. package/esm/utils/isGlobal.js +6 -0
  125. package/esm/utils/isGlobal.js.map +1 -0
  126. package/esm/utils/isNode.js +2 -0
  127. package/esm/utils/isNode.js.map +1 -0
  128. package/esm/utils/isNodePath.js +4 -0
  129. package/esm/utils/isNodePath.js.map +1 -0
  130. package/esm/utils/isNotNull.js +4 -0
  131. package/esm/utils/isNotNull.js.map +1 -0
  132. package/esm/utils/isRemoved.js +46 -0
  133. package/esm/utils/isRemoved.js.map +1 -0
  134. package/esm/utils/isRequire.js +13 -0
  135. package/esm/utils/isRequire.js.map +1 -0
  136. package/esm/utils/isSerializable.js +13 -0
  137. package/esm/utils/isSerializable.js.map +1 -0
  138. package/esm/utils/isTypedNode.js +6 -0
  139. package/esm/utils/isTypedNode.js.map +1 -0
  140. package/esm/utils/isUnnecessaryReactCall.js +72 -0
  141. package/esm/utils/isUnnecessaryReactCall.js.map +1 -0
  142. package/esm/utils/peek.js +2 -0
  143. package/esm/utils/peek.js.map +1 -0
  144. package/esm/utils/processTemplateExpression.js +11 -0
  145. package/esm/utils/processTemplateExpression.js.map +1 -0
  146. package/esm/utils/removeDangerousCode.js +127 -0
  147. package/esm/utils/removeDangerousCode.js.map +1 -0
  148. package/esm/utils/scopeHelpers.js +514 -0
  149. package/esm/utils/scopeHelpers.js.map +1 -0
  150. package/esm/utils/traversalCache.js +28 -0
  151. package/esm/utils/traversalCache.js.map +1 -0
  152. package/esm/utils/unwrapSequence.js +14 -0
  153. package/esm/utils/unwrapSequence.js.map +1 -0
  154. package/esm/utils/valueToLiteral.js +59 -0
  155. package/esm/utils/valueToLiteral.js.map +1 -0
  156. package/esm/utils/visitors/JSXElementsRemover.js +51 -0
  157. package/esm/utils/visitors/JSXElementsRemover.js.map +1 -0
  158. package/esm/vm/createVmContext.js +72 -0
  159. package/esm/vm/createVmContext.js.map +1 -0
  160. package/esm/vm/process.js +29 -0
  161. package/esm/vm/process.js.map +1 -0
  162. package/lib/babel.js +2 -0
  163. package/lib/babel.js.map +1 -0
  164. package/lib/cache.js +87 -0
  165. package/lib/cache.js.map +1 -0
  166. package/lib/debug/fileReporter.js +153 -0
  167. package/lib/debug/fileReporter.js.map +1 -0
  168. package/lib/evaluators/index.js +20 -0
  169. package/lib/evaluators/index.js.map +1 -0
  170. package/lib/index.js +225 -0
  171. package/lib/index.js.map +1 -0
  172. package/lib/module.js +327 -0
  173. package/lib/module.js.map +1 -0
  174. package/lib/options/babel-merge.d.js +2 -0
  175. package/lib/options/babel-merge.d.js.map +1 -0
  176. package/lib/options/buildOptions.js +35 -0
  177. package/lib/options/buildOptions.js.map +1 -0
  178. package/lib/options/loadBabelOptions.js +31 -0
  179. package/lib/options/loadBabelOptions.js.map +1 -0
  180. package/lib/plugins/babel-transform.js +60 -0
  181. package/lib/plugins/babel-transform.js.map +1 -0
  182. package/lib/plugins/collector.js +76 -0
  183. package/lib/plugins/collector.js.map +1 -0
  184. package/lib/plugins/dynamic-import.js +34 -0
  185. package/lib/plugins/dynamic-import.js.map +1 -0
  186. package/lib/plugins/preeval.js +82 -0
  187. package/lib/plugins/preeval.js.map +1 -0
  188. package/lib/plugins/shaker.js +303 -0
  189. package/lib/plugins/shaker.js.map +1 -0
  190. package/lib/shaker.js +58 -0
  191. package/lib/shaker.js.map +1 -0
  192. package/lib/transform/BaseEntrypoint.js +175 -0
  193. package/lib/transform/BaseEntrypoint.js.map +1 -0
  194. package/lib/transform/Entrypoint.helpers.js +182 -0
  195. package/lib/transform/Entrypoint.helpers.js.map +1 -0
  196. package/lib/transform/Entrypoint.js +226 -0
  197. package/lib/transform/Entrypoint.js.map +1 -0
  198. package/lib/transform/Entrypoint.types.js +2 -0
  199. package/lib/transform/Entrypoint.types.js.map +1 -0
  200. package/lib/transform/EvaluatedEntrypoint.js +13 -0
  201. package/lib/transform/EvaluatedEntrypoint.js.map +1 -0
  202. package/lib/transform/actions/AbortError.js +16 -0
  203. package/lib/transform/actions/AbortError.js.map +1 -0
  204. package/lib/transform/actions/BaseAction.js +144 -0
  205. package/lib/transform/actions/BaseAction.js.map +1 -0
  206. package/lib/transform/actions/UnprocessedEntrypointError.js +16 -0
  207. package/lib/transform/actions/UnprocessedEntrypointError.js.map +1 -0
  208. package/lib/transform/actions/actionRunner.js +82 -0
  209. package/lib/transform/actions/actionRunner.js.map +1 -0
  210. package/lib/transform/actions/types.js +2 -0
  211. package/lib/transform/actions/types.js.map +1 -0
  212. package/lib/transform/generators/baseProcessingHandlers.js +27 -0
  213. package/lib/transform/generators/baseProcessingHandlers.js.map +1 -0
  214. package/lib/transform/generators/collect.js +66 -0
  215. package/lib/transform/generators/collect.js.map +1 -0
  216. package/lib/transform/generators/evalFile.js +57 -0
  217. package/lib/transform/generators/evalFile.js.map +1 -0
  218. package/lib/transform/generators/explodeReexports.js +70 -0
  219. package/lib/transform/generators/explodeReexports.js.map +1 -0
  220. package/lib/transform/generators/extract.js +128 -0
  221. package/lib/transform/generators/extract.js.map +1 -0
  222. package/lib/transform/generators/getExports.js +80 -0
  223. package/lib/transform/generators/getExports.js.map +1 -0
  224. package/lib/transform/generators/index.js +19 -0
  225. package/lib/transform/generators/index.js.map +1 -0
  226. package/lib/transform/generators/processEntrypoint.js +49 -0
  227. package/lib/transform/generators/processEntrypoint.js.map +1 -0
  228. package/lib/transform/generators/processImports.js +29 -0
  229. package/lib/transform/generators/processImports.js.map +1 -0
  230. package/lib/transform/generators/resolveImports.js +158 -0
  231. package/lib/transform/generators/resolveImports.js.map +1 -0
  232. package/lib/transform/generators/transform.js +130 -0
  233. package/lib/transform/generators/transform.js.map +1 -0
  234. package/lib/transform/generators/workflow.js +90 -0
  235. package/lib/transform/generators/workflow.js.map +1 -0
  236. package/lib/transform/helpers/loadLinariaOptions.js +73 -0
  237. package/lib/transform/helpers/loadLinariaOptions.js.map +1 -0
  238. package/lib/transform/helpers/withDefaultServices.js +30 -0
  239. package/lib/transform/helpers/withDefaultServices.js.map +1 -0
  240. package/lib/transform/rootLog.js +9 -0
  241. package/lib/transform/rootLog.js.map +1 -0
  242. package/lib/transform/types.js +8 -0
  243. package/lib/transform/types.js.map +1 -0
  244. package/lib/transform.js +128 -0
  245. package/lib/transform.js.map +1 -0
  246. package/lib/types.js +2 -0
  247. package/lib/types.js.map +1 -0
  248. package/lib/utils/EventEmitter.js +61 -0
  249. package/lib/utils/EventEmitter.js.map +1 -0
  250. package/lib/utils/ShakerMetadata.js +9 -0
  251. package/lib/utils/ShakerMetadata.js.map +1 -0
  252. package/lib/utils/TransformMetadata.js +19 -0
  253. package/lib/utils/TransformMetadata.js.map +1 -0
  254. package/lib/utils/addIdentifierToLinariaPreval.js +75 -0
  255. package/lib/utils/addIdentifierToLinariaPreval.js.map +1 -0
  256. package/lib/utils/collectExportsAndImports.js +990 -0
  257. package/lib/utils/collectExportsAndImports.js.map +1 -0
  258. package/lib/utils/collectTemplateDependencies.js +233 -0
  259. package/lib/utils/collectTemplateDependencies.js.map +1 -0
  260. package/lib/utils/createId.js +13 -0
  261. package/lib/utils/createId.js.map +1 -0
  262. package/lib/utils/dispose-polyfill.js +9 -0
  263. package/lib/utils/dispose-polyfill.js.map +1 -0
  264. package/lib/utils/findIdentifiers.js +73 -0
  265. package/lib/utils/findIdentifiers.js.map +1 -0
  266. package/lib/utils/findPackageJSON.js +29 -0
  267. package/lib/utils/findPackageJSON.js.map +1 -0
  268. package/lib/utils/getFileIdx.js +16 -0
  269. package/lib/utils/getFileIdx.js.map +1 -0
  270. package/lib/utils/getPluginKey.js +21 -0
  271. package/lib/utils/getPluginKey.js.map +1 -0
  272. package/lib/utils/getScope.js +12 -0
  273. package/lib/utils/getScope.js.map +1 -0
  274. package/lib/utils/getSource.js +24 -0
  275. package/lib/utils/getSource.js.map +1 -0
  276. package/lib/utils/getTagProcessor.js +318 -0
  277. package/lib/utils/getTagProcessor.js.map +1 -0
  278. package/lib/utils/getVisitorKeys.js +11 -0
  279. package/lib/utils/getVisitorKeys.js.map +1 -0
  280. package/lib/utils/hasLinariaPreval.js +13 -0
  281. package/lib/utils/hasLinariaPreval.js.map +1 -0
  282. package/lib/utils/isExports.js +27 -0
  283. package/lib/utils/isExports.js.map +1 -0
  284. package/lib/utils/isGlobal.js +13 -0
  285. package/lib/utils/isGlobal.js.map +1 -0
  286. package/lib/utils/isNode.js +9 -0
  287. package/lib/utils/isNode.js.map +1 -0
  288. package/lib/utils/isNodePath.js +10 -0
  289. package/lib/utils/isNodePath.js.map +1 -0
  290. package/lib/utils/isNotNull.js +10 -0
  291. package/lib/utils/isNotNull.js.map +1 -0
  292. package/lib/utils/isRemoved.js +52 -0
  293. package/lib/utils/isRemoved.js.map +1 -0
  294. package/lib/utils/isRequire.js +18 -0
  295. package/lib/utils/isRequire.js.map +1 -0
  296. package/lib/utils/isSerializable.js +19 -0
  297. package/lib/utils/isSerializable.js.map +1 -0
  298. package/lib/utils/isTypedNode.js +13 -0
  299. package/lib/utils/isTypedNode.js.map +1 -0
  300. package/lib/utils/isUnnecessaryReactCall.js +81 -0
  301. package/lib/utils/isUnnecessaryReactCall.js.map +1 -0
  302. package/lib/utils/peek.js +9 -0
  303. package/lib/utils/peek.js.map +1 -0
  304. package/lib/utils/processTemplateExpression.js +18 -0
  305. package/lib/utils/processTemplateExpression.js.map +1 -0
  306. package/lib/utils/removeDangerousCode.js +134 -0
  307. package/lib/utils/removeDangerousCode.js.map +1 -0
  308. package/lib/utils/scopeHelpers.js +544 -0
  309. package/lib/utils/scopeHelpers.js.map +1 -0
  310. package/lib/utils/traversalCache.js +38 -0
  311. package/lib/utils/traversalCache.js.map +1 -0
  312. package/lib/utils/unwrapSequence.js +20 -0
  313. package/lib/utils/unwrapSequence.js.map +1 -0
  314. package/lib/utils/valueToLiteral.js +65 -0
  315. package/lib/utils/valueToLiteral.js.map +1 -0
  316. package/lib/utils/visitors/JSXElementsRemover.js +57 -0
  317. package/lib/utils/visitors/JSXElementsRemover.js.map +1 -0
  318. package/lib/vm/createVmContext.js +80 -0
  319. package/lib/vm/createVmContext.js.map +1 -0
  320. package/lib/vm/process.js +38 -0
  321. package/lib/vm/process.js.map +1 -0
  322. package/package.json +63 -0
  323. package/types/babel.d.ts +2 -0
  324. package/types/babel.js +2 -0
  325. package/types/cache.d.ts +24 -0
  326. package/types/cache.js +85 -0
  327. package/types/debug/fileReporter.d.ts +27 -0
  328. package/types/debug/fileReporter.js +151 -0
  329. package/types/evaluators/index.d.ts +10 -0
  330. package/types/evaluators/index.js +15 -0
  331. package/types/index.d.ts +30 -0
  332. package/types/index.js +69 -0
  333. package/types/module.d.ts +62 -0
  334. package/types/module.js +318 -0
  335. package/types/options/buildOptions.d.ts +7 -0
  336. package/types/options/buildOptions.js +35 -0
  337. package/types/options/loadBabelOptions.d.ts +3 -0
  338. package/types/options/loadBabelOptions.js +27 -0
  339. package/types/plugins/babel-transform.d.ts +4 -0
  340. package/types/plugins/babel-transform.js +49 -0
  341. package/types/plugins/collector.d.ts +16 -0
  342. package/types/plugins/collector.js +67 -0
  343. package/types/plugins/dynamic-import.d.ts +6 -0
  344. package/types/plugins/dynamic-import.js +32 -0
  345. package/types/plugins/preeval.d.ts +16 -0
  346. package/types/plugins/preeval.js +69 -0
  347. package/types/plugins/shaker.d.ts +11 -0
  348. package/types/plugins/shaker.js +299 -0
  349. package/types/shaker.d.ts +3 -0
  350. package/types/shaker.js +64 -0
  351. package/types/transform/BaseEntrypoint.d.ts +23 -0
  352. package/types/transform/BaseEntrypoint.js +182 -0
  353. package/types/transform/Entrypoint.d.ts +50 -0
  354. package/types/transform/Entrypoint.helpers.d.ts +14 -0
  355. package/types/transform/Entrypoint.helpers.js +169 -0
  356. package/types/transform/Entrypoint.js +223 -0
  357. package/types/transform/Entrypoint.types.d.ts +23 -0
  358. package/types/transform/Entrypoint.types.js +2 -0
  359. package/types/transform/EvaluatedEntrypoint.d.ts +16 -0
  360. package/types/transform/EvaluatedEntrypoint.js +9 -0
  361. package/types/transform/actions/AbortError.d.ts +4 -0
  362. package/types/transform/actions/AbortError.js +12 -0
  363. package/types/transform/actions/BaseAction.d.ts +40 -0
  364. package/types/transform/actions/BaseAction.js +149 -0
  365. package/types/transform/actions/UnprocessedEntrypointError.d.ts +6 -0
  366. package/types/transform/actions/UnprocessedEntrypointError.js +13 -0
  367. package/types/transform/actions/actionRunner.d.ts +4 -0
  368. package/types/transform/actions/actionRunner.js +86 -0
  369. package/types/transform/actions/types.d.ts +15 -0
  370. package/types/transform/actions/types.js +2 -0
  371. package/types/transform/generators/baseProcessingHandlers.d.ts +17 -0
  372. package/types/transform/generators/baseProcessingHandlers.js +23 -0
  373. package/types/transform/generators/collect.d.ts +6 -0
  374. package/types/transform/generators/collect.js +57 -0
  375. package/types/transform/generators/evalFile.d.ts +6 -0
  376. package/types/transform/generators/evalFile.js +56 -0
  377. package/types/transform/generators/explodeReexports.d.ts +7 -0
  378. package/types/transform/generators/explodeReexports.js +67 -0
  379. package/types/transform/generators/extract.d.ts +8 -0
  380. package/types/transform/generators/extract.js +116 -0
  381. package/types/transform/generators/getExports.d.ts +8 -0
  382. package/types/transform/generators/getExports.js +65 -0
  383. package/types/transform/generators/index.d.ts +15 -0
  384. package/types/transform/generators/index.js +15 -0
  385. package/types/transform/generators/processEntrypoint.d.ts +9 -0
  386. package/types/transform/generators/processEntrypoint.js +88 -0
  387. package/types/transform/generators/processImports.d.ts +5 -0
  388. package/types/transform/generators/processImports.js +21 -0
  389. package/types/transform/generators/resolveImports.d.ts +9 -0
  390. package/types/transform/generators/resolveImports.js +124 -0
  391. package/types/transform/generators/transform.d.ts +17 -0
  392. package/types/transform/generators/transform.js +115 -0
  393. package/types/transform/generators/workflow.d.ts +7 -0
  394. package/types/transform/generators/workflow.js +77 -0
  395. package/types/transform/helpers/loadLinariaOptions.d.ts +6 -0
  396. package/types/transform/helpers/loadLinariaOptions.js +86 -0
  397. package/types/transform/helpers/withDefaultServices.d.ts +5 -0
  398. package/types/transform/helpers/withDefaultServices.js +40 -0
  399. package/types/transform/rootLog.d.ts +3 -0
  400. package/types/transform/rootLog.js +5 -0
  401. package/types/transform/types.d.ts +137 -0
  402. package/types/transform/types.js +4 -0
  403. package/types/transform.d.ts +20 -0
  404. package/types/transform.js +121 -0
  405. package/types/types.d.ts +72 -0
  406. package/types/types.js +5 -0
  407. package/types/utils/EventEmitter.d.ts +58 -0
  408. package/types/utils/EventEmitter.js +61 -0
  409. package/types/utils/ShakerMetadata.d.ts +7 -0
  410. package/types/utils/ShakerMetadata.js +5 -0
  411. package/types/utils/TransformMetadata.d.ts +13 -0
  412. package/types/utils/TransformMetadata.js +17 -0
  413. package/types/utils/addIdentifierToLinariaPreval.d.ts +4 -0
  414. package/types/utils/addIdentifierToLinariaPreval.js +75 -0
  415. package/types/utils/collectExportsAndImports.d.ts +31 -0
  416. package/types/utils/collectExportsAndImports.js +962 -0
  417. package/types/utils/collectTemplateDependencies.d.ts +17 -0
  418. package/types/utils/collectTemplateDependencies.js +212 -0
  419. package/types/utils/createId.d.ts +2 -0
  420. package/types/utils/createId.js +9 -0
  421. package/types/utils/dispose-polyfill.d.ts +0 -0
  422. package/types/utils/dispose-polyfill.js +5 -0
  423. package/types/utils/findIdentifiers.d.ts +6 -0
  424. package/types/utils/findIdentifiers.js +68 -0
  425. package/types/utils/findPackageJSON.d.ts +1 -0
  426. package/types/utils/findPackageJSON.js +29 -0
  427. package/types/utils/getFileIdx.d.ts +1 -0
  428. package/types/utils/getFileIdx.js +13 -0
  429. package/types/utils/getPluginKey.d.ts +2 -0
  430. package/types/utils/getPluginKey.js +16 -0
  431. package/types/utils/getScope.d.ts +2 -0
  432. package/types/utils/getScope.js +11 -0
  433. package/types/utils/getSource.d.ts +2 -0
  434. package/types/utils/getSource.js +22 -0
  435. package/types/utils/getTagProcessor.d.ts +6 -0
  436. package/types/utils/getTagProcessor.js +315 -0
  437. package/types/utils/getVisitorKeys.d.ts +5 -0
  438. package/types/utils/getVisitorKeys.js +8 -0
  439. package/types/utils/hasLinariaPreval.d.ts +4 -0
  440. package/types/utils/hasLinariaPreval.js +9 -0
  441. package/types/utils/isExports.d.ts +6 -0
  442. package/types/utils/isExports.js +20 -0
  443. package/types/utils/isGlobal.d.ts +2 -0
  444. package/types/utils/isGlobal.js +9 -0
  445. package/types/utils/isNode.d.ts +2 -0
  446. package/types/utils/isNode.js +7 -0
  447. package/types/utils/isNodePath.d.ts +3 -0
  448. package/types/utils/isNodePath.js +7 -0
  449. package/types/utils/isNotNull.d.ts +1 -0
  450. package/types/utils/isNotNull.js +7 -0
  451. package/types/utils/isRemoved.d.ts +5 -0
  452. package/types/utils/isRemoved.js +42 -0
  453. package/types/utils/isRequire.d.ts +6 -0
  454. package/types/utils/isRequire.js +15 -0
  455. package/types/utils/isSerializable.d.ts +2 -0
  456. package/types/utils/isSerializable.js +18 -0
  457. package/types/utils/isTypedNode.d.ts +5 -0
  458. package/types/utils/isTypedNode.js +9 -0
  459. package/types/utils/isUnnecessaryReactCall.d.ts +3 -0
  460. package/types/utils/isUnnecessaryReactCall.js +76 -0
  461. package/types/utils/peek.d.ts +1 -0
  462. package/types/utils/peek.js +5 -0
  463. package/types/utils/processTemplateExpression.d.ts +5 -0
  464. package/types/utils/processTemplateExpression.js +17 -0
  465. package/types/utils/removeDangerousCode.d.ts +3 -0
  466. package/types/utils/removeDangerousCode.js +144 -0
  467. package/types/utils/scopeHelpers.d.ts +12 -0
  468. package/types/utils/scopeHelpers.js +568 -0
  469. package/types/utils/traversalCache.d.ts +5 -0
  470. package/types/utils/traversalCache.js +36 -0
  471. package/types/utils/unwrapSequence.d.ts +8 -0
  472. package/types/utils/unwrapSequence.js +17 -0
  473. package/types/utils/valueToLiteral.d.ts +3 -0
  474. package/types/utils/valueToLiteral.js +64 -0
  475. package/types/utils/visitors/JSXElementsRemover.d.ts +3 -0
  476. package/types/utils/visitors/JSXElementsRemover.js +52 -0
  477. package/types/vm/createVmContext.d.ts +7 -0
  478. package/types/vm/createVmContext.js +92 -0
  479. package/types/vm/process.d.ts +25 -0
  480. package/types/vm/process.js +32 -0
@@ -0,0 +1,226 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Entrypoint = void 0;
7
+ var _tsInvariant = require("ts-invariant");
8
+ var _BaseEntrypoint = require("./BaseEntrypoint");
9
+ var _Entrypoint = require("./Entrypoint.helpers");
10
+ var _EvaluatedEntrypoint = require("./EvaluatedEntrypoint");
11
+ var _AbortError = require("./actions/AbortError");
12
+ var _BaseAction = require("./actions/BaseAction");
13
+ var _UnprocessedEntrypointError = require("./actions/UnprocessedEntrypointError");
14
+ const EMPTY_FILE = '=== empty file ===';
15
+ function hasLoop(name, parent, processed = []) {
16
+ if (parent.name === name || processed.includes(parent.name)) {
17
+ return true;
18
+ }
19
+ for (const p of parent.parents) {
20
+ const found = hasLoop(name, p, [...processed, parent.name]);
21
+ if (found) {
22
+ return found;
23
+ }
24
+ }
25
+ return false;
26
+ }
27
+ class Entrypoint extends _BaseEntrypoint.BaseEntrypoint {
28
+ evaluated = false;
29
+ onSupersedeHandlers = [];
30
+ actionsCache = new Map();
31
+ #hasLinariaMetadata = false;
32
+ #supersededWith = null;
33
+ #transformResultCode = null;
34
+ constructor(services, parents, initialCode, name, only, exports, evaluatedOnly, loadedAndParsed, resolveTasks = new Map(), dependencies = new Map(), generation = 1) {
35
+ var _parents$0$log, _parents$;
36
+ super(services, evaluatedOnly, exports, generation, name, only, parents);
37
+ this.initialCode = initialCode;
38
+ this.resolveTasks = resolveTasks;
39
+ this.dependencies = dependencies;
40
+ this.loadedAndParsed = loadedAndParsed !== null && loadedAndParsed !== void 0 ? loadedAndParsed : services.loadAndParseFn(services, name, initialCode, (_parents$0$log = (_parents$ = parents[0]) === null || _parents$ === void 0 ? void 0 : _parents$.log) !== null && _parents$0$log !== void 0 ? _parents$0$log : services.log);
41
+ if (this.loadedAndParsed.code !== undefined) {
42
+ services.cache.invalidateIfChanged(name, this.loadedAndParsed.code);
43
+ }
44
+ this.log.extend('source')('created %s (%o)\n%s', name, only, this.originalCode || EMPTY_FILE);
45
+ }
46
+ get ignored() {
47
+ return this.loadedAndParsed.evaluator === 'ignored';
48
+ }
49
+ get originalCode() {
50
+ return this.loadedAndParsed.code;
51
+ }
52
+ get supersededWith() {
53
+ var _this$supersededWith$, _this$supersededWith;
54
+ return (_this$supersededWith$ = (_this$supersededWith = this.#supersededWith) === null || _this$supersededWith === void 0 ? void 0 : _this$supersededWith.supersededWith) !== null && _this$supersededWith$ !== void 0 ? _this$supersededWith$ : this.#supersededWith;
55
+ }
56
+ get transformedCode() {
57
+ var _ref, _this$transformResult, _this$supersededWith2;
58
+ return (_ref = (_this$transformResult = this.#transformResultCode) !== null && _this$transformResult !== void 0 ? _this$transformResult : (_this$supersededWith2 = this.supersededWith) === null || _this$supersededWith2 === void 0 ? void 0 : _this$supersededWith2.transformedCode) !== null && _ref !== void 0 ? _ref : null;
59
+ }
60
+ static createRoot(services, name, only, loadedCode) {
61
+ const created = Entrypoint.create(services, null, name, only, loadedCode);
62
+ (0, _tsInvariant.invariant)(created !== 'loop', 'loop detected');
63
+ return created;
64
+ }
65
+
66
+ /**
67
+ * Creates an entrypoint for the specified file.
68
+ * If there is already an entrypoint for this file, there will be four possible outcomes:
69
+ * 1. If `loadedCode` is specified and is different from the one that was used to create the existing entrypoint,
70
+ * the existing entrypoint will be superseded by a new one and all cached results for it will be invalidated.
71
+ * It can happen if the file was changed and the watcher notified us about it, or we received a new version
72
+ * of the file from a loader whereas the previous one was loaded from the filesystem.
73
+ * The new entrypoint will be returned.
74
+ * 2. If `only` is subset of the existing entrypoint's `only`, the existing entrypoint will be returned.
75
+ * 3. If `only` is superset of the existing entrypoint's `only`, the existing entrypoint will be superseded and the new one will be returned.
76
+ * 4. If a loop is detected, 'ignored' will be returned, the existing entrypoint will be superseded or not depending on the `only` value.
77
+ */
78
+ static create(services, parent, name, only, loadedCode) {
79
+ const {
80
+ cache,
81
+ eventEmitter
82
+ } = services;
83
+ return eventEmitter.perf('createEntrypoint', () => {
84
+ const [status, entrypoint] = Entrypoint.innerCreate(services, parent ? {
85
+ evaluated: parent.evaluated,
86
+ log: parent.log,
87
+ name: parent.name,
88
+ parents: parent.parents,
89
+ seqId: parent.seqId
90
+ } : null, name, only, loadedCode);
91
+ if (status !== 'cached') {
92
+ cache.add('entrypoints', name, entrypoint);
93
+ }
94
+ return status === 'loop' ? 'loop' : entrypoint;
95
+ });
96
+ }
97
+ static innerCreate(services, parent, name, only, loadedCode) {
98
+ var _cached$evaluatedOnly;
99
+ const {
100
+ cache
101
+ } = services;
102
+ const cached = cache.get('entrypoints', name);
103
+ const changed = loadedCode !== undefined ? cache.invalidateIfChanged(name, loadedCode) : false;
104
+ if (!(cached !== null && cached !== void 0 && cached.evaluated) && cached !== null && cached !== void 0 && cached.ignored) {
105
+ return ['cached', cached];
106
+ }
107
+ const exports = cached === null || cached === void 0 ? void 0 : cached.exports;
108
+ const evaluatedOnly = (_cached$evaluatedOnly = cached === null || cached === void 0 ? void 0 : cached.evaluatedOnly) !== null && _cached$evaluatedOnly !== void 0 ? _cached$evaluatedOnly : [];
109
+ const mergedOnly = !changed && cached !== null && cached !== void 0 && cached.only ? (0, _Entrypoint.mergeOnly)(cached.only, only).filter(i => !evaluatedOnly.includes(i)) : only;
110
+ if (cached !== null && cached !== void 0 && cached.evaluated) {
111
+ cached.log('is already evaluated with', cached.evaluatedOnly);
112
+ }
113
+ if (!changed && cached && !cached.evaluated) {
114
+ const isLoop = parent && hasLoop(name, parent);
115
+ if (isLoop) {
116
+ parent.log('[createEntrypoint] %s is a loop', name);
117
+ }
118
+ if (parent && !cached.parents.map(p => p.name).includes(parent.name)) {
119
+ cached.parents.push(parent);
120
+ }
121
+ if ((0, _Entrypoint.isSuperSet)(cached.only, mergedOnly)) {
122
+ cached.log('is cached', name);
123
+ return [isLoop ? 'loop' : 'cached', cached];
124
+ }
125
+ cached.log('is cached, but with different `only` %o (the cached one %o)', only, cached === null || cached === void 0 ? void 0 : cached.only);
126
+ return [isLoop ? 'loop' : 'created', cached.supersede(mergedOnly)];
127
+ }
128
+ const newEntrypoint = new Entrypoint(services, parent ? [parent] : [], loadedCode, name, mergedOnly, exports, evaluatedOnly, undefined, cached && 'resolveTasks' in cached ? cached.resolveTasks : undefined, cached && 'dependencies' in cached ? cached.dependencies : undefined, cached ? cached.generation + 1 : 1);
129
+ if (cached && !cached.evaluated) {
130
+ cached.log('is cached, but with different code');
131
+ cached.supersede(newEntrypoint);
132
+ }
133
+ return ['created', newEntrypoint];
134
+ }
135
+ addDependency(dependency) {
136
+ this.resolveTasks.delete(dependency.source);
137
+ this.dependencies.set(dependency.source, dependency);
138
+ }
139
+ addResolveTask(name, dependency) {
140
+ this.resolveTasks.set(name, dependency);
141
+ }
142
+ assertNotSuperseded() {
143
+ if (this.supersededWith) {
144
+ this.log('superseded');
145
+ throw new _AbortError.AbortError('superseded');
146
+ }
147
+ }
148
+ assertTransformed() {
149
+ if (this.transformedCode === null) {
150
+ var _this$supersededWith3;
151
+ this.log('not transformed');
152
+ throw new _UnprocessedEntrypointError.UnprocessedEntrypointError((_this$supersededWith3 = this.supersededWith) !== null && _this$supersededWith3 !== void 0 ? _this$supersededWith3 : this);
153
+ }
154
+ }
155
+ createAction(actionType, data, abortSignal = null) {
156
+ var _cached$abortSignal;
157
+ if (!this.actionsCache.has(actionType)) {
158
+ this.actionsCache.set(actionType, new Map());
159
+ }
160
+ const cache = this.actionsCache.get(actionType);
161
+ const cached = cache.get(data);
162
+ if (cached && !((_cached$abortSignal = cached.abortSignal) !== null && _cached$abortSignal !== void 0 && _cached$abortSignal.aborted)) {
163
+ return cached;
164
+ }
165
+ const newAction = new _BaseAction.BaseAction(actionType, this.services, this, data, abortSignal);
166
+ cache.set(data, newAction);
167
+ this.services.eventEmitter.entrypointEvent(this.seqId, {
168
+ type: 'actionCreated',
169
+ actionType,
170
+ actionIdx: newAction.idx
171
+ });
172
+ return newAction;
173
+ }
174
+ createChild(name, only, loadedCode) {
175
+ return Entrypoint.create(this.services, this, name, only, loadedCode);
176
+ }
177
+ createEvaluated() {
178
+ const evaluatedOnly = (0, _Entrypoint.mergeOnly)(this.evaluatedOnly, this.only);
179
+ this.log('create EvaluatedEntrypoint for %o', evaluatedOnly);
180
+ return new _EvaluatedEntrypoint.EvaluatedEntrypoint(this.services, evaluatedOnly, this.exportsProxy, this.generation + 1, this.name, this.only, this.parents);
181
+ }
182
+ getDependency(name) {
183
+ return this.dependencies.get(name);
184
+ }
185
+ getResolveTask(name) {
186
+ return this.resolveTasks.get(name);
187
+ }
188
+ hasLinariaMetadata() {
189
+ return this.#hasLinariaMetadata;
190
+ }
191
+ onSupersede(callback) {
192
+ if (this.#supersededWith) {
193
+ callback(this.#supersededWith);
194
+ return () => {};
195
+ }
196
+ this.onSupersedeHandlers.push(callback);
197
+ return () => {
198
+ const index = this.onSupersedeHandlers.indexOf(callback);
199
+ if (index >= 0) {
200
+ this.onSupersedeHandlers.splice(index, 1);
201
+ }
202
+ };
203
+ }
204
+ setTransformResult(res) {
205
+ var _res$code;
206
+ this.#hasLinariaMetadata = Boolean(res === null || res === void 0 ? void 0 : res.metadata);
207
+ this.#transformResultCode = (_res$code = res === null || res === void 0 ? void 0 : res.code) !== null && _res$code !== void 0 ? _res$code : null;
208
+ this.services.eventEmitter.entrypointEvent(this.seqId, {
209
+ isNull: res === null,
210
+ type: 'setTransformResult'
211
+ });
212
+ }
213
+ supersede(newOnlyOrEntrypoint) {
214
+ const newEntrypoint = newOnlyOrEntrypoint instanceof Entrypoint ? newOnlyOrEntrypoint : new Entrypoint(this.services, this.parents, this.initialCode, this.name, newOnlyOrEntrypoint, this.exports, this.evaluatedOnly, this.loadedAndParsed, this.resolveTasks, this.dependencies, this.generation + 1);
215
+ this.services.eventEmitter.entrypointEvent(this.seqId, {
216
+ type: 'superseded',
217
+ with: newEntrypoint.seqId
218
+ });
219
+ this.log('superseded by %s (%o -> %o)', newEntrypoint.name, this.only, newEntrypoint.only);
220
+ this.#supersededWith = newEntrypoint;
221
+ this.onSupersedeHandlers.forEach(handler => handler(newEntrypoint));
222
+ return newEntrypoint;
223
+ }
224
+ }
225
+ exports.Entrypoint = Entrypoint;
226
+ //# sourceMappingURL=Entrypoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Entrypoint.js","names":["_tsInvariant","require","_BaseEntrypoint","_Entrypoint","_EvaluatedEntrypoint","_AbortError","_BaseAction","_UnprocessedEntrypointError","EMPTY_FILE","hasLoop","name","parent","processed","includes","p","parents","found","Entrypoint","BaseEntrypoint","evaluated","onSupersedeHandlers","actionsCache","Map","hasLinariaMetadata","supersededWith","transformResultCode","constructor","services","initialCode","only","exports","evaluatedOnly","loadedAndParsed","resolveTasks","dependencies","generation","_parents$0$log","_parents$","loadAndParseFn","log","code","undefined","cache","invalidateIfChanged","extend","originalCode","ignored","evaluator","_this$supersededWith$","_this$supersededWith","transformedCode","_ref","_this$transformResult","_this$supersededWith2","createRoot","loadedCode","created","create","invariant","eventEmitter","perf","status","entrypoint","innerCreate","seqId","add","_cached$evaluatedOnly","cached","get","changed","mergedOnly","mergeOnly","filter","i","isLoop","map","push","isSuperSet","supersede","newEntrypoint","addDependency","dependency","delete","source","set","addResolveTask","assertNotSuperseded","AbortError","assertTransformed","_this$supersededWith3","UnprocessedEntrypointError","createAction","actionType","data","abortSignal","_cached$abortSignal","has","aborted","newAction","BaseAction","entrypointEvent","type","actionIdx","idx","createChild","createEvaluated","EvaluatedEntrypoint","exportsProxy","getDependency","getResolveTask","onSupersede","callback","index","indexOf","splice","setTransformResult","res","_res$code","Boolean","metadata","isNull","newOnlyOrEntrypoint","with","forEach","handler"],"sources":["../../src/transform/Entrypoint.ts"],"sourcesContent":["import { invariant } from 'ts-invariant';\n\nimport type { ParentEntrypoint, ITransformFileResult } from '../types';\n\nimport { BaseEntrypoint } from './BaseEntrypoint';\nimport { isSuperSet, mergeOnly } from './Entrypoint.helpers';\nimport type {\n IEntrypointCode,\n IEntrypointDependency,\n IIgnoredEntrypoint,\n} from './Entrypoint.types';\nimport { EvaluatedEntrypoint } from './EvaluatedEntrypoint';\nimport { AbortError } from './actions/AbortError';\nimport type { ActionByType } from './actions/BaseAction';\nimport { BaseAction } from './actions/BaseAction';\nimport { UnprocessedEntrypointError } from './actions/UnprocessedEntrypointError';\nimport type { Services, ActionTypes, ActionQueueItem } from './types';\n\nconst EMPTY_FILE = '=== empty file ===';\n\nfunction hasLoop(\n name: string,\n parent: ParentEntrypoint,\n processed: string[] = []\n): boolean {\n if (parent.name === name || processed.includes(parent.name)) {\n return true;\n }\n\n for (const p of parent.parents) {\n const found = hasLoop(name, p, [...processed, parent.name]);\n if (found) {\n return found;\n }\n }\n\n return false;\n}\n\nexport class Entrypoint extends BaseEntrypoint {\n public readonly evaluated = false;\n\n public readonly loadedAndParsed: IEntrypointCode | IIgnoredEntrypoint;\n\n protected onSupersedeHandlers: Array<(newEntrypoint: Entrypoint) => void> =\n [];\n\n private actionsCache: Map<\n ActionTypes,\n Map<unknown, BaseAction<ActionQueueItem>>\n > = new Map();\n\n #hasLinariaMetadata: boolean = false;\n\n #supersededWith: Entrypoint | null = null;\n\n #transformResultCode: string | null = null;\n\n private constructor(\n services: Services,\n parents: ParentEntrypoint[],\n public readonly initialCode: string | undefined,\n name: string,\n only: string[],\n exports: Record<string | symbol, unknown> | undefined,\n evaluatedOnly: string[],\n loadedAndParsed?: IEntrypointCode | IIgnoredEntrypoint,\n protected readonly resolveTasks = new Map<\n string,\n Promise<IEntrypointDependency>\n >(),\n protected readonly dependencies = new Map<string, IEntrypointDependency>(),\n generation = 1\n ) {\n super(services, evaluatedOnly, exports, generation, name, only, parents);\n\n this.loadedAndParsed =\n loadedAndParsed ??\n services.loadAndParseFn(\n services,\n name,\n initialCode,\n parents[0]?.log ?? services.log\n );\n\n if (this.loadedAndParsed.code !== undefined) {\n services.cache.invalidateIfChanged(name, this.loadedAndParsed.code);\n }\n\n this.log.extend('source')(\n 'created %s (%o)\\n%s',\n name,\n only,\n this.originalCode || EMPTY_FILE\n );\n }\n\n public get ignored() {\n return this.loadedAndParsed.evaluator === 'ignored';\n }\n\n public get originalCode() {\n return this.loadedAndParsed.code;\n }\n\n public get supersededWith(): Entrypoint | null {\n return this.#supersededWith?.supersededWith ?? this.#supersededWith;\n }\n\n public get transformedCode(): string | null {\n return (\n this.#transformResultCode ?? this.supersededWith?.transformedCode ?? null\n );\n }\n\n public static createRoot(\n services: Services,\n name: string,\n only: string[],\n loadedCode: string | undefined\n ): Entrypoint {\n const created = Entrypoint.create(services, null, name, only, loadedCode);\n invariant(created !== 'loop', 'loop detected');\n\n return created;\n }\n\n /**\n * Creates an entrypoint for the specified file.\n * If there is already an entrypoint for this file, there will be four possible outcomes:\n * 1. If `loadedCode` is specified and is different from the one that was used to create the existing entrypoint,\n * the existing entrypoint will be superseded by a new one and all cached results for it will be invalidated.\n * It can happen if the file was changed and the watcher notified us about it, or we received a new version\n * of the file from a loader whereas the previous one was loaded from the filesystem.\n * The new entrypoint will be returned.\n * 2. If `only` is subset of the existing entrypoint's `only`, the existing entrypoint will be returned.\n * 3. If `only` is superset of the existing entrypoint's `only`, the existing entrypoint will be superseded and the new one will be returned.\n * 4. If a loop is detected, 'ignored' will be returned, the existing entrypoint will be superseded or not depending on the `only` value.\n */\n protected static create(\n services: Services,\n parent: ParentEntrypoint | null,\n name: string,\n only: string[],\n loadedCode: string | undefined\n ): Entrypoint | 'loop' {\n const { cache, eventEmitter } = services;\n return eventEmitter.perf('createEntrypoint', () => {\n const [status, entrypoint] = Entrypoint.innerCreate(\n services,\n parent\n ? {\n evaluated: parent.evaluated,\n log: parent.log,\n name: parent.name,\n parents: parent.parents,\n seqId: parent.seqId,\n }\n : null,\n name,\n only,\n loadedCode\n );\n\n if (status !== 'cached') {\n cache.add('entrypoints', name, entrypoint);\n }\n\n return status === 'loop' ? 'loop' : entrypoint;\n });\n }\n\n private static innerCreate(\n services: Services,\n parent: ParentEntrypoint | null,\n name: string,\n only: string[],\n loadedCode: string | undefined\n ): ['loop' | 'created' | 'cached', Entrypoint] {\n const { cache } = services;\n\n const cached = cache.get('entrypoints', name);\n const changed =\n loadedCode !== undefined\n ? cache.invalidateIfChanged(name, loadedCode)\n : false;\n\n if (!cached?.evaluated && cached?.ignored) {\n return ['cached', cached];\n }\n\n const exports = cached?.exports;\n const evaluatedOnly = cached?.evaluatedOnly ?? [];\n const mergedOnly =\n !changed && cached?.only\n ? mergeOnly(cached.only, only).filter((i) => !evaluatedOnly.includes(i))\n : only;\n\n if (cached?.evaluated) {\n cached.log('is already evaluated with', cached.evaluatedOnly);\n }\n\n if (!changed && cached && !cached.evaluated) {\n const isLoop = parent && hasLoop(name, parent);\n if (isLoop) {\n parent.log('[createEntrypoint] %s is a loop', name);\n }\n\n if (parent && !cached.parents.map((p) => p.name).includes(parent.name)) {\n cached.parents.push(parent);\n }\n\n if (isSuperSet(cached.only, mergedOnly)) {\n cached.log('is cached', name);\n return [isLoop ? 'loop' : 'cached', cached];\n }\n\n cached.log(\n 'is cached, but with different `only` %o (the cached one %o)',\n only,\n cached?.only\n );\n\n return [isLoop ? 'loop' : 'created', cached.supersede(mergedOnly)];\n }\n\n const newEntrypoint = new Entrypoint(\n services,\n parent ? [parent] : [],\n loadedCode,\n name,\n mergedOnly,\n exports,\n evaluatedOnly,\n undefined,\n cached && 'resolveTasks' in cached ? cached.resolveTasks : undefined,\n cached && 'dependencies' in cached ? cached.dependencies : undefined,\n cached ? cached.generation + 1 : 1\n );\n\n if (cached && !cached.evaluated) {\n cached.log('is cached, but with different code');\n cached.supersede(newEntrypoint);\n }\n\n return ['created', newEntrypoint];\n }\n\n public addDependency(dependency: IEntrypointDependency): void {\n this.resolveTasks.delete(dependency.source);\n this.dependencies.set(dependency.source, dependency);\n }\n\n public addResolveTask(\n name: string,\n dependency: Promise<IEntrypointDependency>\n ): void {\n this.resolveTasks.set(name, dependency);\n }\n\n public assertNotSuperseded() {\n if (this.supersededWith) {\n this.log('superseded');\n throw new AbortError('superseded');\n }\n }\n\n public assertTransformed() {\n if (this.transformedCode === null) {\n this.log('not transformed');\n throw new UnprocessedEntrypointError(this.supersededWith ?? this);\n }\n }\n\n public createAction<\n TType extends ActionTypes,\n TAction extends ActionByType<TType>,\n >(\n actionType: TType,\n data: TAction['data'],\n abortSignal: AbortSignal | null = null\n ): BaseAction<TAction> {\n if (!this.actionsCache.has(actionType)) {\n this.actionsCache.set(actionType, new Map());\n }\n\n const cache = this.actionsCache.get(actionType)!;\n const cached = cache.get(data);\n if (cached && !cached.abortSignal?.aborted) {\n return cached as BaseAction<TAction>;\n }\n\n const newAction = new BaseAction<TAction>(\n actionType as TAction['type'],\n this.services,\n this,\n data,\n abortSignal\n );\n\n cache.set(data, newAction);\n\n this.services.eventEmitter.entrypointEvent(this.seqId, {\n type: 'actionCreated',\n actionType,\n actionIdx: newAction.idx,\n });\n\n return newAction;\n }\n\n public createChild(\n name: string,\n only: string[],\n loadedCode?: string\n ): Entrypoint | 'loop' {\n return Entrypoint.create(this.services, this, name, only, loadedCode);\n }\n\n public createEvaluated() {\n const evaluatedOnly = mergeOnly(this.evaluatedOnly, this.only);\n this.log('create EvaluatedEntrypoint for %o', evaluatedOnly);\n\n return new EvaluatedEntrypoint(\n this.services,\n evaluatedOnly,\n this.exportsProxy,\n this.generation + 1,\n this.name,\n this.only,\n this.parents\n );\n }\n\n public getDependency(name: string): IEntrypointDependency | undefined {\n return this.dependencies.get(name);\n }\n\n public getResolveTask(\n name: string\n ): Promise<IEntrypointDependency> | undefined {\n return this.resolveTasks.get(name);\n }\n\n public hasLinariaMetadata() {\n return this.#hasLinariaMetadata;\n }\n\n public onSupersede(callback: (newEntrypoint: Entrypoint) => void) {\n if (this.#supersededWith) {\n callback(this.#supersededWith);\n return () => {};\n }\n\n this.onSupersedeHandlers.push(callback);\n\n return () => {\n const index = this.onSupersedeHandlers.indexOf(callback);\n if (index >= 0) {\n this.onSupersedeHandlers.splice(index, 1);\n }\n };\n }\n\n public setTransformResult(res: ITransformFileResult | null) {\n this.#hasLinariaMetadata = Boolean(res?.metadata);\n this.#transformResultCode = res?.code ?? null;\n\n this.services.eventEmitter.entrypointEvent(this.seqId, {\n isNull: res === null,\n type: 'setTransformResult',\n });\n }\n\n private supersede(newOnlyOrEntrypoint: string[] | Entrypoint): Entrypoint {\n const newEntrypoint =\n newOnlyOrEntrypoint instanceof Entrypoint\n ? newOnlyOrEntrypoint\n : new Entrypoint(\n this.services,\n this.parents,\n this.initialCode,\n this.name,\n newOnlyOrEntrypoint,\n this.exports,\n this.evaluatedOnly,\n this.loadedAndParsed,\n this.resolveTasks,\n this.dependencies,\n this.generation + 1\n );\n\n this.services.eventEmitter.entrypointEvent(this.seqId, {\n type: 'superseded',\n with: newEntrypoint.seqId,\n });\n this.log(\n 'superseded by %s (%o -> %o)',\n newEntrypoint.name,\n this.only,\n newEntrypoint.only\n );\n this.#supersededWith = newEntrypoint;\n this.onSupersedeHandlers.forEach((handler) => handler(newEntrypoint));\n\n return newEntrypoint;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAIA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAMA,IAAAG,oBAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAEA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,2BAAA,GAAAN,OAAA;AAGA,MAAMO,UAAU,GAAG,oBAAoB;AAEvC,SAASC,OAAOA,CACdC,IAAY,EACZC,MAAwB,EACxBC,SAAmB,GAAG,EAAE,EACf;EACT,IAAID,MAAM,CAACD,IAAI,KAAKA,IAAI,IAAIE,SAAS,CAACC,QAAQ,CAACF,MAAM,CAACD,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GACrCwG,mBAAmB,GACnB,IAAIxG,UAAU,CACZ,IAAI,CAACU,QAAQ,EACb,IAAI,CAACZ,OAAO,EACZ,IAAI,CAACa,WAAW,EAChB,IAAI,CAAClB,IAAI,EACT+G,mBAAmB,EACnB,IAAI,CAAC3F,OAAO,EACZ,IAAI,CAACC,aAAa,EAClB,IAAI,CAACC,eAAe,EACpB,IAAI,CAACC,YAAY,EACjB,IAAI,CAACC,YAAY,EACjB,IAAI,CAACC,UAAU,GAAG,CACpB,CAAC;IAEP,IAAI,CAACR,QAAQ,CAACgC,YAAY,CAACyC,eAAe,CAAC,IAAI,CAACpC,KAAK,EAAE;MACrDqC,IAAI,EAAE,YAAY;MAClBqB,IAAI,EAAE3C,aAAa,CAACf;IACtB,CAAC,CAAC;IACF,IAAI,CAACzB,GAAG,CACN,6BAA6B,EAC7BwC,aAAa,CAACrE,IAAI,EAClB,IAAI,CAACmB,IAAI,EACTkD,aAAa,CAAClD,IAChB,CAAC;IACD,IAAI,CAAC,CAACL,cAAc,GAAGuD,aAAa;IACpC,IAAI,CAAC3D,mBAAmB,CAACuG,OAAO,CAAEC,OAAO,IAAKA,OAAO,CAAC7C,aAAa,CAAC,CAAC;IAErE,OAAOA,aAAa;EACtB;AACF;AAACjD,OAAA,CAAAb,UAAA,GAAAA,UAAA"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=Entrypoint.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Entrypoint.types.js","names":[],"sources":["../../src/transform/Entrypoint.types.ts"],"sourcesContent":["import type { TransformOptions } from '@babel/core';\nimport type { File } from '@babel/types';\n\nimport type { Debugger, Evaluator } from '@wyw-in-js/shared';\n\nimport type { Services } from './types';\n\nexport interface IEntrypointCode {\n readonly ast: File;\n code: string;\n evalConfig: TransformOptions;\n evaluator: Evaluator;\n}\n\nexport interface IIgnoredEntrypoint {\n readonly ast?: File;\n readonly code?: string;\n evaluator: 'ignored';\n reason: 'extension' | 'rule';\n}\n\nexport interface IEntrypointDependency {\n only: string[];\n resolved: string | null;\n source: string;\n}\n\nexport type LoadAndParseFn = (\n services: Services,\n name: string,\n loadedCode: string | undefined,\n log: Debugger\n) => IEntrypointCode | IIgnoredEntrypoint;\n"],"mappings":""}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.EvaluatedEntrypoint = void 0;
7
+ var _BaseEntrypoint = require("./BaseEntrypoint");
8
+ class EvaluatedEntrypoint extends _BaseEntrypoint.BaseEntrypoint {
9
+ evaluated = true;
10
+ ignored = false;
11
+ }
12
+ exports.EvaluatedEntrypoint = EvaluatedEntrypoint;
13
+ //# sourceMappingURL=EvaluatedEntrypoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EvaluatedEntrypoint.js","names":["_BaseEntrypoint","require","EvaluatedEntrypoint","BaseEntrypoint","evaluated","ignored","exports"],"sources":["../../src/transform/EvaluatedEntrypoint.ts"],"sourcesContent":["import type { Debugger } from '@wyw-in-js/shared';\n\nimport { BaseEntrypoint } from './BaseEntrypoint';\n\nexport interface IEvaluatedEntrypoint {\n evaluated: true;\n evaluatedOnly: string[];\n exports: Record<string | symbol, unknown>;\n generation: number;\n ignored: false;\n log: Debugger;\n only: string[];\n}\n\nexport class EvaluatedEntrypoint\n extends BaseEntrypoint\n implements IEvaluatedEntrypoint\n{\n public readonly evaluated = true;\n\n public readonly ignored = false;\n}\n"],"mappings":";;;;;;AAEA,IAAAA,eAAA,GAAAC,OAAA;AAYO,MAAMC,mBAAmB,SACtBC,8BAAc,CAExB;EACkBC,SAAS,GAAG,IAAI;EAEhBC,OAAO,GAAG,KAAK;AACjC;AAACC,OAAA,CAAAJ,mBAAA,GAAAA,mBAAA"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isAborted = exports.AbortError = void 0;
7
+ class AbortError extends Error {
8
+ constructor(reason) {
9
+ super(reason);
10
+ this.name = 'AbortError';
11
+ }
12
+ }
13
+ exports.AbortError = AbortError;
14
+ const isAborted = value => value instanceof AbortError;
15
+ exports.isAborted = isAborted;
16
+ //# sourceMappingURL=AbortError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbortError.js","names":["AbortError","Error","constructor","reason","name","exports","isAborted","value"],"sources":["../../../src/transform/actions/AbortError.ts"],"sourcesContent":["export class AbortError extends Error {\n constructor(reason?: string) {\n super(reason);\n this.name = 'AbortError';\n }\n}\n\nexport const isAborted = (value: unknown): value is AbortError =>\n value instanceof AbortError;\n"],"mappings":";;;;;;AAAO,MAAMA,UAAU,SAASC,KAAK,CAAC;EACpCC,WAAWA,CAACC,MAAe,EAAE;IAC3B,KAAK,CAACA,MAAM,CAAC;IACb,IAAI,CAACC,IAAI,GAAG,YAAY;EAC1B;AACF;AAACC,OAAA,CAAAL,UAAA,GAAAA,UAAA;AAEM,MAAMM,SAAS,GAAIC,KAAc,IACtCA,KAAK,YAAYP,UAAU;AAACK,OAAA,CAAAC,SAAA,GAAAA,SAAA"}
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.BaseAction = void 0;
7
+ require("../../utils/dispose-polyfill");
8
+ var _types = require("../types");
9
+ /* eslint-disable no-plusplus */
10
+
11
+ let actionIdx = 0;
12
+ class BaseAction {
13
+ result = _types.Pending;
14
+ activeScenario = null;
15
+ activeScenarioNextResults = [];
16
+ constructor(type, services, entrypoint, data, abortSignal) {
17
+ this.type = type;
18
+ this.services = services;
19
+ this.entrypoint = entrypoint;
20
+ this.data = data;
21
+ this.abortSignal = abortSignal;
22
+ actionIdx += 1;
23
+ this.idx = actionIdx.toString(16).padStart(6, '0');
24
+ }
25
+ get log() {
26
+ return this.entrypoint.log.extend(this.ref);
27
+ }
28
+ get ref() {
29
+ return `${this.type}@${this.idx}`;
30
+ }
31
+ createAbortSignal() {
32
+ const abortController = new AbortController();
33
+ const unsubscribeFromParentAbort = this.onAbort(() => {
34
+ this.entrypoint.log('parent aborted');
35
+ abortController.abort();
36
+ });
37
+ const unsubscribeFromSupersede = this.entrypoint.onSupersede(() => {
38
+ this.entrypoint.log('entrypoint superseded, aborting processing');
39
+ abortController.abort();
40
+ });
41
+ const abortSignal = abortController.signal;
42
+ abortSignal[Symbol.dispose] = () => {
43
+ unsubscribeFromParentAbort();
44
+ unsubscribeFromSupersede();
45
+ };
46
+ return abortSignal;
47
+ }
48
+ *getNext(type, entrypoint, data, abortSignal = this.abortSignal) {
49
+ return yield [type, entrypoint, data, abortSignal];
50
+ }
51
+ onAbort(fn) {
52
+ var _this$abortSignal;
53
+ (_this$abortSignal = this.abortSignal) === null || _this$abortSignal === void 0 || _this$abortSignal.addEventListener('abort', fn);
54
+ return () => {
55
+ var _this$abortSignal2;
56
+ (_this$abortSignal2 = this.abortSignal) === null || _this$abortSignal2 === void 0 || _this$abortSignal2.removeEventListener('abort', fn);
57
+ };
58
+ }
59
+ run(handler) {
60
+ if (!this.activeScenario) {
61
+ this.activeScenario = handler.call(this);
62
+ this.activeScenarioNextResults = [];
63
+ }
64
+ let nextIdx = 0;
65
+ const throwFn = e => this.emitAction(nextIdx, () => this.activeScenario.throw(e));
66
+ const nextFn = arg => this.emitAction(nextIdx, () => this.activeScenario.next(arg));
67
+ const processNextResult = (result, onError) => {
68
+ if ('then' in result) {
69
+ result.then(r => {
70
+ if (r.done) {
71
+ this.result = r.value;
72
+ }
73
+ }, onError);
74
+ } else if (result.done) {
75
+ this.result = result.value;
76
+ }
77
+ this.activeScenarioNextResults.push(result);
78
+ };
79
+ const processError = e => {
80
+ if (this.activeScenarioNextResults.length > nextIdx) {
81
+ this.log('error was already handled in another branch, result idx is %d', nextIdx);
82
+ return;
83
+ }
84
+ this.log('error processing, result idx is %d', nextIdx);
85
+ try {
86
+ const nextResult = throwFn(e);
87
+ processNextResult(nextResult, processError);
88
+ } catch (errorInGenerator) {
89
+ const {
90
+ recover
91
+ } = handler;
92
+ if (recover) {
93
+ const nextResult = {
94
+ done: false,
95
+ value: recover(errorInGenerator, this)
96
+ };
97
+ processNextResult(nextResult, processError);
98
+ return;
99
+ }
100
+ this.activeScenarioError = errorInGenerator;
101
+ throw errorInGenerator;
102
+ }
103
+ };
104
+ const processNext = arg => {
105
+ if (this.activeScenarioNextResults.length > nextIdx) {
106
+ this.log('next was already handled in another branch, result idx is %d', nextIdx);
107
+ return;
108
+ }
109
+ this.log('next processing, result idx is %d', nextIdx);
110
+ try {
111
+ const nextResult = nextFn(arg);
112
+ processNextResult(nextResult, processError);
113
+ } catch (e) {
114
+ processError(e);
115
+ }
116
+ };
117
+ return {
118
+ next: arg => {
119
+ this.rethrowActiveScenarioError();
120
+ processNext(arg);
121
+ return this.activeScenarioNextResults[nextIdx++];
122
+ },
123
+ throw: e => {
124
+ this.rethrowActiveScenarioError();
125
+ processError(e);
126
+ return this.activeScenarioNextResults[nextIdx++];
127
+ }
128
+ };
129
+ }
130
+ emitAction(yieldIdx, fn) {
131
+ return this.services.eventEmitter.action(this.type, `${this.idx}:${yieldIdx + 1}`, this.entrypoint.ref, fn);
132
+ }
133
+ rethrowActiveScenarioError() {
134
+ if (!this.activeScenarioError) {
135
+ return;
136
+ }
137
+ this.log('scenario has an unhandled error from another branch, rethrow %o', this.activeScenarioError);
138
+
139
+ // eslint-disable-next-line @typescript-eslint/no-throw-literal
140
+ throw this.activeScenarioError;
141
+ }
142
+ }
143
+ exports.BaseAction = BaseAction;
144
+ //# sourceMappingURL=BaseAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseAction.js","names":["require","_types","actionIdx","BaseAction","result","Pending","activeScenario","activeScenarioNextResults","constructor","type","services","entrypoint","data","abortSignal","idx","toString","padStart","log","extend","ref","createAbortSignal","abortController","AbortController","unsubscribeFromParentAbort","onAbort","abort","unsubscribeFromSupersede","onSupersede","signal","Symbol","dispose","getNext","fn","_this$abortSignal","addEventListener","_this$abortSignal2","removeEventListener","run","handler","call","nextIdx","throwFn","e","emitAction","throw","nextFn","arg","next","processNextResult","onError","then","r","done","value","push","processError","length","nextResult","errorInGenerator","recover","activeScenarioError","processNext","rethrowActiveScenarioError","yieldIdx","eventEmitter","action","exports"],"sources":["../../../src/transform/actions/BaseAction.ts"],"sourcesContent":["/* eslint-disable no-plusplus */\nimport '../../utils/dispose-polyfill';\nimport type { Debugger } from '@wyw-in-js/shared';\n\nimport type { Entrypoint } from '../Entrypoint';\nimport type {\n ActionQueueItem,\n ActionTypes,\n AnyIteratorResult,\n AsyncScenarioForAction,\n Handler,\n IBaseAction,\n Services,\n SyncScenarioForAction,\n TypeOfResult,\n YieldResult,\n} from '../types';\nimport { Pending } from '../types';\n\nlet actionIdx = 0;\n\nexport type ActionByType<TType extends ActionTypes> = Extract<\n ActionQueueItem,\n {\n type: TType;\n }\n>;\n\ntype GetBase<TAction extends ActionQueueItem> = IBaseAction<\n TAction,\n TypeOfResult<TAction>,\n TAction['data']\n>;\n\nexport class BaseAction<TAction extends ActionQueueItem>\n implements GetBase<TAction>\n{\n public readonly idx: string;\n\n public result: TypeOfResult<TAction> | typeof Pending = Pending;\n\n private activeScenario:\n | SyncScenarioForAction<TAction>\n | AsyncScenarioForAction<TAction>\n | null = null;\n\n private activeScenarioError?: unknown;\n\n private activeScenarioNextResults: AnyIteratorResult<\n 'async' | 'sync',\n TypeOfResult<TAction>\n >[] = [];\n\n public constructor(\n public readonly type: TAction['type'],\n public readonly services: Services,\n public readonly entrypoint: Entrypoint,\n public readonly data: TAction['data'],\n public readonly abortSignal: AbortSignal | null\n ) {\n actionIdx += 1;\n this.idx = actionIdx.toString(16).padStart(6, '0');\n }\n\n public get log(): Debugger {\n return this.entrypoint.log.extend(this.ref);\n }\n\n public get ref() {\n return `${this.type}@${this.idx}`;\n }\n\n public createAbortSignal(): AbortSignal & Disposable {\n const abortController = new AbortController();\n\n const unsubscribeFromParentAbort = this.onAbort(() => {\n this.entrypoint.log('parent aborted');\n abortController.abort();\n });\n\n const unsubscribeFromSupersede = this.entrypoint.onSupersede(() => {\n this.entrypoint.log('entrypoint superseded, aborting processing');\n abortController.abort();\n });\n\n const abortSignal = abortController.signal as AbortSignal & Disposable;\n abortSignal[Symbol.dispose] = () => {\n unsubscribeFromParentAbort();\n unsubscribeFromSupersede();\n };\n\n return abortSignal;\n }\n\n public *getNext<\n TNextType extends ActionTypes,\n TNextAction extends ActionByType<TNextType> = ActionByType<TNextType>,\n >(\n type: TNextType,\n entrypoint: Entrypoint,\n data: TNextAction['data'],\n abortSignal: AbortSignal | null = this.abortSignal\n ): Generator<\n [TNextType, Entrypoint, TNextAction['data'], AbortSignal | null],\n TypeOfResult<TNextAction>,\n YieldResult\n > {\n return (yield [\n type,\n entrypoint,\n data,\n abortSignal,\n ]) as TypeOfResult<TNextAction>;\n }\n\n public onAbort(fn: () => void): () => void {\n this.abortSignal?.addEventListener('abort', fn);\n\n return () => {\n this.abortSignal?.removeEventListener('abort', fn);\n };\n }\n\n public run<\n TMode extends 'async' | 'sync',\n THandler extends Handler<TMode, TAction> = Handler<TMode, TAction>,\n >(handler: THandler) {\n type IterationResult = AnyIteratorResult<TMode, TypeOfResult<TAction>>;\n\n if (!this.activeScenario) {\n this.activeScenario = handler.call(this);\n this.activeScenarioNextResults = [];\n }\n\n let nextIdx = 0;\n\n const throwFn = (e: unknown) =>\n this.emitAction(nextIdx, () => this.activeScenario!.throw(e));\n\n const nextFn = (arg: YieldResult) =>\n this.emitAction(nextIdx, () => this.activeScenario!.next(arg));\n\n const processNextResult = (\n result: IterationResult,\n onError?: (e: unknown) => void\n ) => {\n if ('then' in result) {\n result.then((r) => {\n if (r.done) {\n this.result = r.value;\n }\n }, onError);\n } else if (result.done) {\n this.result = result.value;\n }\n\n this.activeScenarioNextResults.push(result);\n };\n\n const processError = (e: unknown) => {\n if (this.activeScenarioNextResults.length > nextIdx) {\n this.log(\n 'error was already handled in another branch, result idx is %d',\n nextIdx\n );\n return;\n }\n\n this.log('error processing, result idx is %d', nextIdx);\n\n try {\n const nextResult = throwFn(e);\n processNextResult(nextResult as IterationResult, processError);\n } catch (errorInGenerator) {\n const { recover } = handler;\n if (recover) {\n const nextResult = {\n done: false,\n value: recover(errorInGenerator, this),\n };\n\n processNextResult(nextResult as IterationResult, processError);\n return;\n }\n\n this.activeScenarioError = errorInGenerator;\n throw errorInGenerator;\n }\n };\n\n const processNext = (arg: YieldResult) => {\n if (this.activeScenarioNextResults.length > nextIdx) {\n this.log(\n 'next was already handled in another branch, result idx is %d',\n nextIdx\n );\n return;\n }\n\n this.log('next processing, result idx is %d', nextIdx);\n\n try {\n const nextResult = nextFn(arg);\n processNextResult(nextResult as IterationResult, processError);\n } catch (e) {\n processError(e);\n }\n };\n\n return {\n next: (arg: YieldResult): IterationResult => {\n this.rethrowActiveScenarioError();\n processNext(arg);\n return this.activeScenarioNextResults[nextIdx++] as IterationResult;\n },\n throw: (e: unknown): IterationResult => {\n this.rethrowActiveScenarioError();\n processError(e);\n return this.activeScenarioNextResults[nextIdx++] as IterationResult;\n },\n };\n }\n\n protected emitAction<TRes>(yieldIdx: number, fn: () => TRes) {\n return this.services.eventEmitter.action(\n this.type,\n `${this.idx}:${yieldIdx + 1}`,\n this.entrypoint.ref,\n fn\n );\n }\n\n private rethrowActiveScenarioError() {\n if (!this.activeScenarioError) {\n return;\n }\n\n this.log(\n 'scenario has an unhandled error from another branch, rethrow %o',\n this.activeScenarioError\n );\n\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\n throw this.activeScenarioError;\n }\n}\n"],"mappings":";;;;;;AACAA,OAAA;AAgBA,IAAAC,MAAA,GAAAD,OAAA;AAjBA;;AAmBA,IAAIE,SAAS,GAAG,CAAC;AAeV,MAAMC,UAAU,CAEvB;EAGSC,MAAM,GAA2CC,cAAO;EAEvDC,cAAc,GAGX,IAAI;EAIPC,yBAAyB,GAG3B,EAAE;EAEDC,WAAWA,CACAC,IAAqB,EACrBC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,CAAC;MAEtD,IAAI;QACF,MAAMiB,UAAU,GAAGZ,MAAM,CAACC,GAAG,CAAC;QAC9BE,iBAAiB,CAACS,UAAU,EAAqBF,YAAY,CAAC;MAChE,CAAC,CAAC,OAAOb,CAAC,EAAE;QACVa,YAAY,CAACb,CAAC,CAAC;MACjB;IACF,CAAC;IAED,OAAO;MACLK,IAAI,EAAGD,GAAgB,IAAsB;QAC3C,IAAI,CAACgB,0BAA0B,CAAC,CAAC;QACjCD,WAAW,CAACf,GAAG,CAAC;QAChB,OAAO,IAAI,CAACvC,yBAAyB,CAACiC,OAAO,EAAE,CAAC;MAClD,CAAC;MACDI,KAAK,EAAGF,CAAU,IAAsB;QACtC,IAAI,CAACoB,0BAA0B,CAAC,CAAC;QACjCP,YAAY,CAACb,CAAC,CAAC;QACf,OAAO,IAAI,CAACnC,yBAAyB,CAACiC,OAAO,EAAE,CAAC;MAClD;IACF,CAAC;EACH;EAEUG,UAAUA,CAAOoB,QAAgB,EAAE/B,EAAc,EAAE;IAC3D,OAAO,IAAI,CAACtB,QAAQ,CAACsD,YAAY,CAACC,MAAM,CACtC,IAAI,CAACxD,IAAI,EACR,GAAE,IAAI,CAACK,GAAI,IAAGiD,QAAQ,GAAG,CAAE,EAAC,EAC7B,IAAI,CAACpD,UAAU,CAACQ,GAAG,EACnBa,EACF,CAAC;EACH;EAEQ8B,0BAA0BA,CAAA,EAAG;IACnC,IAAI,CAAC,IAAI,CAACF,mBAAmB,EAAE;MAC7B;IACF;IAEA,IAAI,CAAC3C,GAAG,CACN,iEAAiE,EACjE,IAAI,CAAC2C,mBACP,CAAC;;IAED;IACA,MAAM,IAAI,CAACA,mBAAmB;EAChC;AACF;AAACM,OAAA,CAAA/D,UAAA,GAAAA,UAAA"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isUnprocessedEntrypointError = exports.UnprocessedEntrypointError = void 0;
7
+ class UnprocessedEntrypointError extends Error {
8
+ constructor(entrypoint) {
9
+ super(`Entrypoint ${entrypoint.idx} is not processed and can't be evaluated`);
10
+ this.entrypoint = entrypoint;
11
+ }
12
+ }
13
+ exports.UnprocessedEntrypointError = UnprocessedEntrypointError;
14
+ const isUnprocessedEntrypointError = value => value instanceof UnprocessedEntrypointError;
15
+ exports.isUnprocessedEntrypointError = isUnprocessedEntrypointError;
16
+ //# sourceMappingURL=UnprocessedEntrypointError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnprocessedEntrypointError.js","names":["UnprocessedEntrypointError","Error","constructor","entrypoint","idx","exports","isUnprocessedEntrypointError","value"],"sources":["../../../src/transform/actions/UnprocessedEntrypointError.ts"],"sourcesContent":["import type { Entrypoint } from '../Entrypoint';\n\nexport class UnprocessedEntrypointError extends Error {\n constructor(public entrypoint: Entrypoint) {\n super(\n `Entrypoint ${entrypoint.idx} is not processed and can't be evaluated`\n );\n }\n}\n\nexport const isUnprocessedEntrypointError = (\n value: unknown\n): value is UnprocessedEntrypointError =>\n value instanceof UnprocessedEntrypointError;\n"],"mappings":";;;;;;AAEO,MAAMA,0BAA0B,SAASC,KAAK,CAAC;EACpDC,WAAWA,CAAQC,UAAsB,EAAE;IACzC,KAAK,CACF,cAAaA,UAAU,CAACC,GAAI,0CAC/B,CAAC;IAAC,KAHeD,UAAsB,GAAtBA,UAAsB;EAIzC;AACF;AAACE,OAAA,CAAAL,0BAAA,GAAAA,0BAAA;AAEM,MAAMM,4BAA4B,GACvCC,KAAc,IAEdA,KAAK,YAAYP,0BAA0B;AAACK,OAAA,CAAAC,4BAAA,GAAAA,4BAAA"}
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.asyncActionRunner = asyncActionRunner;
7
+ exports.syncActionRunner = syncActionRunner;
8
+ var _types = require("../types");
9
+ var _AbortError = require("./AbortError");
10
+ /* eslint-disable no-await-in-loop */
11
+
12
+ function getHandler(action, actionHandlers) {
13
+ const handler = actionHandlers[action.type];
14
+ if (!handler) {
15
+ throw new Error(`No handler for action ${action.type}`);
16
+ }
17
+
18
+ // FIXME Handlers<TMode>[TAction['type']] is not assignable to Handler<TMode, TAction>
19
+ return handler;
20
+ }
21
+ const getActionRef = (type, entrypoint) => `${type}@${entrypoint.ref}`;
22
+ const ACTION_ERROR = Symbol('ACTION_ERROR');
23
+ const isActionError = e => Array.isArray(e) && e[0] === ACTION_ERROR;
24
+ async function asyncActionRunner(action, actionHandlers, stack = [getActionRef(action.type, action.entrypoint)]) {
25
+ if (action.result !== _types.Pending) {
26
+ action.log('result is cached');
27
+ return action.result;
28
+ }
29
+ const handler = getHandler(action, actionHandlers);
30
+ const generator = action.run(handler);
31
+ let actionResult;
32
+ // eslint-disable-next-line no-constant-condition
33
+ while (true) {
34
+ var _action$abortSignal;
35
+ if ((_action$abortSignal = action.abortSignal) !== null && _action$abortSignal !== void 0 && _action$abortSignal.aborted) {
36
+ action.log('action is aborted');
37
+ generator.throw(new _AbortError.AbortError(stack[0]));
38
+ }
39
+ const result = await (isActionError(actionResult) ? generator.throw(actionResult[1]) : generator.next(actionResult));
40
+ if (result.done) {
41
+ return result.value;
42
+ }
43
+ const [type, entrypoint, data, abortSignal] = result.value;
44
+ const nextAction = entrypoint.createAction(type, data, abortSignal);
45
+ try {
46
+ actionResult = await asyncActionRunner(nextAction, actionHandlers, [...stack, getActionRef(type, entrypoint)]);
47
+ } catch (e) {
48
+ nextAction.log('error', e);
49
+ actionResult = [ACTION_ERROR, e];
50
+ }
51
+ }
52
+ }
53
+ function syncActionRunner(action, actionHandlers, stack = [getActionRef(action.type, action.entrypoint)]) {
54
+ if (action.result !== _types.Pending) {
55
+ action.log('result is cached');
56
+ return action.result;
57
+ }
58
+ const handler = getHandler(action, actionHandlers);
59
+ const generator = action.run(handler);
60
+ let actionResult;
61
+ // eslint-disable-next-line no-constant-condition
62
+ while (true) {
63
+ var _action$abortSignal2;
64
+ if ((_action$abortSignal2 = action.abortSignal) !== null && _action$abortSignal2 !== void 0 && _action$abortSignal2.aborted) {
65
+ action.log('action is aborted');
66
+ generator.throw(new _AbortError.AbortError(stack[0]));
67
+ }
68
+ const result = isActionError(actionResult) ? generator.throw(actionResult[1]) : generator.next(actionResult);
69
+ if (result.done) {
70
+ return result.value;
71
+ }
72
+ const [type, entrypoint, data, abortSignal] = result.value;
73
+ const nextAction = entrypoint.createAction(type, data, abortSignal);
74
+ try {
75
+ actionResult = syncActionRunner(nextAction, actionHandlers, [...stack, getActionRef(type, entrypoint)]);
76
+ } catch (e) {
77
+ nextAction.log('error', e);
78
+ actionResult = [ACTION_ERROR, e];
79
+ }
80
+ }
81
+ }
82
+ //# sourceMappingURL=actionRunner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actionRunner.js","names":["_types","require","_AbortError","getHandler","action","actionHandlers","handler","type","Error","getActionRef","entrypoint","ref","ACTION_ERROR","Symbol","isActionError","e","Array","isArray","asyncActionRunner","stack","result","Pending","log","generator","run","actionResult","_action$abortSignal","abortSignal","aborted","throw","AbortError","next","done","value","data","nextAction","createAction","syncActionRunner","_action$abortSignal2"],"sources":["../../../src/transform/actions/actionRunner.ts"],"sourcesContent":["/* eslint-disable no-await-in-loop */\nimport type {\n ActionQueueItem,\n Handler,\n Handlers,\n TypeOfResult,\n} from '../types';\nimport { Pending } from '../types';\n\nimport { AbortError } from './AbortError';\nimport type { BaseAction } from './BaseAction';\n\nfunction getHandler<\n TMode extends 'async' | 'sync',\n TAction extends ActionQueueItem,\n>(\n action: BaseAction<TAction>,\n actionHandlers: Handlers<TMode>\n): Handler<TMode, TAction> {\n const handler = actionHandlers[action.type];\n if (!handler) {\n throw new Error(`No handler for action ${action.type}`);\n }\n\n // FIXME Handlers<TMode>[TAction['type']] is not assignable to Handler<TMode, TAction>\n return handler as unknown as Handler<TMode, TAction>;\n}\n\nconst getActionRef = (type: string, entrypoint: { ref: string }) =>\n `${type}@${entrypoint.ref}`;\n\nconst ACTION_ERROR = Symbol('ACTION_ERROR');\ntype ActionError = [marker: typeof ACTION_ERROR, err: unknown];\nconst isActionError = (e: unknown): e is ActionError =>\n Array.isArray(e) && e[0] === ACTION_ERROR;\n\nexport async function asyncActionRunner<TAction extends ActionQueueItem>(\n action: BaseAction<TAction>,\n actionHandlers: Handlers<'async' | 'sync'>,\n stack: string[] = [getActionRef(action.type, action.entrypoint)]\n): Promise<TypeOfResult<TAction>> {\n if (action.result !== Pending) {\n action.log('result is cached');\n return action.result as TypeOfResult<TAction>;\n }\n\n const handler = getHandler(action, actionHandlers);\n const generator = action.run<'async' | 'sync'>(handler);\n let actionResult: TypeOfResult<ActionQueueItem> | ActionError | undefined;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n if (action.abortSignal?.aborted) {\n action.log('action is aborted');\n generator.throw(new AbortError(stack[0]));\n }\n\n const result = await (isActionError(actionResult)\n ? generator.throw(actionResult[1])\n : generator.next(actionResult));\n if (result.done) {\n return result.value as TypeOfResult<TAction>;\n }\n\n const [type, entrypoint, data, abortSignal] = result.value;\n const nextAction = entrypoint.createAction(type, data, abortSignal);\n\n try {\n actionResult = await asyncActionRunner(nextAction, actionHandlers, [\n ...stack,\n getActionRef(type, entrypoint),\n ]);\n } catch (e) {\n nextAction.log('error', e);\n actionResult = [ACTION_ERROR, e];\n }\n }\n}\n\nexport function syncActionRunner<TAction extends ActionQueueItem>(\n action: BaseAction<TAction>,\n actionHandlers: Handlers<'sync'>,\n stack: string[] = [getActionRef(action.type, action.entrypoint)]\n): TypeOfResult<TAction> {\n if (action.result !== Pending) {\n action.log('result is cached');\n return action.result as TypeOfResult<TAction>;\n }\n\n const handler = getHandler(action, actionHandlers);\n const generator = action.run<'sync'>(handler);\n let actionResult: TypeOfResult<ActionQueueItem> | ActionError | undefined;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n if (action.abortSignal?.aborted) {\n action.log('action is aborted');\n generator.throw(new AbortError(stack[0]));\n }\n\n const result = isActionError(actionResult)\n ? generator.throw(actionResult[1])\n : generator.next(actionResult);\n if (result.done) {\n return result.value as TypeOfResult<TAction>;\n }\n\n const [type, entrypoint, data, abortSignal] = result.value;\n const nextAction = entrypoint.createAction(type, data, abortSignal);\n\n try {\n actionResult = syncActionRunner(nextAction, actionHandlers, [\n ...stack,\n getActionRef(type, entrypoint),\n ]);\n } catch (e) {\n nextAction.log('error', e);\n actionResult = [ACTION_ERROR, e];\n }\n }\n}\n"],"mappings":";;;;;;;AAOA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AATA;;AAYA,SAASE,UAAUA,CAIjBC,MAA2B,EAC3BC,cAA+B,EACN;EACzB,MAAMC,OAAO,GAAGD,cAAc,CAACD,MAAM,CAACG,IAAI,CAAC;EAC3C,IAAI,CAACD,OAAO,EAAE;IACZ,MAAM,IAAIE,KAAK,CAAE,yBAAwBJ,MAAM,CAACG,IAAK,EAAC,CAAC;EACzD;;EAEA;EACA,OAAOD,OAAO;AAChB;AAEA,MAAMG,YAAY,GAAGA,CAACF,IAAY,EAAEG,UAA2B,KAC5D,GAAEH,IAAK,IAAGG,UAAU,CAACC,GAAI,EAAC;AAE7B,MAAMC,YAAY,GAAGC,MAAM,CAAC,cAAc,CAAC;AAE3C,MAAMC,aAAa,GAAIC,CAAU,IAC/BC,KAAK,CAACC,OAAO,CAACF,CAAC,CAAC,IAAIA,CAAC,CAAC,CAAC,CAAC,KAAKH,YAAY;AAEpC,eAAeM,iBAAiBA,CACrCd,MAA2B,EAC3BC,cAA0C,EAC1Cc,KAAe,GAAG,CAACV,YAAY,CAACL,MAAM,CAACG,IAAI,EAAEH,MAAM,CAACM,UAAU,CAAC,CAAC,EAChC;EAChC,IAAIN,MAAM,CAACgB,MAAM,KAAKC,cAAO,EAAE;IAC7BjB,MAAM,CAACkB,GAAG,CAAC,kBAAkB,CAAC;IAC9B,OAAOlB,MAAM,CAACgB,MAAM;EACtB;EAEA,MAAMd,OAAO,GAAGH,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AEG,UAAU,CAAC,CAC/B,CAAC;IACJ,CAAC,CAAC,OAAOK,CAAC,EAAE;MACVoB,UAAU,CAACb,GAAG,CAAC,OAAO,EAAEP,CAAC,CAAC;MAC1BU,YAAY,GAAG,CAACb,YAAY,EAAEG,CAAC,CAAC;IAClC;EACF;AACF"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../src/transform/actions/types.ts"],"sourcesContent":["import type { BabelFileResult } from '@babel/core';\n\nimport type { Replacements, Rules } from '@wyw-in-js/shared';\n\nexport interface IExtracted {\n cssSourceMapText: string;\n cssText: string;\n replacements: Replacements;\n rules: Rules;\n}\n\nexport interface IWorkflowActionNonLinariaResult {\n code: string;\n sourceMap: BabelFileResult['map'];\n}\n\nexport interface IWorkflowActionLinariaResult\n extends IExtracted,\n IWorkflowActionNonLinariaResult {\n dependencies: string[];\n}\n"],"mappings":""}