@storybook/react-dom-shim 7.6.0 → 8.0.0-alpha.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/preset.d.ts +23 -85
- package/dist/preset.js +1 -1
- package/package.json +12 -12
package/dist/preset.d.ts
CHANGED
|
@@ -2784,9 +2784,13 @@ interface Presets {
|
|
|
2784
2784
|
apply(extension: 'entries', config?: [], args?: any): Promise<unknown>;
|
|
2785
2785
|
apply(extension: 'stories', config?: [], args?: any): Promise<StoriesEntry[]>;
|
|
2786
2786
|
apply(extension: 'managerEntries', config: [], args?: any): Promise<string[]>;
|
|
2787
|
-
apply(extension: 'refs', config?: [], args?: any): Promise<
|
|
2788
|
-
apply(extension: 'core', config?:
|
|
2789
|
-
apply(extension: '
|
|
2787
|
+
apply(extension: 'refs', config?: [], args?: any): Promise<StorybookConfigRaw['refs']>;
|
|
2788
|
+
apply(extension: 'core', config?: StorybookConfigRaw['core'], args?: any): Promise<NonNullable<StorybookConfigRaw['core']>>;
|
|
2789
|
+
apply(extension: 'docs', config?: StorybookConfigRaw['docs'], args?: any): Promise<NonNullable<StorybookConfigRaw['docs']>>;
|
|
2790
|
+
apply(extension: 'features', config?: StorybookConfigRaw['features'], args?: any): Promise<NonNullable<StorybookConfigRaw['features']>>;
|
|
2791
|
+
apply(extension: 'typescript', config?: StorybookConfigRaw['typescript'], args?: any): Promise<NonNullable<StorybookConfigRaw['typescript']>>;
|
|
2792
|
+
apply(extension: 'build', config?: StorybookConfigRaw['build'], args?: any): Promise<NonNullable<StorybookConfigRaw['build']>>;
|
|
2793
|
+
apply(extension: 'staticDirs', config?: StorybookConfigRaw['staticDirs'], args?: any): Promise<StorybookConfigRaw['staticDirs']>;
|
|
2790
2794
|
apply<T>(extension: string, config?: T, args?: unknown): Promise<T>;
|
|
2791
2795
|
}
|
|
2792
2796
|
interface LoadedPreset {
|
|
@@ -2846,7 +2850,7 @@ interface BuilderOptions {
|
|
|
2846
2850
|
cache?: FileSystemCache;
|
|
2847
2851
|
configDir: string;
|
|
2848
2852
|
docsMode?: boolean;
|
|
2849
|
-
features?:
|
|
2853
|
+
features?: StorybookConfigRaw['features'];
|
|
2850
2854
|
versionCheck?: VersionCheck;
|
|
2851
2855
|
disableWebpackDefaults?: boolean;
|
|
2852
2856
|
serverChannelUrl?: string;
|
|
@@ -2952,9 +2956,10 @@ interface TestBuildConfig {
|
|
|
2952
2956
|
test?: TestBuildFlags;
|
|
2953
2957
|
}
|
|
2954
2958
|
/**
|
|
2955
|
-
* The interface for Storybook configuration in
|
|
2959
|
+
* The interface for Storybook configuration used internally in presets
|
|
2960
|
+
* The difference is that these values are the raw values, AKA, not wrapped with `PresetValue<>`
|
|
2956
2961
|
*/
|
|
2957
|
-
interface
|
|
2962
|
+
interface StorybookConfigRaw {
|
|
2958
2963
|
/**
|
|
2959
2964
|
* Sets the addons you want to use with Storybook.
|
|
2960
2965
|
*
|
|
@@ -2962,11 +2967,6 @@ interface StorybookConfig {
|
|
|
2962
2967
|
*/
|
|
2963
2968
|
addons?: Preset[];
|
|
2964
2969
|
core?: CoreConfig;
|
|
2965
|
-
/**
|
|
2966
|
-
* Sets a list of directories of static files to be loaded by Storybook server
|
|
2967
|
-
*
|
|
2968
|
-
* @example `['./public']` or `[{from: './public', 'to': '/assets'}]`
|
|
2969
|
-
*/
|
|
2970
2970
|
staticDirs?: (DirectoryMapping | string)[];
|
|
2971
2971
|
logLevel?: string;
|
|
2972
2972
|
features?: {
|
|
@@ -3008,86 +3008,24 @@ interface StorybookConfig {
|
|
|
3008
3008
|
disallowImplicitActionsInRenderV8?: boolean;
|
|
3009
3009
|
};
|
|
3010
3010
|
build?: TestBuildConfig;
|
|
3011
|
-
/**
|
|
3012
|
-
* Tells Storybook where to find stories.
|
|
3013
|
-
*
|
|
3014
|
-
* @example `['./src/*.stories.@(j|t)sx?']`
|
|
3015
|
-
*/
|
|
3016
3011
|
stories: StoriesEntry[];
|
|
3017
|
-
/**
|
|
3018
|
-
* Framework, e.g. '@storybook/react-vite', required in v7
|
|
3019
|
-
*/
|
|
3020
3012
|
framework?: Preset;
|
|
3021
|
-
/**
|
|
3022
|
-
* Controls how Storybook handles TypeScript files.
|
|
3023
|
-
*/
|
|
3024
3013
|
typescript?: Partial<TypescriptOptions>;
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
* Modify or return swc config.
|
|
3035
|
-
*/
|
|
3036
|
-
swc?: (config: Options$2, options: Options) => Options$2 | Promise<Options$2>;
|
|
3037
|
-
/**
|
|
3038
|
-
* Modify or return env config.
|
|
3039
|
-
*/
|
|
3040
|
-
env?: PresetValue<Record<string, string>>;
|
|
3041
|
-
/**
|
|
3042
|
-
* Modify or return babel config.
|
|
3043
|
-
*/
|
|
3044
|
-
babelDefault?: (config: TransformOptions, options: Options) => TransformOptions | Promise<TransformOptions>;
|
|
3045
|
-
/**
|
|
3046
|
-
* Add additional scripts to run in the preview a la `.storybook/preview.js`
|
|
3047
|
-
*
|
|
3048
|
-
* @deprecated use `previewAnnotations` or `/preview.js` file instead
|
|
3049
|
-
*/
|
|
3050
|
-
config?: PresetValue<Entry[]>;
|
|
3051
|
-
/**
|
|
3052
|
-
* Add additional scripts to run in the preview a la `.storybook/preview.js`
|
|
3053
|
-
*/
|
|
3054
|
-
previewAnnotations?: PresetValue<Entry[]>;
|
|
3055
|
-
/**
|
|
3056
|
-
* Process CSF files for the story index.
|
|
3057
|
-
* @deprecated use {@link experimental_indexers} instead
|
|
3058
|
-
*/
|
|
3059
|
-
storyIndexers?: PresetValue<StoryIndexer[]>;
|
|
3060
|
-
/**
|
|
3061
|
-
* Process CSF files for the story index.
|
|
3062
|
-
*/
|
|
3063
|
-
experimental_indexers?: PresetValue<Indexer[]>;
|
|
3064
|
-
/**
|
|
3065
|
-
* Docs related features in index generation
|
|
3066
|
-
*/
|
|
3014
|
+
refs?: CoreCommon_StorybookRefs;
|
|
3015
|
+
babel?: TransformOptions;
|
|
3016
|
+
swc?: Options$2;
|
|
3017
|
+
env?: Record<string, string>;
|
|
3018
|
+
babelDefault?: TransformOptions;
|
|
3019
|
+
config?: Entry[];
|
|
3020
|
+
previewAnnotations?: Entry[];
|
|
3021
|
+
storyIndexers?: StoryIndexer[];
|
|
3022
|
+
experimental_indexers?: Indexer[];
|
|
3067
3023
|
docs?: DocsOptions;
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
* The previewHead and previewBody functions accept a string,
|
|
3071
|
-
* which is the existing head/body, and return a modified string.
|
|
3072
|
-
*/
|
|
3073
|
-
previewHead?: PresetValue<string>;
|
|
3074
|
-
previewBody?: PresetValue<string>;
|
|
3075
|
-
/**
|
|
3076
|
-
* Programmatically override the preview's main page template.
|
|
3077
|
-
* This should return a reference to a file containing an `.ejs` template
|
|
3078
|
-
* that will be interpolated with environment variables.
|
|
3079
|
-
*
|
|
3080
|
-
* @example '.storybook/index.ejs'
|
|
3081
|
-
*/
|
|
3024
|
+
previewHead?: string;
|
|
3025
|
+
previewBody?: string;
|
|
3082
3026
|
previewMainTemplate?: string;
|
|
3083
|
-
|
|
3084
|
-
* Programmatically modify the preview head/body HTML.
|
|
3085
|
-
* The managerHead function accept a string,
|
|
3086
|
-
* which is the existing head content, and return a modified string.
|
|
3087
|
-
*/
|
|
3088
|
-
managerHead?: PresetValue<string>;
|
|
3027
|
+
managerHead?: string;
|
|
3089
3028
|
}
|
|
3090
|
-
type PresetValue<T> = T | ((config: T, options: Options) => T | Promise<T>);
|
|
3091
3029
|
type Path = string;
|
|
3092
3030
|
|
|
3093
3031
|
declare const webpackFinal: (config: any, options: Options) => Promise<any>;
|
package/dist/preset.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var preset_exports={};__export(preset_exports,{viteFinal:()=>viteFinal,webpackFinal:()=>webpackFinal});module.exports=__toCommonJS(preset_exports);var import_package=require("react-dom/package.json"),webpackFinal=async(config,options)=>{var _a;let{legacyRootApi}=await options.presets.apply("frameworkOptions")||{},isReact18=import_package.version.startsWith("18")||import_package.version.startsWith("0.0.0");return legacyRootApi??!isReact18?
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var preset_exports={};__export(preset_exports,{viteFinal:()=>viteFinal,webpackFinal:()=>webpackFinal});module.exports=__toCommonJS(preset_exports);var import_package=require("react-dom/package.json"),webpackFinal=async(config,options)=>{var _a;let{legacyRootApi}=await options.presets.apply("frameworkOptions")||{},isReact18=import_package.version.startsWith("18")||import_package.version.startsWith("0.0.0");return legacyRootApi??!isReact18?{...config,resolve:{...config.resolve,alias:{...(_a=config.resolve)==null?void 0:_a.alias,"@storybook/react-dom-shim":"@storybook/react-dom-shim/dist/react-16"}}}:config},viteFinal=async(config,options)=>{var _a,_b;let{legacyRootApi}=await options.presets.apply("frameworkOptions")||{},isReact18=import_package.version.startsWith("18")||import_package.version.startsWith("0.0.0");if(!(legacyRootApi||!isReact18))return config;let alias=Array.isArray((_a=config.resolve)==null?void 0:_a.alias)?config.resolve.alias.concat({find:/^@storybook\/react-dom-shim$/,replacement:"@storybook/react-dom-shim/dist/react-16"}):{...(_b=config.resolve)==null?void 0:_b.alias,"@storybook/react-dom-shim":"@storybook/react-dom-shim/dist/react-16"};return{...config,resolve:{...config.resolve,alias}}};0&&(module.exports={viteFinal,webpackFinal});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-dom-shim",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-alpha.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -22,26 +22,26 @@
|
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"exports": {
|
|
24
24
|
".": {
|
|
25
|
-
"types": "./dist/react-16.d.ts",
|
|
26
|
-
"node": "./dist/react-16.js",
|
|
27
|
-
"require": "./dist/react-16.js",
|
|
28
|
-
"import": "./dist/react-16.mjs"
|
|
29
|
-
},
|
|
30
|
-
"./dist/react-18": {
|
|
31
25
|
"types": "./dist/react-18.d.ts",
|
|
32
26
|
"node": "./dist/react-18.js",
|
|
33
27
|
"require": "./dist/react-18.js",
|
|
34
28
|
"import": "./dist/react-18.mjs"
|
|
35
29
|
},
|
|
30
|
+
"./dist/react-16": {
|
|
31
|
+
"types": "./dist/react-16.d.ts",
|
|
32
|
+
"node": "./dist/react-16.js",
|
|
33
|
+
"require": "./dist/react-16.js",
|
|
34
|
+
"import": "./dist/react-16.mjs"
|
|
35
|
+
},
|
|
36
36
|
"./dist/preset": {
|
|
37
37
|
"types": "./dist/preset.d.ts",
|
|
38
38
|
"require": "./dist/preset.js"
|
|
39
39
|
},
|
|
40
40
|
"./package.json": "./package.json"
|
|
41
41
|
},
|
|
42
|
-
"main": "dist/react-
|
|
43
|
-
"module": "dist/react-
|
|
44
|
-
"types": "dist/react-
|
|
42
|
+
"main": "dist/react-18.js",
|
|
43
|
+
"module": "dist/react-18.mjs",
|
|
44
|
+
"types": "dist/react-18.d.ts",
|
|
45
45
|
"files": [
|
|
46
46
|
"dist/**/*",
|
|
47
47
|
"README.md",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@storybook/types": "
|
|
58
|
-
"typescript": "
|
|
57
|
+
"@storybook/types": "8.0.0-alpha.0",
|
|
58
|
+
"typescript": "^5.3.2"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|