Repository navigation
Conversation
The formatting job lets `npx` resolve a new version of `prettier` on each run. Record `[email protected]` in a private npm manifest and lockfile, disable dependency lifecycle scripts by default, and invoke the installed binary. Formatter updates now have a reviewable version and integrity change instead of happening implicitly during CI. Related: astral-sh/astral-tl#21 and astral-sh/trusted-publishing-examples#12 make the same locked-formatter change. astral-sh/uv#21193 covers uv's direct `prettier` invocations. Co-authored-by: zaniebot <[email protected]>
The formatter is installed from a lockfile, but new npm resolutions can still select a package immediately after publication. Add a seven-day release-age policy and require `npm>=11.10.0` with `engine-strict` so older clients cannot silently ignore it. Use a compatible Node 24 runtime in CI and keep the existing locked dependency versions. Follow-up to #322. Related: astral-sh/uv#21193. Co-authored-by: zaniebot <[email protected]>
The contributor hook configuration maintains another set of tool installations, including a floating `prettier@3` dependency, while CI already invokes each check directly. Remove `.pre-commit-config.yaml` and its Renovate configuration, and document the direct schema-validation and generated-file commands alongside the existing formatting and linting commands. This changes only uv's contributor setup; the `uv-pre-commit` integration and its user documentation remain supported. Related: #21193 covers the remaining direct `prettier` invocations. Supersedes #21194. #21154 independently pins one-shot tools; only its `prettier` hook pin overlaps with this removal. astral-sh/docstring-adder#236 and astral-sh/ecosystem-analyzer#162 remove only their unnecessary `prettier` hooks. --------- Co-authored-by: zaniebot <[email protected]>
4d9bfd9 to
12f7d06
Compare
There was a problem hiding this comment.
I think we probably want to make these changes in the org preset instead, so they don't need to be copied around?
| let output = Command::new("node") | ||
| .arg(prettier) | ||
| .args(["--stdin-filepath", "uv.schema.json"]) |
There was a problem hiding this comment.
Maybe npm run prettier here instead, for consistency with how we invoke it elsewhere.
| subprocess.run( | ||
| ["npx", "--yes", f"prettier@{PRETTIER_VERSION}", "--write"] | ||
| + [str(path) for path in generated_paths], | ||
| ["node", str(prettier), "--write"] + [str(path) for path in generated_paths], |
There was a problem hiding this comment.
Maybe npm run prettier here too? We could also do check=True to avoid having to test the prettier.cjs file explicitly.
12f7d06 to
822e00f
Compare
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]>
The formatter is locked, but new npm resolutions have no release-age policy or supported-client floor. Require `npm>=11.10.0` with `engine-strict`, wait seven days before selecting newly published packages, and pin Node.js to `24.19.0` in CI. Configure Renovate for the root formatter manifest and the formatter workflow's Node.js pin under the shared dependency policy, leaving unrelated GitHub Actions updates disabled. The locked Prettier version is unchanged. Follow-up to #161. Related: astral-sh/packse#324 and astral-sh/astral-tl#21 apply the same effective seven-day `npm` policy; astral-sh/uv#21193 combines it with locked formatter tooling. --------- Co-authored-by: zaniebot <[email protected]>
The formatting job downloads `prettier` through `npx` without a committed lockfile. Record the existing `[email protected]` in a private npm manifest and lockfile, disable dependency lifecycle scripts by default, and invoke the installed binary. Require `npm>=11.10.0` through `engines.npm` and `engine-strict` so older clients cannot silently ignore the seven-day `min-release-age` policy for new resolutions, and pin Node.js to `24.19.0` in CI. Formatter updates now have a reviewable version and integrity change instead of happening during CI. Enable Renovate for the root formatter manifest so its locked versions continue to receive updates under the shared policy. Related: astral-sh/hawk#161 and astral-sh/uv#21193 cover the corresponding `prettier` consumption paths. astral-sh/internal-dev#61 records the equivalent locked tool environment for `bun`.
Merging this PR will improve performance by 9.38%1 warning
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
The formatting workflow, contributor commands, generators, and editor hook fetch Prettier through one-shot
npxinvocations without a committed lockfile. Add a shared privatenpmtoolchain that locks the existing3.9.0formatter and the README generator's3.8.3release, and disable lifecycle scripts in.npmrc. Requirenpm>=11.10.0throughengines.npmandengine-strictso older installers cannot silently ignore the seven-daymin-release-agepolicy for new resolutions. CI pins Node.js to24.19.0, and CI and release preparation install the tools withnpm ci --ignore-scripts. Callers then run the installed CLI directly so formatting cannot fall back to a download. Keep the root tooling lock under Renovate's shared update policy.Related: #21197 removes uv's contributor hook configuration. #21204 separately moves Python-tool invocations into the locked
checkgroup. astral-sh/ruff#27842 hardens the nativeprekformatter environment, while astral-sh/hawk#161 records a lockednpmformatter environment.