nx 16.4.0-beta.6 → 16.4.0-beta.7
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 +13 -13
- package/src/adapter/angular-json.d.ts +1 -1
- package/src/adapter/angular-json.js +6 -6
- package/src/command-line/init/implementation/react/rename-js-to-jsx.js +8 -5
- package/src/command-line/list/list.js +1 -1
- package/src/config/workspaces.d.ts +1 -1
- package/src/config/workspaces.js +9 -8
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/polyfills.js +1 -1
- package/src/daemon/server/project-graph-incremental-recomputation.js +13 -6
- package/src/daemon/server/server.js +3 -3
- package/src/generators/utils/project-configuration.js +1 -1
- package/src/native/index.d.ts +18 -4
- package/src/native/index.js +4 -1
- package/src/plugins/js/package-json/create-package-json.js +4 -2
- package/src/project-graph/file-map-utils.js +8 -3
- package/src/project-graph/project-graph.js +4 -6
- package/src/project-graph/utils/retrieve-workspace-files.d.ts +21 -0
- package/src/project-graph/utils/retrieve-workspace-files.js +107 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nx",
|
|
3
|
-
"version": "16.4.0-beta.
|
|
3
|
+
"version": "16.4.0-beta.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
|
|
6
6
|
"repository": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"homepage": "https://nx.dev",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@nrwl/tao": "16.4.0-beta.
|
|
35
|
+
"@nrwl/tao": "16.4.0-beta.7",
|
|
36
36
|
"@parcel/watcher": "2.0.4",
|
|
37
37
|
"@yarnpkg/lockfile": "^1.1.0",
|
|
38
38
|
"@yarnpkg/parsers": "^3.0.0-rc.18",
|
|
@@ -80,16 +80,16 @@
|
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
82
|
"optionalDependencies": {
|
|
83
|
-
"@nx/nx-darwin-arm64": "16.4.0-beta.
|
|
84
|
-
"@nx/nx-darwin-x64": "16.4.0-beta.
|
|
85
|
-
"@nx/nx-freebsd-x64": "16.4.0-beta.
|
|
86
|
-
"@nx/nx-linux-arm-gnueabihf": "16.4.0-beta.
|
|
87
|
-
"@nx/nx-linux-arm64-gnu": "16.4.0-beta.
|
|
88
|
-
"@nx/nx-linux-arm64-musl": "16.4.0-beta.
|
|
89
|
-
"@nx/nx-linux-x64-gnu": "16.4.0-beta.
|
|
90
|
-
"@nx/nx-linux-x64-musl": "16.4.0-beta.
|
|
91
|
-
"@nx/nx-win32-arm64-msvc": "16.4.0-beta.
|
|
92
|
-
"@nx/nx-win32-x64-msvc": "16.4.0-beta.
|
|
83
|
+
"@nx/nx-darwin-arm64": "16.4.0-beta.7",
|
|
84
|
+
"@nx/nx-darwin-x64": "16.4.0-beta.7",
|
|
85
|
+
"@nx/nx-freebsd-x64": "16.4.0-beta.7",
|
|
86
|
+
"@nx/nx-linux-arm-gnueabihf": "16.4.0-beta.7",
|
|
87
|
+
"@nx/nx-linux-arm64-gnu": "16.4.0-beta.7",
|
|
88
|
+
"@nx/nx-linux-arm64-musl": "16.4.0-beta.7",
|
|
89
|
+
"@nx/nx-linux-x64-gnu": "16.4.0-beta.7",
|
|
90
|
+
"@nx/nx-linux-x64-musl": "16.4.0-beta.7",
|
|
91
|
+
"@nx/nx-win32-arm64-msvc": "16.4.0-beta.7",
|
|
92
|
+
"@nx/nx-win32-x64-msvc": "16.4.0-beta.7"
|
|
93
93
|
},
|
|
94
94
|
"nx-migrations": {
|
|
95
95
|
"migrations": "./migrations.json",
|
|
@@ -175,5 +175,5 @@
|
|
|
175
175
|
},
|
|
176
176
|
"main": "./bin/nx.js",
|
|
177
177
|
"types": "./bin/nx.d.ts",
|
|
178
|
-
"gitHead": "
|
|
178
|
+
"gitHead": "847d3a45b61cd2c267acb66c4165a5bb875aff4f"
|
|
179
179
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ProjectConfiguration, ProjectsConfigurations } from '../config/workspace-json-project-json';
|
|
2
2
|
export declare function shouldMergeAngularProjects(root: string, includeProjectsFromAngularJson: boolean): boolean;
|
|
3
3
|
export declare function isAngularPluginInstalled(): boolean;
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function mergeAngularJsonAndProjects(projects: {
|
|
5
5
|
[name: string]: ProjectConfiguration;
|
|
6
6
|
}, angularCliWorkspaceRoot: string): {
|
|
7
7
|
[name: string]: ProjectConfiguration;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toOldFormat = exports.toNewFormat = exports.
|
|
3
|
+
exports.toOldFormat = exports.toNewFormat = exports.mergeAngularJsonAndProjects = exports.isAngularPluginInstalled = exports.shouldMergeAngularProjects = void 0;
|
|
4
4
|
const fs_1 = require("fs");
|
|
5
5
|
const path = require("path");
|
|
6
6
|
const fileutils_1 = require("../utils/fileutils");
|
|
@@ -38,20 +38,20 @@ exports.isAngularPluginInstalled = isAngularPluginInstalled;
|
|
|
38
38
|
function readAngularJson(angularCliWorkspaceRoot) {
|
|
39
39
|
return toNewFormat((0, fileutils_1.readJsonFile)(path.join(angularCliWorkspaceRoot, 'angular.json'))).projects;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function mergeAngularJsonAndProjects(projects, angularCliWorkspaceRoot) {
|
|
42
42
|
const res = readAngularJson(angularCliWorkspaceRoot);
|
|
43
43
|
const folders = new Set();
|
|
44
44
|
for (let k of Object.keys(res)) {
|
|
45
45
|
folders.add(res[k].root);
|
|
46
46
|
}
|
|
47
|
-
for (let k of Object.keys(
|
|
48
|
-
if (!folders.has(
|
|
49
|
-
res[k] =
|
|
47
|
+
for (let k of Object.keys(projects)) {
|
|
48
|
+
if (!folders.has(projects[k].root)) {
|
|
49
|
+
res[k] = projects[k];
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
return res;
|
|
53
53
|
}
|
|
54
|
-
exports.
|
|
54
|
+
exports.mergeAngularJsonAndProjects = mergeAngularJsonAndProjects;
|
|
55
55
|
function toNewFormat(w) {
|
|
56
56
|
Object.values(w.projects || {}).forEach((projectConfig) => {
|
|
57
57
|
if (projectConfig.architect) {
|
|
@@ -3,15 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.renameJsToJsx = void 0;
|
|
4
4
|
const fs_extra_1 = require("fs-extra");
|
|
5
5
|
const glob_1 = require("glob");
|
|
6
|
+
const fileutils_1 = require("../../../../utils/fileutils");
|
|
6
7
|
// Vite cannot process JSX like <div> or <Header> unless the file is named .jsx or .tsx
|
|
7
8
|
function renameJsToJsx(appName, isStandalone) {
|
|
8
9
|
const files = (0, glob_1.sync)(isStandalone ? 'src/**/*.js' : `apps/${appName}/src/**/*.js`);
|
|
9
10
|
files.forEach((file) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
(
|
|
11
|
+
if ((0, fileutils_1.fileExists)(file)) {
|
|
12
|
+
const content = (0, fs_extra_1.readFileSync)(file).toString();
|
|
13
|
+
// Try to detect JSX before renaming to .jsx
|
|
14
|
+
// Files like setupTests.js from CRA should not be renamed
|
|
15
|
+
if (/<[a-zA-Z0-9]+/.test(content)) {
|
|
16
|
+
(0, fs_extra_1.renameSync)(file, `${file}x`);
|
|
17
|
+
}
|
|
15
18
|
}
|
|
16
19
|
});
|
|
17
20
|
}
|
|
@@ -34,7 +34,7 @@ function listHandler(args) {
|
|
|
34
34
|
title: 'Community Plugins',
|
|
35
35
|
bodyLines: [
|
|
36
36
|
'Looking for a technology / framework not listed above?',
|
|
37
|
-
'There are many excellent plugins
|
|
37
|
+
'There are many excellent plugins maintained by the Nx community.',
|
|
38
38
|
'Search for the one you need here: https://nx.dev/plugins/registry.',
|
|
39
39
|
],
|
|
40
40
|
});
|
|
@@ -72,7 +72,7 @@ export declare function deduplicateProjectFiles(files: string[]): string[];
|
|
|
72
72
|
export declare function inferProjectFromNonStandardFile(file: string): ProjectConfiguration & {
|
|
73
73
|
name: string;
|
|
74
74
|
};
|
|
75
|
-
export declare function
|
|
75
|
+
export declare function buildProjectsConfigurationsFromProjectPaths(nxJson: NxJsonConfiguration, projectFiles: string[], // making this parameter allows devkit to pick up newly created projects
|
|
76
76
|
readJson?: <T extends Object>(string: any) => T): ProjectsConfigurations;
|
|
77
77
|
export declare function mergeTargetConfigurations(projectConfiguration: ProjectConfiguration, target: string, targetDefaults: TargetDefaults[string]): TargetConfiguration;
|
|
78
78
|
export declare function readTargetDefaultsForTarget(targetName: string, targetDefaults: TargetDefaults, executor?: string): TargetDefaults[string];
|
package/src/config/workspaces.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.renamePropertyWithStableKeys = exports.readTargetDefaultsForTarget = exports.mergeTargetConfigurations = exports.
|
|
3
|
+
exports.renamePropertyWithStableKeys = exports.readTargetDefaultsForTarget = exports.mergeTargetConfigurations = exports.buildProjectsConfigurationsFromProjectPaths = exports.inferProjectFromNonStandardFile = exports.deduplicateProjectFiles = exports.globForProjectFiles = exports.getGlobPatternsFromPackageManagerWorkspaces = exports.getGlobPatternsFromPluginsAsync = exports.getGlobPatternsFromPlugins = exports.toProjectName = exports.normalizeExecutorSchema = exports.Workspaces = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const fast_glob_1 = require("fast-glob");
|
|
6
6
|
const fs_1 = require("fs");
|
|
@@ -58,11 +58,11 @@ class Workspaces {
|
|
|
58
58
|
return this.cachedProjectsConfig;
|
|
59
59
|
}
|
|
60
60
|
const nxJson = this.readNxJson();
|
|
61
|
-
const projectsConfigurations =
|
|
61
|
+
const projectsConfigurations = buildProjectsConfigurationsFromProjectPaths(nxJson, globForProjectFiles(this.root, (opts === null || opts === void 0 ? void 0 : opts._ignorePluginInference)
|
|
62
62
|
? []
|
|
63
63
|
: getGlobPatternsFromPlugins(nxJson, (0, installation_directory_1.getNxRequirePaths)(this.root), this.root), nxJson), (path) => (0, fileutils_1.readJsonFile)((0, path_1.join)(this.root, path)));
|
|
64
64
|
if ((0, angular_json_1.shouldMergeAngularProjects)(this.root, opts === null || opts === void 0 ? void 0 : opts._includeProjectsFromAngularJson)) {
|
|
65
|
-
projectsConfigurations.projects = (0, angular_json_1.
|
|
65
|
+
projectsConfigurations.projects = (0, angular_json_1.mergeAngularJsonAndProjects)(projectsConfigurations.projects, this.root);
|
|
66
66
|
}
|
|
67
67
|
this.cachedProjectsConfig = this.mergeTargetDefaultsIntoProjectDescriptions(projectsConfigurations, nxJson);
|
|
68
68
|
return this.cachedProjectsConfig;
|
|
@@ -384,7 +384,9 @@ function getGlobPatternsFromPackageManagerWorkspaces(root) {
|
|
|
384
384
|
// Include the root project
|
|
385
385
|
return packageJson.nx ? patterns.concat('package.json') : patterns;
|
|
386
386
|
}
|
|
387
|
-
catch (_c) {
|
|
387
|
+
catch (_c) {
|
|
388
|
+
return [];
|
|
389
|
+
}
|
|
388
390
|
}
|
|
389
391
|
exports.getGlobPatternsFromPackageManagerWorkspaces = getGlobPatternsFromPackageManagerWorkspaces;
|
|
390
392
|
function normalizePatterns(patterns) {
|
|
@@ -511,7 +513,7 @@ function inferProjectFromNonStandardFile(file) {
|
|
|
511
513
|
};
|
|
512
514
|
}
|
|
513
515
|
exports.inferProjectFromNonStandardFile = inferProjectFromNonStandardFile;
|
|
514
|
-
function
|
|
516
|
+
function buildProjectsConfigurationsFromProjectPaths(nxJson, projectFiles, // making this parameter allows devkit to pick up newly created projects
|
|
515
517
|
readJson = (string) => (0, fileutils_1.readJsonFile)(string) // making this an arg allows us to reuse in devkit
|
|
516
518
|
) {
|
|
517
519
|
const projects = {};
|
|
@@ -558,8 +560,7 @@ readJson = (string) => (0, fileutils_1.readJsonFile)(string) // making this an a
|
|
|
558
560
|
projects[name] = config;
|
|
559
561
|
}
|
|
560
562
|
else {
|
|
561
|
-
logger_1.logger.
|
|
562
|
-
throw new Error();
|
|
563
|
+
logger_1.logger.warn(`Skipping project inferred from ${file} since project ${name} already exists.`);
|
|
563
564
|
}
|
|
564
565
|
}
|
|
565
566
|
}
|
|
@@ -569,7 +570,7 @@ readJson = (string) => (0, fileutils_1.readJsonFile)(string) // making this an a
|
|
|
569
570
|
projects: projects,
|
|
570
571
|
};
|
|
571
572
|
}
|
|
572
|
-
exports.
|
|
573
|
+
exports.buildProjectsConfigurationsFromProjectPaths = buildProjectsConfigurationsFromProjectPaths;
|
|
573
574
|
function mergeTargetConfigurations(projectConfiguration, target, targetDefaults) {
|
|
574
575
|
var _a, _b;
|
|
575
576
|
const targetConfiguration = (_a = projectConfiguration.targets) === null || _a === void 0 ? void 0 : _a[target];
|