@storybook/server-webpack5 7.0.0-alpha.4 → 7.0.0-alpha.40
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 +2 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +0 -0
- package/dist/preset.d.ts +9 -0
- package/dist/preset.js +1 -0
- package/dist/preset.mjs +1 -0
- package/dist/types-00986772.d.ts +27 -0
- package/package.json +39 -12
- package/preset.js +1 -1
- package/LICENSE +0 -21
- package/dist/cjs/index.js +0 -18
- package/dist/cjs/preset.js +0 -16
- package/dist/esm/index.js +0 -1
- package/dist/esm/preset.js +0 -6
- package/dist/types/index.d.ts +0 -1
- package/dist/types/preset.d.ts +0 -11
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ So you can develop UI components in isolation without worrying about app specifi
|
|
|
14
14
|
|
|
15
15
|
```sh
|
|
16
16
|
cd my-app
|
|
17
|
-
npx
|
|
17
|
+
npx storybook init -t server
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
To configure the server that Storybook will connect to, export a global parameter `parameters.server.url` in `.storybook/preview.js`:
|
|
@@ -92,7 +92,7 @@ In particular the [View Component::Storybook](https://github.com/jonspalmer/view
|
|
|
92
92
|
|
|
93
93
|
## Server rendering
|
|
94
94
|
|
|
95
|
-
The server rendering side of things is relatively
|
|
95
|
+
The server rendering side of things is relatively straightforward. When you browse to a story in the sidebar, Storybook will make a `fetch` request to `${parameters.server.url}/{parameters.server.id}` and display the HTML that is returned.
|
|
96
96
|
|
|
97
97
|
You need to ensure the route in your server app renders the appropriate HTML when called in that fashion.
|
|
98
98
|
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var m=Object.defineProperty;var t=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var b=(r,o,p,f)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of x(o))!a.call(r,e)&&e!==p&&m(r,e,{get:()=>o[e],enumerable:!(f=t(o,e))||f.enumerable});return r};var c=r=>b(m({},"__esModule",{value:!0}),r);var d={};module.exports=c(d);
|
package/dist/index.mjs
ADDED
|
File without changes
|
package/dist/preset.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PresetProperty } from '@storybook/core-common';
|
|
2
|
+
import { S as StorybookConfig } from './types-00986772.js';
|
|
3
|
+
import '@storybook/preset-server-webpack';
|
|
4
|
+
import '@storybook/builder-webpack5';
|
|
5
|
+
|
|
6
|
+
declare const addons: PresetProperty<'addons', StorybookConfig>;
|
|
7
|
+
declare const core: PresetProperty<'core', StorybookConfig>;
|
|
8
|
+
|
|
9
|
+
export { addons, core };
|
package/dist/preset.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var i=Object.create;var n=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var c=(o,r)=>{for(var e in r)n(o,e,{get:r[e],enumerable:!0})},a=(o,r,e,p)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of y(r))!m.call(o,s)&&s!==e&&n(o,s,{get:()=>r[s],enumerable:!(p=k(r,s))||p.enumerable});return o};var d=(o,r,e)=>(e=o!=null?i(b(o)):{},a(r||!o||!o.__esModule?n(e,"default",{value:o,enumerable:!0}):e,o)),f=o=>a(n({},"__esModule",{value:!0}),o);var u={};c(u,{addons:()=>g,core:()=>l});module.exports=f(u);var t=d(require("path")),g=[t.default.dirname(require.resolve(t.default.join("@storybook/preset-server-webpack","package.json"))),t.default.dirname(require.resolve(t.default.join("@storybook/server","package.json")))],l=async(o,r)=>{let e=await r.presets.apply("framework");return{...o,builder:{name:t.default.dirname(require.resolve(t.default.join("@storybook/builder-webpack5","package.json"))),options:typeof e=="string"?{}:e.options.builder||{}}}};0&&(module.exports={addons,core});
|
package/dist/preset.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=(o=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(o,{get:(s,e)=>(typeof require!="undefined"?require:s)[e]}):o)(function(o){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+o+'" is not supported')});import r from"path";var i=[r.dirname(t.resolve(r.join("@storybook/preset-server-webpack","package.json"))),r.dirname(t.resolve(r.join("@storybook/server","package.json")))],k=async(o,s)=>{let e=await s.presets.apply("framework");return{...o,builder:{name:r.dirname(t.resolve(r.join("@storybook/builder-webpack5","package.json"))),options:typeof e=="string"?{}:e.options.builder||{}}}};export{i as addons,k as core};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { StorybookConfig as StorybookConfig$1, TypescriptOptions as TypescriptOptions$1 } from '@storybook/preset-server-webpack';
|
|
2
|
+
import { BuilderOptions, StorybookConfigWebpack, TypescriptOptions } from '@storybook/builder-webpack5';
|
|
3
|
+
|
|
4
|
+
declare type FrameworkName = '@storybook/server-webpack5';
|
|
5
|
+
declare type BuilderName = '@storybook/builder-webpack5';
|
|
6
|
+
declare type FrameworkOptions = {
|
|
7
|
+
builder?: BuilderOptions;
|
|
8
|
+
};
|
|
9
|
+
declare type StorybookConfigFramework = {
|
|
10
|
+
framework: FrameworkName | {
|
|
11
|
+
name: FrameworkName;
|
|
12
|
+
options: FrameworkOptions;
|
|
13
|
+
};
|
|
14
|
+
core?: StorybookConfig$1['core'] & {
|
|
15
|
+
builder?: BuilderName | {
|
|
16
|
+
name: BuilderName;
|
|
17
|
+
options: BuilderOptions;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
typescript?: Partial<TypescriptOptions & TypescriptOptions$1> & StorybookConfig$1['typescript'];
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* The interface for Storybook configuration in `main.ts` files.
|
|
24
|
+
*/
|
|
25
|
+
declare type StorybookConfig = Omit<StorybookConfig$1, keyof StorybookConfigWebpack | keyof StorybookConfigFramework> & StorybookConfigWebpack & StorybookConfigFramework;
|
|
26
|
+
|
|
27
|
+
export { FrameworkOptions as F, StorybookConfig as S };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/server-webpack5",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.40",
|
|
4
4
|
"description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -19,9 +19,26 @@
|
|
|
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
|
+
"./preset": {
|
|
29
|
+
"require": "./dist/preset.js",
|
|
30
|
+
"import": "./dist/preset.mjs",
|
|
31
|
+
"types": "./dist/preset.d.ts"
|
|
32
|
+
},
|
|
33
|
+
"./package.json": {
|
|
34
|
+
"require": "./package.json",
|
|
35
|
+
"import": "./package.json",
|
|
36
|
+
"types": "./package.json"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"main": "dist/index.js",
|
|
40
|
+
"module": "dist/index.mjs",
|
|
41
|
+
"types": "dist/index.d.ts",
|
|
25
42
|
"files": [
|
|
26
43
|
"dist/**/*",
|
|
27
44
|
"README.md",
|
|
@@ -29,23 +46,33 @@
|
|
|
29
46
|
"*.d.ts"
|
|
30
47
|
],
|
|
31
48
|
"scripts": {
|
|
32
|
-
"
|
|
49
|
+
"check": "../../../scripts/node_modules/.bin/tsc --noEmit",
|
|
50
|
+
"prep": "../../../scripts/prepare/bundle.ts"
|
|
33
51
|
},
|
|
34
52
|
"dependencies": {
|
|
35
|
-
"@storybook/builder-webpack5": "7.0.0-alpha.
|
|
36
|
-
"@storybook/core-common": "7.0.0-alpha.
|
|
37
|
-
"@storybook/preset-server-webpack": "7.0.0-alpha.
|
|
38
|
-
"@storybook/server": "7.0.0-alpha.
|
|
39
|
-
"@types/node": "^
|
|
40
|
-
"core-js": "^3.8.2",
|
|
53
|
+
"@storybook/builder-webpack5": "7.0.0-alpha.40",
|
|
54
|
+
"@storybook/core-common": "7.0.0-alpha.40",
|
|
55
|
+
"@storybook/preset-server-webpack": "7.0.0-alpha.40",
|
|
56
|
+
"@storybook/server": "7.0.0-alpha.40",
|
|
57
|
+
"@types/node": "^16.0.0",
|
|
41
58
|
"react": "16.14.0",
|
|
42
59
|
"react-dom": "16.14.0"
|
|
43
60
|
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"typescript": "~4.6.3"
|
|
63
|
+
},
|
|
44
64
|
"engines": {
|
|
45
65
|
"node": ">=10.13.0"
|
|
46
66
|
},
|
|
47
67
|
"publishConfig": {
|
|
48
68
|
"access": "public"
|
|
49
69
|
},
|
|
50
|
-
"
|
|
70
|
+
"bundler": {
|
|
71
|
+
"entries": [
|
|
72
|
+
"./src/index.ts",
|
|
73
|
+
"./src/preset.ts"
|
|
74
|
+
],
|
|
75
|
+
"platform": "node"
|
|
76
|
+
},
|
|
77
|
+
"gitHead": "8f6d8629f1ad7e776c39e2c7621f4a0d538aa93c"
|
|
51
78
|
}
|
package/preset.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports = require('./dist/
|
|
1
|
+
module.exports = require('./dist/preset');
|
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.
|
package/dist/cjs/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _server = require("@storybook/server");
|
|
8
|
-
|
|
9
|
-
Object.keys(_server).forEach(function (key) {
|
|
10
|
-
if (key === "default" || key === "__esModule") return;
|
|
11
|
-
if (key in exports && exports[key] === _server[key]) return;
|
|
12
|
-
Object.defineProperty(exports, key, {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _server[key];
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
});
|
package/dist/cjs/preset.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.core = exports.addons = void 0;
|
|
7
|
-
const addons = ['@storybook/preset-server-webpack', '@storybook/server'];
|
|
8
|
-
exports.addons = addons;
|
|
9
|
-
|
|
10
|
-
const core = async config => {
|
|
11
|
-
return Object.assign({}, config, {
|
|
12
|
-
builder: require.resolve('@storybook/builder-webpack5')
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
exports.core = core;
|
package/dist/esm/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@storybook/server';
|
package/dist/esm/preset.js
DELETED
package/dist/types/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@storybook/server';
|
package/dist/types/preset.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { StorybookConfig } from '@storybook/core-common';
|
|
2
|
-
export declare const addons: StorybookConfig['addons'];
|
|
3
|
-
export declare const core: (config: StorybookConfig['core']) => Promise<{
|
|
4
|
-
builder: string;
|
|
5
|
-
disableWebpackDefaults?: boolean | undefined;
|
|
6
|
-
channelOptions?: Partial<import("telejson").Options> | undefined;
|
|
7
|
-
disableProjectJson?: boolean | undefined;
|
|
8
|
-
disableTelemetry?: boolean | undefined;
|
|
9
|
-
enableCrashReports?: boolean | undefined;
|
|
10
|
-
crossOriginIsolated?: boolean | undefined;
|
|
11
|
-
}>;
|