vyriy 0.5.1 → 0.5.3

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 (70) hide show
  1. package/README.md +23 -12
  2. package/args.js +40 -0
  3. package/bin/vyriy.js +1 -1
  4. package/cli.js +67 -0
  5. package/package.json +51 -6
  6. package/{cli/types.d.ts → types.d.ts} +7 -1
  7. package/cli/args.js +0 -29
  8. package/cli/cli.js +0 -28
  9. package/commands/check-env.d.ts +0 -2
  10. package/commands/check-env.js +0 -120
  11. package/commands/create/index.d.ts +0 -2
  12. package/commands/create/index.js +0 -135
  13. package/commands/create/plan/index.d.ts +0 -4
  14. package/commands/create/plan/index.js +0 -3
  15. package/commands/create/plan/plan.d.ts +0 -9
  16. package/commands/create/plan/plan.js +0 -34
  17. package/commands/create/plan/question.d.ts +0 -2
  18. package/commands/create/plan/question.js +0 -25
  19. package/commands/create/plan/types.d.ts +0 -14
  20. package/commands/create/preset/api.d.ts +0 -2
  21. package/commands/create/preset/api.js +0 -69
  22. package/commands/create/preset/base.d.ts +0 -2
  23. package/commands/create/preset/base.js +0 -195
  24. package/commands/create/preset/gql.d.ts +0 -2
  25. package/commands/create/preset/gql.js +0 -750
  26. package/commands/create/preset/index.d.ts +0 -47
  27. package/commands/create/preset/index.js +0 -56
  28. package/commands/create/preset/library.d.ts +0 -2
  29. package/commands/create/preset/library.js +0 -253
  30. package/commands/create/preset/mfe.d.ts +0 -2
  31. package/commands/create/preset/mfe.js +0 -333
  32. package/commands/create/preset/rest.d.ts +0 -2
  33. package/commands/create/preset/rest.js +0 -248
  34. package/commands/create/preset/shared.d.ts +0 -116
  35. package/commands/create/preset/shared.js +0 -245
  36. package/commands/create/preset/spa.d.ts +0 -2
  37. package/commands/create/preset/spa.js +0 -138
  38. package/commands/create/preset/ssg.d.ts +0 -2
  39. package/commands/create/preset/ssg.js +0 -177
  40. package/commands/create/preset/ssr.d.ts +0 -2
  41. package/commands/create/preset/ssr.js +0 -185
  42. package/commands/create/preset/types.d.ts +0 -15
  43. package/commands/create/prompt/conflict-strategy.d.ts +0 -5
  44. package/commands/create/prompt/conflict-strategy.js +0 -22
  45. package/commands/create/prompt/index.d.ts +0 -7
  46. package/commands/create/prompt/index.js +0 -6
  47. package/commands/create/prompt/preset.d.ts +0 -4
  48. package/commands/create/prompt/preset.js +0 -11
  49. package/commands/create/prompt/prompt.d.ts +0 -2
  50. package/commands/create/prompt/prompt.js +0 -4
  51. package/commands/create/prompt/provider.d.ts +0 -2
  52. package/commands/create/prompt/provider.js +0 -13
  53. package/commands/create/prompt/resolve-option.d.ts +0 -6
  54. package/commands/create/prompt/resolve-option.js +0 -8
  55. package/commands/create/prompt/scope.d.ts +0 -2
  56. package/commands/create/prompt/scope.js +0 -2
  57. package/commands/create/prompt/types.d.ts +0 -4
  58. package/commands/dist.d.ts +0 -2
  59. package/commands/dist.js +0 -287
  60. package/commands/help.d.ts +0 -3
  61. package/commands/help.js +0 -24
  62. package/commands/index.d.ts +0 -5
  63. package/commands/index.js +0 -5
  64. package/commands/types.d.ts +0 -44
  65. package/commands/version.d.ts +0 -2
  66. package/commands/version.js +0 -6
  67. /package/{cli/args.d.ts → args.d.ts} +0 -0
  68. /package/{cli/cli.d.ts → cli.d.ts} +0 -0
  69. /package/{cli/index.d.ts → index.d.ts} +0 -0
  70. /package/{cli/index.js → index.js} +0 -0
@@ -1,25 +0,0 @@
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
- };
@@ -1,14 +0,0 @@
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>;
@@ -1,2 +0,0 @@
1
- import { Preset } from './types.js';
2
- export declare const api: Preset;
@@ -1,69 +0,0 @@
1
- import { base } from './base.js';
2
- import { apiWorkspaceBaseFiles, baseToolingDeps, buildPackageJson, serverDeps, webpackDeps, workspaceScripts, } from './shared.js';
3
- export const api = {
4
- files: (options) => ({
5
- ...base.files(options),
6
- ...apiWorkspaceBaseFiles(options.name, options.description),
7
- 'package.json': buildPackageJson(options, [
8
- 'workspaces/*',
9
- ], workspaceScripts('api'), {
10
- ...baseToolingDeps(),
11
- ...webpackDeps(),
12
- ...serverDeps(),
13
- }),
14
- 'workspaces/api/index.ts': `import { server } from '@vyriy/server';
15
- import { api } from '@vyriy/handler';
16
-
17
- server(
18
- api(async (event) =>
19
- Promise.resolve({
20
- statusCode: 200,
21
- body: JSON.stringify({
22
- path: event.path,
23
- }),
24
- }),
25
- ),
26
- );
27
- `,
28
- 'workspaces/api/index.test.ts': `import { describe, expect, it, jest } from '@jest/globals';
29
-
30
- const apiMock = jest.fn((handler) => ({
31
- handler,
32
- }));
33
- const serverMock = jest.fn();
34
-
35
- jest.mock('@vyriy/handler', () => ({
36
- api: apiMock,
37
- }));
38
-
39
- jest.mock('@vyriy/server', () => ({
40
- server: serverMock,
41
- }));
42
-
43
- describe('workspaces/api/index.ts', () => {
44
- it('starts the server with a handler that returns the request path', async () => {
45
- await import('./index.js');
46
-
47
- expect(apiMock).toHaveBeenCalledTimes(1);
48
- expect(serverMock).toHaveBeenCalledTimes(1);
49
- expect(serverMock).toHaveBeenCalledWith(apiMock.mock.results[0]?.value);
50
-
51
- const handler = apiMock.mock.calls[0]?.[0] as (event: {
52
- path: string;
53
- }) => Promise<{ statusCode: number; body: string }>;
54
-
55
- await expect(handler({ path: '/healthcheck' })).resolves.toEqual({
56
- statusCode: 200,
57
- body: JSON.stringify({
58
- path: '/healthcheck',
59
- }),
60
- });
61
- });
62
- });
63
- `,
64
- }),
65
- ci: {
66
- ...base.ci,
67
- },
68
- deploy: {},
69
- };
@@ -1,2 +0,0 @@
1
- import { Preset } from './types.js';
2
- export declare const base: Preset;
@@ -1,195 +0,0 @@
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\nconsumer\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
- };
@@ -1,2 +0,0 @@
1
- import { Preset } from './types.js';
2
- export declare const gql: Preset;