vyriy 0.0.0 → 0.2.1

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.
Files changed (76) hide show
  1. package/AGENTS.md +65 -0
  2. package/LICENSE +21 -0
  3. package/README.md +159 -0
  4. package/bin/vyriy.d.ts +2 -0
  5. package/bin/vyriy.js +3 -0
  6. package/checks/node/index.d.ts +2 -0
  7. package/checks/node/index.js +1 -0
  8. package/checks/node/node.d.ts +2 -0
  9. package/checks/node/node.js +22 -0
  10. package/checks/node/types.d.ts +11 -0
  11. package/checks/yarn/index.d.ts +2 -0
  12. package/checks/yarn/index.js +1 -0
  13. package/checks/yarn/types.d.ts +7 -0
  14. package/checks/yarn/yarn.d.ts +2 -0
  15. package/checks/yarn/yarn.js +40 -0
  16. package/cli/args/args.d.ts +2 -0
  17. package/cli/args/args.js +23 -0
  18. package/cli/args/index.d.ts +2 -0
  19. package/cli/args/index.js +1 -0
  20. package/cli/args/types.d.ts +10 -0
  21. package/cli/cli.d.ts +2 -0
  22. package/cli/cli.js +49 -0
  23. package/cli/index.d.ts +3 -0
  24. package/cli/index.js +2 -0
  25. package/cli/types.d.ts +4 -0
  26. package/commands/doctor/doctor.d.ts +2 -0
  27. package/commands/doctor/doctor.js +20 -0
  28. package/commands/doctor/index.d.ts +2 -0
  29. package/commands/doctor/index.js +1 -0
  30. package/commands/doctor/types.d.ts +8 -0
  31. package/commands/init/index.d.ts +2 -0
  32. package/commands/init/index.js +1 -0
  33. package/commands/init/init.d.ts +2 -0
  34. package/commands/init/init.js +7 -0
  35. package/commands/init/types.d.ts +5 -0
  36. package/commands/new/index.d.ts +2 -0
  37. package/commands/new/index.js +1 -0
  38. package/commands/new/new.d.ts +2 -0
  39. package/commands/new/new.js +32 -0
  40. package/commands/new/types.d.ts +7 -0
  41. package/index.d.ts +8 -0
  42. package/index.js +8 -1
  43. package/package.json +309 -9
  44. package/project-plan/api/api.d.ts +6 -0
  45. package/project-plan/api/api.js +56 -0
  46. package/project-plan/api/index.d.ts +2 -0
  47. package/project-plan/api/index.js +1 -0
  48. package/project-plan/api/types.d.ts +10 -0
  49. package/project-plan/ci/ci.d.ts +3 -0
  50. package/project-plan/ci/ci.js +19 -0
  51. package/project-plan/ci/index.d.ts +2 -0
  52. package/project-plan/ci/index.js +1 -0
  53. package/project-plan/ci/types.d.ts +6 -0
  54. package/project-plan/create/create.d.ts +2 -0
  55. package/project-plan/create/create.js +133 -0
  56. package/project-plan/create/index.d.ts +2 -0
  57. package/project-plan/create/index.js +1 -0
  58. package/project-plan/create/types.d.ts +13 -0
  59. package/project-plan/index.d.ts +6 -0
  60. package/project-plan/index.js +5 -0
  61. package/project-plan/kind/index.d.ts +2 -0
  62. package/project-plan/kind/index.js +1 -0
  63. package/project-plan/kind/kind.d.ts +2 -0
  64. package/project-plan/kind/kind.js +16 -0
  65. package/project-plan/kind/types.d.ts +2 -0
  66. package/project-plan/print/index.d.ts +2 -0
  67. package/project-plan/print/index.js +1 -0
  68. package/project-plan/print/print.d.ts +2 -0
  69. package/project-plan/print/print.js +47 -0
  70. package/project-plan/print/types.d.ts +2 -0
  71. package/project-plan/types.d.ts +46 -0
  72. package/prompts/project-plan/index.d.ts +2 -0
  73. package/prompts/project-plan/index.js +1 -0
  74. package/prompts/project-plan/project-plan.d.ts +2 -0
  75. package/prompts/project-plan/project-plan.js +132 -0
  76. package/prompts/project-plan/types.d.ts +18 -0
