vyriy 0.5.1 → 0.5.2

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.
@@ -1,27 +1,26 @@
1
1
  import packageJson from '../../../package.json' with { type: 'json' };
2
2
  import { base } from './base.js';
3
3
  import { assetsDeclarationFile, baseToolingDeps, buildPackageJson, reactComponentFiles, reactDeps, reactServiceFiles, reactWorkspaceScripts, serverDeps, stylelintConfigFile, stylelintDeps, webpackDeps, } from './shared.js';
4
- export const ssr = {
5
- files: (options) => ({
6
- ...base.files(options),
7
- ...stylelintConfigFile(),
8
- ...assetsDeclarationFile(),
9
- ...reactComponentFiles(),
10
- ...reactServiceFiles(),
11
- 'package.json': buildPackageJson(options, [
12
- 'packages/*',
13
- 'workspaces/*',
14
- ], reactWorkspaceScripts('api'), {
15
- ...baseToolingDeps(),
16
- ...webpackDeps(),
17
- ...serverDeps(),
18
- ...reactDeps(),
19
- ...stylelintDeps(),
20
- '@vyriy/cn': `^${packageJson.version}`,
21
- '@vyriy/html': `^${packageJson.version}`,
22
- sass: packageJson.peerDependencies.sass,
23
- }),
24
- 'workspaces/api/bin/build.sh': `#!/usr/bin/env sh
4
+ export const ssr = (options) => ({
5
+ ...base(options),
6
+ ...stylelintConfigFile(),
7
+ ...assetsDeclarationFile(),
8
+ ...reactComponentFiles(),
9
+ ...reactServiceFiles(),
10
+ 'package.json': buildPackageJson(options, [
11
+ 'packages/*',
12
+ 'workspaces/*',
13
+ ], reactWorkspaceScripts('api'), {
14
+ ...baseToolingDeps(),
15
+ ...webpackDeps(),
16
+ ...serverDeps(),
17
+ ...reactDeps(),
18
+ ...stylelintDeps(),
19
+ '@vyriy/cn': `^${packageJson.version}`,
20
+ '@vyriy/html': `^${packageJson.version}`,
21
+ sass: packageJson.peerDependencies.sass,
22
+ }),
23
+ 'workspaces/api/bin/build.sh': `#!/usr/bin/env sh
25
24
 
26
25
  set -e
27
26
 
@@ -35,7 +34,7 @@ cp $scriptdir/package.json "$distdir/package.json"
35
34
  npm pkg delete "type" --prefix "$distdir"
36
35
  npm pkg delete "private" --prefix "$distdir"
37
36
  `,
38
- 'workspaces/api/bin/start.sh': `#!/usr/bin/env sh
37
+ 'workspaces/api/bin/start.sh': `#!/usr/bin/env sh
39
38
 
40
39
  set -e
41
40
 
@@ -47,15 +46,15 @@ yarn exec sass packages/components/page/styles.scss "$distdir/styles.css" --no-s
47
46
 
48
47
  PROJECT_CWD="$distdir" NODE_ENV=production LOG_LEVEL=info "$PWD/node_modules/.bin/tsx" $scriptdir/index.tsx
49
48
  `,
50
- 'workspaces/api/doc.mdx': `import { Meta, Markdown } from '@storybook/addon-docs/blocks';
49
+ 'workspaces/api/doc.mdx': `import { Meta, Markdown } from '@storybook/addon-docs/blocks';
51
50
  import ReadMe from './README.md?raw';
52
51
 
53
52
  <Meta title="Workspaces/API" />
54
53
 
55
54
  <Markdown>{ReadMe}</Markdown>
56
55
  `,
57
- 'workspaces/api/README.md': `# ${options.name} API\n\n${options.description}\n`,
58
- 'workspaces/api/webpack.config.ts': `import { path } from '@vyriy/path';
56
+ 'workspaces/api/README.md': `# ${options.name} API\n\n${options.description}\n`,
57
+ 'workspaces/api/webpack.config.ts': `import { path } from '@vyriy/path';
59
58
  import { ssr, external } from '@vyriy/webpack-config';
60
59
 
61
60
  export default ssr(
@@ -71,12 +70,12 @@ export default ssr(
71
70
  }),
72
71
  );
73
72
  `,
74
- 'workspaces/api/package.json': JSON.stringify({
75
- name: '@w/api',
76
- type: 'module',
77
- private: true,
78
- }, null, 2) + '\n',
79
- 'workspaces/api/index.tsx': `import { readFileSync } from 'node:fs';
73
+ 'workspaces/api/package.json': JSON.stringify({
74
+ name: '@w/api',
75
+ type: 'module',
76
+ private: true,
77
+ }, null, 2) + '\n',
78
+ 'workspaces/api/index.tsx': `import { readFileSync } from 'node:fs';
80
79
  import { renderToString } from 'react-dom/server';
81
80
 
82
81
  import { server } from '@vyriy/server';
@@ -111,7 +110,7 @@ server(
111
110
  }),
112
111
  );
113
112
  `,
114
- 'workspaces/api/index.test.tsx': `import { describe, expect, it, jest } from '@jest/globals';
113
+ 'workspaces/api/index.test.tsx': `import { describe, expect, it, jest } from '@jest/globals';
115
114
 
116
115
  const apiMock = jest.fn((handler) => ({
117
116
  handler,
@@ -177,9 +176,4 @@ describe('workspaces/api/index.tsx', () => {
177
176
  });
178
177
  });
179
178
  `,
180
- }),
181
- ci: {
182
- ...base.ci,
183
- },
184
- deploy: {},
185
- };
179
+ });
@@ -1,13 +1,7 @@
1
1
  import type { PlanResult } from '../plan/types.js';
