@cypress/webpack-dev-server 1.7.0 → 1.8.2
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/CHANGELOG.md +22 -0
- package/README.md +1 -1
- package/dist/index.js +3 -2
- package/dist/loader.d.ts +2 -1
- package/dist/loader.js +5 -1
- package/dist/makeWebpackConfig.js +9 -2
- package/dist/plugin.js +1 -1
- package/dist/startServer.js +4 -4
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
# [@cypress/webpack-dev-server-v1.8.2](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.8.1...@cypress/webpack-dev-server-v1.8.2) (2022-03-03)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* avoid nextjs unsafeCache and watchOptions ([#20440](https://github.com/cypress-io/cypress/issues/20440)) ([9f60901](https://github.com/cypress-io/cypress/commit/9f6090170b0675d25b26b98cd0f987a5e395ab78))
|
|
7
|
+
* error regression - strip ansi colors out of cy.fixture() error message ([#20335](https://github.com/cypress-io/cypress/issues/20335)) ([e0bd6ac](https://github.com/cypress-io/cypress/commit/e0bd6ac2aaf8d00b9233fffefed8f6ed2484bf45))
|
|
8
|
+
|
|
9
|
+
# [@cypress/webpack-dev-server-v1.8.1](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.8.0...@cypress/webpack-dev-server-v1.8.1) (2022-02-08)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* detect newly added specs in dev-server compilation ([#17950](https://github.com/cypress-io/cypress/issues/17950)) ([f9ce67c](https://github.com/cypress-io/cypress/commit/f9ce67cfb6fed74a3549e7aff7ce0a5b217d9a13))
|
|
15
|
+
|
|
16
|
+
# [@cypress/webpack-dev-server-v1.8.0](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.7.0...@cypress/webpack-dev-server-v1.8.0) (2021-12-16)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* use hoisted yarn install in binary build ([#17285](https://github.com/cypress-io/cypress/issues/17285)) ([e4f5b10](https://github.com/cypress-io/cypress/commit/e4f5b106d49d6ac0857c5fdac886f83b99558c88))
|
|
22
|
+
|
|
1
23
|
# [@cypress/webpack-dev-server-v1.7.0](https://github.com/cypress-io/cypress/compare/@cypress/webpack-dev-server-v1.6.0...@cypress/webpack-dev-server-v1.7.0) (2021-10-15)
|
|
2
24
|
|
|
3
25
|
|
package/README.md
CHANGED
|
@@ -46,7 +46,7 @@ by calling an event `devServerEvents.emit('dev-server:compile:success')`
|
|
|
46
46
|
|
|
47
47
|
## Webpack
|
|
48
48
|
|
|
49
|
-
Webpack-dev-server fulfills his
|
|
49
|
+
Webpack-dev-server fulfills his responsibilities by
|
|
50
50
|
|
|
51
51
|
- Making a `webpack.config` from the users setup by changing the entrypoint to `browser.ts`
|
|
52
52
|
- Launches the webpack dev server with `devServer.publicPath = "__cypress/src/"` and `devServer.hot = false`
|
package/dist/index.js
CHANGED
|
@@ -13,12 +13,13 @@ exports.defineDevServerConfig = exports.devServer = exports.startDevServer = voi
|
|
|
13
13
|
const debug_1 = require("debug");
|
|
14
14
|
const startServer_1 = require("./startServer");
|
|
15
15
|
const webpackDevServerFacts_1 = require("./webpackDevServerFacts");
|
|
16
|
-
const debug = debug_1.debug('cypress:webpack-dev-server:webpack');
|
|
16
|
+
const debug = (0, debug_1.debug)('cypress:webpack-dev-server:webpack');
|
|
17
17
|
function startDevServer(startDevServerArgs, exitProcess = process.exit) {
|
|
18
18
|
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
-
const webpackDevServer = yield startServer_1.start(startDevServerArgs, exitProcess);
|
|
19
|
+
const webpackDevServer = yield (0, startServer_1.start)(startDevServerArgs, exitProcess);
|
|
20
20
|
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
21
21
|
if (webpackDevServerFacts_1.webpackDevServerFacts.isV3()) {
|
|
22
|
+
// @ts-ignore
|
|
22
23
|
const server = webpackDevServer.listen(0, '127.0.0.1', () => {
|
|
23
24
|
// FIXME: handle address returning a string
|
|
24
25
|
const port = server.address().port;
|
package/dist/loader.d.ts
CHANGED
package/dist/loader.js
CHANGED
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
27
|
const debug_1 = __importDefault(require("debug"));
|
|
28
28
|
const path = __importStar(require("path"));
|
|
29
|
-
const debug = debug_1.default('cypress:webpack-dev-server:webpack');
|
|
29
|
+
const debug = (0, debug_1.default)('cypress:webpack-dev-server:webpack');
|
|
30
30
|
/**
|
|
31
31
|
* @param {ComponentSpec} file spec to create import string from.
|
|
32
32
|
* @param {string} filename name of the spec file - this is the same as file.name
|
|
@@ -67,6 +67,10 @@ function buildSpecs(projectRoot, files = []) {
|
|
|
67
67
|
}
|
|
68
68
|
// Runs the tests inside the iframe
|
|
69
69
|
function loader() {
|
|
70
|
+
// In Webpack 5, a spec added after the dev-server is created won't
|
|
71
|
+
// be included in the compilation. Disabling the caching of this loader ensures
|
|
72
|
+
// we regenerate our specs and include any new ones in the compilation.
|
|
73
|
+
this.cacheable(false);
|
|
70
74
|
const { files, projectRoot, supportFile } = this._cypress;
|
|
71
75
|
const supportFileAbsolutePath = supportFile ? JSON.stringify(path.resolve(projectRoot, supportFile)) : undefined;
|
|
72
76
|
return `
|
|
@@ -37,11 +37,12 @@ const path = __importStar(require("path"));
|
|
|
37
37
|
const webpack_merge_1 = require("webpack-merge");
|
|
38
38
|
const webpack_config_1 = __importDefault(require("./webpack.config"));
|
|
39
39
|
const plugin_1 = __importDefault(require("./plugin"));
|
|
40
|
-
const debug = debug_1.debug('cypress:webpack-dev-server:makeWebpackConfig');
|
|
40
|
+
const debug = (0, debug_1.debug)('cypress:webpack-dev-server:makeWebpackConfig');
|
|
41
41
|
const removeList = ['HtmlWebpackPlugin', 'PreloadPlugin', 'HtmlPwaPlugin'];
|
|
42
42
|
const OsSeparatorRE = RegExp(`\\${path.sep}`, 'g');
|
|
43
43
|
const posixSeparator = '/';
|
|
44
44
|
function makeWebpackConfig(userWebpackConfig, options) {
|
|
45
|
+
var _a;
|
|
45
46
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
47
|
const { projectRoot, devServerPublicPathRoute, files, supportFile, devServerEvents, template } = options;
|
|
47
48
|
debug(`User passed in webpack config with values %o`, userWebpackConfig);
|
|
@@ -86,7 +87,13 @@ function makeWebpackConfig(userWebpackConfig, options) {
|
|
|
86
87
|
return true;
|
|
87
88
|
});
|
|
88
89
|
}
|
|
89
|
-
|
|
90
|
+
if (typeof ((_a = userWebpackConfig === null || userWebpackConfig === void 0 ? void 0 : userWebpackConfig.module) === null || _a === void 0 ? void 0 : _a.unsafeCache) === 'function') {
|
|
91
|
+
const originalCachePredicate = userWebpackConfig.module.unsafeCache;
|
|
92
|
+
userWebpackConfig.module.unsafeCache = (module) => {
|
|
93
|
+
return originalCachePredicate(module) && !/[\\/]webpack-dev-server[\\/]dist[\\/]browser\.js/.test(module.resource);
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
const mergedConfig = (0, webpack_merge_1.merge)(userWebpackConfig, (0, webpack_config_1.default)(template), dynamicWebpackConfig);
|
|
90
97
|
mergedConfig.entry = entry;
|
|
91
98
|
debug('Merged webpack config %o', mergedConfig);
|
|
92
99
|
if (process.env.WEBPACK_PERF_MEASURE) {
|
package/dist/plugin.js
CHANGED
|
@@ -35,7 +35,7 @@ class CypressCTOptionsPlugin {
|
|
|
35
35
|
if (!errors || !errors.length) {
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
|
-
this.devServerEvents.emit('dev-server:compile:error', exports.normalizeError(errors[0]));
|
|
38
|
+
this.devServerEvents.emit('dev-server:compile:error', (0, exports.normalizeError)(errors[0]));
|
|
39
39
|
}
|
|
40
40
|
else if (this.errorEmitted) {
|
|
41
41
|
// compilation succeed but assets haven't emitted to the output yet
|
package/dist/startServer.js
CHANGED
|
@@ -29,7 +29,7 @@ const webpack_1 = __importDefault(require("webpack"));
|
|
|
29
29
|
const webpack_dev_server_1 = __importDefault(require("webpack-dev-server"));
|
|
30
30
|
const makeWebpackConfig_1 = require("./makeWebpackConfig");
|
|
31
31
|
const webpackDevServerFacts_1 = require("./webpackDevServerFacts");
|
|
32
|
-
const debug = debug_1.default('cypress:webpack-dev-server:start');
|
|
32
|
+
const debug = (0, debug_1.default)('cypress:webpack-dev-server:start');
|
|
33
33
|
function start(_a, exitProcess = process.exit) {
|
|
34
34
|
var { webpackConfig: userWebpackConfig, template, options } = _a, userOptions = __rest(_a, ["webpackConfig", "template", "options"]);
|
|
35
35
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -37,11 +37,11 @@ function start(_a, exitProcess = process.exit) {
|
|
|
37
37
|
debug('User did not pass in any webpack configuration');
|
|
38
38
|
}
|
|
39
39
|
const { projectRoot, devServerPublicPathRoute, isTextTerminal } = options.config;
|
|
40
|
-
const webpackConfig = yield makeWebpackConfig_1.makeWebpackConfig(userWebpackConfig || {}, Object.assign({ files: options.specs, template,
|
|
40
|
+
const webpackConfig = yield (0, makeWebpackConfig_1.makeWebpackConfig)(userWebpackConfig || {}, Object.assign({ files: options.specs, template,
|
|
41
41
|
projectRoot,
|
|
42
42
|
devServerPublicPathRoute, devServerEvents: options.devServerEvents, supportFile: options.config.supportFile, isOpenMode: !isTextTerminal }, userOptions));
|
|
43
43
|
debug('compiling webpack');
|
|
44
|
-
const compiler = webpack_1.default(webpackConfig);
|
|
44
|
+
const compiler = (0, webpack_1.default)(webpackConfig);
|
|
45
45
|
// When compiling in run mode
|
|
46
46
|
// Stop the clock early, no need to run all the tests on a failed build
|
|
47
47
|
if (isTextTerminal) {
|
|
@@ -66,7 +66,7 @@ function start(_a, exitProcess = process.exit) {
|
|
|
66
66
|
webpackDevServerConfig = Object.assign(Object.assign({ host: 'localhost', port: 'auto' }, userWebpackConfig === null || userWebpackConfig === void 0 ? void 0 : userWebpackConfig.devServer), { devMiddleware: {
|
|
67
67
|
publicPath: devServerPublicPathRoute,
|
|
68
68
|
}, hot: false });
|
|
69
|
-
// @ts-
|
|
69
|
+
// @ts-ignore Webpack types are clashing between Webpack and WebpackDevServer
|
|
70
70
|
return new webpack_dev_server_1.default(webpackDevServerConfig, compiler);
|
|
71
71
|
}
|
|
72
72
|
throw webpackDevServerFacts_1.webpackDevServerFacts.unsupported();
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cypress/webpack-dev-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.2",
|
|
4
4
|
"description": "Launches Webpack Dev Server for Component Testing",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsc",
|
|
8
8
|
"build-prod": "tsc",
|
|
9
|
-
"test": "node ./test-
|
|
9
|
+
"test": "node ./test-deps.js",
|
|
10
10
|
"test-all": "tsc && mocha -r @packages/ts/register test/**/*.spec.ts test/*.spec.ts --exit",
|
|
11
11
|
"watch": "tsc -w"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"debug": "4.3.2",
|
|
14
|
+
"debug": "^4.3.2",
|
|
15
15
|
"semver": "^7.3.4",
|
|
16
16
|
"webpack-merge": "^5.4.0"
|
|
17
17
|
},
|