nx 17.2.0-beta.11 → 17.2.0-beta.12
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 +12 -12
- package/src/adapter/ngcli-adapter.js +5 -2
- package/src/executors/run-commands/run-commands.impl.d.ts +1 -1
- package/src/executors/run-commands/run-commands.impl.js +1 -1
- package/src/native/index.d.ts +1 -1
- package/src/project-graph/project-graph.js +9 -0
- package/src/utils/cache-directory.d.ts +1 -0
- package/src/utils/cache-directory.js +5 -1
- package/src/utils/workspace-context.js +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nx",
|
|
3
|
-
"version": "17.2.0-beta.
|
|
3
|
+
"version": "17.2.0-beta.12",
|
|
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": {
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"yargs": "^17.6.2",
|
|
67
67
|
"yargs-parser": "21.1.1",
|
|
68
68
|
"node-machine-id": "1.1.12",
|
|
69
|
-
"@nrwl/tao": "17.2.0-beta.
|
|
69
|
+
"@nrwl/tao": "17.2.0-beta.12"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"@swc-node/register": "^1.6.7",
|
|
@@ -81,16 +81,16 @@
|
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
"optionalDependencies": {
|
|
84
|
-
"@nx/nx-darwin-x64": "17.2.0-beta.
|
|
85
|
-
"@nx/nx-darwin-arm64": "17.2.0-beta.
|
|
86
|
-
"@nx/nx-linux-x64-gnu": "17.2.0-beta.
|
|
87
|
-
"@nx/nx-linux-x64-musl": "17.2.0-beta.
|
|
88
|
-
"@nx/nx-win32-x64-msvc": "17.2.0-beta.
|
|
89
|
-
"@nx/nx-linux-arm64-gnu": "17.2.0-beta.
|
|
90
|
-
"@nx/nx-linux-arm64-musl": "17.2.0-beta.
|
|
91
|
-
"@nx/nx-linux-arm-gnueabihf": "17.2.0-beta.
|
|
92
|
-
"@nx/nx-win32-arm64-msvc": "17.2.0-beta.
|
|
93
|
-
"@nx/nx-freebsd-x64": "17.2.0-beta.
|
|
84
|
+
"@nx/nx-darwin-x64": "17.2.0-beta.12",
|
|
85
|
+
"@nx/nx-darwin-arm64": "17.2.0-beta.12",
|
|
86
|
+
"@nx/nx-linux-x64-gnu": "17.2.0-beta.12",
|
|
87
|
+
"@nx/nx-linux-x64-musl": "17.2.0-beta.12",
|
|
88
|
+
"@nx/nx-win32-x64-msvc": "17.2.0-beta.12",
|
|
89
|
+
"@nx/nx-linux-arm64-gnu": "17.2.0-beta.12",
|
|
90
|
+
"@nx/nx-linux-arm64-musl": "17.2.0-beta.12",
|
|
91
|
+
"@nx/nx-linux-arm-gnueabihf": "17.2.0-beta.12",
|
|
92
|
+
"@nx/nx-win32-arm64-msvc": "17.2.0-beta.12",
|
|
93
|
+
"@nx/nx-freebsd-x64": "17.2.0-beta.12"
|
|
94
94
|
},
|
|
95
95
|
"nx-migrations": {
|
|
96
96
|
"migrations": "./migrations.json",
|
|
@@ -22,9 +22,12 @@ const executor_utils_1 = require("../command-line/run/executor-utils");
|
|
|
22
22
|
const nx_plugin_1 = require("../utils/nx-plugin");
|
|
23
23
|
const schema_utils_1 = require("../config/schema-utils");
|
|
24
24
|
async function createBuilderContext(builderInfo, context) {
|
|
25
|
-
require('
|
|
25
|
+
require('./compat');
|
|
26
26
|
const fsHost = new NxScopedHost(context.root);
|
|
27
|
-
|
|
27
|
+
// the top level import is not patched because it is imported before the
|
|
28
|
+
// patching happens so we require it here to use the patched version below
|
|
29
|
+
const { workspaces } = require('@angular-devkit/core');
|
|
30
|
+
const { workspace } = await workspaces.readWorkspace('angular.json', workspaces.createWorkspaceHost(fsHost));
|
|
28
31
|
const architectHost = await getWrappedWorkspaceNodeModulesArchitectHost(workspace, context.root, context.projectsConfigurations.projects);
|
|
29
32
|
const registry = new core_1.schema.CoreSchemaRegistry();
|
|
30
33
|
registry.addPostTransform(core_1.schema.transforms.addUndefinedDefaults);
|
|
@@ -38,4 +38,4 @@ export interface NormalizedRunCommandsOptions extends RunCommandsOptions {
|
|
|
38
38
|
export default function (options: RunCommandsOptions, context: ExecutorContext): Promise<{
|
|
39
39
|
success: boolean;
|
|
40
40
|
}>;
|
|
41
|
-
export declare function interpolateArgsIntoCommand(command: string, opts: Pick<NormalizedRunCommandsOptions, 'parsedArgs' | '__unparsed__'>, forwardAllArgs: boolean): string;
|
|
41
|
+
export declare function interpolateArgsIntoCommand(command: string, opts: Pick<NormalizedRunCommandsOptions, 'args' | 'parsedArgs' | '__unparsed__'>, forwardAllArgs: boolean): string;
|
|
@@ -185,7 +185,7 @@ function interpolateArgsIntoCommand(command, opts, forwardAllArgs) {
|
|
|
185
185
|
return command.replace(regex, (_, group) => opts.parsedArgs[group] !== undefined ? opts.parsedArgs[group] : '');
|
|
186
186
|
}
|
|
187
187
|
else if (forwardAllArgs) {
|
|
188
|
-
return `${command}${opts.__unparsed__.length > 0 ? ' ' + opts.__unparsed__.join(' ') : ''}`;
|
|
188
|
+
return `${command}${opts.args ? ' ' + opts.args : ''}${opts.__unparsed__.length > 0 ? ' ' + opts.__unparsed__.join(' ') : ''}`;
|
|
189
189
|
}
|
|
190
190
|
else {
|
|
191
191
|
return command;
|
package/src/native/index.d.ts
CHANGED
|
@@ -169,7 +169,7 @@ export class Watcher {
|
|
|
169
169
|
}
|
|
170
170
|
export class WorkspaceContext {
|
|
171
171
|
workspaceRoot: string
|
|
172
|
-
constructor(workspaceRoot: string)
|
|
172
|
+
constructor(workspaceRoot: string, cacheDir: string)
|
|
173
173
|
getWorkspaceFiles(projectRootMap: Record<string, string>): NxWorkspaceFiles
|
|
174
174
|
glob(globs: Array<string>, exclude?: Array<string> | undefined | null): Array<string>
|
|
175
175
|
hashFilesMatchingGlob(globs: Array<string>, exclude?: Array<string> | undefined | null): string
|
|
@@ -68,10 +68,16 @@ function readProjectsConfigurationFromProjectGraph(projectGraph) {
|
|
|
68
68
|
exports.readProjectsConfigurationFromProjectGraph = readProjectsConfigurationFromProjectGraph;
|
|
69
69
|
async function buildProjectGraphWithoutDaemon() {
|
|
70
70
|
const nxJson = (0, nx_json_1.readNxJson)();
|
|
71
|
+
perf_hooks_1.performance.mark('retrieve-project-configurations:start');
|
|
71
72
|
const { projects, externalNodes, sourceMaps, projectRootMap } = await (0, retrieve_workspace_files_1.retrieveProjectConfigurations)(workspace_root_1.workspaceRoot, nxJson);
|
|
73
|
+
perf_hooks_1.performance.mark('retrieve-project-configurations:end');
|
|
74
|
+
perf_hooks_1.performance.mark('retrieve-workspace-files:start');
|
|
72
75
|
const { allWorkspaceFiles, fileMap, rustReferences } = await (0, retrieve_workspace_files_1.retrieveWorkspaceFiles)(workspace_root_1.workspaceRoot, projectRootMap);
|
|
76
|
+
perf_hooks_1.performance.mark('retrieve-workspace-files:end');
|
|
73
77
|
const cacheEnabled = process.env.NX_CACHE_PROJECT_GRAPH !== 'false';
|
|
78
|
+
perf_hooks_1.performance.mark('build-project-graph-using-project-file-map:start');
|
|
74
79
|
const projectGraph = (await (0, build_project_graph_1.buildProjectGraphUsingProjectFileMap)(projects, externalNodes, fileMap, allWorkspaceFiles, rustReferences, cacheEnabled ? (0, nx_deps_cache_1.readFileMapCache)() : null, cacheEnabled)).projectGraph;
|
|
80
|
+
perf_hooks_1.performance.mark('build-project-graph-using-project-file-map:end');
|
|
75
81
|
(0, source_maps_1.writeSourceMaps)(sourceMaps);
|
|
76
82
|
(0, nx_plugin_1.unregisterPluginTSTranspiler)();
|
|
77
83
|
return projectGraph;
|
|
@@ -122,6 +128,9 @@ async function createProjectGraphAsync(opts = {
|
|
|
122
128
|
if (!client_1.daemonClient.enabled()) {
|
|
123
129
|
try {
|
|
124
130
|
const res = await buildProjectGraphWithoutDaemon();
|
|
131
|
+
perf_hooks_1.performance.measure('create-project-graph-async >> retrieve-project-configurations', 'retrieve-project-configurations:start', 'retrieve-project-configurations:end');
|
|
132
|
+
perf_hooks_1.performance.measure('create-project-graph-async >> retrieve-workspace-files', 'retrieve-workspace-files:start', 'retrieve-workspace-files:end');
|
|
133
|
+
perf_hooks_1.performance.measure('create-project-graph-async >> build-project-graph-using-project-file-map', 'build-project-graph-using-project-file-map:start', 'build-project-graph-using-project-file-map:end');
|
|
125
134
|
perf_hooks_1.performance.mark('create-project-graph-async:end');
|
|
126
135
|
perf_hooks_1.performance.measure('create-project-graph-async', 'create-project-graph-async:start', 'create-project-graph-async:end');
|
|
127
136
|
return res;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.projectGraphCacheDirectory = exports.cacheDir = void 0;
|
|
3
|
+
exports.projectGraphCacheDirectory = exports.cacheDirectoryForWorkspace = exports.cacheDir = void 0;
|
|
4
4
|
const fs_1 = require("fs");
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
const fileutils_1 = require("./fileutils");
|
|
@@ -52,5 +52,9 @@ function defaultCacheDirectory(root) {
|
|
|
52
52
|
* Path to the directory where Nx stores its cache and daemon-related files.
|
|
53
53
|
*/
|
|
54
54
|
exports.cacheDir = cacheDirectory(workspace_root_1.workspaceRoot, readCacheDirectoryProperty(workspace_root_1.workspaceRoot));
|
|
55
|
+
function cacheDirectoryForWorkspace(workspaceRoot) {
|
|
56
|
+
return cacheDirectory(workspaceRoot, readCacheDirectoryProperty(workspaceRoot));
|
|
57
|
+
}
|
|
58
|
+
exports.cacheDirectoryForWorkspace = cacheDirectoryForWorkspace;
|
|
55
59
|
exports.projectGraphCacheDirectory = absolutePath(workspace_root_1.workspaceRoot, process.env.NX_PROJECT_GRAPH_CACHE_DIRECTORY ??
|
|
56
60
|
defaultCacheDirectory(workspace_root_1.workspaceRoot));
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resetWorkspaceContext = exports.updateProjectFiles = exports.getAllFileDataInContext = exports.updateFilesInContext = exports.hashWithWorkspaceContext = exports.globWithWorkspaceContext = exports.getNxWorkspaceFilesFromContext = exports.setupWorkspaceContext = void 0;
|
|
4
4
|
const perf_hooks_1 = require("perf_hooks");
|
|
5
|
+
const cache_directory_1 = require("./cache-directory");
|
|
5
6
|
let workspaceContext;
|
|
6
7
|
function setupWorkspaceContext(workspaceRoot) {
|
|
7
8
|
const { WorkspaceContext } = require('../native');
|
|
8
9
|
perf_hooks_1.performance.mark('workspace-context');
|
|
9
|
-
workspaceContext = new WorkspaceContext(workspaceRoot);
|
|
10
|
+
workspaceContext = new WorkspaceContext(workspaceRoot, (0, cache_directory_1.cacheDirectoryForWorkspace)(workspaceRoot));
|
|
10
11
|
perf_hooks_1.performance.mark('workspace-context:end');
|
|
11
12
|
perf_hooks_1.performance.measure('workspace context init', 'workspace-context', 'workspace-context:end');
|
|
12
13
|
}
|