diff --git a/package.json b/package.json index 82fb7f61..72840540 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "type": "module", "version": "1.0.0-rc.6", "private": true, - "packageManager": "pnpm@8.12.1", + "packageManager": "pnpm@8.13.1", "author": "pengzhanbo", "license": "MIT", "keywords": [ @@ -18,7 +18,6 @@ "pnpm": ">=7" }, "scripts": { - "autoUpdate": "node scripts/autoInstall.js", "build": "pnpm run build:package", "build:package": "pnpm --filter=!vuepress-theme-plume-monorepo --filter=!docs run -r --stream build", "commit": "cz", @@ -36,8 +35,7 @@ "release:changelog": "conventional-changelog -p angular -i CHANGELOG.md -s", "release:check": "pnpm lint && pnpm build", "release:publish": "pnpm -r publish", - "release:version": "bumpp package.json plugins/*/package.json theme/package.json --execute=\"pnpm release:changelog\" --commit \"build: publish v%s\" --all --tag --push", - "up": "taze -r major" + "release:version": "bumpp package.json plugins/*/package.json theme/package.json --execute=\"pnpm release:changelog\" --commit \"build: publish v%s\" --all --tag --push" }, "devDependencies": { "@commitlint/cli": "^18.4.3", @@ -62,10 +60,10 @@ "lint-staged": "^15.2.0", "minimist": "^1.2.8", "ora": "^8.0.1", - "pnpm": "^8.12.1", + "pnpm": "^8.13.1", "rimraf": "^5.0.5", "sort-package-json": "^2.6.0", - "taze": "^0.13.0", + "taze": "^0.13.1", "tsconfig-vuepress": "^4.5.0", "typescript": "^5.3.3", "vite": "^5.0.10" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 92f7f03b..5e574b79 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -75,8 +75,8 @@ importers: specifier: ^8.0.1 version: 8.0.1 pnpm: - specifier: ^8.12.1 - version: 8.12.1 + specifier: ^8.13.1 + version: 8.13.1 rimraf: specifier: ^5.0.5 version: 5.0.5 @@ -84,8 +84,8 @@ importers: specifier: ^2.6.0 version: 2.6.0 taze: - specifier: ^0.13.0 - version: 0.13.0 + specifier: ^0.13.1 + version: 0.13.1 tsconfig-vuepress: specifier: ^4.5.0 version: 4.5.0 @@ -390,6 +390,9 @@ importers: theme: dependencies: + '@pengzhanbo/utils': + specifier: ^1.1.1 + version: 1.1.1 '@vuepress-plume/plugin-auto-frontmatter': specifier: workspace:* version: link:../plugins/plugin-auto-frontmatter @@ -460,8 +463,8 @@ importers: specifier: 2.0.0-rc.0 version: 2.0.0-rc.0 '@vueuse/core': - specifier: ^10.7.0 - version: 10.7.0(vue@3.3.13) + specifier: ^10.7.1 + version: 10.7.1(vue@3.3.13) date-fns: specifier: ^3.0.6 version: 3.0.6 @@ -3832,6 +3835,12 @@ packages: - vue-eslint-parser dev: true + /@pengzhanbo/utils@1.1.1: + resolution: {integrity: sha512-gY4nPqvkOpP7aCzrxVEurkOXe9VGT0OmUBpTj2TNU/Jycvxbs5u2IrUXMgAATauab/qMHS6/EpvAqneo7EYEsw==} + dependencies: + throttle-debounce: 5.0.0 + dev: false + /@pkgjs/parseargs@0.11.0: resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} @@ -4868,7 +4877,7 @@ packages: dependencies: '@vue/devtools-api': 6.5.1 '@vuepress/shared': 2.0.0-rc.0 - '@vueuse/core': 10.7.0(vue@3.3.13) + '@vueuse/core': 10.7.1(vue@3.3.13) vue: 3.3.13(typescript@5.3.3) vue-router: 4.2.5(vue@3.3.13) transitivePeerDependencies: @@ -4954,7 +4963,7 @@ packages: '@vuepress/core': 2.0.0-rc.0(typescript@5.3.3) '@vuepress/shared': 2.0.0-rc.0 '@vuepress/utils': 2.0.0-rc.0 - '@vueuse/core': 10.7.0(vue@3.3.13) + '@vueuse/core': 10.7.1(vue@3.3.13) ts-debounce: 4.0.0 vue: 3.3.13(typescript@5.3.3) vue-router: 4.2.5(vue@3.3.13) @@ -5106,24 +5115,24 @@ packages: - supports-color dev: false - /@vueuse/core@10.7.0(vue@3.3.13): - resolution: {integrity: sha512-4EUDESCHtwu44ZWK3Gc/hZUVhVo/ysvdtwocB5vcauSV4B7NiGY5972WnsojB3vRNdxvAt7kzJWE2h9h7C9d5w==} + /@vueuse/core@10.7.1(vue@3.3.13): + resolution: {integrity: sha512-74mWHlaesJSWGp1ihg76vAnfVq9NTv1YT0SYhAQ6zwFNdBkkP+CKKJmVOEHcdSnLXCXYiL5e7MaewblfiYLP7g==} dependencies: '@types/web-bluetooth': 0.0.20 - '@vueuse/metadata': 10.7.0 - '@vueuse/shared': 10.7.0(vue@3.3.13) + '@vueuse/metadata': 10.7.1 + '@vueuse/shared': 10.7.1(vue@3.3.13) vue-demi: 0.14.6(vue@3.3.13) transitivePeerDependencies: - '@vue/composition-api' - vue dev: false - /@vueuse/metadata@10.7.0: - resolution: {integrity: sha512-GlaH7tKP2iBCZ3bHNZ6b0cl9g0CJK8lttkBNUX156gWvNYhTKEtbweWLm9rxCPIiwzYcr/5xML6T8ZUEt+DkvA==} + /@vueuse/metadata@10.7.1: + resolution: {integrity: sha512-jX8MbX5UX067DYVsbtrmKn6eG6KMcXxLRLlurGkZku5ZYT3vxgBjui2zajvUZ18QLIjrgBkFRsu7CqTAg18QFw==} dev: false - /@vueuse/shared@10.7.0(vue@3.3.13): - resolution: {integrity: sha512-kc00uV6CiaTdc3i1CDC4a3lBxzaBE9AgYNtFN87B5OOscqeWElj/uza8qVDmk7/U8JbqoONLbtqiLJ5LGRuqlw==} + /@vueuse/shared@10.7.1(vue@3.3.13): + resolution: {integrity: sha512-v0jbRR31LSgRY/C5i5X279A/WQjD6/JsMzGa+eqt658oJ75IvQXAeONmwvEMrvJQKnRElq/frzBR7fhmWY5uLw==} dependencies: vue-demi: 0.14.6(vue@3.3.13) transitivePeerDependencies: @@ -6208,7 +6217,7 @@ packages: minipass-pipeline: 1.2.4 p-map: 4.0.0 ssri: 10.0.4 - tar: 6.1.13 + tar: 6.2.0 unique-filename: 3.0.0 dev: true @@ -12553,7 +12562,7 @@ packages: npmlog: 6.0.2 rimraf: 3.0.2 semver: 7.5.4 - tar: 6.1.13 + tar: 6.2.0 which: 2.0.2 transitivePeerDependencies: - bluebird @@ -13188,8 +13197,8 @@ packages: semver: 7.5.4 dev: false - /pacote@17.0.4: - resolution: {integrity: sha512-eGdLHrV/g5b5MtD5cTPyss+JxOlaOloSMG3UwPMAvL8ywaLJ6beONPF40K4KKl/UI6q5hTKCJq5rCu8tkF+7Dg==} + /pacote@17.0.5: + resolution: {integrity: sha512-TAE0m20zSDMnchPja9vtQjri19X3pZIyRpm2TJVeI+yU42leJBBDTRYhOcWFsPhaMxf+3iwQkFiKz16G9AEeeA==} engines: {node: ^16.14.0 || >=18.0.0} hasBin: true dependencies: @@ -13210,7 +13219,7 @@ packages: read-package-json-fast: 3.0.2 sigstore: 2.1.0 ssri: 10.0.4 - tar: 6.1.13 + tar: 6.2.0 transitivePeerDependencies: - bluebird - supports-color @@ -13467,8 +13476,8 @@ packages: engines: {node: '>=4'} dev: true - /pnpm@8.12.1: - resolution: {integrity: sha512-ZwXqGWattlhwU+bP5v3cN3+BBmIo2vc2xEkAEvRPL/G/DHE7uPMUX84OPvZpx8FfGaWawVeDiVHyNMF7gcplXQ==} + /pnpm@8.13.1: + resolution: {integrity: sha512-dYvrxpictkYsUTgSmEAZOxDCWN3NsKtD7g753Yd4S8IY1uQctb7qw2K4zjPx+LCAJbWZkzwLzoIFCpo2uEdNQw==} engines: {node: '>=16.14'} hasBin: true dev: true @@ -15431,18 +15440,6 @@ packages: streamx: 2.15.0 dev: false - /tar@6.1.13: - resolution: {integrity: sha512-jdIBIN6LTIe2jqzay/2vtYLlBHa3JF42ot3h1dW8Q0PaAG4v8rm0cvpVePtau5C6OKXGGcgO9q2AMNSWxiLqKw==} - engines: {node: '>=10'} - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 4.2.7 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - dev: true - /tar@6.2.0: resolution: {integrity: sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==} engines: {node: '>=10'} @@ -15454,8 +15451,8 @@ packages: mkdirp: 1.0.4 yallist: 4.0.0 - /taze@0.13.0: - resolution: {integrity: sha512-o17Y6miF+44sDJ7haRHTqZefTlGOaBSdDHRwRcrt+s3WeGSPBUtPSG18XNwToIXN//eh58hyYnyDwTnpYLp4sg==} + /taze@0.13.1: + resolution: {integrity: sha512-viIeTWEezE1mtQ9M9dtvIwfF7WkNRXVZP7g/NsGDFxwwzJIVJReSiZiyfsJccdJo6XUe7FaYzvrG1VD6Tnj4Jg==} hasBin: true dependencies: '@antfu/ni': 0.21.12 @@ -15464,7 +15461,7 @@ packages: deepmerge: 4.3.1 detect-indent: 7.0.1 execa: 8.0.1 - pacote: 17.0.4 + pacote: 17.0.5 picocolors: 1.0.0 prompts: 2.4.2 semver: 7.5.4 @@ -15589,6 +15586,11 @@ packages: long: 2.4.0 dev: false + /throttle-debounce@5.0.0: + resolution: {integrity: sha512-2iQTSgkkc1Zyk0MeVrt/3BvuOXYPl/R8Z0U2xxo9rjwNciaHDG3R+Lm6dh4EeUci49DanvBnuqI6jshoQQRGEg==} + engines: {node: '>=12.22'} + dev: false + /through2-filter@3.0.0: resolution: {integrity: sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==} dependencies: @@ -16511,7 +16513,7 @@ packages: '@vuepress/client': 2.0.0-rc.0(typescript@5.3.3) '@vuepress/shared': 2.0.0-rc.0 '@vuepress/utils': 2.0.0-rc.0 - '@vueuse/core': 10.7.0(vue@3.3.13) + '@vueuse/core': 10.7.1(vue@3.3.13) balloon-css: 1.2.0 js-yaml: 4.1.0 vue: 3.3.13(typescript@5.3.3) @@ -16645,7 +16647,7 @@ packages: '@vuepress/client': 2.0.0-rc.0(typescript@5.3.3) '@vuepress/shared': 2.0.0-rc.0 '@vuepress/utils': 2.0.0-rc.0 - '@vueuse/core': 10.7.0(vue@3.3.13) + '@vueuse/core': 10.7.1(vue@3.3.13) cheerio: 1.0.0-rc.12 dayjs: 1.11.10 execa: 8.0.1 diff --git a/scripts/autoInstall.js b/scripts/autoInstall.js deleted file mode 100644 index c0f678fb..00000000 --- a/scripts/autoInstall.js +++ /dev/null @@ -1,80 +0,0 @@ -import fs from 'node:fs' -import path from 'node:path' -import { fileURLToPath } from 'node:url' -import process from 'node:process' -import { execa } from 'execa' -import ora from 'ora' -import chalk from 'chalk' - -const _dirname - = typeof __dirname !== 'undefined' - ? __dirname - : path.dirname(fileURLToPath(import.meta.url)) - -const packages = [ - ...fs - .readdirSync(path.join(_dirname, '../packages')) - .filter(file => file !== '.DS_Store' && file !== 'tsconfig.build.json') - .map(dir => path.join('../packages', dir)), - '../docs', -] - -const dependencies = packages.map((dir) => { - const pkg = fs.readFileSync( - path.join(_dirname, dir, 'package.json'), - 'utf-8', - ) - const { dependencies, devDependencies } = JSON.parse(pkg) - return { - dirname: path.join(_dirname, dir), - dependencies: filterVuePress(Object.keys(dependencies || {})), - devDependencies: filterVuePress(Object.keys(devDependencies || {})), - } -}) - -function filterVuePress(dependencies) { - const vuepress = dependencies - .filter( - dependence => - dependence.startsWith('@vuepress/'), - ) - .map(dependence => `${dependence}@next`) - const includes = ['vue', 'vue-router'] - const vue = dependencies - .filter(dependence => includes.includes(dependence)) - .map(dependence => `${dependence}@latest`) - return [...vue, ...vuepress] -} - -const options = [] -dependencies.forEach(({ dirname, dependencies, devDependencies }) => { - if (dependencies.length) - options.push(['pnpm', ['add', ...dependencies], { cwd: dirname }]) - - if (devDependencies.length) - options.push(['pnpm', ['add', '-D', ...devDependencies], { cwd: dirname }]) -}) - -async function install(index = 0) { - if (index >= options.length) - return - const spinner = ora() - const opt = options[index] - const dir = opt[2].cwd.split('/').slice(-2).join('/') - console.log('Installing ', chalk.cyan(dir)) - console.log(chalk.gray(opt[0], opt[1].join(' '))) - console.log('\n') - const current = execa(opt[0], opt[1], opt[2]) - current?.stdout?.pipe(process.stdout) - try { - await current - spinner.succeed('Installed.') - await install(index + 1) - } - catch (e) { - spinner.fail('Install Fail.') - console.log(e) - } -} - -install() diff --git a/theme/package.json b/theme/package.json index c48593ce..b221a64c 100644 --- a/theme/package.json +++ b/theme/package.json @@ -43,6 +43,7 @@ "ts:watch": "tsc -b tsconfig.build.json --watch" }, "dependencies": { + "@pengzhanbo/utils": "^1.1.1", "@vuepress-plume/plugin-auto-frontmatter": "workspace:*", "@vuepress-plume/plugin-baidu-tongji": "workspace:*", "@vuepress-plume/plugin-blog-data": "workspace:*", @@ -66,7 +67,7 @@ "@vuepress/plugin-toc": "2.0.0-rc.0", "@vuepress/shared": "2.0.0-rc.0", "@vuepress/utils": "2.0.0-rc.0", - "@vueuse/core": "^10.7.0", + "@vueuse/core": "^10.7.1", "date-fns": "^3.0.6", "lodash.merge": "^4.6.2", "nanoid": "^5.0.4",