@modern-js/module-tools-docs 2.0.0-beta.4

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 (163) hide show
  1. package/LICENSE +144 -0
  2. package/docs/.island/config.ts +245 -0
  3. package/docs/.island/dist/404.html +41 -0
  4. package/docs/.island/dist/assets/before-getting-started.1b82b538.js +87 -0
  5. package/docs/.island/dist/assets/before-getting-started.582a31cc.js +87 -0
  6. package/docs/.island/dist/assets/build-config.72eb0918.js +804 -0
  7. package/docs/.island/dist/assets/build-config.d8bb1658.js +809 -0
  8. package/docs/.island/dist/assets/build-preset.96805d7d.js +256 -0
  9. package/docs/.island/dist/assets/build-preset.c20dcd40.js +256 -0
  10. package/docs/.island/dist/assets/build-your-ui.7f349247.js +2 -0
  11. package/docs/.island/dist/assets/build-your-ui.a8361604.js +2 -0
  12. package/docs/.island/dist/assets/command-preview.2d45fc82.js +264 -0
  13. package/docs/.island/dist/assets/command-preview.dc51b953.js +264 -0
  14. package/docs/.island/dist/assets/components.esm.03560353.js +9 -0
  15. package/docs/.island/dist/assets/design-system.86694ff5.js +1254 -0
  16. package/docs/.island/dist/assets/design-system.c4745cce.js +639 -0
  17. package/docs/.island/dist/assets/dev.1d326a37.js +37 -0
  18. package/docs/.island/dist/assets/dev.1fd06000.js +37 -0
  19. package/docs/.island/dist/assets/down.f35427d3.svg +1 -0
  20. package/docs/.island/dist/assets/extension.12299fd6.js +2 -0
  21. package/docs/.island/dist/assets/extension.96dc63a4.js +2 -0
  22. package/docs/.island/dist/assets/getting-started.40e9218d.js +117 -0
  23. package/docs/.island/dist/assets/getting-started.b1ed3f10.js +114 -0
  24. package/docs/.island/dist/assets/github.3bf8ccee.svg +1 -0
  25. package/docs/.island/dist/assets/index.2b2347ea.js +33 -0
  26. package/docs/.island/dist/assets/index.6cef6f5f.js +4 -0
  27. package/docs/.island/dist/assets/index.cb118238.js +36 -0
  28. package/docs/.island/dist/assets/index.ccb6ce27.js +4 -0
  29. package/docs/.island/dist/assets/island_inject.11a12ecc.js +1 -0
  30. package/docs/.island/dist/assets/island_inject.b13deaee.js +1 -0
  31. package/docs/.island/dist/assets/loading.8c9bb911.svg +1 -0
  32. package/docs/.island/dist/assets/modify-output-product.7f6bff35.js +100 -0
  33. package/docs/.island/dist/assets/modify-output-product.b91eff1f.js +100 -0
  34. package/docs/.island/dist/assets/moon.6b705924.svg +3 -0
  35. package/docs/.island/dist/assets/plugin.895932d8.js +42 -0
  36. package/docs/.island/dist/assets/plugin.d2fbc531.js +42 -0
  37. package/docs/.island/dist/assets/publish-your-project.21b8309f.js +164 -0
  38. package/docs/.island/dist/assets/publish-your-project.8d398b17.js +166 -0
  39. package/docs/.island/dist/assets/right.89674cd7.svg +1 -0
  40. package/docs/.island/dist/assets/search.0aea6901.svg +1 -0
  41. package/docs/.island/dist/assets/search.1c85d17c.js +3 -0
  42. package/docs/.island/dist/assets/search.484eca11.js +222 -0
  43. package/docs/.island/dist/assets/search.54fca8d0.js +3 -0
  44. package/docs/.island/dist/assets/style.09015a4b.css +1 -0
  45. package/docs/.island/dist/assets/style.2e5f7bc2.css +1970 -0
  46. package/docs/.island/dist/assets/sun.841dac10.svg +11 -0
  47. package/docs/.island/dist/assets/test-your-project.18bd4582.js +190 -0
  48. package/docs/.island/dist/assets/test-your-project.f53bebf7.js +190 -0
  49. package/docs/.island/dist/assets/test.0da1f99f.js +67 -0
  50. package/docs/.island/dist/assets/test.0e81f002.js +66 -0
  51. package/docs/.island/dist/assets/translator.b1077c44.svg +1 -0
  52. package/docs/.island/dist/assets/use-micro-generator.7d9e4016.js +60 -0
  53. package/docs/.island/dist/assets/use-micro-generator.db5520c1.js +60 -0
  54. package/docs/.island/dist/assets/using-storybook.57ea6b77.js +260 -0
  55. package/docs/.island/dist/assets/using-storybook.a2212f2e.js +260 -0
  56. package/docs/.island/dist/assets/welcome.0449a9c8.js +13 -0
  57. package/docs/.island/dist/assets/welcome.a8448931.js +13 -0
  58. package/docs/.island/dist/assets/why-module-engineering-solution.6ae8c0e3.js +26 -0
  59. package/docs/.island/dist/assets/why-module-engineering-solution.c9a45cbd.js +26 -0
  60. package/docs/.island/dist/chunk-COLCRJ2V.js +1 -0
  61. package/docs/.island/dist/chunk-K5FMOYDC.js +10 -0
  62. package/docs/.island/dist/chunk-WE42KMYS.js +26 -0
  63. package/docs/.island/dist/client-entry.js +3 -0
  64. package/docs/.island/dist/en/api/build-config.html +344 -0
  65. package/docs/.island/dist/en/api/build-preset.html +82 -0
  66. package/docs/.island/dist/en/api/design-system.html +155 -0
  67. package/docs/.island/dist/en/api/dev.html +45 -0
  68. package/docs/.island/dist/en/api/index.html +41 -0
  69. package/docs/.island/dist/en/api/plugin.html +48 -0
  70. package/docs/.island/dist/en/api/test.html +58 -0
  71. package/docs/.island/dist/en/guide/before-getting-started.html +127 -0
  72. package/docs/.island/dist/en/guide/build-your-ui.html +41 -0
  73. package/docs/.island/dist/en/guide/command-preview.html +100 -0
  74. package/docs/.island/dist/en/guide/extension.html +41 -0
  75. package/docs/.island/dist/en/guide/getting-started.html +76 -0
  76. package/docs/.island/dist/en/guide/modify-output-product.html +140 -0
  77. package/docs/.island/dist/en/guide/publish-your-project.html +91 -0
  78. package/docs/.island/dist/en/guide/test-your-project.html +72 -0
  79. package/docs/.island/dist/en/guide/use-micro-generator.html +65 -0
  80. package/docs/.island/dist/en/guide/using-storybook.html +113 -0
  81. package/docs/.island/dist/en/guide/welcome.html +53 -0
  82. package/docs/.island/dist/en/guide/why-module-engineering-solution.html +49 -0
  83. package/docs/.island/dist/en/index.html +42 -0
  84. package/docs/.island/dist/react-dom.js +1 -0
  85. package/docs/.island/dist/react-dom_client.js +1 -0
  86. package/docs/.island/dist/react.js +1 -0
  87. package/docs/.island/dist/react_jsx-runtime.js +10 -0
  88. package/docs/.island/dist/ssr-manifest.json +57 -0
  89. package/docs/.island/dist/test-result.png +0 -0
  90. package/docs/.island/dist/why-module-solution.png +0 -0
  91. package/docs/.island/dist/zh/api/build-config.html +347 -0
  92. package/docs/.island/dist/zh/api/build-preset.html +82 -0
  93. package/docs/.island/dist/zh/api/design-system.html +149 -0
  94. package/docs/.island/dist/zh/api/dev.html +46 -0
  95. package/docs/.island/dist/zh/api/index.html +41 -0
  96. package/docs/.island/dist/zh/api/plugin.html +48 -0
  97. package/docs/.island/dist/zh/api/test.html +59 -0
  98. package/docs/.island/dist/zh/guide/before-getting-started.html +127 -0
  99. package/docs/.island/dist/zh/guide/build-your-ui.html +41 -0
  100. package/docs/.island/dist/zh/guide/command-preview.html +100 -0
  101. package/docs/.island/dist/zh/guide/extension.html +41 -0
  102. package/docs/.island/dist/zh/guide/getting-started.html +79 -0
  103. package/docs/.island/dist/zh/guide/modify-output-product.html +140 -0
  104. package/docs/.island/dist/zh/guide/publish-your-project.html +92 -0
  105. package/docs/.island/dist/zh/guide/test-your-project.html +72 -0
  106. package/docs/.island/dist/zh/guide/use-micro-generator.html +65 -0
  107. package/docs/.island/dist/zh/guide/using-storybook.html +114 -0
  108. package/docs/.island/dist/zh/guide/welcome.html +53 -0
  109. package/docs/.island/dist/zh/guide/why-module-engineering-solution.html +49 -0
  110. package/docs/.island/dist/zh/index.html +42 -0
  111. package/docs/.island/index.html +39 -0
  112. package/docs/.island/styles/index.css +10 -0
  113. package/docs/en/api/build-config.md +501 -0
  114. package/docs/en/api/build-preset.md +214 -0
  115. package/docs/en/api/design-system.md +524 -0
  116. package/docs/en/api/dev.md +32 -0
  117. package/docs/en/api/index.md +3 -0
  118. package/docs/en/api/plugin.md +34 -0
  119. package/docs/en/api/test.md +48 -0
  120. package/docs/en/guide/advance/asset.mdx +132 -0
  121. package/docs/en/guide/advance/build-umd.mdx +241 -0
  122. package/docs/en/guide/advance/copy.md +235 -0
  123. package/docs/en/guide/advance/external-dependency.mdx +125 -0
  124. package/docs/en/guide/advance/in-depth-about-build.md +266 -0
  125. package/docs/en/guide/advance/in-depth-about-dev-command.md +22 -0
  126. package/docs/en/guide/basic/before-getting-started.md +187 -0
  127. package/docs/en/guide/basic/command-preview.md +204 -0
  128. package/docs/en/guide/basic/modify-output-product.md +145 -0
  129. package/docs/en/guide/basic/publish-your-project.md +115 -0
  130. package/docs/en/guide/basic/test-your-project.mdx +158 -0
  131. package/docs/en/guide/basic/use-micro-generator.md +35 -0
  132. package/docs/en/guide/basic/using-storybook.mdx +187 -0
  133. package/docs/en/guide/intro/getting-started.md +78 -0
  134. package/docs/en/guide/intro/welcome.md +14 -0
  135. package/docs/en/guide/intro/why-module-engineering-solution.md +17 -0
  136. package/docs/en/index.md +35 -0
  137. package/docs/public/test-result.png +0 -0
  138. package/docs/public/why-module-solution.png +0 -0
  139. package/docs/zh/api/build-config.md +570 -0
  140. package/docs/zh/api/build-preset.md +220 -0
  141. package/docs/zh/api/design-system.md +1147 -0
  142. package/docs/zh/api/dev.md +33 -0
  143. package/docs/zh/api/index.md +3 -0
  144. package/docs/zh/api/plugins.md +108 -0
  145. package/docs/zh/api/testing.md +52 -0
  146. package/docs/zh/guide/advance/asset.mdx +132 -0
  147. package/docs/zh/guide/advance/build-umd.mdx +232 -0
  148. package/docs/zh/guide/advance/copy.md +235 -0
  149. package/docs/zh/guide/advance/external-dependency.mdx +125 -0
  150. package/docs/zh/guide/advance/in-depth-about-build.md +267 -0
  151. package/docs/zh/guide/advance/in-depth-about-dev-command.md +26 -0
  152. package/docs/zh/guide/basic/before-getting-started.md +187 -0
  153. package/docs/zh/guide/basic/command-preview.md +204 -0
  154. package/docs/zh/guide/basic/modify-output-product.md +144 -0
  155. package/docs/zh/guide/basic/publish-your-project.md +112 -0
  156. package/docs/zh/guide/basic/test-your-project.mdx +158 -0
  157. package/docs/zh/guide/basic/use-micro-generator.md +35 -0
  158. package/docs/zh/guide/basic/using-storybook.mdx +186 -0
  159. package/docs/zh/guide/intro/getting-started.md +78 -0
  160. package/docs/zh/guide/intro/welcome.md +14 -0
  161. package/docs/zh/guide/intro/why-module-engineering-solution.md +17 -0
  162. package/docs/zh/index.md +29 -0
  163. package/package.json +19 -0
