@modern-js/app-tools 2.4.0 → 2.5.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 (302) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/dist/{js/node → cjs}/analyze/constants.js +0 -0
  3. package/dist/cjs/analyze/generateCode.js +249 -0
  4. package/dist/{js/node → cjs}/analyze/getBundleEntry.js +6 -0
  5. package/dist/{js/node → cjs}/analyze/getClientRoutes/getRoutes.js +1 -18
  6. package/dist/{js/node → cjs}/analyze/getClientRoutes/getRoutesLegacy.js +1 -18
  7. package/dist/{js/node → cjs}/analyze/getClientRoutes/index.js +0 -0
  8. package/dist/{js/node → cjs}/analyze/getClientRoutes/utils.js +0 -0
  9. package/dist/{js/node → cjs}/analyze/getFileSystemEntry.js +0 -0
  10. package/dist/{js/node → cjs}/analyze/getHtmlTemplate.js +4 -24
  11. package/dist/{js/node → cjs}/analyze/getServerRoutes.js +22 -42
  12. package/dist/cjs/analyze/index.js +290 -0
  13. package/dist/{js/node → cjs}/analyze/isDefaultExportFunction.js +0 -0
  14. package/dist/{js/node → cjs}/analyze/makeLegalIdentifier.js +0 -0
  15. package/dist/{js/node → cjs}/analyze/nestedRoutes.js +16 -50
  16. package/dist/{js/node → cjs}/analyze/templates.js +16 -49
  17. package/dist/{js/node → cjs}/analyze/utils.js +9 -29
  18. package/dist/{js/node → cjs}/builder/builder-rspack/index.js +0 -0
  19. package/dist/{js/node → cjs}/builder/builder-webpack/builderPlugins/compatModern.js +0 -0
  20. package/dist/{js/node → cjs}/builder/builder-webpack/index.js +22 -62
  21. package/dist/{js/node → cjs}/builder/builder-webpack/webpackPlugins/RouterPlugin.js +7 -24
  22. package/dist/{js/node → cjs}/builder/builder-webpack/webpackPlugins/index.js +0 -0
  23. package/dist/{js/node → cjs}/builder/generator/createBuilderOptions.js +0 -0
  24. package/dist/{js/node → cjs}/builder/generator/createBuilderProviderConfig.js +14 -25
  25. package/dist/{js/node → cjs}/builder/generator/getBuilderTargets.js +4 -0
  26. package/dist/cjs/builder/generator/index.js +58 -0
  27. package/dist/{js/node → cjs}/builder/index.js +12 -34
  28. package/dist/{js/node → cjs}/builder/shared/builderPlugins/adapterModern.js +35 -34
  29. package/dist/{js/node → cjs}/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.js +0 -0
  30. package/dist/{js/node → cjs}/builder/shared/bundlerPlugins/HtmlBottomTemplate.js +0 -0
  31. package/dist/{js/node → cjs}/builder/shared/createCopyPattern.js +0 -0
  32. package/dist/{js/node → cjs}/builder/shared/index.js +0 -0
  33. package/dist/{js/node → cjs}/builder/shared/loaders/serverModuleLoader.js +0 -0
  34. package/dist/{js/node → cjs}/builder/shared/types.js +0 -0
  35. package/dist/{js/node → cjs}/commands/build.js +9 -46
  36. package/dist/cjs/commands/deploy.js +31 -0
  37. package/dist/{js/node → cjs}/commands/dev.js +17 -52
  38. package/dist/{js/node → cjs}/commands/index.js +0 -0
  39. package/dist/{js/node → cjs}/commands/inspect.js +2 -22
  40. package/dist/{js/node → cjs}/commands/serve.js +8 -28
  41. package/dist/{js/node → cjs}/config/default.js +15 -26
  42. package/dist/{js/node → cjs}/config/index.js +0 -0
  43. package/dist/{js/node → cjs}/config/initialize/index.js +0 -0
  44. package/dist/{js/node → cjs}/config/initialize/inits.js +4 -20
  45. package/dist/{js/node → cjs}/config/legacy/createHtmlConfig.js +0 -0
  46. package/dist/{js/node → cjs}/config/legacy/createOutputConfig.js +0 -0
  47. package/dist/{js/node → cjs}/config/legacy/createSourceConfig.js +0 -0
  48. package/dist/{js/node → cjs}/config/legacy/createToolsConfig.js +0 -0
  49. package/dist/{js/node → cjs}/config/legacy/index.js +0 -0
  50. package/dist/cjs/defineConfig.js +33 -0
  51. package/dist/{js/node → cjs}/exports/server.js +0 -0
  52. package/dist/{js/node → cjs}/hooks.js +0 -0
  53. package/dist/cjs/index.js +198 -0
  54. package/dist/cjs/initialize/index.js +102 -0
  55. package/dist/{js/node → cjs}/locale/en.js +0 -0
  56. package/dist/{js/node → cjs}/locale/index.js +0 -0
  57. package/dist/{js/node → cjs}/locale/zh.js +0 -0
  58. package/dist/{js/node → cjs}/schema/Schema.js +0 -0
  59. package/dist/{js/node → cjs}/schema/index.js +0 -0
  60. package/dist/{js/node → cjs}/schema/legacy.js +0 -0
  61. package/dist/{js/node → cjs}/types/config/deploy.js +0 -0
  62. package/dist/{js/node → cjs}/types/config/dev.js +0 -0
  63. package/dist/{js/node → cjs}/types/config/experiments.js +0 -0
  64. package/dist/{js/node → cjs}/types/config/html.js +0 -0
  65. package/dist/{js/node → cjs}/types/config/index.js +0 -0
  66. package/dist/{js/node → cjs}/types/config/output.js +0 -0
  67. package/dist/{js/node → cjs}/types/config/performance.js +0 -0
  68. package/dist/{js/node → cjs}/types/config/security.js +0 -0
  69. package/dist/{js/node → cjs}/types/config/source.js +0 -0
  70. package/dist/{js/node → cjs}/types/config/tools.js +0 -0
  71. package/dist/{js/node → cjs}/types/hooks.js +0 -0
  72. package/dist/{js/node → cjs}/types/index.js +0 -0
  73. package/dist/{js/node → cjs}/types/legacyConfig/deploy.js +0 -0
  74. package/dist/{js/node → cjs}/types/legacyConfig/dev.js +0 -0
  75. package/dist/{js/node → cjs}/types/legacyConfig/index.js +0 -0
  76. package/dist/{js/node → cjs}/types/legacyConfig/output.js +0 -0
  77. package/dist/{js/node → cjs}/types/legacyConfig/source.js +0 -0
  78. package/dist/{js/node → cjs}/types/legacyConfig/tools.js +0 -0
  79. package/dist/{js/node → cjs}/types/utils.js +0 -0
  80. package/dist/{js/node → cjs}/utils/config.js +19 -57
  81. package/dist/{js/node → cjs}/utils/createServer.js +10 -46
  82. package/dist/{js/node → cjs}/utils/env.js +0 -0
  83. package/dist/{js/node → cjs}/utils/generateWatchFiles.js +16 -38
  84. package/dist/{js/node → cjs}/utils/getSelectedEntries.js +3 -23
  85. package/dist/cjs/utils/getServerInternalPlugins.js +41 -0
  86. package/dist/{js/node → cjs}/utils/language.js +0 -0
  87. package/dist/{js/node → cjs}/utils/printInstructions.js +3 -23
  88. package/dist/cjs/utils/restart.js +45 -0
  89. package/dist/{js/node → cjs}/utils/routes.js +3 -23
  90. package/dist/{js/node → cjs}/utils/types.js +0 -0
  91. package/dist/{js/treeshaking → esm}/analyze/constants.js +0 -0
  92. package/dist/{js/treeshaking → esm}/analyze/generateCode.js +14 -14
  93. package/dist/{js/treeshaking → esm}/analyze/getBundleEntry.js +4 -2
  94. package/dist/{js/treeshaking → esm}/analyze/getClientRoutes/getRoutes.js +1 -1
  95. package/dist/{js/treeshaking → esm}/analyze/getClientRoutes/getRoutesLegacy.js +1 -1
  96. package/dist/{js/treeshaking → esm}/analyze/getClientRoutes/index.js +0 -0
  97. package/dist/{js/treeshaking → esm}/analyze/getClientRoutes/utils.js +0 -0
  98. package/dist/{js/treeshaking → esm}/analyze/getFileSystemEntry.js +1 -1
  99. package/dist/{js/treeshaking → esm}/analyze/getHtmlTemplate.js +0 -0
  100. package/dist/{js/treeshaking → esm}/analyze/getServerRoutes.js +8 -6
  101. package/dist/{js/treeshaking → esm}/analyze/index.js +8 -8
  102. package/dist/{js/treeshaking → esm}/analyze/isDefaultExportFunction.js +0 -0
  103. package/dist/{js/treeshaking → esm}/analyze/makeLegalIdentifier.js +0 -0
  104. package/dist/{js/treeshaking → esm}/analyze/nestedRoutes.js +5 -5
  105. package/dist/{js/treeshaking → esm}/analyze/templates.js +8 -7
  106. package/dist/{js/treeshaking → esm}/analyze/utils.js +3 -3
  107. package/dist/{js/treeshaking → esm}/builder/builder-rspack/index.js +0 -0
  108. package/dist/{js/treeshaking → esm}/builder/builder-webpack/builderPlugins/compatModern.js +4 -4
  109. package/dist/{js/treeshaking → esm}/builder/builder-webpack/index.js +2 -2
  110. package/dist/{js/treeshaking → esm}/builder/builder-webpack/webpackPlugins/RouterPlugin.js +5 -2
  111. package/dist/{js/treeshaking → esm}/builder/builder-webpack/webpackPlugins/index.js +0 -0
  112. package/dist/{js/treeshaking → esm}/builder/generator/createBuilderOptions.js +2 -2
  113. package/dist/{js/treeshaking → esm}/builder/generator/createBuilderProviderConfig.js +0 -0
  114. package/dist/{js/treeshaking → esm}/builder/generator/getBuilderTargets.js +5 -1
  115. package/dist/{js/treeshaking → esm}/builder/generator/index.js +2 -2
  116. package/dist/{js/treeshaking → esm}/builder/index.js +0 -0
  117. package/dist/{js/treeshaking → esm}/builder/shared/builderPlugins/adapterModern.js +62 -13
  118. package/dist/{js/treeshaking → esm}/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.js +0 -0
  119. package/dist/{js/treeshaking → esm}/builder/shared/bundlerPlugins/HtmlBottomTemplate.js +2 -2
  120. package/dist/{js/treeshaking → esm}/builder/shared/createCopyPattern.js +0 -0
  121. package/dist/{js/treeshaking → esm}/builder/shared/index.js +0 -0
  122. package/dist/{js/treeshaking → esm}/builder/shared/loaders/serverModuleLoader.js +0 -0
  123. package/dist/{js/treeshaking → esm}/builder/shared/types.js +0 -0
  124. package/dist/{js/treeshaking → esm}/commands/build.js +0 -0
  125. package/dist/{js/treeshaking → esm}/commands/deploy.js +0 -0
  126. package/dist/{js/treeshaking → esm}/commands/dev.js +2 -2
  127. package/dist/{js/treeshaking → esm}/commands/index.js +0 -0
  128. package/dist/{js/treeshaking → esm}/commands/inspect.js +0 -0
  129. package/dist/{js/treeshaking → esm}/commands/serve.js +2 -2
  130. package/dist/{js/treeshaking → esm}/config/default.js +0 -0
  131. package/dist/{js/treeshaking → esm}/config/index.js +0 -0
  132. package/dist/{js/treeshaking → esm}/config/initialize/index.js +0 -0
  133. package/dist/{js/treeshaking → esm}/config/initialize/inits.js +2 -2
  134. package/dist/esm/config/legacy/createHtmlConfig.js +19 -0
  135. package/dist/{js/treeshaking → esm}/config/legacy/createOutputConfig.js +1 -1
  136. package/dist/{js/treeshaking → esm}/config/legacy/createSourceConfig.js +1 -1
  137. package/dist/{js/treeshaking → esm}/config/legacy/createToolsConfig.js +1 -1
  138. package/dist/{js/treeshaking → esm}/config/legacy/index.js +0 -0
  139. package/dist/{js/treeshaking → esm}/defineConfig.js +0 -0
  140. package/dist/{js/treeshaking → esm}/exports/server.js +0 -0
  141. package/dist/{js/treeshaking → esm}/hooks.js +0 -0
  142. package/dist/{js/treeshaking → esm}/index.js +0 -0
  143. package/dist/{js/treeshaking → esm}/initialize/index.js +2 -2
  144. package/dist/{js/treeshaking → esm}/locale/en.js +0 -0
  145. package/dist/{js/treeshaking → esm}/locale/index.js +0 -0
  146. package/dist/{js/treeshaking → esm}/locale/zh.js +0 -0
  147. package/dist/{js/treeshaking → esm}/schema/Schema.js +0 -0
  148. package/dist/{js/treeshaking → esm}/schema/index.js +0 -0
  149. package/dist/{js/treeshaking → esm}/schema/legacy.js +0 -0
  150. package/dist/{js/treeshaking → esm}/types/config/deploy.js +0 -0
  151. package/dist/{js/treeshaking → esm}/types/config/dev.js +0 -0
  152. package/dist/{js/treeshaking → esm}/types/config/experiments.js +0 -0
  153. package/dist/{js/treeshaking → esm}/types/config/html.js +0 -0
  154. package/dist/{js/treeshaking → esm}/types/config/index.js +0 -0
  155. package/dist/{js/treeshaking → esm}/types/config/output.js +0 -0
  156. package/dist/{js/treeshaking → esm}/types/config/performance.js +0 -0
  157. package/dist/{js/treeshaking → esm}/types/config/security.js +0 -0
  158. package/dist/{js/treeshaking → esm}/types/config/source.js +0 -0
  159. package/dist/{js/treeshaking → esm}/types/config/tools.js +0 -0
  160. package/dist/{js/treeshaking → esm}/types/hooks.js +0 -0
  161. package/dist/{js/treeshaking → esm}/types/index.js +0 -0
  162. package/dist/{js/treeshaking → esm}/types/legacyConfig/deploy.js +0 -0
  163. package/dist/{js/treeshaking → esm}/types/legacyConfig/dev.js +0 -0
  164. package/dist/{js/treeshaking → esm}/types/legacyConfig/index.js +0 -0
  165. package/dist/{js/treeshaking → esm}/types/legacyConfig/output.js +0 -0
  166. package/dist/{js/treeshaking → esm}/types/legacyConfig/source.js +0 -0
  167. package/dist/{js/treeshaking → esm}/types/legacyConfig/tools.js +0 -0
  168. package/dist/{js/treeshaking → esm}/types/utils.js +0 -0
  169. package/dist/{js/treeshaking → esm}/utils/config.js +2 -2
  170. package/dist/{js/treeshaking → esm}/utils/createServer.js +0 -0
  171. package/dist/{js/treeshaking → esm}/utils/env.js +0 -0
  172. package/dist/{js/treeshaking → esm}/utils/generateWatchFiles.js +0 -0
  173. package/dist/{js/treeshaking → esm}/utils/getSelectedEntries.js +0 -0
  174. package/dist/{js/treeshaking → esm}/utils/getServerInternalPlugins.js +2 -2
  175. package/dist/{js/treeshaking → esm}/utils/language.js +0 -0
  176. package/dist/{js/treeshaking → esm}/utils/printInstructions.js +0 -0
  177. package/dist/{js/treeshaking → esm}/utils/restart.js +0 -0
  178. package/dist/{js/treeshaking → esm}/utils/routes.js +0 -0
  179. package/dist/{js/treeshaking → esm}/utils/types.js +0 -0
  180. package/dist/{js/modern → esm-node}/analyze/constants.js +0 -0
  181. package/dist/esm-node/analyze/generateCode.js +225 -0
  182. package/dist/{js/modern → esm-node}/analyze/getBundleEntry.js +6 -0
  183. package/dist/{js/modern → esm-node}/analyze/getClientRoutes/getRoutes.js +1 -20
  184. package/dist/{js/modern → esm-node}/analyze/getClientRoutes/getRoutesLegacy.js +1 -20
  185. package/dist/{js/modern → esm-node}/analyze/getClientRoutes/index.js +0 -0
  186. package/dist/{js/modern → esm-node}/analyze/getClientRoutes/utils.js +0 -0
  187. package/dist/{js/modern → esm-node}/analyze/getFileSystemEntry.js +0 -0
  188. package/dist/{js/modern → esm-node}/analyze/getHtmlTemplate.js +4 -24
  189. package/dist/{js/modern → esm-node}/analyze/getServerRoutes.js +24 -45
  190. package/dist/esm-node/analyze/index.js +281 -0
  191. package/dist/{js/modern → esm-node}/analyze/isDefaultExportFunction.js +0 -0
  192. package/dist/{js/modern → esm-node}/analyze/makeLegalIdentifier.js +0 -0
  193. package/dist/{js/modern → esm-node}/analyze/nestedRoutes.js +16 -52
  194. package/dist/{js/modern → esm-node}/analyze/templates.js +16 -51
  195. package/dist/{js/modern → esm-node}/analyze/utils.js +9 -29
  196. package/dist/{js/modern → esm-node}/builder/builder-rspack/index.js +0 -0
  197. package/dist/{js/modern → esm-node}/builder/builder-webpack/builderPlugins/compatModern.js +0 -0
  198. package/dist/esm-node/builder/builder-webpack/index.js +51 -0
  199. package/dist/{js/modern → esm-node}/builder/builder-webpack/webpackPlugins/RouterPlugin.js +7 -24
  200. package/dist/{js/modern → esm-node}/builder/builder-webpack/webpackPlugins/index.js +0 -0
  201. package/dist/{js/modern → esm-node}/builder/generator/createBuilderOptions.js +0 -0
  202. package/dist/esm-node/builder/generator/createBuilderProviderConfig.js +26 -0
  203. package/dist/{js/modern → esm-node}/builder/generator/getBuilderTargets.js +10 -1
  204. package/dist/esm-node/builder/generator/index.js +29 -0
  205. package/dist/esm-node/builder/index.js +17 -0
  206. package/dist/{js/modern → esm-node}/builder/shared/builderPlugins/adapterModern.js +35 -36
  207. package/dist/{js/modern → esm-node}/builder/shared/bundlerPlugins/HtmlAsyncChunkPlugin.js +0 -0
  208. package/dist/{js/modern → esm-node}/builder/shared/bundlerPlugins/HtmlBottomTemplate.js +0 -0
  209. package/dist/{js/modern → esm-node}/builder/shared/createCopyPattern.js +0 -0
  210. package/dist/{js/modern → esm-node}/builder/shared/index.js +0 -0
  211. package/dist/{js/modern → esm-node}/builder/shared/loaders/serverModuleLoader.js +0 -0
  212. package/dist/{js/modern → esm-node}/builder/shared/types.js +0 -0
  213. package/dist/esm-node/commands/build.js +52 -0
  214. package/dist/esm-node/commands/deploy.js +8 -0
  215. package/dist/esm-node/commands/dev.js +72 -0
  216. package/dist/{js/modern → esm-node}/commands/index.js +0 -0
  217. package/dist/esm-node/commands/inspect.js +18 -0
  218. package/dist/{js/modern → esm-node}/commands/serve.js +8 -28
  219. package/dist/{js/modern → esm-node}/config/default.js +15 -28
  220. package/dist/{js/modern → esm-node}/config/index.js +0 -0
  221. package/dist/{js/modern → esm-node}/config/initialize/index.js +0 -0
  222. package/dist/{js/modern → esm-node}/config/initialize/inits.js +4 -22
  223. package/dist/{js/modern → esm-node}/config/legacy/createHtmlConfig.js +0 -0
  224. package/dist/{js/modern → esm-node}/config/legacy/createOutputConfig.js +0 -0
  225. package/dist/{js/modern → esm-node}/config/legacy/createSourceConfig.js +0 -0
  226. package/dist/{js/modern → esm-node}/config/legacy/createToolsConfig.js +0 -0
  227. package/dist/{js/modern → esm-node}/config/legacy/index.js +0 -0
  228. package/dist/esm-node/defineConfig.js +9 -0
  229. package/dist/{js/modern → esm-node}/exports/server.js +0 -0
  230. package/dist/{js/modern → esm-node}/hooks.js +0 -0
  231. package/dist/esm-node/index.js +172 -0
  232. package/dist/esm-node/initialize/index.js +91 -0
  233. package/dist/{js/modern → esm-node}/locale/en.js +0 -0
  234. package/dist/{js/modern → esm-node}/locale/index.js +0 -0
  235. package/dist/{js/modern → esm-node}/locale/zh.js +0 -0
  236. package/dist/{js/modern → esm-node}/schema/Schema.js +0 -0
  237. package/dist/{js/modern → esm-node}/schema/index.js +0 -0
  238. package/dist/{js/modern → esm-node}/schema/legacy.js +0 -0
  239. package/dist/{js/modern → esm-node}/types/config/deploy.js +0 -0
  240. package/dist/{js/modern → esm-node}/types/config/dev.js +0 -0
  241. package/dist/{js/modern → esm-node}/types/config/experiments.js +0 -0
  242. package/dist/{js/modern → esm-node}/types/config/html.js +0 -0
  243. package/dist/{js/modern → esm-node}/types/config/index.js +0 -0
  244. package/dist/{js/modern → esm-node}/types/config/output.js +0 -0
  245. package/dist/{js/modern → esm-node}/types/config/performance.js +0 -0
  246. package/dist/{js/modern → esm-node}/types/config/security.js +0 -0
  247. package/dist/{js/modern → esm-node}/types/config/source.js +0 -0
  248. package/dist/{js/modern → esm-node}/types/config/tools.js +0 -0
  249. package/dist/{js/modern → esm-node}/types/hooks.js +0 -0
  250. package/dist/{js/modern → esm-node}/types/index.js +0 -0
  251. package/dist/{js/modern → esm-node}/types/legacyConfig/deploy.js +0 -0
  252. package/dist/{js/modern → esm-node}/types/legacyConfig/dev.js +0 -0
  253. package/dist/{js/modern → esm-node}/types/legacyConfig/index.js +0 -0
  254. package/dist/{js/modern → esm-node}/types/legacyConfig/output.js +0 -0
  255. package/dist/{js/modern → esm-node}/types/legacyConfig/source.js +0 -0
  256. package/dist/{js/modern → esm-node}/types/legacyConfig/tools.js +0 -0
  257. package/dist/{js/modern → esm-node}/types/utils.js +0 -0
  258. package/dist/esm-node/utils/config.js +88 -0
  259. package/dist/esm-node/utils/createServer.js +37 -0
  260. package/dist/{js/modern → esm-node}/utils/env.js +0 -0
  261. package/dist/esm-node/utils/generateWatchFiles.js +33 -0
  262. package/dist/{js/modern → esm-node}/utils/getSelectedEntries.js +3 -23
  263. package/dist/esm-node/utils/getServerInternalPlugins.js +18 -0
  264. package/dist/{js/modern → esm-node}/utils/language.js +0 -0
  265. package/dist/esm-node/utils/printInstructions.js +11 -0
  266. package/dist/esm-node/utils/restart.js +22 -0
  267. package/dist/esm-node/utils/routes.js +10 -0
  268. package/dist/{js/modern → esm-node}/utils/types.js +0 -0
  269. package/dist/types/types/config/tools.d.ts +1 -1
  270. package/dist/types/types/hooks.d.ts +5 -4
  271. package/dist/types/types/index.d.ts +3 -1
  272. package/package.json +30 -31
  273. package/dist/js/modern/analyze/generateCode.js +0 -247
  274. package/dist/js/modern/analyze/index.js +0 -329
  275. package/dist/js/modern/builder/builder-webpack/index.js +0 -93
  276. package/dist/js/modern/builder/generator/createBuilderProviderConfig.js +0 -39
  277. package/dist/js/modern/builder/generator/index.js +0 -53
  278. package/dist/js/modern/builder/index.js +0 -39
  279. package/dist/js/modern/commands/build.js +0 -91
  280. package/dist/js/modern/commands/deploy.js +0 -28
  281. package/dist/js/modern/commands/dev.js +0 -109
  282. package/dist/js/modern/commands/inspect.js +0 -38
  283. package/dist/js/modern/defineConfig.js +0 -27
  284. package/dist/js/modern/index.js +0 -221
  285. package/dist/js/modern/initialize/index.js +0 -132
  286. package/dist/js/modern/utils/config.js +0 -128
  287. package/dist/js/modern/utils/createServer.js +0 -75
  288. package/dist/js/modern/utils/generateWatchFiles.js +0 -55
  289. package/dist/js/modern/utils/getServerInternalPlugins.js +0 -58
  290. package/dist/js/modern/utils/printInstructions.js +0 -31
  291. package/dist/js/modern/utils/restart.js +0 -44
  292. package/dist/js/modern/utils/routes.js +0 -30
  293. package/dist/js/node/analyze/generateCode.js +0 -271
  294. package/dist/js/node/analyze/index.js +0 -336
  295. package/dist/js/node/builder/generator/index.js +0 -82
  296. package/dist/js/node/commands/deploy.js +0 -51
  297. package/dist/js/node/defineConfig.js +0 -49
  298. package/dist/js/node/index.js +0 -245
  299. package/dist/js/node/initialize/index.js +0 -141
  300. package/dist/js/node/utils/getServerInternalPlugins.js +0 -79
  301. package/dist/js/node/utils/restart.js +0 -67
  302. package/dist/js/treeshaking/config/legacy/createHtmlConfig.js +0 -19
