@modern-js/main-doc 2.21.0 → 2.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (256) hide show
  1. package/CHANGELOG.md +24 -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/global-proxy.mdx +7 -7
  28. package/docs/en/components/init-app.mdx +3 -3
  29. package/docs/en/components/init-rspack-app.mdx +4 -4
  30. package/docs/en/components/language-config.mdx +9 -0
  31. package/docs/en/components/package-manager.mdx +11 -0
  32. package/docs/en/components/ua-polyfill.mdx +2 -2
  33. package/docs/en/configure/app/source/config-dir.mdx +1 -1
  34. package/docs/en/configure/app/source/design-system.mdx +67 -67
  35. package/docs/en/configure/app/source/disable-default-entries.mdx +6 -5
  36. package/docs/en/configure/app/source/disable-entry-dirs.mdx +5 -5
  37. package/docs/en/configure/app/source/enable-async-entry.mdx +9 -9
  38. package/docs/en/configure/app/source/entries-dir.mdx +3 -3
  39. package/docs/en/configure/app/source/entries.mdx +21 -19
  40. package/docs/en/configure/app/tools/swc.mdx +2 -2
  41. package/docs/en/guides/advanced-features/bff/frameworks.mdx +2 -2
  42. package/docs/en/guides/advanced-features/bff/function.mdx +4 -4
  43. package/docs/en/guides/advanced-features/bff/type.mdx +5 -5
  44. package/docs/en/guides/advanced-features/rspack-start.mdx +6 -6
  45. package/docs/en/guides/advanced-features/ssg.mdx +2 -2
  46. package/docs/en/guides/advanced-features/testing.mdx +2 -2
  47. package/docs/en/guides/advanced-features/web-server.mdx +2 -2
  48. package/docs/en/guides/basic-features/css.mdx +2 -2
  49. package/docs/en/guides/basic-features/mock.mdx +1 -1
  50. package/docs/en/guides/basic-features/proxy.mdx +4 -5
  51. package/docs/en/guides/basic-features/routes.mdx +11 -7
  52. package/docs/en/guides/concept/entries.mdx +3 -3
  53. package/docs/en/guides/topic-detail/generator/create/_category_.json +4 -0
  54. package/docs/en/guides/topic-detail/generator/create/config.mdx +75 -0
  55. package/docs/en/guides/topic-detail/generator/create/option.md +151 -0
  56. package/docs/en/guides/topic-detail/generator/create/use.mdx +66 -0
  57. package/docs/en/guides/topic-detail/generator/new/_category_.json +4 -0
  58. package/docs/en/guides/topic-detail/generator/new/config.md +155 -0
  59. package/docs/en/guides/topic-detail/generator/new/option.md +67 -0
  60. package/docs/en/guides/topic-detail/generator/new/use.md +95 -0
  61. package/docs/en/guides/topic-detail/generator/plugin/_category_.json +2 -2
  62. package/docs/en/guides/topic-detail/generator/plugin/api/_category_.json +1 -1
  63. package/docs/en/guides/topic-detail/generator/plugin/api/afterForged.md +49 -0
  64. package/docs/en/guides/topic-detail/generator/plugin/api/context.md +184 -0
  65. package/docs/en/guides/topic-detail/generator/plugin/api/input.md +124 -0
  66. package/docs/en/guides/topic-detail/generator/plugin/api/onForged.md +310 -0
  67. package/docs/en/guides/topic-detail/generator/plugin/category.md +88 -0
  68. package/docs/en/guides/topic-detail/generator/plugin/context.md +104 -0
  69. package/docs/en/guides/topic-detail/generator/plugin/structure.md +106 -0
  70. package/docs/en/guides/topic-detail/generator/plugin/use.md +33 -0
  71. package/docs/en/guides/topic-detail/micro-frontend/c02-development.mdx +8 -8
  72. package/docs/en/tutorials/first-app/c03-css.mdx +2 -2
  73. package/docs/en/tutorials/first-app/c08-entries.mdx +3 -3
  74. package/docs/zh/apis/app/commands.mdx +3 -3
  75. package/docs/zh/apis/app/hooks/api/{functions/api.mdx → api.mdx} +4 -4
  76. package/docs/zh/apis/app/hooks/api/app.mdx +12 -0
  77. package/docs/zh/apis/app/hooks/api/{framework/lambda.mdx → lambda.mdx} +5 -5
  78. package/docs/zh/apis/app/hooks/api/test.mdx +3 -3
  79. package/docs/zh/apis/app/hooks/config/icon.mdx +15 -15
  80. package/docs/zh/apis/app/hooks/config/mock.mdx +1 -1
  81. package/docs/zh/apis/app/hooks/config/public.mdx +3 -3
  82. package/docs/zh/apis/app/hooks/config/upload.mdx +1 -1
  83. package/docs/zh/apis/app/hooks/modern-config.mdx +3 -3
  84. package/docs/zh/apis/app/hooks/server/index_.mdx +1 -6
  85. package/docs/zh/apis/app/hooks/shared.mdx +1 -1
  86. package/docs/zh/apis/app/hooks/src/app.mdx +15 -25
  87. package/docs/zh/apis/app/hooks/src/index_.mdx +6 -6
  88. package/docs/zh/apis/app/hooks/src/pages.mdx +7 -3
  89. package/docs/zh/apis/app/hooks/src/routes.mdx +4 -4
  90. package/docs/zh/apis/app/hooks/src/stories.mdx +1 -1
  91. package/docs/zh/apis/app/runtime/core/use-runtime-context.mdx +5 -1
  92. package/docs/zh/components/language-config.mdx +9 -0
  93. package/docs/zh/components/package-manager.mdx +11 -0
  94. package/docs/zh/components/ua-polyfill.mdx +1 -1
  95. package/docs/zh/configure/app/source/design-system.mdx +3 -4
  96. package/docs/zh/configure/app/source/enable-async-entry.mdx +2 -5
  97. package/docs/zh/configure/app/source/entries.mdx +2 -2
  98. package/docs/zh/configure/app/tools/swc.mdx +2 -2
  99. package/docs/zh/guides/advanced-features/rspack-start.mdx +6 -6
  100. package/docs/zh/guides/advanced-features/ssg.mdx +1 -1
  101. package/docs/zh/guides/advanced-features/testing.mdx +2 -2
  102. package/docs/zh/guides/advanced-features/web-server.mdx +1 -1
  103. package/docs/zh/guides/basic-features/css.mdx +1 -1
  104. package/docs/zh/guides/basic-features/mock.mdx +1 -1
  105. package/docs/zh/guides/basic-features/routes.mdx +7 -4
  106. package/docs/zh/guides/concept/entries.mdx +3 -3
  107. package/docs/zh/guides/topic-detail/generator/create/_category_.json +4 -0
  108. package/docs/zh/guides/topic-detail/generator/create/config.mdx +76 -0
  109. package/docs/zh/guides/topic-detail/generator/create/option.md +151 -0
  110. package/docs/zh/guides/topic-detail/generator/create/use.mdx +66 -0
  111. package/docs/zh/guides/topic-detail/generator/new/_category_.json +4 -0
  112. package/docs/zh/guides/topic-detail/generator/new/config.md +153 -0
  113. package/docs/zh/guides/topic-detail/generator/new/option.md +67 -0
  114. package/docs/zh/guides/topic-detail/generator/new/use.md +94 -0
  115. package/docs/zh/guides/topic-detail/generator/plugin/_category_.json +2 -2
  116. package/docs/zh/guides/topic-detail/generator/plugin/api/_category_.json +1 -1
  117. package/docs/zh/guides/topic-detail/generator/plugin/api/afterForged.md +50 -0
  118. package/docs/zh/guides/topic-detail/generator/plugin/api/context.md +184 -0
  119. package/docs/zh/guides/topic-detail/generator/plugin/api/input.md +124 -0
  120. package/docs/zh/guides/topic-detail/generator/plugin/api/onForged.md +310 -0
  121. package/docs/zh/guides/topic-detail/generator/plugin/category.md +93 -0
  122. package/docs/zh/guides/topic-detail/generator/plugin/context.md +105 -0
  123. package/docs/zh/guides/topic-detail/generator/plugin/structure.md +106 -0
  124. package/docs/zh/guides/topic-detail/generator/plugin/use.md +33 -0
  125. package/docs/zh/guides/topic-detail/micro-frontend/c02-development.mdx +4 -4
  126. package/docs/zh/guides/topic-detail/model/test-model.mdx +1 -1
  127. package/docs/zh/tutorials/first-app/c03-css.mdx +1 -1
  128. package/docs/zh/tutorials/first-app/c08-entries.mdx +1 -1
  129. package/modern.config.ts +2 -1
  130. package/package.json +5 -5
  131. package/docs/en/apis/app/hooks/api/framework/_category_.json +0 -4
  132. package/docs/en/apis/app/hooks/api/framework/lambda.mdx +0 -57
  133. package/docs/en/apis/app/hooks/api/functions/_category_.json +0 -4
  134. package/docs/en/apis/app/hooks/api/functions/api.mdx +0 -81
  135. package/docs/en/apis/app/hooks/api/functions/app.mdx +0 -12
  136. package/docs/en/apis/app/hooks/api/functions/common.mdx +0 -9
  137. package/docs/en/guides/topic-detail/generator/codesmith/_category_.json +0 -4
  138. package/docs/en/guides/topic-detail/generator/codesmith/api/_category_.json +0 -4
  139. package/docs/en/guides/topic-detail/generator/codesmith/api/app.mdx +0 -152
  140. package/docs/en/guides/topic-detail/generator/codesmith/api/ejs.mdx +0 -56
  141. package/docs/en/guides/topic-detail/generator/codesmith/api/fs.mdx +0 -54
  142. package/docs/en/guides/topic-detail/generator/codesmith/api/git.mdx +0 -50
  143. package/docs/en/guides/topic-detail/generator/codesmith/api/handlebars.mdx +0 -57
  144. package/docs/en/guides/topic-detail/generator/codesmith/api/json.mdx +0 -56
  145. package/docs/en/guides/topic-detail/generator/codesmith/api/npm.mdx +0 -48
  146. package/docs/en/guides/topic-detail/generator/codesmith/develop.mdx +0 -53
  147. package/docs/en/guides/topic-detail/generator/codesmith/introduce.mdx +0 -47
  148. package/docs/en/guides/topic-detail/generator/codesmith/run-in-js.mdx +0 -47
  149. package/docs/en/guides/topic-detail/generator/codesmith/structure.mdx +0 -89
  150. package/docs/en/guides/topic-detail/generator/config/_category_.json +0 -4
  151. package/docs/en/guides/topic-detail/generator/config/app.mdx +0 -82
  152. package/docs/en/guides/topic-detail/generator/config/common.mdx +0 -100
  153. package/docs/en/guides/topic-detail/generator/config/module.mdx +0 -42
  154. package/docs/en/guides/topic-detail/generator/config/monorepo.mdx +0 -28
  155. package/docs/en/guides/topic-detail/generator/plugin/abstract.mdx +0 -23
  156. package/docs/en/guides/topic-detail/generator/plugin/api/file/_category_.json +0 -4
  157. package/docs/en/guides/topic-detail/generator/plugin/api/file/addFile.mdx +0 -52
  158. package/docs/en/guides/topic-detail/generator/plugin/api/file/addHelper.mdx +0 -26
  159. package/docs/en/guides/topic-detail/generator/plugin/api/file/addManyFile.mdx +0 -58
  160. package/docs/en/guides/topic-detail/generator/plugin/api/file/addPartial.mdx +0 -26
  161. package/docs/en/guides/topic-detail/generator/plugin/api/file/introduce.mdx +0 -39
  162. package/docs/en/guides/topic-detail/generator/plugin/api/file/rmDir.mdx +0 -24
  163. package/docs/en/guides/topic-detail/generator/plugin/api/file/rmFile.mdx +0 -24
  164. package/docs/en/guides/topic-detail/generator/plugin/api/file/updateJSONFile.mdx +0 -54
  165. package/docs/en/guides/topic-detail/generator/plugin/api/file/updateModernConfig.mdx +0 -27
  166. package/docs/en/guides/topic-detail/generator/plugin/api/file/updateTextRawFile.mdx +0 -33
  167. package/docs/en/guides/topic-detail/generator/plugin/api/git/_category_.json +0 -4
  168. package/docs/en/guides/topic-detail/generator/plugin/api/git/gitAddAndCommit.mdx +0 -20
  169. package/docs/en/guides/topic-detail/generator/plugin/api/git/initGitRepo.mdx +0 -16
  170. package/docs/en/guides/topic-detail/generator/plugin/api/git/isInGitRepo.mdx +0 -16
  171. package/docs/en/guides/topic-detail/generator/plugin/api/hook/_category_.json +0 -4
  172. package/docs/en/guides/topic-detail/generator/plugin/api/hook/afterForged.mdx +0 -35
  173. package/docs/en/guides/topic-detail/generator/plugin/api/hook/onForged.mdx +0 -35
  174. package/docs/en/guides/topic-detail/generator/plugin/api/info/_category_.json +0 -4
  175. package/docs/en/guides/topic-detail/generator/plugin/api/info/isFileExit.mdx +0 -22
  176. package/docs/en/guides/topic-detail/generator/plugin/api/info/locale.mdx +0 -17
  177. package/docs/en/guides/topic-detail/generator/plugin/api/info/readDir.mdx +0 -22
  178. package/docs/en/guides/topic-detail/generator/plugin/api/input/_category_.json +0 -4
  179. package/docs/en/guides/topic-detail/generator/plugin/api/input/addInputAfter.mdx +0 -55
  180. package/docs/en/guides/topic-detail/generator/plugin/api/input/addInputBefore.mdx +0 -55
  181. package/docs/en/guides/topic-detail/generator/plugin/api/input/setInput.mdx +0 -43
  182. package/docs/en/guides/topic-detail/generator/plugin/api/input/setInputValue.mdx +0 -31
  183. package/docs/en/guides/topic-detail/generator/plugin/api/input/type.mdx +0 -65
  184. package/docs/en/guides/topic-detail/generator/plugin/api/introduce.mdx +0 -90
  185. package/docs/en/guides/topic-detail/generator/plugin/api/new/_category_.json +0 -4
  186. package/docs/en/guides/topic-detail/generator/plugin/api/new/createElement.mdx +0 -33
  187. package/docs/en/guides/topic-detail/generator/plugin/api/new/createSubProject.mdx +0 -35
  188. package/docs/en/guides/topic-detail/generator/plugin/api/new/enableFunc.mdx +0 -44
  189. package/docs/en/guides/topic-detail/generator/plugin/api/new/introduce.mdx +0 -15
  190. package/docs/en/guides/topic-detail/generator/plugin/api/npm/_category_.json +0 -4
  191. package/docs/en/guides/topic-detail/generator/plugin/api/npm/install.mdx +0 -18
  192. package/docs/en/guides/topic-detail/generator/plugin/develop.mdx +0 -125
  193. package/docs/en/guides/topic-detail/generator/plugin/use.mdx +0 -61
  194. package/docs/en/guides/topic-detail/generator/project.mdx +0 -118
  195. package/docs/zh/apis/app/hooks/api/framework/_category_.json +0 -4
  196. package/docs/zh/apis/app/hooks/api/functions/_category_.json +0 -4
  197. package/docs/zh/apis/app/hooks/api/functions/app.mdx +0 -12
  198. package/docs/zh/apis/app/hooks/api/functions/common.mdx +0 -9
  199. package/docs/zh/guides/topic-detail/generator/codesmith/_category_.json +0 -4
  200. package/docs/zh/guides/topic-detail/generator/codesmith/api/_category_.json +0 -4
  201. package/docs/zh/guides/topic-detail/generator/codesmith/api/app.mdx +0 -152
  202. package/docs/zh/guides/topic-detail/generator/codesmith/api/ejs.mdx +0 -56
  203. package/docs/zh/guides/topic-detail/generator/codesmith/api/fs.mdx +0 -54
  204. package/docs/zh/guides/topic-detail/generator/codesmith/api/git.mdx +0 -49
  205. package/docs/zh/guides/topic-detail/generator/codesmith/api/handlebars.mdx +0 -56
  206. package/docs/zh/guides/topic-detail/generator/codesmith/api/json.mdx +0 -56
  207. package/docs/zh/guides/topic-detail/generator/codesmith/api/npm.mdx +0 -47
  208. package/docs/zh/guides/topic-detail/generator/codesmith/develop.mdx +0 -53
  209. package/docs/zh/guides/topic-detail/generator/codesmith/introduce.mdx +0 -59
  210. package/docs/zh/guides/topic-detail/generator/codesmith/run-in-js.mdx +0 -47
  211. package/docs/zh/guides/topic-detail/generator/codesmith/structure.mdx +0 -89
  212. package/docs/zh/guides/topic-detail/generator/config/_category_.json +0 -4
  213. package/docs/zh/guides/topic-detail/generator/config/app.mdx +0 -82
  214. package/docs/zh/guides/topic-detail/generator/config/common.mdx +0 -100
  215. package/docs/zh/guides/topic-detail/generator/config/module.mdx +0 -42
  216. package/docs/zh/guides/topic-detail/generator/config/monorepo.mdx +0 -28
  217. package/docs/zh/guides/topic-detail/generator/plugin/abstract.mdx +0 -23
  218. package/docs/zh/guides/topic-detail/generator/plugin/api/file/_category_.json +0 -4
  219. package/docs/zh/guides/topic-detail/generator/plugin/api/file/addFile.mdx +0 -52
  220. package/docs/zh/guides/topic-detail/generator/plugin/api/file/addHelper.mdx +0 -26
  221. package/docs/zh/guides/topic-detail/generator/plugin/api/file/addManyFile.mdx +0 -55
  222. package/docs/zh/guides/topic-detail/generator/plugin/api/file/addPartial.mdx +0 -26
  223. package/docs/zh/guides/topic-detail/generator/plugin/api/file/introduce.mdx +0 -39
  224. package/docs/zh/guides/topic-detail/generator/plugin/api/file/rmDir.mdx +0 -24
  225. package/docs/zh/guides/topic-detail/generator/plugin/api/file/rmFile.mdx +0 -24
  226. package/docs/zh/guides/topic-detail/generator/plugin/api/file/updateJSONFile.mdx +0 -54
  227. package/docs/zh/guides/topic-detail/generator/plugin/api/file/updateModernConfig.mdx +0 -27
  228. package/docs/zh/guides/topic-detail/generator/plugin/api/file/updateTextRawFile.mdx +0 -33
  229. package/docs/zh/guides/topic-detail/generator/plugin/api/git/_category_.json +0 -4
  230. package/docs/zh/guides/topic-detail/generator/plugin/api/git/gitAddAndCommit.mdx +0 -20
  231. package/docs/zh/guides/topic-detail/generator/plugin/api/git/initGitRepo.mdx +0 -16
  232. package/docs/zh/guides/topic-detail/generator/plugin/api/git/isInGitRepo.mdx +0 -16
  233. package/docs/zh/guides/topic-detail/generator/plugin/api/hook/_category_.json +0 -4
  234. package/docs/zh/guides/topic-detail/generator/plugin/api/hook/afterForged.mdx +0 -35
  235. package/docs/zh/guides/topic-detail/generator/plugin/api/hook/onForged.mdx +0 -35
  236. package/docs/zh/guides/topic-detail/generator/plugin/api/info/_category_.json +0 -4
  237. package/docs/zh/guides/topic-detail/generator/plugin/api/info/isFileExit.mdx +0 -22
  238. package/docs/zh/guides/topic-detail/generator/plugin/api/info/locale.mdx +0 -17
  239. package/docs/zh/guides/topic-detail/generator/plugin/api/info/readDir.mdx +0 -22
  240. package/docs/zh/guides/topic-detail/generator/plugin/api/input/_category_.json +0 -4
  241. package/docs/zh/guides/topic-detail/generator/plugin/api/input/addInputAfter.mdx +0 -57
  242. package/docs/zh/guides/topic-detail/generator/plugin/api/input/addInputBefore.mdx +0 -56
  243. package/docs/zh/guides/topic-detail/generator/plugin/api/input/setInput.mdx +0 -43
  244. package/docs/zh/guides/topic-detail/generator/plugin/api/input/setInputValue.mdx +0 -29
  245. package/docs/zh/guides/topic-detail/generator/plugin/api/input/type.mdx +0 -65
  246. package/docs/zh/guides/topic-detail/generator/plugin/api/introduce.mdx +0 -92
  247. package/docs/zh/guides/topic-detail/generator/plugin/api/new/_category_.json +0 -4
  248. package/docs/zh/guides/topic-detail/generator/plugin/api/new/createElement.mdx +0 -33
  249. package/docs/zh/guides/topic-detail/generator/plugin/api/new/createSubProject.mdx +0 -35
  250. package/docs/zh/guides/topic-detail/generator/plugin/api/new/enableFunc.mdx +0 -44
  251. package/docs/zh/guides/topic-detail/generator/plugin/api/new/introduce.mdx +0 -15
  252. package/docs/zh/guides/topic-detail/generator/plugin/api/npm/_category_.json +0 -4
  253. package/docs/zh/guides/topic-detail/generator/plugin/api/npm/install.mdx +0 -16
  254. package/docs/zh/guides/topic-detail/generator/plugin/develop.mdx +0 -125
  255. package/docs/zh/guides/topic-detail/generator/plugin/use.mdx +0 -61
  256. package/docs/zh/guides/topic-detail/generator/project.mdx +0 -118
