NPM Package Mockup
Generating build artefacts and publishing them to a registry are different operations with different risk profiles - publishing is effectively irreversible. This page keeps them visually and functionally separate at every step.
State machine
Failed is reachable from Building or Publishing, never skipped past. The install command is shown only in the Published state - offering npm install for an unbuilt or unpublished package produces a failed command and an immediate loss of trust.
Configuration example
Example only: scope availability has not been checked
→ @company/design-system
Example only: package availability has not been checked
Illustration only. No credentials are collected or stored by this page.
Package contents
- Name validation - lowercase, no leading dot or underscore, no spaces, URL-safe, ≤ 214 characters, not a reserved or typo-squat name. Checked against the registry before Save is enabled.
- Never hard-code a company or package name - derive it from project configuration and allow override.
Published state example
@company/design-system Published
Example command only (package not verified): npm install @company/design-system
Version drift example
⚠ Package is 2 versions behind
Design system 3.4.0 · Package 3.2.0
Unpublished changes: 8 components, 14 tokens, 1 breaking change
Removing token color.primary.hover is a breaking change: the next compatible version number must be 4.0.0, rather than 3.4.0.
Version drift is shown plainly, never hidden - package and system versions drift, and hiding that produces the worst class of bug.
Publish safety
- Dry run first - the exact file manifest, size, and semver bump are shown before any publish, with a diff of what changed since the last published version.
- Breaking-change gate - a removed or renamed token forces a major bump and requires typed confirmation of the version number.
- Permission gate - only Owner and DS Admin may publish.
- Audit - every build and publish writes to the History Activity log with actor, version, and outcome.
- Failure handling - the registry's actual error is surfaced (401 auth, 403 scope, 409 version exists, network) with a specific remedy, never a generic "failed".
✗ Couldn't publish to npmjs.com
Version 3.2.0 already exists on the registry. npm does not allow republishing an existing version. Publish as 3.2.1, or change the version.