Skip to content

Commit f248d16

Browse files
authored
fix(core): simplify key registration process (#30405)
<!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #
1 parent 46d55ad commit f248d16

File tree

3 files changed

+72
-96
lines changed

3 files changed

+72
-96
lines changed

package.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,19 @@
7171
"@nuxt/kit": "^3.10.0",
7272
"@nuxt/schema": "^3.10.0",
7373
"@nx/angular": "20.5.0-rc.4",
74-
"@nx/conformance": "1.3.0-beta.7",
7574
"@nx/cypress": "20.5.0-rc.4",
7675
"@nx/devkit": "20.5.0-rc.4",
7776
"@nx/esbuild": "20.5.0-rc.4",
7877
"@nx/eslint": "20.5.0-rc.4",
7978
"@nx/eslint-plugin": "20.5.0-rc.4",
8079
"@nx/jest": "20.5.0-rc.4",
8180
"@nx/js": "20.5.0-rc.4",
82-
"@nx/key": "1.3.0-beta.7",
81+
"@nx/key": "1.3.0-beta.11",
8382
"@nx/next": "20.5.0-rc.4",
8483
"@nx/playwright": "20.5.0-rc.4",
85-
"@nx/powerpack-conformance": "1.3.0-beta.7",
86-
"@nx/powerpack-enterprise-cloud": "1.3.0-beta.7",
87-
"@nx/powerpack-license": "1.3.0-beta.7",
84+
"@nx/powerpack-conformance": "1.3.0-beta.11",
85+
"@nx/powerpack-enterprise-cloud": "1.3.0-beta.11",
86+
"@nx/powerpack-license": "1.3.0-beta.11",
8887
"@nx/react": "20.5.0-rc.4",
8988
"@nx/rsbuild": "20.5.0-rc.4",
9089
"@nx/rspack": "20.5.0-rc.4",
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,8 @@
11
import { workspaceRoot } from '../../utils/workspace-root';
22
import { RegisterOptions } from './command-object';
3-
import { prompt } from 'enquirer';
43
import { requireNxKey } from '../../utils/require-nx-key';
54

65
export async function handleRegister(options: RegisterOptions) {
76
const nxKey = await requireNxKey();
8-
9-
// If a key was provided through options, activate it directly
10-
if (options.key) {
11-
return nxKey.activateNxKey(workspaceRoot, options.key);
12-
}
13-
14-
// Try to auto-register a key
15-
const generatedKey = await nxKey.autoRegisterNxKey(workspaceRoot);
16-
if (generatedKey) {
17-
return;
18-
}
19-
20-
// If auto-registration was skipped, prompt for a key
21-
const { key } = await prompt<{ key: string }>({
22-
type: 'input',
23-
name: 'key',
24-
message: 'Enter your key',
25-
});
26-
27-
return nxKey.activateNxKey(workspaceRoot, key);
7+
return nxKey.registerNxKey(workspaceRoot, options.key);
288
}

0 commit comments

Comments
 (0)