nx 20.5.0-rc.3 → 20.5.0
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/.eslintrc.json +0 -1
- package/package.json +11 -11
- package/src/command-line/activate-powerpack/activate-powerpack.d.ts +2 -0
- package/src/command-line/{activate-key/activate-key.js → activate-powerpack/activate-powerpack.js} +12 -12
- package/src/command-line/activate-powerpack/command-object.d.ts +6 -0
- package/src/command-line/{activate-key → activate-powerpack}/command-object.js +7 -8
- package/src/command-line/init/configure-plugins.js +10 -12
- package/src/command-line/nx-commands.js +5 -19
- package/src/command-line/report/report.d.ts +3 -3
- package/src/command-line/report/report.js +31 -33
- package/src/core/graph/main.js +1 -1
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/plugins/package-json/create-nodes.js +3 -1
- package/src/tasks-runner/cache.d.ts +5 -5
- package/src/tasks-runner/cache.js +17 -29
- package/src/tasks-runner/run-command.js +2 -2
- package/src/utils/powerpack.d.ts +5 -0
- package/src/utils/powerpack.js +33 -0
- package/src/command-line/activate-key/activate-key.d.ts +0 -2
- package/src/command-line/activate-key/command-object.d.ts +0 -6
- package/src/utils/nx-key.d.ts +0 -5
- package/src/utils/nx-key.js +0 -39
Binary file
|
@@ -86,6 +86,9 @@ function createNodeFromPackageJson(pkgJsonPath, workspaceRoot, cache, isInPackag
|
|
86
86
|
...json,
|
87
87
|
root: projectRoot,
|
88
88
|
isInPackageManagerWorkspaces,
|
89
|
+
// change this to bust the cache when making changes that result in different
|
90
|
+
// results for the same hash
|
91
|
+
bust: 1,
|
89
92
|
});
|
90
93
|
const cached = cache[hash];
|
91
94
|
if (cached) {
|
@@ -126,7 +129,6 @@ function buildProjectConfigurationFromPackageJson(packageJson, workspaceRoot, pa
|
|
126
129
|
let name = packageJson.name ?? (0, to_project_name_1.toProjectName)(normalizedPath);
|
127
130
|
const projectConfiguration = {
|
128
131
|
root: projectRoot,
|
129
|
-
sourceRoot: projectRoot,
|
130
132
|
name,
|
131
133
|
...packageJson.nx,
|
132
134
|
targets: (0, package_json_1.readTargetsFromPackageJson)(packageJson, nxJson),
|
@@ -32,11 +32,11 @@ export declare class DbCache {
|
|
32
32
|
temporaryOutputPath(task: Task): string;
|
33
33
|
private getRemoteCache;
|
34
34
|
private _getRemoteCache;
|
35
|
-
private
|
36
|
-
private
|
37
|
-
private
|
38
|
-
private
|
39
|
-
private
|
35
|
+
private getPowerpackS3Cache;
|
36
|
+
private getPowerpackSharedCache;
|
37
|
+
private getPowerpackGcsCache;
|
38
|
+
private getPowerpackAzureCache;
|
39
|
+
private getPowerpackCache;
|
40
40
|
private resolvePackage;
|
41
41
|
private assertCacheIsValid;
|
42
42
|
}
|
@@ -155,38 +155,26 @@ class DbCache {
|
|
155
155
|
}
|
156
156
|
}
|
157
157
|
else {
|
158
|
-
return ((await this.
|
159
|
-
(await this.
|
160
|
-
(await this.
|
161
|
-
(await this.
|
158
|
+
return ((await this.getPowerpackS3Cache()) ??
|
159
|
+
(await this.getPowerpackSharedCache()) ??
|
160
|
+
(await this.getPowerpackGcsCache()) ??
|
161
|
+
(await this.getPowerpackAzureCache()) ??
|
162
162
|
null);
|
163
163
|
}
|
164
164
|
}
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
return this.
|
170
|
-
}
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
return this.
|
176
|
-
}
|
177
|
-
async
|
178
|
-
const cache = await this.resolveRemoteCache('@nx/gcs-cache');
|
179
|
-
if (cache)
|
180
|
-
return cache;
|
181
|
-
return this.resolveRemoteCache('@nx/powerpack-gcs-cache');
|
182
|
-
}
|
183
|
-
async getAzureCache() {
|
184
|
-
const cache = await this.resolveRemoteCache('@nx/azure-cache');
|
185
|
-
if (cache)
|
186
|
-
return cache;
|
187
|
-
return this.resolveRemoteCache('@nx/powerpack-azure-cache');
|
188
|
-
}
|
189
|
-
async resolveRemoteCache(pkg) {
|
165
|
+
getPowerpackS3Cache() {
|
166
|
+
return this.getPowerpackCache('@nx/powerpack-s3-cache');
|
167
|
+
}
|
168
|
+
getPowerpackSharedCache() {
|
169
|
+
return this.getPowerpackCache('@nx/powerpack-shared-fs-cache');
|
170
|
+
}
|
171
|
+
getPowerpackGcsCache() {
|
172
|
+
return this.getPowerpackCache('@nx/powerpack-gcs-cache');
|
173
|
+
}
|
174
|
+
getPowerpackAzureCache() {
|
175
|
+
return this.getPowerpackCache('@nx/powerpack-azure-cache');
|
176
|
+
}
|
177
|
+
async getPowerpackCache(pkg) {
|
190
178
|
let getRemoteCache = null;
|
191
179
|
try {
|
192
180
|
getRemoteCache = (await Promise.resolve(`${this.resolvePackage(pkg)}`).then(s => require(s))).getRemoteCache;
|
@@ -36,7 +36,7 @@ const task_results_life_cycle_1 = require("./life-cycles/task-results-life-cycle
|
|
36
36
|
const task_graph_utils_1 = require("./task-graph-utils");
|
37
37
|
const utils_1 = require("./utils");
|
38
38
|
const chalk = require("chalk");
|
39
|
-
const
|
39
|
+
const powerpack_1 = require("../utils/powerpack");
|
40
40
|
const tasks_execution_hooks_1 = require("../project-graph/plugins/tasks-execution-hooks");
|
41
41
|
async function getTerminalOutputLifeCycle(initiatingProject, projectNames, tasks, nxArgs, nxJson, overrides) {
|
42
42
|
const { runnerOptions } = getRunner(nxArgs, nxJson);
|
@@ -141,7 +141,7 @@ async function runCommandForTasks(projectsToRun, currentProjectGraph, { nxJson }
|
|
141
141
|
initiatingProject,
|
142
142
|
});
|
143
143
|
await renderIsDone;
|
144
|
-
await (0,
|
144
|
+
await (0, powerpack_1.printPowerpackLicense)();
|
145
145
|
return taskResults;
|
146
146
|
}
|
147
147
|
async function ensureWorkspaceIsInSyncAndGetGraphs(projectGraph, nxJson, projectNames, nxArgs, overrides, extraTargetDependencies, extraOptions) {
|
@@ -0,0 +1,5 @@
|
|
1
|
+
export declare function printPowerpackLicense(): Promise<void>;
|
2
|
+
export declare function getPowerpackLicenseInformation(): Promise<import("@nx/powerpack-license").PowerpackLicense>;
|
3
|
+
export declare class NxPowerpackNotInstalledError extends Error {
|
4
|
+
constructor(e: Error);
|
5
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.NxPowerpackNotInstalledError = void 0;
|
4
|
+
exports.printPowerpackLicense = printPowerpackLicense;
|
5
|
+
exports.getPowerpackLicenseInformation = getPowerpackLicenseInformation;
|
6
|
+
const logger_1 = require("./logger");
|
7
|
+
const package_manager_1 = require("./package-manager");
|
8
|
+
const workspace_root_1 = require("./workspace-root");
|
9
|
+
async function printPowerpackLicense() {
|
10
|
+
try {
|
11
|
+
const { organizationName, seatCount, workspaceCount } = await getPowerpackLicenseInformation();
|
12
|
+
logger_1.logger.log(`Nx Powerpack Licensed to ${organizationName} for ${seatCount} user${seatCount > 1 ? 's' : ''} in ${workspaceCount === 9999 ? 'an unlimited number of' : workspaceCount} workspace${workspaceCount > 1 ? 's' : ''}`);
|
13
|
+
}
|
14
|
+
catch { }
|
15
|
+
}
|
16
|
+
async function getPowerpackLicenseInformation() {
|
17
|
+
try {
|
18
|
+
const { getPowerpackLicenseInformation, getPowerpackLicenseInformationAsync, } = (await Promise.resolve().then(() => require('@nx/powerpack-license')));
|
19
|
+
return (getPowerpackLicenseInformationAsync ?? getPowerpackLicenseInformation)(workspace_root_1.workspaceRoot);
|
20
|
+
}
|
21
|
+
catch (e) {
|
22
|
+
if ('code' in e && e.code === 'MODULE_NOT_FOUND') {
|
23
|
+
throw new NxPowerpackNotInstalledError(e);
|
24
|
+
}
|
25
|
+
throw e;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
class NxPowerpackNotInstalledError extends Error {
|
29
|
+
constructor(e) {
|
30
|
+
super(`The "@nx/powerpack-license" package is needed to use Nx Powerpack enabled features. Please install the @nx/powerpack-license with ${(0, package_manager_1.getPackageManagerCommand)().addDev} @nx/powerpack-license`, { cause: e });
|
31
|
+
}
|
32
|
+
}
|
33
|
+
exports.NxPowerpackNotInstalledError = NxPowerpackNotInstalledError;
|
package/src/utils/nx-key.d.ts
DELETED
package/src/utils/nx-key.js
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.NxKeyNotInstalledError = void 0;
|
4
|
-
exports.printNxKey = printNxKey;
|
5
|
-
exports.getNxKeyInformation = getNxKeyInformation;
|
6
|
-
const logger_1 = require("./logger");
|
7
|
-
const package_manager_1 = require("./package-manager");
|
8
|
-
const workspace_root_1 = require("./workspace-root");
|
9
|
-
async function printNxKey() {
|
10
|
-
try {
|
11
|
-
const { organizationName, seatCount, workspaceCount } = await getNxKeyInformation();
|
12
|
-
logger_1.logger.log(`Nx key licensed to ${organizationName} for ${seatCount} user${seatCount > 1 ? 's' : ''} in ${workspaceCount === 9999 ? 'an unlimited number of' : workspaceCount} workspace${workspaceCount > 1 ? 's' : ''}`);
|
13
|
-
}
|
14
|
-
catch { }
|
15
|
-
}
|
16
|
-
async function getNxKeyInformation() {
|
17
|
-
try {
|
18
|
-
const { getPowerpackLicenseInformation, getPowerpackLicenseInformationAsync, } = (await Promise.resolve().then(() => require('@nx/powerpack-license')));
|
19
|
-
return (getPowerpackLicenseInformationAsync ?? getPowerpackLicenseInformation)(workspace_root_1.workspaceRoot);
|
20
|
-
}
|
21
|
-
catch (e) {
|
22
|
-
try {
|
23
|
-
const { getNxKeyInformationAsync } = (await Promise.resolve().then(() => require('@nx/key')));
|
24
|
-
return getNxKeyInformationAsync(workspace_root_1.workspaceRoot);
|
25
|
-
}
|
26
|
-
catch (e) {
|
27
|
-
if ('code' in e && e.code === 'MODULE_NOT_FOUND') {
|
28
|
-
throw new NxKeyNotInstalledError(e);
|
29
|
-
}
|
30
|
-
throw e;
|
31
|
-
}
|
32
|
-
}
|
33
|
-
}
|
34
|
-
class NxKeyNotInstalledError extends Error {
|
35
|
-
constructor(e) {
|
36
|
-
super(`The "@nx/key" package is needed to use Nx key enabled features. Please install it with ${(0, package_manager_1.getPackageManagerCommand)().addDev} @nx/key`, { cause: e });
|
37
|
-
}
|
38
|
-
}
|
39
|
-
exports.NxKeyNotInstalledError = NxKeyNotInstalledError;
|