package/package.json CHANGED
@@ -1,13 +1,313 @@
1
1
  {
2
2
  "name": "vyriy",
3
- "version": "0.0.0",
4
- "description": "Vyriy",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
3
+ "version": "0.2.1",
4
+ "description": "Interactive project master for calm cloud-ready applications.",
5
+ "type": "module",
6
+ "main": "./index.js",
7
+ "bin": "./bin/vyriy.js",
8
+ "agents": "./AGENTS.md",
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/evheniy/vyriy",
13
+ "directory": "packages/vyriy"
8
14
  },
9
- "keywords": [],
10
- "author": "",
11
- "license": "ISC",
12
- "type": "commonjs"
15
+ "types": "./index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./index.d.ts",
19
+ "import": "./index.js",
20
+ "default": "./index.js"
21
+ },
22
+ "./bin/vyriy": {
23
+ "types": "./bin/vyriy.d.ts",
24
+ "import": "./bin/vyriy.js",
25
+ "default": "./bin/vyriy.js"
26
+ },
27
+ "./bin/vyriy.js": {
28
+ "types": "./bin/vyriy.d.ts",
29
+ "import": "./bin/vyriy.js",
30
+ "default": "./bin/vyriy.js"
31
+ },
32
+ "./checks/node/index": {
33
+ "types": "./checks/node/index.d.ts",
34
+ "import": "./checks/node/index.js",
35
+ "default": "./checks/node/index.js"
36
+ },
37
+ "./checks/node/index.js": {
38
+ "types": "./checks/node/index.d.ts",
39
+ "import": "./checks/node/index.js",
40
+ "default": "./checks/node/index.js"
41
+ },
42
+ "./checks/node/node": {
43
+ "types": "./checks/node/node.d.ts",
44
+ "import": "./checks/node/node.js",
45
+ "default": "./checks/node/node.js"
46
+ },
47
+ "./checks/node/node.js": {
48
+ "types": "./checks/node/node.d.ts",
49
+ "import": "./checks/node/node.js",
50
+ "default": "./checks/node/node.js"
51
+ },
52
+ "./checks/yarn/index": {
53
+ "types": "./checks/yarn/index.d.ts",
54
+ "import": "./checks/yarn/index.js",
55
+ "default": "./checks/yarn/index.js"
56
+ },
57
+ "./checks/yarn/index.js": {
58
+ "types": "./checks/yarn/index.d.ts",
59
+ "import": "./checks/yarn/index.js",
60
+ "default": "./checks/yarn/index.js"
61
+ },
62
+ "./checks/yarn/yarn": {
63
+ "types": "./checks/yarn/yarn.d.ts",
64
+ "import": "./checks/yarn/yarn.js",
65
+ "default": "./checks/yarn/yarn.js"
66
+ },
67
+ "./checks/yarn/yarn.js": {
68
+ "types": "./checks/yarn/yarn.d.ts",
69
+ "import": "./checks/yarn/yarn.js",
70
+ "default": "./checks/yarn/yarn.js"
71
+ },
72
+ "./cli/args/args": {
73
+ "types": "./cli/args/args.d.ts",
74
+ "import": "./cli/args/args.js",
75
+ "default": "./cli/args/args.js"
76
+ },
77
+ "./cli/args/args.js": {
78
+ "types": "./cli/args/args.d.ts",
79
+ "import": "./cli/args/args.js",
80
+ "default": "./cli/args/args.js"
81
+ },
82
+ "./cli/args/index": {
83
+ "types": "./cli/args/index.d.ts",
84
+ "import": "./cli/args/index.js",
85
+ "default": "./cli/args/index.js"
86
+ },
87
+ "./cli/args/index.js": {
88
+ "types": "./cli/args/index.d.ts",
89
+ "import": "./cli/args/index.js",
90
+ "default": "./cli/args/index.js"
91
+ },
92
+ "./cli/cli": {
93
+ "types": "./cli/cli.d.ts",
94
+ "import": "./cli/cli.js",
95
+ "default": "./cli/cli.js"
96
+ },
97
+ "./cli/cli.js": {
98
+ "types": "./cli/cli.d.ts",
99
+ "import": "./cli/cli.js",
100
+ "default": "./cli/cli.js"
101
+ },
102
+ "./cli/index": {
103
+ "types": "./cli/index.d.ts",
104
+ "import": "./cli/index.js",
105
+ "default": "./cli/index.js"
106
+ },
107
+ "./cli/index.js": {
108
+ "types": "./cli/index.d.ts",
109
+ "import": "./cli/index.js",
110
+ "default": "./cli/index.js"
111
+ },
112
+ "./commands/doctor/doctor": {
113
+ "types": "./commands/doctor/doctor.d.ts",
114
+ "import": "./commands/doctor/doctor.js",
115
+ "default": "./commands/doctor/doctor.js"
116
+ },
117
+ "./commands/doctor/doctor.js": {
118
+ "types": "./commands/doctor/doctor.d.ts",
119
+ "import": "./commands/doctor/doctor.js",
120
+ "default": "./commands/doctor/doctor.js"
121
+ },
122
+ "./commands/doctor/index": {
123
+ "types": "./commands/doctor/index.d.ts",
124
+ "import": "./commands/doctor/index.js",
125
+ "default": "./commands/doctor/index.js"
126
+ },
127
+ "./commands/doctor/index.js": {
128
+ "types": "./commands/doctor/index.d.ts",
129
+ "import": "./commands/doctor/index.js",
130
+ "default": "./commands/doctor/index.js"
131
+ },
132
+ "./commands/init/index": {
133
+ "types": "./commands/init/index.d.ts",
134
+ "import": "./commands/init/index.js",
135
+ "default": "./commands/init/index.js"
136
+ },
137
+ "./commands/init/index.js": {
138
+ "types": "./commands/init/index.d.ts",
139
+ "import": "./commands/init/index.js",
140
+ "default": "./commands/init/index.js"
141
+ },
142
+ "./commands/init/init": {
143
+ "types": "./commands/init/init.d.ts",
144
+ "import": "./commands/init/init.js",
145
+ "default": "./commands/init/init.js"
146
+ },
147
+ "./commands/init/init.js": {
148
+ "types": "./commands/init/init.d.ts",
149
+ "import": "./commands/init/init.js",
150
+ "default": "./commands/init/init.js"
151
+ },
152
+ "./commands/new/index": {
153
+ "types": "./commands/new/index.d.ts",
154
+ "import": "./commands/new/index.js",
155
+ "default": "./commands/new/index.js"
156
+ },
157
+ "./commands/new/index.js": {
158
+ "types": "./commands/new/index.d.ts",
159
+ "import": "./commands/new/index.js",
160
+ "default": "./commands/new/index.js"
161
+ },
162
+ "./commands/new/new": {
163
+ "types": "./commands/new/new.d.ts",
164
+ "import": "./commands/new/new.js",
165
+ "default": "./commands/new/new.js"
166
+ },
167
+ "./commands/new/new.js": {
168
+ "types": "./commands/new/new.d.ts",
169
+ "import": "./commands/new/new.js",
170
+ "default": "./commands/new/new.js"
171
+ },
172
+ "./index": {
173
+ "types": "./index.d.ts",
174
+ "import": "./index.js",
175
+ "default": "./index.js"
176
+ },
177
+ "./index.js": {
178
+ "types": "./index.d.ts",
179
+ "import": "./index.js",
180
+ "default": "./index.js"
181
+ },
182
+ "./project-plan/api/api": {
183
+ "types": "./project-plan/api/api.d.ts",
184
+ "import": "./project-plan/api/api.js",
185
+ "default": "./project-plan/api/api.js"
186
+ },
187
+ "./project-plan/api/api.js": {
188
+ "types": "./project-plan/api/api.d.ts",
189
+ "import": "./project-plan/api/api.js",
190
+ "default": "./project-plan/api/api.js"
191
+ },
192
+ "./project-plan/api/index": {
193
+ "types": "./project-plan/api/index.d.ts",
194
+ "import": "./project-plan/api/index.js",
195
+ "default": "./project-plan/api/index.js"
196
+ },
197
+ "./project-plan/api/index.js": {
198
+ "types": "./project-plan/api/index.d.ts",
199
+ "import": "./project-plan/api/index.js",
200
+ "default": "./project-plan/api/index.js"
201
+ },
202
+ "./project-plan/ci/ci": {
203
+ "types": "./project-plan/ci/ci.d.ts",
204
+ "import": "./project-plan/ci/ci.js",
205
+ "default": "./project-plan/ci/ci.js"
206
+ },
207
+ "./project-plan/ci/ci.js": {
208
+ "types": "./project-plan/ci/ci.d.ts",
209
+ "import": "./project-plan/ci/ci.js",
210
+ "default": "./project-plan/ci/ci.js"
211
+ },
212
+ "./project-plan/ci/index": {
213
+ "types": "./project-plan/ci/index.d.ts",
214
+ "import": "./project-plan/ci/index.js",
215
+ "default": "./project-plan/ci/index.js"
216
+ },
217
+ "./project-plan/ci/index.js": {
218
+ "types": "./project-plan/ci/index.d.ts",
219
+ "import": "./project-plan/ci/index.js",
220
+ "default": "./project-plan/ci/index.js"
221
+ },
222
+ "./project-plan/create/create": {
223
+ "types": "./project-plan/create/create.d.ts",
224
+ "import": "./project-plan/create/create.js",
225
+ "default": "./project-plan/create/create.js"
226
+ },
227
+ "./project-plan/create/create.js": {
228
+ "types": "./project-plan/create/create.d.ts",
229
+ "import": "./project-plan/create/create.js",
230
+ "default": "./project-plan/create/create.js"
231
+ },
232
+ "./project-plan/create/index": {
233
+ "types": "./project-plan/create/index.d.ts",
234
+ "import": "./project-plan/create/index.js",
235
+ "default": "./project-plan/create/index.js"
236
+ },
237
+ "./project-plan/create/index.js": {
238
+ "types": "./project-plan/create/index.d.ts",
239
+ "import": "./project-plan/create/index.js",
240
+ "default": "./project-plan/create/index.js"
241
+ },
242
+ "./project-plan/index": {
243
+ "types": "./project-plan/index.d.ts",
244
+ "import": "./project-plan/index.js",
245
+ "default": "./project-plan/index.js"
246
+ },
247
+ "./project-plan/index.js": {
248
+ "types": "./project-plan/index.d.ts",
249
+ "import": "./project-plan/index.js",
250
+ "default": "./project-plan/index.js"
251
+ },
252
+ "./project-plan/kind/index": {
253
+ "types": "./project-plan/kind/index.d.ts",
254
+ "import": "./project-plan/kind/index.js",
255
+ "default": "./project-plan/kind/index.js"
256
+ },
257
+ "./project-plan/kind/index.js": {
258
+ "types": "./project-plan/kind/index.d.ts",
259
+ "import": "./project-plan/kind/index.js",
260
+ "default": "./project-plan/kind/index.js"
261
+ },
262
+ "./project-plan/kind/kind": {
263
+ "types": "./project-plan/kind/kind.d.ts",
264
+ "import": "./project-plan/kind/kind.js",
265
+ "default": "./project-plan/kind/kind.js"
266
+ },
267
+ "./project-plan/kind/kind.js": {
268
+ "types": "./project-plan/kind/kind.d.ts",
269
+ "import": "./project-plan/kind/kind.js",
270
+ "default": "./project-plan/kind/kind.js"
271
+ },
272
+ "./project-plan/print/index": {
273
+ "types": "./project-plan/print/index.d.ts",
274
+ "import": "./project-plan/print/index.js",
275
+ "default": "./project-plan/print/index.js"
276
+ },
277
+ "./project-plan/print/index.js": {
278
+ "types": "./project-plan/print/index.d.ts",
279
+ "import": "./project-plan/print/index.js",
280
+ "default": "./project-plan/print/index.js"
281
+ },
282
+ "./project-plan/print/print": {
283
+ "types": "./project-plan/print/print.d.ts",
284
+ "import": "./project-plan/print/print.js",
285
+ "default": "./project-plan/print/print.js"
286
+ },
287
+ "./project-plan/print/print.js": {
288
+ "types": "./project-plan/print/print.d.ts",
289
+ "import": "./project-plan/print/print.js",
290
+ "default": "./project-plan/print/print.js"
291
+ },
292
+ "./prompts/project-plan/index": {
293
+ "types": "./prompts/project-plan/index.d.ts",
294
+ "import": "./prompts/project-plan/index.js",
295
+ "default": "./prompts/project-plan/index.js"
296
+ },
297
+ "./prompts/project-plan/index.js": {
298
+ "types": "./prompts/project-plan/index.d.ts",
299
+ "import": "./prompts/project-plan/index.js",
300
+ "default": "./prompts/project-plan/index.js"
301
+ },
302
+ "./prompts/project-plan/project-plan": {
303
+ "types": "./prompts/project-plan/project-plan.d.ts",
304
+ "import": "./prompts/project-plan/project-plan.js",
305
+ "default": "./prompts/project-plan/project-plan.js"
306
+ },
307
+ "./prompts/project-plan/project-plan.js": {
308
+ "types": "./prompts/project-plan/project-plan.d.ts",
309
+ "import": "./prompts/project-plan/project-plan.js",
310
+ "default": "./prompts/project-plan/project-plan.js"
311
+ }
312
+ }
13
313
  }
