@tramvai/cli 5.53.80 → 6.62.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 (401) hide show
  1. package/bin/spawn.js +8 -2
  2. package/lib/api/start/application.experimental.d.ts +7 -0
  3. package/lib/api/start/application.experimental.d.ts.map +1 -0
  4. package/lib/api/start/application.experimental.js +275 -0
  5. package/lib/api/start/application.experimental.js.map +1 -0
  6. package/lib/api/start/index.d.ts +1 -0
  7. package/lib/api/start/index.d.ts.map +1 -1
  8. package/lib/api/start/index.js +17 -6
  9. package/lib/api/start/index.js.map +1 -1
  10. package/lib/builder/webpack/devServer/setup.d.ts.map +1 -1
  11. package/lib/builder/webpack/devServer/setup.js +3 -1
  12. package/lib/builder/webpack/devServer/setup.js.map +1 -1
  13. package/lib/builder/webpack/providers/analyze/shared.d.ts.map +1 -1
  14. package/lib/builder/webpack/providers/analyze/shared.js +5 -9
  15. package/lib/builder/webpack/providers/analyze/shared.js.map +1 -1
  16. package/lib/builder/webpack/providers/client.d.ts.map +1 -1
  17. package/lib/builder/webpack/providers/client.js +10 -9
  18. package/lib/builder/webpack/providers/client.js.map +1 -1
  19. package/lib/builder/webpack/providers/server.d.ts.map +1 -1
  20. package/lib/builder/webpack/providers/server.js +10 -9
  21. package/lib/builder/webpack/providers/server.js.map +1 -1
  22. package/lib/cli/CLI.d.ts +1 -1
  23. package/lib/cli/CLI.d.ts.map +1 -1
  24. package/lib/cli/CLI.js.map +1 -1
  25. package/lib/cli/bin-init.js +0 -2
  26. package/lib/cli/bin-init.js.map +1 -1
  27. package/lib/cli/index.d.ts.map +1 -1
  28. package/lib/cli/index.js +1 -12
  29. package/lib/cli/index.js.map +1 -1
  30. package/lib/cli/runCLI.d.ts.map +1 -1
  31. package/lib/cli/runCLI.js.map +1 -1
  32. package/lib/commands/add/command.d.ts +1 -4
  33. package/lib/commands/add/command.d.ts.map +1 -1
  34. package/lib/commands/add/command.js +3 -2
  35. package/lib/commands/add/command.js.map +1 -1
  36. package/lib/commands/analyze/command.d.ts +1 -1
  37. package/lib/commands/analyze/command.d.ts.map +1 -1
  38. package/lib/commands/analyze/command.js +11 -13
  39. package/lib/commands/analyze/command.js.map +1 -1
  40. package/lib/commands/benchmark/command.d.ts +1 -1
  41. package/lib/commands/benchmark/command.d.ts.map +1 -1
  42. package/lib/commands/benchmark/command.js +8 -9
  43. package/lib/commands/benchmark/command.js.map +1 -1
  44. package/lib/commands/build/build.d.ts.map +1 -1
  45. package/lib/commands/build/build.js +1 -0
  46. package/lib/commands/build/build.js.map +1 -1
  47. package/lib/commands/build/command.d.ts +1 -1
  48. package/lib/commands/build/command.d.ts.map +1 -1
  49. package/lib/commands/build/command.js +12 -15
  50. package/lib/commands/build/command.js.map +1 -1
  51. package/lib/commands/generate/command.d.ts +1 -1
  52. package/lib/commands/generate/command.d.ts.map +1 -1
  53. package/lib/commands/generate/command.js +3 -2
  54. package/lib/commands/generate/command.js.map +1 -1
  55. package/lib/commands/lint/command.d.ts +1 -1
  56. package/lib/commands/lint/command.d.ts.map +1 -1
  57. package/lib/commands/lint/command.js +3 -2
  58. package/lib/commands/lint/command.js.map +1 -1
  59. package/lib/commands/new/command.d.ts +0 -1
  60. package/lib/commands/new/command.d.ts.map +1 -1
  61. package/lib/commands/new/command.js +0 -1
  62. package/lib/commands/new/command.js.map +1 -1
  63. package/lib/commands/new/steps/installDependencies.js +3 -3
  64. package/lib/commands/new/steps/installDependencies.js.map +1 -1
  65. package/lib/commands/start/command.d.ts +1 -1
  66. package/lib/commands/start/command.d.ts.map +1 -1
  67. package/lib/commands/start/command.js +18 -15
  68. package/lib/commands/start/command.js.map +1 -1
  69. package/lib/commands/start-prod/command.d.ts +1 -1
  70. package/lib/commands/start-prod/command.d.ts.map +1 -1
  71. package/lib/commands/start-prod/command.js +11 -13
  72. package/lib/commands/start-prod/command.js.map +1 -1
  73. package/lib/commands/static/command.d.ts +1 -1
  74. package/lib/commands/static/command.d.ts.map +1 -1
  75. package/lib/commands/static/command.js +7 -3
  76. package/lib/commands/static/command.js.map +1 -1
  77. package/lib/commands/update/command.d.ts +1 -4
  78. package/lib/commands/update/command.d.ts.map +1 -1
  79. package/lib/commands/update/command.js +3 -2
  80. package/lib/commands/update/command.js.map +1 -1
  81. package/lib/external/config.d.ts.map +1 -1
  82. package/lib/external/config.js.map +1 -1
  83. package/lib/library/babel/index.d.ts +3 -9
  84. package/lib/library/babel/index.d.ts.map +1 -1
  85. package/lib/library/babel/index.js +3 -132
  86. package/lib/library/babel/index.js.map +1 -1
  87. package/lib/library/swc/index.d.ts +3 -3
  88. package/lib/library/swc/index.d.ts.map +1 -1
  89. package/lib/library/swc/index.js +4 -114
  90. package/lib/library/swc/index.js.map +1 -1
  91. package/lib/library/webpack/application/client/common.d.ts.map +1 -1
  92. package/lib/library/webpack/application/client/common.js +10 -9
  93. package/lib/library/webpack/application/client/common.js.map +1 -1
  94. package/lib/library/webpack/application/common.d.ts.map +1 -1
  95. package/lib/library/webpack/application/common.js +3 -4
  96. package/lib/library/webpack/application/common.js.map +1 -1
  97. package/lib/library/webpack/blocks/pwa/client.d.ts.map +1 -1
  98. package/lib/library/webpack/blocks/pwa/client.js +9 -58
  99. package/lib/library/webpack/blocks/pwa/client.js.map +1 -1
  100. package/lib/library/webpack/blocks/resolve.d.ts.map +1 -1
  101. package/lib/library/webpack/blocks/resolve.js +1 -0
  102. package/lib/library/webpack/blocks/resolve.js.map +1 -1
  103. package/lib/library/webpack/child-app/client/common.d.ts.map +1 -1
  104. package/lib/library/webpack/child-app/client/common.js +2 -2
  105. package/lib/library/webpack/child-app/client/common.js.map +1 -1
  106. package/lib/library/webpack/child-app/common.d.ts.map +1 -1
  107. package/lib/library/webpack/child-app/common.js +3 -4
  108. package/lib/library/webpack/child-app/common.js.map +1 -1
  109. package/lib/library/webpack/utils/threadLoader.d.ts.map +1 -1
  110. package/lib/library/webpack/utils/threadLoader.js +20 -3
  111. package/lib/library/webpack/utils/threadLoader.js.map +1 -1
  112. package/lib/library/webpack/utils/transpiler.js +1 -1
  113. package/lib/library/webpack/utils/transpiler.js.map +1 -1
  114. package/lib/models/analytics/utils.d.ts +2 -1
  115. package/lib/models/analytics/utils.d.ts.map +1 -1
  116. package/lib/models/analytics/utils.js +3 -0
  117. package/lib/models/analytics/utils.js.map +1 -1
  118. package/lib/models/command.d.ts +1 -1
  119. package/lib/models/command.d.ts.map +1 -1
  120. package/lib/models/command.js +1 -1
  121. package/lib/models/command.js.map +1 -1
  122. package/lib/models/context.d.ts +1 -1
  123. package/lib/models/context.d.ts.map +1 -1
  124. package/lib/models/logger.d.ts +0 -1
  125. package/lib/models/logger.d.ts.map +1 -1
  126. package/lib/models/logger.js +2 -3
  127. package/lib/models/logger.js.map +1 -1
  128. package/lib/schema/autogeneratedSchema.json +15 -15
  129. package/lib/typings/configEntry/application.d.ts +1 -1
  130. package/lib/typings/configEntry/application.d.ts.map +1 -1
  131. package/lib/typings/public.d.ts +0 -1
  132. package/lib/typings/public.d.ts.map +1 -1
  133. package/lib/typings/public.js +0 -2
  134. package/lib/typings/public.js.map +1 -1
  135. package/lib/utils/cpu-profile.d.ts.map +1 -1
  136. package/lib/utils/cpu-profile.js +0 -1
  137. package/lib/utils/cpu-profile.js.map +1 -1
  138. package/package.json +23 -27
  139. package/schema.json +15 -15
  140. package/src/api/start/__integration__/start.test.ts +8 -0
  141. package/src/api/start/application.experimental.ts +305 -0
  142. package/src/api/start/index.ts +20 -4
  143. package/src/builder/webpack/devServer/setup.ts +1 -0
  144. package/src/builder/webpack/providers/analyze/shared.ts +6 -10
  145. package/src/builder/webpack/providers/client.ts +15 -10
  146. package/src/builder/webpack/providers/server.ts +15 -10
  147. package/src/cli/CLI.ts +1 -1
  148. package/src/cli/bin-init.ts +0 -2
  149. package/src/cli/index.ts +4 -11
  150. package/src/cli/runCLI.ts +0 -1
  151. package/src/commands/add/command.ts +3 -2
  152. package/src/commands/analyze/command.ts +12 -14
  153. package/src/commands/benchmark/command.ts +9 -10
  154. package/src/commands/build/build.ts +2 -0
  155. package/src/commands/build/command.ts +13 -16
  156. package/src/commands/generate/command.ts +3 -2
  157. package/src/commands/lint/command.ts +3 -2
  158. package/src/commands/new/command.ts +0 -2
  159. package/src/commands/new/steps/installDependencies.ts +3 -3
  160. package/src/commands/new/templates/shared/_prettierrc.js.hbs +1 -1
  161. package/src/commands/start/command.ts +20 -16
  162. package/src/commands/start-prod/command.ts +12 -14
  163. package/src/commands/static/command.ts +7 -3
  164. package/src/commands/update/command.ts +3 -2
  165. package/src/external/config.ts +1 -0
  166. package/src/library/babel/index.ts +3 -160
  167. package/src/library/swc/__integration__/__snapshots__/swc.build.test.ts.snap +46 -28
  168. package/src/library/swc/__integration__/__snapshots__/swc.start.test.ts.snap +12 -8
  169. package/src/library/swc/__integration__/swc.start.test.ts +4 -4
  170. package/src/library/swc/index.ts +3 -139
  171. package/src/library/webpack/application/client/common.ts +12 -7
  172. package/src/library/webpack/application/common.ts +8 -4
  173. package/src/library/webpack/blocks/pwa/client.ts +13 -64
  174. package/src/library/webpack/blocks/resolve.ts +1 -0
  175. package/src/library/webpack/child-app/client/common.ts +2 -2
  176. package/src/library/webpack/child-app/common.ts +7 -5
  177. package/src/library/webpack/utils/threadLoader.ts +21 -0
  178. package/src/library/webpack/utils/transpiler.ts +2 -2
  179. package/src/models/analytics/utils.ts +6 -2
  180. package/src/models/command.ts +3 -4
  181. package/src/models/context.ts +1 -1
  182. package/src/models/logger.ts +1 -3
  183. package/src/schema/autogeneratedSchema.json +15 -15
  184. package/src/typings/configEntry/application.ts +5 -1
  185. package/src/typings/public.ts +0 -2
  186. package/src/utils/cpu-profile.ts +0 -1
  187. package/lib/library/babel/plugins/create-token-pure.d.ts +0 -7
  188. package/lib/library/babel/plugins/create-token-pure.d.ts.map +0 -1
  189. package/lib/library/babel/plugins/create-token-pure.js +0 -39
  190. package/lib/library/babel/plugins/create-token-pure.js.map +0 -1
  191. package/lib/library/babel/plugins/fill-action-name.d.ts +0 -3
  192. package/lib/library/babel/plugins/fill-action-name.d.ts.map +0 -1
  193. package/lib/library/babel/plugins/fill-action-name.js +0 -107
  194. package/lib/library/babel/plugins/fill-action-name.js.map +0 -1
  195. package/lib/library/babel/plugins/fill-declare-action-name.d.ts +0 -6
  196. package/lib/library/babel/plugins/fill-declare-action-name.d.ts.map +0 -1
  197. package/lib/library/babel/plugins/fill-declare-action-name.js +0 -94
  198. package/lib/library/babel/plugins/fill-declare-action-name.js.map +0 -1
  199. package/lib/library/babel/plugins/lazy-component/lazy-component.d.ts +0 -7
  200. package/lib/library/babel/plugins/lazy-component/lazy-component.d.ts.map +0 -1
  201. package/lib/library/babel/plugins/lazy-component/lazy-component.js +0 -75
  202. package/lib/library/babel/plugins/lazy-component/lazy-component.js.map +0 -1
  203. package/lib/library/babel/plugins/lazy-component/legacy-universal-replace.d.ts +0 -14
  204. package/lib/library/babel/plugins/lazy-component/legacy-universal-replace.d.ts.map +0 -1
  205. package/lib/library/babel/plugins/lazy-component/legacy-universal-replace.js +0 -53
  206. package/lib/library/babel/plugins/lazy-component/legacy-universal-replace.js.map +0 -1
  207. package/lib/library/babel/plugins/lazy-component/properties/chunkName.d.ts +0 -3
  208. package/lib/library/babel/plugins/lazy-component/properties/chunkName.d.ts.map +0 -1
  209. package/lib/library/babel/plugins/lazy-component/properties/chunkName.js +0 -133
  210. package/lib/library/babel/plugins/lazy-component/properties/chunkName.js.map +0 -1
  211. package/lib/library/babel/plugins/lazy-component/properties/importAsync.d.ts +0 -3
  212. package/lib/library/babel/plugins/lazy-component/properties/importAsync.d.ts.map +0 -1
  213. package/lib/library/babel/plugins/lazy-component/properties/importAsync.js +0 -11
  214. package/lib/library/babel/plugins/lazy-component/properties/importAsync.js.map +0 -1
  215. package/lib/library/babel/plugins/lazy-component/properties/isReady.d.ts +0 -3
  216. package/lib/library/babel/plugins/lazy-component/properties/isReady.d.ts.map +0 -1
  217. package/lib/library/babel/plugins/lazy-component/properties/isReady.js +0 -14
  218. package/lib/library/babel/plugins/lazy-component/properties/isReady.js.map +0 -1
  219. package/lib/library/babel/plugins/lazy-component/properties/requireAsync.d.ts +0 -3
  220. package/lib/library/babel/plugins/lazy-component/properties/requireAsync.d.ts.map +0 -1
  221. package/lib/library/babel/plugins/lazy-component/properties/requireAsync.js +0 -15
  222. package/lib/library/babel/plugins/lazy-component/properties/requireAsync.js.map +0 -1
  223. package/lib/library/babel/plugins/lazy-component/properties/requireSync.d.ts +0 -3
  224. package/lib/library/babel/plugins/lazy-component/properties/requireSync.d.ts.map +0 -1
  225. package/lib/library/babel/plugins/lazy-component/properties/requireSync.js +0 -16
  226. package/lib/library/babel/plugins/lazy-component/properties/requireSync.js.map +0 -1
  227. package/lib/library/babel/plugins/lazy-component/properties/resolve.d.ts +0 -3
  228. package/lib/library/babel/plugins/lazy-component/properties/resolve.d.ts.map +0 -1
  229. package/lib/library/babel/plugins/lazy-component/properties/resolve.js +0 -14
  230. package/lib/library/babel/plugins/lazy-component/properties/resolve.js.map +0 -1
  231. package/lib/library/babel/plugins/lazy-component/properties/types.d.ts +0 -14
  232. package/lib/library/babel/plugins/lazy-component/properties/types.d.ts.map +0 -1
  233. package/lib/library/babel/plugins/lazy-component/properties/types.js +0 -3
  234. package/lib/library/babel/plugins/lazy-component/properties/types.js.map +0 -1
  235. package/lib/library/babel/plugins/lazy-component/properties/utils/webpackComments.d.ts +0 -14
  236. package/lib/library/babel/plugins/lazy-component/properties/utils/webpackComments.d.ts.map +0 -1
  237. package/lib/library/babel/plugins/lazy-component/properties/utils/webpackComments.js +0 -57
  238. package/lib/library/babel/plugins/lazy-component/properties/utils/webpackComments.js.map +0 -1
  239. package/lib/library/babel/plugins/provider-stack.d.ts +0 -4
  240. package/lib/library/babel/plugins/provider-stack.d.ts.map +0 -1
  241. package/lib/library/babel/plugins/provider-stack.js +0 -63
  242. package/lib/library/babel/plugins/provider-stack.js.map +0 -1
  243. package/lib/library/babel/plugins/react-compiler.d.ts +0 -13
  244. package/lib/library/babel/plugins/react-compiler.d.ts.map +0 -1
  245. package/lib/library/babel/plugins/react-compiler.js +0 -27
  246. package/lib/library/babel/plugins/react-compiler.js.map +0 -1
  247. package/lib/library/babel/plugins/react-element-info-unique.d.ts +0 -26
  248. package/lib/library/babel/plugins/react-element-info-unique.d.ts.map +0 -1
  249. package/lib/library/babel/plugins/react-element-info-unique.js +0 -112
  250. package/lib/library/babel/plugins/react-element-info-unique.js.map +0 -1
  251. package/lib/library/babel/plugins/types.h.d.ts +0 -7
  252. package/lib/library/babel/plugins/types.h.d.ts.map +0 -1
  253. package/lib/library/babel/plugins/types.h.js +0 -3
  254. package/lib/library/babel/plugins/types.h.js.map +0 -1
  255. package/lib/library/webpack/plugins/AssetsIntegritiesPlugin.d.ts +0 -8
  256. package/lib/library/webpack/plugins/AssetsIntegritiesPlugin.d.ts.map +0 -1
  257. package/lib/library/webpack/plugins/AssetsIntegritiesPlugin.js +0 -29
  258. package/lib/library/webpack/plugins/AssetsIntegritiesPlugin.js.map +0 -1
  259. package/lib/library/webpack/plugins/AutoPublicPathPlugin.d.ts +0 -4
  260. package/lib/library/webpack/plugins/AutoPublicPathPlugin.d.ts.map +0 -1
  261. package/lib/library/webpack/plugins/AutoPublicPathPlugin.js +0 -23
  262. package/lib/library/webpack/plugins/AutoPublicPathPlugin.js.map +0 -1
  263. package/lib/library/webpack/plugins/ModuleFederationFixRange.d.ts +0 -24
  264. package/lib/library/webpack/plugins/ModuleFederationFixRange.d.ts.map +0 -1
  265. package/lib/library/webpack/plugins/ModuleFederationFixRange.js +0 -127
  266. package/lib/library/webpack/plugins/ModuleFederationFixRange.js.map +0 -1
  267. package/lib/library/webpack/plugins/ModuleFederationIgnoreEntries.d.ts +0 -15
  268. package/lib/library/webpack/plugins/ModuleFederationIgnoreEntries.d.ts.map +0 -1
  269. package/lib/library/webpack/plugins/ModuleFederationIgnoreEntries.js +0 -49
  270. package/lib/library/webpack/plugins/ModuleFederationIgnoreEntries.js.map +0 -1
  271. package/lib/library/webpack/plugins/PolyfillCondition.d.ts +0 -8
  272. package/lib/library/webpack/plugins/PolyfillCondition.d.ts.map +0 -1
  273. package/lib/library/webpack/plugins/PolyfillCondition.js +0 -46
  274. package/lib/library/webpack/plugins/PolyfillCondition.js.map +0 -1
  275. package/lib/library/webpack/plugins/PurifyStatsPlugin.d.ts +0 -15
  276. package/lib/library/webpack/plugins/PurifyStatsPlugin.d.ts.map +0 -1
  277. package/lib/library/webpack/plugins/PurifyStatsPlugin.js +0 -47
  278. package/lib/library/webpack/plugins/PurifyStatsPlugin.js.map +0 -1
  279. package/lib/library/webpack/plugins/PwaIconsPlugin.d.ts +0 -12
  280. package/lib/library/webpack/plugins/PwaIconsPlugin.d.ts.map +0 -1
  281. package/lib/library/webpack/plugins/PwaIconsPlugin.js +0 -78
  282. package/lib/library/webpack/plugins/PwaIconsPlugin.js.map +0 -1
  283. package/lib/library/webpack/plugins/WebManifestPlugin.d.ts +0 -13
  284. package/lib/library/webpack/plugins/WebManifestPlugin.d.ts.map +0 -1
  285. package/lib/library/webpack/plugins/WebManifestPlugin.js +0 -47
  286. package/lib/library/webpack/plugins/WebManifestPlugin.js.map +0 -1
  287. package/lib/library/webpack/utils/polyfills/const.d.ts +0 -3
  288. package/lib/library/webpack/utils/polyfills/const.d.ts.map +0 -1
  289. package/lib/library/webpack/utils/polyfills/const.js +0 -49
  290. package/lib/library/webpack/utils/polyfills/const.js.map +0 -1
  291. package/lib/library/webpack/utils/polyfills/polyfillCondition.d.ts +0 -8
  292. package/lib/library/webpack/utils/polyfills/polyfillCondition.d.ts.map +0 -1
  293. package/lib/library/webpack/utils/polyfills/polyfillCondition.js +0 -51
  294. package/lib/library/webpack/utils/polyfills/polyfillCondition.js.map +0 -1
  295. package/lib/library/webpack/utils/polyfills/specToFeature.d.ts +0 -7
  296. package/lib/library/webpack/utils/polyfills/specToFeature.d.ts.map +0 -1
  297. package/lib/library/webpack/utils/polyfills/specToFeature.js +0 -207
  298. package/lib/library/webpack/utils/polyfills/specToFeature.js.map +0 -1
  299. package/lib/models/analytics/analytics.d.ts +0 -156
  300. package/lib/models/analytics/analytics.d.ts.map +0 -1
  301. package/lib/models/analytics/analytics.js +0 -259
  302. package/lib/models/analytics/analytics.js.map +0 -1
  303. package/lib/models/analytics/analytics.worker.d.ts +0 -5
  304. package/lib/models/analytics/analytics.worker.d.ts.map +0 -1
  305. package/lib/models/analytics/analytics.worker.js +0 -87
  306. package/lib/models/analytics/analytics.worker.js.map +0 -1
  307. package/lib/typings/pwa/index.d.ts +0 -80
  308. package/lib/typings/pwa/index.d.ts.map +0 -1
  309. package/lib/typings/pwa/index.js +0 -3
  310. package/lib/typings/pwa/index.js.map +0 -1
  311. package/lib/utils/errors.d.ts +0 -7
  312. package/lib/utils/errors.d.ts.map +0 -1
  313. package/lib/utils/errors.js +0 -43
  314. package/lib/utils/errors.js.map +0 -1
  315. package/lib/utils/memoryUsage.d.ts +0 -20
  316. package/lib/utils/memoryUsage.d.ts.map +0 -1
  317. package/lib/utils/memoryUsage.js +0 -51
  318. package/lib/utils/memoryUsage.js.map +0 -1
  319. package/lib/utils/sentry.d.ts +0 -2
  320. package/lib/utils/sentry.d.ts.map +0 -1
  321. package/lib/utils/sentry.js +0 -27
  322. package/lib/utils/sentry.js.map +0 -1
  323. package/src/library/babel/plugins/__fixtures__/create-token-pure/already-has-comment.ts +0 -5
  324. package/src/library/babel/plugins/__fixtures__/create-token-pure/do-nothing.ts +0 -10
  325. package/src/library/babel/plugins/__fixtures__/create-token-pure/from-core.ts +0 -5
  326. package/src/library/babel/plugins/__fixtures__/create-token-pure/from-dippy.ts +0 -5
  327. package/src/library/babel/plugins/__fixtures__/create-token-pure/many-imports.ts +0 -9
  328. package/src/library/babel/plugins/__fixtures__/fill-declare-action-name/import-mixed.ts +0 -17
  329. package/src/library/babel/plugins/__fixtures__/fill-declare-action-name/import-with-name.ts +0 -28
  330. package/src/library/babel/plugins/__fixtures__/fill-declare-action-name/import-without-name.ts +0 -25
  331. package/src/library/babel/plugins/__fixtures__/fill-declare-action-name/require-with-name.ts +0 -21
  332. package/src/library/babel/plugins/__fixtures__/fill-declare-action-name/require-without-name.ts +0 -19
  333. package/src/library/babel/plugins/__fixtures__/lazy-component/base.ts +0 -3
  334. package/src/library/babel/plugins/__fixtures__/lazy-component/cmp.tsx +0 -7
  335. package/src/library/babel/plugins/__fixtures__/lazy-component/comments.ts +0 -7
  336. package/src/library/babel/plugins/__fixtures__/lazy-component/dynamic.ts +0 -3
  337. package/src/library/babel/plugins/__fixtures__/lazy-component/inner/first.tsx +0 -7
  338. package/src/library/babel/plugins/__fixtures__/lazy-component/inner/path/cmp.tsx +0 -7
  339. package/src/library/babel/plugins/__fixtures__/lazy-component/inner/second.tsx +0 -7
  340. package/src/library/babel/plugins/__fixtures__/lazy-component/inner/third.tsx +0 -7
  341. package/src/library/babel/plugins/__fixtures__/lazy-component/lazy+hmr.ts +0 -3
  342. package/src/library/babel/plugins/__fixtures__/lazy-component/long-import.ts +0 -3
  343. package/src/library/babel/plugins/__fixtures__/lazy-component/not-lazy-import.ts +0 -7
  344. package/src/library/babel/plugins/__fixtures__/lazy-component/not-lazy.ts +0 -8
  345. package/src/library/babel/plugins/__fixtures__/legacy-universal-replace/cmp.tsx +0 -7
  346. package/src/library/babel/plugins/__fixtures__/legacy-universal-replace/not-universal.ts +0 -8
  347. package/src/library/babel/plugins/__fixtures__/legacy-universal-replace/platform-legacy.ts +0 -5
  348. package/src/library/babel/plugins/__fixtures__/legacy-universal-replace/react-universal.ts +0 -3
  349. package/src/library/babel/plugins/__fixtures__/legacy-universal-replace/tramvai/react/index.es.ts +0 -3
  350. package/src/library/babel/plugins/__fixtures__/provider-stack/add-stack.ts +0 -22
  351. package/src/library/babel/plugins/__fixtures__/provider-stack/check-function-name.ts +0 -10
  352. package/src/library/babel/plugins/__fixtures__/provider-stack/do-nothing.ts +0 -16
  353. package/src/library/babel/plugins/__fixtures__/provider-stack/error-in-scope.ts +0 -24
  354. package/src/library/babel/plugins/__fixtures__/provider-stack/inside-await.ts +0 -12
  355. package/src/library/babel/plugins/__fixtures__/provider-stack/module-decorator.ts +0 -27
  356. package/src/library/babel/plugins/__snapshots__/create-token-pure.spec.ts.snap +0 -108
  357. package/src/library/babel/plugins/__snapshots__/fill-declare-action-name.spec.ts.snap +0 -264
  358. package/src/library/babel/plugins/__snapshots__/provider-stack.spec.ts.snap +0 -362
  359. package/src/library/babel/plugins/create-token-pure.spec.ts +0 -39
  360. package/src/library/babel/plugins/create-token-pure.ts +0 -47
  361. package/src/library/babel/plugins/fill-action-name.ts +0 -126
  362. package/src/library/babel/plugins/fill-declare-action-name.spec.ts +0 -37
  363. package/src/library/babel/plugins/fill-declare-action-name.ts +0 -110
  364. package/src/library/babel/plugins/lazy-component/__snapshots__/lazy-component.spec.ts.snap +0 -313
  365. package/src/library/babel/plugins/lazy-component/__snapshots__/legacy-universal-replace.spec.ts.snap +0 -114
  366. package/src/library/babel/plugins/lazy-component/lazy-component.spec.ts +0 -46
  367. package/src/library/babel/plugins/lazy-component/lazy-component.ts +0 -91
  368. package/src/library/babel/plugins/lazy-component/legacy-universal-replace.spec.ts +0 -33
  369. package/src/library/babel/plugins/lazy-component/legacy-universal-replace.ts +0 -88
  370. package/src/library/babel/plugins/lazy-component/properties/chunkName.ts +0 -185
  371. package/src/library/babel/plugins/lazy-component/properties/importAsync.ts +0 -8
  372. package/src/library/babel/plugins/lazy-component/properties/isReady.ts +0 -19
  373. package/src/library/babel/plugins/lazy-component/properties/requireAsync.ts +0 -20
  374. package/src/library/babel/plugins/lazy-component/properties/requireSync.ts +0 -21
  375. package/src/library/babel/plugins/lazy-component/properties/resolve.ts +0 -21
  376. package/src/library/babel/plugins/lazy-component/properties/types.ts +0 -20
  377. package/src/library/babel/plugins/lazy-component/properties/utils/webpackComments.ts +0 -61
  378. package/src/library/babel/plugins/provider-stack.spec.ts +0 -55
  379. package/src/library/babel/plugins/provider-stack.ts +0 -88
  380. package/src/library/babel/plugins/react-compiler.ts +0 -39
  381. package/src/library/babel/plugins/react-element-info-unique.ts +0 -144
  382. package/src/library/babel/plugins/types.h.ts +0 -8
  383. package/src/library/webpack/plugins/AssetsIntegritiesPlugin.ts +0 -34
  384. package/src/library/webpack/plugins/AutoPublicPathPlugin.ts +0 -23
  385. package/src/library/webpack/plugins/ModuleFederationFixRange.ts +0 -181
  386. package/src/library/webpack/plugins/ModuleFederationIgnoreEntries.ts +0 -59
  387. package/src/library/webpack/plugins/PolyfillCondition.ts +0 -62
  388. package/src/library/webpack/plugins/PurifyStatsPlugin.ts +0 -57
  389. package/src/library/webpack/plugins/PwaIconsPlugin.ts +0 -94
  390. package/src/library/webpack/plugins/WebManifestPlugin.ts +0 -62
  391. package/src/library/webpack/utils/polyfills/__integration__/__snapshots__/condition.test.ts.snap +0 -1348
  392. package/src/library/webpack/utils/polyfills/__integration__/condition.test.ts +0 -128
  393. package/src/library/webpack/utils/polyfills/const.ts +0 -46
  394. package/src/library/webpack/utils/polyfills/polyfillCondition.ts +0 -63
  395. package/src/library/webpack/utils/polyfills/specToFeature.ts +0 -243
  396. package/src/models/analytics/analytics.ts +0 -488
  397. package/src/models/analytics/analytics.worker.ts +0 -102
  398. package/src/typings/pwa/index.ts +0 -83
  399. package/src/utils/errors.ts +0 -39
  400. package/src/utils/memoryUsage.ts +0 -58
  401. package/src/utils/sentry.ts +0 -25
