nx 20.5.0-rc.1 → 20.5.0-rc.3

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 CHANGED
@@ -131,6 +131,7 @@
131
131
  "@nx/nx-win32-arm64-msvc",
132
132
  "@nx/nx-freebsd-x64",
133
133
  "@nx/powerpack-license",
134
+ "@nx/key",
134
135
  // Powerpack plugin conditionally available dynamically at runtime
135
136
  "@nx/powerpack-conformance"
136
137
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "20.5.0-rc.1",
3
+ "version": "20.5.0-rc.3",
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": {
@@ -82,16 +82,16 @@
82
82
  }
83
83
  },
84
84
  "optionalDependencies": {
85
- "@nx/nx-darwin-arm64": "20.5.0-rc.1",
86
- "@nx/nx-darwin-x64": "20.5.0-rc.1",
87
- "@nx/nx-freebsd-x64": "20.5.0-rc.1",
88
- "@nx/nx-linux-arm-gnueabihf": "20.5.0-rc.1",
89
- "@nx/nx-linux-arm64-gnu": "20.5.0-rc.1",
90
- "@nx/nx-linux-arm64-musl": "20.5.0-rc.1",
91
- "@nx/nx-linux-x64-gnu": "20.5.0-rc.1",
92
- "@nx/nx-linux-x64-musl": "20.5.0-rc.1",
93
- "@nx/nx-win32-arm64-msvc": "20.5.0-rc.1",
94
- "@nx/nx-win32-x64-msvc": "20.5.0-rc.1"
85
+ "@nx/nx-darwin-arm64": "20.5.0-rc.3",
86
+ "@nx/nx-darwin-x64": "20.5.0-rc.3",
87
+ "@nx/nx-freebsd-x64": "20.5.0-rc.3",
88
+ "@nx/nx-linux-arm-gnueabihf": "20.5.0-rc.3",
89
+ "@nx/nx-linux-arm64-gnu": "20.5.0-rc.3",
90
+ "@nx/nx-linux-arm64-musl": "20.5.0-rc.3",
91
+ "@nx/nx-linux-x64-gnu": "20.5.0-rc.3",
92
+ "@nx/nx-linux-x64-musl": "20.5.0-rc.3",
93
+ "@nx/nx-win32-arm64-msvc": "20.5.0-rc.3",
94
+ "@nx/nx-win32-x64-msvc": "20.5.0-rc.3"
95
95
  },
