storybook-builder-rsbuild 0.0.14 → 0.1.0

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
@@ -4,7 +4,7 @@ import { TypescriptOptions as TypescriptOptions$1, Builder, Options, BuilderResu
4
4
  import { PluginTypeCheckerOptions } from '@rsbuild/plugin-type-check';
5
5
 
6
6
  type RsbuildStats = {
7
- toJson: () => any;
7
+ toJson: (...args: any[]) => any;
8
8
  };
9
9
  /**
10
10
  * Options for TypeScript usage within Storybook.
@@ -33,6 +33,10 @@ type BuilderOptions = {
33
33
  * Which environment to use from the Rsbuild config.
34
34
  */
35
35
  environment?: string;
36
+ /**
37
+ * @storybook/addon-docs options
38
+ */
39
+ addonDocs?: any;
36
40
  };
37
41
  interface BuilderResult extends BuilderResult$1 {
38
42
  stats?: Stats;
package/dist/index.js CHANGED
@@ -302,7 +302,8 @@ var storybookPaths = {
302
302
  ...themingPath ? { "@storybook/theming": themingPath } : {}
303
303
  };
304
304
  var iframe_rsbuild_config_default = async (options) => {
305
- const appliedDocsWebpack = await (0, import_preset.webpack)({}, options);
305
+ const { rsbuildConfigPath, addonDocs } = await (0, import_common2.getBuilderOptions)(options);
306
+ const appliedDocsWebpack = await (0, import_preset.webpack)({}, { ...options, ...addonDocs });
306
307
  const {
307
308
  outputDir = (0, import_node_path3.join)(".", "public"),
308
309
  quiet,
@@ -345,7 +346,6 @@ var iframe_rsbuild_config_default = async (options) => {
345
346
  options.presets.apply("build"),
346
347
  presets.apply("tags", {})
347
348
  ]);
348
- const { rsbuildConfigPath } = await (0, import_common2.getBuilderOptions)(options);
349
349
  const stories = (0, import_common2.normalizeStories)(nonNormalizedStories, {
350
350
  configDir: options.configDir,
351
351
  workingDir
@@ -491,6 +491,15 @@ var iframe_rsbuild_config_default = async (options) => {
491
491
  });
492
492
  config.resolve ??= {};
493
493
  config.resolve.symlinks = !(0, import_common2.isPreservingSymlinks)();
494
+ config.resolve.extensions = [
495
+ ".mjs",
496
+ ".js",
497
+ ".jsx",
498
+ ".ts",
499
+ ".tsx",
500
+ ".json",
501
+ ".cjs"
502
+ ];
494
503
  config.watchOptions = {
495
504
  ignored: /node_modules/
496
505
  };
@@ -540,7 +549,7 @@ var iframe_rsbuild_config_default = async (options) => {
540
549
  inject: false,
541
550
  template,
542
551
  templateParameters: {
543
- version: packageJson.version,
552
+ version: packageJson?.version ?? "0.0.0-storybook-rsbuild-unknown-version",
544
553
  globals: {
545
554
  CONFIG_TYPE: configType,
546
555
  LOGLEVEL: logLevel,
package/dist/index.mjs CHANGED
@@ -245,7 +245,8 @@ var storybookPaths = {
245
245
  ...themingPath ? { "@storybook/theming": themingPath } : {}
246
246
  };
247
247
  var iframe_rsbuild_config_default = async (options) => {
248
- const appliedDocsWebpack = await webpack({}, options);
248
+ const { rsbuildConfigPath, addonDocs } = await getBuilderOptions(options);
249
+ const appliedDocsWebpack = await webpack({}, { ...options, ...addonDocs });
249
250
  const {
250
251
  outputDir = join(".", "public"),
251
252
  quiet,
@@ -288,7 +289,6 @@ var iframe_rsbuild_config_default = async (options) => {
288
289
  options.presets.apply("build"),
289
290
  presets.apply("tags", {})
290
291
  ]);
291
- const { rsbuildConfigPath } = await getBuilderOptions(options);
292
292
  const stories = normalizeStories(nonNormalizedStories, {
293
293
  configDir: options.configDir,
294
294
  workingDir
@@ -436,6 +436,15 @@ var iframe_rsbuild_config_default = async (options) => {
436
436
  });
437
437
  config.resolve ??= {};
438
438
  config.resolve.symlinks = !isPreservingSymlinks();
439
+ config.resolve.extensions = [
440
+ ".mjs",
441
+ ".js",
442
+ ".jsx",
443
+ ".ts",
444
+ ".tsx",
445
+ ".json",
446
+ ".cjs"
447
+ ];
439
448
  config.watchOptions = {
440
449
  ignored: /node_modules/
441
450
  };
@@ -485,7 +494,7 @@ var iframe_rsbuild_config_default = async (options) => {
485
494
  inject: false,
486
495
  template,
487
496
  templateParameters: {
488
- version: packageJson.version,
497
+ version: packageJson?.version ?? "0.0.0-storybook-rsbuild-unknown-version",
489
498
  globals: {
490
499
  CONFIG_TYPE: configType,
491
500
  LOGLEVEL: logLevel,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "storybook-builder-rsbuild",
3
- "version": "0.0.14",
3
+ "version": "0.1.0",
4
4
  "description": "Rsbuild builder for Storybook",
5
5
  "keywords": [
6
6
  "storybook",
@@ -56,41 +56,41 @@
56
56
  "!src/**/*"
57
57
  ],
58
58
  "dependencies": {
59
- "@rsbuild/plugin-type-check": "1.0.1-beta.14",
59
+ "@rsbuild/plugin-type-check": "^1.0.1",
60
60
  "@storybook/addon-docs": "^8.2.1",
61
61
  "@storybook/core-webpack": "^8.2.1",
62
62
  "browser-assert": "^1.2.1",
63
63
  "case-sensitive-paths-webpack-plugin": "^2.4.0",
64
64
  "cjs-module-lexer": "^1.2.3",
65
65
  "constants-browserify": "^1.0.0",
66
- "css-loader": "^6.7.1",
67
- "es-module-lexer": "^1.5.0",
68
- "express": "^4.17.3",
69
- "fs-extra": "^11.1.0",
70
- "magic-string": "^0.30.5",
66
+ "css-loader": "^6.11.0",
67
+ "es-module-lexer": "^1.5.4",
68
+ "express": "^4.19.2",
69
+ "fs-extra": "^11.2.0",
70
+ "magic-string": "^0.30.11",
71
71
  "path-browserify": "^1.0.1",
72
72
  "process": "^0.11.10",
73
- "rsbuild-plugin-html-minifier-terser": "^1.1.0",
74
- "style-loader": "^3.3.1",
73
+ "rsbuild-plugin-html-minifier-terser": "^1.1.1",
74
+ "style-loader": "^3.3.4",
75
75
  "ts-dedent": "^2.2.0",
76
- "url": "^0.11.0",
77
- "util": "^0.12.4",
76
+ "url": "^0.11.4",
77
+ "util": "^0.12.5",
78
78
  "util-deprecate": "^1.0.2"
79
79
  },
80
80
  "devDependencies": {
81
- "@rsbuild/core": "1.0.1-beta.14",
81
+ "@rsbuild/core": "1.0.1",
82
82
  "@types/express": "^4.17.21",
83
83
  "@types/fs-extra": "^11.0.4",
84
84
  "@types/node": "^18.0.0",
85
- "@types/pretty-hrtime": "^1.0.0",
85
+ "@types/pretty-hrtime": "^1.0.3",
86
86
  "add": "^2.0.6",
87
87
  "pretty-hrtime": "^1.0.3",
88
- "slash": "^5.0.0",
89
- "storybook": "8.2.8",
88
+ "slash": "^5.1.0",
89
+ "storybook": "8.3.0-beta.3",
90
90
  "typescript": "^5.3.2"
91
91
  },
92
92
  "peerDependencies": {
93
- "@rsbuild/core": ">= 1.0.1-beta.14 || 1.x",
93
+ "@rsbuild/core": "^1.0.1",
94
94
  "storybook": "^8.2.1"
95
95
  },
96
96
  "peerDependenciesMeta": {
@@ -73,13 +73,8 @@
73
73
  <% } %>
74
74
  <script type="module">
75
75
  import './sb-preview/runtime.js';
76
-
77
76
  <% htmlWebpackPlugin.files.js.forEach(file => { %>
78
- <% if (file.startsWith('/')) { %>
79
- import '.<%= file %>';
80
- <% } else { %>
81
- import './<%= file %>';
82
- <% } %>
77
+ import '<%= file %>';
83
78
  <% }); %>
84
79
  </script>
85
80
  </body>