storybook-builder-rsbuild 2.1.6 → 3.0.0-beta.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.
@@ -0,0 +1,45 @@
1
+ import CJS_COMPAT_NODE_URL_1947c9521fb72e4e from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_1947c9521fb72e4e from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_1947c9521fb72e4e from "node:module";
4
+
5
+ var __filename = CJS_COMPAT_NODE_URL_1947c9521fb72e4e.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_1947c9521fb72e4e.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_1947c9521fb72e4e.createRequire(import.meta.url);
8
+
9
+ // ------------------------------------------------------------
10
+ // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
+ // ------------------------------------------------------------
12
+ var __create = Object.create;
13
+ var __defProp = Object.defineProperty;
14
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
15
+ var __getOwnPropNames = Object.getOwnPropertyNames;
16
+ var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
17
+ var __require = /* @__PURE__ */ ((x) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(x, {
18
+ get: (a, b) => (typeof require < "u" ? require : a)[b]
19
+ }) : x)(function(x) {
20
+ if (typeof require < "u") return require.apply(this, arguments);
21
+ throw Error('Dynamic require of "' + x + '" is not supported');
22
+ });
23
+ var __commonJS = (cb, mod) => function() {
24
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
25
+ };
26
+ var __copyProps = (to, from, except, desc) => {
27
+ if (from && typeof from == "object" || typeof from == "function")
28
+ for (let key of __getOwnPropNames(from))
29
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
30
+ return to;
31
+ };
32
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
33
+ // If the importer is in node compatibility mode or this is not an ESM
34
+ // file that has been converted to a CommonJS file using a Babel-
35
+ // compatible transform (i.e. "__esModule" has not been set), then set
36
+ // "default" to the CommonJS "module.exports" for node compatibility.
37
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
38
+ mod
39
+ ));
40
+
41
+ export {
42
+ __require,
43
+ __commonJS,
44
+ __toESM
45
+ };
package/dist/index.d.ts CHANGED
@@ -1,72 +1,3 @@
1
- import * as rsbuildReal from '@rsbuild/core';
2
- import { RsbuildConfig } from '@rsbuild/core';
3
- import { TypescriptOptions as TypescriptOptions$1, Builder, Options, StorybookConfigRaw, BuilderResult as BuilderResult$1 } from 'storybook/internal/types';
4
- import { PluginTypeCheckerOptions } from '@rsbuild/plugin-type-check';
5
-
6
- type RsbuildStats = {
7
- toJson: (...args: any[]) => any;
8
- };
9
- /**
10
- * Options for TypeScript usage within Storybook.
11
- */
12
- interface TypescriptOptions extends TypescriptOptions$1 {
13
- /**
14
- * Configures `@rsbuild/plugin-type-check`, using `fork-ts-checker-webpack-plugin` under the hood.
15
- */
16
- checkOptions?: PluginTypeCheckerOptions;
17
- }
18
- type RsbuildBuilder = Builder<RsbuildConfig, RsbuildStats>;
19
- type RsbuildFinal = (config: RsbuildConfig, options: Options) => RsbuildConfig | Promise<RsbuildConfig>;
20
- type StorybookConfigRsbuild = {
21
- rsbuildFinal?: RsbuildFinal;
22
- webpackAddons?: StorybookConfigRaw['addons'];
23
- };
24
- type BuilderOptions = {
25
- /**
26
- * Path to rsbuild.config file, relative to CWD.
27
- */
28
- rsbuildConfigPath?: string;
29
- /**
30
- * Enable Rspack's lazy compilation (experimental).
31
- */
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;
38
- /**
39
- * Which environment to use from the Rsbuild config.
40
- */
41
- environment?: string;
42
- /**
43
- * @storybook/addon-docs options
44
- */
45
- addonDocs?: any;
46
- };
47
- interface BuilderResult extends BuilderResult$1 {
48
- stats?: Stats;
49
- }
50
-
51
- declare const getVirtualModules: (options: Options) => Promise<{
52
- virtualModules: Record<string, string>;
53
- entries: string[];
54
- }>;
55
-
56
- type StatsOrMultiStats = Parameters<rsbuildReal.OnAfterBuildFn>[0]['stats'];
57
- type Stats = NonNullable<Exclude<StatsOrMultiStats, {
58
- stats: unknown[];
59
- }>>;
60
- declare const printDuration: (startTime: [number, number]) => string;
61
- type BuilderStartOptions = Parameters<RsbuildBuilder['start']>['0'];
62
- declare const executor: {
63
- get: (options: Options) => Promise<typeof rsbuildReal>;
64
- };
65
- declare const getConfig: RsbuildBuilder['getConfig'];
66
- declare function bail(): Promise<void>;
67
- declare const start: RsbuildBuilder['start'];
68
- declare const build: ({ options }: BuilderStartOptions) => Promise<Stats>;
69
- declare const corePresets: string[];
70
- declare const previewMainTemplate: () => string;
71
-
72
- export { BuilderOptions, BuilderResult, RsbuildBuilder, RsbuildFinal, Stats, StorybookConfigRsbuild, TypescriptOptions, bail, build, corePresets, executor, getConfig, getVirtualModules, previewMainTemplate, printDuration, start };
1
+ // auto generated file from file:///Users/bytedance/Projects/storybook-rsbuild/scripts/build/utils/generate-type-mappers.ts, do not edit
2
+ export * from '../src/index.ts';
3
+ export type * from '../src/index.ts';