Learn Package Publishing, Checklist by Checklist
AmericaModule exists for one moment in a developer's life: the point where some code stops being yours and becomes something other people install. That moment hides a surprising number of decisions. What is the public API? What does the version number promise? Which files actually end up in the tarball? Who can press publish, and what happens if their account is compromised? Over time this site has answered those questions in a few hundred short pages. This hub sorts them into six clusters so that you can read in a sensible order instead of by search result.
Each cluster corresponds to one part of the pre-publish checklist. Read them in order before a first release, or jump straight to the one that matches the question in front of you. The examples lean on npm and PyPI because they are the most common, but most of the reasoning carries over to Go modules, Rust crates and internal registries.
A word on scope. The site does not rank registries, sell tooling or count downloads, and it avoids framework loyalties. Where ecosystems differ, the pages say so plainly and show the relevant configuration, so you can apply the same reasoning to whatever toolchain your team already uses.
Two new long reads for this hub
Most of the site is about getting ready to publish. These two guides cover what comes after: the checks worth doing in the first hour after a release goes live, and how to write a support policy so that users know which versions and runtimes you will keep fixing.
- The first hour after publishing: post-release checks that catch real problems
- Writing a support policy for versions, runtimes and security fixes
Cluster 1: Metadata, files and the first release
Before anything else, the package has to describe itself correctly and contain the right files. These pages cover the fields that registries and tools read, how to check what will be uploaded, and the order in which a first release usually comes together.
- A reading path for your first package release
- The npm pre-publish checklist, with a reason for each item
- The PyPI release checklist from pyproject.toml to upload
- The pyproject.toml fields worth filling in before every release
- How to test your package tarball before publishing
- Diagnosing files missing from a published package
Cluster 2: Versioning and change
A version number is a promise about compatibility. These pages explain what semantic versioning actually commits you to, how 0.x differs, and how to retire or change behaviour without surprising anyone who depends on you.
- Semantic versioning explained for package authors
- What 0.x versions actually promise under semver
- A stability checklist for leaving 0.x
- Ten ways breaking changes sneak into minor releases
- Remove, deprecate or alias: three ways to retire an API
- How to write a changelog entry users can act on
Cluster 3: API surface and module formats
Everything a user can import, call or catch is part of your public API, including error types and type definitions. This cluster deals with designing that surface deliberately and with the practical headaches of module formats and entry points.
- Designing function signatures you will not regret
- Errors are part of your library's public API
- Snapshotting your public API so changes are never accidental
- How to configure the package.json exports field
- Shipping a dual ESM and CommonJS package
Cluster 4: Dependencies
Every dependency you declare becomes a dependency of everyone who installs you. These pages cover how to choose ranges, when peer dependencies are appropriate, and how to evaluate a package before adding it to your own.
- How to evaluate a dependency before adding it
- Caret, tilde or exact: dependency ranges for libraries
- Peer dependencies explained, without the folklore
- Dependency ranges in libraries: do and don't
- Fixing an ERESOLVE peer dependency conflict
Cluster 5: Security and the supply chain
Package registries are an attractive target, and publishing is the point where a compromised account or a malicious install script does the most damage. This cluster covers account security, tokenless publishing from CI, provenance and how to handle a vulnerability report.
- Maintainer account security habits that protect users
- How to set up PyPI trusted publishing from CI
- Inside package provenance attestations
- npm install scripts: risks for authors and users
- Reporting a package vulnerability privately
Cluster 6: Licensing and long-term maintenance
A package outlives the enthusiasm that created it. These pages deal with choosing and declaring a licence, writing a deprecation policy, and handing over or archiving a project responsibly when the time comes.
- Permissive and copyleft licences, a plain guide
- How to declare an SPDX licence identifier
- The long read on writing a deprecation policy
- Maintaining a package for years
- Questions about archiving an unmaintained package
A suggested order
For a first release, read cluster 1 completely, the semver guide from cluster 2, and the account security page from cluster 5. That is enough to publish something you will not have to apologise for. Come back to clusters 3 and 4 before your first minor release with new features, and to cluster 6 when the package has users you have never met. Throughout, keep a written release checklist in the repository. The best checklist is the one you have edited after every release that surprised you.
Questions authors search for before a release
Some pre-publish questions only come up once a package is nearly ready: how to rehearse the upload, how to ship code that has to be compiled, and what to do when the name on your README turns out to belong to someone else. Each of these guides answers one of them directly, then gives a checklist.
- How to use TestPyPI for a dry-run release before the real PyPI upload
- How to ship prebuilt native binaries in an npm package
- The package name you want is already taken: scopes, owners and new names
How these guides are checked is set out in our editorial standards.