@storybook/svelte 6.5.6 → 7.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/README.md +1 -32
- package/dist/cjs/config.js +51 -0
- package/dist/cjs/{client/docs → docs}/config.js +0 -0
- package/dist/cjs/{client/docs → docs}/extractArgTypes.js +0 -0
- package/dist/cjs/{client/docs → docs}/extractComponentDescription.js +0 -0
- package/dist/cjs/{client/docs → docs}/prepareForInline.js +0 -0
- package/dist/cjs/{client/docs → docs}/sourceDecorator.js +0 -0
- package/dist/cjs/{client/index.js → index.js} +4 -3
- package/dist/cjs/{client/preview → preview}/config.js +1 -7
- package/dist/cjs/{client/preview → preview}/decorators.js +0 -0
- package/dist/cjs/{client/preview → preview}/globals.js +0 -0
- package/dist/cjs/{client/preview → preview}/index.js +2 -2
- package/dist/cjs/{client/preview → preview}/render.js +0 -0
- package/dist/cjs/{client/preview → preview}/types.js +0 -0
- package/dist/esm/config.js +6 -0
- package/dist/{modern/client → esm}/docs/config.js +0 -0
- package/dist/{modern/client → esm}/docs/extractArgTypes.js +3 -7
- package/dist/{modern/client → esm}/docs/extractComponentDescription.js +0 -0
- package/dist/{modern/client → esm}/docs/prepareForInline.js +0 -0
- package/dist/{modern/client → esm}/docs/sourceDecorator.js +7 -8
- package/dist/esm/index.js +3 -0
- package/dist/esm/preview/config.js +2 -0
- package/dist/{modern/client → esm}/preview/decorators.js +0 -1
- package/dist/{modern/client → esm}/preview/globals.js +0 -0
- package/dist/{modern/client → esm}/preview/index.js +1 -1
- package/dist/{modern/client → esm}/preview/render.js +0 -0
- package/dist/esm/{client/preview → preview}/types.js +0 -0
- package/dist/types/config.d.ts +11 -0
- package/dist/{ts3.9/client → types}/docs/config.d.ts +1 -1
- package/dist/{ts3.9/client → types}/docs/extractArgTypes.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/extractComponentDescription.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/prepareForInline.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/sourceDecorator.d.ts +0 -0
- package/dist/{ts3.9/client → types}/index.d.ts +0 -0
- package/dist/{esm/client/preview/config.js → types/preview/config.d.ts} +0 -3
- package/dist/{ts3.9/client → types}/preview/decorators.d.ts +0 -0
- package/dist/{ts3.9/client → types}/preview/globals.d.ts +0 -0
- package/dist/{ts3.9/client → types}/preview/index.d.ts +2 -2
- package/dist/{ts3.9/client → types}/preview/render.d.ts +0 -0
- package/dist/{ts3.9/client → types}/preview/types.d.ts +1 -1
- package/package.json +16 -41
- package/preview.js +1 -0
- package/bin/build.js +0 -5
- package/bin/index.js +0 -3
- package/dist/cjs/server/build.js +0 -9
- package/dist/cjs/server/framework-preset-svelte-docs.js +0 -32
- package/dist/cjs/server/framework-preset-svelte.js +0 -57
- package/dist/cjs/server/index.js +0 -9
- package/dist/cjs/server/options.js +0 -17
- package/dist/cjs/server/preset.js +0 -8
- package/dist/cjs/server/svelte-docgen-loader.js +0 -120
- package/dist/esm/client/docs/config.js +0 -15
- package/dist/esm/client/docs/extractArgTypes.js +0 -140
- package/dist/esm/client/docs/extractComponentDescription.js +0 -12
- package/dist/esm/client/docs/prepareForInline.js +0 -20
- package/dist/esm/client/docs/sourceDecorator.js +0 -239
- package/dist/esm/client/index.js +0 -5
- package/dist/esm/client/preview/decorators.js +0 -95
- package/dist/esm/client/preview/globals.js +0 -3
- package/dist/esm/client/preview/index.js +0 -30
- package/dist/esm/client/preview/render.js +0 -49
- package/dist/esm/server/build.js +0 -3
- package/dist/esm/server/framework-preset-svelte-docs.js +0 -16
- package/dist/esm/server/framework-preset-svelte.js +0 -42
- package/dist/esm/server/index.js +0 -3
- package/dist/esm/server/options.js +0 -8
- package/dist/esm/server/preset.js +0 -1
- package/dist/esm/server/svelte-docgen-loader.js +0 -99
- package/dist/modern/client/index.js +0 -5
- package/dist/modern/client/preview/config.js +0 -5
- package/dist/modern/client/preview/types.js +0 -0
- package/dist/modern/server/build.js +0 -3
- package/dist/modern/server/framework-preset-svelte-docs.js +0 -16
- package/dist/modern/server/framework-preset-svelte.js +0 -42
- package/dist/modern/server/index.js +0 -3
- package/dist/modern/server/options.js +0 -8
- package/dist/modern/server/preset.js +0 -1
- package/dist/modern/server/svelte-docgen-loader.js +0 -99
- package/dist/ts3.4/client/docs/config.d.ts +0 -11
- package/dist/ts3.4/client/docs/extractArgTypes.d.ts +0 -5
- package/dist/ts3.4/client/docs/extractComponentDescription.d.ts +0 -3
- package/dist/ts3.4/client/docs/prepareForInline.d.ts +0 -3
- package/dist/ts3.4/client/docs/sourceDecorator.d.ts +0 -16
- package/dist/ts3.4/client/index.d.ts +0 -1
- package/dist/ts3.4/client/preview/config.d.ts +0 -5
- package/dist/ts3.4/client/preview/decorators.d.ts +0 -1
- package/dist/ts3.4/client/preview/globals.d.ts +0 -1
- package/dist/ts3.4/client/preview/index.d.ts +0 -9
- package/dist/ts3.4/client/preview/render.d.ts +0 -5
- package/dist/ts3.4/client/preview/types.d.ts +0 -21
- package/dist/ts3.4/server/build.d.ts +0 -1
- package/dist/ts3.4/server/framework-preset-svelte-docs.d.ts +0 -5
- package/dist/ts3.4/server/framework-preset-svelte.d.ts +0 -6
- package/dist/ts3.4/server/index.d.ts +0 -1
- package/dist/ts3.4/server/options.d.ts +0 -3
- package/dist/ts3.4/server/preset.d.ts +0 -2
- package/dist/ts3.4/server/svelte-docgen-loader.d.ts +0 -5
- package/dist/ts3.9/client/preview/config.d.ts +0 -5
- package/dist/ts3.9/server/build.d.ts +0 -1
- package/dist/ts3.9/server/framework-preset-svelte-docs.d.ts +0 -5
- package/dist/ts3.9/server/framework-preset-svelte.d.ts +0 -6
- package/dist/ts3.9/server/index.d.ts +0 -1
- package/dist/ts3.9/server/options.d.ts +0 -3
- package/dist/ts3.9/server/preset.d.ts +0 -2
- package/dist/ts3.9/server/svelte-docgen-loader.d.ts +0 -5
- package/preset.js +0 -1
- package/standalone.js +0 -8
package/README.md
CHANGED
|
@@ -1,32 +1 @@
|
|
|
1
|
-
# Storybook
|
|
2
|
-
|
|
3
|
-
Storybook for Svelte is a UI development environment for your Svelte components.
|
|
4
|
-
With it, you can visualize different states of your UI components and develop them interactively.
|
|
5
|
-
|
|
6
|
-

