@@ -2,37 +2,51 @@ import { execSync } from 'node:child_process';
2
2
import { isCI } from '../ci/is-ci' ;
3
3
import { getPackageManagerCommand } from '../package-manager' ;
4
4
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
+ ] ;
6
14
7
- const messageOptions = {
15
+ const messageOptions : Record < string , MessageData [ ] > = {
8
16
setupCI : [
9
17
{
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 ,
13
21
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' } ,
18
28
] ,
19
29
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' } ,
23
32
} ,
24
33
{
25
34
code : 'set-up-ci' ,
26
35
message : `Set up CI with caching, distribution and test deflaking` ,
27
36
initial : 0 ,
28
37
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' } ,
32
47
] ,
33
48
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' ,
36
50
fallback : { value : 'skip' , key : 'setupNxCloud' } ,
37
51
} ,
38
52
] ,
@@ -51,10 +65,18 @@ const messageOptions = {
51
65
fallback : undefined ,
52
66
} ,
53
67
] ,
54
- } as const ;
68
+ } ;
55
69
56
70
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
+ }
58
80
59
81
export class PromptMessages {
60
82
private selectedMessages : { [ key in MessageKey ] ?: number } = { } ;
0 commit comments