@storybook/preset-server-webpack 7.0.0-alpha.53 → 7.0.0-alpha.55
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/chunk-HXSBEJGO.mjs +1 -0
- package/dist/index.mjs +1 -1
- package/dist/loader.mjs +13 -13
- package/package.json +6 -6
- package/dist/chunk-HKSD7XQF.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __require=(x=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(x,{get:(a,b)=>(typeof require!="undefined"?require:a)[b]}):x)(function(x){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+x+'" is not supported')});export{__require};
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{__require}from"./chunk-HXSBEJGO.mjs";var webpack=config=>{let rules=[...config.module?.rules||[],{type:"javascript/auto",test:/\.stories\.json$/,use:__require.resolve("@storybook/preset-server-webpack/dist/loader")},{type:"javascript/auto",test:/\.stories\.ya?ml/,use:[__require.resolve("@storybook/preset-server-webpack/dist/loader"),__require.resolve("yaml-loader")]}];return config.module=config.module||{},config.module.rules=rules,config};export{webpack};
|
package/dist/loader.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import{
|
|
2
|
-
${
|
|
3
|
-
${
|
|
4
|
-
${
|
|
5
|
-
${
|
|
6
|
-
${
|
|
7
|
-
`).join("")}function
|
|
1
|
+
import{__require}from"./chunk-HXSBEJGO.mjs";import{dedent}from"ts-dedent";var{identifier}=__require("safe-identifier");function stringifyObject(object,level=0,excludeOuterParams=!1){if(typeof object=="string")return JSON.stringify(object);let indent=" ".repeat(level);if(Array.isArray(object)){let arrayString=object.map(item=>stringifyObject(item,level+1)).join(`,
|
|
2
|
+
${indent} `);return excludeOuterParams?arrayString:`[
|
|
3
|
+
${indent} ${arrayString}
|
|
4
|
+
${indent}]`}if(typeof object=="object"){let objectString="";return Object.keys(object).length>0&&(objectString=Object.keys(object).map(key=>{let value=stringifyObject(object[key],level+1);return`
|
|
5
|
+
${indent} ${key}: ${value}`}).join(",")),excludeOuterParams?objectString:objectString.length===0?"{}":`{${objectString}
|
|
6
|
+
${indent}}`}return object}function stringifyImports(imports){return Object.keys(imports).length===0?"":Object.entries(imports).map(([module,names])=>`import { ${names.sort().join(", ")} } from '${module}';
|
|
7
|
+
`).join("")}function stringifyDecorators(decorators){return decorators&&decorators.length>0?`
|
|
8
8
|
decorators: [
|
|
9
|
-
${
|
|
9
|
+
${decorators.join(`,
|
|
10
10
|
`)}
|
|
11
|
-
],`:""}function
|
|
11
|
+
],`:""}function stringifyDefault(section){let{title,imports,decorators,stories,...options}=section,decoratorsString=stringifyDecorators(decorators),optionsString=stringifyObject(options,0,!0);return dedent`
|
|
12
12
|
export default {
|
|
13
|
-
title: ${JSON.stringify(
|
|
13
|
+
title: ${JSON.stringify(title)},${decoratorsString}${optionsString}
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
`}function
|
|
17
|
-
`)}function
|
|
18
|
-
`)}function
|
|
16
|
+
`}function stringifyStory(story){let{name,...options}=story,storyId=identifier(name),exportedStory={name,...options};return[`export const ${storyId} = ${stringifyObject(exportedStory)};`,""].join(`
|
|
17
|
+
`)}function stringifySection(section){return[stringifyImports(section.imports),stringifyDefault(section),...section.stories.map(story=>stringifyStory(story))].join(`
|
|
18
|
+
`)}function createSection(args){return{imports:{},decorators:[],...args}}function compileCsfModule(args){return stringifySection(createSection(args))}var loader_default=content=>{try{return compileCsfModule(JSON.parse(content))}catch{}return content};export{loader_default as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/preset-server-webpack",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.55",
|
|
4
4
|
"description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"prep": "../../../scripts/prepare/bundle.ts"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@storybook/core-server": "7.0.0-alpha.
|
|
59
|
-
"@storybook/core-webpack": "7.0.0-alpha.
|
|
60
|
-
"@storybook/server": "7.0.0-alpha.
|
|
58
|
+
"@storybook/core-server": "7.0.0-alpha.55",
|
|
59
|
+
"@storybook/core-webpack": "7.0.0-alpha.55",
|
|
60
|
+
"@storybook/server": "7.0.0-alpha.55",
|
|
61
61
|
"@types/node": "^16.0.0",
|
|
62
62
|
"global": "^4.4.0",
|
|
63
63
|
"react": "16.14.0",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"fs-extra": "^9.0.1",
|
|
71
|
-
"jest-specific-snapshot": "^
|
|
71
|
+
"jest-specific-snapshot": "^7.0.0",
|
|
72
72
|
"typescript": "^4.9.3",
|
|
73
73
|
"yaml": "^1.10.0"
|
|
74
74
|
},
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
],
|
|
86
86
|
"platform": "node"
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "55cd2ab63d1f897de59e2471d2f916f7d2c13546"
|
|
89
89
|
}
|
package/dist/chunk-HKSD7XQF.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var d=(a=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(a,{get:(b,c)=>(typeof require!="undefined"?require:b)[c]}):a)(function(a){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+a+'" is not supported')});export{d as a};
|