File without changes
@@ -0,0 +1,172 @@
1
+ import path from "path";
2
+ import lintPlugin from "@modern-js/plugin-lint";
3
+ import {
4
+ cleanRequireCache,
5
+ emptyDir,
6
+ Import,
7
+ getCommand
8
+ } from "@modern-js/utils";
9
+ import { castArray } from "@modern-js/utils/lodash";
10
+ import analyzePlugin from "./analyze";
11
+ import initializePlugin from "./initialize";
12
+ import { hooks } from "./hooks";
13
+ import { i18n, localeKeys } from "./locale";
14
+ import { getLocaleLanguage } from "./utils/language";
15
+ import { restart } from "./utils/restart";
16
+ import { generateWatchFiles } from "./utils/generateWatchFiles";
17
+ export * from "./defineConfig";
18
+ export * from "./types";
19
+ const upgradeModel = Import.lazy(
20
+ "@modern-js/upgrade",
21
+ require
22
+ );
23
+ const devCommand = async (program, api) => {
24
+ const runner = api.useHookRunners();
25
+ const devToolMetas = await runner.registerDev();
26
+ const devProgram = program.command("dev").alias("start").usage("[options]").description(i18n.t(localeKeys.command.dev.describe)).option("-c --config <config>", i18n.t(localeKeys.command.shared.config)).option("-e --entry [entry...]", i18n.t(localeKeys.command.dev.entry)).option("--analyze", i18n.t(localeKeys.command.shared.analyze)).option("--api-only", i18n.t(localeKeys.command.dev.apiOnly)).action(async (options) => {
27
+ const { dev } = await import("./commands/dev");
28
+ await dev(api, options);
29
+ });
30
+ for (const meta of devToolMetas) {
31
+ if (!meta.subCommands) {
32
+ continue;
33
+ }
34
+ for (const subCmd of meta.subCommands) {
35
+ devProgram.command(subCmd).action(async (options = {}) => {
36
+ const { appDirectory } = api.useAppContext();
37
+ const { isTypescript } = await import("@modern-js/utils");
38
+ await runner.beforeDevTask(meta);
39
+ await meta.action(options, {
40
+ isTsProject: isTypescript(appDirectory)
41
+ });
42
+ });
43
+ }
44
+ }
45
+ };
46
+ const buildCommand = async (program, api) => {
47
+ const runner = api.useHookRunners();
48
+ const platformBuilders = await runner.registerBuildPlatform();
49
+ const buildProgram = program.command("build").usage("[options]").description(i18n.t(localeKeys.command.build.describe)).option("-c --config <config>", i18n.t(localeKeys.command.shared.config)).option("--analyze", i18n.t(localeKeys.command.shared.analyze)).action(async (options) => {
50
+ const { build } = await import("./commands/build");
51
+ await build(api, options);
52
+ });
53
+ for (const platformBuilder of platformBuilders) {
54
+ const platforms = castArray(platformBuilder.platform);
55
+ for (const platform of platforms) {
56
+ buildProgram.command(platform).action(async () => {
57
+ const { appDirectory } = api.useAppContext();
58
+ const { isTypescript } = await import("@modern-js/utils");
59
+ await runner.beforeBuildPlatform(platformBuilders);
60
+ await platformBuilder.build(platform, {
61
+ isTsProject: isTypescript(appDirectory)
62
+ });
63
+ });
64
+ }
65
+ }
66
+ };
67
+ var src_default = (options = {
68
+ bundler: "webpack"
69
+ }) => ({
70
+ name: "@modern-js/app-tools",
71
+ post: [
72
+ "@modern-js/plugin-initialize",
73
+ "@modern-js/plugin-analyze",
74
+ "@modern-js/plugin-ssr",
75
+ "@modern-js/plugin-document",
76
+ "@modern-js/plugin-state",
77
+ "@modern-js/plugin-router",
78
+ "@modern-js/plugin-router-v5",
79
+ "@modern-js/plugin-polyfill"
80
+ ],
81
+ registerHook: hooks,
82
+ usePlugins: [
83
+ initializePlugin({
84
+ bundler: (options == null ? void 0 : options.bundler) === "experimental-rspack" ? "rspack" : "webpack"
85
+ }),
86
+ analyzePlugin({
87
+ bundler: (options == null ? void 0 : options.bundler) === "experimental-rspack" ? "rspack" : "webpack"
88
+ }),
89
+ lintPlugin()
90
+ ],
91
+ setup: (api) => {
92
+ const locale = getLocaleLanguage();
93
+ i18n.changeLanguage({ locale });
94
+ return {
95
+ async commands({ program }) {
96
+ await devCommand(program, api);
97
+ await buildCommand(program, api);
98
+ program.command("serve").usage("[options]").description(i18n.t(localeKeys.command.serve.describe)).option("--api-only", i18n.t(localeKeys.command.dev.apiOnly)).option(
99
+ "-c --config <config>",
100
+ i18n.t(localeKeys.command.shared.config)
101
+ ).action(async () => {
102
+ const { start } = await import("./commands/serve");
103
+ await start(api);
104
+ });
105
+ program.command("deploy").usage("[options]").option(
106
+ "-c --config <config>",
107
+ i18n.t(localeKeys.command.shared.config)
108
+ ).description(i18n.t(localeKeys.command.deploy.describe)).action(async (options2) => {
109
+ const { build } = await import("./commands/build");
110
+ await build(api);
111
+ const { deploy } = await import("./commands/deploy");
112
+ await deploy(api, options2);
113
+ process.exit(0);
114
+ });
115
+ program.command("new").usage("[options]").description(i18n.t(localeKeys.command.new.describe)).option("--lang <lang>", i18n.t(localeKeys.command.new.lang)).option("-d, --debug", i18n.t(localeKeys.command.new.debug), false).option(
116
+ "-c, --config <config>",
117
+ i18n.t(localeKeys.command.new.config)
118
+ ).option("--dist-tag <tag>", i18n.t(localeKeys.command.new.distTag)).option("--registry", i18n.t(localeKeys.command.new.registry)).action(async (options2) => {
119
+ const { MWANewAction } = await import("@modern-js/new-action");
120
+ await MWANewAction({ ...options2, locale: options2.lang || locale });
121
+ });
122
+ program.command("inspect").description("inspect internal webpack config").option(
123
+ `--env <env>`,
124
+ i18n.t(localeKeys.command.inspect.env),
125
+ "development"
126
+ ).option(
127
+ "--output <output>",
128
+ i18n.t(localeKeys.command.inspect.output),
129
+ "/"
130
+ ).option("--verbose", i18n.t(localeKeys.command.inspect.verbose)).option(
131
+ "-c --config <config>",
132
+ i18n.t(localeKeys.command.shared.config)
133
+ ).action(async (options2) => {
134
+ const { inspect } = await import("./commands/inspect");
135
+ inspect(api, options2);
136
+ });
137
+ upgradeModel.defineCommand(program.command("upgrade"));
138
+ },
139
+ async prepare() {
140
+ const command = getCommand();
141
+ if (command === "dev" || command === "start" || command === "build") {
142
+ const appContext = api.useAppContext();
143
+ await emptyDir(appContext.distDirectory);
144
+ }
145
+ },
146
+ async watchFiles() {
147
+ const appContext = api.useAppContext();
148
+ const config = api.useResolvedConfigContext();
149
+ return generateWatchFiles(appContext, config.source.configDir);
150
+ },
151
+ async fileChange(e) {
152
+ const { filename, eventType } = e;
153
+ const appContext = api.useAppContext();
154
+ const { appDirectory, srcDirectory } = appContext;
155
+ const absolutePath = path.resolve(appDirectory, filename);
156
+ if (!absolutePath.includes(srcDirectory) && (eventType === "change" || eventType === "unlink")) {
157
+ const { closeServer } = await import("./utils/createServer");
158
+ await closeServer();
159
+ await restart(api.useHookRunners(), filename);
160
+ }
161
+ },
162
+ async beforeRestart() {
163
+ cleanRequireCache([require.resolve("./analyze")]);
164
+ }
165
+ };
166
+ }
167
+ });
168
+ export {
169
+ buildCommand,
170
+ src_default as default,
171
+ devCommand
172
+ };
@@ -0,0 +1,91 @@
1
+ import {
2
+ ensureAbsolutePath,
3
+ getPort,
4
+ isDev,
5
+ isDevCommand
6
+ } from "@modern-js/utils";
7
+ import { legacySchema, schema } from "../schema";
8
+ import {
9
+ checkIsLegacyConfig,
10
+ createDefaultConfig,
11
+ createLegacyDefaultConfig,
12
+ transformNormalizedConfig
13
+ } from "../config";
14
+ var initialize_default = ({
15
+ bundler
16
+ }) => ({
17
+ name: "@modern-js/plugin-initialize",
18
+ setup(api) {
19
+ const config = () => {
20
+ const appContext = api.useAppContext();
21
+ const userConfig = api.useConfigContext();
22
+ return checkIsLegacyConfig(userConfig) ? createLegacyDefaultConfig(appContext) : createDefaultConfig(appContext, bundler);
23
+ };
24
+ const validateSchema = () => {
25
+ const userConfig = api.useConfigContext();
26
+ const schemas = checkIsLegacyConfig(userConfig) ? legacySchema : schema;
27
+ return schemas.generate();
28
+ };
29
+ return {
30
+ config,
31
+ validateSchema,
32
+ async resolvedConfig({ resolved }) {
33
+ var _a;
34
+ let appContext = api.useAppContext();
35
+ const userConfig = api.useConfigContext();
36
+ const port = await getServerPort(resolved);
37
+ appContext = {
38
+ ...appContext,
39
+ port,
40
+ distDirectory: ensureAbsolutePath(
41
+ appContext.distDirectory,
42
+ ((_a = resolved.output.distPath) == null ? void 0 : _a.root) || "dist"
43
+ )
44
+ };
45
+ api.setAppContext(appContext);
46
+ const normalizedConfig = checkIsLegacyConfig(resolved) ? transformNormalizedConfig(resolved) : resolved;
47
+ resolved._raw = userConfig;
48
+ resolved.server = {
49
+ ...normalizedConfig.server || {},
50
+ port
51
+ };
52
+ resolved.autoLoadPlugins = normalizedConfig.autoLoadPlugins || false;
53
+ stabilizeConfig(resolved, normalizedConfig, [
54
+ "source",
55
+ "bff",
56
+ "dev",
57
+ "html",
58
+ "output",
59
+ "tools",
60
+ "testing",
61
+ "plugins",
62
+ "builderPlugins",
63
+ "runtime",
64
+ "runtimeByEntries",
65
+ "deploy",
66
+ "performance"
67
+ ]);
68
+ if (bundler === "webpack") {
69
+ resolved.security = normalizedConfig.security || {};
70
+ resolved.experiments = normalizedConfig.experiments;
71
+ }
72
+ return { resolved };
73
+ }
74
+ };
75
+ }
76
+ });
77
+ function stabilizeConfig(resolve, config, keys) {
78
+ keys.forEach((key) => {
79
+ resolve[key] = config[key] || {};
80
+ });
81
+ }
82
+ async function getServerPort(config) {
83
+ const prodPort = config.server.port || 8080;
84
+ if (isDev() && isDevCommand()) {
85
+ return getPort(config.dev.port || prodPort);
86
+ }
87
+ return prodPort;
88
+ }
89
+ export {
90
+ initialize_default as default
91
+ };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,88 @@
1
+ import * as path from "path";
2
+ import { bundle } from "@modern-js/node-bundle-require";
3
+ import {
4
+ CONFIG_FILE_EXTENSIONS,
5
+ fs,
6
+ getServerConfig,
7
+ OUTPUT_CONFIG_FILE
8
+ } from "@modern-js/utils";
9
+ const defineServerConfig = (config) => config;
10
+ const buildServerConfig = async ({
11
+ appDirectory,
12
+ distDirectory,
13
+ configFile,
14
+ options
15
+ }) => {
16
+ const configFilePath = await getServerConfig(appDirectory, configFile);
17
+ const getOutputFile = async (filepath) => path.resolve(
18
+ distDirectory,
19
+ `${filepath.replace(
20
+ new RegExp(CONFIG_FILE_EXTENSIONS.join("|")),
21
+ ""
22
+ )}.js`
23
+ );
24
+ if (configFilePath) {
25
+ const configHelperFilePath = path.normalize(
26
+ path.join(distDirectory, "./config-helper.js")
27
+ );
28
+ const helperCode = `
29
+ export const defineConfig = (config) => config;
30
+ `;
31
+ await fs.ensureDir(distDirectory);
32
+ await fs.writeFile(configHelperFilePath, helperCode);
33
+ await bundle(configFilePath, {
34
+ ...options,
35
+ getOutputFile,
36
+ esbuildPlugins: [
37
+ {
38
+ name: "native-build-config",
39
+ setup(ctx) {
40
+ ctx.onResolve(
41
+ {
42
+ filter: /app-tools\/server/
43
+ },
44
+ () => {
45
+ return {
46
+ path: configHelperFilePath
47
+ };
48
+ }
49
+ );
50
+ }
51
+ }
52
+ ]
53
+ });
54
+ }
55
+ };
56
+ const safeReplacer = () => {
57
+ const cache = [];
58
+ const keyCache = [];
59
+ return function(key, value) {
60
+ if (typeof value === "object" && value !== null) {
61
+ const index = cache.indexOf(value);
62
+ if (index !== -1) {
63
+ return `[Circular ${keyCache[index]}]`;
64
+ }
65
+ cache.push(value);
66
+ keyCache.push(key || "root");
67
+ }
68
+ return value;
69
+ };
70
+ };
71
+ const emitResolvedConfig = async (appDirectory, resolvedConfig) => {
72
+ var _a;
73
+ const outputPath = path.join(
74
+ appDirectory,
75
+ ((_a = resolvedConfig.output.distPath) == null ? void 0 : _a.root) || "./dist",
76
+ OUTPUT_CONFIG_FILE
77
+ );
78
+ await fs.writeJSON(outputPath, resolvedConfig, {
79
+ spaces: 2,
80
+ replacer: safeReplacer()
81
+ });
82
+ };
83
+ export {
84
+ buildServerConfig,
85
+ defineServerConfig,
86
+ emitResolvedConfig,
87
+ safeReplacer
88
+ };
@@ -0,0 +1,37 @@
1
+ import { Server } from "@modern-js/server";
2
+ let server = null;
3
+ const getServer = () => server;
4
+ const setServer = (newServer) => {
5
+ server = newServer;
6
+ };
7
+ const closeServer = async () => {
8
+ if (server) {
9
+ await server.close();
10
+ server = null;
11
+ }
12
+ };
13
+ const createServer = async (options) => {
14
+ if (server) {
15
+ await server.close();
16
+ }
17
+ server = new Server(options);
18
+ const app = await server.init();
19
+ return app;
20
+ };
21
+ const injectDataLoaderPlugin = (internalPlugins) => {
22
+ const DataLoaderPlugin = require.resolve("@modern-js/plugin-data-loader/server");
23
+ return {
24
+ ...internalPlugins,
25
+ "@modern-js/plugin-data-loader": {
26
+ path: DataLoaderPlugin,
27
+ forced: true
28
+ }
29
+ };
30
+ };
31
+ export {
32
+ closeServer,
33
+ createServer,
34
+ getServer,
35
+ injectDataLoaderPlugin,
36
+ setServer
37
+ };
File without changes
@@ -0,0 +1,33 @@
1
+ import path from "path";
2
+ import { fs, getServerConfig } from "@modern-js/utils";
3
+ const getPackageConfig = (appDirectory, packageJsonConfig) => {
4
+ const PACKAGE_JSON_CONFIG_NAME = "modernConfig";
5
+ const json = JSON.parse(
6
+ fs.readFileSync(path.resolve(appDirectory, "./package.json"), "utf8")
7
+ );
8
+ return json[packageJsonConfig != null ? packageJsonConfig : PACKAGE_JSON_CONFIG_NAME];
9
+ };
10
+ const addServerConfigToDeps = async (dependencies, appDirectory, serverConfigFile) => {
11
+ const serverConfig = await getServerConfig(appDirectory, serverConfigFile);
12
+ if (serverConfig) {
13
+ dependencies.push(serverConfig);
14
+ }
15
+ };
16
+ async function generateWatchFiles(appContext, configDir) {
17
+ const { appDirectory, configFile } = appContext;
18
+ const configPath = path.join(appDirectory, configDir || "");
19
+ const dependencies = getPackageConfig(
20
+ appContext.appDirectory,
21
+ appContext.packageName
22
+ ) ? [path.resolve(appDirectory, "./package.json")] : [];
23
+ await addServerConfigToDeps(
24
+ dependencies,
25
+ appContext.appDirectory,
26
+ appContext.serverConfigFile
27
+ );
28
+ return [`${configPath}/html`, configFile || "./config", ...dependencies];
29
+ }
30
+ export {
31
+ addServerConfigToDeps,
32
+ generateWatchFiles
33
+ };
@@ -1,32 +1,12 @@
1
- var __async = (__this, __arguments, generator) => {
2
- return new Promise((resolve, reject) => {
3
- var fulfilled = (value) => {
4
- try {
5
- step(generator.next(value));
6
- } catch (e) {
7
- reject(e);
8
- }
9
- };
10
- var rejected = (value) => {
11
- try {
12
- step(generator.throw(value));
13
- } catch (e) {
14
- reject(e);
15
- }
16
- };
17
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18
- step((generator = generator.apply(__this, __arguments)).next());
19
- });
20
- };
21
1
  import { chalk, inquirer } from "@modern-js/utils";