@@ -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,2 @@
1
+ export * from './api.js';
2
+ export type * from './types.js';
@@ -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,3 @@
1
+ import { CreateCiPlan } from './types.js';
2
+ export declare const defaultValidationPipelines: readonly ["install", "typecheck", "lint", "prettier", "test", "build"];
3
+ export declare const createCiPlan: CreateCiPlan;
@@ -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,2 @@
1
+ export * from './ci.js';
2
+ export type * from './types.js';
@@ -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,2 @@
1
+ import { CreateProjectPlanFromPreset } from './types.js';
2
+ export declare const createProjectPlanFromPreset: CreateProjectPlanFromPreset;
@@ -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,2 @@
1
+ export * from './create.js';
2
+ export type * from './types.js';
@@ -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,6 @@
1
+ export * from './api/index.js';
2
+ export * from './ci/index.js';
3
+ export * from './create/index.js';
4
+ export * from './kind/index.js';
5
+ export * from './print/index.js';
6
+ export type * from './types.js';
@@ -0,0 +1,5 @@
1
+ export * from './api/index.js';
2
+ export * from './ci/index.js';
3
+ export * from './create/index.js';
4
+ export * from './kind/index.js';
5
+ export * from './print/index.js';
@@ -0,0 +1,2 @@
1
+ export * from './kind.js';
2
+ export type * from './types.js';
@@ -0,0 +1 @@
1
+ export * from './kind.js';
@@ -0,0 +1,2 @@
1
+ import { GetProjectKindFromPreset } from './types.js';
2
+ export declare const getProjectKindFromPreset: GetProjectKindFromPreset;
@@ -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,2 @@
1
+ import { VyriyPreset, VyriyProjectKind } from '../types.js';
2
+ export type GetProjectKindFromPreset = (preset: VyriyPreset) => VyriyProjectKind;
@@ -0,0 +1,2 @@
1
+ export * from './print.js';
2
+ export type * from './types.js';
@@ -0,0 +1 @@
1
+ export * from './print.js';