vyriy 0.3.5 → 0.3.9
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/README.md +48 -21
- package/cli/args/args.js +6 -0
- package/cli/args/types.d.ts +5 -1
- package/cli/cli.js +18 -2
- package/commands/new/new.js +77 -6
- package/commands/new/types.d.ts +2 -0
- package/commands/publish/index.d.ts +2 -0
- package/commands/publish/index.js +1 -0
- package/commands/publish/publish.d.ts +2 -0
- package/commands/publish/publish.js +274 -0
- package/commands/publish/types.d.ts +31 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +159 -1
- package/presets/base/createBaseFiles.d.ts +3 -0
- package/presets/base/createBaseFiles.js +307 -0
- package/presets/config.d.ts +28 -0
- package/presets/config.js +7 -0
- package/presets/createProjectFiles.js +4 -175
- package/presets/library/createLibraryUiFiles.d.ts +3 -0
- package/presets/library/createLibraryUiFiles.js +127 -0
- package/presets/packages/createPackageFiles.d.ts +3 -0
- package/presets/packages/createPackageFiles.js +39 -0
- package/presets/packages/createPackageManifest.d.ts +7 -0
- package/presets/packages/createPackageManifest.js +13 -0
- package/presets/workspaces/createWorkspaceFiles.d.ts +3 -0
- package/presets/workspaces/createWorkspaceFiles.js +98 -0
- package/project-plan/api/api.js +5 -17
- package/project-plan/api/types.d.ts +1 -0
- package/project-plan/create/create.js +68 -77
- package/project-plan/kind/kind.js +1 -16
- package/project-plan/types.d.ts +7 -7
- package/prompts/project-plan/project-plan.js +62 -24
- package/shared/index.d.ts +1 -0
- package/shared/index.js +1 -0
- package/shared/runCommand.d.ts +9 -0
- package/shared/runCommand.js +34 -0
- package/shared/types.d.ts +7 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type ExportTarget = {
|
|
2
|
+
readonly default: string;
|
|
3
|
+
readonly import: string;
|
|
4
|
+
readonly types: string;
|
|
5
|
+
};
|
|
6
|
+
export type Repository = {
|
|
7
|
+
readonly directory?: string;
|
|
8
|
+
readonly type: string;
|
|
9
|
+
readonly url: string;
|
|
10
|
+
};
|
|
11
|
+
export type PackageJson = {
|
|
12
|
+
agents?: string;
|
|
13
|
+
bin?: string | Record<string, string>;
|
|
14
|
+
dependencies?: unknown;
|
|
15
|
+
engines?: unknown;
|
|
16
|
+
exports?: Record<string, ExportTarget>;
|
|
17
|
+
license?: string;
|
|
18
|
+
main?: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
packageManager?: unknown;
|
|
21
|
+
private?: boolean;
|
|
22
|
+
repository?: Repository;
|
|
23
|
+
scripts?: unknown;
|
|
24
|
+
types?: string;
|
|
25
|
+
workspaces?: unknown;
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
};
|
|
28
|
+
export type RunPublishCommandOptions = {
|
|
29
|
+
readonly cwd?: string;
|
|
30
|
+
};
|
|
31
|
+
export type RunPublishCommand = (options?: RunPublishCommandOptions) => Promise<number>;
|
package/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './cli/index.js';
|
|
|
2
2
|
export * from './commands/doctor/index.js';
|
|
3
3
|
export * from './commands/init/index.js';
|
|
4
4
|
export * from './commands/new/index.js';
|
|
5
|
+
export * from './commands/publish/index.js';
|
|
5
6
|
export * from './checks/yarn/index.js';
|
|
6
7
|
export * from './doctor/index.js';
|
|
7
8
|
export * from './file-plan/index.js';
|
package/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export * from './cli/index.js';
|
|
|
2
2
|
export * from './commands/doctor/index.js';
|
|
3
3
|
export * from './commands/init/index.js';
|
|
4
4
|
export * from './commands/new/index.js';
|
|
5
|
+
export * from './commands/publish/index.js';
|
|
5
6
|
export * from './checks/yarn/index.js';
|
|
6
7
|
export * from './doctor/index.js';
|
|
7
8
|
export * from './file-plan/index.js';
|
package/package.json
CHANGED
|
@@ -1,10 +1,74 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vyriy",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.9",
|
|
4
4
|
"description": "Interactive project master for calm cloud-ready applications.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
7
7
|
"bin": "./bin/vyriy.js",
|
|
8
|
+
"peerDependencies": {
|
|
9
|
+
"@storybook/react-webpack5": "^10.4.0",
|
|
10
|
+
"@types/react": "^19.2.15",
|
|
11
|
+
"@types/react-dom": "^19.2.3",
|
|
12
|
+
"cross-env": "^10.1.0",
|
|
13
|
+
"eslint": "^10.4.0",
|
|
14
|
+
"husky": "^9.1.7",
|
|
15
|
+
"jest": "^30.4.2",
|
|
16
|
+
"npm-run-all2": "^9.0.0",
|
|
17
|
+
"prettier": "^3.8.3",
|
|
18
|
+
"react": "^19.2.6",
|
|
19
|
+
"react-dom": "^19.2.6",
|
|
20
|
+
"rimraf": "^6.1.3",
|
|
21
|
+
"storybook": "^10.4.0",
|
|
22
|
+
"stylelint": "^17.12.0",
|
|
23
|
+
"typescript": "^6.0.3"
|
|
24
|
+
},
|
|
25
|
+
"peerDependenciesMeta": {
|
|
26
|
+
"@storybook/react-webpack5": {
|
|
27
|
+
"optional": true
|
|
28
|
+
},
|
|
29
|
+
"@types/react": {
|
|
30
|
+
"optional": true
|
|
31
|
+
},
|
|
32
|
+
"@types/react-dom": {
|
|
33
|
+
"optional": true
|
|
34
|
+
},
|
|
35
|
+
"cross-env": {
|
|
36
|
+
"optional": true
|
|
37
|
+
},
|
|
38
|
+
"eslint": {
|
|
39
|
+
"optional": true
|
|
40
|
+
},
|
|
41
|
+
"husky": {
|
|
42
|
+
"optional": true
|
|
43
|
+
},
|
|
44
|
+
"jest": {
|
|
45
|
+
"optional": true
|
|
46
|
+
},
|
|
47
|
+
"npm-run-all2": {
|
|
48
|
+
"optional": true
|
|
49
|
+
},
|
|
50
|
+
"prettier": {
|
|
51
|
+
"optional": true
|
|
52
|
+
},
|
|
53
|
+
"react": {
|
|
54
|
+
"optional": true
|
|
55
|
+
},
|
|
56
|
+
"react-dom": {
|
|
57
|
+
"optional": true
|
|
58
|
+
},
|
|
59
|
+
"rimraf": {
|
|
60
|
+
"optional": true
|
|
61
|
+
},
|
|
62
|
+
"storybook": {
|
|
63
|
+
"optional": true
|
|
64
|
+
},
|
|
65
|
+
"stylelint": {
|
|
66
|
+
"optional": true
|
|
67
|
+
},
|
|
68
|
+
"typescript": {
|
|
69
|
+
"optional": true
|
|
70
|
+
}
|
|
71
|
+
},
|
|
8
72
|
"agents": "./AGENTS.md",
|
|
9
73
|
"license": "MIT",
|
|
10
74
|
"repository": {
|
|
@@ -12,6 +76,10 @@
|
|
|
12
76
|
"url": "https://github.com/evheniy/vyriy",
|
|
13
77
|
"directory": "packages/vyriy"
|
|
14
78
|
},
|
|
79
|
+
"packageManager": "yarn@4.15.0",
|
|
80
|
+
"engines": {
|
|
81
|
+
"node": ">=24.0.0"
|
|
82
|
+
},
|
|
15
83
|
"types": "./index.d.ts",
|
|
16
84
|
"exports": {
|
|
17
85
|
".": {
|
|
@@ -169,6 +237,26 @@
|
|
|
169
237
|
"import": "./commands/new/new.js",
|
|
170
238
|
"default": "./commands/new/new.js"
|
|
171
239
|
},
|
|
240
|
+
"./commands/publish/index": {
|
|
241
|
+
"types": "./commands/publish/index.d.ts",
|
|
242
|
+
"import": "./commands/publish/index.js",
|
|
243
|
+
"default": "./commands/publish/index.js"
|
|
244
|
+
},
|
|
245
|
+
"./commands/publish/index.js": {
|
|
246
|
+
"types": "./commands/publish/index.d.ts",
|
|
247
|
+
"import": "./commands/publish/index.js",
|
|
248
|
+
"default": "./commands/publish/index.js"
|
|
249
|
+
},
|
|
250
|
+
"./commands/publish/publish": {
|
|
251
|
+
"types": "./commands/publish/publish.d.ts",
|
|
252
|
+
"import": "./commands/publish/publish.js",
|
|
253
|
+
"default": "./commands/publish/publish.js"
|
|
254
|
+
},
|
|
255
|
+
"./commands/publish/publish.js": {
|
|
256
|
+
"types": "./commands/publish/publish.d.ts",
|
|
257
|
+
"import": "./commands/publish/publish.js",
|
|
258
|
+
"default": "./commands/publish/publish.js"
|
|
259
|
+
},
|
|
172
260
|
"./doctor/checkCorepack": {
|
|
173
261
|
"types": "./doctor/checkCorepack.d.ts",
|
|
174
262
|
"import": "./doctor/checkCorepack.js",
|
|
@@ -299,6 +387,26 @@
|
|
|
299
387
|
"import": "./presets/agentsTemplate.js",
|
|
300
388
|
"default": "./presets/agentsTemplate.js"
|
|
301
389
|
},
|
|
390
|
+
"./presets/base/createBaseFiles": {
|
|
391
|
+
"types": "./presets/base/createBaseFiles.d.ts",
|
|
392
|
+
"import": "./presets/base/createBaseFiles.js",
|
|
393
|
+
"default": "./presets/base/createBaseFiles.js"
|
|
394
|
+
},
|
|
395
|
+
"./presets/base/createBaseFiles.js": {
|
|
396
|
+
"types": "./presets/base/createBaseFiles.d.ts",
|
|
397
|
+
"import": "./presets/base/createBaseFiles.js",
|
|
398
|
+
"default": "./presets/base/createBaseFiles.js"
|
|
399
|
+
},
|
|
400
|
+
"./presets/config": {
|
|
401
|
+
"types": "./presets/config.d.ts",
|
|
402
|
+
"import": "./presets/config.js",
|
|
403
|
+
"default": "./presets/config.js"
|
|
404
|
+
},
|
|
405
|
+
"./presets/config.js": {
|
|
406
|
+
"types": "./presets/config.d.ts",
|
|
407
|
+
"import": "./presets/config.js",
|
|
408
|
+
"default": "./presets/config.js"
|
|
409
|
+
},
|
|
302
410
|
"./presets/createProjectFiles": {
|
|
303
411
|
"types": "./presets/createProjectFiles.d.ts",
|
|
304
412
|
"import": "./presets/createProjectFiles.js",
|
|
@@ -319,6 +427,46 @@
|
|
|
319
427
|
"import": "./presets/index.js",
|
|
320
428
|
"default": "./presets/index.js"
|
|
321
429
|
},
|
|
430
|
+
"./presets/library/createLibraryUiFiles": {
|
|
431
|
+
"types": "./presets/library/createLibraryUiFiles.d.ts",
|
|
432
|
+
"import": "./presets/library/createLibraryUiFiles.js",
|
|
433
|
+
"default": "./presets/library/createLibraryUiFiles.js"
|
|
434
|
+
},
|
|
435
|
+
"./presets/library/createLibraryUiFiles.js": {
|
|
436
|
+
"types": "./presets/library/createLibraryUiFiles.d.ts",
|
|
437
|
+
"import": "./presets/library/createLibraryUiFiles.js",
|
|
438
|
+
"default": "./presets/library/createLibraryUiFiles.js"
|
|
439
|
+
},
|
|
440
|
+
"./presets/packages/createPackageFiles": {
|
|
441
|
+
"types": "./presets/packages/createPackageFiles.d.ts",
|
|
442
|
+
"import": "./presets/packages/createPackageFiles.js",
|
|
443
|
+
"default": "./presets/packages/createPackageFiles.js"
|
|
444
|
+
},
|
|
445
|
+
"./presets/packages/createPackageFiles.js": {
|
|
446
|
+
"types": "./presets/packages/createPackageFiles.d.ts",
|
|
447
|
+
"import": "./presets/packages/createPackageFiles.js",
|
|
448
|
+
"default": "./presets/packages/createPackageFiles.js"
|
|
449
|
+
},
|
|
450
|
+
"./presets/packages/createPackageManifest": {
|
|
451
|
+
"types": "./presets/packages/createPackageManifest.d.ts",
|
|
452
|
+
"import": "./presets/packages/createPackageManifest.js",
|
|
453
|
+
"default": "./presets/packages/createPackageManifest.js"
|
|
454
|
+
},
|
|
455
|
+
"./presets/packages/createPackageManifest.js": {
|
|
456
|
+
"types": "./presets/packages/createPackageManifest.d.ts",
|
|
457
|
+
"import": "./presets/packages/createPackageManifest.js",
|
|
458
|
+
"default": "./presets/packages/createPackageManifest.js"
|
|
459
|
+
},
|
|
460
|
+
"./presets/workspaces/createWorkspaceFiles": {
|
|
461
|
+
"types": "./presets/workspaces/createWorkspaceFiles.d.ts",
|
|
462
|
+
"import": "./presets/workspaces/createWorkspaceFiles.js",
|
|
463
|
+
"default": "./presets/workspaces/createWorkspaceFiles.js"
|
|
464
|
+
},
|
|
465
|
+
"./presets/workspaces/createWorkspaceFiles.js": {
|
|
466
|
+
"types": "./presets/workspaces/createWorkspaceFiles.d.ts",
|
|
467
|
+
"import": "./presets/workspaces/createWorkspaceFiles.js",
|
|
468
|
+
"default": "./presets/workspaces/createWorkspaceFiles.js"
|
|
469
|
+
},
|
|
322
470
|
"./project-plan/api/api": {
|
|
323
471
|
"types": "./project-plan/api/api.d.ts",
|
|
324
472
|
"import": "./project-plan/api/api.js",
|
|
@@ -489,6 +637,16 @@
|
|
|
489
637
|
"import": "./shared/index.js",
|
|
490
638
|
"default": "./shared/index.js"
|
|
491
639
|
},
|
|
640
|
+
"./shared/runCommand": {
|
|
641
|
+
"types": "./shared/runCommand.d.ts",
|
|
642
|
+
"import": "./shared/runCommand.js",
|
|
643
|
+
"default": "./shared/runCommand.js"
|
|
644
|
+
},
|
|
645
|
+
"./shared/runCommand.js": {
|
|
646
|
+
"types": "./shared/runCommand.d.ts",
|
|
647
|
+
"import": "./shared/runCommand.js",
|
|
648
|
+
"default": "./shared/runCommand.js"
|
|
649
|
+
},
|
|
492
650
|
"./shared/semver": {
|
|
493
651
|
"types": "./shared/semver.d.ts",
|
|
494
652
|
"import": "./shared/semver.js",
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import { agentsTemplate } from '../agentsTemplate.js';
|
|
2
|
+
import { json, packageVersion, peerDependencies, publishedPackageJson } from '../config.js';
|
|
3
|
+
const baseRootDevDependencies = {
|
|
4
|
+
'@vyriy/typescript-config': packageVersion(publishedPackageJson.version),
|
|
5
|
+
typescript: peerDependencies.typescript,
|
|
6
|
+
'@vyriy/prettier-config': packageVersion(publishedPackageJson.version),
|
|
7
|
+
prettier: peerDependencies.prettier,
|
|
8
|
+
'@vyriy/eslint-config': packageVersion(publishedPackageJson.version),
|
|
9
|
+
eslint: peerDependencies.eslint,
|
|
10
|
+
'@vyriy/jest-config': packageVersion(publishedPackageJson.version),
|
|
11
|
+
jest: peerDependencies.jest,
|
|
12
|
+
'@vyriy/storybook-config': packageVersion(publishedPackageJson.version),
|
|
13
|
+
storybook: peerDependencies.storybook,
|
|
14
|
+
'@storybook/react-webpack5': peerDependencies['@storybook/react-webpack5'],
|
|
15
|
+
react: peerDependencies.react,
|
|
16
|
+
'react-dom': peerDependencies['react-dom'],
|
|
17
|
+
'@types/react': peerDependencies['@types/react'],
|
|
18
|
+
'@types/react-dom': peerDependencies['@types/react-dom'],
|
|
19
|
+
'@vyriy/path': packageVersion(publishedPackageJson.version),
|
|
20
|
+
husky: peerDependencies.husky,
|
|
21
|
+
'npm-run-all2': peerDependencies['npm-run-all2'],
|
|
22
|
+
'cross-env': peerDependencies['cross-env'],
|
|
23
|
+
};
|
|
24
|
+
const buildDistDevDependencies = {
|
|
25
|
+
vyriy: packageVersion(publishedPackageJson.version),
|
|
26
|
+
rimraf: peerDependencies.rimraf,
|
|
27
|
+
};
|
|
28
|
+
const stylelintDevDependencies = {
|
|
29
|
+
'@vyriy/stylelint-config': packageVersion(publishedPackageJson.version),
|
|
30
|
+
stylelint: peerDependencies.stylelint,
|
|
31
|
+
};
|
|
32
|
+
const shouldCreateStylelintConfig = (plan) => plan.features.some((feature) => [
|
|
33
|
+
'react',
|
|
34
|
+
'webpack',
|
|
35
|
+
].includes(feature));
|
|
36
|
+
const getStylePackageName = (plan) => plan.packages.find((packagePlan) => packagePlan.kind === 'ui')?.name ?? 'ui';
|
|
37
|
+
const shouldCreateResetStyles = (plan) => shouldCreateStylelintConfig(plan) && plan.preset !== 'library';
|
|
38
|
+
const hasPublishablePackages = (plan) => plan.packages.some((packagePlan) => packagePlan.publishable);
|
|
39
|
+
const createRootPackageJson = (plan) => {
|
|
40
|
+
const publishable = hasPublishablePackages(plan);
|
|
41
|
+
const stylelint = shouldCreateStylelintConfig(plan);
|
|
42
|
+
return {
|
|
43
|
+
path: 'package.json',
|
|
44
|
+
content: json({
|
|
45
|
+
name: `${plan.packageScope}/${plan.projectName}`,
|
|
46
|
+
version: '0.0.0',
|
|
47
|
+
description: plan.description,
|
|
48
|
+
private: true,
|
|
49
|
+
type: 'module',
|
|
50
|
+
packageManager: publishedPackageJson.packageManager,
|
|
51
|
+
engines: {
|
|
52
|
+
node: publishedPackageJson.engines.node,
|
|
53
|
+
},
|
|
54
|
+
workspaces: [
|
|
55
|
+
'packages/*',
|
|
56
|
+
'workspaces/*',
|
|
57
|
+
],
|
|
58
|
+
scripts: {
|
|
59
|
+
storybook: 'cross-env STORYBOOK_DISABLE_TELEMETRY=1 storybook dev -p 6006 --disable-telemetry',
|
|
60
|
+
check: 'run-s lint build test',
|
|
61
|
+
fix: "run-s 'fix:*'",
|
|
62
|
+
lint: "run-s 'lint:*'",
|
|
63
|
+
build: "run-s 'build:*'",
|
|
64
|
+
test: "run-s 'test:*'",
|
|
65
|
+
'fix:prettier': 'prettier . --write',
|
|
66
|
+
'fix:eslint': 'eslint . --fix',
|
|
67
|
+
'lint:ts': 'tsc --pretty false',
|
|
68
|
+
'lint:prettier': 'prettier . --check',
|
|
69
|
+
'lint:eslint': 'eslint .',
|
|
70
|
+
...(stylelint ? { 'lint:stylelint': 'stylelint "packages/**/*.{scss,css}"' } : {}),
|
|
71
|
+
'build:dist': publishable
|
|
72
|
+
? 'rimraf dist && tsc -p tsconfig.build.json && vyriy publish'
|
|
73
|
+
: 'echo "Build dist is not configured yet."',
|
|
74
|
+
'build:storybook': 'cross-env STORYBOOK_DISABLE_TELEMETRY=1 storybook build --quiet --disable-telemetry',
|
|
75
|
+
'test:jest': 'jest --passWithNoTests',
|
|
76
|
+
postinstall: 'husky',
|
|
77
|
+
},
|
|
78
|
+
devDependencies: {
|
|
79
|
+
...baseRootDevDependencies,
|
|
80
|
+
...(publishable ? buildDistDevDependencies : {}),
|
|
81
|
+
...(stylelint ? stylelintDevDependencies : {}),
|
|
82
|
+
},
|
|
83
|
+
}),
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
const createBuildTsConfig = () => ({
|
|
87
|
+
path: 'tsconfig.build.json',
|
|
88
|
+
content: json({
|
|
89
|
+
extends: './tsconfig.json',
|
|
90
|
+
include: [
|
|
91
|
+
'packages/**/*.ts',
|
|
92
|
+
'packages/**/*.tsx',
|
|
93
|
+
'packages/**/*.json',
|
|
94
|
+
],
|
|
95
|
+
exclude: [
|
|
96
|
+
'**/*.test.ts',
|
|
97
|
+
'**/*.test.tsx',
|
|
98
|
+
'**/*.stories.ts',
|
|
99
|
+
'**/*.stories.tsx',
|
|
100
|
+
],
|
|
101
|
+
compilerOptions: {
|
|
102
|
+
rootDir: './packages',
|
|
103
|
+
outDir: './dist',
|
|
104
|
+
noEmit: false,
|
|
105
|
+
declaration: true,
|
|
106
|
+
allowImportingTsExtensions: false,
|
|
107
|
+
},
|
|
108
|
+
}),
|
|
109
|
+
});
|
|
110
|
+
const createStyleFiles = (plan) => shouldCreateStylelintConfig(plan)
|
|
111
|
+
? [
|
|
112
|
+
{
|
|
113
|
+
path: 'stylelint.config.ts',
|
|
114
|
+
content: "export { default } from '@vyriy/stylelint-config';\n",
|
|
115
|
+
},
|
|
116
|
+
...(shouldCreateResetStyles(plan)
|
|
117
|
+
? [
|
|
118
|
+
{
|
|
119
|
+
path: `packages/${getStylePackageName(plan)}/reset.scss`,
|
|
120
|
+
content: `html {
|
|
121
|
+
box-sizing: border-box;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
*,
|
|
125
|
+
*::before,
|
|
126
|
+
*::after {
|
|
127
|
+
box-sizing: inherit;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
body {
|
|
131
|
+
margin: 0;
|
|
132
|
+
}
|
|
133
|
+
`,
|
|
134
|
+
},
|
|
135
|
+
]
|
|
136
|
+
: []),
|
|
137
|
+
]
|
|
138
|
+
: [];
|
|
139
|
+
export const createBaseFiles = (plan) => [
|
|
140
|
+
createRootPackageJson(plan),
|
|
141
|
+
{
|
|
142
|
+
path: 'README.md',
|
|
143
|
+
content: `# ${plan.projectName}\n\n${plan.description}\n`,
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
path: 'doc.mdx',
|
|
147
|
+
content: `import { Meta, Markdown } from '@storybook/addon-docs/blocks';
|
|
148
|
+
import ReadMe from './README.md?raw';
|
|
149
|
+
|
|
150
|
+
<Meta title="${plan.projectName}" />
|
|
151
|
+
|
|
152
|
+
<Markdown>{ReadMe}</Markdown>
|
|
153
|
+
`,
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
path: 'AGENTS.md',
|
|
157
|
+
content: agentsTemplate,
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
path: '.editorconfig',
|
|
161
|
+
content: `# https://editorconfig.org
|
|
162
|
+
root = true
|
|
163
|
+
|
|
164
|
+
[*]
|
|
165
|
+
charset = utf-8
|
|
166
|
+
end_of_line = lf
|
|
167
|
+
insert_final_newline = true
|
|
168
|
+
trim_trailing_whitespace = true
|
|
169
|
+
|
|
170
|
+
indent_style = space
|
|
171
|
+
indent_size = 2
|
|
172
|
+
|
|
173
|
+
max_line_length = 100
|
|
174
|
+
|
|
175
|
+
# Markdown
|
|
176
|
+
[*.md]
|
|
177
|
+
trim_trailing_whitespace = false
|
|
178
|
+
max_line_length = off
|
|
179
|
+
|
|
180
|
+
# YAML / YML
|
|
181
|
+
[*.{yml,yaml}]
|
|
182
|
+
indent_size = 2
|
|
183
|
+
|
|
184
|
+
# JSON
|
|
185
|
+
[*.json]
|
|
186
|
+
indent_size = 2
|
|
187
|
+
|
|
188
|
+
# TypeScript / JavaScript
|
|
189
|
+
[*.{ts,tsx,js,jsx}]
|
|
190
|
+
indent_size = 2
|
|
191
|
+
|
|
192
|
+
# Shell / Bash
|
|
193
|
+
[*.sh]
|
|
194
|
+
indent_size = 2`,
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
path: '.gitignore',
|
|
198
|
+
content: `.yarn/*
|
|
199
|
+
!.yarn/cache
|
|
200
|
+
!.yarn/patches
|
|
201
|
+
!.yarn/plugins
|
|
202
|
+
!.yarn/releases
|
|
203
|
+
!.yarn/sdks
|
|
204
|
+
!.yarn/versions
|
|
205
|
+
|
|
206
|
+
.DS_Store
|
|
207
|
+
.idea
|
|
208
|
+
node_modules
|
|
209
|
+
coverage
|
|
210
|
+
dist
|
|
211
|
+
storybook-static
|
|
212
|
+
*storybook.log
|
|
213
|
+
consumer
|
|
214
|
+
|
|
215
|
+
cdk.out
|
|
216
|
+
cdk.context.json
|
|
217
|
+
|
|
218
|
+
!/**/.gitkeep`,
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
path: '.npmrc',
|
|
222
|
+
content: 'engine-strict=true\n',
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
path: '.nvmrc',
|
|
226
|
+
content: 'lts/krypton',
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
path: '.yarnrc.yml',
|
|
230
|
+
content: 'nodeLinker: node-modules\nnpmMinimalAgeGate: 0\n',
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
path: '.husky/commit-msg',
|
|
234
|
+
content: '#!/bin/sh\n',
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
path: '.husky/post-checkout',
|
|
238
|
+
content: '#!/bin/sh\n\nyarn\n',
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
path: '.husky/post-merge',
|
|
242
|
+
content: '#!/bin/sh\n\nyarn\n',
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
path: '.husky/pre-commit',
|
|
246
|
+
content: '#!/bin/sh\n\nyarn check\n',
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
path: '.husky/pre-push',
|
|
250
|
+
content: '#!/bin/sh\n\nyarn check\n',
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
path: '.storybook/main.ts',
|
|
254
|
+
content: `import config from '@vyriy/storybook-config';
|
|
255
|
+
import { path } from '@vyriy/path';
|
|
256
|
+
|
|
257
|
+
export default {
|
|
258
|
+
...config,
|
|
259
|
+
stories: [
|
|
260
|
+
path('**/*.mdx'),
|
|
261
|
+
path('**/*.stories.@(js|jsx|mjs|ts|tsx)'),
|
|
262
|
+
],
|
|
263
|
+
};
|
|
264
|
+
`,
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
path: '.storybook/preview.tsx',
|
|
268
|
+
content: "export { default } from '@vyriy/storybook-config/preview';\n",
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
path: 'yarn.lock',
|
|
272
|
+
content: '',
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
path: 'tsconfig.json',
|
|
276
|
+
content: json({
|
|
277
|
+
extends: '@vyriy/typescript-config/index.json',
|
|
278
|
+
include: [
|
|
279
|
+
'.storybook/**/*.ts',
|
|
280
|
+
'.storybook/**/*.tsx',
|
|
281
|
+
'packages/**/*.ts',
|
|
282
|
+
'packages/**/*.tsx',
|
|
283
|
+
'workspaces/**/*.ts',
|
|
284
|
+
'workspaces/**/*.tsx',
|
|
285
|
+
'*.ts',
|
|
286
|
+
],
|
|
287
|
+
}),
|
|
288
|
+
},
|
|
289
|
+
...(hasPublishablePackages(plan) ? [createBuildTsConfig()] : []),
|
|
290
|
+
{
|
|
291
|
+
path: 'prettier.config.ts',
|
|
292
|
+
content: "export { default } from '@vyriy/prettier-config';\n",
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
path: '.prettierignore',
|
|
296
|
+
content: 'node_modules\ndist\ncoverage\nstorybook-static\n',
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
path: 'eslint.config.ts',
|
|
300
|
+
content: "export { default } from '@vyriy/eslint-config';\n",
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
path: 'jest.config.ts',
|
|
304
|
+
content: "export { default } from '@vyriy/jest-config';\n",
|
|
305
|
+
},
|
|
306
|
+
...createStyleFiles(plan),
|
|
307
|
+
];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import packageJson from '../package.json';
|
|
2
|
+
type PublishedPackageJson = typeof packageJson & {
|
|
3
|
+
readonly engines: {
|
|
4
|
+
readonly node: string;
|
|
5
|
+
};
|
|
6
|
+
readonly packageManager: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const json: (value: unknown) => string;
|
|
9
|
+
export declare const packageVersion: (version: string) => string;
|
|
10
|
+
export declare const publishedPackageJson: PublishedPackageJson;
|
|
11
|
+
export declare const peerDependencies: {
|
|
12
|
+
"@storybook/react-webpack5": string;
|
|
13
|
+
"@types/react": string;
|
|
14
|
+
"@types/react-dom": string;
|
|
15
|
+
"cross-env": string;
|
|
16
|
+
eslint: string;
|
|
17
|
+
husky: string;
|
|
18
|
+
jest: string;
|
|
19
|
+
"npm-run-all2": string;
|
|
20
|
+
prettier: string;
|
|
21
|
+
react: string;
|
|
22
|
+
"react-dom": string;
|
|
23
|
+
rimraf: string;
|
|
24
|
+
storybook: string;
|
|
25
|
+
stylelint: string;
|
|
26
|
+
typescript: string;
|
|
27
|
+
};
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import packageJson from '../package.json' with { type: 'json' };
|
|
2
|
+
export const json = (value) => `${JSON.stringify(value, null, 2)}\n`;
|
|
3
|
+
export const packageVersion = (version) => `^${version}`;
|
|
4
|
+
const assumePublishedPackageJson = () => { };
|
|
5
|
+
assumePublishedPackageJson(packageJson);
|
|
6
|
+
export const publishedPackageJson = packageJson;
|
|
7
|
+
export const peerDependencies = publishedPackageJson.peerDependencies;
|