@storybook/core-common 7.0.0-alpha.5 → 7.0.0-alpha.51
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 +166 -0
- package/dist/index.js +27 -0
- package/dist/index.mjs +27 -0
- package/jest.config.js +7 -0
- package/package.json +37 -43
- package/templates/base-preview-head.html +4 -4
- package/templates/{index.ejs → preview.ejs} +4 -4
- package/LICENSE +0 -21
- package/dist/cjs/index.js +0 -380
- package/dist/cjs/presets.js +0 -332
- package/dist/cjs/test-typings.d.js +0 -1
- package/dist/cjs/types.js +0 -5
- package/dist/cjs/utils/cache.js +0 -17
- package/dist/cjs/utils/check-addon-order.js +0 -54
- package/dist/cjs/utils/envs.js +0 -85
- package/dist/cjs/utils/file-cache.js +0 -71
- package/dist/cjs/utils/findDistEsm.js +0 -28
- package/dist/cjs/utils/get-storybook-configuration.js +0 -31
- package/dist/cjs/utils/get-storybook-info.js +0 -131
- package/dist/cjs/utils/glob-to-regexp.js +0 -32
- package/dist/cjs/utils/handlebars.js +0 -16
- package/dist/cjs/utils/interpolate.js +0 -23
- package/dist/cjs/utils/interpret-files.js +0 -48
- package/dist/cjs/utils/interpret-require.js +0 -113
- package/dist/cjs/utils/load-custom-presets.js +0 -32
- package/dist/cjs/utils/load-main-config.js +0 -21
- package/dist/cjs/utils/load-manager-or-addons-file.js +0 -34
- package/dist/cjs/utils/load-preview-or-config-file.js +0 -28
- package/dist/cjs/utils/log-config.js +0 -18
- package/dist/cjs/utils/normalize-stories.js +0 -143
- package/dist/cjs/utils/notify-telemetry.js +0 -38
- package/dist/cjs/utils/paths.js +0 -65
- package/dist/cjs/utils/print-duration.js +0 -16
- package/dist/cjs/utils/progress-reporting.js +0 -86
- package/dist/cjs/utils/readTemplate.js +0 -18
- package/dist/cjs/utils/resolve-path-in-sb-cache.js +0 -36
- package/dist/cjs/utils/safeResolve.js +0 -30
- package/dist/cjs/utils/template.js +0 -74
- package/dist/cjs/utils/to-importFn.js +0 -67
- package/dist/cjs/utils/to-require-context.js +0 -35
- package/dist/cjs/utils/validate-configuration-files.js +0 -83
- package/dist/esm/index.js +0 -28
- package/dist/esm/presets.js +0 -309
- package/dist/esm/test-typings.d.js +0 -0
- package/dist/esm/types.js +0 -1
- package/dist/esm/utils/cache.js +0 -7
- package/dist/esm/utils/check-addon-order.js +0 -45
- package/dist/esm/utils/envs.js +0 -70
- package/dist/esm/utils/file-cache.js +0 -57
- package/dist/esm/utils/findDistEsm.js +0 -14
- package/dist/esm/utils/get-storybook-configuration.js +0 -24
- package/dist/esm/utils/get-storybook-info.js +0 -116
- package/dist/esm/utils/glob-to-regexp.js +0 -24
- package/dist/esm/utils/handlebars.js +0 -5
- package/dist/esm/utils/interpolate.js +0 -14
- package/dist/esm/utils/interpret-files.js +0 -31
- package/dist/esm/utils/interpret-require.js +0 -95
- package/dist/esm/utils/load-custom-presets.js +0 -20
- package/dist/esm/utils/load-main-config.js +0 -9
- package/dist/esm/utils/load-manager-or-addons-file.js +0 -21
- package/dist/esm/utils/load-preview-or-config-file.js +0 -16
- package/dist/esm/utils/log-config.js +0 -8
- package/dist/esm/utils/normalize-stories.js +0 -116
- package/dist/esm/utils/notify-telemetry.js +0 -22
- package/dist/esm/utils/paths.js +0 -48
- package/dist/esm/utils/print-duration.js +0 -4
- package/dist/esm/utils/progress-reporting.js +0 -75
- package/dist/esm/utils/readTemplate.js +0 -7
- package/dist/esm/utils/resolve-path-in-sb-cache.js +0 -24
- package/dist/esm/utils/safeResolve.js +0 -15
- package/dist/esm/utils/template.js +0 -49
- package/dist/esm/utils/to-importFn.js +0 -52
- package/dist/esm/utils/to-require-context.js +0 -22
- package/dist/esm/utils/validate-configuration-files.js +0 -67
- package/dist/types/index.d.ts +0 -27
- package/dist/types/presets.d.ts +0 -41
- package/dist/types/types.d.ts +0 -371
- package/dist/types/utils/cache.d.ts +0 -1
- package/dist/types/utils/check-addon-order.d.ts +0 -16
- package/dist/types/utils/envs.d.ts +0 -8
- package/dist/types/utils/file-cache.d.ts +0 -30
- package/dist/types/utils/findDistEsm.d.ts +0 -1
- package/dist/types/utils/get-storybook-configuration.d.ts +0 -1
- package/dist/types/utils/get-storybook-info.d.ts +0 -12
- package/dist/types/utils/glob-to-regexp.d.ts +0 -1
- package/dist/types/utils/handlebars.d.ts +0 -1
- package/dist/types/utils/interpolate.d.ts +0 -9
- package/dist/types/utils/interpret-files.d.ts +0 -6
- package/dist/types/utils/interpret-require.d.ts +0 -2
- package/dist/types/utils/load-custom-presets.d.ts +0 -4
- package/dist/types/utils/load-main-config.d.ts +0 -4
- package/dist/types/utils/load-manager-or-addons-file.d.ts +0 -3
- package/dist/types/utils/load-preview-or-config-file.d.ts +0 -3
- package/dist/types/utils/log-config.d.ts +0 -1
- package/dist/types/utils/normalize-stories.d.ts +0 -11
- package/dist/types/utils/notify-telemetry.d.ts +0 -1
- package/dist/types/utils/paths.d.ts +0 -6
- package/dist/types/utils/print-duration.d.ts +0 -1
- package/dist/types/utils/progress-reporting.d.ts +0 -5
- package/dist/types/utils/readTemplate.d.ts +0 -1
- package/dist/types/utils/resolve-path-in-sb-cache.d.ts +0 -9
- package/dist/types/utils/safeResolve.d.ts +0 -2
- package/dist/types/utils/template.d.ts +0 -5
- package/dist/types/utils/to-importFn.d.ts +0 -4
- package/dist/types/utils/to-require-context.d.ts +0 -7
- package/dist/types/utils/validate-configuration-files.d.ts +0 -1
- package/templates/base-manager-head.html +0 -46
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { PresetConfig, CoreCommon_ResolvedAddonPreset, CoreCommon_ResolvedAddonVirtual, LoadedPreset, CLIOptions, LoadOptions, BuilderOptions, Presets, CoreCommon_AddonInfo, Options as Options$2, PackageJson, CoreCommon_StorybookInfo, Ref, StorybookConfig, CoreCommon_StoriesEntry, CoreCommon_NormalizedStoriesSpecifier } from '@storybook/types';
|
|
2
|
+
import * as Cache from 'file-system-cache';
|
|
3
|
+
import Cache__default from 'file-system-cache';
|
|
4
|
+
import { Router } from 'express';
|
|
5
|
+
|
|
6
|
+
declare function filterPresetsConfig(presetsConfig: PresetConfig[]): PresetConfig[];
|
|
7
|
+
/**
|
|
8
|
+
* Parse an addon into either a managerEntries or a preset. Throw on invalid input.
|
|
9
|
+
*
|
|
10
|
+
* Valid inputs:
|
|
11
|
+
* - '@storybook/addon-actions/manager'
|
|
12
|
+
* => { type: 'virtual', item }
|
|
13
|
+
*
|
|
14
|
+
* - '@storybook/addon-docs/preset'
|
|
15
|
+
* => { type: 'presets', item }
|
|
16
|
+
*
|
|
17
|
+
* - '@storybook/addon-docs'
|
|
18
|
+
* => { type: 'presets', item: '@storybook/addon-docs/preset' }
|
|
19
|
+
*
|
|
20
|
+
* - { name: '@storybook/addon-docs(/preset)?', options: { ... } }
|
|
21
|
+
* => { type: 'presets', item: { name: '@storybook/addon-docs/preset', options } }
|
|
22
|
+
*/
|
|
23
|
+
declare const resolveAddonName: (configDir: string, name: string, options: any) => CoreCommon_ResolvedAddonPreset | CoreCommon_ResolvedAddonVirtual | undefined;
|
|
24
|
+
declare function loadPreset(input: PresetConfig, level: number, storybookOptions: InterPresetOptions): Promise<LoadedPreset[]>;
|
|
25
|
+
type InterPresetOptions = Omit<CLIOptions & LoadOptions & BuilderOptions, 'frameworkPresets'>;
|
|
26
|
+
declare function getPresets(presets: PresetConfig[], storybookOptions: InterPresetOptions): Promise<Presets>;
|
|
27
|
+
declare function loadAllPresets(options: CLIOptions & LoadOptions & BuilderOptions & {
|
|
28
|
+
corePresets: PresetConfig[];
|
|
29
|
+
overridePresets: PresetConfig[];
|
|
30
|
+
}): Promise<Presets>;
|
|
31
|
+
|
|
32
|
+
declare const cache: Cache.FileSystemCache;
|
|
33
|
+
|
|
34
|
+
interface Options$1 {
|
|
35
|
+
before: CoreCommon_AddonInfo;
|
|
36
|
+
after: CoreCommon_AddonInfo;
|
|
37
|
+
configFile: string;
|
|
38
|
+
getConfig: (path: string) => any;
|
|
39
|
+
}
|
|
40
|
+
declare const checkAddonOrder: ({ before, after, configFile, getConfig }: Options$1) => Promise<void>;
|
|
41
|
+
|
|
42
|
+
declare function loadEnvs(options?: {
|
|
43
|
+
production?: boolean;
|
|
44
|
+
}): {
|
|
45
|
+
stringified: Record<string, string>;
|
|
46
|
+
raw: Record<string, string>;
|
|
47
|
+
};
|
|
48
|
+
declare const stringifyEnvs: (raw: Record<string, string>) => Record<string, string>;
|
|
49
|
+
declare const stringifyProcessEnvs: (raw: Record<string, string>) => Record<string, string>;
|
|
50
|
+
|
|
51
|
+
declare const findDistEsm: (cwd: string, relativePath: string) => string;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Framework can be a string or an object. This utility always returns the string name.
|
|
55
|
+
*/
|
|
56
|
+
declare function getFrameworkName(options: Options$2): Promise<string>;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Render is set as a string on core. It must be set by the framework
|
|
60
|
+
*/
|
|
61
|
+
declare function getRendererName(options: Options$2): Promise<string>;
|
|
62
|
+
|
|
63
|
+
declare function getStorybookConfiguration(storybookScript: string, shortName: string, longName: string): string | null;
|
|
64
|
+
|
|
65
|
+
declare const getStorybookInfo: (packageJson: PackageJson) => CoreCommon_StorybookInfo;
|
|
66
|
+
|
|
67
|
+
declare const getAutoRefs: (options: Options$2) => Promise<Record<string, Ref>>;
|
|
68
|
+
declare function getRefs(options: Options$2): Promise<Record<string, Ref>>;
|
|
69
|
+
|
|
70
|
+
declare function globToRegexp(glob: string): RegExp;
|
|
71
|
+
|
|
72
|
+
declare function handlebars(source: string, data: any): string;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Return a string corresponding to template filled with bindings using following pattern:
|
|
76
|
+
* For each (key, value) of `bindings` replace, in template, `{{key}}` by escaped version of `value`
|
|
77
|
+
*
|
|
78
|
+
* @param template {String} Template with `{{binding}}`
|
|
79
|
+
* @param bindings {Object} key-value object use to fill the template, `{{key}}` will be replaced by `escaped(value)`
|
|
80
|
+
* @returns {String} Filled template
|
|
81
|
+
*/
|
|
82
|
+
declare const interpolate: (template: string, bindings: Record<string, string>) => string;
|
|
83
|
+
|
|
84
|
+
declare const boost: Set<string>;
|
|
85
|
+
declare function getInterpretedFile(pathToFile: string): string | undefined;
|
|
86
|
+
declare function getInterpretedFileWithExt(pathToFile: string): {
|
|
87
|
+
path: string;
|
|
88
|
+
ext: string;
|
|
89
|
+
} | undefined;
|
|
90
|
+
|
|
91
|
+
declare function interopRequireDefault(filePath: string): any;
|
|
92
|
+
declare function serverRequire(filePath: string | string[]): any;
|
|
93
|
+
declare function serverResolve(filePath: string | string[]): string | null;
|
|
94
|
+
|
|
95
|
+
declare function loadCustomPresets({ configDir }: {
|
|
96
|
+
configDir: string;
|
|
97
|
+
}): PresetConfig[];
|
|
98
|
+
|
|
99
|
+
declare function loadMainConfig({ configDir }: {
|
|
100
|
+
configDir: string;
|
|
101
|
+
}): StorybookConfig;
|
|
102
|
+
|
|
103
|
+
declare function loadManagerOrAddonsFile({ configDir }: {
|
|
104
|
+
configDir: string;
|
|
105
|
+
}): string | undefined;
|
|
106
|
+
|
|
107
|
+
declare function loadPreviewOrConfigFile({ configDir }: {
|
|
108
|
+
configDir: string;
|
|
109
|
+
}): string | undefined;
|
|
110
|
+
|
|
111
|
+
declare function logConfig(caption: unknown, config: unknown): void;
|
|
112
|
+
|
|
113
|
+
declare const getDirectoryFromWorkingDir: ({ configDir, workingDir, directory, }: NormalizeOptions & {
|
|
114
|
+
directory: string;
|
|
115
|
+
}) => string;
|
|
116
|
+
declare const normalizeStoriesEntry: (entry: CoreCommon_StoriesEntry, { configDir, workingDir }: NormalizeOptions) => CoreCommon_NormalizedStoriesSpecifier;
|
|
117
|
+
interface NormalizeOptions {
|
|
118
|
+
configDir: string;
|
|
119
|
+
workingDir: string;
|
|
120
|
+
}
|
|
121
|
+
declare const normalizeStories: (entries: CoreCommon_StoriesEntry[], options: NormalizeOptions) => CoreCommon_NormalizedStoriesSpecifier[];
|
|
122
|
+
|
|
123
|
+
declare const getProjectRoot: () => string;
|
|
124
|
+
declare const nodePathsToArray: (nodePath: string) => string[];
|
|
125
|
+
/**
|
|
126
|
+
* Ensures that a path starts with `./` or `../`, or is entirely `.` or `..`
|
|
127
|
+
*/
|
|
128
|
+
declare function normalizeStoryPath(filename: string): string;
|
|
129
|
+
|
|
130
|
+
declare const useProgressReporting: (router: Router, startTime: [number, number], options: any) => Promise<{
|
|
131
|
+
handler: any;
|
|
132
|
+
modulesCount: number;
|
|
133
|
+
}>;
|
|
134
|
+
|
|
135
|
+
declare function readTemplate(filename: string): Promise<string>;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Get the path of the file or directory with input name inside the Storybook cache directory:
|
|
139
|
+
* - `node_modules/.cache/storybook/{directoryName}` in a Node.js project or npm package
|
|
140
|
+
* - `.cache/storybook/{directoryName}` otherwise
|
|
141
|
+
*
|
|
142
|
+
* @param fileOrDirectoryName {string} Name of the file or directory
|
|
143
|
+
* @return {string} Absolute path to the file or directory
|
|
144
|
+
*/
|
|
145
|
+
declare function resolvePathInStorybookCache(fileOrDirectoryName: string): string;
|
|
146
|
+
|
|
147
|
+
declare function isPreservingSymlinks(): boolean | undefined;
|
|
148
|
+
|
|
149
|
+
declare function getPreviewBodyTemplate(configDirPath: string, interpolations?: Record<string, string>): string;
|
|
150
|
+
declare function getPreviewHeadTemplate(configDirPath: string, interpolations?: Record<string, string>): string;
|
|
151
|
+
declare function getPreviewMainTemplate(): string;
|
|
152
|
+
|
|
153
|
+
declare function validateFrameworkName(frameworkName: string): void;
|
|
154
|
+
|
|
155
|
+
declare function validateConfigurationFiles(configDir: string): void;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Mimicking the satisfies operator until we can upgrade to TS4.9
|
|
159
|
+
*/
|
|
160
|
+
declare function satisfies<A>(): <T extends A>(x: T) => T;
|
|
161
|
+
|
|
162
|
+
type Options = Parameters<typeof Cache__default>['0'];
|
|
163
|
+
type FileSystemCache = ReturnType<typeof Cache__default>;
|
|
164
|
+
declare function createFileSystemCache(options: Options): FileSystemCache;
|
|
165
|
+
|
|
166
|
+
export { boost, cache, checkAddonOrder, createFileSystemCache, filterPresetsConfig, findDistEsm, getAutoRefs, getDirectoryFromWorkingDir, getFrameworkName, getInterpretedFile, getInterpretedFileWithExt, getPresets, getPreviewBodyTemplate, getPreviewHeadTemplate, getPreviewMainTemplate, getProjectRoot, getRefs, getRendererName, getStorybookConfiguration, getStorybookInfo, globToRegexp, handlebars, interopRequireDefault, interpolate, isPreservingSymlinks, loadAllPresets, loadCustomPresets, loadEnvs, loadMainConfig, loadManagerOrAddonsFile, loadPreset, loadPreviewOrConfigFile, logConfig, nodePathsToArray, normalizeStories, normalizeStoriesEntry, normalizeStoryPath, readTemplate, resolveAddonName, resolvePathInStorybookCache, satisfies, serverRequire, serverResolve, stringifyEnvs, stringifyProcessEnvs, useProgressReporting, validateConfigurationFiles, validateFrameworkName };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";var Ke=Object.create;var w=Object.defineProperty;var Ve=Object.getOwnPropertyDescriptor;var Ge=Object.getOwnPropertyNames;var Xe=Object.getPrototypeOf,Ze=Object.prototype.hasOwnProperty;var Qe=(e,r)=>{for(var t in r)w(e,t,{get:r[t],enumerable:!0})},te=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of Ge(r))!Ze.call(e,n)&&n!==t&&w(e,n,{get:()=>r[n],enumerable:!(o=Ve(r,n))||o.enumerable});return e};var p=(e,r,t)=>(t=e!=null?Ke(Xe(e)):{},te(r||!e||!e.__esModule?w(t,"default",{value:e,enumerable:!0}):t,e)),er=e=>te(w({},"__esModule",{value:!0}),e);var Ur={};Qe(Ur,{boost:()=>O,cache:()=>ar,checkAddonOrder:()=>fr,createFileSystemCache:()=>j,filterPresetsConfig:()=>de,findDistEsm:()=>gr,getAutoRefs:()=>Se,getDirectoryFromWorkingDir:()=>He,getFrameworkName:()=>V,getInterpretedFile:()=>g,getInterpretedFileWithExt:()=>B,getPresets:()=>ye,getPreviewBodyTemplate:()=>Tr,getPreviewHeadTemplate:()=>Dr,getPreviewMainTemplate:()=>Lr,getProjectRoot:()=>mr,getRefs:()=>wr,getRendererName:()=>yr,getStorybookConfiguration:()=>G,getStorybookInfo:()=>Cr,globToRegexp:()=>Q,handlebars:()=>Or,interopRequireDefault:()=>R,interpolate:()=>Rr,isPreservingSymlinks:()=>Nr,loadAllPresets:()=>ir,loadCustomPresets:()=>U,loadEnvs:()=>dr,loadMainConfig:()=>Er,loadManagerOrAddonsFile:()=>$r,loadPreset:()=>ue,loadPreviewOrConfigFile:()=>Sr,logConfig:()=>jr,nodePathsToArray:()=>W,normalizeStories:()=>_r,normalizeStoriesEntry:()=>Ue,normalizeStoryPath:()=>Y,readTemplate:()=>Fr,resolveAddonName:()=>le,resolvePathInStorybookCache:()=>q,satisfies:()=>Hr,serverRequire:()=>b,serverResolve:()=>E,stringifyEnvs:()=>lr,stringifyProcessEnvs:()=>ur,useProgressReporting:()=>Ir,validateConfigurationFiles:()=>v,validateFrameworkName:()=>Br});module.exports=er(Ur);var pe=require("ts-dedent"),h=require("@storybook/node-logger");var $=p(require("path"));var M=p(require("fs")),O=new Set([".js",".jsx",".ts",".tsx",".cjs",".mjs"]);function rr(){return[...Array.from(O)]}var oe=rr();function g(e){return oe.map(r=>e.endsWith(r)?e:`${e}${r}`).find(r=>M.default.existsSync(r))}function B(e){return oe.map(r=>({path:e.endsWith(r)?e:`${e}${r}`,ext:r})).find(r=>M.default.existsSync(r.path))}var ne=!1;function R(e){let r=!!require("module")._extensions[".ts"];if(ne===!1&&!r){let{register:n}=require("esbuild-register/dist/node");ne=!0,n({target:`node${process.version.slice(1)}`,format:"cjs",hookIgnoreNodeModules:!1,tsconfigRaw:`{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"strict": false,
|
|
4
|
+
"skipLibCheck": true,
|
|
5
|
+
},
|
|
6
|
+
}`})}let t=require(e);return typeof t=="object"&&t!==null&&typeof t.default<"u"?t.default:t}function tr(e){for(let r=0;r<e.length;r+=1){let t=B(e[r]);if(t)return t}}function b(e){let r=E(e);return r?R(r):null}function E(e){let r=Array.isArray(e)?e:[e],t=tr(r);return t?t.path:null}var se=require("ts-dedent"),ie=p(require("glob")),H=p(require("path"));function v(e){let r=`{${Array.from(O).join(",")}}`;if(!(n=>!!ie.default.sync(H.default.resolve(e,`${n}${r}`)).length)("main"))throw new Error(se.dedent`
|
|
7
|
+
No configuration files have been found in your configDir (${H.default.resolve(e)}).
|
|
8
|
+
Storybook needs either a "main" or "config" file.
|
|
9
|
+
`)}function U({configDir:e}){v(e);let r=b($.default.resolve(e,"presets"));if(b($.default.resolve(e,"main"))){let o=E($.default.resolve(e,"main"));if(o)return[o]}return r||[]}var ae=p(require("resolve-from")),ce=(e,r)=>{try{return(0,ae.default)(e,r)}catch{return}},fe=e=>{try{return require.resolve(e)}catch{return}};var C=e=>e!=null&&typeof e=="object"&&Array.isArray(e)===!1,or=e=>typeof e=="function";function de(e){return e.filter(r=>{let t=typeof r=="string"?r:r.name;return!/@storybook[\\\\/]preset-typescript/.test(t)})}function me(e,r,t){return or(e)?[...e({...t,...r})]:Array.isArray(e)?[...e]:[]}var le=(e,r,t)=>{let o=r.startsWith("/")?fe:ce.bind(null,e),n=o(r);if(n){if(r.match(/\/(manager|register(-panel)?)(\.(js|ts|tsx|jsx))?$/))return{type:"virtual",name:r,managerEntries:[n]};if(r.match(/\/(preset)(\.(js|ts|tsx|jsx))?$/))return{type:"presets",name:n}}let s=d=>{if(o(`${r}${d}`))return`${r}${d}`},c=d=>o(`${r}${d}`),i=c("/manager"),m=c("/register")||c("/register-panel"),f=s("/preview"),a=c("/preview"),l=c("/preset");if(!(i||f)&&l)return{type:"presets",name:l};if(i||m||f||l){let d=[];return i&&d.push(i),!i&&m&&!l&&d.push(m),{type:"virtual",name:r,...d.length?{managerEntries:d}:{},...f?{previewAnnotations:[a?{bare:f,absolute:a}:f]}:{},...l?{presets:[{name:l,options:t}]}:{}}}if(n)return{type:"presets",name:n}},nr=({configDir:e})=>r=>{let t=C(r)&&r.options||void 0,o=C(r)?r.name:r;try{let n=le(e,o,t);return{...t?{options:t}:{},...n}}catch{h.logger.error(`Addon value should end in /manager or /preview or /register OR it should be a valid preset https://storybook.js.org/docs/react/addons/writing-presets/
|
|
10
|
+
${r}`)}};async function sr(e){if(e.type==="virtual"){let{type:t,name:o,...n}=e;return n}let r=e.name?e.name:e;return R(r)}async function ue(e,r,t){try{let o=e.name?e.name:e,n=e.options?e.options:{},s=await sr(e);if(typeof s=="function"&&(s=s(t,n)),Array.isArray(s))return await S(s,r+1,t);if(C(s)){let{addons:c,presets:i,...m}=s,f=me(i,n,t),a=me(c,n,t);return[...await S([...f],r+1,t),...await S([...a.map(nr(t))].filter(Boolean),r+1,t),{name:o,preset:m,options:n}]}throw new Error(pe.dedent`
|
|
11
|
+
${e} is not a valid preset
|
|
12
|
+
`)}catch(o){let n=r>0?` Failed to load preset: ${JSON.stringify(e)} on level ${r}`:` Failed to load preset: ${JSON.stringify(e)}`;return h.logger.warn(n),h.logger.error(o),[]}}async function S(e,r,t){return!e||!Array.isArray(e)||!e.length?[]:(r||h.logger.info("=> Loading presets"),(await Promise.all(e.map(async o=>ue(o,r,t)))).reduce((o,n)=>o.concat(n),[]))}function ge(e,r,t,o,n){let s=new Promise(c=>c(t));return e.length?e.reduce((c,{preset:i,options:m})=>{let f=i[r];if(!f)return c;if(typeof f=="function"){let a=f,l={preset:i,combinedOptions:{...n,...o,...m,presetsList:e,presets:{apply:async(d,u,k={})=>ge(e,d,u,k,n)}}};return c.then(d=>a.call(l.preset,d,l.combinedOptions))}return c.then(a=>Array.isArray(a)&&Array.isArray(f)?[...a,...f]:C(a)&&C(f)?{...a,...f}:f)},s):s}async function ye(e,r){let t=await S(e,0,r);return{apply:async(o,n,s={})=>ge(t,o,n,s,r)}}async function ir(e){let{corePresets:r=[],overridePresets:t=[],...o}=e,n=[...r,...U(e),...t],s=de(n);return s.length<n.length&&h.logger.warn("Storybook now supports TypeScript natively. You can safely remove `@storybook/preset-typescript`."),ye(s,o)}var be=p(require("file-system-cache"));function j(e){return(0,be.default)(e)}var A=p(require("path")),he=p(require("pkg-dir"));function q(e){let r=process.cwd(),t=he.default.sync(r),o;return t?o=A.default.resolve(t,"node_modules/.cache/storybook"):o=A.default.resolve(r,".cache/storybook"),A.default.join(o,e)}var ar=j({basePath:q("dev-server"),ns:"storybook"});var _=require("@storybook/node-logger"),z=e=>r=>{let t=r.name||r;return t&&t.includes(e)},cr=(e,r,t)=>{let o=e.findIndex(z("@storybook/addon-essentials")),n=e.findIndex(z(r.name)),s=e.findIndex(z(t.name));return n===-1&&r.inEssentials&&(n=o),s===-1&&t.inEssentials&&(s=o),n!==-1&&s!==-1&&n<=s},fr=async({before:e,after:r,configFile:t,getConfig:o})=>{try{let n=await o(t);if(!(n!=null&&n.addons)){_.logger.warn("Unable to find 'addons' config in main Storybook config");return}if(!cr(n.addons,e,r)){let s=" (or '@storybook/addon-essentials')",c=`'${e.name}'${e.inEssentials?s:""}`,i=`'${r.name}'${r.inEssentials?s:""}`;_.logger.warn(`Expected ${c} to be listed before ${i} in main Storybook config.`)}}catch{_.logger.warn(`Unable to load config file: ${t}`)}};var xe=require("lazy-universal-dotenv");var P=p(require("path")),J=p(require("find-up")),mr=()=>{let e;try{let r=J.default.sync(".git",{type:"directory"});r&&(e=e||P.default.join(r,".."))}catch{}try{let r=J.default.sync(".svn",{type:"directory"});r&&(e=e||P.default.join(r,".."))}catch{}try{e=e||__dirname.split("node_modules")[0]}catch{}return e||process.cwd()},W=e=>e.split(process.platform==="win32"?";":":").filter(Boolean).map(r=>P.default.resolve("./",r)),pr=/^\.{1,2}([/\\]|$)/;function Y(e){return pr.test(e)?e:`.${P.default.sep}${e}`}function dr(e={}){let r=e.production?"production":"development",t={NODE_ENV:process.env.NODE_ENV||r,NODE_PATH:process.env.NODE_PATH||"",STORYBOOK:process.env.STORYBOOK||"true",PUBLIC_URL:e.production?".":""};Object.keys(process.env).filter(i=>/^STORYBOOK_/.test(i)).forEach(i=>{t[i]=process.env[i]});let o=Object.entries(t).reduce((i,[m,f])=>Object.assign(i,{[m]:JSON.stringify(f)}),{}),{stringified:n,raw:s}=(0,xe.getEnvironment)({nodeEnv:t.NODE_ENV}),c={...t,...s};return c.NODE_PATH=W(c.NODE_PATH||""),{stringified:{...o,...n},raw:c}}var lr=e=>Object.entries(e).reduce((r,[t,o])=>(r[t]=JSON.stringify(o),r),{}),ur=e=>Object.entries(e).reduce((t,[o,n])=>(t[`process.env.${o}`]=JSON.stringify(n),t),{"process.env.XSTORYBOOK_EXAMPLE_APP":'""'});var K=p(require("path")),ve=require("find-up"),gr=(e,r)=>{let t=(0,ve.sync)("package.json",{cwd:e});if(!t)throw new Error(`Could not find package.json in: ${e}`);let o=K.default.dirname(t);return K.default.join(o,"dist","esm",r)};var Ce=require("ts-dedent");async function V(e){let r=await e.presets.apply("framework","",e);if(!r)throw new Error(Ce.dedent`
|
|
13
|
+
You must specify a framework in '.storybook/main.js' config.
|
|
14
|
+
|
|
15
|
+
https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#framework-field-mandatory
|
|
16
|
+
`);return typeof r=="object"?r.name:r}async function yr(e){let{renderer:r}=await e.presets.apply("core",{},e);return r||V(e)}function G(e,r,t){if(!e)return null;let o=e.split(/[\s='"]+/),n=o.indexOf(t);return n===-1&&(n=o.indexOf(r)),n===-1?null:o[n+1]}var we=p(require("path")),Oe=p(require("fs-extra"));var Pe={"@storybook/react":"react","@storybook/vue":"vue","@storybook/vue3":"vue3","@storybook/angular":"angular","@storybook/html":"html","@storybook/web-components":"web-components","@storybook/polymer":"polymer","@storybook/ember":"ember","@storybook/marko":"marko","@storybook/mithril":"mithril","@storybook/riot":"riot","@storybook/svelte":"svelte","@storybook/preact":"preact","@storybook/rax":"rax","@storybook/server":"server"},ke=console,br=({dependencies:e,devDependencies:r,peerDependencies:t},o)=>[Object.entries(e||{}).find(o),Object.entries(r||{}).find(o),Object.entries(t||{}).find(o)],hr=e=>{let[r,t,o]=br(e,([i])=>Pe[i]),[n,s]=r||t||o||[],c=n?Pe[n]:void 0;return r&&t&&r[0]===t[0]&&ke.warn(`Found "${r[0]}" in both "dependencies" and "devDependencies". This is probably a mistake.`),r&&o&&r[0]===o[0]&&ke.warn(`Found "${r[0]}" in both "dependencies" and "peerDependencies". This is probably a mistake.`),{version:s,framework:c,frameworkPackage:n,renderer:c,rendererPackage:n}},xr=["ts","js","tsx","jsx","mjs","cjs"],X=(e,r)=>{let t=we.default.join(r,e),o=xr.find(n=>Oe.default.existsSync(`${t}.${n}`));return o?`${t}.${o}`:null},vr=e=>{var o;let r=".storybook",t=(o=e.scripts)==null?void 0:o.storybook;if(t){let n=G(t,"-c","--config-dir");n&&(r=n)}return{configDir:r,mainConfig:X("main",r),previewConfig:X("preview",r),managerConfig:X("manager",r)}},Cr=e=>{let r=hr(e),t=vr(e);return{...r,...t}};var Z=require("fs-extra"),I=require("path"),Re=p(require("find-up")),Ee=p(require("resolve-from")),$e=require("@storybook/node-logger"),Se=async e=>{let r=await(0,Re.default)("package.json",{cwd:e.configDir});if(!r)return{};let t=(0,I.dirname)(r),{dependencies:o=[],devDependencies:n=[]}=await(0,Z.readJSON)(r)||{},s=Object.keys({...o,...n});return(await Promise.all(s.map(async i=>{try{let m=(0,Ee.default)(t,(0,I.join)(i,"package.json")),{storybook:f,name:a,version:l}=await(0,Z.readJSON)(m)||{};if(f!=null&&f.url)return{id:a,...f,version:l}}catch(m){if(m.code==="ERR_PACKAGE_PATH_NOT_EXPORTED")return;$e.logger.warn(`unable to find package.json for ${i}`);return}}))).filter(Boolean).reduce((i,m)=>({...i,[m.id]:{id:m.id.toLowerCase(),url:je(m.url),title:m.title,version:m.version}}),{})},Pr=e=>fetch(`${e}/iframe.html`).then(async({ok:r,status:t})=>{if(r){if(t!==200)return!1;let o=await fetch(`${e}/iframe.html`,{headers:{Accept:"application/json"}});if(o.ok&&(await o.json().catch(n=>({}))).loginUrl)return!1}return r},()=>!1),je=e=>e.replace(/\/$/,""),kr=e=>{let r=e.replace(/[A-Z]/g,t=>` ${t}`).replace(/[-_][A-Z]/gi,t=>` ${t.toUpperCase()}`).replace(/-/g," ").replace(/_/g," ");return`${r.substring(0,1).toUpperCase()}${r.substring(1)}`.trim()};async function wr(e){let r=await e.presets.apply("refs",await Se(e));return Object.entries(r).forEach(([t,o])=>{if(o.disable){delete r[t];return}r[t.toLowerCase()]={...o,id:t.toLowerCase(),title:o.title||kr(o.id||t),url:je(o.url)}}),await Promise.all(Object.entries(r).map(async([t,o])=>{let n=await Pr(o.url);r[t]={...o,type:n?"server-checked":"unknown"}})),r}var Ae=require("picomatch");function Q(e){let r=(0,Ae.makeRe)(e,{fastpaths:!1,noglobstar:!1,bash:!1});if(!r.source.startsWith("^"))throw new Error(`Invalid glob: >> ${e} >> ${r}`);return e.startsWith("./")?new RegExp(["^\\.",e.startsWith("./**")?"":"[\\\\/]",r.source.substring(1)].join("")):r}var _e=p(require("handlebars"));function Or(e,r){return _e.default.compile(e)(r)}var Rr=(e,r)=>Object.entries(r).reduce((t,[o,n])=>{let s=n.replace(/\\/g,"/").replace(/\$/g,"$$$");return t.replace(new RegExp(`{{${o}}}`,"g"),s)},e);var Ie=p(require("path"));function Er({configDir:e}){return v(e),b(Ie.default.resolve(e,"main"))}var F=p(require("path")),Fe=require("@storybook/node-logger"),Ne=require("ts-dedent");function $r({configDir:e}){let r=g(F.default.resolve(e,"addons")),t=g(F.default.resolve(e,"manager"));if((r||t)&&Fe.logger.info("=> Loading custom manager config"),r&&t)throw new Error(Ne.dedent`
|
|
17
|
+
You have both a "addons.js" and a "manager.js", remove the "addons.js" file from your configDir (${F.default.resolve(e,"addons")})`);return t||r}var N=p(require("path")),Te=require("ts-dedent");function Sr({configDir:e}){let r=g(N.default.resolve(e,"config")),t=g(N.default.resolve(e,"preview"));if(r&&t)throw new Error(Te.dedent`
|
|
18
|
+
You have both a "config.js" and a "preview.js", remove the "config.js" file from your configDir (${N.default.resolve(e,"config")})`);return t||r}var De=p(require("chalk"));function jr(e,r){console.log(De.default.cyan(e)),console.dir(r,{depth:null})}var Me=p(require("fs")),x=p(require("path")),Be=require("picomatch"),ee=p(require("slash"));var T="",Le="**/*.@(mdx|stories.mdx|stories.tsx|stories.ts|stories.jsx|stories.js)",Ar=(e,r)=>{try{return Me.default.lstatSync(x.default.resolve(e,r)).isDirectory()}catch{return!1}},He=({configDir:e,workingDir:r,directory:t})=>{let o=x.default.resolve(e,t),n=x.default.relative(r,o);return Y(n)},Ue=(e,{configDir:r,workingDir:t})=>{let o;if(typeof e=="string"){let m=(0,Be.scan)(e);if(m.isGlob){let f=m.prefix+m.base,a=m.glob;o={titlePrefix:T,directory:f,files:a}}else Ar(r,e)?o={titlePrefix:T,directory:e,files:Le}:o={titlePrefix:T,directory:x.default.dirname(e),files:x.default.basename(e)}}else o={titlePrefix:T,files:Le,...e};let n=(0,ee.default)(o.files),{directory:s}=o,c=(0,ee.default)(He({configDir:r,workingDir:t,directory:s})).replace(/\/$/,""),i=Q(`${c}/${n}`);return{...o,directory:c,importPathMatcher:i}},_r=(e,r)=>e.map(t=>Ue(t,r));var qe=p(require("pretty-hrtime")),ze=e=>(0,qe.default)(process.hrtime(e)).replace(" ms"," milliseconds").replace(" s"," seconds").replace(" m"," minutes");var Ir=async(e,r,t)=>{var m;let o=0,n,s=()=>{};e.get("/progress",(f,a)=>{let l=!1,d=()=>{l=!0,a.end()};a.on("close",d),!(l||a.writableEnded)&&(a.setHeader("Cache-Control","no-cache"),a.setHeader("Content-Type","text/event-stream"),a.setHeader("Connection","keep-alive"),a.flushHeaders(),s=u=>{l||a.writableEnded||(a.write(`data: ${JSON.stringify(u)}
|
|
19
|
+
|
|
20
|
+
`),a.flush(),u.value===1&&d())})});let c=(f,a,l)=>{o=Math.max(f,o);let d={value:o,message:a.charAt(0).toUpperCase()+a.slice(1)};if(a==="building"){let u=l&&l.match(/(\d+)\/(\d+)/)||[],k=parseInt(u[1],10),L=parseInt(u[2],10);!Number.isNaN(k)&&!Number.isNaN(L)&&(d.modules={complete:k,total:L},n=L)}o===1&&(t.cache&&t.cache.set("modulesCount",n),d.message||(d.message=`Completed in ${ze(r)}.`)),s(d)},i=await((m=t.cache)==null?void 0:m.get("modulesCount").catch(()=>{}))||1e3;return{handler:c,modulesCount:i}};var Je=p(require("fs-extra"));async function Fr(e){return Je.default.readFile(e,{encoding:"utf8"})}function Nr(){let{NODE_OPTIONS:e,NODE_PRESERVE_SYMLINKS:r}=process.env;return!!r||(e==null?void 0:e.includes("--preserve-symlinks"))}var re=p(require("path")),D=require("pkg-dir"),y=p(require("fs")),We=(e,r={})=>Object.entries(r).reduce((t,[o,n])=>t.replace(new RegExp(`%${o}%`,"g"),n),e);function Tr(e,r){let t=y.default.readFileSync(`${(0,D.sync)(__dirname)}/templates/base-preview-body.html`,"utf8"),o=re.default.resolve(e,"preview-body.html"),n=t;return y.default.existsSync(o)&&(n=y.default.readFileSync(o,"utf8")+n),We(n,r)}function Dr(e,r){let t=y.default.readFileSync(`${(0,D.sync)(__dirname)}/templates/base-preview-head.html`,"utf8"),o=re.default.resolve(e,"preview-head.html"),n=t;return y.default.existsSync(o)&&(n+=y.default.readFileSync(o,"utf8")),We(n,r)}function Lr(){return`${(0,D.sync)(__dirname)}/templates/preview.ejs`}var Ye=require("ts-dedent"),Mr=["@storybook/html","@storybook/preact","@storybook/react","@storybook/server","@storybook/svelte","@storybook/vue","@storybook/vue3","@storybook/web-components"];function Br(e){if(Mr.includes(e))throw new Error(Ye.dedent`
|
|
21
|
+
Invalid value of ${e} in the 'framework' field of Storybook config.
|
|
22
|
+
|
|
23
|
+
Please run 'npx sb@next automigrate'
|
|
24
|
+
|
|
25
|
+
See the v7 Migration guide for more information:
|
|
26
|
+
https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#framework-field-mandatory
|
|
27
|
+
`)}function Hr(){return e=>e}0&&(module.exports={boost,cache,checkAddonOrder,createFileSystemCache,filterPresetsConfig,findDistEsm,getAutoRefs,getDirectoryFromWorkingDir,getFrameworkName,getInterpretedFile,getInterpretedFileWithExt,getPresets,getPreviewBodyTemplate,getPreviewHeadTemplate,getPreviewMainTemplate,getProjectRoot,getRefs,getRendererName,getStorybookConfiguration,getStorybookInfo,globToRegexp,handlebars,interopRequireDefault,interpolate,isPreservingSymlinks,loadAllPresets,loadCustomPresets,loadEnvs,loadMainConfig,loadManagerOrAddonsFile,loadPreset,loadPreviewOrConfigFile,logConfig,nodePathsToArray,normalizeStories,normalizeStoriesEntry,normalizeStoryPath,readTemplate,resolveAddonName,resolvePathInStorybookCache,satisfies,serverRequire,serverResolve,stringifyEnvs,stringifyProcessEnvs,useProgressReporting,validateConfigurationFiles,validateFrameworkName});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var l=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(r,t)=>(typeof require!="undefined"?require:r)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});import{dedent as ye}from"ts-dedent";import{logger as h}from"@storybook/node-logger";import $ from"path";import L from"fs";var E=new Set([".js",".jsx",".ts",".tsx",".cjs",".mjs"]);function pe(){return[...Array.from(E)]}var M=pe();function u(e){return M.map(r=>e.endsWith(r)?e:`${e}${r}`).find(r=>L.existsSync(r))}function B(e){return M.map(r=>({path:e.endsWith(r)?e:`${e}${r}`,ext:r})).find(r=>L.existsSync(r.path))}var H=!1;function R(e){let r=!!l("module")._extensions[".ts"];if(H===!1&&!r){let{register:n}=l("esbuild-register/dist/node");H=!0,n({target:`node${process.version.slice(1)}`,format:"cjs",hookIgnoreNodeModules:!1,tsconfigRaw:`{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"strict": false,
|
|
4
|
+
"skipLibCheck": true,
|
|
5
|
+
},
|
|
6
|
+
}`})}let t=l(e);return typeof t=="object"&&t!==null&&typeof t.default<"u"?t.default:t}function de(e){for(let r=0;r<e.length;r+=1){let t=B(e[r]);if(t)return t}}function b(e){let r=S(e);return r?R(r):null}function S(e){let r=Array.isArray(e)?e:[e],t=de(r);return t?t.path:null}import{dedent as le}from"ts-dedent";import ue from"glob";import U from"path";function P(e){let r=`{${Array.from(E).join(",")}}`;if(!(n=>!!ue.sync(U.resolve(e,`${n}${r}`)).length)("main"))throw new Error(le`
|
|
7
|
+
No configuration files have been found in your configDir (${U.resolve(e)}).
|
|
8
|
+
Storybook needs either a "main" or "config" file.
|
|
9
|
+
`)}function q({configDir:e}){P(e);let r=b($.resolve(e,"presets"));if(b($.resolve(e,"main"))){let o=S($.resolve(e,"main"));if(o)return[o]}return r||[]}import ge from"resolve-from";var z=(e,r)=>{try{return ge(e,r)}catch{return}},J=e=>{try{return l.resolve(e)}catch{return}};var x=e=>e!=null&&typeof e=="object"&&Array.isArray(e)===!1,be=e=>typeof e=="function";function he(e){return e.filter(r=>{let t=typeof r=="string"?r:r.name;return!/@storybook[\\\\/]preset-typescript/.test(t)})}function W(e,r,t){return be(e)?[...e({...t,...r})]:Array.isArray(e)?[...e]:[]}var xe=(e,r,t)=>{let o=r.startsWith("/")?J:z.bind(null,e),n=o(r);if(n){if(r.match(/\/(manager|register(-panel)?)(\.(js|ts|tsx|jsx))?$/))return{type:"virtual",name:r,managerEntries:[n]};if(r.match(/\/(preset)(\.(js|ts|tsx|jsx))?$/))return{type:"presets",name:n}}let s=d=>{if(o(`${r}${d}`))return`${r}${d}`},c=d=>o(`${r}${d}`),a=c("/manager"),f=c("/register")||c("/register-panel"),i=s("/preview"),m=c("/preview"),p=c("/preset");if(!(a||i)&&p)return{type:"presets",name:p};if(a||f||i||p){let d=[];return a&&d.push(a),!a&&f&&!p&&d.push(f),{type:"virtual",name:r,...d.length?{managerEntries:d}:{},...i?{previewAnnotations:[m?{bare:i,absolute:m}:i]}:{},...p?{presets:[{name:p,options:t}]}:{}}}if(n)return{type:"presets",name:n}},ve=({configDir:e})=>r=>{let t=x(r)&&r.options||void 0,o=x(r)?r.name:r;try{let n=xe(e,o,t);return{...t?{options:t}:{},...n}}catch{h.error(`Addon value should end in /manager or /preview or /register OR it should be a valid preset https://storybook.js.org/docs/react/addons/writing-presets/
|
|
10
|
+
${r}`)}};async function Ce(e){if(e.type==="virtual"){let{type:t,name:o,...n}=e;return n}let r=e.name?e.name:e;return R(r)}async function Pe(e,r,t){try{let o=e.name?e.name:e,n=e.options?e.options:{},s=await Ce(e);if(typeof s=="function"&&(s=s(t,n)),Array.isArray(s))return await k(s,r+1,t);if(x(s)){let{addons:c,presets:a,...f}=s,i=W(a,n,t),m=W(c,n,t);return[...await k([...i],r+1,t),...await k([...m.map(ve(t))].filter(Boolean),r+1,t),{name:o,preset:f,options:n}]}throw new Error(ye`
|
|
11
|
+
${e} is not a valid preset
|
|
12
|
+
`)}catch(o){let n=r>0?` Failed to load preset: ${JSON.stringify(e)} on level ${r}`:` Failed to load preset: ${JSON.stringify(e)}`;return h.warn(n),h.error(o),[]}}async function k(e,r,t){return!e||!Array.isArray(e)||!e.length?[]:(r||h.info("=> Loading presets"),(await Promise.all(e.map(async o=>Pe(o,r,t)))).reduce((o,n)=>o.concat(n),[]))}function Y(e,r,t,o,n){let s=new Promise(c=>c(t));return e.length?e.reduce((c,{preset:a,options:f})=>{let i=a[r];if(!i)return c;if(typeof i=="function"){let m=i,p={preset:a,combinedOptions:{...n,...o,...f,presetsList:e,presets:{apply:async(d,C,y={})=>Y(e,d,C,y,n)}}};return c.then(d=>m.call(p.preset,d,p.combinedOptions))}return c.then(m=>Array.isArray(m)&&Array.isArray(i)?[...m,...i]:x(m)&&x(i)?{...m,...i}:i)},s):s}async function ke(e,r){let t=await k(e,0,r);return{apply:async(o,n,s={})=>Y(t,o,n,s,r)}}async function Sr(e){let{corePresets:r=[],overridePresets:t=[],...o}=e,n=[...r,...q(e),...t],s=he(n);return s.length<n.length&&h.warn("Storybook now supports TypeScript natively. You can safely remove `@storybook/preset-typescript`."),ke(s,o)}import we from"file-system-cache";function j(e){return we(e)}import A from"path";import Oe from"pkg-dir";function K(e){let r=process.cwd(),t=Oe.sync(r),o;return t?o=A.resolve(t,"node_modules/.cache/storybook"):o=A.resolve(r,".cache/storybook"),A.join(o,e)}var Dr=j({basePath:K("dev-server"),ns:"storybook"});import{logger as _}from"@storybook/node-logger";var I=e=>r=>{let t=r.name||r;return t&&t.includes(e)},Ee=(e,r,t)=>{let o=e.findIndex(I("@storybook/addon-essentials")),n=e.findIndex(I(r.name)),s=e.findIndex(I(t.name));return n===-1&&r.inEssentials&&(n=o),s===-1&&t.inEssentials&&(s=o),n!==-1&&s!==-1&&n<=s},Br=async({before:e,after:r,configFile:t,getConfig:o})=>{try{let n=await o(t);if(!n?.addons){_.warn("Unable to find 'addons' config in main Storybook config");return}if(!Ee(n.addons,e,r)){let s=" (or '@storybook/addon-essentials')",c=`'${e.name}'${e.inEssentials?s:""}`,a=`'${r.name}'${r.inEssentials?s:""}`;_.warn(`Expected ${c} to be listed before ${a} in main Storybook config.`)}}catch{_.warn(`Unable to load config file: ${t}`)}};import{getEnvironment as Se}from"lazy-universal-dotenv";import w from"path";import V from"find-up";var zr=()=>{let e;try{let r=V.sync(".git",{type:"directory"});r&&(e=e||w.join(r,".."))}catch{}try{let r=V.sync(".svn",{type:"directory"});r&&(e=e||w.join(r,".."))}catch{}try{e=e||__dirname.split("node_modules")[0]}catch{}return e||process.cwd()},G=e=>e.split(process.platform==="win32"?";":":").filter(Boolean).map(r=>w.resolve("./",r)),Re=/^\.{1,2}([/\\]|$)/;function X(e){return Re.test(e)?e:`.${w.sep}${e}`}function Kr(e={}){let r=e.production?"production":"development",t={NODE_ENV:process.env.NODE_ENV||r,NODE_PATH:process.env.NODE_PATH||"",STORYBOOK:process.env.STORYBOOK||"true",PUBLIC_URL:e.production?".":""};Object.keys(process.env).filter(a=>/^STORYBOOK_/.test(a)).forEach(a=>{t[a]=process.env[a]});let o=Object.entries(t).reduce((a,[f,i])=>Object.assign(a,{[f]:JSON.stringify(i)}),{}),{stringified:n,raw:s}=Se({nodeEnv:t.NODE_ENV}),c={...t,...s};return c.NODE_PATH=G(c.NODE_PATH||""),{stringified:{...o,...n},raw:c}}var Vr=e=>Object.entries(e).reduce((r,[t,o])=>(r[t]=JSON.stringify(o),r),{}),Gr=e=>Object.entries(e).reduce((t,[o,n])=>(t[`process.env.${o}`]=JSON.stringify(n),t),{"process.env.XSTORYBOOK_EXAMPLE_APP":'""'});import Z from"path";import{sync as $e}from"find-up";var et=(e,r)=>{let t=$e("package.json",{cwd:e});if(!t)throw new Error(`Could not find package.json in: ${e}`);let o=Z.dirname(t);return Z.join(o,"dist","esm",r)};import{dedent as je}from"ts-dedent";async function Q(e){let r=await e.presets.apply("framework","",e);if(!r)throw new Error(je`
|
|
13
|
+
You must specify a framework in '.storybook/main.js' config.
|
|
14
|
+
|
|
15
|
+
https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#framework-field-mandatory
|
|
16
|
+
`);return typeof r=="object"?r.name:r}async function st(e){let{renderer:r}=await e.presets.apply("core",{},e);return r||Q(e)}function ee(e,r,t){if(!e)return null;let o=e.split(/[\s='"]+/),n=o.indexOf(t);return n===-1&&(n=o.indexOf(r)),n===-1?null:o[n+1]}import Ae from"path";import _e from"fs-extra";var re={"@storybook/react":"react","@storybook/vue":"vue","@storybook/vue3":"vue3","@storybook/angular":"angular","@storybook/html":"html","@storybook/web-components":"web-components","@storybook/polymer":"polymer","@storybook/ember":"ember","@storybook/marko":"marko","@storybook/mithril":"mithril","@storybook/riot":"riot","@storybook/svelte":"svelte","@storybook/preact":"preact","@storybook/rax":"rax","@storybook/server":"server"},te=console,Ie=({dependencies:e,devDependencies:r,peerDependencies:t},o)=>[Object.entries(e||{}).find(o),Object.entries(r||{}).find(o),Object.entries(t||{}).find(o)],Fe=e=>{let[r,t,o]=Ie(e,([a])=>re[a]),[n,s]=r||t||o||[],c=n?re[n]:void 0;return r&&t&&r[0]===t[0]&&te.warn(`Found "${r[0]}" in both "dependencies" and "devDependencies". This is probably a mistake.`),r&&o&&r[0]===o[0]&&te.warn(`Found "${r[0]}" in both "dependencies" and "peerDependencies". This is probably a mistake.`),{version:s,framework:c,frameworkPackage:n,renderer:c,rendererPackage:n}},Ne=["ts","js","tsx","jsx","mjs","cjs"],F=(e,r)=>{let t=Ae.join(r,e),o=Ne.find(n=>_e.existsSync(`${t}.${n}`));return o?`${t}.${o}`:null},Te=e=>{let r=".storybook",t=e.scripts?.storybook;if(t){let o=ee(t,"-c","--config-dir");o&&(r=o)}return{configDir:r,mainConfig:F("main",r),previewConfig:F("preview",r),managerConfig:F("manager",r)}},pt=e=>{let r=Fe(e),t=Te(e);return{...r,...t}};import{readJSON as oe}from"fs-extra";import{dirname as De,join as Le}from"path";import Me from"find-up";import Be from"resolve-from";import{logger as He}from"@storybook/node-logger";var Ue=async e=>{let r=await Me("package.json",{cwd:e.configDir});if(!r)return{};let t=De(r),{dependencies:o=[],devDependencies:n=[]}=await oe(r)||{},s=Object.keys({...o,...n});return(await Promise.all(s.map(async a=>{try{let f=Be(t,Le(a,"package.json")),{storybook:i,name:m,version:p}=await oe(f)||{};if(i?.url)return{id:m,...i,version:p}}catch(f){if(f.code==="ERR_PACKAGE_PATH_NOT_EXPORTED")return;He.warn(`unable to find package.json for ${a}`);return}}))).filter(Boolean).reduce((a,f)=>({...a,[f.id]:{id:f.id.toLowerCase(),url:ne(f.url),title:f.title,version:f.version}}),{})},qe=e=>fetch(`${e}/iframe.html`).then(async({ok:r,status:t})=>{if(r){if(t!==200)return!1;let o=await fetch(`${e}/iframe.html`,{headers:{Accept:"application/json"}});if(o.ok&&(await o.json().catch(n=>({}))).loginUrl)return!1}return r},()=>!1),ne=e=>e.replace(/\/$/,""),ze=e=>{let r=e.replace(/[A-Z]/g,t=>` ${t}`).replace(/[-_][A-Z]/gi,t=>` ${t.toUpperCase()}`).replace(/-/g," ").replace(/_/g," ");return`${r.substring(0,1).toUpperCase()}${r.substring(1)}`.trim()};async function ht(e){let r=await e.presets.apply("refs",await Ue(e));return Object.entries(r).forEach(([t,o])=>{if(o.disable){delete r[t];return}r[t.toLowerCase()]={...o,id:t.toLowerCase(),title:o.title||ze(o.id||t),url:ne(o.url)}}),await Promise.all(Object.entries(r).map(async([t,o])=>{let n=await qe(o.url);r[t]={...o,type:n?"server-checked":"unknown"}})),r}import{makeRe as Je}from"picomatch";function se(e){let r=Je(e,{fastpaths:!1,noglobstar:!1,bash:!1});if(!r.source.startsWith("^"))throw new Error(`Invalid glob: >> ${e} >> ${r}`);return e.startsWith("./")?new RegExp(["^\\.",e.startsWith("./**")?"":"[\\\\/]",r.source.substring(1)].join("")):r}import We from"handlebars";function kt(e,r){return We.compile(e)(r)}var Ot=(e,r)=>Object.entries(r).reduce((t,[o,n])=>{let s=n.replace(/\\/g,"/").replace(/\$/g,"$$$");return t.replace(new RegExp(`{{${o}}}`,"g"),s)},e);import Ye from"path";function jt({configDir:e}){return P(e),b(Ye.resolve(e,"main"))}import N from"path";import{logger as Ke}from"@storybook/node-logger";import{dedent as Ve}from"ts-dedent";function Tt({configDir:e}){let r=u(N.resolve(e,"addons")),t=u(N.resolve(e,"manager"));if((r||t)&&Ke.info("=> Loading custom manager config"),r&&t)throw new Error(Ve`
|
|
17
|
+
You have both a "addons.js" and a "manager.js", remove the "addons.js" file from your configDir (${N.resolve(e,"addons")})`);return t||r}import T from"path";import{dedent as Ge}from"ts-dedent";function Ht({configDir:e}){let r=u(T.resolve(e,"config")),t=u(T.resolve(e,"preview"));if(r&&t)throw new Error(Ge`
|
|
18
|
+
You have both a "config.js" and a "preview.js", remove the "config.js" file from your configDir (${T.resolve(e,"config")})`);return t||r}import Xe from"chalk";function zt(e,r){console.log(Xe.cyan(e)),console.dir(r,{depth:null})}import Ze from"fs";import v from"path";import{scan as Qe}from"picomatch";import ie from"slash";var O="",ae="**/*.@(mdx|stories.mdx|stories.tsx|stories.ts|stories.jsx|stories.js)",er=(e,r)=>{try{return Ze.lstatSync(v.resolve(e,r)).isDirectory()}catch{return!1}},rr=({configDir:e,workingDir:r,directory:t})=>{let o=v.resolve(e,t),n=v.relative(r,o);return X(n)},tr=(e,{configDir:r,workingDir:t})=>{let o;if(typeof e=="string"){let f=Qe(e);if(f.isGlob){let i=f.prefix+f.base,m=f.glob;o={titlePrefix:O,directory:i,files:m}}else er(r,e)?o={titlePrefix:O,directory:e,files:ae}:o={titlePrefix:O,directory:v.dirname(e),files:v.basename(e)}}else o={titlePrefix:O,files:ae,...e};let n=ie(o.files),{directory:s}=o,c=ie(rr({configDir:r,workingDir:t,directory:s})).replace(/\/$/,""),a=se(`${c}/${n}`);return{...o,directory:c,importPathMatcher:a}},Zt=(e,r)=>e.map(t=>tr(t,r));import or from"pretty-hrtime";var ce=e=>or(process.hrtime(e)).replace(" ms"," milliseconds").replace(" s"," seconds").replace(" m"," minutes");var oo=async(e,r,t)=>{let o=0,n,s=()=>{};e.get("/progress",(f,i)=>{let m=!1,p=()=>{m=!0,i.end()};i.on("close",p),!(m||i.writableEnded)&&(i.setHeader("Cache-Control","no-cache"),i.setHeader("Content-Type","text/event-stream"),i.setHeader("Connection","keep-alive"),i.flushHeaders(),s=d=>{m||i.writableEnded||(i.write(`data: ${JSON.stringify(d)}
|
|
19
|
+
|
|
20
|
+
`),i.flush(),d.value===1&&p())})});let c=(f,i,m)=>{o=Math.max(f,o);let p={value:o,message:i.charAt(0).toUpperCase()+i.slice(1)};if(i==="building"){let d=m&&m.match(/(\d+)\/(\d+)/)||[],C=parseInt(d[1],10),y=parseInt(d[2],10);!Number.isNaN(C)&&!Number.isNaN(y)&&(p.modules={complete:C,total:y},n=y)}o===1&&(t.cache&&t.cache.set("modulesCount",n),p.message||(p.message=`Completed in ${ce(r)}.`)),s(p)},a=await t.cache?.get("modulesCount").catch(()=>{})||1e3;return{handler:c,modulesCount:a}};import nr from"fs-extra";async function io(e){return nr.readFile(e,{encoding:"utf8"})}function co(){let{NODE_OPTIONS:e,NODE_PRESERVE_SYMLINKS:r}=process.env;return!!r||e?.includes("--preserve-symlinks")}import fe from"path";import{sync as D}from"pkg-dir";import g from"fs";var me=(e,r={})=>Object.entries(r).reduce((t,[o,n])=>t.replace(new RegExp(`%${o}%`,"g"),n),e);function uo(e,r){let t=g.readFileSync(`${D(__dirname)}/templates/base-preview-body.html`,"utf8"),o=fe.resolve(e,"preview-body.html"),n=t;return g.existsSync(o)&&(n=g.readFileSync(o,"utf8")+n),me(n,r)}function go(e,r){let t=g.readFileSync(`${D(__dirname)}/templates/base-preview-head.html`,"utf8"),o=fe.resolve(e,"preview-head.html"),n=t;return g.existsSync(o)&&(n+=g.readFileSync(o,"utf8")),me(n,r)}function yo(){return`${D(__dirname)}/templates/preview.ejs`}import{dedent as sr}from"ts-dedent";var ir=["@storybook/html","@storybook/preact","@storybook/react","@storybook/server","@storybook/svelte","@storybook/vue","@storybook/vue3","@storybook/web-components"];function xo(e){if(ir.includes(e))throw new Error(sr`
|
|
21
|
+
Invalid value of ${e} in the 'framework' field of Storybook config.
|
|
22
|
+
|
|
23
|
+
Please run 'npx sb@next automigrate'
|
|
24
|
+
|
|
25
|
+
See the v7 Migration guide for more information:
|
|
26
|
+
https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#framework-field-mandatory
|
|
27
|
+
`)}function Co(){return e=>e}export{E as boost,Dr as cache,Br as checkAddonOrder,j as createFileSystemCache,he as filterPresetsConfig,et as findDistEsm,Ue as getAutoRefs,rr as getDirectoryFromWorkingDir,Q as getFrameworkName,u as getInterpretedFile,B as getInterpretedFileWithExt,ke as getPresets,uo as getPreviewBodyTemplate,go as getPreviewHeadTemplate,yo as getPreviewMainTemplate,zr as getProjectRoot,ht as getRefs,st as getRendererName,ee as getStorybookConfiguration,pt as getStorybookInfo,se as globToRegexp,kt as handlebars,R as interopRequireDefault,Ot as interpolate,co as isPreservingSymlinks,Sr as loadAllPresets,q as loadCustomPresets,Kr as loadEnvs,jt as loadMainConfig,Tt as loadManagerOrAddonsFile,Pe as loadPreset,Ht as loadPreviewOrConfigFile,zt as logConfig,G as nodePathsToArray,Zt as normalizeStories,tr as normalizeStoriesEntry,X as normalizeStoryPath,io as readTemplate,xe as resolveAddonName,K as resolvePathInStorybookCache,Co as satisfies,b as serverRequire,S as serverResolve,Vr as stringifyEnvs,Gr as stringifyProcessEnvs,oo as useProgressReporting,P as validateConfigurationFiles,xo as validateFrameworkName};
|
package/jest.config.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/core-common",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.51",
|
|
4
4
|
"description": "Storybook framework-agnostic API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -19,9 +19,21 @@
|
|
|
19
19
|
"url": "https://opencollective.com/storybook"
|
|
20
20
|
},
|
|
21
21
|
"license": "MIT",
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"require": "./dist/index.js",
|
|
25
|
+
"import": "./dist/index.mjs",
|
|
26
|
+
"types": "./dist/index.d.ts"
|
|
27
|
+
},
|
|
28
|
+
"./package.json": {
|
|
29
|
+
"require": "./package.json",
|
|
30
|
+
"import": "./package.json",
|
|
31
|
+
"types": "./package.json"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"main": "dist/index.js",
|
|
35
|
+
"module": "dist/index.mjs",
|
|
36
|
+
"types": "dist/index.d.ts",
|
|
25
37
|
"files": [
|
|
26
38
|
"dist/**/*",
|
|
27
39
|
"types/**/*",
|
|
@@ -30,50 +42,26 @@
|
|
|
30
42
|
"*.d.ts"
|
|
31
43
|
],
|
|
32
44
|
"scripts": {
|
|
33
|
-
"
|
|
45
|
+
"check": "../../../scripts/node_modules/.bin/tsc --noEmit",
|
|
46
|
+
"prep": "../../../scripts/prepare/bundle.ts"
|
|
34
47
|
},
|
|
35
48
|
"dependencies": {
|
|
36
|
-
"@babel/core": "^7.
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
40
|
-
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.1",
|
|
41
|
-
"@babel/plugin-proposal-object-rest-spread": "^7.12.1",
|
|
42
|
-
"@babel/plugin-proposal-optional-chaining": "^7.12.7",
|
|
43
|
-
"@babel/plugin-proposal-private-methods": "^7.12.1",
|
|
44
|
-
"@babel/plugin-proposal-private-property-in-object": "^7.12.1",
|
|
45
|
-
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
46
|
-
"@babel/plugin-transform-arrow-functions": "^7.12.1",
|
|
47
|
-
"@babel/plugin-transform-block-scoping": "^7.12.12",
|
|
48
|
-
"@babel/plugin-transform-classes": "^7.12.1",
|
|
49
|
-
"@babel/plugin-transform-destructuring": "^7.12.1",
|
|
50
|
-
"@babel/plugin-transform-for-of": "^7.12.1",
|
|
51
|
-
"@babel/plugin-transform-parameters": "^7.12.1",
|
|
52
|
-
"@babel/plugin-transform-shorthand-properties": "^7.12.1",
|
|
53
|
-
"@babel/plugin-transform-spread": "^7.12.1",
|
|
54
|
-
"@babel/preset-env": "^7.12.11",
|
|
55
|
-
"@babel/preset-react": "^7.12.10",
|
|
56
|
-
"@babel/preset-typescript": "^7.12.7",
|
|
57
|
-
"@babel/register": "^7.12.1",
|
|
58
|
-
"@storybook/node-logger": "7.0.0-alpha.5",
|
|
59
|
-
"@storybook/semver": "^7.3.2",
|
|
60
|
-
"@types/babel__core": "^7.0.0",
|
|
49
|
+
"@babel/core": "^7.20.2",
|
|
50
|
+
"@storybook/node-logger": "7.0.0-alpha.51",
|
|
51
|
+
"@storybook/types": "7.0.0-alpha.51",
|
|
52
|
+
"@types/babel__core": "^7.1.20",
|
|
61
53
|
"@types/express": "^4.7.0",
|
|
62
|
-
"@types/node": "^
|
|
54
|
+
"@types/node": "^16.0.0 || ^18.0.0",
|
|
63
55
|
"@types/pretty-hrtime": "^1.0.0",
|
|
64
|
-
"babel-loader": "^8.2.5",
|
|
65
|
-
"babel-plugin-macros": "^3.0.1",
|
|
66
|
-
"babel-plugin-polyfill-corejs3": "^0.1.0",
|
|
67
56
|
"chalk": "^4.1.0",
|
|
68
|
-
"
|
|
57
|
+
"esbuild": "^0.14.48",
|
|
58
|
+
"esbuild-register": "^3.3.3",
|
|
69
59
|
"express": "^4.17.1",
|
|
70
|
-
"file-system-cache": "^
|
|
60
|
+
"file-system-cache": "^2.0.0",
|
|
71
61
|
"find-up": "^5.0.0",
|
|
72
62
|
"fs-extra": "^9.0.1",
|
|
73
63
|
"glob": "^7.1.6",
|
|
74
64
|
"handlebars": "^4.7.7",
|
|
75
|
-
"interpret": "^2.2.0",
|
|
76
|
-
"json5": "^2.1.3",
|
|
77
65
|
"lazy-universal-dotenv": "^3.0.1",
|
|
78
66
|
"picomatch": "^2.3.0",
|
|
79
67
|
"pkg-dir": "^5.0.0",
|
|
@@ -85,11 +73,11 @@
|
|
|
85
73
|
"util-deprecate": "^1.0.2"
|
|
86
74
|
},
|
|
87
75
|
"devDependencies": {
|
|
88
|
-
"@types/
|
|
89
|
-
"@types/interpret": "^1.1.1",
|
|
90
|
-
"@types/mock-fs": "^4.13.0",
|
|
76
|
+
"@types/mock-fs": "^4.13.1",
|
|
91
77
|
"@types/picomatch": "^2.3.0",
|
|
92
|
-
"mock-fs": "^
|
|
78
|
+
"mock-fs": "^5.2.0",
|
|
79
|
+
"type-fest": "^2.19.0",
|
|
80
|
+
"typescript": "^4.9.3"
|
|
93
81
|
},
|
|
94
82
|
"peerDependencies": {
|
|
95
83
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
@@ -103,5 +91,11 @@
|
|
|
103
91
|
"publishConfig": {
|
|
104
92
|
"access": "public"
|
|
105
93
|
},
|
|
106
|
-
"
|
|
94
|
+
"bundler": {
|
|
95
|
+
"entries": [
|
|
96
|
+
"./src/index.ts"
|
|
97
|
+
],
|
|
98
|
+
"platform": "node"
|
|
99
|
+
},
|
|
100
|
+
"gitHead": "4fec76c3f5135854d9834ebc1cf2f1f325696ded"
|
|
107
101
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<style>
|
|
4
4
|
/* While we aren't showing the main block yet, but still preparing, we want everything the user
|
|
5
|
-
has rendered, which may or may not be in #root, to be display none */
|
|
5
|
+
has rendered, which may or may not be in #storybook-root, to be display none */
|
|
6
6
|
.sb-show-preparing-story:not(.sb-show-main) > :not(.sb-preparing-story) {
|
|
7
7
|
display: none;
|
|
8
8
|
}
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
min-height: 100vh;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
.sb-show-main.sb-main-centered #root {
|
|
29
|
+
.sb-show-main.sb-main-centered #storybook-root {
|
|
30
30
|
box-sizing: border-box;
|
|
31
31
|
margin: auto;
|
|
32
32
|
padding: 1rem;
|
|
@@ -237,8 +237,8 @@
|
|
|
237
237
|
.sb-argstableBlock td:nth-of-type(3) {
|
|
238
238
|
width: 15%;
|
|
239
239
|
}
|
|
240
|
-
.sb-argstableBlock th:
|
|
241
|
-
.sb-argstableBlock td:
|
|
240
|
+
.sb-argstableBlock th:last-of-type,
|
|
241
|
+
.sb-argstableBlock td:last-of-type {
|
|
242
242
|
width: 25%;
|
|
243
243
|
padding-right: 20px;
|
|
244
244
|
}
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
<% }); %>
|
|
17
17
|
|
|
18
18
|
<style>
|
|
19
|
-
#root[hidden],
|
|
20
|
-
#docs
|
|
19
|
+
#storybook-root[hidden],
|
|
20
|
+
#storybook-docs[hidden] {
|
|
21
21
|
display: none !important;
|
|
22
22
|
}
|
|
23
23
|
</style>
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
<body>
|
|
26
26
|
<% if (typeof bodyHtmlSnippet !== 'undefined') { %> <%= bodyHtmlSnippet %> <% } %>
|
|
27
27
|
|
|
28
|
-
<div id="root"></div>
|
|
29
|
-
<div id="docs
|
|
28
|
+
<div id="storybook-root"></div>
|
|
29
|
+
<div id="storybook-docs"></div>
|
|
30
30
|
|
|
31
31
|
<% if (typeof globals !== 'undefined' && Object.keys(globals).length) { %>
|
|
32
32
|
<script>
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2017 Kadira Inc. <hello@kadira.io>
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
THE SOFTWARE.
|