@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.
@@ -107,7 +107,8 @@ exports.typescript = typescript;
107
107
 
108
108
  var features = async function (existing) {
109
109
  return _objectSpread(_objectSpread({}, existing), {}, {
110
- postcss: true
110
+ postcss: true,
111
+ emotionAlias: true
111
112
  });
112
113
  };
113
114
 
@@ -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
- _nodeLogger.logger.warn(`🚨 Extraction error on ${relativePath}: ${err}`);
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
- throw err;
142
+ throw err;
143
+ }
141
144
  }
145
+
146
+ entry[absolutePath] = fileStories;
147
+ return fileStories;
142
148
  }
143
149
 
144
150
  async sortStories(storiesList) {
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StoryOne = void 0;
7
+ // no default export
8
+ // e.g. https://github.com/storybookjs/storybook/issues/16421
9
+ var StoryOne = {};
10
+ exports.StoryOne = StoryOne;
@@ -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
- staticDirs.forEach(async function (dir) {
60
- var staticDirAndTarget = typeof dir === 'string' ? dir : `${dir.from}:${dir.to}`;
59
+ if (staticDirs) {
60
+ staticDirs.forEach(async function (dir) {
61
+ var staticDirAndTarget = typeof dir === 'string' ? dir : `${dir.from}:${dir.to}`;
61
62
 
62
- var _await$parseStaticDir = await parseStaticDir((0, _coreCommon.getDirectoryFromWorkingDir)({
63
- configDir: options.configDir,
64
- workingDir: process.cwd(),
65
- directory: staticDirAndTarget
66
- })),
67
- from = _await$parseStaticDir.staticPath,
68
- to = _await$parseStaticDir.targetEndpoint;
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
- _nodeLogger.logger.info((0, _chalk.default)`=> Serving static files from {cyan ${from}} at {cyan ${to}}`);
71
+ _nodeLogger.logger.info((0, _chalk.default)`=> Serving static files from {cyan ${from}} at {cyan ${to}}`);
71
72
 
72
- router.use(to, _express.default.static(from, {
73
- index: false
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) {
@@ -71,6 +71,7 @@ export var typescript = function () {
71
71
  };
72
72
  export var features = async function (existing) {
73
73
  return _objectSpread(_objectSpread({}, existing), {}, {
74
- postcss: true
74
+ postcss: true,
75
+ emotionAlias: true
75
76
  });
76
77
  };
@@ -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
- logger.warn(`🚨 Extraction error on ${relativePath}: ${err}`);
118
- throw err;
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) {
@@ -0,0 +1,3 @@
1
+ // no default export
2
+ // e.g. https://github.com/storybookjs/storybook/issues/16421
3
+ export var StoryOne = {};
@@ -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
- staticDirs.forEach(async function (dir) {
41
- var staticDirAndTarget = typeof dir === 'string' ? dir : `${dir.from}:${dir.to}`;
42
-
43
- var _await$parseStaticDir = await parseStaticDir(getDirectoryFromWorkingDir({
44
- configDir: options.configDir,
45
- workingDir: process.cwd(),
46
- directory: staticDirAndTarget
47
- })),
48
- from = _await$parseStaticDir.staticPath,
49
- to = _await$parseStaticDir.targetEndpoint;
50
-
51
- logger.info(chalk`=> Serving static files from {cyan ${from}} at {cyan ${to}}`);
52
- router.use(to, express.static(from, {
53
- index: false
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) {
@@ -71,6 +71,7 @@ export var typescript = function () {
71
71
  };
72
72
  export var features = async function (existing) {
73
73
  return _objectSpread(_objectSpread({}, existing), {}, {
74
- postcss: true
74
+ postcss: true,
75
+ emotionAlias: true
75
76
  });
76
77
  };
@@ -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
- logger.warn(`🚨 Extraction error on ${relativePath}: ${err}`);
118
- throw err;
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) {
@@ -0,0 +1,3 @@
1
+ // no default export
2
+ // e.g. https://github.com/storybookjs/storybook/issues/16421
3
+ export var StoryOne = {};
@@ -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
- staticDirs.forEach(async function (dir) {
41
- var staticDirAndTarget = typeof dir === 'string' ? dir : `${dir.from}:${dir.to}`;
42
-
43
- var _await$parseStaticDir = await parseStaticDir(getDirectoryFromWorkingDir({
44
- configDir: options.configDir,
45
- workingDir: process.cwd(),
46
- directory: staticDirAndTarget
47
- })),
48
- from = _await$parseStaticDir.staticPath,
49
- to = _await$parseStaticDir.targetEndpoint;
50
-
51
- logger.info(chalk`=> Serving static files from {cyan ${from}} at {cyan ${to}}`);
52
- router.use(to, express.static(from, {
53
- index: false
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) {
@@ -21,4 +21,5 @@ export declare const typescript: () => {
21
21
  };
22
22
  export declare const features: (existing: Record<string, boolean>) => Promise<{
23
23
  postcss: boolean;
24
+ emotionAlias: boolean;
24
25
  }>;
@@ -0,0 +1 @@
1
+ export declare const StoryOne: {};
@@ -21,4 +21,5 @@ export declare const typescript: () => {
21
21
  };
22
22
  export declare const features: (existing: Record<string, boolean>) => Promise<{
23
23
  postcss: boolean;
24
+ emotionAlias: boolean;
24
25
  }>;
@@ -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.28",
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.28",
45
- "@storybook/core-client": "6.4.0-beta.28",
46
- "@storybook/core-common": "6.4.0-beta.28",
47
- "@storybook/core-events": "6.4.0-beta.28",
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.28",
50
- "@storybook/manager-webpack4": "6.4.0-beta.28",
51
- "@storybook/node-logger": "6.4.0-beta.28",
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.28",
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.28",
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.28",
96
- "@storybook/manager-webpack5": "6.4.0-beta.28",
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": "72316abb8354d1f84d2bf8f645b18aeb315768c3",
114
+ "gitHead": "17ef07b50965ad82f3c6a5f7442211bb8f140267",
115
115
  "sbmodern": "dist/modern/index.js"
116
116
  }