@tramvai/cli 5.49.1 → 6.59.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 (656) hide show
  1. package/__migrations__/d2023-02-01b-tramvai-config-refactoring.js +78 -80
  2. package/__migrations__/d2025-04-11b-tramvai-config-remove-modern.js +13 -0
  3. package/bin/spawn.js +76 -4
  4. package/lib/api/analyze/index.d.ts +0 -1
  5. package/lib/api/analyze/index.d.ts.map +1 -1
  6. package/lib/api/analyze/index.js +2 -2
  7. package/lib/api/analyze/index.js.map +1 -1
  8. package/lib/api/build/application.d.ts.map +1 -1
  9. package/lib/api/build/application.js +2 -5
  10. package/lib/api/build/application.js.map +1 -1
  11. package/lib/api/build/child-app.d.ts.map +1 -1
  12. package/lib/api/build/child-app.js +1 -5
  13. package/lib/api/build/child-app.js.map +1 -1
  14. package/lib/api/build/index.d.ts +0 -2
  15. package/lib/api/build/index.d.ts.map +1 -1
  16. package/lib/api/build/index.js.map +1 -1
  17. package/lib/api/build/module.d.ts.map +1 -1
  18. package/lib/api/build/module.js +1 -3
  19. package/lib/api/build/module.js.map +1 -1
  20. package/lib/api/index.d.ts.map +1 -1
  21. package/lib/api/index.js +0 -4
  22. package/lib/api/index.js.map +1 -1
  23. package/lib/api/start/application.experimental.d.ts +7 -0
  24. package/lib/api/start/application.experimental.d.ts.map +1 -0
  25. package/lib/api/start/application.experimental.js +275 -0
  26. package/lib/api/start/application.experimental.js.map +1 -0
  27. package/lib/api/start/index.d.ts +1 -1
  28. package/lib/api/start/index.d.ts.map +1 -1
  29. package/lib/api/start/index.js +17 -6
  30. package/lib/api/start/index.js.map +1 -1
  31. package/lib/api/start/utils/banner.d.ts.map +1 -1
  32. package/lib/api/start/utils/banner.js +0 -1
  33. package/lib/api/start/utils/banner.js.map +1 -1
  34. package/lib/api/start/utils/tips/tips.d.ts.map +1 -1
  35. package/lib/api/start/utils/tips/tips.js +0 -8
  36. package/lib/api/start/utils/tips/tips.js.map +1 -1
  37. package/lib/builder/webpack/devServer/pool/process/pool.d.ts.map +1 -1
  38. package/lib/builder/webpack/devServer/pool/process/pool.js +0 -2
  39. package/lib/builder/webpack/devServer/pool/process/pool.js.map +1 -1
  40. package/lib/builder/webpack/devServer/server.d.ts.map +1 -1
  41. package/lib/builder/webpack/devServer/server.js +4 -0
  42. package/lib/builder/webpack/devServer/server.js.map +1 -1
  43. package/lib/builder/webpack/devServer/setup.d.ts.map +1 -1
  44. package/lib/builder/webpack/devServer/setup.js +3 -1
  45. package/lib/builder/webpack/devServer/setup.js.map +1 -1
  46. package/lib/builder/webpack/index.d.ts.map +1 -1
  47. package/lib/builder/webpack/index.js +3 -5
  48. package/lib/builder/webpack/index.js.map +1 -1
  49. package/lib/builder/webpack/providers/analyze/shared.d.ts.map +1 -1
  50. package/lib/builder/webpack/providers/analyze/shared.js +5 -9
  51. package/lib/builder/webpack/providers/analyze/shared.js.map +1 -1
  52. package/lib/builder/webpack/providers/build/client.d.ts.map +1 -1
  53. package/lib/builder/webpack/providers/build/client.js +0 -1
  54. package/lib/builder/webpack/providers/build/client.js.map +1 -1
  55. package/lib/builder/webpack/providers/build/clientShared.d.ts.map +1 -1
  56. package/lib/builder/webpack/providers/build/clientShared.js +4 -6
  57. package/lib/builder/webpack/providers/build/clientShared.js.map +1 -1
  58. package/lib/builder/webpack/providers/client.d.ts.map +1 -1
  59. package/lib/builder/webpack/providers/client.js +10 -22
  60. package/lib/builder/webpack/providers/client.js.map +1 -1
  61. package/lib/builder/webpack/providers/server.d.ts.map +1 -1
  62. package/lib/builder/webpack/providers/server.js +10 -9
  63. package/lib/builder/webpack/providers/server.js.map +1 -1
  64. package/lib/builder/webpack/providers/shared.d.ts.map +1 -1
  65. package/lib/builder/webpack/providers/shared.js +2 -8
  66. package/lib/builder/webpack/providers/shared.js.map +1 -1
  67. package/lib/builder/webpack/tokens.d.ts +4 -139
  68. package/lib/builder/webpack/tokens.d.ts.map +1 -1
  69. package/lib/builder/webpack/tokens.js +1 -4
  70. package/lib/builder/webpack/tokens.js.map +1 -1
  71. package/lib/builder/webpack/utils/copyStatsJsonFile.d.ts.map +1 -1
  72. package/lib/builder/webpack/utils/copyStatsJsonFile.js +0 -11
  73. package/lib/builder/webpack/utils/copyStatsJsonFile.js.map +1 -1
  74. package/lib/cli/CLI.d.ts +2 -2
  75. package/lib/cli/CLI.d.ts.map +1 -1
  76. package/lib/cli/CLI.js +2 -2
  77. package/lib/cli/CLI.js.map +1 -1
  78. package/lib/cli/bin-init.js +0 -2
  79. package/lib/cli/bin-init.js.map +1 -1
  80. package/lib/cli/index.d.ts.map +1 -1
  81. package/lib/cli/index.js +28 -18
  82. package/lib/cli/index.js.map +1 -1
  83. package/lib/cli/runCLI.d.ts +3 -0
  84. package/lib/cli/runCLI.d.ts.map +1 -1
  85. package/lib/cli/runCLI.js +18 -6
  86. package/lib/cli/runCLI.js.map +1 -1
  87. package/lib/commands/add/command.d.ts +1 -4
  88. package/lib/commands/add/command.d.ts.map +1 -1
  89. package/lib/commands/add/command.js +3 -2
  90. package/lib/commands/add/command.js.map +1 -1
  91. package/lib/commands/analyze/command.d.ts +1 -1
  92. package/lib/commands/analyze/command.d.ts.map +1 -1
  93. package/lib/commands/analyze/command.js +11 -13
  94. package/lib/commands/analyze/command.js.map +1 -1
  95. package/lib/commands/benchmark/command.d.ts +1 -1
  96. package/lib/commands/benchmark/command.d.ts.map +1 -1
  97. package/lib/commands/benchmark/command.js +8 -9
  98. package/lib/commands/benchmark/command.js.map +1 -1
  99. package/lib/commands/build/build.d.ts.map +1 -1
  100. package/lib/commands/build/build.js +1 -0
  101. package/lib/commands/build/build.js.map +1 -1
  102. package/lib/commands/build/command.d.ts +2 -2
  103. package/lib/commands/build/command.d.ts.map +1 -1
  104. package/lib/commands/build/command.js +53 -28
  105. package/lib/commands/build/command.js.map +1 -1
  106. package/lib/commands/createApp.d.ts.map +1 -1
  107. package/lib/commands/createApp.js +0 -1
  108. package/lib/commands/createApp.js.map +1 -1
  109. package/lib/commands/generate/command.d.ts +1 -1
  110. package/lib/commands/generate/command.d.ts.map +1 -1
  111. package/lib/commands/generate/command.js +3 -2
  112. package/lib/commands/generate/command.js.map +1 -1
  113. package/lib/commands/lint/command.d.ts +1 -1
  114. package/lib/commands/lint/command.d.ts.map +1 -1
  115. package/lib/commands/lint/command.js +3 -2
  116. package/lib/commands/lint/command.js.map +1 -1
  117. package/lib/commands/new/command.d.ts +0 -1
  118. package/lib/commands/new/command.d.ts.map +1 -1
  119. package/lib/commands/new/command.js +0 -1
  120. package/lib/commands/new/command.js.map +1 -1
  121. package/lib/commands/new/new.d.ts.map +1 -1
  122. package/lib/commands/new/new.js +28 -3
  123. package/lib/commands/new/new.js.map +1 -1
  124. package/lib/commands/new/steps/installDependencies.js +3 -3
  125. package/lib/commands/new/steps/installDependencies.js.map +1 -1
  126. package/lib/commands/start/command.d.ts +2 -2
  127. package/lib/commands/start/command.d.ts.map +1 -1
  128. package/lib/commands/start/command.js +57 -22
  129. package/lib/commands/start/command.js.map +1 -1
  130. package/lib/commands/start/start.d.ts +1 -1
  131. package/lib/commands/start/start.d.ts.map +1 -1
  132. package/lib/commands/start/start.js +2 -1
  133. package/lib/commands/start/start.js.map +1 -1
  134. package/lib/commands/start-prod/command.d.ts +1 -1
  135. package/lib/commands/start-prod/command.d.ts.map +1 -1
  136. package/lib/commands/start-prod/command.js +11 -13
  137. package/lib/commands/start-prod/command.js.map +1 -1
  138. package/lib/commands/static/application.d.ts.map +1 -1
  139. package/lib/commands/static/application.js +0 -1
  140. package/lib/commands/static/application.js.map +1 -1
  141. package/lib/commands/static/command.d.ts +1 -1
  142. package/lib/commands/static/command.d.ts.map +1 -1
  143. package/lib/commands/static/command.js +7 -3
  144. package/lib/commands/static/command.js.map +1 -1
  145. package/lib/commands/update/command.d.ts +7 -5
  146. package/lib/commands/update/command.d.ts.map +1 -1
  147. package/lib/commands/update/command.js +11 -3
  148. package/lib/commands/update/command.js.map +1 -1
  149. package/lib/commands/update/dependantLibs.d.ts +2 -1
  150. package/lib/commands/update/dependantLibs.d.ts.map +1 -1
  151. package/lib/commands/update/dependantLibs.js +17 -4
  152. package/lib/commands/update/dependantLibs.js.map +1 -1
  153. package/lib/commands/update/update.d.ts +2 -1
  154. package/lib/commands/update/update.d.ts.map +1 -1
  155. package/lib/commands/update/update.js +6 -6
  156. package/lib/commands/update/update.js.map +1 -1
  157. package/lib/commands/update/updatePackageJson.d.ts +1 -1
  158. package/lib/commands/update/updatePackageJson.d.ts.map +1 -1
  159. package/lib/commands/update/updatePackageJson.js +10 -14
  160. package/lib/commands/update/updatePackageJson.js.map +1 -1
  161. package/lib/config/configManager.d.ts +0 -1
  162. package/lib/config/configManager.d.ts.map +1 -1
  163. package/lib/config/configManager.js +2 -17
  164. package/lib/config/configManager.js.map +1 -1
  165. package/lib/config/validate.d.ts.map +1 -1
  166. package/lib/config/validate.js +8 -1
  167. package/lib/config/validate.js.map +1 -1
  168. package/lib/di/providers/index.d.ts +0 -1
  169. package/lib/di/providers/index.d.ts.map +1 -1
  170. package/lib/di/providers/index.js +0 -1
  171. package/lib/di/providers/index.js.map +1 -1
  172. package/lib/di/tokens/config.d.ts +2 -0
  173. package/lib/di/tokens/config.d.ts.map +1 -1
  174. package/lib/di/tokens/index.d.ts +0 -1
  175. package/lib/di/tokens/index.d.ts.map +1 -1
  176. package/lib/di/tokens/index.js +0 -1
  177. package/lib/di/tokens/index.js.map +1 -1
  178. package/lib/external/config.d.ts.map +1 -1
  179. package/lib/external/config.js.map +1 -1
  180. package/lib/library/babel/index.d.ts +3 -53
  181. package/lib/library/babel/index.d.ts.map +1 -1
  182. package/lib/library/babel/index.js +3 -139
  183. package/lib/library/babel/index.js.map +1 -1
  184. package/lib/library/swc/index.d.ts +3 -3
  185. package/lib/library/swc/index.d.ts.map +1 -1
  186. package/lib/library/swc/index.js +4 -114
  187. package/lib/library/swc/index.js.map +1 -1
  188. package/lib/library/typescript/index.d.ts +0 -23
  189. package/lib/library/typescript/index.d.ts.map +1 -1
  190. package/lib/library/typescript/index.js +1 -2
  191. package/lib/library/typescript/index.js.map +1 -1
  192. package/lib/library/webpack/application/client/common.d.ts.map +1 -1
  193. package/lib/library/webpack/application/client/common.js +45 -10
  194. package/lib/library/webpack/application/client/common.js.map +1 -1
  195. package/lib/library/webpack/application/client/dev.js +2 -2
  196. package/lib/library/webpack/application/client/dev.js.map +1 -1
  197. package/lib/library/webpack/application/client/prod.d.ts.map +1 -1
  198. package/lib/library/webpack/application/client/prod.js +1 -2
  199. package/lib/library/webpack/application/client/prod.js.map +1 -1
  200. package/lib/library/webpack/application/common.d.ts.map +1 -1
  201. package/lib/library/webpack/application/common.js +4 -5
  202. package/lib/library/webpack/application/common.js.map +1 -1
  203. package/lib/library/webpack/application/server/common.js +1 -1
  204. package/lib/library/webpack/application/server/common.js.map +1 -1
  205. package/lib/library/webpack/application/server/dev.js +1 -1
  206. package/lib/library/webpack/application/server/dev.js.map +1 -1
  207. package/lib/library/webpack/application/server/prod.js +1 -1
  208. package/lib/library/webpack/application/server/prod.js.map +1 -1
  209. package/lib/library/webpack/blocks/css.d.ts.map +1 -1
  210. package/lib/library/webpack/blocks/css.js +15 -11
  211. package/lib/library/webpack/blocks/css.js.map +1 -1
  212. package/lib/library/webpack/blocks/optimize.js +2 -2
  213. package/lib/library/webpack/blocks/optimize.js.map +1 -1
  214. package/lib/library/webpack/blocks/pwa/client.d.ts.map +1 -1
  215. package/lib/library/webpack/blocks/pwa/client.js +11 -63
  216. package/lib/library/webpack/blocks/pwa/client.js.map +1 -1
  217. package/lib/library/webpack/blocks/pwa/shared.d.ts.map +1 -1
  218. package/lib/library/webpack/blocks/pwa/shared.js +2 -3
  219. package/lib/library/webpack/blocks/pwa/shared.js.map +1 -1
  220. package/lib/library/webpack/blocks/resolve.d.ts.map +1 -1
  221. package/lib/library/webpack/blocks/resolve.js +3 -2
  222. package/lib/library/webpack/blocks/resolve.js.map +1 -1
  223. package/lib/library/webpack/blocks/serverInline.d.ts.map +1 -1
  224. package/lib/library/webpack/blocks/serverInline.js +1 -2
  225. package/lib/library/webpack/blocks/serverInline.js.map +1 -1
  226. package/lib/library/webpack/blocks/sourcemaps.d.ts +1 -1
  227. package/lib/library/webpack/blocks/sourcemaps.d.ts.map +1 -1
  228. package/lib/library/webpack/blocks/sourcemaps.js +4 -2
  229. package/lib/library/webpack/blocks/sourcemaps.js.map +1 -1
  230. package/lib/library/webpack/child-app/client/common.d.ts.map +1 -1
  231. package/lib/library/webpack/child-app/client/common.js +8 -3
  232. package/lib/library/webpack/child-app/client/common.js.map +1 -1
  233. package/lib/library/webpack/child-app/client/dev.d.ts.map +1 -1
  234. package/lib/library/webpack/child-app/client/dev.js +5 -1
  235. package/lib/library/webpack/child-app/client/dev.js.map +1 -1
  236. package/lib/library/webpack/child-app/client/prod.d.ts.map +1 -1
  237. package/lib/library/webpack/child-app/client/prod.js +4 -0
  238. package/lib/library/webpack/child-app/client/prod.js.map +1 -1
  239. package/lib/library/webpack/child-app/common.d.ts.map +1 -1
  240. package/lib/library/webpack/child-app/common.js +4 -9
  241. package/lib/library/webpack/child-app/common.js.map +1 -1
  242. package/lib/library/webpack/child-app/server/dev.d.ts.map +1 -1
  243. package/lib/library/webpack/child-app/server/dev.js +4 -0
  244. package/lib/library/webpack/child-app/server/dev.js.map +1 -1
  245. package/lib/library/webpack/child-app/server/prod.d.ts.map +1 -1
  246. package/lib/library/webpack/child-app/server/prod.js +4 -0
  247. package/lib/library/webpack/child-app/server/prod.js.map +1 -1
  248. package/lib/library/webpack/common/client/prod.js +1 -1
  249. package/lib/library/webpack/common/client/prod.js.map +1 -1
  250. package/lib/library/webpack/common/main.d.ts.map +1 -1
  251. package/lib/library/webpack/common/main.js +1 -2
  252. package/lib/library/webpack/common/main.js.map +1 -1
  253. package/lib/library/webpack/constants/stats.d.ts.map +1 -1
  254. package/lib/library/webpack/constants/stats.js +2 -0
  255. package/lib/library/webpack/constants/stats.js.map +1 -1
  256. package/lib/library/webpack/loaders/image-loader/getImageMiniatureURL.js +1 -1
  257. package/lib/library/webpack/loaders/image-loader/getImageMiniatureURL.js.map +1 -1
  258. package/lib/library/webpack/module/client/common.js +1 -1
  259. package/lib/library/webpack/module/client/common.js.map +1 -1
  260. package/lib/library/webpack/module/externals.js +1 -1
  261. package/lib/library/webpack/module/externals.js.map +1 -1
  262. package/lib/library/webpack/module/server/common.js +1 -1
  263. package/lib/library/webpack/module/server/common.js.map +1 -1
  264. package/lib/library/webpack/plugins/RuntimePathPlugin.d.ts.map +1 -1
  265. package/lib/library/webpack/plugins/RuntimePathPlugin.js +7 -3
  266. package/lib/library/webpack/plugins/RuntimePathPlugin.js.map +1 -1
  267. package/lib/library/webpack/utils/threadLoader.d.ts.map +1 -1
  268. package/lib/library/webpack/utils/threadLoader.js +20 -3
  269. package/lib/library/webpack/utils/threadLoader.js.map +1 -1
  270. package/lib/library/webpack/utils/transpiler.d.ts +0 -1
  271. package/lib/library/webpack/utils/transpiler.d.ts.map +1 -1
  272. package/lib/library/webpack/utils/transpiler.js +2 -6
  273. package/lib/library/webpack/utils/transpiler.js.map +1 -1
  274. package/lib/models/analytics/utils.d.ts +16 -0
  275. package/lib/models/analytics/utils.d.ts.map +1 -0
  276. package/lib/models/analytics/utils.js +88 -0
  277. package/lib/models/analytics/utils.js.map +1 -0
  278. package/lib/models/command.d.ts +1 -1
  279. package/lib/models/command.d.ts.map +1 -1
  280. package/lib/models/command.js +2 -8
  281. package/lib/models/command.js.map +1 -1
  282. package/lib/models/context.d.ts +4 -4
  283. package/lib/models/context.d.ts.map +1 -1
  284. package/lib/models/context.js +3 -2
  285. package/lib/models/context.js.map +1 -1
  286. package/lib/models/logger.js +1 -1
  287. package/lib/models/logger.js.map +1 -1
  288. package/lib/models/task.d.ts.map +1 -1
  289. package/lib/models/task.js +1 -7
  290. package/lib/models/task.js.map +1 -1
  291. package/lib/schema/autogeneratedSchema.json +161 -20
  292. package/lib/schema/topLevelSchema.d.ts +14 -0
  293. package/lib/schema/topLevelSchema.d.ts.map +1 -1
  294. package/lib/schema/topLevelSchema.js +14 -0
  295. package/lib/schema/topLevelSchema.js.map +1 -1
  296. package/lib/typings/build/Builder.d.ts +2 -6
  297. package/lib/typings/build/Builder.d.ts.map +1 -1
  298. package/lib/typings/configEntry/application.d.ts +11 -6
  299. package/lib/typings/configEntry/application.d.ts.map +1 -1
  300. package/lib/typings/configEntry/cli.d.ts +13 -0
  301. package/lib/typings/configEntry/cli.d.ts.map +1 -1
  302. package/lib/typings/projectType.d.ts +5 -0
  303. package/lib/typings/projectType.d.ts.map +1 -1
  304. package/lib/typings/public.d.ts +0 -1
  305. package/lib/typings/public.d.ts.map +1 -1
  306. package/lib/typings/public.js +0 -2
  307. package/lib/typings/public.js.map +1 -1
  308. package/lib/typings/target.d.ts +1 -1
  309. package/lib/typings/target.d.ts.map +1 -1
  310. package/lib/utils/commands/dependencies/findTramvaiVersion.d.ts +1 -1
  311. package/lib/utils/commands/dependencies/findTramvaiVersion.d.ts.map +1 -1
  312. package/lib/utils/commands/dependencies/findTramvaiVersion.js +4 -11
  313. package/lib/utils/commands/dependencies/findTramvaiVersion.js.map +1 -1
  314. package/lib/utils/commands/dependencies/getLatestPackageVersion.d.ts +1 -1
  315. package/lib/utils/commands/dependencies/getLatestPackageVersion.d.ts.map +1 -1
  316. package/lib/utils/commands/dependencies/getLatestPackageVersion.js +7 -3
  317. package/lib/utils/commands/dependencies/getLatestPackageVersion.js.map +1 -1
  318. package/lib/utils/cpu-profile.d.ts +3 -0
  319. package/lib/utils/cpu-profile.d.ts.map +1 -1
  320. package/lib/utils/cpu-profile.js +8 -4
  321. package/lib/utils/cpu-profile.js.map +1 -1
  322. package/lib/utils/safeRequire.d.ts +1 -1
  323. package/lib/utils/safeRequire.d.ts.map +1 -1
  324. package/lib/utils/safeRequire.js +13 -3
  325. package/lib/utils/safeRequire.js.map +1 -1
  326. package/package.json +26 -32
  327. package/schema.json +175 -20
  328. package/src/api/analyze/index.ts +2 -3
  329. package/src/api/benchmark/__integration__/__fixtures__/tramvai.json +3 -0
  330. package/src/api/build/__integration__/__fixtures__/tramvai.json +4 -2
  331. package/src/api/build/__integration__/build.test.ts +0 -1
  332. package/src/api/build/application.ts +2 -5
  333. package/src/api/build/child-app.ts +1 -5
  334. package/src/api/build/index.ts +0 -2
  335. package/src/api/build/module.ts +1 -3
  336. package/src/api/index.ts +1 -10
  337. package/src/api/start/__integration__/__fixtures__/app/server.tsx +1 -0
  338. package/src/api/start/__integration__/__fixtures__/package.json +0 -3
  339. package/src/api/start/__integration__/__fixtures__/tramvai.json +3 -0
  340. package/src/api/start/__integration__/start.test.ts +10 -1
  341. package/src/api/start/application.experimental.ts +305 -0
  342. package/src/api/start/index.ts +20 -5
  343. package/src/api/start/utils/banner.ts +0 -1
  344. package/src/api/start/utils/tips/tips.ts +0 -9
  345. package/src/builder/webpack/devServer/pool/process/pool.ts +0 -2
  346. package/src/builder/webpack/devServer/server.ts +5 -0
  347. package/src/builder/webpack/devServer/setup.ts +1 -0
  348. package/src/builder/webpack/index.ts +3 -5
  349. package/src/builder/webpack/providers/analyze/shared.ts +6 -10
  350. package/src/builder/webpack/providers/build/client.ts +0 -1
  351. package/src/builder/webpack/providers/build/clientShared.ts +5 -11
  352. package/src/builder/webpack/providers/client.ts +16 -29
  353. package/src/builder/webpack/providers/server.ts +15 -10
  354. package/src/builder/webpack/providers/shared.ts +2 -9
  355. package/src/builder/webpack/tokens.ts +0 -9
  356. package/src/builder/webpack/utils/copyStatsJsonFile.ts +0 -17
  357. package/src/cli/CLI.ts +6 -4
  358. package/src/cli/bin-init.ts +0 -2
  359. package/src/cli/index.ts +36 -18
  360. package/src/cli/runCLI.ts +26 -6
  361. package/src/commands/add/command.ts +3 -2
  362. package/src/commands/analyze/command.ts +12 -14
  363. package/src/commands/benchmark/command.ts +9 -10
  364. package/src/commands/build/build.ts +2 -0
  365. package/src/commands/build/command.ts +58 -29
  366. package/src/commands/createApp.ts +0 -2
  367. package/src/commands/generate/command.ts +3 -2
  368. package/src/commands/lint/command.ts +3 -2
  369. package/src/commands/new/command.ts +0 -2
  370. package/src/commands/new/new.ts +39 -7
  371. package/src/commands/new/steps/installDependencies.ts +3 -3
  372. package/src/commands/new/templates/packageManagerConfig/yarnPackageManagerConfig/_yarnrc.yml.hbs +9 -0
  373. package/src/commands/new/templates/shared/_gitignore.hbs +10 -0
  374. package/src/commands/new/templates/shared/_prettierrc.js.hbs +1 -1
  375. package/src/commands/new/templates/shared/package.json.hbs +5 -1
  376. package/src/commands/start/command.ts +62 -23
  377. package/src/commands/start/start.ts +7 -1
  378. package/src/commands/start-prod/command.ts +12 -14
  379. package/src/commands/static/application.ts +0 -1
  380. package/src/commands/static/command.ts +7 -3
  381. package/src/commands/update/command.ts +12 -3
  382. package/src/commands/update/dependantLibs.ts +23 -8
  383. package/src/commands/update/update.ts +7 -6
  384. package/src/commands/update/updatePackageJson.spec.ts +66 -3
  385. package/src/commands/update/updatePackageJson.ts +28 -16
  386. package/src/config/__integration__/__fixtures__/relative/src/index.ts +0 -0
  387. package/src/config/__integration__/__fixtures__/relative/src/polyfill.ts +0 -0
  388. package/src/config/__integration__/validate.test.ts +94 -0
  389. package/src/config/configManager.ts +2 -19
  390. package/src/config/validate.ts +8 -1
  391. package/src/di/providers/index.ts +0 -1
  392. package/src/di/tokens/index.ts +0 -1
  393. package/src/external/config.ts +1 -0
  394. package/src/library/babel/index.ts +3 -166
  395. package/src/library/swc/__integration__/__snapshots__/swc.build.test.ts.snap +61 -236
  396. package/src/library/swc/__integration__/__snapshots__/swc.start.test.ts.snap +19 -18
  397. package/src/library/swc/__integration__/swc.build.test.ts +1 -13
  398. package/src/library/swc/__integration__/swc.start.test.ts +4 -1
  399. package/src/library/swc/index.ts +3 -139
  400. package/src/library/typescript/index.ts +1 -3
  401. package/src/library/webpack/application/client/common.ts +71 -9
  402. package/src/library/webpack/application/client/dev.ts +2 -2
  403. package/src/library/webpack/application/client/prod.ts +1 -2
  404. package/src/library/webpack/application/common.ts +9 -5
  405. package/src/library/webpack/application/server/common.ts +1 -1
  406. package/src/library/webpack/application/server/dev.ts +1 -1
  407. package/src/library/webpack/application/server/prod.ts +1 -1
  408. package/src/library/webpack/blocks/css.ts +17 -11
  409. package/src/library/webpack/blocks/optimize.ts +2 -2
  410. package/src/library/webpack/blocks/pwa/client.ts +14 -70
  411. package/src/library/webpack/blocks/pwa/shared.ts +1 -3
  412. package/src/library/webpack/blocks/resolve.ts +3 -2
  413. package/src/library/webpack/blocks/serverInline.ts +1 -2
  414. package/src/library/webpack/blocks/sourcemaps.ts +4 -2
  415. package/src/library/webpack/child-app/client/common.ts +9 -3
  416. package/src/library/webpack/child-app/client/dev.ts +6 -1
  417. package/src/library/webpack/child-app/client/prod.ts +5 -0
  418. package/src/library/webpack/child-app/common.ts +8 -12
  419. package/src/library/webpack/child-app/server/dev.ts +5 -0
  420. package/src/library/webpack/child-app/server/prod.ts +5 -0
  421. package/src/library/webpack/common/client/prod.ts +1 -1
  422. package/src/library/webpack/common/main.ts +1 -5
  423. package/src/library/webpack/constants/stats.ts +2 -0
  424. package/src/library/webpack/loaders/image-loader/getImageMiniatureURL.ts +1 -1
  425. package/src/library/webpack/module/client/common.ts +1 -1
  426. package/src/library/webpack/module/externals.ts +1 -1
  427. package/src/library/webpack/module/server/common.ts +1 -1
  428. package/src/library/webpack/plugins/RuntimePathPlugin.ts +8 -3
  429. package/src/library/webpack/utils/threadLoader.ts +21 -0
  430. package/src/library/webpack/utils/transpiler.ts +3 -7
  431. package/src/models/analytics/utils.ts +126 -0
  432. package/src/models/command.ts +4 -12
  433. package/src/models/config.spec.ts +6 -2
  434. package/src/models/context.ts +4 -5
  435. package/src/models/logger.ts +1 -1
  436. package/src/models/task.ts +1 -7
  437. package/src/schema/autogeneratedSchema.json +161 -20
  438. package/src/schema/topLevelSchema.js +14 -0
  439. package/src/schema/tramvai.spec.ts +3 -1
  440. package/src/typings/build/Builder.ts +3 -8
  441. package/src/typings/configEntry/application.ts +16 -7
  442. package/src/typings/configEntry/cli.ts +14 -0
  443. package/src/typings/projectType.ts +5 -0
  444. package/src/typings/public.ts +0 -2
  445. package/src/typings/target.ts +1 -1
  446. package/src/utils/commands/dependencies/findTramvaiVersion.ts +5 -12
  447. package/src/utils/commands/dependencies/getLatestPackageVersion.ts +11 -3
  448. package/src/utils/cpu-profile.ts +14 -4
  449. package/src/utils/safeRequire.spec.ts +36 -0
  450. package/src/utils/safeRequire.ts +12 -3
  451. package/lib/builder/webpack/providers/build/clientModern.d.ts +0 -3
  452. package/lib/builder/webpack/providers/build/clientModern.d.ts.map +0 -1
  453. package/lib/builder/webpack/providers/build/clientModern.js +0 -60
  454. package/lib/builder/webpack/providers/build/clientModern.js.map +0 -1
  455. package/lib/di/providers/analytics.d.ts +0 -3
  456. package/lib/di/providers/analytics.d.ts.map +0 -1
  457. package/lib/di/providers/analytics.js +0 -20
  458. package/lib/di/providers/analytics.js.map +0 -1
  459. package/lib/di/tokens/analytics.d.ts +0 -14
  460. package/lib/di/tokens/analytics.d.ts.map +0 -1
  461. package/lib/di/tokens/analytics.js +0 -8
  462. package/lib/di/tokens/analytics.js.map +0 -1
  463. package/lib/library/babel/plugins/create-token-pure.d.ts +0 -7
  464. package/lib/library/babel/plugins/create-token-pure.d.ts.map +0 -1
  465. package/lib/library/babel/plugins/create-token-pure.js +0 -39
  466. package/lib/library/babel/plugins/create-token-pure.js.map +0 -1
  467. package/lib/library/babel/plugins/fill-action-name.d.ts +0 -3
  468. package/lib/library/babel/plugins/fill-action-name.d.ts.map +0 -1
  469. package/lib/library/babel/plugins/fill-action-name.js +0 -107
  470. package/lib/library/babel/plugins/fill-action-name.js.map +0 -1
  471. package/lib/library/babel/plugins/fill-declare-action-name.d.ts +0 -6
  472. package/lib/library/babel/plugins/fill-declare-action-name.d.ts.map +0 -1
  473. package/lib/library/babel/plugins/fill-declare-action-name.js +0 -94
  474. package/lib/library/babel/plugins/fill-declare-action-name.js.map +0 -1
  475. package/lib/library/babel/plugins/lazy-component/lazy-component.d.ts +0 -7
  476. package/lib/library/babel/plugins/lazy-component/lazy-component.d.ts.map +0 -1
  477. package/lib/library/babel/plugins/lazy-component/lazy-component.js +0 -75
  478. package/lib/library/babel/plugins/lazy-component/lazy-component.js.map +0 -1
  479. package/lib/library/babel/plugins/lazy-component/legacy-universal-replace.d.ts +0 -14
  480. package/lib/library/babel/plugins/lazy-component/legacy-universal-replace.d.ts.map +0 -1
  481. package/lib/library/babel/plugins/lazy-component/legacy-universal-replace.js +0 -53
  482. package/lib/library/babel/plugins/lazy-component/legacy-universal-replace.js.map +0 -1
  483. package/lib/library/babel/plugins/lazy-component/properties/chunkName.d.ts +0 -3
  484. package/lib/library/babel/plugins/lazy-component/properties/chunkName.d.ts.map +0 -1
  485. package/lib/library/babel/plugins/lazy-component/properties/chunkName.js +0 -133
  486. package/lib/library/babel/plugins/lazy-component/properties/chunkName.js.map +0 -1
  487. package/lib/library/babel/plugins/lazy-component/properties/importAsync.d.ts +0 -3
  488. package/lib/library/babel/plugins/lazy-component/properties/importAsync.d.ts.map +0 -1
  489. package/lib/library/babel/plugins/lazy-component/properties/importAsync.js +0 -11
  490. package/lib/library/babel/plugins/lazy-component/properties/importAsync.js.map +0 -1
  491. package/lib/library/babel/plugins/lazy-component/properties/isReady.d.ts +0 -3
  492. package/lib/library/babel/plugins/lazy-component/properties/isReady.d.ts.map +0 -1
  493. package/lib/library/babel/plugins/lazy-component/properties/isReady.js +0 -14
  494. package/lib/library/babel/plugins/lazy-component/properties/isReady.js.map +0 -1
  495. package/lib/library/babel/plugins/lazy-component/properties/requireAsync.d.ts +0 -3
  496. package/lib/library/babel/plugins/lazy-component/properties/requireAsync.d.ts.map +0 -1
  497. package/lib/library/babel/plugins/lazy-component/properties/requireAsync.js +0 -15
  498. package/lib/library/babel/plugins/lazy-component/properties/requireAsync.js.map +0 -1
  499. package/lib/library/babel/plugins/lazy-component/properties/requireSync.d.ts +0 -3
  500. package/lib/library/babel/plugins/lazy-component/properties/requireSync.d.ts.map +0 -1
  501. package/lib/library/babel/plugins/lazy-component/properties/requireSync.js +0 -16
  502. package/lib/library/babel/plugins/lazy-component/properties/requireSync.js.map +0 -1
  503. package/lib/library/babel/plugins/lazy-component/properties/resolve.d.ts +0 -3
  504. package/lib/library/babel/plugins/lazy-component/properties/resolve.d.ts.map +0 -1
  505. package/lib/library/babel/plugins/lazy-component/properties/resolve.js +0 -14
  506. package/lib/library/babel/plugins/lazy-component/properties/resolve.js.map +0 -1
  507. package/lib/library/babel/plugins/lazy-component/properties/types.d.ts +0 -14
  508. package/lib/library/babel/plugins/lazy-component/properties/types.d.ts.map +0 -1
  509. package/lib/library/babel/plugins/lazy-component/properties/types.js +0 -3
  510. package/lib/library/babel/plugins/lazy-component/properties/types.js.map +0 -1
  511. package/lib/library/babel/plugins/lazy-component/properties/utils/webpackComments.d.ts +0 -14
  512. package/lib/library/babel/plugins/lazy-component/properties/utils/webpackComments.d.ts.map +0 -1
  513. package/lib/library/babel/plugins/lazy-component/properties/utils/webpackComments.js +0 -57
  514. package/lib/library/babel/plugins/lazy-component/properties/utils/webpackComments.js.map +0 -1
  515. package/lib/library/babel/plugins/provider-stack.d.ts +0 -4
  516. package/lib/library/babel/plugins/provider-stack.d.ts.map +0 -1
  517. package/lib/library/babel/plugins/provider-stack.js +0 -63
  518. package/lib/library/babel/plugins/provider-stack.js.map +0 -1
  519. package/lib/library/babel/plugins/react-compiler.d.ts +0 -13
  520. package/lib/library/babel/plugins/react-compiler.d.ts.map +0 -1
  521. package/lib/library/babel/plugins/react-compiler.js +0 -27
  522. package/lib/library/babel/plugins/react-compiler.js.map +0 -1
  523. package/lib/library/babel/plugins/react-element-info-unique.d.ts +0 -26
  524. package/lib/library/babel/plugins/react-element-info-unique.d.ts.map +0 -1
  525. package/lib/library/babel/plugins/react-element-info-unique.js +0 -112
  526. package/lib/library/babel/plugins/react-element-info-unique.js.map +0 -1
  527. package/lib/library/babel/plugins/types.h.d.ts +0 -7
  528. package/lib/library/babel/plugins/types.h.d.ts.map +0 -1
  529. package/lib/library/babel/plugins/types.h.js +0 -3
  530. package/lib/library/babel/plugins/types.h.js.map +0 -1
  531. package/lib/library/webpack/plugins/AutoPublicPathPlugin.d.ts +0 -4
  532. package/lib/library/webpack/plugins/AutoPublicPathPlugin.d.ts.map +0 -1
  533. package/lib/library/webpack/plugins/AutoPublicPathPlugin.js +0 -23
  534. package/lib/library/webpack/plugins/AutoPublicPathPlugin.js.map +0 -1
  535. package/lib/library/webpack/plugins/ModuleFederationFixRange.d.ts +0 -24
  536. package/lib/library/webpack/plugins/ModuleFederationFixRange.d.ts.map +0 -1
  537. package/lib/library/webpack/plugins/ModuleFederationFixRange.js +0 -127
  538. package/lib/library/webpack/plugins/ModuleFederationFixRange.js.map +0 -1
  539. package/lib/library/webpack/plugins/ModuleFederationIgnoreEntries.d.ts +0 -15
  540. package/lib/library/webpack/plugins/ModuleFederationIgnoreEntries.d.ts.map +0 -1
  541. package/lib/library/webpack/plugins/ModuleFederationIgnoreEntries.js +0 -49
  542. package/lib/library/webpack/plugins/ModuleFederationIgnoreEntries.js.map +0 -1
  543. package/lib/library/webpack/plugins/PolyfillCondition.d.ts +0 -8
  544. package/lib/library/webpack/plugins/PolyfillCondition.d.ts.map +0 -1
  545. package/lib/library/webpack/plugins/PolyfillCondition.js +0 -46
  546. package/lib/library/webpack/plugins/PolyfillCondition.js.map +0 -1
  547. package/lib/library/webpack/plugins/PwaIconsPlugin.d.ts +0 -12
  548. package/lib/library/webpack/plugins/PwaIconsPlugin.d.ts.map +0 -1
  549. package/lib/library/webpack/plugins/PwaIconsPlugin.js +0 -78
  550. package/lib/library/webpack/plugins/PwaIconsPlugin.js.map +0 -1
  551. package/lib/library/webpack/plugins/WebManifestPlugin.d.ts +0 -13
  552. package/lib/library/webpack/plugins/WebManifestPlugin.d.ts.map +0 -1
  553. package/lib/library/webpack/plugins/WebManifestPlugin.js +0 -47
  554. package/lib/library/webpack/plugins/WebManifestPlugin.js.map +0 -1
  555. package/lib/library/webpack/utils/polyfills/const.d.ts +0 -3
  556. package/lib/library/webpack/utils/polyfills/const.d.ts.map +0 -1
  557. package/lib/library/webpack/utils/polyfills/const.js +0 -49
  558. package/lib/library/webpack/utils/polyfills/const.js.map +0 -1
  559. package/lib/library/webpack/utils/polyfills/polyfillCondition.d.ts +0 -8
  560. package/lib/library/webpack/utils/polyfills/polyfillCondition.d.ts.map +0 -1
  561. package/lib/library/webpack/utils/polyfills/polyfillCondition.js +0 -51
  562. package/lib/library/webpack/utils/polyfills/polyfillCondition.js.map +0 -1
  563. package/lib/library/webpack/utils/polyfills/specToFeature.d.ts +0 -7
  564. package/lib/library/webpack/utils/polyfills/specToFeature.d.ts.map +0 -1
  565. package/lib/library/webpack/utils/polyfills/specToFeature.js +0 -207
  566. package/lib/library/webpack/utils/polyfills/specToFeature.js.map +0 -1
  567. package/lib/models/analytics.d.ts +0 -31
  568. package/lib/models/analytics.d.ts.map +0 -1
  569. package/lib/models/analytics.js +0 -79
  570. package/lib/models/analytics.js.map +0 -1
  571. package/lib/typings/pwa/index.d.ts +0 -80
  572. package/lib/typings/pwa/index.d.ts.map +0 -1
  573. package/lib/typings/pwa/index.js +0 -3
  574. package/lib/typings/pwa/index.js.map +0 -1
  575. package/lib/utils/sentry.d.ts +0 -2
  576. package/lib/utils/sentry.d.ts.map +0 -1
  577. package/lib/utils/sentry.js +0 -27
  578. package/lib/utils/sentry.js.map +0 -1
  579. package/src/builder/webpack/providers/build/clientModern.ts +0 -64
  580. package/src/di/providers/analytics.ts +0 -22
  581. package/src/di/tokens/analytics.ts +0 -8
  582. package/src/library/babel/plugins/__fixtures__/create-token-pure/already-has-comment.ts +0 -5
  583. package/src/library/babel/plugins/__fixtures__/create-token-pure/do-nothing.ts +0 -10
  584. package/src/library/babel/plugins/__fixtures__/create-token-pure/from-core.ts +0 -5
  585. package/src/library/babel/plugins/__fixtures__/create-token-pure/from-dippy.ts +0 -5
  586. package/src/library/babel/plugins/__fixtures__/create-token-pure/many-imports.ts +0 -9
  587. package/src/library/babel/plugins/__fixtures__/fill-declare-action-name/import-mixed.ts +0 -17
  588. package/src/library/babel/plugins/__fixtures__/fill-declare-action-name/import-with-name.ts +0 -28
  589. package/src/library/babel/plugins/__fixtures__/fill-declare-action-name/import-without-name.ts +0 -25
  590. package/src/library/babel/plugins/__fixtures__/fill-declare-action-name/require-with-name.ts +0 -21
  591. package/src/library/babel/plugins/__fixtures__/fill-declare-action-name/require-without-name.ts +0 -19
  592. package/src/library/babel/plugins/__fixtures__/lazy-component/base.ts +0 -3
  593. package/src/library/babel/plugins/__fixtures__/lazy-component/cmp.tsx +0 -7
  594. package/src/library/babel/plugins/__fixtures__/lazy-component/comments.ts +0 -7
  595. package/src/library/babel/plugins/__fixtures__/lazy-component/dynamic.ts +0 -3
  596. package/src/library/babel/plugins/__fixtures__/lazy-component/inner/first.tsx +0 -7
  597. package/src/library/babel/plugins/__fixtures__/lazy-component/inner/path/cmp.tsx +0 -7
  598. package/src/library/babel/plugins/__fixtures__/lazy-component/inner/second.tsx +0 -7
  599. package/src/library/babel/plugins/__fixtures__/lazy-component/inner/third.tsx +0 -7
  600. package/src/library/babel/plugins/__fixtures__/lazy-component/lazy+hmr.ts +0 -3
  601. package/src/library/babel/plugins/__fixtures__/lazy-component/long-import.ts +0 -3
  602. package/src/library/babel/plugins/__fixtures__/lazy-component/not-lazy-import.ts +0 -7
  603. package/src/library/babel/plugins/__fixtures__/lazy-component/not-lazy.ts +0 -8
  604. package/src/library/babel/plugins/__fixtures__/legacy-universal-replace/cmp.tsx +0 -7
  605. package/src/library/babel/plugins/__fixtures__/legacy-universal-replace/not-universal.ts +0 -8
  606. package/src/library/babel/plugins/__fixtures__/legacy-universal-replace/platform-legacy.ts +0 -5
  607. package/src/library/babel/plugins/__fixtures__/legacy-universal-replace/react-universal.ts +0 -3
  608. package/src/library/babel/plugins/__fixtures__/legacy-universal-replace/tramvai/react/index.es.ts +0 -3
  609. package/src/library/babel/plugins/__fixtures__/provider-stack/add-stack.ts +0 -22
  610. package/src/library/babel/plugins/__fixtures__/provider-stack/check-function-name.ts +0 -10
  611. package/src/library/babel/plugins/__fixtures__/provider-stack/do-nothing.ts +0 -16
  612. package/src/library/babel/plugins/__fixtures__/provider-stack/error-in-scope.ts +0 -24
  613. package/src/library/babel/plugins/__fixtures__/provider-stack/inside-await.ts +0 -12
  614. package/src/library/babel/plugins/__fixtures__/provider-stack/module-decorator.ts +0 -27
  615. package/src/library/babel/plugins/__snapshots__/create-token-pure.spec.ts.snap +0 -108
  616. package/src/library/babel/plugins/__snapshots__/fill-declare-action-name.spec.ts.snap +0 -266
  617. package/src/library/babel/plugins/__snapshots__/provider-stack.spec.ts.snap +0 -381
  618. package/src/library/babel/plugins/create-token-pure.spec.ts +0 -39
  619. package/src/library/babel/plugins/create-token-pure.ts +0 -47
  620. package/src/library/babel/plugins/fill-action-name.ts +0 -126
  621. package/src/library/babel/plugins/fill-declare-action-name.spec.ts +0 -37
  622. package/src/library/babel/plugins/fill-declare-action-name.ts +0 -110
  623. package/src/library/babel/plugins/lazy-component/__snapshots__/lazy-component.spec.ts.snap +0 -313
  624. package/src/library/babel/plugins/lazy-component/__snapshots__/legacy-universal-replace.spec.ts.snap +0 -114
  625. package/src/library/babel/plugins/lazy-component/lazy-component.spec.ts +0 -47
  626. package/src/library/babel/plugins/lazy-component/lazy-component.ts +0 -91
  627. package/src/library/babel/plugins/lazy-component/legacy-universal-replace.spec.ts +0 -34
  628. package/src/library/babel/plugins/lazy-component/legacy-universal-replace.ts +0 -88
  629. package/src/library/babel/plugins/lazy-component/properties/chunkName.ts +0 -185
  630. package/src/library/babel/plugins/lazy-component/properties/importAsync.ts +0 -8
  631. package/src/library/babel/plugins/lazy-component/properties/isReady.ts +0 -19
  632. package/src/library/babel/plugins/lazy-component/properties/requireAsync.ts +0 -20
  633. package/src/library/babel/plugins/lazy-component/properties/requireSync.ts +0 -21
  634. package/src/library/babel/plugins/lazy-component/properties/resolve.ts +0 -21
  635. package/src/library/babel/plugins/lazy-component/properties/types.ts +0 -20
  636. package/src/library/babel/plugins/lazy-component/properties/utils/webpackComments.ts +0 -61
  637. package/src/library/babel/plugins/provider-stack.spec.ts +0 -55
  638. package/src/library/babel/plugins/provider-stack.ts +0 -88
  639. package/src/library/babel/plugins/react-compiler.ts +0 -39
  640. package/src/library/babel/plugins/react-element-info-unique.ts +0 -144
  641. package/src/library/babel/plugins/types.h.ts +0 -8
  642. package/src/library/webpack/plugins/AutoPublicPathPlugin.ts +0 -23
  643. package/src/library/webpack/plugins/ModuleFederationFixRange.ts +0 -181
  644. package/src/library/webpack/plugins/ModuleFederationIgnoreEntries.ts +0 -59
  645. package/src/library/webpack/plugins/PolyfillCondition.ts +0 -62
  646. package/src/library/webpack/plugins/PwaIconsPlugin.ts +0 -94
  647. package/src/library/webpack/plugins/WebManifestPlugin.ts +0 -62
  648. package/src/library/webpack/utils/polyfills/__integration__/__snapshots__/condition.test.ts.snap +0 -1348
  649. package/src/library/webpack/utils/polyfills/__integration__/condition.test.ts +0 -128
  650. package/src/library/webpack/utils/polyfills/const.ts +0 -46
  651. package/src/library/webpack/utils/polyfills/polyfillCondition.ts +0 -63
  652. package/src/library/webpack/utils/polyfills/specToFeature.ts +0 -243
  653. package/src/models/analytics.ts +0 -116
  654. package/src/typings/pwa/index.ts +0 -83
  655. package/src/utils/sentry.ts +0 -25
  656. /package/src/commands/new/templates/{shared → packageManagerConfig/defaultPackageManagerConfig}/_npmrc.hbs +0 -0
