create-nx-workspace 23.0.0 → 23.0.2
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/README.md
CHANGED
|
@@ -7,13 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
<div style="text-align: center;">
|
|
9
9
|
|
|
10
|
-
[](https://circleci.com/gh/nrwl/nx)
|
|
11
10
|
[]()
|
|
12
11
|
[](https://www.npmjs.com/package/nx)
|
|
13
12
|
[]()
|
|
14
13
|
[](http://commitizen.github.io/cz-cli/)
|
|
15
|
-
[](https://gitter.im/nrwl-nx/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
16
14
|
[](https://go.nx.dev/community)
|
|
15
|
+
[](https://nx.dev/docs/features/ci-features/sandboxing)
|
|
17
16
|
|
|
18
17
|
</div>
|
|
19
18
|
|
|
@@ -417,9 +417,6 @@ async function normalizeArgsMiddleware(argv) {
|
|
|
417
417
|
argv.name = ai_output_1.SUGGESTED_WORKSPACE_NAME;
|
|
418
418
|
(0, ai_output_1.logProgress)('starting', `Using workspace name: ${argv.name} (if directory exists, re-run with a different name like my-nx-repo-2)`);
|
|
419
419
|
}
|
|
420
|
-
// Always enable Nx Cloud for AI agents - ignore --nxCloud=skip since the AI
|
|
421
|
-
// may pass it without asking the user. Nx Cloud is required for the full experience.
|
|
422
|
-
argv.nxCloud = 'yes';
|
|
423
420
|
// Skip GitHub push prompts in AI mode - we'll provide instructions in the success output
|
|
424
421
|
argv.skipGitHubPush = true;
|
|
425
422
|
}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import type { BannerVariant, CompletionMessageKey } from './messages';
|
|
2
|
+
export declare const NX_CLOUD_URL = "https://nx.dev/nx-cloud";
|
|
3
|
+
/**
|
|
4
|
+
* Clickable Nx Cloud marketing link for cloud prompt footers. Every
|
|
5
|
+
* create-nx-workspace prompt reports the same content tag, so the link is a
|
|
6
|
+
* single baked constant embedded directly in the footers. Visible text stays
|
|
7
|
+
* the clean `NX_CLOUD_URL` while clicks carry UTM attribution; terminals
|
|
8
|
+
* without OSC 8 support just render the bare URL (CLOUD-4642).
|
|
9
|
+
*/
|
|
10
|
+
export declare const NX_CLOUD_HYPERLINK: string;
|
|
2
11
|
/**
|
|
3
12
|
* Returns the flow variant for tracking (0, 1, or 2).
|
|
4
13
|
* Returns '0' for docs generation to preserve deterministic output.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.messages = exports.PromptMessages = exports.NxCloudChoices = void 0;
|
|
3
|
+
exports.messages = exports.PromptMessages = exports.NxCloudChoices = exports.NX_CLOUD_HYPERLINK = exports.NX_CLOUD_URL = void 0;
|
|
4
4
|
exports.getFlowVariant = getFlowVariant;
|
|
5
5
|
exports.getCompletionMessageKeyForVariant = getCompletionMessageKeyForVariant;
|
|
6
6
|
exports.isEnterpriseCloudUrl = isEnterpriseCloudUrl;
|
|
@@ -13,6 +13,16 @@ const node_path_1 = require("node:path");
|
|
|
13
13
|
const node_os_1 = require("node:os");
|
|
14
14
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
15
15
|
const is_ci_1 = require("../ci/is-ci");
|
|
16
|
+
const terminal_link_1 = require("../terminal-link");
|
|
17
|
+
exports.NX_CLOUD_URL = 'https://nx.dev/nx-cloud';
|
|
18
|
+
/**
|
|
19
|
+
* Clickable Nx Cloud marketing link for cloud prompt footers. Every
|
|
20
|
+
* create-nx-workspace prompt reports the same content tag, so the link is a
|
|
21
|
+
* single baked constant embedded directly in the footers. Visible text stays
|
|
22
|
+
* the clean `NX_CLOUD_URL` while clicks carry UTM attribution; terminals
|
|
23
|
+
* without OSC 8 support just render the bare URL (CLOUD-4642).
|
|
24
|
+
*/
|
|
25
|
+
exports.NX_CLOUD_HYPERLINK = (0, terminal_link_1.terminalLink)(exports.NX_CLOUD_URL, `${exports.NX_CLOUD_URL}?utm_source=nx-cli&utm_medium=cli&utm_campaign=nx-cloud-connect&utm_content=create-nx-workspace`);
|
|
16
26
|
// Flow variant controls both tracking and banner display (CLOUD-4235)
|
|
17
27
|
// Variants: 0 = control, 1 = updated prompt, 2 = no prompt (auto-connect)
|
|
18
28
|
const FLOW_VARIANT_CACHE_FILE = (0, node_path_1.join)((0, node_os_1.tmpdir)(), 'nx-cnw-flow-variant');
|
|
@@ -167,7 +177,7 @@ const messageOptions = {
|
|
|
167
177
|
{ value: 'circleci', name: 'Circle CI' },
|
|
168
178
|
{ value: 'skip', name: '\nDo it later' },
|
|
169
179
|
],
|
|
170
|
-
footer:
|
|
180
|
+
footer: `\nSelf-healing CI, remote caching, and task distribution are provided by Nx Cloud: ${exports.NX_CLOUD_HYPERLINK}`,
|
|
171
181
|
fallback: { value: 'skip', key: 'setupNxCloud' },
|
|
172
182
|
completionMessage: 'ci-setup',
|
|
173
183
|
},
|
|
@@ -185,7 +195,7 @@ const messageOptions = {
|
|
|
185
195
|
{ value: 'yes', name: 'Yes' },
|
|
186
196
|
{ value: 'skip', name: 'Skip' },
|
|
187
197
|
],
|
|
188
|
-
footer:
|
|
198
|
+
footer: `\nAutomatically fix broken PRs, 70% faster CI: ${exports.NX_CLOUD_HYPERLINK}`,
|
|
189
199
|
fallback: undefined,
|
|
190
200
|
completionMessage: 'platform-setup',
|
|
191
201
|
},
|
|
@@ -203,7 +213,7 @@ const messageOptions = {
|
|
|
203
213
|
{ value: 'skip', name: 'Skip for now' },
|
|
204
214
|
{ value: 'never', name: chalk_1.default.dim("No, don't ask again") },
|
|
205
215
|
],
|
|
206
|
-
footer:
|
|
216
|
+
footer: `\nFree for small teams. Remote caching and task distribution. 2-minute setup: ${exports.NX_CLOUD_HYPERLINK}`,
|
|
207
217
|
fallback: undefined,
|
|
208
218
|
completionMessage: 'platform-setup',
|
|
209
219
|
},
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wrap `text` in an OSC 8 hyperlink that points at `url`. Supported terminals
|
|
3
|
+
* render `text` as a clickable link to `url`; everywhere else `text` prints
|
|
4
|
+
* unchanged. This lets us keep tracking querystrings out of the visible output
|
|
5
|
+
* while still attaching them to the link target (CLOUD-4642).
|
|
6
|
+
*/
|
|
7
|
+
export declare function terminalLink(text: string, url: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* Exported for testing. VTE reports versions as a packed integer, e.g. "5402"
|
|
10
|
+
* means 0.54.2; everything else is dot-separated.
|
|
11
|
+
*/
|
|
12
|
+
export declare function parseVersion(versionString?: string): {
|
|
13
|
+
major: number;
|
|
14
|
+
minor: number;
|
|
15
|
+
patch: number;
|
|
16
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Keep in sync with packages/nx/src/utils/terminal-link.ts.
|
|
3
|
+
// create-nx-workspace cannot depend on nx, so this generic OSC 8 helper is
|
|
4
|
+
// intentionally duplicated (same reasoning as output.ts / package-manager.ts).
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.terminalLink = terminalLink;
|
|
7
|
+
exports.parseVersion = parseVersion;
|
|
8
|
+
const OSC = '\u001B]';
|
|
9
|
+
const BEL = '\u0007';
|
|
10
|
+
const SEP = ';';
|
|
11
|
+
/**
|
|
12
|
+
* Wrap `text` in an OSC 8 hyperlink that points at `url`. Supported terminals
|
|
13
|
+
* render `text` as a clickable link to `url`; everywhere else `text` prints
|
|
14
|
+
* unchanged. This lets us keep tracking querystrings out of the visible output
|
|
15
|
+
* while still attaching them to the link target (CLOUD-4642).
|
|
16
|
+
*/
|
|
17
|
+
function terminalLink(text, url) {
|
|
18
|
+
if (!supportsHyperlinks()) {
|
|
19
|
+
return text;
|
|
20
|
+
}
|
|
21
|
+
return [OSC, '8', SEP, SEP, url, BEL, text, OSC, '8', SEP, SEP, BEL].join('');
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Best-effort detection of OSC 8 hyperlink support, adapted from the
|
|
25
|
+
* `supports-hyperlinks` package. Defaults to false when in doubt so we never
|
|
26
|
+
* print raw escape sequences to a terminal that can't render them.
|
|
27
|
+
*/
|
|
28
|
+
function supportsHyperlinks() {
|
|
29
|
+
const env = process.env;
|
|
30
|
+
if (env.FORCE_HYPERLINK !== undefined) {
|
|
31
|
+
return !(env.FORCE_HYPERLINK.length > 0 && parseInt(env.FORCE_HYPERLINK, 10) === 0);
|
|
32
|
+
}
|
|
33
|
+
if (!process.stdout || !process.stdout.isTTY) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
if (process.platform === 'win32') {
|
|
37
|
+
// Only Windows Terminal advertises OSC 8 support reliably.
|
|
38
|
+
return Boolean(env.WT_SESSION);
|
|
39
|
+
}
|
|
40
|
+
if (env.CI || env.TEAMCITY_VERSION) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
if (env.TERM === 'dumb') {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
if (env.TERM_PROGRAM) {
|
|
47
|
+
const version = parseVersion(env.TERM_PROGRAM_VERSION);
|
|
48
|
+
switch (env.TERM_PROGRAM) {
|
|
49
|
+
case 'iTerm.app':
|
|
50
|
+
return version.major === 3 ? version.minor >= 1 : version.major > 3;
|
|
51
|
+
case 'WezTerm':
|
|
52
|
+
return version.major >= 20200620;
|
|
53
|
+
case 'vscode':
|
|
54
|
+
return (version.major > 1 || (version.major === 1 && version.minor >= 72));
|
|
55
|
+
case 'ghostty':
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (env.VTE_VERSION) {
|
|
60
|
+
if (env.VTE_VERSION === '0.50.0') {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
const version = parseVersion(env.VTE_VERSION);
|
|
64
|
+
return version.major > 0 || version.minor >= 50;
|
|
65
|
+
}
|
|
66
|
+
if (env.TERM === 'xterm-kitty') {
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
if (env.TERMINAL_EMULATOR === 'JetBrains-JediTerm') {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Exported for testing. VTE reports versions as a packed integer, e.g. "5402"
|
|
76
|
+
* means 0.54.2; everything else is dot-separated.
|
|
77
|
+
*/
|
|
78
|
+
function parseVersion(versionString = '') {
|
|
79
|
+
if (/^\d{3,4}$/.test(versionString)) {
|
|
80
|
+
const m = /(\d{1,2})(\d{2})/.exec(versionString) ?? [];
|
|
81
|
+
return { major: 0, minor: parseInt(m[1], 10), patch: parseInt(m[2], 10) };
|
|
82
|
+
}
|
|
83
|
+
const [major = 0, minor = 0, patch = 0] = (versionString ?? '')
|
|
84
|
+
.split('.')
|
|
85
|
+
.map((n) => parseInt(n, 10) || 0);
|
|
86
|
+
return { major, minor, patch };
|
|
87
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-nx-workspace",
|
|
3
|
-
"version": "23.0.
|
|
3
|
+
"version": "23.0.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Smart Monorepos · Fast Builds",
|
|
6
6
|
"repository": {
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
},
|
|
38
38
|
"homepage": "https://nx.dev",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"axios": "1.16.
|
|
40
|
+
"axios": "1.16.1",
|
|
41
41
|
"chalk": "^4.1.0",
|
|
42
42
|
"enquirer": "~2.3.6",
|
|
43
43
|
"flat": "^5.0.2",
|
|
44
44
|
"open": "^8.4.0",
|
|
45
45
|
"ora": "^5.3.0",
|
|
46
|
-
"tmp": "~0.2.
|
|
46
|
+
"tmp": "~0.2.7",
|
|
47
47
|
"tslib": "^2.3.0",
|
|
48
48
|
"yargs": "^17.6.2"
|
|
49
49
|
},
|