Warn when release-it's built-in npm plugin is left enabled - #145
Merged
Conversation
scalvert
force-pushed
the
deps/vitest-4-migration
branch
from
June 18, 2026 02:11
a314349 to
e5eb7ff
Compare
This plugin fully replaces release-it's built-in `npm` plugin, but if the
built-in plugin is left enabled release-it also runs `npm version` and tries
to publish the root package, producing confusing errors. Detect this in the
constructor and emit a clear warning telling users to set `npm: false`
(`npm: { publish: false }` is not sufficient). Also document the correct
configuration and the TypeScript `Config` type gotcha in the README.
Closes #125
Closes #132
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The warning was emitted from the constructor and the test read it via `log.warn.mock.calls`. release-it 19's test factory pre-wraps the logger as a spy so `.mock` exists, but release-it 17/18 do not, so the tests threw `Cannot read properties of undefined (reading 'calls')` on those versions. Move the check to the top of `init()` (before the `skipChecks` guard) so it still fires on every release but after the test harness can install a log capture. The harness now overrides `log.warn` into a plain `warnings` array (version-independent), and the three tests drive `init()` with `skipChecks`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
scalvert
force-pushed
the
fix/npm-false-config
branch
from
June 18, 2026 02:12
ae76b6d to
558dd19
Compare
rwjblue-glean
approved these changes
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #125
Closes #132
This plugin fully replaces release-it's built-in
npmplugin. If the built-in plugin is left enabled, release-it also runsnpm versionand tries to publish the root package, producing confusing errors.Changes
npmplugin is not fully disabled (i.e.npmis anything other thanfalse). This is what Detect and warn for invalid configuration of therelease-itbuiltinnpmplugin #125 asked for.npm: falseis not a valid config #132:npm: falseis valid at runtime, but release-it's exported TypeScriptConfigtype doesn't model thefalseform, sosatisfies Configrejects it — a type assertion or JSON/JS config is needed.Note
Stacked on #126's replacement (the vitest 4 branch) because the new tests are authored against the vitest 4 harness. Base will auto-retarget to
masteronce that merges.npm testgreen: lint + 43/43.🤖 Generated with Claude Code