Repository navigation
chore: bump the plugin header with @ucsantacruz/wordpress-version-updater - #150
Merged
Merged
Conversation
…ater Replace the repo-local wp-plugin-version-updater.js with the shared @ucsantacruz/wordpress-version-updater package (2.0.0). The bumpFiles entry for plugin.php now points at node_modules/@ucsantacruz/wordpress-version-updater/index.js, because commit-and-tag-version loads a string `updater` as a file path, not as a package name. Add a `prerelease` script that runs `wordpress-version-updater check plugin.php`. commit-and-tag-version changes a thrown updater error into a warning and continues the release, so a missing header could let package.json move while plugin.php stayed behind. The check runs before the release writes a file and stops it if the package or the `Version:` line is missing. The package-lock.json refresh is intentional. `npm install` updated the dev dependency tree along with the new package. npm audit goes from 80 issues (3 critical) to 72 (0 critical). Nothing in the tree ships in the plugin ZIP. Refs #149 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add tests/node/version-updater.test.js, run with `npm run test:release` on the built-in node:test runner, so it adds no test dependencies. The tests check that: - readVersion() on plugin.php returns the version in package.json and package-lock.json. - writeVersion() writes multi-digit versions and an -rc.N version, and changes only the Version line. - A release version written over an -rc.N version leaves no suffix. - `wordpress-version-updater check` passes on plugin.php and exits 1 on a file with no header. - package.json still sends plugin.php through the package and runs the prerelease check. The package job in ci.yml runs the tests after `npm ci` on every PR. Refs #149 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Update CLAUDE.md and .github/copilot-instructions.md for the move from wp-plugin-version-updater.js to @ucsantacruz/wordpress-version-updater. Remove the note about keeping the regex shared between readVersion and writeVersion, because the regex now lives in the package. Describe the prerelease check and `npm run test:release`, and make clear that the Node test file covers release tooling, not the JS test suite that the ROADMAP rules out. Closes #149 Co-Authored-By: Claude Opus 5.5 <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.
Closes #149.
This PR replaces the repo-local
wp-plugin-version-updater.jswith the shared@ucsantacruz/wordpress-version-updaterpackage (2.0.0). It adds tests for the package against this plugin's own files, and it runs the tests in CI.Changes
package.jsonplugin.phpentry inbumpFilesnow points atnode_modules/@ucsantacruz/wordpress-version-updater/index.js. commit-and-tag-version loads a stringupdateras a file path, not as a package name.prereleasescript,wordpress-version-updater check plugin.php. It runs before the release writes a file. If the package or theVersion:line is missing, the release stops.wp-plugin-version-updater.jsis deleted.tests/node/version-updater.test.jsis new. You run it withnpm run test:release. It uses the built-innode:testrunner, so it adds no test dependencies. The tests check that:plugin.phpmatchespackage.jsonandpackage-lock.json.writeVersionwrites multi-digit versions (0.5.10) and-rc.Nversions, and changes only theVersion:line.-rc.Nversion leaves no suffix.checkcommand passes onplugin.phpand exits with code 1 on a file with no header.package.jsonstill sendsplugin.phpthrough the package.ci.yml: thepackagejob runsnpm run test:releaseafternpm ci.CLAUDE.mdand.github/copilot-instructions.mddescribe the package, theprereleasecheck and the new tests.Note for reviewers
The
package-lock.jsondiff is large, about 3,500 lines added and 3,600 removed.npm installrefreshed the dev dependency tree along with the new package, and the refresh is intentional.npm auditgoes from 80 issues (3 critical) to 72 (0 critical). Nothing in this tree ships in the plugin ZIP.Testing
npm run test:release: 9 tests pass.npx commit-and-tag-version --dry-runruns theprereleasecheck and bumpsplugin.php,package.jsonandpackage-lock.jsonfrom 0.5.9 to 0.5.10.npm ci --dry-runpasses, so the lockfile is in sync.composer lintandcomposer testdid not run locally. No PHP file changed. CI runs both.🤖 Generated with Claude Code