Skip to content

Commit 92e09d9

Browse files
authored
fix(misc): adjust nx cloud ab test (#26866)
<!-- 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 --> ![image](https://github.com/nrwl/nx/assets/8104246/98c3b475-d213-4e81-8c80-4010714ad4f7) ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ![image](https://github.com/nrwl/nx/assets/8104246/2a67ae6b-2718-45f3-adfe-2dcc88c8ecbd) ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #
1 parent 3e0d2de commit 92e09d9

File tree

3 files changed

+45
-23
lines changed

3 files changed

+45
-23
lines changed

docs/generated/cli/create-nx-workspace.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ Generate a 'src/' directory for Next.js
121121

122122
Type: `string`
123123

124-
Choices: [yes, github, circleci, skip]
124+
Choices: [github, circleci, gitlab, azure, bitbucket, skip, yes]
125125

126-
Do you want Nx Cloud to make your CI fast?
126+
Which CI provider would you like to use?
127127

128128
### packageManager
129129

docs/generated/packages/nx/documents/create-nx-workspace.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ Generate a 'src/' directory for Next.js
121121

122122
Type: `string`
123123

124-
Choices: [yes, github, circleci, skip]
124+
Choices: [github, circleci, gitlab, azure, bitbucket, skip, yes]
125125

126-
Do you want Nx Cloud to make your CI fast?
126+
Which CI provider would you like to use?
127127

128128
### packageManager
129129

packages/create-nx-workspace/src/utils/nx/ab-testing.ts

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,51 @@ import { execSync } from 'node:child_process';
22
import { isCI } from '../ci/is-ci';
33
import { getPackageManagerCommand } from '../package-manager';
44

5-
export const NxCloudChoices = ['yes', 'github', 'circleci', 'skip'];
5+
export const NxCloudChoices = [
6+
'github',
7+
'circleci',
8+
'gitlab',
9+
'azure',
10+
'bitbucket',
11+
'skip',
12+
'yes', // Deprecated but still handled
13+
];
614

7-
const messageOptions = {
15+
const messageOptions: Record<string, MessageData[]> = {
816
setupCI: [
917
{
10-
code: 'enable-nx-cloud',
11-
message: `Do you want Nx Cloud to make your CI fast?`,
12-
initial: 1,
18+
code: 'which-ci-provider',
19+
message: `Which CI provider would you like to use?`,
20+
initial: 0,
1321
choices: [
14-
{ value: 'yes', name: 'Yes, enable Nx Cloud' },
15-
{ value: 'github', name: 'Yes, configure Nx Cloud for GitHub Actions' },
16-
{ value: 'circleci', name: 'Yes, configure Nx Cloud for Circle CI' },
17-
{ value: 'skip', name: 'Skip for now' },
22+
{ value: 'github', name: 'GitHub Actions' },
23+
{ value: 'circleci', name: 'Circle CI' },
24+
{ value: 'gitlab', name: 'Gitlab' },
25+
{ value: 'azure', name: 'Azure DevOps' },
26+
{ value: 'bitbucket', name: 'BitBucket Pipelines' },
27+
{ value: 'skip', name: '\nDo it later' },
1828
],
1929
footer:
20-
'\nWatch a short video on Nx Cloud at https://nx.dev/ci/intro/why-nx-cloud',
21-
hint: `\n(it's free and can be disabled any time)`,
22-
fallback: undefined,
30+
'\nRemote caching, task distribution, and test splitting are provided by Nx Cloud. Read more at https://nx.dev/ci',
31+
fallback: { value: 'skip', key: 'setupNxCloud' },
2332
},
2433
{
2534
code: 'set-up-ci',
2635
message: `Set up CI with caching, distribution and test deflaking`,
2736
initial: 0,
2837
choices: [
29-
{ value: 'github', name: 'Yes, for GitHub Actions with Nx Cloud' },
30-
{ value: 'circleci', name: 'Yes, for CircleCI with Nx Cloud' },
31-
{ value: 'skip', name: 'Skip for now' },
38+
{ value: 'github', name: 'GitHub Actions' },
39+
{ value: 'circleci', name: 'CircleCI' },
40+
{ value: 'gitlab', name: 'Gitlab' },
41+
{ value: 'azure', name: 'Azure DevOps' },
42+
{
43+
value: 'bitbucket',
44+
name: 'BitBucket Pipelines',
45+
},
46+
{ value: 'skip', name: '\nDo it later' },
3247
],
3348
footer:
34-
'\nWatch a short video on Nx Cloud at https://nx.dev/ci/intro/why-nx-cloud',
35-
hint: `\n(it's free and can be disabled any time)`,
49+
'\nRemote caching, task distribution, and test splitting are provided by Nx Cloud. Read more at https://nx.dev/ci',
3650
fallback: { value: 'skip', key: 'setupNxCloud' },
3751
},
3852
],
@@ -51,10 +65,18 @@ const messageOptions = {
5165
fallback: undefined,
5266
},
5367
],
54-
} as const;
68+
};
5569

5670
export type MessageKey = keyof typeof messageOptions;
57-
type MessageData = (typeof messageOptions)[MessageKey][number];
71+
interface MessageData {
72+
code: string;
73+
message: string;
74+
initial: number;
75+
choices: Array<{ value: string; name: string }>;
76+
footer: string;
77+
hint?: string;
78+
fallback?: { value: string; key: MessageKey };
79+
}
5880

5981
export class PromptMessages {
6082
private selectedMessages: { [key in MessageKey]?: number } = {};

0 commit comments

Comments
 (0)