@@ -1,12 +1,5 @@
1
1
  import { CLICommand } from '../../models/command';
2
- import { checkApplication } from '../../validators/commands/checkBuild';
3
- import { checkConfigExists } from '../../validators/commands/checkConfigExists';
4
- import { checkDependencies } from '../../validators/commands/checkDependencies';
5
- import { runMigrationsAndCheckVersions } from '../../validators/commands/runMigrationsAndCheckVersions';
6
2
  import type { BuildCommand as BuildCommandType } from '../../api/build';
7
- import { checkPwaDependencies } from '../../validators/commands/checkPwaDependencies';
8
- import { checkSwcDependencies } from '../../validators/commands/checkSwcDependencies';
9
- import { checkReactCompilerDependencies } from '../../validators/commands/checkReactCompilerDependencies';
10
3
  import { getFeaturesProperties, getProjectProperties } from '../../models/analytics/utils';
11
4
 
12
5
  export type Params = Parameters<BuildCommandType>[0] & {
@@ -69,15 +62,19 @@ class BuildCommand extends CLICommand<Params> {
69
62
 
70
63
  alias = 'b';
71
64
 
72
- validators = [
73
- checkConfigExists,
74
- checkApplication,
75
- runMigrationsAndCheckVersions,
76
- checkDependencies,
77
- checkPwaDependencies,
78
- checkSwcDependencies,
79
- checkReactCompilerDependencies,
80
- ];
65
+ validators() {
66
+ return [
67
+ require('../../validators/commands/checkConfigExists').checkConfigExists,
68
+ require('../../validators/commands/checkBuild').checkApplication,
69
+ require('../../validators/commands/runMigrationsAndCheckVersions')
70
+ .runMigrationsAndCheckVersions,
71
+ require('../../validators/commands/checkDependencies').checkDependencies,
72
+ require('../../validators/commands/checkPwaDependencies').checkPwaDependencies,
73
+ require('../../validators/commands/checkSwcDependencies').checkSwcDependencies,
74
+ require('../../validators/commands/checkReactCompilerDependencies')
75
+ .checkReactCompilerDependencies,
76
+ ];
77
+ }
81
78
 
82
79
  async action(parameters: Params) {
83
80
  const start = Date.now();
@@ -1,5 +1,4 @@
1
1
  import { CLICommand } from '../../models/command';
2
- import { checkConfigExists } from '../../validators/commands/checkConfigExists';
3
2
 
4
3
  export type GeneratorName = 'action' | 'reducer' | 'component' | 'page' | 'bundle' | 'module';
5
4
  export type Params = {
@@ -21,7 +20,9 @@ class GenerateCommand extends CLICommand<Params> {
21
20
 
22
21
  alias = 'g';
23
22
 
24
- validators = [checkConfigExists];
23
+ validators() {
24
+ return [require('../../validators/commands/checkConfigExists').checkConfigExists];
25
+ }
25
26
 
26
27
  action(parameters: Params) {
27
28
  // used require for lazy code execution
@@ -1,5 +1,4 @@
1
1
  import { CLICommand } from '../../models/command';
2
- import { checkApplication } from '../../validators/commands/checkBuild';
3
2
 
4
3
  class LintCommand extends CLICommand {
5
4
  name = 'lint';
@@ -12,7 +11,9 @@ class LintCommand extends CLICommand {
12
11
 
13
12
  alias = 'l';
14
13
 
15
- validators = [checkApplication];
14
+ validators() {
15
+ return [require('../../validators/commands/checkBuild').checkApplication];
16
+ }
16
17
 
17
18
  action() {
18
19
  return Promise.resolve({
@@ -33,8 +33,6 @@ class NewCommand extends CLICommand<Params> {
33
33
 
34
34
  alias = 'n';
35
35
 
36
- validators = [];
37
-
38
36
  action(parameters: Params) {
39
37
  // used require for lazy code execution
40
38
  return require('./new').default(this.context, parameters);
@@ -62,7 +62,7 @@ const devDependencies = [
62
62
  'postcss-nested',
63
63
  'husky@^4',
64
64
  'lint-staged',
65
- 'prettier-config-tinkoff',
65
+ '@tramvai/prettier-config',
66
66
  'typescript',
67
67
  ];
68
68
 
@@ -126,7 +126,7 @@ export async function installDependencies({
126
126
 
127
127
  // Install cli and core packages into the root of repository if using workspaces for update command to work correctly
128
128
  if (workspace !== undefined) {
129
- console.log(`${chalk.blue('[DEPENDENCIES]')} Installing root dependencies`);
129
+ console.log(`${chalk.blue('[DEPENDENCIES]')} Installing root dev dependencies`);
130
130
 
131
131
  await packageManager.install({
132
132
  packageNames: deps(type, { isDev: true, isRoot: true }),
@@ -135,7 +135,7 @@ export async function installDependencies({
135
135
  workspace: undefined,
136
136
  });
137
137
 
138
- console.log(`${chalk.blue('[DEPENDENCIES]')} Installing root dev dependencies`);
138
+ console.log(`${chalk.blue('[DEPENDENCIES]')} Installing root dependencies`);
139
139
 
140
140
  await packageManager.install({
141
141
  packageNames: deps(type, { isDev: false, isRoot: true }),
@@ -1 +1 @@
1
- module.exports = require('prettier-config-tinkoff');
1
+ module.exports = require('@tramvai/prettier-config');
@@ -1,12 +1,5 @@
1
1
  import { CLICommand } from '../../models/command';
2
- import { checkApplication } from '../../validators/commands/checkBuild';
3
- import { checkConfigExists } from '../../validators/commands/checkConfigExists';
4
- import { checkDependencies } from '../../validators/commands/checkDependencies';
5
- import { runMigrationsAndCheckVersions } from '../../validators/commands/runMigrationsAndCheckVersions';
6
2
  import type { StartCommand as StartCommandType } from '../../api/start';
7
- import { checkPwaDependencies } from '../../validators/commands/checkPwaDependencies';
8
- import { checkSwcDependencies } from '../../validators/commands/checkSwcDependencies';
9
- import { checkReactCompilerDependencies } from '../../validators/commands/checkReactCompilerDependencies';
10
3
  import { getFeaturesProperties, getProjectProperties } from '../../models/analytics/utils';
11
4
 
12
5
  export type Params = Parameters<StartCommandType>[0] & {
@@ -124,19 +117,30 @@ export class StartCommand extends CLICommand<Params> {
124
117
  value: '[httpsCert]',
125
118
  description: 'Path to https certificate',
126
119
  },
120
+ {
121
+ name: '--experimentalWebpackWorkerThreads',
122
+ value: '[experimentalWebpackWorkerThreads]',
123
+ transformer: (value: string) => value !== 'false',
124
+ description:
125
+ 'Enable new experimental @tramvai/api builder to run webpack compilation in worker threads',
126
+ },
127
127
  ];
128
128
 
129
129
  alias = 's';
130
130
 
131
- validators = [
132
- checkConfigExists,
133
- checkApplication,
134
- runMigrationsAndCheckVersions,
135
- checkDependencies,
136
- checkPwaDependencies,
137
- checkSwcDependencies,
138
- checkReactCompilerDependencies,
139
- ];
131
+ validators() {
132
+ return [
133
+ require('../../validators/commands/checkConfigExists').checkConfigExists,
134
+ require('../../validators/commands/checkBuild').checkApplication,
135
+ require('../../validators/commands/runMigrationsAndCheckVersions')
136
+ .runMigrationsAndCheckVersions,
137
+ require('../../validators/commands/checkDependencies').checkDependencies,
138
+ require('../../validators/commands/checkPwaDependencies').checkPwaDependencies,
139
+ require('../../validators/commands/checkSwcDependencies').checkSwcDependencies,
140
+ require('../../validators/commands/checkReactCompilerDependencies')
141
+ .checkReactCompilerDependencies,
142
+ ];
143
+ }
140
144
 
141
145
  async action(parameters) {
142
146
  const start = Date.now();
@@ -1,10 +1,4 @@
1
1
  import { CLICommand } from '../../models/command';
2
- import { checkConfigExists } from '../../validators/commands/checkConfigExists';
3
- import { checkApplication } from '../../validators/commands/checkBuild';
4
- import { runMigrationsAndCheckVersions } from '../../validators/commands/runMigrationsAndCheckVersions';
5
- import { checkPwaDependencies } from '../../validators/commands/checkPwaDependencies';
6
- import { checkSwcDependencies } from '../../validators/commands/checkSwcDependencies';
7
- import { checkReactCompilerDependencies } from '../../validators/commands/checkReactCompilerDependencies';
8
2
 
9
3
  export interface Params {
10
4
  target: string;
@@ -106,14 +100,18 @@ export class StartProdCommand extends CLICommand<Params> {
106
100
 
107
101
  alias = 'sp';
108
102
 
109
- validators = [
110
- checkConfigExists,
111
- checkApplication,
112
- runMigrationsAndCheckVersions,
113
- checkPwaDependencies,
114
- checkSwcDependencies,
115
- checkReactCompilerDependencies,
116
- ];
103
+ validators() {
104
+ return [
105
+ require('../../validators/commands/checkConfigExists').checkConfigExists,
106
+ require('../../validators/commands/checkBuild').checkApplication,
107
+ require('../../validators/commands/runMigrationsAndCheckVersions')
108
+ .runMigrationsAndCheckVersions,
109
+ require('../../validators/commands/checkPwaDependencies').checkPwaDependencies,
110
+ require('../../validators/commands/checkSwcDependencies').checkSwcDependencies,
111
+ require('../../validators/commands/checkReactCompilerDependencies')
112
+ .checkReactCompilerDependencies,
113
+ ];
114
+ }
117
115
 
118
116
  action(parameters: Params) {
119
117
  // used require for lazy code execution
@@ -1,6 +1,4 @@
1
1
  import { CLICommand } from '../../models/command';
2
- import { checkApplication } from '../../validators/commands/checkBuild';
3
- import { runMigrationsAndCheckVersions } from '../../validators/commands/runMigrationsAndCheckVersions';
4
2
 
5
3
  export type Params = {
6
4
  target: string;
@@ -67,7 +65,13 @@ export class StaticCommand extends CLICommand<Params> {
67
65
 
68
66
  alias = 'st';
69
67
 
70
- validators = [checkApplication, runMigrationsAndCheckVersions];
68
+ validators() {
69
+ return [
70
+ require('../../validators/commands/checkBuild').checkApplication,
71
+ require('../../validators/commands/runMigrationsAndCheckVersions')
72
+ .runMigrationsAndCheckVersions,
73
+ ];
74
+ }
71
75
 
72
76
  action(parameters: Params) {
73
77
  // used require for lazy code execution
@@ -1,5 +1,4 @@
1
1
  import { CLICommand } from '../../models/command';
2
- import { checkVersion } from './checkVersionValidator';
3
2
  import type { Params } from './update';
4
3
 
5
4
  class UpdateCommand extends CLICommand {
@@ -22,7 +21,9 @@ class UpdateCommand extends CLICommand {
22
21
 
23
22
  alias = 'u';
24
23
 
25
- validators = [checkVersion];
24
+ validators() {
25
+ return [require('./checkVersionValidator').checkVersion];
26
+ }
26
27
 
27
28
  async action(parameters: Params) {
28
29
  // used require for lazy code execution
@@ -1,3 +1,4 @@
1
+ // This configuration is virtual and generated in packages/cli/src/library/webpack/blocks/configResolve.ts
1
2
  import type { ConfigManager } from '../config/configManager';
2
3
  import type { ApplicationConfigEntry } from '../typings/configEntry/application';
3
4
  import type { ModuleConfigEntry } from '../typings/configEntry/module';
@@ -1,161 +1,4 @@
1
- import path from 'path';
2
- import { sync as resolve } from 'resolve';
3
- import type { TransformOptions } from '@babel/core';
1
+ import { configFactory } from '@tramvai/plugin-babel-transpiler/lib/config-factory';
4
2
 
5
- import { getReactCompilerPlugin } from './plugins/react-compiler';
6
- import type { TranspilerConfig } from '../webpack/utils/transpiler';
7
-
8
- const envConfig = {
9
- production: {
10
- plugins: [
11
- '@babel/plugin-transform-react-constant-elements',
12
- [
13
- 'transform-react-remove-prop-types',
14
- {
15
- removeImport: true,
16
- },
17
- ],
18
- ],
19
- },
20
- };
21
-
22
- function hasJsxRuntime() {
23
- try {
24
- resolve('react/jsx-runtime', { basedir: process.cwd() });
25
- return true;
26
- } catch (e) {
27
- return false;
28
- }
29
- }
30
-
31
- // eslint-disable-next-line complexity
32
- export const babelConfigFactory = ({
33
- env = 'development',
34
- isServer = false,
35
- modules = false,
36
- actualTarget,
37
- generateDataQaTag = true,
38
- enableFillActionNamePlugin = false,
39
- enableFillDeclareActionNamePlugin = false,
40
- // for testing only!
41
- // @ts-expect-error
42
- markCreateTokenAsPure = true,
43
- typescript = false,
44
- loader = true,
45
- removeTypeofWindow,
46
- tramvai = false,
47
- hot = false,
48
- excludesPresetEnv,
49
- browsersListTargets,
50
- reactCompiler = false,
51
- loose = true,
52
- externalHelpers = true,
53
- }: Partial<TranspilerConfig>) => {
54
- const cfg = envConfig[env] || {};
55
-
56
- const babelConfig: Record<string, any> = {
57
- // по умолчанию sourceType: 'module' и тогда бабель рассматривает все файлы как es-модули, что может
58
- // вызвать проблемы в некоторых случаях когда бабель обрабатывает уже скомпиленный в commonjs файл
59
- // как модуль добавляя в него es-импорты и вводя этим вебпак в ступор на счет типа файла
60
- // unambiguos - режим когда бабель попытается предугадать тип компилируемого файла и уже на этой
61
- // основе добавлять соответствующие импорты
62
- sourceType: 'unambiguous' as const,
63
-
64
- // Это необходимо для того, чтобы деструктуризация array-like сущностей, например, Set
65
- // не приводила к невалидному коду при сборке для старых браузеров:
66
- // [...new Set()] => [].concat(new Set())
67
- // https://babeljs.io/docs/assumptions#arraylikeisiterable
68
- assumptions: {
69
- arrayLikeIsIterable: true,
70
- iterableIsArray: false,
71
- },
72
-
73
- presets: [
74
- [
75
- '@babel/preset-env',
76
- {
77
- modules,
78
- useBuiltIns: 'entry',
79
- // from core-js version depends on what polyfills will be included with `useBuiltIns: 'entry'` option
80
- // this logic is here - https://github.com/zloirock/core-js/blob/master/packages/core-js-compat/src/modules-by-versions.mjs
81
- corejs: require('core-js/package.json').version,
82
- // TODO: will be deprecated in babel@8 - https://babeljs.io/docs/babel-preset-env#loose
83
- loose,
84
- targets: browsersListTargets,
85
- browserslistEnv: actualTarget,
86
- bugfixes: true,
87
- exclude: excludesPresetEnv,
88
- },
89
- ],
90
- [
91
- '@babel/preset-react',
92
- {
93
- runtime: hasJsxRuntime() ? 'automatic' : 'classic',
94
- useSpread: true,
95
- development: env === 'development',
96
- },
97
- ],
98
- typescript && '@babel/preset-typescript',
99
- ]
100
- .concat(cfg.presets || [])
101
- .filter(Boolean) as TransformOptions['presets'],
102
-
103
- plugins: [
104
- // React compiler must be the first plugin in the chain
105
- getReactCompilerPlugin({ isServer, options: reactCompiler }),
106
- // TODO: useESModules is deprecated and should work automatically - https://babeljs.io/docs/en/babel-plugin-transform-runtime#useesmodules
107
- externalHelpers && [
108
- '@babel/transform-runtime',
109
- { useESModules: !(isServer && env === 'development') },
110
- ],
111
- path.resolve(__dirname, './plugins/lazy-component/legacy-universal-replace'), // TODO: удалить плагин после того как отпадёт необходимость поддерживать легаси
112
- path.resolve(__dirname, './plugins/lazy-component/lazy-component'),
113
- enableFillDeclareActionNamePlugin &&
114
- path.resolve(__dirname, './plugins/fill-declare-action-name'),
115
- generateDataQaTag && path.resolve(__dirname, './plugins/react-element-info-unique'), // Собственный плагин. Необходимо удалить в будущем
116
- enableFillActionNamePlugin && path.resolve(__dirname, './plugins/fill-action-name'), // Собственный плагин. Необходимо удалить в будущем
117
- markCreateTokenAsPure && path.resolve(__dirname, './plugins/create-token-pure'),
118
- '@tinkoff/babel-plugin-lodash/cjs',
119
- isServer && 'babel-plugin-dynamic-import-node',
120
- [
121
- '@babel/plugin-proposal-decorators',
122
- {
123
- legacy: true,
124
- },
125
- ],
126
- '@babel/plugin-proposal-export-default-from',
127
- removeTypeofWindow && [
128
- 'transform-define',
129
- {
130
- 'typeof window': isServer ? 'undefined' : 'object',
131
- },
132
- ],
133
- tramvai && env === 'development' && path.resolve(__dirname, './plugins/provider-stack'),
134
- !isServer &&
135
- env === 'development' &&
136
- hot && ['react-refresh/babel', { skipEnvCheck: process.env.NODE_ENV === 'test' }],
137
- ]
138
- .concat(cfg.plugins || [])
139
- .filter(Boolean),
140
- };
141
-
142
- if (typeof browsersListTargets !== 'undefined') {
143
- // to prevent from reading browserslist config for every processed module (sometimes it is not cached in browserslist),
144
- // don't know why, but target from preset-env plugin options is ignored from this process
145
- babelConfig.targets = browsersListTargets;
146
- }
147
-
148
- const loaderConfig = loader
149
- ? {
150
- cwd: path.resolve(__dirname, '..', '..', '..'),
151
- compact: false,
152
- }
153
- : {};
154
-
155
- return {
156
- ...babelConfig,
157
- ...loaderConfig,
158
- };
159
- };
160
-
161
- export default babelConfigFactory;
3
+ export { configFactory as babelConfigFactory };
4
+ export default configFactory;