vyriy 0.3.9 → 0.4.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 (190) hide show
  1. package/README.md +75 -179
  2. package/bin/vyriy.js +2 -2
  3. package/cli/args.js +29 -0
  4. package/cli/cli.d.ts +2 -2
  5. package/cli/cli.js +18 -69
  6. package/cli/index.d.ts +1 -1
  7. package/cli/index.js +1 -1
  8. package/cli/types.d.ts +12 -3
  9. package/commands/check-env.d.ts +2 -0
  10. package/commands/check-env.js +65 -0
  11. package/commands/create/index.d.ts +2 -0
  12. package/commands/create/index.js +121 -0
  13. package/commands/create/plan/index.d.ts +4 -0
  14. package/commands/create/plan/index.js +3 -0
  15. package/commands/create/plan/plan.d.ts +9 -0
  16. package/commands/create/plan/plan.js +34 -0
  17. package/commands/create/plan/question.d.ts +2 -0
  18. package/commands/create/plan/question.js +25 -0
  19. package/commands/create/plan/types.d.ts +14 -0
  20. package/commands/create/preset/api.d.ts +2 -0
  21. package/commands/create/preset/api.js +168 -0
  22. package/commands/create/preset/base.d.ts +2 -0
  23. package/commands/create/preset/base.js +195 -0
  24. package/commands/create/preset/gql.d.ts +2 -0
  25. package/commands/create/preset/gql.js +16 -0
  26. package/commands/create/preset/index.d.ts +17 -0
  27. package/commands/create/preset/index.js +20 -0
  28. package/commands/create/preset/library.d.ts +2 -0
  29. package/commands/create/preset/library.js +252 -0
  30. package/commands/create/preset/mfe.d.ts +2 -0
  31. package/commands/create/preset/mfe.js +16 -0
  32. package/commands/create/preset/rest.d.ts +2 -0
  33. package/commands/create/preset/rest.js +16 -0
  34. package/commands/create/preset/spa.d.ts +2 -0
  35. package/commands/create/preset/spa.js +16 -0
  36. package/commands/create/preset/ssg.d.ts +2 -0
  37. package/commands/create/preset/ssg.js +16 -0
  38. package/commands/create/preset/ssr.d.ts +2 -0
  39. package/commands/create/preset/ssr.js +16 -0
  40. package/commands/create/preset/types.d.ts +15 -0
  41. package/commands/create/prompt/conflict-strategy.d.ts +5 -0
  42. package/commands/create/prompt/conflict-strategy.js +22 -0
  43. package/commands/create/prompt/index.d.ts +7 -0
  44. package/commands/create/prompt/index.js +6 -0
  45. package/commands/create/prompt/preset.d.ts +4 -0
  46. package/commands/create/prompt/preset.js +11 -0
  47. package/commands/create/prompt/prompt.d.ts +2 -0
  48. package/commands/create/prompt/prompt.js +4 -0
  49. package/commands/create/prompt/provider.d.ts +2 -0
  50. package/commands/create/prompt/provider.js +13 -0
  51. package/commands/create/prompt/resolve-option.d.ts +6 -0
  52. package/commands/create/prompt/resolve-option.js +8 -0
  53. package/commands/create/prompt/scope.d.ts +2 -0
  54. package/commands/create/prompt/scope.js +2 -0
  55. package/commands/create/prompt/types.d.ts +4 -0
  56. package/commands/dist.d.ts +2 -0
  57. package/commands/{publish/publish.js → dist.js} +22 -9
  58. package/commands/help.d.ts +3 -0
  59. package/commands/help.js +24 -0
  60. package/commands/index.d.ts +5 -0
  61. package/commands/index.js +5 -0
  62. package/commands/{publish/types.d.ts → types.d.ts} +18 -4
  63. package/commands/version.d.ts +2 -0
  64. package/commands/version.js +6 -0
  65. package/package.json +20 -588
  66. package/bin/vyriy.d.ts +0 -2
  67. package/checks/node/index.d.ts +0 -2
  68. package/checks/node/index.js +0 -1
  69. package/checks/node/node.d.ts +0 -2
  70. package/checks/node/node.js +0 -22
  71. package/checks/node/types.d.ts +0 -11
  72. package/checks/yarn/index.d.ts +0 -2
  73. package/checks/yarn/index.js +0 -1
  74. package/checks/yarn/types.d.ts +0 -7
  75. package/checks/yarn/yarn.d.ts +0 -2
  76. package/checks/yarn/yarn.js +0 -40
  77. package/cli/args/args.js +0 -40
  78. package/cli/args/index.d.ts +0 -2
  79. package/cli/args/index.js +0 -1
  80. package/cli/args/types.d.ts +0 -24
  81. package/commands/doctor/doctor.d.ts +0 -2
  82. package/commands/doctor/doctor.js +0 -9
  83. package/commands/doctor/index.d.ts +0 -2
  84. package/commands/doctor/index.js +0 -1
  85. package/commands/doctor/types.d.ts +0 -8
  86. package/commands/init/index.d.ts +0 -2
  87. package/commands/init/index.js +0 -1
  88. package/commands/init/init.d.ts +0 -2
  89. package/commands/init/init.js +0 -7
  90. package/commands/init/types.d.ts +0 -5
  91. package/commands/new/index.d.ts +0 -2
  92. package/commands/new/index.js +0 -1
  93. package/commands/new/new.d.ts +0 -3
  94. package/commands/new/new.js +0 -189
  95. package/commands/new/types.d.ts +0 -15
  96. package/commands/publish/index.d.ts +0 -2
  97. package/commands/publish/index.js +0 -1
  98. package/commands/publish/publish.d.ts +0 -2
  99. package/doctor/checkCorepack.d.ts +0 -2
  100. package/doctor/checkCorepack.js +0 -24
  101. package/doctor/checkGit.d.ts +0 -2
  102. package/doctor/checkGit.js +0 -23
  103. package/doctor/checkNodeVersion.d.ts +0 -5
  104. package/doctor/checkNodeVersion.js +0 -24
  105. package/doctor/checkYarn.d.ts +0 -10
  106. package/doctor/checkYarn.js +0 -45
  107. package/doctor/createDoctorReport.d.ts +0 -2
  108. package/doctor/createDoctorReport.js +0 -17
  109. package/doctor/index.d.ts +0 -7
  110. package/doctor/index.js +0 -6
  111. package/doctor/printDoctorReport.d.ts +0 -2
  112. package/doctor/printDoctorReport.js +0 -42
  113. package/doctor/types.d.ts +0 -25
  114. package/file-plan/createFilePlan.d.ts +0 -4
  115. package/file-plan/createFilePlan.js +0 -29
  116. package/file-plan/index.d.ts +0 -4
  117. package/file-plan/index.js +0 -3
  118. package/file-plan/printFilePlan.d.ts +0 -2
  119. package/file-plan/printFilePlan.js +0 -44
  120. package/file-plan/types.d.ts +0 -12
  121. package/file-plan/writeFilePlan.d.ts +0 -2
  122. package/file-plan/writeFilePlan.js +0 -12
  123. package/index.d.ts +0 -12
  124. package/index.js +0 -12
  125. package/presets/agentsTemplate.d.ts +0 -1
  126. package/presets/agentsTemplate.js +0 -105
  127. package/presets/base/createBaseFiles.d.ts +0 -3
  128. package/presets/base/createBaseFiles.js +0 -307
  129. package/presets/config.d.ts +0 -28
  130. package/presets/config.js +0 -7
  131. package/presets/createProjectFiles.d.ts +0 -2
  132. package/presets/createProjectFiles.js +0 -8
  133. package/presets/index.d.ts +0 -2
  134. package/presets/index.js +0 -1
  135. package/presets/library/createLibraryUiFiles.d.ts +0 -3
  136. package/presets/library/createLibraryUiFiles.js +0 -127
  137. package/presets/packages/createPackageFiles.d.ts +0 -3
  138. package/presets/packages/createPackageFiles.js +0 -39
  139. package/presets/packages/createPackageManifest.d.ts +0 -7
  140. package/presets/packages/createPackageManifest.js +0 -13
  141. package/presets/types.d.ts +0 -3
  142. package/presets/workspaces/createWorkspaceFiles.d.ts +0 -3
  143. package/presets/workspaces/createWorkspaceFiles.js +0 -98
  144. package/project-plan/api/api.d.ts +0 -6
  145. package/project-plan/api/api.js +0 -44
  146. package/project-plan/api/index.d.ts +0 -2
  147. package/project-plan/api/index.js +0 -1
  148. package/project-plan/api/types.d.ts +0 -11
  149. package/project-plan/ci/ci.d.ts +0 -3
  150. package/project-plan/ci/ci.js +0 -20
  151. package/project-plan/ci/index.d.ts +0 -2
  152. package/project-plan/ci/index.js +0 -1
  153. package/project-plan/ci/types.d.ts +0 -6
  154. package/project-plan/create/create.d.ts +0 -2
  155. package/project-plan/create/create.js +0 -129
  156. package/project-plan/create/index.d.ts +0 -2
  157. package/project-plan/create/index.js +0 -1
  158. package/project-plan/create/types.d.ts +0 -13
  159. package/project-plan/index.d.ts +0 -6
  160. package/project-plan/index.js +0 -5
  161. package/project-plan/kind/index.d.ts +0 -2
  162. package/project-plan/kind/index.js +0 -1
  163. package/project-plan/kind/kind.d.ts +0 -2
  164. package/project-plan/kind/kind.js +0 -1
  165. package/project-plan/kind/types.d.ts +0 -2
  166. package/project-plan/print/index.d.ts +0 -2
  167. package/project-plan/print/index.js +0 -1
  168. package/project-plan/print/print.d.ts +0 -2
  169. package/project-plan/print/print.js +0 -47
  170. package/project-plan/print/types.d.ts +0 -2
  171. package/project-plan/types.d.ts +0 -46
  172. package/prompts/project-plan/index.d.ts +0 -2
  173. package/prompts/project-plan/index.js +0 -1
  174. package/prompts/project-plan/project-plan.d.ts +0 -2
  175. package/prompts/project-plan/project-plan.js +0 -198
  176. package/prompts/project-plan/types.d.ts +0 -18
  177. package/shared/commandExists.d.ts +0 -2
  178. package/shared/commandExists.js +0 -10
  179. package/shared/execCommand.d.ts +0 -2
  180. package/shared/execCommand.js +0 -7
  181. package/shared/fileExists.d.ts +0 -2
  182. package/shared/fileExists.js +0 -10
  183. package/shared/index.d.ts +0 -6
  184. package/shared/index.js +0 -5
  185. package/shared/runCommand.d.ts +0 -9
  186. package/shared/runCommand.js +0 -34
  187. package/shared/semver.d.ts +0 -1
  188. package/shared/semver.js +0 -4
  189. package/shared/types.d.ts +0 -12
  190. /package/cli/{args/args.d.ts → args.d.ts} +0 -0