@@ -1,14 +0,0 @@
1
- export interface WebpackComments {
2
- webpackChunk?: string;
3
- [key: string]: string;
4
- }
5
- /**
6
- * Expect string with specific magic comments here - `webpackChunkName`.
7
- * Objects can be here - https://webpack.js.org/api/module-methods/#magic-comments:~:text=This%20is%20wrapped%20in%20a%20JavaScript%20object%20and%20executed%20using%20node%20VM
8
- * But vm.runInThisContext is slow, and we can cover only simple case here, while use this helper only in `chunkName.ts`
9
- *
10
- * @param str - example: ' webpackChunkName: "any_chunk_name" '
11
- */
12
- export declare const parseWebpackComments: (str: string) => WebpackComments;
13
- export declare const generateWebpackComments: (values: WebpackComments) => string;
14
- //# sourceMappingURL=webpackComments.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"webpackComments.d.ts","sourceRoot":"","sources":["../../../../../../../src/library/babel/plugins/lazy-component/properties/utils/webpackComments.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAID;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,QAAS,MAAM,KAAG,eAkClD,CAAC;AAEF,eAAO,MAAM,uBAAuB,WAAY,eAAe,WAU9D,CAAC"}
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateWebpackComments = exports.parseWebpackComments = void 0;
4
- const quotesRegex = /["']/g;
5
- /**
6
- * Expect string with specific magic comments here - `webpackChunkName`.
7
- * Objects can be here - https://webpack.js.org/api/module-methods/#magic-comments:~:text=This%20is%20wrapped%20in%20a%20JavaScript%20object%20and%20executed%20using%20node%20VM
8
- * But vm.runInThisContext is slow, and we can cover only simple case here, while use this helper only in `chunkName.ts`
9
- *
10
- * @param str - example: ' webpackChunkName: "any_chunk_name" '
11
- */
12
- const parseWebpackComments = (str) => {
13
- try {
14
- const rawValues = str.trim().split(',');
15
- const values = {};
16
- rawValues.forEach((comment) => {
17
- const [key, rawValue] = comment.trim().split(':');
18
- let value = rawValue.trim();
19
- switch (value) {
20
- case 'true': {
21
- value = true;
22
- break;
23
- }
24
- case 'false': {
25
- value = false;
26
- break;
27
- }
28
- case 'null': {
29
- value = null;
30
- break;
31
- }
32
- default: {
33
- value = value.replace(quotesRegex, '');
34
- }
35
- }
36
- values[key] = value;
37
- });
38
- return values;
39
- }
40
- catch (e) {
41
- throw Error(`compilation error while processing: /*${str}*/: ${e.message}`);
42
- }
43
- };
44
- exports.parseWebpackComments = parseWebpackComments;
45
- const generateWebpackComments = (values) => {
46
- try {
47
- const str = Object.keys(values)
48
- .map((key) => `${key}: ${JSON.stringify(values[key])}`)
49
- .join(', ');
50
- return ` ${str} `;
51
- }
52
- catch (e) {
53
- throw Error(`compilation error while processing: /*${values}*/: ${e.message}`);
54
- }
55
- };
56
- exports.generateWebpackComments = generateWebpackComments;
57
- //# sourceMappingURL=webpackComments.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"webpackComments.js","sourceRoot":"","sources":["../../../../../../../src/library/babel/plugins/lazy-component/properties/utils/webpackComments.ts"],"names":[],"mappings":";;;AAKA,MAAM,WAAW,GAAG,OAAO,CAAC;AAE5B;;;;;;GAMG;AACI,MAAM,oBAAoB,GAAG,CAAC,GAAW,EAAmB,EAAE;IACnE,IAAI;QACF,MAAM,SAAS,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACxC,MAAM,MAAM,GAAoB,EAAE,CAAC;QAEnC,SAAS,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC5B,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAClD,IAAI,KAAK,GAAQ,QAAQ,CAAC,IAAI,EAAE,CAAC;YAEjC,QAAQ,KAAK,EAAE;gBACb,KAAK,MAAM,CAAC,CAAC;oBACX,KAAK,GAAG,IAAI,CAAC;oBACb,MAAM;iBACP;gBACD,KAAK,OAAO,CAAC,CAAC;oBACZ,KAAK,GAAG,KAAK,CAAC;oBACd,MAAM;iBACP;gBACD,KAAK,MAAM,CAAC,CAAC;oBACX,KAAK,GAAG,IAAI,CAAC;oBACb,MAAM;iBACP;gBACD,OAAO,CAAC,CAAC;oBACP,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;iBACxC;aACF;YAED,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACtB,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;KACf;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,KAAK,CAAC,yCAAyC,GAAG,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;KAC7E;AACH,CAAC,CAAC;AAlCW,QAAA,oBAAoB,wBAkC/B;AAEK,MAAM,uBAAuB,GAAG,CAAC,MAAuB,EAAE,EAAE;IACjE,IAAI;QACF,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;aAC5B,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,KAAK,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;aACtD,IAAI,CAAC,IAAI,CAAC,CAAC;QAEd,OAAO,IAAI,GAAG,GAAG,CAAC;KACnB;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,KAAK,CAAC,yCAAyC,MAAM,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;KAChF;AACH,CAAC,CAAC;AAVW,QAAA,uBAAuB,2BAUlC"}
@@ -1,4 +0,0 @@
1
- import type { Plugin } from './types.h';
2
- export declare const providerStackPlugin: Plugin;
3
- export default providerStackPlugin;
4
- //# sourceMappingURL=provider-stack.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider-stack.d.ts","sourceRoot":"","sources":["../../../../src/library/babel/plugins/provider-stack.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAIxC,eAAO,MAAM,mBAAmB,EAAE,MA+EjC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -1,63 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.providerStackPlugin = void 0;
4
- const INNER_COMMENT = '__tramvai_stack_provider__';
5
- const providerStackPlugin = ({ types: t }) => {
6
- const isProvider = (path) => {
7
- const { properties } = path.node;
8
- let hasProvideKey = false;
9
- let hasUseKey = false;
10
- for (const prop of properties) {
11
- if (t.isObjectProperty(prop)) {
12
- const { key } = prop;
13
- if (t.isIdentifier(key, { name: 'useValue' }) ||
14
- t.isIdentifier(key, { name: 'useFactory' }) ||
15
- t.isIdentifier(key, { name: 'useClass' })) {
16
- hasUseKey = true;
17
- }
18
- if (t.isIdentifier(key, { name: 'provide' })) {
19
- hasProvideKey = true;
20
- }
21
- if (hasProvideKey && hasUseKey) {
22
- return true;
23
- }
24
- }
25
- }
26
- return false;
27
- };
28
- const generateStack = (path) => {
29
- if (path.scope.hasBinding('Error', true)) {
30
- path.scope.rename('Error');
31
- }
32
- return t.memberExpression(t.newExpression(t.identifier('Error'), []), t.identifier('stack'));
33
- };
34
- const defineProperty = (id, value) => {
35
- return t.callExpression(t.memberExpression(t.identifier('Object'), t.identifier('defineProperty')), [
36
- id,
37
- t.stringLiteral('__stack'),
38
- t.objectExpression([
39
- t.objectProperty(t.identifier('enumerable'), t.booleanLiteral(false)),
40
- t.objectProperty(t.identifier('value'), value),
41
- ]),
42
- ]);
43
- };
44
- return {
45
- visitor: {
46
- ObjectExpression(path) {
47
- if (isProvider(path) &&
48
- !path.node.leadingComments?.find((comment) => comment.value === INNER_COMMENT)) {
49
- const ref = path.scope.generateDeclaredUidIdentifier('ref');
50
- const newNode = t.addComment(t.objectExpression(path.node.properties), 'leading', INNER_COMMENT);
51
- path.replaceWith(t.sequenceExpression([
52
- t.assignmentExpression('=', ref, newNode),
53
- defineProperty(ref, generateStack(path)),
54
- ref,
55
- ]));
56
- }
57
- },
58
- },
59
- };
60
- };
61
- exports.providerStackPlugin = providerStackPlugin;
62
- exports.default = exports.providerStackPlugin;
63
- //# sourceMappingURL=provider-stack.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"provider-stack.js","sourceRoot":"","sources":["../../../../src/library/babel/plugins/provider-stack.ts"],"names":[],"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AoB,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC;wBACzC,cAAc,CAAC,GAAG,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;wBACxC,GAAG;qBACJ,CAAC,CACH,CAAC;iBACH;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC,CAAC;AA/EW,QAAA,mBAAmB,uBA+E9B;AAEF,kBAAe,2BAAmB,CAAC"}
@@ -1,13 +0,0 @@
1
- import type { ReactCompilerOptions } from '../../../typings/configEntry/cli';
2
- type ReactCompilerTarget = '17' | '18' | '19';
3
- export declare const getReactCompilerPlugin: ({ options, isServer, }: {
4
- options: boolean | ReactCompilerOptions;
5
- isServer: boolean;
6
- }) => (string | {
7
- target: ReactCompilerTarget;
8
- sources?: string[];
9
- compilationMode?: "infer" | "annotation" | "all";
10
- panicThreshold?: "ALL_ERRORS" | "CRITICAL_ERRORS" | "NONE";
11
- })[];
12
- export {};
13
- //# sourceMappingURL=react-compiler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-compiler.d.ts","sourceRoot":"","sources":["../../../../src/library/babel/plugins/react-compiler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAE7E,KAAK,mBAAmB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAe9C,eAAO,MAAM,sBAAsB;aAIxB,OAAO,GAAG,oBAAoB;cAC7B,OAAO;;;;;;IAelB,CAAC"}
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getReactCompilerPlugin = void 0;
4
- const resolveReactVersion_1 = require("../../../utils/resolveReactVersion");
5
- const resolveTarget = () => {
6
- const resolved = (0, resolveReactVersion_1.resolveReactVersion)();
7
- const major = resolved.major.toString();
8
- if (['17', '18', '19'].includes(major)) {
9
- return major;
10
- }
11
- throw new Error(`Resolved React version is ${resolved.version} which is not supported. Supported versions are 17, 18 and 19.`);
12
- };
13
- const getReactCompilerPlugin = ({ options, isServer, }) => {
14
- if (!options || isServer) {
15
- return undefined;
16
- }
17
- const compilerOptions = typeof options === 'boolean' ? {} : options;
18
- return [
19
- 'babel-plugin-react-compiler',
20
- {
21
- ...compilerOptions,
22
- target: resolveTarget(),
23
- },
24
- ];
25
- };
26
- exports.getReactCompilerPlugin = getReactCompilerPlugin;
27
- //# sourceMappingURL=react-compiler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-compiler.js","sourceRoot":"","sources":["../../../../src/library/babel/plugins/react-compiler.ts"],"names":[],"mappings":";;;AAAA,4EAAyE;AAKzE,MAAM,aAAa,GAAG,GAAwB,EAAE;IAC9C,MAAM,QAAQ,GAAG,IAAA,yCAAmB,GAAE,CAAC;IACvC,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAyB,CAAC;IAE/D,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QACtC,OAAO,KAAK,CAAC;KACd;IAED,MAAM,IAAI,KAAK,CACb,6BAA6B,QAAQ,CAAC,OAAO,gEAAgE,CAC9G,CAAC;AACJ,CAAC,CAAC;AAEK,MAAM,sBAAsB,GAAG,CAAC,EACrC,OAAO,EACP,QAAQ,GAIT,EAAE,EAAE;IACH,IAAI,CAAC,OAAO,IAAI,QAAQ,EAAE;QACxB,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,eAAe,GAAG,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;IAEpE,OAAO;QACL,6BAA6B;QAC7B;YACE,GAAG,eAAe;YAClB,MAAM,EAAE,aAAa,EAAE;SACxB;KACF,CAAC;AACJ,CAAC,CAAC;AApBW,QAAA,sBAAsB,0BAoBjC"}
@@ -1,26 +0,0 @@
1
- declare const fs: any;
2
- declare const os: any;
3
- declare const path: any;
4
- declare const tmpFilePath: any;
5
- declare const FRAGMENT = "Fragment";
6
- declare let filesChanged: {
7
- name: string;
8
- files: string[];
9
- };
10
- declare function attrName(attr: any): any;
11
- declare function attrValue(attr: any): any;
12
- declare function isEqualAttr(attr1: any, attr2: any): boolean;
13
- declare function isOpeningElementFragment(element: any): boolean;
14
- declare function isCallExpressionFragment(nodeArguments: any): boolean;
15
- declare const getBaseName: (filename: any) => any;
16
- /** @deprecated */
17
- declare function babelPluginReactElementInfo({ types: t }: {
18
- types: any;
19
- }): {
20
- visitor: {
21
- Program(nodePath: any, state: any): void;
22
- JSXOpeningElement(nodePath: any, state: any): void;
23
- CallExpression(nodePath: any, state: any): void;
24
- };
25
- };
26
- //# sourceMappingURL=react-element-info-unique.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-element-info-unique.d.ts","sourceRoot":"","sources":["../../../../src/library/babel/plugins/react-element-info-unique.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,EAAE,KAAgB,CAAC;AACzB,QAAA,MAAM,EAAE,KAAgB,CAAC;AACzB,QAAA,MAAM,IAAI,KAAkB,CAAC;AAE7B,QAAA,MAAM,WAAW,KAAiD,CAAC;AACnE,QAAA,MAAM,QAAQ,aAAa,CAAC;AAC5B,QAAA,IAAI,YAAY,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAapD,iBAAS,QAAQ,CAAC,IAAI,KAAA,OAErB;AAED,iBAAS,SAAS,CAAC,IAAI,KAAA,OAEtB;AAED,iBAAS,WAAW,CAAC,KAAK,KAAA,EAAE,KAAK,KAAA,WAKhC;AAID,iBAAS,wBAAwB,CAAC,OAAO,KAAA,WASxC;AAED,iBAAS,wBAAwB,CAAC,aAAa,KAAA,WAS9C;AAED,QAAA,MAAM,WAAW,wBAEhB,CAAC;AAEF,kBAAkB;AAClB,iBAAS,2BAA2B,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;;CAAA;;;;;;EA8EhD"}
@@ -1,112 +0,0 @@
1
- const fs = require('fs');
2
- const os = require('os');
3
- const path = require('path');
4
- const tmpFilePath = path.resolve(os.tmpdir(), 'changedFiles.json');
5
- const FRAGMENT = 'Fragment';
6
- let filesChanged;
7
- try {
8
- if (process.env.ADD_VERSION_ATTRIBUTE_FOR_JSX) {
9
- filesChanged = JSON.parse(process.env.ADD_VERSION_ATTRIBUTE_FOR_JSX);
10
- }
11
- if (fs.existsSync(tmpFilePath)) {
12
- filesChanged = JSON.parse(fs.readFileSync(tmpFilePath, 'utf8'));
13
- }
14
- }
15
- catch (e) {
16
- filesChanged = null;
17
- }
18
- function attrName(attr) {
19
- return attr.name && attr.name.name;
20
- }
21
- function attrValue(attr) {
22
- return attr.value && attr.value.value;
23
- }
24
- function isEqualAttr(attr1, attr2) {
25
- if (!attr1 || !attr2) {
26
- return false;
27
- }
28
- return attrName(attr1) === attrName(attr2) && attrValue(attr1) === attrValue(attr2);
29
- }
30
- // Не будем проставлять data-qa-атрибуты в случае использования React.Fragment
31
- // На данный момент поддерживаются 2 вида синтаксисов: <Fragment> и <React.Fragment>
32
- function isOpeningElementFragment(element) {
33
- if (!element.name) {
34
- return false;
35
- }
36
- return ((element.name.property && element.name.property.name === FRAGMENT) ||
37
- element.name.name === FRAGMENT);
38
- }
39
- function isCallExpressionFragment(nodeArguments) {
40
- if (!nodeArguments[0]) {
41
- return false;
42
- }
43
- return ((nodeArguments[0].property && nodeArguments[0].property.name === FRAGMENT) ||
44
- nodeArguments[0].name === FRAGMENT);
45
- }
46
- const getBaseName = (filename) => {
47
- return path.basename(filename, path.extname(filename));
48
- };
49
- /** @deprecated */
50
- function babelPluginReactElementInfo({ types: t }) {
51
- const defaultPrefix = 'data-qa';
52
- let prefix;
53
- let filenameAttr;
54
- let changedVersionAttr;
55
- const visitor = {
56
- Program(nodePath, state) {
57
- if (state.opts.prefix) {
58
- prefix = `data-${state.opts.prefix}`;
59
- }
60
- else {
61
- prefix = defaultPrefix;
62
- }
63
- changedVersionAttr = `${prefix}-changed-version`;
64
- filenameAttr = `${prefix}-file`;
65
- },
66
- JSXOpeningElement(nodePath, state) {
67
- const { openingElement } = nodePath.container;
68
- const { attributes } = openingElement;
69
- const newAttributes = [];
70
- const isFragment = isOpeningElementFragment(openingElement);
71
- if (!isFragment &&
72
- filesChanged &&
73
- state.file &&
74
- state.file.opts &&
75
- state.file.opts.sourceFileName &&
76
- filesChanged.files.includes(state.file.opts.sourceFileName)) {
77
- newAttributes.push(t.jsxAttribute(t.jsxIdentifier(changedVersionAttr), t.stringLiteral(filesChanged.name)));
78
- }
79
- if (!isFragment && state.file && state.file.opts && state.file.opts.filename) {
80
- const name = getBaseName(state.file.opts.filename);
81
- const attrDataQaFile = t.jsxAttribute(t.jsxIdentifier(filenameAttr), t.stringLiteral(name));
82
- if (attributes.find((item) => isEqualAttr(item, attrDataQaFile)) === undefined) {
83
- newAttributes.push(attrDataQaFile);
84
- }
85
- }
86
- attributes.push(...newAttributes);
87
- },
88
- CallExpression(nodePath, state) {
89
- if ((nodePath.node.callee.type === 'MemberExpression' &&
90
- nodePath.node.callee.object.name === 'React' &&
91
- nodePath.node.callee.property.name === 'createElement') ||
92
- (nodePath.node.callee.type === 'Identifier' &&
93
- nodePath.node.callee.name === 'createElement')) {
94
- const name = getBaseName(state.file.opts.filename);
95
- const properties = nodePath.node.arguments[1] && nodePath.node.arguments[1].properties;
96
- const isFragment = isCallExpressionFragment(nodePath.node.arguments);
97
- if (!isFragment &&
98
- properties &&
99
- !properties.find((property) => property.type === 'ObjectProperty' &&
100
- property.key.type === 'StringLiteral' &&
101
- property.key.value === filenameAttr)) {
102
- properties.push(t.objectProperty(t.stringLiteral(filenameAttr), t.stringLiteral(name)));
103
- }
104
- }
105
- },
106
- };
107
- return {
108
- visitor,
109
- };
110
- }
111
- module.exports = babelPluginReactElementInfo;
112
- //# sourceMappingURL=react-element-info-unique.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-element-info-unique.js","source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a,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;iBACzF;aACF;QACH,CAAC;KACF,CAAC;IAEF,OAAO;QACL,OAAO;KACR,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,2BAA2B,CAAC"}
@@ -1,7 +0,0 @@
1
- import type { PluginObj, PluginPass, template, types } from '@babel/core';
2
- export interface Babel {
3
- types: typeof types;
4
- template: typeof template;
5
- }
6
- export type Plugin<PluginOptions = void> = (babel: Babel) => PluginObj<PluginPass & PluginOptions>;
7
- //# sourceMappingURL=types.h.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.h.d.ts","sourceRoot":"","sources":["../../../../src/library/babel/plugins/types.h.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE1E,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,QAAQ,EAAE,OAAO,QAAQ,CAAC;CAC3B;AAED,MAAM,MAAM,MAAM,CAAC,aAAa,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC,UAAU,GAAG,aAAa,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.h.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.h.js","sourceRoot":"","sources":["../../../../src/library/babel/plugins/types.h.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- export declare class PatchAutoPublicPathPlugin {
2
- apply(compiler: any): void;
3
- }
4
- //# sourceMappingURL=AutoPublicPathPlugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AutoPublicPathPlugin.d.ts","sourceRoot":"","sources":["../../../../src/library/webpack/plugins/AutoPublicPathPlugin.ts"],"names":[],"mappings":"AAEA,qBAAa,yBAAyB;IACpC,KAAK,CAAC,QAAQ,KAAA;CAmBf"}
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PatchAutoPublicPathPlugin = void 0;
4
- // Fixes webpack AutoPublicPathPlugin error when fallback load of shared microfrontend chunk
5
- // this happens because currentScript.src is not defined for an inline script
6
- class PatchAutoPublicPathPlugin {
7
- apply(compiler) {
8
- compiler.hooks.compilation.tap('PatchAutoPublicPathPlugin', (compilation) => {
9
- compilation.hooks.runtimeModule.tap('PatchAutoPublicPathPlugin', (module) => {
10
- if (module.constructor.name === 'AutoPublicPathRuntimeModule') {
11
- const base = module.generate.bind(module);
12
- // eslint-disable-next-line no-param-reassign
13
- module.generate = function (...args) {
14
- const result = base(...args);
15
- return result.replace('document.currentScript.src', 'document.currentScript.src || document.currentScript.dataset.src');
16
- };
17
- }
18
- });
19
- });
20
- }
21
- }
22
- exports.PatchAutoPublicPathPlugin = PatchAutoPublicPathPlugin;
23
- //# sourceMappingURL=AutoPublicPathPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AutoPublicPathPlugin.js","sourceRoot":"","sources":["../../../../src/library/webpack/plugins/AutoPublicPathPlugin.ts"],"names":[],"mappings":";;;AAAA,4FAA4F;AAC5F,6EAA6E;AAC7E,MAAa,yBAAyB;IACpC,KAAK,CAAC,QAAQ;QACZ,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,2BAA2B,EAAE,CAAC,WAAW,EAAE,EAAE;YAC1E,WAAW,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,2BAA2B,EAAE,CAAC,MAAM,EAAE,EAAE;gBAC1E,IAAI,MAAM,CAAC,WAAW,CAAC,IAAI,KAAK,6BAA6B,EAAE;oBAC7D,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;oBAE1C,6CAA6C;oBAC7C,MAAM,CAAC,QAAQ,GAAG,UAAU,GAAG,IAAI;wBACjC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;wBAE7B,OAAO,MAAM,CAAC,OAAO,CACnB,4BAA4B,EAC5B,kEAAkE,CACnE,CAAC;oBACJ,CAAC,CAAC;iBACH;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AApBD,8DAoBC"}
@@ -1,24 +0,0 @@
1
- import type webpack from 'webpack';
2
- import type { Compiler, NormalModule } from 'webpack';
3
- type SemverRange = [number, number, number, number];
4
- interface SharedModuleOptions {
5
- shareKey: string;
6
- requiredVersion?: SemverRange;
7
- importResolved: string;
8
- singleton?: boolean;
9
- }
10
- interface SharedModule extends NormalModule {
11
- options?: SharedModuleOptions;
12
- }
13
- export interface ModuleFederationFixRangeOptions {
14
- flexibleTramvaiVersions: boolean;
15
- }
16
- export declare class ModuleFederationFixRange implements webpack.WebpackPluginInstance {
17
- private flexibleTramvaiVersions;
18
- private sharedModules;
19
- constructor({ flexibleTramvaiVersions }: ModuleFederationFixRangeOptions);
20
- apply(compiler: Compiler): void;
21
- fixVersionRange(sharedModule: SharedModule, resolvedVersion?: string): void;
22
- }
23
- export {};
24
- //# sourceMappingURL=ModuleFederationFixRange.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModuleFederationFixRange.d.ts","sourceRoot":"","sources":["../../../../src/library/webpack/plugins/ModuleFederationFixRange.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAQtD,KAAK,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEpD,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,WAAW,CAAC;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,UAAU,YAAa,SAAQ,YAAY;IACzC,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B;AAED,MAAM,WAAW,+BAA+B;IAC9C,uBAAuB,EAAE,OAAO,CAAC;CAClC;AAED,qBAAa,wBAAyB,YAAW,OAAO,CAAC,qBAAqB;IAC5E,OAAO,CAAC,uBAAuB,CAAU;IAEzC,OAAO,CAAC,aAAa,CAA0D;gBAEnE,EAAE,uBAAuB,EAAE,EAAE,+BAA+B;IAIxE,KAAK,CAAC,QAAQ,EAAE,QAAQ;IA6GxB,eAAe,CAAC,YAAY,EAAE,YAAY,EAAE,eAAe,CAAC,EAAE,MAAM;CAoCrE"}
@@ -1,127 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ModuleFederationFixRange = void 0;
4
- const webpack_1 = require("webpack");
5
- // eslint-disable-next-line no-restricted-imports
6
- const semver_1 = require("webpack/lib/util/semver");
7
- const tramvaiVersions_1 = require("../../../utils/tramvaiVersions");
8
- const PLUGIN_NAME = 'ModuleFederationValidateDuplicates';
9
- class ModuleFederationFixRange {
10
- constructor({ flexibleTramvaiVersions }) {
11
- // { name: { importResolved: { number }} }
12
- this.sharedModules = new Map();
13
- this.flexibleTramvaiVersions = flexibleTramvaiVersions ?? false;
14
- }
15
- apply(compiler) {
16
- compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation, { normalModuleFactory }) => {
17
- normalModuleFactory.hooks.factorize.intercept({
18
- register: (tap) => {
19
- if (tap.name === 'ConsumeSharedPlugin') {
20
- const originalFn = tap.fn;
21
- // eslint-disable-next-line no-param-reassign
22
- tap.fn = async (...args) => {
23
- const module = await originalFn(...args);
24
- if (module?.options) {
25
- const { shareKey: name, importResolved } = module.options;
26
- let shared = this.sharedModules.get(name);
27
- if (!shared) {
28
- shared = new Map();
29
- this.sharedModules.set(name, shared);
30
- }
31
- let modules = shared.get(importResolved);
32
- if (!modules) {
33
- modules = new Set();
34
- shared.set(importResolved, modules);
35
- }
36
- // save major version of the semver array
37
- modules.add(module);
38
- }
39
- return module;
40
- };
41
- }
42
- return tap;
43
- },
44
- });
45
- // eslint-disable-next-line max-statements
46
- compilation.hooks.optimizeDependencies.tap(PLUGIN_NAME, () => {
47
- for (const [name, sharedModulesByName] of this.sharedModules.entries()) {
48
- const hasDuplicates = sharedModulesByName.size > 1;
49
- for (const [importResolved, sharedModulesByPath] of sharedModulesByName.entries()) {
50
- if (hasDuplicates) {
51
- const error = new webpack_1.WebpackError(`This file is a duplicate for a module "${name}" that resolved to different path`);
52
- error.file = importResolved;
53
- compilation.warnings.push(error);
54
- }
55
- let validModule;
56
- let validVersion;
57
- const invalidModules = new Set();
58
- for (const sharedModule of sharedModulesByPath) {
59
- const connections = compilation.moduleGraph.getOutgoingConnections(sharedModule);
60
- // eslint-disable-next-line no-unreachable-loop
61
- for (const { module } of connections) {
62
- const resolvedVersion = module.resourceResolveData?.descriptionFileData?.version;
63
- this.fixVersionRange(sharedModule, resolvedVersion);
64
- const requiredVersion = sharedModule?.options?.requiredVersion;
65
- if (requiredVersion && resolvedVersion) {
66
- if ((0, semver_1.satisfy)(requiredVersion, resolvedVersion)) {
67
- validModule = sharedModule;
68
- validVersion = resolvedVersion;
69
- }
70
- else {
71
- invalidModules.add(sharedModule);
72
- }
73
- }
74
- // there should by only one outgoing module for ConsumeSharedModule
75
- break;
76
- }
77
- }
78
- if (invalidModules.size > 0 && validModule) {
79
- for (const sharedModule of invalidModules) {
80
- const error = new webpack_1.WebpackError(`Shared module has been actually resolved to ${validVersion} instead of the expected`);
81
- error.module = sharedModule;
82
- compilation.warnings.push(error);
83
- // replace invalid module with valid version (invalid anyway are resolved to wrong version)
84
- // to prevent any issues with shared dependencies
85
- compilation.moduleGraph.moveModuleConnections(sharedModule, validModule, (connection) => {
86
- // ignore any outgoing connections as we want to ignore that module entirely and all its dependencies
87
- return connection.originModule !== sharedModule;
88
- });
89
- }
90
- }
91
- }
92
- }
93
- // reset sharedModules info after validation
94
- this.sharedModules = new Map();
95
- });
96
- });
97
- }
98
- fixVersionRange(sharedModule, resolvedVersion) {
99
- const { options, options: { shareKey: name, singleton }, context, } = sharedModule;
100
- let { requiredVersion } = options;
101
- // if version was not resolved automatically then get the version
102
- // from actual module
103
- // ignore singletons as the actual version won't change anything
104
- // and usually it is just a react and co libraries
105
- if (!requiredVersion && context && !singleton) {
106
- if (resolvedVersion) {
107
- requiredVersion = (0, semver_1.parseRange)(resolvedVersion);
108
- }
109
- }
110
- if (!requiredVersion) {
111
- return;
112
- }
113
- if (requiredVersion && this.flexibleTramvaiVersions) {
114
- const isTramvai = (0, tramvaiVersions_1.isUnifiedVersion)(name) || (0, tramvaiVersions_1.isDependantLib)(name);
115
- // exclude local stub versions, because `^0.0.0-stub` will have lowest priority and unexpected versions can be used
116
- if (isTramvai && requiredVersion[0] > 2 && resolvedVersion !== '0.0.0-stub') {
117
- // 1 is used for `^` range modifier
118
- // see https://github.com/webpack/webpack/blob/56363993156e06a1230c9759eba277a22e6b6604/lib/util/semver.js#LL235C20-L235C20
119
- requiredVersion[0] = 1;
120
- }
121
- }
122
- // change version in webpack module
123
- options.requiredVersion = requiredVersion;
124
- }
125
- }
126
- exports.ModuleFederationFixRange = ModuleFederationFixRange;
127
- //# sourceMappingURL=ModuleFederationFixRange.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModuleFederationFixRange.js","sourceRoot":"","sources":["../../../../src/library/webpack/plugins/ModuleFederationFixRange.ts"],"names":[],"mappings":";;;AAEA,qCAAuC;AACvC,iDAAiD;AACjD,oDAA8D;AAC9D,oEAAkF;AAElF,MAAM,WAAW,GAAG,oCAAoC,CAAC;AAmBzD,MAAa,wBAAwB;IAKnC,YAAY,EAAE,uBAAuB,EAAmC;QAHxE,0CAA0C;QAClC,kBAAa,GAAgD,IAAI,GAAG,EAAE,CAAC;QAG7E,IA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AAA,mBAAU,EAAC,eAAe,CAAC,CAAC;aAC/C;SACF;QAED,IAAI,CAAC,eAAe,EAAE;YACpB,OAAO;SACR;QAED,IAAI,eAAe,IAAI,IAAI,CAAC,uBAAuB,EAAE;YACnD,MAAM,SAAS,GAAG,IAAA,kCAAgB,EAAC,IAAI,CAAC,IAAI,IAAA,gCAAc,EAAC,IAAI,CAAC,CAAC;YAEjE,mHAAmH;YACnH,IAAI,SAAS,IAAI,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,eAAe,KAAK,YAAY,EAAE;gBAC3E,mCAAmC;gBACnC,2HAA2H;gBAC3H,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;aACxB;SACF;QAED,mCAAmC;QACnC,OAAO,CAAC,eAAe,GAAG,eAAe,CAAC;IAC5C,CAAC;CACF;AA1JD,4DA0JC"}
@@ -1,15 +0,0 @@
1
- import type webpack from 'webpack';
2
- import type { Compiler } from 'webpack';
3
- export interface ModuleFederationIgnoreEntriesOptions {
4
- entries: string[];
5
- }
6
- /**
7
- * Temporary fix of usage ModuleFederation with multiple entries
8
- * [open discussion](https://github.com/webpack/webpack/discussions/14985) how to do it properly
9
- */
10
- export declare class ModuleFederationIgnoreEntries implements webpack.WebpackPluginInstance {
11
- protected entries: Set<string>;
12
- constructor(options: ModuleFederationIgnoreEntriesOptions);
13
- apply(compiler: Compiler): void;
14
- }
15
- //# sourceMappingURL=ModuleFederationIgnoreEntries.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModuleFederationIgnoreEntries.d.ts","sourceRoot":"","sources":["../../../../src/library/webpack/plugins/ModuleFederationIgnoreEntries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIxC,MAAM,WAAW,oCAAoC;IACnD,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;;GAGG;AACH,qBAAa,6BAA8B,YAAW,OAAO,CAAC,qBAAqB;IACjF,SAAS,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;gBAEnB,OAAO,EAAE,oCAAoC;IAIzD,KAAK,CAAC,QAAQ,EAAE,QAAQ;CAsCzB"}