Diff Delta:
37
About 143 Diff Delta/hour
Classified as:
Feature Add, General
Tayvon's Description of Work
Summary
Adds a read-write-stage-only value to the packages-and-scopes-permission option for npm token create, letting the CLI create granular access tokens with a stage-only publish policy (parity with the web UI). Also adds a deprecation warning when creating a direct-publish-capable token, steering users toward the stage-only value.
Changes
- Add
read-write-stage-onlyto thepackages-and-scopes-permissionconfig enum and update its description.orgs-permissionis intentionally left unchanged (the registry only acceptsread-write-stage-onlyfor packages/scopes). -
token createalready forwardspackages_and_scopes_permissionverbatim in the POST body, so the value flows straight to the registry create-token route, which normalizes it topublish_policy: stage_onlyβ identical to the web UI. - Add a
log.warnwhen creating a token withread-writepackage/scope permission (direct-publish-capable), pointing users to--packages-and-scopes-permission=read-write-stage-only. Stage-only, read-only, and no-access tokens do not warn;--bypass-2fais orthogonal and does not by itself trigger the warning. - Tests: creating a stage-only token asserts the POST body carries the value and emits no warning; read-write (with and without
--bypass-2fa) emits the warning;--bypass-2faalone does not. - Regenerate affected tap snapshots (
docs.js,workspaces/configtype-description.js).
Building updated commit group diff...
5 total changed files
(2 files ignored)
Loading changes...
Loading changes...
Loading changes...