Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/.wordpress-org
/node_modules
/src
/bin

.distignore
.editorconfig
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/.github export-ignore
/vendor/ export-ignore -diff
/node_modules export-ignore
/bin export-ignore

/.distignore export-ignore
/.editorconfig export-ignore
Expand Down
2 changes: 1 addition & 1 deletion .plugin-data
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "1.1.3",
"version": "1.1.4",
"slug": "blockparty-tabs"
}
2 changes: 1 addition & 1 deletion .wordpress-org/blueprints/blueprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"pluginData": {
"resource": "git:directory",
"url": "https://github.com/BeAPI/blockparty-tabs",
"ref": "1.1.3",
"ref": "1.1.4",
"refType": "tag"
},
"options": {
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ 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).

## 1.1.4 - 2026-08-04

- Performance improvements removed script blocking time.

## 1.1.3 - 2026-04-27

- Performance improvements
Expand Down
57 changes: 34 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,27 +84,36 @@ The plugin generates semantic HTML with proper ARIA attributes:

```html
<div class="wp-block-blockparty-tabs" role="tablist">
<ul class="wp-block-blockparty-tabs-nav">
<li class="wp-block-blockparty-tabs-nav-item is-active">
<a id="block-tab-0-0" role="tab" aria-controls="block-panel-0-0"
class="wp-block-blockparty-tabs-nav-link" href="#block-tab-0-0"
aria-selected="true">
<span>Tab 1</span>
</a>
</li>
<!-- More tabs... -->
</ul>

<section class="wp-block-blockparty-tabs-panels">
<div role="tabpanel" tabindex="0"
class="wp-block-blockparty-tabs-panel-item is-active"
id="block-panel-0-0" aria-labelledby="block-tab-0-0">
<div class="wp-block-blockparty-tabs-panel-item__inner">
<!-- Your content here -->
</div>
</div>
<!-- More panels... -->
</section>
<ul class="wp-block-blockparty-tabs-nav">
<li class="wp-block-blockparty-tabs-nav-item is-active">
<a
id="block-tab-0-0"
role="tab"
aria-controls="block-panel-0-0"
class="wp-block-blockparty-tabs-nav-link"
href="#block-tab-0-0"
aria-selected="true"
>
<span>Tab 1</span>
</a>
</li>
<!-- More tabs... -->
</ul>

<section class="wp-block-blockparty-tabs-panels">
<div
role="tabpanel"
tabindex="0"
class="wp-block-blockparty-tabs-panel-item is-active"
id="block-panel-0-0"
aria-labelledby="block-tab-0-0"
>
<div class="wp-block-blockparty-tabs-panel-item__inner">
<!-- Your content here -->
</div>
</div>
<!-- More panels... -->
</section>
</div>
```

Expand Down Expand Up @@ -134,9 +143,11 @@ npm run lint:css

