Skip to content

Commit 00e0721

Browse files
committed
workflow: update infra
1 parent 982ece2 commit 00e0721

10 files changed

+2793
-2044
lines changed

.vscode/settings.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Source: https://github.com/antfu/eslint-config?tab=readme-ov-file#ide-support-auto-fix-on-save
12
{
23
// Disable the default formatter, use eslint instead
34
"prettier.enable": false,

commitlint.config.ts commitlint.config.mjs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// Default Config See https://github.com/conventional-changelog/commitlint/tree/master/@commitlint/config-conventional
2-
import { rules } from '@commitlint/config-conventional'
2+
import config from '@commitlint/config-conventional'
33

4-
// See https://github.com/vuejs/core/blob/main/scripts/verifyCommit.js
4+
const { rules } = config
5+
6+
// See https://github.com/vuejs/core/blob/main/scripts/verify-commit.js
57
rules['type-enum'][2].push('wip', 'types', 'release', 'workflow', 'dx')
68
rules['header-max-length'][2] = 200
79
rules['subject-case'][0] = 0

dependency-licenses.txt

-5
This file was deleted.

eslint.config.mjs

+22-1
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
1+
import path from 'node:path'
2+
import { fileURLToPath } from 'node:url'
13
import antfu from '@antfu/eslint-config'
4+
import { FlatCompat } from '@eslint/eslintrc'
5+
import nounsanitized from 'eslint-plugin-no-unsanitized'
6+
7+
// mimic CommonJS variables -- not needed if using CommonJS
8+
const __filename = fileURLToPath(import.meta.url)
9+
const __dirname = path.dirname(__filename)
10+
11+
const compat = new FlatCompat({
12+
baseDirectory: __dirname,
13+
})
214

315
export default antfu(
416
{
517
formatters: true,
18+
ignores: ['demo/', 'stats.html'],
619
lessOpinionated: true,
720
},
821
{
922
rules: {
1023
'brace-style': ['error', 'stroustrup', { allowSingleLine: false }],
1124
'curly': ['error', 'all'],
12-
'no-console': 'off',
25+
'no-console': ['warn', { allow: ['info', 'warn', 'error'] }],
1326
'vue/max-attributes-per-line': ['error', { singleline: 3 }],
1427
'vue/no-deprecated-v-bind-sync': 'off',
1528
'vue/no-deprecated-v-on-native-modifier': 'off',
@@ -18,5 +31,13 @@ export default antfu(
1831
'vue/no-deprecated-dollar-scopedslots-api': 'off',
1932
'vue/singleline-html-element-content-newline': 'off',
2033
},
34+
languageOptions: {
35+
globals: {
36+
37+
},
38+
},
2139
},
40+
[nounsanitized.configs.recommended], // 代码安全性检测
41+
// mimic ESLintRC-style extends
42+
...compat.extends('plugin:financial/recommended'), // 避免财务计算
2243
)

licenses.txt

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
├─ MIT: 325
2+
├─ ISC: 150
3+
├─ Apache-2.0: 17
4+
├─ BSD-2-Clause: 11
5+
├─ BSD-3-Clause: 5
6+
├─ BlueOak-1.0.0: 4
7+
├─ CC0-1.0: 2
8+
├─ MPL-2.0: 1
9+
├─ UNLICENSED: 1
10+
├─ Artistic-2.0: 1
11+
├─ MIT,Apache2: 1
12+
├─ Apache 2.0: 1
13+
├─ (BSD-2-Clause OR MIT OR Apache-2.0): 1
14+
├─ CC-BY-3.0: 1
15+
└─ (MIT OR CC0-1.0): 1

package.json

+40-33
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,10 @@
7070
"build": "vite build && pnpm typegen",
7171
"release": "esno ./scripts/release.mts",
7272
"sync-to-cnpm": "npx cnpm sync && curl -L https://npmmirror.com/sync/json-editor-vue",
73-
"license-scan": "license-checker --summary --out ./dependency-licenses.txt",
74-
"lint": "eslint \"**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue,json,md,html,css,scss,sass}\" --ignore-pattern stats.html",
75-
"lint:fix": "eslint \"**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue,json,md,html,css,scss,sass}\" --ignore-pattern stats.html --fix",
76-
"preinstall": "node -e \"if (process.env.INIT_CWD === process.cwd()) { process.exit(1) }\" || npx only-allow pnpm",
77-
"postinstall": "node -e \"if (process.env.INIT_CWD === process.cwd()) { process.exit(1) }\" || (npx simple-git-hooks && pnpm license-scan)"
73+
"lint": "eslint \"**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue,json,md,html,css,scss,sass}\"",
74+
"lint:fix": "eslint \"**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue,json,md,html,css,scss,sass}\" --fix",
75+
"preinstall": "node -e \"if (process.env.INIT_CWD === process.cwd()) { process.exit(1) }\" || npx only-allow pnpm && pnpm config set registry https://registry.npmmirror.com",
76+
"postinstall": "node -e \"if (process.env.INIT_CWD === process.cwd()) { process.exit(1) }\" || npx simple-git-hooks && git config core.hooksPath .git/hooks/ && npx license-checker --summary --out ./licenses.txt"
7877
},
7978
"peerDependencies": {
8079
"@vue/composition-api": ">=1",
@@ -86,65 +85,73 @@
8685
}
8786
},
8887
"dependencies": {
89-
"vanilla-jsoneditor": "^2.0.0",
88+
"vanilla-jsoneditor": "^2.3.3",
9089
"vue-demi": "^0.14.10"
9190
},
9291
"devDependencies": {
93-
"@antfu/eslint-config": "^3.8.0",
94-
"@arethetypeswrong/cli": "^0.16.4",
95-
"@commitlint/cli": "^19.5.0",
96-
"@commitlint/config-conventional": "^19.5.0",
92+
"@antfu/eslint-config": "^3.14.0",
93+
"@arethetypeswrong/cli": "^0.17.3",
94+
"@commitlint/cli": "^19.6.1",
95+
"@commitlint/config-conventional": "^19.6.0",
96+
"@eslint/eslintrc": "^3.2.0",
9797
"@types/cross-spawn": "^6.0.6",
9898
"@types/lodash-es": "^4.17.12",
99-
"@types/node": "^22.8.4",
99+
"@types/node": "^22.10.7",
100100
"@types/prompts": "^2.4.9",
101101
"@types/semver": "^7.5.8",
102-
"@vitejs/plugin-vue": "^5.1.4",
103-
"@vitest/ui": "^2.1.4",
104-
"@vue/compiler-sfc": "^3.5.12",
102+
"@vitejs/plugin-vue": "^5.2.1",
103+
"@vitest/ui": "^2.1.8",
104+
"@vue/compiler-sfc": "^3.5.13",
105105
"@vue/test-utils": "^2.4.6",
106-
"axios": "^1.7.7",
107-
"case-police": "^0.7.0",
106+
"axios": "^1.7.9",
107+
"case-police": "^0.7.2",
108108
"cnpm": "^9.4.0",
109-
"cross-spawn": "^7.0.3",
109+
"cross-spawn": "^7.0.6",
110110
"del": "^8.0.0",
111111
"destr": "^2.0.3",
112-
"eslint-plugin-format": "^0.1.2",
112+
"eslint": "^9.18.0",
113+
"eslint-plugin-financial": "^0.1.0",
114+
"eslint-plugin-format": "^1.0.1",
115+
"eslint-plugin-no-unsanitized": "^4.1.2",
113116
"esno": "^4.8.0",
114-
"happy-dom": "^15.7.4",
117+
"happy-dom": "^16.6.0",
115118
"json-editor-vue": "workspace:*",
116119
"kolorist": "^1.8.0",
117120
"license-checker": "^25.0.1",
118-
"lint-staged": "^15.2.10",
121+
"lint-staged": "^15.4.0",
119122
"lodash-es": "^4.17.21",
120123
"lossless-json": "^4.0.2",
121124
"magicast": "^0.3.5",
125+
"npm-deprecated-check": "^1.3.0",
122126
"only-allow": "^1.2.1",
123127
"open": "^10.1.0",
124128
"prompts": "^2.4.2",
125-
"publint": "^0.2.12",
126-
"rollup-plugin-visualizer": "^5.12.0",
129+
"publint": "^0.3.2",
130+
"rollup-plugin-visualizer": "^5.14.0",
127131
"semver": "^7.6.3",
128132
"simple-git-hooks": "^2.11.1",
129133
"tsup": "^8.3.5",
130-
"typescript": "^5.6.3",
131-
"unplugin-auto-import": "^0.18.3",
132-
"unplugin-vue-components": "^0.27.4",
133-
"vite": "^5.4.10",
134-
"vite-plugin-dts": "4.3.0",
135-
"vitepress": "^1.4.2",
136-
"vitest": "^2.1.4",
137-
"vue": "^3.5.12",
134+
"typescript": "^5.7.3",
135+
"unplugin-auto-import": "^19.0.0",
136+
"unplugin-vue-components": "^28.0.0",
137+
"vite": "^6.0.7",
138+
"vite-plugin-dts": "4.5.0",
139+
"vitepress": "^1.5.0",
140+
"vitest": "^2.1.8",
141+
"vue": "^3.5.13",
138142
"vue-global-config": "^0.6.3",
139143
"zhlint": "^0.8.2"
140144
},
141145
"simple-git-hooks": {
142-
"pre-commit": "pnpm lint-staged && actionlint",
146+
"pre-commit": "npx lint-staged",
143147
"commit-msg": "npx --no -- commitlint --edit ${1}"
144148
},
145149
"lint-staged": {
146-
"*.md": "case-police --fix",
150+
"*.md": [
151+
"case-police --fix",
152+
"zhlint --fix"
153+
],
147154
"docs/README.zh-CN.md": "zhlint --fix",
148-
"*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue,json,md,html,css,scss,sass}": "eslint --ignore-pattern stats.html --cache --fix"
155+
"*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue,json,md,html,css,scss,sass}": "eslint --cache --fix"
149156
}
150157
}

0 commit comments

Comments
 (0)