@storybook/builder-webpack5 6.3.0 → 6.3.4

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/index.js CHANGED
@@ -88,7 +88,7 @@ var start = async function ({
88
88
  hasErrors: function () {
89
89
  return true;
90
90
  },
91
- hasWarngins: function () {
91
+ hasWarnings: function () {
92
92
  return false;
93
93
  },
94
94
  toJson: function () {
@@ -168,7 +168,8 @@ var build = async function ({
168
168
 
169
169
  var config = await getConfig(options);
170
170
  return new Promise(function (succeed, fail) {
171
- webpackInstance(config).run(function (error, stats) {
171
+ var compiler = webpackInstance(config);
172
+ compiler.run(function (error, stats) {
172
173
  if (error || !stats || stats.hasErrors()) {
173
174
  _nodeLogger.logger.error('=> Failed to build the preview');
174
175
 
@@ -177,7 +178,10 @@ var build = async function ({
177
178
  if (error) {
178
179
  _nodeLogger.logger.error(error.message);
179
180
 
180
- return fail(error);
181
+ compiler.close(function () {
182
+ return fail(error);
183
+ });
184
+ return;
181
185
  }
182
186
 
183
187
  if (stats && (stats.hasErrors() || stats.hasWarnings())) {
@@ -196,7 +200,10 @@ var build = async function ({
196
200
  warnings.forEach(function (e) {
197
201
  return _nodeLogger.logger.error(e.message);
198
202
  });
199
- return fail(stats);
203
+ compiler.close(function () {
204
+ return fail(stats);
205
+ });
206
+ return;
200
207
  }
201
208
  }
202
209
 
@@ -211,9 +218,17 @@ var build = async function ({
211
218
  }).warnings.forEach(function (e) {
212
219
  return _nodeLogger.logger.warn(e.message);
213
220
  });
214
- }
221
+ } // https://webpack.js.org/api/node/#run
222
+ // #15227
223
+
215
224
 
216
- return succeed(stats);
225
+ compiler.close(function (closeErr) {
226
+ if (closeErr) {
227
+ return fail(closeErr);
228
+ }
229
+
230
+ return succeed(stats);
231
+ });
217
232
  });
218
233
  });
219
234
  };
@@ -62,7 +62,8 @@ var _default = async function _default({
62
62
  frameworkPath: frameworkPath,
63
63
  presets: presets,
64
64
  typescriptOptions: typescriptOptions,
65
- modern: modern
65
+ modern: modern,
66
+ features: features
66
67
  }) {
67
68
  var envs = await presets.apply('env');
68
69
  var logLevel = await presets.apply('logLevel', undefined);
@@ -131,7 +132,6 @@ var _default = async function _default({
131
132
  logging: 'error'
132
133
  },
133
134
  watchOptions: {
134
- aggregateTimeout: 10,
135
135
  ignored: /node_modules/
136
136
  },
137
137
  ignoreWarnings: [{
@@ -151,7 +151,8 @@ var _default = async function _default({
151
151
  version: packageJson.version,
152
152
  globals: {
153
153
  LOGLEVEL: logLevel,
154
- FRAMEWORK_OPTIONS: frameworkOptions
154
+ FRAMEWORK_OPTIONS: frameworkOptions,
155
+ FEATURES: features
155
156
  },
156
157
  headHtmlSnippet: headHtmlSnippet,
157
158
  bodyHtmlSnippet: bodyHtmlSnippet
@@ -169,9 +170,9 @@ var _default = async function _default({
169
170
  }), new _webpack.DefinePlugin({
170
171
  'process.env': (0, _coreCommon.stringifyEnvs)(envs),
171
172
  NODE_ENV: JSON.stringify(process.env.NODE_ENV)
172
- }), isProd ? null : new _WatchMissingNodeModulesPlugin.default(_coreCommon.nodeModulesPaths), isProd ? null : new _webpack.HotModuleReplacementPlugin(), new _caseSensitivePathsWebpackPlugin.default(), quiet ? null : new _webpack.ProgressPlugin({}), new _dotenvWebpack.default({
173
+ }), isProd ? null : new _WatchMissingNodeModulesPlugin.default(_coreCommon.nodeModulesPaths), isProd ? null : new _webpack.HotModuleReplacementPlugin(), new _caseSensitivePathsWebpackPlugin.default(), quiet ? null : new _webpack.ProgressPlugin({}), (0, _coreCommon.hasDotenv)() ? new _dotenvWebpack.default({
173
174
  silent: true
174
- }), shouldCheckTs ? new _forkTsCheckerWebpackPlugin.default(tsCheckOptions) : null].filter(Boolean),
175
+ }) : null, shouldCheckTs ? new _forkTsCheckerWebpackPlugin.default(tsCheckOptions) : null].filter(Boolean),
175
176
  module: {
176
177
  rules: [babelLoader, (0, _coreCommon.es6Transpiler)(), {
177
178
  test: /\.md$/,
package/dist/esm/index.js CHANGED
@@ -62,7 +62,7 @@ export var start = async function ({
62
62
  hasErrors: function () {
63
63
  return true;
64
64
  },
65
- hasWarngins: function () {
65
+ hasWarnings: function () {
66
66
  return false;
67
67
  },
68
68
  toJson: function () {
@@ -133,14 +133,18 @@ export var build = async function ({
133
133
  logger.info('=> Compiling preview..');
134
134
  var config = await getConfig(options);
135
135
  return new Promise(function (succeed, fail) {
136
- webpackInstance(config).run(function (error, stats) {
136
+ var compiler = webpackInstance(config);
137
+ compiler.run(function (error, stats) {
137
138
  if (error || !stats || stats.hasErrors()) {
138
139
  logger.error('=> Failed to build the preview');
139
140
  process.exitCode = 1;
140
141
 
141
142
  if (error) {
142
143
  logger.error(error.message);
143
- return fail(error);
144
+ compiler.close(function () {
145
+ return fail(error);
146
+ });
147
+ return;
144
148
  }
145
149
 
146
150
  if (stats && (stats.hasErrors() || stats.hasWarnings())) {
@@ -159,7 +163,10 @@ export var build = async function ({
159
163
  warnings.forEach(function (e) {
160
164
  return logger.error(e.message);
161
165
  });
162
- return fail(stats);
166
+ compiler.close(function () {
167
+ return fail(stats);
168
+ });
169
+ return;
163
170
  }
164
171
  }
165
172
 
@@ -174,9 +181,17 @@ export var build = async function ({
174
181
  }).warnings.forEach(function (e) {
175
182
  return logger.warn(e.message);
176
183
  });
177
- }
184
+ } // https://webpack.js.org/api/node/#run
185
+ // #15227
186
+
178
187
 
179
- return succeed(stats);
188
+ compiler.close(function (closeErr) {
189
+ if (closeErr) {
190
+ return fail(closeErr);
191
+ }
192
+
193
+ return succeed(stats);
194
+ });
180
195
  });
181
196
  });
182
197
  };
@@ -17,7 +17,7 @@ import TerserWebpackPlugin from 'terser-webpack-plugin';
17
17
  import VirtualModulePlugin from 'webpack-virtual-modules';
18
18
  import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
19
19
  import themingPaths from '@storybook/theming/paths';
20
- import { toRequireContextString, es6Transpiler, stringifyEnvs, nodeModulesPaths, interpolate } from '@storybook/core-common';
20
+ import { toRequireContextString, es6Transpiler, stringifyEnvs, nodeModulesPaths, interpolate, hasDotenv } from '@storybook/core-common';
21
21
  import { createBabelLoader } from './babel-loader-preview';
22
22
  import { useBaseTsSupport } from './useBaseTsSupport';
23
23
  var storybookPaths = ['addons', 'api', 'channels', 'channel-postmessage', 'components', 'core-events', 'router', 'theming', 'semver', 'client-api', 'client-logger'].reduce(function (acc, sbPackage) {
@@ -38,7 +38,8 @@ export default (async function ({
38
38
  frameworkPath: frameworkPath,
39
39
  presets: presets,
40
40
  typescriptOptions: typescriptOptions,
41
- modern: modern
41
+ modern: modern,
42
+ features: features
42
43
  }) {
43
44
  var envs = await presets.apply('env');
44
45
  var logLevel = await presets.apply('logLevel', undefined);
@@ -104,7 +105,6 @@ export default (async function ({
104
105
  logging: 'error'
105
106
  },
106
107
  watchOptions: {
107
- aggregateTimeout: 10,
108
108
  ignored: /node_modules/
109
109
  },
110
110
  ignoreWarnings: [{
@@ -124,7 +124,8 @@ export default (async function ({
124
124
  version: packageJson.version,
125
125
  globals: {
126
126
  LOGLEVEL: logLevel,
127
- FRAMEWORK_OPTIONS: frameworkOptions
127
+ FRAMEWORK_OPTIONS: frameworkOptions,
128
+ FEATURES: features
128
129
  },
129
130
  headHtmlSnippet: headHtmlSnippet,
130
131
  bodyHtmlSnippet: bodyHtmlSnippet
@@ -142,9 +143,9 @@ export default (async function ({
142
143
  }), new DefinePlugin({
143
144
  'process.env': stringifyEnvs(envs),
144
145
  NODE_ENV: JSON.stringify(process.env.NODE_ENV)
145
- }), isProd ? null : new WatchMissingNodeModulesPlugin(nodeModulesPaths), isProd ? null : new HotModuleReplacementPlugin(), new CaseSensitivePathsPlugin(), quiet ? null : new ProgressPlugin({}), new Dotenv({
146
+ }), isProd ? null : new WatchMissingNodeModulesPlugin(nodeModulesPaths), isProd ? null : new HotModuleReplacementPlugin(), new CaseSensitivePathsPlugin(), quiet ? null : new ProgressPlugin({}), hasDotenv() ? new Dotenv({
146
147
  silent: true
147
- }), shouldCheckTs ? new ForkTsCheckerWebpackPlugin(tsCheckOptions) : null].filter(Boolean),
148
+ }) : null, shouldCheckTs ? new ForkTsCheckerWebpackPlugin(tsCheckOptions) : null].filter(Boolean),
148
149
  module: {
149
150
  rules: [babelLoader, es6Transpiler(), {
150
151
  test: /\.md$/,
@@ -62,7 +62,7 @@ export var start = async function ({
62
62
  hasErrors: function () {
63
63
  return true;
64
64
  },
65
- hasWarngins: function () {
65
+ hasWarnings: function () {
66
66
  return false;
67
67
  },
68
68
  toJson: function () {
@@ -133,14 +133,18 @@ export var build = async function ({
133
133
  logger.info('=> Compiling preview..');
134
134
  var config = await getConfig(options);
135
135
  return new Promise(function (succeed, fail) {
136
- webpackInstance(config).run(function (error, stats) {
136
+ var compiler = webpackInstance(config);
137
+ compiler.run(function (error, stats) {
137
138
  if (error || !stats || stats.hasErrors()) {
138
139
  logger.error('=> Failed to build the preview');
139
140
  process.exitCode = 1;
140
141
 
141
142
  if (error) {
142
143
  logger.error(error.message);
143
- return fail(error);
144
+ compiler.close(function () {
145
+ return fail(error);
146
+ });
147
+ return;
144
148
  }
145
149
 
146
150
  if (stats && (stats.hasErrors() || stats.hasWarnings())) {
@@ -159,7 +163,10 @@ export var build = async function ({
159
163
  warnings.forEach(function (e) {
160
164
  return logger.error(e.message);
161
165
  });
162
- return fail(stats);
166
+ compiler.close(function () {
167
+ return fail(stats);
168
+ });
169
+ return;
163
170
  }
164
171
  }
165
172
 
@@ -174,9 +181,17 @@ export var build = async function ({
174
181
  }).warnings.forEach(function (e) {
175
182
  return logger.warn(e.message);
176
183
  });
177
- }
184
+ } // https://webpack.js.org/api/node/#run
185
+ // #15227
186
+
178
187
 
179
- return succeed(stats);
188
+ compiler.close(function (closeErr) {
189
+ if (closeErr) {
190
+ return fail(closeErr);
191
+ }
192
+
193
+ return succeed(stats);
194
+ });
180
195
  });
181
196
  });
182
197
  };
@@ -17,7 +17,7 @@ import TerserWebpackPlugin from 'terser-webpack-plugin';
17
17
  import VirtualModulePlugin from 'webpack-virtual-modules';
18
18
  import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
19
19
  import themingPaths from '@storybook/theming/paths';
20
- import { toRequireContextString, es6Transpiler, stringifyEnvs, nodeModulesPaths, interpolate } from '@storybook/core-common';
20
+ import { toRequireContextString, es6Transpiler, stringifyEnvs, nodeModulesPaths, interpolate, hasDotenv } from '@storybook/core-common';
21
21
  import { createBabelLoader } from './babel-loader-preview';
22
22
  import { useBaseTsSupport } from './useBaseTsSupport';
23
23
  var storybookPaths = ['addons', 'api', 'channels', 'channel-postmessage', 'components', 'core-events', 'router', 'theming', 'semver', 'client-api', 'client-logger'].reduce(function (acc, sbPackage) {
@@ -38,7 +38,8 @@ export default (async function ({
38
38
  frameworkPath: frameworkPath,
39
39
  presets: presets,
40
40
  typescriptOptions: typescriptOptions,
41
- modern: modern
41
+ modern: modern,
42
+ features: features
42
43
  }) {
43
44
  var envs = await presets.apply('env');
44
45
  var logLevel = await presets.apply('logLevel', undefined);
@@ -104,7 +105,6 @@ export default (async function ({
104
105
  logging: 'error'
105
106
  },
106
107
  watchOptions: {
107
- aggregateTimeout: 10,
108
108
  ignored: /node_modules/
109
109
  },
110
110
  ignoreWarnings: [{
@@ -124,7 +124,8 @@ export default (async function ({
124
124
  version: packageJson.version,
125
125
  globals: {
126
126
  LOGLEVEL: logLevel,
127
- FRAMEWORK_OPTIONS: frameworkOptions
127
+ FRAMEWORK_OPTIONS: frameworkOptions,
128
+ FEATURES: features
128
129
  },
129
130
  headHtmlSnippet: headHtmlSnippet,
130
131
  bodyHtmlSnippet: bodyHtmlSnippet
@@ -142,9 +143,9 @@ export default (async function ({
142
143
  }), new DefinePlugin({
143
144
  'process.env': stringifyEnvs(envs),
144
145
  NODE_ENV: JSON.stringify(process.env.NODE_ENV)
145
- }), isProd ? null : new WatchMissingNodeModulesPlugin(nodeModulesPaths), isProd ? null : new HotModuleReplacementPlugin(), new CaseSensitivePathsPlugin(), quiet ? null : new ProgressPlugin({}), new Dotenv({
146
+ }), isProd ? null : new WatchMissingNodeModulesPlugin(nodeModulesPaths), isProd ? null : new HotModuleReplacementPlugin(), new CaseSensitivePathsPlugin(), quiet ? null : new ProgressPlugin({}), hasDotenv() ? new Dotenv({
146
147
  silent: true
147
- }), shouldCheckTs ? new ForkTsCheckerWebpackPlugin(tsCheckOptions) : null].filter(Boolean),
148
+ }) : null, shouldCheckTs ? new ForkTsCheckerWebpackPlugin(tsCheckOptions) : null].filter(Boolean),
148
149
  module: {
149
150
  rules: [babelLoader, es6Transpiler(), {
150
151
  test: /\.md$/,
@@ -1,4 +1,4 @@
1
1
  import { Configuration } from 'webpack';
2
2
  import { Options } from '@storybook/core-common';
3
- declare const _default: ({ configDir, babelOptions, entries, stories, outputDir, quiet, packageJson, configType, framework, frameworkPath, presets, typescriptOptions, modern, }: Options & Record<string, any>) => Promise<Configuration>;
3
+ declare const _default: ({ configDir, babelOptions, entries, stories, outputDir, quiet, packageJson, configType, framework, frameworkPath, presets, typescriptOptions, modern, features, }: Options & Record<string, any>) => Promise<Configuration>;
4
4
  export default _default;
@@ -1,4 +1,4 @@
1
1
  import { Configuration } from 'webpack';
2
2
  import { Options } from '@storybook/core-common';
3
- declare const _default: ({ configDir, babelOptions, entries, stories, outputDir, quiet, packageJson, configType, framework, frameworkPath, presets, typescriptOptions, modern, }: Options & Record<string, any>) => Promise<Configuration>;
3
+ declare const _default: ({ configDir, babelOptions, entries, stories, outputDir, quiet, packageJson, configType, framework, frameworkPath, presets, typescriptOptions, modern, features, }: Options & Record<string, any>) => Promise<Configuration>;
4
4
  export default _default;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@storybook/builder-webpack5",
3
- "version": "6.3.0",
3
+ "version": "6.3.4",
4
4
  "description": "Storybook framework-agnostic API",
5
5
  "keywords": [
6
6
  "storybook"
7
7
  ],
8
- "homepage": "https://github.com/storybookjs/storybook/tree/master/lib/core",
8
+ "homepage": "https://github.com/storybookjs/storybook/tree/main/lib/core",
9
9
  "bugs": {
10
10
  "url": "https://github.com/storybookjs/storybook/issues"
11
11
  },
@@ -60,19 +60,19 @@
60
60
  "@babel/preset-env": "^7.12.11",
61
61
  "@babel/preset-react": "^7.12.10",
62
62
  "@babel/preset-typescript": "^7.12.7",
63
- "@storybook/addons": "6.3.0",
64
- "@storybook/api": "6.3.0",
65
- "@storybook/channel-postmessage": "6.3.0",
66
- "@storybook/channels": "6.3.0",
67
- "@storybook/client-api": "6.3.0",
68
- "@storybook/client-logger": "6.3.0",
69
- "@storybook/components": "6.3.0",
70
- "@storybook/core-common": "6.3.0",
71
- "@storybook/core-events": "6.3.0",
72
- "@storybook/node-logger": "6.3.0",
73
- "@storybook/router": "6.3.0",
63
+ "@storybook/addons": "6.3.4",
64
+ "@storybook/api": "6.3.4",
65
+ "@storybook/channel-postmessage": "6.3.4",
66
+ "@storybook/channels": "6.3.4",
67
+ "@storybook/client-api": "6.3.4",
68
+ "@storybook/client-logger": "6.3.4",
69
+ "@storybook/components": "6.3.4",
70
+ "@storybook/core-common": "6.3.4",
71
+ "@storybook/core-events": "6.3.4",
72
+ "@storybook/node-logger": "6.3.4",
73
+ "@storybook/router": "6.3.4",
74
74
  "@storybook/semver": "^7.3.2",
75
- "@storybook/theming": "6.3.0",
75
+ "@storybook/theming": "6.3.4",
76
76
  "@types/node": "^14.0.10",
77
77
  "babel-loader": "^8.2.2",
78
78
  "babel-plugin-macros": "^3.0.1",
@@ -80,7 +80,7 @@
80
80
  "case-sensitive-paths-webpack-plugin": "^2.3.0",
81
81
  "core-js": "^3.8.2",
82
82
  "css-loader": "^5.0.1",
83
- "dotenv-webpack": "^6.0.0",
83
+ "dotenv-webpack": "^7.0.0",
84
84
  "fork-ts-checker-webpack-plugin": "^6.0.4",
85
85
  "fs-extra": "^9.0.1",
86
86
  "glob": "^7.1.6",
@@ -118,6 +118,6 @@
118
118
  "publishConfig": {
119
119
  "access": "public"
120
120
  },
121
- "gitHead": "9a381339dee8faf13933265cf2600577ca2c20e8",
121
+ "gitHead": "b6fd5c62b15188baca1c1b9b8f71df6098a510ef",
122
122
  "sbmodern": "dist/modern/index.js"
123
123
  }