@@ -0,0 +1,187 @@
1
+ # Using Storybook
2
+
3
+ First of all, if you haven't read the following, take a few minutes to understand it first.
4
+
5
+ * [use micro-generator to enable Storybook debugging](/en/guide/use-micro-generator#storybook-debug)
6
+ * [`modern dev`](/en/guide/command-preview#modern-dev)
7
+
8
+ [Storybook](https://storybook.js.org/) is a tool dedicated to component debugging, providing around component development.
9
+
10
+ * Develop UIs that are more durable
11
+ * Test UIs with less effort and no flakes
12
+ * Document UI for your team to reuse
13
+ * Share how the UI actually works
14
+ * Automate UI workflows
15
+
16
+ So it is a complex and powerful tool.
17
+
18
+ The modular engineering solution is integrated with Storybook, so you can pretty much follow the official Storybook documentation. However, there are still a few things to keep in mind, which are explained below.
19
+
20
+ ## Debugging code
21
+
22
+ Component code needs to be introduced during debugging code, and currently component code can be introduced in two ways:
23
+
24
+ * Referencing the component product
25
+ * Referencing component source code
26
+
27
+ We recommend the first way of "**referencing component product**". Because it is almost close to the real usage scenario, not only can we debug the component functionality, but also verify the correctness of the build product.
28
+
29
+ Next, we will talk about how to use each of these two methods.
30
+
31
+ ### Referencing component products
32
+
33
+ If the TypeScript project `foo` exists.
34
+
35
+ <CH.Spotlight>
36
+
37
+ ```json package.json
38
+ {
39
+ "name": "foo",
40
+ "main": "./dist/index.js",
41
+ "types": "./dist/types/index.d.ts"
42
+ }
43
+ ```
44
+
45
+ ---
46
+
47
+ Make sure the `main` and `types` of `package.json`
48
+ values are real paths.
49
+
50
+ ```json package.json
51
+ {
52
+ "name": "foo",
53
+ "main": "./dist/index.js",
54
+ "types": "./dist/types/index.d.ts"
55
+ }
56
+ ```
57
+
58
+ ---
59
+
60
+ The source code of the `foo` project.
61
+
62
+ ```typescript src/index.ts
63
+ export const content = 'hello world';
64
+ ```
65
+
66
+ ---
67
+
68
+
69
+ Make sure that the `paths` configuration pointing to the project root is set in `stories/tsconfig.json`.
70
+ The `key` of `paths` is the same as the project name.
71
+
72
+ ```json stories/tsconfig.json focus=7:9
73
+ {
74
+ "extends": "../tsconfig.json",
75
+ "include": ["./"],
76
+ "compilerOptions": {
77
+ "jsx": "preserve",
78
+ "baseUrl": ".",
79
+ "paths": {
80
+ "foo": ["../"]
81
+ }
82
+ }
83
+ }
84
+ ```
85
+
86
+ ---
87
+
88
+ Finally, it is referenced directly in the Story code by the project name.
89
+
90
+ ```tsx stories/index.stories.tsx focus=1:1
91
+ import { content } from 'foo';
92
+
93
+ const Component = () => <div>this is a Story Component {content}</div>;
94
+
95
+ export const YourStory = () => <Component />;
96
+
97
+ export default {
98
+ title: 'Your Stories',
99
+ };
100
+ ```
101
+
102
+ </CH.Spotlight>
103
+
104
+ If, during development, you encounter a situation where the type definition is not available in real time, at that point.
105
+
106
+ For `pnpm` projects, `package.json` can be modified as follows.
107
+
108
+ ``` ts focus=4:7
109
+ {
110
+ "name": "foo",
111
+ "main": "./dist/index.js",
112
+ "types": "./src/index.ts",
113
+ "publishConfig": {
114
+ "types": "./dist/index.d.ts",
115
+ }
116
+ }
117
+ ```
118
+ > For the use of pnpm's `publishConfig`, you can read the following [link](https://pnpm.io/package_json#publishconfig).
119
+
120
+ For npm and Yarn projects, the values of `types` of `package.json` can only be changed manually in **development phase** and **release phase**.
121
+
122
+
123
+ So why is it possible to reference the product directly?
124
+
125
+ 1. the `modern build` command is executed automatically before the `modern dev storybook` command, ensuring the existence of the project build product.
126
+ 2. The project name is added as an alias inside Storybook to ensure that the path to the project's product can be parsed **according to `package.json`**.
127
+
128
+
129
+ ### Referencing component source code
130
+
131
+ Referencing component source code can be done by means of relative paths to:
132
+
133
+ ```ts ./stories/index.tsx
134
+ import { content } from '../src';
135
+
136
+ const Component = () => <div>this is a Story Component {content}</div>;
137
+
138
+ export const YourStory = () => <Component />;
139
+
140
+ export default {
141
+ title: 'Your Stories',
142
+ };
143
+ ```
144
+
145
+ So why is the source code approach not recommended?
146
+
147
+ Not only is it impossible to verify that the component product is correct using the component source code, **but also some of the configurations supported by the module project for building the product cannot be fully translated into Storybook internal configuration**. If some of the configurations cannot be converted to each other, there will be unintended results during Storybook debugging.
148
+
149
+
150
+ ## Configure Storybook
151
+
152
+ ### Configuration file
153
+
154
+ Storybook is officially configured for projects through a folder called `.storybook`, which contains various configuration files. **In a module project scenario, Storybook configuration files can be added to the `config/storybook` directory of the project.**
155
+
156
+ For more information on how to use the various Storybook configuration files, see the following links:
157
+
158
+ * [Configure Storybook](https://storybook.js.org/docs/react/configure/overview)
159
+
160
+ **But there are some limitations to Storybooking in a module project**:
161
+
162
+ * It is currently not possible to change the location of the Story file, i.e., you cannot change the `stories` configuration in the `main.js` file.
163
+ * Currently you cannot modify Webpack and Babel related configuration, i.e. you cannot modify `webpackFinal` and `babel` configuration in the `main.js` file.
164
+
165
+ In the future we will consider whether these configurations can be allowed to be modified, but for now we are limiting their use to reduce unpredictable issues.
166
+
167
+ ### `dev.storybook`
168
+
169
+ In addition to the configuration file, the module engineering solution also provides a `dev.storybook` configuration item in the `modern.config.(j|t)s` project configuration file.
170
+
171
+ The webpack configuration of Storybook can be modified via this configuration.
172
+
173
+ * [`dev.storybook.webpack`](xxx)
174
+
175
+ ### Building Storybook Products
176
+
177
+ In addition to Storybook debugging of components or common modules, you can also perform Storybook build tasks with the following commands.
178
+
179
+ ``` bash
180
+ modern build --platform storybook
181
+ ```
182
+
183
+ For the `modern build --platform` command you can see.
184
+
185
+ * [`modern build`](/en/guide/command-preview#modern-build)
186
+
187
+ After the build is complete, you can see the build product files in the `dist/storybook-static` directory.
@@ -0,0 +1,78 @@
1
+ # Quick start
2
+
3
+ ## 3 minute demo
4
+
5
+ Want to experience Module Tools in action? The only prerequisite you need is [Node.js LTS](https://github.com/nodejs/Release) and make sure your Node version is **>= 14.17.6**.
6
+
7
+ From your shell, install the following dependencies in your project.
8
+
9
+ - `@modern-js/module-tools`
10
+ - `@modern-js/plugin-testing`
11
+
12
+ > If it's a TypeScript project, add the `"typescript"` dependency.
13
+
14
+ ```bash
15
+ npm install -D @modern-js/module-tools @modern-js/plugin-testing
16
+ ```
17
+
18
+ > For projects that use pnpm or the Yarn package manager, just replace npm. **pnpm is recommended**.
19
+
20
+ Then add the command `"build": "modern build"` to your project's `package.json` file.
21
+
22
+ ```json
23
+ {
24
+ "scripts": {
25
+ "build": "modern build"
26
+ }
27
+ }
28
+ ```
29
+
30
+ If your project has a `src/index.(js|jsx)` file or both `src/index.(ts|tsx)` and `tsconfig.json` files, then congratulations you can run the `npm run build` command directly to build your project with Module Tools.
31
+
32
+ **If you want to see real projects that use the module engineering solution, you can execute the following command**.
33
+ ```bash
34
+ git clone https://github.com/modern-js-dev/module-tools-examples
35
+ cd module-tools-example
36
+
37
+ ## Execute the build.
38
+ pnpm build
39
+
40
+ ## Execute the build in listening mode.
41
+ pnpm build --watch
42
+
43
+ ## Start Storybook
44
+ pnpm dev storybook
45
+
46
+ ## Test
47
+ pnpm test
48
+ pnpm test
49
+ ```
50
+
51
+ **If you want to create a complete module project, you can execute the following command:**
52
+
53
+ ```bash
54
+ npx @modern-js/create your-project-dir-name
55
+ ```
56
+
57
+ Next, in the issue interaction, follow the options below.
58
+
59
+ ```bash
60
+ ? Please select the type of project you want to create Module
61
+ ? Please fill in the project name library
62
+ ? Please select the development language TS
63
+ ? Please select the package management tool pnpm
64
+ ```
65
+ > The project name is the value of the `"name"` field in `package.json`.
66
+
67
+ Then the process of initializing the project will start. After the project directory and files are generated and the dependencies are installed, a complete module project is created.
68
+
69
+ We can start the project build directly with the `pnpm build` command, and start the build in watching mode with the `pnpm build --watch` command.
70
+
71
+ ## Let's get started
72
+
73
+ Choose your tutorial scenario...
74
+
75
+ - I'm a beginner and need to learn [basic usage](/en/guide/before-getting-started) of Module Tools.
76
+ - I have learned the basic usage of Module Tools and can learn [advanced usage](/en/guide/before-getting-started) of Module Tools.
77
+ - I am the maintainer of the project and need to learn how to develop plugins for Module Tools and learn more about Module Tools Advanced.
78
+
@@ -0,0 +1,14 @@
1
+ # Welcome to Module Tools
2
+
3
+ Module Tools is a modules engineering solution for Modern.js, as well as a core dependency. It allows developers to build, debug, and publish module type project more easily. A module type project can mostly be thought of as an npm package type project, which may be a component, component library or tool library project.
4
+
5
+ If you are planning to develop a project of the npm package type, then you came to the right place! Modern.js provides a professional module engineering solution. It gives you:
6
+
7
+ - **Simple project initialization**: simply execute the `npx @modern-js/create project-dir` command, followed by a few interactive questions, to create a complete module type project. The created project also supports the choice of two package managers, [**pnpm**](https://pnpm.io/) and [**Yarn**](https://classic.yarnpkg.com/).
8
+ - **Code formatting**: In a module project, you can execute `modern lint` to format the code. The initialized module project includes the [ESLint](https://eslint.org/docs/latest/user-guide/core-concepts#what-is-eslint) ruleset for Modern.js for most scenarios.
9
+ - **Comprehensive build capabilities and faster builds**: Module Tools provides high-performance build capabilities based on [esbuild](https://esbuild.github.io/getting-started/) and [SWC](https://swc.rs/), and provides rich configurations for different build scenarios.
10
+ - **Storybook debugging tools**: Module Tools provides [Storybook](https://storybook.js.org/) debugging tools for debugging module projects. After installing the Storybook plugin for Module Tools, you can start it with the `modern dev storybook` command. You can use Storybook not only for debugging components, but also for other types of modules.
11
+ - **Testing capabilities with Jest**: When you need to test a module, you can use the `modern test` command of Module Tools, which not only integrates with [Jest](https://jestjs.io/), but also provides an API for configuring [Jest](https://jestjs.io/docs/configuration).
12
+ - **Versioning based on Changesets**: When you need to record changes to a project, you can use the `modern change` command to generate a Markdown file containing the changes; when you need to upgrade a project, you can use the `modern bump` command to analyze and upgrade the version through the Markdown file; when you need to release a project, you can use the `modern release` command to release the project; Module Tools implements these commands based on [Changesets](https://github.com/changesets/changesets).
13
+ - **Extensible plug-in mechanism**: Want to integrate additional debugging tools for your project? Or maybe you want to do some extra processing during the build process, Module Tools provides a plugin mechanism and plugin hooks that cover both the `dev` command and the `build` command process. You can use them to extend the capabilities of your project.
14
+ - **Lots more!** Module Tools will continue to optimize its build and debug features in the future. If there are important issues to be solved in module project building, or if a mainstream module project debugging tool or pattern emerges, then they will probably be supported by Module Tools.
@@ -0,0 +1,17 @@
1
+ # Why module project solution
2
+
3
+ You've probably all experienced it: when developing a component library or tool library from scratch, we have to consider not only how to write the code logic of the project itself, but also how to build, debug, test, format the code, and other things that have nothing to do with the code logic.
4
+
5
+ For example, when we consider which builder is used to build the code for a module project, we might previously consider [webpack](https://webpack.js.org/) or [Rollup](https://rollupjs.org/guide/en/), but now we might also consider [esbuild](https://esbuild.github.io/) or [SWC](https://swc.rs/).
6
+
7
+ Regardless of which builder is chosen, this is going to be a costly learning curve for developers who are not skilled in the use of these build tools. Even if you want to use them quickly, it will take a lot of time and effort.
8
+
9
+ In addition to the build, things like providing debugging tools for projects, supporting testing capabilities, adding code format validation, etc. can take a long time and effort for a novice to understand or master them and actually serve the current project.
10
+
11
+ To ensure the quality of the code and the integrity of the project, we often need to do these things that are not related to the logical implementation of the code. However, these things are likely to affect the overall project development progress, reduce the developer's development experience, and make the developer feel that the development threshold of the module project is very high.
12
+
13
+ If you have to go through all this work every time you develop a module type project, you will spend most of your development time in the beginning on these things that are not related to code implementation. If we could provide a module engineering solution that would help developers to solve the project engineering issues and allow them to focus more on code implementation, it would greatly improve the module type project development experience.
14
+
15
+ ![Not using engineering solution vs. using engineering solution](/why-module-solution.png)
16
+
17
+ Modern.js, in order to make developing module type projects easier, provides a module engineering solution in order to solve the above mentioned problems and provides the main features using Module Tools. **Module-tools can be understood as a tool dedicated to the development of module type projects**.
@@ -0,0 +1,35 @@
1
+ ---
2
+ pageType: home
3
+
4
+ hero:
5
+ name: Module tools
6
+ text: 模块工程解决方案
7
+ tagline: 简单、强大、高性能的现代化npm包开发方案
8
+ image:
9
+ src: /island.png
10
+ alt: Island
11
+ actions:
12
+ - theme: brand
13
+ text: 快速开始
14
+ link: /zh/guide/getting-started
15
+
16
+ features:
17
+ - title: 'Libuild: 现代库构建方案'
18
+ details: 基于 Libuild 构建,构建速度极快,带给你极致的开发体验。
19
+ icon: 🚀
20
+ - title: 'Storybook: 社区流行的UI开发工具'
21
+ details: 集成了Storybook,你可以使用它调试UI。
22
+ icon: 📦
23
+ - title: 'Island: 强大的现代化SSG方案'
24
+ details: 高性能的静态站点生成器。
25
+ icon: 🔑
26
+ - title: 'transform + bundle'
27
+ details: 支持bundle和bundleless两种构建模式。
28
+ icon: ✨
29
+ - title: '零配置'
30
+ details: 无需任何配置即可开发你的npm包,内置预设覆盖多种场景。
31
+ icon: 🛠️
32
+ - title: '扩展性强: 提供强大的插件机制'
33
+ details: 通过其插件扩展机制,你可以轻松的扩展Module tools的各项能力。
34
+ icon: 🎨
35
+ ---
Binary file