96
96
  "nx-migrations": {
97
97
  "migrations": "./migrations.json",
@@ -0,0 +1,2 @@
1
+ import { ActivateKeyOptions } from './command-object';
2
+ export declare function handleActivateKey(options: ActivateKeyOptions): Promise<void>;
@@ -1,33 +1,33 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.handleActivatePowerpack = handleActivatePowerpack;
3
+ exports.handleActivateKey = handleActivateKey;
4
4
  const workspace_root_1 = require("../../utils/workspace-root");
5
5
  const enquirer_1 = require("enquirer");
6
6
  const child_process_1 = require("child_process");
7
7
  const package_manager_1 = require("../../utils/package-manager");
8
- async function handleActivatePowerpack(options) {
9
- const license = options.license ??
8
+ async function handleActivateKey(options) {
9
+ const key = options.key ??
10
10
  (await (0, enquirer_1.prompt)({
11
11
  type: 'input',
12
- name: 'license',
13
- message: 'Enter your License Key',
12
+ name: 'key',
13
+ message: 'Enter your key',
14
14
  }));
15
- const { activatePowerpack } = await requirePowerpack();
16
- activatePowerpack(workspace_root_1.workspaceRoot, license);
15
+ const { activateNxKey } = await requireNxKey();
16
+ activateNxKey(workspace_root_1.workspaceRoot, key);
17
17
  }
18
- async function requirePowerpack() {
18
+ async function requireNxKey() {
19
19
  // @ts-ignore
20
- return Promise.resolve().then(() => require('@nx/powerpack-license')).catch(async (e) => {
20
+ return Promise.resolve().then(() => require('@nx/key')).catch(async (e) => {
21
21
  if ('code' in e && e.code === 'MODULE_NOT_FOUND') {
22
22
  try {
23
- (0, child_process_1.execSync)(`${(0, package_manager_1.getPackageManagerCommand)().addDev} @nx/powerpack-license@latest`, {
23
+ (0, child_process_1.execSync)(`${(0, package_manager_1.getPackageManagerCommand)().addDev} @nx/key@latest`, {
24
24
  windowsHide: false,
25
25
  });
26
26
  // @ts-ignore
27
- return await Promise.resolve().then(() => require('@nx/powerpack-license'));
27
+ return await Promise.resolve().then(() => require('@nx/key'));
28
28
  }
29
29
  catch (e) {
30
- throw new Error('Failed to install @nx/powerpack-license. Please install @nx/powerpack-license and try again.');
30
+ throw new Error('Failed to install @nx/key. Please install @nx/key and try again.');
31
31
  }
32
32
  }
33
33
  });
@@ -0,0 +1,6 @@
1
+ import { CommandModule } from 'yargs';
2
+ export interface ActivateKeyOptions {
3
+ key: string;
4
+ verbose: boolean;
5
+ }
6
+ export declare const yargsActivateKeyCommand: CommandModule<{}, ActivateKeyOptions>;
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.yargsActivatePowerpackCommand = void 0;
3
+ exports.yargsActivateKeyCommand = void 0;
4
4
  const shared_options_1 = require("../yargs-utils/shared-options");
5
5
  const handle_errors_1 = require("../../utils/handle-errors");
6
- exports.yargsActivatePowerpackCommand = {
7
- command: 'activate-powerpack <license>',
6
+ exports.yargsActivateKeyCommand = {
7
+ command: 'activate-key <key>',
8
+ aliases: ['activate-powerpack'],
8
9
  describe: false,
9
10
  // describe: 'Activate a Nx Powerpack license.',
10
11
  builder: (yargs) => (0, shared_options_1.withVerbose)(yargs)
@@ -12,14 +13,14 @@ exports.yargsActivatePowerpackCommand = {
12
13
  'strip-dashed': true,
13
14
  'unknown-options-as-args': true,
14
15
  })
15
- .positional('license', {
16
+ .positional('key', {
16
17
  type: 'string',
17
- description: 'This is a License Key for Nx Powerpack.',
18
+ description: 'This is a key for Nx.',
18
19
  })
19
- .example('$0 activate-powerpack <license key>', 'Activate a Nx Powerpack license'),
20
+ .example('$0 activate-key <key>', 'Activate a Nx key'),
20
21
  handler: async (args) => {
21
22
  const exitCode = await (0, handle_errors_1.handleErrors)(args.verbose, async () => {
22
- return (await Promise.resolve().then(() => require('./activate-powerpack'))).handleActivatePowerpack(args);
23
+ return (await Promise.resolve().then(() => require('./activate-key'))).handleActivateKey(args);
23
24
  });
24
25
  process.exit(exitCode);
25
26
  },
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.commandsObject = exports.parserConfiguration = void 0;
4
4
  const chalk = require("chalk");
5
5
  const yargs = require("yargs");
6
- const command_object_1 = require("./activate-powerpack/command-object");
6
+ const command_object_1 = require("./activate-key/command-object");
7
7
  const command_object_2 = require("./affected/command-object");
8
8
  const command_object_3 = require("./connect/command-object");
9
9
  const command_object_4 = require("./daemon/command-object");
@@ -46,7 +46,7 @@ exports.commandsObject = yargs
46
46
  .parserConfiguration(exports.parserConfiguration)
47
47
  .usage(chalk.bold('Smart Monorepos · Fast CI'))
48
48
  .demandCommand(1, '')
49
- .command(command_object_1.yargsActivatePowerpackCommand)
49
+ .command(command_object_1.yargsActivateKeyCommand)
50
50
  .command(command_object_22.yargsAddCommand)
51
51
  .command(command_object_2.yargsAffectedBuildCommand)
52
52
  .command(command_object_2.yargsAffectedCommand)
@@ -99,7 +99,7 @@ function createMissingConformanceCommand(command) {
99
99
  output_1.output.error({
100
100
  title: `${command} is not available`,
101
101
  bodyLines: [
102
- `In order to use the \`nx ${command}\` command you must have an active Powerpack license and the \`@nx/powerpack-conformance\` plugin installed.`,
102
+ `In order to use the \`nx ${command}\` command you must have an active Nx key and the \`@nx/conformance\` plugin installed.`,
103
103
  '',
104
104
  'To learn more, visit https://nx.dev/nx-enterprise/powerpack/conformance',
105
105
  ],
@@ -110,7 +110,14 @@ function createMissingConformanceCommand(command) {
110
110
  }
111
111
  function resolveConformanceCommandObject() {
112
112
  try {
113
- const { yargsConformanceCommand } = require('@nx/powerpack-conformance');
113
+ const { yargsConformanceCommand } = (() => {
114
+ try {
115
+ return require('@nx/powerpack-conformance');
116
+ }
117
+ catch {
118
+ return require('@nx/conformance');
119
+ }
120
+ })();
114
121
  return yargsConformanceCommand;
115
122
  }
116
123
  catch {
@@ -119,7 +126,14 @@ function resolveConformanceCommandObject() {
119
126
  }
120
127
  function resolveConformanceCheckCommandObject() {
121
128
  try {
122
- const { yargsConformanceCheckCommand, } = require('@nx/powerpack-conformance');
129
+ const { yargsConformanceCheckCommand } = (() => {
130
+ try {
131
+ return require('@nx/powerpack-conformance');
132
+ }
133
+ catch {
134
+ return require('@nx/conformance');
135
+ }
136
+ })();
123
137
  return yargsConformanceCheckCommand;
124
138
  }
125
139
  catch {
@@ -1,7 +1,7 @@
1
1
  import { PackageManager } from '../../utils/package-manager';
2
2
  import { PackageJson } from '../../utils/package-json';
3
3
  import { NxJsonConfiguration } from '../../config/nx-json';
4
- import type { PowerpackLicense } from '@nx/powerpack-license';
4
+ import { type NxKey } from '@nx/key';
5
5
  export declare const packagesWeCareAbout: string[];
6
6
  export declare const patternsWeIgnoreInCommunityReport: Array<string | RegExp>;
7
7
  /**
@@ -16,8 +16,8 @@ export declare function reportHandler(): Promise<void>;
16
16
  export interface ReportData {
17
17
  pm: PackageManager;
18
18
  pmVersion: string;
19
- powerpackLicense: PowerpackLicense | null;
20
- powerpackError: Error | null;
19
+ nxKey: NxKey | null;
20
+ nxKeyError: Error | null;
21
21
  powerpackPlugins: PackageJson[];
22
22
  localPlugins: string[];
23
23
  communityPlugins: PackageJson[];
@@ -21,7 +21,7 @@ const installed_plugins_1 = require("../../utils/plugins/installed-plugins");
21
21
  const installation_directory_1 = require("../../utils/installation-directory");
22
22
  const nx_json_1 = require("../../config/nx-json");
23
23
  const error_types_1 = require("../../project-graph/error-types");
24
- const powerpack_1 = require("../../utils/powerpack");
24
+ const nx_key_1 = require("../../utils/nx-key");
25
25
  const nxPackageJson = (0, fileutils_1.readJsonFile)((0, path_1.join)(__dirname, '../../../package.json'));
26
26
  exports.packagesWeCareAbout = [
27
27
  'lerna',
@@ -46,7 +46,7 @@ const LINE_SEPARATOR = '---------------------------------------';
46
46
  *
47
47
  */
48
48
  async function reportHandler() {
49
- const { pm, pmVersion, powerpackLicense, powerpackError, localPlugins, powerpackPlugins, communityPlugins, registeredPlugins, packageVersionsWeCareAbout, outOfSyncPackageGroup, projectGraphError, nativeTarget, } = await getReportData();
49
+ const { pm, pmVersion, nxKey, nxKeyError, localPlugins, powerpackPlugins, communityPlugins, registeredPlugins, packageVersionsWeCareAbout, outOfSyncPackageGroup, projectGraphError, nativeTarget, } = await getReportData();
50
50
  const fields = [
51
51
  ['Node', process.versions.node],
52
52
  ['OS', `${process.platform}-${process.arch}`],
@@ -61,29 +61,31 @@ async function reportHandler() {
61
61
  packageVersionsWeCareAbout.forEach((p) => {
62
62
  bodyLines.push(`${chalk.green(p.package.padEnd(padding))} : ${chalk.bold(p.version)}`);
63
63
  });
64
- if (powerpackLicense) {
64
+ if (nxKey) {
65
65
  bodyLines.push('');
66
66
  bodyLines.push(LINE_SEPARATOR);
67
- bodyLines.push(chalk.green('Nx Powerpack'));
68
- const licenseExpiryDate = new Date((powerpackLicense.realExpiresAt ?? powerpackLicense.expiresAt) * 1000);
69
- bodyLines.push(`Licensed to ${powerpackLicense.organizationName} for ${powerpackLicense.seatCount} user${powerpackLicense.seatCount > 1 ? 's' : ''} in ${powerpackLicense.workspaceCount === 9999
67
+ bodyLines.push(chalk.green('Nx key licensed packages'));
68
+ bodyLines.push(`Licensed to ${nxKey.organizationName} for ${nxKey.seatCount} user${nxKey.seatCount > 1 ? 's' : ''} in ${nxKey.workspaceCount === 9999
70
69
  ? 'an unlimited number of'
71
- : powerpackLicense.workspaceCount} workspace${powerpackLicense.workspaceCount > 1 ? 's' : ''}.`);
72
- // license is not expired
73
- if (licenseExpiryDate.getTime() >= Date.now()) {
74
- if ('perpetualNxVersion' in powerpackLicense) {
75
- bodyLines.push(`License expires on ${licenseExpiryDate.toLocaleDateString()}, but will continue to work with Nx ${powerpackLicense.perpetualNxVersion} and below.`);
76
- }
77
- else {
78
- bodyLines.push(`License expires on ${licenseExpiryDate.toLocaleDateString()}.`);
79
- }
80
- }
81
- else {
82
- if ('perpetualNxVersion' in powerpackLicense) {
83
- bodyLines.push(`License expired on ${licenseExpiryDate.toLocaleDateString()}, but will continue to work with Nx ${powerpackLicense.perpetualNxVersion} and below.`);
70
+ : nxKey.workspaceCount} workspace${nxKey.workspaceCount > 1 ? 's' : ''}.`);
71
+ if (nxKey.realExpiresAt || nxKey.expiresAt) {
72
+ const licenseExpiryDate = new Date((nxKey.realExpiresAt ?? nxKey.expiresAt) * 1000);
73
+ // license is not expired
74
+ if (licenseExpiryDate.getTime() >= Date.now()) {
75
+ if ('perpetualNxVersion' in nxKey) {
76
+ bodyLines.push(`License expires on ${licenseExpiryDate.toLocaleDateString()}, but will continue to work with Nx ${nxKey.perpetualNxVersion} and below.`);
77
+ }
78
+ else {
79
+ bodyLines.push(`License expires on ${licenseExpiryDate.toLocaleDateString()}.`);
80
+ }
84
81
  }
85
82
  else {
86
- bodyLines.push(`License expired on ${licenseExpiryDate.toLocaleDateString()}.`);
83
+ if ('perpetualNxVersion' in nxKey) {
84
+ bodyLines.push(`License expired on ${licenseExpiryDate.toLocaleDateString()}, but will continue to work with Nx ${nxKey.perpetualNxVersion} and below.`);
85
+ }
86
+ else {
87
+ bodyLines.push(`License expired on ${licenseExpiryDate.toLocaleDateString()}.`);
88
+ }
87
89
  }
88
90
  }
89
91
  bodyLines.push('');
@@ -94,11 +96,11 @@ async function reportHandler() {
94
96
  }
95
97
  bodyLines.push('');
96
98
  }
97
- else if (powerpackError) {
99
+ else if (nxKeyError) {
98
100
  bodyLines.push('');
99
- bodyLines.push(chalk.red('Nx Powerpack'));
101
+ bodyLines.push(chalk.red('Nx key'));
100
102
  bodyLines.push(LINE_SEPARATOR);
101
- bodyLines.push(powerpackError.message);
103
+ bodyLines.push(nxKeyError.message);
102
104
  bodyLines.push('');
103
105
  }
104
106
  if (registeredPlugins.length) {
@@ -165,20 +167,20 @@ async function getReportData() {
165
167
  }
166
168
  const outOfSyncPackageGroup = findMisalignedPackagesForPackage(nxPackageJson);
167
169
  const native = isNativeAvailable();
168
- let powerpackLicense = null;
169
- let powerpackError = null;
170
+ let nxKey = null;
171
+ let nxKeyError = null;
170
172
  try {
171
- powerpackLicense = await (0, powerpack_1.getPowerpackLicenseInformation)();
173
+ nxKey = await (0, nx_key_1.getNxKeyInformation)();
172
174
  }
173
175
  catch (e) {
174
- if (!(e instanceof powerpack_1.NxPowerpackNotInstalledError)) {
175
- powerpackError = e;
176
+ if (!(e instanceof nx_key_1.NxKeyNotInstalledError)) {
177
+ nxKeyError = e;
176
178
  }
177
179
  }
178
180
  return {
179
181
  pm,
180
- powerpackLicense,
181
- powerpackError,
182
+ nxKey,
183
+ nxKeyError,
182
184
  powerpackPlugins,
183
185
  pmVersion,
184
186
  localPlugins,
@@ -256,7 +258,7 @@ function findMisalignedPackagesForPackage(base) {
256
258
  }
257
259
  function findInstalledPowerpackPlugins() {
258
260
  const installedPlugins = (0, installed_plugins_1.findInstalledPlugins)();
259
- return installedPlugins.filter((dep) => new RegExp('@nx/powerpack*').test(dep.name));
261
+ return installedPlugins.filter((dep) => new RegExp('@nx/powerpack*|@nx/(.+)-cache|@nx/(conformance|owners|enterprise*)').test(dep.name));
260
262
  }
261
263
  function findInstalledCommunityPlugins() {
262
264
  const installedPlugins = (0, installed_plugins_1.findInstalledPlugins)();
@@ -74,6 +74,7 @@ export interface ProjectGraphProjectNode {
74
74
  description?: string;
75
75
  };
76
76
  }
77
+ export declare function isProjectGraphProjectNode(node: ProjectGraphProjectNode | ProjectGraphExternalNode): node is ProjectGraphProjectNode;
77
78
  /**
78
79
  * A node describing an external dependency
79
80
  * `name` has as form of:
@@ -85,14 +86,15 @@ export interface ProjectGraphProjectNode {
85
86
  *
86
87
  */
87
88
  export interface ProjectGraphExternalNode {
88
- type: 'npm';
89
- name: `npm:${string}`;
89
+ type: string;
90
+ name: string;
90
91
  data: {
91
92
  version: string;
92
93
  packageName: string;
93
94
  hash?: string;
94
95
  };
95
96
  }
97
+ export declare function isProjectGraphExternalNode(node: ProjectGraphProjectNode | ProjectGraphExternalNode): node is ProjectGraphExternalNode;
96
98
  /**
97
99
  * A dependency between two projects
98
100
  */
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DependencyType = void 0;
4
4
  exports.fileDataDepTarget = fileDataDepTarget;
5
5
  exports.fileDataDepType = fileDataDepType;
6
+ exports.isProjectGraphProjectNode = isProjectGraphProjectNode;
7
+ exports.isProjectGraphExternalNode = isProjectGraphExternalNode;
6
8
  function fileDataDepTarget(dep) {
7
9
  return typeof dep === 'string'
8
10
  ? dep
@@ -35,3 +37,9 @@ var DependencyType;
35
37
  */
36
38
  DependencyType["implicit"] = "implicit";
37
39
  })(DependencyType || (exports.DependencyType = DependencyType = {}));
40
+ function isProjectGraphProjectNode(node) {
41
+ return node.type === 'app' || node.type === 'e2e' || node.type === 'lib';
42
+ }
43
+ function isProjectGraphExternalNode(node) {
44
+ return isProjectGraphProjectNode(node) === false;
45
+ }
@@ -10,6 +10,7 @@
10
10
  */
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.serverLogger = void 0;
13
+ const versions_1 = require("../../utils/versions");
13
14
  class ServerLogger {
14
15
  log(...s) {
15
16
  console.log(this.formatLogMessage(`${s
@@ -28,7 +29,7 @@ class ServerLogger {
28
29
  this.log(`[WATCHER]: ${s.join(' ')}`);
29
30
  }
30
31
  formatLogMessage(message) {
31
- return `[NX Daemon Server] - ${this.getNow()} - ${message}`;
32
+ return `[NX v${versions_1.nxVersion} Daemon Server] - ${this.getNow()} - ${message}`;
32
33
  }
33
34
  getNow() {
34
35
  return new Date(Date.now()).toISOString();
Binary file
@@ -32,11 +32,11 @@ export declare class DbCache {
32
32
  temporaryOutputPath(task: Task): string;
33
33
  private getRemoteCache;
34
34
  private _getRemoteCache;
35
- private getPowerpackS3Cache;
36
- private getPowerpackSharedCache;
37
- private getPowerpackGcsCache;
38
- private getPowerpackAzureCache;
39
- private getPowerpackCache;
35
+ private getS3Cache;
36
+ private getSharedCache;
37
+ private getGcsCache;
38
+ private getAzureCache;
39
+ private resolveRemoteCache;
40
40
  private resolvePackage;
41
41
  private assertCacheIsValid;
42
42
  }
@@ -155,26 +155,38 @@ class DbCache {
155
155
  }
156
156
  }
157
157
  else {
158
- return ((await this.getPowerpackS3Cache()) ??
159
- (await this.getPowerpackSharedCache()) ??
160
- (await this.getPowerpackGcsCache()) ??
161
- (await this.getPowerpackAzureCache()) ??
158
+ return ((await this.getS3Cache()) ??
159
+ (await this.getSharedCache()) ??
160
+ (await this.getGcsCache()) ??
161
+ (await this.getAzureCache()) ??
162
162
  null);
163
163
  }
164
164
  }
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) {
165
+ async getS3Cache() {
166
+ const cache = await this.resolveRemoteCache('@nx/s3-cache');
167
+ if (cache)
168
+ return cache;
169
+ return this.resolveRemoteCache('@nx/powerpack-s3-cache');
170
+ }
171
+ async getSharedCache() {
172
+ const cache = await this.resolveRemoteCache('@nx/shared-fs-cache');
173
+ if (cache)
174
+ return cache;
175
+ return this.resolveRemoteCache('@nx/powerpack-shared-fs-cache');
176
+ }
177
+ async getGcsCache() {
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) {
178
190
  let getRemoteCache = null;
179
191
  try {
180
192
  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 powerpack_1 = require("../utils/powerpack");
39
+ const nx_key_1 = require("../utils/nx-key");
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, powerpack_1.printPowerpackLicense)();
144
+ await (0, nx_key_1.printNxKey)();
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 printNxKey(): Promise<void>;
2
+ export declare function getNxKeyInformation(): Promise<any>;
3
+ export declare class NxKeyNotInstalledError extends Error {
4
+ constructor(e: Error);
5
+ }
@@ -0,0 +1,39 @@
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;
@@ -1,2 +0,0 @@
1
- import { ActivatePowerpackOptions } from './command-object';
2
- export declare function handleActivatePowerpack(options: ActivatePowerpackOptions): Promise<void>;
@@ -1,6 +0,0 @@
1
- import { CommandModule } from 'yargs';
2
- export interface ActivatePowerpackOptions {
3
- license: string;
4
- verbose: boolean;
5
- }
6
- export declare const yargsActivatePowerpackCommand: CommandModule<{}, ActivatePowerpackOptions>;
@@ -1,5 +0,0 @@
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
- }
@@ -1,33 +0,0 @@
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;