The team command communicates with the registry through the standard npm team API endpoints. The scope:team format is parsed to separate the organization scope from the team name. For mutation subcommands (create, destroy, add, rm) the registry URL is resolved per scope from the registries map with an optional --registry override, the auth header is resolved from the configured credentials honoring scoped credentials, and the request is sent with retry support and bounded response reads. When an OTP is in play, the Rust side restricts redirects to the configured registry origins so the npm-otp header cannot leak to another host; the TypeScript fetch layer already strips it on cross-host redirects. The ls subcommand dispatches to listing teams within an org when given @scope and to listing members of a specific team when given @scope:team. Output supports three modes, the default human-readable listing, --parseable which emits newline-delimited names, and --json which emits structured arrays.
On the TypeScript side the command is registered in pnpm/src/cmd/index.ts and removed from the notImplemented list. On the Rust side it is added as a CliCommand variant, routed in dispatch, and dispatched in dispatch_query. Both sides include comprehensive tests covering all subcommands, error paths for 401 403 404 and 409 responses, empty results, and the three output formats.
pnpr serves the npm team API from each hosted registry's config-declared teams: GET /-/org/{scope}/team and GET /-/team/{scope}/{team}/user list teams and members, gated by the registry-level access with denials masked as not-found, while team mutations answer an explicit 403 since pnpr teams are config-managed.
@pnpm/cli.parse-cli-args no longer stops option parsing at an escape word (create, exec, test) that appears as another command's parameter, which previously made pnpm team create drop a trailing --registry option.
---------
Co-authored-by: Zoltan Kochan <z@kochan.io>
85 lines
1.7 KiB
Plaintext
85 lines
1.7 KiB
Plaintext
# Logs
|
|
logs
|
|
*.log
|
|
npm-debug.log*
|
|
|
|
# Dependency directory
|
|
**/node_modules/**
|
|
_node_modules
|
|
.pnp.cjs
|
|
|
|
# Coverage directory used by tools like istanbul
|
|
coverage
|
|
|
|
.tmp
|
|
_docpress
|
|
.DS_Store
|
|
|
|
lib
|
|
dist
|
|
tsconfig.tsbuildinfo
|
|
tsconfig.lint.tsbuildinfo
|
|
test.lib/
|
|
|
|
# Generated by `pnpm --filter pnpm run compile` (tsgo typecheck).
|
|
# The root `/pnpm/` entry that used to sit here (build detritus in the
|
|
# pre-pnpm11 package location) is gone: `pnpm/` is the Rust source tree
|
|
# now, so it must not be ignored. Delete any stale generated `pnpm/`
|
|
# dir left over from before the pnpm11 relocation.
|
|
__typecheck__/
|
|
|
|
# Visual Studio Code configs
|
|
.vscode/
|
|
|
|
# JetBrains IDEs
|
|
.idea/
|
|
|
|
# pnpm uses npm for publishing a new version with
|
|
# dependencies bundled but the npm lockfile is not needed
|
|
# because pnpm use pnpm for installation
|
|
package-lock.json
|
|
|
|
__package_previews__
|
|
.store
|
|
|
|
privatePackages/store
|
|
|
|
## Verdaccio storage
|
|
storage
|
|
# ...but not the pnpr crate's `storage` source module (the bare rule above
|
|
# is unanchored and would otherwise swallow this source directory).
|
|
!/pnpr/crates/pnpr/src/storage/
|
|
!/pnpr/crates/pnpr/src/storage/**
|
|
|
|
yarn.lock
|
|
|
|
RELEASE.md
|
|
|
|
.jest-cache
|
|
.verdaccio-cache
|
|
.turbo
|
|
.eslintcache
|
|
.claude
|
|
.local-settings
|
|
.pnpm-typecheck.json
|
|
|
|
## custom modules-dir fixture
|
|
pnpm11/__fixtures__/custom-modules-dir/**/fake_modules/
|
|
pnpm11/__fixtures__/custom-modules-dir/cache/
|
|
pnpm11/__fixtures__/custom-modules-dir/patches/
|
|
|
|
## pacquet (Rust) artifacts
|
|
/target
|
|
/bench-work-env
|
|
.pacquet
|
|
|
|
## test registry auth state (written by pnpr when serving with auth)
|
|
htpasswd
|
|
tokens.db
|
|
pnpm/npm/napi/*.node
|
|
|
|
# Generated NAPI addon platform packages + cross-compiled artifacts
|
|
pnpm/npm/napi.*/
|
|
/pnpm-napi.*.node
|
|
pnpr-bins-*
|