@@ -6,7 +6,7 @@ title: Frameworks
6
6
 
7
7
  Modern.js's BFF supports different runtime frameworks, currently Modern.js's BFF supports two runtime frameworks[Express.js](https://expressjs.com/) 和 [Koa.js](https://koajs.com/).
8
8
 
9
- ## Function Writing
9
+ ## Function Mode
10
10
 
11
11
  Under the function writing, only the middleware writing method of various runtime frameworks is different, and other implementations are basically the same. Take Express as an example to introduce how to write a middleware by hand in the `api/_ app.ts` and add permission verification:
12
12
 
@@ -96,7 +96,7 @@ Refresh the page and you can see that `/api/hello` was accessed successfully:
96
96
 
97
97
  The above code simulates the way to add middleware to the `/api/_app.ts` to achieve an easy login function. Also, other functions can be implemented in this hook file to extend BFF Server.
98
98
 
99
- ## Framework Writing
99
+ ## Framework Mode
100
100
 
101
101
  Under the framework writing, Modern.js does not collect middleware in the `api/_app.ts`, and the running process is controlled by the plugin itself.
102
102
 
@@ -51,10 +51,10 @@ Execute `pnpm run dev`, then open `http://localhost:8080/` to see that the page
51
51
 
52
52
  In Modern.js, the BFF function routing system is implemented based on the file system, and it is also a conventional routing system.
53
53
 
54
- In **Function Writing**, All files under `api/` will map to an interface. In **Framework Writing**, All files under `api/lambda` will map to an interface
54
+ In **Function Mode**, All files under `api/` will map to an interface. In **Framework Mode**, All files under `api/lambda` will map to an interface
55
55
 
56
56
  :::note
57
- Function Writing & Framework Writing will introduce soon.
57
+ Function Mode & Framework Mode will introduce soon.
58
58
 
59
59
  :::
60
60
 
@@ -69,14 +69,14 @@ Files named `index.[jt]s` are mapped to the previous directory.
69
69
  - `api/index.ts` -> `{prefix}/`
70
70
  - `api/user/index.ts` -> `{prefix}/user`
71
71
 
72
- ### Multi-layer Route
72
+ ### Multi-layer Routing
73
73
 
74
74
  Supports parsing nested files, if you create a nested folder structure, the files will still automatically parse routes in the same way.
75
75
 
76
76
  - `api/hello.ts` -> `{prefix}/hello`
77
77
  - `api/user/list.ts` -> `{prefix}/user/list`
78
78
 
79
- ### Dynamic Route
79
+ ### Dynamic Routing
80
80
 
81
81
  Create folders or files named with `[xxx]` to support dynamic named routing parameters.
82
82
 
@@ -1,19 +1,19 @@
1
1
  ---
2
2
  sidebar_position: 2
3
- title: Writing Type
3
+ title: BFF Type
4
4
  ---
5
- # Writing Type
5
+ # BFF Type
6
6
 
7
7
  Runtime framework support is also an important part of **BFF**. Modern.js supports extending BFF's runtime framework through plugins, and provides a series of built-in plugins, developers can directly use the conventions and ecology of the framework.
8
8
 
9
- The plugin is compatible with most of the specifications of these frameworks, and each framework needs to provide two types of ways to extend the writing of BFF functions, namely **Function Writing** and **Framework Writing**.
9
+ The plugin is compatible with most of the specifications of these frameworks, and each framework needs to provide two types of ways to extend the writing of BFF functions, namely **Function Mode** and **Framework Mode**.
10
10
 
11
11
  :::note
12
12
  Whether the current `api/` directory structure is written as a framework is determined by the corresponding plugin, Modern.js don't care.
13
13
 
14
14
  :::
15
15
 
16
- ## Function Writing
16
+ ## Function Mode
17
17
 
18
18
  When the plugin considers that it is currently written as a function, it must support writing middleware in the `api/_ app.ts` to extend the BFF function.
19
19
 
@@ -32,7 +32,7 @@ The writing of middleware for different plugins is not the same, see [Runtime Fr
32
32
 
33
33
  :::
34
34
 
35
- ## Framework Writing
35
+ ## Framework Mode
36
36
 
37
37
  Framework writing is a way of using frame structure to extend BFF functions. Compared with function writing, although frame writing can use more frame structure and make the entire BFF Server clearer in complex scenarios, it is also more complex and requires more attention to the content at the framework level.
38
38
 
@@ -30,14 +30,14 @@ When using Rspack as the bundler, the following Features are temporarily unavail
30
30
 
31
31
  :::
32
32
 
33
- ## Migrating from webpack to Rspack
33
+ ## Enable Rspack build
34
34
 
35
35
  You can enable Rspack build by running `pnpm run new`:
36
36
 
37
37
  ```bash
38
38
  $ pnpm run new
39
- ? Action: Enable features
40
- ? Enable features: Enable Rspack Build
39
+ ? Please select the operation you want: Enable features
40
+ ? Please select the feature name: Enable Rspack Build
41
41
  ```
42
42
 
43
43
  After executing the command, enable the Rspack build in `modern.config.ts`:
@@ -54,9 +54,9 @@ import appTools, { defineConfig } from '@modern-js/app-tools';
54
54
  });
