@nx/workspace 17.3.0-canary.20231213-3655269 → 17.3.0-canary.20231214-dc03c37
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/workspace",
|
|
3
|
-
"version": "17.3.0-canary.
|
|
3
|
+
"version": "17.3.0-canary.20231214-dc03c37",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Workspace plugin contains executors and generators that are useful for any Nx workspace. It should be present in every Nx workspace and other plugins build on it.",
|
|
6
6
|
"repository": {
|
|
@@ -61,13 +61,13 @@
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@nx/devkit": "17.3.0-canary.
|
|
64
|
+
"@nx/devkit": "17.3.0-canary.20231214-dc03c37",
|
|
65
65
|
"chalk": "^4.1.0",
|
|
66
66
|
"enquirer": "~2.3.6",
|
|
67
67
|
"tslib": "^2.3.0",
|
|
68
68
|
"yargs-parser": "21.1.1",
|
|
69
|
-
"nx": "17.3.0-canary.
|
|
70
|
-
"@nrwl/workspace": "17.3.0-canary.
|
|
69
|
+
"nx": "17.3.0-canary.20231214-dc03c37",
|
|
70
|
+
"@nrwl/workspace": "17.3.0-canary.20231214-dc03c37"
|
|
71
71
|
},
|
|
72
72
|
"publishConfig": {
|
|
73
73
|
"access": "public"
|
|
@@ -11,10 +11,14 @@ async function monorepoGenerator(tree, options) {
|
|
|
11
11
|
const projectsToMove = [];
|
|
12
12
|
// Need to determine libs vs packages directory base on the type of root project.
|
|
13
13
|
for (const [, project] of projects) {
|
|
14
|
-
if (project.root === '.')
|
|
14
|
+
if (project.root === '.') {
|
|
15
15
|
rootProject = project;
|
|
16
|
-
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
projectsToMove.push(project);
|
|
19
|
+
}
|
|
17
20
|
}
|
|
21
|
+
projectsToMove.unshift(rootProject); // move the root project 1st
|
|
18
22
|
// Currently, Nx only handles apps+libs or packages. You cannot mix and match them.
|
|
19
23
|
// If the standalone project is an app (React, Angular, etc), then use apps+libs.
|
|
20
24
|
// Otherwise, for TS standalone (lib), use packages.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ProjectConfiguration, Tree } from '@nx/devkit';
|
|
2
2
|
export declare function maybeExtractTsConfigBase(tree: Tree): void;
|
|
3
3
|
export declare function maybeExtractJestConfigBase(tree: Tree): Promise<void>;
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function maybeMigrateEslintConfigIfRootProject(tree: Tree, rootProject: ProjectConfiguration): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.maybeMigrateEslintConfigIfRootProject = exports.maybeExtractJestConfigBase = exports.maybeExtractTsConfigBase = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
function maybeExtractTsConfigBase(tree) {
|
|
6
6
|
let extractTsConfigBase;
|
|
@@ -26,11 +26,7 @@ async function maybeExtractJestConfigBase(tree) {
|
|
|
26
26
|
await jestInitGenerator(tree, {});
|
|
27
27
|
}
|
|
28
28
|
exports.maybeExtractJestConfigBase = maybeExtractJestConfigBase;
|
|
29
|
-
function
|
|
30
|
-
if (rootProject.root !== '.')
|
|
31
|
-
return;
|
|
32
|
-
if (tree.exists('.eslintrc.base.json'))
|
|
33
|
-
return;
|
|
29
|
+
function maybeMigrateEslintConfigIfRootProject(tree, rootProject) {
|
|
34
30
|
let migrateConfigToMonorepoStyle;
|
|
35
31
|
try {
|
|
36
32
|
migrateConfigToMonorepoStyle = require('@nx/' +
|
|
@@ -39,11 +35,9 @@ function maybeExtractEslintConfigIfRootProject(tree, rootProject) {
|
|
|
39
35
|
catch {
|
|
40
36
|
// eslint not installed
|
|
41
37
|
}
|
|
42
|
-
|
|
43
|
-
// If other libs/apps exist, then this migration is already done by `@nx/eslint:lint-rootProject` generator.
|
|
44
|
-
migrateConfigToMonorepoStyle?.([rootProject], tree, tree.exists((0, devkit_1.joinPathFragments)(rootProject.root, 'jest.config.ts')) ||
|
|
38
|
+
migrateConfigToMonorepoStyle?.(Array.from((0, devkit_1.getProjects)(tree).values()), tree, tree.exists((0, devkit_1.joinPathFragments)(rootProject.root, 'jest.config.ts')) ||
|
|
45
39
|
tree.exists((0, devkit_1.joinPathFragments)(rootProject.root, 'jest.config.js'))
|
|
46
40
|
? 'jest'
|
|
47
41
|
: 'none');
|
|
48
42
|
}
|
|
49
|
-
exports.
|
|
43
|
+
exports.maybeMigrateEslintConfigIfRootProject = maybeMigrateEslintConfigIfRootProject;
|
|
@@ -33,7 +33,6 @@ async function moveGeneratorInternal(tree, rawSchema) {
|
|
|
33
33
|
if (projectConfig.root === '.') {
|
|
34
34
|
(0, extract_base_configs_1.maybeExtractTsConfigBase)(tree);
|
|
35
35
|
await (0, extract_base_configs_1.maybeExtractJestConfigBase)(tree);
|
|
36
|
-
(0, extract_base_configs_1.maybeExtractEslintConfigIfRootProject)(tree, projectConfig);
|
|
37
36
|
// Reload config since it has been updated after extracting base configs
|
|
38
37
|
projectConfig = (0, devkit_1.readProjectConfiguration)(tree, rawSchema.projectName);
|
|
39
38
|
}
|
|
@@ -51,6 +50,10 @@ async function moveGeneratorInternal(tree, rawSchema) {
|
|
|
51
50
|
(0, update_build_targets_1.updateBuildTargets)(tree, schema);
|
|
52
51
|
(0, update_default_project_1.updateDefaultProject)(tree, schema);
|
|
53
52
|
(0, update_implicit_dependencies_1.updateImplicitDependencies)(tree, schema);
|
|
53
|
+
if (projectConfig.root === '.') {
|
|
54
|
+
// we want to migrate eslint config once the root project files are moved
|
|
55
|
+
(0, extract_base_configs_1.maybeMigrateEslintConfigIfRootProject)(tree, projectConfig);
|
|
56
|
+
}
|
|
54
57
|
await (0, run_angular_plugin_1.runAngularPlugin)(tree, schema);
|
|
55
58
|
if (!schema.skipFormat) {
|
|
56
59
|
await (0, devkit_1.formatFiles)(tree);
|