@nx/web 16.8.0-beta.4 → 16.8.0-beta.6
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/package.json +5 -5
- package/src/executors/file-server/file-server.impl.js +77 -78
- package/src/generators/application/application.js +247 -228
- package/src/generators/init/init.js +35 -38
- package/src/generators/static-serve/static-serve-configuration.js +11 -8
- package/src/migrations/update-13-0-0/remove-deprecated-options-13-0-0.js +21 -25
- package/src/migrations/update-13-0-0/remove-node-sass-13-0-0.js +12 -15
- package/src/migrations/update-13-0-0/remove-webpack-5-packages-13-0-0.js +10 -14
- package/src/migrations/update-13-3-0/rename-build-to-webpack.js +9 -13
- package/src/migrations/update-13-3-0/rename-package-to-rollup.js +9 -13
- package/src/migrations/update-13-8-0/add-postcss-config-option.js +11 -15
- package/src/migrations/update-14-1-7/rollup-format-backwards-compatibility.js +13 -14
- package/src/migrations/update-14-7-6/update-webpack-executor.js +16 -20
- package/src/migrations/update-15-0-0/add-babel-inputs.js +3 -6
- package/src/migrations/update-15-0-0/update-rollup-executor.js +26 -30
- package/src/migrations/update-15-5-4/update-babel-preset.js +24 -28
- package/src/migrations/update-15-9-1/add-dropped-dependencies.js +24 -28
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +3 -6
- package/src/migrations/update-16-0-0-update-executors/update-16-0-0-update-executors.js +27 -31
- package/src/utils/wait-for-port-open.js +3 -6
|
@@ -1,33 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
3
|
const devkit_1 = require("@nx/devkit");
|
|
5
4
|
const deprecatedOptions = ['showCircularDependencies', 'budgets'];
|
|
6
|
-
function update(host) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
(0, devkit_1.updateProjectConfiguration)(host, name, config);
|
|
26
|
-
devkit_1.logger.info(`NX Removed legacy build option from "${name}": ${opt}`);
|
|
27
|
-
}
|
|
5
|
+
async function update(host) {
|
|
6
|
+
const projects = (0, devkit_1.getProjects)(host);
|
|
7
|
+
for (const [name, config] of projects.entries()) {
|
|
8
|
+
if (config.targets.build.executor !== '@nrwl/web:build')
|
|
9
|
+
return;
|
|
10
|
+
for (const opt of deprecatedOptions) {
|
|
11
|
+
let updated = false;
|
|
12
|
+
if (typeof config.targets.build?.configurations?.production?.[opt] !==
|
|
13
|
+
'undefined') {
|
|
14
|
+
delete config.targets.build.configurations.production[opt];
|
|
15
|
+
updated = true;
|
|
16
|
+
}
|
|
17
|
+
if (typeof config.targets.build.options[opt] !== 'undefined') {
|
|
18
|
+
delete config.targets.build.options[opt];
|
|
19
|
+
updated = true;
|
|
20
|
+
}
|
|
21
|
+
if (updated) {
|
|
22
|
+
(0, devkit_1.updateProjectConfiguration)(host, name, config);
|
|
23
|
+
devkit_1.logger.info(`NX Removed legacy build option from "${name}": ${opt}`);
|
|
28
24
|
}
|
|
29
25
|
}
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
}
|
|
27
|
+
await (0, devkit_1.formatFiles)(host);
|
|
32
28
|
}
|
|
33
29
|
exports.default = update;
|
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
3
|
const devkit_1 = require("@nx/devkit");
|
|
5
4
|
/**
|
|
6
5
|
* For web/react apps with style scss option, remove node-sass sine it is deprecated.
|
|
7
6
|
* We already include sass package in `@nrwl/web` deps so no need to install anything extra.
|
|
8
7
|
*/
|
|
9
|
-
function update(tree) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return task;
|
|
22
|
-
});
|
|
8
|
+
async function update(tree) {
|
|
9
|
+
const packageJson = (0, devkit_1.readJson)(tree, 'package.json');
|
|
10
|
+
let task = undefined;
|
|
11
|
+
if (packageJson.devDependencies['node-sass']) {
|
|
12
|
+
task = (0, devkit_1.removeDependenciesFromPackageJson)(tree, [], ['node-sass']);
|
|
13
|
+
}
|
|
14
|
+
if (packageJson.dependencies['node-sass']) {
|
|
15
|
+
task = (0, devkit_1.removeDependenciesFromPackageJson)(tree, ['node-sass'], []);
|
|
16
|
+
}
|
|
17
|
+
if (task)
|
|
18
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
19
|
+
return task;
|
|
23
20
|
}
|
|
24
21
|
exports.default = update;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
3
|
const devkit_1 = require("@nx/devkit");
|
|
5
4
|
const packages = [
|
|
6
5
|
'webpack',
|
|
@@ -15,18 +14,15 @@ const packages = [
|
|
|
15
14
|
'react-refresh',
|
|
16
15
|
'@pmmmwh/react-refresh-webpack-plugin',
|
|
17
16
|
];
|
|
18
|
-
function update(tree) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
return task;
|
|
30
|
-
});
|
|
17
|
+
async function update(tree) {
|
|
18
|
+
const packageJson = (0, devkit_1.readJson)(tree, 'package.json');
|
|
19
|
+
let task = undefined;
|
|
20
|
+
// Undo the install by `nx g @nrwl/web:webpack5` in Nx 12.
|
|
21
|
+
if (packageJson.devDependencies['webpack']?.match(/^([\^~])?5\./) &&
|
|
22
|
+
packages.every((p) => packageJson.devDependencies[p])) {
|
|
23
|
+
task = (0, devkit_1.removeDependenciesFromPackageJson)(tree, [], packages);
|
|
24
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
25
|
+
}
|
|
26
|
+
return task;
|
|
31
27
|
}
|
|
32
28
|
exports.default = update;
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
3
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
function update(host) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
yield (0, devkit_1.formatFiles)(host);
|
|
16
|
-
});
|
|
4
|
+
async function update(host) {
|
|
5
|
+
const projects = (0, devkit_1.getProjects)(host);
|
|
6
|
+
for (const [name, config] of projects.entries()) {
|
|
7
|
+
if (config?.targets?.build?.executor !== '@nrwl/web:build')
|
|
8
|
+
continue;
|
|
9
|
+
config.targets.build.executor = '@nrwl/web:webpack';
|
|
10
|
+
(0, devkit_1.updateProjectConfiguration)(host, name, config);
|
|
11
|
+
}
|
|
12
|
+
await (0, devkit_1.formatFiles)(host);
|
|
17
13
|
}
|
|
18
14
|
exports.default = update;
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
3
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
function update(host) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
yield (0, devkit_1.formatFiles)(host);
|
|
16
|
-
});
|
|
4
|
+
async function update(host) {
|
|
5
|
+
const projects = (0, devkit_1.getProjects)(host);
|
|
6
|
+
for (const [name, config] of projects.entries()) {
|
|
7
|
+
if (config?.targets?.build?.executor !== '@nrwl/web:package')
|
|
8
|
+
continue;
|
|
9
|
+
config.targets.build.executor = '@nrwl/web:rollup';
|
|
10
|
+
(0, devkit_1.updateProjectConfiguration)(host, name, config);
|
|
11
|
+
}
|
|
12
|
+
await (0, devkit_1.formatFiles)(host);
|
|
17
13
|
}
|
|
18
14
|
exports.default = update;
|
|
@@ -1,25 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
3
|
const devkit_1 = require("@nx/devkit");
|
|
5
4
|
/*
|
|
6
5
|
* This migration ensures that the previous behavior of applying the app postcss config
|
|
7
6
|
* is carried over to Nx 13.8.0.
|
|
8
7
|
*/
|
|
9
|
-
function update(host) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if (host.exists(configPath)) {
|
|
18
|
-
config.targets.build.options.postcssConfig = configPath;
|
|
19
|
-
}
|
|
20
|
-
(0, devkit_1.updateProjectConfiguration)(host, name, config);
|
|
8
|
+
async function update(host) {
|
|
9
|
+
const projects = (0, devkit_1.getProjects)(host);
|
|
10
|
+
for (const [name, config] of projects.entries()) {
|
|
11
|
+
if (config?.targets?.build?.executor !== '@nrwl/web:webpack')
|
|
12
|
+
continue;
|
|
13
|
+
const configPath = `${config.root}/postcss.config.js`;
|
|
14
|
+
if (host.exists(configPath)) {
|
|
15
|
+
config.targets.build.options.postcssConfig = configPath;
|
|
21
16
|
}
|
|
22
|
-
|
|
23
|
-
}
|
|
17
|
+
(0, devkit_1.updateProjectConfiguration)(host, name, config);
|
|
18
|
+
}
|
|
19
|
+
await (0, devkit_1.formatFiles)(host);
|
|
24
20
|
}
|
|
25
21
|
exports.default = update;
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
3
|
const devkit_1 = require("@nx/devkit");
|
|
5
4
|
/*
|
|
6
5
|
*
|
|
7
6
|
*/
|
|
8
|
-
function update(tree) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
async function update(tree) {
|
|
8
|
+
for (const [name, config] of (0, devkit_1.getProjects)(tree)) {
|
|
9
|
+
if (config.targets?.build?.executor !== '@nrwl/web:rollup')
|
|
10
|
+
continue;
|
|
11
|
+
if (Array.isArray(config.targets.build.options?.format))
|
|
12
|
+
continue;
|
|
13
|
+
config.targets.build.options = {
|
|
14
|
+
...config.targets.build.options,
|
|
15
|
+
format: ['esm', 'cjs'],
|
|
16
|
+
};
|
|
17
|
+
(0, devkit_1.updateProjectConfiguration)(tree, name, config);
|
|
18
|
+
}
|
|
19
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
21
20
|
}
|
|
22
21
|
exports.default = update;
|
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
3
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
function update(host) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
config.targets.build.executor = '@nrwl/webpack:webpack';
|
|
13
|
-
updated = true;
|
|
14
|
-
}
|
|
15
|
-
if (((_d = (_c = config === null || config === void 0 ? void 0 : config.targets) === null || _c === void 0 ? void 0 : _c.serve) === null || _d === void 0 ? void 0 : _d.executor) === '@nrwl/web:dev-server') {
|
|
16
|
-
config.targets.serve.executor = '@nrwl/webpack:dev-server';
|
|
17
|
-
updated = true;
|
|
18
|
-
}
|
|
19
|
-
if (updated) {
|
|
20
|
-
(0, devkit_1.updateProjectConfiguration)(host, name, config);
|
|
21
|
-
}
|
|
4
|
+
async function update(host) {
|
|
5
|
+
const projects = (0, devkit_1.getProjects)(host);
|
|
6
|
+
for (const [name, config] of projects.entries()) {
|
|
7
|
+
let updated = false;
|
|
8
|
+
if (config?.targets?.build?.executor === '@nrwl/web:webpack') {
|
|
9
|
+
config.targets.build.executor = '@nrwl/webpack:webpack';
|
|
10
|
+
updated = true;
|
|
22
11
|
}
|
|
23
|
-
|
|
24
|
-
|
|
12
|
+
if (config?.targets?.serve?.executor === '@nrwl/web:dev-server') {
|
|
13
|
+
config.targets.serve.executor = '@nrwl/webpack:dev-server';
|
|
14
|
+
updated = true;
|
|
15
|
+
}
|
|
16
|
+
if (updated) {
|
|
17
|
+
(0, devkit_1.updateProjectConfiguration)(host, name, config);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
await (0, devkit_1.formatFiles)(host);
|
|
25
21
|
}
|
|
26
22
|
exports.default = update;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
3
|
const devkit_1 = require("@nx/devkit");
|
|
5
4
|
const add_babel_inputs_1 = require("@nx/js/src/utils/add-babel-inputs");
|
|
6
|
-
function default_1(tree) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
yield (0, devkit_1.formatFiles)(tree);
|
|
10
|
-
});
|
|
5
|
+
async function default_1(tree) {
|
|
6
|
+
(0, add_babel_inputs_1.addBabelInputs)(tree);
|
|
7
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
11
8
|
}
|
|
12
9
|
exports.default = default_1;
|
|
@@ -1,37 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
3
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
function update(host) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (format === 'cjs') {
|
|
20
|
-
if (!acc.includes('cjs'))
|
|
21
|
-
acc.push(format);
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
4
|
+
async function update(host) {
|
|
5
|
+
const projects = (0, devkit_1.getProjects)(host);
|
|
6
|
+
for (const [name, config] of projects.entries()) {
|
|
7
|
+
let updated = false;
|
|
8
|
+
if (config?.targets?.build?.executor === '@nrwl/web:rollup') {
|
|
9
|
+
config.targets.build.executor = '@nrwl/rollup:rollup';
|
|
10
|
+
updated = true;
|
|
11
|
+
}
|
|
12
|
+
if (config?.targets?.build?.options?.formats?.includes('umd')) {
|
|
13
|
+
config.targets.build.options.formats =
|
|
14
|
+
config.targets.build.options.formats.reduce((acc, x) => {
|
|
15
|
+
const format = x === 'umd' ? 'cjs' : x;
|
|
16
|
+
if (format === 'cjs') {
|
|
17
|
+
if (!acc.includes('cjs'))
|
|
24
18
|
acc.push(format);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
acc.push(format);
|
|
22
|
+
}
|
|
23
|
+
return acc;
|
|
24
|
+
}, []);
|
|
25
|
+
updated = true;
|
|
26
|
+
}
|
|
27
|
+
if (updated) {
|
|
28
|
+
(0, devkit_1.updateProjectConfiguration)(host, name, config);
|
|
33
29
|
}
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
}
|
|
31
|
+
await (0, devkit_1.formatFiles)(host);
|
|
36
32
|
}
|
|
37
33
|
exports.default = update;
|
|
@@ -1,36 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
3
|
const devkit_1 = require("@nx/devkit");
|
|
5
4
|
const versions_1 = require("../../utils/versions");
|
|
6
5
|
/* Updates @nrwl/web/babel to @nrwl/js/babel because web package is no longer necessary to use webpack/rollup + babel. */
|
|
7
|
-
function update(tree) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
(0, devkit_1.writeJson)(tree, babelrcPath, babelrc);
|
|
33
|
-
});
|
|
6
|
+
async function update(tree) {
|
|
7
|
+
// Add `@nrwl/js` in case it was missing before.
|
|
8
|
+
(0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
9
|
+
'@nrwl/js': versions_1.nxVersion,
|
|
10
|
+
});
|
|
11
|
+
const projects = (0, devkit_1.getProjects)(tree);
|
|
12
|
+
projects.forEach((config, name) => {
|
|
13
|
+
const babelrcPath = (0, devkit_1.joinPathFragments)(config.root, '.babelrc');
|
|
14
|
+
if (!tree.exists(babelrcPath))
|
|
15
|
+
return;
|
|
16
|
+
const babelrc = (0, devkit_1.readJson)(tree, babelrcPath);
|
|
17
|
+
const idx = babelrc?.presets?.findIndex((p) => typeof p === 'string'
|
|
18
|
+
? p === '@nrwl/web/babel'
|
|
19
|
+
: p[0] === '@nrwl/web/babel');
|
|
20
|
+
if (idx === -1)
|
|
21
|
+
return;
|
|
22
|
+
const preset = babelrc.presets[idx];
|
|
23
|
+
if (typeof preset === 'string') {
|
|
24
|
+
babelrc.presets.splice(idx, 1, '@nrwl/js/babel');
|
|
25
|
+
}
|
|
26
|
+
else if (Array.isArray(preset)) {
|
|
27
|
+
babelrc.presets.splice(idx, 1, ['@nrwl/js/babel', preset[1]]);
|
|
28
|
+
}
|
|
29
|
+
(0, devkit_1.writeJson)(tree, babelrcPath, babelrc);
|
|
34
30
|
});
|
|
35
31
|
}
|
|
36
32
|
exports.default = update;
|
|
@@ -1,39 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
3
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
function addDroppedDependencies(tree) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
for (const [_, projectConfiguration] of projects) {
|
|
17
|
-
for (const [_, targetConfiguration] of Object.entries((_a = projectConfiguration.targets) !== null && _a !== void 0 ? _a : {})) {
|
|
18
|
-
for (const droppedDependency of droppedDependencies) {
|
|
19
|
-
if ((_b = targetConfiguration.executor) === null || _b === void 0 ? void 0 : _b.startsWith(droppedDependency + ':')) {
|
|
20
|
-
devDependencies[droppedDependency] = devkit_1.NX_VERSION;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
26
|
-
for (const [_, targetConfiguration] of Object.entries((_c = nxJson === null || nxJson === void 0 ? void 0 : nxJson.targetDefaults) !== null && _c !== void 0 ? _c : {})) {
|
|
4
|
+
async function addDroppedDependencies(tree) {
|
|
5
|
+
const devDependencies = {};
|
|
6
|
+
const droppedDependencies = [
|
|
7
|
+
'@nrwl/linter',
|
|
8
|
+
'@nrwl/cypress',
|
|
9
|
+
'@nrwl/jest',
|
|
10
|
+
'@nrwl/rollup',
|
|
11
|
+
];
|
|
12
|
+
const projects = (0, devkit_1.getProjects)(tree);
|
|
13
|
+
for (const [_, projectConfiguration] of projects) {
|
|
14
|
+
for (const [_, targetConfiguration] of Object.entries(projectConfiguration.targets ?? {})) {
|
|
27
15
|
for (const droppedDependency of droppedDependencies) {
|
|
28
|
-
if (
|
|
16
|
+
if (targetConfiguration.executor?.startsWith(droppedDependency + ':')) {
|
|
29
17
|
devDependencies[droppedDependency] = devkit_1.NX_VERSION;
|
|
30
18
|
}
|
|
31
19
|
}
|
|
32
20
|
}
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
}
|
|
22
|
+
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
23
|
+
for (const [_, targetConfiguration] of Object.entries(nxJson?.targetDefaults ?? {})) {
|
|
24
|
+
for (const droppedDependency of droppedDependencies) {
|
|
25
|
+
if (targetConfiguration.executor?.startsWith(droppedDependency + ':')) {
|
|
26
|
+
devDependencies[droppedDependency] = devkit_1.NX_VERSION;
|
|
27
|
+
}
|
|
35
28
|
}
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
}
|
|
30
|
+
if (Object.keys(devDependencies).length > 0) {
|
|
31
|
+
(0, devkit_1.addDependenciesToPackageJson)(tree, {}, devDependencies);
|
|
32
|
+
}
|
|
33
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
38
34
|
}
|
|
39
35
|
exports.default = addDroppedDependencies;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
3
|
const devkit_1 = require("@nx/devkit");
|
|
5
4
|
const replace_package_1 = require("@nx/devkit/src/utils/replace-package");
|
|
6
|
-
function replacePackage(tree) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
yield (0, devkit_1.formatFiles)(tree);
|
|
10
|
-
});
|
|
5
|
+
async function replacePackage(tree) {
|
|
6
|
+
await (0, replace_package_1.replaceNrwlPackageWithNxPackage)(tree, '@nrwl/web', '@nx/web');
|
|
7
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
11
8
|
}
|
|
12
9
|
exports.default = replacePackage;
|
|
@@ -1,38 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
3
|
const devkit_1 = require("@nx/devkit");
|
|
5
4
|
const versions_1 = require("../../utils/versions");
|
|
6
|
-
function update(host) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
deps['@nx/webpack'] = versions_1.nxVersion;
|
|
17
|
-
updated = true;
|
|
18
|
-
}
|
|
19
|
-
if (((_d = (_c = config === null || config === void 0 ? void 0 : config.targets) === null || _c === void 0 ? void 0 : _c.serve) === null || _d === void 0 ? void 0 : _d.executor) === '@nrwl/web:dev-server') {
|
|
20
|
-
config.targets.serve.executor = '@nx/webpack:dev-server';
|
|
21
|
-
deps['@nx/webpack'] = versions_1.nxVersion;
|
|
22
|
-
updated = true;
|
|
23
|
-
}
|
|
24
|
-
// rollup
|
|
25
|
-
if (((_f = (_e = config === null || config === void 0 ? void 0 : config.targets) === null || _e === void 0 ? void 0 : _e.build) === null || _f === void 0 ? void 0 : _f.executor) === '@nrwl/web:rollup') {
|
|
26
|
-
config.targets.build.executor = '@nx/rollup:rollup';
|
|
27
|
-
deps['@nx/rollup'] = versions_1.nxVersion;
|
|
28
|
-
updated = true;
|
|
29
|
-
}
|
|
30
|
-
if (updated) {
|
|
31
|
-
(0, devkit_1.updateProjectConfiguration)(host, name, config);
|
|
32
|
-
}
|
|
5
|
+
async function update(host) {
|
|
6
|
+
const projects = (0, devkit_1.getProjects)(host);
|
|
7
|
+
const deps = {};
|
|
8
|
+
for (const [name, config] of projects.entries()) {
|
|
9
|
+
let updated = false;
|
|
10
|
+
// webpack
|
|
11
|
+
if (config?.targets?.build?.executor === '@nrwl/web:webpack') {
|
|
12
|
+
config.targets.build.executor = '@nx/webpack:webpack';
|
|
13
|
+
deps['@nx/webpack'] = versions_1.nxVersion;
|
|
14
|
+
updated = true;
|
|
33
15
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
16
|
+
if (config?.targets?.serve?.executor === '@nrwl/web:dev-server') {
|
|
17
|
+
config.targets.serve.executor = '@nx/webpack:dev-server';
|
|
18
|
+
deps['@nx/webpack'] = versions_1.nxVersion;
|
|
19
|
+
updated = true;
|
|
20
|
+
}
|
|
21
|
+
// rollup
|
|
22
|
+
if (config?.targets?.build?.executor === '@nrwl/web:rollup') {
|
|
23
|
+
config.targets.build.executor = '@nx/rollup:rollup';
|
|
24
|
+
deps['@nx/rollup'] = versions_1.nxVersion;
|
|
25
|
+
updated = true;
|
|
26
|
+
}
|
|
27
|
+
if (updated) {
|
|
28
|
+
(0, devkit_1.updateProjectConfiguration)(host, name, config);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
await (0, devkit_1.formatFiles)(host);
|
|
32
|
+
return (0, devkit_1.addDependenciesToPackageJson)(host, {}, deps);
|
|
37
33
|
}
|
|
38
34
|
exports.default = update;
|