22
2
  import { i18n, localeKeys } from "../locale";
23
- const getSelectedEntries = (entry, entrypoints) => __async(void 0, null, function* () {
3
+ const getSelectedEntries = async (entry, entrypoints) => {
24
4
  const entryNames = entrypoints.map((e) => e.entryName);
25
5
  if (!entry) {
26
6
  return entryNames;
27
7
  }
28
8
  if (typeof entry === "boolean") {
29
- const { selected } = yield inquirer.prompt([
9
+ const { selected } = await inquirer.prompt([
30
10
  {
31
11
  type: "checkbox",
32
12
  name: "selected",
@@ -52,7 +32,7 @@ const getSelectedEntries = (entry, entrypoints) => __async(void 0, null, functio
52
32
  }
53
33
  });
54
34
  return entry;
55
- });
35
+ };
56
36
  export {
57
37
  getSelectedEntries
58
38
  };
@@ -0,0 +1,18 @@
1
+ async function getServerInternalPlugins(api) {
2
+ const hookRunners = api.useHookRunners();
3
+ const { plugins: serverPlugins } = await hookRunners.collectServerPlugins({
4
+ plugins: []
5
+ });
6
+ const serverInternalPlugins = serverPlugins.reduce(
7
+ (result, plugin) => Object.assign(result, plugin),
8
+ {}
9
+ );
10
+ api.setAppContext({
11
+ ...api.useAppContext(),
12
+ serverInternalPlugins
13
+ });
14
+ return serverInternalPlugins;
15
+ }
16
+ export {
17
+ getServerInternalPlugins
18
+ };
File without changes
@@ -0,0 +1,11 @@
1
+ import { prettyInstructions, logger } from "@modern-js/utils";
2
+ const printInstructions = async (hookRunners, appContext, config) => {
3
+ const message = prettyInstructions(appContext, config);
4
+ const { instructions } = await hookRunners.beforePrintInstructions({
5
+ instructions: message
6
+ });
7
+ logger.info(instructions);
8
+ };
9
+ export {
10
+ printInstructions
11
+ };
@@ -0,0 +1,22 @@
1
+ import { cli } from "@modern-js/core";
2
+ import { chalk, clearConsole, logger, program } from "@modern-js/utils";
3
+ async function restart(hooksRunner, filename) {
4
+ clearConsole();
5
+ logger.info(`Restart because ${chalk.yellow(filename)} is changed...
6
+ `);
7
+ let hasGetError = false;
8
+ await hooksRunner.beforeRestart();
9
+ try {
10
+ await cli.init(cli.getPrevInitOptions());
11
+ } catch (err) {
12
+ console.error(err);
13
+ hasGetError = true;
14
+ } finally {
15
+ if (!hasGetError) {
16
+ program.parse(process.argv);
17
+ }
18
+ }
19
+ }
20
+ export {
21
+ restart
22
+ };
@@ -0,0 +1,10 @@
1
+ import path from "path";
2
+ import { fs, ROUTE_SPEC_FILE } from "@modern-js/utils";
3
+ const generateRoutes = async (appContext) => {
4
+ const { serverRoutes, distDirectory } = appContext;
5
+ const output = JSON.stringify({ routes: serverRoutes }, null, 2);
6
+ await fs.outputFile(path.join(distDirectory, ROUTE_SPEC_FILE), output);
7
+ };
8
+ export {
9
+ generateRoutes
10
+ };
File without changes
@@ -8,7 +8,7 @@ import type { UnwrapBuilderConfig } from '../utils';
8
8
  export type BuilderToolsConfig = UnwrapBuilderConfig<BuilderConfig, 'tools'> & {
9
9
  esbuild?: PluginEsbuildOptions;
10
10
  };
11
- export type RsBuilderToolsConfig = UnwrapBuilderConfig<RsBuilderConfig, 'source'>;
11
+ export type RsBuilderToolsConfig = UnwrapBuilderConfig<RsBuilderConfig, 'tools'>;
12
12
  /**
13
13
  * The configuration of `tools.tailwindcss` is provided by `tailwindcss` plugin.
14
14
  * Please use `yarn new` or `pnpm new` to enable the corresponding capability.
@@ -4,6 +4,7 @@ import type { Entrypoint, HtmlPartials, NestedRoute, PageRoute, RouteLegacy, Ser
4
4
  import type { RegisterBuildPlatformResult, DevToolData } from '@modern-js/core';
5
5
  import type { Stats, MultiStats } from '@modern-js/builder-shared';
6
6
  import type { Rspack } from '@modern-js/builder-rspack-provider';
7
+ import { Bundler } from './utils';
7
8
  export interface ImportSpecifier {
8
9
  local?: string;
9
10
  imported?: string;
@@ -18,7 +19,7 @@ export interface RuntimePlugin {
18
19
  options: string;
19
20
  args?: string;
20
21
  }
21
- export type AppToolsHooks = {
22
+ export type AppToolsHooks<B extends Bundler = 'webpack'> = {
22
23
  modifyEntryExport: AsyncWaterfall<{
23
24
  entrypoint: Entrypoint;
24
25
  exportStatement: string;
@@ -61,16 +62,16 @@ export type AppToolsHooks = {
61
62
  beforeDev: AsyncWorkflow<void, unknown>;
62
63
  afterDev: AsyncWorkflow<void, unknown>;
63
64
  beforeCreateCompiler: AsyncWorkflow<{
64
- bundlerConfigs: webpack.Configuration[] | Rspack.Configuration[];
65
+ bundlerConfigs?: B extends 'rspack' ? Rspack.Configuration[] : webpack.Configuration[];
65
66
  }, unknown>;
66
67
  afterCreateCompiler: AsyncWorkflow<{
67
- compiler?: webpack.Compiler | webpack.MultiCompiler | Rspack.Compiler;
68
+ compiler?: B extends 'rspack' ? Rspack.Compiler : webpack.Compiler | webpack.MultiCompiler;
68
69
  }, unknown>;
69
70
  beforePrintInstructions: AsyncWaterfall<{
70
71
  instructions: string;
71
72
  }>;
72
73
  beforeBuild: AsyncWorkflow<{
73
- bundlerConfigs?: webpack.Configuration[] | Rspack.Configuration[];
74
+ bundlerConfigs?: B extends 'rspack' ? Rspack.Configuration[] : webpack.Configuration[];
74
75
  }, unknown>;
75
76
  afterBuild: AsyncWorkflow<{
76
77
  stats?: Stats | MultiStats;
@@ -6,11 +6,13 @@ import { Bundler, FromConfig } from './utils';
6
6
  export * from './hooks';
7
7
  export * from './config';
8
8
  export * from './legacyConfig';
9
+ export type { webpack } from '@modern-js/builder-webpack-provider';
10
+ export type { Rspack } from '@modern-js/builder-rspack-provider';
9
11
  export type { Bundler } from './utils';
10
12
  export type { ServerUserConfig, ServerNormalizedConfig, BffUserConfig, BffNormalizedConfig, SSR, SSRByEntries } from '@modern-js/server-core';
11
13
  export type { IAppContext, PluginAPI, CliPlugin, NormalizedConfig, UserConfig } from '@modern-js/core';
12
14
  export type AppTools<B extends Bundler = 'webpack'> = {
13
- hooks: AppToolsHooks;
15
+ hooks: AppToolsHooks<B>;
14
16
  userConfig: FromConfig<B, {
15
17
  rspack: RsAppToolsUserConfig;
16
18
  webpack: AppToolsUserConfig;