From 4b98c0604651457ee3ea7eefefcc5b2d1545e4ce Mon Sep 17 00:00:00 2001 From: Paolo Tesei Date: Mon, 3 Aug 2026 16:22:09 +0200 Subject: [PATCH 1/7] perf remove window load --- src/faq/script.js | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/faq/script.js b/src/faq/script.js index 9e2a33f..f4101d7 100644 --- a/src/faq/script.js +++ b/src/faq/script.js @@ -1,17 +1,26 @@ -import { Accordion } from '@beapi/be-a11y'; +import { Accordion } from "@beapi/be-a11y"; // eslint-disable-next-line no-undef const accordionConfig = beapiFaqBlock.accordionConfig; -window.addEventListener( 'load', function () { +/** + * Initialize FAQ accordion instances. + */ +const init = () => { Accordion.init( - '.wp-block-blockparty-faq:has(button.wp-block-blockparty-faq-trigger)', - accordionConfig + ".wp-block-blockparty-faq:has(button.wp-block-blockparty-faq-trigger)", + accordionConfig, ); - Accordion.init( '.wp-block-blockparty-faq:has(button.faq__trigger)', { + Accordion.init(".wp-block-blockparty-faq:has(button.faq__trigger)", { ...accordionConfig, - panelSelector: '.faq__panel', - triggerSelector: '.faq__trigger', - } ); -} ); + panelSelector: ".faq__panel", + triggerSelector: ".faq__trigger", + }); +}; + +if (document.readyState === "loading") { + document.addEventListener("DOMContentLoaded", init); +} else { + init(); +} From 0501ea4a2eef6e851fb6591ad148fe67c25522cb Mon Sep 17 00:00:00 2001 From: Paolo Tesei Date: Tue, 4 Aug 2026 09:26:36 +0200 Subject: [PATCH 2/7] fix format script --- src/faq/script.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/faq/script.js b/src/faq/script.js index f4101d7..bd9b564 100644 --- a/src/faq/script.js +++ b/src/faq/script.js @@ -1,4 +1,4 @@ -import { Accordion } from "@beapi/be-a11y"; +import { Accordion } from '@beapi/be-a11y'; // eslint-disable-next-line no-undef const accordionConfig = beapiFaqBlock.accordionConfig; @@ -8,19 +8,19 @@ const accordionConfig = beapiFaqBlock.accordionConfig; */ const init = () => { Accordion.init( - ".wp-block-blockparty-faq:has(button.wp-block-blockparty-faq-trigger)", - accordionConfig, + '.wp-block-blockparty-faq:has(button.wp-block-blockparty-faq-trigger)', + accordionConfig ); - Accordion.init(".wp-block-blockparty-faq:has(button.faq__trigger)", { + Accordion.init( '.wp-block-blockparty-faq:has(button.faq__trigger)', { ...accordionConfig, - panelSelector: ".faq__panel", - triggerSelector: ".faq__trigger", - }); + panelSelector: '.faq__panel', + triggerSelector: '.faq__trigger', + } ); }; -if (document.readyState === "loading") { - document.addEventListener("DOMContentLoaded", init); +if ( document.readyState === 'loading' ) { + document.addEventListener( 'DOMContentLoaded', init ); } else { init(); } From 8680969c08be7e4ce91a8c19adbffa27f9312ba3 Mon Sep 17 00:00:00 2001 From: Paolo Tesei Date: Tue, 4 Aug 2026 09:51:58 +0200 Subject: [PATCH 3/7] add bumb version script --- .distignore | 1 + .gitattributes | 2 +- README.md | 1 + bin/bump-version.js | 428 ++++++++++++++++++++++++++++++++++++++++++++ package.json | 5 +- 5 files changed, 434 insertions(+), 3 deletions(-) create mode 100755 bin/bump-version.js diff --git a/.distignore b/.distignore index 00f7f99..1c86fb2 100644 --- a/.distignore +++ b/.distignore @@ -4,6 +4,7 @@ /config /node_modules /tests +/bin .distignore .editorconfig diff --git a/.gitattributes b/.gitattributes index d8401c1..c2d7c0f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,7 +4,7 @@ /node_modules export-ignore -diff /tests export-ignore /vendor export-ignore -diff - +/bin export-ignore /.distignore export-ignore /.editorconfig export-ignore /.gitattributes export-ignore diff --git a/README.md b/README.md index aec715d..d76df81 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ A Gutenberg block for SEO friendly FAQ in an accessible accordion. - `npm run start` - Start the development server with hot reload - `npm run env:start` - Start the WordPress environment (wp-env) - `npm run env:stop` - Stop the WordPress environment +- `npm run bump -- ` - Bump the plugin version across package, blocks, PHP, and docs ### Note diff --git a/bin/bump-version.js b/bin/bump-version.js new file mode 100755 index 0000000..f51e122 --- /dev/null +++ b/bin/bump-version.js @@ -0,0 +1,428 @@ +#!/usr/bin/env node +/** + * Bump the plugin version across package, block metadata, PHP, and docs. + * + * Usage: + * npm run bump -- patch + * npm run bump -- minor + * npm run bump -- major + * npm run bump -- 2.2.0 + * + * @package blockparty-faq + */ + +const fs = require( 'fs' ); +const path = require( 'path' ); + +const ROOT = path.resolve( __dirname, '..' ); + +const SEMVER_RE = /^(\d+)\.(\d+)\.(\d+)$/; + +/** + * Resolve the absolute path of a project-relative file. + * + * @param {string} relativePath Relative path from the project root. + * @return {string} Absolute file path. + */ +const resolvePath = ( relativePath ) => path.join( ROOT, relativePath ); + +/** + * Read a UTF-8 file from the project root. + * + * @param {string} relativePath Relative path from the project root. + * @return {string} File contents. + */ +const readFile = ( relativePath ) => + fs.readFileSync( resolvePath( relativePath ), 'utf8' ); + +/** + * Write a UTF-8 file to the project root. + * + * @param {string} relativePath Relative path from the project root. + * @param {string} contents File contents. + * @return {void} + */ +const writeFile = ( relativePath, contents ) => { + fs.writeFileSync( resolvePath( relativePath ), contents, 'utf8' ); +}; + +/** + * Parse a JSON file from the project root. + * + * @param {string} relativePath Relative path from the project root. + * @return {Object} Parsed JSON object. + */ +const readJson = ( relativePath ) => JSON.parse( readFile( relativePath ) ); + +/** + * Write a JSON file with tab indentation (project convention). + * + * @param {string} relativePath Relative path from the project root. + * @param {Object} data Data to serialize. + * @return {void} + */ +const writeJson = ( relativePath, data ) => { + writeFile( relativePath, `${ JSON.stringify( data, null, '\t' ) }\n` ); +}; + +/** + * Print usage help and exit. + * + * @param {number} exitCode Process exit code. + * @return {void} + */ +const printUsage = ( exitCode = 1 ) => { + console.error( ` +Usage: + npm run bump -- + +Examples: + npm run bump -- patch + npm run bump -- minor + npm run bump -- 2.2.0 +`.trim() ); + process.exit( exitCode ); +}; + +/** + * Compute the next semantic version. + * + * @param {string} current Current version (x.y.z). + * @param {string} bump Bump type or explicit version. + * @return {string} Next version. + */ +const getNextVersion = ( current, bump ) => { + if ( SEMVER_RE.test( bump ) ) { + return bump; + } + + const match = current.match( SEMVER_RE ); + if ( ! match ) { + throw new Error( `Invalid current version: ${ current }` ); + } + + let major = Number( match[ 1 ] ); + let minor = Number( match[ 2 ] ); + let patch = Number( match[ 3 ] ); + + switch ( bump ) { + case 'major': + major += 1; + minor = 0; + patch = 0; + break; + case 'minor': + minor += 1; + patch = 0; + break; + case 'patch': + patch += 1; + break; + default: + throw new Error( + `Unknown bump type "${ bump }". Use patch, minor, major, or x.y.z.` + ); + } + + return `${ major }.${ minor }.${ patch }`; +}; + +/** + * Format today's date as YYYY-MM-DD (local timezone). + * + * @return {string} ISO date string without time. + */ +const today = () => { + const now = new Date(); + const year = now.getFullYear(); + const month = String( now.getMonth() + 1 ).padStart( 2, '0' ); + const day = String( now.getDate() ).padStart( 2, '0' ); + return `${ year }-${ month }-${ day }`; +}; + +/** + * Replace the first occurrence of a pattern or throw. + * + * @param {string} contents File contents. + * @param {RegExp|string} search Search pattern. + * @param {string} replace Replacement. + * @param {string} label Human-readable label for errors. + * @return {string} Updated contents. + */ +const replaceOnce = ( contents, search, replace, label ) => { + if ( typeof search === 'string' ) { + if ( ! contents.includes( search ) ) { + throw new Error( `Could not find ${ label }.` ); + } + return contents.replace( search, replace ); + } + + if ( ! search.test( contents ) ) { + throw new Error( `Could not find ${ label }.` ); + } + + return contents.replace( search, replace ); +}; + +/** + * Update version fields in a JSON file that has a top-level "version" key. + * + * @param {string} relativePath Relative path from the project root. + * @param {string} version New version. + * @return {void} + */ +const updateJsonVersion = ( relativePath, version ) => { + const data = readJson( relativePath ); + if ( typeof data.version !== 'string' ) { + throw new Error( `Missing "version" in ${ relativePath }.` ); + } + data.version = version; + writeJson( relativePath, data ); +}; + +/** + * Update package-lock.json root package version fields. + * + * @param {string} version New version. + * @return {void} + */ +const updatePackageLock = ( version ) => { + const lockPath = 'package-lock.json'; + if ( ! fs.existsSync( resolvePath( lockPath ) ) ) { + return; + } + + const lock = readJson( lockPath ); + lock.version = version; + if ( lock.packages && lock.packages[ '' ] ) { + lock.packages[ '' ].version = version; + } + writeJson( lockPath, lock ); +}; + +/** + * Update version strings in the main plugin PHP file. + * + * @param {string} currentVersion Current version. + * @param {string} nextVersion New version. + * @return {void} + */ +const updatePluginPhp = ( currentVersion, nextVersion ) => { + const relativePath = 'blockparty-faq.php'; + let contents = readFile( relativePath ); + + contents = replaceOnce( + contents, + new RegExp( + `( \\* Version:\\s+)${ escapeRegExp( currentVersion ) }` + ), + `$1${ nextVersion }`, + `plugin header Version in ${ relativePath }` + ); + + contents = replaceOnce( + contents, + `define( 'BLOCKPARTY_FAQ_VERSION', '${ currentVersion }' );`, + `define( 'BLOCKPARTY_FAQ_VERSION', '${ nextVersion }' );`, + `BLOCKPARTY_FAQ_VERSION in ${ relativePath }` + ); + + writeFile( relativePath, contents ); +}; + +/** + * Escape a string for safe use inside a RegExp. + * + * @param {string} value Raw string. + * @return {string} Escaped string. + */ +const escapeRegExp = ( value ) => + value.replace( /[.*+?^${}()|[\]\\]/g, '\\$&' ); + +/** + * Update Stable tag and changelog stubs in readme.txt. + * + * @param {string} currentVersion Current version. + * @param {string} nextVersion New version. + * @param {string} date Release date (YYYY-MM-DD). + * @return {void} + */ +const updateReadmeTxt = ( currentVersion, nextVersion, date ) => { + const relativePath = 'readme.txt'; + let contents = readFile( relativePath ); + + contents = replaceOnce( + contents, + new RegExp( + `(Stable tag:\\s+)${ escapeRegExp( currentVersion ) }` + ), + `$1${ nextVersion }`, + `Stable tag in ${ relativePath }` + ); + + const changelogStub = `= ${ nextVersion } - ${ date } =\n* TBD\n\n`; + contents = replaceOnce( + contents, + `= ${ currentVersion }`, + `${ changelogStub }= ${ currentVersion }`, + `changelog section in ${ relativePath }` + ); + + const upgradeStub = `= ${ nextVersion } =\nTBD\n\n`; + contents = replaceOnce( + contents, + '== Upgrade Notice ==\n\n', + `== Upgrade Notice ==\n\n${ upgradeStub }`, + `Upgrade Notice in ${ relativePath }` + ); + + writeFile( relativePath, contents ); +}; + +/** + * Prepend a Keep a Changelog stub in CHANGELOG.md. + * + * @param {string} nextVersion New version. + * @param {string} date Release date (YYYY-MM-DD). + * @return {void} + */ +const updateChangelogMd = ( nextVersion, date ) => { + const relativePath = 'CHANGELOG.md'; + let contents = readFile( relativePath ); + + if ( contents.includes( `## [${ nextVersion }]` ) ) { + throw new Error( + `CHANGELOG.md already contains an entry for ${ nextVersion }.` + ); + } + + const stub = `## [${ nextVersion }] - ${ date } + +### Changed + +- TBD + +`; + + contents = replaceOnce( + contents, + 'and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n', + `and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n${ stub }`, + `Semantic Versioning intro in ${ relativePath }` + ); + + writeFile( relativePath, contents ); +}; + +/** + * Prepend a changelog stub in README.md. + * + * @param {string} nextVersion New version. + * @param {string} date Release date (YYYY-MM-DD). + * @return {void} + */ +const updateReadmeMd = ( nextVersion, date ) => { + const relativePath = 'README.md'; + let contents = readFile( relativePath ); + + if ( contents.includes( `### ${ nextVersion } -` ) ) { + throw new Error( + `README.md already contains an entry for ${ nextVersion }.` + ); + } + + const stub = `### ${ nextVersion } - ${ date } + +- TBD + +`; + + contents = replaceOnce( + contents, + '## Changelog\n\n', + `## Changelog\n\n${ stub }`, + `Changelog heading in ${ relativePath }` + ); + + writeFile( relativePath, contents ); +}; + +/** + * Main entry point. + * + * @return {void} + */ +const main = () => { + const bumpArg = process.argv[ 2 ]; + + if ( ! bumpArg || bumpArg === '-h' || bumpArg === '--help' ) { + printUsage( bumpArg ? 0 : 1 ); + } + + const pluginData = readJson( '.plugin-data' ); + const packageJson = readJson( 'package.json' ); + + const currentVersion = pluginData.version || packageJson.version; + if ( ! SEMVER_RE.test( currentVersion ) ) { + throw new Error( `Invalid current version: ${ currentVersion }` ); + } + + const nextVersion = getNextVersion( currentVersion, bumpArg ); + if ( nextVersion === currentVersion ) { + throw new Error( + `Next version ${ nextVersion } is identical to the current version.` + ); + } + + const date = today(); + const updated = []; + + updateJsonVersion( '.plugin-data', nextVersion ); + updated.push( '.plugin-data' ); + + updateJsonVersion( 'package.json', nextVersion ); + updated.push( 'package.json' ); + + updatePackageLock( nextVersion ); + if ( fs.existsSync( resolvePath( 'package-lock.json' ) ) ) { + updated.push( 'package-lock.json' ); + } + + const blockJsonFiles = [ + 'src/faq/block.json', + 'src/faq-answer/block.json', + 'src/faq-item/block.json', + 'src/faq-question/block.json', + ]; + + blockJsonFiles.forEach( ( file ) => { + updateJsonVersion( file, nextVersion ); + updated.push( file ); + } ); + + updatePluginPhp( currentVersion, nextVersion ); + updated.push( 'blockparty-faq.php' ); + + updateReadmeTxt( currentVersion, nextVersion, date ); + updated.push( 'readme.txt' ); + + updateChangelogMd( nextVersion, date ); + updated.push( 'CHANGELOG.md' ); + + updateReadmeMd( nextVersion, date ); + updated.push( 'README.md' ); + + console.log( `Bumped version ${ currentVersion } → ${ nextVersion }` ); + console.log( 'Updated files:' ); + updated.forEach( ( file ) => console.log( ` - ${ file }` ) ); + console.log( + '\nFill in the TBD changelog entries before releasing.' + ); +}; + +try { + main(); +} catch ( error ) { + console.error( `Error: ${ error.message }` ); + process.exit( 1 ); +} diff --git a/package.json b/package.json index a8d1b72..4c8df2d 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "make-pot": "wp i18n make-pot . languages/blockparty-faq.pot --exclude=\"src\" --domain=blockparty-faq", "make-json": "wp i18n make-json languages/blockparty-faq-fr_FR.po languages/ --no-purge", "env:start": "wp-env start", - "env:stop": "wp-env stop" + "env:stop": "wp-env stop", + "bump": "node bin/bump-version.js" }, "dependencies": { "@beapi/be-a11y": "^1.7.2", @@ -34,4 +35,4 @@ "volta": { "node": "20.12.0" } -} +} \ No newline at end of file From a3d0af892d15efe4b8e3af8b9d514ac0878601c4 Mon Sep 17 00:00:00 2001 From: Paolo Tesei Date: Wed, 5 Aug 2026 09:27:14 +0200 Subject: [PATCH 4/7] refactor scripts bumb version --- .distignore | 2 +- .gitattributes | 2 +- README.md | 38 +++----------------------------- package.json | 2 +- {bin => scripts}/bump-version.js | 36 ------------------------------ 5 files changed, 6 insertions(+), 74 deletions(-) rename {bin => scripts}/bump-version.js (92%) diff --git a/.distignore b/.distignore index 1c86fb2..48e1330 100644 --- a/.distignore +++ b/.distignore @@ -4,7 +4,7 @@ /config /node_modules /tests -/bin +/scripts .distignore .editorconfig diff --git a/.gitattributes b/.gitattributes index c2d7c0f..edc4693 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,7 +4,7 @@ /node_modules export-ignore -diff /tests export-ignore /vendor export-ignore -diff -/bin export-ignore +/scripts export-ignore /.distignore export-ignore /.editorconfig export-ignore /.gitattributes export-ignore diff --git a/README.md b/README.md index d76df81..dcc06cb 100644 --- a/README.md +++ b/README.md @@ -52,40 +52,8 @@ FAQ structured data (JSON-LD) requires Yoast SEO, Rank Math, or SEOPress. All th ## Changelog -### 1.0.0 - 2024-04-02 +See [readme.txt](readme.txt) and [CHANGELOG.md](CHANGELOG.md) for the full version history. -- initial commit. +--- -### 1.0.1 - 2024-04-03 - -- fix css variable names - -### 1.0.2 - 2024-06-06 - -- Add support for PHP 8.2 - -### 2.0.0 - 2026-01-26 - -- **Major block structure refactoring** : Transition from a monolithic block to a nested architecture with child blocks (`faq-item`, `faq-question`, `faq-answer`) -- **Configurable accordion mode** : Added `isAccordion` attribute allowing to toggle between an interactive accordion mode and a static mode -- **InnerBlocks support in answers** : Ability to add any Gutenberg block (lists, paragraphs, images, etc.) in FAQ answers -- **Front-end JavaScript** : Added `script.js` to handle accordion interactivity on the front-end with customizable configuration via the `beapi_faq_block_config` filter -- **Automatic migration** : Migration system from the old format (`questions` array attribute) to the new format (InnerBlocks) -- **Complete internationalization** : Support for PO/MO translations for PHP and JSON for JavaScript -- **Aligned build structure** : Reorganization to follow the `blockparty-accordion` model with `block.json` in each block directory -- **Add/remove buttons** : Added buttons to add and remove FAQ items directly from the editor - -### 2.0.1 - 2026-01-27 - -- Fix build blocks - -### 2.0.2 - 2026-01-27 - -- Add missing isAccordion attribute - -### 2.0.3 - 2026-02-17 - -- Allow adding "Button" blocks in the answer content -- Add spacing support for answers -- Add font size support for the question -- Strip HTML tags from the question in structured data +Developed with ❤️ by [Be API](https://beapi.fr) diff --git a/package.json b/package.json index 4c8df2d..dbd7c47 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "make-json": "wp i18n make-json languages/blockparty-faq-fr_FR.po languages/ --no-purge", "env:start": "wp-env start", "env:stop": "wp-env stop", - "bump": "node bin/bump-version.js" + "bump": "node scripts/bump-version.js" }, "dependencies": { "@beapi/be-a11y": "^1.7.2", diff --git a/bin/bump-version.js b/scripts/bump-version.js similarity index 92% rename from bin/bump-version.js rename to scripts/bump-version.js index f51e122..43c641b 100755 --- a/bin/bump-version.js +++ b/scripts/bump-version.js @@ -314,39 +314,6 @@ const updateChangelogMd = ( nextVersion, date ) => { writeFile( relativePath, contents ); }; -/** - * Prepend a changelog stub in README.md. - * - * @param {string} nextVersion New version. - * @param {string} date Release date (YYYY-MM-DD). - * @return {void} - */ -const updateReadmeMd = ( nextVersion, date ) => { - const relativePath = 'README.md'; - let contents = readFile( relativePath ); - - if ( contents.includes( `### ${ nextVersion } -` ) ) { - throw new Error( - `README.md already contains an entry for ${ nextVersion }.` - ); - } - - const stub = `### ${ nextVersion } - ${ date } - -- TBD - -`; - - contents = replaceOnce( - contents, - '## Changelog\n\n', - `## Changelog\n\n${ stub }`, - `Changelog heading in ${ relativePath }` - ); - - writeFile( relativePath, contents ); -}; - /** * Main entry point. * @@ -409,9 +376,6 @@ const main = () => { updateChangelogMd( nextVersion, date ); updated.push( 'CHANGELOG.md' ); - updateReadmeMd( nextVersion, date ); - updated.push( 'README.md' ); - console.log( `Bumped version ${ currentVersion } → ${ nextVersion }` ); console.log( 'Updated files:' ); updated.forEach( ( file ) => console.log( ` - ${ file }` ) ); From 10a4188a41c859ba179cbf3a7762f28d443b5045 Mon Sep 17 00:00:00 2001 From: Paolo Tesei Date: Wed, 5 Aug 2026 16:22:32 +0200 Subject: [PATCH 5/7] refactor bump version script --- .distignore | 2 +- .gitattributes | 2 +- bin/bump.sh | 262 +++++++++++++++++++++++++++ package.json | 2 +- scripts/bump-version.js | 392 ---------------------------------------- 5 files changed, 265 insertions(+), 395 deletions(-) create mode 100644 bin/bump.sh delete mode 100755 scripts/bump-version.js diff --git a/.distignore b/.distignore index 48e1330..1c86fb2 100644 --- a/.distignore +++ b/.distignore @@ -4,7 +4,7 @@ /config /node_modules /tests -/scripts +/bin .distignore .editorconfig diff --git a/.gitattributes b/.gitattributes index edc4693..c2d7c0f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,7 +4,7 @@ /node_modules export-ignore -diff /tests export-ignore /vendor export-ignore -diff -/scripts export-ignore +/bin export-ignore /.distignore export-ignore /.editorconfig export-ignore /.gitattributes export-ignore diff --git a/bin/bump.sh b/bin/bump.sh new file mode 100644 index 0000000..38f9f7a --- /dev/null +++ b/bin/bump.sh @@ -0,0 +1,262 @@ +#!/usr/bin/env bash +# +# Bump the plugin version across package, block metadata, PHP, and docs. +# +# Usage (no chmod required): +# bash bin/bump.sh patch +# bash bin/bump.sh minor +# bash bin/bump.sh major +# bash bin/bump.sh 2.2.0 +# npm run bump -- patch +# npm run bump -- 2.2.0 +# +# macOS sed (-i '') is assumed. +# + +set -euo pipefail + +# --------------------------------------------------------------------------- +# Assets — add or remove paths here +# --------------------------------------------------------------------------- + +ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)" + +# JSON files that expose a top-level "version" field +JSON_VERSION_FILES=( + ".plugin-data" + "package.json" + "src/faq/block.json" + "src/faq-answer/block.json" + "src/faq-item/block.json" + "src/faq-question/block.json" +) + +PACKAGE_LOCK_FILE="package-lock.json" +PHP_FILE="blockparty-faq.php" +README_TXT="readme.txt" +CHANGELOG="CHANGELOG.md" + +# --------------------------------------------------------------------------- +# Helpers +# --------------------------------------------------------------------------- + +UPDATED_FILES=() + +log_updated() { + UPDATED_FILES+=( "$1" ) +} + +require_file() { + local file="$1" + if [[ ! -f "${ROOT_DIR}/${file}" ]]; then + echo "Error: Missing file ${file}" >&2 + exit 1 + fi +} + +replace_json_version() { + local file="$1" + local path="${ROOT_DIR}/${file}" + require_file "${file}" + sed -i '' "s/\"version\": \"[0-9]*\.[0-9]*\.[0-9]*\"/\"version\": \"${VERSION}\"/" "${path}" + log_updated "${file}" +} + +usage() { + local code="${1:-0}" + echo "Usage: bash bin/bump.sh " + echo "" + echo "Examples:" + echo " bash bin/bump.sh patch" + echo " bash bin/bump.sh minor" + echo " bash bin/bump.sh 2.2.0" + echo " npm run bump -- patch" + exit "${code}" +} + +resolve_version() { + local current="$1" + local input="$2" + + if [[ "${input}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "${input}" + return + fi + + local major minor patch + IFS='.' read -r major minor patch <<< "${current}" + + case "${input}" in + major) + echo "$((major + 1)).0.0" + ;; + minor) + echo "${major}.$((minor + 1)).0" + ;; + patch) + echo "${major}.${minor}.$((patch + 1))" + ;; + *) + echo "Error: Unknown bump argument \"${input}\". Use patch, minor, major, or an explicit x.y.z version." >&2 + exit 1 + ;; + esac +} + +escape_sed() { + printf '%s\n' "$1" | sed -e 's/[.[\*^$\/]/\\&/g' +} + +# --------------------------------------------------------------------------- +# Args +# --------------------------------------------------------------------------- + +if [[ -z "${1:-}" || "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then + usage "$([[ -n "${1:-}" ]] && echo 0 || echo 1)" +fi + +INPUT="$1" + +require_file ".plugin-data" +CURRENT="$(sed -n 's/.*"version"[[:space:]]*:[[:space:]]*"\([0-9]*\.[0-9]*\.[0-9]*\)".*/\1/p' "${ROOT_DIR}/.plugin-data" | head -n 1)" + +if [[ -z "${CURRENT}" ]]; then + echo "Error: Could not read current version from .plugin-data" >&2 + exit 1 +fi + +if ! [[ "${CURRENT}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Error: Invalid current version \"${CURRENT}\" in .plugin-data" >&2 + exit 1 +fi + +VERSION="$(resolve_version "${CURRENT}" "${INPUT}")" + +if [[ "${VERSION}" == "${CURRENT}" ]]; then + echo "Error: Version is already ${CURRENT}" >&2 + exit 1 +fi + +echo "Bumping version: ${CURRENT} → ${VERSION}" +TODAY="$(date +%Y-%m-%d)" + +# --------------------------------------------------------------------------- +# JSON version fields +# --------------------------------------------------------------------------- + +for file in "${JSON_VERSION_FILES[@]}"; do + replace_json_version "${file}" +done + +# --------------------------------------------------------------------------- +# package-lock.json (root + packages[""] only) +# --------------------------------------------------------------------------- + +if [[ -f "${ROOT_DIR}/${PACKAGE_LOCK_FILE}" ]]; then + # Root "version" (near top of file) + sed -i '' '1,5s/"version": "[0-9]*\.[0-9]*\.[0-9]*"/"version": "'"${VERSION}"'"/' "${ROOT_DIR}/${PACKAGE_LOCK_FILE}" + # packages[""].version + sed -i '' '6,12s/"version": "[0-9]*\.[0-9]*\.[0-9]*"/"version": "'"${VERSION}"'"/' "${ROOT_DIR}/${PACKAGE_LOCK_FILE}" + log_updated "${PACKAGE_LOCK_FILE}" +fi + +# --------------------------------------------------------------------------- +# Main plugin PHP +# --------------------------------------------------------------------------- + +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}" + +# --------------------------------------------------------------------------- +# readme.txt — Stable tag + changelog + Upgrade Notice stubs +# --------------------------------------------------------------------------- + +require_file "${README_TXT}" +sed -i '' "s/^\(Stable tag:[[:space:]]*\)$(escape_sed "${CURRENT}")/\1${VERSION}/" "${ROOT_DIR}/${README_TXT}" + +if grep -q "^= ${VERSION} - " "${ROOT_DIR}/${README_TXT}"; then + echo "Error: readme.txt already contains a changelog entry for ${VERSION}" >&2 + exit 1 +fi + +awk -v ver="${VERSION}" -v today="${TODAY}" -v current="${CURRENT}" ' + { + if ( $0 ~ ("^= " current " - ") ) { + print "= " ver " - " today " =" + print "* TBD" + print "" + } + print + } +' "${ROOT_DIR}/${README_TXT}" > "${ROOT_DIR}/${README_TXT}.tmp" +mv "${ROOT_DIR}/${README_TXT}.tmp" "${ROOT_DIR}/${README_TXT}" + +if grep -q "^= ${VERSION} =$" "${ROOT_DIR}/${README_TXT}"; then + echo "Error: readme.txt already contains an Upgrade Notice for ${VERSION}" >&2 + exit 1 +fi + +awk -v ver="${VERSION}" ' + { + print + if ( $0 == "== Upgrade Notice ==" ) { + getline + print "" + print "= " ver " =" + print "TBD" + print "" + if ( $0 != "" ) { + print + } + } + } +' "${ROOT_DIR}/${README_TXT}" > "${ROOT_DIR}/${README_TXT}.tmp" +mv "${ROOT_DIR}/${README_TXT}.tmp" "${ROOT_DIR}/${README_TXT}" +log_updated "${README_TXT}" + +# --------------------------------------------------------------------------- +# CHANGELOG.md — Keep a Changelog entry +# --------------------------------------------------------------------------- + +require_file "${CHANGELOG}" + +if grep -q "^## \[${VERSION}\]" "${ROOT_DIR}/${CHANGELOG}"; then + echo "Error: CHANGELOG.md already contains an entry for ${VERSION}" >&2 + exit 1 +fi + +awk -v ver="${VERSION}" -v today="${TODAY}" ' + { + print + if ( !inserted && index( $0, "Semantic Versioning" ) ) { + getline + print "" + print "## [" ver "] - " today + print "" + print "### Changed" + print "" + print "- TBD" + print "" + inserted = 1 + # Marker is followed by a blank line; skip the consumed blank. + next + } + } +' "${ROOT_DIR}/${CHANGELOG}" > "${ROOT_DIR}/${CHANGELOG}.tmp" +mv "${ROOT_DIR}/${CHANGELOG}.tmp" "${ROOT_DIR}/${CHANGELOG}" +log_updated "${CHANGELOG}" + +# --------------------------------------------------------------------------- +# Summary +# --------------------------------------------------------------------------- + +echo "" +echo "Bumped version ${CURRENT} → ${VERSION}" +echo "Updated files:" +for file in "${UPDATED_FILES[@]}"; do + echo " - ${file}" +done +echo "" +echo "Fill in the TBD changelog entries before releasing." diff --git a/package.json b/package.json index dbd7c47..5ba1142 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "make-json": "wp i18n make-json languages/blockparty-faq-fr_FR.po languages/ --no-purge", "env:start": "wp-env start", "env:stop": "wp-env stop", - "bump": "node scripts/bump-version.js" + "bump": "bash bin/bump.sh" }, "dependencies": { "@beapi/be-a11y": "^1.7.2", diff --git a/scripts/bump-version.js b/scripts/bump-version.js deleted file mode 100755 index 43c641b..0000000 --- a/scripts/bump-version.js +++ /dev/null @@ -1,392 +0,0 @@ -#!/usr/bin/env node -/** - * Bump the plugin version across package, block metadata, PHP, and docs. - * - * Usage: - * npm run bump -- patch - * npm run bump -- minor - * npm run bump -- major - * npm run bump -- 2.2.0 - * - * @package blockparty-faq - */ - -const fs = require( 'fs' ); -const path = require( 'path' ); - -const ROOT = path.resolve( __dirname, '..' ); - -const SEMVER_RE = /^(\d+)\.(\d+)\.(\d+)$/; - -/** - * Resolve the absolute path of a project-relative file. - * - * @param {string} relativePath Relative path from the project root. - * @return {string} Absolute file path. - */ -const resolvePath = ( relativePath ) => path.join( ROOT, relativePath ); - -/** - * Read a UTF-8 file from the project root. - * - * @param {string} relativePath Relative path from the project root. - * @return {string} File contents. - */ -const readFile = ( relativePath ) => - fs.readFileSync( resolvePath( relativePath ), 'utf8' ); - -/** - * Write a UTF-8 file to the project root. - * - * @param {string} relativePath Relative path from the project root. - * @param {string} contents File contents. - * @return {void} - */ -const writeFile = ( relativePath, contents ) => { - fs.writeFileSync( resolvePath( relativePath ), contents, 'utf8' ); -}; - -/** - * Parse a JSON file from the project root. - * - * @param {string} relativePath Relative path from the project root. - * @return {Object} Parsed JSON object. - */ -const readJson = ( relativePath ) => JSON.parse( readFile( relativePath ) ); - -/** - * Write a JSON file with tab indentation (project convention). - * - * @param {string} relativePath Relative path from the project root. - * @param {Object} data Data to serialize. - * @return {void} - */ -const writeJson = ( relativePath, data ) => { - writeFile( relativePath, `${ JSON.stringify( data, null, '\t' ) }\n` ); -}; - -/** - * Print usage help and exit. - * - * @param {number} exitCode Process exit code. - * @return {void} - */ -const printUsage = ( exitCode = 1 ) => { - console.error( ` -Usage: - npm run bump -- - -Examples: - npm run bump -- patch - npm run bump -- minor - npm run bump -- 2.2.0 -`.trim() ); - process.exit( exitCode ); -}; - -/** - * Compute the next semantic version. - * - * @param {string} current Current version (x.y.z). - * @param {string} bump Bump type or explicit version. - * @return {string} Next version. - */ -const getNextVersion = ( current, bump ) => { - if ( SEMVER_RE.test( bump ) ) { - return bump; - } - - const match = current.match( SEMVER_RE ); - if ( ! match ) { - throw new Error( `Invalid current version: ${ current }` ); - } - - let major = Number( match[ 1 ] ); - let minor = Number( match[ 2 ] ); - let patch = Number( match[ 3 ] ); - - switch ( bump ) { - case 'major': - major += 1; - minor = 0; - patch = 0; - break; - case 'minor': - minor += 1; - patch = 0; - break; - case 'patch': - patch += 1; - break; - default: - throw new Error( - `Unknown bump type "${ bump }". Use patch, minor, major, or x.y.z.` - ); - } - - return `${ major }.${ minor }.${ patch }`; -}; - -/** - * Format today's date as YYYY-MM-DD (local timezone). - * - * @return {string} ISO date string without time. - */ -const today = () => { - const now = new Date(); - const year = now.getFullYear(); - const month = String( now.getMonth() + 1 ).padStart( 2, '0' ); - const day = String( now.getDate() ).padStart( 2, '0' ); - return `${ year }-${ month }-${ day }`; -}; - -/** - * Replace the first occurrence of a pattern or throw. - * - * @param {string} contents File contents. - * @param {RegExp|string} search Search pattern. - * @param {string} replace Replacement. - * @param {string} label Human-readable label for errors. - * @return {string} Updated contents. - */ -const replaceOnce = ( contents, search, replace, label ) => { - if ( typeof search === 'string' ) { - if ( ! contents.includes( search ) ) { - throw new Error( `Could not find ${ label }.` ); - } - return contents.replace( search, replace ); - } - - if ( ! search.test( contents ) ) { - throw new Error( `Could not find ${ label }.` ); - } - - return contents.replace( search, replace ); -}; - -/** - * Update version fields in a JSON file that has a top-level "version" key. - * - * @param {string} relativePath Relative path from the project root. - * @param {string} version New version. - * @return {void} - */ -const updateJsonVersion = ( relativePath, version ) => { - const data = readJson( relativePath ); - if ( typeof data.version !== 'string' ) { - throw new Error( `Missing "version" in ${ relativePath }.` ); - } - data.version = version; - writeJson( relativePath, data ); -}; - -/** - * Update package-lock.json root package version fields. - * - * @param {string} version New version. - * @return {void} - */ -const updatePackageLock = ( version ) => { - const lockPath = 'package-lock.json'; - if ( ! fs.existsSync( resolvePath( lockPath ) ) ) { - return; - } - - const lock = readJson( lockPath ); - lock.version = version; - if ( lock.packages && lock.packages[ '' ] ) { - lock.packages[ '' ].version = version; - } - writeJson( lockPath, lock ); -}; - -/** - * Update version strings in the main plugin PHP file. - * - * @param {string} currentVersion Current version. - * @param {string} nextVersion New version. - * @return {void} - */ -const updatePluginPhp = ( currentVersion, nextVersion ) => { - const relativePath = 'blockparty-faq.php'; - let contents = readFile( relativePath ); - - contents = replaceOnce( - contents, - new RegExp( - `( \\* Version:\\s+)${ escapeRegExp( currentVersion ) }` - ), - `$1${ nextVersion }`, - `plugin header Version in ${ relativePath }` - ); - - contents = replaceOnce( - contents, - `define( 'BLOCKPARTY_FAQ_VERSION', '${ currentVersion }' );`, - `define( 'BLOCKPARTY_FAQ_VERSION', '${ nextVersion }' );`, - `BLOCKPARTY_FAQ_VERSION in ${ relativePath }` - ); - - writeFile( relativePath, contents ); -}; - -/** - * Escape a string for safe use inside a RegExp. - * - * @param {string} value Raw string. - * @return {string} Escaped string. - */ -const escapeRegExp = ( value ) => - value.replace( /[.*+?^${}()|[\]\\]/g, '\\$&' ); - -/** - * Update Stable tag and changelog stubs in readme.txt. - * - * @param {string} currentVersion Current version. - * @param {string} nextVersion New version. - * @param {string} date Release date (YYYY-MM-DD). - * @return {void} - */ -const updateReadmeTxt = ( currentVersion, nextVersion, date ) => { - const relativePath = 'readme.txt'; - let contents = readFile( relativePath ); - - contents = replaceOnce( - contents, - new RegExp( - `(Stable tag:\\s+)${ escapeRegExp( currentVersion ) }` - ), - `$1${ nextVersion }`, - `Stable tag in ${ relativePath }` - ); - - const changelogStub = `= ${ nextVersion } - ${ date } =\n* TBD\n\n`; - contents = replaceOnce( - contents, - `= ${ currentVersion }`, - `${ changelogStub }= ${ currentVersion }`, - `changelog section in ${ relativePath }` - ); - - const upgradeStub = `= ${ nextVersion } =\nTBD\n\n`; - contents = replaceOnce( - contents, - '== Upgrade Notice ==\n\n', - `== Upgrade Notice ==\n\n${ upgradeStub }`, - `Upgrade Notice in ${ relativePath }` - ); - - writeFile( relativePath, contents ); -}; - -/** - * Prepend a Keep a Changelog stub in CHANGELOG.md. - * - * @param {string} nextVersion New version. - * @param {string} date Release date (YYYY-MM-DD). - * @return {void} - */ -const updateChangelogMd = ( nextVersion, date ) => { - const relativePath = 'CHANGELOG.md'; - let contents = readFile( relativePath ); - - if ( contents.includes( `## [${ nextVersion }]` ) ) { - throw new Error( - `CHANGELOG.md already contains an entry for ${ nextVersion }.` - ); - } - - const stub = `## [${ nextVersion }] - ${ date } - -### Changed - -- TBD - -`; - - contents = replaceOnce( - contents, - 'and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n', - `and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n${ stub }`, - `Semantic Versioning intro in ${ relativePath }` - ); - - writeFile( relativePath, contents ); -}; - -/** - * Main entry point. - * - * @return {void} - */ -const main = () => { - const bumpArg = process.argv[ 2 ]; - - if ( ! bumpArg || bumpArg === '-h' || bumpArg === '--help' ) { - printUsage( bumpArg ? 0 : 1 ); - } - - const pluginData = readJson( '.plugin-data' ); - const packageJson = readJson( 'package.json' ); - - const currentVersion = pluginData.version || packageJson.version; - if ( ! SEMVER_RE.test( currentVersion ) ) { - throw new Error( `Invalid current version: ${ currentVersion }` ); - } - - const nextVersion = getNextVersion( currentVersion, bumpArg ); - if ( nextVersion === currentVersion ) { - throw new Error( - `Next version ${ nextVersion } is identical to the current version.` - ); - } - - const date = today(); - const updated = []; - - updateJsonVersion( '.plugin-data', nextVersion ); - updated.push( '.plugin-data' ); - - updateJsonVersion( 'package.json', nextVersion ); - updated.push( 'package.json' ); - - updatePackageLock( nextVersion ); - if ( fs.existsSync( resolvePath( 'package-lock.json' ) ) ) { - updated.push( 'package-lock.json' ); - } - - const blockJsonFiles = [ - 'src/faq/block.json', - 'src/faq-answer/block.json', - 'src/faq-item/block.json', - 'src/faq-question/block.json', - ]; - - blockJsonFiles.forEach( ( file ) => { - updateJsonVersion( file, nextVersion ); - updated.push( file ); - } ); - - updatePluginPhp( currentVersion, nextVersion ); - updated.push( 'blockparty-faq.php' ); - - updateReadmeTxt( currentVersion, nextVersion, date ); - updated.push( 'readme.txt' ); - - updateChangelogMd( nextVersion, date ); - updated.push( 'CHANGELOG.md' ); - - console.log( `Bumped version ${ currentVersion } → ${ nextVersion }` ); - console.log( 'Updated files:' ); - updated.forEach( ( file ) => console.log( ` - ${ file }` ) ); - console.log( - '\nFill in the TBD changelog entries before releasing.' - ); -}; - -try { - main(); -} catch ( error ) { - console.error( `Error: ${ error.message }` ); - process.exit( 1 ); -} From 78333cbc22e1df5a1920ee75700ae64b24999b53 Mon Sep 17 00:00:00 2001 From: Paolo Tesei Date: Tue, 4 Aug 2026 16:01:25 +0200 Subject: [PATCH 6/7] feat release 2.1.1 # Conflicts: # README.md --- .plugin-data | 2 +- CHANGELOG.md | 6 ++++++ blockparty-faq.php | 4 ++-- package-lock.json | 4 ++-- package.json | 4 ++-- readme.txt | 8 +++++++- src/faq-answer/block.json | 6 ++++-- src/faq-item/block.json | 6 ++++-- src/faq-question/block.json | 18 ++++++++++++++---- src/faq/block.json | 10 ++++++++-- 10 files changed, 50 insertions(+), 18 deletions(-) diff --git a/.plugin-data b/.plugin-data index 8bc87bb..fdbda80 100644 --- a/.plugin-data +++ b/.plugin-data @@ -1,4 +1,4 @@ { - "version": "2.1.0", + "version": "2.1.1", "slug": "blockparty-faq" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bfa564..ee828f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.1.1] - 2026-08-04 + +### Changed + +- TBD + ## [2.1.0] - 2026-06-30 ### Added diff --git a/blockparty-faq.php b/blockparty-faq.php index 6c1174e..ba57330 100644 --- a/blockparty-faq.php +++ b/blockparty-faq.php @@ -4,7 +4,7 @@ * Description: A FAQ block for WordPress Editor that provided structured data based on FAQ schema. * Requires at least: 6.2 * Requires PHP: 8.1 - * Version: 2.1.0 + * Version: 2.1.1 * Plugin URI: https://beapi.fr * Author: Be API Technical team * Author URI: https://beapi.fr @@ -45,7 +45,7 @@ } // Plugin constants -define( 'BLOCKPARTY_FAQ_VERSION', '2.1.0' ); +define( 'BLOCKPARTY_FAQ_VERSION', '2.1.1' ); // Plugin URL and PATH define( 'BLOCKPARTY_FAQ_DIR', plugin_dir_path( __FILE__ ) ); diff --git a/package-lock.json b/package-lock.json index 42a09a5..877ac3c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "blockparty-faq", - "version": "2.1.0", + "version": "2.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "blockparty-faq", - "version": "2.1.0", + "version": "2.1.1", "license": "GPL-2.0-or-later", "dependencies": { "@beapi/be-a11y": "^1.7.2", diff --git a/package.json b/package.json index 5ba1142..4739d74 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blockparty-faq", - "version": "2.1.0", + "version": "2.1.1", "description": "SEO friendly FAQ module in an accessible accordion", "author": "Be API Technical team", "license": "GPL-2.0-or-later", @@ -35,4 +35,4 @@ "volta": { "node": "20.12.0" } -} \ No newline at end of file +} diff --git a/readme.txt b/readme.txt index 02056ca..f4c5fc1 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: block, faq, accordion, gutenberg, schema, seo, accessibility Requires at least: 6.2 Tested up to: 6.8 Requires PHP: 8.1 -Stable tag: 2.1.0 +Stable tag: 2.1.1 License: GPL-2.0-or-later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -57,6 +57,9 @@ Yes. The front-end accordion uses `@beapi/be-a11y` with proper ARIA attributes ( == Changelog == += 2.1.1 - 2026-08-04 = +* Performance improvements removed script blocking time. + = 2.1.0 - 2026-06-30 = * Added configurable FAQ question heading level (h2–h6). * Added Rank Math SEO integration for FAQ structured data. @@ -106,6 +109,9 @@ Yes. The front-end accordion uses `@beapi/be-a11y` with proper ARIA attributes ( == Upgrade Notice == += 2.1.1 = +TBD + = 2.1.0 = Adds Rank Math and SEOPress support, configurable question heading levels, and updated block markup. Existing content is preserved via deprecated save handlers. diff --git a/src/faq-answer/block.json b/src/faq-answer/block.json index 69f4061..1f88f5b 100644 --- a/src/faq-answer/block.json +++ b/src/faq-answer/block.json @@ -2,10 +2,12 @@ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 3, "name": "blockparty/faq-answer", - "version": "2.1.0", + "version": "2.1.1", "title": "FAQ Answer", "category": "design", - "parent": [ "blockparty/faq-item" ], + "parent": [ + "blockparty/faq-item" + ], "description": "Content of the FAQ answer.", "supports": { "html": false, diff --git a/src/faq-item/block.json b/src/faq-item/block.json index 97292d5..b45013d 100644 --- a/src/faq-item/block.json +++ b/src/faq-item/block.json @@ -2,10 +2,12 @@ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 3, "name": "blockparty/faq-item", - "version": "2.1.0", + "version": "2.1.1", "title": "FAQ Item", "category": "design", - "parent": [ "blockparty/faq" ], + "parent": [ + "blockparty/faq" + ], "description": "A FAQ item containing a question and an answer.", "supports": { "html": false, diff --git a/src/faq-question/block.json b/src/faq-question/block.json index 9a21948..7ff59d7 100644 --- a/src/faq-question/block.json +++ b/src/faq-question/block.json @@ -2,12 +2,16 @@ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 3, "name": "blockparty/faq-question", - "version": "2.1.0", + "version": "2.1.1", "title": "FAQ Question", "category": "design", - "parent": [ "blockparty/faq-item" ], + "parent": [ + "blockparty/faq-item" + ], "description": "Content of the FAQ question.", - "usesContext": [ "blockparty/headingLevel" ], + "usesContext": [ + "blockparty/headingLevel" + ], "supports": { "html": false, "inserter": false, @@ -28,7 +32,13 @@ "headingLevel": { "type": "number", "default": 3, - "enum": [ 2, 3, 4, 5, 6 ] + "enum": [ + 2, + 3, + 4, + 5, + 6 + ] } }, "textdomain": "blockparty-faq", diff --git a/src/faq/block.json b/src/faq/block.json index 0507dec..ba4cecf 100644 --- a/src/faq/block.json +++ b/src/faq/block.json @@ -2,7 +2,7 @@ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 3, "name": "blockparty/faq", - "version": "2.1.0", + "version": "2.1.1", "title": "FAQ", "category": "design", "description": "A FAQ block for WordPress Editor that provided structured data based on FAQ schema.", @@ -18,7 +18,13 @@ "headingLevel": { "type": "number", "default": 3, - "enum": [ 2, 3, 4, 5, 6 ] + "enum": [ + 2, + 3, + 4, + 5, + 6 + ] } }, "providesContext": { From c43358749c189c045011f2260adc39d17f229a6e Mon Sep 17 00:00:00 2001 From: Paolo Tesei Date: Wed, 5 Aug 2026 09:31:49 +0200 Subject: [PATCH 7/7] clean changelog --- CHANGELOG.md | 2 +- readme.txt | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee828f2..77c9f73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- TBD +- Performance improvements removed script blocking time. ## [2.1.0] - 2026-06-30 diff --git a/readme.txt b/readme.txt index f4c5fc1..e70c5ea 100644 --- a/readme.txt +++ b/readme.txt @@ -109,9 +109,6 @@ Yes. The front-end accordion uses `@beapi/be-a11y` with proper ARIA attributes ( == Upgrade Notice == -= 2.1.1 = -TBD - = 2.1.0 = Adds Rank Math and SEOPress support, configurable question heading levels, and updated block markup. Existing content is preserved via deprecated save handlers.