fix(npm): approve-scripts detects packages when lockfile is disabled#32842
Merged
bartlomieju merged 1 commit intodenoland:mainfrom Mar 20, 2026
Merged
Conversation
When `lock: false` is set in deno.json, `deno approve-scripts` (without args) would report "No npm packages with lifecycle scripts need approval" even though `deno install` correctly warned about packages with scripts. The issue was that `approve-scripts` queried the npm resolution snapshot without first resolving packages. With no lockfile, the snapshot was empty. Fix by calling `ensure_top_level_package_json_install()` before querying. Closes denoland#32781 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
deno approve-scriptsfailing to detect packages with lifecycle scripts when"lock": falseis set indeno.jsonapprove-scriptsqueried the npm resolution snapshot without first resolving packages — with no lockfile, the snapshot was emptyensure_top_level_package_json_install()before querying the snapshotCloses #32781
Test plan
approve_scripts_no_lockwith two cases:approve_scripts_explicit_package— verifies explicit package approval works withlock: falseapprove_scripts_detects_packages— verifies the no-args path finds packages (previously returned "nothing to approve")🤖 Generated with Claude Code