storybook-builder-rsbuild 1.0.1 → 1.0.2

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/dist/index.d.ts CHANGED
@@ -29,7 +29,12 @@ type BuilderOptions = {
29
29
  /**
30
30
  * Enable Rspack's lazy compilation (experimental).
31
31
  */
32
- lazyCompilation?: boolean;
32
+ lazyCompilation?: NonNullable<RsbuildConfig['performance']>['buildCache'];
33
+ /**
34
+ * Enable Rspack's [persistent cache(experimental)](https://rspack.dev/config/experiments#experimentscache).
35
+ * We continue to use the name `fsCache` here to maintain better compatibility with the webpack builder.
36
+ */
37
+ fsCache?: boolean;
33
38
  /**
34
39
  * Which environment to use from the Rsbuild config.
35
40
  */
package/dist/index.js CHANGED
@@ -133,7 +133,7 @@ var import_server_errors = require("storybook/internal/server-errors");
133
133
  var import_node_path3 = require("path");
134
134
  var import_core = require("@rsbuild/core");
135
135
  var import_plugin_type_check = require("@rsbuild/plugin-type-check");
136
- var import_preset = require("@storybook/addon-docs/dist/preset");
136
+ var import_preset = require("@storybook/addon-docs/preset");
137
137
  var import_case_sensitive_paths_webpack_plugin = __toESM(require("case-sensitive-paths-webpack-plugin"));
138
138
  var import_rsbuild_plugin_html_minifier_terser = require("rsbuild-plugin-html-minifier-terser");
139
139
  var import_common2 = require("storybook/internal/common");
@@ -370,6 +370,7 @@ var iframe_rsbuild_config_default = async (options, extraWebpackConfig) => {
370
370
  const shouldCheckTs = typescriptOptions.check && !typescriptOptions.skipCompiler;
371
371
  const tsCheckOptions = typescriptOptions.checkOptions || {};
372
372
  const builderOptions = await (0, import_common2.getBuilderOptions)(options);
373
+ const cacheConfig = builderOptions.fsCache ? true : void 0;
373
374
  const lazyCompilationConfig = builderOptions.lazyCompilation && !isProd ? {
374
375
  lazyCompilation: { entries: false }
375
376
  } : {};
@@ -481,7 +482,8 @@ var iframe_rsbuild_config_default = async (options, extraWebpackConfig) => {
481
482
  splitChunks: {
482
483
  chunks: "all"
483
484
  }
484
- }
485
+ },
486
+ buildCache: cacheConfig
485
487
  },
486
488
  plugins: [
487
489
  shouldCheckTs ? (0, import_plugin_type_check.pluginTypeCheck)(tsCheckOptions) : null,
@@ -553,7 +555,7 @@ var iframe_rsbuild_config_default = async (options, extraWebpackConfig) => {
553
555
  ...config.experiments,
554
556
  ...lazyCompilationConfig
555
557
  };
556
- return mergeConfig(config, extraWebpackConfig, appliedDocsWebpack);
558
+ return mergeConfig(config, extraWebpackConfig || {}, appliedDocsWebpack);
557
559
  },