|
|
7
|
-
|
|
8
|
-
Storybook runs outside of your app.
|
|
9
|
-
So you can develop UI components in isolation without worrying about app specific dependencies and requirements.
|
|
10
|
-
|
|
11
|
-
## Getting Started
|
|
12
|
-
|
|
13
|
-
```sh
|
|
14
|
-
cd my-svelte-app
|
|
15
|
-
npx sb init
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
For more information visit: [storybook.js.org](https://storybook.js.org)
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
Storybook also comes with a lot of [addons](https://storybook.js.org/addons) and a great API to customize as you wish.
|
|
23
|
-
You can also build a [static version](https://storybook.js.org/docs/svelte/sharing/publish-storybook) of your Storybook and deploy it anywhere you want.
|
|
24
|
-
|
|
25
|
-
## TODOs
|
|
26
|
-
|
|
27
|
-
- [ ] Support `addon-info`
|
|
28
|
-
- [ ] Support Svelte markup directly in stories
|
|
29
|
-
- [ ] Add Svelte storybook generator
|
|
30
|
-
- [ ] Provide stories that show advanced Svelte use cases
|
|
31
|
-
- [ ] Hydratable
|
|
32
|
-
- [ ] Advanced mount options
|
|
1
|
+
# Storybook Svelte renderer
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.to-string.js");
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
6
|
+
|
|
7
|
+
require("core-js/modules/es.object.keys.js");
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "__esModule", {
|
|
10
|
+
value: true
|
|
11
|
+
});
|
|
12
|
+
var _exportNames = {
|
|
13
|
+
parameters: true,
|
|
14
|
+
decorators: true,
|
|
15
|
+
argTypesEnhancers: true
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "argTypesEnhancers", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function get() {
|
|
20
|
+
return _config.argTypesEnhancers;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports, "decorators", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function get() {
|
|
26
|
+
return _config.decorators;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
exports.parameters = void 0;
|
|
30
|
+
|
|
31
|
+
require("core-js/modules/es.object.assign.js");
|
|
32
|
+
|
|
33
|
+
var _config = require("./docs/config");
|
|
34
|
+
|
|
35
|
+
var _config2 = require("./preview/config");
|
|
36
|
+
|
|
37
|
+
Object.keys(_config2).forEach(function (key) {
|
|
38
|
+
if (key === "default" || key === "__esModule") return;
|
|
39
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
40
|
+
if (key in exports && exports[key] === _config2[key]) return;
|
|
41
|
+
Object.defineProperty(exports, key, {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function get() {
|
|
44
|
+
return _config2[key];
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
var parameters = Object.assign({
|
|
49
|
+
framework: 'svelte'
|
|
50
|
+
}, _config.parameters);
|
|
51
|
+
exports.parameters = parameters;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -54,6 +54,7 @@ Object.defineProperty(exports, "storiesOf", {
|
|
|
54
54
|
|
|
55
55
|
var _preview = require("./preview");
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
var _module, _module$hot;
|
|
58
|
+
|
|
59
|
+
// optimization: stop HMR propagation in webpack
|
|
60
|
+
(_module = module) === null || _module === void 0 ? void 0 : (_module$hot = _module.hot) === null || _module$hot === void 0 ? void 0 : _module$hot.decline();
|
|
@@ -9,7 +9,6 @@ Object.defineProperty(exports, "decorateStory", {
|
|
|
9
9
|
return _decorators.decorateStory;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
exports.parameters = void 0;
|
|
13
12
|
Object.defineProperty(exports, "render", {
|
|
14
13
|
enumerable: true,
|
|
15
14
|
get: function get() {
|
|
@@ -25,9 +24,4 @@ Object.defineProperty(exports, "renderToDOM", {
|
|
|
25
24
|
|
|
26
25
|
var _render = require("./render");
|
|
27
26
|
|
|
28
|
-
var _decorators = require("./decorators");
|
|
29
|
-
|
|
30
|
-
var parameters = {
|
|
31
|
-
framework: 'svelte'
|
|
32
|
-
};
|
|
33
|
-
exports.parameters = parameters;
|
|
27
|
+
var _decorators = require("./decorators");
|
|
File without changes
|
|
File without changes
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.storiesOf = exports.setAddon = exports.raw = exports.getStorybook = exports.forceReRender = exports.configure = exports.clearDecorators = exports.addParameters = exports.addDecorator = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _coreClient = require("@storybook/core-client");
|
|
9
9
|
|
|
10
10
|
var _decorators = require("./decorators");
|
|
11
11
|
|
|
@@ -13,7 +13,7 @@ require("./globals");
|
|
|
13
13
|
|
|
14
14
|
var _render = require("./render");
|
|
15
15
|
|
|
16
|
-
var _start = (0,
|
|
16
|
+
var _start = (0, _coreClient.start)(_render.renderToDOM, {
|
|
17
17
|
decorateStory: _decorators.decorateStory,
|
|
18
18
|
render: _render.render
|
|
19
19
|
}),
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -21,19 +21,17 @@ export const extractArgTypes = component => {
|
|
|
21
21
|
export const createArgTypes = docgen => {
|
|
22
22
|
const results = {};
|
|
23
23
|
docgen.data.forEach(item => {
|
|
24
|
-
var _item$type, _item$type2;
|
|
25
|
-
|
|
26
24
|
results[item.name] = {
|
|
27
25
|
control: parseTypeToControl(item.type),
|
|
28
26
|
name: item.name,
|
|
29
27
|
description: item.description,
|
|
30
28
|
type: {
|
|
31
29
|
required: hasKeyword('required', item.keywords),
|
|
32
|
-
name:
|
|
30
|
+
name: item.type?.text
|
|
33
31
|
},
|
|
34
32
|
table: {
|
|
35
33
|
type: {
|
|
36
|
-
summary:
|
|
34
|
+
summary: item.type?.text
|
|
37
35
|
},
|
|
38
36
|
defaultValue: {
|
|
39
37
|
summary: item.defaultValue
|
|
@@ -56,11 +54,9 @@ export const createArgTypes = docgen => {
|
|
|
56
54
|
};
|
|
57
55
|
});
|
|
58
56
|
docgen.slots.forEach(item => {
|
|
59
|
-
var _item$params;
|
|
60
|
-
|
|
61
57
|
results[`slot_${item.name}`] = {
|
|
62
58
|
name: item.name,
|
|
63
|
-
description: [item.description,
|
|
59
|
+
description: [item.description, item.params?.map(p => `\`${p.name}\``).join(' ')].filter(p => p).join('\n\n'),
|
|
64
60
|
type: {
|
|
65
61
|
name: 'other',
|
|
66
62
|
value: 'void'
|
|
File without changes
|
|
File without changes
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable no-underscore-dangle */
|
|
1
2
|
import { addons, useEffect } from '@storybook/addons';
|
|
2
3
|
import { once } from '@storybook/client-logger';
|
|
3
4
|
import { SourceType, SNIPPET_RENDERED } from '@storybook/docs-tools';
|
|
@@ -8,18 +9,16 @@ import { SourceType, SNIPPET_RENDERED } from '@storybook/docs-tools';
|
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
11
|
const skipSourceRender = context => {
|
|
11
|
-
|
|
12
|
+
const sourceParams = context?.parameters.docs?.source;
|
|
13
|
+
const isArgsStory = context?.parameters.__isArgsStory; // always render if the user forces it
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
const isArgsStory = context === null || context === void 0 ? void 0 : context.parameters.__isArgsStory; // always render if the user forces it
|
|
15
|
-
|
|
16
|
-
if ((sourceParams === null || sourceParams === void 0 ? void 0 : sourceParams.type) === SourceType.DYNAMIC) {
|
|
15
|
+
if (sourceParams?.type === SourceType.DYNAMIC) {
|
|
17
16
|
return false;
|
|
18
17
|
} // never render if the user is forcing the block to render code, or
|
|
19
18
|
// if the user provides code, or if it's not an args story.
|
|
20
19
|
|
|
21
20
|
|
|
22
|
-
return !isArgsStory ||
|
|
21
|
+
return !isArgsStory || sourceParams?.code || sourceParams?.type === SourceType.CODE;
|
|
23
22
|
};
|
|
24
23
|
/**
|
|
25
24
|
* Transform a key/value to a svelte declaration as string.
|
|
@@ -142,7 +141,7 @@ function getWrapperProperties(component) {
|
|
|
142
141
|
|
|
143
142
|
return {
|
|
144
143
|
wrapper: true,
|
|
145
|
-
slotProperty: slotProp
|
|
144
|
+
slotProperty: slotProp?.name
|
|
146
145
|
};
|
|
147
146
|
}
|
|
148
147
|
/**
|
|
@@ -188,6 +187,6 @@ export const sourceDecorator = (storyFn, context) => {
|
|
|
188
187
|
component = ctxtComponent;
|
|
189
188
|
}
|
|
190
189
|
|
|
191
|
-
source = generateSvelteSource(component, args, context
|
|
190
|
+
source = generateSvelteSource(component, args, context?.argTypes, slotProperty);
|
|
192
191
|
return story;
|
|
193
192
|
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const parameters: {
|
|
2
|
+
docs: {
|
|
3
|
+
inlineStories: boolean;
|
|
4
|
+
prepareForInline: (storyFn: import("@storybook/csf").StoryFn<import("@storybook/csf").AnyFramework, import("@storybook/csf").Args>) => import("react").DetailedReactHTMLElement<import("react").HTMLAttributes<any>, any>;
|
|
5
|
+
extractArgTypes: import("lib/docs-tools/dist/types").ArgTypesExtractor;
|
|
6
|
+
extractComponentDescription: typeof import("./docs/extractComponentDescription").extractComponentDescription;
|
|
7
|
+
};
|
|
8
|
+
framework: string;
|
|
9
|
+
};
|
|
10
|
+
export { decorators, argTypesEnhancers } from './docs/config';
|
|
11
|
+
export * from './preview/config';
|
|
@@ -8,4 +8,4 @@ export declare const parameters: {
|
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
10
|
export declare const decorators: ((storyFn: any, context: import("@storybook/csf").StoryContext<import("@storybook/csf").AnyFramework, import("@storybook/csf").Args>) => any)[];
|
|
11
|
-
export declare const argTypesEnhancers: (<TFramework extends import("@storybook/csf").AnyFramework>(context: import("@storybook/csf").StoryContextForEnhancers<TFramework, import("@storybook/csf").Args>) => import("@storybook/
|
|
11
|
+
export declare const argTypesEnhancers: (<TFramework extends import("@storybook/csf").AnyFramework>(context: import("@storybook/csf").StoryContextForEnhancers<TFramework, import("@storybook/csf").Args>) => import("@storybook/csf").StrictArgTypes<import("@storybook/csf").Args> | import("lib/addons/dist/types").Parameters)[];
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -3,7 +3,7 @@ declare const forceReRender: (() => never) | (() => void);
|
|
|
3
3
|
export declare const setAddon: ((addon: any) => void) | (() => never), addDecorator: (() => never) | ((decorator: import("@storybook/csf").DecoratorFunction<import("./types").SvelteFramework, import("@storybook/csf").Args>) => void), addParameters: (({ globals, globalTypes, ...parameters }: import("@storybook/csf").Parameters & {
|
|
4
4
|
globals?: import("@storybook/csf").Globals;
|
|
5
5
|
globalTypes?: import("@storybook/csf").GlobalTypes;
|
|
6
|
-
}) => void) | (() => never), clearDecorators: (() => void) | (() => never), getStorybook: (() => never) | (() => import("
|
|
7
|
-
export declare const storiesOf: (kind: string, m: any) => import("
|
|
6
|
+
}) => void) | (() => never), clearDecorators: (() => void) | (() => never), getStorybook: (() => never) | (() => import("lib/client-api/dist/types/ClientApi").GetStorybookKind<import("./types").SvelteFramework>[]), raw: (() => never) | (() => import("lib/store/dist/types").BoundStory<import("./types").SvelteFramework>[]);
|
|
7
|
+
export declare const storiesOf: (kind: string, m: any) => import("lib/addons/dist/types").StoryApi<any>;
|
|
8
8
|
export declare const configure: (loadable: any, m: any) => void;
|
|
9
9
|
export { forceReRender };
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,41 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/svelte",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Storybook
|
|
3
|
+
"version": "7.0.0-alpha.0",
|
|
4
|
+
"description": "Storybook Svelte renderer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
7
7
|
],
|
|
8
|
-
"homepage": "https://github.com/storybookjs/storybook/tree/main/
|
|
8
|
+
"homepage": "https://github.com/storybookjs/storybook/tree/main/renderers/svelte",
|
|
9
9
|
"bugs": {
|
|
10
10
|
"url": "https://github.com/storybookjs/storybook/issues"
|
|
11
11
|
},
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
14
14
|
"url": "https://github.com/storybookjs/storybook.git",
|
|
15
|
-
"directory": "
|
|
15
|
+
"directory": "renderers/svelte"
|
|
16
16
|
},
|
|
17
17
|
"funding": {
|
|
18
18
|
"type": "opencollective",
|
|
19
19
|
"url": "https://opencollective.com/storybook"
|
|
20
20
|
},
|
|
21
21
|
"license": "MIT",
|
|
22
|
-
"main": "dist/cjs/
|
|
23
|
-
"module": "dist/esm/
|
|
24
|
-
"types": "dist/
|
|
25
|
-
"typesVersions": {
|
|
26
|
-
"<3.8": {
|
|
27
|
-
"dist/ts3.9/*": [
|
|
28
|
-
"dist/ts3.4/*"
|
|
29
|
-
]
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"bin": {
|
|
33
|
-
"build-storybook": "./bin/build.js",
|
|
34
|
-
"start-storybook": "./bin/index.js",
|
|
35
|
-
"storybook-server": "./bin/index.js"
|
|
36
|
-
},
|
|
22
|
+
"main": "dist/cjs/index.js",
|
|
23
|
+
"module": "dist/esm/index.js",
|
|
24
|
+
"types": "dist/types/index.d.ts",
|
|
37
25
|
"files": [
|
|
38
|
-
"bin/**/*",
|
|
39
26
|
"dist/**/*",
|
|
40
27
|
"templates/**/*",
|
|
41
28
|
"README.md",
|
|
@@ -46,36 +33,25 @@
|
|
|
46
33
|
"prepare": "node ../../scripts/prepare.js"
|
|
47
34
|
},
|
|
48
35
|
"dependencies": {
|
|
49
|
-
"@storybook/addons": "
|
|
50
|
-
"@storybook/client-logger": "
|
|
51
|
-
"@storybook/core": "
|
|
52
|
-
"@storybook/core-common": "6.5.6",
|
|
36
|
+
"@storybook/addons": "7.0.0-alpha.0",
|
|
37
|
+
"@storybook/client-logger": "7.0.0-alpha.0",
|
|
38
|
+
"@storybook/core-client": "7.0.0-alpha.0",
|
|
53
39
|
"@storybook/csf": "0.0.2--canary.4566f4d.1",
|
|
54
|
-
"@storybook/docs-tools": "
|
|
55
|
-
"@storybook/
|
|
56
|
-
"@storybook/store": "6.5.6",
|
|
40
|
+
"@storybook/docs-tools": "7.0.0-alpha.0",
|
|
41
|
+
"@storybook/store": "7.0.0-alpha.0",
|
|
57
42
|
"core-js": "^3.8.2",
|
|
58
43
|
"global": "^4.4.0",
|
|
59
|
-
"loader-utils": "^2.0.0",
|
|
60
44
|
"react": "16.14.0",
|
|
61
45
|
"react-dom": "16.14.0",
|
|
62
|
-
"read-pkg-up": "^7.0.1",
|
|
63
46
|
"regenerator-runtime": "^0.13.7",
|
|
64
|
-
"sveltedoc-parser": "4.1.0"
|
|
65
|
-
"ts-dedent": "^2.0.0",
|
|
66
|
-
"webpack": ">=4.0.0 <6.0.0"
|
|
47
|
+
"sveltedoc-parser": "4.1.0"
|
|
67
48
|
},
|
|
68
49
|
"devDependencies": {
|
|
69
|
-
"
|
|
70
|
-
"@types/webpack-env": "^1.16.0",
|
|
71
|
-
"svelte": "^3.31.2",
|
|
72
|
-
"svelte-loader": "^3.0.0",
|
|
73
|
-
"webpack": "4"
|
|
50
|
+
"svelte": "^3.31.2"
|
|
74
51
|
},
|
|
75
52
|
"peerDependencies": {
|
|
76
53
|
"@babel/core": "*",
|
|
77
|
-
"svelte": "^3.1.0"
|
|
78
|
-
"svelte-loader": "*"
|
|
54
|
+
"svelte": "^3.1.0"
|
|
79
55
|
},
|
|
80
56
|
"engines": {
|
|
81
57
|
"node": ">=10.13.0"
|
|
@@ -83,6 +59,5 @@
|
|
|
83
59
|
"publishConfig": {
|
|
84
60
|
"access": "public"
|
|
85
61
|
},
|
|
86
|
-
"gitHead": "
|
|
87
|
-
"sbmodern": "dist/modern/client/index.js"
|
|
62
|
+
"gitHead": "c82d897ea765da8cf4fbbcc2af1f28c808a93e23"
|
|
88
63
|
}
|
package/preview.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/esm/config';
|
package/bin/build.js
DELETED
package/bin/index.js
DELETED
package/dist/cjs/server/build.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _server = require("@storybook/core/server");
|
|
4
|
-
|
|
5
|
-
var _options = _interopRequireDefault(require("./options"));
|
|
6
|
-
|
|
7
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
8
|
-
|
|
9
|
-
(0, _server.buildStatic)(_options.default);
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.previewAnnotations = void 0;
|
|
7
|
-
exports.webpackFinal = webpackFinal;
|
|
8
|
-
|
|
9
|
-
require("core-js/modules/es.promise.js");
|
|
10
|
-
|
|
11
|
-
var _path = _interopRequireDefault(require("path"));
|
|
12
|
-
|
|
13
|
-
var _coreCommon = require("@storybook/core-common");
|
|
14
|
-
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
|
|
17
|
-
async function webpackFinal(webpackConfig, options) {
|
|
18
|
-
var svelteOptions = await options.presets.apply('svelteOptions', {}, options);
|
|
19
|
-
webpackConfig.module.rules.push({
|
|
20
|
-
test: /\.svelte$/,
|
|
21
|
-
loader: _path.default.resolve(`${__dirname}/svelte-docgen-loader`),
|
|
22
|
-
enforce: 'post',
|
|
23
|
-
options: svelteOptions
|
|
24
|
-
});
|
|
25
|
-
return webpackConfig;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
var previewAnnotations = function (entry = []) {
|
|
29
|
-
return [...entry, (0, _coreCommon.findDistEsm)(__dirname, 'client/docs/config')];
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
exports.previewAnnotations = previewAnnotations;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.babelDefault = babelDefault;
|
|
7
|
-
exports.previewAnnotations = void 0;
|
|
8
|
-
exports.webpack = webpack;
|
|
9
|
-
|
|
10
|
-
require("core-js/modules/es.promise.js");
|
|
11
|
-
|
|
12
|
-
var _coreCommon = require("@storybook/core-common");
|
|
13
|
-
|
|
14
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15
|
-
|
|
16
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17
|
-
|
|
18
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
|
-
|
|
20
|
-
async function webpack(config, options) {
|
|
21
|
-
var _await$options$preset = await options.presets.apply('svelteOptions', {}, options),
|
|
22
|
-
_await$options$preset2 = _await$options$preset.preprocess,
|
|
23
|
-
preprocess = _await$options$preset2 === void 0 ? undefined : _await$options$preset2,
|
|
24
|
-
_await$options$preset3 = _await$options$preset.loader,
|
|
25
|
-
loader = _await$options$preset3 === void 0 ? {} : _await$options$preset3;
|
|
26
|
-
|
|
27
|
-
var mainFields = config.resolve.mainFields || ['browser', 'module', 'main'];
|
|
28
|
-
return _objectSpread(_objectSpread({}, config), {}, {
|
|
29
|
-
module: _objectSpread(_objectSpread({}, config.module), {}, {
|
|
30
|
-
rules: [...config.module.rules, {
|
|
31
|
-
test: /\.(svelte|html)$/,
|
|
32
|
-
loader: require.resolve('svelte-loader'),
|
|
33
|
-
options: _objectSpread({
|
|
34
|
-
preprocess: preprocess
|
|
35
|
-
}, loader)
|
|
36
|
-
}]
|
|
37
|
-
}),
|
|
38
|
-
resolve: _objectSpread(_objectSpread({}, config.resolve), {}, {
|
|
39
|
-
extensions: [...config.resolve.extensions, '.svelte'],
|
|
40
|
-
alias: config.resolve.alias,
|
|
41
|
-
mainFields: ['svelte', ...mainFields]
|
|
42
|
-
})
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
async function babelDefault(config) {
|
|
47
|
-
return _objectSpread(_objectSpread({}, config), {}, {
|
|
48
|
-
presets: [...((config === null || config === void 0 ? void 0 : config.presets) || [])],
|
|
49
|
-
plugins: [...((config === null || config === void 0 ? void 0 : config.plugins) || [])]
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
var previewAnnotations = function (entry = []) {
|
|
54
|
-
return [...entry, (0, _coreCommon.findDistEsm)(__dirname, 'client/preview/config')];
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
exports.previewAnnotations = previewAnnotations;
|
package/dist/cjs/server/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _server = require("@storybook/core/server");
|
|
4
|
-
|
|
5
|
-
var _options = _interopRequireDefault(require("./options"));
|
|
6
|
-
|
|
7
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
8
|
-
|
|
9
|
-
(0, _server.buildDev)(_options.default);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _readPkgUp = require("read-pkg-up");
|
|
9
|
-
|
|
10
|
-
var _default = {
|
|
11
|
-
packageJson: (0, _readPkgUp.sync)({
|
|
12
|
-
cwd: __dirname
|
|
13
|
-
}).packageJson,
|
|
14
|
-
framework: 'svelte',
|
|
15
|
-
frameworkPresets: [require.resolve('./preset.js')]
|
|
16
|
-
};
|
|
17
|
-
exports.default = _default;
|