Skip to content

chore(deps): pin Composer dependency ranges - #232

Merged
erseco merged 1 commit into
mainfrom
chore/pin-composer-dependencies
Jul 27, 2026
Merged

chore(deps): pin Composer dependency ranges#232
erseco merged 1 commit into
mainfrom
chore/pin-composer-dependencies

Conversation

@erseco

@erseco erseco commented Jul 27, 2026

Copy link
Copy Markdown
Member

Summary

  • replace wildcard production constraints with compatible ranges based on the versions currently locked
  • pin direct development dependencies that previously used *
  • keep composer.lock to preserve reproducible installations

Dependency ranges

  • tinybutstrong/tinybutstrong: ^3.15.3
  • tinybutstrong/opentbs: ^1.12.3
  • phpunit/phpunit: ^9.6.35
  • wp-cli/i18n-command: ^2.7.0
  • wp-phpunit/wp-phpunit: ^7.0.2
  • yoast/phpunit-polyfills: ^1.1.5
  • yoast/wp-test-utils: ^1.2.1

Validation

  • ranges were selected from the versions already present in composer.lock
  • no locked package versions were changed
  • local Composer validation and tests could not be run because Composer and external network access are unavailable in the execution environment

Follow-up

The lockfile should be refreshed with composer update --lock if CI reports that its content hash is stale. This should only update lock metadata, not package versions.

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@erseco
erseco merged commit 6c0c623 into main Jul 27, 2026
7 checks passed
@erseco
erseco deleted the chore/pin-composer-dependencies branch July 27, 2026 22:46
erseco added a commit that referenced this pull request Jul 28, 2026
Every open Dependabot alert is npm, in package-lock.json, and transitive
through @wordpress/scripts. None are Composer, so the ranges pinned in
#232 are not involved.

Two changes, no overrides:

1. Lift the version cap. .github/dependabot.yml held @wordpress/scripts
   below 32.3.0 and @wordpress/e2e-test-utils-playwright below 1.47.0,
   because those releases pointed their package "exports" at TypeScript
   source that the Playwright runner cannot load. Upstream reverted that:

     1.46.0  exports["."].default = ./build/index.cjs
     1.47.0  exports["."].default = ./src/index.ts     <- the breakage
     1.48.0  exports["."].default = ./src/index.ts
     1.50.0  exports["."].default = ./build/index.js   <- fixed
     1.51.0  exports["."].default = ./build/index.js

   So the cap is removed and both packages track latest again.

2. npm update, which moves the tree to patched releases already allowed
   by the ranges the parents declare. The lockfile had simply gone stale.

Distinct advisories drop from 34 to 17. Measured across four installs,
each npm ci followed by npm audit:

  main, untouched                     34
  upgrade alone                       33
  upgrade + npm update (this commit)  17
  upgrade + 18 forced overrides        6

An earlier revision of this branch took the last route. It was dropped:
half the reduction needs no overrides at all, and the remaining eleven
advisories can only be bought by forcing majors upstream never tested
together - webpack-dev-server 4->5, uuid 8->11, serialize-javascript
6->7, markdown-it 12->14, linkify-it 3->5, adm-zip 0.5->0.6 - in chains
this project never executes. There is no build step and no dev server,
so webpack, postcss and svgo are installed but never run. Those alerts
will clear as @wordpress/scripts moves, without forced pins to maintain.

Note that npm audit's total rises from 43 to 64 while distinct advisories
halve: it counts packages affected, and the unfixable brace-expansion
advisory cascades widely. Only 5.0.8+ is patched there, and v5 exports
{ expand } instead of the callable default v1/v2 exported, so forcing it
throws "expand is not a function" in minimatch. Verified by running it.

Verified: npm ci exits 0, test:unit-js 9 tests, PHPUnit 1808 tests,
Playwright 72 passed with 1 pre-existing failure - document-types.spec.js
fails identically on main with no changes applied, so it is not a
regression from this upgrade.
erseco added a commit that referenced this pull request Jul 28, 2026
#235)

Every open Dependabot alert is npm, in package-lock.json, and transitive
through @wordpress/scripts. None are Composer, so the ranges pinned in
#232 are not involved.

Two changes, no overrides:

1. Lift the version cap. .github/dependabot.yml held @wordpress/scripts
   below 32.3.0 and @wordpress/e2e-test-utils-playwright below 1.47.0,
   because those releases pointed their package "exports" at TypeScript
   source that the Playwright runner cannot load. Upstream reverted that:

     1.46.0  exports["."].default = ./build/index.cjs
     1.47.0  exports["."].default = ./src/index.ts     <- the breakage
     1.48.0  exports["."].default = ./src/index.ts
     1.50.0  exports["."].default = ./build/index.js   <- fixed
     1.51.0  exports["."].default = ./build/index.js

   So the cap is removed and both packages track latest again.

2. npm update, which moves the tree to patched releases already allowed
   by the ranges the parents declare. The lockfile had simply gone stale.

Distinct advisories drop from 34 to 17. Measured across four installs,
each npm ci followed by npm audit:

  main, untouched                     34
  upgrade alone                       33
  upgrade + npm update (this commit)  17
  upgrade + 18 forced overrides        6

An earlier revision of this branch took the last route. It was dropped:
half the reduction needs no overrides at all, and the remaining eleven
advisories can only be bought by forcing majors upstream never tested
together - webpack-dev-server 4->5, uuid 8->11, serialize-javascript
6->7, markdown-it 12->14, linkify-it 3->5, adm-zip 0.5->0.6 - in chains
this project never executes. There is no build step and no dev server,
so webpack, postcss and svgo are installed but never run. Those alerts
will clear as @wordpress/scripts moves, without forced pins to maintain.

Note that npm audit's total rises from 43 to 64 while distinct advisories
halve: it counts packages affected, and the unfixable brace-expansion
advisory cascades widely. Only 5.0.8+ is patched there, and v5 exports
{ expand } instead of the callable default v1/v2 exported, so forcing it
throws "expand is not a function" in minimatch. Verified by running it.

Verified: npm ci exits 0, test:unit-js 9 tests, PHPUnit 1808 tests,
Playwright 72 passed with 1 pre-existing failure - document-types.spec.js
fails identically on main with no changes applied, so it is not a
regression from this upgrade.
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.

1 participant