558
560
  htmlPlugin: {
559
561
  filename: "iframe.html",
@@ -650,13 +652,14 @@ var rsbuild = async (_, options) => {
650
652
  "webpackFinal",
651
653
  // TODO: using empty webpack config as base for now. It's better to using the composed rspack
652
654
  // config in `iframe-rsbuild.config.ts` as base config. But when `tools.rspack` is an async function,
653
- // the following `tools.rspack` raise an ` Promises are not supported` error.
655
+ // the following `tools.rspack` raise an `Promises are not supported` error.
654
656
  {
655
657
  output: {},
656
658
  module: {},
657
659
  plugins: [],
658
660
  resolve: {},
659
- devServer: {},
661
+ // https://github.com/web-infra-dev/rsbuild/blob/8dc35dc1d1500d2f119875d46b6a07e27986d532/packages/core/src/provider/rspackConfig.ts#L167
662
+ devServer: void 0,
660
663
  optimization: {},
661
664
  performance: {},
662
665
  externals: {},
package/dist/index.mjs CHANGED
@@ -9,7 +9,7 @@ import { corePath } from 'storybook/core-path';
9
9
  import { normalizeStories, loadPreviewOrConfigFile, getBuilderOptions, readTemplate, resolveAddonName, getPresets, stringifyProcessEnvs, isPreservingSymlinks } from 'storybook/internal/common';
10
10
  import { WebpackInvocationError } from 'storybook/internal/server-errors';
11
11
  import { pluginTypeCheck } from '@rsbuild/plugin-type-check';
12
- import { webpack } from '@storybook/addon-docs/dist/preset';
12
+ import { webpack } from '@storybook/addon-docs/preset';
13
13
  import CaseSensitivePathsPlugin from 'case-sensitive-paths-webpack-plugin';
14
14
  import { pluginHtmlMinifierTerser } from 'rsbuild-plugin-html-minifier-terser';
15
15
  import { globalsNameReferenceMap } from 'storybook/internal/preview/globals';
@@ -314,6 +314,7 @@ var iframe_rsbuild_config_default = async (options, extraWebpackConfig) => {
314
314
  const shouldCheckTs = typescriptOptions.check && !typescriptOptions.skipCompiler;
315
315
  const tsCheckOptions = typescriptOptions.checkOptions || {};
316
316
  const builderOptions = await getBuilderOptions(options);
317
+ const cacheConfig = builderOptions.fsCache ? true : void 0;
317
318
  const lazyCompilationConfig = builderOptions.lazyCompilation && !isProd ? {
318
319
  lazyCompilation: { entries: false }
319
320
  } : {};
@@ -425,7 +426,8 @@ var iframe_rsbuild_config_default = async (options, extraWebpackConfig) => {
425
426
  splitChunks: {
426
427
  chunks: "all"
427
428
  }
428
- }
429
+ },
430
+ buildCache: cacheConfig
429
431
  },
430
432
  plugins: [
431
433
  shouldCheckTs ? pluginTypeCheck(tsCheckOptions) : null,
@@ -499,7 +501,7 @@ var iframe_rsbuild_config_default = async (options, extraWebpackConfig) => {
499
501
  ...config.experiments,
500
502
  ...lazyCompilationConfig
501
503
  };
502
- return mergeConfig(config, extraWebpackConfig, appliedDocsWebpack);
504
+ return mergeConfig(config, extraWebpackConfig || {}, appliedDocsWebpack);
503
505
  },
504
506
  htmlPlugin: {
505
507
  filename: "iframe.html",
@@ -592,13 +594,14 @@ var rsbuild = async (_, options) => {
592
594
  "webpackFinal",
593
595
  // TODO: using empty webpack config as base for now. It's better to using the composed rspack
594
596
  // config in `iframe-rsbuild.config.ts` as base config. But when `tools.rspack` is an async function,
595
- // the following `tools.rspack` raise an ` Promises are not supported` error.
597
+ // the following `tools.rspack` raise an `Promises are not supported` error.
596
598
  {
597
599
  output: {},
598
600
  module: {},
599
601
  plugins: [],
600
602
  resolve: {},
601
- devServer: {},
603
+ // https://github.com/web-infra-dev/rsbuild/blob/8dc35dc1d1500d2f119875d46b6a07e27986d532/packages/core/src/provider/rspackConfig.ts#L167
604
+ devServer: void 0,
602
605
  optimization: {},
603
606
  performance: {},
604
607
  externals: {},
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "storybook-builder-rsbuild",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Rsbuild builder for Storybook",
5
5
  "keywords": [
6
6
  "storybook",
7
7
  "rsbuild",
8
8
  "rspack"
9
9
  ],
10
- "homepage": "https://storybook-rsbuild.netlify.app",
10
+ "homepage": "https://storybook.rsbuild.dev",
11
11
  "bugs": {
12
12
  "url": "https://github.com/rspack-contrib/storybook-rsbuild/issues"
13
13
  },
@@ -57,9 +57,9 @@
57
57
  "!src/**/*"
58
58
  ],
59
59
  "dependencies": {
60
- "@rsbuild/plugin-type-check": "^1.2.1",
61
- "@storybook/addon-docs": "^8.2.1",
62
- "@storybook/core-webpack": "^8.2.1",
60
+ "@rsbuild/plugin-type-check": "^1.2.2",
61
+ "@storybook/addon-docs": "^8.6.14",
62
+ "@storybook/core-webpack": "^8.6.14",
63
63
  "browser-assert": "^1.2.1",
64
64
  "case-sensitive-paths-webpack-plugin": "^2.4.0",
65
65
  "cjs-module-lexer": "^1.4.3",
@@ -78,14 +78,14 @@
78
78
  "util-deprecate": "^1.0.2"
79
79
  },
80
80
  "devDependencies": {
81
- "@rsbuild/core": "^1.1.13",
81
+ "@rsbuild/core": "^1.3.22",
82
82
  "@types/find-cache-dir": "^5.0.2",
83
83
  "@types/fs-extra": "^11.0.4",
84
84
  "@types/node": "^18.0.0",
85
85
  "@types/pretty-hrtime": "^1.0.3",
86
86
  "pretty-hrtime": "^1.0.3",
87
87
  "slash": "^5.1.0",
88
- "storybook": "8.6.3",
88
+ "storybook": "8.6.14",
89
89
  "typescript": "^5.7.3"
90
90
  },
91
91
  "peerDependencies": {