Package Publishing Glossary

Short, practical definitions for the vocabulary you run into when you ship a reusable library. Each entry says what the term means and why an author should care. Where a longer article exists on this site, the entry links to it.

Versions and ranges

Semantic versioning (semver)
A numbering scheme, specified at semver.org, of the form MAJOR.MINOR.PATCH. Incompatible API changes bump major, backwards-compatible additions bump minor, compatible fixes bump patch. Longer treatment: semver for package authors.
Pre-release identifier
A hyphenated suffix such as 2.0.0-rc.1. It sorts before the plain release and most range syntaxes skip it unless asked for explicitly.
Build metadata
A plus-sign suffix such as 1.4.0+sha.5114f85. The semver spec says it is ignored when comparing precedence.
Caret and tilde ranges
npm range shorthands. ^1.4.0 accepts any 1.x at or above 1.4.0; ~1.4.0 accepts only 1.4.x. See reading npm semver ranges.
PEP 440
The Python specification for version strings and specifiers, which differs from semver in places (for example 1.0rc1, ~= and post-releases).
Yank
Marking a published release so resolvers avoid it by default while keeping it downloadable for anyone pinned to it exactly. PyPI and crates.io support yanking; Go has a similar retract directive.

Dependencies

Peer dependency
A package your library expects the host project to provide, such as a framework a plugin extends. Declared in peerDependencies so that only one copy is installed. Explained in peer dependencies without the folklore.
devDependency
Needed to build or test the package, not to use it. Consumers do not install these.
Optional dependency / extra
npm's optionalDependencies may fail to install without failing the whole install; Python "extras" declared under [project.optional-dependencies] are opt-in groups such as pkg[cli].
Lockfile
A file recording the exact resolved versions of a dependency tree (package-lock.json, poetry.lock, Cargo.lock). Libraries' lockfiles are not used by their consumers; see should libraries commit lockfiles.
Transitive dependency
A dependency of one of your dependencies. You do not choose it directly, but its bugs and licence still reach your users.

Modules, builds and artefacts

ESM and CJS
ECMAScript modules (import/export) and CommonJS (require/module.exports), the two JavaScript module systems Node.js supports. Shipping both is covered in the dual package tutorial.
Dual package hazard
The risk that a consumer loads both the ESM and CJS copies of one library, producing two separate instances of its state.
Conditional exports
The exports field in package.json mapping entry points to files per condition such as import, require or types. How-to: configuring exports.
Tree-shaking
A bundler removing code a consumer never imports. The sideEffects flag tells bundlers which files are safe to drop.
Type declarations
.d.ts files describing a JavaScript package's types for TypeScript users.
sdist and wheel
Python's source distribution archive and its pre-built, installable archive. Wheels can be pure Python or platform specific.
Tarball
The .tgz file npm actually uploads. Check its contents with npm pack --dry-run, as shown in testing the tarball.

Licences and supply chain

SPDX identifier
A standard short name for a licence, such as MIT or Apache-2.0, from the SPDX License List. Expressions like MIT OR Apache-2.0 combine them.
Copyleft
Licences such as the GPL family that require derived works to be shared under the same terms. Compared with permissive licences in this guide.
Provenance
Verifiable information about where and how a package artefact was built, usually a signed statement linking it to a source commit and CI run. npm and PyPI both support forms of it.
Trusted Publishing
Publishing from CI using short-lived OpenID Connect credentials instead of a long-lived API token.
SLSA
Supply-chain Levels for Software Artifacts, a framework of build-integrity requirements published under the OpenSSF.
Sigstore
An open project providing signing and transparency-log infrastructure used by several registries.
SBOM
A software bill of materials: a machine-readable inventory of the components in a piece of software, commonly in SPDX or CycloneDX format.
Typosquatting
Registering a package name one keystroke away from a popular one in the hope of being installed by mistake.

Related pages