Skip to content

refactor bump version script - #36

Merged
ptesei merged 1 commit into
developfrom
feat/perf-remove-window-load
Aug 5, 2026
Merged

refactor bump version script#36
ptesei merged 1 commit into
developfrom
feat/perf-remove-window-load

Conversation

@ptesei

@ptesei ptesei commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

Low Risk
Developer-only release tooling with no runtime plugin behavior; main caveat is the script assumes macOS sed syntax, so Linux CI may need adjustment.

Overview
Replaces the Node-based version bump with a bash script under bin/bump.sh, and wires npm run bump to bash bin/bump.sh instead of node scripts/bump-version.js.

The new script keeps the same release workflow: semver from patch/minor/major or an explicit x.y.z, reading the current version from .plugin-data, then updating JSON versions, package-lock.json, blockparty-faq.php, readme.txt stubs, and CHANGELOG.md. It uses sed/awk rather than parsing and rewriting JSON in Node, documents macOS sed -i '', and adds guards against duplicate changelog/upgrade entries for the target version.

Packaging metadata now ignores /bin instead of /scripts in .distignore and .gitattributes; scripts/bump-version.js is removed.

Reviewed by Cursor Bugbot for commit 10a4188. Bugbot is set up for automated code reviews on this repo. Configure here.

@ptesei
ptesei merged commit f5dcb4a into develop Aug 5, 2026
1 check passed
@ptesei
ptesei deleted the feat/perf-remove-window-load branch August 5, 2026 14:34

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 10a4188. Configure here.

Comment thread bin/bump.sh
require_file "${PHP_FILE}"
sed -i '' "s/^\( \* Version:[[:space:]]*\)$(escape_sed "${CURRENT}")/\1${VERSION}/" "${ROOT_DIR}/${PHP_FILE}"
sed -i '' "s/define( 'BLOCKPARTY_FAQ_VERSION', '$(escape_sed "${CURRENT}")' )/define( 'BLOCKPARTY_FAQ_VERSION', '${VERSION}' )/" "${ROOT_DIR}/${PHP_FILE}"
log_updated "${PHP_FILE}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Silent success on missed replacements

Medium Severity

sed and awk updates no longer verify that a match was found. If the PHP header, define, Stable tag, or changelog markers differ slightly from what the patterns expect, those fields stay unchanged while the script still reports a successful bump and lists the files as updated. The previous Node script failed loudly via replaceOnce in these cases.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 10a4188. Configure here.

Comment thread bin/bump.sh

if grep -q "^= ${VERSION} - " "${ROOT_DIR}/${README_TXT}"; then
echo "Error: readme.txt already contains a changelog entry for ${VERSION}" >&2
exit 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Guards run after partial writes

Medium Severity

Duplicate changelog and Upgrade Notice checks run only after JSON, lockfile, PHP, and Stable tag have already been rewritten. An explicit bump to a version that already appears in readme.txt history exits with an error but leaves those version fields updated, so the working tree ends up half-bumped.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 10a4188. Configure here.

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