2
2
  export type FileMap = Record<string, string>;
3
- export type CiProvider = 'gitlab' | 'github';
4
- export type DeployProvider = 'aws' | 'docker';
5
- export type Preset = {
6
- files: (options: PlanResult) => FileMap;
7
- ci: Partial<Record<CiProvider, FileMap>>;
8
- deploy: Partial<Record<DeployProvider, FileMap>>;
9
- };
10
- export type PresetKey = 'base' | 'library' | 'api' | 'ssr' | 'rest' | 'gql' | 'ssg' | 'spa' | 'mfe';
3
+ export type Preset = (options: PlanResult) => FileMap;
4
+ export type PresetKey = 'base' | 'library' | 'api' | 'ssr' | 'rest' | 'gql' | 'ssg' | 'spa' | 'mfe' | 'fullstack';
11
5
  export type Presets = Partial<Record<PresetKey, {
12
6
  name: string;
13
7
  description: string;
@@ -1,6 +1,5 @@
1
1
  export * from './conflict-strategy.js';
2
2
  export * from './prompt.js';
3
- export * from './provider.js';
4
3
  export * from './preset.js';
5
4
  export * from './resolve-option.js';
6
5
  export * from './scope.js';
@@ -1,6 +1,5 @@
1
1
  export * from './conflict-strategy.js';
2
2
  export * from './prompt.js';
3
- export * from './provider.js';
4
3
  export * from './preset.js';
5
4
  export * from './resolve-option.js';
6
5
  export * from './scope.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vyriy",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Interactive project master for calm cloud-ready applications.",
5
5
  "type": "module",
6
6
  "bin": "./bin/vyriy.js",
@@ -1,2 +0,0 @@
1
- import type { PromptOutput, PromptQuestion } from './types.js';
2
- export declare const provider: <OptionName extends string>(question: PromptQuestion, output: PromptOutput, label: string, options: Partial<Record<OptionName, unknown>>) => Promise<OptionName | undefined>;
@@ -1,13 +0,0 @@
1
- import { prompt } from './prompt.js';
2
- import { resolveOption } from './resolve-option.js';
3
- export const provider = async (question, output, label, options) => {
4
- const optionNames = Object.keys(options);
5
- const defaultOption = optionNames[0];
6
- if (defaultOption === undefined) {
7
- return undefined;
8
- }
9
- output.write(`\n${label}:\n\n`);
10
- optionNames.forEach((optionName, index) => output.write(` ${index + 1}. ${optionName}\n`));
11
- const optionValue = await prompt(question, `\n${label} number or name`, defaultOption);
12
- return resolveOption(optionValue, optionNames);
13
- };