55
55
  ```
56
56
 
57
- :::tip
58
- When migrating from webpack to Rspack, there may have some differences in build and configuration capabilities. For more details, please refer to [Configuration Differences](https://modernjs.dev/builder/en/guide/advanced/rspack-start.html#migrating-from-webpack-to-rspack).
59
- :::
57
+ ## Migrating configuration
58
+
59
+ After enabling Rspack building capability, further configuration migration is needed by referring to the [Configuration Differences](https://modernjs.dev/builder/en/guide/advanced/rspack-start.html#migrating-from-webpack-to-rspack).
60
60
 
61
61
  ## The relationship between Rspack and Modern.js versions
62
62
 
@@ -9,8 +9,8 @@ Static Site Generation is a solution for rendering complete static web pages at
9
9
  First need to execute `pnpm run new` to enable the SSG features:
10
10
 
11
11
  ```bash
12
- ? Action Enable features
13
- ? Enable features Enable SSG
12
+ ? Please select the operation you want: Enable features
13
+ ? Please select the feature name: Enable SSG
14
14
  ```
15
15
 
16
16
  After execute script, register SSG plugin in `modern.config.ts`:
@@ -9,8 +9,8 @@ Modern.js integrates the testing capabilities of [Jest](https://jestjs.io/) by d
9
9
  First need to execute `pnpm run new` enable [unit test/integration test] features:
10
10
 
11
11
  ```
