pnpm approve-builds

Підтвердження залежностей для запуску скриптів під час інсталяції.

Затверджені залежності додаються до map allowBuilds у файлі pnpm-workspace.yaml зі значенням true, тоді як незатверджені — зі значенням false. Ви також можете оновити ці налаштування вручну, якщо бажаєте.

Since v12.11.0, when pnpm-workspace.yaml already has a permissions setting, the decisions are written there as the build capability instead. To review agent skills as well, use pnpm approve.

Використання#

Ви можете запустити команду pnpm approve-builds без аргументів, щоб отримати інтерактивний інтерфейс, або вказати імена пакунків як позиційні аргументи:

pnpm approve-builds esbuild fsevents !core-js

Додайте перед назвою пакунка префікс !, щоб заборонити його. Це стосується лише зазначених пакунків; решта залишаються без змін. Approved packages that are awaiting approval are rebuilt right away. Naming a package both approved and denied fails with ERR_PNPM_APPROVE_BUILDS_CONTRADICTING_ARGS.

Since v12.4.0, a decision is saved even when nothing is awaiting approval, so a policy can be written before the package is installed. A named package that is not awaiting approval is reported with a warning rather than an error, and is not rebuilt: it may not be installed yet, and rebuilding it would need a lockfile the project may not have. An argument that names no package at all is rejected before anything is written.

During install, packages with ignored builds that are not yet listed in allowBuilds are automatically added to pnpm-workspace.yaml with the placeholder value set this to true or false, so you can manually set them to true or false.

Writing allowBuilds also removes the ignored legacy settings onlyBuiltDependencies, onlyBuiltDependenciesFile, neverBuiltDependencies, and ignoredBuiltDependencies from pnpm-workspace.yaml.

Параметри#

--all#

Затвердити всі збірки, що очікують на розгляд, без запитів на підтвердження. Cannot be combined with package names (ERR_PNPM_APPROVE_BUILDS_ALL_WITH_ARGS).

--global, -g#

Approve builds for globally installed packages.

pnpm gathers the packages awaiting approval across every isolated install group, asks about them once, and writes a single policy into the pnpm-workspace.yaml of the global packages directory. Only the groups that actually contain an approved package are then rebuilt.