From 1e10ca4844076b0b2b9c8f60e73e63355933dbf6 Mon Sep 17 00:00:00 2001 From: YongGit <1013588891@qq.com> Date: Sat, 5 Apr 2025 15:27:47 +0800 Subject: [PATCH 1/4] chore: commitlint upgrade --- .eslintignore | 12 - .eslintrc.js | 4 - .husky/commit-msg | 2 +- commitlint.config.js => commitlint.config.cts | 15 +- eslint.config.js | 53 ++++ package.json | 18 +- packages/eslint-config/index.js | 100 ------ packages/eslint-config/package.json | 31 -- packages/use-immer/package.json | 2 +- pnpm-lock.yaml | 287 +++++++++++------- 10 files changed, 256 insertions(+), 268 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc.js rename commitlint.config.js => commitlint.config.cts (88%) create mode 100644 eslint.config.js delete mode 100644 packages/eslint-config/index.js delete mode 100644 packages/eslint-config/package.json diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index e81413dc..00000000 --- a/.eslintignore +++ /dev/null @@ -1,12 +0,0 @@ -dist/ -node_modules -node_modules/ -patches/ -types/ -!packages/.vitepress -!/.eslintrc.js -!/rollup.config.js -!.test -.temp - -playground \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index dc2d234c..00000000 --- a/.eslintrc.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - root: true, - extends: ['@vue-hooks-plus'], -} diff --git a/.husky/commit-msg b/.husky/commit-msg index 0280839d..80416c7b 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,4 +1,4 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -# npx --no-install commitlint --edit "$1" +npx --no-install commitlint --edit "$1" diff --git a/commitlint.config.js b/commitlint.config.cts similarity index 88% rename from commitlint.config.js rename to commitlint.config.cts index 38c40986..d83e66b2 100644 --- a/commitlint.config.js +++ b/commitlint.config.cts @@ -11,9 +11,12 @@ // revert:回滚某个更早之前的提交 | Roll back some earlier previous submission // version: 改变package.json 版本 | Change the package.json version -module.exports = { +import { RuleConfigSeverity, type UserConfig } from "@commitlint/types"; + +const Configuration: UserConfig = { + extends: ["@commitlint/config-conventional"], + formatter: "@commitlint/format", ignores: [commit => commit.includes('init')], - extends: ['@commitlint/config-conventional'], rules: { 'body-leading-blank': [2, 'always'], 'footer-leading-blank': [1, 'always'], @@ -22,8 +25,7 @@ module.exports = { 'type-empty': [2, 'never'], 'subject-case': [0], 'type-enum': [ - 2, - 'always', + RuleConfigSeverity.Error, "always", [ 'feat', 'fix', @@ -42,4 +44,7 @@ module.exports = { ], ], }, -} +}; + +export default Configuration; + diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 00000000..1d892046 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,53 @@ +import pluginVue from 'eslint-plugin-vue' +import globals from 'globals' +import { defineConfig, globalIgnores } from 'eslint/config' + +export default defineConfig([ + ...pluginVue.configs['flat/recommended'], + globalIgnores(['dist/*', 'node_modules/*', 'patches/*', 'types/*']), + { + rules: { + 'vue/multi-word-component-names': 'off', + 'vue/html-self-closing': 'off', + 'react/no-string-refs': 'off', + 'react/no-unknown-property': 'off', + 'react/display-name': 'off', + 'no-sparse-arrays': 0, + 'no-inner-declarations': 0, + 'no-constant-condition': 0, + 'no-restricted-imports': [ + 'error', + { + paths: ['vue-hooks-plus', '..', '../..', 'packages/hooks/src/index.ts'], + }, + ], + 'no-unused-vars': [ + 2, + { + vars: 'local', + args: 'none', + }, + ], + 'node/no-callback-literal': 'off', + 'import/namespace': 'off', + 'import/default': 'off', + 'import/no-named-as-default': 'off', + 'import/no-named-as-default-member': 'off', + + 'vue/attributes-order': 'off', + 'vue/one-component-per-file': 'off', + 'vue/html-closing-bracket-newline': 'off', + 'vue/max-attributes-per-line': 'off', + 'vue/multiline-html-element-content-newline': 'off', + 'vue/singleline-html-element-content-newline': 'off', + 'vue/attribute-hyphenation': 'off', + 'vue/require-default-prop': 'off', + }, + languageOptions: { + sourceType: 'module', + globals: { + ...globals.browser, + }, + }, + }, +]) diff --git a/package.json b/package.json index ac56651d..0f2aa8e2 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,6 @@ "docs:build": "pnpm build && vitepress build docs", "docs:build-github": "pnpm build:vitepress-demo-block && tsx scripts/gitPage.ts github", "docs:build-gitee": "pnpm build:vitepress-demo-block && tsx scripts/gitPage.ts gitee", - "clean": " rimraf dist lib es", "build": "pnpm recursive exec pnpm run build", "test": "vitest", "test:ui": "vitest --ui", @@ -23,8 +22,8 @@ "docs:preview": "vitepress preview docs" }, "devDependencies": { - "@commitlint/cli": "^17.1.2", - "@commitlint/config-conventional": "^17.1.0", + "@commitlint/cli": "^17.8.1", + "@commitlint/config-conventional": "^17.8.1", "@types/fs-extra": "^9.0.13", "@types/jest": "^29.0.0", "@types/lodash": "^4.14.178", @@ -34,6 +33,7 @@ "@types/prettier": "^2.6.3", "@types/qs": "^6.9.7", "@types/react-dom": "^18.0.6", + "@typescript-eslint/eslint-plugin": "^5.33.0", "@vite-pwa/vitepress": "^1.0.0", "@vitejs/plugin-vue": "^2.3.1", "@vitest/coverage-c8": "^0.25.7", @@ -44,8 +44,8 @@ "@vue-hooks-plus/use-immer": "workspace:^1.0.0", "@vue-hooks-plus/use-request": "workspace:^2.0.0", "@vue-hooks-plus/use-request-plugins": "workspace:^2.0.0", - "@vue-hooks-plus/use-worker": "workspace:^1.0.0", "@vue-hooks-plus/use-url-state": "workspace:^1.0.0", + "@vue-hooks-plus/use-worker": "workspace:^1.0.0", "@vue-hooks-plus/vite-plugin-gen-temp": "^2.6.6", "@vue-hooks-plus/vitepress": "^1.2.4", "@vue-hooks-plus/vitepress-demo-block": "workspace:^1.0.0", @@ -53,7 +53,10 @@ "@vue/test-utils": "^2.1.0", "axios": "^1.4.0", "broadcast-channel": "^5.1.0", + "conventional-changelog-atom": "^5.0.0", "cross-env": "^7.0.3", + "eslint": "^9.24.0", + "eslint-plugin-vue": "^9.6.0", "execa": "^6.1.0", "fast-glob": "^3.2.12", "fs-extra": "^11.3.0", @@ -84,9 +87,12 @@ "vue-tsc": "1.0.9", "vue-typical": "^2.1.0" }, + "simple-git-hooks": { + "pre-commit": "npx lint-staged" + }, "lint-staged": { - "*.{js,ts,tsx,vue}": [ - "echo Linting..." + "*.{js,ts,tsx,vue,md,json}": [ + "eslint --cache --fix" ] }, "repository": "https://github.com/InhiblabCore/vue-hooks-plus", diff --git a/packages/eslint-config/index.js b/packages/eslint-config/index.js deleted file mode 100644 index 2945f492..00000000 --- a/packages/eslint-config/index.js +++ /dev/null @@ -1,100 +0,0 @@ -const { resolve } = require('path') - -module.exports = { - root: true, - env: { - browser: true, - node: true, - es6: true, - }, - parser: 'vue-eslint-parser', - parserOptions: { - parser: '@typescript-eslint/parser', - ecmaVersion: 2020, - sourceType: 'module', - jsxPragma: 'React', - ecmaFeatures: { - jsx: true, - }, - }, - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/eslint-recommended', - 'plugin:@typescript-eslint/recommended', - 'plugin:vue/vue3-recommended', - ], - plugins: ['@typescript-eslint', 'vue'], - rules: { - 'vue/multi-word-component-names': 'off', - 'vue/html-self-closing': 'off', - 'react/no-string-refs': 'off', - 'react/no-unknown-property': 'off', - 'react/display-name': 'off', - '@typescript-eslint/explicit-module-boundary-types': 'off', - '@typescript-eslint/ban-ts-comment': 'off', - 'no-sparse-arrays': 0, - 'no-inner-declarations': 0, - '@typescript-eslint/indent': 0, - 'no-constant-condition': 0, - '@typescript-eslint/explicit-function-return-type': 'off', - '@typescript-eslint/no-empty-function': 0, - '@typescript-eslint/explicit-member-accessibility': [2, { accessibility: 'no-public' }], - '@typescript-eslint/no-non-null-assertion': 0, - // '@typescript-eslint/explicit-function-return-type': [2, { allowExpressions: true }], - '@typescript-eslint/no-use-before-define': [2, { functions: false }], - '@typescript-eslint/no-namespace': 0, - '@typescript-eslint/ban-ts-ignore': 0, - '@typescript-eslint/no-empty-interface': 1, - '@typescript-eslint/camelcase': 0, - '@typescript-eslint/no-explicit-any': 0, - '@typescript-eslint/no-var-requires': 0, - 'no-restricted-imports': [ - 'error', - { - paths: ['vue-hooks-plus', '..', '../..', resolve(__dirname, 'packages/hooks/src/index.ts')], - }, - ], - 'no-unused-vars': [ - 2, - { - vars: 'local', - args: 'none', - }, - ], - 'node/no-callback-literal': 'off', - 'import/namespace': 'off', - 'import/default': 'off', - 'import/no-named-as-default': 'off', - 'import/no-named-as-default-member': 'off', - - 'vue/attributes-order': 'off', - 'vue/one-component-per-file': 'off', - 'vue/html-closing-bracket-newline': 'off', - 'vue/max-attributes-per-line': 'off', - 'vue/multiline-html-element-content-newline': 'off', - 'vue/singleline-html-element-content-newline': 'off', - 'vue/attribute-hyphenation': 'off', - 'vue/require-default-prop': 'off', - }, - - overrides: [ - { - files: ['**/*.md', '**/*.md/*.*', '**/demo/*.vue', 'scripts/*.ts', '*.test.ts', '*.spec.ts'], - rules: { - 'no-alert': 'off', - 'no-console': 'off', - 'no-undef': 'off', - 'no-unused-vars': 'off', - 'no-restricted-imports': 'off', - '@typescript-eslint/no-unused-vars': 'off', - '@typescript-eslint/no-redeclare': 'off', - }, - }, - { - files: ['packages/hooks/docs/.vitepress/**/*.*'], - rules: { - 'no-restricted-imports': 'off', - }, - }, - ], -} diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json deleted file mode 100644 index 407bfc72..00000000 --- a/packages/eslint-config/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "@vue-hooks-plus/eslint-config", - "version": "1.0.0", - "description": "", - "main": "index.js", - "files": [ - "index.js", - "package.json" - ], - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "build":"echo eslint ignore" - }, - "keywords": [ - "eslint-config" - ], - "author": "YongGit", - "license": "MIT", - "peerDependencies": { - "eslint": ">=7.4.0" - }, - "devDependencies": { - "@typescript-eslint/eslint-plugin": "^5.33.0", - "@typescript-eslint/parser": "^5.33.0", - "eslint": "^8.20.0", - "eslint-config-prettier": "^8.5.0", - "eslint-plugin-prettier": "^4.2.1", - "eslint-plugin-vue": "^9.6.0", - "vue-eslint-parser": "^9.0.3" - } -} diff --git a/packages/use-immer/package.json b/packages/use-immer/package.json index bffc2a0e..c5df2384 100644 --- a/packages/use-immer/package.json +++ b/packages/use-immer/package.json @@ -12,7 +12,7 @@ "module": "./dist/useImmer.es.js", "types":"./dist/types/index.d.ts" , "scripts": { - "build": "npm run clean && vite build", + "build": "npm run clean && vite build", "clean": "rimraf dist" }, "keywords": [], diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 74abc3f2..7cfcdd52 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,8 +4,8 @@ importers: .: specifiers: - '@commitlint/cli': ^17.1.2 - '@commitlint/config-conventional': ^17.1.0 + '@commitlint/cli': ^17.8.1 + '@commitlint/config-conventional': ^17.8.1 '@types/fs-extra': ^9.0.13 '@types/jest': ^29.0.0 '@types/lodash': ^4.14.178 @@ -15,6 +15,7 @@ importers: '@types/prettier': ^2.6.3 '@types/qs': ^6.9.7 '@types/react-dom': ^18.0.6 + '@typescript-eslint/eslint-plugin': ^5.33.0 '@vite-pwa/vitepress': ^1.0.0 '@vitejs/plugin-vue': ^2.3.1 '@vitest/coverage-c8': ^0.25.7 @@ -34,7 +35,10 @@ importers: '@vue/test-utils': ^2.1.0 axios: ^1.4.0 broadcast-channel: ^5.1.0 + conventional-changelog-atom: ^5.0.0 cross-env: ^7.0.3 + eslint: ^9.24.0 + eslint-plugin-vue: ^9.6.0 execa: ^6.1.0 fast-glob: ^3.2.12 fs-extra: ^11.3.0 @@ -76,6 +80,7 @@ importers: '@types/prettier': 2.7.3 '@types/qs': 6.9.18 '@types/react-dom': 18.3.6_@types+react@18.3.20 + '@typescript-eslint/eslint-plugin': 5.62.0_76ydpfjck7h2lo76u6hqjw4sri '@vite-pwa/vitepress': 1.0.0_vite-plugin-pwa@1.0.0 '@vitejs/plugin-vue': 2.3.4_vite@3.0.2+vue@3.5.13 '@vitest/coverage-c8': 0.25.8_4rke55fors2tnsu273t7mnruwm @@ -95,7 +100,10 @@ importers: '@vue/test-utils': 2.4.6 axios: 1.8.4 broadcast-channel: 5.5.1 + conventional-changelog-atom: 5.0.0 cross-env: 7.0.3 + eslint: 9.24.0 + eslint-plugin-vue: 9.33.0_eslint@9.24.0 execa: 6.1.0 fast-glob: 3.3.3 fs-extra: 11.3.0 @@ -130,19 +138,19 @@ importers: specifiers: '@typescript-eslint/eslint-plugin': ^5.33.0 '@typescript-eslint/parser': ^5.33.0 - eslint: ^8.20.0 + eslint: ^9.24.0 eslint-config-prettier: ^8.5.0 eslint-plugin-prettier: ^4.2.1 eslint-plugin-vue: ^9.6.0 vue-eslint-parser: ^9.0.3 devDependencies: - '@typescript-eslint/eslint-plugin': 5.62.0_cntrqg5kbw2b3ofwts74zvoa6a - '@typescript-eslint/parser': 5.62.0_jihedaljdcwb335y544ngwxjiy - eslint: 8.57.1 - eslint-config-prettier: 8.10.0_eslint@8.57.1 - eslint-plugin-prettier: 4.2.1_pvgxo3bbcninonlgtvprmc7wxu - eslint-plugin-vue: 9.33.0_eslint@8.57.1 - vue-eslint-parser: 9.4.3_eslint@8.57.1 + '@typescript-eslint/eslint-plugin': 5.62.0_76ydpfjck7h2lo76u6hqjw4sri + '@typescript-eslint/parser': 5.62.0_ks6ui6jebwf5sajuqqtqmktvo4 + eslint: 9.24.0 + eslint-config-prettier: 8.10.0_eslint@9.24.0 + eslint-plugin-prettier: 4.2.1_j3yki6ov5rytm7rhde4bwdi5fm + eslint-plugin-vue: 9.33.0_eslint@9.24.0 + vue-eslint-parser: 9.4.3_eslint@9.24.0 packages/hooks: specifiers: @@ -2433,13 +2441,13 @@ packages: dev: true optional: true - /@eslint-community/eslint-utils/4.5.1_eslint@8.57.1: + /@eslint-community/eslint-utils/4.5.1_eslint@9.24.0: resolution: {integrity: sha512-soEIOALTfTK6EjmKMMoLugwaP0rzkad90iIWd1hMO9ARkSAyjfMfkRRhLvD5qH7vvM0Cg72pieUfR6yh6XxC4w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 dependencies: - eslint: 8.57.1 + eslint: 9.24.0 eslint-visitor-keys: 3.4.3 dev: true @@ -2448,14 +2456,44 @@ packages: engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} dev: true - /@eslint/eslintrc/2.1.4: - resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@eslint/config-array/0.20.0: + resolution: {integrity: sha512-fxlS1kkIjx8+vy2SjuCB94q3htSNrufYTXubwiBFeaQHbH6Ipi43gFJq2zCMt6PHhImH3Xmr0NksKDvchWlpQQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dependencies: + '@eslint/object-schema': 2.1.6 + debug: 4.4.0 + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@eslint/config-helpers/0.2.1: + resolution: {integrity: sha512-RI17tsD2frtDu/3dmI7QRrD4bedNKPM08ziRYaC5AhkGrzIAJelm9kJU1TznK+apx6V+cqRz8tfpEeG3oIyjxw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dev: true + + /@eslint/core/0.12.0: + resolution: {integrity: sha512-cmrR6pytBuSMTaBweKoGMwu3EiHiEC+DoyupPmlZ0HxBJBtIxwe+j/E4XPIKNx+Q74c8lXKPwYawBf5glsTkHg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dependencies: + '@types/json-schema': 7.0.15 + dev: true + + /@eslint/core/0.13.0: + resolution: {integrity: sha512-yfkgDw1KR66rkT5A8ci4irzDysN7FRpq3ttJolR88OqQikAWqwA8j5VZyas+vjyBNFIJ7MfybJ9plMILI2UrCw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dependencies: + '@types/json-schema': 7.0.15 + dev: true + + /@eslint/eslintrc/3.3.1: + resolution: {integrity: sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} dependencies: ajv: 6.12.6 debug: 4.4.0 - espree: 9.6.1 - globals: 13.24.0 + espree: 10.3.0 + globals: 14.0.0 ignore: 5.3.2 import-fresh: 3.3.1 js-yaml: 4.1.0 @@ -2465,21 +2503,35 @@ packages: - supports-color dev: true - /@eslint/js/8.57.1: - resolution: {integrity: sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@eslint/js/9.24.0: + resolution: {integrity: sha512-uIY/y3z0uvOGX8cp1C2fiC4+ZmBhp6yZWkojtHL1YEMnRt1Y63HB9TM17proGEmeG7HeUY+UP36F0aknKYTpYA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} dev: true - /@humanwhocodes/config-array/0.13.0: - resolution: {integrity: sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==} - engines: {node: '>=10.10.0'} - deprecated: Use @eslint/config-array instead + /@eslint/object-schema/2.1.6: + resolution: {integrity: sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dev: true + + /@eslint/plugin-kit/0.2.8: + resolution: {integrity: sha512-ZAoA40rNMPwSm+AeHpCq8STiNAwzWLJuP8Xv4CHIc9wv/PSuExjMrmjfYNj682vW0OOiZ1HKxzvjQr9XZIisQA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} dependencies: - '@humanwhocodes/object-schema': 2.0.3 - debug: 4.4.0 - minimatch: 3.1.2 - transitivePeerDependencies: - - supports-color + '@eslint/core': 0.13.0 + levn: 0.4.1 + dev: true + + /@humanfs/core/0.19.1: + resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} + engines: {node: '>=18.18.0'} + dev: true + + /@humanfs/node/0.16.6: + resolution: {integrity: sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==} + engines: {node: '>=18.18.0'} + dependencies: + '@humanfs/core': 0.19.1 + '@humanwhocodes/retry': 0.3.1 dev: true /@humanwhocodes/module-importer/1.0.1: @@ -2487,9 +2539,14 @@ packages: engines: {node: '>=12.22'} dev: true - /@humanwhocodes/object-schema/2.0.3: - resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} - deprecated: Use @eslint/object-schema instead + /@humanwhocodes/retry/0.3.1: + resolution: {integrity: sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==} + engines: {node: '>=18.18'} + dev: true + + /@humanwhocodes/retry/0.4.2: + resolution: {integrity: sha512-xeO57FpIu4p1Ri3Jq/EXq4ClRm86dVF2z/+kvFnyqVYRavTZmaFaUBbWCOuuTh0o/g7DSsk6kc2vrS4Vl5oPOQ==} + engines: {node: '>=18.18'} dev: true /@iconify-json/logos/1.2.4: @@ -3448,7 +3505,7 @@ packages: '@types/yargs-parser': 21.0.3 dev: true - /@typescript-eslint/eslint-plugin/5.62.0_cntrqg5kbw2b3ofwts74zvoa6a: + /@typescript-eslint/eslint-plugin/5.62.0_76ydpfjck7h2lo76u6hqjw4sri: resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -3460,12 +3517,12 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.12.1 - '@typescript-eslint/parser': 5.62.0_jihedaljdcwb335y544ngwxjiy + '@typescript-eslint/parser': 5.62.0_ks6ui6jebwf5sajuqqtqmktvo4 '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/type-utils': 5.62.0_jihedaljdcwb335y544ngwxjiy - '@typescript-eslint/utils': 5.62.0_jihedaljdcwb335y544ngwxjiy + '@typescript-eslint/type-utils': 5.62.0_ks6ui6jebwf5sajuqqtqmktvo4 + '@typescript-eslint/utils': 5.62.0_ks6ui6jebwf5sajuqqtqmktvo4 debug: 4.4.0 - eslint: 8.57.1 + eslint: 9.24.0 graphemer: 1.4.0 ignore: 5.3.2 natural-compare-lite: 1.4.0 @@ -3476,7 +3533,7 @@ packages: - supports-color dev: true - /@typescript-eslint/parser/5.62.0_jihedaljdcwb335y544ngwxjiy: + /@typescript-eslint/parser/5.62.0_ks6ui6jebwf5sajuqqtqmktvo4: resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -3490,7 +3547,7 @@ packages: '@typescript-eslint/types': 5.62.0 '@typescript-eslint/typescript-estree': 5.62.0_typescript@5.8.2 debug: 4.4.0 - eslint: 8.57.1 + eslint: 9.24.0 typescript: 5.8.2 transitivePeerDependencies: - supports-color @@ -3504,7 +3561,7 @@ packages: '@typescript-eslint/visitor-keys': 5.62.0 dev: true - /@typescript-eslint/type-utils/5.62.0_jihedaljdcwb335y544ngwxjiy: + /@typescript-eslint/type-utils/5.62.0_ks6ui6jebwf5sajuqqtqmktvo4: resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -3515,9 +3572,9 @@ packages: optional: true dependencies: '@typescript-eslint/typescript-estree': 5.62.0_typescript@5.8.2 - '@typescript-eslint/utils': 5.62.0_jihedaljdcwb335y544ngwxjiy + '@typescript-eslint/utils': 5.62.0_ks6ui6jebwf5sajuqqtqmktvo4 debug: 4.4.0 - eslint: 8.57.1 + eslint: 9.24.0 tsutils: 3.21.0_typescript@5.8.2 typescript: 5.8.2 transitivePeerDependencies: @@ -3550,19 +3607,19 @@ packages: - supports-color dev: true - /@typescript-eslint/utils/5.62.0_jihedaljdcwb335y544ngwxjiy: + /@typescript-eslint/utils/5.62.0_ks6ui6jebwf5sajuqqtqmktvo4: resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - '@eslint-community/eslint-utils': 4.5.1_eslint@8.57.1 + '@eslint-community/eslint-utils': 4.5.1_eslint@9.24.0 '@types/json-schema': 7.0.15 '@types/semver': 7.7.0 '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 '@typescript-eslint/typescript-estree': 5.62.0_typescript@5.8.2 - eslint: 8.57.1 + eslint: 9.24.0 eslint-scope: 5.1.1 semver: 7.7.1 transitivePeerDependencies: @@ -3623,8 +3680,8 @@ packages: vite: ^3.0.0 vue: ^3.2.25 dependencies: - vite: 3.2.11_less@4.2.2 - vue: 3.5.13 + vite: 3.2.11_ue4hszsjlr3ayqwkvy34jdue3e + vue: 3.5.13_typescript@5.8.2 dev: true /@vitejs/plugin-vue/5.2.3_vite@5.4.16+vue@3.5.13: @@ -3982,7 +4039,7 @@ packages: dependencies: '@vue/compiler-ssr': 3.5.13 '@vue/shared': 3.5.13 - vue: 3.5.13 + vue: 3.5.13_typescript@5.8.2 /@vue/shared/3.5.13: resolution: {integrity: sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ==} @@ -4834,6 +4891,11 @@ packages: compare-func: 2.0.0 dev: true + /conventional-changelog-atom/5.0.0: + resolution: {integrity: sha512-WfzCaAvSCFPkznnLgLnfacRAzjgqjLUjvf3MftfsJzQdDICqkOOpcMtdJF3wTerxSpv2IAAjX8doM3Vozqle3g==} + engines: {node: '>=18'} + dev: true + /conventional-changelog-conventionalcommits/6.1.0: resolution: {integrity: sha512-3cS3GEtR78zTfMzk0AizXKKIdN4OvSh7ibNz6/DPbhWWQu7LqE/8+/GqSodV+sywUR2gpJAdP/1JFf4XtN7Zpw==} engines: {node: '>=14'} @@ -5123,13 +5185,6 @@ packages: path-type: 4.0.0 dev: true - /doctrine/3.0.0: - resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} - engines: {node: '>=6.0.0'} - dependencies: - esutils: 2.0.3 - dev: true - /dom-serializer/1.4.1: resolution: {integrity: sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==} dependencies: @@ -5887,16 +5942,16 @@ packages: engines: {node: '>=12'} dev: true - /eslint-config-prettier/8.10.0_eslint@8.57.1: + /eslint-config-prettier/8.10.0_eslint@9.24.0: resolution: {integrity: sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==} hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: - eslint: 8.57.1 + eslint: 9.24.0 dev: true - /eslint-plugin-prettier/4.2.1_pvgxo3bbcninonlgtvprmc7wxu: + /eslint-plugin-prettier/4.2.1_j3yki6ov5rytm7rhde4bwdi5fm: resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==} engines: {node: '>=12.0.0'} peerDependencies: @@ -5907,26 +5962,26 @@ packages: eslint-config-prettier: optional: true dependencies: - eslint: 8.57.1 - eslint-config-prettier: 8.10.0_eslint@8.57.1 + eslint: 9.24.0 + eslint-config-prettier: 8.10.0_eslint@9.24.0 prettier: 3.5.3 prettier-linter-helpers: 1.0.0 dev: true - /eslint-plugin-vue/9.33.0_eslint@8.57.1: + /eslint-plugin-vue/9.33.0_eslint@9.24.0: resolution: {integrity: sha512-174lJKuNsuDIlLpjeXc5E2Tss8P44uIimAfGD0b90k0NoirJqpG7stLuU9Vp/9ioTOrQdWVREc4mRd1BD+CvGw==} engines: {node: ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.2.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 dependencies: - '@eslint-community/eslint-utils': 4.5.1_eslint@8.57.1 - eslint: 8.57.1 + '@eslint-community/eslint-utils': 4.5.1_eslint@9.24.0 + eslint: 9.24.0 globals: 13.24.0 natural-compare: 1.4.0 nth-check: 2.1.1 postcss-selector-parser: 6.1.2 semver: 7.7.1 - vue-eslint-parser: 9.4.3_eslint@8.57.1 + vue-eslint-parser: 9.4.3_eslint@9.24.0 xml-name-validator: 4.0.0 transitivePeerDependencies: - supports-color @@ -5948,55 +6003,69 @@ packages: estraverse: 5.3.0 dev: true + /eslint-scope/8.3.0: + resolution: {integrity: sha512-pUNxi75F8MJ/GdeKtVLSbYg4ZI34J6C0C7sbL4YOp2exGwen7ZsuBqKzUhXd0qMQ362yET3z+uPwKeg/0C2XCQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dependencies: + esrecurse: 4.3.0 + estraverse: 5.3.0 + dev: true + /eslint-visitor-keys/3.4.3: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /eslint/8.57.1: - resolution: {integrity: sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. + /eslint-visitor-keys/4.2.0: + resolution: {integrity: sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dev: true + + /eslint/9.24.0: + resolution: {integrity: sha512-eh/jxIEJyZrvbWRe4XuVclLPDYSYYYgLy5zXGGxD6j8zjSAxFEzI2fL/8xNq6O2yKqVt+eF2YhV+hxjV6UKXwQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true + peerDependencies: + jiti: '*' + peerDependenciesMeta: + jiti: + optional: true dependencies: - '@eslint-community/eslint-utils': 4.5.1_eslint@8.57.1 + '@eslint-community/eslint-utils': 4.5.1_eslint@9.24.0 '@eslint-community/regexpp': 4.12.1 - '@eslint/eslintrc': 2.1.4 - '@eslint/js': 8.57.1 - '@humanwhocodes/config-array': 0.13.0 + '@eslint/config-array': 0.20.0 + '@eslint/config-helpers': 0.2.1 + '@eslint/core': 0.12.0 + '@eslint/eslintrc': 3.3.1 + '@eslint/js': 9.24.0 + '@eslint/plugin-kit': 0.2.8 + '@humanfs/node': 0.16.6 '@humanwhocodes/module-importer': 1.0.1 - '@nodelib/fs.walk': 1.2.8 - '@ungap/structured-clone': 1.3.0 + '@humanwhocodes/retry': 0.4.2 + '@types/estree': 1.0.7 + '@types/json-schema': 7.0.15 ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.6 debug: 4.4.0 - doctrine: 3.0.0 escape-string-regexp: 4.0.0 - eslint-scope: 7.2.2 - eslint-visitor-keys: 3.4.3 - espree: 9.6.1 + eslint-scope: 8.3.0 + eslint-visitor-keys: 4.2.0 + espree: 10.3.0 esquery: 1.6.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 - file-entry-cache: 6.0.1 + file-entry-cache: 8.0.0 find-up: 5.0.0 glob-parent: 6.0.2 - globals: 13.24.0 - graphemer: 1.4.0 ignore: 5.3.2 imurmurhash: 0.1.4 is-glob: 4.0.3 - is-path-inside: 3.0.3 - js-yaml: 4.1.0 json-stable-stringify-without-jsonify: 1.0.1 - levn: 0.4.1 lodash.merge: 4.6.2 minimatch: 3.1.2 natural-compare: 1.4.0 optionator: 0.9.4 - strip-ansi: 6.0.1 - text-table: 0.2.0 transitivePeerDependencies: - supports-color dev: true @@ -6006,6 +6075,15 @@ packages: engines: {node: '>=6'} dev: true + /espree/10.3.0: + resolution: {integrity: sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dependencies: + acorn: 8.14.1 + acorn-jsx: 5.3.2_acorn@8.14.1 + eslint-visitor-keys: 4.2.0 + dev: true + /espree/9.6.1: resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -6191,11 +6269,11 @@ packages: picomatch: 4.0.2 dev: true - /file-entry-cache/6.0.1: - resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} - engines: {node: ^10.12.0 || >=12.0.0} + /file-entry-cache/8.0.0: + resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} + engines: {node: '>=16.0.0'} dependencies: - flat-cache: 3.2.0 + flat-cache: 4.0.1 dev: true /filelist/1.0.4: @@ -6255,13 +6333,12 @@ packages: path-exists: 4.0.0 dev: true - /flat-cache/3.2.0: - resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} - engines: {node: ^10.12.0 || >=12.0.0} + /flat-cache/4.0.1: + resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} + engines: {node: '>=16'} dependencies: flatted: 3.3.3 keyv: 4.5.4 - rimraf: 3.0.2 dev: true /flatted/3.3.3: @@ -6537,6 +6614,11 @@ packages: type-fest: 0.20.2 dev: true + /globals/14.0.0: + resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} + engines: {node: '>=18'} + dev: true + /globals/15.15.0: resolution: {integrity: sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==} engines: {node: '>=18'} @@ -6980,11 +7062,6 @@ packages: engines: {node: '>=8'} dev: true - /is-path-inside/3.0.3: - resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} - engines: {node: '>=8'} - dev: true - /is-plain-obj/1.1.0: resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} engines: {node: '>=0.10.0'} @@ -9375,10 +9452,6 @@ packages: engines: {node: '>=0.10'} dev: true - /text-table/0.2.0: - resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} - dev: true - /thenify-all/1.6.0: resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} engines: {node: '>=0.8'} @@ -9745,7 +9818,6 @@ packages: resolution: {integrity: sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==} engines: {node: '>=14.17'} hasBin: true - dev: true /uc.micro/1.0.6: resolution: {integrity: sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==} @@ -10498,17 +10570,17 @@ packages: '@vue/composition-api': optional: true dependencies: - vue: 3.5.13 + vue: 3.5.13_typescript@5.8.2 dev: true - /vue-eslint-parser/9.4.3_eslint@8.57.1: + /vue-eslint-parser/9.4.3_eslint@9.24.0: resolution: {integrity: sha512-2rYRLWlIpaiN8xbPiDyXZXRgLGOtWxERV7ND5fFAv5qo1D2N9Fu9MNajBNc6o13lZ+24DAWCkQCvj4klgmcITg==} engines: {node: ^14.17.0 || >=16.0.0} peerDependencies: eslint: '>=6.0.0' dependencies: debug: 4.4.0 - eslint: 8.57.1 + eslint: 9.24.0 eslint-scope: 7.2.2 eslint-visitor-keys: 3.4.3 espree: 9.6.1 @@ -10595,7 +10667,6 @@ packages: '@vue/server-renderer': 3.5.13_vue@3.5.13 '@vue/shared': 3.5.13 typescript: 5.8.2 - dev: true /web-resource-inliner/6.0.1: resolution: {integrity: sha512-kfqDxt5dTB1JhqsCUQVFDj0rmY+4HLwGQIsLPbyrsN9y9WV/1oFDSx3BQ4GfCv9X+jVeQ7rouTqwK53rA/7t8A==} From 081dca13e2c04477ae870b7f5b6933c1cb63e2f4 Mon Sep 17 00:00:00 2001 From: YongGit <1013588891@qq.com> Date: Sat, 5 Apr 2025 15:29:39 +0800 Subject: [PATCH 2/4] chore: eslint commitlint upgrade --- package.json | 2 -- pnpm-lock.yaml | 9 --------- 2 files changed, 11 deletions(-) diff --git a/package.json b/package.json index 0f2aa8e2..dd799ab4 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,6 @@ "@vitejs/plugin-vue": "^2.3.1", "@vitest/coverage-c8": "^0.25.7", "@vitest/ui": "^0.25.3", - "@vue-hooks-plus/eslint-config": "workspace:^1.0.0", "@vue-hooks-plus/md-demo-plugins": "^1.0.0", "@vue-hooks-plus/types": "workspace:^2.0.0", "@vue-hooks-plus/use-immer": "workspace:^1.0.0", @@ -53,7 +52,6 @@ "@vue/test-utils": "^2.1.0", "axios": "^1.4.0", "broadcast-channel": "^5.1.0", - "conventional-changelog-atom": "^5.0.0", "cross-env": "^7.0.3", "eslint": "^9.24.0", "eslint-plugin-vue": "^9.6.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7cfcdd52..b7f8cb2a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,7 +20,6 @@ importers: '@vitejs/plugin-vue': ^2.3.1 '@vitest/coverage-c8': ^0.25.7 '@vitest/ui': ^0.25.3 - '@vue-hooks-plus/eslint-config': workspace:^1.0.0 '@vue-hooks-plus/md-demo-plugins': ^1.0.0 '@vue-hooks-plus/types': workspace:^2.0.0 '@vue-hooks-plus/use-immer': workspace:^1.0.0 @@ -35,7 +34,6 @@ importers: '@vue/test-utils': ^2.1.0 axios: ^1.4.0 broadcast-channel: ^5.1.0 - conventional-changelog-atom: ^5.0.0 cross-env: ^7.0.3 eslint: ^9.24.0 eslint-plugin-vue: ^9.6.0 @@ -85,7 +83,6 @@ importers: '@vitejs/plugin-vue': 2.3.4_vite@3.0.2+vue@3.5.13 '@vitest/coverage-c8': 0.25.8_4rke55fors2tnsu273t7mnruwm '@vitest/ui': 0.25.8 - '@vue-hooks-plus/eslint-config': link:packages/eslint-config '@vue-hooks-plus/md-demo-plugins': 1.1.0_erz2jsxiahvile5wzydwj6eewu '@vue-hooks-plus/types': link:packages/types '@vue-hooks-plus/use-immer': link:packages/use-immer @@ -100,7 +97,6 @@ importers: '@vue/test-utils': 2.4.6 axios: 1.8.4 broadcast-channel: 5.5.1 - conventional-changelog-atom: 5.0.0 cross-env: 7.0.3 eslint: 9.24.0 eslint-plugin-vue: 9.33.0_eslint@9.24.0 @@ -4891,11 +4887,6 @@ packages: compare-func: 2.0.0 dev: true - /conventional-changelog-atom/5.0.0: - resolution: {integrity: sha512-WfzCaAvSCFPkznnLgLnfacRAzjgqjLUjvf3MftfsJzQdDICqkOOpcMtdJF3wTerxSpv2IAAjX8doM3Vozqle3g==} - engines: {node: '>=18'} - dev: true - /conventional-changelog-conventionalcommits/6.1.0: resolution: {integrity: sha512-3cS3GEtR78zTfMzk0AizXKKIdN4OvSh7ibNz6/DPbhWWQu7LqE/8+/GqSodV+sywUR2gpJAdP/1JFf4XtN7Zpw==} engines: {node: '>=14'} From 7b1d0cef6f4ef6605caa2dd2672345ecba026357 Mon Sep 17 00:00:00 2001 From: YongGit <1013588891@qq.com> Date: Sat, 5 Apr 2025 15:35:50 +0800 Subject: [PATCH 3/4] style: opt dir & files --- .../hooks/.vscode => .vscode}/extensions.json | 0 packages/hooks/{scripts => config}/build.ts | 0 packages/hooks/scripts/config.ts | 6 ----- packages/hooks/scripts/plugin.ts | 23 ------------------- packages/hooks/scripts/utils.ts | 12 ---------- packages/hooks/vite.config.ts | 6 +---- 6 files changed, 1 insertion(+), 46 deletions(-) rename {packages/hooks/.vscode => .vscode}/extensions.json (100%) rename packages/hooks/{scripts => config}/build.ts (100%) delete mode 100644 packages/hooks/scripts/config.ts delete mode 100644 packages/hooks/scripts/plugin.ts delete mode 100644 packages/hooks/scripts/utils.ts diff --git a/packages/hooks/.vscode/extensions.json b/.vscode/extensions.json similarity index 100% rename from packages/hooks/.vscode/extensions.json rename to .vscode/extensions.json diff --git a/packages/hooks/scripts/build.ts b/packages/hooks/config/build.ts similarity index 100% rename from packages/hooks/scripts/build.ts rename to packages/hooks/config/build.ts diff --git a/packages/hooks/scripts/config.ts b/packages/hooks/scripts/config.ts deleted file mode 100644 index 2c0cc4de..00000000 --- a/packages/hooks/scripts/config.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UserConfig } from 'vite' - -// vite config -const config: UserConfig = {} - -export default config diff --git a/packages/hooks/scripts/plugin.ts b/packages/hooks/scripts/plugin.ts deleted file mode 100644 index 29a968f0..00000000 --- a/packages/hooks/scripts/plugin.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { cyan } from 'kolorist' -import { Logger, Plugin } from 'vite' -import { move } from './utils' - -export function movePlugin({ from, to }: { from: string; to: string }): Plugin { - let logger: Logger - - const logPrefix = '[vite-plugin-move]' - return { - name: 'vite-plugin-move', - apply: 'build', - enforce: 'pre', - configResolved: config => { - logger = config.logger - }, - buildEnd() { - move(from, to, logger) - }, - async closeBundle() { - logger.info(`\n${cyan(logPrefix)} File successfully!`) - }, - } -} diff --git a/packages/hooks/scripts/utils.ts b/packages/hooks/scripts/utils.ts deleted file mode 100644 index baa41854..00000000 --- a/packages/hooks/scripts/utils.ts +++ /dev/null @@ -1,12 +0,0 @@ -import fs from 'fs-extra' -import { cyan } from 'kolorist' -import { Logger } from 'vite' - -const logPrefix = '[vite-plugin-move]' - -export function move(originalUrl: string, targetUrl: string, log: Logger) { - fs.move(originalUrl, targetUrl, err => { - if (err) return log.error(JSON.stringify(err)) - log.info(`\n${cyan(logPrefix)} File successfully moved!!`) - }) -} diff --git a/packages/hooks/vite.config.ts b/packages/hooks/vite.config.ts index f5f1a6a8..2bd5095f 100644 --- a/packages/hooks/vite.config.ts +++ b/packages/hooks/vite.config.ts @@ -1,10 +1,6 @@ import { defineConfig } from 'vite' -import { buildConfig } from './scripts/build' -// import config from './scripts/config' +import { buildConfig } from './config/build' export default defineConfig(() => { - // if (mode === 'fullTypes') { - // return buildFullTypesConfig - // } return buildConfig }) From 125e67104d24d4f48218b8ab467265dad427350d Mon Sep 17 00:00:00 2001 From: YongGit <1013588891@qq.com> Date: Sat, 5 Apr 2025 15:40:13 +0800 Subject: [PATCH 4/4] docs: opt --- CONTRIBUTING.md | 18 +++--------------- DEV_DOCUMENT.md | 42 +----------------------------------------- 2 files changed, 4 insertions(+), 56 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6098192c..78047957 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,9 +22,9 @@ To develop and test the core `VueHooks Plus` package: 1. `packages/hooks/src` folder adds a folder starting with an `useXxx`. -2. Add `en-US.md` and `zh-CN.md` as a document. +2. Add `*.md` as a document at `docs/en` or `docs/zh`. -3. Add `demo` folder as a document example. +3. Add `demo` folder as a document example as `docs/demo`. 4. Add `__tests__` folder as Unit Tests. @@ -40,19 +40,7 @@ Start documentation via [Dev Document Guide](./DEV_DOCUMENT.md). 1. Run `pnpm docs:dev` in VueHooks Plus's root folder or Run `pnpm initial` and `pnpm docs:dev` `packages/hooks` folder. -2. `.md` must add a mapping path. - -``` - ---- -map: -# Path mapped to docs -path: /useBoolean ---- - -``` - -3. `packages/hooks/docs/.vitepress/router.ts` add hooks router info. +2. `docs/.vitepress/config` add hooks router info. ## Pull Request Guidelines diff --git a/DEV_DOCUMENT.md b/DEV_DOCUMENT.md index 5de4ef7c..f6bb8f7a 100644 --- a/DEV_DOCUMENT.md +++ b/DEV_DOCUMENT.md @@ -1,48 +1,8 @@ # Dev the Document -## Working principle - -I modified the [ruabick](https://github.com/dewfall123/ruabick) plugin o read the .md file and map the generated path。 - -### plugins: - -- `@vue-hooks-plus/vite-plugin-gen-temp` dynamically generate md files. -- `@vue-hooks-plus/vitepress-demo-block` demo block at the md files. -- `@vue-hooks-plus/vitepress` transformation based on vitepress to support internationalization. -- `@vue-hooks-plus/md-demo-plugins` apply demo block. - -[Source](https://github.com/InhiblabCore/plugins) - ## Start -need run initial at `packages/hooks` folder. - -```bash - -pnpm initial - -``` - -Check if a .docs folder is generated in your directory。If it fails, it cannot be started and needs to be re-run `initial` 👆 . - -next, vitepress run .docs - ```bash - -pnpm docs:dev - -``` - -or - -at `root` dir run - -```bash - +pnpm install pnpm docs:dev - ``` - -will implement script to finished `scripts/docs.ts` - -If the page startup is blank, you need to refresh the page.