vyriy 0.0.0 → 0.2.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/LICENSE +21 -0
- package/README.md +159 -0
- package/bin/vyriy.d.ts +2 -0
- package/bin/vyriy.js +3 -0
- package/checks/node/index.d.ts +2 -0
- package/checks/node/index.js +1 -0
- package/checks/node/node.d.ts +2 -0
- package/checks/node/node.js +22 -0
- package/checks/node/types.d.ts +11 -0
- package/checks/yarn/index.d.ts +2 -0
- package/checks/yarn/index.js +1 -0
- package/checks/yarn/types.d.ts +7 -0
- package/checks/yarn/yarn.d.ts +2 -0
- package/checks/yarn/yarn.js +40 -0
- package/cli/args/args.d.ts +2 -0
- package/cli/args/args.js +23 -0
- package/cli/args/index.d.ts +2 -0
- package/cli/args/index.js +1 -0
- package/cli/args/types.d.ts +10 -0
- package/cli/cli.d.ts +2 -0
- package/cli/cli.js +49 -0
- package/cli/index.d.ts +3 -0
- package/cli/index.js +2 -0
- package/cli/types.d.ts +4 -0
- package/commands/doctor/doctor.d.ts +2 -0
- package/commands/doctor/doctor.js +20 -0
- package/commands/doctor/index.d.ts +2 -0
- package/commands/doctor/index.js +1 -0
- package/commands/doctor/types.d.ts +8 -0
- package/commands/init/index.d.ts +2 -0
- package/commands/init/index.js +1 -0
- package/commands/init/init.d.ts +2 -0
- package/commands/init/init.js +7 -0
- package/commands/init/types.d.ts +5 -0
- package/commands/new/index.d.ts +2 -0
- package/commands/new/index.js +1 -0
- package/commands/new/new.d.ts +2 -0
- package/commands/new/new.js +32 -0
- package/commands/new/types.d.ts +7 -0
- package/index.d.ts +8 -0
- package/index.js +8 -1
- package/package.json +308 -9
- package/project-plan/api/api.d.ts +6 -0
- package/project-plan/api/api.js +56 -0
- package/project-plan/api/index.d.ts +2 -0
- package/project-plan/api/index.js +1 -0
- package/project-plan/api/types.d.ts +10 -0
- package/project-plan/ci/ci.d.ts +3 -0
- package/project-plan/ci/ci.js +19 -0
- package/project-plan/ci/index.d.ts +2 -0
- package/project-plan/ci/index.js +1 -0
- package/project-plan/ci/types.d.ts +6 -0
- package/project-plan/create/create.d.ts +2 -0
- package/project-plan/create/create.js +133 -0
- package/project-plan/create/index.d.ts +2 -0
- package/project-plan/create/index.js +1 -0
- package/project-plan/create/types.d.ts +13 -0
- package/project-plan/index.d.ts +6 -0
- package/project-plan/index.js +5 -0
- package/project-plan/kind/index.d.ts +2 -0
- package/project-plan/kind/index.js +1 -0
- package/project-plan/kind/kind.d.ts +2 -0
- package/project-plan/kind/kind.js +16 -0
- package/project-plan/kind/types.d.ts +2 -0
- package/project-plan/print/index.d.ts +2 -0
- package/project-plan/print/index.js +1 -0
- package/project-plan/print/print.d.ts +2 -0
- package/project-plan/print/print.js +47 -0
- package/project-plan/print/types.d.ts +2 -0
- package/project-plan/types.d.ts +46 -0
- package/prompts/project-plan/index.d.ts +2 -0
- package/prompts/project-plan/index.js +1 -0
- package/prompts/project-plan/project-plan.d.ts +2 -0
- package/prompts/project-plan/project-plan.js +132 -0
- package/prompts/project-plan/types.d.ts +18 -0
package/package.json
CHANGED
|
@@ -1,13 +1,312 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vyriy",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Interactive project master for calm cloud-ready applications.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./index.js",
|
|
7
|
+
"bin": "./bin/vyriy.js",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/evheniy/vyriy",
|
|
12
|
+
"directory": "packages/vyriy"
|
|
8
13
|
},
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
"types": "./index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./index.d.ts",
|
|
18
|
+
"import": "./index.js",
|
|
19
|
+
"default": "./index.js"
|
|
20
|
+
},
|
|
21
|
+
"./bin/vyriy": {
|
|
22
|
+
"types": "./bin/vyriy.d.ts",
|
|
23
|
+
"import": "./bin/vyriy.js",
|
|
24
|
+
"default": "./bin/vyriy.js"
|
|
25
|
+
},
|
|
26
|
+
"./bin/vyriy.js": {
|
|
27
|
+
"types": "./bin/vyriy.d.ts",
|
|
28
|
+
"import": "./bin/vyriy.js",
|
|
29
|
+
"default": "./bin/vyriy.js"
|
|
30
|
+
},
|
|
31
|
+
"./checks/node/index": {
|
|
32
|
+
"types": "./checks/node/index.d.ts",
|
|
33
|
+
"import": "./checks/node/index.js",
|
|
34
|
+
"default": "./checks/node/index.js"
|
|
35
|
+
},
|
|
36
|
+
"./checks/node/index.js": {
|
|
37
|
+
"types": "./checks/node/index.d.ts",
|
|
38
|
+
"import": "./checks/node/index.js",
|
|
39
|
+
"default": "./checks/node/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./checks/node/node": {
|
|
42
|
+
"types": "./checks/node/node.d.ts",
|
|
43
|
+
"import": "./checks/node/node.js",
|
|
44
|
+
"default": "./checks/node/node.js"
|
|
45
|
+
},
|
|
46
|
+
"./checks/node/node.js": {
|
|
47
|
+
"types": "./checks/node/node.d.ts",
|
|
48
|
+
"import": "./checks/node/node.js",
|
|
49
|
+
"default": "./checks/node/node.js"
|
|
50
|
+
},
|
|
51
|
+
"./checks/yarn/index": {
|
|
52
|
+
"types": "./checks/yarn/index.d.ts",
|
|
53
|
+
"import": "./checks/yarn/index.js",
|
|
54
|
+
"default": "./checks/yarn/index.js"
|
|
55
|
+
},
|
|
56
|
+
"./checks/yarn/index.js": {
|
|
57
|
+
"types": "./checks/yarn/index.d.ts",
|
|
58
|
+
"import": "./checks/yarn/index.js",
|
|
59
|
+
"default": "./checks/yarn/index.js"
|
|
60
|
+
},
|
|
61
|
+
"./checks/yarn/yarn": {
|
|
62
|
+
"types": "./checks/yarn/yarn.d.ts",
|
|
63
|
+
"import": "./checks/yarn/yarn.js",
|
|
64
|
+
"default": "./checks/yarn/yarn.js"
|
|
65
|
+
},
|
|
66
|
+
"./checks/yarn/yarn.js": {
|
|
67
|
+
"types": "./checks/yarn/yarn.d.ts",
|
|
68
|
+
"import": "./checks/yarn/yarn.js",
|
|
69
|
+
"default": "./checks/yarn/yarn.js"
|
|
70
|
+
},
|
|
71
|
+
"./cli/args/args": {
|
|
72
|
+
"types": "./cli/args/args.d.ts",
|
|
73
|
+
"import": "./cli/args/args.js",
|
|
74
|
+
"default": "./cli/args/args.js"
|
|
75
|
+
},
|
|
76
|
+
"./cli/args/args.js": {
|
|
77
|
+
"types": "./cli/args/args.d.ts",
|
|
78
|
+
"import": "./cli/args/args.js",
|
|
79
|
+
"default": "./cli/args/args.js"
|
|
80
|
+
},
|
|
81
|
+
"./cli/args/index": {
|
|
82
|
+
"types": "./cli/args/index.d.ts",
|
|
83
|
+
"import": "./cli/args/index.js",
|
|
84
|
+
"default": "./cli/args/index.js"
|
|
85
|
+
},
|
|
86
|
+
"./cli/args/index.js": {
|
|
87
|
+
"types": "./cli/args/index.d.ts",
|
|
88
|
+
"import": "./cli/args/index.js",
|
|
89
|
+
"default": "./cli/args/index.js"
|
|
90
|
+
},
|
|
91
|
+
"./cli/cli": {
|
|
92
|
+
"types": "./cli/cli.d.ts",
|
|
93
|
+
"import": "./cli/cli.js",
|
|
94
|
+
"default": "./cli/cli.js"
|
|
95
|
+
},
|
|
96
|
+
"./cli/cli.js": {
|
|
97
|
+
"types": "./cli/cli.d.ts",
|
|
98
|
+
"import": "./cli/cli.js",
|
|
99
|
+
"default": "./cli/cli.js"
|
|
100
|
+
},
|
|
101
|
+
"./cli/index": {
|
|
102
|
+
"types": "./cli/index.d.ts",
|
|
103
|
+
"import": "./cli/index.js",
|
|
104
|
+
"default": "./cli/index.js"
|
|
105
|
+
},
|
|
106
|
+
"./cli/index.js": {
|
|
107
|
+
"types": "./cli/index.d.ts",
|
|
108
|
+
"import": "./cli/index.js",
|
|
109
|
+
"default": "./cli/index.js"
|
|
110
|
+
},
|
|
111
|
+
"./commands/doctor/doctor": {
|
|
112
|
+
"types": "./commands/doctor/doctor.d.ts",
|
|
113
|
+
"import": "./commands/doctor/doctor.js",
|
|
114
|
+
"default": "./commands/doctor/doctor.js"
|
|
115
|
+
},
|
|
116
|
+
"./commands/doctor/doctor.js": {
|
|
117
|
+
"types": "./commands/doctor/doctor.d.ts",
|
|
118
|
+
"import": "./commands/doctor/doctor.js",
|
|
119
|
+
"default": "./commands/doctor/doctor.js"
|
|
120
|
+
},
|
|
121
|
+
"./commands/doctor/index": {
|
|
122
|
+
"types": "./commands/doctor/index.d.ts",
|
|
123
|
+
"import": "./commands/doctor/index.js",
|
|
124
|
+
"default": "./commands/doctor/index.js"
|
|
125
|
+
},
|
|
126
|
+
"./commands/doctor/index.js": {
|
|
127
|
+
"types": "./commands/doctor/index.d.ts",
|
|
128
|
+
"import": "./commands/doctor/index.js",
|
|
129
|
+
"default": "./commands/doctor/index.js"
|
|
130
|
+
},
|
|
131
|
+
"./commands/init/index": {
|
|
132
|
+
"types": "./commands/init/index.d.ts",
|
|
133
|
+
"import": "./commands/init/index.js",
|
|
134
|
+
"default": "./commands/init/index.js"
|
|
135
|
+
},
|
|
136
|
+
"./commands/init/index.js": {
|
|
137
|
+
"types": "./commands/init/index.d.ts",
|
|
138
|
+
"import": "./commands/init/index.js",
|
|
139
|
+
"default": "./commands/init/index.js"
|
|
140
|
+
},
|
|
141
|
+
"./commands/init/init": {
|
|
142
|
+
"types": "./commands/init/init.d.ts",
|
|
143
|
+
"import": "./commands/init/init.js",
|
|
144
|
+
"default": "./commands/init/init.js"
|
|
145
|
+
},
|
|
146
|
+
"./commands/init/init.js": {
|
|
147
|
+
"types": "./commands/init/init.d.ts",
|
|
148
|
+
"import": "./commands/init/init.js",
|
|
149
|
+
"default": "./commands/init/init.js"
|
|
150
|
+
},
|
|
151
|
+
"./commands/new/index": {
|
|
152
|
+
"types": "./commands/new/index.d.ts",
|
|
153
|
+
"import": "./commands/new/index.js",
|
|
154
|
+
"default": "./commands/new/index.js"
|
|
155
|
+
},
|
|
156
|
+
"./commands/new/index.js": {
|
|
157
|
+
"types": "./commands/new/index.d.ts",
|
|
158
|
+
"import": "./commands/new/index.js",
|
|
159
|
+
"default": "./commands/new/index.js"
|
|
160
|
+
},
|
|
161
|
+
"./commands/new/new": {
|
|
162
|
+
"types": "./commands/new/new.d.ts",
|
|
163
|
+
"import": "./commands/new/new.js",
|
|
164
|
+
"default": "./commands/new/new.js"
|
|
165
|
+
},
|
|
166
|
+
"./commands/new/new.js": {
|
|
167
|
+
"types": "./commands/new/new.d.ts",
|
|
168
|
+
"import": "./commands/new/new.js",
|
|
169
|
+
"default": "./commands/new/new.js"
|
|
170
|
+
},
|
|
171
|
+
"./index": {
|
|
172
|
+
"types": "./index.d.ts",
|
|
173
|
+
"import": "./index.js",
|
|
174
|
+
"default": "./index.js"
|
|
175
|
+
},
|
|
176
|
+
"./index.js": {
|
|
177
|
+
"types": "./index.d.ts",
|
|
178
|
+
"import": "./index.js",
|
|
179
|
+
"default": "./index.js"
|
|
180
|
+
},
|
|
181
|
+
"./project-plan/api/api": {
|
|
182
|
+
"types": "./project-plan/api/api.d.ts",
|
|
183
|
+
"import": "./project-plan/api/api.js",
|
|
184
|
+
"default": "./project-plan/api/api.js"
|
|
185
|
+
},
|
|
186
|
+
"./project-plan/api/api.js": {
|
|
187
|
+
"types": "./project-plan/api/api.d.ts",
|
|
188
|
+
"import": "./project-plan/api/api.js",
|
|
189
|
+
"default": "./project-plan/api/api.js"
|
|
190
|
+
},
|
|
191
|
+
"./project-plan/api/index": {
|
|
192
|
+
"types": "./project-plan/api/index.d.ts",
|
|
193
|
+
"import": "./project-plan/api/index.js",
|
|
194
|
+
"default": "./project-plan/api/index.js"
|
|
195
|
+
},
|
|
196
|
+
"./project-plan/api/index.js": {
|
|
197
|
+
"types": "./project-plan/api/index.d.ts",
|
|
198
|
+
"import": "./project-plan/api/index.js",
|
|
199
|
+
"default": "./project-plan/api/index.js"
|
|
200
|
+
},
|
|
201
|
+
"./project-plan/ci/ci": {
|
|
202
|
+
"types": "./project-plan/ci/ci.d.ts",
|
|
203
|
+
"import": "./project-plan/ci/ci.js",
|
|
204
|
+
"default": "./project-plan/ci/ci.js"
|
|
205
|
+
},
|
|
206
|
+
"./project-plan/ci/ci.js": {
|
|
207
|
+
"types": "./project-plan/ci/ci.d.ts",
|
|
208
|
+
"import": "./project-plan/ci/ci.js",
|
|
209
|
+
"default": "./project-plan/ci/ci.js"
|
|
210
|
+
},
|
|
211
|
+
"./project-plan/ci/index": {
|
|
212
|
+
"types": "./project-plan/ci/index.d.ts",
|
|
213
|
+
"import": "./project-plan/ci/index.js",
|
|
214
|
+
"default": "./project-plan/ci/index.js"
|
|
215
|
+
},
|
|
216
|
+
"./project-plan/ci/index.js": {
|
|
217
|
+
"types": "./project-plan/ci/index.d.ts",
|
|
218
|
+
"import": "./project-plan/ci/index.js",
|
|
219
|
+
"default": "./project-plan/ci/index.js"
|
|
220
|
+
},
|
|
221
|
+
"./project-plan/create/create": {
|
|
222
|
+
"types": "./project-plan/create/create.d.ts",
|
|
223
|
+
"import": "./project-plan/create/create.js",
|
|
224
|
+
"default": "./project-plan/create/create.js"
|
|
225
|
+
},
|
|
226
|
+
"./project-plan/create/create.js": {
|
|
227
|
+
"types": "./project-plan/create/create.d.ts",
|
|
228
|
+
"import": "./project-plan/create/create.js",
|
|
229
|
+
"default": "./project-plan/create/create.js"
|
|
230
|
+
},
|
|
231
|
+
"./project-plan/create/index": {
|
|
232
|
+
"types": "./project-plan/create/index.d.ts",
|
|
233
|
+
"import": "./project-plan/create/index.js",
|
|
234
|
+
"default": "./project-plan/create/index.js"
|
|
235
|
+
},
|
|
236
|
+
"./project-plan/create/index.js": {
|
|
237
|
+
"types": "./project-plan/create/index.d.ts",
|
|
238
|
+
"import": "./project-plan/create/index.js",
|
|
239
|
+
"default": "./project-plan/create/index.js"
|
|
240
|
+
},
|
|
241
|
+
"./project-plan/index": {
|
|
242
|
+
"types": "./project-plan/index.d.ts",
|
|
243
|
+
"import": "./project-plan/index.js",
|
|
244
|
+
"default": "./project-plan/index.js"
|
|
245
|
+
},
|
|
246
|
+
"./project-plan/index.js": {
|
|
247
|
+
"types": "./project-plan/index.d.ts",
|
|
248
|
+
"import": "./project-plan/index.js",
|
|
249
|
+
"default": "./project-plan/index.js"
|
|
250
|
+
},
|
|
251
|
+
"./project-plan/kind/index": {
|
|
252
|
+
"types": "./project-plan/kind/index.d.ts",
|
|
253
|
+
"import": "./project-plan/kind/index.js",
|
|
254
|
+
"default": "./project-plan/kind/index.js"
|
|
255
|
+
},
|
|
256
|
+
"./project-plan/kind/index.js": {
|
|
257
|
+
"types": "./project-plan/kind/index.d.ts",
|
|
258
|
+
"import": "./project-plan/kind/index.js",
|
|
259
|
+
"default": "./project-plan/kind/index.js"
|
|
260
|
+
},
|
|
261
|
+
"./project-plan/kind/kind": {
|
|
262
|
+
"types": "./project-plan/kind/kind.d.ts",
|
|
263
|
+
"import": "./project-plan/kind/kind.js",
|
|
264
|
+
"default": "./project-plan/kind/kind.js"
|
|
265
|
+
},
|
|
266
|
+
"./project-plan/kind/kind.js": {
|
|
267
|
+
"types": "./project-plan/kind/kind.d.ts",
|
|
268
|
+
"import": "./project-plan/kind/kind.js",
|
|
269
|
+
"default": "./project-plan/kind/kind.js"
|
|
270
|
+
},
|
|
271
|
+
"./project-plan/print/index": {
|
|
272
|
+
"types": "./project-plan/print/index.d.ts",
|
|
273
|
+
"import": "./project-plan/print/index.js",
|
|
274
|
+
"default": "./project-plan/print/index.js"
|
|
275
|
+
},
|
|
276
|
+
"./project-plan/print/index.js": {
|
|
277
|
+
"types": "./project-plan/print/index.d.ts",
|
|
278
|
+
"import": "./project-plan/print/index.js",
|
|
279
|
+
"default": "./project-plan/print/index.js"
|
|
280
|
+
},
|
|
281
|
+
"./project-plan/print/print": {
|
|
282
|
+
"types": "./project-plan/print/print.d.ts",
|
|
283
|
+
"import": "./project-plan/print/print.js",
|
|
284
|
+
"default": "./project-plan/print/print.js"
|
|
285
|
+
},
|
|
286
|
+
"./project-plan/print/print.js": {
|
|
287
|
+
"types": "./project-plan/print/print.d.ts",
|
|
288
|
+
"import": "./project-plan/print/print.js",
|
|
289
|
+
"default": "./project-plan/print/print.js"
|
|
290
|
+
},
|
|
291
|
+
"./prompts/project-plan/index": {
|
|
292
|
+
"types": "./prompts/project-plan/index.d.ts",
|
|
293
|
+
"import": "./prompts/project-plan/index.js",
|
|
294
|
+
"default": "./prompts/project-plan/index.js"
|
|
295
|
+
},
|
|
296
|
+
"./prompts/project-plan/index.js": {
|
|
297
|
+
"types": "./prompts/project-plan/index.d.ts",
|
|
298
|
+
"import": "./prompts/project-plan/index.js",
|
|
299
|
+
"default": "./prompts/project-plan/index.js"
|
|
300
|
+
},
|
|
301
|
+
"./prompts/project-plan/project-plan": {
|
|
302
|
+
"types": "./prompts/project-plan/project-plan.d.ts",
|
|
303
|
+
"import": "./prompts/project-plan/project-plan.js",
|
|
304
|
+
"default": "./prompts/project-plan/project-plan.js"
|
|
305
|
+
},
|
|
306
|
+
"./prompts/project-plan/project-plan.js": {
|
|
307
|
+
"types": "./prompts/project-plan/project-plan.d.ts",
|
|
308
|
+
"import": "./prompts/project-plan/project-plan.js",
|
|
309
|
+
"default": "./prompts/project-plan/project-plan.js"
|
|
310
|
+
}
|
|
311
|
+
}
|
|
13
312
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CreateApiPlan, GetApiRuntimeFromPreset, GetDefaultApiStyleFromPreset, GetFeaturesFromApiPlan, IsApiPreset } from './types.js';
|
|
2
|
+
export declare const isApiPreset: IsApiPreset;
|
|
3
|
+
export declare const getApiRuntimeFromPreset: GetApiRuntimeFromPreset;
|
|
4
|
+
export declare const getDefaultApiStyleFromPreset: GetDefaultApiStyleFromPreset;
|
|
5
|
+
export declare const getFeaturesFromApiPlan: GetFeaturesFromApiPlan;
|
|
6
|
+
export declare const createApiPlan: CreateApiPlan;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const apiPresets = [
|
|
2
|
+
'api',
|
|
3
|
+
'fullstack',
|
|
4
|
+
'mfe-bff',
|
|
5
|
+
'openmfe-bff',
|
|
6
|
+
'aws-serverless',
|
|
7
|
+
];
|
|
8
|
+
export const isApiPreset = (preset) => apiPresets.includes(preset);
|
|
9
|
+
export const getApiRuntimeFromPreset = (preset) => preset === 'aws-serverless' ? 'lambda' : 'node';
|
|
10
|
+
export const getDefaultApiStyleFromPreset = (preset) => preset === 'openmfe-bff' ? 'mixed' : 'rest';
|
|
11
|
+
export const getFeaturesFromApiPlan = (api) => {
|
|
12
|
+
if (!api) {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
if (api.style === 'mixed') {
|
|
16
|
+
return ['rest-api', 'graphql-api'];
|
|
17
|
+
}
|
|
18
|
+
return api.style === 'rest' ? ['rest-api'] : ['graphql-api'];
|
|
19
|
+
};
|
|
20
|
+
export const createApiPlan = ({ preset, style = getDefaultApiStyleFromPreset(preset) }) => {
|
|
21
|
+
if (!isApiPreset(preset)) {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
const basePlan = {
|
|
25
|
+
enabled: true,
|
|
26
|
+
style,
|
|
27
|
+
runtime: getApiRuntimeFromPreset(preset),
|
|
28
|
+
};
|
|
29
|
+
const restPlan = {
|
|
30
|
+
rest: {
|
|
31
|
+
router: 'vyriy-router',
|
|
32
|
+
packageName: '@vyriy/router',
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
const graphqlPlan = {
|
|
36
|
+
graphql: {
|
|
37
|
+
packageName: 'graphql',
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
if (style === 'mixed') {
|
|
41
|
+
return {
|
|
42
|
+
...basePlan,
|
|
43
|
+
...restPlan,
|
|
44
|
+
...graphqlPlan,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
return style === 'rest'
|
|
48
|
+
? {
|
|
49
|
+
...basePlan,
|
|
50
|
+
...restPlan,
|
|
51
|
+
}
|
|
52
|
+
: {
|
|
53
|
+
...basePlan,
|
|
54
|
+
...graphqlPlan,
|
|
55
|
+
};
|
|
56
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './api.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { VyriyApiPlan, VyriyApiRuntime, VyriyApiStyle, VyriyFeature, VyriyPreset } from '../types.js';
|
|
2
|
+
export type CreateApiPlanOptions = {
|
|
3
|
+
readonly preset: VyriyPreset;
|
|
4
|
+
readonly style?: VyriyApiStyle;
|
|
5
|
+
};
|
|
6
|
+
export type CreateApiPlan = (options: CreateApiPlanOptions) => VyriyApiPlan | undefined;
|
|
7
|
+
export type IsApiPreset = (preset: VyriyPreset) => boolean;
|
|
8
|
+
export type GetApiRuntimeFromPreset = (preset: VyriyPreset) => VyriyApiRuntime;
|
|
9
|
+
export type GetDefaultApiStyleFromPreset = (preset: VyriyPreset) => VyriyApiStyle;
|
|
10
|
+
export type GetFeaturesFromApiPlan = (api: VyriyApiPlan | undefined) => VyriyFeature[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const defaultValidationPipelines = [
|
|
2
|
+
'install',
|
|
3
|
+
'typecheck',
|
|
4
|
+
'lint',
|
|
5
|
+
'prettier',
|
|
6
|
+
'test',
|
|
7
|
+
'build',
|
|
8
|
+
];
|
|
9
|
+
export const createCiPlan = ({ provider = 'none' } = {}) => provider === 'none'
|
|
10
|
+
? {
|
|
11
|
+
enabled: false,
|
|
12
|
+
providers: [],
|
|
13
|
+
pipelines: [],
|
|
14
|
+
}
|
|
15
|
+
: {
|
|
16
|
+
enabled: true,
|
|
17
|
+
providers: [provider],
|
|
18
|
+
pipelines: [...defaultValidationPipelines],
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ci.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { VyriyCiPlan, VyriyCiProvider } from '../types.js';
|
|
2
|
+
export type VyriyCiPromptProvider = 'none' | VyriyCiProvider;
|
|
3
|
+
export type CreateCiPlanOptions = {
|
|
4
|
+
readonly provider?: VyriyCiPromptProvider;
|
|
5
|
+
};
|
|
6
|
+
export type CreateCiPlan = (options?: CreateCiPlanOptions) => VyriyCiPlan;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { createApiPlan, getFeaturesFromApiPlan } from '../api/index.js';
|
|
2
|
+
import { createCiPlan } from '../ci/index.js';
|
|
3
|
+
import { getProjectKindFromPreset } from '../kind/index.js';
|
|
4
|
+
const baseFeatures = [
|
|
5
|
+
'typescript',
|
|
6
|
+
'eslint',
|
|
7
|
+
'prettier',
|
|
8
|
+
'jest',
|
|
9
|
+
];
|
|
10
|
+
const presetFeatures = {
|
|
11
|
+
library: ['react', 'storybook'],
|
|
12
|
+
api: [],
|
|
13
|
+
'react-csr': ['react', 'webpack'],
|
|
14
|
+
'react-ssr': ['react', 'webpack'],
|
|
15
|
+
'react-ssg': ['react', 'webpack'],
|
|
16
|
+
mfe: ['react', 'webpack'],
|
|
17
|
+
openmfe: ['react', 'webpack', 'openmfe'],
|
|
18
|
+
'mfe-bff': ['react', 'webpack', 'bff'],
|
|
19
|
+
'openmfe-bff': [
|
|
20
|
+
'react',
|
|
21
|
+
'webpack',
|
|
22
|
+
'openmfe',
|
|
23
|
+
'bff',
|
|
24
|
+
],
|
|
25
|
+
fullstack: ['react', 'webpack'],
|
|
26
|
+
'aws-serverless': ['aws-cdk', 'lambda', 'dynamodb'],
|
|
27
|
+
empty: [],
|
|
28
|
+
};
|
|
29
|
+
const packagePlans = {
|
|
30
|
+
library: [{ name: 'ui', kind: 'ui', publishable: true }],
|
|
31
|
+
api: [{ name: 'api', kind: 'api', publishable: false }],
|
|
32
|
+
'react-csr': [
|
|
33
|
+
{ name: 'app', kind: 'core', publishable: false },
|
|
34
|
+
{ name: 'ui', kind: 'ui', publishable: true },
|
|
35
|
+
],
|
|
36
|
+
'react-ssr': [
|
|
37
|
+
{ name: 'app', kind: 'core', publishable: false },
|
|
38
|
+
{ name: 'ui', kind: 'ui', publishable: true },
|
|
39
|
+
{ name: 'ssr', kind: 'ssr', publishable: false },
|
|
40
|
+
],
|
|
41
|
+
'react-ssg': [
|
|
42
|
+
{ name: 'app', kind: 'core', publishable: false },
|
|
43
|
+
{ name: 'ui', kind: 'ui', publishable: true },
|
|
44
|
+
{ name: 'ssg', kind: 'ssg', publishable: false },
|
|
45
|
+
{ name: 'content', kind: 'core', publishable: false },
|
|
46
|
+
],
|
|
47
|
+
mfe: [
|
|
48
|
+
{ name: 'mfe', kind: 'mfe', publishable: false },
|
|
49
|
+
{ name: 'ui', kind: 'ui', publishable: true },
|
|
50
|
+
],
|
|
51
|
+
openmfe: [
|
|
52
|
+
{ name: 'mfe', kind: 'mfe', publishable: false },
|
|
53
|
+
{ name: 'ui', kind: 'ui', publishable: true },
|
|
54
|
+
{ name: 'openmfe-contract', kind: 'contract', publishable: true },
|
|
55
|
+
],
|
|
56
|
+
'mfe-bff': [
|
|
57
|
+
{ name: 'mfe', kind: 'mfe', publishable: false },
|
|
58
|
+
{ name: 'ui', kind: 'ui', publishable: true },
|
|
59
|
+
{ name: 'bff', kind: 'bff', publishable: false },
|
|
60
|
+
],
|
|
61
|
+
'openmfe-bff': [
|
|
62
|
+
{ name: 'mfe', kind: 'mfe', publishable: false },
|
|
63
|
+
{ name: 'ui', kind: 'ui', publishable: true },
|
|
64
|
+
{ name: 'bff', kind: 'bff', publishable: false },
|
|
65
|
+
{ name: 'openmfe-contract', kind: 'contract', publishable: true },
|
|
66
|
+
],
|
|
67
|
+
fullstack: [
|
|
68
|
+
{ name: 'app', kind: 'core', publishable: false },
|
|
69
|
+
{ name: 'ui', kind: 'ui', publishable: true },
|
|
70
|
+
{ name: 'api', kind: 'api', publishable: false },
|
|
71
|
+
],
|
|
72
|
+
'aws-serverless': [
|
|
73
|
+
{ name: 'api', kind: 'api', publishable: false },
|
|
74
|
+
{ name: 'infrastructure', kind: 'core', publishable: false },
|
|
75
|
+
],
|
|
76
|
+
empty: [],
|
|
77
|
+
};
|
|
78
|
+
const workspacePlans = {
|
|
79
|
+
library: [],
|
|
80
|
+
api: [{ name: 'api', kind: 'api' }],
|
|
81
|
+
'react-csr': [{ name: 'web', kind: 'web' }],
|
|
82
|
+
'react-ssr': [
|
|
83
|
+
{ name: 'ssr', kind: 'ssr' },
|
|
84
|
+
{ name: 'web', kind: 'web' },
|
|
85
|
+
],
|
|
86
|
+
'react-ssg': [
|
|
87
|
+
{ name: 'ssg', kind: 'ssg' },
|
|
88
|
+
{ name: 'web', kind: 'web' },
|
|
89
|
+
],
|
|
90
|
+
mfe: [{ name: 'mfe', kind: 'mfe' }],
|
|
91
|
+
openmfe: [
|
|
92
|
+
{ name: 'mfe', kind: 'mfe' },
|
|
93
|
+
{ name: 'openmfe', kind: 'openmfe' },
|
|
94
|
+
],
|
|
95
|
+
'mfe-bff': [
|
|
96
|
+
{ name: 'mfe', kind: 'mfe' },
|
|
97
|
+
{ name: 'bff', kind: 'bff' },
|
|
98
|
+
],
|
|
99
|
+
'openmfe-bff': [
|
|
100
|
+
{ name: 'mfe', kind: 'mfe' },
|
|
101
|
+
{ name: 'bff', kind: 'bff' },
|
|
102
|
+
{ name: 'openmfe', kind: 'openmfe' },
|
|
103
|
+
],
|
|
104
|
+
fullstack: [
|
|
105
|
+
{ name: 'web', kind: 'web' },
|
|
106
|
+
{ name: 'api', kind: 'api' },
|
|
107
|
+
],
|
|
108
|
+
'aws-serverless': [{ name: 'cdk', kind: 'cdk' }],
|
|
109
|
+
empty: [],
|
|
110
|
+
};
|
|
111
|
+
const uniqueFeatures = (features) => [...new Set(features)];
|
|
112
|
+
export const createProjectPlanFromPreset = ({ description, apiStyle, ciProvider, features = [], packageScope, preset, projectName, targetDirectory, }) => {
|
|
113
|
+
const api = createApiPlan({ preset, style: apiStyle });
|
|
114
|
+
const apiFeatures = getFeaturesFromApiPlan(api);
|
|
115
|
+
return {
|
|
116
|
+
projectName,
|
|
117
|
+
targetDirectory,
|
|
118
|
+
packageScope,
|
|
119
|
+
description,
|
|
120
|
+
preset,
|
|
121
|
+
projectKind: getProjectKindFromPreset(preset),
|
|
122
|
+
features: uniqueFeatures([
|
|
123
|
+
...baseFeatures,
|
|
124
|
+
...presetFeatures[preset],
|
|
125
|
+
...apiFeatures,
|
|
126
|
+
...features,
|
|
127
|
+
]),
|
|
128
|
+
packages: [...packagePlans[preset]],
|
|
129
|
+
workspaces: [...workspacePlans[preset]],
|
|
130
|
+
ci: createCiPlan({ provider: ciProvider }),
|
|
131
|
+
...(api ? { api } : {}),
|
|
132
|
+
};
|
|
133
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './create.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { VyriyApiStyle, VyriyFeature, VyriyPreset, VyriyProjectPlan } from '../types.js';
|
|
2
|
+
import { VyriyCiPromptProvider } from '../ci/index.js';
|
|
3
|
+
export type CreateProjectPlanFromPresetOptions = {
|
|
4
|
+
readonly projectName: string;
|
|
5
|
+
readonly targetDirectory: string;
|
|
6
|
+
readonly packageScope: string;
|
|
7
|
+
readonly description: string;
|
|
8
|
+
readonly preset: VyriyPreset;
|
|
9
|
+
readonly features?: readonly VyriyFeature[];
|
|
10
|
+
readonly apiStyle?: VyriyApiStyle;
|
|
11
|
+
readonly ciProvider?: VyriyCiPromptProvider;
|
|
12
|
+
};
|
|
13
|
+
export type CreateProjectPlanFromPreset = (options: CreateProjectPlanFromPresetOptions) => VyriyProjectPlan;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './kind.js';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const getProjectKindFromPreset = (preset) => {
|
|
2
|
+
switch (preset) {
|
|
3
|
+
case 'react-csr':
|
|
4
|
+
return 'csr';
|
|
5
|
+
case 'react-ssr':
|
|
6
|
+
return 'ssr';
|
|
7
|
+
case 'react-ssg':
|
|
8
|
+
return 'ssg';
|
|
9
|
+
case 'openmfe':
|
|
10
|
+
case 'mfe-bff':
|
|
11
|
+
case 'openmfe-bff':
|
|
12
|
+
return 'mfe';
|
|
13
|
+
default:
|
|
14
|
+
return preset;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './print.js';
|