Skip to content

Disable dependency lifecycle scripts by default - #525

Merged
zanieb merged 1 commit into
astral-sh:mainfrom
zaniebot:agent/disable-npm-install-scripts
Aug 18, 2026
Merged

zanieb merged 1 commit into
astral-sh:mainfrom
zaniebot:agent/disable-npm-install-scripts

Conversation

@zaniebot

@zaniebot zaniebot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

The release workflow uses unrestricted npm ci for packaging and both marketplace publishers, even though the local just recipes already disable dependency lifecycle scripts. Add --ignore-scripts to those installs and make ignore-scripts=true the project default, so dependencies cannot introduce automatic install-time code execution. Explicit project commands, including vscode:prepublish, remain available.

Related: astral-sh/ruff-vscode#1151 makes the matching install-script change for Ruff. #526 separately narrows the marketplace publisher's dependency tree, and #527 adds an enforced release-age policy for the full extension project.

@MichaReiser MichaReiser left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question as for ruff but looks good

zanieb added a commit to astral-sh/ruff-vscode that referenced this pull request Aug 18, 2026
The release workflow uses unrestricted `npm ci` for packaging and both
marketplace publishers, even though the local `just` recipes already
disable dependency lifecycle scripts. Add `--ignore-scripts` to those
installs and make `ignore-scripts=true` the project default, so
dependencies cannot introduce automatic install-time code execution.
Explicit project commands, including `vscode:prepublish`, remain
available.

Related: astral-sh/ty-vscode#525 makes the matching install-script
change for ty. #1152 separately narrows the
marketplace publisher's dependency tree.

Co-authored-by: Zanie Blue <[email protected]>
@zanieb
zanieb merged commit b2508b0 into astral-sh:main Aug 18, 2026
3 checks passed
zanieb pushed a commit to astral-sh/ruff that referenced this pull request Aug 19, 2026
The playground workflows disable dependency lifecycle scripts, but
ordinary local installs in the playground, its API, and the ty benchmark
project still enable them. Set `ignore-scripts` in each project's
`.npmrc` so the same default applies outside CI, while preserving the
existing seven-day release-age policy. Because `ignore-scripts` also
suppresses first-party pre/post hooks, the playground's `build`,
`dev:build`, and `start` commands invoke their required WASM preparation
explicitly. The datastore instructions now install from the API lockfile
and invoke its local Wrangler instead of allowing `npx` to resolve a
separate dependency tree.

Related: astral-sh/ruff-vscode#1151 and astral-sh/ty-vscode#525 apply
the same install-script default to the editor extensions.
#27844 enforces the cooldown-supporting `npm` floor,
#27842 hardens the native `prek` formatter environment,
and #27838 locks the playground deployment toolchain.

---------

Co-authored-by: zaniebot <[email protected]>
zanieb added a commit that referenced this pull request Sep 3, 2026
Marketplace publishing already consumes prebuilt VSIX files, but each
publisher installs the extension's complete development dependency tree.
Give `scripts/publish` an independent lockfile containing the existing
`@vscode/vsce` and `ovsx` versions, and install it with dependency
lifecycle scripts disabled. Require `npm>=11.10.0` with `engines.npm`
and `engine-strict`, and apply a seven-day `min-release-age` to new
resolutions. Invoke the locked binaries directly so publishing cannot
fall back to an unpinned `npx` download. The packaging jobs and
published VSIX artifacts are unchanged.

Related: astral-sh/ruff-vscode#1152 applies the same publisher split to
Ruff, while #525 sets the install-script policy for
the full extension project. #527 applies the matching
seven-day policy to the full extension project. astral-sh/ruff#27839
isolates playground builds from their publisher.

---------

Co-authored-by: Zanie Blue <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants