From a43340d54197d5bd1fa357837dbaf4946661259d Mon Sep 17 00:00:00 2001 From: Jonathan Miller <230051081+jmiller-moko@users.noreply.github.com> Date: Thu, 8 Jan 2026 19:49:02 -0600 Subject: [PATCH] INIT --- .editorconfig | 41 ++ .git-blame-ignore-revs | 2 + .gitattributes | 125 ++++ .github/CODEOWNERS | 28 + .github/ISSUE_TEMPLATE/adr.md | 16 + .github/ISSUE_TEMPLATE/bug_report.md | 29 + .github/ISSUE_TEMPLATE/deployment_plan.md | 20 + .../ISSUE_TEMPLATE/documentation_change.md | 11 + .github/ISSUE_TEMPLATE/escalation.md | 14 + .github/ISSUE_TEMPLATE/feature_request.md | 21 + .github/ISSUE_TEMPLATE/incident_report.md | 19 + .github/ISSUE_TEMPLATE/migration_plan.md | 20 + .github/ISSUE_TEMPLATE/risk_register_entry.md | 13 + .github/ISSUE_TEMPLATE/runbook.md | 18 + .github/ISSUE_TEMPLATE/security_review.md | 15 + .github/pull_request_template.md | 20 + .github/workflows/build.yml | 92 +++ .github/workflows/ci.yml | 132 ++++ .../workflows/cleanup_version_branches.yml | 80 ++ .github/workflows/release_from_version.yml | 278 +++++++ .github/workflows/squash_version_to_main.yml | 109 +++ .github/workflows/updateserver.yml | 223 ++++++ .github/workflows/version_branch.yml | 227 ++++++ .gitignore | 72 ++ .gitmessage | 9 + CHANGELOG.md | 48 ++ CODE_OF_CONDUCT.md | 87 +++ CONTRIBUTING.md | 93 +++ LICENSE.md | 695 ++++++++++++++++++ README.md | 74 ++ docs/.gitkeep | 0 docs/guides/.gitkeep | 0 docs/guides/build-guide.md | 321 ++++++++ docs/guides/configuration-guide.md | 105 +++ docs/guides/installation-guide.md | 87 +++ docs/guides/operations-guide.md | 131 ++++ docs/guides/rollback-and-recovery-guide.md | 110 +++ docs/guides/troubleshooting-guide.md | 158 ++++ docs/guides/upgrade-and-versioning-guide.md | 117 +++ docs/index.md | 77 ++ docs/plugin-basic.md | 88 +++ docs/reference/.gitkeep | 0 docs/reference/plugin-overview.md | 32 + scripts/update_changelog.sh | 80 ++ scripts/validate_manifest.sh | 42 ++ scripts/verify_changelog.sh | 25 + .../language/overrides/en-GB.override.ini | 43 ++ .../language/overrides/en-US.override.ini | 43 ++ .../language/overrides/index.html | 1 + src/language/overrides/en-GB.override.ini | 43 ++ src/language/overrides/en-US.override.ini | 43 ++ src/language/overrides/index.html | 1 + 52 files changed, 4178 insertions(+) create mode 100644 .editorconfig create mode 100644 .git-blame-ignore-revs create mode 100644 .gitattributes create mode 100644 .github/CODEOWNERS create mode 100644 .github/ISSUE_TEMPLATE/adr.md create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/deployment_plan.md create mode 100644 .github/ISSUE_TEMPLATE/documentation_change.md create mode 100644 .github/ISSUE_TEMPLATE/escalation.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/incident_report.md create mode 100644 .github/ISSUE_TEMPLATE/migration_plan.md create mode 100644 .github/ISSUE_TEMPLATE/risk_register_entry.md create mode 100644 .github/ISSUE_TEMPLATE/runbook.md create mode 100644 .github/ISSUE_TEMPLATE/security_review.md create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/cleanup_version_branches.yml create mode 100644 .github/workflows/release_from_version.yml create mode 100644 .github/workflows/squash_version_to_main.yml create mode 100644 .github/workflows/updateserver.yml create mode 100644 .github/workflows/version_branch.yml create mode 100644 .gitignore create mode 100644 .gitmessage create mode 100644 CHANGELOG.md create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE.md create mode 100644 README.md create mode 100644 docs/.gitkeep create mode 100644 docs/guides/.gitkeep create mode 100644 docs/guides/build-guide.md create mode 100644 docs/guides/configuration-guide.md create mode 100644 docs/guides/installation-guide.md create mode 100644 docs/guides/operations-guide.md create mode 100644 docs/guides/rollback-and-recovery-guide.md create mode 100644 docs/guides/troubleshooting-guide.md create mode 100644 docs/guides/upgrade-and-versioning-guide.md create mode 100644 docs/index.md create mode 100644 docs/plugin-basic.md create mode 100644 docs/reference/.gitkeep create mode 100644 docs/reference/plugin-overview.md create mode 100644 scripts/update_changelog.sh create mode 100644 scripts/validate_manifest.sh create mode 100644 scripts/verify_changelog.sh create mode 100644 src/administrator/language/overrides/en-GB.override.ini create mode 100644 src/administrator/language/overrides/en-US.override.ini create mode 100644 src/administrator/language/overrides/index.html create mode 100644 src/language/overrides/en-GB.override.ini create mode 100644 src/language/overrides/en-US.override.ini create mode 100644 src/language/overrides/index.html diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..e868be93 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,41 @@ +# EditorConfig helps maintain consistent coding styles across different editors and IDEs +# https://editorconfig.org/ + +root = true + +# Default settings — Tabs preferred, width = 2 spaces +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = tab +tab_width = 2 + +# PowerShell scripts — tabs, 2-space visual width +[*.ps1] +indent_style = tab +tab_width = 2 +end_of_line = crlf + +# Markdown files — keep trailing whitespace for line breaks +[*.md] +trim_trailing_whitespace = false + +# JSON / YAML files — tabs, 2-space visual width +[*.{json,yml,yaml}] +indent_style = tab +tab_width = 2 + +# Makefiles — always tabs, default width +[Makefile] +indent_style = tab +tab_width = 2 + +# Windows batch scripts — keep CRLF endings +[*.{bat,cmd}] +end_of_line = crlf + +# Shell scripts — ensure LF endings +[*.sh] +end_of_line = lf diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 00000000..f577b093 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +# Add reformat-only commit SHAs here +# aaaaaaaa00000000000000000000000000000000 reformat: run formatter diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..0362f95f --- /dev/null +++ b/.gitattributes @@ -0,0 +1,125 @@ +############################################################################### +# Core normalization +############################################################################### +* text=auto eol=lf + +# Ensure consistent line endings for scripts +*.sh text eol=lf +*.bash text eol=lf +*.ps1 text eol=lf +*.cmd text eol=crlf +*.bat text eol=crlf + +############################################################################### +# Binary handling +############################################################################### +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.svg binary +*.ico binary +*.pdf binary +*.zip binary +*.tar binary +*.tar.gz binary +*.7z binary +*.docx binary +*.xlsx binary +*.pptx binary +*.mp3 binary +*.mp4 binary +*.woff binary +*.woff2 binary +*.ttf binary +*.otf binary + +############################################################################### +# Export control for GitHub Releases +# These paths will NOT appear in generated release archives +############################################################################### +# CI and automation +.github/ export-ignore +.github/workflows/ export-ignore +.gitlab/ export-ignore + +# Development and tooling +tests/ export-ignore +testing/ export-ignore +tmp/ export-ignore +docs-internal/ export-ignore +tools/ export-ignore + +# Dependency folders that should not ship in release bundles +node_modules/ export-ignore +vendor-dev/ export-ignore + +# Local environment and editor configs +*.local export-ignore +*.env export-ignore +*.env.example export-ignore +*.code-workspace export-ignore + +# Project specific non release scaffolding +dev-assets/ export-ignore +analysis/ export-ignore +research/ export-ignore + +############################################################################### +# Linguistic settings for GitHub code statistics +############################################################################### +*.css linguist-language=CSS +*.scss linguist-language=SCSS +*.js linguist-language=JavaScript +*.ts linguist-language=TypeScript +*.php linguist-language=PHP +*.xml linguist-language=XML +*.json linguist-language=JSON +*.ini linguist-language=INI +*.sql linguist-language=SQL +*.md linguist-language=Markdown + +############################################################################### +# Prevent diff noise for vendor or minified content +############################################################################### +vendor/* -diff +*.min.js -diff +*.min.css -diff + +############################################################################### +# Lockdown for generated files +############################################################################### +*.min.js linguist-generated=true +*.min.css linguist-generated=true + +############################################################################### +# Joomla Specific +############################################################################### + +# Exclude template media sources not intended for production bundles +media_src/ export-ignore +scss/ export-ignore +less/ export-ignore +*/media_src/ export-ignore +*/scss/ export-ignore +*/less/ export-ignore +*.min.* export-ignore + +# Prevent diff noise in compiled Joomla assets +media/*.min.js -diff +media/*.min.css -diff +*/media/*.min.js -diff +*/media/*.min.css -diff + +# Treat Joomla manifest and config files as XML for linguist +*.xml linguist-language=XML + +# Ensure PHP files in tmpl layouts are recognized consistently +html/**/*.php linguist-language=PHP +*/html/**/*.php linguist-language=PHP + +# Exclude local override folders commonly used during site development +html_overrides/ export-ignore +local_templates/ export-ignore +*/html_overrides/ export-ignore +*/local_templates/ export-ignore diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..ca579344 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,28 @@ +# Global ownership + +* @jmiller-moko @mokoconsulting-tech/engineering + +# Plugin root + +/ @jmiller-moko + +# Source code + +/src/ @jmiller-moko +/src/**/*.php @jmiller-moko +/src/**/*.xml @jmiller-moko + +# Language files + +/language/ @jmiller-moko +/language/** @jmiller-moko + +# Documentation + +/docs/ @jmiller-moko +/docs/** @jmiller-moko + +# GitHub workflow and tooling + +/.github/ @jmiller-moko +/.github/** @jmiller-moko diff --git a/.github/ISSUE_TEMPLATE/adr.md b/.github/ISSUE_TEMPLATE/adr.md new file mode 100644 index 00000000..5bf7ed9d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/adr.md @@ -0,0 +1,16 @@ +# Architecture Decision Record Proposal + +## Title + +## Status +Proposed + +## Context + +## Decision + +## Consequences + +## Alternatives Considered + +## Review and Approval diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..971cfdd7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,29 @@ +# Bug Report + +## Summary +Provide a concise description of the defect and impact. + +## Environment +- Application version +- Browser or OS +- Device +- Configuration details + +## Steps to Reproduce +1. +2. +3. + +## Expected Behavior + +## Actual Behavior + +## Logs / Screenshots + +## Severity & Impact + +## Related Incidents or Tickets + +## Acceptance Criteria + +## Review and Approval diff --git a/.github/ISSUE_TEMPLATE/deployment_plan.md b/.github/ISSUE_TEMPLATE/deployment_plan.md new file mode 100644 index 00000000..dc3d9a5c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/deployment_plan.md @@ -0,0 +1,20 @@ +# Deployment Plan + +## Purpose + +## Scope + +## Preconditions + +## Deployment Steps +1. +2. +3. + +## Validation + +## Rollback Plan + +## Communications + +## Review and Approval diff --git a/.github/ISSUE_TEMPLATE/documentation_change.md b/.github/ISSUE_TEMPLATE/documentation_change.md new file mode 100644 index 00000000..f68168c1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation_change.md @@ -0,0 +1,11 @@ +# Documentation Change + +## Summary + +## Context + +## Proposed Updates + +## Acceptance Criteria + +## Review and Approval diff --git a/.github/ISSUE_TEMPLATE/escalation.md b/.github/ISSUE_TEMPLATE/escalation.md new file mode 100644 index 00000000..11acd54e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/escalation.md @@ -0,0 +1,14 @@ +# Escalation + +## Trigger Conditions + +## Severity Level +SEV1 | SEV2 | SEV3 + +## Escalation Path + +## Communication Plan + +## Closure Criteria + +## Review and Approval diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..bbf530c6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,21 @@ +# Feature Request + +## Summary + +## Background / Problem Statement + +## Proposed Solution + +## Alternatives Considered + +## Technical Details + +## User Impact + +## Dependencies + +## Risks + +## Acceptance Criteria + +## Review and Approval diff --git a/.github/ISSUE_TEMPLATE/incident_report.md b/.github/ISSUE_TEMPLATE/incident_report.md new file mode 100644 index 00000000..5cacee18 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/incident_report.md @@ -0,0 +1,19 @@ +# Incident Report + +## Incident Summary + +## Timeline + +## Impact Assessment + +## Root Cause + +## Corrective Actions + +## Preventive Actions + +## Follow Up + +## Communications + +## Review and Approval diff --git a/.github/ISSUE_TEMPLATE/migration_plan.md b/.github/ISSUE_TEMPLATE/migration_plan.md new file mode 100644 index 00000000..16be1734 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/migration_plan.md @@ -0,0 +1,20 @@ +# Migration Plan + +## Purpose + +## Scope + +## Preconditions + +## Migration Steps +1. +2. +3. + +## Rollback Plan + +## Validation + +## Stakeholder Communications + +## Review and Approval diff --git a/.github/ISSUE_TEMPLATE/risk_register_entry.md b/.github/ISSUE_TEMPLATE/risk_register_entry.md new file mode 100644 index 00000000..9333d165 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/risk_register_entry.md @@ -0,0 +1,13 @@ +# Risk Register Entry + +## Risk Description + +## Probability and Impact + +## Mitigation Plan + +## Contingency Plan + +## Owners and Review Cadence + +## Review and Approval diff --git a/.github/ISSUE_TEMPLATE/runbook.md b/.github/ISSUE_TEMPLATE/runbook.md new file mode 100644 index 00000000..7d5a8b7c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/runbook.md @@ -0,0 +1,18 @@ +# Runbook + +## Purpose + +## Preconditions + +## Procedure +1. +2. +3. + +## Validation + +## Rollback + +## References + +## Review and Approval diff --git a/.github/ISSUE_TEMPLATE/security_review.md b/.github/ISSUE_TEMPLATE/security_review.md new file mode 100644 index 00000000..2797eb48 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/security_review.md @@ -0,0 +1,15 @@ +# Security Review + +## Purpose + +## Scope + +## Threat Model Summary + +## Findings + +## Remediation Actions + +## Approval + +## Review and Approval diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..d1b972f2 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,20 @@ +# Pull Request + +## Purpose + +## Change Summary + +## Testing Evidence + +## Risk and Rollback + +## Checklist +- [ ] Follows Conventional Commits +- [ ] Tests added or updated +- [ ] Documentation updated if required +- [ ] License header present where applicable +- [ ] Linked issue(s) referenced + +## Reviewer Notes + +## Review and Approval diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..42d42985 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,92 @@ +name: Build ZIP from src + +on: + release: + types: [prereleased, released] + workflow_dispatch: + inputs: + source_dir: + description: "Folder to zip (relative to repo root)" + required: false + default: "src" + zip_prefix: + description: "ZIP filename prefix (default repo name)" + required: false + default: "" + zip_name: + description: "Override full ZIP filename (without .zip)" + required: false + default: "" + +jobs: + + build-zip: + name: Build ZIP from src + runs-on: ubuntu-latest + + env: + DEFAULT_SOURCE_DIR: src + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Resolve build parameters + id: cfg + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ github.event.inputs.source_dir }}" ]; then + SRC_DIR="${{ github.event.inputs.source_dir }}" + else + SRC_DIR="${DEFAULT_SOURCE_DIR}" + fi + + if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ github.event.inputs.zip_prefix }}" ]; then + PREFIX="${{ github.event.inputs.zip_prefix }}" + else + PREFIX="${GITHUB_REPOSITORY##*/}" + fi + + if [ "${{ github.event_name }}" = "release" ]; then + REF_NAME="${GITHUB_REF_NAME}" + else + REF_NAME="${GITHUB_SHA::7}" + fi + + if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ github.event.inputs.zip_name }}" ]; then + ZIP_NAME="${{ github.event.inputs.zip_name }}" + else + ZIP_NAME="${PREFIX}-${REF_NAME}" + fi + + echo "src_dir=${SRC_DIR}" >> "$GITHUB_OUTPUT" + echo "zip_name=${ZIP_NAME}" >> "$GITHUB_OUTPUT" + + - name: Validate source directory + run: | + if [ ! -d "${{ steps.cfg.outputs.src_dir }}" ]; then + echo "Source directory '${{ steps.cfg.outputs.src_dir }}' does not exist." + exit 1 + fi + + - name: Prepare dist folder + run: | + mkdir -p dist + + - name: Build ZIP from folder contents + run: | + cd "${{ steps.cfg.outputs.src_dir }}" + zip -r "../dist/${{ steps.cfg.outputs.zip_name }}.zip" . + + - name: Upload artifact to workflow run + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.cfg.outputs.zip_name }} + path: dist/${{ steps.cfg.outputs.zip_name }}.zip + + - name: Attach ZIP to GitHub Release + if: github.event_name == 'release' + uses: softprops/action-gh-release@v2 + with: + files: dist/${{ steps.cfg.outputs.zip_name }}.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..8e65efdc --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,132 @@ +name: Continuous Integration Pipeline + +on: + push: + branches: + - main + - "version/*" + pull_request: + branches: + - main + +permissions: + contents: read + +jobs: + php-lint: + name: PHP lint + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "8.2" + coverage: none + + - name: Lint PHP files under src + run: | + if [ -d "src" ]; then + echo "Running php -l against PHP files in src/" + find src -type f -name "*.php" -print0 | xargs -0 -n 1 -P 4 php -l + else + echo "No src directory found. Skipping PHP lint." + fi + + composer-tests: + name: Composer install and tests + runs-on: ubuntu-latest + needs: php-lint + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "8.2" + coverage: none + + - name: Install dependencies if composer.json exists + run: | + if [ -f "composer.json" ]; then + composer install --no-interaction --no-progress --prefer-dist + else + echo "No composer.json found. Skipping dependency install and tests." + fi + + - name: Run Composer tests when defined + run: | + if [ ! -f "composer.json" ]; then + echo "No composer.json. Nothing to test." + exit 0 + fi + + if composer run -q | grep -q "^ test"; then + echo "Detected composer script 'test'. Running composer test." + composer test + else + echo "No 'test' script defined in composer.json. Skipping tests." + fi + + validate-manifest-and-changelog: + name: Validate manifest and changelog via scripts + runs-on: ubuntu-latest + needs: + - php-lint + - composer-tests + + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Run manifest validation script if present + run: | + set -e + echo "Checking for manifest validation scripts" + + if [ -x "scripts/validate_manifest.sh" ]; then + echo "Running scripts/validate_manifest.sh" + scripts/validate_manifest.sh + elif [ -f "scripts/validate_manifest.php" ]; then + echo "Running scripts/validate_manifest.php" + php scripts/validate_manifest.php + elif [ -f "scripts/validate_manifest.py" ]; then + echo "Running scripts/validate_manifest.py" + python scripts/validate_manifest.py + else + echo "No manifest validation script found (scripts/validate_manifest.*). Skipping manifest validation step." + fi + + - name: Run changelog update/verification script if present + run: | + set -e + echo "Checking for changelog update or verification scripts" + + if [ -x "scripts/update_changelog.sh" ]; then + echo "Running scripts/update_changelog.sh --ci" + scripts/update_changelog.sh --ci + elif [ -f "scripts/update_changelog.py" ]; then + echo "Running scripts/update_changelog.py --ci" + python scripts/update_changelog.py --ci + elif [ -x "scripts/verify_changelog.sh" ]; then + echo "Running scripts/verify_changelog.sh" + scripts/verify_changelog.sh + else + echo "No changelog script found (scripts/update_changelog.* or scripts/verify_changelog.sh). Skipping changelog enforcement." + exit 0 + fi + + echo "Checking for uncommitted changes after changelog script" + if ! git diff --quiet; then + echo "Changelog or related files were modified by the script." + echo "Please run the changelog script locally and commit the changes before pushing." + git diff + exit 1 + fi diff --git a/.github/workflows/cleanup_version_branches.yml b/.github/workflows/cleanup_version_branches.yml new file mode 100644 index 00000000..12503661 --- /dev/null +++ b/.github/workflows/cleanup_version_branches.yml @@ -0,0 +1,80 @@ +name: Cleanup merged version branches + +on: + workflow_dispatch: + schedule: + - cron: "0 3 * * 0" + # Runs every Sunday at 03:00 UTC; adjust if needed. + +permissions: + contents: write + +jobs: + cleanup-version-branches: + name: Delete merged version/* branches + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Fetch all remote branches + run: | + git fetch --all --prune + + - name: Identify merged version/* branches + id: find + run: | + # List remote version branches + REMOTE_BRANCHES=$(git branch -r --list "origin/version/*" | sed 's/^ *//') + + if [ -z "$REMOTE_BRANCHES" ]; then + echo "No remote version/* branches found." + echo "branches=" >> "$GITHUB_OUTPUT" + exit 0 + fi + + echo "Found version branches:" + echo "$REMOTE_BRANCHES" + + MERGED_BRANCHES=() + + # Determine which are fully merged into origin/main + for RB in $REMOTE_BRANCHES; do + # Strip the 'origin/' prefix for local tracking + LB=${RB#origin/} + + # Check merge status against origin/main + if git branch --remotes --merged origin/main | grep -q "$RB"; then + # Do not touch the currently checked out branch (defensive) + if [ "$LB" != "$GITHUB_REF_NAME" ]; then + MERGED_BRANCHES+=("$LB") + fi + fi + done + + if [ "${#MERGED_BRANCHES[@]}" -eq 0 ]; then + echo "No merged version/* branches to delete." + echo "branches=" >> "$GITHUB_OUTPUT" + exit 0 + fi + + echo "Merged version branches to delete:" + printf '%s\n' "${MERGED_BRANCHES[@]}" + + # Join into space-separated list for output + echo "branches=${MERGED_BRANCHES[*]}" >> "$GITHUB_OUTPUT" + + - name: Delete merged version branches on origin + if: steps.find.outputs.branches != '' + env: + BRANCHES: ${{ steps.find.outputs.branches }} + run: | + echo "Deleting merged version branches: ${BRANCHES}" + + for BR in ${BRANCHES}; do + echo "Deleting origin/${BR}" + git push origin --delete "${BR}" || echo "Failed to delete ${BR} (might already be gone)" + done diff --git a/.github/workflows/release_from_version.yml b/.github/workflows/release_from_version.yml new file mode 100644 index 00000000..fcb8b02d --- /dev/null +++ b/.github/workflows/release_from_version.yml @@ -0,0 +1,278 @@ +name: Version branch release pipeline + +on: + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + issues: write + +jobs: + meta: + name: Derive version metadata from branch + runs-on: ubuntu-latest + + outputs: + branch: ${{ steps.meta.outputs.branch }} + version: ${{ steps.meta.outputs.version }} + is_prerelease: ${{ steps.meta.outputs.is_prerelease }} + + steps: + - name: Determine branch and version + id: meta + run: | + BRANCH="${GITHUB_REF_NAME}" + + echo "Running on branch: ${BRANCH}" + + if [[ ! "${BRANCH}" =~ ^version\/[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9._]+)?$ ]]; then + echo "This workflow must be run on a branch named version/X.Y.Z or version/X.Y.Z-suffix" + exit 1 + fi + + VERSION="${BRANCH#version/}" + + echo "Detected version: ${VERSION}" + + if [[ "${VERSION}" =~ -(alpha|beta|rc|pre|preview|dev|test) ]]; then + echo "Version is prerelease: ${VERSION}" + IS_PRERELEASE="true" + else + echo "Version is stable: ${VERSION}" + IS_PRERELEASE="false" + fi + + echo "branch=${BRANCH}" >> "$GITHUB_OUTPUT" + echo "version=${VERSION}" >> "$GITHUB_OUTPUT" + echo "is_prerelease=${IS_PRERELEASE}" >> "$GITHUB_OUTPUT" + + build-and-test: + name: Build and test (sanity check) + runs-on: ubuntu-latest + needs: meta + + steps: + - name: Check out version branch + uses: actions/checkout@v4 + with: + ref: ${{ needs.meta.outputs.branch }} + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "8.2" + coverage: none + + - name: PHP lint under src (if present) + run: | + if [ -d "src" ]; then + echo "Running php -l against PHP files in src/" + find src -type f -name "*.php" -print0 | xargs -0 -n 1 -P 4 php -l + else + echo "No src directory found. Skipping PHP lint." + fi + + - name: Install dependencies if composer.json exists + run: | + if [ -f "composer.json" ]; then + composer install --no-interaction --no-progress --prefer-dist + else + echo "No composer.json found. Skipping composer install." + fi + + - name: Run Composer tests when defined + run: | + if [ ! -f "composer.json" ]; then + echo "No composer.json. Nothing to test." + exit 0 + fi + + if composer run -q | grep -q "^ test"; then + echo "Detected composer script 'test'. Running composer test." + composer test + else + echo "No 'test' script defined in composer.json. Skipping tests." + fi + + changelog: + name: Update CHANGELOG.md on version branch + runs-on: ubuntu-latest + needs: [meta, build-and-test] + + steps: + - name: Check out version branch with history + uses: actions/checkout@v4 + with: + ref: ${{ needs.meta.outputs.branch }} + fetch-depth: 0 + + - name: Fetch main for comparison + run: | + git fetch origin main + + - name: Update CHANGELOG using script + env: + VERSION: ${{ needs.meta.outputs.version }} + run: | + if [ ! -f "scripts/update_changelog.sh" ]; then + echo "ERROR: scripts/update_changelog.sh not found" + exit 1 + fi + + chmod +x scripts/update_changelog.sh + ./scripts/update_changelog.sh "${VERSION}" + + - name: Commit CHANGELOG.md if changed + env: + VERSION: ${{ needs.meta.outputs.version }} + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + if git diff --quiet; then + echo "No changelog changes to commit." + exit 0 + fi + + git add CHANGELOG.md + git commit -m "chore: update changelog for ${VERSION}" + git push origin HEAD + + pr-merge-release: + name: PR, conditional squash, and GitHub release + runs-on: ubuntu-latest + needs: [meta, changelog] + + steps: + - name: Check out version branch + uses: actions/checkout@v4 + with: + ref: ${{ needs.meta.outputs.branch }} + fetch-depth: 0 + + - name: Verify branch has commits ahead of main + run: | + git fetch origin main + + AHEAD_COUNT=$(git rev-list --count origin/main..HEAD) + echo "Commits ahead of main: ${AHEAD_COUNT}" + + if [ "${AHEAD_COUNT}" -eq 0 ]; then + echo "ERROR: No commits between main and ${GITHUB_REF_NAME}." + echo "Action required: commit changes to the version branch before running this workflow." + exit 1 + fi + + - name: Ensure standard PR labels exist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + echo "Ensuring standard labels exist" + gh label create "release" --color "0E8A16" --description "Release related PR" || echo "Label 'release' already exists" + gh label create "version-update" --color "5319E7" --description "Version bump and release PR" || echo "Label 'version-update' already exists" + + - name: Create or reuse PR from version branch to main + id: pr + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: ${{ needs.meta.outputs.branch }} + VERSION: ${{ needs.meta.outputs.version }} + run: | + echo "Ensuring PR exists for ${BRANCH} -> main" + + PR_NUMBER=$(gh pr list --head "${BRANCH}" --base "main" --state open --json number -q '.[0].number' || true) + + if [ -z "${PR_NUMBER}" ]; then + echo "No existing open PR found. Creating PR." + PR_URL=$(gh pr create --base "main" --head "${BRANCH}" --title "Merge version ${VERSION} into main" --body "Automated PR to merge version ${VERSION} into main.") + PR_NUMBER=$(gh pr view "${PR_URL}" --json number -q '.number') + + echo "Applying standard labels (non-blocking)" + gh pr edit "${PR_NUMBER}" --add-label "release" || echo "Label 'release' not found or cannot be applied" + gh pr edit "${PR_NUMBER}" --add-label "version-update" || echo "Label 'version-update' not found or cannot be applied" + else + echo "Found existing PR #${PR_NUMBER}" + fi + + echo "pr_number=${PR_NUMBER}" >> "$GITHUB_OUTPUT" + + - name: Squash merge PR into main (stable only) + if: needs.meta.outputs.is_prerelease == 'false' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO: ${{ github.repository }} + VERSION: ${{ needs.meta.outputs.version }} + PR_NUMBER: ${{ steps.pr.outputs.pr_number }} + run: | + if [ -z "${PR_NUMBER}" ]; then + echo "No pull request number returned. Cannot squash merge." + exit 1 + fi + + echo "Performing squash merge PR #${PR_NUMBER} into main" + + MERGE_PAYLOAD=$(jq -n --arg method "squash" --arg title "Squash merge version ${VERSION} into main" '{"merge_method": $method, "commit_title": $title}') + + curl -sS -X PUT -H "Authorization: Bearer ${GITHUB_TOKEN}" -H "Accept: application/vnd.github+json" "https://api.github.com/repos/${REPO}/pulls/${PR_NUMBER}/merge" -d "${MERGE_PAYLOAD}" + + - name: Skip squash (prerelease detected) + if: needs.meta.outputs.is_prerelease == 'true' + run: | + echo "Prerelease version detected. PR created but squash merge intentionally skipped." + + - name: Create GitHub Release (stable and prerelease) and attach ZIP from src + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VERSION: ${{ needs.meta.outputs.version }} + IS_PRERELEASE: ${{ needs.meta.outputs.is_prerelease }} + run: | + PRERELEASE_FLAG="false" + if [ "${IS_PRERELEASE}" = "true" ]; then + PRERELEASE_FLAG="true" + fi + + echo "Building ZIP from src for version ${VERSION}" + + REPO_NAME="${GITHUB_REPOSITORY##*/}" + ASSET_NAME="${REPO_NAME}-${VERSION}.zip" + + if [ ! -d "src" ]; then + echo "ERROR: src directory does not exist. Cannot build release ZIP." + exit 1 + fi + + mkdir -p dist + cd src + zip -r "../dist/${ASSET_NAME}" . + cd .. + + echo "Preparing GitHub release for ${VERSION} (prerelease=${PRERELEASE_FLAG}) with asset dist/${ASSET_NAME}" + + if gh release view "${VERSION}" >/dev/null 2>&1; then + echo "Release ${VERSION} already exists. Uploading asset." + gh release upload "${VERSION}" "dist/${ASSET_NAME}" --clobber + else + ARGS=( + "${VERSION}" + "dist/${ASSET_NAME}" + --title + "Version ${VERSION}" + --notes + "Release generated from branch version/${VERSION}." + ) + + if [ "${PRERELEASE_FLAG}" = "true" ]; then + ARGS+=(--prerelease) + fi + + gh release create "${ARGS[@]}" + fi + + - name: Optional delete version branch after merge (stable only) + if: needs.meta.outputs.is_prerelease == 'false' + env: + BRANCH: ${{ needs.meta.outputs.branch }} + run: | + echo "Deleting branch ${BRANCH} after squash merge and release" + git push origin --delete "${BRANCH}" || echo "Branch already deleted or cannot delete" diff --git a/.github/workflows/squash_version_to_main.yml b/.github/workflows/squash_version_to_main.yml new file mode 100644 index 00000000..6cd07114 --- /dev/null +++ b/.github/workflows/squash_version_to_main.yml @@ -0,0 +1,109 @@ +name: Squash merge version branch into main + +on: + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + +jobs: + squash-merge-version: + name: Conditional squash merge version/* into main + runs-on: ubuntu-latest + + steps: + - name: Determine branch and version + id: meta + run: | + BRANCH="${GITHUB_REF_NAME}" + + echo "Running on branch: $BRANCH" + + if [[ ! "$BRANCH" =~ ^version\/[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9]+)?$ ]]; then + echo "This workflow must be run on a branch named version/X.Y.Z or version/X.Y.Z-tag" + exit 1 + fi + + VERSION="${BRANCH#version/}" + + echo "Detected version: $VERSION" + + # prerelease detection + if [[ "$VERSION" =~ -(alpha|beta|rc|pre|preview|dev|test) ]]; then + echo "Version is prerelease: $VERSION" + IS_PRERELEASE="true" + else + echo "Version is stable: $VERSION" + IS_PRERELEASE="false" + fi + + echo "branch=$BRANCH" >> "$GITHUB_OUTPUT" + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + echo "is_prerelease=$IS_PRERELEASE" >> "$GITHUB_OUTPUT" + + - name: Check out repository + uses: actions/checkout@v4 + + - name: Create or reuse PR from version branch to main + id: cpr + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.GITHUB_TOKEN }} + head: ${{ steps.meta.outputs.branch }} + base: main + title: "Merge version ${{ steps.meta.outputs.version }} into main" + body: | + Automated PR to merge version **${{ steps.meta.outputs.version }}** into **main**. + + - Branch: `${{ steps.meta.outputs.branch }}` + - Version: `${{ steps.meta.outputs.version }}` + - Prerelease: `${{ steps.meta.outputs.is_prerelease }}` + + This PR was generated by the squash merge workflow. + labels: | + release + version-update + + ########################################################### + # Only squash merge IF the branch version is NOT prerelease + ########################################################### + - name: Squash merge PR into main (stable only) + if: steps.meta.outputs.is_prerelease == 'false' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO: ${{ github.repository }} + VERSION: ${{ steps.meta.outputs.version }} + PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }} + run: | + if [ -z "$PR_NUMBER" ]; then + echo "No pull request number returned. Cannot squash merge." + exit 1 + fi + + echo "Performing squash merge PR #${PR_NUMBER} into main" + + curl -sS -X PUT \ + -H "Authorization: Bearer ${GITHUB_TOKEN}" \ + -H "Accept: application/vnd.github+json" \ + "https://api.github.com/repos/${REPO}/pulls/${PR_NUMBER}/merge" \ + -d "$(jq -n \ + --arg method "squash" \ + --arg title "Squash merge version ${VERSION} into main" \ + '{merge_method: $method, commit_title: $title}')" + + ########################################################### + # If prerelease, annotate and skip squash + ########################################################### + - name: Skip squash (prerelease detected) + if: steps.meta.outputs.is_prerelease == 'true' + run: | + echo "Prerelease version detected. PR created but squash merge intentionally skipped." + + - name: Optional delete version branch after merge + if: steps.meta.outputs.is_prerelease == 'false' + env: + BRANCH: ${{ steps.meta.outputs.branch }} + run: | + echo "Deleting branch ${BRANCH} after squash merge" + git push origin --delete "${BRANCH}" || echo "Branch already deleted or cannot delete" diff --git a/.github/workflows/updateserver.yml b/.github/workflows/updateserver.yml new file mode 100644 index 00000000..cc228102 --- /dev/null +++ b/.github/workflows/updateserver.yml @@ -0,0 +1,223 @@ +name: Update Joomla Update Server XML Feed + +on: + release: + types: [prereleased, released] + workflow_dispatch: + inputs: + version: + description: "Version to publish (defaults to release tag on release events)" + required: false + default: "" + asset_name: + description: "ZIP asset base name (without .zip). Defaults to -." + required: false + default: "" + +permissions: + contents: write + issues: write + +env: + EXT_NAME: "MokoWaaS-Brand" + EXT_ELEMENT: "mokowaasbrand" + EXT_TYPE: "plugin" + EXT_FOLDER: "system" + EXT_CLIENT: "site" + EXT_INFOURL: "https://github.com/mokoconsulting-tech/mokowaasbrand" + EXT_CATEGORY: "MokoWaaS-Brand" + +jobs: + update-server: + name: Publish version to UpdateServer + runs-on: ubuntu-latest + environment: UpdateServer + + steps: + - name: Resolve version and asset metadata + id: meta + run: | + if [ "${{ github.event_name }}" = "release" ]; then + VERSION="${{ github.event.release.tag_name }}" + else + VERSION="${{ github.event.inputs.version }}" + fi + + if [ -z "$VERSION" ]; then + echo "Version is not defined. Provide it via workflow_dispatch input 'version' when not running on a release." + exit 1 + fi + + # Skip RC versions (do not publish to update server) + if echo "$VERSION" | grep -qiE "(^|[-.])rc([-.]|$)"; then + echo "RC version detected (${VERSION}). Update server publication is skipped by policy." + echo "skip=true" >> "$GITHUB_OUTPUT" + exit 0 + fi + + echo "skip=false" >> "$GITHUB_OUTPUT" + + if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ github.event.inputs.asset_name }}" ]; then + ASSET_NAME="${{ github.event.inputs.asset_name }}" + else + REPO_NAME="${GITHUB_REPOSITORY##*/}" + ASSET_NAME="${REPO_NAME}-${VERSION}" + fi + + DOWNLOAD_URL="https://github.com/${GITHUB_REPOSITORY}/releases/download/${VERSION}/${ASSET_NAME}.zip" + + echo "Resolved version: $VERSION" + echo "Resolved asset name: $ASSET_NAME" + echo "Resolved download URL: $DOWNLOAD_URL" + + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + echo "asset_name=$ASSET_NAME" >> "$GITHUB_OUTPUT" + echo "download_url=$DOWNLOAD_URL" >> "$GITHUB_OUTPUT" + + - name: Parse UpdateServer URL from environment variable + if: steps.meta.outputs.skip != 'true' + id: parse + env: + UPDATESERVER_FILE_URL: ${{ vars.UPDATESERVER_FILE_URL }} + run: | + python << 'PY' + import os + from urllib.parse import urlparse + + url = os.environ.get("UPDATESERVER_FILE_URL", "").strip() + if not url: + raise SystemExit("UPDATESERVER_FILE_URL is not set in the UpdateServer environment") + + parsed = urlparse(url) + parts = parsed.path.strip("/").split("/") + + # Expect: //blob// + if len(parts) < 5 or parts[2] != "blob": + raise SystemExit(f"Unexpected UPDATESERVER_FILE_URL format: {url}") + + owner = parts[0] + repo = parts[1] + branch = parts[3] + file_path = "/".join(parts[4:]) + + with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as fh: + fh.write(f"update_repo={owner}/{repo}") + fh.write(f"update_branch={branch}") + fh.write(f"update_file={file_path}") + PY + + - name: Check out update server repository + if: steps.meta.outputs.skip != 'true' + uses: actions/checkout@v4 + with: + repository: ${{ steps.parse.outputs.update_repo }} + ref: ${{ steps.parse.outputs.update_branch }} + token: ${{ secrets.MOKO_UPDATES_TOKEN }} + fetch-depth: 0 + + - name: Update updates.xml + if: steps.meta.outputs.skip != 'true' + env: + VERSION: ${{ steps.meta.outputs.version }} + DOWNLOAD_URL: ${{ steps.meta.outputs.download_url }} + UPDATE_FILE: ${{ steps.parse.outputs.update_file }} + EXT_NAME: ${{ env.EXT_NAME }} + EXT_ELEMENT: ${{ env.EXT_ELEMENT }} + EXT_TYPE: ${{ env.EXT_TYPE }} + EXT_FOLDER: ${{ env.EXT_FOLDER }} + EXT_CLIENT: ${{ env.EXT_CLIENT }} + EXT_INFOURL: ${{ env.EXT_INFOURL }} + EXT_CATEGORY: ${{ env.EXT_CATEGORY }} + run: | + python << 'PY' + import os + from datetime import datetime + import xml.etree.ElementTree as ET + from pathlib import Path + + xml_path = Path(os.environ["UPDATE_FILE"]) + if not xml_path.exists(): + raise SystemExit(f"{xml_path} not found in update server repository") + + tree = ET.parse(xml_path) + root = tree.getroot() + + version = os.environ["VERSION"] + download_url = os.environ["DOWNLOAD_URL"] + + name = os.environ["EXT_NAME"] + element = os.environ["EXT_ELEMENT"] + ext_type = os.environ["EXT_TYPE"] + folder = os.environ["EXT_FOLDER"] + client = os.environ["EXT_CLIENT"] + infourl = os.environ["EXT_INFOURL"] + category = os.environ["EXT_CATEGORY"] + + target = None + for upd in root.findall("update"): + v_node = upd.find("version") + if v_node is not None and (v_node.text or "").strip() == version: + target = upd + break + + if target is None: + target = ET.SubElement(root, "update") + + def ensure_child(parent, tag, text=None): + node = parent.find(tag) + if node is None: + node = ET.SubElement(parent, tag) + if text is not None: + node.text = text + return node + + ensure_child(target, "name", name) + ensure_child(target, "description", f"{name} extension") + ensure_child(target, "element", element) + ensure_child(target, "type", ext_type) + ensure_child(target, "folder", folder) + ensure_child(target, "client", client) + ensure_child(target, "version", version) + ensure_child(target, "infourl", infourl) + + downloads = target.find("downloads") + if downloads is None: + downloads = ET.SubElement(target, "downloads") + + for child in list(downloads): + if child.tag == "downloadurl": + downloads.remove(child) + + dl = ET.SubElement(downloads, "downloadurl", type="full", format="zip") + dl.text = download_url + + ensure_child(target, "maintainer", "Moko Consulting") + ensure_child(target, "maintainerurl", "https://mokoconsulting.tech") + ensure_child(target, "category", category) + ensure_child(target, "creationDate", datetime.utcnow().strftime("%Y-%m-%d")) + + tree.write(xml_path, encoding="utf-8", xml_declaration=True) + PY + + - name: Configure git user + if: steps.meta.outputs.skip != 'true' + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + - name: Commit and push update server changes + if: steps.meta.outputs.skip != 'true' + env: + VERSION: ${{ steps.meta.outputs.version }} + UPDATE_FILE: ${{ steps.parse.outputs.update_file }} + run: | + git status + + if git diff --quiet; then + echo "No changes to commit in update server repository." + exit 0 + fi + + git add "${UPDATE_FILE}" README.md || true + git commit -m "Update server metadata for version ${VERSION}" + git push diff --git a/.github/workflows/version_branch.yml b/.github/workflows/version_branch.yml new file mode 100644 index 00000000..1e6c3f9d --- /dev/null +++ b/.github/workflows/version_branch.yml @@ -0,0 +1,227 @@ +name: Create version branch and bump versions + +on: + workflow_dispatch: + inputs: + new_version: + description: "New version (for example: 01.02.00). Leave blank to auto-increment from highest version/* branch." + required: false + default: "" + base_branch: + description: "Base branch to create version branch from" + required: false + default: "main" + +permissions: + contents: write + +jobs: + create-version-branch: + name: Create version branch and update versions + runs-on: ubuntu-latest + + env: + BASE_BRANCH: ${{ github.event.inputs.base_branch }} + + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ env.BASE_BRANCH }} + + - name: Determine new version (input or auto-increment) + id: version + env: + INPUT_VERSION: ${{ github.event.inputs.new_version }} + run: | + python << 'PY' + import os + import re + import subprocess + + input_version = os.environ.get("INPUT_VERSION", "").strip() + + if input_version: + new_version = input_version + else: + completed = subprocess.run( + ["git", "ls-remote", "--heads", "origin"], + check=True, + capture_output=True, + text=True, + ) + + pattern = re.compile(r"refs/heads/version/([0-9]+\.[0-9]+\.[0-9]+)$") + versions = [] + + for line in completed.stdout.splitlines(): + parts = line.split() + if len(parts) != 2: + continue + ref = parts[1] + m = pattern.search(ref) + if not m: + continue + + v_str = m.group(1) + try: + major, minor, patch = map(int, v_str.split(".")) + except ValueError: + continue + versions.append((major, minor, patch)) + + if versions: + major, minor, patch = max(versions) + patch += 1 + else: + major, minor, patch = 1, 0, 0 + + new_version = f"{major:02d}.{minor:02d}.{patch:02d}" + + print(f"Using version {new_version}") + + with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as fh: + fh.write(f"new_version={new_version}\n") + PY + + - name: Compute branch name + id: branch + env: + NEW_VERSION: ${{ steps.version.outputs.new_version }} + run: | + SAFE_VERSION="${NEW_VERSION// /-}" + BRANCH_NAME="version/${SAFE_VERSION}" + echo "Using branch name: $BRANCH_NAME" + echo "branch_name=$BRANCH_NAME" >> "$GITHUB_OUTPUT" + + - name: Create version branch from base + run: | + git checkout -b "${{ steps.branch.outputs.branch_name }}" + + - name: Bump version strings across repo + env: + NEW_VERSION: ${{ steps.version.outputs.new_version }} + run: | + echo "Updating version strings to ${NEW_VERSION} across repository" + + python << 'PY' + import os + import re + from pathlib import Path + + new_version = os.environ["NEW_VERSION"] + + targets = [ + Path("src"), + Path("docs"), + ] + + patterns = [ + (re.compile(r"\(VERSION\s+[0-9]+\.[0-9]+\.[0-9]+\)"), lambda v: f"(VERSION {v})"), + (re.compile(r"(VERSION[:\s]+)([0-9]+\.[0-9]+\.[0-9]+)"), lambda v: r"\1" + v), + (re.compile(r"()([0-9]+\.[0-9]+\.[0-9]+)()"), lambda v: r"\1" + v + r"\3"), + (re.compile(r'(]*\\bversion=")([0-9]+\.[0-9]+\.[0-9]+)(")'), lambda v: r"\1" + v + r"\3"), + (re.compile(r'(\"version\"\s*:\s*\")(\d+\.\d+\.\d+)(\")'), lambda v: r"\1" + v + r"\3"), + ] + + def update_file(path: Path) -> bool: + try: + text = path.read_text(encoding="utf-8") + except UnicodeDecodeError: + return False + + original = text + for regex, repl in patterns: + text = regex.sub(lambda m, r=repl: r(m), text) + + if text != original: + path.write_text(text, encoding="utf-8") + print(f"Updated version in {path}") + return True + + return False + + for root in targets: + if not root.exists(): + continue + + for path in root.rglob("*"): + if not path.is_file(): + continue + + if path.suffix.lower() in { + ".png", ".jpg", ".jpeg", ".gif", ".svg", ".ico", + ".zip", ".pdf", ".tar", ".gz", + }: + continue + + update_file(path) + + repo_root = Path(".").resolve() + + def is_under_any_target(p: Path) -> bool: + for t in targets: + if not t.exists(): + continue + try: + p.resolve().relative_to(t.resolve()) + return True + except ValueError: + continue + return False + + # Explicitly update README.md and CHANGELOG.md + for fname in ["README.md", "CHANGELOG.md"]: + p = Path(fname) + if p.exists() and p.is_file(): + update_file(p) + + # Update remaining markdown files outside src/docs + for path in repo_root.rglob("*.md"): + if not path.is_file(): + continue + + if path.name.lower() in {"readme.md", "changelog.md"}: + continue + + if is_under_any_target(path): + continue + + update_file(path) + PY + + - name: Update CHANGELOG using script + env: + NEW_VERSION: ${{ steps.version.outputs.new_version }} + run: | + if [ ! -f "scripts/update_changelog.sh" ]; then + echo "scripts/update_changelog.sh not found. Failing version branch creation." + exit 1 + fi + + chmod +x scripts/update_changelog.sh + ./scripts/update_changelog.sh "${NEW_VERSION}" + + - name: Configure git user + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + - name: Commit version bump + env: + NEW_VERSION: ${{ steps.version.outputs.new_version }} + run: | + git status + if git diff --quiet; then + echo "No changes detected after version bump. Skipping commit." + exit 0 + fi + + git add -A + + git commit -m "chore: bump version to ${NEW_VERSION}" + + - name: Push version branch + run: | + git push -u origin "${{ steps.branch.outputs.branch_name }}" diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..e6c94d27 --- /dev/null +++ b/.gitignore @@ -0,0 +1,72 @@ +# ============================================================ +.env +.env.local +.env.*.local +*.local.php +*.secret.php + +# ============================================================ +# Logs, dumps & databases +# ============================================================ +*.log +*.pid +*.seed +*.sql +*.sql.gz +*.sqlite +*.sqlite3 +*.db +*.db-journal + +# ============================================================ +# OS / Editor / IDE cruft +# ============================================================ +.DS_Store +Thumbs.db +desktop.ini +# Windows artifacts +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db +$RECYCLE.BIN/ +System Volume Information/ +*.lnk +Icon? +.idea/ +.vscode/ +*.code-workspace +*.sublime-project +*.sublime-workspace +.project +.settings/ +.buildpath + +# ============================================================ +# Dev scripts & scratch +# ============================================================ +todo +todo.md + +# ============================================================ +# Maps & compiled asset helpers +# ============================================================ +*.css.map +*.js.map + +# ============================================================ +# SFTP / sync tools +# ============================================================ +sftp-config*.json +sync.ffs_db +*.ffs_gui + +# ============================================================ +# Replit / cloud IDE +# ============================================================ +.replit +replit.md + +# ============================================================ +# Keep-empty folders helper +# ============================================================ +!.gitkeep diff --git a/.gitmessage b/.gitmessage new file mode 100644 index 00000000..70f20360 --- /dev/null +++ b/.gitmessage @@ -0,0 +1,9 @@ +# (): +# types: build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test +# subject: imperative, lower-case, no trailing period + +# Body: what and why + +# BREAKING CHANGE: +# Closes: #123 +# Signed-off-by: diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..8dc85a46 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,48 @@ + +# Changelog + +## [01.03.00] - 2025-12-11 +- Cleanup + +## [01.02.01] - 2025-12-11 +- Version bump + +## [01.02.00] - 2025-12-11 +- Created `/docs/` +- Created `mokowaasbrand\.github\workflows\build.yml` +- Added image and favicon replacement feature + +## [01.01.05] - 2025-12-11 +- Version bump + +## [01.01.04] - 2025-12-11 +- Manifest Fix + +## [01.01.03] - 2025-12-11 +- Fixed Administrator Language location + +## [01.01.02] - 2025-12-11 +- Moved code to `/src/` +- Alignment with Release Deployment pipeline + +## [1.0] - YYYY-MM-DD +### Added +- First published draft diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..2910393f --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,87 @@ + +# Code of Conduct + +## 1. Purpose + +The purpose of this Code of Conduct is to ensure a safe, inclusive, and respectful environment for all contributors and participants in Moko Consulting projects. This applies to all interactions, whether in repositories, issue trackers, documentation, meetings, or community spaces. + +## 2. Our Standards + +Participants are expected to uphold behaviors that strengthen our community, including: + + Demonstrating empathy and respect toward others. + Being inclusive of diverse viewpoints and backgrounds. + Gracefully accepting constructive feedback. + Prioritizing collaboration over conflict. + Showing professionalism in all interactions. + +### Unacceptable behavior includes: + + Harassment, discrimination, or derogatory comments. + Threatening or violent language or actions. + Disruptive, aggressive, or intentionally harmful behavior. + Publishing others’ private information without permission. + Any behavior that violates applicable laws. + +## 3. Responsibilities of Maintainers + +Maintainers are responsible for: + + Clarifying acceptable behavior. + Taking appropriate corrective action when unacceptable behavior occurs. + Removing, editing, or rejecting contributions that violate this Code. + Temporarily or permanently banning contributors who engage in repeated or severe violations. + +## 4. Scope + +This Code applies to: + + All Moko Consulting repositories. + All documentation and collaboration platforms. + Public and private communication related to project activities. + Any representation of Moko Consulting in online or offline spaces. + +## 5. Enforcement + +Instances of misconduct may be reported to: +**[hello@mokoconsulting.tech](mailto:hello@mokoconsulting.tech)** + +All reports will be reviewed and investigated promptly and fairly. Maintainers are obligated to maintain confidentiality where possible. + +Consequences may include: + + A warning. + Required training or mediation. + Temporary or permanent bans. + Escalation to legal authorities when required. + +## 6. Acknowledgements + +This Code of Conduct is inspired by widely adopted community guidelines, including the Contributor Covenant and major open-source collaboration standards. + +## 7. Related Documents + + [Governance Guide](./docs-governance.md) + [Contributor Guide](./docs-contributing.md) + [Documentation Index](./docs-index.md) + +This Code of Conduct is a living document and may be updated following the established Change Management process. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..ef709fe9 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,93 @@ + + +# Contributing to MokoWaaS-Brand (VERSION: 01.03.00) + +## Overview +Contributions to the MokoWaaS-Brand plugin follow standardized development, governance, and quality control expectations defined by Moko Consulting. This document outlines contribution requirements, acceptable change types, branch management, testing expectations, and release readiness standards. + +## 1. Contribution Workflow +All contributions must follow the established workflow: +1. Fork the repository or create a feature branch (if internal). +2. Ensure your environment matches the supported Joomla and PHP versions. +3. Implement changes following coding, documentation, and metadata standards. +4. Validate plugin functionality locally. +5. Submit a Pull Request (PR) for review. + +## 2. Branching Model +- `main`: Production stable branch. +- `develop`: Aggregates work for the next minor release. +- `feature/*`: New enhancements or changes. +- `bugfix/*`: Hotfixes and corrections. + +Internal teams must coordinate with governance before creating major feature branches. + +## 3. Coding and Documentation Standards +All code must: +- Follow MokoCodingDefaults +- Include the unified SPDX license header +- Include a FILE INFORMATION metadata block +- Avoid deprecated Joomla APIs +- Preserve load order compatibility with other system plugins + +Documentation must: +- Include metadata +- Maintain revision history +- Use consistent formatting as defined by Moko documentation standards + +## 4. Testing Requirements +Before submitting a PR, contributors must verify: +- Plugin installs successfully in Joomla 5.x +- No load errors appear in logs +- Branding replacements appear as expected +- Terminology strings are correct +- No regressions in administrator UI + +Automated testing coverage will expand as part of future roadmap enhancements. + +## 5. Pull Request Requirements +A PR must include: +- Description of change +- Screenshots for UI related updates +- Version updates when appropriate +- Notes for documentation changes +- Reference to related issues or tasks + +PRs lacking required information may be flagged or delayed. + +## 6. Release Versioning +Changes must follow semantic versioning: +- MAJOR: Structural branding or architectural changes +- MINOR: Feature updates or terminology expansion +- PATCH: Bug fixes or language corrections + +Version updates must be reflected in: +- Manifest files +- PHP headers +- Documentation metadata + +## 7. Code Review Standards +Reviewers validate: +- Code quality and clarity +- Compliance with MokoCodingDefaults +- Impact to templates and WaaS branding rules +- Backwards compatibility expectations + +## Revision History +| Date | Author | Description | +| ------ | -------- | ----------- | +| 2025-12-11 | Jonathan Miller (@jmiller-moko) | Initial creation of contribution guidelines | diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 00000000..9ae6c550 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,695 @@ + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. + diff --git a/README.md b/README.md new file mode 100644 index 00000000..70f50279 --- /dev/null +++ b/README.md @@ -0,0 +1,74 @@ + + +## MokoWaaS-Brand Plugin (VERSION: 01.03.00) + +MokoWaaS-Brand provides a structured identity override layer that aligns the Joomla administrative and front end experience with the MokoWaaS platform standard. The plugin operationalizes a unified naming convention, brand controlled visuals, and enforced terminology across all tenant sites to ensure consistent service delivery within the WaaS framework. + +## Purpose + +This plugin enables Moko Consulting to maintain authoritative governance over the visual and linguistic representation of the WaaS ecosystem. All upstream Joomla identifiers are abstracted behind MokoWaaS compliant terminology to ensure alignment with enterprise service positioning. + +## Key Capabilities + +* Centralized substitution of Joomla labels with MokoWaaS terminology. +* Replacement of platform logos, titles, and meta naming with controlled brand assets. +* Enforcement of standardized UI patterns that support a cohesive multi tenant WaaS environment. +* Governance alignment with MokoDefaults for compliance, lifecycle management, and maintainability. + +## Installation + +1. Package the plugin directory into a Joomla installable ZIP archive. +2. Deploy through the Joomla Extension Manager. +3. Enable the plugin and confirm that the MokoWaaS identity layer is active across system areas. + +## Configuration + +The plugin exposes controlled parameters to ensure governance continuity. Configuration options are intentionally limited to preserve WaaS brand integrity and prevent tenant level deviation. + +## Versioning + +This extension follows the MokoDefaults version governance model. Version numbering aligns to major, minor, and patch level increments with strict change control. + +## Compliance + +All source code complies with the MokoDefaults coding and documentation standards. Brand assets referenced by the plugin must be licensed for internal WaaS use and stored within the designated media registry. + +## Documentation + +The plugin is documented through the MokoDefaults documentation framework. All reference materials, architectural notes, and governance artifacts are maintained within the `/docs/` directory of the repository. Documentation updates adhere to the same change control workflows as source code, ensuring traceability and alignment with platform standards. + +## Support + +For operational issues, submit a ticket through the Moko Consulting service channel. For lifecycle updates, monitor the MokoWaaS repository for release notifications. + +## Revision History + +| Date | Author | Summary | +| ---------- | ------------------------------- | --------------------------------------------- | +| 2025-12-11 | Jonathan Miller (@jmiller-moko) | Version Bump | +| 2025-12-11 | Jonathan Miller (@jmiller-moko) | `/docs/` creation | +| 2025-12-11 | Jonathan Miller (@jmiller-moko) | Version bump | +| 2025-12-11 | Jonathan Miller (@jmiller-moko) | Manifest Fix | +| 2025-12-11 | Jonathan Miller (@jmiller-moko) | Language Fix | +| 2025-12-11 | Jonathan Miller (@jmiller-moko) | Initial creation of README and metadata block | diff --git a/docs/.gitkeep b/docs/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/docs/guides/.gitkeep b/docs/guides/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/docs/guides/build-guide.md b/docs/guides/build-guide.md new file mode 100644 index 00000000..d00702a3 --- /dev/null +++ b/docs/guides/build-guide.md @@ -0,0 +1,321 @@ + + +# MokoWaaS-Brand Build Guide (VERSION: 01.03.00) + +## 1. Purpose + +This document defines the complete build and packaging workflow for the MokoWaaS-Brand system plugin. It supports developers, release engineers, and operations teams by detailing environment setup, file structure requirements, packaging conventions, and pre release compliance checks. + +## 2. Build Requirements + +To build the plugin correctly, ensure the following environment prerequisites: + +* PHP 8.1 or higher +* Joomla 5.x compatible environment available for testing +* Git installed and configured +* Zip CLI utility or equivalent archiving tool +* Access to MokoCodingDefaults for header and structure compliance + +Optional but recommended: + +* Node.js and NPM for asset linting (if applicable) +* IDE or editor with Joomla syntax highlighting + +## 3. Repository Structure Overview + +The repository should maintain a clean, predictable, and modular structure suitable for Joomla system plugins, WaaS platform governance, and automated build tooling. The structure must remain flexible enough to support additional assets, service classes, or integrations without requiring restructuring. + +```text +mokowaasbrand/ + ├── src/ + │ ├── plugin.php + │ ├── services/ (optional service providers) + │ ├── helpers/ (optional utility classes) + │ └── traits/ (optional logic modules) + │ + ├── language/ + │ └── en-GB/*.ini (primary language definitions) + │ + ├── media/ (optional; images, CSS, JS) + │ └── assets/ + │ + ├── templateDetails.xml (plugin manifest) + ├── LICENSE.md (standard GPL license) + ├── README.md (repository overview) + ├── CONTRIBUTING.md (contribution rules) + ├── CODEOWNERS (ownership and review rules) + │ + ├── docs/ (documentation suite) + │ ├── index.md + │ └── guides/*.md + │ + └── scripts/ (optional automation utilities, if used) +``` + +All files must contain the standardized Moko Consulting copyright header. + +## 4. Build Workflow + +### 4.1 Step 1: Validate File Headers + +Ensure: + +* SPDX identifier is present +* FILE INFORMATION block is correct +* Version matches plugin manifest + +### 4.2 Step 2: Validate Manifest + +Open `templateDetails.xml` and confirm: + +* Version number updated +* File references are correct +* Plugin name and metadata align with release + +### 4.3 Step 3: Clean Workspace + +Remove any unneeded files: + +* IDE artifacts +* Temporary logs +* System caches + +### 4.4 Step 4: Create Package + +Using CLI: + +```bash +zip -r mokowaasbrand_v01.03.00.zip ./ -x "*.git*" "scripts/*" "docs/*" +``` + +Ensure excluded paths match release governance and do not remove required runtime files. + +### 4.5 Step 5: Install and Validate + +Before release: + +1. Install the built plugin in a clean Joomla environment. +2. Validate load order and branding output. +3. Check logs for warnings or notices. +4. Validate language strings and UI terminology. + +## 5. Release Requirements + +For a version to qualify as release ready: + +* Documentation updated with correct version +* CHANGELOG updated if applicable +* All guides reflect new behaviors where relevant +* Branch has passed peer review and any required governance checks +* Tag created following semantic versioning conventions + +## 6. Automated Build Options + +Automated build and validation can be handled via configured CI workflows (for example, `.github/workflows/build.yml`) or other non-interactive tooling maintained in the repository. This keeps build behavior consistent across environments and reduces manual intervention. + +Possible automations: + +* Header enforcement +* Manifest version synchronization +* Folder and file presence validation +* ZIP creation using approved naming conventions + +## 7. Post Release Steps + +After release: + +* Update download links and release notes +* Notify WaaS internal release channels +* Update dependent templates or modules if required +* Record the release in any internal environment or asset registry + +## 8. CI/CD Workflow Integration + +A continuous integration and delivery pipeline is implemented using GitHub Actions. The workflows below operationalize the build, validation, and release actions referenced throughout this guide. + +### 8.1 Build and Validate Workflow (`.github/workflows/build.yml`) + +```yaml +name: Build and Validate MokoWaaS-Brand + +on: + push: + branches: [ main, develop ] + pull_request: + branches: [ main, develop ] + +jobs: + build-validate: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + + - name: Validate headers and metadata + run: | + echo "[INFO] Run header and FILE INFORMATION validation here (linters, custom scripts, etc.)." + + - name: Validate manifest + run: | + echo "[INFO] Validate templateDetails.xml version, file list, and metadata." + + - name: Lint PHP and syntax check + run: | + echo "[INFO] Run php -l over src/ and any additional linting as needed." + + - name: Create build artifact + run: | + zip -r mokowaasbrand_ci_build.zip ./ -x "*.git*" "docs/*" "scripts/*" + + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: mokowaasbrand-build + path: mokowaasbrand_ci_build.zip +``` + +### 8.2 Release Workflow (`.github/workflows/release.yml`) + +```yaml +name: Release MokoWaaS-Brand + +on: + push: + tags: + - 'v*' + +jobs: + publish-release: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Download build artifact + uses: actions/download-artifact@v4 + with: + name: mokowaasbrand-build + path: ./dist + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + files: | + dist/mokowaasbrand_ci_build.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +``` + +### 8.3 Governance Expectations + +* All changes to workflow files must follow the same review process as application code. +* Workflows must implement the validation steps described in this guide (headers, manifest, structure, syntax). +* Any new automated action should be documented and traceable via commit history and release notes. + +--- + +## 9. Extended Release Checklist + +This checklist is narrowed to **workflow linked actions only**, ensuring alignment with CI/CD enforcement and automation. + +### Before Build (Workflow Linked) + +* [ ] GitHub Actions workflow passes all checks +* [ ] Manifest version synchronized automatically +* [ ] Metadata header validation workflow completes +* [ ] Folder structure and required file presence validated by CI + +### During Build (Workflow Linked) + +* [ ] Packaging job completes in Actions +* [ ] CI artifact successfully generated +* [ ] Automated syntax checks (PHP, XML, INI) pass + +### After Build (Workflow Linked) + +* [ ] Release pipeline triggers +* [ ] Git tag created by workflow +* [ ] Artifact uploaded to release via Actions +* [ ] Workflow posts release summary + +--- + +## 11. Dependency Validation Rules + +To prevent runtime failures, validate the following prior to packaging: + +### 11.1 Joomla Compatibility + +* Confirm plugin uses only supported Joomla API calls +* Validate absence of deprecated function references + +### 11.2 PHP Compatibility + +* All code must comply with PHP 8.1+ syntax +* No short tags, deprecated globals, or removed extensions + +### 11.3 File Presence Validation + +Required files: + +* `templateDetails.xml` +* `src/plugin.php` +* At least one language file under `/language/en-GB/` +* LICENSE.md +* README.md +* CONTRIBUTING.md + +### 11.4 Optional Runtime Dependencies + +If services, traits, or helpers are referenced, verify all matching files exist. + +--- + +## 12. Template Version Synchronization Process + +Templates and plugins must remain synchronized to avoid inconsistencies. + +### 12.1 Synchronization Workflow + +1. Update plugin terminology keys +2. Sync updated keys with template language files +3. Verify template overrides do not shadow plugin output +4. Validate layout consistency in UI + +### 12.2 Alignment Rules + +* Template updates must follow plugin updates, not precede them +* Template releases must specify minimum supported plugin version +* Plugin release notes must reference any required template updates + +--- + +## Revision History + +| Date | Author | Description | +| ---------- | ------------------------------- | ------------------------------- | +| 2025-12-11 | Jonathan Miller (@jmiller-moko) | Initial creation of build guide | diff --git a/docs/guides/configuration-guide.md b/docs/guides/configuration-guide.md new file mode 100644 index 00000000..9338a5d0 --- /dev/null +++ b/docs/guides/configuration-guide.md @@ -0,0 +1,105 @@ + + +# MokoWaaS-Brand Configuration Guide (VERSION: 01.03.00) + +## 1. Objective + +This guide outlines the configuration parameters available within the MokoWaaS-Brand system plugin and establishes recommended defaults for WaaS governed environments. Proper configuration ensures consistent branding behavior across templates, modules, and administrative surfaces. + +## 2. Accessing Plugin Configuration + +1. Log in to Joomla Administrator. +2. Navigate to **System > Plugins**. +3. Search for **MokoWaaS-Brand**. +4. Select the plugin name to open the configuration panel. + +## 3. Configuration Sections + +The plugin provides several configuration areas designed to control branding behavior. + +### 3.1 Brand Terminology Controls + +These toggles replace Joomla native labels with WaaS aligned naming conventions. + +Use cases include: + +* Standardizing administrator UI language +* Reinforcing WaaS platform identity across components + +Recommended Default: **Enabled** + +### 3.2 Footer and Attribution Controls + +Controls platform level branding elements including: + +* Footer identification +* Powered By statements +* Attribution placements + +Recommended Default: **Enabled** + +### 3.3 Visibility Controls + +Options for concealing or modifying native Joomla identifiers when appropriate. + +Examples include: + +* Hiding Joomla version labels +* Suppressing default metadata references + +Recommended Default: **Enabled** for WaaS managed sites. + +### 3.4 Rendering Enhancements + +Controls adjustments to UI elements to ensure consistent presentation. + +Examples: + +* Header text alignment +* Replacement of naming strings + +Recommended Default: **Enabled** + +## 4. Configuration Change Workflow + +To ensure continuity across managed environments: + +1. Document the change request. +2. Apply updates in a staging environment. +3. Validate branding presentation. +4. Promote changes to production following WaaS change controls. + +## 5. Troubleshooting Configuration Issues + +* If changes do not appear, clear Joomla and browser cache. +* Confirm that no template override is superseding plugin outputs. +* Review logs for load order conflicts. +* Confirm that extension priority does not conflict with other system plugins. + +## 6. Validation Checklist + +* Branding reads consistently across administrator screens. +* No Joomla specific identifiers remain where replacement is expected. +* Frontend and backend output align with WaaS design expectations. + +## Revision History + +| Version | Date | Author | Description | +| -------- | ---------- | ------------------------------- | ---------------------------------------------- | +| 01.02.00 | 2025-12-11 | Jonathan Miller (@jmiller-moko) | Initial standalone configuration guide created | diff --git a/docs/guides/installation-guide.md b/docs/guides/installation-guide.md new file mode 100644 index 00000000..e13f6ced --- /dev/null +++ b/docs/guides/installation-guide.md @@ -0,0 +1,87 @@ + + +# MokoWaaS-Brand Installation Guide (VERSION: 01.03.00) + +## Introduction + +The MokoWaaS-Brand Installation Guide provides the authoritative process for deploying the system plugin within WaaS-managed Joomla environments. The installation ensures consistent application of MokoWaaS branding policy, identity governance, and terminology alignment across all administrative interfaces. + +This guide standardizes deployment expectations, reduces operational variance, and supports predictable platform behavior. + +## Requirements + +Before installation, ensure the following conditions are met: + +* Joomla 5.x operational environment +* PHP 8.1 or higher +* Administrative access credentials +* Validated MokoWaaS-Brand plugin package from an approved release channel +* Recommended: environment snapshot or backup prior to installation + +## Obtaining the Package + +To maintain integrity and compliance: + +1. Acquire the plugin package from the official MokoConsulting repository or release channel. +2. Validate package checksum or digital signature if provided. +3. Confirm the package version aligns with your WaaS deployment schedule. + +## Installation Steps + +Follow these steps to install the plugin: + +1. Log in to the Joomla Administrator dashboard. +2. Navigate to **System > Extensions > Install**. +3. Choose **Upload Package File**. +4. Upload the MokoWaaS-Brand plugin package. +5. Confirm successful installation in the extension status message. + +## Activation + +After installation, the plugin must be activated: + +1. Navigate to **System > Plugins**. +2. Search for **MokoWaaS-Brand**. +3. Confirm the plugin type is **System**. +4. Set status to **Enabled**. +5. Save and close. + +## Post Installation Validation + +To ensure proper activation and system compatibility, verify the following: + +* MokoWaaS branding appears in the administrator footer. +* Terminology updates apply consistently across admin UI. +* No conflicts with templates, overrides, or extensions. +* Joomla and PHP logs show no errors related to the plugin. + +## Rollback Procedure + +If the plugin introduces issues or conflicts: + +1. Disable the plugin via **System > Plugins**. +2. Clear Joomla and browser cache. +3. Test affected interfaces and confirm restoration of stability. +4. Restore environment snapshot if the issue persists. + +## Revision History + +| Date | Author | Description | +| ---------- | ------------------------------- | ---------------------------- | +| 2025-12-11 | Jonathan Miller (@jmiller-moko) | Rewrite for version 01.03.00 | diff --git a/docs/guides/operations-guide.md b/docs/guides/operations-guide.md new file mode 100644 index 00000000..a81e21bf --- /dev/null +++ b/docs/guides/operations-guide.md @@ -0,0 +1,131 @@ + + +# MokoWaaS-Brand Operations Guide (VERSION: 01.03.00) + +## Introduction + +The MokoWaaS-Brand Operations Guide defines how the plugin is managed across WaaS governed Joomla environments. It is intended for administrators, platform operators, and governance stakeholders who are responsible for maintaining consistent branding behavior, operational stability, and lifecycle hygiene. + +This document focuses on day to day responsibilities, monitoring expectations, and coordination points with other parts of the WaaS platform. + +## Operational Scope + +The MokoWaaS-Brand plugin operates as a system level extension that enforces WaaS branding, terminology, and identity across administrative user interfaces. Because it runs early in the request lifecycle, it requires explicit operational oversight to ensure: + +* Consistent behavior after template or core updates +* Stable interaction with other system plugins +* Alignment with WaaS branding policy and governance + +## Roles and Responsibilities + +### WaaS Platform Administrators + +* Maintain the plugin at the approved version for each environment +* Validate branding consistency following platform or template changes +* Coordinate with development teams on rollout of new features or terminology + +### Governance and Brand Owners + +* Approve changes to WaaS terminology or visible branding +* Review that the plugin’s behavior aligns with documented brand guidelines +* Provide input for configuration changes that affect end user perception + +### Development and Release Teams + +* Implement and test changes to the plugin +* Prepare release artifacts and update documentation +* Coordinate rollout sequencing with templates, modules, and language packs + +## Routine Operational Tasks + +### Branding Consistency Reviews + +Performed when: + +* Joomla core is updated +* Templates or overrides change +* Language packs are updated or replaced + +Administrators should verify that: + +* Branding remains consistent across key administrator views +* No reverted or legacy Joomla labels reappear + +### Cache Management + +To avoid stale UI output: + +* Clear Joomla cache after plugin updates +* Clear CDN or reverse proxy cache where applicable +* Encourage administrators to hard refresh their browsers after major changes + +### Change Logging + +For each operational change involving the plugin: + +* Record the change type (configuration, version, dependency) +* Record the timestamp and operator +* Capture any observed side effects during or after the change + +## Monitoring and Alerts + +Operational logging and monitoring should focus on: + +* Plugin initialization or load order errors +* Warnings related to language strings or missing constants +* UI rendering anomalies reported by administrators + +Recommended monitoring sources: + +* Joomla Administrator logs +* Web server and PHP error logs +* Centralized WaaS logging and observability tools where available + +## Maintenance Lifecycle + +### Scheduled Maintenance + +During planned maintenance windows: + +* Validate that branding and terminology still match WaaS standards +* Confirm that newly deployed templates or components do not conflict with plugin output +* Review configuration settings to ensure they align with current policy + +### Emergency Maintenance + +If the plugin negatively affects platform stability or administrator usability: + +1. Temporarily disable the plugin in the Joomla Plugin Manager. +2. Clear Joomla and application caches. +3. Validate that core navigation and access remain functional. +4. Engage development or governance teams to determine remediation steps. + +## Dependency and Compatibility Considerations + +* Template overrides may change how or where branding appears. +* Joomla updates may introduce new strings that require plugin or language updates. +* Third party system plugins may alter the same UI surfaces and require coordination. + +Administrators should factor these dependencies into maintenance and upgrade planning. + +## Revision History + +| Date | Author | Description | +| ---------- | ------------------------------- | ---------------------------- | +| 2025-12-11 | Jonathan Miller (@jmiller-moko) | Rewrite for version 01.03.00 | diff --git a/docs/guides/rollback-and-recovery-guide.md b/docs/guides/rollback-and-recovery-guide.md new file mode 100644 index 00000000..121ade9d --- /dev/null +++ b/docs/guides/rollback-and-recovery-guide.md @@ -0,0 +1,110 @@ + + +# MokoWaaS-Brand Rollback and Recovery Guide (VERSION: 01.03.00) + +## Introduction + +The Rollback and Recovery Guide defines the procedures required to restore a stable operational state when the MokoWaaS-Brand plugin introduces issues or when an environment must revert to a previously validated condition. It ensures WaaS administrators, incident responders, and platform operators have a consistent and predictable process during incidents. + +Rollback and recovery are essential components of WaaS governance, reducing downtime and ensuring branding and UI consistency across environments. + +## When to Initiate Rollback + +Rollback should be initiated when any of the following conditions occur: + +* Branding inconsistencies or terminology reversions +* UI rendering problems that impair administrator functionality +* Plugin updates introduce instability or regression +* Language conflicts or missing terminology keys +* Critical plugin or PHP errors appear in logs + +These symptoms indicate that immediate containment and structured recovery are necessary. + +## Immediate Containment Actions + +To prevent further disruption: + +1. Disable the MokoWaaS-Brand plugin via **System > Plugins**. +2. Clear Joomla cache. +3. Retest impacted areas to confirm whether disabling stabilizes behavior. +4. Review Joomla and PHP logs for indicators of root cause. + +Containment limits the blast radius while enabling structured diagnosis. + +## Full Rollback Procedure + +### Restoring a Prior Plugin Version + +1. Locate the last validated plugin release package. +2. Navigate to **System > Extensions > Install**. +3. Upload and reinstall the previous version. +4. Confirm proper installation via the extension manager. +5. Validate that branding and UI behavior return to expected baselines. + +### Environment Snapshot Restoration + +If plugin version rollback does not resolve the issue: + +1. Restore the environment snapshot taken before the change. +2. Validate compatibility across templates, plugins, and language packs. +3. Reenable the plugin. +4. Retest critical paths and administrator workflows. + +Snapshots provide a guaranteed restoration point for complex failures. + +## Recovery Validation + +Once recovery steps are complete: + +* Ensure branding matches WaaS identity guidelines. +* Confirm no plugin initialization or load order errors. +* Validate terminology strings across admin surfaces. +* Verify stable rendering of the administrator dashboard. + +Recovery is not complete unless all validation points succeed. + +## Post Incident Documentation + +All rollback or recovery events must be documented, including: + +* Plugin version(s) involved +* Summary of symptoms and operational impact +* Detailed rollback actions taken +* Root cause indicators or contributing factors +* Recommendations for preventing recurrence + +Documentation improves platform resilience and informs future release governance. + +## Preventative Strategies + +To reduce the likelihood of rollback events: + +* Test all plugin and template updates in staging before production rollout +* Maintain version synchronization across branding related assets +* Acquire plugin builds only from approved WaaS release channels +* Enforce strict change control and governance for branding updates +* Audit template overrides regularly to avoid conflicts + +These strategies improve long term WaaS platform stability. + +## Revision History + +| Date | Author | Description | +| ---------- | ------------------------------- | ------------------------------------------- | +| 2025-12-11 | Jonathan Miller (@jmiller-moko) | Full rewrite and update to version 01.03.00 | diff --git a/docs/guides/troubleshooting-guide.md b/docs/guides/troubleshooting-guide.md new file mode 100644 index 00000000..936ba317 --- /dev/null +++ b/docs/guides/troubleshooting-guide.md @@ -0,0 +1,158 @@ + + +# MokoWaaS-Brand Troubleshooting Guide (VERSION: 01.03.00) + +## Introduction + +The MokoWaaS-Brand Troubleshooting Guide provides a structured, repeatable approach for diagnosing and resolving issues related to branding enforcement across WaaS managed Joomla environments. It assists administrators, support engineers, and operations staff in identifying symptoms, validating root causes, and restoring consistent platform behavior. + +This guide focuses on actionable diagnostics, minimizing downtime, and ensuring that WaaS branding policy is applied consistently. + +## Understanding the Plugin’s Operational Behavior + +As a system level extension, the MokoWaaS-Brand plugin: + +* Loads early in the Joomla lifecycle +* Influences visible terminology and branding markers +* Interacts with templates, overrides, and language constants +* Depends on correct cache behavior and language file integrity + +Issues typically arise from conflicts, outdated overrides, or environmental configuration rather than the plugin itself. + +## Common Issues and Resolutions + +### Branding Not Updating + +Branding appears unchanged or reverts to Joomla defaults. + +**Likely Causes:** + +* Joomla cache not cleared +* Browser cache holding stale assets +* Template overrides overriding plugin output +* Language file conflicts or outdated strings + +**Resolution:** + +1. Clear Joomla cache entirely. +2. Test in a private browser session. +3. Inspect template override directories for conflicting files. +4. Confirm plugin is enabled. +5. Validate plugin load order. + +--- + +### Missing or Incorrect Terminology + +Labels or UI strings do not match expected WaaS terminology. + +**Likely Causes:** + +* Outdated or missing language packs +* Third party extensions overriding key strings +* Joomla updates introducing new terminology + +**Resolution:** + +1. Validate the integrity of all language files. +2. Check extension overrides. +3. Reapply updated MokoWaaS-Brand language packs. +4. Review recent Joomla updates for changes in language constants. + +--- + +### UI Rendering Issues + +Visual inconsistencies or broken layouts. + +**Likely Causes:** + +* Template level CSS conflicts +* Third party system plugins modifying DOM or rendering pipelines +* Outdated or incompatible template overrides + +**Resolution:** + +1. Switch temporarily to a default template. +2. Inspect and test CSS priority. +3. Disable third party plugins one at a time to isolate conflicts. + +--- + +## Diagnostic Tools and Logs + +Effective diagnosis depends on reviewing the correct system logs. + +### Joomla Logs + +Monitor for: + +* Plugin initialization warnings +* Deprecated methods +* Handler conflicts between extensions + +### PHP Error Logs + +Check for: + +* Undefined constants or missing language keys +* Fatal or recoverable errors in plugin lifecycle hooks + +### Browser Developer Tools + +Useful for detecting: + +* JavaScript conflicts affecting admin UI +* Missing or misrouted asset loads +* DOM rendering issues + +--- + +## Escalation Workflow + +If your troubleshooting steps do not resolve the issue: + +1. Document observed symptoms and any steps already taken. +2. Capture relevant logs, console messages, and screenshots. +3. Escalate to WaaS operations or development teams. +4. Include environmental details such as: + + * Joomla version + * MokoWaaS-Brand plugin version + * Template version + * Installed third party extensions + +--- + +## Preventative Practices + +To reduce incidents and ensure operational stability: + +* Maintain version alignment across templates, plugins, and language packs. +* Test all changes in a staging environment. +* Enforce change control for branding or terminology adjustments. +* Remove legacy template overrides that duplicate plugin functionality. + +--- + +## Revision History + +| Date | Author | Description | +| ---------- | ------------------------------- | ------------------------------------------- | +| 2025-12-11 | Jonathan Miller (@jmiller-moko) | Full rewrite and update to version 01.03.00 | diff --git a/docs/guides/upgrade-and-versioning-guide.md b/docs/guides/upgrade-and-versioning-guide.md new file mode 100644 index 00000000..c88e1045 --- /dev/null +++ b/docs/guides/upgrade-and-versioning-guide.md @@ -0,0 +1,117 @@ + + +# MokoWaaS-Brand Upgrade and Versioning Guide (VERSION: 01.03.00) + +## Introduction + +The MokoWaaS-Brand Upgrade and Versioning Guide establishes a consistent lifecycle management process for the plugin across WaaS governed environments. By defining clear versioning rules, upgrade requirements, and governance commitments, this guide ensures stability and predictable branding behavior throughout the platform. + +## Versioning Standards + +The plugin uses a semantic versioning model aligned with WaaS operational governance. Each segment communicates functional impact and expected deployment considerations. + +### Version Structure + +`01.03.00` + +* **MAJOR**: Introduces changes that affect platform wide branding structure, architecture, or identity rules. +* **MINOR**: Adds new features, terminology mappings, UX updates, or configuration options. +* **PATCH**: Corrects bugs, updates language strings, or performs low impact adjustments. + +This structure ensures operators understand the significance of each release. + +## Upgrade Workflow + +A well defined upgrade process reduces operational risk and ensures consistent branding enforcement. + +### Pre Upgrade Validation + +Before applying a new release: + +1. Validate compatibility with: + + * Joomla core version + * WaaS template version + * Language pack versions +2. Review release notes and change logs. +3. Capture an environment snapshot or backup. +4. Confirm that dependent extensions are ready for upgrade sequencing. + +### Installing an Update + +1. Navigate to **System > Extensions > Install**. +2. Upload the updated plugin package. +3. Confirm successful installation. +4. Validate the displayed plugin version. + +### Post Upgrade Validation + +After update: + +* Confirm branding and terminology consistency across administrative surfaces. +* Validate template behavior. +* Monitor logs for warnings or conflicts. +* Ensure no override files reintroduce outdated terminology. + +## Release Governance + +Versioning and rollout require alignment across multiple teams. + +### Development Teams + +* Implement changes and fixes. +* Tag releases using semantic rules. +* Provide documentation, changelogs, and upgrade notes. + +### WaaS Platform Operations + +* Validate releases in staging. +* Approve and coordinate production rollout. +* Maintain version inventories and update paths. + +### Governance and Brand Teams + +* Approve major branding modifications. +* Ensure updates comply with identity management rules. +* Review terminology changes prior to deployment. + +## Rollback Protocol + +If unexpected issues or instability occur: + +1. Disable the plugin via the Joomla Plugin Manager. +2. Revert to the last validated version. +3. Clear Joomla and browser caches. +4. Restore from environment backup if needed. +5. Document incident and remediation for future governance. + +## Preventative Practices + +To minimize disruptions: + +* Maintain version parity across templates, plugins, and language packs. +* Avoid modifying plugin files outside formal release cycles. +* Confirm updates in staging environments before production deployment. +* Periodically audit template overrides for outdated terminology. + +## Revision History + +| Date | Author | Description | +| ---------- | ------------------------------- | ------------------------------------------- | +| 2025-12-11 | Jonathan Miller (@jmiller-moko) | Full rewrite and update to version 01.03.00 | diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 00000000..a08025b0 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,77 @@ + + +# MokoWaaS-Brand Documentation Index (VERSION: 01.03.00) + +## Introduction + +The MokoWaaS-Brand Documentation Index provides the authoritative map of all documentation assets associated with the MokoWaaS-Brand system plugin. It ensures traceability, governance compliance, and visibility across all operational, technical, and administrative materials that support WaaS-managed Joomla environments. + +This index serves as the entry point for contributors, administrators, and governance teams who require a single source of truth for locating and validating documentation files. + +## Documentation Structure + +Documentation is organized into two primary categories: core documentation and operational guides. Each file is individually versioned, governed, and maintained as part of the WaaS documentation ecosystem. + +### Core Documentation + +* **Plugin Overview** + `/docs/plugin-basic.md` + +### Guides + +* **Installation Guide** + `/docs/guides/installation-guide.md` + +* **Configuration Guide** + `/docs/guides/configuration-guide.md` + +* **Operations Guide** + `/docs/guides/operations-guide.md` + +* **Troubleshooting Guide** + `/docs/guides/troubleshooting-guide.md` + +* **Upgrade and Versioning Guide** + `/docs/guides/upgrade-and-versioning-guide.md` + +* **Rollback and Recovery Guide** + `/docs/guides/rollback-and-recovery-guide.md` + +## Maintenance and Governance + +To preserve documentation integrity across the WaaS platform, the following standards apply: + +* All files must include the standard Moko Consulting metadata header. +* Version changes must be reflected both in the header and revision history. +* Newly created documentation must be added to this index immediately. +* Documentation should remain consistent with platform terminology, governance rules, and branding policy. + +## Contribution Expectations + +Contributors should: + +* Maintain consistency with the established structure and tone of existing documents. +* Validate cross-document references when updating terminology or behavior. +* Follow MokoCodingDefaults for formatting, metadata placement, and content alignment. + +## Revision History + +| Date | Author | Description | +| ---------- | ------------------------------- | ------------------------------------------- | +| 2025-12-11 | Jonathan Miller (@jmiller-moko) | Full rewrite and update to version 01.03.00 | diff --git a/docs/plugin-basic.md b/docs/plugin-basic.md new file mode 100644 index 00000000..189ab943 --- /dev/null +++ b/docs/plugin-basic.md @@ -0,0 +1,88 @@ + + +# MokoWaaS-Brand Plugin Overview (VERSION: 01.03.00) + +## Introduction + +The MokoWaaS-Brand plugin is a foundational system component used across WaaS-managed Joomla environments. It ensures consistent application of platform identity, terminology, and user experience standards. By centralizing key branding functions, the plugin supports multi‑tenant WaaS operations and reduces administrative fragmentation. + +## Role in the WaaS Platform + +The plugin establishes a unified naming and branding layer across administrator and user interfaces. As the primary enforcement point for WaaS branding policy, it integrates with templates, modules, and language packs to maintain consistent terminology and presentation. + +Key functions include: + +* Replacing Joomla-native labels with WaaS-approved terminology. +* Ensuring consistent visual identifiers in administrative interfaces. +* Providing a stable branding baseline consumed by other system extensions. + +## System Requirements + +To ensure correct operation, the plugin requires: + +* Joomla 5.x or higher +* PHP 8.1 or higher +* A compatible WaaS template aligned with Moko platform standards +* System-level plugin execution priority before template rendering + +## Installation Overview + +The plugin is deployed through the Joomla Extension Manager. + +High‑level installation flow: + +1. Upload the distributed plugin package. +2. Validate manifest metadata for accuracy and compliance. +3. Enable the plugin under System Plugins. +4. Clear system and browser caches to ensure fresh language loads. + +## Configuration Overview + +The plugin provides configurable controls under the Joomla Plugin Manager. + +Primary configuration categories include: + +* **Terminology Controls:** Apply standardized WaaS vocabulary. +* **UI Adjustments:** Modify display elements such as headers or default labels. +* **Visibility Controls:** Suppress or replace Joomla identifiers as needed. +* **Branding Elements:** Manage powered‑by references and footer behavior. + +Configuration ensures a consistent and predictable WaaS identity across all managed sites. + +## Operational Expectations + +Platform operators should maintain the plugin in an enabled state at all times. Updates may affect downstream systems such as templates or modules, so operational workflows must include: + +* Version alignment across branding components +* Review of template overrides for conflict prevention +* Coordination with WaaS governance for terminology changes + +## Constraints and Considerations + +While the plugin provides broad branding coverage, certain constraints apply: + +* Third‑party extensions may require additional overrides +* Joomla core updates may introduce changes requiring terminology refresh +* Legacy templates may require refactoring to fully adopt standardized naming + +## Revision History + +| Date | Author | Description | +| ---------- | ------------------------------- | ---------------------------- | +| 2025-12-11 | Jonathan Miller (@jmiller-moko) | Rewrite for version 01.03.00 | diff --git a/docs/reference/.gitkeep b/docs/reference/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/docs/reference/plugin-overview.md b/docs/reference/plugin-overview.md new file mode 100644 index 00000000..8825cbf2 --- /dev/null +++ b/docs/reference/plugin-overview.md @@ -0,0 +1,32 @@ +# MokoWaaS-Brand Plugin Overview + +## Executive Summary +The MokoWaaS-Brand plugin operates as a core enablement layer within the WaaS delivery stack, aligning platform branding, terminology, and visual identity across administrative and user-facing touchpoints. It standardizes language, reinforces WaaS positioning, and reduces fragmentation risk across templates and extensions. + +## Purpose +- Replace default Joomla terminology with WaaS aligned naming. +- Provide a consistent brand experience in the administrator interface. +- Establish a baseline layer for future identity and UX governance. + +## Key Capabilities +- Terminology substitution for core labels and messages. +- Footer and powered by messaging alignment. +- Optional concealment of native Joomla identifiers where appropriate. +- Foundation for extended branding controls through templates and language packs. + +## System Requirements +- Joomla 5.x +- PHP 8.1 or higher +- Compatible WaaS template and language stack +- Ability to run as a system plugin before template rendering + +## High Level Lifecycle +1. Install the plugin via the Joomla Extension Manager. +2. Enable the plugin in the System Plugin list. +3. Clear cache to propagate new language strings. +4. Validate administrator and frontend views for correct WaaS branding. + +## Operational Notes +- The plugin should remain enabled on all WaaS managed instances. +- Changes to terminology may impact documentation and training materials and should be coordinated with internal teams. +- Third party extensions may require additional overrides for full branding alignment. diff --git a/scripts/update_changelog.sh b/scripts/update_changelog.sh new file mode 100644 index 00000000..2889e410 --- /dev/null +++ b/scripts/update_changelog.sh @@ -0,0 +1,80 @@ +#!/usr/bin/env bash +set -euo pipefail + +# scripts/update_changelog.sh +# +# Purpose: +# - Apply the MokoWaaS-Brand CHANGELOG template entry for a given version. +# - Insert a new header at the top of CHANGELOG.md, immediately after "# Changelog". +# - Avoid duplicates if an entry for the version already exists. +# - Preserve the rest of the file verbatim. +# +# Usage: +# ./scripts/update_changelog.sh +# +# Example: +# ./scripts/update_changelog.sh 01.05.00 + +VERSION="${1:-}" + +if [[ -z "${VERSION}" ]]; then + echo "ERROR: Version argument is required. Usage: scripts/update_changelog.sh " >&2 + exit 1 +fi + +CHANGELOG_FILE="CHANGELOG.md" + +DATE_UTC="$(date -u +"%Y-%m-%d")" +HEADER="## ${VERSION} - ${DATE_UTC}" + +if [[ ! -f "${CHANGELOG_FILE}" ]]; then + { + echo "# Changelog" + echo + } > "${CHANGELOG_FILE}" +fi + +# Do not duplicate existing entries +if grep -qE "^##[[:space:]]+${VERSION}[[:space:]]+-[[:space:]]+" "${CHANGELOG_FILE}"; then + echo "CHANGELOG.md already contains an entry for ${VERSION}. No changes made." + exit 0 +fi + +TMP_FILE="${CHANGELOG_FILE}.tmp" + +# Insert after the first '# Changelog' line. +# If '# Changelog' is missing, prepend it. +if grep -qE "^# Changelog$" "${CHANGELOG_FILE}"; then + awk -v header="${HEADER}" ' + BEGIN { inserted=0 } + { + print + if (!inserted && $0 ~ /^# Changelog$/) { + print "" + print header + print "" + inserted=1 + } + } + END { + if (!inserted) { + # fallback: append at end + print "" + print header + print "" + } + } + ' "${CHANGELOG_FILE}" > "${TMP_FILE}" +else + { + echo "# Changelog" + echo + echo "${HEADER}" + echo + cat "${CHANGELOG_FILE}" + } > "${TMP_FILE}" +fi + +mv "${TMP_FILE}" "${CHANGELOG_FILE}" + +echo "Applied changelog header: ${HEADER}" diff --git a/scripts/validate_manifest.sh b/scripts/validate_manifest.sh new file mode 100644 index 00000000..703f7685 --- /dev/null +++ b/scripts/validate_manifest.sh @@ -0,0 +1,42 @@ +#!/bin/bash +set -e + +MANIFEST="src/mokowaasbrand.xml" + +echo "Validating Joomla manifest: $MANIFEST" + +if [ ! -f "$MANIFEST" ]; then + echo "ERROR: Manifest not found: $MANIFEST" + exit 1 +fi + +# Check XML syntax +if ! xmllint --noout "$MANIFEST"; then + echo "ERROR: Manifest XML is not valid." + exit 1 +fi + +# Required fields +REQUIRED_NODES=( + "//extension" + "//name" + "//version" + "//author" + "//creationDate" +) + +for NODE in "${REQUIRED_NODES[@]}"; do + if ! xmllint --xpath "$NODE" "$MANIFEST" > /dev/null 2>&1; then + echo "ERROR: Required manifest node missing: $NODE" + exit 1 + fi +done + +VERSION=$(xmllint --xpath "string(//version)" "$MANIFEST") + +if [ -z "$VERSION" ]; then + echo "ERROR: Version node is empty in manifest." + exit 1 +fi + +echo "Manifest OK. Version: $VERSION" diff --git a/scripts/verify_changelog.sh b/scripts/verify_changelog.sh new file mode 100644 index 00000000..3884efd8 --- /dev/null +++ b/scripts/verify_changelog.sh @@ -0,0 +1,25 @@ +#!/bin/bash +set -e + +echo "Running changelog verifier" + +BRANCH="${GITHUB_REF_NAME}" + +if [[ ! "$BRANCH" =~ ^version/ ]]; then + echo "Not on a version branch. Skipping changelog verification." + exit 0 +fi + +VERSION="${BRANCH#version/}" + +if [ ! -f "CHANGELOG.md" ]; then + echo "ERROR: CHANGELOG.md does not exist." + exit 1 +fi + +if ! grep -q "$VERSION" CHANGELOG.md; then + echo "ERROR: CHANGELOG.md missing entry for version $VERSION" + exit 1 +fi + +echo "Changelog contains correct version section." diff --git a/src/administrator/language/overrides/en-GB.override.ini b/src/administrator/language/overrides/en-GB.override.ini new file mode 100644 index 00000000..cae120c1 --- /dev/null +++ b/src/administrator/language/overrides/en-GB.override.ini @@ -0,0 +1,43 @@ +; ----------------------------------------------------------------------------- +; Copyright (C) 2025 Moko Consulting +; This file is part of a Moko Consulting project. +; SPDX-License-Identifier: GPL-3.0-or-later +; REPO: (add when this lives in a repository) +; ----------------------------------------------------------------------------- +; FILE INFORMATION +; Defgroup: Joomla Language Overrides +; Ingroup: MokoWaaS +; Version: 1.0.0 +; File: en-GB.override.ini +; Path: language/overrides/en-GB.override.ini +; Brief: English overrides replacing all visible occurrences of “Joomla!” with “MokoWaaS”. +; Notes: Extend by adding more keys discovered via the Language Overrides tool. +; Variables: (none) +; ----------------------------------------------------------------------------- +; ===== Footer & template branding ===== +TPL_CASSIOPEIA_POWERED_BY="Powered by MokoWaaS" +MOD_FOOTER_LINE2="Powered by MokoWaaS" + +; ===== Control panel greetings ===== +COM_CPANEL_WELCOME_TITLE="Welcome to MokoWaaS!" +COM_CPANEL_MSG_WELCOME="Welcome to MokoWaaS!" + +; ===== Help/Docs phrasing ===== +COM_ADMIN_HELP_SITE="MokoWaaS Help" +COM_ADMIN_HELPSITE_FIELD_LABEL="MokoWaaS Help" + +; ===== Generic replacements ===== +JGLOBAL_FIELDSET_JOOMLA_DEFAULTS="MokoWaaS Defaults" +COM_INSTALLER_TYPE_JOOMLA="MokoWaaS Package" +LIB_JOOMLA="MokoWaaS Library" + +; ===== System messages ===== +JERROR_JOOMLA="MokoWaaS Error" +JFIELD_JOOMLA_LABEL="MokoWaaS Field" + +; ===== AdminLogin Support ===== +MOD_LOGINSUPPORT_FORUM="Moko Consulting Support" +MOD_LOGINSUPPORT_DOCUMENTATION="MokoWaaS Documentation" +MOD_LOGINSUPPORT_NEWS="Moko Consulting News" +TPL_ATUM_BACKEND_LOGIN="MokoWaaS Administrator Login" +JERROR_LAYOUT_ERROR_HAS_OCCURRED="ERROR OCCURED" \ No newline at end of file diff --git a/src/administrator/language/overrides/en-US.override.ini b/src/administrator/language/overrides/en-US.override.ini new file mode 100644 index 00000000..ccab554d --- /dev/null +++ b/src/administrator/language/overrides/en-US.override.ini @@ -0,0 +1,43 @@ +; ----------------------------------------------------------------------------- +; Copyright (C) 2025 Moko Consulting +; This file is part of a Moko Consulting project. +; SPDX-License-Identifier: GPL-3.0-or-later +; REPO: (add when this lives in a repository) +; ----------------------------------------------------------------------------- +; FILE INFORMATION +; Defgroup: Joomla Language Overrides +; Ingroup: MokoWaaS +; Version: 1.0.0 +; File: en-US.override.ini +; Path: language/overrides/en-US.override.ini +; Brief: English overrides replacing all visible occurrences of “Joomla!” with “MokoWaaS”. +; Notes: Extend by adding more keys discovered via the Language Overrides tool. +; Variables: (none) +; ----------------------------------------------------------------------------- +; ===== Footer & template branding ===== +TPL_CASSIOPEIA_POWERED_BY="Powered by MokoWaaS" +MOD_FOOTER_LINE2="Powered by MokoWaaS" + +; ===== Control panel greetings ===== +COM_CPANEL_WELCOME_TITLE="Welcome to MokoWaaS!" +COM_CPANEL_MSG_WELCOME="Welcome to MokoWaaS!" + +; ===== Help/Docs phrasing ===== +COM_ADMIN_HELP_SITE="MokoWaaS Help" +COM_ADMIN_HELPSITE_FIELD_LABEL="MokoWaaS Help" + +; ===== Generic replacements ===== +JGLOBAL_FIELDSET_JOOMLA_DEFAULTS="MokoWaaS Defaults" +COM_INSTALLER_TYPE_JOOMLA="MokoWaaS Package" +LIB_JOOMLA="MokoWaaS Library" + +; ===== System messages ===== +JERROR_JOOMLA="MokoWaaS Error" +JFIELD_JOOMLA_LABEL="MokoWaaS Field" + +; ===== AdminLogin Support ===== +MOD_LOGINSUPPORT_FORUM="Moko Consulting Support" +MOD_LOGINSUPPORT_DOCUMENTATION="MokoWaaS Documentation" +MOD_LOGINSUPPORT_NEWS="Moko Consulting News" +TPL_ATUM_BACKEND_LOGIN="MokoWaaS Administrator Login" +JERROR_LAYOUT_ERROR_HAS_OCCURRED="ERROR OCCURED" \ No newline at end of file diff --git a/src/administrator/language/overrides/index.html b/src/administrator/language/overrides/index.html new file mode 100644 index 00000000..2efb97f3 --- /dev/null +++ b/src/administrator/language/overrides/index.html @@ -0,0 +1 @@ + diff --git a/src/language/overrides/en-GB.override.ini b/src/language/overrides/en-GB.override.ini new file mode 100644 index 00000000..cae120c1 --- /dev/null +++ b/src/language/overrides/en-GB.override.ini @@ -0,0 +1,43 @@ +; ----------------------------------------------------------------------------- +; Copyright (C) 2025 Moko Consulting +; This file is part of a Moko Consulting project. +; SPDX-License-Identifier: GPL-3.0-or-later +; REPO: (add when this lives in a repository) +; ----------------------------------------------------------------------------- +; FILE INFORMATION +; Defgroup: Joomla Language Overrides +; Ingroup: MokoWaaS +; Version: 1.0.0 +; File: en-GB.override.ini +; Path: language/overrides/en-GB.override.ini +; Brief: English overrides replacing all visible occurrences of “Joomla!” with “MokoWaaS”. +; Notes: Extend by adding more keys discovered via the Language Overrides tool. +; Variables: (none) +; ----------------------------------------------------------------------------- +; ===== Footer & template branding ===== +TPL_CASSIOPEIA_POWERED_BY="Powered by MokoWaaS" +MOD_FOOTER_LINE2="Powered by MokoWaaS" + +; ===== Control panel greetings ===== +COM_CPANEL_WELCOME_TITLE="Welcome to MokoWaaS!" +COM_CPANEL_MSG_WELCOME="Welcome to MokoWaaS!" + +; ===== Help/Docs phrasing ===== +COM_ADMIN_HELP_SITE="MokoWaaS Help" +COM_ADMIN_HELPSITE_FIELD_LABEL="MokoWaaS Help" + +; ===== Generic replacements ===== +JGLOBAL_FIELDSET_JOOMLA_DEFAULTS="MokoWaaS Defaults" +COM_INSTALLER_TYPE_JOOMLA="MokoWaaS Package" +LIB_JOOMLA="MokoWaaS Library" + +; ===== System messages ===== +JERROR_JOOMLA="MokoWaaS Error" +JFIELD_JOOMLA_LABEL="MokoWaaS Field" + +; ===== AdminLogin Support ===== +MOD_LOGINSUPPORT_FORUM="Moko Consulting Support" +MOD_LOGINSUPPORT_DOCUMENTATION="MokoWaaS Documentation" +MOD_LOGINSUPPORT_NEWS="Moko Consulting News" +TPL_ATUM_BACKEND_LOGIN="MokoWaaS Administrator Login" +JERROR_LAYOUT_ERROR_HAS_OCCURRED="ERROR OCCURED" \ No newline at end of file diff --git a/src/language/overrides/en-US.override.ini b/src/language/overrides/en-US.override.ini new file mode 100644 index 00000000..ccab554d --- /dev/null +++ b/src/language/overrides/en-US.override.ini @@ -0,0 +1,43 @@ +; ----------------------------------------------------------------------------- +; Copyright (C) 2025 Moko Consulting +; This file is part of a Moko Consulting project. +; SPDX-License-Identifier: GPL-3.0-or-later +; REPO: (add when this lives in a repository) +; ----------------------------------------------------------------------------- +; FILE INFORMATION +; Defgroup: Joomla Language Overrides +; Ingroup: MokoWaaS +; Version: 1.0.0 +; File: en-US.override.ini +; Path: language/overrides/en-US.override.ini +; Brief: English overrides replacing all visible occurrences of “Joomla!” with “MokoWaaS”. +; Notes: Extend by adding more keys discovered via the Language Overrides tool. +; Variables: (none) +; ----------------------------------------------------------------------------- +; ===== Footer & template branding ===== +TPL_CASSIOPEIA_POWERED_BY="Powered by MokoWaaS" +MOD_FOOTER_LINE2="Powered by MokoWaaS" + +; ===== Control panel greetings ===== +COM_CPANEL_WELCOME_TITLE="Welcome to MokoWaaS!" +COM_CPANEL_MSG_WELCOME="Welcome to MokoWaaS!" + +; ===== Help/Docs phrasing ===== +COM_ADMIN_HELP_SITE="MokoWaaS Help" +COM_ADMIN_HELPSITE_FIELD_LABEL="MokoWaaS Help" + +; ===== Generic replacements ===== +JGLOBAL_FIELDSET_JOOMLA_DEFAULTS="MokoWaaS Defaults" +COM_INSTALLER_TYPE_JOOMLA="MokoWaaS Package" +LIB_JOOMLA="MokoWaaS Library" + +; ===== System messages ===== +JERROR_JOOMLA="MokoWaaS Error" +JFIELD_JOOMLA_LABEL="MokoWaaS Field" + +; ===== AdminLogin Support ===== +MOD_LOGINSUPPORT_FORUM="Moko Consulting Support" +MOD_LOGINSUPPORT_DOCUMENTATION="MokoWaaS Documentation" +MOD_LOGINSUPPORT_NEWS="Moko Consulting News" +TPL_ATUM_BACKEND_LOGIN="MokoWaaS Administrator Login" +JERROR_LAYOUT_ERROR_HAS_OCCURRED="ERROR OCCURED" \ No newline at end of file diff --git a/src/language/overrides/index.html b/src/language/overrides/index.html new file mode 100644 index 00000000..2efb97f3 --- /dev/null +++ b/src/language/overrides/index.html @@ -0,0 +1 @@ +