@@ -0,0 +1,9 @@
1
+ export declare const plan: (dirName: string, appPath: string) => Promise<{
2
+ name: string;
3
+ description: string;
4
+ target: string;
5
+ preset: "base" | "api" | "library";
6
+ scope: string | undefined;
7
+ ci: import("../preset/types.js").CiProvider | undefined;
8
+ deploy: import("../preset/types.js").DeployProvider | undefined;
9
+ } | undefined>;
@@ -0,0 +1,34 @@
1
+ import { stdin, stdout } from 'node:process';
2
+ import { createInterface } from 'node:readline';
3
+ import { presets as appPreset } from '../preset/index.js';
4
+ import { prompt, provider as promptProvider, preset as promptPreset, scope as promptScope } from '../prompt/index.js';
5
+ import { question as createQuestion } from './question.js';
6
+ export const plan = async (dirName, appPath) => {
7
+ const readline = createInterface({ input: stdin, output: stdout });
8
+ const question = createQuestion(readline, stdout);
9
+ try {
10
+ stdout.write('\nVyriy Project Master\n\n');
11
+ const name = await prompt(question, 'Project name', dirName);
12
+ const description = await prompt(question, 'Project description', 'Calm cloud-ready application');
13
+ const target = await prompt(question, 'Target directory', appPath);
14
+ const preset = await promptPreset(question, stdout);
15
+ const scope = await promptScope(question, preset, name);
16
+ const ci = await promptProvider(question, stdout, 'CI/CD provider', appPreset[preset].preset.ci);
17
+ const deploy = await promptProvider(question, stdout, 'Deploy provider', appPreset[preset].preset.deploy);
18
+ const confirmation = (await prompt(question, 'Use this project plan?', 'y')).toLowerCase();
19
+ return confirmation === 'y'
20
+ ? {
21
+ name,
22
+ description,
23
+ target,
24
+ preset,
25
+ scope,
26
+ ci,
27
+ deploy,
28
+ }
29
+ : undefined;
30
+ }
31
+ finally {
32
+ readline.close();
33
+ }
34
+ };
@@ -0,0 +1,2 @@
1
+ import { Question } from './types.js';
2
+ export declare const question: Question;
@@ -0,0 +1,25 @@
1
+ export const question = (readline, output) => {
2
+ const queuedLines = [];
3
+ const pendingQuestions = [];
4
+ readline.on('line', (line) => {
5
+ const resolve = pendingQuestions.shift();
6
+ if (resolve) {
7
+ resolve(line);
8
+ return;
9
+ }
10
+ queuedLines.push(line);
11
+ });
12
+ readline.on('close', () => {
13
+ for (const resolve of pendingQuestions.splice(0)) {
14
+ resolve('');
15
+ }
16
+ });
17
+ return (query) => {
18
+ output.write(query);
19
+ const queuedLine = queuedLines.shift();
20
+ if (queuedLine !== undefined) {
21
+ return Promise.resolve(queuedLine);
22
+ }
23
+ return new Promise((resolve) => pendingQuestions.push(resolve));
24
+ };
25
+ };
@@ -0,0 +1,14 @@
1
+ import type { Interface } from 'node:readline';
2
+ import type { Writable } from 'node:stream';
3
+ export type Question = (readline: Interface, output: Writable) => (query: string) => Promise<string>;
4
+ export type Prompt = (question: (query: string) => Promise<string>, label: string, defaultValue: string) => Promise<string>;
5
+ export type PlanResult = {
6
+ name: string;
7
+ description: string;
8
+ target: string;
9
+ preset: string;
10
+ scope?: string;
11
+ ci?: string;
12
+ deploy?: string;
13
+ };
14
+ export type Plan = (dirName: string, appPath: string) => Promise<PlanResult | undefined>;
@@ -0,0 +1,2 @@
1
+ import { Preset } from './types.js';
2
+ export declare const api: Preset;
@@ -0,0 +1,168 @@
1
+ import packageJson from '../../../package.json' with { type: 'json' };
2
+ import { base } from './base.js';
3
+ export const api = {
4
+ files: (options) => ({
5
+ ...base.files(options),
6
+ 'package.json': JSON.stringify({
7
+ name: options.name,
8
+ version: '0.0.0',
9
+ description: options.description,
10
+ private: true,
11
+ type: 'module',
12
+ agents: './AGENTS.md',
13
+ packageManager: packageJson.packageManager,
14
+ engines: {
15
+ node: packageJson.engines.node,
16
+ },
17
+ workspaces: [
18
+ 'workspaces/*',
19
+ ],
20
+ scripts: {
21
+ storybook: 'cross-env STORYBOOK_DISABLE_TELEMETRY=1 storybook dev -p 6006 --disable-telemetry',
22
+ check: 'run-s lint build test',
23
+ fix: "run-s 'fix:*'",
24
+ start: "run-p 'start:*'",
25
+ lint: "run-s 'lint:*'",
26
+ build: "run-s 'build:*'",
27
+ test: "run-s 'test:*'",
28
+ 'fix:prettier': 'prettier . --write',
29
+ 'fix:eslint': 'eslint . --fix',
30
+ 'start:api': 'sh workspaces/api/bin/start.sh',
31
+ 'lint:ts': 'tsc',
32
+ 'lint:prettier': 'prettier . --check',
33
+ 'lint:eslint': 'eslint .',
34
+ 'build:api': 'rimraf dist && sh workspaces/api/bin/build.sh',
35
+ 'build:storybook': 'cross-env STORYBOOK_DISABLE_TELEMETRY=1 storybook build --quiet --disable-telemetry',
36
+ 'test:jest': 'jest',
37
+ postinstall: 'husky',
38
+ },
39
+ devDependencies: {
40
+ '@vyriy/typescript-config': `^${packageJson.version}`,
41
+ typescript: packageJson.peerDependencies.typescript,
42
+ '@vyriy/prettier-config': `^${packageJson.version}`,
43
+ prettier: packageJson.peerDependencies.prettier,
44
+ '@vyriy/eslint-config': `^${packageJson.version}`,
45
+ eslint: packageJson.peerDependencies.eslint,
46
+ '@vyriy/jest-config': `^${packageJson.version}`,
47
+ jest: packageJson.peerDependencies.jest,
48
+ '@vyriy/storybook-config': `^${packageJson.version}`,
49
+ storybook: packageJson.peerDependencies.storybook,
50
+ '@vyriy/path': `^${packageJson.version}`,
51
+ vyriy: `^${packageJson.version}`,
52
+ husky: packageJson.peerDependencies.husky,
53
+ 'npm-run-all2': packageJson.peerDependencies['npm-run-all2'],
54
+ 'cross-env': packageJson.peerDependencies['cross-env'],
55
+ rimraf: packageJson.peerDependencies.rimraf,
56
+ '@vyriy/webpack-config': `^${packageJson.version}`,
57
+ '@vyriy/handler': `^${packageJson.version}`,
58
+ '@vyriy/server': `^${packageJson.version}`,
59
+ tsx: packageJson.peerDependencies.tsx,
60
+ webpack: packageJson.peerDependencies.webpack,
61
+ 'webpack-cli': packageJson.peerDependencies['webpack-cli'],
62
+ },
63
+ }, null, 2) + '\n',
64
+ 'workspaces/api/bin/build.sh': `#!/usr/bin/env sh
65
+
66
+ set -e
67
+
68
+ scriptdir="$PWD/workspaces/api";
69
+
70
+ NODE_ENV=production npx webpack --config $scriptdir/webpack.config.ts
71
+
72
+ cp $scriptdir/package.json dist/api/package.json
73
+ npm pkg delete "type" --prefix dist/api
74
+ npm pkg delete "private" --prefix dist/api
75
+ `,
76
+ 'workspaces/api/bin/start.sh': `#!/usr/bin/env sh
77
+
78
+ set -e
79
+
80
+ scriptdir="$PWD/workspaces/api";
81
+
82
+ NODE_ENV=production LOG_LEVEL=info tsx $scriptdir/index.ts
83
+ `,
84
+ 'workspaces/api/doc.mdx': `import { Meta, Markdown } from '@storybook/addon-docs/blocks';
85
+ import ReadMe from './README.md?raw';
86
+
87
+ <Meta title="Workspaces/API" />
88
+
89
+ <Markdown>{ReadMe}</Markdown>
90
+ `,
91
+ 'workspaces/api/README.md': `# ${options.name} API\n\n${options.description}\n`,
92
+ 'workspaces/api/webpack.config.ts': `import { path } from '@vyriy/path';
93
+ import { ssr, external } from '@vyriy/webpack-config';
94
+
95
+ export default ssr(
96
+ '@w/api',
97
+ {
98
+ path: path('dist', 'api'),
99
+ filename: 'index.js',
100
+ library: { type: 'commonjs2' },
101
+ },
102
+ (config) => ({
103
+ ...config,
104
+ externals: [external({ allowlist: [/^@p/, /^@w/, /^@vyriy/] })],
105
+ }),
106
+ );
107
+ `,
108
+ 'workspaces/api/package.json': JSON.stringify({
109
+ name: '@w/api',
110
+ type: 'module',
111
+ private: true,
112
+ }, null, 2) + '\n',
113
+ 'workspaces/api/index.ts': `import { server } from '@vyriy/server';
114
+ import { api } from '@vyriy/handler';
115
+
116
+ server(
117
+ api(async (event) =>
118
+ Promise.resolve({
119
+ statusCode: 200,
120
+ body: JSON.stringify({
121
+ path: event.path,
122
+ }),
123
+ }),
124
+ ),
125
+ );
126
+ `,
127
+ 'workspaces/api/index.test.ts': `import { describe, expect, it, jest } from '@jest/globals';
128
+
129
+ const apiMock = jest.fn((handler) => ({
130
+ handler,
131
+ }));
132
+ const serverMock = jest.fn();
133
+
134
+ jest.mock('@vyriy/handler', () => ({
135
+ api: apiMock,
136
+ }));
137
+
138
+ jest.mock('@vyriy/server', () => ({
139
+ server: serverMock,
140
+ }));
141
+
142
+ describe('workspaces/api/index.ts', () => {
143
+ it('starts the server with a handler that returns the request path', async () => {
144
+ await import('./index.js');
145
+
146
+ expect(apiMock).toHaveBeenCalledTimes(1);
147
+ expect(serverMock).toHaveBeenCalledTimes(1);
148
+ expect(serverMock).toHaveBeenCalledWith(apiMock.mock.results[0]?.value);
149
+
150
+ const handler = apiMock.mock.calls[0]?.[0] as (event: {
151
+ path: string;
152
+ }) => Promise<{ statusCode: number; body: string }>;
153
+
154
+ await expect(handler({ path: '/healthcheck' })).resolves.toEqual({
155
+ statusCode: 200,
156
+ body: JSON.stringify({
157
+ path: '/healthcheck',
158
+ }),
159
+ });
160
+ });
161
+ });
162
+ `,
163
+ }),
164
+ ci: {
165
+ ...base.ci,
166
+ },
167
+ deploy: {},
168
+ };
@@ -0,0 +1,2 @@
1
+ import { Preset } from './types.js';
2
+ export declare const base: Preset;
@@ -0,0 +1,195 @@
1
+ import { existsSync, readFileSync } from 'node:fs';
2
+ import { dirname, resolve } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import packageJson from '../../../package.json' with { type: 'json' };
5
+ const presetDir = dirname(fileURLToPath(import.meta.url));
6
+ const agentsPath = [
7
+ resolve(presetDir, '../../../AGENTS.md'),
8
+ resolve(presetDir, '../../../../AGENTS.md'),
9
+ ].find(existsSync) ?? '';
10
+ const agentsContent = agentsPath ? readFileSync(agentsPath, 'utf8') : '';
11
+ export const base = {
12
+ files: ({ name, description }) => ({
13
+ 'package.json': JSON.stringify({
14
+ name,
15
+ version: '0.0.0',
16
+ description,
17
+ private: true,
18
+ type: 'module',
19
+ agents: './AGENTS.md',
20
+ packageManager: packageJson.packageManager,
21
+ engines: {
22
+ node: packageJson.engines.node,
23
+ },
24
+ scripts: {
25
+ storybook: 'cross-env STORYBOOK_DISABLE_TELEMETRY=1 storybook dev -p 6006 --disable-telemetry',
26
+ check: 'run-s lint build test',
27
+ fix: "run-s 'fix:*'",
28
+ lint: "run-s 'lint:*'",
29
+ build: "run-s 'build:*'",
30
+ test: "run-s 'test:*'",
31
+ 'fix:prettier': 'prettier . --write',
32
+ 'fix:eslint': 'eslint . --fix',
33
+ 'lint:ts': 'tsc',
34
+ 'lint:prettier': 'prettier . --check',
35
+ 'lint:eslint': 'eslint .',
36
+ 'build:storybook': 'cross-env STORYBOOK_DISABLE_TELEMETRY=1 storybook build --quiet --disable-telemetry',
37
+ 'test:jest': 'jest --passWithNoTests',
38
+ postinstall: 'husky',
39
+ },
40
+ dependencies: {
41
+ '@vyriy/typescript-config': `^${packageJson.version}`,
42
+ typescript: packageJson.peerDependencies.typescript,
43
+ '@vyriy/prettier-config': `^${packageJson.version}`,
44
+ prettier: packageJson.peerDependencies.prettier,
45
+ '@vyriy/eslint-config': `^${packageJson.version}`,
46
+ eslint: packageJson.peerDependencies.eslint,
47
+ '@vyriy/jest-config': `^${packageJson.version}`,
48
+ jest: packageJson.peerDependencies.jest,
49
+ '@vyriy/storybook-config': `^${packageJson.version}`,
50
+ storybook: packageJson.peerDependencies.storybook,
51
+ '@vyriy/path': `^${packageJson.version}`,
52
+ husky: packageJson.peerDependencies.husky,
53
+ 'npm-run-all2': packageJson.peerDependencies['npm-run-all2'],
54
+ 'cross-env': packageJson.peerDependencies['cross-env'],
55
+ },
56
+ }, null, 2) + '\n',
57
+ 'README.md': `# ${name}\n\n${description}\n`,
58
+ 'doc.mdx': `import { Meta, Markdown } from '@storybook/addon-docs/blocks';
59
+ import ReadMe from './README.md?raw';
60
+
61
+ <Meta title="${name}" />
62
+
63
+ <Markdown>{ReadMe}</Markdown>
64
+ `,
65
+ 'AGENTS.md': agentsContent,
66
+ '.editorconfig': `# https://editorconfig.org
67
+ root = true
68
+
69
+ [*]
70
+ charset = utf-8
71
+ end_of_line = lf
72
+ insert_final_newline = true
73
+ trim_trailing_whitespace = true
74
+
75
+ indent_style = space
76
+ indent_size = 2
77
+
78
+ max_line_length = 100
79
+
80
+ # Markdown
81
+ [*.md]
82
+ trim_trailing_whitespace = false
83
+ max_line_length = off
84
+
85
+ # YAML / YML
86
+ [*.{yml,yaml}]
87
+ indent_size = 2
88
+
89
+ # JSON
90
+ [*.json]
91
+ indent_size = 2
92
+
93
+ # TypeScript / JavaScript
94
+ [*.{ts,tsx,js,jsx}]
95
+ indent_size = 2
96
+
97
+ # Shell / Bash
98
+ [*.sh]
99
+ indent_size = 2
100
+ `,
101
+ '.gitignore': `.yarn/*
102
+ !.yarn/cache
103
+ !.yarn/patches
104
+ !.yarn/plugins
105
+ !.yarn/releases
106
+ !.yarn/sdks
107
+ !.yarn/versions
108
+
109
+ .DS_Store
110
+ .idea
111
+ node_modules
112
+ coverage
113
+ dist
114
+ storybook-static
115
+ *storybook.log
116
+ consumer
117
+
118
+ cdk.out
119
+ cdk.context.json
120
+
121
+ !/**/.gitkeep
122
+ `,
123
+ '.npmrc': 'engine-strict=true\n',
124
+ '.nvmrc': 'lts/krypton\n',
125
+ '.yarnrc.yml': 'nodeLinker: node-modules\nnpmMinimalAgeGate: 0\n',
126
+ '.husky/commit-msg': '#!/bin/sh\n',
127
+ '.husky/post-checkout': '#!/bin/sh\n\nyarn\n',
128
+ '.husky/post-merge': '#!/bin/sh\n\nyarn\n',
129
+ '.husky/pre-commit': '#!/bin/sh\n\nyarn check\n',
130
+ '.husky/pre-push': '#!/bin/sh\n\nyarn check\n',
131
+ '.storybook/main.ts': `import config from '@vyriy/storybook-config';
132
+ import { path } from '@vyriy/path';
133
+
134
+ export default {
135
+ ...config,
136
+ stories: [
137
+ path('**/*.mdx'),
138
+ path('**/*.stories.@(js|jsx|mjs|ts|tsx)'),
139
+ ],
140
+ };
141
+ `,
142
+ '.storybook/preview.tsx': "export { default } from '@vyriy/storybook-config/preview';\n",
143
+ 'yarn.lock': '',
144
+ 'tsconfig.json': JSON.stringify({
145
+ extends: '@vyriy/typescript-config/index.json',
146
+ include: [
147
+ '.storybook/**/*.ts',
148
+ '.storybook/**/*.tsx',
149
+ 'packages/**/*.ts',
150
+ 'packages/**/*.tsx',
151
+ 'workspaces/**/*.ts',
152
+ 'workspaces/**/*.tsx',
153
+ '*.ts',
154
+ ],
155
+ }, null, 2) + '\n',
156
+ 'prettier.config.ts': "export { default } from '@vyriy/prettier-config';\n",
157
+ '.prettierignore': 'node_modules\ndist\ncoverage\nstorybook-static\n',
158
+ 'eslint.config.ts': "export { default } from '@vyriy/eslint-config';\n",
159
+ 'jest.config.ts': "export { default } from '@vyriy/jest-config';\n",
160
+ }),
161
+ ci: {
162
+ gitlab: {
163
+ '.gitlab-ci.yml': `image: node:24
164
+
165
+ code:
166
+ script:
167
+ - corepack enable
168
+ - yarn install
169
+ - yarn check
170
+ `,
171
+ },
172
+ github: {
173
+ '.github/workflows/code.yml': `name: code
174
+
175
+ on:
176
+ push:
177
+ pull_request:
178
+
179
+ jobs:
180
+ code:
181
+ runs-on: ubuntu-latest
182
+ steps:
183
+ - uses: actions/checkout@v4
184
+ - uses: actions/setup-node@v4
185
+ with:
186
+ node-version: 24
187
+ - run: |
188
+ corepack enable
189
+ yarn install
190
+ yarn check
191
+ `,
192
+ },
193
+ },
194
+ deploy: {},
195
+ };
@@ -0,0 +1,2 @@
1
+ import { Preset } from './types.js';
2
+ export declare const gql: Preset;
@@ -0,0 +1,16 @@
1
+ import { base } from './base.js';
2
+ export const gql = {
3
+ files: (options) => ({
4
+ ...base.files(options),
5
+ }),
6
+ ci: {
7
+ github: {
8
+ '.gitlab-ci.yml': 'code',
9
+ },
10
+ },
11
+ deploy: {
12
+ docker: {
13
+ Dockerfile: 'code',
14
+ },
15
+ },
16
+ };
@@ -0,0 +1,17 @@
1
+ export declare const presets: {
2
+ base: {
3
+ name: string;
4
+ description: string;
5
+ preset: import("./types.js").Preset;
6
+ };
7
+ library: {
8
+ name: string;
9
+ description: string;
10
+ preset: import("./types.js").Preset;
11
+ };
12
+ api: {
13
+ name: string;
14
+ description: string;
15
+ preset: import("./types.js").Preset;
16
+ };
17
+ };
@@ -0,0 +1,20 @@
1
+ import { base } from './base.js';
2
+ import { library } from './library.js';
3
+ import { api } from './api.js';
4
+ export const presets = {
5
+ base: {
6
+ name: 'Base',
7
+ description: 'Only configuration',
8
+ preset: base,
9
+ },
10
+ library: {
11
+ name: 'Library',
12
+ description: 'Preset to generate JS/React library',
13
+ preset: library,
14
+ },
15
+ api: {
16
+ name: 'API',
17
+ description: 'Preset to generate simple API',
18
+ preset: api,
19
+ },
20
+ };
@@ -0,0 +1,2 @@
1
+ import { Preset } from './types.js';
2
+ export declare const library: Preset;