Skip to content

Commit 153713d

Browse files
Update dependencies and sync with create-vue 3.18.4 (#16)
* Update template dependencies and sync with create-vue 3.18.4 * Refactor to share dependency versions * Update project to match the templates
1 parent b728025 commit 153713d

File tree

21 files changed

+1221
-1331
lines changed

21 files changed

+1221
-1331
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ packages/create-vue-lib/README.md
2626
*.njsproj
2727
*.sln
2828
*.sw?
29+
30+
.eslintcache

eslint.config.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescri
99
export default defineConfigWithVueTs(
1010
{
1111
name: 'app/files-to-lint',
12-
files: ['**/*.{ts,mts,vue}']
12+
files: ['**/*.{vue,ts,mts}']
1313
},
1414

1515
includeIgnoreFile(path.resolve(path.dirname(fileURLToPath(import.meta.url)), '.gitignore')),
1616

17-
pluginVue.configs['flat/essential'],
17+
...pluginVue.configs['flat/essential'],
1818
vueTsConfigs.recommended,
1919

2020
stylistic.configs.customize({

package.json

Lines changed: 13 additions & 13 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": "^1.3.1",
10-
"@stylistic/eslint-plugin": "^5.2.2",
11-
"@tsconfig/node22": "^22.0.2",
12-
"@types/node": "^22.16.5",
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",
1313
"@vue/eslint-config-typescript": "^14.6.0",
14-
"eslint": "^9.31.0",
15-
"eslint-plugin-vue": "~10.3.0",
16-
"jiti": "^2.4.2",
17-
"lint-staged": "^16.1.2",
14+
"eslint": "^9.39.2",
15+
"eslint-plugin-vue": "~10.6.2",
16+
"jiti": "^2.6.1",
17+
"lint-staged": "^16.2.7",
1818
"npm-run-all2": "^8.0.4",
19-
"simple-git-hooks": "^2.13.0",
20-
"typescript": "~5.8.0"
19+
"simple-git-hooks": "^2.13.1",
20+
"typescript": "~5.9.3"
2121
},
2222
"scripts": {
2323
"clean": "pnpm run -r clean",
@@ -26,8 +26,8 @@
2626
"type-check": "run-p type-check:*",
2727
"type-check:packages": "pnpm run -r type-check",
2828
"type-check:self": "tsc",
29-
"lint": "eslint",
30-
"lint:fix": "eslint --fix",
29+
"lint": "eslint --cache",
30+
"lint:fix": "eslint --fix --cache",
3131
"lint:staged": "lint-staged",
3232
"build": "pnpm run -r build",
3333
"preinstall": "node scripts/preinstall.js",
@@ -37,6 +37,6 @@
3737
"pre-commit": "pnpm exec run-s type-check lint:staged"
3838
},
3939
"lint-staged": {
40-
"*.{vue,js,jsx,cjs,mjs,ts,tsx,cts,mts}": "eslint"
40+
"*.{vue,js,jsx,cjs,mjs,ts,tsx,cts,mts}": "eslint --fix --cache"
4141
}
4242
}

packages/create-vue-lib/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@
2020
"dist"
2121
],
2222
"devDependencies": {
23-
"@tsconfig/node22": "^22.0.2",
23+
"@tsconfig/node24": "^24.0.3",
2424
"@types/ejs": "^3.1.5",
25-
"@types/node": "^22.16.5",
25+
"@types/node": "^24.10.4",
2626
"@types/prompts": "^2.4.9",
2727
"copyfiles": "^2.4.1",
2828
"ejs": "^3.1.10",
2929
"npm-run-all2": "^8.0.4",
3030
"picocolors": "^1.1.1",
3131
"prompts": "^2.4.2",
32-
"publint": "^0.3.12",
33-
"rimraf": "^6.0.1",
34-
"tsup": "^8.5.0",
35-
"typescript": "~5.8.0"
32+
"publint": "^0.3.16",
33+
"rimraf": "^6.1.2",
34+
"tsup": "^8.5.1",
35+
"typescript": "~5.9.3"
3636
},
3737
"scripts": {
3838
"clean": "rimraf dist LICENSE README.md",

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ 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'
1011

1112
async function prompt(options: Omit<PromptObject, 'name'>) {
1213
try {
@@ -472,6 +473,22 @@ function copyFiles(templateFile: string, config: Config) {
472473
content = content.replace(/([{[(]\n)\n+/g, '$1')
473474
}
474475

476+
if (target.endsWith('package.json')) {
477+
// Replace "$" with actual dependency versions
478+
content = content.replace(/"([^"]+)": "\$"/g, (all, name: string) => {
479+
const version = versions[name as keyof typeof versions]
480+
481+
if (typeof version === 'string') {
482+
return `"${name}": "${version}"`
483+
}
484+
else {
485+
console.log(bgRed(black('ERROR')))
486+
console.log(red(`Couldn't find package version for "${name}"`))
487+
process.exit(1)
488+
}
489+
})
490+
}
491+
475492
fs.writeFileSync(target, content)
476493
}
477494
else {

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ coverage
1616
<%- config.packagesDir %>docs/.vitepress/cache
1717
<%- config.packagesDir %><%- config.mainPackageDirName %>/README.md
1818

19-
/cypress/videos/
20-
/cypress/screenshots/
21-
2219
# Editor directories and files
2320
.vscode/*
2421
!.vscode/extensions.json
@@ -30,3 +27,12 @@ coverage
3027
*.sw?
3128

3229
*.tsbuildinfo
30+
31+
.eslintcache
32+
33+
# Cypress
34+
/cypress/videos/
35+
/cypress/screenshots/
36+
37+
# Vitest
38+
__screenshots__/

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@
77
},
88
"devDependencies": {
99
<%_ if (config.includeEsLint) { _%>
10-
"@eslint/compat": "^1.3.1",
10+
"@eslint/compat": "$",
1111
<%_ if (config.includeEsLintStylistic) { _%>
12-
"@stylistic/eslint-plugin": "^5.2.2",
12+
"@stylistic/eslint-plugin": "$",
1313
<%_ } _%>
14-
"@tsconfig/node22": "^22.0.2",
15-
"@types/node": "^22.16.5",
14+
"@tsconfig/node24": "$",
15+
"@types/node": "$",
1616
<%_ if (config.includeVitest) { _%>
17-
"@vitest/eslint-plugin": "^1.3.4",
17+
"@vitest/eslint-plugin": "$",
1818
<%_ } _%>
19-
"@vue/eslint-config-typescript": "^14.6.0",
20-
"eslint": "^9.31.0",
21-
"eslint-plugin-vue": "~10.3.0",
22-
"jiti": "^2.4.2",
23-
"lint-staged": "^16.1.2",
24-
"npm-run-all2": "^8.0.4",
19+
"@vue/eslint-config-typescript": "$",
20+
"eslint": "$",
21+
"eslint-plugin-vue": "$",
22+
"jiti": "$",
23+
"lint-staged": "$",
24+
"npm-run-all2": "$",
2525
<%_ } _%>
26-
"simple-git-hooks": "^2.13.0",
26+
"simple-git-hooks": "$",
2727
<%_ if (config.includeEsLint) { _%>
28-
"typescript": "~5.8.0"
28+
"typescript": "$"
2929
<%_ } _%>
3030
},
3131
"scripts": {
@@ -45,8 +45,8 @@
4545
"type-check": "run-p type-check:*",
4646
"type-check:packages": "pnpm run -r type-check",
4747
"type-check:self": "tsc",
48-
"lint": "eslint",
49-
"lint:fix": "eslint --fix",
48+
"lint": "eslint --cache",
49+
"lint:fix": "eslint --fix --cache",
5050
"lint:staged": "lint-staged",
5151
<%_ } else { _%>
5252
"type-check": "pnpm run -r type-check",
@@ -60,7 +60,7 @@
6060
"pre-commit": "pnpm exec run-s type-check lint:staged"
6161
},
6262
"lint-staged": {
63-
"*.{vue,js,jsx,cjs,mjs,ts,tsx,cts,mts}": "eslint --fix"
63+
"*.{vue,js,jsx,cjs,mjs,ts,tsx,cts,mts}": "eslint --fix --cache"
6464
}
6565
<%_ } else { _%>
6666
"simple-git-hooks": {

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": "^6.0.2",
41+
"@rollup/plugin-replace": "$",
4242
<%_ if (config.includeTailwind) { _%>
43-
"@tailwindcss/vite": "^4.1.11",
43+
"@tailwindcss/vite": "$",
4444
<%_ } _%>
45-
"@tsconfig/node22": "^22.0.2",
46-
"@types/jsdom": "^21.1.7",
47-
"@types/node": "^22.16.5",
48-
"@vitejs/plugin-vue": "^6.0.1",
45+
"@tsconfig/node24": "$",
46+
"@types/jsdom": "$",
47+
"@types/node": "$",
48+
"@vitejs/plugin-vue": "$",
4949
<%_ if (config.includeVitest) { _%>
50-
"@vitest/coverage-v8": "^3.2.4",
51-
"@vue/test-utils": "^2.4.6",
50+
"@vitest/coverage-v8": "$",
51+
"@vue/test-utils": "$",
5252
<%_ } _%>
53-
"@vue/tsconfig": "^0.7.0",
54-
"copyfiles": "^2.4.1",
55-
"jsdom": "^26.1.0",
56-
"npm-run-all2": "^8.0.4",
57-
"publint": "^0.3.12",
58-
"rimraf": "^6.0.1",
53+
"@vue/tsconfig": "$",
54+
"copyfiles": "$",
55+
"jsdom": "$",
56+
"npm-run-all2": "$",
57+
"publint": "$",
58+
"rimraf": "$",
5959
<%_ if (config.includeTailwind) { _%>
60-
"tailwindcss": "^4.1.11",
60+
"tailwindcss": "$",
6161
<%_ } _%>
62-
"typescript": "~5.8.0",
63-
"vite": "^7.0.6",
64-
"vite-plugin-dts": "^4.5.4",
62+
"typescript": "$",
63+
"vite": "$",
64+
"vite-plugin-dts": "$",
6565
<%_ if (config.includeVitest) { _%>
66-
"vitest": "^3.2.4",
66+
"vitest": "$",
6767
<%_ } _%>
68-
"vue": "^3.5.18",
69-
"vue-tsc": "^3.0.4"
68+
"vue": "$",
69+
"vue-tsc": "$"
7070
},
7171
"scripts": {
7272
"clean:dist": "rimraf dist",

packages/create-vue-lib/src/template/base/config/packages/@projectName@/tsconfig.node.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "@tsconfig/node22/tsconfig.json",
2+
"extends": "@tsconfig/node24/tsconfig.json",
33
"include": [
44
"vite.config.*",
55
"vitest.config.*",

packages/create-vue-lib/src/template/eslint/config/eslint.config.mts.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ import pluginVitest from '@vitest/eslint-plugin'
1414
export default defineConfigWithVueTs(
1515
{
1616
name: 'app/files-to-lint',
17-
files: ['**/*.{ts,mts,vue}']
17+
files: ['**/*.{vue,ts,mts}']
1818
},
1919

2020
includeIgnoreFile(path.resolve(path.dirname(fileURLToPath(import.meta.url)), '.gitignore')),
2121

22-
pluginVue.configs['flat/essential'],
22+
...pluginVue.configs['flat/essential'],
2323
vueTsConfigs.recommended,
2424

2525
<%_ if (config.includeEsLintStylistic) { _%>

0 commit comments

Comments
 (0)