Skip to content

Disable npm install scripts by default - #27837

Merged
zanieb merged 2 commits into
astral-sh:mainfrom
zaniebot:agent/deny-npm-install-scripts
Aug 19, 2026
Merged

zanieb merged 2 commits into
astral-sh:mainfrom
zaniebot:agent/deny-npm-install-scripts

Conversation

@zaniebot

@zaniebot zaniebot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

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.

@astral-sh-bot

astral-sh-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@zanieb
zanieb marked this pull request as ready for review August 18, 2026 20:43
@zanieb
zanieb requested a review from a team as a code owner August 18, 2026 20:43
@zanieb zanieb added the ci Related to internal CI tooling label Aug 18, 2026
zanieb pushed a commit that referenced this pull request Aug 19, 2026
Older `npm` releases silently ignore the seven-day dependency cooldown
added in #27796. Require `npm` 11.10.0 or newer in the playground,
playground API, and ty benchmark projects, and enable `engine-strict` so
unsupported clients fail during `npm install` or `npm ci`. The lockfile
changes only record that requirement; dependency versions and the
existing cooldown are unchanged.

Pin Node.js to `24.19.0` for the playground CI and publishing jobs,
which provides a compatible bundled `npm`. The separate script-default
changes are in #27837, and the locked playground deployment tool is in
#27838.

Related: #27855 pins the remaining WebAssembly test and
publication runtimes. astral-sh/setup-uv#1026 and
astral-sh/ruff-action#411 enforce the same legacy-aware `npm` version
floor. astral-sh/uv#21193 applies it to uv's locked formatter toolchain.

---------

Co-authored-by: zaniebot <[email protected]>
@zaniebot
zaniebot force-pushed the agent/deny-npm-install-scripts branch from 27178b4 to 2881db9 Compare August 19, 2026 14:20
@zanieb
zanieb enabled auto-merge (squash) August 19, 2026 14:25
@zanieb
zanieb merged commit 73ffad4 into astral-sh:main Aug 19, 2026
56 checks passed
carljm added a commit that referenced this pull request Aug 19, 2026
…ype-form

