@modern-js/main-doc 2.21.1 → 2.22.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (292) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/docs/en/apis/app/commands.mdx +5 -5
  3. package/docs/en/apis/app/hooks/api/api.mdx +80 -0
  4. package/docs/en/apis/app/hooks/api/app.mdx +12 -0
  5. package/docs/en/apis/app/hooks/api/lambda.mdx +57 -0
  6. package/docs/en/apis/app/hooks/api/test.mdx +1 -1
  7. package/docs/en/apis/app/hooks/config/html.mdx +2 -2
  8. package/docs/en/apis/app/hooks/config/icon.mdx +19 -19
  9. package/docs/en/apis/app/hooks/config/mock.mdx +1 -1
  10. package/docs/en/apis/app/hooks/config/public.mdx +10 -10
  11. package/docs/en/apis/app/hooks/config/storybook.mdx +3 -3
  12. package/docs/en/apis/app/hooks/config/upload.mdx +13 -13
  13. package/docs/en/apis/app/hooks/modern-config.mdx +4 -4
  14. package/docs/en/apis/app/hooks/server/index_.mdx +2 -9
  15. package/docs/en/apis/app/hooks/server/test.mdx +5 -2
  16. package/docs/en/apis/app/hooks/shared.mdx +1 -1
  17. package/docs/en/apis/app/hooks/src/app.mdx +17 -27
  18. package/docs/en/apis/app/hooks/src/index_.mdx +6 -6
  19. package/docs/en/apis/app/hooks/src/pages.mdx +41 -37
  20. package/docs/en/apis/app/hooks/src/routes.mdx +16 -36
  21. package/docs/en/apis/app/hooks/src/server.mdx +1 -1
  22. package/docs/en/apis/app/hooks/src/stories.mdx +6 -3
  23. package/docs/en/apis/app/hooks/src/test.mdx +4 -3
  24. package/docs/en/apis/app/runtime/core/use-runtime-context.mdx +5 -1
  25. package/docs/en/apis/app/runtime/web-server/hook.mdx +2 -2
  26. package/docs/en/apis/app/runtime/web-server/middleware.mdx +2 -2
  27. package/docs/en/components/debug-app.mdx +1 -1
  28. package/docs/en/components/deploy.mdx +1 -0
  29. package/docs/en/components/entry-mode.mdx +0 -0
  30. package/docs/en/components/init-app.mdx +6 -10
  31. package/docs/en/components/init-rspack-app.mdx +4 -4
  32. package/docs/en/components/language-config.mdx +9 -0
  33. package/docs/en/components/package-manager.mdx +11 -0
  34. package/docs/en/components/release-note.mdx +1 -0
  35. package/docs/en/components/ua-polyfill.mdx +2 -2
  36. package/docs/en/configure/app/output/css-modules.mdx +13 -0
  37. package/docs/en/configure/app/source/config-dir.mdx +1 -1
  38. package/docs/en/configure/app/source/design-system.mdx +67 -67
  39. package/docs/en/configure/app/source/disable-default-entries.mdx +6 -5
  40. package/docs/en/configure/app/source/disable-entry-dirs.mdx +5 -5
  41. package/docs/en/configure/app/source/enable-async-entry.mdx +9 -9
  42. package/docs/en/configure/app/source/entries-dir.mdx +3 -3
  43. package/docs/en/configure/app/source/entries.mdx +21 -19
  44. package/docs/en/configure/app/tools/swc.mdx +2 -16
  45. package/docs/en/guides/advanced-features/bff/frameworks.mdx +2 -2
  46. package/docs/en/guides/advanced-features/bff/function.mdx +4 -4
  47. package/docs/en/guides/advanced-features/bff/type.mdx +5 -5
  48. package/docs/en/guides/advanced-features/rspack-start.mdx +7 -8
  49. package/docs/en/guides/advanced-features/ssg.mdx +2 -2
  50. package/docs/en/guides/advanced-features/testing.mdx +2 -2
  51. package/docs/en/guides/advanced-features/web-server.mdx +2 -2
  52. package/docs/en/guides/basic-features/css.mdx +2 -2
  53. package/docs/en/guides/basic-features/mock.mdx +1 -1
  54. package/docs/en/guides/basic-features/routes.mdx +11 -7
  55. package/docs/en/guides/concept/builder.mdx +15 -15
  56. package/docs/en/guides/concept/entries.mdx +50 -49
  57. package/docs/en/guides/get-started/glossary.mdx +12 -12
  58. package/docs/en/guides/get-started/introduction.mdx +17 -20
  59. package/docs/en/guides/get-started/quick-start.mdx +21 -37
  60. package/docs/en/guides/get-started/upgrade.mdx +15 -13
  61. package/docs/en/guides/topic-detail/changesets/_category_.json +4 -0
  62. package/docs/en/guides/topic-detail/changesets/add.mdx +125 -0
  63. package/docs/en/guides/topic-detail/changesets/changelog.mdx +238 -0
  64. package/docs/en/guides/topic-detail/changesets/commit.mdx +269 -0
  65. package/docs/en/guides/topic-detail/changesets/config.mdx +147 -0
  66. package/docs/en/guides/topic-detail/changesets/github.mdx +175 -0
  67. package/docs/en/guides/topic-detail/changesets/introduce.mdx +56 -0
  68. package/docs/en/guides/topic-detail/changesets/release-note.mdx +273 -0
  69. package/docs/en/guides/topic-detail/changesets/release-pre.mdx +49 -0
  70. package/docs/en/guides/topic-detail/changesets/release.mdx +229 -0
  71. package/docs/en/guides/topic-detail/generator/create/_category_.json +4 -0
  72. package/docs/en/guides/topic-detail/generator/create/config.mdx +75 -0
  73. package/docs/en/guides/topic-detail/generator/create/option.md +151 -0
  74. package/docs/en/guides/topic-detail/generator/create/use.mdx +66 -0
  75. package/docs/en/guides/topic-detail/generator/new/_category_.json +4 -0
  76. package/docs/en/guides/topic-detail/generator/new/config.md +155 -0
  77. package/docs/en/guides/topic-detail/generator/new/option.md +67 -0
  78. package/docs/en/guides/topic-detail/generator/new/use.md +95 -0
  79. package/docs/en/guides/topic-detail/generator/plugin/_category_.json +2 -2
  80. package/docs/en/guides/topic-detail/generator/plugin/api/_category_.json +1 -1
  81. package/docs/en/guides/topic-detail/generator/plugin/api/afterForged.md +49 -0
  82. package/docs/en/guides/topic-detail/generator/plugin/api/context.md +184 -0
  83. package/docs/en/guides/topic-detail/generator/plugin/api/input.md +124 -0
  84. package/docs/en/guides/topic-detail/generator/plugin/api/onForged.md +310 -0
  85. package/docs/en/guides/topic-detail/generator/plugin/category.md +88 -0
  86. package/docs/en/guides/topic-detail/generator/plugin/context.md +104 -0
  87. package/docs/en/guides/topic-detail/generator/plugin/structure.md +106 -0
  88. package/docs/en/guides/topic-detail/generator/plugin/use.md +33 -0
  89. package/docs/en/guides/topic-detail/micro-frontend/c02-development.mdx +8 -8
  90. package/docs/en/guides/troubleshooting/builder.mdx +8 -0
  91. package/docs/en/tutorials/first-app/c03-css.mdx +2 -2
  92. package/docs/en/tutorials/first-app/c08-entries.mdx +3 -3
  93. package/docs/zh/apis/app/commands.mdx +3 -3
  94. package/docs/zh/apis/app/hooks/api/{functions/api.mdx → api.mdx} +4 -4
  95. package/docs/zh/apis/app/hooks/api/app.mdx +12 -0
  96. package/docs/zh/apis/app/hooks/api/{framework/lambda.mdx → lambda.mdx} +5 -5
  97. package/docs/zh/apis/app/hooks/api/test.mdx +3 -3
  98. package/docs/zh/apis/app/hooks/config/icon.mdx +15 -15
  99. package/docs/zh/apis/app/hooks/config/mock.mdx +1 -1
  100. package/docs/zh/apis/app/hooks/config/public.mdx +3 -3
  101. package/docs/zh/apis/app/hooks/config/upload.mdx +1 -1
  102. package/docs/zh/apis/app/hooks/modern-config.mdx +3 -3
  103. package/docs/zh/apis/app/hooks/server/index_.mdx +1 -6
  104. package/docs/zh/apis/app/hooks/shared.mdx +1 -1
  105. package/docs/zh/apis/app/hooks/src/app.mdx +15 -25
  106. package/docs/zh/apis/app/hooks/src/index_.mdx +6 -6
  107. package/docs/zh/apis/app/hooks/src/pages.mdx +7 -3
  108. package/docs/zh/apis/app/hooks/src/routes.mdx +4 -4
  109. package/docs/zh/apis/app/hooks/src/stories.mdx +1 -1
  110. package/docs/zh/apis/app/runtime/core/use-runtime-context.mdx +5 -1
  111. package/docs/zh/community/blog/v2-release-note.mdx +1 -1
  112. package/docs/zh/community/contributing-guide.mdx +1 -1
  113. package/docs/zh/components/entry-mode.mdx +0 -0
  114. package/docs/zh/components/init-app.mdx +5 -9
  115. package/docs/zh/components/language-config.mdx +9 -0
  116. package/docs/zh/components/package-manager.mdx +11 -0
  117. package/docs/zh/components/ua-polyfill.mdx +1 -1
  118. package/docs/zh/configure/app/output/css-modules.mdx +13 -0
  119. package/docs/zh/configure/app/source/design-system.mdx +3 -4
  120. package/docs/zh/configure/app/source/enable-async-entry.mdx +2 -5
  121. package/docs/zh/configure/app/source/entries.mdx +2 -2
  122. package/docs/zh/configure/app/tools/swc.mdx +2 -16
  123. package/docs/zh/guides/advanced-features/rspack-start.mdx +7 -8
  124. package/docs/zh/guides/advanced-features/ssg.mdx +1 -1
  125. package/docs/zh/guides/advanced-features/testing.mdx +2 -2
  126. package/docs/zh/guides/advanced-features/web-server.mdx +1 -1
  127. package/docs/zh/guides/basic-features/css.mdx +1 -1
  128. package/docs/zh/guides/basic-features/mock.mdx +1 -1
  129. package/docs/zh/guides/basic-features/routes.mdx +7 -4
  130. package/docs/zh/guides/concept/builder.mdx +1 -1
  131. package/docs/zh/guides/concept/entries.mdx +21 -17
  132. package/docs/zh/guides/get-started/quick-start.mdx +7 -10
  133. package/docs/zh/guides/get-started/upgrade.mdx +1 -1
  134. package/docs/zh/guides/topic-detail/changesets/add.mdx +15 -13
  135. package/docs/zh/guides/topic-detail/changesets/changelog.mdx +20 -20
  136. package/docs/zh/guides/topic-detail/changesets/commit.mdx +12 -14
  137. package/docs/zh/guides/topic-detail/changesets/config.mdx +5 -5
  138. package/docs/zh/guides/topic-detail/changesets/github.mdx +38 -27
  139. package/docs/zh/guides/topic-detail/changesets/introduce.mdx +12 -12
  140. package/docs/zh/guides/topic-detail/changesets/release-note.mdx +84 -70
  141. package/docs/zh/guides/topic-detail/changesets/release-pre.mdx +9 -9
  142. package/docs/zh/guides/topic-detail/changesets/release.mdx +29 -29
  143. package/docs/zh/guides/topic-detail/generator/create/_category_.json +4 -0
  144. package/docs/zh/guides/topic-detail/generator/create/config.mdx +76 -0
  145. package/docs/zh/guides/topic-detail/generator/create/option.md +151 -0
  146. package/docs/zh/guides/topic-detail/generator/create/use.mdx +66 -0
  147. package/docs/zh/guides/topic-detail/generator/new/_category_.json +4 -0
  148. package/docs/zh/guides/topic-detail/generator/new/config.md +153 -0
  149. package/docs/zh/guides/topic-detail/generator/new/option.md +67 -0
  150. package/docs/zh/guides/topic-detail/generator/new/use.md +94 -0
  151. package/docs/zh/guides/topic-detail/generator/plugin/_category_.json +2 -2
  152. package/docs/zh/guides/topic-detail/generator/plugin/api/_category_.json +1 -1
  153. package/docs/zh/guides/topic-detail/generator/plugin/api/afterForged.md +50 -0
  154. package/docs/zh/guides/topic-detail/generator/plugin/api/context.md +184 -0
  155. package/docs/zh/guides/topic-detail/generator/plugin/api/input.md +124 -0
  156. package/docs/zh/guides/topic-detail/generator/plugin/api/onForged.md +310 -0
  157. package/docs/zh/guides/topic-detail/generator/plugin/category.md +93 -0
  158. package/docs/zh/guides/topic-detail/generator/plugin/context.md +105 -0
  159. package/docs/zh/guides/topic-detail/generator/plugin/structure.md +106 -0
  160. package/docs/zh/guides/topic-detail/generator/plugin/use.md +33 -0
  161. package/docs/zh/guides/topic-detail/micro-frontend/c02-development.mdx +4 -4
  162. package/docs/zh/guides/topic-detail/model/test-model.mdx +1 -1
  163. package/docs/zh/guides/troubleshooting/builder.mdx +8 -0
  164. package/docs/zh/tutorials/first-app/c03-css.mdx +1 -1
  165. package/docs/zh/tutorials/first-app/c08-entries.mdx +1 -1
  166. package/package.json +5 -5
  167. package/docs/en/apis/app/hooks/api/framework/_category_.json +0 -4
  168. package/docs/en/apis/app/hooks/api/framework/lambda.mdx +0 -57
  169. package/docs/en/apis/app/hooks/api/functions/_category_.json +0 -4
  170. package/docs/en/apis/app/hooks/api/functions/api.mdx +0 -81
  171. package/docs/en/apis/app/hooks/api/functions/app.mdx +0 -12
  172. package/docs/en/apis/app/hooks/api/functions/common.mdx +0 -9
  173. package/docs/en/guides/topic-detail/generator/codesmith/_category_.json +0 -4
  174. package/docs/en/guides/topic-detail/generator/codesmith/api/_category_.json +0 -4
  175. package/docs/en/guides/topic-detail/generator/codesmith/api/app.mdx +0 -152
  176. package/docs/en/guides/topic-detail/generator/codesmith/api/ejs.mdx +0 -56
  177. package/docs/en/guides/topic-detail/generator/codesmith/api/fs.mdx +0 -54
  178. package/docs/en/guides/topic-detail/generator/codesmith/api/git.mdx +0 -50
  179. package/docs/en/guides/topic-detail/generator/codesmith/api/handlebars.mdx +0 -57
  180. package/docs/en/guides/topic-detail/generator/codesmith/api/json.mdx +0 -56
  181. package/docs/en/guides/topic-detail/generator/codesmith/api/npm.mdx +0 -48
  182. package/docs/en/guides/topic-detail/generator/codesmith/develop.mdx +0 -53
  183. package/docs/en/guides/topic-detail/generator/codesmith/introduce.mdx +0 -47
  184. package/docs/en/guides/topic-detail/generator/codesmith/run-in-js.mdx +0 -47
  185. package/docs/en/guides/topic-detail/generator/codesmith/structure.mdx +0 -89
  186. package/docs/en/guides/topic-detail/generator/config/_category_.json +0 -4
  187. package/docs/en/guides/topic-detail/generator/config/app.mdx +0 -82
  188. package/docs/en/guides/topic-detail/generator/config/common.mdx +0 -100
  189. package/docs/en/guides/topic-detail/generator/config/module.mdx +0 -42
  190. package/docs/en/guides/topic-detail/generator/config/monorepo.mdx +0 -28
  191. package/docs/en/guides/topic-detail/generator/plugin/abstract.mdx +0 -23
  192. package/docs/en/guides/topic-detail/generator/plugin/api/file/_category_.json +0 -4
  193. package/docs/en/guides/topic-detail/generator/plugin/api/file/addFile.mdx +0 -52
  194. package/docs/en/guides/topic-detail/generator/plugin/api/file/addHelper.mdx +0 -26
  195. package/docs/en/guides/topic-detail/generator/plugin/api/file/addManyFile.mdx +0 -58
  196. package/docs/en/guides/topic-detail/generator/plugin/api/file/addPartial.mdx +0 -26
  197. package/docs/en/guides/topic-detail/generator/plugin/api/file/introduce.mdx +0 -39
  198. package/docs/en/guides/topic-detail/generator/plugin/api/file/rmDir.mdx +0 -24
  199. package/docs/en/guides/topic-detail/generator/plugin/api/file/rmFile.mdx +0 -24
  200. package/docs/en/guides/topic-detail/generator/plugin/api/file/updateJSONFile.mdx +0 -54
  201. package/docs/en/guides/topic-detail/generator/plugin/api/file/updateModernConfig.mdx +0 -27
  202. package/docs/en/guides/topic-detail/generator/plugin/api/file/updateTextRawFile.mdx +0 -33
  203. package/docs/en/guides/topic-detail/generator/plugin/api/git/_category_.json +0 -4
  204. package/docs/en/guides/topic-detail/generator/plugin/api/git/gitAddAndCommit.mdx +0 -20
  205. package/docs/en/guides/topic-detail/generator/plugin/api/git/initGitRepo.mdx +0 -16
  206. package/docs/en/guides/topic-detail/generator/plugin/api/git/isInGitRepo.mdx +0 -16
  207. package/docs/en/guides/topic-detail/generator/plugin/api/hook/_category_.json +0 -4
  208. package/docs/en/guides/topic-detail/generator/plugin/api/hook/afterForged.mdx +0 -35
  209. package/docs/en/guides/topic-detail/generator/plugin/api/hook/onForged.mdx +0 -35
  210. package/docs/en/guides/topic-detail/generator/plugin/api/info/_category_.json +0 -4
  211. package/docs/en/guides/topic-detail/generator/plugin/api/info/isFileExit.mdx +0 -22
  212. package/docs/en/guides/topic-detail/generator/plugin/api/info/locale.mdx +0 -17
  213. package/docs/en/guides/topic-detail/generator/plugin/api/info/readDir.mdx +0 -22
  214. package/docs/en/guides/topic-detail/generator/plugin/api/input/_category_.json +0 -4
  215. package/docs/en/guides/topic-detail/generator/plugin/api/input/addInputAfter.mdx +0 -55
  216. package/docs/en/guides/topic-detail/generator/plugin/api/input/addInputBefore.mdx +0 -55
  217. package/docs/en/guides/topic-detail/generator/plugin/api/input/setInput.mdx +0 -43
  218. package/docs/en/guides/topic-detail/generator/plugin/api/input/setInputValue.mdx +0 -31
  219. package/docs/en/guides/topic-detail/generator/plugin/api/input/type.mdx +0 -65
  220. package/docs/en/guides/topic-detail/generator/plugin/api/introduce.mdx +0 -90
  221. package/docs/en/guides/topic-detail/generator/plugin/api/new/_category_.json +0 -4
  222. package/docs/en/guides/topic-detail/generator/plugin/api/new/createElement.mdx +0 -33
  223. package/docs/en/guides/topic-detail/generator/plugin/api/new/createSubProject.mdx +0 -35
  224. package/docs/en/guides/topic-detail/generator/plugin/api/new/enableFunc.mdx +0 -44
  225. package/docs/en/guides/topic-detail/generator/plugin/api/new/introduce.mdx +0 -15
  226. package/docs/en/guides/topic-detail/generator/plugin/api/npm/_category_.json +0 -4
  227. package/docs/en/guides/topic-detail/generator/plugin/api/npm/install.mdx +0 -18
  228. package/docs/en/guides/topic-detail/generator/plugin/develop.mdx +0 -125
  229. package/docs/en/guides/topic-detail/generator/plugin/use.mdx +0 -61
  230. package/docs/en/guides/topic-detail/generator/project.mdx +0 -118
  231. package/docs/zh/apis/app/hooks/api/framework/_category_.json +0 -4
  232. package/docs/zh/apis/app/hooks/api/functions/_category_.json +0 -4
  233. package/docs/zh/apis/app/hooks/api/functions/app.mdx +0 -12
  234. package/docs/zh/apis/app/hooks/api/functions/common.mdx +0 -9
  235. package/docs/zh/guides/topic-detail/generator/codesmith/_category_.json +0 -4
  236. package/docs/zh/guides/topic-detail/generator/codesmith/api/_category_.json +0 -4
  237. package/docs/zh/guides/topic-detail/generator/codesmith/api/app.mdx +0 -152
  238. package/docs/zh/guides/topic-detail/generator/codesmith/api/ejs.mdx +0 -56
  239. package/docs/zh/guides/topic-detail/generator/codesmith/api/fs.mdx +0 -54
  240. package/docs/zh/guides/topic-detail/generator/codesmith/api/git.mdx +0 -49
  241. package/docs/zh/guides/topic-detail/generator/codesmith/api/handlebars.mdx +0 -56
  242. package/docs/zh/guides/topic-detail/generator/codesmith/api/json.mdx +0 -56
  243. package/docs/zh/guides/topic-detail/generator/codesmith/api/npm.mdx +0 -47
  244. package/docs/zh/guides/topic-detail/generator/codesmith/develop.mdx +0 -53
  245. package/docs/zh/guides/topic-detail/generator/codesmith/introduce.mdx +0 -59
  246. package/docs/zh/guides/topic-detail/generator/codesmith/run-in-js.mdx +0 -47
  247. package/docs/zh/guides/topic-detail/generator/codesmith/structure.mdx +0 -89
  248. package/docs/zh/guides/topic-detail/generator/config/_category_.json +0 -4
  249. package/docs/zh/guides/topic-detail/generator/config/app.mdx +0 -82
  250. package/docs/zh/guides/topic-detail/generator/config/common.mdx +0 -100
  251. package/docs/zh/guides/topic-detail/generator/config/module.mdx +0 -42
  252. package/docs/zh/guides/topic-detail/generator/config/monorepo.mdx +0 -28
  253. package/docs/zh/guides/topic-detail/generator/plugin/abstract.mdx +0 -23
  254. package/docs/zh/guides/topic-detail/generator/plugin/api/file/_category_.json +0 -4
  255. package/docs/zh/guides/topic-detail/generator/plugin/api/file/addFile.mdx +0 -52
  256. package/docs/zh/guides/topic-detail/generator/plugin/api/file/addHelper.mdx +0 -26
  257. package/docs/zh/guides/topic-detail/generator/plugin/api/file/addManyFile.mdx +0 -55
  258. package/docs/zh/guides/topic-detail/generator/plugin/api/file/addPartial.mdx +0 -26
  259. package/docs/zh/guides/topic-detail/generator/plugin/api/file/introduce.mdx +0 -39
  260. package/docs/zh/guides/topic-detail/generator/plugin/api/file/rmDir.mdx +0 -24
  261. package/docs/zh/guides/topic-detail/generator/plugin/api/file/rmFile.mdx +0 -24
  262. package/docs/zh/guides/topic-detail/generator/plugin/api/file/updateJSONFile.mdx +0 -54
  263. package/docs/zh/guides/topic-detail/generator/plugin/api/file/updateModernConfig.mdx +0 -27
  264. package/docs/zh/guides/topic-detail/generator/plugin/api/file/updateTextRawFile.mdx +0 -33
  265. package/docs/zh/guides/topic-detail/generator/plugin/api/git/_category_.json +0 -4
  266. package/docs/zh/guides/topic-detail/generator/plugin/api/git/gitAddAndCommit.mdx +0 -20
  267. package/docs/zh/guides/topic-detail/generator/plugin/api/git/initGitRepo.mdx +0 -16
  268. package/docs/zh/guides/topic-detail/generator/plugin/api/git/isInGitRepo.mdx +0 -16
  269. package/docs/zh/guides/topic-detail/generator/plugin/api/hook/_category_.json +0 -4
  270. package/docs/zh/guides/topic-detail/generator/plugin/api/hook/afterForged.mdx +0 -35
  271. package/docs/zh/guides/topic-detail/generator/plugin/api/hook/onForged.mdx +0 -35
  272. package/docs/zh/guides/topic-detail/generator/plugin/api/info/_category_.json +0 -4
  273. package/docs/zh/guides/topic-detail/generator/plugin/api/info/isFileExit.mdx +0 -22
  274. package/docs/zh/guides/topic-detail/generator/plugin/api/info/locale.mdx +0 -17
  275. package/docs/zh/guides/topic-detail/generator/plugin/api/info/readDir.mdx +0 -22
  276. package/docs/zh/guides/topic-detail/generator/plugin/api/input/_category_.json +0 -4
  277. package/docs/zh/guides/topic-detail/generator/plugin/api/input/addInputAfter.mdx +0 -57
  278. package/docs/zh/guides/topic-detail/generator/plugin/api/input/addInputBefore.mdx +0 -56
  279. package/docs/zh/guides/topic-detail/generator/plugin/api/input/setInput.mdx +0 -43
  280. package/docs/zh/guides/topic-detail/generator/plugin/api/input/setInputValue.mdx +0 -29
  281. package/docs/zh/guides/topic-detail/generator/plugin/api/input/type.mdx +0 -65
  282. package/docs/zh/guides/topic-detail/generator/plugin/api/introduce.mdx +0 -92
  283. package/docs/zh/guides/topic-detail/generator/plugin/api/new/_category_.json +0 -4
  284. package/docs/zh/guides/topic-detail/generator/plugin/api/new/createElement.mdx +0 -33
  285. package/docs/zh/guides/topic-detail/generator/plugin/api/new/createSubProject.mdx +0 -35
  286. package/docs/zh/guides/topic-detail/generator/plugin/api/new/enableFunc.mdx +0 -44
  287. package/docs/zh/guides/topic-detail/generator/plugin/api/new/introduce.mdx +0 -15
  288. package/docs/zh/guides/topic-detail/generator/plugin/api/npm/_category_.json +0 -4
  289. package/docs/zh/guides/topic-detail/generator/plugin/api/npm/install.mdx +0 -16
  290. package/docs/zh/guides/topic-detail/generator/plugin/develop.mdx +0 -125
  291. package/docs/zh/guides/topic-detail/generator/plugin/use.mdx +0 -61
  292. package/docs/zh/guides/topic-detail/generator/project.mdx +0 -118
