Overview of @microsoft/esrp-npm-release
mainThe @microsoft/esrp-npm-release tool is a CLI designed for Microsoft teams to release npm packages to ESRP in dependency-topological order. This ensures that a package's internal dependencies are published before the package itself, preventing dangling references and installation failures in consuming repositories.
How it works
The tool is a bundled CLI (dist/index.mjs) intended to be run during a release job. It does not calculate dependency order itself; instead, it expects a directory of "packed packages" organized into numbered dependency layers. For each layer, the tool:
- Zips the layer's package tarballs.
- Uploads the zip to a temporary "staging" Azure Blob Storage account.
- Calls the ESRP release API to publish the layer and waits for completion.
- Deletes the staged zip (with an automated lifecycle policy fallback).
When to use this tool
- Use it when: You have a large monorepo or many packages where publishing order is critical to prevent broken dependencies.
- Do NOT use it when: You are managing single packages or small monorepos where the official
EsrpReleasetask is simpler, or if you prefer manual grouping.