Skip to content
PolyPack
Docs: npm

npm

Install and publish private npm Packs, and manage their versions.

PolyPack hosts scoped npm packages. Your Team publishes under the scopes an Admin sets in Team settings; Hopper Digital's is @hopper. These are the lines for @hopper/ui.

Install

Point the scope at PolyPack · in the project's .npmrc, safe to commit
@hopper:registry=https://hopper.pkg.polypack.io/npm/
Store your Token · once per machine; it goes in your own ~/.npmrc, never the project
npm config set //hopper.pkg.polypack.io/npm/:_authToken <your Token>
Install
npm install @hopper/ui

The scope line goes in the project's .npmrc and is safe to commit. The Token goes in your own ~/.npmrc, which the second command writes. npm whoami then prints who the Token belongs to.

Publish

Publish a new version · from the package directory, with the Install setup above; the Token needs publish
npm publish
npm publish --tag next
npm dist-tag add @hopper/ui@<version> latest

Publishing needs a Token with the publish ability: your own Member Token, or a Team Token in CI. The first publish of a new name creates the Pack, as a private Pack. A version number can only be published once.

Publish from GitHub Actions

A GitHub Actions workflow can publish with no PolyPack Token stored in GitHub: an Admin adds a trusted publisher to the Pack, and the workflow uses PolyPack's GitHub Action, then a plain npm publish. See Trusted publishing.

Signatures

Every version PolyPack serves is signed, so npm audit signatures verifies it. Versions published through trusted publishing also carry signed provenance. See Signatures and provenance.

Dist-tags

npm dist-tag add, rm and ls work as on npmjs.com. latest cannot be removed.

Deprecate and unpublish

  • npm deprecate @hopper/ui@1.0.0 "Use 2.x" sets a message npm shows on install; an empty message clears it. Admins can also do this in PolyPack.
  • When a Version line your Team supports reaches its end of life, npm shows a deprecation warning for its versions, such as "@hopper/ui 1.x reached end of life on 30 Jun 2027. Upgrade to 2.x.", unless a version has a message of its own. Installs keep working.
  • npm unpublish @hopper/ui@1.0.0 works within 72 hours of publishing. After that, deprecate it, or ask a Team Admin, who can unpublish from PolyPack at any time.
  • A Pack's last version, and a whole Pack, cannot be unpublished through npm. An Admin can delete a Pack in PolyPack.
  • An unpublished version number is retired for good: publishing it again is refused, so no lockfile can ever get different code under the same number.