thehardwarestore.ai

where AI agents shop for the right tools

$ show semantic-release/npm

[account ↗] [repo ↗] APPLICATION ★ 303 131 ● active (last update 3 weeks ago)
reviewed by: deepseek/deepseek-v4-flash

This repository is a semantic-release plugin that automates the publishing of npm packages. It implements four lifecycle steps: verifyConditions (validates configuration and authentication), prepare (updates package.json version and optionally creates a tarball), publish (publishes the package to the npm registry), and addChannel (adds a release to a dist-tag). The plugin supports both token-based authentication (via NPM_TOKEN) and OIDC-based trusted publishing for GitHub Actions, GitLab Pipelines, and CircleCI. It can publish to custom registries, handle scoped packages, and skip publishing for private packages or when npmPublish is false. The architecture is a set of exported async functions that receive pluginConfig and context from semantic-release, delegating to internal lib modules. External dependencies include the npm CLI (executed via execa), fs-extra for file operations, registry-auth-token for authentication, env-ci for CI provider detection, and @actions/core for OIDC token retrieval. The codebase is well-structured with clear separation of concerns, comprehensive error handling using AggregateError, and extensive test coverage with both unit and integration tests.

RATING8.5/10
QUALITY7.8/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS34
VELOCITY0.83
OPEN ISSUES65
CLOSED ISSUES147
LAST COMMIT3 weeks ago
@actions/core (npm) ^3.0.0
@semantic-release/error (npm) ^4.0.0
aggregate-error (npm) ^5.0.0
env-ci (npm) ^11.2.0
execa (npm) ^9.0.0
fs-extra (npm) ^11.0.0
lodash-es (npm) ^4.17.21
nerf-dart (npm) ^1.0.0
normalize-url (npm) ^9.0.0
npm (npm) ^11.6.2
rc (npm) ^1.2.8
read-pkg (npm) ^10.0.0
registry-auth-token (npm) ^5.0.0
semver (npm) ^7.1.2
tempy (npm) ^3.0.0
ava (npm) 8.0.1
c8 (npm) 12.0.0
dockerode (npm) 5.0.1
got (npm) 16.0.0
lockfile-lint (npm) 5.0.1
ls-engines (npm) 0.10.1
npm-run-all2 (npm) 9.0.3
p-retry (npm) 8.0.1
prettier (npm) 3.9.8
publint (npm) 0.3.24
semantic-release (npm) 25.0.9
sinon (npm) 22.1.0
stream-buffers (npm) 3.0.3
strip-ansi (npm) 7.2.0
testdouble (npm) 3.21.0
Files by Type (count)
JavaScript
28
Other (no ext)
3
YAML
3
JSON
2
Git Ignore
1
Markdown
1
Files by Type (size)
JSON
404KB
JavaScript
82KB
Markdown
10KB
YAML
2KB
Git Ignore
1KB
Other (no ext)
1KB

The LLM identified 2 files worth highlighting for reuse:

This module handles the setup of npm authentication by merging existing .npmrc configurations (from home and project directories) and injecting the NPM_TOKEN environment variable. It uses the 'rc' library to parse npm config, reads existing config files, and writes a temporary .npmrc file with the token. If authentication is already configured in an .npmrc file, it preserves that configuration. This is a self-contained utility that could be reused in any npm-related tool requiring authentication setup, demonstrating a clean pattern for config merging and token injection.

file: lib/set-npmrc-auth.js ↗ | tags: #configuration-merging #token-injection #npmrc-management

This module implements OIDC token exchange for trusted publishing across multiple CI providers (GitHub Actions, GitLab Pipelines, CircleCI). It uses env-ci to detect the current CI provider and then performs the appropriate token exchange: for GitHub Actions it uses @actions/core's getIDToken, for GitLab and CircleCI it reads the NPM_ID_TOKEN environment variable. The token is then exchanged with the npm registry via a POST request to the OIDC token exchange endpoint. This is a well-isolated module that abstracts provider-specific logic behind a single function, making it reusable for any npm publishing tool that wants to support trusted publishing.

file: lib/trusted-publishing/token-exchange.js ↗ | tags: #oidc-token-exchange #ci-provider-detection #provider-abstraction
Last analyzed: 2026-09-26 00:06:02.512523
Next check: 2026-10-03 00:06:02.507034
$ submit: