@vyriy/create 0.9.3 → 0.9.4
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/create.js +17 -1
- package/package.json +21 -21
- package/preset/api.js +1 -1
- package/preset/fullstack.js +7 -1
- package/preset/mfe.js +7 -1
package/create.js
CHANGED
|
@@ -8,13 +8,29 @@ import { plan } from './plan/index.js';
|
|
|
8
8
|
import { conflictStrategy as promptConflictStrategy } from './prompt/index.js';
|
|
9
9
|
import { presets } from './preset/index.js';
|
|
10
10
|
const exec = promisify(processExec);
|
|
11
|
+
const dependencyResolutions = {
|
|
12
|
+
'file-entry-cache': '11.1.5',
|
|
13
|
+
};
|
|
14
|
+
const addDependencyResolutions = (files) => {
|
|
15
|
+
const packageFile = JSON.parse(String(files['package.json']));
|
|
16
|
+
return {
|
|
17
|
+
...files,
|
|
18
|
+
'package.json': `${JSON.stringify({
|
|
19
|
+
...packageFile,
|
|
20
|
+
resolutions: {
|
|
21
|
+
...packageFile.resolutions,
|
|
22
|
+
...dependencyResolutions,
|
|
23
|
+
},
|
|
24
|
+
}, null, 2)}\n`,
|
|
25
|
+
};
|
|
26
|
+
};
|
|
11
27
|
const isPresetName = (preset) => preset in presets;
|
|
12
28
|
const mergeFiles = (planOption) => {
|
|
13
29
|
if (!isPresetName(planOption.preset)) {
|
|
14
30
|
return undefined;
|
|
15
31
|
}
|
|
16
32
|
const preset = presets[planOption.preset].preset;
|
|
17
|
-
return preset(planOption);
|
|
33
|
+
return addDependencyResolutions(preset(planOption));
|
|
18
34
|
};
|
|
19
35
|
const getSortedFileNames = (files) => Object.keys(files).sort((a, b) => a.localeCompare(b));
|
|
20
36
|
const logFilePlan = (target, files) => {
|
package/package.json
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vyriy/create",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.4",
|
|
4
4
|
"description": "Vyriy project creation CLI.",
|
|
5
5
|
"homepage": "https://vyriy.dev/docs/create/",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": ">=24.0.0"
|
|
9
9
|
},
|
|
10
|
-
"packageManager": "yarn@4.
|
|
10
|
+
"packageManager": "yarn@4.18.0",
|
|
11
11
|
"bin": {
|
|
12
12
|
"vc": "./bin/index.js",
|
|
13
13
|
"vyriy-create": "./bin/index.js"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@vyriy/check": "0.9.
|
|
17
|
-
"@vyriy/tooling": "0.9.
|
|
16
|
+
"@vyriy/check": "0.9.4",
|
|
17
|
+
"@vyriy/tooling": "0.9.4"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
21
|
-
"@storybook/addon-docs": "^10.
|
|
22
|
-
"@storybook/react-webpack5": "^10.
|
|
20
|
+
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
21
|
+
"@storybook/addon-docs": "^10.5.6",
|
|
22
|
+
"@storybook/react-webpack5": "^10.5.6",
|
|
23
23
|
"@testing-library/dom": "^10.4.1",
|
|
24
24
|
"@testing-library/react": "^16.3.2",
|
|
25
25
|
"@types/jest": "^30.0.0",
|
|
26
|
-
"@types/react": "^19.2.
|
|
27
|
-
"@types/react-dom": "^19.2.
|
|
26
|
+
"@types/react": "^19.2.18",
|
|
27
|
+
"@types/react-dom": "^19.2.4",
|
|
28
28
|
"cross-env": "^10.1.0",
|
|
29
|
-
"eslint": "^10.
|
|
29
|
+
"eslint": "^10.8.0",
|
|
30
30
|
"graphql": "^17.0.2",
|
|
31
31
|
"html-entities": "^2.6.0",
|
|
32
32
|
"husky": "^9.1.7",
|
|
33
33
|
"jest": "^30.4.2",
|
|
34
|
-
"npm-check-updates": "^
|
|
35
|
-
"npm-run-all2": "^9.0.
|
|
36
|
-
"prettier": "^3.9.
|
|
37
|
-
"react": "^19.2.
|
|
38
|
-
"react-dom": "^19.2.
|
|
34
|
+
"npm-check-updates": "^23.0.1",
|
|
35
|
+
"npm-run-all2": "^9.0.3",
|
|
36
|
+
"prettier": "^3.9.6",
|
|
37
|
+
"react": "^19.2.8",
|
|
38
|
+
"react-dom": "^19.2.8",
|
|
39
39
|
"rimraf": "^6.1.3",
|
|
40
|
-
"sass": "^1.
|
|
41
|
-
"storybook": "^10.
|
|
42
|
-
"stylelint": "^17.14.
|
|
43
|
-
"tsx": "^4.23.
|
|
40
|
+
"sass": "^1.102.0",
|
|
41
|
+
"storybook": "^10.5.6",
|
|
42
|
+
"stylelint": "^17.14.1",
|
|
43
|
+
"tsx": "^4.23.5",
|
|
44
44
|
"typescript": "^6.0.3",
|
|
45
|
-
"webpack": "^5.
|
|
46
|
-
"webpack-cli": "^7.2.
|
|
45
|
+
"webpack": "^5.109.2",
|
|
46
|
+
"webpack-cli": "^7.2.2",
|
|
47
47
|
"zod": "^4.4.3"
|
|
48
48
|
},
|
|
49
49
|
"peerDependenciesMeta": {
|
package/preset/api.js
CHANGED
package/preset/fullstack.js
CHANGED
|
@@ -9,7 +9,7 @@ const agentsPath = [
|
|
|
9
9
|
resolve(presetDir, '../../../../AGENTS.md'),
|
|
10
10
|
].find(existsSync) ?? '';
|
|
11
11
|
const agentsContent = agentsPath ? readFileSync(agentsPath, 'utf8') : '';
|
|
12
|
-
const
|
|
12
|
+
const rawProjectFiles = {
|
|
13
13
|
'.browserslistrc': '[development]\nextends @vyriy/browserslist-config\n\n[ssr]\nextends @vyriy/browserslist-config\n\n[production]\nextends @vyriy/browserslist-config\n\n[modern]\nextends @vyriy/browserslist-config\n',
|
|
14
14
|
'packages/env/doc.mdx': "import { Meta, Markdown } from '@storybook/addon-docs/blocks';\nimport ReadMe from './README.md?raw';\n\n<Meta title=\"Packages/Env\" />\n\n<Markdown>{ReadMe}</Markdown>\n",
|
|
15
15
|
'packages/env/index.ts': "export * from './env.js';\n",
|
|
@@ -277,6 +277,12 @@ The tests verify that the entry point mounts into \`#root\` and renders the demo
|
|
|
277
277
|
'workspaces/ui/index.tsx': "import { element } from '@vyriy/render/element';\n\nimport { ProfileCard } from '@p/components/profile-card';\nimport '@p/components/styles.scss';\n\nelement({\n root: document.getElementById('root'),\n component: (\n <ProfileCard name=\"Developer\" title=\"Senior IT Professional\" avatarUrl=\"http://localhost:3001/avatar.svg\" />\n ),\n});\n",
|
|
278
278
|
'workspaces/ui/webpack.config.ts': "import { EnvironmentPlugin } from 'webpack';\n\nimport { csr, html } from '@vyriy/webpack-config';\nimport { path } from '@vyriy/path';\n\nexport default csr(\n '@w/ui',\n {\n path: path('dist', 'cdn'),\n filename: 'index.js',\n },\n (config) => ({\n ...config,\n plugins: [\n ...(config.plugins ?? []),\n new EnvironmentPlugin(['API', 'CDN', 'UI']),\n html({\n htmlAttributes: 'lang=\"en\"',\n title: '<title>Demo</title>',\n meta: '<meta charset=\"utf-8\" /><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />',\n body: '<div id=\"root\"></div>',\n }),\n ],\n }),\n);\n",
|
|
279
279
|
};
|
|
280
|
+
const projectFiles = {
|
|
281
|
+
...rawProjectFiles,
|
|
282
|
+
'workspaces/api/index.tsx': String(rawProjectFiles['workspaces/api/index.tsx'])
|
|
283
|
+
.replace("import { getUi } from '@p/env';\n\nserver(", "import { getUi } from '@p/env';\n\ntype RouterEvent = Parameters<ReturnType<typeof createRouter>['route']>[0];\n\nserver(")
|
|
284
|
+
.replace('api(async (event) =>', 'api(async (event: RouterEvent) =>'),
|
|
285
|
+
};
|
|
280
286
|
export const fullstack = (options) => ({
|
|
281
287
|
'AGENTS.md': agentsContent,
|
|
282
288
|
'.editorconfig': `# https://editorconfig.org
|
package/preset/mfe.js
CHANGED
|
@@ -9,7 +9,7 @@ const agentsPath = [
|
|
|
9
9
|
resolve(presetDir, '../../../../AGENTS.md'),
|
|
10
10
|
].find(existsSync) ?? '';
|
|
11
11
|
const agentsContent = agentsPath ? readFileSync(agentsPath, 'utf8') : '';
|
|
12
|
-
const
|
|
12
|
+
const rawProjectFiles = {
|
|
13
13
|
'.browserslistrc': '[development]\nextends @vyriy/browserslist-config\n\n[ssr]\nextends @vyriy/browserslist-config\n\n[production]\nextends @vyriy/browserslist-config\n\n[modern]\nextends @vyriy/browserslist-config\n',
|
|
14
14
|
'.editorconfig': '# https://editorconfig.org\nroot = true\n\n[*]\ncharset = utf-8\nend_of_line = lf\ninsert_final_newline = true\ntrim_trailing_whitespace = true\n\nindent_style = space\nindent_size = 2\n\nmax_line_length = 100\n\n# Markdown\n[*.md]\ntrim_trailing_whitespace = false\nmax_line_length = off\n\n# YAML / YML\n[*.{yml,yaml}]\nindent_size = 2\n\n# JSON\n[*.json]\nindent_size = 2\n\n# TypeScript / JavaScript\n[*.{ts,tsx,js,jsx}]\nindent_size = 2\n\n# Shell / Bash\n[*.sh]\nindent_size = 2\n',
|
|
15
15
|
'.gitignore': '.yarn/*\n!.yarn/cache\n!.yarn/patches\n!.yarn/plugins\n!.yarn/releases\n!.yarn/sdks\n!.yarn/versions\n\n.DS_Store\n.idea\nnode_modules\ncoverage\ndist\nstorybook-static\n*storybook.log\nconsumer\n\ncdk.out\ncdk.context.json\n\n.claude\n.codex\n.agents\n\n!/**/.gitkeep\n',
|
|
@@ -206,6 +206,12 @@ const projectFiles = {
|
|
|
206
206
|
'workspaces/ui/public/screenshots/default.svg': '<svg\n width="1280"\n height="720"\n viewBox="0 0 1280 720"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n role="img"\n aria-labelledby="title description"\n>\n <title id="title">Default profile card screenshot</title>\n <desc id="description">A profile card microfrontend rendered in a desktop host page.</desc>\n\n <rect width="1280" height="720" fill="#F3F4F6" />\n <rect x="80" y="72" width="1120" height="576" rx="32" fill="white" />\n\n <rect x="128" y="120" width="360" height="480" rx="28" fill="#F9FAFB" stroke="#E5E7EB" />\n <circle cx="308" cy="244" r="72" fill="#9CA3AF" />\n <rect x="188" y="368" width="240" height="28" rx="14" fill="#111827" />\n <rect x="224" y="420" width="168" height="18" rx="9" fill="#6B7280" />\n <rect x="232" y="492" width="152" height="44" rx="22" fill="#10B981" />\n\n <rect x="560" y="152" width="420" height="40" rx="20" fill="#111827" />\n <rect x="560" y="232" width="520" height="20" rx="10" fill="#6B7280" />\n <rect x="560" y="272" width="460" height="20" rx="10" fill="#9CA3AF" />\n <rect x="560" y="312" width="360" height="20" rx="10" fill="#D1D5DB" />\n <rect x="560" y="420" width="520" height="96" rx="24" fill="#F9FAFB" stroke="#E5E7EB" />\n</svg>\n',
|
|
207
207
|
'workspaces/ui/webpack.config.ts': "import { EnvironmentPlugin } from 'webpack';\n\nimport { csr, html } from '@vyriy/webpack-config';\nimport { path } from '@vyriy/path';\n\ntype ConfigWithDevServer = {\n devServer?: Record<string, unknown>;\n};\n\nexport default csr(\n '@w/ui',\n {\n path: path('dist', 'ui'),\n filename: 'index.js',\n },\n (config) => {\n const configWithDevServer = config as typeof config & ConfigWithDevServer;\n\n return {\n ...config,\n devServer: {\n ...configWithDevServer.devServer,\n static: {\n directory: path('workspaces', 'ui', 'public'),\n },\n },\n plugins: [\n ...(config.plugins ?? []),\n new EnvironmentPlugin(['UI']),\n html(\n {\n htmlAttributes: 'lang=\"en\"',\n title: '<title>Search</title>',\n body: '<vyriy-profile-card name=\"Developer\" title=\"Senior IT Professional\" avatarUrl=\"avatar.svg\"></vyriy-profile-card>',\n script: [\n '<script defer=\"defer\" src=\"index.js\"></script>',\n [\n '<script type=\"module\">',\n \"const card = document.querySelector('vyriy-profile-card');\",\n \"card.addEventListener('vyriy-profile-card.select', (event) => {\",\n \" console.log('UI demo event:', event.detail);\",\n '});',\n '</scr' + 'ipt>',\n ].join(''),\n ].join(''),\n },\n {\n inject: false,\n publicPath: process.env.UI,\n },\n ),\n ],\n };\n },\n);\n",
|
|
208
208
|
};
|
|
209
|
+
const projectFiles = {
|
|
210
|
+
...rawProjectFiles,
|
|
211
|
+
'workspaces/api/index.ts': String(rawProjectFiles['workspaces/api/index.ts'])
|
|
212
|
+
.replace("import { parseProfileCardQuery } from '@p/query';\n\nserver(", "import { parseProfileCardQuery } from '@p/query';\n\ntype RouterEvent = Parameters<ReturnType<typeof createRouter>['route']>[0];\n\nserver(")
|
|
213
|
+
.replace('api(async (event) =>', 'api(async (event: RouterEvent) =>'),
|
|
214
|
+
};
|
|
209
215
|
export const mfe = (options) => ({
|
|
210
216
|
...projectFiles,
|
|
211
217
|
'AGENTS.md': agentsContent,
|