12
- ? Action: Enable features
13
- ? Enable features: Enable Unit Test / Integration Test
12
+ ? Please select the operation you want: Enable features
13
+ ? Please select the feature name: Enable Unit Test / Integration Test
14
14
  ```
15
15
 
16
16
  After executing the above command, the `"test": "modern test"` command will be automatically generated in package.json.
@@ -27,8 +27,8 @@ Because the full web server cannot be controlled this way, and the extension log
27
27
  You can execute the'pnpm run new 'command in the project root directory to enable the "Custom Web Serve" function:
28
28
 
29
29
  ```bash
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
  After executing the command, register the `@modern-js/plugin-server` plugin in `modern.config.ts`:
@@ -66,8 +66,8 @@ If you need to use other CSS-in-JS libraries such as [styled-jsx](https://www.np
66
66
  Follow the steps below to make a selection:
67
67
 
68
68
  ```bash
69
- ? Action: Enable features
70
- ? Enable features: Enable Tailwind CSS
69
+ ? Please select the operation you want: Enable features
70
+ ? Please select the feature name: Enable Tailwind CSS
71
71
  ```
72
72
 
73
73
  Register the Tailwind plugin in `modern.config.ts`:
@@ -32,7 +32,7 @@ export default {
32
32
  /* the default method is GET */
33
33
  '/api/getExample': { id: 1 },
34
34
 
35
- /* You can use custom functions to dynamically return data */
35
+ /* You can use custom functions to dynamically return data, req and res are both Node.js HTTP objects. */
36
36
  'POST /api/addInfo': (req, res, next) => {
37
37
  res.setHeader('Access-Control-Allow-Origin', '*');
38
38
  res.end('200');
@@ -6,7 +6,7 @@ sidebar_position: 5
6
6
 
7
7
  ## Local Proxy
8
8
 
9
- Modern.js provides a way to configure the development proxy in [tools.devServer](/configure/app/tools/dev-server). For example, to proxy the local interface to an online address:
9
+ Modern.js provides a way to configure the development proxy in [`tools.devServer`](/configure/app/tools/dev-server). For example, to proxy the local interface to an online address:
10
10
 
11
11
  ```ts title="modern.config.ts"
12
12
  import { defineConfig } from '@modern-js/app-tools';
@@ -25,11 +25,10 @@ export default defineConfig({
25
25
  });
26
26
  ```
27
27
 
28
- when access `http://localhost:8080/go/api`, the response content is returned from [http://www.example.com/](http://www.example.com/).
28
+ When access `http://localhost:8080/go/api`, the response content will be returned from [http://www.example.com/](http://www.example.com/).
29
29
 
30
30
  :::info
31
31
  For more detail, see [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware).
32
-
33
32
  :::
34
33
 
35
34
  ## Global Proxy
@@ -40,7 +39,7 @@ import GlobalProxy from "@site-docs-en/components/global-proxy"
40
39
 
41
40
  ## BFF Proxy
42
41
 
43
- By configuring [`bff.proxy`](/configure/app/bff/proxy), you can proxy BFF API requests to specified services. Unlike other proxy above, it can also be used in the production environment:
42
+ By configuring [`bff.proxy`](/configure/app/bff/proxy), BFF API requests can be proxied to a specified service. Unlike the other proxy methods above, it can be used in the production environment:
44
43
 
45
44
  ```ts title="modern.config.ts"
46
45
  export default defineConfig({
@@ -52,7 +51,7 @@ export default defineConfig({
52
51
  });
53
52
  ```
54
53
 
55
- For example, when a BFF call is used in the code, the final request `http://localhost:8080/api/v1/topics` will auto proxy to `https://cnodejs.org/api/v1/topics`:
54
+ For example, when using BFF function in the code, the final request `http://localhost:8080/api/v1/topics` will be automatically proxied to `https://cnodejs.org/api/v1/topics`:
56
55
 
57
56
  ```js
58
57
  import getTopics from '@api/v1/topics';
@@ -182,7 +182,7 @@ Routes generated from file directories named with `[$]` will be treated as dynam
182
182
 
183
183
  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 usually used to distinguish between **creation** and **editing**.
184
184
 
185
- In the component, you can use [useParams](/apis/app/runtime/router/router#useparams) to obtain the corresponding named parameter.
185
+ In the component, you can use [useParams](/apis/app/runtime/router/router#useparams) to get the corresponding named parameter.
186
186
 
187
187
  In the loader, params will be passed as the input parameter of the [loader function](/guides/basic-features/data-fetch#loader-function), and you can get the parameter value through `params.xxx`.
188
188
 
@@ -191,7 +191,7 @@ In the loader, params will be passed as the input parameter of the [loader funct
191
191
  If you create a `$.tsx` file under the routes directory, it will be treated as the catch-all routing component. When there is no matching route, this component will be rendered.
192
192
 
193
193
  :::note
194
- `$.tsx` can be considered as a special `page` route component. When there is a `layout` component in the current directory, `$.tsx` will be rendered as a child component of `layout`.
194
+ `$.tsx` can be considered as a special `page` route component. When there is a `layout.tsx` file in the current directory, `$.tsx` will be rendered as a child component of `layout`.
195
195
  :::
196
196
 
197
197
  For example, the following directory structure:
@@ -215,7 +215,7 @@ params['*']; // => 'aaa/bbb'
215
215
 
216
216
  ### No-path Layout
217
217
 
218
- When the directory name starts with `__`, the corresponding directory name will not be converted to an actual route path. For example, the following file directory:
218
+ When the directory name starts with `__`, the directory name will not be converted to an actual route path. For example, the following file directory:
219
219
 
220
220
  ```bash
221
221
  .
@@ -449,7 +449,7 @@ However, this also brings a problem: if the chunk corresponding to the route has
449
449
 
450
450
  In this case, you can define a `Loading` component to display a custom `Loading` component before the static resources are loaded.
451
451
 
452
- To further improve the user experience and reduce loading time, Modern.js supports defining the `prefetch` attribute on the Link component to preload static resources and data. The `prefetch` attribute has three optional values:
452
+ To further improve the user experience and reduce loading time, Modern.js supports defining the `prefetch` attribute on the Link component to preload static resources and data.
453
453
 
454
454
  ```tsx
455
455
  <Link prefetch="intent" to="page">
@@ -461,6 +461,8 @@ To further improve the user experience and reduce loading time, Modern.js suppor
461
461
 
462
462
  :::
463
463
 
464
+ The `prefetch` attribute has three optional values:
465
+
464
466
  - `none`: default value, no prefetching, no additional behavior.
465
467
  - `intent`: This is the value we recommend for most scenarios. When you hover over the Link, the corresponding chunk and data defined in the data loader will be loaded automatically. When you move the mouse away, the loading will be cancelled automatically. In our tests, even fast clicks can reduce loading time by about 200ms.
466
468
  - `render`: The corresponding chunk and data defined in the Data Loader will be loaded when the Link component is rendered.
@@ -504,8 +506,6 @@ export default () => {
504
506
  Modern.js provides a series of optimizations for resource loading and rendering for conventional routing by default, and provides out-of-the-box SSR capabilities. When using self-controlled routing, developers need to encapsulate these capabilities themselves. It is recommended to use conventional routing.
505
507
  :::
506
508
 
507
- When using self-controlled routing, if the developer turns off the [`runtime.router`](/configure/app/runtime/router) configuration and uses `react-router-dom` directly, they also need to wrap it according to the React Router documentation.
508
-
509
509
  ## Other
510
510
 
511
511
  By default, Modern.js will enable the built-in routing scheme, which is React Router.
@@ -518,7 +518,9 @@ export default defineConfig({
518
518
  });
519
519
  ```
520
520
 
521
- Modern.js exposes the API of React Router from the `@modern-js/runtime/router` namespace for developers to use, ensuring that developers and Modern.js use the same code. In addition, in this case, the React Router code will be bundled into the JS output. If the project already has its own routing scheme or does not need to use client-side routing, this feature can be turned off.
521
+ As mentioned above, when the [`runtime.router`](/configure/app/runtime/router) configuration is enabled, Modern.js will export the API of React Router from the `@modern-js/runtime/router` namespace for developers to use, ensuring that developers and Modern.js are using the same code, and automatically wrapping the `Provider` component according to the router configuration. In addition, in this case, the code of React Router will be packed into the JS output.
522
+
523
+ If the project already has its own routing plan or does not need to use client-side routing, this feature can be disabled.
522
524
 
523
525
  ```js
524
526
  export default defineConfig({
@@ -527,3 +529,5 @@ export default defineConfig({
527
529
  },
528
530
  });
529
531
  ```
532
+
533
+ As mentioned above, if the [`runtime.router`](/configure/app/runtime/router) configuration is disabled and `react-router-dom` is used directly for project routing management, the `Provider` needs to be wrapped according to the React Router documentation.
@@ -33,9 +33,9 @@ The project initialized by Modern.js is single-entry (SPA), and the project stru
33
33
  Modern.js can easily switch from single entry to multiple entry. You can execute `pnpm run new` under the project to create entry through generator:
34
34
 
35
35
  ```bash
36
- ? Action: Create project element
37
- ? Create project element: New "entry"
38
- ? Entry name: new-entry
36
+ ? Please select the operation you want: Create Element
37
+ ? Please select the type of element to create: New "entry"
38
+ ? Please fill in the entry name: new-entry
39
39
  ```
40
40
 
41
41
  After execution, Modern.js will automatically generate a new entry directory, and you can see that the `src/` directory has the following structure:
@@ -0,0 +1,4 @@
1
+ {
2
+ "label": "@modern-js/create",
3
+ "position": 1
4
+ }
@@ -0,0 +1,75 @@
1
+ ---
2
+ sidebar_position: 3
3
+ ---
4
+
5
+ # Configuration Parameters
6
+
7
+ `@modern-js/create` provides the [--config](/guides/topic-detail/generator/create/option.html#-c,---config-<config>) parameter, which is used to specify the answers to interactive questions in advance during the execution process.
8
+
9
+ Here, we will introduce the fields and field values that can be configured in the `config` under different scenario.
10
+
11
+ ## General Configuration
12
+
13
+ ### solution
14
+
15
+ Question: Please select the type of project you want to create.
16
+
17
+ Options:
18
+
19
+ - Web App -- mwa
20
+
21
+ - Npm Module -- module
22
+
23
+ - Doc Site -- doc
24
+
25
+ - Monorepo -- monorepo
26
+
27
+ ### scenes
28
+
29
+ Question: Please select the project scenario.
30
+
31
+ Options:
32
+
33
+ List of plugin keywords when using custom generator plugins.
34
+
35
+ ## Web App
36
+
37
+ import LanguageConfig from '@site-docs-en/components/language-config';
38
+
39
+ <LanguageConfig />
40
+
41
+ import PackageManager from '@site-docs-en/components/package-manager';
42
+
43
+ <PackageManager />
44
+
45
+ ### buildTools
46
+
47
+ Question: Please select the bundler.
48
+
49
+ Options:
50
+
51
+ - webpack -- webpack
52
+
53
+ - Rspack -- rspack
54
+
55
+ ## Npm Module
56
+
57
+ ### packageName
58
+
59
+ Question: Please fill in the project name.
60
+
61
+ :::info
62
+ The value of the `name` field in the `package.json` file of the Npm module, which is a string type.
63
+ :::
64
+
65
+ <LanguageConfig />
66
+
67
+ <PackageManager />
68
+
69
+ ## Modern Doc
70
+
71
+ <PackageManager />
72
+
73
+ ## Monorepo
74
+
75
+ <PackageManager />
@@ -0,0 +1,151 @@
1
+ ---
2
+ sidebar_position: 2
3
+ ---
4
+
5
+ # CLI Options
6
+
7
+ `@modern-js/create` provides many configuration parameters to configure its behavior during execution, which can be viewed using the `--help` parameter:
8
+
9
+ ```bash
10
+ npx @modern-js/create@latest --help
11
+
12
+ Usage: npx @modern-js/create@latest [projectDir]
13
+
14
+ create Modern.js solution project
15
+
16
+ Options:
17
+ --version show create tools version
18
+ --lang <lang> set create tools language(en or zh)
19
+ -c, --config <config> set default project config(json string) (default: "{}")
20
+ -d,--debug using debug mode to log something (default: false)
21
+ --mwa create mwa application using default config (default: false)
22
+ --module create module application using default config (default: false)
23
+ --monorepo create monorepo application using default config (default: false)
24
+ --generator <generator> run custom generator
25
+ -p, --plugin <plugin> use generator plugin to create new solution or customize Modern.js solution (default: [])
26
+ --dist-tag <distTag> use specified tag version for it\'s generator (default: "")
27
+ --packages <packages> set project specific dependency version information (default: "{}")
28
+ --registry <registry> set npm registry url to run npm command (default: "")
29
+ --no-need-install not run install command
30
+ -h, --help display help for command
31
+
32
+ Commands:
33
+ clean-cache clean locale generator cache
34
+ ```
35
+
36
+ The following will provide a detailed introduction to these parameters:
37
+
38
+ ## [projectDir]
39
+
40
+ The project directory name.
41
+
42
+ When executing `@modern-js/create`, a `projectDir` folder will be created in the current directory by default, and the project will be initialized in this folder. If this parameter is empty, the initialization project will be directly generated in the current directory.
43
+
44
+ :::info
45
+ If the contents of the directory where `projectDir` is located are not empty, a prompt will be given whether to continue creating. It is recommended to perform project initialization operations in an empty directory.
46
+ :::
47
+
48
+ ## --version
49
+
50
+ Get the version of the `@modern-js/create` tool.
51
+
52
+ ```bash
53
+ npx @modern-js/create@latest --version
54
+
55
+ [INFO] @modern-js/create v2.21.1
56
+ ```
57
+
58
+ ## --lang \<lang>
59
+
60
+ The execution language, supports `zh` and `en`.
61
+
62
+ By default, `@modern-js/create` will automatically identify the user's system language and choose to use Chinese or English. If the identification fails or does not meet usage habits, you can manually specify it using this parameter.
63
+
64
+ ## -c, --config \<config>
65
+
66
+ Specify the default project configuration.
67
+
68
+ By default, `@modern-js/create` will prompt for interactive questions such as language selection and package management tools during the execution process. When it is necessary to specify these configuration contents in advance, they can be passed in through this field.
69
+
70
+ This field is a JSON string. For example, when specifying a package management tool:
71
+
72
+ ```bash
73
+ npx @modern-js/create@latest --config '{"packageManager": "pnpm"}'
74
+ ```
75
+
76
+ Supported parameters for `config` can be found at [Configuration Parameters](/guides/topic-detail/generator/create/config.html)。
77
+
78
+ ## -d,--debug
79
+
80
+ Display debug logs.
81
+
82
+ When encountering problems during use, you can use this parameter to display debug logs, which is convenient for quickly locating the problem position and troubleshooting.
83
+
84
+ ## --mwa
85
+
86
+ Quickly create a Web App project.
87
+
88
+ ## --module
89
+
90
+ Quickly create a Npm Module project.
91
+
92
+ ## --monorepo
93
+
94
+ Quickly create a Monorepo project.
95
+
96
+ ## -p, --plugin \<plugin>
97
+
98
+ Specify a generator plugin.
99
+
100
+ `@modern-js/create` supports customizing the default project solution type of Modern.js or adding project solution type scenarios using generator plugin. For details, please refer to [Developing Generator Plugin](/guides/topic-detail/generator/plugin/structure.html).
101
+
102
+ ## --generator \<generator>
103
+
104
+ Specify a micro-generator.
105
+
106
+ <!-- TODO 详情可查看[开发微生成器]-->
107
+ `@modern-js/create` supports completely customizing the project generation process using micro-generator.
108
+
109
+ ## --dist-tag \<distTag>
110
+
111
+ Specify the version of the generator and Modern.js-related dependencies.
112
+
113
+ During the execution of `@modern-js/create`, a smaller micro-generator will be executed by default, and the `latest` version of the micro-generator will be used by default. This parameter can be used to specify the version number of the micro-generator to be executed and the version of the installed Modern.js-related dependencies.
114
+
115
+ For example, use the `next` version:
116
+
117
+ ```bash
118
+ npx @modern-js/create@next --dist-tag next
119
+ ```
120
+
121
+ ## --packages \<packages>
122
+
123
+ Specify specific package version dependencies when creating a project.
124
+
125
+ If you need to specify a specific package version when creating a project, you can use this parameter. This parameter will configure `pnpm.overrides` (if the package management tool is pnpm) or `resolutions` to lock the package version number in the `package.json` file in the project root directory.
126
+
127
+ The parameter value is a JSON string.
128
+
129
+ For example, specify the react version:
130
+
131
+ ```bash
132
+ npx @modern-js/create@latest --packages '{"react":"^17"}'
133
+ ```
134
+
135
+ ## --registry \<registry>
136
+
137
+ Specify the sub-generator to execute and the npm registry to fetch project dependencies version.
138
+
139
+ ## --no-need-install
140
+
141
+ Ignore automatic installation of dependencies.
142
+
143
+ By default, `@modern-js/create` will automatically install dependencies after creating a project. Using this parameter can ignore the installation of dependencies.
144
+
145
+ ## clean-cache
146
+
147
+ The `@modern-js/create` command generates sub-generators cache in the tmp directory of the execution machine by default to speed up the generator execution. This command can be used to delete the cache when it needs to be refreshed or when there are problems with the cache.
148
+
149
+ ```bash
150
+ npx @modern-js/create@latest clean-cache
151
+ ```
@@ -0,0 +1,66 @@
1
+ ---
2
+ sidebar_position: 1
3
+ ---
4
+
5
+ # Usage
6
+
7
+ Modern.js provides `@modern-js/create` tool for creating project templates provided by Modern.js, including [Web App](https://modernjs.dev/), [Npm Module](https://modernjs.dev/module-tools), [Modern Doc](https://modernjs.dev/doc-tools), [Monorepo](/guides/topic-detail/monorepo/intro.html).
8
+
9
+ The following will introduce how to use `@modern-js/create`.
10
+
11
+ ## Environment Preparation
12
+
13
+ import Prerequisites from "@site-docs-en/components/prerequisites"
14
+
15
+ <Prerequisites />
16
+
17
+ ## Create a Project with `@modern-js/create`
18
+
19
+ You do not need to install `@modern-js/create` globally, just use npx to run it:
20
+
21
+ ```bash
22
+ npx @modern-js/create@latest [projectDir]
23
+ ```
24
+
25
+ :::info
26
+ `[projectDir]` is the project directory name. If it is not filled in, the project will be created in the current directory.
27
+ :::
28
+
29
+ During the execution, complete the interaction according to the prompt to create a project that meets your requirements.
30
+
31
+ ### Create an Web APP Project
32
+
33
+ ```bash
34
+ npx @modern-js/create@latest web-app
35
+ ? Please select the type of project you want to create: Web App
36
+ ? Please select the programming language: TS
37
+ ? Please select the package manager: pnpm
38
+ ? Please select the bundler: webpack
39
+ ```
40
+
41
+ ### Create an Npm Module Project
42
+
43
+ ```bash
44
+ npx @modern-js/create@latest npm-module
45
+ ? Please select the type of project you want to create: Npm Module
46
+ ? Please fill in the project name: npm-module
47
+ ? Please select the programming language: TS
48
+ ? Please select the package manager: pnpm
49
+ ```
50
+
51
+ ### Create a Modern Doc Project
52
+
53
+ ```bash
54
+ npx @modern-js/create@latest doc-website
55
+ ? Please select the type of project you want to create: Doc Site
56
+ ? Please select the package manager: pnpm
57
+ ```
58
+
59
+ ### Create Monorepo Project
60
+
61
+ ```bash
62
+ npx @modern-js/create@latest monorepo
63
+ ? Please select the type of project you want to create: Doc Site
64
+ ? Please select the package manager: pnpm
65
+ ```
66
+
@@ -0,0 +1,4 @@
1
+ {
2
+ "label": "new Command",
3
+ "position": 2
4
+ }