pnpm 12.0 稳定版已正式发布,该版本使用 Rust 语言对 pnpm 进行了重写 1。新版本保持了与 pnpm 11 在命令、标志、设置以及 lockfile 格式上的兼容性 1。在包含大量循环依赖的大型工作区中,peer 依赖解析速度提升了 2 到 3 倍,同时内存占用降低了约 25% 1。此外,在 Linux 系统环境下,packageImportMethod: auto 配置将优先采用硬链接方式 1。
此次更新引入了多项破坏性变更和新功能,包括 Git 依赖身份解析、循环依赖图 lockfile 规范化、项目感知全局 bins、注册表修订版本以及批量审批暂存发布等 1。pnpm 12 现在支持提供 npm、Yarn Classic、Yarn Berry、Yarn 6 (yarnpkg/zpm) 和 Bun 等其他包管理器 1。在默认行为与权限控制方面,pnpm init 命令现在会固定使用最新发布的 pnpm 版本,而非执行该命令时的版本 1。全局命令拒绝在 sudo 权限下运行,并会报错 ERR_PNPM_SUDO_NOT_SUPPORTED 1。同时,filterLog pnpmfile 钩子已被弃用 1。用户可通过执行 pnpm self-update next-12 命令,从 next-12 标签安装该版本 1。
The stable version of pnpm 12.0 has been officially released, featuring a complete rewrite of the package manager in Rust 1. Despite this major architectural shift, the new version maintains full compatibility with pnpm 11, carrying over its commands, flags, settings, and lockfile format 1. Users can install the new release from the next-12 tag by running the command pnpm self-update next-12 1.
This release introduces significant performance improvements, particularly for large workspaces with heavy cyclic dependencies, where peer resolution is now two to three times faster and uses about 25% less memory 1. Additionally, the packageImportMethod: auto setting now hardlinks first on Linux systems 1. Beyond performance, pnpm 12.0 expands its ecosystem support by provisioning npm, Yarn Classic, Yarn Berry, Yarn 6 (yarnpkg/zpm), and Bun 1. The update also brings several new features and breaking changes, including Git dependency identity resolution, lockfile normalization for cyclic dependency graphs, project-aware global bins, registry revisions, and batch approval for staged publishing 1.
Global commands now refuse to run under sudo, failing with the ERR_PNPM_SUDO_NOT_SUPPORTED error 1. The pnpm init command has been updated to pin the latest released pnpm rather than the version that ran the command 1. Furthermore, the filterLog pnpmfile hook is deprecated 1.
评论
还没有评论,欢迎留下第一条。