* origin/main:
  [ty] Fix dynamic-class diagnostic snapshot in string annotations (#27890)
  Lock `wrangler` for playground deployments (#27838)
  [ty] Dogfood standalone scripts with inline configuration (#27885)
  Annotate intentional release secret inheritance (#27887)
  [ty] Skip invalid subscript operands in string annotations (#27882)
  [ty] Handle dynamic classes in string annotations (#27883)
  Disable `npm` install scripts by default (#27837)
  Require wheels for Python tooling dependencies (#27861)
  Update dependency pytest to v9 (#27881)
eifinger pushed a commit to astral-sh/setup-uv that referenced this pull request Aug 20, 2026
CI already disables npm lifecycle scripts, but ordinary installs from
the repository still run them. Set `ignore-scripts = true` in `.npmrc`
so developer and maintenance installs use the same default. Keep the
existing seven-day `min-release-age` policy for new resolutions. Require
`npm>=11.10.0` through `engines.npm` and `engine-strict`, while
retaining `devEngines` for newer clients; older installers can otherwise
ignore `devEngines` and the age setting. Pin the build and checksum
workflows to Node.js `24.19.0` so their bundled `npm` supports the
policy. Explicit project commands such as `npm run package` remain
available.

Related: astral-sh/ruff-action#401 applies the matching `npm` defaults,
and astral-sh/ruff-action#411 adds the same legacy-aware version floor.
astral-sh/ruff#27837 applies the install-script default to Ruff's
JavaScript projects. #1027 separately adds
registry-signature and provenance verification.

---------

Co-authored-by: zaniebot <[email protected]>
github-actions Bot added a commit to step-security/setup-uv that referenced this pull request Oct 5, 2026
CI already disables npm lifecycle scripts, but ordinary installs from
the repository still run them. Set `ignore-scripts = true` in `.npmrc`
so developer and maintenance installs use the same default. Keep the
existing seven-day `min-release-age` policy for new resolutions. Require
`npm>=11.10.0` through `engines.npm` and `engine-strict`, while
retaining `devEngines` for newer clients; older installers can otherwise
ignore `devEngines` and the age setting. Pin the build and checksum
workflows to Node.js `24.19.0` so their bundled `npm` supports the
policy. Explicit project commands such as `npm run package` remain
available.

Related: astral-sh/ruff-action#401 applies the matching `npm` defaults,
and astral-sh/ruff-action#411 adds the same legacy-aware version floor.
astral-sh/ruff#27837 applies the install-script default to Ruff's
JavaScript projects. astral-sh/setup-uv#1027 separately adds
registry-signature and provenance verification.

---------

Co-authored-by: zaniebot <[email protected]>
github-actions Bot added a commit to step-security/setup-uv that referenced this pull request Oct 5, 2026
CI already disables npm lifecycle scripts, but ordinary installs from
the repository still run them. Set `ignore-scripts = true` in `.npmrc`
so developer and maintenance installs use the same default. Keep the
existing seven-day `min-release-age` policy for new resolutions. Require
`npm>=11.10.0` through `engines.npm` and `engine-strict`, while
retaining `devEngines` for newer clients; older installers can otherwise
ignore `devEngines` and the age setting. Pin the build and checksum
workflows to Node.js `24.19.0` so their bundled `npm` supports the
policy. Explicit project commands such as `npm run package` remain
available.

Related: astral-sh/ruff-action#401 applies the matching `npm` defaults,
and astral-sh/ruff-action#411 adds the same legacy-aware version floor.
astral-sh/ruff#27837 applies the install-script default to Ruff's
JavaScript projects. astral-sh/setup-uv#1027 separately adds
registry-signature and provenance verification.

---------

Co-authored-by: zaniebot <[email protected]>
Raj-StepSecurity pushed a commit to step-security/setup-uv that referenced this pull request Oct 5, 2026
CI already disables npm lifecycle scripts, but ordinary installs from
the repository still run them. Set `ignore-scripts = true` in `.npmrc`
so developer and maintenance installs use the same default. Keep the
existing seven-day `min-release-age` policy for new resolutions. Require
`npm>=11.10.0` through `engines.npm` and `engine-strict`, while
retaining `devEngines` for newer clients; older installers can otherwise
ignore `devEngines` and the age setting. Pin the build and checksum
workflows to Node.js `24.19.0` so their bundled `npm` supports the
policy. Explicit project commands such as `npm run package` remain
available.

Related: astral-sh/ruff-action#401 applies the matching `npm` defaults,
and astral-sh/ruff-action#411 adds the same legacy-aware version floor.
astral-sh/ruff#27837 applies the install-script default to Ruff's
JavaScript projects. astral-sh/setup-uv#1027 separately adds
registry-signature and provenance verification.

---------
Raj-StepSecurity pushed a commit to step-security/setup-uv that referenced this pull request Oct 5, 2026
CI already disables npm lifecycle scripts, but ordinary installs from
the repository still run them. Set `ignore-scripts = true` in `.npmrc`
so developer and maintenance installs use the same default. Keep the
existing seven-day `min-release-age` policy for new resolutions. Require
`npm>=11.10.0` through `engines.npm` and `engine-strict`, while
retaining `devEngines` for newer clients; older installers can otherwise
ignore `devEngines` and the age setting. Pin the build and checksum
workflows to Node.js `24.19.0` so their bundled `npm` supports the
policy. Explicit project commands such as `npm run package` remain
available.

Related: astral-sh/ruff-action#401 applies the matching `npm` defaults,
and astral-sh/ruff-action#411 adds the same legacy-aware version floor.
astral-sh/ruff#27837 applies the install-script default to Ruff's
JavaScript projects. astral-sh/setup-uv#1027 separately adds
registry-signature and provenance verification.

---------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Related to internal CI tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants