Skip to content

Commit eb9208d

Browse files
committed
Use a pnpm catalog for dependencies
1 parent f550e66 commit eb9208d

File tree

14 files changed

+297
-252
lines changed

14 files changed

+297
-252
lines changed

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66
"node": "^20.19.0 || >=22.12.0"
77
},
88
"devDependencies": {
9-
"@eslint/compat": "^2.0.0",
10-
"@stylistic/eslint-plugin": "^5.6.1",
11-
"@tsconfig/node24": "^24.0.3",
12-
"@types/node": "^24.10.4",
13-
"@vue/eslint-config-typescript": "^14.6.0",
14-
"eslint": "^9.39.2",
15-
"eslint-plugin-vue": "~10.6.2",
16-
"jiti": "^2.6.1",
17-
"lint-staged": "^16.2.7",
18-
"npm-run-all2": "^8.0.4",
19-
"simple-git-hooks": "^2.13.1",
20-
"typescript": "~5.9.3"
9+
"@eslint/compat": "catalog:",
10+
"@stylistic/eslint-plugin": "catalog:",
11+
"@tsconfig/node24": "catalog:",
12+
"@types/node": "catalog:",
13+
"@vue/eslint-config-typescript": "catalog:",
14+
"eslint": "catalog:",
15+
"eslint-plugin-vue": "catalog:",
16+
"jiti": "catalog:",
17+
"lint-staged": "catalog:",
18+
"npm-run-all2": "catalog:",
19+
"simple-git-hooks": "catalog:",
20+
"typescript": "catalog:"
2121
},
2222
"scripts": {
2323
"clean": "pnpm run -r clean",

packages/create-vue-lib/package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@
2020
"dist"
2121
],
2222
"devDependencies": {
23-
"@tsconfig/node24": "^24.0.3",
24-
"@types/ejs": "^3.1.5",
25-
"@types/node": "^24.10.4",
26-
"@types/prompts": "^2.4.9",
27-
"copyfiles": "^2.4.1",
28-
"ejs": "^3.1.10",
29-
"npm-run-all2": "^8.0.4",
30-
"picocolors": "^1.1.1",
31-
"prompts": "^2.4.2",
32-
"publint": "^0.3.16",
33-
"rimraf": "^6.1.2",
34-
"tsdown": "^0.21.9",
35-
"typescript": "~5.9.3"
23+
"@tsconfig/node24": "catalog:",
24+
"@types/ejs": "catalog:",
25+
"@types/node": "catalog:",
26+
"@types/prompts": "catalog:",
27+
"copyfiles": "catalog:",
28+
"ejs": "catalog:",
29+
"npm-run-all2": "catalog:",
30+
"picocolors": "catalog:",
31+
"prompts": "catalog:",
32+
"publint": "catalog:",
33+
"rimraf": "catalog:",
34+
"tsdown": "catalog:",
35+
"typescript": "catalog:"
3636
},
3737
"scripts": {
3838
"clean": "rimraf dist LICENSE README.md",

packages/create-vue-lib/src/index.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import prompts, { type PromptObject } from 'prompts'
77
import ejs from 'ejs'
88
import { bgGreen, bgRed, bgYellowBright, black, bold, cyan, green, magenta, red } from 'picocolors'
99
import packageJson from '../package.json'
10-
import versions from './template/versions.json'
1110

1211
async function prompt(options: Omit<PromptObject, 'name'>) {
1312
try {
@@ -483,22 +482,6 @@ function copyFiles(templateFile: string, config: Config) {
483482
content = content.replace(/([{[(]\n)\n+/g, '$1')
484483
}
485484

486-
if (target.endsWith('package.json')) {
487-
// Replace "$" with actual dependency versions
488-
content = content.replace(/"([^"]+)": "\$"/g, (all, name: string) => {
489-
const version = versions[name as keyof typeof versions]
490-
491-
if (typeof version === 'string') {
492-
return `"${name}": "${version}"`
493-
}
494-
else {
495-
console.log(bgRed(black('ERROR')))
496-
console.log(red(`Couldn't find package version for "${name}"`))
497-
process.exit(1)
498-
}
499-
})
500-
}
501-
502485
fs.writeFileSync(target, content)
503486
}
504487
else {

packages/create-vue-lib/src/template/base/config/package.json.ejs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@
77
},
88
"devDependencies": {
99
<%_ if (config.includeEsLint) { _%>
10-
"@eslint/compat": "$",
10+
"@eslint/compat": "catalog:",
1111
<%_ if (config.includeEsLintStylistic) { _%>
12-
"@stylistic/eslint-plugin": "$",
12+
"@stylistic/eslint-plugin": "catalog:",
1313
<%_ } _%>
14-
"@tsconfig/node24": "$",
15-
"@types/node": "$",
14+
"@tsconfig/node24": "catalog:",
15+
"@types/node": "catalog:",
1616
<%_ if (config.includeVitest) { _%>
17-
"@vitest/eslint-plugin": "$",
17+
"@vitest/eslint-plugin": "catalog:",
1818
<%_ } _%>
19-
"@vue/eslint-config-typescript": "$",
20-
"eslint": "$",
21-
"eslint-plugin-vue": "$",
22-
"jiti": "$",
23-
"lint-staged": "$",
24-
"npm-run-all2": "$",
19+
"@vue/eslint-config-typescript": "catalog:",
20+
"eslint": "catalog:",
21+
"eslint-plugin-vue": "catalog:",
22+
"jiti": "catalog:",
23+
"lint-staged": "catalog:",
24+
"npm-run-all2": "catalog:",
2525
<%_ } _%>
26-
"simple-git-hooks": "$",
26+
"simple-git-hooks": "catalog:",
2727
<%_ if (config.includeEsLint) { _%>
28-
"typescript": "$"
28+
"typescript": "catalog:"
2929
<%_ } _%>
3030
},
3131
"scripts": {

packages/create-vue-lib/src/template/base/config/packages/@projectName@/package.json.ejs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,35 +38,35 @@
3838
"vue": "^3.2.0"
3939
},
4040
"devDependencies": {
41-
"@rollup/plugin-replace": "$",
41+
"@rollup/plugin-replace": "catalog:",
4242
<%_ if (config.includeTailwind) { _%>
43-
"@tailwindcss/vite": "$",
43+
"@tailwindcss/vite": "catalog:",
4444
<%_ } _%>
45-
"@tsconfig/node24": "$",
46-
"@types/jsdom": "$",
47-
"@types/node": "$",
48-
"@vitejs/plugin-vue": "$",
45+
"@tsconfig/node24": "catalog:",
46+
"@types/jsdom": "catalog:",
47+
"@types/node": "catalog:",
48+
"@vitejs/plugin-vue": "catalog:",
4949
<%_ if (config.includeVitest) { _%>
50-
"@vitest/coverage-v8": "$",
51-
"@vue/test-utils": "$",
50+
"@vitest/coverage-v8": "catalog:",
51+
"@vue/test-utils": "catalog:",
5252
<%_ } _%>
53-
"@vue/tsconfig": "$",
54-
"copyfiles": "$",
55-
"jsdom": "$",
56-
"npm-run-all2": "$",
57-
"publint": "$",
58-
"rimraf": "$",
53+
"@vue/tsconfig": "catalog:",
54+
"copyfiles": "catalog:",
55+
"jsdom": "catalog:",
56+
"npm-run-all2": "catalog:",
57+
"publint": "catalog:",
58+
"rimraf": "catalog:",
5959
<%_ if (config.includeTailwind) { _%>
60-
"tailwindcss": "$",
60+
"tailwindcss": "catalog:",
6161
<%_ } _%>
62-
"typescript": "$",
63-
"vite": "$",
64-
"vite-plugin-dts": "$",
62+
"typescript": "catalog:",
63+
"vite": "catalog:",
64+
"vite-plugin-dts": "catalog:",
6565
<%_ if (config.includeVitest) { _%>
66-
"vitest": "$",
66+
"vitest": "catalog:",
6767
<%_ } _%>
68-
"vue": "$",
69-
"vue-tsc": "$"
68+
"vue": "catalog:",
69+
"vue-tsc": "catalog:"
7070
},
7171
"scripts": {
7272
"clean:dist": "rimraf dist",

packages/create-vue-lib/src/template/base/config/pnpm-workspace.yaml.ejs

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,50 @@ packages:
1111
<%_ } _%>
1212
<%_ } _%>
1313

14-
minimumReleaseAge: 1440
15-
1614
allowBuilds:
1715
<%_ if (config.includeTailwind) { _%>
1816
'@tailwindcss/oxide': true
1917
<%_ } _%>
2018
'esbuild': true
2119
'simple-git-hooks': false
2220

21+
catalog:
22+
'@eslint/compat': ^2.0.0
23+
'@rollup/plugin-replace': ^6.0.3
24+
'@stylistic/eslint-plugin': ^5.6.1
25+
'@tailwindcss/vite': ^4.1.18
26+
'@tsconfig/node24': ^24.0.3
27+
'@types/jsdom': ^27.0.0
28+
'@types/node': ^24.10.4
29+
'@vitejs/plugin-vue': ^6.0.3
30+
'@vitest/coverage-v8': ^4.0.16
31+
'@vitest/eslint-plugin': ^1.6.5
32+
'@vue/eslint-config-typescript': ^14.6.0
33+
'@vue/test-utils': ^2.4.6
34+
'@vue/tsconfig': ^0.8.1
35+
copyfiles: ^2.4.1
36+
eslint: ^9.39.2
37+
eslint-plugin-vue: ~10.6.2
38+
jiti: ^2.6.1
39+
jsdom: ^27.3.0
40+
lint-staged: ^16.2.7
41+
npm-run-all2: ^8.0.4
42+
postcss: ^8.5.6
43+
publint: ^0.3.16
44+
rimraf: ^6.1.2
45+
simple-git-hooks: ^2.13.1
46+
tailwindcss: ^4.1.18
47+
typescript: ~5.9.3
48+
vite: ^7.3.0
49+
vite-plugin-dts: ^4.5.4
50+
vite-plugin-vue-devtools: ^8.0.5
51+
vitepress: ^1.6.4
52+
vitest: ^4.0.16
53+
vue: ^3.5.26
54+
vue-tsc: ^3.2.1
55+
56+
cleanupUnusedCatalogs: true
57+
2358
dedupePeers: true
59+
60+
minimumReleaseAge: 1440

packages/create-vue-lib/src/template/playground/config/packages/playground/package.json.ejs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22
"private": true,
33
"type": "module",
44
"dependencies": {
5-
"vue": "$"
5+
"vue": "catalog:"
66
},
77
"devDependencies": {
88
<%_ if (config.includeTailwind) { _%>
9-
"@tailwindcss/vite": "$",
9+
"@tailwindcss/vite": "catalog:",
1010
<%_ } _%>
11-
"@tsconfig/node24": "$",
12-
"@types/node": "$",
13-
"@vitejs/plugin-vue": "$",
14-
"@vue/tsconfig": "$",
15-
"npm-run-all2": "$",
16-
"rimraf": "$",
11+
"@tsconfig/node24": "catalog:",
12+
"@types/node": "catalog:",
13+
"@vitejs/plugin-vue": "catalog:",
14+
"@vue/tsconfig": "catalog:",
15+
"npm-run-all2": "catalog:",
16+
"rimraf": "catalog:",
1717
<%_ if (config.includeTailwind) { _%>
18-
"tailwindcss": "$",
18+
"tailwindcss": "catalog:",
1919
<%_ } _%>
20-
"typescript": "$",
21-
"vite": "$",
22-
"vite-plugin-vue-devtools": "$",
23-
"vue-tsc": "$"
20+
"typescript": "catalog:",
21+
"vite": "catalog:",
22+
"vite-plugin-vue-devtools": "catalog:",
23+
"vue-tsc": "catalog:"
2424
},
2525
"scripts": {
2626
"clean": "rimraf dist",

packages/create-vue-lib/src/template/versions.json

Lines changed: 0 additions & 35 deletions
This file was deleted.

packages/create-vue-lib/src/template/vitepress/config/packages/docs/package.json.ejs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@
22
"private": true,
33
"type": "module",
44
"dependencies": {
5-
"vue": "$"
5+
"vue": "catalog:"
66
},
77
"devDependencies": {
88
<%_ if (config.includeTailwind) { _%>
9-
"@tailwindcss/vite": "$",
9+
"@tailwindcss/vite": "catalog:",
1010
<%_ } _%>
11-
"@tsconfig/node24": "$",
12-
"@types/node": "$",
13-
"@vue/tsconfig": "$",
14-
"npm-run-all2": "$",
11+
"@tsconfig/node24": "catalog:",
12+
"@types/node": "catalog:",
13+
"@vue/tsconfig": "catalog:",
14+
"npm-run-all2": "catalog:",
1515
<%_ if (config.includeVpRaw) { _%>
16-
"postcss": "$",
16+
"postcss": "catalog:",
1717
<%_ } _%>
18-
"rimraf": "$",
18+
"rimraf": "catalog:",
1919
<%_ if (config.includeTailwind) { _%>
20-
"tailwindcss": "$",
20+
"tailwindcss": "catalog:",
2121
<%_ } _%>
22-
"typescript": "$",
23-
"vitepress": "$",
24-
"vue-tsc": "$"
22+
"typescript": "catalog:",
23+
"vitepress": "catalog:",
24+
"vue-tsc": "catalog:"
2525
},
2626
"scripts": {
2727
"clean": "rimraf dist .vitepress/cache",

packages/docs/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
"vue": "^3.5.26"
66
},
77
"devDependencies": {
8-
"@tsconfig/node24": "^24.0.3",
9-
"@types/node": "^24.10.4",
10-
"@vue/tsconfig": "^0.8.1",
11-
"npm-run-all2": "^8.0.4",
12-
"rimraf": "^6.1.2",
13-
"typescript": "~5.9.3",
14-
"vitepress": "^1.6.4",
15-
"vue-tsc": "^3.2.1"
8+
"@tsconfig/node24": "catalog:",
9+
"@types/node": "catalog:",
10+
"@vue/tsconfig": "catalog:",
11+
"npm-run-all2": "catalog:",
12+
"rimraf": "catalog:",
13+
"typescript": "catalog:",
14+
"vitepress": "catalog:",
15+
"vue-tsc": "catalog:"
1616
},
1717
"scripts": {
1818
"clean": "rimraf dist .vitepress/cache",

0 commit comments

Comments
 (0)