@storybook/core-server 6.4.0-beta.28 → 6.4.0-beta.31
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/cjs/presets/common-preset.js +2 -1
- package/dist/cjs/utils/StoryIndexGenerator.js +12 -6
- package/dist/cjs/utils/__mockdata__/src/NoMeta.stories.js +10 -0
- package/dist/cjs/utils/server-statics.js +17 -15
- package/dist/esm/presets/common-preset.js +2 -1
- package/dist/esm/utils/StoryIndexGenerator.js +11 -6
- package/dist/esm/utils/__mockdata__/src/NoMeta.stories.js +3 -0
- package/dist/esm/utils/server-statics.js +19 -17
- package/dist/modern/presets/common-preset.js +2 -1
- package/dist/modern/utils/StoryIndexGenerator.js +11 -6
- package/dist/modern/utils/__mockdata__/src/NoMeta.stories.js +3 -0
- package/dist/modern/utils/server-statics.js +19 -17
- package/dist/ts3.4/presets/common-preset.d.ts +1 -0
- package/dist/ts3.4/utils/__mockdata__/src/NoMeta.stories.d.ts +1 -0
- package/dist/ts3.9/presets/common-preset.d.ts +1 -0
- package/dist/ts3.9/utils/__mockdata__/src/NoMeta.stories.d.ts +1 -0
- package/package.json +13 -13
|
@@ -113,9 +113,10 @@ class StoryIndexGenerator {
|
|
|
113
113
|
async extractStories(specifier, absolutePath) {
|
|
114
114
|
var relativePath = _path.default.relative(this.options.workingDir, absolutePath);
|
|
115
115
|
|
|
116
|
+
var fileStories = {};
|
|
117
|
+
var entry = this.storyIndexEntries.get(specifier);
|
|
118
|
+
|
|
116
119
|
try {
|
|
117
|
-
var entry = this.storyIndexEntries.get(specifier);
|
|
118
|
-
var fileStories = {};
|
|
119
120
|
var importPath = (0, _slash.default)(relativePath[0] === '.' ? relativePath : `./${relativePath}`);
|
|
120
121
|
var defaultTitle = (0, _store.autoTitleFromSpecifier)(importPath, specifier);
|
|
121
122
|
var csf = (await (0, _csfTools.readCsfOrMdx)(absolutePath, {
|
|
@@ -132,13 +133,18 @@ class StoryIndexGenerator {
|
|
|
132
133
|
importPath: importPath
|
|
133
134
|
};
|
|
134
135
|
});
|
|
135
|
-
entry[absolutePath] = fileStories;
|
|
136
|
-
return fileStories;
|
|
137
136
|
} catch (err) {
|
|
138
|
-
|
|
137
|
+
if (err.name === 'NoMetaError') {
|
|
138
|
+
_nodeLogger.logger.info(`💡 Skipping ${relativePath}: ${err}`);
|
|
139
|
+
} else {
|
|
140
|
+
_nodeLogger.logger.warn(`🚨 Extraction error on ${relativePath}: ${err}`);
|
|
139
141
|
|
|
140
|
-
|
|
142
|
+
throw err;
|
|
143
|
+
}
|
|
141
144
|
}
|
|
145
|
+
|
|
146
|
+
entry[absolutePath] = fileStories;
|
|
147
|
+
return fileStories;
|
|
142
148
|
}
|
|
143
149
|
|
|
144
150
|
async sortStories(storiesList) {
|
|
@@ -44,7 +44,7 @@ var defaultFavIcon = require.resolve('../public/favicon.ico');
|
|
|
44
44
|
|
|
45
45
|
async function useStatics(router, options) {
|
|
46
46
|
var hasCustomFavicon = false;
|
|
47
|
-
var staticDirs = await options.presets.apply('staticDirs'
|
|
47
|
+
var staticDirs = await options.presets.apply('staticDirs');
|
|
48
48
|
|
|
49
49
|
if (staticDirs && options.staticDir) {
|
|
50
50
|
throw new Error((0, _tsDedent.default)`
|
|
@@ -56,23 +56,25 @@ async function useStatics(router, options) {
|
|
|
56
56
|
`);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
if (staticDirs) {
|
|
60
|
+
staticDirs.forEach(async function (dir) {
|
|
61
|
+
var staticDirAndTarget = typeof dir === 'string' ? dir : `${dir.from}:${dir.to}`;
|
|
61
62
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
var _await$parseStaticDir = await parseStaticDir((0, _coreCommon.getDirectoryFromWorkingDir)({
|
|
64
|
+
configDir: options.configDir,
|
|
65
|
+
workingDir: process.cwd(),
|
|
66
|
+
directory: staticDirAndTarget
|
|
67
|
+
})),
|
|
68
|
+
from = _await$parseStaticDir.staticPath,
|
|
69
|
+
to = _await$parseStaticDir.targetEndpoint;
|
|
69
70
|
|
|
70
|
-
|
|
71
|
+
_nodeLogger.logger.info((0, _chalk.default)`=> Serving static files from {cyan ${from}} at {cyan ${to}}`);
|
|
71
72
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
router.use(to, _express.default.static(from, {
|
|
74
|
+
index: false
|
|
75
|
+
}));
|
|
76
|
+
});
|
|
77
|
+
}
|
|
76
78
|
|
|
77
79
|
if (options.staticDir && options.staticDir.length > 0) {
|
|
78
80
|
await Promise.all(options.staticDir.map(async function (dir) {
|
|
@@ -91,10 +91,10 @@ export class StoryIndexGenerator {
|
|
|
91
91
|
|
|
92
92
|
async extractStories(specifier, absolutePath) {
|
|
93
93
|
var relativePath = path.relative(this.options.workingDir, absolutePath);
|
|
94
|
+
var fileStories = {};
|
|
95
|
+
var entry = this.storyIndexEntries.get(specifier);
|
|
94
96
|
|
|
95
97
|
try {
|
|
96
|
-
var entry = this.storyIndexEntries.get(specifier);
|
|
97
|
-
var fileStories = {};
|
|
98
98
|
var importPath = slash(relativePath[0] === '.' ? relativePath : `./${relativePath}`);
|
|
99
99
|
var defaultTitle = autoTitleFromSpecifier(importPath, specifier);
|
|
100
100
|
var csf = (await readCsfOrMdx(absolutePath, {
|
|
@@ -111,12 +111,17 @@ export class StoryIndexGenerator {
|
|
|
111
111
|
importPath: importPath
|
|
112
112
|
};
|
|
113
113
|
});
|
|
114
|
-
entry[absolutePath] = fileStories;
|
|
115
|
-
return fileStories;
|
|
116
114
|
} catch (err) {
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
if (err.name === 'NoMetaError') {
|
|
116
|
+
logger.info(`💡 Skipping ${relativePath}: ${err}`);
|
|
117
|
+
} else {
|
|
118
|
+
logger.warn(`🚨 Extraction error on ${relativePath}: ${err}`);
|
|
119
|
+
throw err;
|
|
120
|
+
}
|
|
119
121
|
}
|
|
122
|
+
|
|
123
|
+
entry[absolutePath] = fileStories;
|
|
124
|
+
return fileStories;
|
|
120
125
|
}
|
|
121
126
|
|
|
122
127
|
async sortStories(storiesList) {
|
|
@@ -25,7 +25,7 @@ var defaultFavIcon = require.resolve('../public/favicon.ico');
|
|
|
25
25
|
|
|
26
26
|
export async function useStatics(router, options) {
|
|
27
27
|
var hasCustomFavicon = false;
|
|
28
|
-
var staticDirs = await options.presets.apply('staticDirs'
|
|
28
|
+
var staticDirs = await options.presets.apply('staticDirs');
|
|
29
29
|
|
|
30
30
|
if (staticDirs && options.staticDir) {
|
|
31
31
|
throw new Error(dedent`
|
|
@@ -37,22 +37,24 @@ export async function useStatics(router, options) {
|
|
|
37
37
|
`);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
40
|
+
if (staticDirs) {
|
|
41
|
+
staticDirs.forEach(async function (dir) {
|
|
42
|
+
var staticDirAndTarget = typeof dir === 'string' ? dir : `${dir.from}:${dir.to}`;
|
|
43
|
+
|
|
44
|
+
var _await$parseStaticDir = await parseStaticDir(getDirectoryFromWorkingDir({
|
|
45
|
+
configDir: options.configDir,
|
|
46
|
+
workingDir: process.cwd(),
|
|
47
|
+
directory: staticDirAndTarget
|
|
48
|
+
})),
|
|
49
|
+
from = _await$parseStaticDir.staticPath,
|
|
50
|
+
to = _await$parseStaticDir.targetEndpoint;
|
|
51
|
+
|
|
52
|
+
logger.info(chalk`=> Serving static files from {cyan ${from}} at {cyan ${to}}`);
|
|
53
|
+
router.use(to, express.static(from, {
|
|
54
|
+
index: false
|
|
55
|
+
}));
|
|
56
|
+
});
|
|
57
|
+
}
|
|
56
58
|
|
|
57
59
|
if (options.staticDir && options.staticDir.length > 0) {
|
|
58
60
|
await Promise.all(options.staticDir.map(async function (dir) {
|
|
@@ -91,10 +91,10 @@ export class StoryIndexGenerator {
|
|
|
91
91
|
|
|
92
92
|
async extractStories(specifier, absolutePath) {
|
|
93
93
|
var relativePath = path.relative(this.options.workingDir, absolutePath);
|
|
94
|
+
var fileStories = {};
|
|
95
|
+
var entry = this.storyIndexEntries.get(specifier);
|
|
94
96
|
|
|
95
97
|
try {
|
|
96
|
-
var entry = this.storyIndexEntries.get(specifier);
|
|
97
|
-
var fileStories = {};
|
|
98
98
|
var importPath = slash(relativePath[0] === '.' ? relativePath : `./${relativePath}`);
|
|
99
99
|
var defaultTitle = autoTitleFromSpecifier(importPath, specifier);
|
|
100
100
|
var csf = (await readCsfOrMdx(absolutePath, {
|
|
@@ -111,12 +111,17 @@ export class StoryIndexGenerator {
|
|
|
111
111
|
importPath: importPath
|
|
112
112
|
};
|
|
113
113
|
});
|
|
114
|
-
entry[absolutePath] = fileStories;
|
|
115
|
-
return fileStories;
|
|
116
114
|
} catch (err) {
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
if (err.name === 'NoMetaError') {
|
|
116
|
+
logger.info(`💡 Skipping ${relativePath}: ${err}`);
|
|
117
|
+
} else {
|
|
118
|
+
logger.warn(`🚨 Extraction error on ${relativePath}: ${err}`);
|
|
119
|
+
throw err;
|
|
120
|
+
}
|
|
119
121
|
}
|
|
122
|
+
|
|
123
|
+
entry[absolutePath] = fileStories;
|
|
124
|
+
return fileStories;
|
|
120
125
|
}
|
|
121
126
|
|
|
122
127
|
async sortStories(storiesList) {
|
|
@@ -25,7 +25,7 @@ var defaultFavIcon = require.resolve('../public/favicon.ico');
|
|
|
25
25
|
|
|
26
26
|
export async function useStatics(router, options) {
|
|
27
27
|
var hasCustomFavicon = false;
|
|
28
|
-
var staticDirs = await options.presets.apply('staticDirs'
|
|
28
|
+
var staticDirs = await options.presets.apply('staticDirs');
|
|
29
29
|
|
|
30
30
|
if (staticDirs && options.staticDir) {
|
|
31
31
|
throw new Error(dedent`
|
|
@@ -37,22 +37,24 @@ export async function useStatics(router, options) {
|
|
|
37
37
|
`);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
40
|
+
if (staticDirs) {
|
|
41
|
+
staticDirs.forEach(async function (dir) {
|
|
42
|
+
var staticDirAndTarget = typeof dir === 'string' ? dir : `${dir.from}:${dir.to}`;
|
|
43
|
+
|
|
44
|
+
var _await$parseStaticDir = await parseStaticDir(getDirectoryFromWorkingDir({
|
|
45
|
+
configDir: options.configDir,
|
|
46
|
+
workingDir: process.cwd(),
|
|
47
|
+
directory: staticDirAndTarget
|
|
48
|
+
})),
|
|
49
|
+
from = _await$parseStaticDir.staticPath,
|
|
50
|
+
to = _await$parseStaticDir.targetEndpoint;
|
|
51
|
+
|
|
52
|
+
logger.info(chalk`=> Serving static files from {cyan ${from}} at {cyan ${to}}`);
|
|
53
|
+
router.use(to, express.static(from, {
|
|
54
|
+
index: false
|
|
55
|
+
}));
|
|
56
|
+
});
|
|
57
|
+
}
|
|
56
58
|
|
|
57
59
|
if (options.staticDir && options.staticDir.length > 0) {
|
|
58
60
|
await Promise.all(options.staticDir.map(async function (dir) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const StoryOne: {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const StoryOne: {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/core-server",
|
|
3
|
-
"version": "6.4.0-beta.
|
|
3
|
+
"version": "6.4.0-beta.31",
|
|
4
4
|
"description": "Storybook framework-agnostic API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -41,16 +41,16 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@discoveryjs/json-ext": "^0.5.3",
|
|
44
|
-
"@storybook/builder-webpack4": "6.4.0-beta.
|
|
45
|
-
"@storybook/core-client": "6.4.0-beta.
|
|
46
|
-
"@storybook/core-common": "6.4.0-beta.
|
|
47
|
-
"@storybook/core-events": "6.4.0-beta.
|
|
44
|
+
"@storybook/builder-webpack4": "6.4.0-beta.31",
|
|
45
|
+
"@storybook/core-client": "6.4.0-beta.31",
|
|
46
|
+
"@storybook/core-common": "6.4.0-beta.31",
|
|
47
|
+
"@storybook/core-events": "6.4.0-beta.31",
|
|
48
48
|
"@storybook/csf": "0.0.2--canary.87bc651.0",
|
|
49
|
-
"@storybook/csf-tools": "6.4.0-beta.
|
|
50
|
-
"@storybook/manager-webpack4": "6.4.0-beta.
|
|
51
|
-
"@storybook/node-logger": "6.4.0-beta.
|
|
49
|
+
"@storybook/csf-tools": "6.4.0-beta.31",
|
|
50
|
+
"@storybook/manager-webpack4": "6.4.0-beta.31",
|
|
51
|
+
"@storybook/node-logger": "6.4.0-beta.31",
|
|
52
52
|
"@storybook/semver": "^7.3.2",
|
|
53
|
-
"@storybook/store": "6.4.0-beta.
|
|
53
|
+
"@storybook/store": "6.4.0-beta.31",
|
|
54
54
|
"@types/node": "^14.0.10",
|
|
55
55
|
"@types/node-fetch": "^2.5.7",
|
|
56
56
|
"@types/pretty-hrtime": "^1.0.0",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"ws": "^8.2.3"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
|
-
"@storybook/builder-webpack5": "6.4.0-beta.
|
|
87
|
+
"@storybook/builder-webpack5": "6.4.0-beta.31",
|
|
88
88
|
"@types/compression": "^1.7.0",
|
|
89
89
|
"@types/ip": "^1.1.0",
|
|
90
90
|
"@types/serve-favicon": "^2.5.2",
|
|
@@ -92,8 +92,8 @@
|
|
|
92
92
|
"jest-specific-snapshot": "^4.0.0"
|
|
93
93
|
},
|
|
94
94
|
"peerDependencies": {
|
|
95
|
-
"@storybook/builder-webpack5": "6.4.0-beta.
|
|
96
|
-
"@storybook/manager-webpack5": "6.4.0-beta.
|
|
95
|
+
"@storybook/builder-webpack5": "6.4.0-beta.31",
|
|
96
|
+
"@storybook/manager-webpack5": "6.4.0-beta.31",
|
|
97
97
|
"react": "^16.8.0 || ^17.0.0",
|
|
98
98
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
99
99
|
},
|
|
@@ -111,6 +111,6 @@
|
|
|
111
111
|
"publishConfig": {
|
|
112
112
|
"access": "public"
|
|
113
113
|
},
|
|
114
|
-
"gitHead": "
|
|
114
|
+
"gitHead": "17ef07b50965ad82f3c6a5f7442211bb8f140267",
|
|
115
115
|
"sbmodern": "dist/modern/index.js"
|
|
116
116
|
}
|