@modern-js/module-tools-docs 2.2.0-beta.0 → 2.2.1-beta.1
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.
- package/doc_build/static/css/main.css +3 -3
- package/doc_build/static/css/main.css.map +1 -1
- package/doc_build/static/js/async/en_api_config_build-config.js +2 -2
- package/doc_build/static/js/async/en_api_config_build-preset.js +2 -2
- package/doc_build/static/js/async/en_api_config_design-system.js +2 -2
- package/doc_build/static/js/async/en_api_config_plugins.js +2 -2
- package/doc_build/static/js/async/en_api_config_testing.js +2 -2
- package/doc_build/static/js/async/en_api_plugin-api_plugin-hooks.js +2 -2
- package/doc_build/static/js/async/en_guide_advance_asset.js +2 -2
- package/doc_build/static/js/async/en_guide_advance_build-umd.js +4 -4
- package/doc_build/static/js/async/en_guide_advance_copy.js +3 -3
- package/doc_build/static/js/async/en_guide_advance_external-dependency.js +4 -4
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-build.js +5 -5
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-dev-command.js +2455 -75
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-dev-command.js.map +1 -1
- package/doc_build/static/js/async/en_guide_advance_theme-config.js +3 -3
- package/doc_build/static/js/async/en_guide_basic_before-getting-started.js +14 -152
- package/doc_build/static/js/async/en_guide_basic_before-getting-started.js.map +1 -1
- package/doc_build/static/js/async/en_guide_basic_command-preview.js +8 -8
- package/doc_build/static/js/async/en_guide_basic_modify-output-product.js +126 -37
- package/doc_build/static/js/async/en_guide_basic_modify-output-product.js.map +1 -1
- package/doc_build/static/js/async/en_guide_basic_publish-your-project.js +2 -2
- package/doc_build/static/js/async/en_guide_basic_test-your-project.js +2 -2
- package/doc_build/static/js/async/en_guide_basic_use-micro-generator.js +2791 -4
- package/doc_build/static/js/async/en_guide_basic_use-micro-generator.js.map +1 -1
- package/doc_build/static/js/async/en_guide_basic_using-storybook.js +10 -10
- package/doc_build/static/js/async/en_guide_best-practices_components.js +3 -3
- package/doc_build/static/js/async/en_guide_intro_getting-started.js +2 -2
- package/doc_build/static/js/async/en_plugins_guide_getting-started.js +2 -2
- package/doc_build/static/js/async/en_plugins_guide_plugin-object.js +2 -2
- package/doc_build/static/js/async/en_plugins_guide_setup-function.js +2 -2
- package/doc_build/static/js/async/zh_api_config_build-config.js +2 -2
- package/doc_build/static/js/async/zh_api_config_build-preset.js +2 -2
- package/doc_build/static/js/async/zh_api_config_design-system.js +2 -2
- package/doc_build/static/js/async/zh_api_config_plugins.js +2 -2
- package/doc_build/static/js/async/zh_api_config_testing.js +2 -2
- package/doc_build/static/js/async/zh_api_plugin-api_plugin-hooks.js +2 -2
- package/doc_build/static/js/async/zh_guide_advance_asset.js +2 -2
- package/doc_build/static/js/async/zh_guide_advance_build-umd.js +2 -2
- package/doc_build/static/js/async/zh_guide_advance_copy.js +3 -3
- package/doc_build/static/js/async/zh_guide_advance_external-dependency.js +3 -3
- package/doc_build/static/js/async/zh_guide_advance_in-depth-about-build.js +5 -5
- package/doc_build/static/js/async/zh_guide_advance_in-depth-about-dev-command.js +2450 -74
- package/doc_build/static/js/async/zh_guide_advance_in-depth-about-dev-command.js.map +1 -1
- package/doc_build/static/js/async/zh_guide_advance_theme-config.js +3 -3
- package/doc_build/static/js/async/zh_guide_basic_before-getting-started.js +14 -152
- package/doc_build/static/js/async/zh_guide_basic_before-getting-started.js.map +1 -1
- package/doc_build/static/js/async/zh_guide_basic_command-preview.js +8 -8
- package/doc_build/static/js/async/zh_guide_basic_modify-output-product.js +87 -9
- package/doc_build/static/js/async/zh_guide_basic_modify-output-product.js.map +1 -1
- package/doc_build/static/js/async/zh_guide_basic_publish-your-project.js +7 -7
- package/doc_build/static/js/async/zh_guide_basic_test-your-project.js +410 -11
- package/doc_build/static/js/async/zh_guide_basic_test-your-project.js.map +1 -1
- package/doc_build/static/js/async/zh_guide_basic_use-micro-generator.js +2790 -3
- package/doc_build/static/js/async/zh_guide_basic_use-micro-generator.js.map +1 -1
- package/doc_build/static/js/async/zh_guide_basic_using-storybook.js +496 -405
- package/doc_build/static/js/async/zh_guide_basic_using-storybook.js.map +1 -1
- package/doc_build/static/js/async/zh_guide_best-practices_components.js +4 -4
- package/doc_build/static/js/async/zh_guide_intro_getting-started.js +2 -2
- package/doc_build/static/js/async/zh_plugins_guide_getting-started.js +2 -2
- package/doc_build/static/js/async/zh_plugins_guide_plugin-object.js +2 -2
- package/doc_build/static/js/async/zh_plugins_guide_setup-function.js +2 -2
- package/doc_build/static/js/builder-runtime.js +1 -1
- package/doc_build/static/js/builder-runtime.js.map +1 -1
- package/doc_build/static/js/main.js +211 -211
- package/doc_build/static/js/main.js.map +1 -1
- package/doc_build/static/js/vendors-node_modules_pnpm_remix-run_router_1_2_0_node_modules_remix-run_router_dist_router_js-9d5e9c.js +70 -70
- package/doc_build/static/js/vendors-node_modules_pnpm_remix-run_router_1_2_0_node_modules_remix-run_router_dist_router_js-9d5e9c.js.map +1 -1
- package/doc_build/static/search_index.json +1 -1
- package/docs/en/guide/advance/in-depth-about-dev-command.md +65 -12
- package/docs/en/guide/basic/before-getting-started.md +4 -14
- package/docs/en/guide/basic/command-preview.md +1 -1
- package/docs/en/guide/basic/modify-output-product.md +6 -2
- package/docs/en/guide/basic/use-micro-generator.md +62 -1
- package/docs/en/guide/basic/using-storybook.mdx +4 -4
- package/docs/zh/guide/advance/in-depth-about-dev-command.md +60 -13
- package/docs/zh/guide/basic/before-getting-started.md +4 -14
- package/docs/zh/guide/basic/command-preview.md +2 -2
- package/docs/zh/guide/basic/modify-output-product.md +5 -3
- package/docs/zh/guide/basic/publish-your-project.md +4 -4
- package/docs/zh/guide/basic/test-your-project.mdx +18 -5
- package/docs/zh/guide/basic/use-micro-generator.md +61 -1
- package/docs/zh/guide/basic/using-storybook.mdx +13 -10
- package/package.json +4 -4
- package/docs/.island/dist/404.html +0 -41
- package/docs/.island/dist/assets/asset.26aea654.js +0 -160
- package/docs/.island/dist/assets/asset.36e3d3c9.js +0 -160
- package/docs/.island/dist/assets/before-getting-started.0e863740.js +0 -87
- package/docs/.island/dist/assets/before-getting-started.2c6e6b8a.js +0 -87
- package/docs/.island/dist/assets/build-config.460d11d9.js +0 -804
- package/docs/.island/dist/assets/build-config.e155e534.js +0 -854
- package/docs/.island/dist/assets/build-preset.6c2c6c62.js +0 -256
- package/docs/.island/dist/assets/build-preset.d3da921d.js +0 -256
- package/docs/.island/dist/assets/build-umd.ba00f028.js +0 -264
- package/docs/.island/dist/assets/build-umd.edb9d163.js +0 -273
- package/docs/.island/dist/assets/command-preview.1dc93921.js +0 -264
- package/docs/.island/dist/assets/command-preview.ef7a9d01.js +0 -264
- package/docs/.island/dist/assets/components.esm.03560353.js +0 -9
- package/docs/.island/dist/assets/copy.28dc4d5f.js +0 -277
- package/docs/.island/dist/assets/copy.f4625565.js +0 -277
- package/docs/.island/dist/assets/design-system.8993234c.js +0 -1254
- package/docs/.island/dist/assets/design-system.b0ba163f.js +0 -639
- package/docs/.island/dist/assets/dev.b373b152.js +0 -37
- package/docs/.island/dist/assets/dev.b39fd42a.js +0 -37
- package/docs/.island/dist/assets/down.f35427d3.svg +0 -1
- package/docs/.island/dist/assets/extension.4bf3526b.js +0 -1
- package/docs/.island/dist/assets/extension.d64ed0b8.js +0 -469
- package/docs/.island/dist/assets/external-dependency.2ede7532.js +0 -156
- package/docs/.island/dist/assets/external-dependency.92ca89e0.js +0 -156
- package/docs/.island/dist/assets/getting-started.822cf0b2.js +0 -117
- package/docs/.island/dist/assets/getting-started.e2764829.js +0 -114
- package/docs/.island/dist/assets/github.3bf8ccee.svg +0 -1
- package/docs/.island/dist/assets/in-depth-about-build.94cc902d.js +0 -375
- package/docs/.island/dist/assets/in-depth-about-build.aa74de10.js +0 -374
- package/docs/.island/dist/assets/in-depth-about-dev-command.877bdb83.js +0 -33
- package/docs/.island/dist/assets/in-depth-about-dev-command.9736befd.js +0 -39
- package/docs/.island/dist/assets/index.01786ba7.js +0 -30
- package/docs/.island/dist/assets/index.6cef6f5f.js +0 -4
- package/docs/.island/dist/assets/index.cb118238.js +0 -36
- package/docs/.island/dist/assets/index.ccb6ce27.js +0 -4
- package/docs/.island/dist/assets/island_inject.69495876.js +0 -1
- package/docs/.island/dist/assets/island_inject.cdfb22d9.js +0 -1
- package/docs/.island/dist/assets/loading.8c9bb911.svg +0 -1
- package/docs/.island/dist/assets/modify-output-product.9e2394d7.js +0 -100
- package/docs/.island/dist/assets/modify-output-product.f363845a.js +0 -100
- package/docs/.island/dist/assets/moon.6b705924.svg +0 -3
- package/docs/.island/dist/assets/plugin.70a61997.js +0 -42
- package/docs/.island/dist/assets/plugin.80b12ee2.js +0 -42
- package/docs/.island/dist/assets/publish-your-project.7321c10e.js +0 -164
- package/docs/.island/dist/assets/publish-your-project.7326359f.js +0 -166
- package/docs/.island/dist/assets/right.89674cd7.svg +0 -1
- package/docs/.island/dist/assets/search.0aea6901.svg +0 -1
- package/docs/.island/dist/assets/search.11353245.js +0 -222
- package/docs/.island/dist/assets/search.a1b1cff3.js +0 -3
- package/docs/.island/dist/assets/search.f9025ced.js +0 -3
- package/docs/.island/dist/assets/style.09015a4b.css +0 -1
- package/docs/.island/dist/assets/style.2e5f7bc2.css +0 -1970
- package/docs/.island/dist/assets/sun.841dac10.svg +0 -11
- package/docs/.island/dist/assets/test-your-project.8ab2809e.js +0 -190
- package/docs/.island/dist/assets/test-your-project.9ae2a49e.js +0 -190
- package/docs/.island/dist/assets/test.2bfe276b.js +0 -66
- package/docs/.island/dist/assets/test.a2c00a3f.js +0 -67
- package/docs/.island/dist/assets/translator.b1077c44.svg +0 -1
- package/docs/.island/dist/assets/use-micro-generator.13c1a09f.js +0 -60
- package/docs/.island/dist/assets/use-micro-generator.dfe877f6.js +0 -60
- package/docs/.island/dist/assets/using-storybook.adb88cb8.js +0 -260
- package/docs/.island/dist/assets/using-storybook.b8e7dd04.js +0 -260
- package/docs/.island/dist/assets/welcome.94880043.js +0 -13
- package/docs/.island/dist/assets/welcome.b2140e7e.js +0 -13
- package/docs/.island/dist/assets/why-module-engineering-solution.bfe7981a.js +0 -26
- package/docs/.island/dist/assets/why-module-engineering-solution.e31cd19f.js +0 -26
- package/docs/.island/dist/chunk-COLCRJ2V.js +0 -1
- package/docs/.island/dist/chunk-K5FMOYDC.js +0 -10
- package/docs/.island/dist/chunk-WE42KMYS.js +0 -26
- package/docs/.island/dist/client-entry.js +0 -3
- package/docs/.island/dist/en/api/build-config.html +0 -344
- package/docs/.island/dist/en/api/build-preset.html +0 -82
- package/docs/.island/dist/en/api/design-system.html +0 -155
- package/docs/.island/dist/en/api/dev.html +0 -45
- package/docs/.island/dist/en/api/index.html +0 -41
- package/docs/.island/dist/en/api/plugin.html +0 -48
- package/docs/.island/dist/en/api/test.html +0 -58
- package/docs/.island/dist/en/guide/advance/asset.html +0 -68
- package/docs/.island/dist/en/guide/advance/build-umd.html +0 -72
- package/docs/.island/dist/en/guide/advance/copy.html +0 -82
- package/docs/.island/dist/en/guide/advance/extension.html +0 -41
- package/docs/.island/dist/en/guide/advance/external-dependency.html +0 -71
- package/docs/.island/dist/en/guide/advance/in-depth-about-build.html +0 -148
- package/docs/.island/dist/en/guide/advance/in-depth-about-dev-command.html +0 -51
- package/docs/.island/dist/en/guide/basic/before-getting-started.html +0 -127
- package/docs/.island/dist/en/guide/basic/command-preview.html +0 -100
- package/docs/.island/dist/en/guide/basic/modify-output-product.html +0 -140
- package/docs/.island/dist/en/guide/basic/publish-your-project.html +0 -91
- package/docs/.island/dist/en/guide/basic/test-your-project.html +0 -72
- package/docs/.island/dist/en/guide/basic/use-micro-generator.html +0 -65
- package/docs/.island/dist/en/guide/basic/using-storybook.html +0 -113
- package/docs/.island/dist/en/guide/intro/getting-started.html +0 -76
- package/docs/.island/dist/en/guide/intro/welcome.html +0 -53
- package/docs/.island/dist/en/guide/intro/why-module-engineering-solution.html +0 -49
- package/docs/.island/dist/en/index.html +0 -42
- package/docs/.island/dist/react-dom.js +0 -1
- package/docs/.island/dist/react-dom_client.js +0 -1
- package/docs/.island/dist/react.js +0 -1
- package/docs/.island/dist/react_jsx-runtime.js +0 -10
- package/docs/.island/dist/ssr-manifest.json +0 -57
- package/docs/.island/dist/test-result.png +0 -0
- package/docs/.island/dist/why-module-solution.png +0 -0
- package/docs/.island/dist/zh/api/build-config.html +0 -361
- package/docs/.island/dist/zh/api/build-preset.html +0 -82
- package/docs/.island/dist/zh/api/design-system.html +0 -149
- package/docs/.island/dist/zh/api/dev.html +0 -46
- package/docs/.island/dist/zh/api/index.html +0 -41
- package/docs/.island/dist/zh/api/plugin.html +0 -48
- package/docs/.island/dist/zh/api/test.html +0 -59
- package/docs/.island/dist/zh/guide/advance/asset.html +0 -68
- package/docs/.island/dist/zh/guide/advance/build-umd.html +0 -72
- package/docs/.island/dist/zh/guide/advance/copy.html +0 -82
- package/docs/.island/dist/zh/guide/advance/extension.html +0 -127
- package/docs/.island/dist/zh/guide/advance/external-dependency.html +0 -71
- package/docs/.island/dist/zh/guide/advance/in-depth-about-build.html +0 -148
- package/docs/.island/dist/zh/guide/advance/in-depth-about-dev-command.html +0 -53
- package/docs/.island/dist/zh/guide/basic/before-getting-started.html +0 -127
- package/docs/.island/dist/zh/guide/basic/command-preview.html +0 -100
- package/docs/.island/dist/zh/guide/basic/modify-output-product.html +0 -140
- package/docs/.island/dist/zh/guide/basic/publish-your-project.html +0 -92
- package/docs/.island/dist/zh/guide/basic/test-your-project.html +0 -72
- package/docs/.island/dist/zh/guide/basic/use-micro-generator.html +0 -65
- package/docs/.island/dist/zh/guide/basic/using-storybook.html +0 -114
- package/docs/.island/dist/zh/guide/intro/getting-started.html +0 -79
- package/docs/.island/dist/zh/guide/intro/welcome.html +0 -53
- package/docs/.island/dist/zh/guide/intro/why-module-engineering-solution.html +0 -49
- package/docs/.island/dist/zh/index.html +0 -42
|
@@ -1187,7 +1187,7 @@ const chCodeConfig = {
|
|
|
1187
1187
|
"autoImport": true,
|
|
1188
1188
|
"showCopyButton": true,
|
|
1189
1189
|
"skipLanguages": [],
|
|
1190
|
-
"filepath": "/Users/
|
|
1190
|
+
"filepath": "/Users/bytedance/github/targeral/modern-dev/website/module-tools/docs/zh/guide/basic/using-storybook.mdx"
|
|
1191
1191
|
};
|
|
1192
1192
|
const frontmatter = {
|
|
1193
1193
|
"sidebar_position": 5
|
|
@@ -1214,7 +1214,7 @@ const toc = [{
|
|
|
1214
1214
|
"depth": 2
|
|
1215
1215
|
}];
|
|
1216
1216
|
const title = `使用 Storybook`;
|
|
1217
|
-
const content = "\"---\\nsidebar_position: 5\\n---\\n\\n# 使用 Storybook\\n\\n首先如果没有看过以下内容的话,可以先花几分钟先了解一下:\\n\\n- [使用微生成器开启 Storybook 调试](/guide/basic/use-micro-generator#storybook-调试)\\n- [`modern dev`](/guide/basic/command-preview#modern-dev)\\n\\n[Storybook](https://storybook.js.org/) 是一个专门用于组件调试的工具,围绕着组件开发提供了:\\n\\n- 丰富多样的调试能力\\n- 可与一些测试工具结合使用\\n- 可重复使用的文档内容\\n- 可分享能力\\n- 工作流程自动化\\n\\n因此它是一个复杂且功能强大的工具。\\n\\n模块工程解决方案集成了 Storybook
|
|
1217
|
+
const content = "\"---\\nsidebar_position: 5\\n---\\n\\n# 使用 Storybook\\n\\n首先如果没有看过以下内容的话,可以先花几分钟先了解一下:\\n\\n- [使用微生成器开启 Storybook 调试](/guide/basic/use-micro-generator#storybook-调试)\\n- [`modern dev`](/guide/basic/command-preview#modern-dev)\\n\\n[Storybook](https://storybook.js.org/) 是一个专门用于组件调试的工具,围绕着组件开发提供了:\\n\\n- 丰富多样的调试能力\\n- 可与一些测试工具结合使用\\n- 可重复使用的文档内容\\n- 可分享能力\\n- 工作流程自动化\\n\\n因此它是一个复杂且功能强大的工具。\\n\\n模块工程解决方案集成了 Storybook,因此你几乎可以按照 Storybook 官方文档的内容进行使用。不过依然有一些地方需要注意,接下来讲解一下。\\n\\n## 调试代码\\n\\n在调试代码过程中需要引入项目代码,目前可以通过两种方式引入项目代码:\\n\\n- 引用项目产物\\n- 引用项目源码\\n\\n我们更推荐使用第一种“**引用项目产物**”的方式。因为它更接近真实的使用场景,不仅可以对组件功能进行调试,同时也对构建产物的正确性进行了验证。\\n\\n接下来我们分别讲一下这两种方式具体如何使用。\\n\\n### 引用组件产物\\n\\n假如存在 TypeScript 项目 `foo`:\\n\\n<CH.Spotlight>\\n\\n```json package.json\\n{\\n \\\"name\\\": \\\"foo\\\",\\n \\\"main\\\": \\\"./dist/index.js\\\",\\n \\\"types\\\": \\\"./dist/types/index.d.ts\\\"\\n}\\n```\\n\\n---\\n\\n确保 `package.json` 的 `main` 和 `types`\\n的值为正确的产物路径。\\n\\n```json package.json\\n{\\n \\\"name\\\": \\\"foo\\\",\\n \\\"main\\\": \\\"./dist/index.js\\\",\\n \\\"types\\\": \\\"./dist/types/index.d.ts\\\"\\n}\\n```\\n\\n---\\n\\n`foo` 项目的源码。\\n\\n```typescript src/index.ts\\nexport const content = 'hello world';\\n```\\n\\n---\\n\\n确保在 `stories/tsconfig.json` 中设置了指向项目根目录的 `paths` 配置。\\n`paths` 的 `key` 与项目名称相同,这样在编译过程中以及在代码中不会出现问题。\\n\\n```json stories/tsconfig.json focus=5:7\\n{\\n \\\"extends\\\": \\\"../tsconfig.json\\\",\\n \\\"compilerOptions\\\": {\\n \\\"baseUrl\\\": \\\"../\\\",\\n \\\"paths\\\": {\\n \\\"foo\\\": [\\\".\\\"],\\n \\\"foo/*\\\": [\\\"./*\\\"]\\n }\\n },\\n \\\"include\\\": [\\n \\\"**/*\\\"\\n ]\\n}\\n```\\n\\n---\\n\\n最后在 Story 代码中直接以项目名称的方式引用。\\n\\n```tsx stories/index.stories.tsx focus=1:1\\nimport { content } from 'foo';\\n\\nconst Component = () => <div>this is a Story Component {content}</div>;\\n\\nexport const YourStory = () => <Component />;\\n\\nexport default {\\n title: 'Your Stories',\\n};\\n```\\n\\n</CH.Spotlight>\\n\\n:::info\\n在开发过程中,可能会遇到无法实时获得类型定义的情况。因为只有当保存代码后,产物目录下的类型文件才会更新。此时:\\n\\n对于 `pnpm` 的项目,可以按照下面的内容对 `package.json` 进行修改:\\n\\n```ts focus=4:7\\n{\\n \\\"name\\\": \\\"foo\\\",\\n \\\"main\\\": \\\"./dist/index.js\\\",\\n \\\"types\\\": \\\"./src/index.ts\\\",\\n \\\"publishConfig\\\": {\\n \\\"types\\\": \\\"./dist/index.d.ts\\\",\\n }\\n}\\n```\\n\\n> 关于 pnpm 的 `publishConfig` 的使用,可以阅读下面这个[链接](https://pnpm.io/package_json#publishconfig)。\\n\\n而对于 npm 和 Yarn 的项目,则只能通过手动的方式在**开发阶段**和**发布阶段**对 `package.json` 的 `types` 的值进行修改。\\n:::\\n\\n那么为什么可以直接引用产物呢?\\n\\n1. 在执行 `modern dev storybook` 命令之前,会自动执行 `modern build` 命令,保证项目构建产物的存在。\\n2. 在 Storybook 内部增加了针对 `tsconfig.json` 文件或者以项目名称作为别名的处理,保证能够**根据 `package.json` 解析出项目的产物路径**。\\n\\n### 引用组件源码\\n\\n引用组件的源码可以通过相对路径的方式:\\n\\n```ts ./stories/index.tsx\\nimport { content } from '../src';\\n\\nconst Component = () => <div>this is a Story Component {content}</div>;\\n\\nexport const YourStory = () => <Component />;\\n\\nexport default {\\n title: 'Your Stories',\\n};\\n```\\n\\n那么为什么不推荐使用源码的方式呢?\\n\\n不仅仅是因为使用组件源码无法验证组件产物是否正确,**同时模块工程对于构建产物支持的一些配置无法完全转换为 Storybook\\n内部的配置**。如果某些配置无法进行相互转换的话,就会在 Storybook 调试过程中出现不符合预期的结果。\\n\\n## 配置 Storybook\\n\\nStorybook 官方通过一个名为 `.storybook` 的文件夹来进行项目配置,其中包含各种配置文件。**在模块工程方案中,可以在项目的 `config/storybook` 目录下增加 Storybook 配置文件。**\\n\\n关于 Storybook 各种配置文件的使用方式,可以查看下面的链接:\\n\\n- [Configure Storybook](https://storybook.js.org/docs/react/configure/overview)\\n\\n**不过在模块项目里进行 Storybook 存在一些限制**:\\n\\n- 目前不能修改 Story 文件存放的位置,即无法在 `main.js` 文件里修改 `stories` 配置。\\n- 目前不能修改 Webpack 和 Babel 相关的配置,即无法在 `main.js` 文件里修改 `webpackFinal` 和 `babel` 配置。\\n\\n在未来我们会考虑这些配置是否可以允许修改,不过目前为了减少不可预知的问题暂时限制使用这些配置。\\n\\n\\n## 构建 Storybook 产物\\n\\n除了可以对组件或者普通的模块进行 Storybook 调试,还可以通过下面的命令来执行 Storybook 的构建任务。\\n\\n```bash\\nmodern build --platform storybook\\n```\\n\\n关于 `modern build --platform` 命令可以查看:\\n\\n- [`modern build`](/guide/basic/command-preview#modern-build)\\n\\n构建完成后,可以在 `dist/storybook-static` 目录看到构建产物文件。\\n\"";
|
|
1218
1218
|
function _createMdxContent(props) {
|
|
1219
1219
|
const _components = Object.assign({
|
|
1220
1220
|
h1: "h1",
|
|
@@ -1226,13 +1226,14 @@ function _createMdxContent(props) {
|
|
|
1226
1226
|
h2: "h2",
|
|
1227
1227
|
strong: "strong",
|
|
1228
1228
|
h3: "h3",
|
|
1229
|
+
div: "div",
|
|
1229
1230
|
blockquote: "blockquote",
|
|
1230
1231
|
ol: "ol"
|
|
1231
1232
|
}, props.components);
|
|
1232
|
-
if (!CH) _missingMdxReference("CH", false, "39:1-
|
|
1233
|
-
if (!CH.Code) _missingMdxReference("CH.Code", true, "
|
|
1233
|
+
if (!CH) _missingMdxReference("CH", false, "39:1-107:16");
|
|
1234
|
+
if (!CH.Code) _missingMdxReference("CH.Code", true, "114:1-123:4");
|
|
1234
1235
|
if (!CH.CodeSlot) _missingMdxReference("CH.CodeSlot", true);
|
|
1235
|
-
if (!CH.Spotlight) _missingMdxReference("CH.Spotlight", true, "39:1-
|
|
1236
|
+
if (!CH.Spotlight) _missingMdxReference("CH.Spotlight", true, "39:1-107:16");
|
|
1236
1237
|
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
|
|
1237
1238
|
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.h1, {
|
|
1238
1239
|
id: "使用-storybook",
|
|
@@ -1280,7 +1281,7 @@ function _createMdxContent(props) {
|
|
|
1280
1281
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.p, {
|
|
1281
1282
|
children: "因此它是一个复杂且功能强大的工具。"
|
|
1282
1283
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.p, {
|
|
1283
|
-
children: "模块工程解决方案集成了 Storybook
|
|
1284
|
+
children: "模块工程解决方案集成了 Storybook,因此你几乎可以按照 Storybook 官方文档的内容进行使用。不过依然有一些地方需要注意,接下来讲解一下。"
|
|
1284
1285
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.h2, {
|
|
1285
1286
|
id: "调试代码",
|
|
1286
1287
|
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
@@ -1290,17 +1291,17 @@ function _createMdxContent(props) {
|
|
|
1290
1291
|
children: "#"
|
|
1291
1292
|
}), "调试代码"]
|
|
1292
1293
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.p, {
|
|
1293
|
-
children: "
|
|
1294
|
+
children: "在调试代码过程中需要引入项目代码,目前可以通过两种方式引入项目代码:"
|
|
1294
1295
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.ul, {
|
|
1295
1296
|
children: ["\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.li, {
|
|
1296
|
-
children: "
|
|
1297
|
+
children: "引用项目产物"
|
|
1297
1298
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.li, {
|
|
1298
|
-
children: "
|
|
1299
|
+
children: "引用项目源码"
|
|
1299
1300
|
}), "\n"]
|
|
1300
1301
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.p, {
|
|
1301
1302
|
children: ["我们更推荐使用第一种“", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.strong, {
|
|
1302
|
-
children: "
|
|
1303
|
-
}), "
|
|
1303
|
+
children: "引用项目产物"
|
|
1304
|
+
}), "”的方式。因为它更接近真实的使用场景,不仅可以对组件功能进行调试,同时也对构建产物的正确性进行了验证。"]
|
|
1304
1305
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.p, {
|
|
1305
1306
|
children: "接下来我们分别讲一下这两种方式具体如何使用。"
|
|
1306
1307
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.h3, {
|
|
@@ -2710,6 +2711,85 @@ function _createMdxContent(props) {
|
|
|
2710
2711
|
"color": "#ECEFF4"
|
|
2711
2712
|
}
|
|
2712
2713
|
}
|
|
2714
|
+
}, {
|
|
2715
|
+
"content": "],",
|
|
2716
|
+
"props": {
|
|
2717
|
+
"style": {
|
|
2718
|
+
"color": "#ECEFF4"
|
|
2719
|
+
}
|
|
2720
|
+
}
|
|
2721
|
+
}]
|
|
2722
|
+
}, {
|
|
2723
|
+
"tokens": [{
|
|
2724
|
+
"content": " ",
|
|
2725
|
+
"props": {
|
|
2726
|
+
"style": {
|
|
2727
|
+
"color": "#D8DEE9FF"
|
|
2728
|
+
}
|
|
2729
|
+
}
|
|
2730
|
+
}, {
|
|
2731
|
+
"content": "\"",
|
|
2732
|
+
"props": {
|
|
2733
|
+
"style": {
|
|
2734
|
+
"color": "#ECEFF4"
|
|
2735
|
+
}
|
|
2736
|
+
}
|
|
2737
|
+
}, {
|
|
2738
|
+
"content": "foo/*",
|
|
2739
|
+
"props": {
|
|
2740
|
+
"style": {
|
|
2741
|
+
"color": "#8FBCBB"
|
|
2742
|
+
}
|
|
2743
|
+
}
|
|
2744
|
+
}, {
|
|
2745
|
+
"content": "\"",
|
|
2746
|
+
"props": {
|
|
2747
|
+
"style": {
|
|
2748
|
+
"color": "#ECEFF4"
|
|
2749
|
+
}
|
|
2750
|
+
}
|
|
2751
|
+
}, {
|
|
2752
|
+
"content": ":",
|
|
2753
|
+
"props": {
|
|
2754
|
+
"style": {
|
|
2755
|
+
"color": "#ECEFF4"
|
|
2756
|
+
}
|
|
2757
|
+
}
|
|
2758
|
+
}, {
|
|
2759
|
+
"content": " ",
|
|
2760
|
+
"props": {
|
|
2761
|
+
"style": {
|
|
2762
|
+
"color": "#D8DEE9FF"
|
|
2763
|
+
}
|
|
2764
|
+
}
|
|
2765
|
+
}, {
|
|
2766
|
+
"content": "[",
|
|
2767
|
+
"props": {
|
|
2768
|
+
"style": {
|
|
2769
|
+
"color": "#ECEFF4"
|
|
2770
|
+
}
|
|
2771
|
+
}
|
|
2772
|
+
}, {
|
|
2773
|
+
"content": "\"",
|
|
2774
|
+
"props": {
|
|
2775
|
+
"style": {
|
|
2776
|
+
"color": "#ECEFF4"
|
|
2777
|
+
}
|
|
2778
|
+
}
|
|
2779
|
+
}, {
|
|
2780
|
+
"content": "./*",
|
|
2781
|
+
"props": {
|
|
2782
|
+
"style": {
|
|
2783
|
+
"color": "#A3BE8C"
|
|
2784
|
+
}
|
|
2785
|
+
}
|
|
2786
|
+
}, {
|
|
2787
|
+
"content": "\"",
|
|
2788
|
+
"props": {
|
|
2789
|
+
"style": {
|
|
2790
|
+
"color": "#ECEFF4"
|
|
2791
|
+
}
|
|
2792
|
+
}
|
|
2713
2793
|
}, {
|
|
2714
2794
|
"content": "]",
|
|
2715
2795
|
"props": {
|
|
@@ -3562,7 +3642,7 @@ function _createMdxContent(props) {
|
|
|
3562
3642
|
children: "main"
|
|
3563
3643
|
}), " 和 ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, {
|
|
3564
3644
|
children: "types"
|
|
3565
|
-
}), "\n
|
|
3645
|
+
}), "\n的值为正确的产物路径。"]
|
|
3566
3646
|
}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CH.CodeSlot, {})]
|
|
3567
3647
|
}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
|
|
3568
3648
|
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.p, {
|
|
@@ -3580,403 +3660,412 @@ function _createMdxContent(props) {
|
|
|
3580
3660
|
children: "paths"
|
|
3581
3661
|
}), " 的 ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, {
|
|
3582
3662
|
children: "key"
|
|
3583
|
-
}), "
|
|
3663
|
+
}), " 与项目名称相同,这样在编译过程中以及在代码中不会出现问题。"]
|
|
3584
3664
|
}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CH.CodeSlot, {})]
|
|
3585
3665
|
}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
|
|
3586
3666
|
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.p, {
|
|
3587
3667
|
children: "最后在 Story 代码中直接以项目名称的方式引用。"
|
|
3588
3668
|
}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CH.CodeSlot, {})]
|
|
3589
3669
|
})]
|
|
3590
|
-
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
children: "
|
|
3595
|
-
}),
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
"
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
}
|
|
3625
|
-
}
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
}
|
|
3690
|
-
}
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
}
|
|
3755
|
-
}
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
}
|
|
3820
|
-
}
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
}
|
|
3864
|
-
}
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
}
|
|
3936
|
-
}
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
}
|
|
3952
|
-
}
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
children: "
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3670
|
+
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.div, {
|
|
3671
|
+
className: "modern-directive info",
|
|
3672
|
+
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.p, {
|
|
3673
|
+
className: "modern-directive-title",
|
|
3674
|
+
children: "INFO"
|
|
3675
|
+
}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.div, {
|
|
3676
|
+
className: "modern-directive-content",
|
|
3677
|
+
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.p, {
|
|
3678
|
+
children: "\n在开发过程中,可能会遇到无法实时获得类型定义的情况。因为只有当保存代码后,产物目录下的类型文件才会更新。此时:"
|
|
3679
|
+
}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.p, {
|
|
3680
|
+
children: ["对于 ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, {
|
|
3681
|
+
children: "pnpm"
|
|
3682
|
+
}), " 的项目,可以按照下面的内容对 ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, {
|
|
3683
|
+
children: "package.json"
|
|
3684
|
+
}), " 进行修改:"]
|
|
3685
|
+
}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CH.Code, {
|
|
3686
|
+
codeConfig: chCodeConfig,
|
|
3687
|
+
northPanel: {
|
|
3688
|
+
"tabs": [""],
|
|
3689
|
+
"active": "",
|
|
3690
|
+
"heightRatio": 1
|
|
3691
|
+
},
|
|
3692
|
+
files: [{
|
|
3693
|
+
"name": "",
|
|
3694
|
+
"focus": "4:7",
|
|
3695
|
+
"code": {
|
|
3696
|
+
"lines": [{
|
|
3697
|
+
"tokens": [{
|
|
3698
|
+
"content": "{",
|
|
3699
|
+
"props": {
|
|
3700
|
+
"style": {
|
|
3701
|
+
"color": "#ECEFF4"
|
|
3702
|
+
}
|
|
3703
|
+
}
|
|
3704
|
+
}]
|
|
3705
|
+
}, {
|
|
3706
|
+
"tokens": [{
|
|
3707
|
+
"content": " ",
|
|
3708
|
+
"props": {
|
|
3709
|
+
"style": {
|
|
3710
|
+
"color": "#D8DEE9FF"
|
|
3711
|
+
}
|
|
3712
|
+
}
|
|
3713
|
+
}, {
|
|
3714
|
+
"content": "\"",
|
|
3715
|
+
"props": {
|
|
3716
|
+
"style": {
|
|
3717
|
+
"color": "#ECEFF4"
|
|
3718
|
+
}
|
|
3719
|
+
}
|
|
3720
|
+
}, {
|
|
3721
|
+
"content": "name",
|
|
3722
|
+
"props": {
|
|
3723
|
+
"style": {
|
|
3724
|
+
"color": "#A3BE8C"
|
|
3725
|
+
}
|
|
3726
|
+
}
|
|
3727
|
+
}, {
|
|
3728
|
+
"content": "\"",
|
|
3729
|
+
"props": {
|
|
3730
|
+
"style": {
|
|
3731
|
+
"color": "#ECEFF4"
|
|
3732
|
+
}
|
|
3733
|
+
}
|
|
3734
|
+
}, {
|
|
3735
|
+
"content": ": ",
|
|
3736
|
+
"props": {
|
|
3737
|
+
"style": {
|
|
3738
|
+
"color": "#D8DEE9FF"
|
|
3739
|
+
}
|
|
3740
|
+
}
|
|
3741
|
+
}, {
|
|
3742
|
+
"content": "\"",
|
|
3743
|
+
"props": {
|
|
3744
|
+
"style": {
|
|
3745
|
+
"color": "#ECEFF4"
|
|
3746
|
+
}
|
|
3747
|
+
}
|
|
3748
|
+
}, {
|
|
3749
|
+
"content": "foo",
|
|
3750
|
+
"props": {
|
|
3751
|
+
"style": {
|
|
3752
|
+
"color": "#A3BE8C"
|
|
3753
|
+
}
|
|
3754
|
+
}
|
|
3755
|
+
}, {
|
|
3756
|
+
"content": "\"",
|
|
3757
|
+
"props": {
|
|
3758
|
+
"style": {
|
|
3759
|
+
"color": "#ECEFF4"
|
|
3760
|
+
}
|
|
3761
|
+
}
|
|
3762
|
+
}, {
|
|
3763
|
+
"content": ",",
|
|
3764
|
+
"props": {
|
|
3765
|
+
"style": {
|
|
3766
|
+
"color": "#ECEFF4"
|
|
3767
|
+
}
|
|
3768
|
+
}
|
|
3769
|
+
}]
|
|
3770
|
+
}, {
|
|
3771
|
+
"tokens": [{
|
|
3772
|
+
"content": " ",
|
|
3773
|
+
"props": {
|
|
3774
|
+
"style": {
|
|
3775
|
+
"color": "#D8DEE9FF"
|
|
3776
|
+
}
|
|
3777
|
+
}
|
|
3778
|
+
}, {
|
|
3779
|
+
"content": "\"",
|
|
3780
|
+
"props": {
|
|
3781
|
+
"style": {
|
|
3782
|
+
"color": "#ECEFF4"
|
|
3783
|
+
}
|
|
3784
|
+
}
|
|
3785
|
+
}, {
|
|
3786
|
+
"content": "main",
|
|
3787
|
+
"props": {
|
|
3788
|
+
"style": {
|
|
3789
|
+
"color": "#A3BE8C"
|
|
3790
|
+
}
|
|
3791
|
+
}
|
|
3792
|
+
}, {
|
|
3793
|
+
"content": "\"",
|
|
3794
|
+
"props": {
|
|
3795
|
+
"style": {
|
|
3796
|
+
"color": "#ECEFF4"
|
|
3797
|
+
}
|
|
3798
|
+
}
|
|
3799
|
+
}, {
|
|
3800
|
+
"content": ": ",
|
|
3801
|
+
"props": {
|
|
3802
|
+
"style": {
|
|
3803
|
+
"color": "#D8DEE9FF"
|
|
3804
|
+
}
|
|
3805
|
+
}
|
|
3806
|
+
}, {
|
|
3807
|
+
"content": "\"",
|
|
3808
|
+
"props": {
|
|
3809
|
+
"style": {
|
|
3810
|
+
"color": "#ECEFF4"
|
|
3811
|
+
}
|
|
3812
|
+
}
|
|
3813
|
+
}, {
|
|
3814
|
+
"content": "./dist/index.js",
|
|
3815
|
+
"props": {
|
|
3816
|
+
"style": {
|
|
3817
|
+
"color": "#A3BE8C"
|
|
3818
|
+
}
|
|
3819
|
+
}
|
|
3820
|
+
}, {
|
|
3821
|
+
"content": "\"",
|
|
3822
|
+
"props": {
|
|
3823
|
+
"style": {
|
|
3824
|
+
"color": "#ECEFF4"
|
|
3825
|
+
}
|
|
3826
|
+
}
|
|
3827
|
+
}, {
|
|
3828
|
+
"content": ",",
|
|
3829
|
+
"props": {
|
|
3830
|
+
"style": {
|
|
3831
|
+
"color": "#ECEFF4"
|
|
3832
|
+
}
|
|
3833
|
+
}
|
|
3834
|
+
}]
|
|
3835
|
+
}, {
|
|
3836
|
+
"tokens": [{
|
|
3837
|
+
"content": " ",
|
|
3838
|
+
"props": {
|
|
3839
|
+
"style": {
|
|
3840
|
+
"color": "#D8DEE9FF"
|
|
3841
|
+
}
|
|
3842
|
+
}
|
|
3843
|
+
}, {
|
|
3844
|
+
"content": "\"",
|
|
3845
|
+
"props": {
|
|
3846
|
+
"style": {
|
|
3847
|
+
"color": "#ECEFF4"
|
|
3848
|
+
}
|
|
3849
|
+
}
|
|
3850
|
+
}, {
|
|
3851
|
+
"content": "types",
|
|
3852
|
+
"props": {
|
|
3853
|
+
"style": {
|
|
3854
|
+
"color": "#A3BE8C"
|
|
3855
|
+
}
|
|
3856
|
+
}
|
|
3857
|
+
}, {
|
|
3858
|
+
"content": "\"",
|
|
3859
|
+
"props": {
|
|
3860
|
+
"style": {
|
|
3861
|
+
"color": "#ECEFF4"
|
|
3862
|
+
}
|
|
3863
|
+
}
|
|
3864
|
+
}, {
|
|
3865
|
+
"content": ": ",
|
|
3866
|
+
"props": {
|
|
3867
|
+
"style": {
|
|
3868
|
+
"color": "#D8DEE9FF"
|
|
3869
|
+
}
|
|
3870
|
+
}
|
|
3871
|
+
}, {
|
|
3872
|
+
"content": "\"",
|
|
3873
|
+
"props": {
|
|
3874
|
+
"style": {
|
|
3875
|
+
"color": "#ECEFF4"
|
|
3876
|
+
}
|
|
3877
|
+
}
|
|
3878
|
+
}, {
|
|
3879
|
+
"content": "./src/index.ts",
|
|
3880
|
+
"props": {
|
|
3881
|
+
"style": {
|
|
3882
|
+
"color": "#A3BE8C"
|
|
3883
|
+
}
|
|
3884
|
+
}
|
|
3885
|
+
}, {
|
|
3886
|
+
"content": "\"",
|
|
3887
|
+
"props": {
|
|
3888
|
+
"style": {
|
|
3889
|
+
"color": "#ECEFF4"
|
|
3890
|
+
}
|
|
3891
|
+
}
|
|
3892
|
+
}, {
|
|
3893
|
+
"content": ",",
|
|
3894
|
+
"props": {
|
|
3895
|
+
"style": {
|
|
3896
|
+
"color": "#ECEFF4"
|
|
3897
|
+
}
|
|
3898
|
+
}
|
|
3899
|
+
}]
|
|
3900
|
+
}, {
|
|
3901
|
+
"tokens": [{
|
|
3902
|
+
"content": " ",
|
|
3903
|
+
"props": {
|
|
3904
|
+
"style": {
|
|
3905
|
+
"color": "#D8DEE9FF"
|
|
3906
|
+
}
|
|
3907
|
+
}
|
|
3908
|
+
}, {
|
|
3909
|
+
"content": "\"",
|
|
3910
|
+
"props": {
|
|
3911
|
+
"style": {
|
|
3912
|
+
"color": "#ECEFF4"
|
|
3913
|
+
}
|
|
3914
|
+
}
|
|
3915
|
+
}, {
|
|
3916
|
+
"content": "publishConfig",
|
|
3917
|
+
"props": {
|
|
3918
|
+
"style": {
|
|
3919
|
+
"color": "#A3BE8C"
|
|
3920
|
+
}
|
|
3921
|
+
}
|
|
3922
|
+
}, {
|
|
3923
|
+
"content": "\"",
|
|
3924
|
+
"props": {
|
|
3925
|
+
"style": {
|
|
3926
|
+
"color": "#ECEFF4"
|
|
3927
|
+
}
|
|
3928
|
+
}
|
|
3929
|
+
}, {
|
|
3930
|
+
"content": ": ",
|
|
3931
|
+
"props": {
|
|
3932
|
+
"style": {
|
|
3933
|
+
"color": "#D8DEE9FF"
|
|
3934
|
+
}
|
|
3935
|
+
}
|
|
3936
|
+
}, {
|
|
3937
|
+
"content": "{",
|
|
3938
|
+
"props": {
|
|
3939
|
+
"style": {
|
|
3940
|
+
"color": "#ECEFF4"
|
|
3941
|
+
}
|
|
3942
|
+
}
|
|
3943
|
+
}]
|
|
3944
|
+
}, {
|
|
3945
|
+
"tokens": [{
|
|
3946
|
+
"content": " ",
|
|
3947
|
+
"props": {
|
|
3948
|
+
"style": {
|
|
3949
|
+
"color": "#D8DEE9FF"
|
|
3950
|
+
}
|
|
3951
|
+
}
|
|
3952
|
+
}, {
|
|
3953
|
+
"content": "\"",
|
|
3954
|
+
"props": {
|
|
3955
|
+
"style": {
|
|
3956
|
+
"color": "#ECEFF4"
|
|
3957
|
+
}
|
|
3958
|
+
}
|
|
3959
|
+
}, {
|
|
3960
|
+
"content": "types",
|
|
3961
|
+
"props": {
|
|
3962
|
+
"style": {
|
|
3963
|
+
"color": "#A3BE8C"
|
|
3964
|
+
}
|
|
3965
|
+
}
|
|
3966
|
+
}, {
|
|
3967
|
+
"content": "\"",
|
|
3968
|
+
"props": {
|
|
3969
|
+
"style": {
|
|
3970
|
+
"color": "#ECEFF4"
|
|
3971
|
+
}
|
|
3972
|
+
}
|
|
3973
|
+
}, {
|
|
3974
|
+
"content": ":",
|
|
3975
|
+
"props": {
|
|
3976
|
+
"style": {
|
|
3977
|
+
"color": "#ECEFF4"
|
|
3978
|
+
}
|
|
3979
|
+
}
|
|
3980
|
+
}, {
|
|
3981
|
+
"content": " ",
|
|
3982
|
+
"props": {
|
|
3983
|
+
"style": {
|
|
3984
|
+
"color": "#D8DEE9FF"
|
|
3985
|
+
}
|
|
3986
|
+
}
|
|
3987
|
+
}, {
|
|
3988
|
+
"content": "\"",
|
|
3989
|
+
"props": {
|
|
3990
|
+
"style": {
|
|
3991
|
+
"color": "#ECEFF4"
|
|
3992
|
+
}
|
|
3993
|
+
}
|
|
3994
|
+
}, {
|
|
3995
|
+
"content": "./dist/index.d.ts",
|
|
3996
|
+
"props": {
|
|
3997
|
+
"style": {
|
|
3998
|
+
"color": "#A3BE8C"
|
|
3999
|
+
}
|
|
4000
|
+
}
|
|
4001
|
+
}, {
|
|
4002
|
+
"content": "\"",
|
|
4003
|
+
"props": {
|
|
4004
|
+
"style": {
|
|
4005
|
+
"color": "#ECEFF4"
|
|
4006
|
+
}
|
|
4007
|
+
}
|
|
4008
|
+
}, {
|
|
4009
|
+
"content": ",",
|
|
4010
|
+
"props": {
|
|
4011
|
+
"style": {
|
|
4012
|
+
"color": "#ECEFF4"
|
|
4013
|
+
}
|
|
4014
|
+
}
|
|
4015
|
+
}]
|
|
4016
|
+
}, {
|
|
4017
|
+
"tokens": [{
|
|
4018
|
+
"content": " ",
|
|
4019
|
+
"props": {
|
|
4020
|
+
"style": {
|
|
4021
|
+
"color": "#D8DEE9FF"
|
|
4022
|
+
}
|
|
4023
|
+
}
|
|
4024
|
+
}, {
|
|
4025
|
+
"content": "}",
|
|
4026
|
+
"props": {
|
|
4027
|
+
"style": {
|
|
4028
|
+
"color": "#ECEFF4"
|
|
4029
|
+
}
|
|
4030
|
+
}
|
|
4031
|
+
}]
|
|
4032
|
+
}, {
|
|
4033
|
+
"tokens": [{
|
|
4034
|
+
"content": "}",
|
|
4035
|
+
"props": {
|
|
4036
|
+
"style": {
|
|
4037
|
+
"color": "#ECEFF4"
|
|
4038
|
+
}
|
|
4039
|
+
}
|
|
4040
|
+
}]
|
|
4041
|
+
}],
|
|
4042
|
+
"lang": "ts"
|
|
4043
|
+
},
|
|
4044
|
+
"annotations": []
|
|
4045
|
+
}]
|
|
4046
|
+
}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.blockquote, {
|
|
4047
|
+
children: ["\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.p, {
|
|
4048
|
+
children: ["关于 pnpm 的 ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, {
|
|
4049
|
+
children: "publishConfig"
|
|
4050
|
+
}), " 的使用,可以阅读下面这个", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
4051
|
+
href: "https://pnpm.io/package_json#publishconfig",
|
|
4052
|
+
target: "_blank",
|
|
4053
|
+
rel: "nofollow",
|
|
4054
|
+
children: "链接"
|
|
4055
|
+
}), "。"]
|
|
4056
|
+
}), "\n"]
|
|
4057
|
+
}), "而对于 npm 和 Yarn 的项目,则只能通过手动的方式在", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.strong, {
|
|
4058
|
+
children: "开发阶段"
|
|
4059
|
+
}), "和", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.strong, {
|
|
4060
|
+
children: "发布阶段"
|
|
4061
|
+
}), "对 ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, {
|
|
4062
|
+
children: "package.json"
|
|
4063
|
+
}), " 的 ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, {
|
|
4064
|
+
children: "types"
|
|
4065
|
+
}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.p, {
|
|
4066
|
+
children: "的值进行修改。"
|
|
4067
|
+
})]
|
|
4068
|
+
})]
|
|
3980
4069
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.p, {
|
|
3981
4070
|
children: "那么为什么可以直接引用产物呢?"
|
|
3982
4071
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.ol, {
|
|
@@ -3987,7 +4076,9 @@ function _createMdxContent(props) {
|
|
|
3987
4076
|
children: "modern build"
|
|
3988
4077
|
}), " 命令,保证项目构建产物的存在。"]
|
|
3989
4078
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.li, {
|
|
3990
|
-
children: ["在 Storybook
|
|
4079
|
+
children: ["在 Storybook 内部增加了针对 ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, {
|
|
4080
|
+
children: "tsconfig.json"
|
|
4081
|
+
}), " 文件或者以项目名称作为别名的处理,保证能够", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.strong, {
|
|
3991
4082
|
children: ["根据 ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, {
|
|
3992
4083
|
children: "package.json"
|
|
3993
4084
|
}), " 解析出项目的产物路径"]
|
|
@@ -4659,7 +4750,7 @@ function MDXContent(props = {}) {
|
|
|
4659
4750
|
}
|
|
4660
4751
|
/* harmony default export */ __webpack_exports__["default"] = (MDXContent);
|
|
4661
4752
|
function _missingMdxReference(id, component, place) {
|
|
4662
|
-
throw new Error("Expected " + (component ? "component" : "object") + " `" + id + "` to be defined: you likely forgot to import, pass, or provide it." + (place ? "\nIt’s referenced in your code at `" + place + "` in `/Users/
|
|
4753
|
+
throw new Error("Expected " + (component ? "component" : "object") + " `" + id + "` to be defined: you likely forgot to import, pass, or provide it." + (place ? "\nIt’s referenced in your code at `" + place + "` in `/Users/bytedance/github/targeral/modern-dev/website/module-tools/docs/zh/guide/basic/using-storybook.mdx`" : ""));
|
|
4663
4754
|
}
|
|
4664
4755
|
|
|
4665
4756
|
|