@@ -4,11 +4,15 @@ sidebar_position: 3
4
4
  ---
5
5
  # pages/
6
6
 
7
- Entry identifier if the application want uses file system-based routing.
7
+ The identifier for the entry point when the application uses the [`Pages` entry](https://modernjs.dev/v1/docs/guides/usages/entries#pages-%E5%85%A5%E5%8F%A3) type.
8
8
 
9
- When the entry is the **Pages entry** type, the files in the `pages/` directory will be analyzed to client side routing.
9
+ :::info
10
+ Compatible with Modern.js 1.0 `Pages` entry. It is recommended to use [conventional routing](guides/basic-features/routes.html#conventional-routing).
11
+ :::
12
+
13
+ When the project structure is of the `Pages entry` type, the client-side routing configuration will be obtained by analyzing the files in the `src/pages` directory.
10
14
 
11
- For example, the following directory:
15
+ For example, the following directory structure:
12
16
 
13
17
  ```bash
14
18
  .
@@ -20,7 +24,7 @@ For example, the following directory:
20
24
  └── info.jsx
21
25
  ```
22
26
 
23
- The generated route is configured as:
27
+ The corresponding generated routing configuration is:
24
28
 
25
29
  ```bash
26
30
  [
@@ -30,22 +34,22 @@ The generated route is configured as:
30
34
  ]
31
35
  ```
32
36
 
33
- Files match the following conditions will not be treated as routing files:
37
+ Files under the pages directory that meet the following conditions will not be treated as routing files:
34
38
 
35
- - suffix is not `.(j|t)sx?`.
36
- - `.d.ts` type definition file.
37
- - test file suffix like `.(test|spec|e2e).(j|t)sx?`.
39
+ - Files whose suffix is not `.(j|t)sx?`.
40
+ - `.d.ts` type definition files.
41
+ - Test files ending in `.test.(j|t)sx?` or `.spec.(j|t)sx?` or `.e2e.(j|t)sx?`.
38
42
 
39
43
  :::tip
40
- it is recommended to write only the routing files in the `pages/`, and write the business logic to the independent features directory outside the `pages/`. In this way, most of the files in the pages directory will be routing files, and there is no need for additional filtering rules.
44
+ It is recommended to only write entry code in the pages directory and write business logic in the independent features directory outside the pages directory. In this way, most of the files under the pages directory will be routing files, and there is no need for additional filtering rules.
41
45
 
42
46
  :::
43
47
 
44
48
  ### Dynamic Routing
45
49
 
46
- Directories or files wrapped with `[]` are considered dynamic routing.
50
+ If the directory name of the route file is named with [], the generated route will be used as a dynamic route.
47
51
 
48
- For example the following directory structure:
52
+ For example, the following directory structure:
49
53
 
50
54
  ```bash
51
55
  .
@@ -60,7 +64,7 @@ For example the following directory structure:
60
64
  └── info.jsx
61
65
  ```
62
66
 
63
- The generated route is configured as:
67
+ The corresponding generated routing configuration is:
64
68
 
65
69
  ```js
66
70
  [
@@ -72,13 +76,13 @@ The generated route is configured as:
72
76
  ]
73
77
  ```
74
78
 
75
- Basis dynamic routing, it supports adding special routing suffixes `(*、?、+)`.
79
+ On the basis of dynamic routing, special routing suffixes `(*, ?, +)` can be added.
76
80
 
77
- For example: `src/pages/users/[id]*.tsx` generate route `/users/:id*`
81
+ For example: `src/pages/users/[id]*.tsx` will result in the route `/users/:id*`.
78
82
 
79
83
  ### Global Layout
80
84
 
81
- When the entire App needs a global `layout`, it can be achieved through `pages/_app.tsx`, which as follows:
85
+ When the entire application needs a global `layout`, it can be achieved through `pages/_app.tsx`. The specific writing method is as follows:
82
86
 
83
87
  ```js
84
88
  import React from 'react';
@@ -93,9 +97,9 @@ export const App = ({Component, ...pageProps}:{ Component: React.ComponentType})
93
97
  }
94
98
  ```
95
99
 
96
- The above `Component` is the component to which the route is accessed.
100
+ The above `Component` is the component matched when accessing a specific route.
97
101
 
98
- For example the following directory structure:
102
+ For example, the following directory structure:
99
103
 
100
104
  ```bash
101
105
  .
@@ -107,26 +111,26 @@ For example the following directory structure:
107
111
  └── index.js
108
112
  ```
109
113
 
110
- - access `/`, the `Component` is `pages/index.js`.
111
- - access `/a`, the `Component` is `pages/a/index.js`.
112
- - access `/a/b`, the `Component` is `pages/a/b/index.js`.
114
+ - Accessing `/` corresponds to the `Component` component in `pages/index.js`.
115
+ - Accessing `/a` corresponds to the `Component` component in `pages/a/index.js`.
116
+ - Accessing `/a/b` corresponds to the `Component` component in `pages/a/b/index.js`.
113
117
 
114
- :::tip Advantages
118
+ :::tip Advantages of global layout
115
119
 
116
- - preserve the state of the global layout when the page changes.
117
- - add global css.
118
- - handle ComponentDidCatch error
119
- - use [defineConfig](/apis/app/runtime/app/define-config) dynamic configuration runtime.
120
+ - Preserve the state of the global layout when the page changes.
121
+ - Add global styles.
122
+ - ComponentDidCatch error handling.
123
+ - Use [defineConfig](/apis/app/runtime/app/define-config) to dynamically configure the runtime configuration.
120
124
 
121
125
  :::
122
126
 
123
127
  ### Partial Layout
124
128
 
125
- When developing an App, where sub routes under the same route may share the layout.
129
+ When developing an application, there are scenarios where sub-routes under the same route share a layout.
126
130
 
127
- For this scene, Modern.js convention, when there is a `_layout.js` in the directory, the routes can shared this layout.
131
+ For this scenario, Modern.js conventionally has a similar effect to global layout when there is `_layout.js` under the directory.
128
132
 
129
- For example the following directory structure:
133
+ For example, the following directory structure:
130
134
 
131
135
  ```bash
132
136
  └── pages
@@ -147,18 +151,18 @@ const ALayout = ({ Component, ...pageProps }) => {
147
151
  export default ALayout;
148
152
  ```
149
153
 
150
- The Component props is the specific route, for example
154
+ The `Component` parameter is the component corresponding to a specific accessed route, for example:
151
155
 
152
- - access `/a`, the `Component` is `pages/a/index.js`.
153
- - 访问 `/a/b`, the `Component` is `pages/a/b/index.js`.
156
+ - Accessing `/a` corresponds to the `Component` component in `pages/a/index.js`.
157
+ - Accessing `/a/b` corresponds to the `Component` component in `pages/a/b/index.js`.
154
158
 
155
- In this way, you can use `pages/a/_layout.js` to display the routing common layout in the `a` directory.
159
+ In this way, `pages/a/_layout.js` can be used to meet the layout needs of shared routes under the `a` directory.
156
160
 
157
- ### 404 路由
161
+ ### 404 Route
158
162
 
159
- The convention `pages/404.[tj]sx` is the default 404 route.
163
+ `pages/404.[tj]sx` is conventionally the default 404 route.
160
164
 
161
- For example the following directory structure:
165
+ For example, the following directory structure:
162
166
 
163
167
  ```bash
164
168
  .
@@ -169,7 +173,7 @@ For example the following directory structure:
169
173
  ├── 404.js
170
174
  ```
171
175
 
172
- the generated route is configured is as:
176
+ The generated routing configuration is as follows:
173
177
 
174
178
  ```bash
175
179
  [
@@ -179,4 +183,4 @@ the generated route is configured is as:
179
183
  ]
180
184
  ```
181
185
 
182
- All unmatched routes will match to `pages/404.[tj]s`.
186
+ All unmatched routes will be matched to `pages/404.[tj]s`.
@@ -4,13 +4,13 @@ sidebar_position: 2
4
4
  ---
5
5
  # routes/
6
6
 
7
- The entry identifier when the application uses file system-based routing.
7
+ The identifier for the entry point when the application uses [Conventional Routing](guides/basic-features/routes.html#conventional-routing).
8
8
 
9
- When the project structure is of type `Routes directory entry`, the files in the `src/routes` directory are parsed to get the client-side routing configuration. See [Routing by convention](/guides/basic-features/routes) for more details on usage.
9
+ Conventional routing uses `routes/` as the convention for the entry point and analyzes the files in the `src/routes` directory to obtain the client-side routing configuration.
10
10
 
11
- Any `layout.[tj]sx` and `page.[tj]sx` under `src/routes` will be used as a route to the application:
11
+ Any `layout.[tj]sx` and `page.[tj]sx` under `src/routes` will be used as the application's routes:
12
12
 
13
- ```bash {3}
13
+ ```bash {3,4}
14
14
  .
15
15
  └── routes
16
16
  ├── layout.tsx
@@ -20,9 +20,9 @@ Any `layout.[tj]sx` and `page.[tj]sx` under `src/routes` will be used as a route
20
20
  └── page.tsx
21
21
  ```
22
22
 
23
- ## basic example
23
+ ## Basic Example
24
24
 
25
- The directory names in the `routes` directory will be used as a mapping of the route url, where `layout.tsx` is used as the layout component and `page.tsx` as the content component, which is a leaf node of the whole route, for example the following directory structure:
25
+ The directory name under `routes` will be used as the mapping of the route URL. `layout.tsx` is used as the layout component and `page.tsx` is used as the content component in the routing. They are the leaf nodes of the entire route. For example, the following directory structure:
26
26
 
27
27
  ```bash
28
28
  .
@@ -32,14 +32,14 @@ The directory names in the `routes` directory will be used as a mapping of the r
32
32
  └── page.tsx
33
33
  ```
34
34
 
35
- The following two routes are produced:
35
+ will generate two routes:
36
36
 
37
37
  - `/`
38
38
  - `/user`
39
39
 
40
- ## Dynamic Route
40
+ ## Dynamic Routing
41
41
 
42
- If the directory name of the route file is named with `[]`, the generated route will be used as a dynamic route. For example, the following file directories:
42
+ If the directory name of the route file is named with `[]`, the generated route will be used as a dynamic route. For example, the following file directory:
43
43
 
44
44
  ```
45
45
  └── routes
@@ -50,35 +50,15 @@ If the directory name of the route file is named with `[]`, the generated route
50
50
  └── page.tsx
51
51
  ```
52
52
 
53
- The `routes/[id]/page.tsx` file will be converted to a `/:id` route. All `/xxx` will match that route, except for the `/blog` route, which can be matched exactly.
53
+ The `routes/[id]/page.tsx` file will be converted to the `/:id` route. Except for the `/blog` route that can be matched exactly, all other `/xxx` routes will be matched to this route.
54
54
 
55
- In the component, you can get the corresponding parameters by [useParams](/apis/app/runtime/router/router#useparams).
55
+ In the component, you can use [useParams](/apis/app/runtime/router/router#useparams) to obtain the corresponding named parameter.
56
56
 
57
- In the loader, params will be used as input to [loader](/guides/basic-features/data-fetch#loader-function), and the corresponding parameters can be retrieved through the property `params`.
57
+ When using the [loader](/guides/basic-features/data-fetch#the-loader-function) function to obtain data, `params` will be passed as an input parameter to the `loader` function, and the corresponding parameter can be obtained through the attribute of `params`.
58
58
 
59
- ## Dynamic Optional Routes
59
+ ## Layout Component
60
60
 
61
- By using file directories named with `[$]`, the generated routes will be treated as dynamic routes. For example, the following file directory:
62
-
63
- ```
64
- └── routes
65
- ├── user
66
- │ └── [id$]
67
- │ └── page.tsx
68
- ├── blog
69
- │ └── page.tsx
70
- └── page.tsx
71
- ```
72
-
73
- The `routes/user/[id$]/page.tsx` file will be converted to the `/user/:id?` route. All routes under `/user` will match this route, and the `id` parameter is optional. This route is commonly used to differentiate between **creating** and **editing**.
74
-
75
- In the component, you can get the corresponding named parameters using [useParams](/apis/app/runtime/router/router#useparams).
76
-
77
- In the loader, params will be passed as an argument to the [loader](/guides/basic-features/data-fetch#loader-函数), and you can get them through `params.xxx`.
78
-
79
- ## Layout component
80
-
81
- As in the example below, you can add a common layout component for all routing components by adding `layout.tsx`
61
+ In the following example, a common layout component can be added to all route components by adding `layout.tsx`:
82
62
 
83
63
  ```bash
84
64
  .
@@ -90,7 +70,7 @@ As in the example below, you can add a common layout component for all routing c
90
70
  └── page.tsx
91
71
  ```
92
72
 
93
- You can represent child components in layout components by using `<Outlet>`:
73
+ In the layout component, you can use `<Outlet>` to represent the child components:
94
74
 
95
75
  ```tsx title=routes/layout.tsx
96
76
  import { Link, Outlet, useLoaderData } from '@modern-js/runtime/router';
@@ -105,6 +85,6 @@ export default () => {
105
85
  ```
106
86
 
107
87
  :::note
108
- `<Outlet>` is a new API in React Router 6, see [Outlet] for details(https://reactrouter.com/en/main/components/outlet#outlet).
88
+ `<Outlet>` is a new API in React Router 6. For details, see [Outlet](https://reactrouter.com/en/main/components/outlet#outlet).
109
89
 
110
90
  :::
@@ -4,4 +4,4 @@ sidebar_position: 8
4
4
  ---
5
5
  # *.[server|node].[tj]sx
6
6
 
7
- Used in application projects to place server side code, When `*.tsx` and `*. [server|node].tsx` coexist, rendering on the server side will give preference to the `*. [server|node].tsx` file instead of the `*.tsx` file.
7
+ Used in the application project to place server-side code. When `*.tsx` and `*.[server|node].tsx` coexist, SSR will prefer to use the `*.[server|node].tsx` file instead of the `*.tsx` file when rendering on the server.
@@ -4,11 +4,14 @@ sidebar_position: 7
4
4
  ---
5
5
  # **/*.stories.[tj]sx
6
6
 
7
- App Storybook debug file. files in `src/` which suffix `*.stories.[tj]sx` are as debug files for Storybook.
7
+ Application project Storybook files.
8
8
 
9
- Execute the `dev story` command to debugging these files in the Storybook.
9
+ You can create files in the `*.stories.[tj]sx` format in the project source code directory `src/` as Storybook files.
10
+
11
+ Run the `npm run dev story` command in the project to use these files to debug relevant content in Storybook.
10
12
 
11
13
  :::info
12
- Using a Storybook requires executing `new` command to enable the Visual Testing (Storybook) mode.
14
+ To use Storybook, you need to enable the "Visual Testing (Storybook)" mode by running the `new` command in the project first.
13
15
 
14
16
  :::
17
+
@@ -2,13 +2,14 @@
2
2
  title: '**/*.test.[tj]sx?'
3
3
  sidebar_position: 6
4
4
  ---
5
+
5
6
  # **/*.test.[tj]sx?
6
7
 
7
- App test file.
8
+ Application project test files.
8
9
 
9
- The App supports the file suffixed with `.test.[tj]sx` under the `src/` to write test cases.
10
+ The application project supports creating files with the suffix `.test.[tj]sx?` in the project source code directory (`src`) to write test cases.
10
11
 
11
12
  :::info
12
- To use unit test and integration test, you need to execute the `new` command in advance to enable the `unit test/integration test`.
13
+ To use unit testing and integration testing, you need to enable the "Unit Testing / Integration Testing" feature by running the `new` command in the project first.
13
14
 
14
15
  :::
@@ -28,6 +28,7 @@ type RuntimeContext = {
28
28
  cookie: string;
29
29
  };
30
30
  store: ReduckStore;
31
+ router: RemixRouter;
31
32
  };
32
33
 
33
34
  function useRuntimeContext(): RuntimeContext;
@@ -41,7 +42,10 @@ function useRuntimeContext(): RuntimeContext;
41
42
  - `query`: the query of the request.
42
43
  - `headers`: the header info of the request.
43
44
  - `cookie`: the cookie of the request.
44
- - `store`: when the runtime.state is enabled, this value is the reduck global `store`.
45
+ - `store`: when the `runtime.state` is enabled, this value is the Reduck global `store`.
46
+ - `router`: When the `runtime.router` is enabled, this value exists.
47
+ - `location`: The current location reflected by the router. The same as [`useLocation`] the return value of (/apis/app/runtime/router/router.html#uselocation).
48
+ - `navigate`: Navigate to the given path. The same as the return value of [`useNavigate`](/apis/app/runtime/router/router.html#usenavigate).
45
49
 
46
50
  ## Example
47
51
 
@@ -24,8 +24,8 @@ Before using this API, please execute `pnpm run new` to create a new "Custom Web
24
24
 
25
25
  ```bash
26
26
  pnpm run new
27
- ? Action Create project element
28
- ? New "Custom Web Server" source code directory
27
+ ? Please select the operation you want: Create Elements
28
+ ? Please select the type of element to create: New "Custom Web Server" source code directory
29
29
  ```
30
30
 
31
31
  :::
@@ -27,8 +27,8 @@ Before using this API, please execute `pnpm run new` to create a new "Custom Web
27
27
 
28
28
  ```bash
29
29
  pnpm run new
30
- ? Action Create project element
31
- ? New "Custom Web Server" source code directory
30
+ ? Please select the operation you want: Create Element
31
+ ? Please select the type of element to create: New "Custom Web Server" source code directory
32
32
  ```
33
33
 
34
34
  :::
@@ -1,4 +1,4 @@
1
- Execute `pnpm run dev` in the project to start the project:
1
+ Run `pnpm run dev` in the project to start the project:
2
2
 
3
3
  ```bash
4
4
  $ pnpm run dev
@@ -0,0 +1 @@
1
+ After local verification, you can organize the artifacts in `dist/` into the structure required by the server for deployment.
File without changes
@@ -1,12 +1,13 @@
1
- Modern.js generator will provide an interactive Q & A interface, initialization items according to the result, according to the default selection:
1
+ `@modern-js/create` provides an interactive Q & A interface to initialize the project based on the results, with initialization performed according to the default settings:
2
2
 
3
3
  ```bash
4
- ? Please select the solution you want to create: Web App
5
- ? Development Language: TS
6
- ? Package Manager: pnpm
4
+ ? Please select the type of project you want to create: Web App
5
+ ? Please select the programming language: TS
6
+ ? Please select the package manager: pnpm
7
+ ? Please select the bundler: webpack
7
8
  ```
8
9
 
9
- After create the project, Modern.js automatically installs dependency and creates a git repository.
10
+ After create the project, Modern.js will automatically install dependencies and create a git repository.
10
11
 
11
12
  ```bash
12
13
  [INFO] dependencies are automatically installed
@@ -20,11 +21,6 @@ pnpm run lint # Run ESLint and automatically fix problems
20
21
  pnpm run new # Enable optional features or add a new entry
21
22
  ```
22
23
 
23
- :::note
24
- In addition to working during project initialization, the Modern.js generator can also generate modules of the project in subsequent development, which is not thrown away as soon as it is used.
25
-
26
- :::
27
-
28
24
  Now, the project structure is as follows:
29
25
 
30
26
  ```
@@ -1,7 +1,7 @@
1
1
  ```bash
2
2
  $ npx @modern-js/create@latest myapp
3
- ? Please select the solution you want to create: Web App
4
- ? Development Language: TS
5
- ? Package Manager: pnpm
6
- ? Bundler: Rspack
3
+ ? Please select the type of project you want to create: Web App
4
+ ? Please select the programming language: TS
5
+ ? Please select the package manager: pnpm
6
+ ? Please select the bundler: Rspack
7
7
  ```
@@ -0,0 +1,9 @@
1
+ ### language
2
+
3
+ Question: Please select the programming language.
4
+
5
+ Options:
6
+
7
+ - TS -- ts
8
+
9
+ - ES6+ -- js
@@ -0,0 +1,11 @@
1
+ ### packageManager
2
+
3
+ Question: Please select the package manager.
4
+
5
+ Options:
6
+
7
+ - pnpm -- pnpm
8
+
9
+ - Yarn -- yarn
10
+
11
+ - npm -- npm
@@ -0,0 +1 @@
1
+ According to the [Release Note](https://github.com/web-infra-dev/modern.js/releases) on the official website, developers can also manually upgrade the project to the desired version.
@@ -9,8 +9,8 @@ Modern.js also provides a runtime Polyfill solution based on browser [UA](https:
9
9
  exec `pnpm run new` to enable this features:
10
10
 
11
11
  ```bash
12
- ? Action Enable features
13
- ? Enable features Enable UA-based Polyfill Feature
12
+ ? Please select the operation you want: Enable features
13
+ ? Please select the feature name: Enable UA-based Polyfill Feature
14
14
  ```
15
15
 
16
16
  After executing the command, register the Polyfill plugin in `modern.config.ts`:
@@ -0,0 +1,13 @@
1
+ ---
2
+ sidebar_label: cssModules
3
+ ---
4
+
5
+ # output.cssModules
6
+
7
+ :::tip
8
+ This config is provided by Modern.js Builder, more detail can see [output.cssModules](https://modernjs.dev/builder/en/api/config-output.html#outputcssmodules).
9
+ :::
10
+
11
+ import Main from '@modern-js/builder-doc/docs/en/config/output/cssModules.md';
12
+
13
+ <Main />
@@ -9,7 +9,7 @@ sidebar_label: configDir
9
9
 
10
10
  Modern.js supports placing some files in the `./config` folder to customize HTML templates, icons, static resources, etc. For details, please refer to [File Convention](/apis/app/hooks/config/html).
11
11
 
12
- This option allows you to customize the directory of configuration files.
12
+ This option allows you to customize the directory of the configuration files.
13
13
 
14
14
  For example, adjust the resource file directory to the `resources` directory:
15
15