Title: Managing Packages
Published: March 10, 2021
Last modified: November 5, 2026

---

# Managing Packages

## In this article

 * [Internal workspaces (tools and tests)](https://developer.wordpress.org/block-editor/contributors/code/managing-packages/?output_format=md#internal-workspaces-tools-and-tests)
 * [Supply chain policy](https://developer.wordpress.org/block-editor/contributors/code/managing-packages/?output_format=md#supply-chain-policy)

This repository uses [npm workspaces](https://docs.npmjs.com/cli/v10/using-npm/workspaces)
to manage WordPress packages and [lerna](https://lerna.js.org/) to publish them 
to [npm](https://www.npmjs.com/). This enforces certain steps in the workflow which
are described in details in [packages](https://github.com/WordPress/gutenberg/blob/HEAD/packages/README.md)
documentation.

Add a short entry to the package’s `CHANGELOG.md` for changes that affect consumers.
Follow [Maintaining Changelogs](https://developer.wordpress.org/block-editor/reference-guide/packages/packages-/#maintaining-changelogs)
for scope and formatting.

Publishing WordPress packages to npm is automated by synchronizing it with the bi-
weekly Gutenberg plugin RC1 release. You can learn more about this process and other
ways to publish new versions of npm packages in the [Gutenberg Release Process document](https://developer.wordpress.org/block-editor/contributors/code/release/#publication-of-packages).

## 󠀁[Internal workspaces (tools and tests)](https://developer.wordpress.org/block-editor/contributors/code/managing-packages/?output_format=md#internal-workspaces-tools-and-tests)󠁿

The repository also contains internal workspaces under `tools/` and `test/` for 
development tooling and test infrastructure. When you need to add a new tool, script,
or dependency for repo-level work, create a workspace under `tools/` (or add to 
an existing one) instead of adding dependencies to the root `package.json`. See 
the [Workspace Development guide](https://developer.wordpress.org/block-editor/contributors/code/workspace-development/)
for the conversion pattern, CI conventions, and reference examples.

## 󠀁[Supply chain policy](https://developer.wordpress.org/block-editor/contributors/code/managing-packages/?output_format=md#supply-chain-policy)󠁿

`.npmrc` opts in to the npm v12 defaults that refuse git references (`EALLOWGIT`)
and tarball URLs (`EALLOWREMOTE`), and extends that to local tarball files (`EALLOWFILE`).
Local directories stay at the npm default, which gates nothing here: the `file:`
links between workspaces resolve as workspaces rather than directory dependencies.

Install scripts are opt-in: every dependency that ships one is recorded in `allowScripts`
in the root `package.json`, and `strict-allow-scripts` fails the install with `ESTRICTALLOWSCRIPTS`
on anything missing from that list. Every entry is `false`, so nothing compiles 
on install. `test/ai-development` installs with `--prefix`, so it carries its own
copy of the policy.

`allowScripts` covers dependencies only, so workspace lifecycle scripts such as 
the `@wordpress/icons` `prepare` still run. npm v12 skips them under `install-strategy
=linked` with no error ([npm/cli#9982](https://github.com/npm/cli/issues/9982)),
so moving to npm v12 means invoking them from the root `postinstall` instead.

When an install fails that way, read the script, then edit `allowScripts` by hand
and commit the `package.json` change. Use the package name on its own to cover every
version, or `name@version` to pin an approval to the version you reviewed:

    ```language-json
    "allowScripts": {
        "some-package": false,
        "another-package@1.2.3": true
    }
    ```

Do not use the `npm install-scripts` subcommands until an npm release ships [npm/cli#9941](https://github.com/npm/cli/pull/9941).
All of them read the hoisted layout, so under `install-strategy=linked` they misbehave:`
ls` reports covered packages as uncovered, `prune` deletes every entry as unused,
and `approve` and `deny` write unusable `node_modules/.store` paths instead of the
package name.

First published

March 10, 2021

Last updated

November 5, 2026

Edit article

[ Improve it on GitHub: Managing Packages ](https://github.com/WordPress/gutenberg/edit/trunk/docs/contributors/code/managing-packages.md)

[  Previous: Scripts](https://developer.wordpress.org/block-editor/contributors/code/scripts/)

[  Next: Testing published packages across WordPress versions](https://developer.wordpress.org/block-editor/contributors/code/package-runtime-compatibility/)