create-nx-workspace 23.0.0 → 23.1.0-beta.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/README.md CHANGED
@@ -7,13 +7,12 @@
7
7
 
8
8
  <div style="text-align: center;">
9
9
 
10
- [![CircleCI](https://circleci.com/gh/nrwl/nx.svg?style=svg)](https://circleci.com/gh/nrwl/nx)
11
10
  [![License](https://img.shields.io/npm/l/@nx/workspace.svg?style=flat-square)]()
12
11
  [![NPM Version](https://badge.fury.io/js/nx.svg)](https://www.npmjs.com/package/nx)
13
12
  [![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)]()
14
13
  [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
15
- [![Join the chat at https://gitter.im/nrwl-nx/community](https://badges.gitter.im/nrwl-nx/community.svg)](https://gitter.im/nrwl-nx/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
16
14
  [![Join us on the Official Nx Discord Server](https://img.shields.io/discord/1143497901675401286?label=discord)](https://go.nx.dev/community)
15
+ [![Nx Sandboxing](https://staging.nx.app/workspaces/62d013ea0852fe0a2df74438/sandbox-badge.svg)](https://nx.dev/docs/features/ci-features/sandboxing)
17
16
 
18
17
  </div>
19
18
 
@@ -71,6 +71,6 @@ export interface CreateWorkspaceOptions {
71
71
  */
72
72
  trustThirdPartyPreset?: boolean;
73
73
  }
74
- export declare const supportedAgents: readonly ["claude", "codex", "copilot", "cursor", "gemini", "opencode"];
74
+ export declare const supportedAgents: readonly ['claude', 'codex', 'copilot', 'cursor', 'gemini', 'opencode'];
75
75
  export type Agent = (typeof supportedAgents)[number];
76
76
  export declare const agentDisplayMap: Record<Agent, string>;
@@ -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 medium, so the link is a single
6
+ * baked constant embedded directly in the footers. Visible text stays the clean
7
+ * `NX_CLOUD_URL` while clicks carry UTM attribution; terminals without OSC 8
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 medium, so the link is a single
21
+ * baked constant embedded directly in the footers. Visible text stays the clean
22
+ * `NX_CLOUD_URL` while clicks carry UTM attribution; terminals without OSC 8
23
+ * 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=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: '\nSelf-healing CI, remote caching, and task distribution are provided by Nx Cloud: https://nx.dev/nx-cloud',
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: '\nAutomatically fix broken PRs, 70% faster CI: https://nx.dev/nx-cloud',
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: '\nFree for small teams. Remote caching and task distribution. 2-minute setup: https://nx.dev/nx-cloud',
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
  },
@@ -11,13 +11,13 @@ export type BannerVariant = '0' | '2';
11
11
  */
12
12
  declare const completionMessages: {
13
13
  readonly 'ci-setup': {
14
- readonly title: "Your CI setup is almost complete.";
14
+ readonly title: 'Your CI setup is almost complete.';
15
15
  };
16
16
  readonly 'cache-setup': {
17
- readonly title: "Your remote cache setup is almost complete.";
17
+ readonly title: 'Your remote cache setup is almost complete.';
18
18
  };
19
19
  readonly 'platform-setup': {
20
- readonly title: "Your platform setup is almost complete.";
20
+ readonly title: 'Your platform setup is almost complete.';
21
21
  };
22
22
  };
23
23
  export type CompletionMessageKey = keyof typeof completionMessages;
@@ -1,4 +1,4 @@
1
- export declare const packageManagerList: readonly ["pnpm", "yarn", "npm", "bun"];
1
+ export declare const packageManagerList: readonly ['pnpm', 'yarn', 'npm', 'bun'];
2
2
  export type PackageManager = (typeof packageManagerList)[number];
3
3
  export declare function detectPackageManager(dir?: string): PackageManager;
4
4
  /**
@@ -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.0",
3
+ "version": "23.1.0-beta.0",
4
4
  "private": false,
5
5
  "description": "Smart Monorepos · Fast Builds",
6
6
  "repository": {
@@ -43,7 +43,7 @@
43
43
  "flat": "^5.0.2",
44
44
  "open": "^8.4.0",
45
45
  "ora": "^5.3.0",
46
- "tmp": "~0.2.6",
46
+ "tmp": "~0.2.7",
47
47
  "tslib": "^2.3.0",
48
48
  "yargs": "^17.6.2"
49
49
  },