@vyriy/create 0.5.4 → 0.5.6
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/package.json +2 -16
- package/plan/plan.d.ts +0 -1
- package/plan/plan.js +1 -3
- package/plan/types.d.ts +0 -1
- package/preset/api.js +118 -5
- package/preset/fullstack.js +393 -12
- package/preset/gql.js +198 -34
- package/preset/library.js +346 -180
- package/preset/mfe.js +546 -16
- package/preset/rest.js +182 -6
- package/preset/spa.js +236 -7
- package/preset/ssg.js +266 -13
- package/preset/ssr.js +256 -10
- package/prompt/index.d.ts +0 -1
- package/prompt/index.js +0 -1
- package/prompt/scope.d.ts +0 -2
- package/prompt/scope.js +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vyriy/create",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.6",
|
|
4
4
|
"description": "Vyriy project creation CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"vyriy-create": "./bin/index.js"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@vyriy/check": "0.5.
|
|
15
|
+
"@vyriy/check": "0.5.6"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"@testing-library/dom": "^10.4.1",
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
"react-dom": "^19.2.7",
|
|
32
32
|
"rimraf": "^6.1.3",
|
|
33
33
|
"sass": "^1.100.0",
|
|
34
|
-
"serve": "^14.2.6",
|
|
35
34
|
"storybook": "^10.4.2",
|
|
36
35
|
"stylelint": "^17.12.0",
|
|
37
36
|
"tsx": "^4.22.4",
|
|
@@ -88,9 +87,6 @@
|
|
|
88
87
|
"sass": {
|
|
89
88
|
"optional": true
|
|
90
89
|
},
|
|
91
|
-
"serve": {
|
|
92
|
-
"optional": true
|
|
93
|
-
},
|
|
94
90
|
"storybook": {
|
|
95
91
|
"optional": true
|
|
96
92
|
},
|
|
@@ -344,16 +340,6 @@
|
|
|
344
340
|
"types": "./prompt/resolve-option.d.ts",
|
|
345
341
|
"import": "./prompt/resolve-option.js",
|
|
346
342
|
"default": "./prompt/resolve-option.js"
|
|
347
|
-
},
|
|
348
|
-
"./prompt/scope": {
|
|
349
|
-
"types": "./prompt/scope.d.ts",
|
|
350
|
-
"import": "./prompt/scope.js",
|
|
351
|
-
"default": "./prompt/scope.js"
|
|
352
|
-
},
|
|
353
|
-
"./prompt/scope.js": {
|
|
354
|
-
"types": "./prompt/scope.d.ts",
|
|
355
|
-
"import": "./prompt/scope.js",
|
|
356
|
-
"default": "./prompt/scope.js"
|
|
357
343
|
}
|
|
358
344
|
}
|
|
359
345
|
}
|
package/plan/plan.d.ts
CHANGED
package/plan/plan.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { stdin, stdout } from 'node:process';
|
|
2
2
|
import { dirname, resolve } from 'node:path';
|
|
3
3
|
import { createInterface } from 'node:readline';
|
|
4
|
-
import { prompt, preset as promptPreset
|
|
4
|
+
import { prompt, preset as promptPreset } from '../prompt/index.js';
|
|
5
5
|
import { question as createQuestion } from './question.js';
|
|
6
6
|
const toDirectoryName = (name, fallback) => {
|
|
7
7
|
const directoryName = name.trim().replaceAll(/[\s\\/]+/g, '_');
|
|
@@ -17,7 +17,6 @@ export const plan = async (dirName, appPath) => {
|
|
|
17
17
|
const description = await prompt(question, 'Project description', 'Calm cloud-ready application');
|
|
18
18
|
const target = await prompt(question, 'Target directory', getTargetDefault(name, dirName, appPath));
|
|
19
19
|
const preset = await promptPreset(question, stdout);
|
|
20
|
-
const scope = await promptScope(question, preset, name);
|
|
21
20
|
const confirmation = (await prompt(question, 'Use this project plan?', 'y')).toLowerCase();
|
|
22
21
|
return confirmation === 'y'
|
|
23
22
|
? {
|
|
@@ -25,7 +24,6 @@ export const plan = async (dirName, appPath) => {
|
|
|
25
24
|
description,
|
|
26
25
|
target,
|
|
27
26
|
preset,
|
|
28
|
-
scope,
|
|
29
27
|
}
|
|
30
28
|
: undefined;
|
|
31
29
|
}
|
package/plan/types.d.ts
CHANGED
package/preset/api.js
CHANGED
|
@@ -33,14 +33,14 @@ export const api = (options) => ({
|
|
|
33
33
|
test: "run-s 'test:*'",
|
|
34
34
|
'fix:prettier': 'prettier . --write',
|
|
35
35
|
'fix:eslint': 'eslint . --fix',
|
|
36
|
+
'start:api': 'sh workspaces/api/bin/start.sh',
|
|
36
37
|
'lint:ts': 'tsc',
|
|
37
38
|
'lint:prettier': 'prettier . --check',
|
|
38
39
|
'lint:eslint': 'eslint .',
|
|
40
|
+
'build:api': 'rimraf dist && sh workspaces/api/bin/build.sh',
|
|
39
41
|
'build:storybook': 'cross-env STORYBOOK_DISABLE_TELEMETRY=1 storybook build --quiet --disable-telemetry',
|
|
40
42
|
'test:jest': 'jest',
|
|
41
43
|
postinstall: 'husky',
|
|
42
|
-
'start:api': 'sh workspaces/api/bin/start.sh',
|
|
43
|
-
'build:api': 'rimraf dist && sh workspaces/api/bin/build.sh',
|
|
44
44
|
},
|
|
45
45
|
dependencies: {
|
|
46
46
|
'@vyriy/typescript-config': `^${packageJson.version}`,
|
|
@@ -65,11 +65,81 @@ export const api = (options) => ({
|
|
|
65
65
|
'@vyriy/server': `^${packageJson.version}`,
|
|
66
66
|
},
|
|
67
67
|
}, null, 2) + '\n',
|
|
68
|
-
'README.md': `#
|
|
68
|
+
'README.md': `# Api
|
|
69
|
+
|
|
70
|
+
Calm cloud-ready application built as a Yarn workspace.
|
|
71
|
+
|
|
72
|
+
The repository currently contains one runtime workspace:
|
|
73
|
+
|
|
74
|
+
- \`workspaces/api\` - HTTP API entry point based on \`@vyriy/server\` and \`@vyriy/handler\`.
|
|
75
|
+
|
|
76
|
+
## Requirements
|
|
77
|
+
|
|
78
|
+
- Node.js \`>=24.0.0\`
|
|
79
|
+
- Yarn \`4.16.0\`
|
|
80
|
+
|
|
81
|
+
## Usage
|
|
82
|
+
|
|
83
|
+
Install dependencies:
|
|
84
|
+
|
|
85
|
+
\`\`\`bash
|
|
86
|
+
yarn install
|
|
87
|
+
\`\`\`
|
|
88
|
+
|
|
89
|
+
Start the API:
|
|
90
|
+
|
|
91
|
+
\`\`\`bash
|
|
92
|
+
yarn start
|
|
93
|
+
\`\`\`
|
|
94
|
+
|
|
95
|
+
Build the API bundle:
|
|
96
|
+
|
|
97
|
+
\`\`\`bash
|
|
98
|
+
yarn build
|
|
99
|
+
\`\`\`
|
|
100
|
+
|
|
101
|
+
Run all project checks:
|
|
102
|
+
|
|
103
|
+
\`\`\`bash
|
|
104
|
+
yarn check
|
|
105
|
+
\`\`\`
|
|
106
|
+
|
|
107
|
+
## Scripts
|
|
108
|
+
|
|
109
|
+
- \`yarn start\` - start all workspace services.
|
|
110
|
+
- \`yarn start:api\` - run the API from \`workspaces/api/index.ts\`.
|
|
111
|
+
- \`yarn build\` - build all project outputs.
|
|
112
|
+
- \`yarn build:api\` - create the production API bundle in \`dist/api\`.
|
|
113
|
+
- \`yarn test\` - run Jest tests.
|
|
114
|
+
- \`yarn lint\` - run TypeScript, Prettier, and ESLint validation.
|
|
115
|
+
- \`yarn storybook\` - start Storybook documentation.
|
|
116
|
+
|
|
117
|
+
## Project Structure
|
|
118
|
+
|
|
119
|
+
- \`workspaces/api\` - API source, tests, build script, and workspace README.
|
|
120
|
+
- \`.storybook\` - Storybook configuration for MDX documentation and stories.
|
|
121
|
+
- \`doc.mdx\` - root Storybook documentation page backed by this README.
|
|
122
|
+
- \`dist\` - generated production output.
|
|
123
|
+
|
|
124
|
+
## Development
|
|
125
|
+
|
|
126
|
+
Keep public behavior documented in the relevant workspace README and covered by
|
|
127
|
+
matching tests. For API changes, start with \`workspaces/api/index.ts\` and keep
|
|
128
|
+
\`workspaces/api/index.test.ts\` aligned with the request/response contract.
|
|
129
|
+
|
|
130
|
+
## Project Guidance
|
|
131
|
+
|
|
132
|
+
These articles describe the development approach behind this preset and provide practical guidance for evolving a project on top of it:
|
|
133
|
+
|
|
134
|
+
- [Calm Development Environment: Node.js, Corepack, Yarn and Static Preview](https://vyriy.dev/blog/calm-development-setup/) - how to keep the local development environment predictable and easy to reproduce.
|
|
135
|
+
- [Calm App Structure for the Vyriy Ecosystem](https://vyriy.dev/blog/vyriy-calm-app-structure/) - a practical project structure for Vyriy applications: shared configs, small packages, thin workspaces, Storybook docs, tests, and deployable entry points.
|
|
136
|
+
- [One Handler, Many Runtimes](https://vyriy.dev/examples/one-handler-many-runtimes/) - how @vyriy/handler, @vyriy/router, and @vyriy/server compose a calm Lambda-compatible API that can run locally, in Docker, Fargate-style HTTP runtimes, and AWS Lambda.
|
|
137
|
+
- [Storybook as Project Documentation](https://vyriy.dev/blog/storybook-as-project-documentation/) - how to use Storybook as living project documentation and a component playground.
|
|
138
|
+
`,
|
|
69
139
|
'doc.mdx': `import { Meta, Markdown } from '@storybook/addon-docs/blocks';
|
|
70
140
|
import ReadMe from './README.md?raw';
|
|
71
141
|
|
|
72
|
-
<Meta title="
|
|
142
|
+
<Meta title="Api" />
|
|
73
143
|
|
|
74
144
|
<Markdown>{ReadMe}</Markdown>
|
|
75
145
|
`,
|
|
@@ -195,7 +265,50 @@ import ReadMe from './README.md?raw';
|
|
|
195
265
|
|
|
196
266
|
<Markdown>{ReadMe}</Markdown>
|
|
197
267
|
`,
|
|
198
|
-
'workspaces/api/README.md': `#
|
|
268
|
+
'workspaces/api/README.md': `# @w/api
|
|
269
|
+
|
|
270
|
+
HTTP API workspace for the application.
|
|
271
|
+
|
|
272
|
+
The current handler starts a \`@vyriy/server\` instance with an \`@vyriy/handler\`
|
|
273
|
+
API adapter. For every request it returns a JSON response with the requested
|
|
274
|
+
path:
|
|
275
|
+
|
|
276
|
+
\`\`\`json
|
|
277
|
+
{
|
|
278
|
+
"path": "/healthcheck"
|
|
279
|
+
}
|
|
280
|
+
\`\`\`
|
|
281
|
+
|
|
282
|
+
## Usage
|
|
283
|
+
|
|
284
|
+
Start the API from the repository root:
|
|
285
|
+
|
|
286
|
+
\`\`\`bash
|
|
287
|
+
yarn start:api
|
|
288
|
+
\`\`\`
|
|
289
|
+
|
|
290
|
+
Build the production bundle:
|
|
291
|
+
|
|
292
|
+
\`\`\`bash
|
|
293
|
+
yarn build:api
|
|
294
|
+
\`\`\`
|
|
295
|
+
|
|
296
|
+
The build writes a CommonJS bundle to \`dist/api/index.js\` and copies the
|
|
297
|
+
workspace \`package.json\` into \`dist/api\`.
|
|
298
|
+
|
|
299
|
+
## Development
|
|
300
|
+
|
|
301
|
+
The API entry point is \`index.ts\`.
|
|
302
|
+
|
|
303
|
+
Update the handler there when adding routes or changing response behavior, and
|
|
304
|
+
keep \`index.test.ts\` aligned with the public behavior.
|
|
305
|
+
|
|
306
|
+
Run the focused test suite with:
|
|
307
|
+
|
|
308
|
+
\`\`\`bash
|
|
309
|
+
yarn jest workspaces/api --runInBand --coverage=false
|
|
310
|
+
\`\`\`
|
|
311
|
+
`,
|
|
199
312
|
'workspaces/api/webpack.config.ts': `import { path } from '@vyriy/path';
|
|
200
313
|
import { ssr, external } from '@vyriy/webpack-config';
|
|
201
314
|
|