From f2b3b1255389e69313463bee69c15e0d871132a7 Mon Sep 17 00:00:00 2001 From: xingyu Date: Fri, 22 May 2026 12:02:14 +0800 Subject: [PATCH] chore: pnpm v11 (#7942) * chore: remove rolldown dep * fix: issues-helper and maintain-one-comment are temporarily disabled due to security issues * chore: update deps * fix: change error type to TypeError for non-browser environment check in LocalStorageDriver * chore: update pnpm v11 --- .github/workflows/issue-labeled.yml | 6 +- .gitignore | 1 + docs/src/en/guide/introduction/quick-start.md | 2 +- docs/src/guide/introduction/quick-start.md | 2 +- .../eslint-config/src/configs/yaml.ts | 8 +- internal/vite-config/package.json | 1 - internal/vite-config/src/plugins/license.ts | 14 +- package.json | 11 +- .../shared/src/cache/local-storage-driver.ts | 3 +- .../preferences/preferences-button.vue | 12 +- pnpm-lock.yaml | 1099 +++++++---------- pnpm-workspace.yaml | 40 +- 12 files changed, 508 insertions(+), 691 deletions(-) diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml index 2feda4ef7..7a461e3b6 100644 --- a/.github/workflows/issue-labeled.yml +++ b/.github/workflows/issue-labeled.yml @@ -18,7 +18,7 @@ jobs: steps: - name: remove enhancement pending if: github.event.label.name == 'enhancement' - uses: actions-cool/issues-helper@v3 + uses: actions-cool/issues-helper-backup@d65454423c6fbbd20026b9b499d403f79422ac69 with: actions: 'remove-labels' token: ${{ secrets.GITHUB_TOKEN }} @@ -27,7 +27,7 @@ jobs: - name: remove bug pending if: github.event.label.name == 'bug' - uses: actions-cool/issues-helper@v3 + uses: actions-cool/issues-helper-backup@d65454423c6fbbd20026b9b499d403f79422ac69 with: actions: 'remove-labels' token: ${{ secrets.GITHUB_TOKEN }} @@ -36,7 +36,7 @@ jobs: - name: needs reproduction if: github.event.label.name == 'needs reproduction' - uses: actions-cool/issues-helper@v3 + uses: actions-cool/issues-helper-backup@d65454423c6fbbd20026b9b499d403f79422ac69 with: actions: 'create-comment, remove-labels' token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 9375b2c8f..20fba96c3 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ package-lock.json .VSCodeCounter **/backend-mock/data .omx +.pnpm-store # local env files .env.local .env.*.local diff --git a/docs/src/en/guide/introduction/quick-start.md b/docs/src/en/guide/introduction/quick-start.md index 12793c601..1dbfe2a7a 100644 --- a/docs/src/en/guide/introduction/quick-start.md +++ b/docs/src/en/guide/introduction/quick-start.md @@ -10,7 +10,7 @@ outline: deep Before starting the project, ensure that your environment meets the following requirements: -- [Node.js](https://nodejs.org/en) version 20.15.0 or above. It is recommended to use [fnm](https://github.com/Schniz/fnm), [nvm](https://github.com/nvm-sh/nvm), or directly use [pnpm](https://pnpm.io/cli/env) for version management. +- [Node.js](https://nodejs.org/en) version 22.18.0 or above. It is recommended to use [fnm](https://github.com/Schniz/fnm), [nvm](https://github.com/nvm-sh/nvm), or directly use [pnpm](https://pnpm.io/cli/env) for version management. - [Git](https://git-scm.com/) any version. To verify if your environment meets the above requirements, you can check the versions using the following commands: diff --git a/docs/src/guide/introduction/quick-start.md b/docs/src/guide/introduction/quick-start.md index f940672de..34131cc55 100644 --- a/docs/src/guide/introduction/quick-start.md +++ b/docs/src/guide/introduction/quick-start.md @@ -10,7 +10,7 @@ outline: deep 在启动项目前,你需要确保你的环境满足以下要求: -- [Node.js](https://nodejs.org/en) 20.15.0 及以上版本,推荐使用 [fnm](https://github.com/Schniz/fnm) 、 [nvm](https://github.com/nvm-sh/nvm) 或者直接使用[pnpm](https://pnpm.io/cli/env) 进行版本管理。 +- [Node.js](https://nodejs.org/en) 22.18.0 及以上版本,推荐使用 [fnm](https://github.com/Schniz/fnm) 、 [nvm](https://github.com/nvm-sh/nvm) 或者直接使用[pnpm](https://pnpm.io/cli/env) 进行版本管理。 - [Git](https://git-scm.com/) 任意版本。 验证你的环境是否满足以上要求,你可以通过以下命令查看版本: diff --git a/internal/lint-configs/eslint-config/src/configs/yaml.ts b/internal/lint-configs/eslint-config/src/configs/yaml.ts index 889371955..920f2149a 100644 --- a/internal/lint-configs/eslint-config/src/configs/yaml.ts +++ b/internal/lint-configs/eslint-config/src/configs/yaml.ts @@ -56,6 +56,11 @@ export async function yaml(): Promise { { order: [ 'packages', + 'publicHoistPattern', + 'strictPeerDependencies', + 'autoInstallPeers', + 'dedupePeerDependents', + 'verifyDepsBeforeRun', 'overrides', 'patchedDependencies', 'hoistPattern', @@ -63,6 +68,7 @@ export async function yaml(): Promise { 'catalogs', 'allowedDeprecatedVersions', + 'allowBuilds', 'allowNonAppliedPatches', 'configDependencies', 'ignoredBuiltDependencies', @@ -78,7 +84,7 @@ export async function yaml(): Promise { }, { order: { type: 'asc' }, - pathPattern: '.*', + pathPattern: '^.+$', }, ], }, diff --git a/internal/vite-config/package.json b/internal/vite-config/package.json index a3c48e8e8..b2abcad7a 100644 --- a/internal/vite-config/package.json +++ b/internal/vite-config/package.json @@ -48,7 +48,6 @@ "@vitejs/plugin-vue-jsx": "catalog:", "dayjs": "catalog:", "dotenv": "catalog:", - "rolldown": "catalog:", "rollup-plugin-visualizer": "catalog:", "sass": "catalog:", "sass-embedded": "catalog:", diff --git a/internal/vite-config/src/plugins/license.ts b/internal/vite-config/src/plugins/license.ts index f87a05b18..7733288b5 100644 --- a/internal/vite-config/src/plugins/license.ts +++ b/internal/vite-config/src/plugins/license.ts @@ -1,8 +1,3 @@ -import type { - NormalizedOutputOptions, - OutputBundle, - OutputChunk, -} from 'rolldown'; import type { PluginOption } from 'vite'; import { EOL } from 'node:os'; @@ -13,7 +8,6 @@ import { dateUtil, readPackageJSON } from '@vben/node-utils'; * 用于注入版权信息 * @returns */ - async function viteLicensePlugin( root = process.cwd(), ): Promise { @@ -27,7 +21,7 @@ async function viteLicensePlugin( apply: 'build', enforce: 'post', generateBundle: { - handler: (_options: NormalizedOutputOptions, bundle: OutputBundle) => { + handler(_options, bundle) { const date = dateUtil().format('YYYY-MM-DD '); const copyrightText = `/*! * Vben Admin @@ -44,13 +38,11 @@ async function viteLicensePlugin( for (const [, fileContent] of Object.entries(bundle)) { if (fileContent.type === 'chunk' && fileContent.isEntry) { - const chunkContent = fileContent as OutputChunk; // 插入版权信息 - const content = chunkContent.code; + const content = fileContent.code; const updatedContent = `${copyrightText}${EOL}${content}`; - // 更新bundle - (fileContent as OutputChunk).code = updatedContent; + fileContent.code = updatedContent; } } }, diff --git a/package.json b/package.json index 9a86d09fc..29916365d 100644 --- a/package.json +++ b/package.json @@ -53,17 +53,17 @@ "dev:play": "pnpm -F @vben/playground run dev", "format": "vsh lint --format", "lint": "vsh lint", - "postinstall": "pnpm -r run stub --if-present", + "postinstall": "pnpm -r run --if-present stub", "preinstall": "npx only-allow pnpm", "prepare": "is-ci || pnpm exec lefthook install", "preview": "turbo-run preview", "publint": "vsh publint", - "reinstall": "pnpm clean --del-lock && pnpm install", + "reinstall": "pnpm run clean -- --del-lock && pnpm install", "test:unit": "vitest run --dom", "test:e2e": "turbo run test:e2e", "update:deps": "npx taze -r -w", "version": "pnpm exec changeset version && pnpm install --no-frozen-lockfile", - "catalog": "pnpx codemod pnpm/catalog" + "catalog": "pnpm dlx codemod pnpm/catalog" }, "devDependencies": { "@changesets/changelog-github": "catalog:", @@ -84,6 +84,7 @@ "@vitejs/plugin-vue-jsx": "catalog:", "cross-env": "catalog:", "cspell": "catalog:", + "eslint": "catalog:", "happy-dom": "catalog:", "is-ci": "catalog:", "lefthook": "catalog:", @@ -103,7 +104,7 @@ }, "engines": { "node": "^22.18.0 || ^24.0.0", - "pnpm": ">=10.0.0" + "pnpm": ">=11.0.0" }, - "packageManager": "pnpm@10.33.4" + "packageManager": "pnpm@11.2.2" } diff --git a/packages/@core/base/shared/src/cache/local-storage-driver.ts b/packages/@core/base/shared/src/cache/local-storage-driver.ts index 041068f67..c1d04d6d7 100644 --- a/packages/@core/base/shared/src/cache/local-storage-driver.ts +++ b/packages/@core/base/shared/src/cache/local-storage-driver.ts @@ -18,8 +18,7 @@ class LocalStorageDriver implements IStorageDriver { storageType = 'localStorage', }: LocalStorageDriverOptions = {}) { if (typeof window === 'undefined') { - // eslint-disable-next-line unicorn/prefer-type-error -- not a type check, it's an environment check - throw new Error( + throw new TypeError( 'LocalStorageDriver is not available in non-browser environments. Use MemoryStorageDriver instead.', ); } diff --git a/packages/effects/layouts/src/widgets/preferences/preferences-button.vue b/packages/effects/layouts/src/widgets/preferences/preferences-button.vue index 451c936e8..d3703b84f 100644 --- a/packages/effects/layouts/src/widgets/preferences/preferences-button.vue +++ b/packages/effects/layouts/src/widgets/preferences/preferences-button.vue @@ -14,11 +14,17 @@ function clearPreferencesAndLogout() { } const preferencesRef = ref | null>(null); - +