For bug reports and feature requests, please use the [GitHub issues](https://github.com/BeAPI/blockparty-tabs/issues) page.

## Credits
## Changelog

Developed by [Be API Technical Team](https://beapi.fr)
See [readme.txt](readme.txt) and [CHANGELOG.md](CHANGELOG.md) for the full version history.

Developed with ❤️ by [Be API](https://beapi.fr)

## License

Expand Down
260 changes: 260 additions & 0 deletions bin/bump.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,260 @@
#!/usr/bin/env bash
#
# Bump the plugin version across project metadata, blocks, 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 1.2.0
# npm run bump -- patch
# npm run bump -- 1.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/blockparty-tabs/block.json"
"src/blockparty-tabs-nav/block.json"
"src/blockparty-tabs-nav-item/block.json"
"src/blockparty-tabs-panel-item/block.json"
"src/blockparty-tabs-panels/block.json"
)

PACKAGE_LOCK_FILE="package-lock.json"
PHP_FILE="blockparty-tabs.php"
README_TXT="readme.txt"
CHANGELOG="CHANGELOG.md"
README_MD="README.md"
BLUEPRINT=".wordpress-org/blueprints/blueprint.json"

# ---------------------------------------------------------------------------
# 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 <patch|minor|major|x.y.z>"
echo ""
echo "Examples:"
echo " bash bin/bump.sh patch"
echo " bash bin/bump.sh minor"
echo " bash bin/bump.sh 1.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
}

# ---------------------------------------------------------------------------
# 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}"

# ---------------------------------------------------------------------------
# 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:]]*\)[0-9]*\.[0-9]*\.[0-9]*/\1${VERSION}/" "${ROOT_DIR}/${PHP_FILE}"
sed -i '' "s/define( 'BLOCKPARTY_TABS_VERSION', '[0-9]*\.[0-9]*\.[0-9]*' )/define( 'BLOCKPARTY_TABS_VERSION', '${VERSION}' )/" "${ROOT_DIR}/${PHP_FILE}"
log_updated "${PHP_FILE}"

# ---------------------------------------------------------------------------
# readme.txt — Stable tag + changelog section
# ---------------------------------------------------------------------------

require_file "${README_TXT}"
sed -i '' "s/^\(Stable tag:[[:space:]]*\)[0-9]*\.[0-9]*\.[0-9]*/\1${VERSION}/" "${ROOT_DIR}/${README_TXT}"

if ! grep -q "^= ${VERSION} =$" "${ROOT_DIR}/${README_TXT}"; then
awk -v ver="${VERSION}" '
{
print
if ( $0 == "== Changelog ==" ) {
print ""
print "= " ver " ="
print ""
print "* "
print ""
getline
# Consume the blank line that followed "== Changelog ==".
if ( $0 != "" ) {
print
}
}
}
' "${ROOT_DIR}/${README_TXT}" > "${ROOT_DIR}/${README_TXT}.tmp"
mv "${ROOT_DIR}/${README_TXT}.tmp" "${ROOT_DIR}/${README_TXT}"
fi
log_updated "${README_TXT}"

# ---------------------------------------------------------------------------
# CHANGELOG.md — Keep a Changelog entry
# ---------------------------------------------------------------------------

require_file "${CHANGELOG}"
TODAY="$(date +%Y-%m-%d)"

if grep -q "^## ${VERSION}" "${ROOT_DIR}/${CHANGELOG}"; then
echo " skip ${CHANGELOG} (entry for ${VERSION} already exists)"
else
awk -v ver="${VERSION}" -v today="${TODAY}" '
{
print
if ( !inserted && index( $0, "Semantic Versioning" ) ) {
getline
print ""
print "## " ver " - " today
print ""
print "- "
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}"
fi

# ---------------------------------------------------------------------------
# Playground blueprint tag ref
# ---------------------------------------------------------------------------

require_file "${BLUEPRINT}"
sed -i '' "s/\"ref\": \"[0-9]*\.[0-9]*\.[0-9]*\"/\"ref\": \"${VERSION}\"/" "${ROOT_DIR}/${BLUEPRINT}"
log_updated "${BLUEPRINT}"

# ---------------------------------------------------------------------------
# README.md — replace old version string when present
# ---------------------------------------------------------------------------

if [[ -f "${ROOT_DIR}/${README_MD}" ]]; then
if grep -q "${CURRENT}" "${ROOT_DIR}/${README_MD}"; then
sed -i '' "s/${CURRENT}/${VERSION}/g" "${ROOT_DIR}/${README_MD}"
log_updated "${README_MD}"
else
echo " skip ${README_MD} (no version string to update)"
fi
fi

# ---------------------------------------------------------------------------
# Summary
# ---------------------------------------------------------------------------

echo ""
echo "Version updated to ${VERSION} in:"
for file in "${UPDATED_FILES[@]}"; do
echo " - ${file}"
done
echo ""
echo "Done. Fill in CHANGELOG.md / readme.txt notes before releasing."
4 changes: 2 additions & 2 deletions blockparty-tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Description: Accessible Tabs block for WordPress gutenberg.
* Requires at least: 6.2
* Requires PHP: 8.1
* Version: 1.1.3
* Version: 1.1.4
* Author: Be API Technical team
* Author URI: https://beapi.fr
* License: GPL-2.0-or-later
Expand All @@ -14,7 +14,7 @@

namespace Blockparty\Tabs;

define( 'BLOCKPARTY_TABS_VERSION', '1.1.3' );
define( 'BLOCKPARTY_TABS_VERSION', '1.1.4' );
define( 'BLOCKPARTY_TABS_URL', plugin_dir_url( __FILE__ ) );
define( 'BLOCKPARTY_TABS_DIR', plugin_dir_path( __FILE__ ) );
define( 'BLOCKPARTY_TABS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
Expand Down
Loading
Loading