diff --git a/.mokogitea/CLAUDE.md b/.mokogitea/CLAUDE.md index 7272e02..c06a709 100644 --- a/.mokogitea/CLAUDE.md +++ b/.mokogitea/CLAUDE.md @@ -1,4 +1,4 @@ -# moko-platform +# MokoCLI Enterprise automation, validation, sync, and governance engine for all Moko Consulting repositories. @@ -9,7 +9,7 @@ Enterprise automation, validation, sync, and governance engine for all Moko Cons | **Language** | PHP 8.1+ | | **Version** | 09.01.00 | | **Branch** | develop on `dev`, merge to `main` (protected) | -| **Wiki** | [moko-platform Wiki](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki) | +| **Wiki** | [MokoCLI Wiki](https://git.mokoconsulting.tech/MokoConsulting/mokocli/wiki) | ## Commands @@ -73,4 +73,4 @@ PHPStan runs with `--memory-limit=512M`. CI enforces PHPCS errors; PHPStan is `c - **Workflow directory**: `.mokogitea/` (not `.gitea/` or `.github/`) - **Wiki**: documentation lives in the Gitea wiki, not `docs/` files - **New CLI tools**: extend `CliFramework`, not `CLIApp` (legacy) -- **Standards**: [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki/Home) +- **Standards**: [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/mokocli/wiki/Home) diff --git a/.mokogitea/ISSUE_TEMPLATE/config.yml b/.mokogitea/ISSUE_TEMPLATE/config.yml index 06221e2..bbaebdc 100644 --- a/.mokogitea/ISSUE_TEMPLATE/config.yml +++ b/.mokogitea/ISSUE_TEMPLATE/config.yml @@ -7,8 +7,8 @@ contact_links: - name: 💬 Ask a Question url: https://mokoconsulting.tech/ about: Get help or ask questions through our website - - name: 📚 moko-platform Documentation - url: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + - name: 📚 MokoCLI Documentation + url: https://git.mokoconsulting.tech/MokoConsulting/mokocli about: View our coding standards and best practices - name: 🔒 Report a Security Vulnerability url: https://git.mokoconsulting.tech/mokoconsulting-tech/.github-private/security/advisories/new diff --git a/.mokogitea/ISSUE_TEMPLATE/documentation.md b/.mokogitea/ISSUE_TEMPLATE/documentation.md index 648dab9..8156651 100644 --- a/.mokogitea/ISSUE_TEMPLATE/documentation.md +++ b/.mokogitea/ISSUE_TEMPLATE/documentation.md @@ -42,7 +42,7 @@ Suggested text here ## Standards Alignment -- [ ] Follows moko-platform documentation guidelines +- [ ] Follows MokoCLI documentation guidelines - [ ] Uses en_US/en_GB localization - [ ] Includes proper SPDX headers where applicable diff --git a/.mokogitea/ISSUE_TEMPLATE/feature_request.md b/.mokogitea/ISSUE_TEMPLATE/feature_request.md index 6d691a0..650523c 100644 --- a/.mokogitea/ISSUE_TEMPLATE/feature_request.md +++ b/.mokogitea/ISSUE_TEMPLATE/feature_request.md @@ -37,7 +37,7 @@ If you have ideas about how this could be implemented, share them here: Add any other context, mockups, or screenshots about the feature request here. ## Relevant Standards -Does this relate to any standards in [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform)? +Does this relate to any standards in [MokoCLI](https://git.mokoconsulting.tech/MokoConsulting/mokocli)? - [ ] Accessibility (WCAG 2.1 AA) - [ ] Localization (en_US/en_GB) - [ ] Security best practices diff --git a/.mokogitea/ISSUE_TEMPLATE/security.md b/.mokogitea/ISSUE_TEMPLATE/security.md index 56b6573..37a266d 100644 --- a/.mokogitea/ISSUE_TEMPLATE/security.md +++ b/.mokogitea/ISSUE_TEMPLATE/security.md @@ -35,7 +35,7 @@ Use this template only for: ## Standards Reference -Does this relate to security standards in [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform)? +Does this relate to security standards in [MokoCLI](https://git.mokoconsulting.tech/MokoConsulting/mokocli)? - [ ] SPDX license identifiers - [ ] Secret management - [ ] Dependency security diff --git a/.mokogitea/branch-protection.yml b/.mokogitea/branch-protection.yml index d1bbbaf..1789097 100644 --- a/.mokogitea/branch-protection.yml +++ b/.mokogitea/branch-protection.yml @@ -2,8 +2,8 @@ # SPDX-License-Identifier: GPL-3.0-or-later # FILE INFORMATION # DEFGROUP: Gitea.Workflow -# INGROUP: moko-platform.Automation -# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +# INGROUP: MokoCLI.Automation +# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli # PATH: /.gitea/workflows/branch-protection.yml # BRIEF: Apply standardised branch protection rules to all governed repositories # @@ -62,7 +62,7 @@ jobs: API="${GITEA_URL}/api/v1" # Platform/standards/infra repos to exclude - EXCLUDE="gitea-org-config org-profile gitea-private .mokogitea-private moko-platform MokoTesting" + EXCLUDE="gitea-org-config org-profile gitea-private .mokogitea-private mokocli mokoplatform MokoTesting" EXCLUDE="$EXCLUDE MokoStandards-Template-Client MokoStandards-Template-Dolibarr MokoStandards-Template-Generic MokoStandards-Template-Joomla MokoDoliProjTemplate" if [ -n "${{ inputs.repos }}" ]; then diff --git a/.mokogitea/bulk-repo-sync.yml b/.mokogitea/bulk-repo-sync.yml index d0fdeb2..a7c831b 100644 --- a/.mokogitea/bulk-repo-sync.yml +++ b/.mokogitea/bulk-repo-sync.yml @@ -2,8 +2,8 @@ # SPDX-License-Identifier: GPL-3.0-or-later # FILE INFORMATION # DEFGROUP: Gitea.Workflow -# INGROUP: moko-platform.Automation -# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +# INGROUP: MokoCLI.Automation +# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli # PATH: /.gitea/workflows/bulk-repo-sync.yml # BRIEF: Bulk repo sync — runs from API repo, syncs standards to all governed repos diff --git a/.mokogitea/pr-branch-check.yml b/.mokogitea/pr-branch-check.yml index e8b1750..0cb099c 100644 --- a/.mokogitea/pr-branch-check.yml +++ b/.mokogitea/pr-branch-check.yml @@ -2,9 +2,9 @@ # SPDX-License-Identifier: GPL-3.0-or-later # # FILE INFORMATION -# DEFGROUP: moko-platform.CI -# INGROUP: moko-platform -# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +# DEFGROUP: MokoCLI.CI +# INGROUP: MokoCLI +# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli # PATH: /.gitea/workflows/pr-branch-check.yml # BRIEF: PR branch merge policy enforcement # diff --git a/.mokogitea/renovate.yml b/.mokogitea/renovate.yml index 726dd4f..ce6f4e7 100644 --- a/.mokogitea/renovate.yml +++ b/.mokogitea/renovate.yml @@ -4,8 +4,8 @@ # # FILE INFORMATION # DEFGROUP: Gitea.Workflow -# INGROUP: moko-platform.Automation -# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +# INGROUP: MokoCLI.Automation +# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli # PATH: /.gitea/workflows/renovate.yml # BRIEF: Run Renovate Bot across all governed repos for dependency updates # @@ -61,7 +61,7 @@ jobs: run: | API="${GITEA_URL}/api/v1" - EXCLUDE="gitea-org-config org-profile gitea-private .mokogitea-private moko-platform MokoTesting" + EXCLUDE="gitea-org-config org-profile gitea-private .mokogitea-private mokocli mokoplatform MokoTesting" EXCLUDE="$EXCLUDE MokoStandards-Template-Client MokoStandards-Template-Dolibarr MokoStandards-Template-Generic MokoStandards-Template-Joomla MokoDoliProjTemplate" if [ -n "${{ inputs.repos }}" ]; then diff --git a/.mokogitea/sync-wikis.yml b/.mokogitea/sync-wikis.yml index af71890..28ab105 100644 --- a/.mokogitea/sync-wikis.yml +++ b/.mokogitea/sync-wikis.yml @@ -4,8 +4,8 @@ # # FILE INFORMATION # DEFGROUP: Gitea.Workflow -# INGROUP: moko-platform.Maintenance -# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +# INGROUP: MokoCLI.Maintenance +# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli # PATH: /.gitea/workflows/sync-wikis.yml # BRIEF: Daily sync of all Gitea wikis to consolidated GitHub wiki repo diff --git a/.mokogitea/workflows/auto-bump.yml b/.mokogitea/workflows/auto-bump.yml index 9de5276..1c0ce49 100644 --- a/.mokogitea/workflows/auto-bump.yml +++ b/.mokogitea/workflows/auto-bump.yml @@ -1,68 +1,72 @@ -# Copyright (C) 2026 Moko Consulting -# -# SPDX-License-Identifier: GPL-3.0-or-later -# -# FILE INFORMATION -# DEFGROUP: Gitea.Workflow -# INGROUP: moko-platform.Release -# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform -# PATH: /.mokogitea/workflows/auto-bump.yml -# VERSION: 09.23.00 -# BRIEF: Auto patch-bump version on every push to dev (skips merge commits) - -name: "Universal: Auto Version Bump" - -on: - push: - branches: - - dev - - rc - - 'feature/**' - - 'patch/**' - -env: - FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true - GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }} - -permissions: - contents: write - -jobs: - bump: - name: Version Bump - runs-on: release - if: >- - !contains(github.event.head_commit.message, '[skip ci]') && - !contains(github.event.head_commit.message, '[skip bump]') && - !startsWith(github.event.head_commit.message, 'Merge pull request') - - steps: - - name: Checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - with: - token: ${{ secrets.MOKOGITEA_TOKEN }} - fetch-depth: 1 - - - name: Setup moko-platform tools - run: | - if [ -f "/opt/moko-platform/cli/version_bump.php" ] && [ -f "/opt/moko-platform/vendor/autoload.php" ]; then - echo "Using pre-installed /opt/moko-platform" - echo "MOKO_CLI=/opt/moko-platform/cli" >> "$GITHUB_ENV" - else - if ! command -v composer &> /dev/null; then - sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1 - fi - rm -rf /tmp/moko-platform-api - git clone --depth 1 --branch main --quiet \ - "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/MokoConsulting/moko-platform.git" \ - /tmp/moko-platform-api - cd /tmp/moko-platform-api && composer install --no-dev --no-interaction --quiet - echo "MOKO_CLI=/tmp/moko-platform-api/cli" >> "$GITHUB_ENV" - fi - - - name: Bump version - run: | - php ${MOKO_CLI}/version_auto_bump.php \ - --path . --branch "${GITHUB_REF_NAME}" \ - --token "${{ secrets.MOKOGITEA_TOKEN }}" \ - --repo-url "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git" +# Copyright (C) 2026 Moko Consulting +# +# SPDX-License-Identifier: GPL-3.0-or-later +# +# FILE INFORMATION +# DEFGROUP: Gitea.Workflow +# INGROUP: MokoCLI.Release +# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli +# PATH: /.mokogitea/workflows/auto-bump.yml +# VERSION: 09.23.00 +# BRIEF: Auto patch-bump version on every push to dev (skips merge commits) + +name: "Universal: Auto Version Bump" + +on: + push: + branches: + - dev + - rc + - 'feature/**' + - 'patch/**' + +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }} + +permissions: + contents: write + +jobs: + bump: + name: Version Bump + runs-on: release + if: >- + !contains(github.event.head_commit.message, '[skip ci]') && + !contains(github.event.head_commit.message, '[skip bump]') && + !startsWith(github.event.head_commit.message, 'Merge pull request') + + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + token: ${{ secrets.MOKOGITEA_TOKEN }} + fetch-depth: 1 + + - name: Setup MokoCLI tools + run: | + # Check both new (mokocli) and legacy (mokoplatform) install paths + if [ -f "/opt/mokocli/cli/version_bump.php" ] && [ -f "/opt/mokocli/vendor/autoload.php" ]; then + echo "Using pre-installed /opt/mokocli" + echo "MOKO_CLI=/opt/mokocli/cli" >> "$GITHUB_ENV" + elif [ -f "/opt/mokoplatform/cli/version_bump.php" ] && [ -f "/opt/mokoplatform/vendor/autoload.php" ]; then + echo "Using pre-installed /opt/mokoplatform (legacy path)" + echo "MOKO_CLI=/opt/mokoplatform/cli" >> "$GITHUB_ENV" + else + if ! command -v composer &> /dev/null; then + sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer >/dev/null 2>&1 + fi + rm -rf /tmp/mokocli + git clone --depth 1 --branch main --quiet \ + "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/MokoConsulting/mokocli.git" \ + /tmp/mokocli + cd /tmp/mokocli && composer install --no-dev --no-interaction --quiet + echo "MOKO_CLI=/tmp/mokocli/cli" >> "$GITHUB_ENV" + fi + + - name: Bump version + run: | + php ${MOKO_CLI}/version_auto_bump.php \ + --path . --branch "${GITHUB_REF_NAME}" \ + --token "${{ secrets.MOKOGITEA_TOKEN }}" \ + --repo-url "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git" diff --git a/.mokogitea/workflows/auto-release.yml b/.mokogitea/workflows/auto-release.yml index ca40435..e86c538 100644 --- a/.mokogitea/workflows/auto-release.yml +++ b/.mokogitea/workflows/auto-release.yml @@ -1,324 +1,332 @@ -# Copyright (C) 2026 Moko Consulting -# -# SPDX-License-Identifier: GPL-3.0-or-later -# -# FILE INFORMATION -# DEFGROUP: Gitea.Workflow -# INGROUP: moko-platform.Release -# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/moko-platform -# PATH: /templates/workflows/universal/auto-release.yml.template -# VERSION: 05.00.00 -# BRIEF: Universal build & release � detects platform from manifest.xml -# -# +========================================================================+ -# | UNIVERSAL BUILD & RELEASE PIPELINE | -# +========================================================================+ -# | | -# | Reads manifest.xml (joomla|dolibarr|generic) to branch logic. | -# | | -# | Platform-specific: | -# | joomla: XML manifest, type-prefixed packages | -# | dolibarr: mod*.class.php, update.txt, dev version reset | -# | generic: README-only, no update stream | -# | | -# +========================================================================+ - -name: "Universal: Build & Release" - -on: - pull_request: - types: [opened, closed] - branches: - - main - workflow_dispatch: - inputs: - action: - description: 'Action to perform' - required: false - type: choice - default: release - options: - - release - - promote-rc - -env: - FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true - GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }} - GITEA_ORG: ${{ vars.GITEA_ORG || github.repository_owner }} - GITEA_REPO: ${{ vars.GITEA_REPO || github.event.repository.name }} - -permissions: - contents: write - -jobs: - # ── PR Opened → Rename branch to RC and build RC release ───────────────────── - promote-rc: - name: Promote to RC - runs-on: release - if: >- - (github.event.action == 'opened' && github.event.pull_request.merged != true) || - (github.event_name == 'workflow_dispatch' && inputs.action == 'promote-rc') - - steps: - - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - with: - token: ${{ secrets.MOKOGITEA_TOKEN }} - fetch-depth: 1 - - - name: Setup moko-platform tools - env: - MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }} - MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting - run: | - if [ -f /opt/moko-platform/cli/version_bump.php ] && [ -f /opt/moko-platform/vendor/autoload.php ]; then - echo Using pre-installed /opt/moko-platform - echo MOKO_CLI=/opt/moko-platform/cli >> $GITHUB_ENV - else - echo Falling back to fresh clone - if ! command -v composer > /dev/null 2>&1; then - sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer > /dev/null 2>&1 - fi - rm -rf /tmp/moko-platform-api - CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git - git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/moko-platform-api - cd /tmp/moko-platform-api - composer install --no-dev --no-interaction --quiet - echo MOKO_CLI=/tmp/moko-platform-api/cli >> $GITHUB_ENV - fi - - - name: Rename branch to rc - run: | - php ${MOKO_CLI}/branch_rename.php \ - --from "${{ github.event.pull_request.head.ref || 'dev' }}" --to rc \ - --token "${{ secrets.MOKOGITEA_TOKEN }}" \ - --api-base "${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" \ - --pr "${{ github.event.pull_request.number }}" - - - name: Checkout rc and configure git - run: | - git fetch origin rc - git checkout rc - git config --local user.email "gitea-actions[bot]@mokoconsulting.tech" - git config --local user.name "gitea-actions[bot]" - git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git" - - - name: Publish RC release - run: | - php ${MOKO_CLI}/release_publish.php \ - --path . --stability rc --bump minor --branch rc \ - --token "${{ secrets.MOKOGITEA_TOKEN }}" - - - name: Summary - if: always() - run: | - echo "## Promoted to Release Candidate" >> $GITHUB_STEP_SUMMARY - echo "Branch renamed to rc, minor bump, RC release built" >> $GITHUB_STEP_SUMMARY - - # ── Merged PR → Build & Release (or promote RC to stable) ──────────────────── - release: - name: Build & Release Pipeline - runs-on: release - if: >- - github.event.pull_request.merged == true || - (github.event_name == 'workflow_dispatch' && inputs.action != 'promote-rc') - - steps: - - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - with: - token: ${{ secrets.MOKOGITEA_TOKEN }} - fetch-depth: 0 - - - name: Configure git for bot pushes - run: | - git config --local user.email "gitea-actions[bot]@mokoconsulting.tech" - git config --local user.name "gitea-actions[bot]" - git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git" - - - name: Check for merge conflict markers - run: | - CONFLICTS=$(grep -rn '<<<<<<< \|>>>>>>> \|^=======$' --include='*.php' --include='*.xml' --include='*.css' --include='*.js' --include='*.json' --include='*.md' --include='*.yml' --include='*.yaml' --include='*.ini' --include='*.txt' . 2>/dev/null | grep -v '.git/' || true) - if [ -n "$CONFLICTS" ]; then - echo "::error::Merge conflict markers found — aborting release" - echo "## Release Blocked: Conflict Markers" >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - echo "$CONFLICTS" >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - exit 1 - fi - echo "No conflict markers found" - - - name: Setup moko-platform tools - env: - MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }} - MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting - COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GH_MIRROR_TOKEN }}"}}' - run: | - if [ -f /opt/moko-platform/cli/version_bump.php ] && [ -f /opt/moko-platform/vendor/autoload.php ]; then - echo Using pre-installed /opt/moko-platform - echo MOKO_CLI=/opt/moko-platform/cli >> $GITHUB_ENV - else - echo Falling back to fresh clone - if ! command -v composer > /dev/null 2>&1; then - sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer > /dev/null 2>&1 - fi - rm -rf /tmp/moko-platform-api - CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git - git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/moko-platform-api - cd /tmp/moko-platform-api - composer install --no-dev --no-interaction --quiet - echo MOKO_CLI=/tmp/moko-platform-api/cli >> $GITHUB_ENV - fi - - - name: "Publish stable release" - run: | - php ${MOKO_CLI}/release_publish.php \ - --path . --stability stable --bump minor --branch main \ - --token "${{ secrets.MOKOGITEA_TOKEN }}" - - - name: Update release notes from CHANGELOG.md - run: | - API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" - - # Extract [Unreleased] section from changelog - if [ -f "CHANGELOG.md" ]; then - NOTES=$(awk '/^## \[Unreleased\]/{found=1; next} /^## \[/{if(found) exit} found{print}' CHANGELOG.md) - [ -z "$NOTES" ] && NOTES="Stable release" - else - NOTES="Stable release" - fi - - # Update release body via API - RELEASE_ID=$(curl -sf -H "Authorization: token ${{ secrets.MOKOGITEA_TOKEN }}" \ - "${API_BASE}/releases/tags/stable" | python3 -c "import json,sys; print(json.load(sys.stdin).get('id',''))" 2>/dev/null || true) - - if [ -n "$RELEASE_ID" ]; then - python3 -c " - import json, urllib.request - body = open('/dev/stdin').read() - payload = json.dumps({'body': body}).encode() - req = urllib.request.Request( - '${API_BASE}/releases/${RELEASE_ID}', - data=payload, method='PATCH', - headers={ - 'Authorization': 'token ${{ secrets.MOKOGITEA_TOKEN }}', - 'Content-Type': 'application/json' - }) - urllib.request.urlopen(req) - " <<< "$NOTES" - echo "Release notes updated from CHANGELOG.md" - fi - - # -- STEP 9: Mirror to GitHub (stable only) -------------------------------- - - name: "Step 9: Mirror release to GitHub" - if: >- - steps.version.outputs.skip != 'true' && - secrets.GH_MIRROR_TOKEN != '' - continue-on-error: true - run: | - VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}" - RELEASE_TAG="${{ steps.version.outputs.release_tag }}" - GH_REPO="${{ vars.GH_MIRROR_REPO || github.repository }}" - API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" - php ${MOKO_CLI}/release_mirror.php \ - --version "$VERSION" --tag "$RELEASE_TAG" \ - --token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \ - --gh-token "${{ secrets.GH_MIRROR_TOKEN }}" --gh-repo "$GH_REPO" \ - --branch main 2>&1 || true - echo "GitHub mirror updated" >> $GITHUB_STEP_SUMMARY - - # -- STEP 10: Sync main branch to GitHub mirror ---------------------------- - - name: "Step 10: Push main to GitHub mirror" - if: >- - steps.version.outputs.skip != 'true' && - secrets.GH_MIRROR_TOKEN != '' - continue-on-error: true - run: | - GH_REPO="${{ vars.GH_MIRROR_REPO || github.repository }}" - GH_ORG=$(echo "$GH_REPO" | cut -d/ -f1) - GH_NAME=$(echo "$GH_REPO" | cut -d/ -f2) - git remote add github "https://x-access-token:${{ secrets.GH_MIRROR_TOKEN }}@github.com/${GH_ORG}/${GH_NAME}.git" 2>/dev/null || \ - git remote set-url github "https://x-access-token:${{ secrets.GH_MIRROR_TOKEN }}@github.com/${GH_ORG}/${GH_NAME}.git" - git fetch origin main --depth=1 - git push github origin/main:refs/heads/main --force 2>/dev/null \ - && echo "main branch pushed to GitHub mirror" \ - || echo "WARNING: GitHub mirror push failed" - - - name: "Step 11: Delete rc branch and recreate dev from main" - if: steps.version.outputs.skip != 'true' - continue-on-error: true - run: | - API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" - TOKEN="${{ secrets.MOKOGITEA_TOKEN }}" - - # Delete rc branch (ephemeral — created by promote-rc) - curl -sf -X DELETE -H "Authorization: token ${TOKEN}" \ - "${API_BASE}/branches/rc" 2>/dev/null \ - && echo "Deleted rc branch" || echo "rc branch not found" - - # Delete dev branch - curl -sf -X DELETE -H "Authorization: token ${TOKEN}" \ - "${API_BASE}/branches/dev" 2>/dev/null && echo "Deleted dev branch" - - # Recreate dev from main (now includes version bump + changelog promotion) - curl -sf -X POST -H "Authorization: token ${TOKEN}" \ - -H "Content-Type: application/json" \ - "${API_BASE}/branches" \ - -d '{"new_branch_name":"dev","old_branch_name":"main"}' 2>/dev/null && echo "Recreated dev from main" - - echo "Pre-release branches cleaned, dev reset from main" >> $GITHUB_STEP_SUMMARY - - - name: "Step 12: Create version branch from main" - if: steps.version.outputs.skip != 'true' - continue-on-error: true - run: | - API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" - TOKEN="${{ secrets.MOKOGITEA_TOKEN }}" - VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}" - BRANCH_NAME="version/${VERSION}" - MAIN_SHA=$(git rev-parse HEAD) - - # Delete old version branch if it exists (same version re-release) - curl -sf -X DELETE -H "Authorization: token ${TOKEN}" "${API_BASE}/branches/${BRANCH_NAME}" 2>/dev/null && echo "Deleted old ${BRANCH_NAME}" - - # Create version/XX.YY.ZZ from main - curl -sf -X POST -H "Authorization: token ${TOKEN}" -H "Content-Type: application/json" "${API_BASE}/branches" -d "{\"new_branch_name\":\"${BRANCH_NAME}\",\"old_branch_name\":\"main\"}" 2>/dev/null && echo "Created ${BRANCH_NAME} from main (${MAIN_SHA})" || echo "WARNING: ${BRANCH_NAME} creation failed" - - echo "Version branch created: ${BRANCH_NAME} (${MAIN_SHA})" >> $GITHUB_STEP_SUMMARY - - - - # -- Dolibarr post-release: Reset dev version ----------------------------- - - name: "Post-release: Reset dev version" - if: steps.version.outputs.skip != 'true' - continue-on-error: true - run: | - API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" - php ${MOKO_CLI}/version_reset_dev.php \ - --token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "${API_BASE}" \ - --branch dev --path . 2>&1 || true - - # -- Summary -------------------------------------------------------------- - - name: Pipeline Summary - if: always() - run: | - VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}" - PLATFORM="${{ steps.platform.outputs.platform }}" - if [ "${{ steps.version.outputs.skip }}" = "true" ]; then - echo "## Release Skipped" >> $GITHUB_STEP_SUMMARY - echo "No VERSION in README.md" >> $GITHUB_STEP_SUMMARY - elif [ "${{ steps.check.outputs.already_released }}" = "true" ]; then - echo "## Already Released — ${VERSION}" >> $GITHUB_STEP_SUMMARY - else - echo "" >> $GITHUB_STEP_SUMMARY - echo "## Build & Release Complete (${PLATFORM})" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "| Step | Result |" >> $GITHUB_STEP_SUMMARY - echo "|------|--------|" >> $GITHUB_STEP_SUMMARY - echo "| Platform | \`${PLATFORM}\` |" >> $GITHUB_STEP_SUMMARY - echo "| Version | \`${VERSION}\` |" >> $GITHUB_STEP_SUMMARY - echo "| Branch | \`${{ steps.version.outputs.branch }}\` |" >> $GITHUB_STEP_SUMMARY - echo "| Tag | \`${{ steps.version.outputs.tag }}\` |" >> $GITHUB_STEP_SUMMARY - echo "| Release | [View](${GITEA_URL}/${GITEA_ORG}/${GITEA_REPO}/releases/tag/${{ steps.version.outputs.tag }}) |" >> $GITHUB_STEP_SUMMARY - fi +# Copyright (C) 2026 Moko Consulting +# +# SPDX-License-Identifier: GPL-3.0-or-later +# +# FILE INFORMATION +# DEFGROUP: Gitea.Workflow +# INGROUP: MokoCLI.Release +# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli +# PATH: /templates/workflows/universal/auto-release.yml.template +# VERSION: 05.00.00 +# BRIEF: Universal build & release � detects platform from manifest.xml +# +# +========================================================================+ +# | UNIVERSAL BUILD & RELEASE PIPELINE | +# +========================================================================+ +# | | +# | Reads manifest.xml (joomla|dolibarr|generic) to branch logic. | +# | | +# | Platform-specific: | +# | joomla: XML manifest, type-prefixed packages | +# | dolibarr: mod*.class.php, update.txt, dev version reset | +# | generic: README-only, no update stream | +# | | +# +========================================================================+ + +name: "Universal: Build & Release" + +on: + pull_request: + types: [opened, closed] + branches: + - main + workflow_dispatch: + inputs: + action: + description: 'Action to perform' + required: false + type: choice + default: release + options: + - release + - promote-rc + +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }} + GITEA_ORG: ${{ vars.GITEA_ORG || github.repository_owner }} + GITEA_REPO: ${{ vars.GITEA_REPO || github.event.repository.name }} + +permissions: + contents: write + +jobs: + # ── PR Opened → Rename branch to RC and build RC release ───────────────────── + promote-rc: + name: Promote to RC + runs-on: release + if: >- + (github.event.action == 'opened' && github.event.pull_request.merged != true) || + (github.event_name == 'workflow_dispatch' && inputs.action == 'promote-rc') + + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + token: ${{ secrets.MOKOGITEA_TOKEN }} + fetch-depth: 1 + + - name: Setup MokoCLI tools + env: + MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }} + MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting + run: | + # Check both new (mokocli) and legacy (mokoplatform) install paths + if [ -f /opt/mokocli/cli/version_bump.php ] && [ -f /opt/mokocli/vendor/autoload.php ]; then + echo "Using pre-installed /opt/mokocli" + echo MOKO_CLI=/opt/mokocli/cli >> $GITHUB_ENV + elif [ -f /opt/mokoplatform/cli/version_bump.php ] && [ -f /opt/mokoplatform/vendor/autoload.php ]; then + echo "Using pre-installed /opt/mokoplatform (legacy path)" + echo MOKO_CLI=/opt/mokoplatform/cli >> $GITHUB_ENV + else + echo "Falling back to fresh clone" + if ! command -v composer > /dev/null 2>&1; then + sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer > /dev/null 2>&1 + fi + rm -rf /tmp/mokocli + CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/mokocli.git + git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/mokocli + cd /tmp/mokocli + composer install --no-dev --no-interaction --quiet + echo MOKO_CLI=/tmp/mokocli/cli >> $GITHUB_ENV + fi + + - name: Rename branch to rc + run: | + php ${MOKO_CLI}/branch_rename.php \ + --from "${{ github.event.pull_request.head.ref || 'dev' }}" --to rc \ + --token "${{ secrets.MOKOGITEA_TOKEN }}" \ + --api-base "${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" \ + --pr "${{ github.event.pull_request.number }}" + + - name: Checkout rc and configure git + run: | + git fetch origin rc + git checkout rc + git config --local user.email "gitea-actions[bot]@mokoconsulting.tech" + git config --local user.name "gitea-actions[bot]" + git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git" + + - name: Publish RC release + run: | + php ${MOKO_CLI}/release_publish.php \ + --path . --stability rc --bump minor --branch rc \ + --token "${{ secrets.MOKOGITEA_TOKEN }}" + + - name: Summary + if: always() + run: | + echo "## Promoted to Release Candidate" >> $GITHUB_STEP_SUMMARY + echo "Branch renamed to rc, minor bump, RC release built" >> $GITHUB_STEP_SUMMARY + + # ── Merged PR → Build & Release (or promote RC to stable) ──────────────────── + release: + name: Build & Release Pipeline + runs-on: release + if: >- + github.event.pull_request.merged == true || + (github.event_name == 'workflow_dispatch' && inputs.action != 'promote-rc') + + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + token: ${{ secrets.MOKOGITEA_TOKEN }} + fetch-depth: 0 + + - name: Configure git for bot pushes + run: | + git config --local user.email "gitea-actions[bot]@mokoconsulting.tech" + git config --local user.name "gitea-actions[bot]" + git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git" + + - name: Check for merge conflict markers + run: | + CONFLICTS=$(grep -rn '<<<<<<< \|>>>>>>> \|^=======$' --include='*.php' --include='*.xml' --include='*.css' --include='*.js' --include='*.json' --include='*.md' --include='*.yml' --include='*.yaml' --include='*.ini' --include='*.txt' . 2>/dev/null | grep -v '.git/' || true) + if [ -n "$CONFLICTS" ]; then + echo "::error::Merge conflict markers found — aborting release" + echo "## Release Blocked: Conflict Markers" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + echo "$CONFLICTS" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + exit 1 + fi + echo "No conflict markers found" + + - name: Setup MokoCLI tools + env: + MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }} + MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting + COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GH_MIRROR_TOKEN }}"}}' + run: | + # Check both new (mokocli) and legacy (mokoplatform) install paths + if [ -f /opt/mokocli/cli/version_bump.php ] && [ -f /opt/mokocli/vendor/autoload.php ]; then + echo "Using pre-installed /opt/mokocli" + echo MOKO_CLI=/opt/mokocli/cli >> $GITHUB_ENV + elif [ -f /opt/mokoplatform/cli/version_bump.php ] && [ -f /opt/mokoplatform/vendor/autoload.php ]; then + echo "Using pre-installed /opt/mokoplatform (legacy path)" + echo MOKO_CLI=/opt/mokoplatform/cli >> $GITHUB_ENV + else + echo "Falling back to fresh clone" + if ! command -v composer > /dev/null 2>&1; then + sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer > /dev/null 2>&1 + fi + rm -rf /tmp/mokocli + CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/mokocli.git + git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/mokocli + cd /tmp/mokocli + composer install --no-dev --no-interaction --quiet + echo MOKO_CLI=/tmp/mokocli/cli >> $GITHUB_ENV + fi + + - name: "Publish stable release" + run: | + php ${MOKO_CLI}/release_publish.php \ + --path . --stability stable --bump minor --branch main \ + --token "${{ secrets.MOKOGITEA_TOKEN }}" + + - name: Update release notes from CHANGELOG.md + run: | + API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" + + # Extract [Unreleased] section from changelog + if [ -f "CHANGELOG.md" ]; then + NOTES=$(awk '/^## \[Unreleased\]/{found=1; next} /^## \[/{if(found) exit} found{print}' CHANGELOG.md) + [ -z "$NOTES" ] && NOTES="Stable release" + else + NOTES="Stable release" + fi + + # Update release body via API + RELEASE_ID=$(curl -sf -H "Authorization: token ${{ secrets.MOKOGITEA_TOKEN }}" \ + "${API_BASE}/releases/tags/stable" | python3 -c "import json,sys; print(json.load(sys.stdin).get('id',''))" 2>/dev/null || true) + + if [ -n "$RELEASE_ID" ]; then + python3 -c " + import json, urllib.request + body = open('/dev/stdin').read() + payload = json.dumps({'body': body}).encode() + req = urllib.request.Request( + '${API_BASE}/releases/${RELEASE_ID}', + data=payload, method='PATCH', + headers={ + 'Authorization': 'token ${{ secrets.MOKOGITEA_TOKEN }}', + 'Content-Type': 'application/json' + }) + urllib.request.urlopen(req) + " <<< "$NOTES" + echo "Release notes updated from CHANGELOG.md" + fi + + # -- STEP 9: Mirror to GitHub (stable only) -------------------------------- + - name: "Step 9: Mirror release to GitHub" + if: >- + steps.version.outputs.skip != 'true' && + secrets.GH_MIRROR_TOKEN != '' + continue-on-error: true + run: | + VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}" + RELEASE_TAG="${{ steps.version.outputs.release_tag }}" + GH_REPO="${{ vars.GH_MIRROR_REPO || github.repository }}" + API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" + php ${MOKO_CLI}/release_mirror.php \ + --version "$VERSION" --tag "$RELEASE_TAG" \ + --token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \ + --gh-token "${{ secrets.GH_MIRROR_TOKEN }}" --gh-repo "$GH_REPO" \ + --branch main 2>&1 || true + echo "GitHub mirror updated" >> $GITHUB_STEP_SUMMARY + + # -- STEP 10: Sync main branch to GitHub mirror ---------------------------- + - name: "Step 10: Push main to GitHub mirror" + if: >- + steps.version.outputs.skip != 'true' && + secrets.GH_MIRROR_TOKEN != '' + continue-on-error: true + run: | + GH_REPO="${{ vars.GH_MIRROR_REPO || github.repository }}" + GH_ORG=$(echo "$GH_REPO" | cut -d/ -f1) + GH_NAME=$(echo "$GH_REPO" | cut -d/ -f2) + git remote add github "https://x-access-token:${{ secrets.GH_MIRROR_TOKEN }}@github.com/${GH_ORG}/${GH_NAME}.git" 2>/dev/null || \ + git remote set-url github "https://x-access-token:${{ secrets.GH_MIRROR_TOKEN }}@github.com/${GH_ORG}/${GH_NAME}.git" + git fetch origin main --depth=1 + git push github origin/main:refs/heads/main --force 2>/dev/null \ + && echo "main branch pushed to GitHub mirror" \ + || echo "WARNING: GitHub mirror push failed" + + - name: "Step 11: Delete rc branch and recreate dev from main" + if: steps.version.outputs.skip != 'true' + continue-on-error: true + run: | + API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" + TOKEN="${{ secrets.MOKOGITEA_TOKEN }}" + + # Delete rc branch (ephemeral — created by promote-rc) + curl -sf -X DELETE -H "Authorization: token ${TOKEN}" \ + "${API_BASE}/branches/rc" 2>/dev/null \ + && echo "Deleted rc branch" || echo "rc branch not found" + + # Delete dev branch + curl -sf -X DELETE -H "Authorization: token ${TOKEN}" \ + "${API_BASE}/branches/dev" 2>/dev/null && echo "Deleted dev branch" + + # Recreate dev from main (now includes version bump + changelog promotion) + curl -sf -X POST -H "Authorization: token ${TOKEN}" \ + -H "Content-Type: application/json" \ + "${API_BASE}/branches" \ + -d '{"new_branch_name":"dev","old_branch_name":"main"}' 2>/dev/null && echo "Recreated dev from main" + + echo "Pre-release branches cleaned, dev reset from main" >> $GITHUB_STEP_SUMMARY + + - name: "Step 12: Create version branch from main" + if: steps.version.outputs.skip != 'true' + continue-on-error: true + run: | + API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" + TOKEN="${{ secrets.MOKOGITEA_TOKEN }}" + VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}" + BRANCH_NAME="version/${VERSION}" + MAIN_SHA=$(git rev-parse HEAD) + + # Delete old version branch if it exists (same version re-release) + curl -sf -X DELETE -H "Authorization: token ${TOKEN}" "${API_BASE}/branches/${BRANCH_NAME}" 2>/dev/null && echo "Deleted old ${BRANCH_NAME}" + + # Create version/XX.YY.ZZ from main + curl -sf -X POST -H "Authorization: token ${TOKEN}" -H "Content-Type: application/json" "${API_BASE}/branches" -d "{\"new_branch_name\":\"${BRANCH_NAME}\",\"old_branch_name\":\"main\"}" 2>/dev/null && echo "Created ${BRANCH_NAME} from main (${MAIN_SHA})" || echo "WARNING: ${BRANCH_NAME} creation failed" + + echo "Version branch created: ${BRANCH_NAME} (${MAIN_SHA})" >> $GITHUB_STEP_SUMMARY + + + + # -- Dolibarr post-release: Reset dev version ----------------------------- + - name: "Post-release: Reset dev version" + if: steps.version.outputs.skip != 'true' + continue-on-error: true + run: | + API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" + php ${MOKO_CLI}/version_reset_dev.php \ + --token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "${API_BASE}" \ + --branch dev --path . 2>&1 || true + + # -- Summary -------------------------------------------------------------- + - name: Pipeline Summary + if: always() + run: | + VERSION="${{ steps.bump.outputs.version || steps.version.outputs.version }}" + PLATFORM="${{ steps.platform.outputs.platform }}" + if [ "${{ steps.version.outputs.skip }}" = "true" ]; then + echo "## Release Skipped" >> $GITHUB_STEP_SUMMARY + echo "No VERSION in README.md" >> $GITHUB_STEP_SUMMARY + elif [ "${{ steps.check.outputs.already_released }}" = "true" ]; then + echo "## Already Released — ${VERSION}" >> $GITHUB_STEP_SUMMARY + else + echo "" >> $GITHUB_STEP_SUMMARY + echo "## Build & Release Complete (${PLATFORM})" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "| Step | Result |" >> $GITHUB_STEP_SUMMARY + echo "|------|--------|" >> $GITHUB_STEP_SUMMARY + echo "| Platform | \`${PLATFORM}\` |" >> $GITHUB_STEP_SUMMARY + echo "| Version | \`${VERSION}\` |" >> $GITHUB_STEP_SUMMARY + echo "| Branch | \`${{ steps.version.outputs.branch }}\` |" >> $GITHUB_STEP_SUMMARY + echo "| Tag | \`${{ steps.version.outputs.tag }}\` |" >> $GITHUB_STEP_SUMMARY + echo "| Release | [View](${GITEA_URL}/${GITEA_ORG}/${GITEA_REPO}/releases/tag/${{ steps.version.outputs.tag }}) |" >> $GITHUB_STEP_SUMMARY + fi diff --git a/.mokogitea/workflows/branch-cleanup.yml b/.mokogitea/workflows/branch-cleanup.yml index 67a735f..9d884e7 100644 --- a/.mokogitea/workflows/branch-cleanup.yml +++ b/.mokogitea/workflows/branch-cleanup.yml @@ -4,10 +4,10 @@ # # FILE INFORMATION # DEFGROUP: Gitea.Workflow -# INGROUP: MokoPlatform.Universal -# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +# INGROUP: MokoStandards.Universal +# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli # PATH: /.mokogitea/workflows/branch-cleanup.yml -# VERSION: 09.23.00 +# VERSION: 01.00.00 # BRIEF: Delete feature branches after PR merge name: "Branch Cleanup" diff --git a/.mokogitea/workflows/ci-platform.yml b/.mokogitea/workflows/ci-platform.yml index 2d274ea..2cac577 100644 --- a/.mokogitea/workflows/ci-platform.yml +++ b/.mokogitea/workflows/ci-platform.yml @@ -4,18 +4,18 @@ # # FILE INFORMATION # DEFGROUP: Gitea.Workflow -# INGROUP: moko-platform.CI -# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +# INGROUP: MokoCLI.CI +# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli # PATH: /.mokogitea/workflows/ci-platform.yml # VERSION: 09.23.00 -# BRIEF: moko-platform CI — the standards engine validates itself +# BRIEF: MokoCLI CI — the standards engine validates itself # # +========================================================================+ -# | MOKO-PLATFORM CI | +# | MOKOCLI CI | # +========================================================================+ # | | # | This is NOT a generic CI workflow. This is the self-validation | -# | pipeline for the central moko-platform enterprise engine. | +# | pipeline for the central MokoCLI enterprise engine. | # | | # | It dogfoods every tool the platform ships to governed repos: | # | | @@ -29,7 +29,7 @@ # | | # +========================================================================+ -name: "Platform: moko-platform CI" +name: "Platform: MokoCLI CI" on: push: @@ -421,7 +421,7 @@ jobs: - name: Check gate results run: | { - echo "# moko-platform CI" + echo "# MokoCLI CI" echo "" echo "| Gate | Job | Status |" echo "|---|---|---|" diff --git a/.mokogitea/workflows/cleanup.yml b/.mokogitea/workflows/cleanup.yml index 91faae4..3a266e9 100644 --- a/.mokogitea/workflows/cleanup.yml +++ b/.mokogitea/workflows/cleanup.yml @@ -4,8 +4,8 @@ # # FILE INFORMATION # DEFGROUP: Gitea.Workflow -# INGROUP: moko-platform.Maintenance -# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +# INGROUP: MokoCLI.Maintenance +# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli # PATH: /.mokogitea/workflows/cleanup.yml # VERSION: 09.23.00 # BRIEF: Scheduled cleanup — delete merged branches and old workflow runs diff --git a/.mokogitea/workflows/gitleaks.yml b/.mokogitea/workflows/gitleaks.yml index 9126c91..4a7f4fb 100644 --- a/.mokogitea/workflows/gitleaks.yml +++ b/.mokogitea/workflows/gitleaks.yml @@ -4,8 +4,8 @@ # # FILE INFORMATION # DEFGROUP: Gitea.Workflow -# INGROUP: moko-platform.Security -# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/moko-platform +# INGROUP: MokoCLI.Security +# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli # PATH: /templates/workflows/gitleaks.yml.template # VERSION: 09.23.00 # BRIEF: Secret scanning — detect leaked credentials, API keys, and tokens diff --git a/.mokogitea/workflows/issue-branch.yml b/.mokogitea/workflows/issue-branch.yml index e849522..23234c9 100644 --- a/.mokogitea/workflows/issue-branch.yml +++ b/.mokogitea/workflows/issue-branch.yml @@ -4,8 +4,8 @@ # # FILE INFORMATION # DEFGROUP: Gitea.Workflow -# INGROUP: moko-platform.Automation -# VERSION: 09.25.02 +# INGROUP: MokoCLI.Automation +# VERSION: 09.25.05 # BRIEF: Auto-create feature branch when an issue is opened name: "Universal: Issue Branch" diff --git a/.mokogitea/workflows/notify.yml b/.mokogitea/workflows/notify.yml index fd369f0..d4429fb 100644 --- a/.mokogitea/workflows/notify.yml +++ b/.mokogitea/workflows/notify.yml @@ -4,8 +4,8 @@ # # FILE INFORMATION # DEFGROUP: Gitea.Workflow -# INGROUP: moko-platform.Notifications -# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +# INGROUP: MokoCLI.Notifications +# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli # PATH: /.mokogitea/workflows/notify.yml # VERSION: 09.23.00 # BRIEF: Push notifications via ntfy on release success or workflow failure diff --git a/.mokogitea/workflows/pr-check.yml b/.mokogitea/workflows/pr-check.yml index 828f821..114aac7 100644 --- a/.mokogitea/workflows/pr-check.yml +++ b/.mokogitea/workflows/pr-check.yml @@ -4,8 +4,8 @@ # # FILE INFORMATION # DEFGROUP: Gitea.Workflow -# INGROUP: moko-platform.CI -# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/moko-platform +# INGROUP: MokoCLI.CI +# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli # PATH: /templates/workflows/universal/pr-check.yml.template # VERSION: 09.23.00 # BRIEF: PR gate — branch policy + code validation before merge diff --git a/.mokogitea/workflows/pre-release.yml b/.mokogitea/workflows/pre-release.yml index 9615a4e..6e6cfe4 100644 --- a/.mokogitea/workflows/pre-release.yml +++ b/.mokogitea/workflows/pre-release.yml @@ -1,243 +1,255 @@ -# Copyright (C) 2026 Moko Consulting -# -# SPDX-License-Identifier: GPL-3.0-or-later -# -# FILE INFORMATION -# DEFGROUP: Gitea.Workflow -# INGROUP: moko-platform.Release -# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform -# PATH: /templates/workflows/universal/pre-release.yml.template -# VERSION: 05.01.00 -# BRIEF: Manual pre-release -- builds dev/alpha/beta/rc packages from any branch - -name: "Universal: Pre-Release" - -on: - pull_request: - types: [closed] - branches: - - dev - pull_request_target: - types: [synchronize, opened, reopened] - branches: - - main - workflow_dispatch: - inputs: - stability: - description: 'Pre-release channel' - required: true - type: choice - options: - - development - - alpha - - beta - - release-candidate - -permissions: - contents: write - -env: - GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }} - GITEA_ORG: ${{ vars.GITEA_ORG || github.repository_owner }} - GITEA_REPO: ${{ vars.GITEA_REPO || github.event.repository.name }} - -jobs: - build: - name: "Build Pre-Release (${{ inputs.stability || 'development' }})" - runs-on: release - if: >- - github.event_name == 'workflow_dispatch' || - (github.event_name == 'pull_request' && github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'dev') || - (github.event_name == 'pull_request_target' && github.event.pull_request.base.ref == 'main') - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - token: ${{ secrets.MOKOGITEA_TOKEN }} - ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || '' }} - - - name: Setup moko-platform tools - env: - MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }} - MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting - run: | - # Use pre-installed /opt/moko-platform if available (updated by cron every 6h) - if [ -f /opt/moko-platform/cli/version_bump.php ] && [ -f /opt/moko-platform/cli/manifest_element.php ] && [ -f /opt/moko-platform/vendor/autoload.php ]; then - echo Using pre-installed /opt/moko-platform - echo MOKO_CLI=/opt/moko-platform/cli >> $GITHUB_ENV - else - echo Falling back to fresh clone - if ! command -v composer > /dev/null 2>&1; then - sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer > /dev/null 2>&1 - fi - rm -rf /tmp/moko-platform-api - CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/moko-platform.git - git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/moko-platform-api - cd /tmp/moko-platform-api && composer install --no-dev --no-interaction --quiet - echo MOKO_CLI=/tmp/moko-platform-api/cli >> $GITHUB_ENV - fi - - - name: Detect platform - id: platform - run: | - php ${MOKO_CLI}/manifest_read.php --path . --github-output - - - name: Resolve metadata and bump version - id: meta - run: | - # Auto-detect stability: RC for PRs targeting main, else use input or default to development - if [ "${{ github.event_name }}" = "pull_request_target" ] && [ "${{ github.event.pull_request.base.ref }}" = "main" ]; then - STABILITY="release-candidate" - else - STABILITY="${{ inputs.stability || 'development' }}" - fi - - case "$STABILITY" in - development) SUFFIX="-dev"; TAG="development" ;; - alpha) SUFFIX="-alpha"; TAG="alpha" ;; - beta) SUFFIX="-beta"; TAG="beta" ;; - release-candidate) SUFFIX="-rc"; TAG="release-candidate" ;; - esac - - # Bump version via CLI: patch for dev/alpha/beta, minor for RC - case "$STABILITY" in - release-candidate) BUMP="minor" ;; - *) BUMP="patch" ;; - esac - - php ${MOKO_CLI}/version_bump.php --path . $([ "$BUMP" = "minor" ] && echo "--minor") 2>/dev/null || true - - # Set stability suffix and verify consistency - VERSION=$(php ${MOKO_CLI}/version_read.php --path . 2>/dev/null || echo "00.00.01") - VERSION=$(echo "$VERSION" | sed 's/-\(dev\|alpha\|beta\|rc\)$//') - - php ${MOKO_CLI}/version_set_platform.php \ - --path . --version "$VERSION" --branch "${{ github.ref_name }}" --stability "$STABILITY" 2>/dev/null || true - php ${MOKO_CLI}/version_check.php --path . --fix 2>/dev/null || true - - # Ensure licensing tags (updateservers, dlid) if enabled in manifest.xml - php ${MOKO_CLI}/manifest_licensing.php --path . --fix 2>/dev/null || true - - # Append suffix for output - if [ -n "$SUFFIX" ]; then - VERSION="${VERSION}${SUFFIX}" - fi - - # Commit version bump - git config --local user.email "gitea-actions[bot]@mokoconsulting.tech" - git config --local user.name "gitea-actions[bot]" - git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git" - git add -A - git diff --cached --quiet || { - git commit -m "chore(version): pre-release bump to ${VERSION} [skip ci]" - git push origin HEAD 2>&1 - } - - # Auto-detect element via manifest_element.php - php ${MOKO_CLI}/manifest_element.php \ - --path . --version "$VERSION" --stability "$STABILITY" \ - --repo "${GITEA_REPO}" --github-output - - # Read back element outputs - EXT_ELEMENT=$(grep '^ext_element=' "$GITHUB_OUTPUT" | tail -1 | cut -d= -f2) - ZIP_NAME=$(grep '^zip_name=' "$GITHUB_OUTPUT" | tail -1 | cut -d= -f2) - [ -z "$EXT_ELEMENT" ] && EXT_ELEMENT=$(echo "${GITEA_REPO}" | tr '[:upper:]' '[:lower:]' | tr -d ' -') - [ -z "$ZIP_NAME" ] && ZIP_NAME="${EXT_ELEMENT}-${VERSION}.zip" - - echo "version=${VERSION}" >> "$GITHUB_OUTPUT" - echo "stability=${STABILITY}" >> "$GITHUB_OUTPUT" - echo "suffix=${SUFFIX}" >> "$GITHUB_OUTPUT" - echo "tag=${TAG}" >> "$GITHUB_OUTPUT" - echo "zip_name=${ZIP_NAME}" >> "$GITHUB_OUTPUT" - echo "ext_element=${EXT_ELEMENT}" >> "$GITHUB_OUTPUT" - - echo "=== Pre-Release: ${EXT_ELEMENT} ${VERSION}${SUFFIX} ===" - - - name: Create release - id: release - run: | - TAG="${{ steps.meta.outputs.tag }}" - VERSION="${{ steps.meta.outputs.version }}" - API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" - php ${MOKO_CLI}/release_create.php \ - --path . --version "$VERSION" --tag "$TAG" \ - --token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \ - --repo "${GITEA_REPO}" --branch dev --prerelease - - - name: Update release notes from CHANGELOG.md - run: | - TAG="${{ steps.meta.outputs.tag }}" - VERSION="${{ steps.meta.outputs.version }}" - API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" - - # Extract [Unreleased] section from changelog (everything between [Unreleased] and next ## heading) - if [ -f "CHANGELOG.md" ]; then - NOTES=$(awk '/^## \[Unreleased\]/{found=1; next} /^## \[/{if(found) exit} found{print}' CHANGELOG.md) - [ -z "$NOTES" ] && NOTES="Release ${VERSION}" - else - NOTES="Release ${VERSION}" - fi - - # Update release body via API - RELEASE_ID=$(curl -sf -H "Authorization: token ${{ secrets.MOKOGITEA_TOKEN }}" \ - "${API_BASE}/releases/tags/${TAG}" | python3 -c "import json,sys; print(json.load(sys.stdin).get('id',''))" 2>/dev/null || true) - - if [ -n "$RELEASE_ID" ]; then - python3 -c " - import json, urllib.request - body = open('/dev/stdin').read() - payload = json.dumps({'body': body}).encode() - req = urllib.request.Request( - '${API_BASE}/releases/${RELEASE_ID}', - data=payload, method='PATCH', - headers={ - 'Authorization': 'token ${{ secrets.MOKOGITEA_TOKEN }}', - 'Content-Type': 'application/json' - }) - urllib.request.urlopen(req) - " <<< "$NOTES" - echo "Release notes updated from CHANGELOG.md" - fi - - - name: Build package and upload - id: package - run: | - VERSION="${{ steps.meta.outputs.version }}" - TAG="${{ steps.meta.outputs.tag }}" - API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" - php ${MOKO_CLI}/release_package.php \ - --path . --version "$VERSION" --tag "$TAG" \ - --token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \ - --repo "${GITEA_REPO}" --output /tmp || true - - # updates.xml is generated dynamically by MokoGitea license server - # No need to build, commit, or sync updates.xml from workflows - - - name: "Delete lesser pre-release channels (cascade)" - continue-on-error: true - run: | - API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" - TOKEN="${{ secrets.MOKOGITEA_TOKEN }}" - - php ${MOKO_CLI}/release_cascade.php \ - --stability "${{ steps.meta.outputs.stability }}" \ - --token "${TOKEN}" \ - --api-base "${API_BASE}" - - - name: Summary - if: always() - run: | - VERSION="${{ steps.meta.outputs.version }}" - STABILITY="${{ steps.meta.outputs.stability }}" - ZIP_NAME="${{ steps.meta.outputs.zip_name }}" - SHA256="${{ steps.package.outputs.sha256_zip }}" - echo "## Pre-Release Complete" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY - echo "|-------|-------|" >> $GITHUB_STEP_SUMMARY - echo "| Version | \`${VERSION}\` |" >> $GITHUB_STEP_SUMMARY - echo "| Channel | ${STABILITY} |" >> $GITHUB_STEP_SUMMARY - echo "| Package | \`${ZIP_NAME}\` |" >> $GITHUB_STEP_SUMMARY - echo "| SHA-256 | \`${SHA256:-n/a}\` |" >> $GITHUB_STEP_SUMMARY +# Copyright (C) 2026 Moko Consulting +# +# SPDX-License-Identifier: GPL-3.0-or-later +# +# FILE INFORMATION +# DEFGROUP: Gitea.Workflow +# INGROUP: MokoCLI.Release +# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli +# PATH: /templates/workflows/universal/pre-release.yml.template +# VERSION: 05.01.00 +# BRIEF: Auto pre-release on push to dev/alpha/beta/rc branches + +name: "Universal: Pre-Release" + +on: + push: + branches: + - dev + - 'fix/**' + - 'patch/**' + - 'hotfix/**' + - 'bugfix/**' + - 'chore/**' + - alpha + - beta + - rc + workflow_dispatch: + inputs: + stability: + description: 'Pre-release channel' + required: true + type: choice + options: + - development + - alpha + - beta + - release-candidate + +permissions: + contents: write + +env: + GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }} + GITEA_ORG: ${{ vars.GITEA_ORG || github.repository_owner }} + GITEA_REPO: ${{ vars.GITEA_REPO || github.event.repository.name }} + +jobs: + build: + name: "Build Pre-Release (${{ inputs.stability || github.ref_name }})" + runs-on: release + if: >- + github.event_name == 'workflow_dispatch' || + github.event_name == 'push' + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.MOKOGITEA_TOKEN }} + ref: ${{ github.ref_name }} + + - name: Setup MokoCLI tools + env: + MOKO_CLONE_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }} + MOKO_CLONE_HOST: git.mokoconsulting.tech/MokoConsulting + run: | + # Check both new (mokocli) and legacy (mokoplatform) install paths + if [ -f /opt/mokocli/cli/version_bump.php ] && [ -f /opt/mokocli/cli/manifest_element.php ] && [ -f /opt/mokocli/vendor/autoload.php ]; then + echo "Using pre-installed /opt/mokocli" + echo MOKO_CLI=/opt/mokocli/cli >> $GITHUB_ENV + elif [ -f /opt/mokoplatform/cli/version_bump.php ] && [ -f /opt/mokoplatform/vendor/autoload.php ]; then + echo "Using pre-installed /opt/mokoplatform (legacy path)" + echo MOKO_CLI=/opt/mokoplatform/cli >> $GITHUB_ENV + else + echo "Falling back to fresh clone" + if ! command -v composer > /dev/null 2>&1; then + sudo apt-get update -qq && sudo apt-get install -y -qq php-cli php-mbstring php-xml php-zip php-curl composer > /dev/null 2>&1 + fi + rm -rf /tmp/mokocli + CLONE_URL=https://x-access-token:${MOKO_CLONE_TOKEN}@${MOKO_CLONE_HOST}/mokocli.git + git clone --depth 1 --branch main --quiet $CLONE_URL /tmp/mokocli + cd /tmp/mokocli && composer install --no-dev --no-interaction --quiet + echo MOKO_CLI=/tmp/mokocli/cli >> $GITHUB_ENV + fi + + - name: Detect platform + id: platform + run: | + # Auto-detect and update platform if not set in manifest + php ${MOKO_CLI}/platform_detect.php --path . --github-output 2>/dev/null || true + php ${MOKO_CLI}/manifest_read.php --path . --github-output + + - name: Resolve metadata and bump version + id: meta + run: | + # Auto-detect stability from branch name on push, or use input on dispatch + if [ "${{ github.event_name }}" = "push" ]; then + case "${{ github.ref_name }}" in + rc) STABILITY="release-candidate" ;; + alpha) STABILITY="alpha" ;; + beta) STABILITY="beta" ;; + *) STABILITY="development" ;; + esac + else + STABILITY="${{ inputs.stability || 'development' }}" + fi + + case "$STABILITY" in + development) SUFFIX="-dev"; TAG="development" ;; + alpha) SUFFIX="-alpha"; TAG="alpha" ;; + beta) SUFFIX="-beta"; TAG="beta" ;; + release-candidate) SUFFIX="-rc"; TAG="release-candidate" ;; + esac + + # Bump version via CLI: patch for dev/alpha/beta, minor for RC + case "$STABILITY" in + release-candidate) BUMP="minor" ;; + *) BUMP="patch" ;; + esac + + php ${MOKO_CLI}/version_bump.php --path . $([ "$BUMP" = "minor" ] && echo "--minor") 2>/dev/null || true + + # Set stability suffix and verify consistency + VERSION=$(php ${MOKO_CLI}/version_read.php --path . 2>/dev/null || echo "00.00.01") + VERSION=$(echo "$VERSION" | sed 's/-\(dev\|alpha\|beta\|rc\)$//') + + php ${MOKO_CLI}/version_set_platform.php \ + --path . --version "$VERSION" --branch "${{ github.ref_name }}" --stability "$STABILITY" 2>/dev/null || true + php ${MOKO_CLI}/version_check.php --path . --fix 2>/dev/null || true + + # Ensure licensing tags (updateservers, dlid) if enabled in manifest.xml + php ${MOKO_CLI}/manifest_licensing.php --path . --fix 2>/dev/null || true + + # Append suffix for output + if [ -n "$SUFFIX" ]; then + VERSION="${VERSION}${SUFFIX}" + fi + + # Commit version bump + git config --local user.email "gitea-actions[bot]@mokoconsulting.tech" + git config --local user.name "gitea-actions[bot]" + git remote set-url origin "https://x-access-token:${{ secrets.MOKOGITEA_TOKEN }}@git.mokoconsulting.tech/${{ github.repository }}.git" + git add -A + git diff --cached --quiet || { + git commit -m "chore(version): pre-release bump to ${VERSION} [skip ci]" + git push origin HEAD 2>&1 + } + + # Auto-detect element via manifest_element.php + php ${MOKO_CLI}/manifest_element.php \ + --path . --version "$VERSION" --stability "$STABILITY" \ + --repo "${GITEA_REPO}" --github-output + + # Read back element outputs + EXT_ELEMENT=$(grep '^ext_element=' "$GITHUB_OUTPUT" | tail -1 | cut -d= -f2) + ZIP_NAME=$(grep '^zip_name=' "$GITHUB_OUTPUT" | tail -1 | cut -d= -f2) + [ -z "$EXT_ELEMENT" ] && EXT_ELEMENT=$(echo "${GITEA_REPO}" | tr '[:upper:]' '[:lower:]' | tr -d ' -') + [ -z "$ZIP_NAME" ] && ZIP_NAME="${EXT_ELEMENT}-${VERSION}.zip" + + echo "version=${VERSION}" >> "$GITHUB_OUTPUT" + echo "stability=${STABILITY}" >> "$GITHUB_OUTPUT" + echo "suffix=${SUFFIX}" >> "$GITHUB_OUTPUT" + echo "tag=${TAG}" >> "$GITHUB_OUTPUT" + echo "zip_name=${ZIP_NAME}" >> "$GITHUB_OUTPUT" + echo "ext_element=${EXT_ELEMENT}" >> "$GITHUB_OUTPUT" + + echo "=== Pre-Release: ${EXT_ELEMENT} ${VERSION}${SUFFIX} ===" + + - name: Create release + id: release + run: | + TAG="${{ steps.meta.outputs.tag }}" + VERSION="${{ steps.meta.outputs.version }}" + API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" + php ${MOKO_CLI}/release_create.php \ + --path . --version "$VERSION" --tag "$TAG" \ + --token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \ + --repo "${GITEA_REPO}" --branch "${{ github.ref_name }}" --prerelease + + - name: Update release notes from CHANGELOG.md + run: | + TAG="${{ steps.meta.outputs.tag }}" + VERSION="${{ steps.meta.outputs.version }}" + API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" + + # Extract [Unreleased] section from changelog (everything between [Unreleased] and next ## heading) + if [ -f "CHANGELOG.md" ]; then + NOTES=$(awk '/^## \[Unreleased\]/{found=1; next} /^## \[/{if(found) exit} found{print}' CHANGELOG.md) + [ -z "$NOTES" ] && NOTES="Release ${VERSION}" + else + NOTES="Release ${VERSION}" + fi + + # Update release body via API + RELEASE_ID=$(curl -sf -H "Authorization: token ${{ secrets.MOKOGITEA_TOKEN }}" \ + "${API_BASE}/releases/tags/${TAG}" | python3 -c "import json,sys; print(json.load(sys.stdin).get('id',''))" 2>/dev/null || true) + + if [ -n "$RELEASE_ID" ]; then + python3 -c " + import json, urllib.request + body = open('/dev/stdin').read() + payload = json.dumps({'body': body}).encode() + req = urllib.request.Request( + '${API_BASE}/releases/${RELEASE_ID}', + data=payload, method='PATCH', + headers={ + 'Authorization': 'token ${{ secrets.MOKOGITEA_TOKEN }}', + 'Content-Type': 'application/json' + }) + urllib.request.urlopen(req) + " <<< "$NOTES" + echo "Release notes updated from CHANGELOG.md" + fi + + - name: Build package and upload + id: package + run: | + VERSION="${{ steps.meta.outputs.version }}" + TAG="${{ steps.meta.outputs.tag }}" + API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" + php ${MOKO_CLI}/release_package.php \ + --path . --version "$VERSION" --tag "$TAG" \ + --token "${{ secrets.MOKOGITEA_TOKEN }}" --api-base "$API_BASE" \ + --repo "${GITEA_REPO}" --output /tmp || true + + # updates.xml is generated dynamically by MokoGitea license server + # No need to build, commit, or sync updates.xml from workflows + + - name: "Delete lesser pre-release channels (cascade)" + continue-on-error: true + run: | + API_BASE="${GITEA_URL}/api/v1/repos/${GITEA_ORG}/${GITEA_REPO}" + TOKEN="${{ secrets.MOKOGITEA_TOKEN }}" + + php ${MOKO_CLI}/release_cascade.php \ + --stability "${{ steps.meta.outputs.stability }}" \ + --token "${TOKEN}" \ + --api-base "${API_BASE}" + + - name: Summary + if: always() + run: | + VERSION="${{ steps.meta.outputs.version }}" + STABILITY="${{ steps.meta.outputs.stability }}" + ZIP_NAME="${{ steps.meta.outputs.zip_name }}" + SHA256="${{ steps.package.outputs.sha256_zip }}" + echo "## Pre-Release Complete" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY + echo "|-------|-------|" >> $GITHUB_STEP_SUMMARY + echo "| Version | \`${VERSION}\` |" >> $GITHUB_STEP_SUMMARY + echo "| Channel | ${STABILITY} |" >> $GITHUB_STEP_SUMMARY + echo "| Package | \`${ZIP_NAME}\` |" >> $GITHUB_STEP_SUMMARY + echo "| SHA-256 | \`${SHA256:-n/a}\` |" >> $GITHUB_STEP_SUMMARY diff --git a/.mokogitea/workflows/repo-health.yml b/.mokogitea/workflows/repo-health.yml index 6b8dfd9..b18f2d0 100644 --- a/.mokogitea/workflows/repo-health.yml +++ b/.mokogitea/workflows/repo-health.yml @@ -1,713 +1,713 @@ -# ============================================================================ -# Copyright (C) 2025 Moko Consulting -# -# This file is part of a Moko Consulting project. -# -# SPDX-License-Identifier: GPL-3.0-or-later -# -# FILE INFORMATION -# DEFGROUP: Gitea.Workflow -# INGROUP: moko-platform.Validation -# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/moko-platform -# PATH: /templates/workflows/joomla/repo_health.yml.template -# VERSION: 09.23.00 -# BRIEF: Enforces repository guardrails by validating scripts governance, tooling availability, and core repository health artifacts. -# ============================================================================ - -name: "Generic: Repo Health" - -defaults: - run: - shell: bash - -on: - workflow_dispatch: - inputs: - profile: - description: 'Validation profile: all, scripts, or repo' - required: true - default: all - type: choice - options: - - all - - scripts - - repo - pull_request: - push: - -permissions: - contents: read - -env: - # Scripts governance policy - SCRIPTS_REQUIRED_DIRS: - SCRIPTS_ALLOWED_DIRS: scripts,scripts/fix,scripts/lib,scripts/release,scripts/run,scripts/validate - - # Repo health policy - REPO_REQUIRED_ARTIFACTS: README.md,LICENSE,CHANGELOG.md,CONTRIBUTING.md,CODE_OF_CONDUCT.md,.mokogitea/workflows/ - REPO_OPTIONAL_FILES: SECURITY.md,GOVERNANCE.md,.editorconfig,.gitattributes,.gitignore,README.md,docs/ - REPO_DISALLOWED_DIRS: - REPO_DISALLOWED_FILES: TODO.md,todo.md - - # Extended checks toggles - EXTENDED_CHECKS: "true" - - # File / directory variables - DOCS_INDEX: docs/docs-index.md - SCRIPT_DIR: scripts - WORKFLOWS_DIR: .mokogitea/workflows - SHELLCHECK_PATTERN: '*.sh' - SPDX_FILE_GLOBS: '*.sh,*.php,*.js,*.ts,*.css,*.xml,*.yml,*.yaml' - FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true - -jobs: - access_check: - name: Access control - runs-on: ubuntu-latest - timeout-minutes: 10 - permissions: - contents: read - - outputs: - allowed: ${{ steps.perm.outputs.allowed }} - permission: ${{ steps.perm.outputs.permission }} - - steps: - - name: Check actor permission (admin only) - id: perm - env: - TOKEN: ${{ secrets.MOKOGITEA_TOKEN || secrets.MOKOGITEA_TOKEN || github.token }} - REPO: ${{ github.repository }} - ACTOR: ${{ github.actor }} - run: | - set -euo pipefail - ALLOWED=false - PERMISSION=unknown - METHOD="" - - # Hardcoded authorized users — always allowed - case "$ACTOR" in - jmiller|gitea-actions[bot]) - ALLOWED=true - PERMISSION=admin - METHOD="hardcoded allowlist" - ;; - *) - # Detect platform and check permissions via API - API_BASE="${GITHUB_API_URL:-${GITEA_API_URL:-https://api.github.com}}" - RESP=$(curl -sf -H "Authorization: token ${TOKEN}" \ - "${API_BASE}/repos/${REPO}/collaborators/${ACTOR}/permission" 2>/dev/null || echo '{}') - PERMISSION=$(echo "$RESP" | grep -oP '"permission"\s*:\s*"\K[^"]+' || echo "unknown") - if [ "$PERMISSION" = "admin" ] || [ "$PERMISSION" = "maintain" ] || [ "$PERMISSION" = "owner" ]; then - ALLOWED=true - fi - METHOD="collaborator API" - ;; - esac - - echo "permission=${PERMISSION}" >> "$GITHUB_OUTPUT" - echo "allowed=${ALLOWED}" >> "$GITHUB_OUTPUT" - - { - echo "## Access Authorization" - echo "" - echo "| Field | Value |" - echo "|-------|-------|" - echo "| **Actor** | \`${ACTOR}\` |" - echo "| **Repository** | \`${REPO}\` |" - echo "| **Permission** | \`${PERMISSION}\` |" - echo "| **Method** | ${METHOD} |" - echo "| **Authorized** | ${ALLOWED} |" - echo "" - if [ "$ALLOWED" = "true" ]; then - echo "${ACTOR} authorized (${METHOD})" - else - echo "${ACTOR} is NOT authorized. Requires admin or maintain role." - fi - } >> "${GITHUB_STEP_SUMMARY}" - - - name: Deny execution when not permitted - if: ${{ steps.perm.outputs.allowed != 'true' }} - run: | - set -euo pipefail - printf '%s\n' 'ERROR: Access denied. Admin permission required.' >> "${GITHUB_STEP_SUMMARY}" - exit 1 - - scripts_governance: - name: Scripts governance - needs: access_check - if: ${{ needs.access_check.outputs.allowed == 'true' }} - runs-on: ubuntu-latest - timeout-minutes: 15 - permissions: - contents: read - - steps: - - name: Checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - with: - fetch-depth: 0 - - - name: Scripts folder checks - env: - PROFILE_RAW: ${{ github.event.inputs.profile }} - run: | - set -euo pipefail - - profile="${PROFILE_RAW:-all}" - case "${profile}" in - all|scripts|repo) ;; - *) - printf '%s\n' "ERROR: Unknown profile: ${profile}" >> "${GITHUB_STEP_SUMMARY}" - exit 1 - ;; - esac - - if [ "${profile}" = 'repo' ]; then - { - printf '%s\n' '### Scripts governance' - printf '%s\n' "Profile: ${profile}" - printf '%s\n' 'Status: SKIPPED' - printf '%s\n' 'Reason: profile excludes scripts governance' - printf '\n' - } >> "${GITHUB_STEP_SUMMARY}" - exit 0 - fi - - if [ ! -d "${SCRIPT_DIR}" ]; then - { - printf '%s\n' '### Scripts governance' - printf '%s\n' 'Status: OK (advisory)' - printf '%s\n' 'scripts/ directory not present. No scripts governance enforced.' - printf '\n' - } >> "${GITHUB_STEP_SUMMARY}" - exit 0 - fi - - if [ -n "${SCRIPTS_REQUIRED_DIRS:-}" ]; then IFS=',' read -r -a required_dirs <<< "${SCRIPTS_REQUIRED_DIRS}"; else required_dirs=(); fi - IFS=',' read -r -a allowed_dirs <<< "${SCRIPTS_ALLOWED_DIRS}" - - missing_dirs=() - unapproved_dirs=() - - for d in "${required_dirs[@]}"; do - req="${d%/}" - [ ! -d "${req}" ] && missing_dirs+=("${req}/") - done - - while IFS= read -r d; do - allowed=false - for a in "${allowed_dirs[@]}"; do - a_norm="${a%/}" - [ "${d%/}" = "${a_norm}" ] && allowed=true - done - [ "${allowed}" = false ] && unapproved_dirs+=("${d%/}/") - done < <(find "${SCRIPT_DIR}" -maxdepth 1 -mindepth 1 -type d 2>/dev/null | sed 's#^\./##') - - { - printf '%s\n' '### Scripts governance' - printf '%s\n' "Profile: ${profile}" - printf '%s\n' '| Area | Status | Notes |' - printf '%s\n' '|---|---|---|' - - if [ "${#missing_dirs[@]}" -gt 0 ]; then - printf '%s\n' '| Required directories | Warning | Missing required subfolders |' - else - printf '%s\n' '| Required directories | OK | All required subfolders present |' - fi - - if [ "${#unapproved_dirs[@]}" -gt 0 ]; then - printf '%s\n' '| Directory policy | Warning | Unapproved directories detected |' - else - printf '%s\n' '| Directory policy | OK | No unapproved directories |' - fi - - printf '%s\n' '| Enforcement mode | Advisory | scripts folder is optional |' - printf '\n' - - if [ "${#missing_dirs[@]}" -gt 0 ]; then - printf '%s\n' 'Missing required script directories:' - for m in "${missing_dirs[@]}"; do printf '%s\n' "- ${m}"; done - printf '\n' - else - printf '%s\n' 'Missing required script directories: none.' - printf '\n' - fi - - if [ "${#unapproved_dirs[@]}" -gt 0 ]; then - printf '%s\n' 'Unapproved script directories detected:' - for m in "${unapproved_dirs[@]}"; do printf '%s\n' "- ${m}"; done - printf '\n' - else - printf '%s\n' 'Unapproved script directories detected: none.' - printf '\n' - fi - - printf '%s\n' 'Scripts governance completed in advisory mode.' - printf '\n' - } >> "${GITHUB_STEP_SUMMARY}" - - repo_health: - name: Repository health - needs: access_check - if: ${{ needs.access_check.outputs.allowed == 'true' }} - runs-on: ubuntu-latest - timeout-minutes: 20 - permissions: - contents: read - - steps: - - name: Checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - with: - fetch-depth: 0 - - - name: Repository health checks - env: - PROFILE_RAW: ${{ github.event.inputs.profile }} - run: | - set -euo pipefail - - profile="${PROFILE_RAW:-all}" - case "${profile}" in - all|scripts|repo) ;; - *) - printf '%s\n' "ERROR: Unknown profile: ${profile}" >> "${GITHUB_STEP_SUMMARY}" - exit 1 - ;; - esac - - if [ "${profile}" = 'scripts' ]; then - { - printf '%s\n' '### Repository health' - printf '%s\n' "Profile: ${profile}" - printf '%s\n' 'Status: SKIPPED' - printf '%s\n' 'Reason: profile excludes repository health' - printf '\n' - } >> "${GITHUB_STEP_SUMMARY}" - exit 0 - fi - - IFS=',' read -r -a required_artifacts <<< "${REPO_REQUIRED_ARTIFACTS}" - IFS=',' read -r -a optional_files <<< "${REPO_OPTIONAL_FILES}" - if [ -n "${REPO_DISALLOWED_DIRS:-}" ]; then IFS=',' read -r -a disallowed_dirs <<< "${REPO_DISALLOWED_DIRS}"; else disallowed_dirs=(); fi - IFS=',' read -r -a disallowed_files <<< "${REPO_DISALLOWED_FILES:-}" - - missing_required=() - missing_optional=() - - # Source directory: source/, src/, or htdocs/ (any is valid for extension repos) - SOURCE_DIR="" - if [ -d "source" ]; then - SOURCE_DIR="source" - elif [ -d "src" ]; then - SOURCE_DIR="src" - elif [ -d "htdocs" ]; then - SOURCE_DIR="htdocs" - elif [ -d "deploy" ] || [ -d "cli" ] || [ -d "monitoring" ]; then - # Platform/tooling repos don't need source/ - SOURCE_DIR="" - else - missing_required+=("source/ or src/ or htdocs/ (source directory required)") - fi - - for item in "${required_artifacts[@]}"; do - if printf '%s' "${item}" | grep -q '/$'; then - d="${item%/}" - [ ! -d "${d}" ] && missing_required+=("${item}") - else - [ ! -f "${item}" ] && missing_required+=("${item}") - fi - done - - for f in "${optional_files[@]}"; do - if printf '%s' "${f}" | grep -q '/$'; then - d="${f%/}" - [ ! -d "${d}" ] && missing_optional+=("${f}") - else - [ ! -f "${f}" ] && missing_optional+=("${f}") - fi - done - - for d in "${disallowed_dirs[@]}"; do - d_norm="${d%/}" - [ -d "${d_norm}" ] && missing_required+=("${d_norm}/ (disallowed)") - done - - for f in "${disallowed_files[@]}"; do - [ -f "${f}" ] && missing_required+=("${f} (disallowed)") - done - - git fetch origin --prune - - dev_paths=() - dev_branches=() - - while IFS= read -r b; do - name="${b#origin/}" - if [ "${name}" = 'dev' ]; then - dev_branches+=("${name}") - else - dev_paths+=("${name}") - fi - done < <(git branch -r --list 'origin/dev*' | sed 's/^ *//') - - if [ "${#dev_paths[@]}" -eq 0 ] && [ "${#dev_branches[@]}" -eq 0 ]; then - missing_required+=("dev or dev/* branch") - fi - - content_warnings=() - - if [ -f 'CHANGELOG.md' ] && ! grep -Eq '^# Changelog' CHANGELOG.md; then - content_warnings+=("CHANGELOG.md missing '# Changelog' header") - fi - - if [ -f 'CHANGELOG.md' ] && grep -Eq '^[# ]*Unreleased' CHANGELOG.md; then - content_warnings+=("CHANGELOG.md contains Unreleased section (review release readiness)") - fi - - if [ -f 'LICENSE' ] && ! grep -qiE 'GNU GENERAL PUBLIC LICENSE|GPL' LICENSE; then - content_warnings+=("LICENSE does not look like a GPL text") - fi - - if [ -f 'README.md' ] && ! grep -qiE 'moko|Moko' README.md; then - content_warnings+=("README.md missing expected brand keyword") - fi - - export PROFILE_RAW="${profile}" - export MISSING_REQUIRED="$(printf '%s\n' "${missing_required[@]:-}")" - export MISSING_OPTIONAL="$(printf '%s\n' "${missing_optional[@]:-}")" - export CONTENT_WARNINGS="$(printf '%s\n' "${content_warnings[@]:-}")" - - report_json=$(printf '{"profile":"%s","missing_required":%d,"missing_optional":%d,"content_warnings":%d}' "$profile" "${#missing_required[@]}" "${#missing_optional[@]}" "${#content_warnings[@]}") - - { - printf '%s\n' '### Repository health' - printf '%s\n' "Profile: ${profile}" - printf '%s\n' '| Metric | Value |' - printf '%s\n' '|---|---|' - printf '%s\n' "| Missing required | ${#missing_required[@]} |" - printf '%s\n' "| Missing optional | ${#missing_optional[@]} |" - printf '%s\n' "| Content warnings | ${#content_warnings[@]} |" - printf '\n' - - printf '%s\n' '### Guardrails report (JSON)' - printf '%s\n' '```json' - printf '%s\n' "${report_json}" - printf '%s\n' '```' - printf '\n' - } >> "${GITHUB_STEP_SUMMARY}" - - if [ "${#missing_required[@]}" -gt 0 ]; then - { - printf '%s\n' '### Missing required repo artifacts' - for m in "${missing_required[@]}"; do printf '%s\n' "- ${m}"; done - printf '%s\n' 'ERROR: Guardrails failed. Missing required repository artifacts.' - printf '\n' - } >> "${GITHUB_STEP_SUMMARY}" - exit 1 - fi - - if [ "${#missing_optional[@]}" -gt 0 ]; then - { - printf '%s\n' '### Missing optional repo artifacts' - for m in "${missing_optional[@]}"; do printf '%s\n' "- ${m}"; done - printf '\n' - } >> "${GITHUB_STEP_SUMMARY}" - fi - - if [ "${#content_warnings[@]}" -gt 0 ]; then - { - printf '%s\n' '### Repo content warnings' - for m in "${content_warnings[@]}"; do printf '%s\n' "- ${m}"; done - printf '\n' - } >> "${GITHUB_STEP_SUMMARY}" - fi - - # -- Joomla-specific checks -- - joomla_findings=() - - MANIFEST="$(find . -maxdepth 2 -name '*.xml' -exec grep -l '/dev/null | head -1 || true)" - if [ -z "${MANIFEST}" ]; then - joomla_findings+=("Joomla XML manifest not found (no *.xml with tag)") - else - if ! grep -qP '' "${MANIFEST}"; then - joomla_findings+=("XML manifest: tag missing") - fi - if ! grep -qP 'type="(component|module|plugin|library|package|template|language)"' "${MANIFEST}"; then - joomla_findings+=("XML manifest: type attribute missing or invalid") - fi - if ! grep -qP '' "${MANIFEST}"; then - joomla_findings+=("XML manifest: tag missing") - fi - if ! grep -qP '' "${MANIFEST}"; then - joomla_findings+=("XML manifest: tag missing") - fi - if ! grep -qP ' missing (required for Joomla 5+)") - fi - fi - - INI_COUNT="$(find . -name '*.ini' -type f 2>/dev/null | wc -l)" - if [ "${INI_COUNT}" -eq 0 ]; then - joomla_findings+=("No .ini language files found") - fi - - if [ ! -f 'updates.xml' ]; then - joomla_findings+=("updates.xml missing in root (required for Joomla update server)") - fi - - if [ -n "${SOURCE_DIR}" ]; then - INDEX_DIRS=("${SOURCE_DIR}" "${SOURCE_DIR}/admin" "${SOURCE_DIR}/site") - for dir in "${INDEX_DIRS[@]}"; do - if [ -d "${dir}" ] && [ ! -f "${dir}/index.html" ]; then - joomla_findings+=("${dir}/index.html missing (directory listing protection)") - fi - done - fi - - if [ "${#joomla_findings[@]}" -gt 0 ]; then - { - printf '%s\n' '### Joomla extension checks' - printf '%s\n' '| Check | Status |' - printf '%s\n' '|---|---|' - for f in "${joomla_findings[@]}"; do - printf '%s\n' "| ${f} | Warning |" - done - printf '\n' - } >> "${GITHUB_STEP_SUMMARY}" - else - { - printf '%s\n' '### Joomla extension checks' - printf '%s\n' 'All Joomla-specific checks passed.' - printf '\n' - } >> "${GITHUB_STEP_SUMMARY}" - fi - - extended_enabled="${EXTENDED_CHECKS:-true}" - extended_findings=() - - if [ "${extended_enabled}" = 'true' ]; then - if [ -f '.github/CODEOWNERS' ] || [ -f 'CODEOWNERS' ] || [ -f 'docs/CODEOWNERS' ]; then - : - else - extended_findings+=("CODEOWNERS not found (.github/CODEOWNERS preferred)") - fi - - if ls "${WORKFLOWS_DIR}"/*.yml >/dev/null 2>&1 || ls "${WORKFLOWS_DIR}"/*.yaml >/dev/null 2>&1; then - bad_refs="$(grep -RIn --include='*.yml' --include='*.yaml' -E '^[[:space:]]*uses:[[:space:]]*[^#]+@(main|master)\b' "${WORKFLOWS_DIR}" 2>/dev/null || true)" - if [ -n "${bad_refs}" ]; then - extended_findings+=("Workflows reference actions @main/@master (pin versions): see log excerpt") - { - printf '%s\n' '### Workflow pinning advisory' - printf '%s\n' 'Found uses: entries pinned to main/master:' - printf '%s\n' '```' - printf '%s\n' "${bad_refs}" - printf '%s\n' '```' - printf '\n' - } >> "${GITHUB_STEP_SUMMARY}" - fi - fi - - if [ -f "${DOCS_INDEX}" ]; then - missing_links="" - while IFS= read -r docline; do - for link in $(echo "$docline" | grep -oE '\]\([^)]+\)' | sed 's/\](//' | sed 's/)$//' || true); do - case "$link" in http://*|https://*|"#"*|mailto:*) continue ;; esac - linkpath="${link%%#*}" - linkpath="${linkpath%%\?*}" - [ -z "$linkpath" ] && continue - if [ "${linkpath:0:1}" = "/" ]; then - testpath="${linkpath#/}" - else - testpath="$(dirname "${DOCS_INDEX}")/${linkpath}" - fi - [ ! -e "$testpath" ] && missing_links="${missing_links}${testpath} " - done - done < "${DOCS_INDEX}" - if [ -n "${missing_links}" ]; then - extended_findings+=("docs/docs-index.md contains broken relative links") - { - printf '%s\n' '### Docs index link integrity' - printf '%s\n' 'Broken relative links:' - for bl in ${missing_links}; do - printf '%s\n' "- ${bl}" - done - printf '\n' - } >> "${GITHUB_STEP_SUMMARY}" - fi - fi - - if [ -d "${SCRIPT_DIR}" ]; then - if ! command -v shellcheck >/dev/null 2>&1; then - sudo apt-get update -qq - sudo apt-get install -y shellcheck >/dev/null - fi - - sc_out='' - while IFS= read -r shf; do - [ -z "${shf}" ] && continue - out_one="$(shellcheck -S warning -x "${shf}" 2>/dev/null || true)" - if [ -n "${out_one}" ]; then - sc_out="${sc_out}${out_one}\n" - fi - done < <(find "${SCRIPT_DIR}" -type f -name "${SHELLCHECK_PATTERN}" 2>/dev/null | sort) - - if [ -n "${sc_out}" ]; then - extended_findings+=("ShellCheck warnings detected (advisory)") - sc_head="$(printf '%s' "${sc_out}" | head -n 200)" - { - printf '%s\n' '### ShellCheck (advisory)' - printf '%s\n' '```' - printf '%s\n' "${sc_head}" - printf '%s\n' '```' - printf '\n' - } >> "${GITHUB_STEP_SUMMARY}" - fi - fi - - spdx_missing=() - IFS=',' read -r -a spdx_globs <<< "${SPDX_FILE_GLOBS}" - spdx_args=() - for g in "${spdx_globs[@]}"; do spdx_args+=("${g}"); done - - while IFS= read -r f; do - [ -z "${f}" ] && continue - if ! head -n 40 "${f}" | grep -q 'SPDX-License-Identifier:'; then - spdx_missing+=("${f}") - fi - done < <(git ls-files "${spdx_args[@]}" 2>/dev/null || true) - - if [ "${#spdx_missing[@]}" -gt 0 ]; then - extended_findings+=("SPDX header missing in some tracked files (advisory)") - { - printf '%s\n' '### SPDX header advisory' - printf '%s\n' 'Files missing SPDX-License-Identifier (first 40 lines scan):' - for f in "${spdx_missing[@]}"; do printf '%s\n' "- ${f}"; done - printf '\n' - } >> "${GITHUB_STEP_SUMMARY}" - fi - - stale_cutoff_days=180 - stale_branches="$(git for-each-ref --format='%(refname:short) %(committerdate:unix)' refs/remotes/origin 2>/dev/null | awk -v now="$(date +%s)" -v days="${stale_cutoff_days}" '{if (now-$2 > days*86400) print $1}' | head -50)" - if [ -n "${stale_branches}" ]; then - extended_findings+=("Stale remote branches detected (advisory)") - { - printf '%s\n' '### Git hygiene advisory' - printf '%s\n' "Branches with last commit older than ${stale_cutoff_days} days (sample up to 50):" - while IFS= read -r b; do [ -n "${b}" ] && printf '%s\n' "- ${b}"; done <<< "${stale_branches}" - printf '\n' - } >> "${GITHUB_STEP_SUMMARY}" - fi - fi - - { - printf '%s\n' '### Guardrails coverage matrix' - printf '%s\n' '| Domain | Status | Notes |' - printf '%s\n' '|---|---|---|' - printf '%s\n' '| Access control | OK | Admin-only execution gate |' - printf '%s\n' '| Release policy | N/A | Releases handled by MokoGitea |' - printf '%s\n' '| Scripts governance | OK | Directory policy and advisory reporting |' - printf '%s\n' '| Repo required artifacts | OK | Required, optional, disallowed enforcement |' - printf '%s\n' '| Repo content heuristics | OK | Brand, license, changelog structure |' - if [ "${extended_enabled}" = 'true' ]; then - if [ "${#extended_findings[@]}" -gt 0 ]; then - printf '%s\n' '| Extended checks | Warning | See extended findings below |' - else - printf '%s\n' '| Extended checks | OK | No findings |' - fi - else - printf '%s\n' '| Extended checks | SKIPPED | EXTENDED_CHECKS disabled |' - fi - printf '\n' - } >> "${GITHUB_STEP_SUMMARY}" - - if [ "${extended_enabled}" = 'true' ] && [ "${#extended_findings[@]}" -gt 0 ]; then - { - printf '%s\n' '### Extended findings (advisory)' - for f in "${extended_findings[@]}"; do printf '%s\n' "- ${f}"; done - printf '\n' - } >> "${GITHUB_STEP_SUMMARY}" - fi - - printf '%s\n' 'Repository health guardrails passed.' >> "${GITHUB_STEP_SUMMARY}" - - - site-health: - name: Site Health - runs-on: ubuntu-latest - if: github.event_name == 'workflow_dispatch' - steps: - - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.3' - - - name: Uptime check - if: env.URLS != '' - run: | - echo "$URLS" > /tmp/urls.txt - php monitoring/uptime-probe.php --urls /tmp/urls.txt --timeout 15 || echo "::warning::Some sites are down" - rm -f /tmp/urls.txt - env: - URLS: ${{ vars.MONITORED_URLS }} - - - name: SSL certificate check - if: env.DOMAINS != '' - run: | - echo "$DOMAINS" > /tmp/domains.txt - php monitoring/ssl-check.php --domains /tmp/domains.txt --warn-days 30 || echo "::warning::SSL certificates expiring soon" - rm -f /tmp/domains.txt - env: - DOMAINS: ${{ vars.MONITORED_DOMAINS }} - - - name: Summary - if: always() - run: | - echo "### Site Health" >> $GITHUB_STEP_SUMMARY - echo "Uptime and SSL checks completed." >> $GITHUB_STEP_SUMMARY - - # ═══════════════════════════════════════════════════════════════════════ - # Issue Reporter — file issues for failed gates - # ═══════════════════════════════════════════════════════════════════════ - report-issues: - name: "Report Issues" - runs-on: ubuntu-latest - needs: [access_check, scripts_governance, repo_health] - if: >- - always() && - (needs.scripts_governance.result == 'failure' || - needs.repo_health.result == 'failure') - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - sparse-checkout: automation/ci-issue-reporter.sh - sparse-checkout-cone-mode: false - - - name: "File issues for failed gates" - env: - GITEA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }} - GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }} - run: | - chmod +x automation/ci-issue-reporter.sh - REPORTER="./automation/ci-issue-reporter.sh" - WF="Repo Health" - - report_gate() { - local gate="$1" result="$2" details="$3" - if [ "$result" = "failure" ]; then - "$REPORTER" --gate "$gate" --details "$details" --workflow "$WF" --severity error - fi - } - - report_gate "Scripts Governance" \ - "${{ needs.scripts_governance.result }}" \ - "Scripts directory policy violations detected. Review required and allowed directories." - - report_gate "Repository Health" \ - "${{ needs.repo_health.result }}" \ - "Repository health checks failed — missing required artifacts, disallowed files, or content warnings. Check the CI run summary." +# ============================================================================ +# Copyright (C) 2025 Moko Consulting +# +# This file is part of a Moko Consulting project. +# +# SPDX-License-Identifier: GPL-3.0-or-later +# +# FILE INFORMATION +# DEFGROUP: Gitea.Workflow +# INGROUP: MokoCLI.Validation +# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli +# PATH: /templates/workflows/joomla/repo_health.yml.template +# VERSION: 09.23.00 +# BRIEF: Enforces repository guardrails by validating scripts governance, tooling availability, and core repository health artifacts. +# ============================================================================ + +name: "Generic: Repo Health" + +defaults: + run: + shell: bash + +on: + workflow_dispatch: + inputs: + profile: + description: 'Validation profile: all, scripts, or repo' + required: true + default: all + type: choice + options: + - all + - scripts + - repo + pull_request: + push: + +permissions: + contents: read + +env: + # Scripts governance policy + SCRIPTS_REQUIRED_DIRS: + SCRIPTS_ALLOWED_DIRS: scripts,scripts/fix,scripts/lib,scripts/release,scripts/run,scripts/validate + + # Repo health policy + REPO_REQUIRED_ARTIFACTS: README.md,LICENSE,CHANGELOG.md,CONTRIBUTING.md,CODE_OF_CONDUCT.md,.mokogitea/workflows/ + REPO_OPTIONAL_FILES: SECURITY.md,GOVERNANCE.md,.editorconfig,.gitattributes,.gitignore,README.md,docs/ + REPO_DISALLOWED_DIRS: + REPO_DISALLOWED_FILES: TODO.md,todo.md + + # Extended checks toggles + EXTENDED_CHECKS: "true" + + # File / directory variables + DOCS_INDEX: docs/docs-index.md + SCRIPT_DIR: scripts + WORKFLOWS_DIR: .mokogitea/workflows + SHELLCHECK_PATTERN: '*.sh' + SPDX_FILE_GLOBS: '*.sh,*.php,*.js,*.ts,*.css,*.xml,*.yml,*.yaml' + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + +jobs: + access_check: + name: Access control + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: read + + outputs: + allowed: ${{ steps.perm.outputs.allowed }} + permission: ${{ steps.perm.outputs.permission }} + + steps: + - name: Check actor permission (admin only) + id: perm + env: + TOKEN: ${{ secrets.MOKOGITEA_TOKEN || secrets.MOKOGITEA_TOKEN || github.token }} + REPO: ${{ github.repository }} + ACTOR: ${{ github.actor }} + run: | + set -euo pipefail + ALLOWED=false + PERMISSION=unknown + METHOD="" + + # Hardcoded authorized users — always allowed + case "$ACTOR" in + jmiller|gitea-actions[bot]) + ALLOWED=true + PERMISSION=admin + METHOD="hardcoded allowlist" + ;; + *) + # Detect platform and check permissions via API + API_BASE="${GITHUB_API_URL:-${GITEA_API_URL:-https://api.github.com}}" + RESP=$(curl -sf -H "Authorization: token ${TOKEN}" \ + "${API_BASE}/repos/${REPO}/collaborators/${ACTOR}/permission" 2>/dev/null || echo '{}') + PERMISSION=$(echo "$RESP" | grep -oP '"permission"\s*:\s*"\K[^"]+' || echo "unknown") + if [ "$PERMISSION" = "admin" ] || [ "$PERMISSION" = "maintain" ] || [ "$PERMISSION" = "owner" ]; then + ALLOWED=true + fi + METHOD="collaborator API" + ;; + esac + + echo "permission=${PERMISSION}" >> "$GITHUB_OUTPUT" + echo "allowed=${ALLOWED}" >> "$GITHUB_OUTPUT" + + { + echo "## Access Authorization" + echo "" + echo "| Field | Value |" + echo "|-------|-------|" + echo "| **Actor** | \`${ACTOR}\` |" + echo "| **Repository** | \`${REPO}\` |" + echo "| **Permission** | \`${PERMISSION}\` |" + echo "| **Method** | ${METHOD} |" + echo "| **Authorized** | ${ALLOWED} |" + echo "" + if [ "$ALLOWED" = "true" ]; then + echo "${ACTOR} authorized (${METHOD})" + else + echo "${ACTOR} is NOT authorized. Requires admin or maintain role." + fi + } >> "${GITHUB_STEP_SUMMARY}" + + - name: Deny execution when not permitted + if: ${{ steps.perm.outputs.allowed != 'true' }} + run: | + set -euo pipefail + printf '%s\n' 'ERROR: Access denied. Admin permission required.' >> "${GITHUB_STEP_SUMMARY}" + exit 1 + + scripts_governance: + name: Scripts governance + needs: access_check + if: ${{ needs.access_check.outputs.allowed == 'true' }} + runs-on: ubuntu-latest + timeout-minutes: 15 + permissions: + contents: read + + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + fetch-depth: 0 + + - name: Scripts folder checks + env: + PROFILE_RAW: ${{ github.event.inputs.profile }} + run: | + set -euo pipefail + + profile="${PROFILE_RAW:-all}" + case "${profile}" in + all|scripts|repo) ;; + *) + printf '%s\n' "ERROR: Unknown profile: ${profile}" >> "${GITHUB_STEP_SUMMARY}" + exit 1 + ;; + esac + + if [ "${profile}" = 'repo' ]; then + { + printf '%s\n' '### Scripts governance' + printf '%s\n' "Profile: ${profile}" + printf '%s\n' 'Status: SKIPPED' + printf '%s\n' 'Reason: profile excludes scripts governance' + printf '\n' + } >> "${GITHUB_STEP_SUMMARY}" + exit 0 + fi + + if [ ! -d "${SCRIPT_DIR}" ]; then + { + printf '%s\n' '### Scripts governance' + printf '%s\n' 'Status: OK (advisory)' + printf '%s\n' 'scripts/ directory not present. No scripts governance enforced.' + printf '\n' + } >> "${GITHUB_STEP_SUMMARY}" + exit 0 + fi + + if [ -n "${SCRIPTS_REQUIRED_DIRS:-}" ]; then IFS=',' read -r -a required_dirs <<< "${SCRIPTS_REQUIRED_DIRS}"; else required_dirs=(); fi + IFS=',' read -r -a allowed_dirs <<< "${SCRIPTS_ALLOWED_DIRS}" + + missing_dirs=() + unapproved_dirs=() + + for d in "${required_dirs[@]}"; do + req="${d%/}" + [ ! -d "${req}" ] && missing_dirs+=("${req}/") + done + + while IFS= read -r d; do + allowed=false + for a in "${allowed_dirs[@]}"; do + a_norm="${a%/}" + [ "${d%/}" = "${a_norm}" ] && allowed=true + done + [ "${allowed}" = false ] && unapproved_dirs+=("${d%/}/") + done < <(find "${SCRIPT_DIR}" -maxdepth 1 -mindepth 1 -type d 2>/dev/null | sed 's#^\./##') + + { + printf '%s\n' '### Scripts governance' + printf '%s\n' "Profile: ${profile}" + printf '%s\n' '| Area | Status | Notes |' + printf '%s\n' '|---|---|---|' + + if [ "${#missing_dirs[@]}" -gt 0 ]; then + printf '%s\n' '| Required directories | Warning | Missing required subfolders |' + else + printf '%s\n' '| Required directories | OK | All required subfolders present |' + fi + + if [ "${#unapproved_dirs[@]}" -gt 0 ]; then + printf '%s\n' '| Directory policy | Warning | Unapproved directories detected |' + else + printf '%s\n' '| Directory policy | OK | No unapproved directories |' + fi + + printf '%s\n' '| Enforcement mode | Advisory | scripts folder is optional |' + printf '\n' + + if [ "${#missing_dirs[@]}" -gt 0 ]; then + printf '%s\n' 'Missing required script directories:' + for m in "${missing_dirs[@]}"; do printf '%s\n' "- ${m}"; done + printf '\n' + else + printf '%s\n' 'Missing required script directories: none.' + printf '\n' + fi + + if [ "${#unapproved_dirs[@]}" -gt 0 ]; then + printf '%s\n' 'Unapproved script directories detected:' + for m in "${unapproved_dirs[@]}"; do printf '%s\n' "- ${m}"; done + printf '\n' + else + printf '%s\n' 'Unapproved script directories detected: none.' + printf '\n' + fi + + printf '%s\n' 'Scripts governance completed in advisory mode.' + printf '\n' + } >> "${GITHUB_STEP_SUMMARY}" + + repo_health: + name: Repository health + needs: access_check + if: ${{ needs.access_check.outputs.allowed == 'true' }} + runs-on: ubuntu-latest + timeout-minutes: 20 + permissions: + contents: read + + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + fetch-depth: 0 + + - name: Repository health checks + env: + PROFILE_RAW: ${{ github.event.inputs.profile }} + run: | + set -euo pipefail + + profile="${PROFILE_RAW:-all}" + case "${profile}" in + all|scripts|repo) ;; + *) + printf '%s\n' "ERROR: Unknown profile: ${profile}" >> "${GITHUB_STEP_SUMMARY}" + exit 1 + ;; + esac + + if [ "${profile}" = 'scripts' ]; then + { + printf '%s\n' '### Repository health' + printf '%s\n' "Profile: ${profile}" + printf '%s\n' 'Status: SKIPPED' + printf '%s\n' 'Reason: profile excludes repository health' + printf '\n' + } >> "${GITHUB_STEP_SUMMARY}" + exit 0 + fi + + IFS=',' read -r -a required_artifacts <<< "${REPO_REQUIRED_ARTIFACTS}" + IFS=',' read -r -a optional_files <<< "${REPO_OPTIONAL_FILES}" + if [ -n "${REPO_DISALLOWED_DIRS:-}" ]; then IFS=',' read -r -a disallowed_dirs <<< "${REPO_DISALLOWED_DIRS}"; else disallowed_dirs=(); fi + IFS=',' read -r -a disallowed_files <<< "${REPO_DISALLOWED_FILES:-}" + + missing_required=() + missing_optional=() + + # Source directory: source/, src/, or htdocs/ (any is valid for extension repos) + SOURCE_DIR="" + if [ -d "source" ]; then + SOURCE_DIR="source" + elif [ -d "src" ]; then + SOURCE_DIR="src" + elif [ -d "htdocs" ]; then + SOURCE_DIR="htdocs" + elif [ -d "deploy" ] || [ -d "cli" ] || [ -d "monitoring" ]; then + # Platform/tooling repos don't need source/ + SOURCE_DIR="" + else + missing_required+=("source/ or src/ or htdocs/ (source directory required)") + fi + + for item in "${required_artifacts[@]}"; do + if printf '%s' "${item}" | grep -q '/$'; then + d="${item%/}" + [ ! -d "${d}" ] && missing_required+=("${item}") + else + [ ! -f "${item}" ] && missing_required+=("${item}") + fi + done + + for f in "${optional_files[@]}"; do + if printf '%s' "${f}" | grep -q '/$'; then + d="${f%/}" + [ ! -d "${d}" ] && missing_optional+=("${f}") + else + [ ! -f "${f}" ] && missing_optional+=("${f}") + fi + done + + for d in "${disallowed_dirs[@]}"; do + d_norm="${d%/}" + [ -d "${d_norm}" ] && missing_required+=("${d_norm}/ (disallowed)") + done + + for f in "${disallowed_files[@]}"; do + [ -f "${f}" ] && missing_required+=("${f} (disallowed)") + done + + git fetch origin --prune + + dev_paths=() + dev_branches=() + + while IFS= read -r b; do + name="${b#origin/}" + if [ "${name}" = 'dev' ]; then + dev_branches+=("${name}") + else + dev_paths+=("${name}") + fi + done < <(git branch -r --list 'origin/dev*' | sed 's/^ *//') + + if [ "${#dev_paths[@]}" -eq 0 ] && [ "${#dev_branches[@]}" -eq 0 ]; then + missing_required+=("dev or dev/* branch") + fi + + content_warnings=() + + if [ -f 'CHANGELOG.md' ] && ! grep -Eq '^# Changelog' CHANGELOG.md; then + content_warnings+=("CHANGELOG.md missing '# Changelog' header") + fi + + if [ -f 'CHANGELOG.md' ] && grep -Eq '^[# ]*Unreleased' CHANGELOG.md; then + content_warnings+=("CHANGELOG.md contains Unreleased section (review release readiness)") + fi + + if [ -f 'LICENSE' ] && ! grep -qiE 'GNU GENERAL PUBLIC LICENSE|GPL' LICENSE; then + content_warnings+=("LICENSE does not look like a GPL text") + fi + + if [ -f 'README.md' ] && ! grep -qiE 'moko|Moko' README.md; then + content_warnings+=("README.md missing expected brand keyword") + fi + + export PROFILE_RAW="${profile}" + export MISSING_REQUIRED="$(printf '%s\n' "${missing_required[@]:-}")" + export MISSING_OPTIONAL="$(printf '%s\n' "${missing_optional[@]:-}")" + export CONTENT_WARNINGS="$(printf '%s\n' "${content_warnings[@]:-}")" + + report_json=$(printf '{"profile":"%s","missing_required":%d,"missing_optional":%d,"content_warnings":%d}' "$profile" "${#missing_required[@]}" "${#missing_optional[@]}" "${#content_warnings[@]}") + + { + printf '%s\n' '### Repository health' + printf '%s\n' "Profile: ${profile}" + printf '%s\n' '| Metric | Value |' + printf '%s\n' '|---|---|' + printf '%s\n' "| Missing required | ${#missing_required[@]} |" + printf '%s\n' "| Missing optional | ${#missing_optional[@]} |" + printf '%s\n' "| Content warnings | ${#content_warnings[@]} |" + printf '\n' + + printf '%s\n' '### Guardrails report (JSON)' + printf '%s\n' '```json' + printf '%s\n' "${report_json}" + printf '%s\n' '```' + printf '\n' + } >> "${GITHUB_STEP_SUMMARY}" + + if [ "${#missing_required[@]}" -gt 0 ]; then + { + printf '%s\n' '### Missing required repo artifacts' + for m in "${missing_required[@]}"; do printf '%s\n' "- ${m}"; done + printf '%s\n' 'ERROR: Guardrails failed. Missing required repository artifacts.' + printf '\n' + } >> "${GITHUB_STEP_SUMMARY}" + exit 1 + fi + + if [ "${#missing_optional[@]}" -gt 0 ]; then + { + printf '%s\n' '### Missing optional repo artifacts' + for m in "${missing_optional[@]}"; do printf '%s\n' "- ${m}"; done + printf '\n' + } >> "${GITHUB_STEP_SUMMARY}" + fi + + if [ "${#content_warnings[@]}" -gt 0 ]; then + { + printf '%s\n' '### Repo content warnings' + for m in "${content_warnings[@]}"; do printf '%s\n' "- ${m}"; done + printf '\n' + } >> "${GITHUB_STEP_SUMMARY}" + fi + + # -- Joomla-specific checks -- + joomla_findings=() + + MANIFEST="$(find . -maxdepth 2 -name '*.xml' -exec grep -l '/dev/null | head -1 || true)" + if [ -z "${MANIFEST}" ]; then + joomla_findings+=("Joomla XML manifest not found (no *.xml with tag)") + else + if ! grep -qP '' "${MANIFEST}"; then + joomla_findings+=("XML manifest: tag missing") + fi + if ! grep -qP 'type="(component|module|plugin|library|package|template|language)"' "${MANIFEST}"; then + joomla_findings+=("XML manifest: type attribute missing or invalid") + fi + if ! grep -qP '' "${MANIFEST}"; then + joomla_findings+=("XML manifest: tag missing") + fi + if ! grep -qP '' "${MANIFEST}"; then + joomla_findings+=("XML manifest: tag missing") + fi + if ! grep -qP ' missing (required for Joomla 5+)") + fi + fi + + INI_COUNT="$(find . -name '*.ini' -type f 2>/dev/null | wc -l)" + if [ "${INI_COUNT}" -eq 0 ]; then + joomla_findings+=("No .ini language files found") + fi + + if [ ! -f 'updates.xml' ]; then + joomla_findings+=("updates.xml missing in root (required for Joomla update server)") + fi + + if [ -n "${SOURCE_DIR}" ]; then + INDEX_DIRS=("${SOURCE_DIR}" "${SOURCE_DIR}/admin" "${SOURCE_DIR}/site") + for dir in "${INDEX_DIRS[@]}"; do + if [ -d "${dir}" ] && [ ! -f "${dir}/index.html" ]; then + joomla_findings+=("${dir}/index.html missing (directory listing protection)") + fi + done + fi + + if [ "${#joomla_findings[@]}" -gt 0 ]; then + { + printf '%s\n' '### Joomla extension checks' + printf '%s\n' '| Check | Status |' + printf '%s\n' '|---|---|' + for f in "${joomla_findings[@]}"; do + printf '%s\n' "| ${f} | Warning |" + done + printf '\n' + } >> "${GITHUB_STEP_SUMMARY}" + else + { + printf '%s\n' '### Joomla extension checks' + printf '%s\n' 'All Joomla-specific checks passed.' + printf '\n' + } >> "${GITHUB_STEP_SUMMARY}" + fi + + extended_enabled="${EXTENDED_CHECKS:-true}" + extended_findings=() + + if [ "${extended_enabled}" = 'true' ]; then + if [ -f '.github/CODEOWNERS' ] || [ -f 'CODEOWNERS' ] || [ -f 'docs/CODEOWNERS' ]; then + : + else + extended_findings+=("CODEOWNERS not found (.github/CODEOWNERS preferred)") + fi + + if ls "${WORKFLOWS_DIR}"/*.yml >/dev/null 2>&1 || ls "${WORKFLOWS_DIR}"/*.yaml >/dev/null 2>&1; then + bad_refs="$(grep -RIn --include='*.yml' --include='*.yaml' -E '^[[:space:]]*uses:[[:space:]]*[^#]+@(main|master)\b' "${WORKFLOWS_DIR}" 2>/dev/null || true)" + if [ -n "${bad_refs}" ]; then + extended_findings+=("Workflows reference actions @main/@master (pin versions): see log excerpt") + { + printf '%s\n' '### Workflow pinning advisory' + printf '%s\n' 'Found uses: entries pinned to main/master:' + printf '%s\n' '```' + printf '%s\n' "${bad_refs}" + printf '%s\n' '```' + printf '\n' + } >> "${GITHUB_STEP_SUMMARY}" + fi + fi + + if [ -f "${DOCS_INDEX}" ]; then + missing_links="" + while IFS= read -r docline; do + for link in $(echo "$docline" | grep -oE '\]\([^)]+\)' | sed 's/\](//' | sed 's/)$//' || true); do + case "$link" in http://*|https://*|"#"*|mailto:*) continue ;; esac + linkpath="${link%%#*}" + linkpath="${linkpath%%\?*}" + [ -z "$linkpath" ] && continue + if [ "${linkpath:0:1}" = "/" ]; then + testpath="${linkpath#/}" + else + testpath="$(dirname "${DOCS_INDEX}")/${linkpath}" + fi + [ ! -e "$testpath" ] && missing_links="${missing_links}${testpath} " + done + done < "${DOCS_INDEX}" + if [ -n "${missing_links}" ]; then + extended_findings+=("docs/docs-index.md contains broken relative links") + { + printf '%s\n' '### Docs index link integrity' + printf '%s\n' 'Broken relative links:' + for bl in ${missing_links}; do + printf '%s\n' "- ${bl}" + done + printf '\n' + } >> "${GITHUB_STEP_SUMMARY}" + fi + fi + + if [ -d "${SCRIPT_DIR}" ]; then + if ! command -v shellcheck >/dev/null 2>&1; then + sudo apt-get update -qq + sudo apt-get install -y shellcheck >/dev/null + fi + + sc_out='' + while IFS= read -r shf; do + [ -z "${shf}" ] && continue + out_one="$(shellcheck -S warning -x "${shf}" 2>/dev/null || true)" + if [ -n "${out_one}" ]; then + sc_out="${sc_out}${out_one}\n" + fi + done < <(find "${SCRIPT_DIR}" -type f -name "${SHELLCHECK_PATTERN}" 2>/dev/null | sort) + + if [ -n "${sc_out}" ]; then + extended_findings+=("ShellCheck warnings detected (advisory)") + sc_head="$(printf '%s' "${sc_out}" | head -n 200)" + { + printf '%s\n' '### ShellCheck (advisory)' + printf '%s\n' '```' + printf '%s\n' "${sc_head}" + printf '%s\n' '```' + printf '\n' + } >> "${GITHUB_STEP_SUMMARY}" + fi + fi + + spdx_missing=() + IFS=',' read -r -a spdx_globs <<< "${SPDX_FILE_GLOBS}" + spdx_args=() + for g in "${spdx_globs[@]}"; do spdx_args+=("${g}"); done + + while IFS= read -r f; do + [ -z "${f}" ] && continue + if ! head -n 40 "${f}" | grep -q 'SPDX-License-Identifier:'; then + spdx_missing+=("${f}") + fi + done < <(git ls-files "${spdx_args[@]}" 2>/dev/null || true) + + if [ "${#spdx_missing[@]}" -gt 0 ]; then + extended_findings+=("SPDX header missing in some tracked files (advisory)") + { + printf '%s\n' '### SPDX header advisory' + printf '%s\n' 'Files missing SPDX-License-Identifier (first 40 lines scan):' + for f in "${spdx_missing[@]}"; do printf '%s\n' "- ${f}"; done + printf '\n' + } >> "${GITHUB_STEP_SUMMARY}" + fi + + stale_cutoff_days=180 + stale_branches="$(git for-each-ref --format='%(refname:short) %(committerdate:unix)' refs/remotes/origin 2>/dev/null | awk -v now="$(date +%s)" -v days="${stale_cutoff_days}" '{if (now-$2 > days*86400) print $1}' | head -50)" + if [ -n "${stale_branches}" ]; then + extended_findings+=("Stale remote branches detected (advisory)") + { + printf '%s\n' '### Git hygiene advisory' + printf '%s\n' "Branches with last commit older than ${stale_cutoff_days} days (sample up to 50):" + while IFS= read -r b; do [ -n "${b}" ] && printf '%s\n' "- ${b}"; done <<< "${stale_branches}" + printf '\n' + } >> "${GITHUB_STEP_SUMMARY}" + fi + fi + + { + printf '%s\n' '### Guardrails coverage matrix' + printf '%s\n' '| Domain | Status | Notes |' + printf '%s\n' '|---|---|---|' + printf '%s\n' '| Access control | OK | Admin-only execution gate |' + printf '%s\n' '| Release policy | N/A | Releases handled by MokoGitea |' + printf '%s\n' '| Scripts governance | OK | Directory policy and advisory reporting |' + printf '%s\n' '| Repo required artifacts | OK | Required, optional, disallowed enforcement |' + printf '%s\n' '| Repo content heuristics | OK | Brand, license, changelog structure |' + if [ "${extended_enabled}" = 'true' ]; then + if [ "${#extended_findings[@]}" -gt 0 ]; then + printf '%s\n' '| Extended checks | Warning | See extended findings below |' + else + printf '%s\n' '| Extended checks | OK | No findings |' + fi + else + printf '%s\n' '| Extended checks | SKIPPED | EXTENDED_CHECKS disabled |' + fi + printf '\n' + } >> "${GITHUB_STEP_SUMMARY}" + + if [ "${extended_enabled}" = 'true' ] && [ "${#extended_findings[@]}" -gt 0 ]; then + { + printf '%s\n' '### Extended findings (advisory)' + for f in "${extended_findings[@]}"; do printf '%s\n' "- ${f}"; done + printf '\n' + } >> "${GITHUB_STEP_SUMMARY}" + fi + + printf '%s\n' 'Repository health guardrails passed.' >> "${GITHUB_STEP_SUMMARY}" + + + site-health: + name: Site Health + runs-on: ubuntu-latest + if: github.event_name == 'workflow_dispatch' + steps: + - uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.3' + + - name: Uptime check + if: env.URLS != '' + run: | + echo "$URLS" > /tmp/urls.txt + php monitoring/uptime-probe.php --urls /tmp/urls.txt --timeout 15 || echo "::warning::Some sites are down" + rm -f /tmp/urls.txt + env: + URLS: ${{ vars.MONITORED_URLS }} + + - name: SSL certificate check + if: env.DOMAINS != '' + run: | + echo "$DOMAINS" > /tmp/domains.txt + php monitoring/ssl-check.php --domains /tmp/domains.txt --warn-days 30 || echo "::warning::SSL certificates expiring soon" + rm -f /tmp/domains.txt + env: + DOMAINS: ${{ vars.MONITORED_DOMAINS }} + + - name: Summary + if: always() + run: | + echo "### Site Health" >> $GITHUB_STEP_SUMMARY + echo "Uptime and SSL checks completed." >> $GITHUB_STEP_SUMMARY + + # ═══════════════════════════════════════════════════════════════════════ + # Issue Reporter — file issues for failed gates + # ═══════════════════════════════════════════════════════════════════════ + report-issues: + name: "Report Issues" + runs-on: ubuntu-latest + needs: [access_check, scripts_governance, repo_health] + if: >- + always() && + (needs.scripts_governance.result == 'failure' || + needs.repo_health.result == 'failure') + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + sparse-checkout: automation/ci-issue-reporter.sh + sparse-checkout-cone-mode: false + + - name: "File issues for failed gates" + env: + GITEA_TOKEN: ${{ secrets.MOKOGITEA_TOKEN }} + GITEA_URL: ${{ vars.GITEA_URL || 'https://git.mokoconsulting.tech' }} + run: | + chmod +x automation/ci-issue-reporter.sh + REPORTER="./automation/ci-issue-reporter.sh" + WF="Repo Health" + + report_gate() { + local gate="$1" result="$2" details="$3" + if [ "$result" = "failure" ]; then + "$REPORTER" --gate "$gate" --details "$details" --workflow "$WF" --severity error + fi + } + + report_gate "Scripts Governance" \ + "${{ needs.scripts_governance.result }}" \ + "Scripts directory policy violations detected. Review required and allowed directories." + + report_gate "Repository Health" \ + "${{ needs.repo_health.result }}" \ + "Repository health checks failed — missing required artifacts, disallowed files, or content warnings. Check the CI run summary." diff --git a/.mokogitea/workflows/security-audit.yml b/.mokogitea/workflows/security-audit.yml index 2a2c8b4..ac92d77 100644 --- a/.mokogitea/workflows/security-audit.yml +++ b/.mokogitea/workflows/security-audit.yml @@ -4,8 +4,8 @@ # # FILE INFORMATION # DEFGROUP: Gitea.Workflow -# INGROUP: moko-platform.Security -# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +# INGROUP: MokoCLI.Security +# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli # PATH: /.mokogitea/workflows/security-audit.yml # VERSION: 09.23.00 # BRIEF: Dependency vulnerability scanning for composer and npm packages diff --git a/.script-registry.json b/.script-registry.json index 2281cfb..7dad2a8 100644 --- a/.script-registry.json +++ b/.script-registry.json @@ -1,7 +1,7 @@ { "metadata": { "generated_at": "2026-03-10T19:51:42.238134Z", - "repository": "MokoConsulting/moko-platform", + "repository": "MokoConsulting/mokocli", "version": "1.0.0" }, "scripts": [ diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e52eb1..28b5006 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION DEFGROUP: MokoStandards.Root INGROUP: MokoStandards -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /CHANGELOG.md BRIEF: Release changelog --> diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bf60cc5..c0b4858 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,161 +1,161 @@ -# Contributing to Moko Consulting Projects - -Thank you for your interest in contributing. All Moko Consulting repositories follow this universal workflow and version policy. - -## Branching Workflow - -``` -feature/* ──PR──> dev ──draft PR──> (renamed to rc) ──merge──> main -``` - -### Step by step - -1. **Create a feature branch** from `dev`: - ```bash - git checkout dev && git pull - git checkout -b feature/my-change - ``` - -2. **Work and commit** on your feature branch. Push to origin. - -3. **Open a PR**: `feature/my-change` → `dev`. After review and checks, merge it. - -4. **When ready for release**, open a **draft PR**: `dev` → `main`. - - This automatically renames the source branch to `rc` (release candidate) - - An RC pre-release is built and uploaded - -5. **Alpha and beta branches** are created by manually renaming the branch before the RC stage: - - Rename `dev` to `alpha` for early testing → alpha pre-release is built - - Rename `alpha` to `beta` for feature-complete testing → beta pre-release is built - - When the draft PR is created, the branch is renamed to `rc` - -6. **Once PR checks pass** on the `rc` branch, mark the PR as ready and merge to `main`. - -7. **Merging to main** triggers the stable release pipeline: - - Minor version bump (e.g., `02.09.xx` → `02.10.00`) - - Stability suffix stripped (clean version) - - Gitea release created with ZIP/tar.gz packages - - `updates.xml` updated (Joomla extensions) - - `dev` branch recreated from `main` - -### Branch summary - -| Branch | Purpose | Created by | -|--------|---------|-----------| -| `feature/*` | New features and fixes | Developer | -| `dev` | Integration branch | Auto-recreated after release | -| `alpha` | Alpha pre-release testing | Manual rename from `dev` | -| `beta` | Beta pre-release testing | Manual rename from `alpha` | -| `rc` | Release candidate | Auto-renamed on draft PR to main | -| `main` | Stable releases | Protected, merge only | -| `version/XX.YY.ZZ` | Archived release snapshots | Auto-created by CI | - -### Protected branches - -| Branch | Direct push | Merge via | -|--------|------------|-----------| -| `main` | Blocked (CI bot whitelisted) | PR merge only | -| `dev` | Blocked (CI bot whitelisted) | PR merge from feature/* | -| `rc` | Blocked (CI bot whitelisted) | Auto-created on draft PR | -| `alpha` | Blocked (CI bot whitelisted) | Manual rename | -| `beta` | Blocked (CI bot whitelisted) | Manual rename | -| `feature/*` | Open | N/A (source branch) | - -## Version Policy - -### Format - -All versions use `XX.YY.ZZ` — three two-digit segments, zero-padded: - -- **XX** — Major version (breaking changes) -- **YY** — Minor version (new features, bumped on release to main) -- **ZZ** — Patch version (auto-incremented on every push to dev/feature branches) - -Rollover: patch `99` → `00` increments minor; minor `99` → `00` increments major. - -### Stability suffixes - -Each branch appends a suffix to indicate stability: - -| Branch | Suffix | Example | -|--------|--------|---------| -| `main` | (none) | `02.09.00` | -| `dev` | `-dev` | `02.09.01-dev` | -| `feature/*` | `-dev` | `02.09.01-dev` | -| `alpha` | `-alpha` | `02.09.01-alpha` | -| `beta` | `-beta` | `02.09.01-beta` | -| `rc` | `-rc` | `02.09.01-rc` | - -### Auto version bump - -On every push to `dev`, `feature/*`, or `patch/*`: - -1. Patch version incremented -2. Stability suffix `-dev` applied -3. All version-bearing files updated (manifests, CHANGELOG, PHP headers, etc.) -4. Commit created with `[skip ci]` to avoid loops - -### Release version flow - -Version bumps happen at specific release events: - -| Event | Bump | Example | -|-------|------|---------| -| Feature merged to dev | Patch bump after dev release | `02.09.01-dev` → release → `02.09.02-dev` | -| Dev promoted to RC | Minor bump | `02.09.02-dev` → `02.10.00-rc` | -| RC merged to main | Minor bump | `02.10.00-rc` → `02.11.00` (stable) | -| Dev recreated from main | Patch bump | `02.11.00` → `02.11.01-dev` | - -### Release stream copies - -When a higher-stability release is published, copies are created for all lesser streams with the same base version: - -- **RC `02.10.00-rc`** also creates: `02.10.00-dev`, `02.10.00-alpha`, `02.10.00-beta` -- **Stable `02.11.00`** also creates: `02.11.00-dev`, `02.11.00-alpha`, `02.11.00-beta`, `02.11.00-rc` - -This ensures Joomla sites on ANY stability channel see the update (Joomla only shows versions higher than what's installed). - -### Version files - -The version tools update all files containing version stamps: - -- `.mokogitea/manifest.xml` (canonical source) -- Joomla XML manifests (`` tag) -- `README.md`, `CHANGELOG.md` (`VERSION:` pattern) -- `package.json`, `pyproject.toml` -- Any text file with a `VERSION: XX.YY.ZZ` label - -Files synced from other repos (with a `# REPO:` header) are not touched. - -## Code Standards - -- **PHP**: PSR-12, tabs for indentation -- **Copyright**: all files must include the Moko Consulting copyright header -- **License**: SPDX identifier `GPL-3.0-or-later` (or as specified per repo) -- **Attribution**: use `Authored-by: Moko Consulting` in commits, not individual names - -## Commit Messages - -Use conventional commit format: - -``` -type(scope): short description - -Optional body with context. - -Authored-by: Moko Consulting -``` - -Types: `feat`, `fix`, `chore`, `docs`, `style`, `refactor`, `test`, `ci` - -Special flags in commit messages: -- `[skip ci]` — skip all CI workflows -- `[skip bump]` — skip auto version bump only - -## Reporting Issues - -Use the repository's issue tracker with the appropriate template. - ---- - -*Moko Consulting * +# Contributing to Moko Consulting Projects + +Thank you for your interest in contributing. All Moko Consulting repositories follow this universal workflow and version policy. + +## Branching Workflow + +``` +feature/* ──PR──> dev ──draft PR──> (renamed to rc) ──merge──> main +``` + +### Step by step + +1. **Create a feature branch** from `dev`: + ```bash + git checkout dev && git pull + git checkout -b feature/my-change + ``` + +2. **Work and commit** on your feature branch. Push to origin. + +3. **Open a PR**: `feature/my-change` → `dev`. After review and checks, merge it. + +4. **When ready for release**, open a **draft PR**: `dev` → `main`. + - This automatically renames the source branch to `rc` (release candidate) + - An RC pre-release is built and uploaded + +5. **Alpha and beta branches** are created by manually renaming the branch before the RC stage: + - Rename `dev` to `alpha` for early testing → alpha pre-release is built + - Rename `alpha` to `beta` for feature-complete testing → beta pre-release is built + - When the draft PR is created, the branch is renamed to `rc` + +6. **Once PR checks pass** on the `rc` branch, mark the PR as ready and merge to `main`. + +7. **Merging to main** triggers the stable release pipeline: + - Minor version bump (e.g., `02.09.xx` → `02.10.00`) + - Stability suffix stripped (clean version) + - Gitea release created with ZIP/tar.gz packages + - `updates.xml` updated (Joomla extensions) + - `dev` branch recreated from `main` + +### Branch summary + +| Branch | Purpose | Created by | +|--------|---------|-----------| +| `feature/*` | New features and fixes | Developer | +| `dev` | Integration branch | Auto-recreated after release | +| `alpha` | Alpha pre-release testing | Manual rename from `dev` | +| `beta` | Beta pre-release testing | Manual rename from `alpha` | +| `rc` | Release candidate | Auto-renamed on draft PR to main | +| `main` | Stable releases | Protected, merge only | +| `version/XX.YY.ZZ` | Archived release snapshots | Auto-created by CI | + +### Protected branches + +| Branch | Direct push | Merge via | +|--------|------------|-----------| +| `main` | Blocked (CI bot whitelisted) | PR merge only | +| `dev` | Blocked (CI bot whitelisted) | PR merge from feature/* | +| `rc` | Blocked (CI bot whitelisted) | Auto-created on draft PR | +| `alpha` | Blocked (CI bot whitelisted) | Manual rename | +| `beta` | Blocked (CI bot whitelisted) | Manual rename | +| `feature/*` | Open | N/A (source branch) | + +## Version Policy + +### Format + +All versions use `XX.YY.ZZ` — three two-digit segments, zero-padded: + +- **XX** — Major version (breaking changes) +- **YY** — Minor version (new features, bumped on release to main) +- **ZZ** — Patch version (auto-incremented on every push to dev/feature branches) + +Rollover: patch `99` → `00` increments minor; minor `99` → `00` increments major. + +### Stability suffixes + +Each branch appends a suffix to indicate stability: + +| Branch | Suffix | Example | +|--------|--------|---------| +| `main` | (none) | `02.09.00` | +| `dev` | `-dev` | `02.09.01-dev` | +| `feature/*` | `-dev` | `02.09.01-dev` | +| `alpha` | `-alpha` | `02.09.01-alpha` | +| `beta` | `-beta` | `02.09.01-beta` | +| `rc` | `-rc` | `02.09.01-rc` | + +### Auto version bump + +On every push to `dev`, `feature/*`, or `patch/*`: + +1. Patch version incremented +2. Stability suffix `-dev` applied +3. All version-bearing files updated (manifests, CHANGELOG, PHP headers, etc.) +4. Commit created with `[skip ci]` to avoid loops + +### Release version flow + +Version bumps happen at specific release events: + +| Event | Bump | Example | +|-------|------|---------| +| Feature merged to dev | Patch bump after dev release | `02.09.01-dev` → release → `02.09.02-dev` | +| Dev promoted to RC | Minor bump | `02.09.02-dev` → `02.10.00-rc` | +| RC merged to main | Minor bump | `02.10.00-rc` → `02.11.00` (stable) | +| Dev recreated from main | Patch bump | `02.11.00` → `02.11.01-dev` | + +### Release stream copies + +When a higher-stability release is published, copies are created for all lesser streams with the same base version: + +- **RC `02.10.00-rc`** also creates: `02.10.00-dev`, `02.10.00-alpha`, `02.10.00-beta` +- **Stable `02.11.00`** also creates: `02.11.00-dev`, `02.11.00-alpha`, `02.11.00-beta`, `02.11.00-rc` + +This ensures Joomla sites on ANY stability channel see the update (Joomla only shows versions higher than what's installed). + +### Version files + +The version tools update all files containing version stamps: + +- `.mokogitea/manifest.xml` (canonical source) +- Joomla XML manifests (`` tag) +- `README.md`, `CHANGELOG.md` (`VERSION:` pattern) +- `package.json`, `pyproject.toml` +- Any text file with a `VERSION: XX.YY.ZZ` label + +Files synced from other repos (with a `# REPO:` header) are not touched. + +## Code Standards + +- **PHP**: PSR-12, tabs for indentation +- **Copyright**: all files must include the Moko Consulting copyright header +- **License**: SPDX identifier `GPL-3.0-or-later` (or as specified per repo) +- **Attribution**: use `Authored-by: Moko Consulting` in commits, not individual names + +## Commit Messages + +Use conventional commit format: + +``` +type(scope): short description + +Optional body with context. + +Authored-by: Moko Consulting +``` + +Types: `feat`, `fix`, `chore`, `docs`, `style`, `refactor`, `test`, `ci` + +Special flags in commit messages: +- `[skip ci]` — skip all CI workflows +- `[skip bump]` — skip auto version bump only + +## Reporting Issues + +Use the repository's issue tracker with the appropriate template. + +--- + +*Moko Consulting * diff --git a/PLUGIN_SCRIPTS.md b/PLUGIN_SCRIPTS.md index d016426..516140f 100644 --- a/PLUGIN_SCRIPTS.md +++ b/PLUGIN_SCRIPTS.md @@ -2,16 +2,16 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Root -INGROUP: MokoPlatform -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Root +INGROUP: MokoCLI +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /PLUGIN_SCRIPTS.md BRIEF: Plugin system CLI documentation --> # Plugin System CLI Scripts -Command-line scripts for validating, health checking, and managing projects using the moko-platform plugin system. +Command-line scripts for validating, health checking, and managing projects using the MokoCLI plugin system. ## Available Scripts diff --git a/README.md b/README.md index c6bf850..e2b05d4 100644 --- a/README.md +++ b/README.md @@ -2,19 +2,19 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Root -INGROUP: MokoPlatform -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Root +INGROUP: MokoCLI +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /README.md -VERSION: 09.25.02 +VERSION: 09.25.05 BRIEF: Project overview and documentation --> -# moko-platform Enterprise API +# MokoCLI Enterprise API ![Version](https://img.shields.io/badge/version-09.01.00-blue) ![PHP](https://img.shields.io/badge/PHP-8.1%2B-777BB4) ![License](https://img.shields.io/badge/license-GPL--3.0--or--later-green) -PHP implementation of moko-platform — enterprise standards, automation framework, workflow templates, and bulk sync tooling. +PHP implementation of MokoCLI — enterprise standards, automation framework, workflow templates, and bulk sync tooling. > **Primary platform**: [Gitea — git.mokoconsulting.tech](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards-API) > **Backup mirror**: [GitHub](https://github.com/MokoConsulting/MokoStandards-API) *(read-only mirror)* diff --git a/analysis/index.md b/analysis/index.md index 8e02640..4f1b0d9 100644 --- a/analysis/index.md +++ b/analysis/index.md @@ -2,9 +2,9 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Index -INGROUP: MokoPlatform.Analysis -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Index +INGROUP: MokoCLI.Analysis +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /analysis/index.md BRIEF: Analysis directory index --> diff --git a/automation/bulk_joomla_template.php b/automation/bulk_joomla_template.php index 30c9c2c..b0846ef 100644 --- a/automation/bulk_joomla_template.php +++ b/automation/bulk_joomla_template.php @@ -9,9 +9,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Automation - * INGROUP: MokoPlatform.Scripts - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Automation + * INGROUP: MokoCLI.Scripts + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /automation/bulk_joomla_template.php * BRIEF: Bulk scaffold and sync Joomla template repositories * @@ -42,7 +42,7 @@ use MokoEnterprise\{ * * Provides three operations for Joomla template projects: * --scaffold: Create a new template repository with the full directory structure - * --sync: Push moko-platform files to existing template repositories + * --sync: Push MokoCLI files to existing template repositories * --list: List all repositories tagged as joomla-template * * Works with both GitHub and Gitea via the PlatformAdapterFactory. @@ -318,7 +318,7 @@ class BulkJoomlaTemplate extends CliFramework $name, $path, $content, - "chore: update {$path} from moko-platform", + "chore: update {$path} from MokoCLI", $existingSha, $branch ); diff --git a/automation/bulk_sync.php b/automation/bulk_sync.php index ed99ee6..c251f51 100755 --- a/automation/bulk_sync.php +++ b/automation/bulk_sync.php @@ -9,9 +9,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Automation - * INGROUP: MokoPlatform.Scripts - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Automation + * INGROUP: MokoCLI.Scripts + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /automation/bulk_sync.php * BRIEF: Enterprise-grade bulk repository synchronization */ @@ -42,7 +42,7 @@ use MokoEnterprise\{ /** * Bulk Repository Synchronization Tool * - * Synchronizes moko-platform files across multiple repositories using + * Synchronizes MokoCLI files across multiple repositories using * the Enterprise library for robust, audited operations. */ class BulkSync extends CliFramework @@ -95,7 +95,7 @@ class BulkSync extends CliFramework */ protected function run(): int { - $this->log("🚀 moko-platform Bulk Synchronization v" . self::VERSION, 'INFO'); + $this->log("🚀 MokoCLI Bulk Synchronization v" . self::VERSION, 'INFO'); // Initialize enterprise components if (!$this->initializeComponents()) { @@ -180,7 +180,7 @@ class BulkSync extends CliFramework $results['health'] = $this->runHealthChecksAll($org, $repositories); } - // Create/update tracking issue in moko-platform + // Create/update tracking issue in MokoCLI $this->createSyncIssue($org, $results); // Create/update a failure issue when any repos failed @@ -244,7 +244,7 @@ class BulkSync extends CliFramework * Filter repositories based on include/exclude lists */ /** Repositories that are permanently excluded from bulk sync. */ - private const ALWAYS_EXCLUDE = ['moko-platform', '.github-private']; + private const ALWAYS_EXCLUDE = ['MokoCLI', '.github-private']; private function filterRepositories(array $repositories, array $include, array $exclude): array { @@ -426,7 +426,7 @@ class BulkSync extends CliFramework $this->log("", 'ERROR'); $this->log("Required Implementation:", 'ERROR'); $this->log(" 1. Clone/fetch target repository", 'ERROR'); - $this->log(" 2. Apply file updates based on moko-platform configuration", 'ERROR'); + $this->log(" 2. Apply file updates based on MokoCLI configuration", 'ERROR'); $this->log(" 3. Create pull request with changes", 'ERROR'); $this->log(" 4. Handle merge conflicts and validation", 'ERROR'); $this->log("", 'ERROR'); @@ -837,7 +837,7 @@ class BulkSync extends CliFramework } /** - * Ensure all standard moko-platform labels exist on a target repository. + * Ensure all standard MokoCLI labels exist on a target repository. * * Fetches existing labels first (GET) and only POSTs the ones that are * missing. This avoids the 422 "already exists" responses that would @@ -872,7 +872,7 @@ class BulkSync extends CliFramework // Workflow / Process ['automation', '8B4513', 'Automated processes or scripts'], - ['moko-platform', 'B60205', 'moko-platform compliance'], + ['MokoCLI', 'B60205', 'MokoCLI compliance'], ['needs-review', 'FBCA04', 'Awaiting code review'], ['work-in-progress', 'D93F0B', 'Work in progress, not ready for merge'], ['breaking-change', 'D73A4A', 'Breaking API or functionality change'], @@ -912,8 +912,8 @@ class BulkSync extends CliFramework ['health: poor', 'FF6B6B', 'Health score below 50'], // Sync / Automation (used by bulk_sync, scan_drift, check_repo_health) - ['standards-update', 'B60205', 'moko-platform sync update'], - ['standards-drift', 'FBCA04', 'Repository drifted from moko-platform'], + ['standards-update', 'B60205', 'MokoCLI sync update'], + ['standards-drift', 'FBCA04', 'Repository drifted from MokoCLI'], ['sync-report', '0075CA', 'Bulk sync run report'], ['sync-failure', 'D73A4A', 'Bulk sync failure requiring attention'], ['push-failure', 'D73A4A', 'File push failure requiring attention'], @@ -925,10 +925,10 @@ class BulkSync extends CliFramework ['type: version', '0E8A16', 'Version-related change'], ]; - // Quick check: if the repo already has the 'moko-platform' label, it was + // Quick check: if the repo already has the 'MokoCLI' label, it was // provisioned previously — skip the expensive full label provisioning. try { - $probe = $this->api->get("/repos/{$org}/{$repo}/labels/moko-platform"); + $probe = $this->api->get("/repos/{$org}/{$repo}/labels/MokoCLI"); if (!empty($probe['name'])) { return; // already provisioned } @@ -1024,7 +1024,7 @@ class BulkSync extends CliFramework */ private function updateOpenBranches(string $org, string $repo): void { - $syncBranchPrefix = 'chore/sync-moko-platform-'; + $syncBranchPrefix = 'chore/sync-MokoCLI-'; try { $defaultBranch = 'main'; @@ -1055,7 +1055,7 @@ class BulkSync extends CliFramework $this->api->post("/repos/{$org}/{$repo}/merges", [ 'base' => $branch, 'head' => $defaultBranch, - 'commit_message' => "chore: merge {$defaultBranch} into {$branch} (moko-platform sync)", + 'commit_message' => "chore: merge {$defaultBranch} into {$branch} (MokoCLI sync)", ]); $this->log(" 🔀 Merged {$defaultBranch} → {$branch} (PR #{$prNum})", 'INFO'); } catch (\Exception $e) { @@ -1076,7 +1076,7 @@ class BulkSync extends CliFramework /** * Records which sync run touched the repo, the PR number, and the - * moko-platform version that was applied — giving each repo a clear audit + * MokoCLI version that was applied — giving each repo a clear audit * trail of what was changed and why. */ /** @@ -1119,16 +1119,16 @@ class BulkSync extends CliFramework $minor = self::VERSION_MINOR; $force = isset($this->options['force']) ? ' *(--force)*' : ''; $prLink = $this->adapter->getPullRequestWebUrl($org, $repo, $prNumber); - $source = $this->adapter->getRepoWebUrl($org, 'moko-platform'); - $branchName = 'chore/sync-moko-platform-v' . $minor; + $source = $this->adapter->getRepoWebUrl($org, 'MokoCLI'); + $branchName = 'chore/sync-MokoCLI-v' . $minor; $branchLink = $this->adapter->getBranchWebUrl($org, $repo, $branchName); - $title = "chore: moko-platform v{$minor} sync tracking"; + $title = "chore: MokoCLI v{$minor} sync tracking"; $body = <<resolveLabelIds($org, $repo, $labelNames); try { @@ -1213,7 +1213,7 @@ class BulkSync extends CliFramework } /** - * Create a tracking issue in moko-platform for this sync run. + * Create a tracking issue in MokoCLI for this sync run. */ private function createSyncIssue(string $org, array $results): void { @@ -1232,7 +1232,7 @@ class BulkSync extends CliFramework $issues = $results['issues'] ?? []; // Stable title — no timestamp so repeated runs update a single issue - $title = "sync: moko-platform v" . self::VERSION_MINOR . " bulk sync report"; + $title = "sync: MokoCLI v" . self::VERSION_MINOR . " bulk sync report"; $protection = $results['protection'] ?? []; $hasProtect = !empty($protection); @@ -1281,7 +1281,7 @@ class BulkSync extends CliFramework : "|---|---|---|---|"; $body = <<api->get("/repos/{$org}/moko-platform/issues", [ + $existing = $this->api->get("/repos/{$org}/MokoCLI/issues", [ 'labels' => 'sync-report', 'state' => 'all', 'per_page' => 1, @@ -1309,8 +1309,8 @@ class BulkSync extends CliFramework 'direction' => 'desc', ]); - $labelNames = ['sync-report', 'moko-platform', 'type: chore', 'automation']; - $labels = $this->resolveLabelIds($org, 'moko-platform', $labelNames); + $labelNames = ['sync-report', 'MokoCLI', 'type: chore', 'automation']; + $labels = $this->resolveLabelIds($org, 'MokoCLI', $labelNames); $existing = array_values($existing); if (!empty($existing) && isset($existing[0]['number'])) { @@ -1319,22 +1319,22 @@ class BulkSync extends CliFramework if (($existing[0]['state'] ?? 'open') === 'closed') { $patch['state'] = 'open'; } - $this->api->patch("/repos/{$org}/moko-platform/issues/{$issueNumber}", $patch); + $this->api->patch("/repos/{$org}/MokoCLI/issues/{$issueNumber}", $patch); try { - $this->api->post("/repos/{$org}/moko-platform/issues/{$issueNumber}/labels", ['labels' => $labels]); + $this->api->post("/repos/{$org}/MokoCLI/issues/{$issueNumber}/labels", ['labels' => $labels]); } catch (\Exception $le) { /* non-fatal */ } - $this->log("📋 Sync report issue updated: {$org}/moko-platform#{$issueNumber}", 'INFO'); + $this->log("📋 Sync report issue updated: {$org}/MokoCLI#{$issueNumber}", 'INFO'); } else { - $issue = $this->api->post("/repos/{$org}/moko-platform/issues", [ + $issue = $this->api->post("/repos/{$org}/MokoCLI/issues", [ 'title' => $title, 'body' => $body, 'labels' => $labels, 'assignees' => ['jmiller'], ]); $issueNumber = $issue['number'] ?? '?'; - $this->log("📋 Sync report issue created: {$org}/moko-platform#{$issueNumber}", 'INFO'); + $this->log("📋 Sync report issue created: {$org}/MokoCLI#{$issueNumber}", 'INFO'); } } catch (\Exception $e) { $this->log("⚠️ Failed to create/update sync report issue: " . $e->getMessage(), 'WARN'); @@ -1342,7 +1342,7 @@ class BulkSync extends CliFramework } /** - * Create or update a failure issue in moko-platform when repos fail to sync. + * Create or update a failure issue in MokoCLI when repos fail to sync. * Uses the 'sync-failure' label so it is distinct from the run-report issue. * Reopens a closed issue rather than creating a duplicate. */ @@ -1388,7 +1388,7 @@ class BulkSync extends CliFramework $body = preg_replace('/^ /m', '', $body); try { - $existing = $this->api->get("/repos/{$org}/moko-platform/issues", [ + $existing = $this->api->get("/repos/{$org}/MokoCLI/issues", [ 'labels' => 'sync-failure', 'state' => 'all', 'per_page' => 1, @@ -1403,17 +1403,17 @@ class BulkSync extends CliFramework if (($existing[0]['state'] ?? 'open') === 'closed') { $patch['state'] = 'open'; } - $this->api->patch("/repos/{$org}/moko-platform/issues/{$num}", $patch); - $this->log("🚨 Failure issue #{$num} updated: {$org}/moko-platform#{$num}", 'WARN'); + $this->api->patch("/repos/{$org}/MokoCLI/issues/{$num}", $patch); + $this->log("🚨 Failure issue #{$num} updated: {$org}/MokoCLI#{$num}", 'WARN'); } else { - $issue = $this->api->post("/repos/{$org}/moko-platform/issues", [ + $issue = $this->api->post("/repos/{$org}/MokoCLI/issues", [ 'title' => $title, 'body' => $body, - 'labels' => $this->resolveLabelIds($org, 'moko-platform', ['sync-failure']), + 'labels' => $this->resolveLabelIds($org, 'MokoCLI', ['sync-failure']), 'assignees' => ['jmiller'], ]); $num = $issue['number'] ?? '?'; - $this->log("🚨 Failure issue created: {$org}/moko-platform#{$num}", 'WARN'); + $this->log("🚨 Failure issue created: {$org}/MokoCLI#{$num}", 'WARN'); } } catch (\Exception $e) { $this->log("⚠️ Could not create/update failure issue: " . $e->getMessage(), 'WARN'); diff --git a/automation/bulk_workflow_trigger.sh b/automation/bulk_workflow_trigger.sh index b649fb6..c63032d 100644 --- a/automation/bulk_workflow_trigger.sh +++ b/automation/bulk_workflow_trigger.sh @@ -1,123 +1,123 @@ -#!/usr/bin/env bash -# Copyright (C) 2026 Moko Consulting -# SPDX-License-Identifier: GPL-3.0-or-later -# BRIEF: Trigger a workflow across all client-waas repos in a Gitea org - -set -euo pipefail - -# --------------------------------------------------------------------------- -# Usage -# --------------------------------------------------------------------------- -usage() { - cat < +# SPDX-License-Identifier: GPL-3.0-or-later +# BRIEF: Trigger a workflow across all client-waas repos in a Gitea org + +set -euo pipefail + +# --------------------------------------------------------------------------- +# Usage +# --------------------------------------------------------------------------- +usage() { + cat <dryRun ? "DRY RUN" : "LIVE") . "\n"; if (!empty($skipRepos)) { echo "Skipping: " . implode(', ', $skipRepos) . "\n"; @@ -97,7 +97,7 @@ class EnrichManifestXmlCli extends CliFramework } $manifestPath = "{$workDir}/.mokogitea/manifest.xml"; - if (!file_exists($manifestPath) || !str_contains(file_get_contents($manifestPath), 'rmTree($workDir); diff --git a/automation/enrich_mokostandards_xml.php b/automation/enrich_mokostandards_xml.php index 43dc8a6..854bca5 100644 --- a/automation/enrich_mokostandards_xml.php +++ b/automation/enrich_mokostandards_xml.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Automation - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Automation + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /automation/enrich_mokostandards_xml.php * BRIEF: Enrich XML manifests with repo-specific build and deploy details * @@ -46,7 +46,7 @@ class EnrichMokostandardsXmlCli extends CliFramework $parser = new MokoStandardsParser(); $tmpBase = sys_get_temp_dir() . '/moko-enrich-' . getmypid(); - echo "=== moko-platform XML Manifest Enrichment ===\n"; + echo "=== MokoCLI XML Manifest Enrichment ===\n"; echo "Mode: " . ($this->dryRun ? "DRY RUN" : "LIVE") . "\n"; if (!empty($skipRepos)) { echo "Skipping: " . implode(', ', $skipRepos) . "\n"; @@ -97,7 +97,7 @@ class EnrichMokostandardsXmlCli extends CliFramework } $manifestPath = "{$workDir}/.mokogitea/manifest.xml"; - if (!file_exists($manifestPath) || !str_contains(file_get_contents($manifestPath), 'rmTree($workDir); diff --git a/automation/index.md b/automation/index.md index f61d3d6..6e07aaa 100644 --- a/automation/index.md +++ b/automation/index.md @@ -2,9 +2,9 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Index -INGROUP: MokoPlatform.Automation -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Index +INGROUP: MokoCLI.Automation +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /automation/index.md BRIEF: Automation directory index --> diff --git a/automation/migrate_to_gitea.php b/automation/migrate_to_gitea.php index d2f1c51..c2497bf 100644 --- a/automation/migrate_to_gitea.php +++ b/automation/migrate_to_gitea.php @@ -8,16 +8,16 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Automation - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Automation + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /automation/migrate_to_gitea.php * BRIEF: Migrate repositories from GitHub to self-hosted Gitea instance * * USAGE * php automation/migrate_to_gitea.php --dry-run * php automation/migrate_to_gitea.php --repos MokoCRM MokoDoliMods - * php automation/migrate_to_gitea.php --exclude moko-platform --skip-archived + * php automation/migrate_to_gitea.php --exclude MokoCLI --skip-archived * php automation/migrate_to_gitea.php --resume */ @@ -278,7 +278,7 @@ class MigrateToGitea extends CliFramework try { $this->gitea->createIssue( $giteaOrg, - 'moko-platform', + 'MokoCLI', 'chore: GitHub → Gitea migration report — ' . count($results['migrated']) . ' repos migrated', $report, ['labels' => ['automation', 'type: chore']] diff --git a/automation/push_files.php b/automation/push_files.php index f6cdc19..b84b9e2 100644 --- a/automation/push_files.php +++ b/automation/push_files.php @@ -9,9 +9,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Automation - * INGROUP: MokoPlatform.Scripts - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Automation + * INGROUP: MokoCLI.Scripts + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /automation/push_files.php * BRIEF: Push one or more specific files to one or more remote repositories */ @@ -35,7 +35,7 @@ use MokoEnterprise\{ /** * Targeted File Push Tool * - * Pushes one or more specific files from moko-platform templates to one or + * Pushes one or more specific files from MokoCLI templates to one or * more remote repositories — without running a full sync. * * Files are specified by their destination path as they appear in the target @@ -81,7 +81,7 @@ class PushFiles extends CliFramework */ protected function run(): int { - $this->log('📦 moko-platform File Push v' . self::VERSION, 'INFO'); + $this->log('📦 MokoCLI File Push v' . self::VERSION, 'INFO'); if (!$this->initializeComponents()) { return 1; @@ -337,7 +337,7 @@ class PushFiles extends CliFramework $prNumber = null; if (!$direct) { - $prTitle = "chore: push " . count($entries) . " file(s) from moko-platform"; + $prTitle = "chore: push " . count($entries) . " file(s) from MokoCLI"; $prBody = $this->buildPRBody($entries); $pr = $this->adapter->createPullRequest( $org, @@ -414,7 +414,7 @@ class PushFiles extends CliFramework $message = !empty($customMessage) ? $customMessage - : "chore: update {$destPath} from moko-platform"; + : "chore: update {$destPath} from MokoCLI"; // Fetch existing file SHA (needed for updates) $existingSha = null; @@ -457,9 +457,9 @@ class PushFiles extends CliFramework ): void { $now = gmdate('Y-m-d H:i:s') . ' UTC'; $version = self::VERSION; - $source = $this->adapter->getRepoWebUrl($org, 'moko-platform'); + $source = $this->adapter->getRepoWebUrl($org, 'MokoCLI'); - $title = "chore: moko-platform file push tracking"; + $title = "chore: MokoCLI file push tracking"; $deliveryLine = $prNumber !== null ? "| **Pull request** | [#{$prNumber}](" . $this->adapter->getPullRequestWebUrl($org, $repo, $prNumber) . ") |" @@ -471,9 +471,9 @@ class PushFiles extends CliFramework )); $body = <<api->get("/repos/{$org}/{$repo}/issues", [ @@ -550,7 +550,7 @@ class PushFiles extends CliFramework } /** - * Create or update a failure issue in moko-platform when repos fail to receive files. + * Create or update a failure issue in MokoCLI when repos fail to receive files. * Uses the 'push-failure' label. Reopens a closed issue rather than creating a duplicate. */ private function createFailureIssue(string $org, array $results): void @@ -598,7 +598,7 @@ class PushFiles extends CliFramework $body = preg_replace('/^ /m', '', $body); try { - $existing = $this->api->get("/repos/{$org}/moko-platform/issues", [ + $existing = $this->api->get("/repos/{$org}/MokoCLI/issues", [ 'labels' => 'push-failure', 'state' => 'all', 'per_page' => 1, @@ -613,17 +613,17 @@ class PushFiles extends CliFramework if (($existing[0]['state'] ?? 'open') === 'closed') { $patch['state'] = 'open'; } - $this->api->patch("/repos/{$org}/moko-platform/issues/{$num}", $patch); - $this->log("🚨 Failure issue #{$num} updated: {$org}/moko-platform#{$num}", 'WARN'); + $this->api->patch("/repos/{$org}/MokoCLI/issues/{$num}", $patch); + $this->log("🚨 Failure issue #{$num} updated: {$org}/MokoCLI#{$num}", 'WARN'); } else { - $issue = $this->api->post("/repos/{$org}/moko-platform/issues", [ + $issue = $this->api->post("/repos/{$org}/MokoCLI/issues", [ 'title' => $title, 'body' => $body, 'labels' => ['push-failure'], 'assignees' => ['jmiller'], ]); $num = $issue['number'] ?? '?'; - $this->log("🚨 Failure issue created: {$org}/moko-platform#{$num}", 'WARN'); + $this->log("🚨 Failure issue created: {$org}/MokoCLI#{$num}", 'WARN'); } } catch (\Exception $e) { $this->log("⚠️ Could not create/update failure issue: " . $e->getMessage(), 'WARN'); @@ -638,14 +638,14 @@ class PushFiles extends CliFramework private function buildPRBody(array $entries): string { $now = gmdate('Y-m-d H:i:s') . ' UTC'; - $lines = ["## moko-platform File Push\n", "**Pushed:** {$now}\n", '### Files\n']; + $lines = ["## MokoCLI File Push\n", "**Pushed:** {$now}\n", '### Files\n']; foreach ($entries as $entry) { $lines[] = "- `{$entry['destination']}`"; } - $sourceUrl = $this->adapter->getRepoWebUrl(self::DEFAULT_ORG, 'moko-platform'); - $lines[] = "\n---\n*Generated by [moko-platform]({$sourceUrl}) `push_files.php`*"; + $sourceUrl = $this->adapter->getRepoWebUrl(self::DEFAULT_ORG, 'MokoCLI'); + $lines[] = "\n---\n*Generated by [MokoCLI]({$sourceUrl}) `push_files.php`*"; return implode("\n", $lines); } diff --git a/automation/push_manifest_xml.php b/automation/push_manifest_xml.php index 988755a..815395b 100644 --- a/automation/push_manifest_xml.php +++ b/automation/push_manifest_xml.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Automation - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Automation + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /automation/push_manifest_xml.php * BRIEF: Push XML manifests to all governed repositories */ @@ -47,7 +47,7 @@ class PushManifestXmlCli extends CliFramework $parser = new MokoStandardsParser(); $tmpBase = sys_get_temp_dir() . '/moko-manifest-push-' . getmypid(); - echo "=== moko-platform XML Manifest Push ===\n"; + echo "=== MokoCLI XML Manifest Push ===\n"; echo "Org: {$giteaOrg}\n"; echo "Mode: " . ($this->dryRun ? "DRY RUN" : "LIVE") . "\n"; if ($repoFilter) { @@ -125,7 +125,7 @@ class PushManifestXmlCli extends CliFramework // Check if already XML and up-to-date $manifestPath = "{$workDir}/.mokogitea/manifest.xml"; - $existingIsXml = file_exists($manifestPath) && str_contains(file_get_contents($manifestPath), 'extractPlatform(file_get_contents($manifestPath)); if ($existingPlatform === $platform) { diff --git a/automation/push_mokostandards_xml.php b/automation/push_mokostandards_xml.php index 09150b4..19fa8df 100644 --- a/automation/push_mokostandards_xml.php +++ b/automation/push_mokostandards_xml.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Automation - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Automation + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /automation/push_mokostandards_xml.php * BRIEF: Push XML manifests to all governed repositories */ @@ -47,7 +47,7 @@ class PushMokostandardsXmlCli extends CliFramework $parser = new MokoStandardsParser(); $tmpBase = sys_get_temp_dir() . '/moko-manifest-push-' . getmypid(); - echo "=== moko-platform XML Manifest Push ===\n"; + echo "=== MokoCLI XML Manifest Push ===\n"; echo "Org: {$giteaOrg}\n"; echo "Mode: " . ($this->dryRun ? "DRY RUN" : "LIVE") . "\n"; if ($repoFilter) { @@ -125,7 +125,7 @@ class PushMokostandardsXmlCli extends CliFramework // Check if already XML and up-to-date $manifestPath = "{$workDir}/.mokogitea/manifest.xml"; - $existingIsXml = file_exists($manifestPath) && str_contains(file_get_contents($manifestPath), 'extractPlatform(file_get_contents($manifestPath)); if ($existingPlatform === $platform) { diff --git a/automation/repo_cleanup.php b/automation/repo_cleanup.php index 0e223bd..645739e 100644 --- a/automation/repo_cleanup.php +++ b/automation/repo_cleanup.php @@ -9,9 +9,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Automation - * INGROUP: MokoPlatform.Scripts - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Automation + * INGROUP: MokoCLI.Scripts + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /automation/repo_cleanup.php * BRIEF: Enterprise repository cleanup — branches, PRs, issues, workflows, labels, logs */ @@ -39,14 +39,14 @@ use MokoEnterprise\{ApiClient, AuditLogger, CliFramework, Config, GitPlatformAda class RepoCleanup extends CliFramework { private const VERSION = '09.23.00'; - private const SYNC_PREFIX = 'chore/sync-moko-platform-'; - private const CURRENT_BRANCH = 'chore/sync-moko-platform-v04.02.00'; + private const SYNC_PREFIX = 'chore/sync-MokoCLI-'; + private const CURRENT_BRANCH = 'chore/sync-MokoCLI-v04.02.00'; /** Workflow files that have been retired and should be deleted from governed repos. */ private const RETIRED_WORKFLOWS = [ 'build.yml', 'code-quality.yml', 'release-cycle.yml', 'release-pipeline.yml', 'branch-cleanup.yml', 'auto-update-changelog.yml', 'enterprise-issue-manager.yml', - 'flush-actions-cache.yml', 'moko-platform-script-runner.yml', 'unified-ci.yml', + 'flush-actions-cache.yml', 'MokoCLI-script-runner.yml', 'unified-ci.yml', 'unified-platform-testing.yml', 'reusable-build.yml', 'reusable-ci-validation.yml', 'reusable-deploy.yml', 'reusable-php-quality.yml', 'reusable-platform-testing.yml', 'reusable-project-detector.yml', 'reusable-release.yml', 'reusable-script-executor.yml', @@ -98,7 +98,7 @@ class RepoCleanup extends CliFramework } - $this->logMsg("🧹 moko-platform Repository Cleanup v" . self::VERSION); + $this->logMsg("🧹 MokoCLI Repository Cleanup v" . self::VERSION); $this->logMsg("Organization: {$org}"); $this->logMsg("Current sync branch: " . self::CURRENT_BRANCH); if ($this->dryRun) { @@ -225,7 +225,7 @@ class RepoCleanup extends CliFramework } $allRepos = $this->adapter->listOrgRepos($org, $skipArchived); - return array_filter($allRepos, fn($r) => !in_array($r['name'], ['moko-platform', '.github-private'], true)); + return array_filter($allRepos, fn($r) => !in_array($r['name'], ['MokoCLI', '.github-private'], true)); } // ─── Cleanup operations ────────────────────────────────────────────── @@ -463,9 +463,9 @@ class RepoCleanup extends CliFramework private function checkLabels(string $org, string $repo, array &$results): void { try { - $this->api->get("/repos/{$org}/{$repo}/labels/moko-platform"); + $this->api->get("/repos/{$org}/{$repo}/labels/MokoCLI"); } catch (\Exception $e) { - $this->logMsg(" ⚠️ Missing 'moko-platform' label"); + $this->logMsg(" ⚠️ Missing 'MokoCLI' label"); $results['labels_missing']++; $this->api->resetCircuitBreaker(); } @@ -479,7 +479,7 @@ class RepoCleanup extends CliFramework if (preg_match('/^\s*VERSION:\s*(\d{2}\.\d{2}\.\d{2})/m', $content, $m)) { $version = $m[1]; - // Check manifest.xml for the tracked moko-platform version + // Check manifest.xml for the tracked MokoCLI version try { $mokoFile = $this->api->get("/repos/{$org}/{$repo}/contents/.mokogitea/manifest.xml"); $mokoContent = base64_decode($mokoFile['content'] ?? ''); diff --git a/automation/server-autoheal.sh b/automation/server-autoheal.sh index 86e7b9a..5560b09 100644 --- a/automation/server-autoheal.sh +++ b/automation/server-autoheal.sh @@ -4,9 +4,9 @@ # Copyright (C) 2026 Moko Consulting # SPDX-License-Identifier: GPL-3.0-or-later # -# DEFGROUP: MokoPlatform.Automation.ServerAutoheal -# INGROUP: MokoPlatform.Automation -# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +# DEFGROUP: MokoCLI.Automation.ServerAutoheal +# INGROUP: MokoCLI.Automation +# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli # PATH: /automation/server-autoheal.sh # BRIEF: Server auto-heal on unclean restart + split system/content backups # diff --git a/bin/moko b/bin/moko index b28c3b2..89e8775 100644 --- a/bin/moko +++ b/bin/moko @@ -9,11 +9,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.CLI - * INGROUP: MokoStandards - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /bin/moko - * BRIEF: Unified CLI dispatcher — run any MokoStandards script without needing GitHub Actions + * BRIEF: Unified CLI dispatcher — run any MokoCLI script without needing GitHub Actions * * USAGE * php bin/moko [options] (all platforms) @@ -292,10 +292,10 @@ function printHelp(): void { echo <<<'HELP' ╔══════════════════════════════════════════════════════════╗ -║ MokoStandards CLI (bin/moko) ║ +║ MokoCLI (bin/moko) ║ ╚══════════════════════════════════════════════════════════╝ -Run any MokoStandards script locally without GitHub Actions. +Run any MokoCLI script locally without GitHub Actions. USAGE php bin/moko [options] (all platforms) diff --git a/cli/archive_repo.php b/cli/archive_repo.php index 8b262c6..b64f9b5 100644 --- a/cli/archive_repo.php +++ b/cli/archive_repo.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/archive_repo.php * BRIEF: Gracefully retire a governed repository — archive, close issues/PRs, remove sync def */ @@ -135,7 +135,7 @@ class ArchiveRepoCli extends CliFramework try { $issue = $adapter->createIssue( $org, - 'moko-platform', + 'MokoCLI', "chore: archived repository {$repoName}", "## Repository Archived\n\n" . "**Repository:** `{$org}/{$repoName}`\n" @@ -150,7 +150,7 @@ class ArchiveRepoCli extends CliFramework ] ); if (isset($issue['number'])) { - echo " Archival record: moko-platform#{$issue['number']}\n"; + echo " Archival record: MokoCLI#{$issue['number']}\n"; } } catch (\Exception $e) { echo " Warning: could not create archival record: " . $e->getMessage() . "\n"; diff --git a/cli/audit_query.php b/cli/audit_query.php index 57bb875..8bfe715 100644 --- a/cli/audit_query.php +++ b/cli/audit_query.php @@ -14,9 +14,9 @@ * (at your option) any later version. * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.CLI - * INGROUP: MokoPlatform.Enterprise - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.CLI + * INGROUP: MokoCLI.Enterprise + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/audit_query.php * BRIEF: Search, filter, and export audit logs */ diff --git a/cli/badge_update.php b/cli/badge_update.php index d7d529b..e385c89 100644 --- a/cli/badge_update.php +++ b/cli/badge_update.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/badge_update.php * BRIEF: Update [VERSION: XX.XX.XX] badges in all markdown files */ diff --git a/cli/branch_rename.php b/cli/branch_rename.php index 61b7967..8b9818d 100644 --- a/cli/branch_rename.php +++ b/cli/branch_rename.php @@ -6,11 +6,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/branch_rename.php - * VERSION: 09.25.02 + * VERSION: 09.25.05 * BRIEF: Rename a git branch via Gitea API (create new, update PR, delete old) */ diff --git a/cli/bulk_workflow_push.php b/cli/bulk_workflow_push.php index cc56f77..82a80a0 100644 --- a/cli/bulk_workflow_push.php +++ b/cli/bulk_workflow_push.php @@ -8,11 +8,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/bulk_workflow_push.php - * VERSION: 09.25.02 + * VERSION: 09.25.05 * BRIEF: Push a workflow file to all governed repos via the Gitea Contents API */ @@ -154,7 +154,7 @@ class BulkWorkflowPushCli extends CliFramework 'content' => $encodedContent, 'sha' => $remoteSha, 'message' => "chore: sync {$destPath} " - . "from moko-platform [skip ci]", + . "from MokoCLI [skip ci]", 'branch' => $branch, ]); @@ -184,7 +184,7 @@ class BulkWorkflowPushCli extends CliFramework $payload = json_encode([ 'content' => $encodedContent, 'message' => "chore: add {$destPath} " - . "from moko-platform [skip ci]", + . "from MokoCLI [skip ci]", 'branch' => $branch, ]); diff --git a/cli/bulk_workflow_trigger.php b/cli/bulk_workflow_trigger.php index 3f4df33..57f7040 100644 --- a/cli/bulk_workflow_trigger.php +++ b/cli/bulk_workflow_trigger.php @@ -8,11 +8,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/bulk_workflow_trigger.php - * VERSION: 09.25.02 + * VERSION: 09.25.05 * BRIEF: Trigger a workflow across multiple repos at once */ diff --git a/cli/changelog_promote.php b/cli/changelog_promote.php index e5dc3db..d952950 100644 --- a/cli/changelog_promote.php +++ b/cli/changelog_promote.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/changelog_promote.php * BRIEF: Promote [Unreleased] section in CHANGELOG.md to a versioned entry */ diff --git a/cli/changelog_prune.php b/cli/changelog_prune.php index d6fe85d..318fc3d 100644 --- a/cli/changelog_prune.php +++ b/cli/changelog_prune.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/changelog_prune.php * BRIEF: Prune old CHANGELOG.md entries — keeps [Unreleased] + last N releases */ diff --git a/cli/client_dashboard.php b/cli/client_dashboard.php index 3fb51e5..55187f8 100644 --- a/cli/client_dashboard.php +++ b/cli/client_dashboard.php @@ -8,11 +8,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/client_dashboard.php - * VERSION: 09.25.02 + * VERSION: 09.25.05 * BRIEF: Generate unified client dashboard HTML */ diff --git a/cli/client_health_check.php b/cli/client_health_check.php index ac7145d..d8cec51 100644 --- a/cli/client_health_check.php +++ b/cli/client_health_check.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/client_health_check.php * BRIEF: Verify a client site's update server, installed version, and release availability */ diff --git a/cli/client_inventory.php b/cli/client_inventory.php index b40f30c..46778f7 100644 --- a/cli/client_inventory.php +++ b/cli/client_inventory.php @@ -8,11 +8,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/client_inventory.php - * VERSION: 09.25.02 + * VERSION: 09.25.05 * BRIEF: Discover and list all client-waas repos with their server configuration status */ diff --git a/cli/client_provision.php b/cli/client_provision.php index fdfa4d1..ff88290 100644 --- a/cli/client_provision.php +++ b/cli/client_provision.php @@ -8,11 +8,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/client_provision.php - * VERSION: 09.25.02 + * VERSION: 09.25.05 * BRIEF: Provision a new client environment end-to-end */ diff --git a/cli/completion.php b/cli/completion.php index 5f3ad4d..d8354ca 100644 --- a/cli/completion.php +++ b/cli/completion.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/completion.php * BRIEF: Generate bash/zsh tab completion scripts for bin/moko */ diff --git a/cli/create_project.php b/cli/create_project.php index e57363f..5440801 100644 --- a/cli/create_project.php +++ b/cli/create_project.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/create_project.php * BRIEF: Create baseline GitHub Projects for repositories with standard fields and views */ @@ -24,7 +24,7 @@ use MokoEnterprise\CliFramework; class CreateProjectCli extends CliFramework { /** @var string[] */ - private array $ALWAYS_EXCLUDE = ['moko-platform', '.github-private']; + private array $ALWAYS_EXCLUDE = ['MokoCLI', '.github-private']; /** @var array */ private array $PLATFORM_TO_TYPE = [ @@ -183,7 +183,7 @@ class CreateProjectCli extends CliFramework CURLOPT_HTTPHEADER => [ 'Authorization: bearer ' . $token, 'Content-Type: application/json', - 'User-Agent: moko-platform-CreateProject', + 'User-Agent: MokoCLI-CreateProject', ], ]); $body = (string) curl_exec($ch); @@ -422,14 +422,14 @@ class CreateProjectCli extends CliFramework updateProjectV2(input: { projectId: $projectId, shortDescription: $shortDescription, - readme: "Managed by moko-platform. Run `php cli/create_project.php` to regenerate." + readme: "Managed by MokoCLI. Run `php cli/create_project.php` to regenerate." }) { projectV2 { id } } }', [ 'projectId' => $projectId, - 'shortDescription' => "Standard project board for {$repo}. Auto-created by moko-platform.", + 'shortDescription' => "Standard project board for {$repo}. Auto-created by MokoCLI.", ], $token ); diff --git a/cli/create_repo.php b/cli/create_repo.php index 38add2b..b24787d 100644 --- a/cli/create_repo.php +++ b/cli/create_repo.php @@ -8,11 +8,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/create_repo.php - * BRIEF: Scaffold a new governed repository with full moko-platform baseline + * BRIEF: Scaffold a new governed repository with full MokoCLI baseline */ declare(strict_types=1); @@ -28,7 +28,7 @@ class CreateRepoCli extends CliFramework { protected function configure(): void { - $this->setDescription('Scaffold a new governed repository with full moko-platform baseline'); + $this->setDescription('Scaffold a new governed repository with full MokoCLI baseline'); $this->addArgument('--name', 'Repository name', null); $this->addArgument('--type', 'Project type', null); $this->addArgument('--description', 'Repository description', ''); @@ -60,16 +60,16 @@ class CreateRepoCli extends CliFramework 'generic' => 'generic', ]; $TYPE_TO_TOPICS = [ - 'dolibarr' => ['dolibarr', 'erp', 'crm', 'php', 'moko-platform'], - 'joomla' => ['joomla', 'cms', 'php', 'moko-platform'], - 'nodejs' => ['nodejs', 'javascript', 'typescript', 'moko-platform'], - 'terraform' => ['terraform', 'infrastructure', 'iac', 'moko-platform'], - 'python' => ['python', 'moko-platform'], - 'wordpress' => ['wordpress', 'php', 'cms', 'moko-platform'], - 'generic' => ['moko-platform'], + 'dolibarr' => ['dolibarr', 'erp', 'crm', 'php', 'MokoCLI'], + 'joomla' => ['joomla', 'cms', 'php', 'MokoCLI'], + 'nodejs' => ['nodejs', 'javascript', 'typescript', 'MokoCLI'], + 'terraform' => ['terraform', 'infrastructure', 'iac', 'MokoCLI'], + 'python' => ['python', 'MokoCLI'], + 'wordpress' => ['wordpress', 'php', 'cms', 'MokoCLI'], + 'generic' => ['MokoCLI'], ]; $platform = $TYPE_TO_PLATFORM[$type] ?? 'generic'; - $topics = $TYPE_TO_TOPICS[$type] ?? ['moko-platform']; + $topics = $TYPE_TO_TOPICS[$type] ?? ['MokoCLI']; $platformName = $adapter->getPlatformName(); $vis = $private ? 'private' : 'public'; echo "Scaffolding new repository: {$org}/{$name}" @@ -84,7 +84,7 @@ class CreateRepoCli extends CliFramework if (!$this->dryRun) { try { $data = $adapter->createOrgRepo($org, $name, [ - 'description' => $description ?: "Managed by moko-platform ({$type})", + 'description' => $description ?: "Managed by MokoCLI ({$type})", 'private' => $private, 'has_issues' => true, 'has_projects' => true, @@ -143,7 +143,7 @@ class CreateRepoCli extends CliFramework . "Copyright (C) 2026 Moko Consulting \n" . "SPDX-License-Identifier: GPL-3.0-or-later\n" . "DEFGROUP: {$name}\n" - . "INGROUP: moko-platform\n" + . "INGROUP: MokoCLI\n" . "REPO: {$repoUrl}\n" . "PATH: /README.md\n" . "BRIEF: {$description}\n" @@ -152,7 +152,7 @@ class CreateRepoCli extends CliFramework . "{$description}\n\n" . "## Getting Started\n\n" . "This repository is governed by" - . " [moko-platform]({$standardsUrl}).\n\n" + . " [MokoCLI]({$standardsUrl}).\n\n" . "## License\n\n" . "GPL-3.0-or-later. See [LICENSE](LICENSE)" . " for details.\n"; @@ -169,7 +169,7 @@ class CreateRepoCli extends CliFramework $name, 'README.md', $readmeContent, - 'docs: initialize README with moko-platform header [skip ci]', + 'docs: initialize README with MokoCLI header [skip ci]', $sha ); echo " README.md created\n"; diff --git a/cli/deploy_joomla.php b/cli/deploy_joomla.php index d361fbf..a18c02c 100644 --- a/cli/deploy_joomla.php +++ b/cli/deploy_joomla.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.CLI - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/deploy_joomla.php * BRIEF: Smart Joomla deploy — routes files to correct server directories by extension type * diff --git a/cli/dev_branch_reset.php b/cli/dev_branch_reset.php index 92d5704..d7d86b3 100644 --- a/cli/dev_branch_reset.php +++ b/cli/dev_branch_reset.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/dev_branch_reset.php * BRIEF: Delete and recreate dev branch from main via Gitea API */ diff --git a/cli/grafana_dashboard.php b/cli/grafana_dashboard.php index 596f776..cf23653 100644 --- a/cli/grafana_dashboard.php +++ b/cli/grafana_dashboard.php @@ -8,11 +8,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/grafana_dashboard.php - * VERSION: 09.25.02 + * VERSION: 09.25.05 * BRIEF: Manage Grafana dashboards via API */ diff --git a/cli/joomla_build.php b/cli/joomla_build.php index 66f4a5b..3f551de 100644 --- a/cli/joomla_build.php +++ b/cli/joomla_build.php @@ -6,11 +6,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/joomla_build.php - * VERSION: 09.25.02 + * VERSION: 09.25.05 * BRIEF: Build a Joomla extension ZIP from manifest — all types supported * NOTE: Called by pre-release and auto-release workflows. */ diff --git a/cli/joomla_compat_check.php b/cli/joomla_compat_check.php index 0c1a9c5..7337d7b 100644 --- a/cli/joomla_compat_check.php +++ b/cli/joomla_compat_check.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/joomla_compat_check.php * BRIEF: Check if extension targetplatform regex matches the latest Joomla version */ diff --git a/cli/joomla_metadata_validate.php b/cli/joomla_metadata_validate.php new file mode 100644 index 0000000..e00cc7c --- /dev/null +++ b/cli/joomla_metadata_validate.php @@ -0,0 +1,472 @@ +#!/usr/bin/env php + + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + * FILE INFORMATION + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli + * PATH: /cli/joomla_metadata_validate.php + * VERSION: 09.25.05 + * BRIEF: Validate MokoGitea repo metadata against Joomla extension manifest XML + */ + +declare(strict_types=1); + +require_once __DIR__ . '/../lib/Enterprise/CliFramework.php'; + +use MokoEnterprise\CliFramework; + +class JoomlaMetadataValidateCli extends CliFramework +{ + /** Joomla element prefix map — must match MokoGitea's cleanJoomlaElement() */ + private const JOOMLA_PREFIX = [ + 'package' => 'pkg_', + 'component' => 'com_', + 'module' => 'mod_', + 'template' => 'tpl_', + 'library' => 'lib_', + 'file' => 'file_', + ]; + + protected function configure(): void + { + $this->setDescription('Validate MokoGitea repo metadata against Joomla extension manifest XML'); + $this->addArgument('--path', 'Repo root path (default: current directory)', '.'); + $this->addArgument('--token', 'Gitea API token (or GITEA_TOKEN env)', ''); + $this->addArgument('--org', 'Gitea org', 'MokoConsulting'); + $this->addArgument('--repo', 'Repo name (auto-detected from git if empty)', ''); + $this->addArgument('--api-base', 'Gitea API base URL', 'https://git.mokoconsulting.tech/api/v1'); + $this->addArgument('--ci', 'CI mode: exit 1 on any error', false); + $this->addArgument('--json', 'Output as JSON', false); + } + + protected function run(): int + { + $path = realpath($this->getArgument('--path')) ?: $this->getArgument('--path'); + $token = $this->getArgument('--token') ?: getenv('GITEA_TOKEN') ?: ''; + $org = $this->getArgument('--org'); + $repoName = $this->getArgument('--repo'); + $apiBase = rtrim($this->getArgument('--api-base'), '/'); + $ciMode = (bool) $this->getArgument('--ci'); + $jsonMode = (bool) $this->getArgument('--json'); + + if (!is_dir($path)) { + $this->log('ERROR', "Path does not exist: {$path}"); + return 1; + } + + if ($repoName === '') { + $repoName = $this->detectRepoName($path); + } + + // ── Step 1: Find the Joomla extension manifest XML ────────── + $joomlaXml = $this->findJoomlaManifest($path); + + if ($joomlaXml === null) { + $this->log('ERROR', 'No Joomla extension manifest XML found'); + return 1; + } + + $this->log('INFO', "Joomla manifest: {$joomlaXml['path']}"); + + // ── Step 2: Load MokoGitea metadata ───────────────────────── + $metadata = $this->loadMetadata($path, $org, $repoName, $token, $apiBase); + + if ($metadata === null) { + $this->log('ERROR', 'Could not load MokoGitea metadata'); + return 1; + } + + // ── Step 3: Compare ───────────────────────────────────────── + $results = $this->compare($metadata, $joomlaXml, $path); + + // ── Step 4: Output ────────────────────────────────────────── + if ($jsonMode) { + echo json_encode([ + 'repo' => $repoName, + 'results' => $results, + ], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n"; + } else { + $this->printResults($repoName, $results); + } + + $errors = count(array_filter($results, fn($r) => $r['status'] === 'error')); + + return ($ciMode && $errors > 0) ? 1 : 0; + } + + // ================================================================= + // Find Joomla manifest XML + // ================================================================= + + private function findJoomlaManifest(string $root): ?array + { + // Search common locations for a Joomla extension manifest + $candidates = []; + + // Package manifest: source/pkg_*.xml + foreach (glob("{$root}/source/pkg_*.xml") as $file) { + $candidates[] = $file; + } + + // Component manifest: source/packages/com_*/[name].xml + foreach (glob("{$root}/source/packages/com_*/*.xml") as $file) { + $basename = basename($file); + // Skip access.xml, config.xml, etc. + if (in_array($basename, ['access.xml', 'config.xml'], true)) { + continue; + } + $candidates[] = $file; + } + + // Direct source/*.xml + foreach (glob("{$root}/source/*.xml") as $file) { + if (basename($file) !== 'pkg_mokosuitebackup.xml') { + // Already caught above + } + $candidates[] = $file; + } + + // src/ fallback + foreach (glob("{$root}/src/pkg_*.xml") as $file) { + $candidates[] = $file; + } + + // Find the first one that has + foreach (array_unique($candidates) as $file) { + $content = file_get_contents($file); + if ($content === false) { + continue; + } + + if (preg_match('/]*type=["\']([^"\']+)["\']/', $content, $typeMatch)) { + $xml = @simplexml_load_string($content); + if ($xml === false) { + continue; + } + + $type = strtolower($typeMatch[1]); + $relPath = str_replace($root . '/', '', $file); + $relPath = str_replace($root . '\\', '', $relPath); + + return [ + 'path' => $relPath, + 'type' => $type, + 'xml' => $xml, + ]; + } + } + + return null; + } + + // ================================================================= + // Load metadata (from API) + // ================================================================= + + private function loadMetadata(string $root, string $org, string $repoName, string $token, string $apiBase): ?array + { + if ($token !== '') { + $url = "{$apiBase}/repos/{$org}/{$repoName}/metadata"; + $ctx = stream_context_create([ + 'http' => [ + 'header' => "Authorization: token {$token}\r\nAccept: application/json\r\n", + 'timeout' => 10, + ], + ]); + + $body = @file_get_contents($url, false, $ctx); + + if ($body !== false) { + $data = json_decode($body, true); + if (is_array($data)) { + $data['source'] = 'api'; + return $data; + } + } + } + + return null; + } + + // ================================================================= + // Compare metadata against Joomla manifest + // ================================================================= + + private function compare(array $metadata, array $joomlaXml, string $root): array + { + $results = []; + $xml = $joomlaXml['xml']; + $type = $joomlaXml['type']; + + // 1. Extension type + $metaType = $this->normalizeExtensionType($metadata['extension_type'] ?? ''); + $results[] = [ + 'field' => 'extension_type', + 'metadata' => $metaType, + 'joomla' => $type, + 'status' => ($metaType === $type) ? 'ok' : 'error', + 'message' => ($metaType === $type) + ? "matches " + : "metadata has \"{$metaType}\" but Joomla manifest has \"{$type}\"", + ]; + + // 2. Element name + $metaName = strtolower($metadata['name'] ?? ''); + $metaElement = $this->deriveElement($metaType, $metaName); + $joomlaElement = $this->extractJoomlaElement($xml, $type); + + $elementMatch = ($metaElement === $joomlaElement); + $results[] = [ + 'field' => 'element', + 'metadata' => $metaElement, + 'joomla' => $joomlaElement, + 'status' => $elementMatch ? 'ok' : 'error', + 'message' => $elementMatch + ? "derived correctly" + : "metadata derives \"{$metaElement}\" but Joomla uses \"{$joomlaElement}\"", + ]; + + // 3. Version + $metaVersion = $metadata['version'] ?? ''; + $joomlaVersion = (string) ($xml->version ?? ''); + + if ($metaVersion !== '' && $joomlaVersion !== '') { + // Strip dev/rc suffixes for comparison (CI bumps these) + $metaBase = preg_replace('/-(dev|rc|alpha|beta)\d*$/', '', $metaVersion); + $joomlaBase = preg_replace('/-(dev|rc|alpha|beta)\d*$/', '', $joomlaVersion); + $versionMatch = ($metaBase === $joomlaBase); + + $results[] = [ + 'field' => 'version', + 'metadata' => $metaVersion, + 'joomla' => $joomlaVersion, + 'status' => $versionMatch ? 'ok' : 'warn', + 'message' => $versionMatch + ? 'matches (base version)' + : "metadata has \"{$metaVersion}\" but Joomla has \"{$joomlaVersion}\"", + ]; + } + + // 4. PHP minimum (from composer.json) + $composerPhp = $this->readComposerPhpRequirement($root); + $metaPhp = $metadata['php_minimum'] ?? ''; + + if ($composerPhp !== '' && $metaPhp !== '') { + $phpMatch = ($metaPhp === $composerPhp); + $results[] = [ + 'field' => 'php_minimum', + 'metadata' => $metaPhp, + 'joomla' => $composerPhp . ' (composer.json)', + 'status' => $phpMatch ? 'ok' : 'warn', + 'message' => $phpMatch + ? 'matches composer.json' + : "metadata has \"{$metaPhp}\" but composer.json requires \"{$composerPhp}\"", + ]; + } + + // 5. Description + $metaDesc = $metadata['description'] ?? ''; + $joomlaDesc = (string) ($xml->description ?? ''); + + // Joomla descriptions are often language keys, skip those + if ($metaDesc !== '' && $joomlaDesc !== '' && !str_starts_with($joomlaDesc, 'COM_') && !str_starts_with($joomlaDesc, 'PKG_')) { + $descMatch = ($metaDesc === $joomlaDesc); + $results[] = [ + 'field' => 'description', + 'metadata' => substr($metaDesc, 0, 60) . (strlen($metaDesc) > 60 ? '...' : ''), + 'joomla' => substr($joomlaDesc, 0, 60) . (strlen($joomlaDesc) > 60 ? '...' : ''), + 'status' => $descMatch ? 'ok' : 'info', + 'message' => $descMatch ? 'matches' : 'descriptions differ (informational)', + ]; + } + + return $results; + } + + // ================================================================= + // Helpers + // ================================================================= + + /** + * Normalize extension_type — map MokoGitea types to Joomla types. + */ + private function normalizeExtensionType(string $type): string + { + return match (strtolower($type)) { + 'joomla-extension' => 'package', // legacy mapping + default => strtolower($type), + }; + } + + /** + * Derive the Joomla element name from type + name. + * Replicates MokoGitea's cleanJoomlaElement() + prefix logic. + */ + private function deriveElement(string $type, string $name): string + { + // Clean: lowercase, strip non-alphanumeric except . _ - + $clean = strtolower($name); + $clean = preg_replace('/[^a-z0-9._-]/', '', $clean); + + $prefix = self::JOOMLA_PREFIX[$type] ?? ''; + + return $prefix . $clean; + } + + /** + * Extract the element name from a Joomla manifest XML. + * Follows the same logic as Joomla's InstallerAdapter::getElement(). + */ + private function extractJoomlaElement(\SimpleXMLElement $xml, string $type): string + { + switch ($type) { + case 'package': + $packagename = (string) ($xml->packagename ?? ''); + if ($packagename !== '') { + return 'pkg_' . strtolower(preg_replace('/[^a-zA-Z0-9._-]/', '', $packagename)); + } + break; + + case 'component': + $element = (string) ($xml->element ?? ''); + if ($element !== '') { + $element = strtolower($element); + return str_starts_with($element, 'com_') ? $element : 'com_' . $element; + } + $name = (string) ($xml->name ?? ''); + $name = strtolower(preg_replace('/[^a-zA-Z0-9._-]/', '', $name)); + return str_starts_with($name, 'com_') ? $name : 'com_' . $name; + + case 'module': + $element = (string) ($xml->element ?? ''); + if ($element !== '') { + return strtolower($element); + } + break; + + case 'plugin': + // Plugins derive element from the file attribute + if (isset($xml->files)) { + foreach ($xml->files->children() as $file) { + $plugin = (string) ($file->attributes()->plugin ?? ''); + if ($plugin !== '') { + return strtolower($plugin); + } + } + } + break; + + case 'library': + $libname = (string) ($xml->libraryname ?? ''); + if ($libname !== '') { + return strtolower($libname); + } + break; + } + + // Fallback: use tag + $name = (string) ($xml->name ?? ''); + return strtolower(preg_replace('/[^a-zA-Z0-9._-]/', '', $name)); + } + + /** + * Read PHP version requirement from composer.json. + */ + private function readComposerPhpRequirement(string $root): string + { + $composerFile = "{$root}/composer.json"; + + if (!is_file($composerFile)) { + return ''; + } + + $data = json_decode(file_get_contents($composerFile), true); + + if (!is_array($data)) { + return ''; + } + + $phpReq = $data['require']['php'] ?? ''; + + // Extract version number from constraint like ">=8.1" + if (preg_match('/(\d+\.\d+)/', $phpReq, $m)) { + return $m[1]; + } + + return ''; + } + + private function detectRepoName(string $root): string + { + $gitConfig = "{$root}/.git/config"; + + if (!file_exists($gitConfig)) { + return basename($root); + } + + $content = file_get_contents($gitConfig); + + if (preg_match('/url\s*=\s*.*\/([^\/\s]+?)(?:\.git)?\s*$/m', $content, $m)) { + return $m[1]; + } + + return basename($root); + } + + // ================================================================= + // Output + // ================================================================= + + private function printResults(string $repoName, array $results): void + { + $errors = count(array_filter($results, fn($r) => $r['status'] === 'error')); + $warns = count(array_filter($results, fn($r) => $r['status'] === 'warn')); + $oks = count(array_filter($results, fn($r) => $r['status'] === 'ok')); + + $this->log('INFO', "Validating {$repoName} Joomla metadata...\n"); + + foreach ($results as $r) { + $icon = match ($r['status']) { + 'ok' => "\xE2\x9C\x93", // ✓ + 'error' => "\xE2\x9C\x97", // ✗ + 'warn' => "\xE2\x9A\xA0", // ⚠ + default => "\xE2\x84\xB9", // ℹ + }; + + $line = sprintf( + " %s %-16s %s", + $icon, + $r['field'], + $r['message'] + ); + + $this->log( + match ($r['status']) { + 'error' => 'ERROR', + 'warn' => 'WARN', + 'ok' => 'OK', + default => 'INFO', + }, + $line + ); + } + + echo "\n"; + + if ($errors > 0) { + $this->log('ERROR', "{$errors} error(s) — update delivery will fail"); + } elseif ($warns > 0) { + $this->log('WARN', "All critical checks passed, {$warns} warning(s)"); + } else { + $this->log('OK', "All {$oks} checks passed"); + } + } +} + +$app = new JoomlaMetadataValidateCli(); +exit($app->execute()); diff --git a/cli/joomla_release.php b/cli/joomla_release.php index b763e62..47ff552 100644 --- a/cli/joomla_release.php +++ b/cli/joomla_release.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/joomla_release.php * BRIEF: Joomla release pipeline — build ZIP+tar.gz, upload to GitHub Release, update updates.xml * @@ -407,7 +407,7 @@ class JoomlaRelease extends CliFramework $this->api->post("/repos/{$repo}/releases", [ 'tag_name' => $tag, 'name' => $releaseName, - 'body' => "## {$version}\n\nCreated by moko-platform release pipeline.", + 'body' => "## {$version}\n\nCreated by MokoCLI release pipeline.", 'prerelease' => ($stability !== 'stable'), ]); } diff --git a/cli/license_manage.php b/cli/license_manage.php index 01fe260..1f4f41b 100644 --- a/cli/license_manage.php +++ b/cli/license_manage.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/license_manage.php * BRIEF: Manage license packages and keys via MokoGitea licensing API * diff --git a/cli/manifest_element.php b/cli/manifest_element.php index 9cf9580..e10e7c7 100644 --- a/cli/manifest_element.php +++ b/cli/manifest_element.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/manifest_element.php * BRIEF: Extract element name, type, type prefix, and ZIP name from manifest */ diff --git a/cli/manifest_licensing.php b/cli/manifest_licensing.php index 5c8096b..6f99eba 100644 --- a/cli/manifest_licensing.php +++ b/cli/manifest_licensing.php @@ -6,11 +6,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/manifest_licensing.php - * VERSION: 09.25.02 + * VERSION: 09.25.05 * BRIEF: Ensure licensing tags (updateservers, dlid) in Joomla extension manifests */ diff --git a/cli/manifest_read.php b/cli/manifest_read.php index 3572920..222ad8f 100644 --- a/cli/manifest_read.php +++ b/cli/manifest_read.php @@ -6,11 +6,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/manifest_read.php - * VERSION: 09.25.02 + * VERSION: 09.25.05 * BRIEF: Parse .manifest.xml and output requested field(s) for CI consumption */ @@ -59,7 +59,7 @@ class ManifestReadCli extends CliFramework $candidates = [ "{$root}/.mokogitea/manifest.xml", "{$root}/.mokogitea/.manifest.xml", // legacy (dot-prefixed) - "{$root}/.mokogitea/.moko-platform", // legacy v4 + "{$root}/.mokogitea/.MokoCLI", // legacy v4 ]; foreach ($candidates as $candidate) { diff --git a/cli/package_build.php b/cli/package_build.php index abf89a1..97ad56f 100644 --- a/cli/package_build.php +++ b/cli/package_build.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/package_build.php * BRIEF: Build ZIP and tar.gz install packages for Joomla/Dolibarr/generic projects * diff --git a/cli/platform_detect.php b/cli/platform_detect.php index b07c6cb..ac1da66 100644 --- a/cli/platform_detect.php +++ b/cli/platform_detect.php @@ -6,11 +6,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/platform_detect.php - * VERSION: 09.25.02 + * VERSION: 09.25.05 * BRIEF: Auto-detect repository platform type and optionally update manifest */ @@ -134,9 +134,9 @@ class PlatformDetectCli extends CliFramework } } - // 5. Platform — is mokoplatform itself or org-config + // 5. Platform — is MokoCLI itself or org-config $repoName = basename($root); - if (in_array($repoName, ['mokoplatform', 'mokogitea-org-config'])) { + if (in_array($repoName, ['mokocli', 'mokoplatform', 'mokogitea-org-config'])) { return 'platform'; } diff --git a/cli/release.php b/cli/release.php index 4ef6b7c..4c0685e 100644 --- a/cli/release.php +++ b/cli/release.php @@ -6,11 +6,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/release.php - * BRIEF: Automate the moko-platform version branch release flow + * BRIEF: Automate the MokoCLI version branch release flow */ declare(strict_types=1); @@ -23,7 +23,7 @@ class ReleaseCli extends CliFramework { protected function configure(): void { - $this->setDescription('Automate the moko-platform version branch release flow'); + $this->setDescription('Automate the MokoCLI version branch release flow'); $this->addArgument('--bump', 'Bump type: patch, minor, or major', ''); } diff --git a/cli/release_body_update.php b/cli/release_body_update.php index 54c9b79..05deb24 100644 --- a/cli/release_body_update.php +++ b/cli/release_body_update.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/release_body_update.php * BRIEF: Update Gitea release body with changelog extract and checksums */ diff --git a/cli/release_cascade.php b/cli/release_cascade.php index 432947e..8f7f9fb 100644 --- a/cli/release_cascade.php +++ b/cli/release_cascade.php @@ -6,11 +6,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/release_cascade.php - * VERSION: 09.25.02 + * VERSION: 09.25.05 * BRIEF: DEPRECATED — cascade behavior removed. Each release stream is independent. */ diff --git a/cli/release_create.php b/cli/release_create.php index c7d6b61..745f8c3 100644 --- a/cli/release_create.php +++ b/cli/release_create.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/release_create.php * BRIEF: Create or overwrite a Gitea release with proper naming */ diff --git a/cli/release_manage.php b/cli/release_manage.php index e665d3e..337afbb 100644 --- a/cli/release_manage.php +++ b/cli/release_manage.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/release_manage.php * BRIEF: Create/update Gitea releases, upload assets, update release body */ diff --git a/cli/release_mirror.php b/cli/release_mirror.php index de1481c..1eb684e 100644 --- a/cli/release_mirror.php +++ b/cli/release_mirror.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/release_mirror.php * BRIEF: Mirror a Gitea release (with assets) to a GitHub repository */ @@ -201,7 +201,7 @@ class ReleaseMirrorCli extends CliFramework CURLOPT_HTTPHEADER => [ "Authorization: token {$token}", 'Accept: application/vnd.github+json', - 'User-Agent: moko-platform', + 'User-Agent: MokoCLI', 'Content-Type: application/json', ], CURLOPT_TIMEOUT => 30, @@ -229,7 +229,7 @@ class ReleaseMirrorCli extends CliFramework CURLOPT_HTTPHEADER => [ "Authorization: token {$token}", 'Accept: application/vnd.github+json', - 'User-Agent: moko-platform', + 'User-Agent: MokoCLI', 'Content-Type: application/octet-stream', ], CURLOPT_POSTFIELDS => file_get_contents($filePath), diff --git a/cli/release_notes.php b/cli/release_notes.php index dd31520..4ee6f4a 100644 --- a/cli/release_notes.php +++ b/cli/release_notes.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/release_notes.php * BRIEF: Extract release notes from CHANGELOG.md for a given version */ diff --git a/cli/release_package.php b/cli/release_package.php index 2eb7035..7e899ad 100644 --- a/cli/release_package.php +++ b/cli/release_package.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/release_package.php * BRIEF: Build packages (ZIP + tar.gz) with SHA-256 and upload to Gitea release */ diff --git a/cli/release_promote.php b/cli/release_promote.php index faf779e..a9eda46 100644 --- a/cli/release_promote.php +++ b/cli/release_promote.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/release_promote.php * BRIEF: Promote a Gitea release from one channel to another (rename release, tag, assets) */ diff --git a/cli/release_publish.php b/cli/release_publish.php index 7b12819..81ea9b0 100644 --- a/cli/release_publish.php +++ b/cli/release_publish.php @@ -6,11 +6,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/release_publish.php - * VERSION: 09.25.02 + * VERSION: 09.25.05 * BRIEF: Publish a release and create copies for all lesser stability streams. */ diff --git a/cli/release_validate.php b/cli/release_validate.php index 63d5a88..04bd3bc 100644 --- a/cli/release_validate.php +++ b/cli/release_validate.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/release_validate.php * BRIEF: Pre-release validation -- version consistency, required files, manifest checks */ diff --git a/cli/release_verify.php b/cli/release_verify.php index 1166ab2..f8229aa 100644 --- a/cli/release_verify.php +++ b/cli/release_verify.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/release_verify.php * BRIEF: Verify a built release artifact — version, SHA256, disallowed files */ diff --git a/cli/scaffold_client.php b/cli/scaffold_client.php index 0bd2998..3cac8aa 100644 --- a/cli/scaffold_client.php +++ b/cli/scaffold_client.php @@ -8,11 +8,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/scaffold_client.php - * VERSION: 09.25.02 + * VERSION: 09.25.05 * BRIEF: Scaffold a new client-waas repo from Template-Client-WaaS with pre-configured settings */ diff --git a/cli/sync_rulesets.php b/cli/sync_rulesets.php index 1c6e264..e921415 100644 --- a/cli/sync_rulesets.php +++ b/cli/sync_rulesets.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/sync_rulesets.php * BRIEF: Apply branch protection rules to all repos via platform adapter */ @@ -46,7 +46,7 @@ class SyncRulesetsCli extends CliFramework ); $platformName = $adapter->getPlatformName(); - $ALWAYS_EXCLUDE = ['moko-platform', '.github-private']; + $ALWAYS_EXCLUDE = ['MokoCLI', '.github-private']; // -- Protection rules (platform-agnostic format) -- $PROTECTIONS = [ diff --git a/cli/theme_lint.php b/cli/theme_lint.php index aa910fb..ba971cd 100644 --- a/cli/theme_lint.php +++ b/cli/theme_lint.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/theme_lint.php * BRIEF: Lint theme files -- CSS syntax, image sizes, hardcoded URLs */ diff --git a/cli/updates_xml_build.php b/cli/updates_xml_build.php index 86f47d7..a6ab06a 100644 --- a/cli/updates_xml_build.php +++ b/cli/updates_xml_build.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/updates_xml_build.php * BRIEF: Generate Joomla updates.xml from extension manifest metadata */ diff --git a/cli/updates_xml_sync.php b/cli/updates_xml_sync.php index 193d9d4..47e36f0 100644 --- a/cli/updates_xml_sync.php +++ b/cli/updates_xml_sync.php @@ -6,11 +6,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/updates_xml_sync.php - * VERSION: 09.25.02 + * VERSION: 09.25.05 * BRIEF: Sync updates.xml to target branches via Gitea API * NOTE: Called by pre-release and auto-release workflows after updates.xml * is modified on the current branch. Pushes the file to other branches diff --git a/cli/version_auto_bump.php b/cli/version_auto_bump.php index 9333d53..c586003 100644 --- a/cli/version_auto_bump.php +++ b/cli/version_auto_bump.php @@ -6,11 +6,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/version_auto_bump.php - * VERSION: 09.25.02 + * VERSION: 09.25.05 * BRIEF: Auto patch-bump, set stability suffix, and commit — single CLI replacing inline workflow bash */ diff --git a/cli/version_bump.php b/cli/version_bump.php index b8698f7..287ee88 100644 --- a/cli/version_bump.php +++ b/cli/version_bump.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/version_bump.php * BRIEF: Auto-increment version -- manifest.xml is canonical, cascades to all XML and MD files */ diff --git a/cli/version_bump_remote.php b/cli/version_bump_remote.php index d154467..3a663d6 100644 --- a/cli/version_bump_remote.php +++ b/cli/version_bump_remote.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/version_bump_remote.php * BRIEF: Bump version in manifest XML and CHANGELOG.md on a remote branch via Gitea API */ diff --git a/cli/version_check.php b/cli/version_check.php index 35db0da..37042f8 100644 --- a/cli/version_check.php +++ b/cli/version_check.php @@ -6,11 +6,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/version_check.php - * VERSION: 09.25.02 + * VERSION: 09.25.05 * BRIEF: Validate version consistency across README, manifests, and sub-packages */ diff --git a/cli/version_read.php b/cli/version_read.php index 22a2fde..35e059a 100644 --- a/cli/version_read.php +++ b/cli/version_read.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/version_read.php * BRIEF: Read version — manifest.xml is canonical, falls back to README.md and Joomla XML */ diff --git a/cli/version_reset_dev.php b/cli/version_reset_dev.php index 8b0d8f3..e22f20a 100644 --- a/cli/version_reset_dev.php +++ b/cli/version_reset_dev.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/version_reset_dev.php * BRIEF: Reset platform version to 'development' on a branch via Gitea API */ diff --git a/cli/version_set_platform.php b/cli/version_set_platform.php index 0133b8d..3ac394f 100644 --- a/cli/version_set_platform.php +++ b/cli/version_set_platform.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/version_set_platform.php * BRIEF: Set version in platform-specific files (Dolibarr $this->version, Joomla ) */ diff --git a/cli/wiki_sync.php b/cli/wiki_sync.php index 4d156e0..21ba2db 100644 --- a/cli/wiki_sync.php +++ b/cli/wiki_sync.php @@ -6,12 +6,12 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/wiki_sync.php - * VERSION: 09.25.02 - * BRIEF: Sync select wiki pages from moko-platform to all template repos + * VERSION: 09.25.05 + * BRIEF: Sync select wiki pages from MokoCLI to all template repos */ declare(strict_types=1); @@ -25,7 +25,7 @@ class WikiSyncCli extends CliFramework private string $giteaUrl = 'https://git.mokoconsulting.tech'; private string $token = ''; private string $org = 'MokoConsulting'; - private string $sourceRepo = 'moko-platform'; + private string $sourceRepo = 'MokoCLI'; private array $targetRepos = []; private array $pages = []; private bool $allTemplates = false; @@ -38,10 +38,10 @@ class WikiSyncCli extends CliFramework protected function configure(): void { - $this->setDescription('Sync wiki pages from moko-platform to template repos'); + $this->setDescription('Sync wiki pages from MokoCLI to template repos'); $this->addArgument('--token', 'Gitea API token (required)', ''); $this->addArgument('--org', 'Organization (default: MokoConsulting)', 'MokoConsulting'); - $this->addArgument('--source', 'Source repo (default: moko-platform)', 'moko-platform'); + $this->addArgument('--source', 'Source repo (default: MokoCLI)', 'MokoCLI'); $this->addArgument('--target', 'Target repo (can repeat)', ''); $this->addArgument('--page', 'Page to sync (can repeat)', ''); $this->addArgument('--all-standards', 'Sync all UPPERCASE standards pages', false); diff --git a/cli/workflow_sync.php b/cli/workflow_sync.php index c02ddb4..8d5a7bf 100644 --- a/cli/workflow_sync.php +++ b/cli/workflow_sync.php @@ -6,11 +6,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.CLI - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.CLI + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/workflow_sync.php - * VERSION: 09.25.02 + * VERSION: 09.25.05 * BRIEF: Sync workflows from Generic → platform templates → live repos based on manifest.platform */ diff --git a/composer.json b/composer.json index 1354d5f..aae1ed0 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { - "name": "mokoconsulting-tech/enterprise", - "description": "moko-platform Enterprise API \u2014 PHP implementation", + "name": "mokoconsulting-tech/mokocli", + "description": "MokoCLI Enterprise API \u2014 PHP implementation", "type": "library", "version": "09.23.00", "license": "GPL-3.0-or-later", @@ -51,7 +51,8 @@ "lib/Enterprise/CliFramework.php" ], "files": [ - "src/functions.php" + "src/functions.php", + "src/aliases.php" ] }, "archive": { diff --git a/deploy/backup-before-deploy.php b/deploy/backup-before-deploy.php index 4c8fb07..2d0785b 100644 --- a/deploy/backup-before-deploy.php +++ b/deploy/backup-before-deploy.php @@ -8,11 +8,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Scripts.Deploy - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Scripts.Deploy + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /deploy/backup-before-deploy.php - * VERSION: 09.25.02 + * VERSION: 09.25.05 * BRIEF: Snapshot Joomla directories before deployment for rollback capability */ diff --git a/deploy/deploy-dolibarr.php b/deploy/deploy-dolibarr.php index 9e0f256..20219dc 100644 --- a/deploy/deploy-dolibarr.php +++ b/deploy/deploy-dolibarr.php @@ -8,11 +8,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Scripts.Deploy - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Scripts.Deploy + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /deploy/deploy-dolibarr.php - * VERSION: 09.25.02 + * VERSION: 09.25.05 * BRIEF: Deploy Dolibarr module files to a remote server via SFTP/rsync */ diff --git a/deploy/deploy-joomla.php b/deploy/deploy-joomla.php index 645de96..97233fa 100644 --- a/deploy/deploy-joomla.php +++ b/deploy/deploy-joomla.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Scripts.Deploy - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Scripts.Deploy + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /deploy/deploy-joomla.php * BRIEF: Smart Joomla deploy — routes files to correct Joomla directories based on XML manifest * diff --git a/deploy/deploy-sftp.php b/deploy/deploy-sftp.php index d39492a..3043075 100644 --- a/deploy/deploy-sftp.php +++ b/deploy/deploy-sftp.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Scripts.Deploy - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Scripts.Deploy + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /deploy/deploy-sftp.php * BRIEF: Deploy a repository src/ directory to a remote web server via SFTP */ diff --git a/deploy/health-check.php b/deploy/health-check.php index 0fd771d..8d4d3cb 100644 --- a/deploy/health-check.php +++ b/deploy/health-check.php @@ -8,11 +8,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Scripts.Deploy - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Scripts.Deploy + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /deploy/health-check.php - * VERSION: 09.25.02 + * VERSION: 09.25.05 * BRIEF: Post-deploy health check — verify a Joomla site is responding correctly */ diff --git a/deploy/rollback-joomla.php b/deploy/rollback-joomla.php index 6250b70..a19bee1 100644 --- a/deploy/rollback-joomla.php +++ b/deploy/rollback-joomla.php @@ -8,11 +8,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Scripts.Deploy - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Scripts.Deploy + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /deploy/rollback-joomla.php - * VERSION: 09.25.02 + * VERSION: 09.25.05 * BRIEF: Rollback a Joomla deployment by restoring from a pre-deploy snapshot */ diff --git a/deploy/sync-joomla.php b/deploy/sync-joomla.php index 804acd7..137cac0 100644 --- a/deploy/sync-joomla.php +++ b/deploy/sync-joomla.php @@ -8,11 +8,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Scripts.Deploy - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Scripts.Deploy + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /deploy/sync-joomla.php - * VERSION: 09.25.02 + * VERSION: 09.25.05 * BRIEF: Sync Joomla site directories between two servers via rsync over SSH */ diff --git a/fix/fix_line_endings.php b/fix/fix_line_endings.php index 6f5d4d6..de722b0 100644 --- a/fix/fix_line_endings.php +++ b/fix/fix_line_endings.php @@ -7,9 +7,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Scripts.Fix - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Scripts.Fix + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /fix/fix_line_endings.php * BRIEF: CLI script to normalise CRLF/CR to LF in tracked source files */ diff --git a/fix/fix_permissions.php b/fix/fix_permissions.php index 615c915..d6b5389 100644 --- a/fix/fix_permissions.php +++ b/fix/fix_permissions.php @@ -7,9 +7,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Scripts.Fix - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Scripts.Fix + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /fix/fix_permissions.php * BRIEF: CLI script to normalise file permissions (dirs 755, files 644, scripts 755) */ diff --git a/fix/fix_tabs.php b/fix/fix_tabs.php index 13f5709..095930f 100644 --- a/fix/fix_tabs.php +++ b/fix/fix_tabs.php @@ -7,9 +7,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Scripts.Fix - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Scripts.Fix + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /fix/fix_tabs.php * BRIEF: CLI script to convert tabs to spaces in tracked source files */ diff --git a/fix/fix_trailing_spaces.php b/fix/fix_trailing_spaces.php index 699163b..8d5aa47 100644 --- a/fix/fix_trailing_spaces.php +++ b/fix/fix_trailing_spaces.php @@ -7,9 +7,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Scripts.Fix - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Scripts.Fix + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /fix/fix_trailing_spaces.php * BRIEF: CLI script to remove trailing whitespace from tracked source files */ diff --git a/fix/index.md b/fix/index.md index d632e0b..3e46806 100644 --- a/fix/index.md +++ b/fix/index.md @@ -2,9 +2,9 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Index -INGROUP: MokoPlatform.Fix -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Index +INGROUP: MokoCLI.Fix +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /fix/index.md BRIEF: Fix directory index --> diff --git a/index.md b/index.md index a70f6be..e809329 100644 --- a/index.md +++ b/index.md @@ -2,16 +2,16 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Root -INGROUP: MokoPlatform -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Root +INGROUP: MokoCLI +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /index.md BRIEF: Scripts directory index --> # Scripts Index -Quick navigation for moko-platform scripts organized by function. +Quick navigation for MokoCLI scripts organized by function. ## Core Categories @@ -60,7 +60,7 @@ Shared library code - Extension utilities - GitHub client -### [Wiki](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki) +### [Wiki](https://git.mokoconsulting.tech/MokoConsulting/mokocli/wiki) All documentation lives in the Gitea wiki. ### [Tests](tests/) @@ -93,4 +93,4 @@ All three languages may coexist in the same directory for the same functionality ## See Also - [README.md](README.md) - Comprehensive scripts documentation -- [Wiki](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki) - Documentation (wiki-first) +- [Wiki](https://git.mokoconsulting.tech/MokoConsulting/mokocli/wiki) - Documentation (wiki-first) diff --git a/lib/CliBase.php b/lib/CliBase.php index 2151b44..667872d 100644 --- a/lib/CliBase.php +++ b/lib/CliBase.php @@ -7,9 +7,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Lib - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Lib + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/CliBase.php * BRIEF: Standalone base CLI class for scripts that do not use CliFramework */ diff --git a/lib/Common.php b/lib/Common.php index 6621891..f6bfc70 100644 --- a/lib/Common.php +++ b/lib/Common.php @@ -7,9 +7,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Lib - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Lib + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Common.php * BRIEF: Common utility functions for scripts * NOTE: Version format used throughout is zero-padded semver: XX.YY.ZZ (e.g. 04.00.04). @@ -33,7 +33,7 @@ class Common const FALLBACK_VERSION = '04.00.00'; const REPO_URL = 'https://git.mokoconsulting.tech/MokoConsulting/MokoStandards-API'; - const REPO_URL_GITHUB = 'https://git.mokoconsulting.tech/MokoConsulting/moko-platform'; + const REPO_URL_GITHUB = 'https://git.mokoconsulting.tech/MokoConsulting/mokocli'; const COPYRIGHT = 'Copyright (C) 2026 Moko Consulting '; const LICENSE = 'GPL-3.0-or-later'; diff --git a/lib/Enterprise/AbstractProjectPlugin.php b/lib/Enterprise/AbstractProjectPlugin.php index 9a3794a..f8d8755 100644 --- a/lib/Enterprise/AbstractProjectPlugin.php +++ b/lib/Enterprise/AbstractProjectPlugin.php @@ -9,9 +9,9 @@ declare(strict_types=1); * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Plugins - * INGROUP: MokoPlatform.Enterprise - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Plugins + * INGROUP: MokoCLI.Enterprise + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/AbstractProjectPlugin.php * BRIEF: Abstract base class for project plugins */ @@ -23,7 +23,7 @@ namespace MokoEnterprise; * * Provides common functionality for all project type plugins * - * @package MokoPlatform\Enterprise + * @package MokoCLI\Enterprise * @version 1.0.0 */ abstract class AbstractProjectPlugin implements ProjectPluginInterface diff --git a/lib/Enterprise/ApiClient.php b/lib/Enterprise/ApiClient.php index a6d8e7d..9f7e5b3 100644 --- a/lib/Enterprise/ApiClient.php +++ b/lib/Enterprise/ApiClient.php @@ -9,9 +9,9 @@ declare(strict_types=1); * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.API - * INGROUP: MokoPlatform.Enterprise - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.API + * INGROUP: MokoCLI.Enterprise + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/ApiClient.php * BRIEF: HTTP API client library */ @@ -31,9 +31,9 @@ declare(strict_types=1); * * SPDX-License-Identifier: GPL-3.0-or-later * - * @package MokoPlatform\Enterprise + * @package MokoCLI\Enterprise * @version 04.00.04 - * @author moko-platform Team + * @author MokoCLI Team * @license GPL-3.0-or-later */ diff --git a/lib/Enterprise/AuditLogger.php b/lib/Enterprise/AuditLogger.php index 1b90dc6..abbae13 100644 --- a/lib/Enterprise/AuditLogger.php +++ b/lib/Enterprise/AuditLogger.php @@ -22,15 +22,15 @@ declare(strict_types=1); * (at your option) any later version. * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Audit - * INGROUP: MokoPlatform.Enterprise - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Audit + * INGROUP: MokoCLI.Enterprise + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/AuditLogger.php * BRIEF: Enterprise audit logging * - * @package MokoPlatform\Enterprise + * @package MokoCLI\Enterprise * @version 04.00.04 - * @author moko-platform Team + * @author MokoCLI Team * @license GPL-3.0-or-later */ diff --git a/lib/Enterprise/CheckpointManager.php b/lib/Enterprise/CheckpointManager.php index 7d447f8..5817923 100644 --- a/lib/Enterprise/CheckpointManager.php +++ b/lib/Enterprise/CheckpointManager.php @@ -10,15 +10,15 @@ declare(strict_types=1); * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Checkpoint - * INGROUP: MokoPlatform.Enterprise - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Checkpoint + * INGROUP: MokoCLI.Enterprise + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/CheckpointManager.php * BRIEF: Checkpoint manager for resumable operations * - * @package MokoPlatform\Enterprise + * @package MokoCLI\Enterprise * @version 04.00.04 - * @author moko-platform Team + * @author MokoCLI Team * @license GPL-3.0-or-later */ diff --git a/lib/Enterprise/CliFramework.php b/lib/Enterprise/CliFramework.php index ab4534e..a3f90b4 100644 --- a/lib/Enterprise/CliFramework.php +++ b/lib/Enterprise/CliFramework.php @@ -7,11 +7,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.CLI - * INGROUP: MokoPlatform.Enterprise - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.CLI + * INGROUP: MokoCLI.Enterprise + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/CliFramework.php - * BRIEF: CliFramework — unified base class for all moko-platform CLI scripts + * BRIEF: CliFramework — unified base class for all MokoCLI CLI scripts */ declare(strict_types=1); @@ -23,11 +23,11 @@ use DateTimeZone; use Exception; // ============================================================================= -// CliFramework — current base class for all moko-platform CLI scripts +// CliFramework — current base class for all MokoCLI CLI scripts // ============================================================================= /** - * Base class for moko-platform CLI scripts. + * Base class for MokoCLI CLI scripts. * * Provides argument parsing, a structured lifecycle, and a full console * graphics system (banners, coloured log levels, progress bars, status diff --git a/lib/Enterprise/Config.php b/lib/Enterprise/Config.php index 6fa909e..80a420e 100644 --- a/lib/Enterprise/Config.php +++ b/lib/Enterprise/Config.php @@ -9,9 +9,9 @@ declare(strict_types=1); * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Config - * INGROUP: MokoPlatform.Enterprise - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Config + * INGROUP: MokoCLI.Enterprise + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/Config.php * BRIEF: Configuration manager */ @@ -32,9 +32,9 @@ declare(strict_types=1); * * SPDX-License-Identifier: GPL-3.0-or-later * - * @package MokoPlatform\Enterprise + * @package MokoCLI\Enterprise * @version 04.00.04 - * @author moko-platform Team + * @author MokoCLI Team * @license GPL-3.0-or-later */ diff --git a/lib/Enterprise/ConfigValidator.php b/lib/Enterprise/ConfigValidator.php index 941f105..99a6988 100644 --- a/lib/Enterprise/ConfigValidator.php +++ b/lib/Enterprise/ConfigValidator.php @@ -7,9 +7,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise - * INGROUP: MokoPlatform.Enterprise - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise + * INGROUP: MokoCLI.Enterprise + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/ConfigValidator.php * BRIEF: Validate project config against plugin JSON schema */ @@ -21,7 +21,7 @@ namespace MokoEnterprise; /** * Configuration Validator * - * Validates moko-platform configuration files (YAML, JSON, HCL) + * Validates MokoCLI configuration files (YAML, JSON, HCL) * against expected schemas and reports errors. * * @since 04.00.00 diff --git a/lib/Enterprise/EnterpriseReadinessValidator.php b/lib/Enterprise/EnterpriseReadinessValidator.php index 398ebf8..019d389 100644 --- a/lib/Enterprise/EnterpriseReadinessValidator.php +++ b/lib/Enterprise/EnterpriseReadinessValidator.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/EnterpriseReadinessValidator.php * BRIEF: Enterprise readiness validation library */ diff --git a/lib/Enterprise/ErrorRecovery.php b/lib/Enterprise/ErrorRecovery.php index 03817b8..fe5439b 100644 --- a/lib/Enterprise/ErrorRecovery.php +++ b/lib/Enterprise/ErrorRecovery.php @@ -17,15 +17,15 @@ declare(strict_types=1); * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Recovery - * INGROUP: MokoPlatform.Enterprise - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Recovery + * INGROUP: MokoCLI.Enterprise + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/ErrorRecovery.php * BRIEF: Error recovery framework * - * @package MokoPlatform\Enterprise + * @package MokoCLI\Enterprise * @version 04.00.04 - * @author moko-platform Team + * @author MokoCLI Team * @license GPL-3.0-or-later * @deprecated Individual class files should be used instead */ diff --git a/lib/Enterprise/FileFixUtility.php b/lib/Enterprise/FileFixUtility.php index e58b08e..ed94621 100644 --- a/lib/Enterprise/FileFixUtility.php +++ b/lib/Enterprise/FileFixUtility.php @@ -7,9 +7,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise - * INGROUP: MokoPlatform.Lib - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise + * INGROUP: MokoCLI.Lib + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/FileFixUtility.php * BRIEF: Utility class for fixing file formatting issues (line endings, permissions, tabs, trailing spaces) */ diff --git a/lib/Enterprise/GitHubAdapter.php b/lib/Enterprise/GitHubAdapter.php index 0dad9b3..9fb3fd4 100644 --- a/lib/Enterprise/GitHubAdapter.php +++ b/lib/Enterprise/GitHubAdapter.php @@ -7,9 +7,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Platform - * INGROUP: MokoPlatform.Enterprise - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Platform + * INGROUP: MokoCLI.Enterprise + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/GitHubAdapter.php * BRIEF: GitHub implementation of GitPlatformAdapter */ @@ -31,7 +31,7 @@ use RuntimeException; * - Topics: PUT with {"names": [...]} * - Workflow dir: .github/workflows * - * @package MokoPlatform\Enterprise + * @package MokoCLI\Enterprise * @since 04.06.10 * @see GitPlatformAdapter */ diff --git a/lib/Enterprise/GitPlatformAdapter.php b/lib/Enterprise/GitPlatformAdapter.php index c359f33..fdb28ea 100644 --- a/lib/Enterprise/GitPlatformAdapter.php +++ b/lib/Enterprise/GitPlatformAdapter.php @@ -7,9 +7,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Platform - * INGROUP: MokoPlatform.Enterprise - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Platform + * INGROUP: MokoCLI.Enterprise + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/GitPlatformAdapter.php * BRIEF: Interface defining all git platform operations for GitHub/Gitea abstraction */ @@ -21,11 +21,11 @@ namespace MokoEnterprise; /** * Git Platform Adapter Interface * - * Defines all platform operations required by moko-platform automation. + * Defines all platform operations required by MokoCLI automation. * Implementations exist for GitHub (GitHubAdapter) and Gitea (MokoGiteaAdapter), * allowing scripts to work against either platform transparently. * - * @package MokoPlatform\Enterprise + * @package MokoCLI\Enterprise * @version 04.06.10 */ interface GitPlatformAdapter diff --git a/lib/Enterprise/InputValidator.php b/lib/Enterprise/InputValidator.php index 8980b8e..37c9c50 100644 --- a/lib/Enterprise/InputValidator.php +++ b/lib/Enterprise/InputValidator.php @@ -9,9 +9,9 @@ declare(strict_types=1); * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Validation - * INGROUP: MokoPlatform.Enterprise - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Validation + * INGROUP: MokoCLI.Enterprise + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/InputValidator.php * BRIEF: Input validation library */ @@ -31,9 +31,9 @@ declare(strict_types=1); * * SPDX-License-Identifier: GPL-3.0-or-later * - * @package MokoPlatform\Enterprise + * @package MokoCLI\Enterprise * @version 04.00.04 - * @author moko-platform Team + * @author MokoCLI Team * @license GPL-3.0-or-later */ @@ -161,11 +161,11 @@ class InputValidator break; case 'moko': - // moko-platform format: XX.YY.ZZ + // MokoCLI format: XX.YY.ZZ $pattern = '/^\d{2}\.\d{2}\.\d{2}$/'; if (!preg_match($pattern, $version)) { throw new ValidationError( - "Invalid moko-platform version format: {$version}. Expected: XX.YY.ZZ" + "Invalid MokoCLI version format: {$version}. Expected: XX.YY.ZZ" ); } break; diff --git a/lib/Enterprise/ManifestReader.php b/lib/Enterprise/ManifestReader.php index f33d24e..9495548 100644 --- a/lib/Enterprise/ManifestReader.php +++ b/lib/Enterprise/ManifestReader.php @@ -7,9 +7,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: moko-platform.Enterprise - * INGROUP: moko-platform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/ManifestReader.php * BRIEF: Read and parse .mokogitea/manifest.xml — shared across all CLI tools */ @@ -58,7 +58,7 @@ class ManifestReader $candidates = [ "{$root}/.mokogitea/manifest.xml", "{$root}/.mokogitea/.manifest.xml", - "{$root}/.mokogitea/.moko-platform", + "{$root}/.mokogitea/.MokoCLI", ]; $manifestFile = null; diff --git a/lib/Enterprise/MetricsCollector.php b/lib/Enterprise/MetricsCollector.php index 8c9de43..73a12c7 100644 --- a/lib/Enterprise/MetricsCollector.php +++ b/lib/Enterprise/MetricsCollector.php @@ -9,15 +9,15 @@ declare(strict_types=1); * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Metrics - * INGROUP: MokoPlatform.Enterprise - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Metrics + * INGROUP: MokoCLI.Enterprise + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/MetricsCollector.php * BRIEF: Metrics collection framework */ /** - * Metrics Collector for moko-platform + * Metrics Collector for MokoCLI * * Provides observability and monitoring capabilities: * - Execution time tracking with timers @@ -46,9 +46,9 @@ declare(strict_types=1); * * SPDX-License-Identifier: GPL-3.0-or-later * - * @package MokoPlatform\Enterprise + * @package MokoCLI\Enterprise * @version 04.00.04 - * @author moko-platform Team + * @author MokoCLI Team * @license GPL-3.0-or-later */ diff --git a/lib/Enterprise/MokoGiteaAdapter.php b/lib/Enterprise/MokoGiteaAdapter.php index f379b41..af80d1f 100644 --- a/lib/Enterprise/MokoGiteaAdapter.php +++ b/lib/Enterprise/MokoGiteaAdapter.php @@ -7,9 +7,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Platform - * INGROUP: MokoPlatform.Enterprise - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Platform + * INGROUP: MokoCLI.Enterprise + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/MokoGiteaAdapter.php * BRIEF: Gitea implementation of GitPlatformAdapter */ @@ -33,7 +33,7 @@ use RuntimeException; * - Branch protection: flat API (not rulesets) * - Workflow dir: .mokogitea/workflows * - * @package MokoPlatform\Enterprise + * @package MokoCLI\Enterprise * @since 04.06.10 * @see GitPlatformAdapter */ diff --git a/lib/Enterprise/MokoStandardsParser.php b/lib/Enterprise/MokoStandardsParser.php index ad9427e..971e7f1 100644 --- a/lib/Enterprise/MokoStandardsParser.php +++ b/lib/Enterprise/MokoStandardsParser.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/MokoStandardsParser.php * BRIEF: Parser for the XML-based manifest.xml repository manifest */ @@ -28,14 +28,14 @@ use SimpleXMLElement; * Reads, writes, and validates the manifest.xml repository manifest. * The file uses XML format (no file extension) and lives at .mokogitea/manifest.xml. * - * @package MokoPlatform\Enterprise + * @package MokoCLI\Enterprise * @version 04.07.00 */ class MokoStandardsParser { public const SCHEMA_VERSION = '1.0'; - public const NAMESPACE_URI = 'https://standards.mokoconsulting.tech/moko-platform/1.0'; - public const STANDARDS_SOURCE = 'https://git.mokoconsulting.tech/MokoConsulting/moko-platform'; + public const NAMESPACE_URI = 'https://standards.mokoconsulting.tech/MokoCLI/1.0'; + public const STANDARDS_SOURCE = 'https://git.mokoconsulting.tech/MokoConsulting/mokocli'; /** Valid platform slugs — must match Template-* repo names. */ public const VALID_PLATFORMS = [ @@ -180,7 +180,7 @@ class MokoStandardsParser * @type string $name Repository name (required) * @type string $org Organization (required) * @type string $platform Platform slug (required) - * @type string $standards_version moko-platform version + * @type string $standards_version MokoCLI version * @type string $description Repo description * @type string $license SPDX license identifier * @type list $topics Repo topics @@ -205,7 +205,7 @@ class MokoStandardsParser // Add comment header $dom->appendChild($dom->createComment( "\n MokoStandards Repository Manifest\n" - . " Auto-generated by moko-platform bulk sync.\n" + . " Auto-generated by MokoCLI bulk sync.\n" . " Manual edits to and may be overwritten.\n" . " See: docs/standards/mokostandards-file-spec.md\n" )); diff --git a/lib/Enterprise/PackageBuilder.php b/lib/Enterprise/PackageBuilder.php index e224389..8f3104d 100644 --- a/lib/Enterprise/PackageBuilder.php +++ b/lib/Enterprise/PackageBuilder.php @@ -7,9 +7,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise - * INGROUP: MokoPlatform.Lib - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise + * INGROUP: MokoCLI.Lib + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/PackageBuilder.php * BRIEF: Builds release packages for generic, Dolibarr module, and Joomla component projects */ diff --git a/lib/Enterprise/PlatformAdapterFactory.php b/lib/Enterprise/PlatformAdapterFactory.php index 9bf4d4e..6f63c38 100644 --- a/lib/Enterprise/PlatformAdapterFactory.php +++ b/lib/Enterprise/PlatformAdapterFactory.php @@ -7,9 +7,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Platform - * INGROUP: MokoPlatform.Enterprise - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Platform + * INGROUP: MokoCLI.Enterprise + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/PlatformAdapterFactory.php * BRIEF: Factory for creating platform-specific GitPlatformAdapter instances */ @@ -33,7 +33,7 @@ use RuntimeException; * $repos = $adapter->listOrgRepos('mokoconsulting-tech'); * ``` * - * @package MokoPlatform\Enterprise + * @package MokoCLI\Enterprise * @version 04.06.10 * * @since 04.00.00 diff --git a/lib/Enterprise/PluginFactory.php b/lib/Enterprise/PluginFactory.php index a41eb01..ab1d289 100644 --- a/lib/Enterprise/PluginFactory.php +++ b/lib/Enterprise/PluginFactory.php @@ -9,9 +9,9 @@ declare(strict_types=1); * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Plugins - * INGROUP: MokoPlatform.Enterprise - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Plugins + * INGROUP: MokoCLI.Enterprise + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/PluginFactory.php * BRIEF: Plugin factory for project type detection */ @@ -23,7 +23,7 @@ namespace MokoEnterprise; * * Provides convenient methods for plugin instantiation with dependency injection * - * @package MokoPlatform\Enterprise + * @package MokoCLI\Enterprise * @version 1.0.0 */ class PluginFactory diff --git a/lib/Enterprise/PluginRegistry.php b/lib/Enterprise/PluginRegistry.php index 72812c9..9e037b3 100644 --- a/lib/Enterprise/PluginRegistry.php +++ b/lib/Enterprise/PluginRegistry.php @@ -9,9 +9,9 @@ declare(strict_types=1); * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Plugins - * INGROUP: MokoPlatform.Enterprise - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Plugins + * INGROUP: MokoCLI.Enterprise + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/PluginRegistry.php * BRIEF: Plugin registry for available project plugins */ @@ -35,7 +35,7 @@ use MokoEnterprise\Plugins\McpServerPlugin; * * Manages plugin discovery, registration, and lifecycle * - * @package MokoPlatform\Enterprise + * @package MokoCLI\Enterprise * @version 1.0.0 */ class PluginRegistry diff --git a/lib/Enterprise/Plugins/ApiPlugin.php b/lib/Enterprise/Plugins/ApiPlugin.php index 5b26bdf..bf52a6f 100644 --- a/lib/Enterprise/Plugins/ApiPlugin.php +++ b/lib/Enterprise/Plugins/ApiPlugin.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Plugins - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Plugins + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/Plugins/ApiPlugin.php * BRIEF: Enterprise plugin for API/Microservices projects */ diff --git a/lib/Enterprise/Plugins/DocumentationPlugin.php b/lib/Enterprise/Plugins/DocumentationPlugin.php index f559fbf..6529877 100644 --- a/lib/Enterprise/Plugins/DocumentationPlugin.php +++ b/lib/Enterprise/Plugins/DocumentationPlugin.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Plugins - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Plugins + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/Plugins/DocumentationPlugin.php * BRIEF: Enterprise plugin for documentation projects */ diff --git a/lib/Enterprise/Plugins/DolibarrPlugin.php b/lib/Enterprise/Plugins/DolibarrPlugin.php index b54dedd..6da6166 100644 --- a/lib/Enterprise/Plugins/DolibarrPlugin.php +++ b/lib/Enterprise/Plugins/DolibarrPlugin.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Plugins - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Plugins + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/Plugins/DolibarrPlugin.php * BRIEF: Enterprise plugin for Dolibarr modules */ diff --git a/lib/Enterprise/Plugins/GenericPlugin.php b/lib/Enterprise/Plugins/GenericPlugin.php index 5774606..6fa9d28 100644 --- a/lib/Enterprise/Plugins/GenericPlugin.php +++ b/lib/Enterprise/Plugins/GenericPlugin.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Plugins - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Plugins + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/Plugins/GenericPlugin.php * BRIEF: Enterprise plugin for generic projects */ diff --git a/lib/Enterprise/Plugins/JoomlaPlugin.php b/lib/Enterprise/Plugins/JoomlaPlugin.php index ae5a6c2..044fb79 100644 --- a/lib/Enterprise/Plugins/JoomlaPlugin.php +++ b/lib/Enterprise/Plugins/JoomlaPlugin.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Plugins - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Plugins + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/Plugins/JoomlaPlugin.php * BRIEF: Enterprise plugin for Joomla projects */ diff --git a/lib/Enterprise/Plugins/McpServerPlugin.php b/lib/Enterprise/Plugins/McpServerPlugin.php index 51c4a23..58f42f6 100644 --- a/lib/Enterprise/Plugins/McpServerPlugin.php +++ b/lib/Enterprise/Plugins/McpServerPlugin.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Plugins - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Plugins + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/Plugins/McpServerPlugin.php * BRIEF: Enterprise plugin for MCP (Model Context Protocol) server projects */ diff --git a/lib/Enterprise/Plugins/MobilePlugin.php b/lib/Enterprise/Plugins/MobilePlugin.php index e3c0e6d..8086d0e 100644 --- a/lib/Enterprise/Plugins/MobilePlugin.php +++ b/lib/Enterprise/Plugins/MobilePlugin.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Plugins - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Plugins + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/Plugins/MobilePlugin.php * BRIEF: Enterprise plugin for mobile app projects */ diff --git a/lib/Enterprise/Plugins/NodeJsPlugin.php b/lib/Enterprise/Plugins/NodeJsPlugin.php index b226d01..1756110 100644 --- a/lib/Enterprise/Plugins/NodeJsPlugin.php +++ b/lib/Enterprise/Plugins/NodeJsPlugin.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Plugins - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Plugins + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/Plugins/NodeJsPlugin.php * BRIEF: Enterprise plugin for Node.js/TypeScript projects */ diff --git a/lib/Enterprise/Plugins/PythonPlugin.php b/lib/Enterprise/Plugins/PythonPlugin.php index 9cc3995..632a991 100644 --- a/lib/Enterprise/Plugins/PythonPlugin.php +++ b/lib/Enterprise/Plugins/PythonPlugin.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Plugins - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Plugins + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/Plugins/PythonPlugin.php * BRIEF: Enterprise plugin for Python projects */ diff --git a/lib/Enterprise/Plugins/TerraformPlugin.php b/lib/Enterprise/Plugins/TerraformPlugin.php index 8a64280..d7e5db1 100644 --- a/lib/Enterprise/Plugins/TerraformPlugin.php +++ b/lib/Enterprise/Plugins/TerraformPlugin.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Plugins - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Plugins + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/Plugins/TerraformPlugin.php * BRIEF: Enterprise plugin for Terraform projects */ diff --git a/lib/Enterprise/Plugins/WordPressPlugin.php b/lib/Enterprise/Plugins/WordPressPlugin.php index 2aa8763..ebebd0e 100644 --- a/lib/Enterprise/Plugins/WordPressPlugin.php +++ b/lib/Enterprise/Plugins/WordPressPlugin.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Plugins - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Plugins + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/Plugins/WordPressPlugin.php * BRIEF: Enterprise plugin for WordPress projects */ diff --git a/lib/Enterprise/ProjectConfigValidator.php b/lib/Enterprise/ProjectConfigValidator.php index 6851e7b..0ec39c8 100644 --- a/lib/Enterprise/ProjectConfigValidator.php +++ b/lib/Enterprise/ProjectConfigValidator.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.ProjectTypes - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.ProjectTypes + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/ProjectConfigValidator.php * BRIEF: Enterprise library for validating project configurations */ diff --git a/lib/Enterprise/ProjectMetricsCollector.php b/lib/Enterprise/ProjectMetricsCollector.php index becf791..865f887 100644 --- a/lib/Enterprise/ProjectMetricsCollector.php +++ b/lib/Enterprise/ProjectMetricsCollector.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.ProjectTypes - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.ProjectTypes + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/ProjectMetricsCollector.php * BRIEF: Enterprise library for collecting project-specific metrics */ diff --git a/lib/Enterprise/ProjectPluginInterface.php b/lib/Enterprise/ProjectPluginInterface.php index 0a7f895..d5f9913 100644 --- a/lib/Enterprise/ProjectPluginInterface.php +++ b/lib/Enterprise/ProjectPluginInterface.php @@ -9,9 +9,9 @@ declare(strict_types=1); * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Plugins - * INGROUP: MokoPlatform.Enterprise - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Plugins + * INGROUP: MokoCLI.Enterprise + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/ProjectPluginInterface.php * BRIEF: Interface for project type plugins */ @@ -24,7 +24,7 @@ namespace MokoEnterprise; * Each project type (Joomla, Node.js, Python, etc.) implements this interface * to provide type-specific validation, metrics, and management capabilities. * - * @package MokoPlatform\Enterprise + * @package MokoCLI\Enterprise * @version 1.0.0 */ interface ProjectPluginInterface diff --git a/lib/Enterprise/ProjectTypeDetector.php b/lib/Enterprise/ProjectTypeDetector.php index 63c8090..2f88bbb 100644 --- a/lib/Enterprise/ProjectTypeDetector.php +++ b/lib/Enterprise/ProjectTypeDetector.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.ProjectTypes - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.ProjectTypes + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/ProjectTypeDetector.php * BRIEF: Enterprise library for detecting project types */ diff --git a/lib/Enterprise/RecoveryError.php b/lib/Enterprise/RecoveryError.php index 6effaae..973197a 100644 --- a/lib/Enterprise/RecoveryError.php +++ b/lib/Enterprise/RecoveryError.php @@ -10,15 +10,15 @@ declare(strict_types=1); * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Recovery - * INGROUP: MokoPlatform.Enterprise - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Recovery + * INGROUP: MokoCLI.Enterprise + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/RecoveryError.php * BRIEF: Recovery error exception class * - * @package MokoPlatform\Enterprise + * @package MokoCLI\Enterprise * @version 04.00.04 - * @author moko-platform Team + * @author MokoCLI Team * @license GPL-3.0-or-later */ diff --git a/lib/Enterprise/RecoveryManager.php b/lib/Enterprise/RecoveryManager.php index 5f8f03e..0056124 100644 --- a/lib/Enterprise/RecoveryManager.php +++ b/lib/Enterprise/RecoveryManager.php @@ -10,15 +10,15 @@ declare(strict_types=1); * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Recovery - * INGROUP: MokoPlatform.Enterprise - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Recovery + * INGROUP: MokoCLI.Enterprise + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/RecoveryManager.php * BRIEF: Recovery manager for failed operations * - * @package MokoPlatform\Enterprise + * @package MokoCLI\Enterprise * @version 04.00.04 - * @author moko-platform Team + * @author MokoCLI Team * @license GPL-3.0-or-later */ diff --git a/lib/Enterprise/RepositoryHealthChecker.php b/lib/Enterprise/RepositoryHealthChecker.php index a181cbb..ac7ab01 100644 --- a/lib/Enterprise/RepositoryHealthChecker.php +++ b/lib/Enterprise/RepositoryHealthChecker.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/RepositoryHealthChecker.php * BRIEF: Repository health checking enterprise library */ diff --git a/lib/Enterprise/RepositorySynchronizer.php b/lib/Enterprise/RepositorySynchronizer.php index ff3dc38..be56288 100644 --- a/lib/Enterprise/RepositorySynchronizer.php +++ b/lib/Enterprise/RepositorySynchronizer.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/RepositorySynchronizer.php * BRIEF: Repository synchronization enterprise library */ @@ -165,8 +165,8 @@ class RepositorySynchronizer // Resolve repo root (three levels up from this file: Enterprise/ → lib/ → root) // API repo root (definitions, sync code) $repoRoot = dirname(dirname(__DIR__)); - // moko-platform repo root (templates, configs) - $standardsRoot = getenv('MOKOSTANDARDS_ROOT') ?: dirname($repoRoot) . '/moko-platform'; + // MokoCLI repo root (templates, configs) + $standardsRoot = getenv('MOKOSTANDARDS_ROOT') ?: dirname($repoRoot) . '/MokoCLI'; // Detect platform from repo metadata $repoInfo = $this->adapter->getRepo($org, $repo); @@ -364,7 +364,7 @@ class RepositorySynchronizer * @param string $repo * @param string $platform Detected platform slug (e.g. 'dolibarr') * @param array $filesToSync - * @param string $repoRoot Absolute path to the moko-platform repository root + * @param string $repoRoot Absolute path to the MokoCLI repository root * @param bool $force When true, overwrite files even when always_overwrite = false * @return array{number: ?int, summary: array} */ @@ -421,7 +421,7 @@ class RepositorySynchronizer // Create tracking issue (no PR — files pushed directly to default branch) $issueBody = $this->generatePRBody($summary); - $issueTitle = 'chore: moko-platform v' . self::STANDARDS_MINOR . ' sync — ' . count($summary['copied']) . ' files updated'; + $issueTitle = 'chore: MokoCLI v' . self::STANDARDS_MINOR . ' sync — ' . count($summary['copied']) . ' files updated'; $issueNumber = null; try { @@ -478,7 +478,7 @@ class RepositorySynchronizer * never added. * * @param string $existing Current file content from the remote repo - * @param string $template Template file content from moko-platform + * @param string $template Template file content from MokoCLI * @return string Merged content */ /** @@ -501,7 +501,7 @@ class RepositorySynchronizer * @param string $repo Repository name * @param string $platform Detected platform type * @param array $filesToSync Files to synchronize - * @param string $repoRoot Path to moko-platform root + * @param string $repoRoot Path to MokoCLI root * @param bool $force Force overwrite * @param string $branchName Target branch * @param string|null $moduleId Dolibarr module ID (pre-fetched) @@ -583,7 +583,7 @@ class RepositorySynchronizer $repo, $targetPath, $content, - "chore: update {$targetPath} from moko-platform", + "chore: update {$targetPath} from MokoCLI", $existingFile['sha'] ?? null, $branchName ); @@ -597,7 +597,7 @@ class RepositorySynchronizer $repo, $targetPath, $content, - "chore: add {$targetPath} from moko-platform", + "chore: add {$targetPath} from MokoCLI", null, $branchName ); @@ -613,7 +613,7 @@ class RepositorySynchronizer $repo, $targetPath, $content, - "chore: update {$targetPath} from moko-platform", + "chore: update {$targetPath} from MokoCLI", $existing['sha'] ?? null, $branchName ); @@ -782,7 +782,7 @@ class RepositorySynchronizer 'license' => 'GPL-3.0-or-later', 'topics' => $repoInfo['topics'] ?? [], 'language' => $repoInfo['language'] ?? MokoStandardsParser::platformLanguage($platform), - 'package_type' => moko-platformParser::platformPackageType($platform), + 'package_type' => MokoCLIParser::platformPackageType($platform), 'last_synced' => date('c'), ]; @@ -1110,7 +1110,7 @@ class RepositorySynchronizer // so repos have a safe place for custom workflows that sync won't touch. $entries[] = [ 'inline_content' => "# Custom Workflows\n\nPlace repo-specific workflows here.\n\n" - . "- **Never overwritten** by moko-platform bulk sync\n" + . "- **Never overwritten** by MokoCLI bulk sync\n" . "- **Never deleted** by the repository-cleanup workflow\n" . "- Safe for custom CI, notifications, or repo-specific automation\n\n" . "Synced workflows live in the parent `{$wfDir}/` directory.\n", @@ -1261,7 +1261,7 @@ class RepositorySynchronizer // Append missing lines with a clear separator $merged = rtrim($existing) . "\n\n" - . "# ── moko-platform sync (auto-appended) ────────────────────────────────\n" + . "# ── MokoCLI sync (auto-appended) ────────────────────────────────\n" . implode("\n", $missing) . "\n"; return $merged; @@ -1313,7 +1313,7 @@ class RepositorySynchronizer '{{standards_version}}' => self::STANDARDS_VERSION, '{{standards_minor}}' => self::STANDARDS_MINOR, '{{standards_branch}}' => self::VERSION_BRANCH, - // Single-brace tokens — used by GitHub repository templates and older moko-platform stubs + // Single-brace tokens — used by GitHub repository templates and older MokoCLI stubs '{REPO_NAME}' => $repoInfo['name'] ?? $repo, '{REPO_URL}' => "https://github.com/{$org}/{$repo}", '{REPO_DESCRIPTION}' => $repoInfo['description'] ?? '', @@ -1383,8 +1383,8 @@ class RepositorySynchronizer */ private function generatePRBody(array $summary): string { - $body = "## moko-platform Synchronization\n\n"; - $body .= "This PR synchronizes workflows, configurations, and scripts from the moko-platform repository.\n\n"; + $body = "## MokoCLI Synchronization\n\n"; + $body .= "This PR synchronizes workflows, configurations, and scripts from the MokoCLI repository.\n\n"; // Summary statistics $body .= "### Summary\n"; @@ -1419,7 +1419,7 @@ class RepositorySynchronizer $body .= "- Verify issue templates render correctly\n\n"; $body .= "---\n"; - $body .= "*This PR was automatically generated by the moko-platform bulk sync process.*\n"; + $body .= "*This PR was automatically generated by the MokoCLI bulk sync process.*\n"; return $body; } @@ -1524,7 +1524,7 @@ class RepositorySynchronizer default => 'EDEDED', }, match ($label) { - 'mokostandards' => 'moko-platform compliance', + 'mokostandards' => 'MokoCLI compliance', 'type: chore' => 'Maintenance tasks', 'automation' => 'Automated processes or scripts', default => '', diff --git a/lib/Enterprise/RetryHelper.php b/lib/Enterprise/RetryHelper.php index 84810b2..46fb2e6 100644 --- a/lib/Enterprise/RetryHelper.php +++ b/lib/Enterprise/RetryHelper.php @@ -10,15 +10,15 @@ declare(strict_types=1); * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Recovery - * INGROUP: MokoPlatform.Enterprise - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Recovery + * INGROUP: MokoCLI.Enterprise + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/RetryHelper.php * BRIEF: Retry helper with exponential backoff * - * @package MokoPlatform\Enterprise + * @package MokoCLI\Enterprise * @version 04.00.04 - * @author moko-platform Team + * @author MokoCLI Team * @license GPL-3.0-or-later */ diff --git a/lib/Enterprise/SecurityValidator.php b/lib/Enterprise/SecurityValidator.php index 3926cb7..a7a23a2 100644 --- a/lib/Enterprise/SecurityValidator.php +++ b/lib/Enterprise/SecurityValidator.php @@ -9,15 +9,15 @@ declare(strict_types=1); * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Security - * INGROUP: MokoPlatform.Enterprise - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Security + * INGROUP: MokoCLI.Enterprise + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/SecurityValidator.php * BRIEF: Security validation library */ /** - * Security Validator for moko-platform + * Security Validator for MokoCLI * * Provides security scanning and validation: * - Credential detection in code/config files @@ -45,9 +45,9 @@ declare(strict_types=1); * * SPDX-License-Identifier: GPL-3.0-or-later * - * @package MokoPlatform\Enterprise + * @package MokoCLI\Enterprise * @version 04.00.04 - * @author moko-platform Team + * @author MokoCLI Team * @license GPL-3.0-or-later */ diff --git a/lib/Enterprise/SourceResolver.php b/lib/Enterprise/SourceResolver.php index c94d111..ac843e2 100644 --- a/lib/Enterprise/SourceResolver.php +++ b/lib/Enterprise/SourceResolver.php @@ -7,9 +7,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise - * INGROUP: MokoPlatform.Lib - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise + * INGROUP: MokoCLI.Lib + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/SourceResolver.php * BRIEF: Resolve the root-level source directory across repos (source/, src/, htdocs/) */ diff --git a/lib/Enterprise/SynchronizationException.php b/lib/Enterprise/SynchronizationException.php index 2761b38..6387da7 100644 --- a/lib/Enterprise/SynchronizationException.php +++ b/lib/Enterprise/SynchronizationException.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/SynchronizationException.php * BRIEF: Custom exception for repository synchronization errors */ diff --git a/lib/Enterprise/TransactionManager.php b/lib/Enterprise/TransactionManager.php index 093ca6c..798e676 100644 --- a/lib/Enterprise/TransactionManager.php +++ b/lib/Enterprise/TransactionManager.php @@ -9,15 +9,15 @@ declare(strict_types=1); * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Transaction - * INGROUP: MokoPlatform.Enterprise - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Transaction + * INGROUP: MokoCLI.Enterprise + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/TransactionManager.php * BRIEF: Transaction manager for atomic operations */ /** - * Transaction Manager for moko-platform + * Transaction Manager for MokoCLI * * Provides atomic multi-step operations with automatic rollback: * - Transaction boundaries for ACID operations @@ -52,9 +52,9 @@ declare(strict_types=1); * * SPDX-License-Identifier: GPL-3.0-or-later * - * @package MokoPlatform\Enterprise + * @package MokoCLI\Enterprise * @version 04.00.04 - * @author moko-platform Team + * @author MokoCLI Team * @license GPL-3.0-or-later */ diff --git a/lib/Enterprise/UnifiedValidation.php b/lib/Enterprise/UnifiedValidation.php index f159bb2..af623a1 100644 --- a/lib/Enterprise/UnifiedValidation.php +++ b/lib/Enterprise/UnifiedValidation.php @@ -9,15 +9,15 @@ declare(strict_types=1); * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Enterprise.Validation - * INGROUP: MokoPlatform.Enterprise - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Enterprise.Validation + * INGROUP: MokoCLI.Enterprise + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/Enterprise/UnifiedValidation.php * BRIEF: Unified validation framework */ /** - * Unified Validation Framework for moko-platform + * Unified Validation Framework for MokoCLI * * Consolidates all validation logic into a single framework with plugins. * Replaces 12+ individual validator scripts with a unified approach. @@ -51,9 +51,9 @@ declare(strict_types=1); * * SPDX-License-Identifier: GPL-3.0-or-later * - * @package MokoPlatform\Enterprise + * @package MokoCLI\Enterprise * @version 04.00.04 - * @author moko-platform Team + * @author MokoCLI Team * @license GPL-3.0-or-later */ diff --git a/lib/index.md b/lib/index.md index 0feff20..53019e6 100644 --- a/lib/index.md +++ b/lib/index.md @@ -2,9 +2,9 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Index -INGROUP: MokoPlatform.Lib -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Index +INGROUP: MokoCLI.Lib +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /lib/index.md BRIEF: Library directory index --> diff --git a/lib/plugins/Joomla/UpdateXmlGenerator.php b/lib/plugins/Joomla/UpdateXmlGenerator.php index 12cfada..b697bc4 100644 --- a/lib/plugins/Joomla/UpdateXmlGenerator.php +++ b/lib/plugins/Joomla/UpdateXmlGenerator.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Joomla - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Joomla + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /lib/plugins/Joomla/UpdateXmlGenerator.php * BRIEF: Generates and updates Joomla extension updates.xml files */ diff --git a/maintenance/index.md b/maintenance/index.md index 17da4a4..89cd2b0 100644 --- a/maintenance/index.md +++ b/maintenance/index.md @@ -2,9 +2,9 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Index -INGROUP: MokoPlatform.Maintenance -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Index +INGROUP: MokoCLI.Maintenance +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /maintenance/index.md BRIEF: Maintenance directory index --> diff --git a/maintenance/pin_action_shas.php b/maintenance/pin_action_shas.php index dbee8a8..9441f4f 100644 --- a/maintenance/pin_action_shas.php +++ b/maintenance/pin_action_shas.php @@ -9,9 +9,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Scripts.Maintenance - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Scripts.Maintenance + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /maintenance/pin_action_shas.php * BRIEF: Pin GitHub Actions to immutable commit SHAs in workflow files * NOTE: Resolves tag/branch refs to commit SHAs via the GitHub API to satisfy diff --git a/maintenance/repo_inventory.php b/maintenance/repo_inventory.php index 73352bd..982e27f 100644 --- a/maintenance/repo_inventory.php +++ b/maintenance/repo_inventory.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Maintenance - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Maintenance + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /maintenance/repo_inventory.php * BRIEF: Generate a live inventory dashboard of all governed repos as a GitHub issue */ @@ -26,7 +26,7 @@ class RepoInventoryCli extends CliFramework private $api = null; private string $token = ''; private $platformConfig = null; - private const ALWAYS_EXCLUDE = ['moko-platform', '.github-private']; + private const ALWAYS_EXCLUDE = ['MokoCLI', '.github-private']; protected function configure(): void { @@ -161,7 +161,7 @@ class RepoInventoryCli extends CliFramework if (!$this->dryRun) { $title = "dashboard: repository inventory ({$org})"; - $issueQuery = "repos/{$org}/moko-platform/issues" + $issueQuery = "repos/{$org}/MokoCLI/issues" . "?labels=inventory&state=all&per_page=1" . "&sort=created&direction=desc"; [$_, $existing] = $this->ghApi('GET', $issueQuery, null); @@ -169,7 +169,7 @@ class RepoInventoryCli extends CliFramework $num = $existing[0]['number']; $this->ghApi( 'PATCH', - "repos/{$org}/moko-platform/issues/{$num}", + "repos/{$org}/MokoCLI/issues/{$num}", [ 'title' => $title, 'body' => $body, @@ -181,7 +181,7 @@ class RepoInventoryCli extends CliFramework } else { [$_, $issue] = $this->ghApi( 'POST', - "repos/{$org}/moko-platform/issues", + "repos/{$org}/MokoCLI/issues", [ 'title' => $title, 'body' => $body, @@ -226,7 +226,7 @@ class RepoInventoryCli extends CliFramework CURLOPT_HTTPHEADER => [ 'Authorization: bearer ' . $this->token, 'Content-Type: application/json', - 'User-Agent: moko-platform-Inventory', + 'User-Agent: MokoCLI-Inventory', ], ]); $body = (string) curl_exec($ch); diff --git a/maintenance/rotate_secrets.php b/maintenance/rotate_secrets.php index e145955..1d3050d 100644 --- a/maintenance/rotate_secrets.php +++ b/maintenance/rotate_secrets.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Maintenance - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Maintenance + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /maintenance/rotate_secrets.php * BRIEF: Audit FTP secrets and variables across all governed repos -- report missing or stale */ @@ -25,7 +25,7 @@ class RotateSecretsCli extends CliFramework { private $api = null; private string $token = ''; - private const ALWAYS_EXCLUDE = ['moko-platform', '.github-private']; + private const ALWAYS_EXCLUDE = ['MokoCLI', '.github-private']; private const ENVS = [ 'DEV' => [ 'vars' => ['DEV_FTP_HOST', 'DEV_FTP_PATH', 'DEV_FTP_USERNAME', 'DEV_FTP_SUFFIX'], @@ -186,7 +186,7 @@ class RotateSecretsCli extends CliFramework . "| Repository | Issue |\n|---|---|\n" . "{$table}\n\n---\n" . "*Auto-created by `rotate_secrets.php`*\n"; - $auditQuery = "repos/{$org}/moko-platform/issues" + $auditQuery = "repos/{$org}/MokoCLI/issues" . "?labels=secret-audit&state=all" . "&per_page=1&sort=created&direction=desc"; [$_, $existing] = $this->ghApi('GET', $auditQuery, null); @@ -196,7 +196,7 @@ class RotateSecretsCli extends CliFramework $num = $existing[0]['number']; $this->ghApi( 'PATCH', - "repos/{$org}/moko-platform/issues/{$num}", + "repos/{$org}/MokoCLI/issues/{$num}", [ 'title' => $auditTitle, 'body' => $body, @@ -210,7 +210,7 @@ class RotateSecretsCli extends CliFramework } else { [$_, $issue] = $this->ghApi( 'POST', - "repos/{$org}/moko-platform/issues", + "repos/{$org}/MokoCLI/issues", [ 'title' => $auditTitle, 'body' => $body, diff --git a/maintenance/setup_labels.php b/maintenance/setup_labels.php index e2a131e..5a5b61d 100644 --- a/maintenance/setup_labels.php +++ b/maintenance/setup_labels.php @@ -3,18 +3,18 @@ /* Copyright (C) 2026 Moko Consulting * - * REQUIRED FILE: This file must be present in all moko-platform-compliant repositories + * REQUIRED FILE: This file must be present in all MokoCLI-compliant repositories * * This file is part of a Moko Consulting project. * * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Scripts.Maintenance - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Scripts.Maintenance + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /maintenance/setup_labels.php - * BRIEF: REQUIRED label deployment script for all moko-platform-governed repositories + * BRIEF: REQUIRED label deployment script for all MokoCLI-governed repositories */ declare(strict_types=1); @@ -27,7 +27,7 @@ use MokoEnterprise\GitPlatformAdapter; use MokoEnterprise\PlatformAdapterFactory; /** - * Deploys the standard set of repository labels required by moko-platform. + * Deploys the standard set of repository labels required by MokoCLI. * * Uses the platform adapter (GitHub or Gitea) to create or update each label. * Supports --dry-run mode to preview without making changes. @@ -66,7 +66,7 @@ class SetupLabels extends CliFramework // Workflow / Process ['automation', '8B4513', 'Automated processes or scripts'], - ['moko-platform', 'B60205', 'moko-platform compliance'], + ['MokoCLI', 'B60205', 'MokoCLI compliance'], ['needs-review', 'FBCA04', 'Awaiting code review'], ['work-in-progress', 'D93F0B', 'Work in progress, not ready for merge'], ['breaking-change', 'D73A4A', 'Breaking API or functionality change'], @@ -106,8 +106,8 @@ class SetupLabels extends CliFramework ['health: poor', 'FF6B6B', 'Health score below 50'], // Sync / Automation - ['standards-update', 'B60205', 'moko-platform sync update'], - ['standards-drift', 'FBCA04', 'Repository drifted from moko-platform'], + ['standards-update', 'B60205', 'MokoCLI sync update'], + ['standards-drift', 'FBCA04', 'Repository drifted from MokoCLI'], ['sync-report', '0075CA', 'Bulk sync run report'], ['sync-failure', 'D73A4A', 'Bulk sync failure requiring attention'], ['push-failure', 'D73A4A', 'File push failure requiring attention'], diff --git a/maintenance/sync_dolibarr_readmes.php b/maintenance/sync_dolibarr_readmes.php index 12565dc..8e97585 100644 --- a/maintenance/sync_dolibarr_readmes.php +++ b/maintenance/sync_dolibarr_readmes.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Scripts.Maintenance - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Scripts.Maintenance + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /maintenance/sync_dolibarr_readmes.php * BRIEF: Keeps root README.md and src/README.md in sync for Dolibarr module repositories * NOTE: Version format is zero-padded semver: XX.YY.ZZ (e.g. 04.00.04). All version regex @@ -77,8 +77,8 @@ class SyncDolibarrReadmes extends CliFramework $moduleName = $this->extractModuleName($rootContent, $repoRoot); $repoUrl = $this->extractField($rootContent, 'REPO', 'https://git.mokoconsulting.tech/MokoConsulting'); - $defgroup = $this->extractField($rootContent, 'DEFGROUP', 'MokoPlatform.Module'); - $ingroup = $this->extractField($rootContent, 'INGROUP', 'moko-platform'); + $defgroup = $this->extractField($rootContent, 'DEFGROUP', 'MokoCLI.Module'); + $ingroup = $this->extractField($rootContent, 'INGROUP', 'MokoCLI'); $brief = $this->extractField($rootContent, 'BRIEF', "{$moduleName} end-user documentation"); $installSection = $this->extractSection($rootContent, 'Installation'); @@ -272,7 +272,7 @@ NOTE: This file is auto-generated by sync_dolibarr_readmes.php from root README. Last synced: {$today} --> -[![moko-platform](https://img.shields.io/badge/moko--platform-{$version}-blue)]({$repoUrl}) +[![MokoCLI](https://img.shields.io/badge/moko--platform-{$version}-blue)]({$repoUrl}) # {$moduleName} diff --git a/maintenance/update_repo_inventory.php b/maintenance/update_repo_inventory.php index ae53df6..5a592f2 100644 --- a/maintenance/update_repo_inventory.php +++ b/maintenance/update_repo_inventory.php @@ -9,9 +9,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Scripts.Maintenance - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Scripts.Maintenance + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /maintenance/update_repo_inventory.php * BRIEF: Queries GitHub org repos and rewrites the auto-generated section of REPOSITORY_INVENTORY.md */ @@ -205,7 +205,7 @@ class UpdateRepoInventory extends CliFramework $lower = strtolower($name); - if (in_array('mokostandards-core', $topics, true) || $name === 'moko-platform' || $name === '.github-private') { + if (in_array('mokostandards-core', $topics, true) || $name === 'MokoCLI' || $name === '.github-private') { $groups['core'][] = $repo; } elseif ( in_array('dolibarr-module', $topics, true) diff --git a/maintenance/update_sha_hashes.php b/maintenance/update_sha_hashes.php index fc68a9b..9b6223c 100755 --- a/maintenance/update_sha_hashes.php +++ b/maintenance/update_sha_hashes.php @@ -9,9 +9,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Scripts.Maintenance - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Scripts.Maintenance + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /maintenance/update_sha_hashes.php * BRIEF: Update SHA-256 hashes in script registry */ diff --git a/maintenance/update_version_from_readme.php b/maintenance/update_version_from_readme.php index 469f7c0..9ad3fd9 100644 --- a/maintenance/update_version_from_readme.php +++ b/maintenance/update_version_from_readme.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Scripts.Maintenance - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Scripts.Maintenance + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /maintenance/update_version_from_readme.php * BRIEF: Reads VERSION from README.md FILE INFORMATION block and propagates it to all badges and FILE INFORMATION headers * NOTE: README.md is the single source of truth for the repository version. @@ -29,7 +29,7 @@ use MokoEnterprise\{ApiClient, AuditLogger, CliFramework}; * badge and FILE INFORMATION VERSION field in the repository. * * Sources updated: - * - Markdown badge: [![moko-platform](https://img.shields.io/badge/moko--platform-OLD-blue)] + * - Markdown badge: [![MokoCLI](https://img.shields.io/badge/moko--platform-OLD-blue)] * - Markdown header: VERSION: OLD (inside comment blocks) * - PHP header: * VERSION: OLD (inside block comments) * - YAML/Shell header:# VERSION: OLD @@ -220,7 +220,7 @@ class UpdateVersionFromReadme extends CliFramework $updated = $original; // ── Badge replacement (all file types) ─────────────────────────── - // shields.io badge: [![moko-platform](...badge/moko--platform-XX.YY.ZZ-color)] + // shields.io badge: [![MokoCLI](...badge/moko--platform-XX.YY.ZZ-color)] $updated = preg_replace( '/(\[!\[MokoStandards\]\(https:\/\/img\.shields\.io\/badge\/MokoStandards-)[0-9]{2}\.[0-9]{2}\.[0-9]{2}(-[a-z]+\)\])/', '${1}' . $version . '${2}', diff --git a/mcp/config.example.json b/mcp/config.example.json index 82769cf..339f5a1 100644 --- a/mcp/config.example.json +++ b/mcp/config.example.json @@ -1,6 +1,6 @@ { - "apiPath": "A:/moko-platform", - "standardsPath": "A:/moko-platform", + "apiPath": "A:/mokocli", + "standardsPath": "A:/mokocli", "giteaUrl": "https://git.mokoconsulting.tech", "giteaToken": "your-gitea-api-token" } diff --git a/mcp/package.json b/mcp/package.json index 4bdc885..9f896d1 100644 --- a/mcp/package.json +++ b/mcp/package.json @@ -1,11 +1,12 @@ { - "name": "@mokoconsulting/moko-platform-mcp", + "name": "@mokoconsulting/mokocli-mcp", "version": "1.0.0", - "description": "MCP server for moko-platform governance — validation, compliance, platform detection, definitions browser", + "description": "MCP server for MokoCLI governance — validation, compliance, platform detection, definitions browser", "type": "module", "main": "dist/index.js", "bin": { - "moko-platform-mcp": "dist/index.js" + "moko-platform-mcp": "dist/index.js", + "mokocli-mcp": "dist/index.js" }, "scripts": { "build": "tsc", diff --git a/mcp/src/config.ts b/mcp/src/config.ts index 5f399a4..2e932ae 100644 --- a/mcp/src/config.ts +++ b/mcp/src/config.ts @@ -7,7 +7,7 @@ * FILE INFORMATION * DEFGROUP: mokostandards-mcp.Config * INGROUP: MokoStandards-API - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /mcp/src/config.ts * BRIEF: Configuration loader for MokoStandards MCP server */ diff --git a/mcp/src/index.ts b/mcp/src/index.ts index 78006a8..0ddb18e 100644 --- a/mcp/src/index.ts +++ b/mcp/src/index.ts @@ -8,7 +8,7 @@ * FILE INFORMATION * DEFGROUP: mokostandards-mcp.Server * INGROUP: MokoStandards-API - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /mcp/src/index.ts * BRIEF: MCP server entry point — exposes MokoStandards governance tools */ diff --git a/mcp/src/runner.ts b/mcp/src/runner.ts index 1dab7ab..cec01bb 100644 --- a/mcp/src/runner.ts +++ b/mcp/src/runner.ts @@ -7,7 +7,7 @@ * FILE INFORMATION * DEFGROUP: mokostandards-mcp.Runner * INGROUP: MokoStandards-API - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /mcp/src/runner.ts * BRIEF: PHP CLI command runner for MokoStandards tools — uses execFile (no shell injection) */ diff --git a/mcp/src/types.ts b/mcp/src/types.ts index 06229c0..589e007 100644 --- a/mcp/src/types.ts +++ b/mcp/src/types.ts @@ -7,7 +7,7 @@ * FILE INFORMATION * DEFGROUP: mokostandards-mcp.Types * INGROUP: MokoStandards-API - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /mcp/src/types.ts * BRIEF: TypeScript type definitions for MokoStandards MCP server */ diff --git a/phpcs.xml b/phpcs.xml index be6b24c..010b763 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -6,8 +6,8 @@ This file is part of a Moko Consulting project. SPDX-License-Identifier: GPL-3.0-or-later --> - - PHP_CodeSniffer configuration for moko-platform projects + + PHP_CodeSniffer configuration for MokoCLI projects lib diff --git a/plugin_health_check.php b/plugin_health_check.php index 7bedb76..b016ff7 100755 --- a/plugin_health_check.php +++ b/plugin_health_check.php @@ -7,9 +7,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Scripts.Plugin - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Scripts.Plugin + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /plugin_health_check.php * BRIEF: Run health checks on a project using the auto-detected or specified plugin */ diff --git a/plugin_list.php b/plugin_list.php index 4f55a51..0f397b4 100755 --- a/plugin_list.php +++ b/plugin_list.php @@ -7,9 +7,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Scripts.Plugin - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Scripts.Plugin + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /plugin_list.php * BRIEF: List all available project-type plugins and their capabilities */ diff --git a/plugin_metrics.php b/plugin_metrics.php index 63214a5..28ecf45 100755 --- a/plugin_metrics.php +++ b/plugin_metrics.php @@ -7,9 +7,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Scripts.Plugin - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Scripts.Plugin + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /plugin_metrics.php * BRIEF: Collect project metrics using the auto-detected or specified plugin */ diff --git a/plugin_readiness.php b/plugin_readiness.php index ee55eb9..d6d662d 100755 --- a/plugin_readiness.php +++ b/plugin_readiness.php @@ -7,9 +7,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Scripts.Plugin - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Scripts.Plugin + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /plugin_readiness.php * BRIEF: Check release readiness of a project using the auto-detected or specified plugin */ diff --git a/plugin_validate.php b/plugin_validate.php index 24bd666..ac6f3f8 100755 --- a/plugin_validate.php +++ b/plugin_validate.php @@ -7,9 +7,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Scripts.Plugin - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Scripts.Plugin + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /plugin_validate.php * BRIEF: Validate a project's structure and standards using the auto-detected or specified plugin */ diff --git a/release/generate_dolibarr_version_txt.php b/release/generate_dolibarr_version_txt.php index fa5efbb..a801e18 100644 --- a/release/generate_dolibarr_version_txt.php +++ b/release/generate_dolibarr_version_txt.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Release - * INGROUP: MokoPlatform.Scripts - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Release + * INGROUP: MokoCLI.Scripts + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /release/generate_dolibarr_version_txt.php * BRIEF: Create or update version.txt on Dolibarr module release * diff --git a/release/generate_joomla_update_xml.php b/release/generate_joomla_update_xml.php index 59e834c..055468e 100644 --- a/release/generate_joomla_update_xml.php +++ b/release/generate_joomla_update_xml.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Release - * INGROUP: MokoPlatform.Scripts - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Release + * INGROUP: MokoCLI.Scripts + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /release/generate_joomla_update_xml.php * BRIEF: Create or update the in updates.xml on release * @@ -35,7 +35,7 @@ * [--zip-url=https://github.com/org/repo/releases/download/v1.2.0/mod_foo-1.2.0.zip] \ * [--inject-updateserver] * - * Usage (remote — from moko-platform): + * Usage (remote — from MokoCLI): * php generate_joomla_update_xml.php \ * --repo=mokoconsulting-tech/WaasComponent \ * --tag=v1.2.0 \ diff --git a/scripts/setup-mokocli-aliases.sh b/scripts/setup-mokocli-aliases.sh new file mode 100644 index 0000000..25eb942 --- /dev/null +++ b/scripts/setup-mokocli-aliases.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +# MokoCLI — Runner path aliases +# +# Creates symlinks so that both /opt/mokocli and /opt/mokoplatform resolve, +# and both /tmp/mokocli and /tmp/mokoplatform-api resolve. +# +# Run this on CI runners during provisioning or as a workflow step. +# +# Usage: +# sudo bash scripts/setup-mokocli-aliases.sh +# +# Copyright (C) 2026 Moko Consulting +# SPDX-License-Identifier: GPL-3.0-or-later + +set -euo pipefail + +# ── /opt paths (persistent runner installs) ────────────────────────── + +if [ -d "/opt/mokoplatform" ] && [ ! -e "/opt/mokocli" ]; then + ln -s /opt/mokoplatform /opt/mokocli + echo "[mokocli-aliases] Created symlink /opt/mokocli -> /opt/mokoplatform" +elif [ -d "/opt/mokocli" ] && [ ! -e "/opt/mokoplatform" ]; then + ln -s /opt/mokocli /opt/mokoplatform + echo "[mokocli-aliases] Created symlink /opt/mokoplatform -> /opt/mokocli" +elif [ -d "/opt/mokocli" ] && [ -d "/opt/mokoplatform" ]; then + echo "[mokocli-aliases] WARNING: Both /opt/mokocli and /opt/mokoplatform exist independently." + echo "[mokocli-aliases] This may cause version mismatches. Consider removing one." +else + echo "[mokocli-aliases] WARNING: Neither /opt/mokocli nor /opt/mokoplatform found." + echo "[mokocli-aliases] MokoCLI does not appear to be installed on this runner." +fi + +# ── /tmp paths (ephemeral CI clones) ───────────────────────────────── + +if [ -d "/tmp/mokoplatform-api" ] && [ -d "/tmp/mokocli" ]; then + echo "[mokocli-aliases] WARNING: Both /tmp/mokocli and /tmp/mokoplatform-api exist independently." +elif [ -d "/tmp/mokoplatform-api" ] && [ ! -e "/tmp/mokocli" ]; then + ln -s /tmp/mokoplatform-api /tmp/mokocli + echo "[mokocli-aliases] Created symlink /tmp/mokocli -> /tmp/mokoplatform-api" +elif [ -d "/tmp/mokocli" ] && [ ! -e "/tmp/mokoplatform-api" ]; then + ln -s /tmp/mokocli /tmp/mokoplatform-api + echo "[mokocli-aliases] Created symlink /tmp/mokoplatform-api -> /tmp/mokocli" +fi + +echo "[mokocli-aliases] Done." diff --git a/scripts/sync-wikis-to-github.sh b/scripts/sync-wikis-to-github.sh index 1d45498..ba33e13 100644 --- a/scripts/sync-wikis-to-github.sh +++ b/scripts/sync-wikis-to-github.sh @@ -7,7 +7,7 @@ # Structure: # wiki/ # README.md -# moko-platform/ +# MokoCLI/ # Home.md # SITE_MONITORING.md # ... @@ -70,7 +70,7 @@ for r in repos: else # Fallback to hardcoded list REPOS=( - ["MokoConsulting/moko-platform"]="moko-platform" + ["MokoConsulting/MokoCLI"]="MokoCLI" ["MokoConsulting/MokoOnyx"]="MokoOnyx" ["MokoConsulting/MokoWaaS"]="MokoWaaS" ["MokoConsulting/monitor-mcp"]="monitor-mcp" diff --git a/src/aliases.php b/src/aliases.php new file mode 100644 index 0000000..3e7a71b --- /dev/null +++ b/src/aliases.php @@ -0,0 +1,126 @@ + + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + * FILE INFORMATION + * DEFGROUP: MokoCLI.Common + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli + * PATH: /src/aliases.php + * BRIEF: Forward/backward aliases for the mokoplatform -> MokoCLI rename + * + * This file provides function aliases so that both old and new names work + * during the transition period. It is auto-loaded via composer.json. + * + * @package MokoCLI + */ + +declare(strict_types=1); + +// Ensure core functions are available (loaded by composer.json "files") +if (!function_exists('mokostandards_version') || !function_exists('mokostandards_root_dir')) { + require_once __DIR__ . '/functions.php'; +} + +// ───────────────────────────────────────────────────────────────────── +// Deprecation helper +// ───────────────────────────────────────────────────────────────────── + +if (!function_exists('_mokocli_deprecation_notice')) { + /** + * Emit a deprecation notice for renamed identifiers. + * + * Uses E_USER_DEPRECATED so it appears in logs when error reporting + * includes deprecations. Does not interrupt execution. + */ + function _mokocli_deprecation_notice(string $old, string $new): void + { + trigger_error( + sprintf( + '[MokoCLI] "%s" is deprecated and will be removed in a future release. Use "%s" instead.', + $old, + $new + ), + E_USER_DEPRECATED + ); + } +} + +// ───────────────────────────────────────────────────────────────────── +// Forward aliases: new MokoCLI names → existing implementations +// These let code start using the new names immediately. +// ───────────────────────────────────────────────────────────────────── + +if (!function_exists('mokocli_version')) { + /** + * Get the MokoCLI version (alias for mokostandards_version). + */ + function mokocli_version(): string + { + return mokostandards_version(); + } +} + +if (!function_exists('mokocli_root_dir')) { + /** + * Get the MokoCLI root directory (alias for mokostandards_root_dir). + */ + function mokocli_root_dir(): string + { + return mokostandards_root_dir(); + } +} + +// ───────────────────────────────────────────────────────────────────── +// Backward aliases: old names emit deprecation then delegate +// These keep old code working but warn about the rename. +// ───────────────────────────────────────────────────────────────────── + +if (!function_exists('mokoplatform_version')) { + function mokoplatform_version(): string + { + _mokocli_deprecation_notice('mokoplatform_version()', 'mokocli_version()'); + return mokostandards_version(); + } +} + +if (!function_exists('mokoplatform_root_dir')) { + function mokoplatform_root_dir(): string + { + _mokocli_deprecation_notice('mokoplatform_root_dir()', 'mokocli_root_dir()'); + return mokostandards_root_dir(); + } +} + +// ───────────────────────────────────────────────────────────────────── +// Path resolution: accept both /opt/mokocli and /opt/mokoplatform +// ───────────────────────────────────────────────────────────────────── + +if (!function_exists('mokocli_resolve_install_path')) { + /** + * Resolve the MokoCLI install path, checking both new and legacy locations. + * + * @return string|null The resolved path, or null if not found + */ + function mokocli_resolve_install_path(): ?string + { + if (is_dir('/opt/mokocli')) { + return '/opt/mokocli'; + } + if (is_dir('/opt/mokoplatform')) { + _mokocli_deprecation_notice('/opt/mokoplatform', '/opt/mokocli'); + return '/opt/mokoplatform'; + } + + trigger_error( + '[MokoCLI] Install path not found. Checked /opt/mokocli and /opt/mokoplatform. ' + . 'Ensure MokoCLI is installed or run scripts/setup-mokocli-aliases.sh.', + E_USER_NOTICE + ); + return null; + } +} diff --git a/src/functions.php b/src/functions.php index 62d05c9..e6e80ac 100644 --- a/src/functions.php +++ b/src/functions.php @@ -1,21 +1,21 @@ * * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Common - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Common + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /src/functions.php * BRIEF: Common utility functions * - * This file provides global helper functions for moko-platform. + * This file provides global helper functions for MokoCLI. * - * @package MokoPlatform + * @package MokoCLI * @version 04.00.04 */ @@ -23,7 +23,7 @@ declare(strict_types=1); if (!function_exists('mokostandards_version')) { /** - * Get the moko-platform version + * Get the MokoCLI version * * @return string Version number */ @@ -35,7 +35,7 @@ if (!function_exists('mokostandards_version')) { if (!function_exists('mokostandards_root_dir')) { /** - * Get the moko-platform root directory + * Get the MokoCLI root directory * * @return string Root directory path */ diff --git a/templates/configs/README.md b/templates/configs/README.md index 1a0aef2..9476261 100644 --- a/templates/configs/README.md +++ b/templates/configs/README.md @@ -6,16 +6,16 @@ This file is part of a Moko Consulting project. SPDX-License-Identifier: GPL-3.0-or-later # FILE INFORMATION -DEFGROUP: MokoPlatform.Templates -INGROUP: MokoPlatform -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Templates +INGROUP: MokoCLI +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/configs/README.md BRIEF: Code quality and security tool configuration templates --> # Code Quality Configuration Templates -This directory contains standardized configuration files for code quality, linting, and security tools used across moko-platform projects. +This directory contains standardized configuration files for code quality, linting, and security tools used across MokoCLI projects. ## Available Configurations @@ -296,9 +296,9 @@ These tools work seamlessly with: ## Support and Updates -Configuration templates are maintained in the moko-platform repository: -- **Repository**: https://git.mokoconsulting.tech/MokoConsulting/moko-platform -- **Documentation**: https://git.mokoconsulting.tech/MokoConsulting/moko-platform/tree/main/docs +Configuration templates are maintained in the MokoCLI repository: +- **Repository**: https://git.mokoconsulting.tech/MokoConsulting/mokocli +- **Documentation**: https://git.mokoconsulting.tech/MokoConsulting/mokocli/tree/main/docs - **Issues**: Report problems or suggest improvements via GitHub Issues ## Version History diff --git a/templates/configs/index.md b/templates/configs/index.md index f6e7e5d..83acd5c 100644 --- a/templates/configs/index.md +++ b/templates/configs/index.md @@ -2,9 +2,9 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Index -INGROUP: MokoPlatform.Templates.Configs -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Index +INGROUP: MokoCLI.Templates.Configs +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/configs/index.md BRIEF: Configuration templates directory index --> diff --git a/templates/configs/manifest.xml.template b/templates/configs/manifest.xml.template index 926fde8..2aa071e 100644 --- a/templates/configs/manifest.xml.template +++ b/templates/configs/manifest.xml.template @@ -3,19 +3,19 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION - DEFGROUP: MokoPlatform.Templates.Config - INGROUP: MokoPlatform.Templates - REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + DEFGROUP: MokoCLI.Templates.Config + INGROUP: MokoCLI.Templates + REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/configs/manifest.xml.template BRIEF: XML manifest template — synced to .mokogitea/manifest.xml in every governed repository NOTE: This template is a reference only. The bulk sync generates XML via MokoStandardsParser::generate(). - moko-platform Repository Manifest - Auto-generated by moko-platform bulk sync. + MokoCLI Repository Manifest + Auto-generated by MokoCLI bulk sync. Manual edits to and may be overwritten. See: docs/standards/manifest-file-spec.md --> - @@ -28,11 +28,11 @@ {{platform}} {{standards_version}} - https://git.mokoconsulting.tech/MokoConsulting/moko-platform + https://git.mokoconsulting.tech/MokoConsulting/mokocli {{PRIMARY_LANGUAGE}} - + diff --git a/templates/configs/manifest.yml.template b/templates/configs/manifest.yml.template index 4db407f..610d84d 100644 --- a/templates/configs/manifest.yml.template +++ b/templates/configs/manifest.yml.template @@ -1,19 +1,19 @@ # Copyright (C) 2026 Moko Consulting # SPDX-License-Identifier: GPL-3.0-or-later # FILE INFORMATION -# DEFGROUP: MokoPlatform.Templates.Config -# INGROUP: MokoPlatform.Templates -# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +# DEFGROUP: MokoCLI.Templates.Config +# INGROUP: MokoCLI.Templates +# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli # PATH: /templates/configs/manifest.yml.template # BRIEF: Governance attachment template — synced to .mokogitea/manifest.xml in every governed repository # NOTE: Tokens replaced at sync time: {{org}}, {{repo_name}}, {{platform}}, {{standards_version}} # -# This file is managed automatically by moko-platform bulk sync. +# This file is managed automatically by MokoCLI bulk sync. # Do not edit manually — changes will be overwritten on the next sync. -# To update governance settings, open a PR in moko-platform instead: -# https://git.mokoconsulting.tech/MokoConsulting/moko-platform +# To update governance settings, open a PR in MokoCLI instead: +# https://git.mokoconsulting.tech/MokoConsulting/mokocli -standards_source: "https://git.mokoconsulting.tech/MokoConsulting/moko-platform" +standards_source: "https://git.mokoconsulting.tech/MokoConsulting/mokocli" standards_version: "{{standards_version}}" platform: "{{platform}}" governed_repo: "{{org}}/{{repo_name}}" diff --git a/templates/configs/mokostandards.xml.template b/templates/configs/mokostandards.xml.template index dbfc296..96b6d22 100644 --- a/templates/configs/mokostandards.xml.template +++ b/templates/configs/mokostandards.xml.template @@ -3,19 +3,19 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION - DEFGROUP: MokoPlatform.Templates.Config - INGROUP: MokoPlatform.Templates - REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + DEFGROUP: MokoCLI.Templates.Config + INGROUP: MokoCLI.Templates + REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/configs/manifest.xml.template BRIEF: XML manifest template — synced to .mokogitea/manifest.xml in every governed repository NOTE: This template is a reference only. The bulk sync generates XML via MokoStandardsParser::generate(). - moko-platform Repository Manifest - Auto-generated by moko-platform bulk sync. + MokoCLI Repository Manifest + Auto-generated by MokoCLI bulk sync. Manual edits to and may be overwritten. See: docs/standards/manifest-file-spec.md --> - @@ -28,11 +28,11 @@ {{platform}} {{standards_version}} - https://git.mokoconsulting.tech/MokoConsulting/moko-platform + https://git.mokoconsulting.tech/MokoConsulting/mokocli {{PRIMARY_LANGUAGE}} - + diff --git a/templates/configs/mokostandards.yml.template b/templates/configs/mokostandards.yml.template index 4e3378c..99d411e 100644 --- a/templates/configs/mokostandards.yml.template +++ b/templates/configs/mokostandards.yml.template @@ -1,19 +1,19 @@ # Copyright (C) 2026 Moko Consulting # SPDX-License-Identifier: GPL-3.0-or-later # FILE INFORMATION -# DEFGROUP: MokoPlatform.Templates.Config -# INGROUP: MokoPlatform.Templates -# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +# DEFGROUP: MokoCLI.Templates.Config +# INGROUP: MokoCLI.Templates +# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli # PATH: /templates/configs/moko-standards.yml.template # BRIEF: Governance attachment template — synced to .mokostandards in every governed repository # NOTE: Tokens replaced at sync time: {{org}}, {{repo_name}}, {{platform}}, {{standards_version}} # -# This file is managed automatically by moko-platform bulk sync. +# This file is managed automatically by MokoCLI bulk sync. # Do not edit manually — changes will be overwritten on the next sync. -# To update governance settings, open a PR in moko-platform instead: -# https://git.mokoconsulting.tech/MokoConsulting/moko-platform +# To update governance settings, open a PR in MokoCLI instead: +# https://git.mokoconsulting.tech/MokoConsulting/mokocli -standards_source: "https://git.mokoconsulting.tech/MokoConsulting/moko-platform" +standards_source: "https://git.mokoconsulting.tech/MokoConsulting/mokocli" standards_version: "{{standards_version}}" platform: "{{platform}}" governed_repo: "{{org}}/{{repo_name}}" diff --git a/templates/configs/phpcs.xml b/templates/configs/phpcs.xml index ddb471f..6f60bc3 100644 --- a/templates/configs/phpcs.xml +++ b/templates/configs/phpcs.xml @@ -6,8 +6,8 @@ This file is part of a Moko Consulting project. SPDX-License-Identifier: GPL-3.0-or-later --> - - PHP_CodeSniffer configuration for moko-platform projects + + PHP_CodeSniffer configuration for MokoCLI projects src diff --git a/templates/docs/README.md b/templates/docs/README.md index dfec43a..3e54c30 100644 --- a/templates/docs/README.md +++ b/templates/docs/README.md @@ -2,9 +2,9 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Index -INGROUP: MokoPlatform.Templates.Docs -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Index +INGROUP: MokoCLI.Templates.Docs +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/docs/README.md BRIEF: Documentation templates README --> @@ -13,7 +13,7 @@ BRIEF: Documentation templates README ## Purpose -This directory contains governed documentation templates for the moko-platform organization. These templates ensure consistency, completeness, and compliance across all documentation artifacts. +This directory contains governed documentation templates for the MokoCLI organization. These templates ensure consistency, completeness, and compliance across all documentation artifacts. ## Intended Use diff --git a/templates/docs/extra/README.md b/templates/docs/extra/README.md index edafb43..064c8ce 100644 --- a/templates/docs/extra/README.md +++ b/templates/docs/extra/README.md @@ -2,9 +2,9 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Index -INGROUP: MokoPlatform.Templates.Docs.Extra -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Index +INGROUP: MokoCLI.Templates.Docs.Extra +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/docs/extra/README.md BRIEF: Extra documentation templates README --> diff --git a/templates/docs/extra/index.md b/templates/docs/extra/index.md index 5d85e61..ee7e39d 100644 --- a/templates/docs/extra/index.md +++ b/templates/docs/extra/index.md @@ -2,9 +2,9 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Index -INGROUP: MokoPlatform.Templates.Docs.Extra -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Index +INGROUP: MokoCLI.Templates.Docs.Extra +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/docs/extra/index.md BRIEF: Extra documentation templates directory index --> diff --git a/templates/docs/index.md b/templates/docs/index.md index b224004..8ee6fc3 100644 --- a/templates/docs/index.md +++ b/templates/docs/index.md @@ -2,9 +2,9 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Index -INGROUP: MokoPlatform.Templates.Docs -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Index +INGROUP: MokoCLI.Templates.Docs +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/docs/index.md BRIEF: Documentation templates directory index --> diff --git a/templates/docs/required/GOVERNANCE.md b/templates/docs/required/GOVERNANCE.md index 270eddd..a0f2be1 100644 --- a/templates/docs/required/GOVERNANCE.md +++ b/templates/docs/required/GOVERNANCE.md @@ -17,14 +17,14 @@ FILE INFORMATION DEFGROUP: {{org}}.{{repo_name}} - INGROUP: MokoPlatform.Governance + INGROUP: MokoCLI.Governance REPO: https://github.com/{{org}}/{{repo_name}} VERSION: {{standards_version}} PATH: /GOVERNANCE.md BRIEF: Project governance rules, roles, and decision process for {{repo_name}} --> -[![moko-platform](https://img.shields.io/badge/moko--platform-{{standards_version}}-blue)](https://git.mokoconsulting.tech/MokoConsulting/moko-platform) +[![MokoCLI](https://img.shields.io/badge/moko--platform-{{standards_version}}-blue)](https://git.mokoconsulting.tech/MokoConsulting/mokocli) # Project Governance @@ -32,10 +32,10 @@ This document defines the governance model for the `{{repo_name}}` repository within the `{{org}}` organization. It is automatically maintained by -[moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform) v{{standards_version}}. +[MokoCLI](https://git.mokoconsulting.tech/MokoConsulting/mokocli) v{{standards_version}}. -Full governance policy is defined in the moko-platform source repository: -[docs/policy/GOVERNANCE.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/GOVERNANCE.md) +Full governance policy is defined in the MokoCLI source repository: +[docs/policy/GOVERNANCE.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/GOVERNANCE.md) --- @@ -80,7 +80,7 @@ available. The following requirements remain mandatory regardless: 4. **Documentation** — changes are documented in `CHANGELOG.md`. See the full policy: -[Sole Operator Policy](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/GOVERNANCE.md#sole-operator-policy) +[Sole Operator Policy](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/GOVERNANCE.md#sole-operator-policy) --- @@ -113,7 +113,7 @@ See the full policy: | Applies To | {{org}}/{{repo_name}} | | Jurisdiction | Tennessee, USA | | Maintainer | @mokoconsulting-tech | -| Standards | moko-platform v{{standards_version}} | +| Standards | MokoCLI v{{standards_version}} | | Repo | https://github.com/{{org}}/{{repo_name}} | | Path | /GOVERNANCE.md | -| Status | Active — auto-maintained by moko-platform | +| Status | Active — auto-maintained by MokoCLI | diff --git a/templates/docs/required/README.md b/templates/docs/required/README.md index 0c0a053..70b6b28 100644 --- a/templates/docs/required/README.md +++ b/templates/docs/required/README.md @@ -2,9 +2,9 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Index -INGROUP: MokoPlatform.Templates.Docs.Required -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Index +INGROUP: MokoCLI.Templates.Docs.Required +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/docs/required/README.md BRIEF: Required documentation templates README --> @@ -13,7 +13,7 @@ BRIEF: Required documentation templates README ## Purpose -This directory contains mandatory documentation templates that MUST be present in all repositories governed by moko-platform documentation policies. These templates ensure baseline documentation compliance and organizational consistency. +This directory contains mandatory documentation templates that MUST be present in all repositories governed by MokoCLI documentation policies. These templates ensure baseline documentation compliance and organizational consistency. ## Intended Use diff --git a/templates/docs/required/index.md b/templates/docs/required/index.md index 50e3e38..dad32e7 100644 --- a/templates/docs/required/index.md +++ b/templates/docs/required/index.md @@ -2,9 +2,9 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Index -INGROUP: MokoPlatform.Templates.Docs.Required -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Index +INGROUP: MokoCLI.Templates.Docs.Required +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/docs/required/index.md BRIEF: Required documentation templates directory index --> diff --git a/templates/docs/required/template-CONTRIBUTING.md b/templates/docs/required/template-CONTRIBUTING.md index 16263db..a06d212 100644 --- a/templates/docs/required/template-CONTRIBUTING.md +++ b/templates/docs/required/template-CONTRIBUTING.md @@ -24,7 +24,7 @@ Thank you for your interest in contributing to **{{REPO_NAME}}**! -This repository is governed by **[moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform)** — the authoritative source of coding standards, workflows, and policies for all Moko Consulting repositories. +This repository is governed by **[MokoCLI](https://git.mokoconsulting.tech/MokoConsulting/mokocli)** — the authoritative source of coding standards, workflows, and policies for all Moko Consulting repositories. ## Branch Strategy @@ -49,9 +49,9 @@ This repository is governed by **[moko-platform](https://git.mokoconsulting.tech |--------|-----| | `dev/XX.YY.ZZ` | Feature development (e.g., `dev/02.00.00/add-extrafields`) | | `version/XX` | Stable release (auto-created, never manually pushed) | -| `chore/` | Automated sync branches (managed by moko-platform) | +| `chore/` | Automated sync branches (managed by MokoCLI) | -> **Never use** `feature/`, `hotfix/`, or `release/` prefixes — they are not part of the moko-platform branch strategy. +> **Never use** `feature/`, `hotfix/`, or `release/` prefixes — they are not part of the MokoCLI branch strategy. ## Commit Conventions @@ -84,16 +84,16 @@ When your PR is merged to `main`, these workflows run automatically: ## Coding Standards -All contributions must follow [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform): +All contributions must follow [MokoCLI](https://git.mokoconsulting.tech/MokoConsulting/mokocli): | Standard | Reference | |----------|-----------| -| Coding Style | [coding-style-guide.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/coding-style-guide.md) | -| File Headers | [file-header-standards.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/file-header-standards.md) | -| Branching | [branch-release-strategy.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/branch-release-strategy.md) | -| Merge Strategy | [merge-strategy.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/merge-strategy.md) | -| Scripting | [scripting-standards.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/scripting-standards.md) | -| Build & Release | [build-release.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/workflows/build-release.md) | +| Coding Style | [coding-style-guide.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/coding-style-guide.md) | +| File Headers | [file-header-standards.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/file-header-standards.md) | +| Branching | [branch-release-strategy.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/branch-release-strategy.md) | +| Merge Strategy | [merge-strategy.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/merge-strategy.md) | +| Scripting | [scripting-standards.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/scripting-standards.md) | +| Build & Release | [build-release.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/workflows/build-release.md) | ## PR Checklist @@ -109,12 +109,12 @@ All contributions must follow [moko-platform](https://git.mokoconsulting.tech/Mo ## Custom Workflows -Place repo-specific workflows in `.mokogitea/workflows/custom/` — they are **never overwritten or deleted** by moko-platform sync: +Place repo-specific workflows in `.mokogitea/workflows/custom/` — they are **never overwritten or deleted** by MokoCLI sync: ``` .mokogitea/workflows/ -├── deploy-dev.yml ← Synced from moko-platform -├── auto-release.yml ← Synced from moko-platform +├── deploy-dev.yml ← Synced from MokoCLI +├── auto-release.yml ← Synced from MokoCLI └── custom/ ← Your custom workflows (safe) └── my-custom-ci.yml ``` @@ -125,4 +125,4 @@ By contributing, you agree that your contributions will be licensed under the [G --- -*This file is synced from [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform). Do not edit directly — changes will be overwritten on the next sync.* +*This file is synced from [MokoCLI](https://git.mokoconsulting.tech/MokoConsulting/mokocli). Do not edit directly — changes will be overwritten on the next sync.* diff --git a/templates/docs/required/template-README.md b/templates/docs/required/template-README.md index 2a1f408..da60b7c 100644 --- a/templates/docs/required/template-README.md +++ b/templates/docs/required/template-README.md @@ -22,7 +22,7 @@ BRIEF: {{REPO_DESCRIPTION}} # {{REPO_NAME}} [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) -[![moko-platform](https://img.shields.io/badge/moko--platform-{{standards_version}}-orange)](https://git.mokoconsulting.tech/MokoConsulting/moko-platform) +[![MokoCLI](https://img.shields.io/badge/moko--platform-{{standards_version}}-orange)](https://git.mokoconsulting.tech/MokoConsulting/mokocli) > {{REPO_DESCRIPTION}} @@ -40,7 +40,7 @@ BRIEF: {{REPO_DESCRIPTION}} ## Contributing -See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. This repository follows [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform). +See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. This repository follows [MokoCLI](https://git.mokoconsulting.tech/MokoConsulting/mokocli). ## License diff --git a/templates/docs/required/template-SECURITY.md b/templates/docs/required/template-SECURITY.md index 43d2940..39ffc07 100644 --- a/templates/docs/required/template-SECURITY.md +++ b/templates/docs/required/template-SECURITY.md @@ -130,7 +130,7 @@ Advisories include: ## Security Best Practices -For repositories adopting moko-platform: +For repositories adopting MokoCLI: ### Required Controls @@ -188,7 +188,7 @@ See [Security Scanning Policy](docs/policy/security-scanning.md) for detailed re ## Compliance and Governance -This security policy is binding for all repositories governed by moko-platform. Deviations require documented justification and approval from the Security Owner. +This security policy is binding for all repositories governed by MokoCLI. Deviations require documented justification and approval from the Security Owner. Security policies are reviewed and updated at least annually or following significant security incidents. @@ -228,7 +228,7 @@ The following are explicitly out of scope: | Repository | [REPOSITORY_URL] | | Owner | [OWNER_NAME] | | Scope | Security vulnerability handling | -| Applies To | All repositories governed by moko-platform | +| Applies To | All repositories governed by MokoCLI | | Status | Active | | Effective | [YYYY-MM-DD] | diff --git a/templates/index.md b/templates/index.md index 1af4170..126cd7e 100644 --- a/templates/index.md +++ b/templates/index.md @@ -19,18 +19,18 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . # FILE INFORMATION -DEFGROUP: MokoPlatform.Templates -INGROUP: MokoPlatform -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Templates +INGROUP: MokoCLI +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/index.md -BRIEF: Comprehensive catalog of all templates in moko-platform +BRIEF: Comprehensive catalog of all templates in MokoCLI --> # Templates Catalog ## Overview -This directory contains all templates and reference implementations provided by moko-platform. Templates are non-authoritative examples that demonstrate how to implement the standards defined in `/docs/policy/`. +This directory contains all templates and reference implementations provided by MokoCLI. Templates are non-authoritative examples that demonstrate how to implement the standards defined in `/docs/policy/`. ## Purpose @@ -102,7 +102,7 @@ Configuration file templates for common tools. ### Documentation (`docs/`) -Documentation file templates aligned with moko-platform policies. +Documentation file templates aligned with MokoCLI policies. **Templates:** - `README.md.template` - Repository README template @@ -396,7 +396,7 @@ To deprecate a template: ### Getting Help - Browse existing templates for examples -- Review moko-platform repository as reference implementation +- Review MokoCLI repository as reference implementation - Consult with repository maintainers - Submit issues for template problems or requests @@ -416,7 +416,7 @@ To contribute new templates or improvements: ## Metadata * **Document**: templates/index.md -* **Repository**: [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform) +* **Repository**: [MokoCLI](https://git.mokoconsulting.tech/MokoConsulting/mokocli) * **Owner**: Moko Consulting Engineering Team * **Scope**: Template catalog and usage guide * **Lifecycle**: Active diff --git a/templates/licenses/README.md b/templates/licenses/README.md index 75345a2..65c3e6d 100644 --- a/templates/licenses/README.md +++ b/templates/licenses/README.md @@ -2,9 +2,9 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Index -INGROUP: MokoPlatform.Templates.Licenses -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Index +INGROUP: MokoCLI.Templates.Licenses +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/licenses/README.md BRIEF: License templates README --> @@ -73,7 +73,7 @@ The following license files are maintained as authoritative sources: 1. **Copy the license file** to your repository root: ```bash # From your repository root - cp /path/to/moko-platform/templates/licenses/GPL-3.0 ./LICENSE + cp /path/to/MokoCLI/templates/licenses/GPL-3.0 ./LICENSE ``` 2. **No file extension**: The LICENSE file must not have an extension (use `LICENSE`, not `LICENSE.txt` or `LICENSE.md`) @@ -173,7 +173,7 @@ along with this program. If not, see . ```bash # Check if your LICENSE matches the authoritative version -diff LICENSE /path/to/moko-platform/templates/licenses/GPL-3.0 +diff LICENSE /path/to/MokoCLI/templates/licenses/GPL-3.0 # Calculate checksum for verification sha256sum LICENSE @@ -193,7 +193,7 @@ The repository health workflow automatically verifies: - [SPDX License List](https://spdx.org/licenses/) - [Choose a License](https://choosealicense.com/) - [GPL Compliance Guide](https://www.gnu.org/licenses/gpl-compliance.html) -- [moko-platform License Policy](../../docs/policy/license-compliance.md) +- [MokoCLI License Policy](../../docs/policy/license-compliance.md) ## Maintenance @@ -213,4 +213,4 @@ The repository health workflow automatically verifies: For questions about license selection or compliance: - **Email**: legal@mokoconsulting.tech - **Documentation**: See [License Compliance Policy](../../docs/policy/license-compliance.md) -- **Issues**: Open an issue in moko-platform repository +- **Issues**: Open an issue in MokoCLI repository diff --git a/templates/licenses/index.md b/templates/licenses/index.md index 0c39d9e..19f2688 100644 --- a/templates/licenses/index.md +++ b/templates/licenses/index.md @@ -2,9 +2,9 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Index -INGROUP: MokoPlatform.Templates.Licenses -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Index +INGROUP: MokoCLI.Templates.Licenses +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/licenses/index.md BRIEF: License templates directory index --> diff --git a/templates/makefiles/README.md b/templates/makefiles/README.md index e4fdc8a..d0fc934 100644 --- a/templates/makefiles/README.md +++ b/templates/makefiles/README.md @@ -2,9 +2,9 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Index -INGROUP: MokoPlatform.Templates.Makefiles -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Index +INGROUP: MokoCLI.Templates.Makefiles +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/makefiles/README.md BRIEF: Makefile templates README --> @@ -98,6 +98,6 @@ Platform-specific templates may include additional targets relevant to their eco ## Support For questions or issues with Makefile templates: -- See main moko-platform documentation +- See main MokoCLI documentation - Check the platform-specific guides (Joomla, Dolibarr) - Review the schema documentation for source/destination details diff --git a/templates/mokogitea/CLAUDE.dolibarr.md.template b/templates/mokogitea/CLAUDE.dolibarr.md.template index 1a94d67..116ee5e 100644 --- a/templates/mokogitea/CLAUDE.dolibarr.md.template +++ b/templates/mokogitea/CLAUDE.dolibarr.md.template @@ -6,9 +6,9 @@ This file is part of a Moko Consulting project. SPDX-License-Identifier: GPL-3.0-or-later # FILE INFORMATION -DEFGROUP: MokoPlatform.Templates.GitHub -INGROUP: MokoPlatform.Templates -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Templates.GitHub +INGROUP: MokoCLI.Templates +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/mokogitea/CLAUDE.dolibarr.md.template VERSION: XX.YY.ZZ BRIEF: Claude AI assistant context template for Dolibarr/MokoCRM module repositories @@ -20,7 +20,7 @@ NOTE: Synced to .gitea/CLAUDE.md in all Dolibarr/CRM repos via bulk sync. > [!IMPORTANT] > **🔧 AI Self-Update Required on First Use** > -> This file may contain unfilled `{{TOKEN}}` placeholders. The moko-platform bulk-sync system +> This file may contain unfilled `{{TOKEN}}` placeholders. The MokoCLI bulk-sync system > replaces them automatically at sync time; if you can still see them, sync has not yet run for > this repository — or this is a brand-new repo. > @@ -41,7 +41,7 @@ NOTE: Synced to .gitea/CLAUDE.md in all Dolibarr/CRM repos via bulk sync. > | `{{REPO_DESCRIPTION}}` | First paragraph of `README.md` body, or the GitHub repo description | > | `{{MODULE_NAME}}` | The module name as used in Dolibarr (lowercase, e.g. `mymodule`) — from the `langs/en_US/*.lang` filename or `$this->rights_class` in the module descriptor | > | `{{MODULE_CLASS}}` | PascalCase module class name (e.g. `MyModule`) — from the `src/core/modules/mod*.class.php` filename | -> | `{{MODULE_ID}}` | The `$this->numero` value in `src/core/modules/mod*.class.php`; check [module-registry.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/development/crm/module-registry.md) if creating a new module | +> | `{{MODULE_ID}}` | The `$this->numero` value in `src/core/modules/mod*.class.php`; check [module-registry.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/development/crm/module-registry.md) if creating a new module | > > --- @@ -53,10 +53,10 @@ NOTE: Synced to .gitea/CLAUDE.md in all Dolibarr/CRM repos via bulk sync. Module name: **{{MODULE_NAME}}** Module class: **{{MODULE_CLASS}}** -Module ID: **{{MODULE_ID}}** *(unique, immutable — registered in [module-registry.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/development/crm/module-registry.md))* +Module ID: **{{MODULE_ID}}** *(unique, immutable — registered in [module-registry.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/development/crm/module-registry.md))* Repository URL: {{REPO_URL}} -This repository is governed by [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform) — the single source of truth for coding standards, file-header policies, GitHub Actions workflows, and Terraform configuration templates across all Moko Consulting repositories. +This repository is governed by [MokoCLI](https://git.mokoconsulting.tech/MokoConsulting/mokocli) — the single source of truth for coding standards, file-header policies, GitHub Actions workflows, and Terraform configuration templates across all Moko Consulting repositories. --- @@ -89,7 +89,7 @@ This repository is governed by [moko-platform](https://git.mokoconsulting.tech/M │ ├── unit/ │ └── integration/ ├── .gitea/ -│ ├── workflows/ # CI/CD workflows (synced from moko-platform) +│ ├── workflows/ # CI/CD workflows (synced from MokoCLI) │ ├── copilot-instructions.md │ └── CLAUDE.md # This file ├── README.md # Version source of truth @@ -155,7 +155,7 @@ public $numero = {{MODULE_ID}}; // IMMUTABLE — never change; registered public $version = 'XX.YY.ZZ'; // Must match README.md version exactly ``` -**`$numero` is permanent.** It was registered in [module-registry.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/development/crm/module-registry.md) when this module was created. Changing it would break all Dolibarr installations that have this module activated. +**`$numero` is permanent.** It was registered in [module-registry.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/development/crm/module-registry.md) when this module was created. Changing it would break all Dolibarr installations that have this module activated. Before creating a new module, always check the registry for the next available ID. @@ -282,15 +282,15 @@ Before opening a PR, verify: --- -# Key Policy Documents (moko-platform) +# Key Policy Documents (MokoCLI) | Document | Purpose | |----------|---------| -| [file-header-standards.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/file-header-standards.md) | Copyright-header rules for every file type | -| [coding-style-guide.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/coding-style-guide.md) | Naming and formatting conventions | -| [branching-strategy.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/branching-strategy.md) | Branch naming, hierarchy, and release workflow | -| [merge-strategy.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/merge-strategy.md) | Squash-merge policy and PR conventions | -| [changelog-standards.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/changelog-standards.md) | How and when to update CHANGELOG.md | -| [module-registry.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/development/crm/module-registry.md) | Dolibarr module ID registry — check before reserving a new ID | -| [crm/development-standards.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/crm/development-standards.md) | MokoCRM Dolibarr module development standards | -| [dolibarr-development-guide.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/guide/crm/dolibarr-development-guide.md) | MokoCRM full development guide | +| [file-header-standards.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/file-header-standards.md) | Copyright-header rules for every file type | +| [coding-style-guide.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/coding-style-guide.md) | Naming and formatting conventions | +| [branching-strategy.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/branching-strategy.md) | Branch naming, hierarchy, and release workflow | +| [merge-strategy.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/merge-strategy.md) | Squash-merge policy and PR conventions | +| [changelog-standards.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/changelog-standards.md) | How and when to update CHANGELOG.md | +| [module-registry.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/development/crm/module-registry.md) | Dolibarr module ID registry — check before reserving a new ID | +| [crm/development-standards.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/crm/development-standards.md) | MokoCRM Dolibarr module development standards | +| [dolibarr-development-guide.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/guide/crm/dolibarr-development-guide.md) | MokoCRM full development guide | diff --git a/templates/mokogitea/CLAUDE.joomla.md.template b/templates/mokogitea/CLAUDE.joomla.md.template index b14c4bc..70f6e8f 100644 --- a/templates/mokogitea/CLAUDE.joomla.md.template +++ b/templates/mokogitea/CLAUDE.joomla.md.template @@ -6,9 +6,9 @@ This file is part of a Moko Consulting project. SPDX-License-Identifier: GPL-3.0-or-later # FILE INFORMATION -DEFGROUP: MokoPlatform.Templates.GitHub -INGROUP: MokoPlatform.Templates -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Templates.GitHub +INGROUP: MokoCLI.Templates +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/mokogitea/CLAUDE.joomla.md.template VERSION: XX.YY.ZZ BRIEF: Claude AI assistant context template for Joomla/MokoWaaS governed repositories @@ -20,7 +20,7 @@ NOTE: Synced to .gitea/CLAUDE.md in all Joomla/WaaS repos via bulk sync. > [!IMPORTANT] > **🔧 AI Self-Update Required on First Use** > -> This file may contain unfilled `{{TOKEN}}` placeholders. The moko-platform bulk-sync system +> This file may contain unfilled `{{TOKEN}}` placeholders. The MokoCLI bulk-sync system > replaces them automatically at sync time; if you can still see them, sync has not yet run for > this repository — or this is a brand-new repo. > @@ -55,7 +55,7 @@ Extension name: **{{EXTENSION_NAME}}** Extension type: **{{EXTENSION_TYPE}}** (`{{EXTENSION_ELEMENT}}`) Repository URL: {{REPO_URL}} -This repository is governed by [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform) — the single source of truth for coding standards, file-header policies, GitHub Actions workflows, and Terraform configuration templates across all Moko Consulting repositories. +This repository is governed by [MokoCLI](https://git.mokoconsulting.tech/MokoConsulting/mokocli) — the single source of truth for coding standards, file-header policies, GitHub Actions workflows, and Terraform configuration templates across all Moko Consulting repositories. --- @@ -81,7 +81,7 @@ This repository is governed by [moko-platform](https://git.mokoconsulting.tech/M ├── docs/ # Technical documentation ├── tests/ # Test suite ├── .gitea/ -│ ├── workflows/ # CI/CD workflows (synced from moko-platform) +│ ├── workflows/ # CI/CD workflows (synced from MokoCLI) │ ├── copilot-instructions.md │ └── CLAUDE.md # This file ├── README.md # Version source of truth @@ -284,16 +284,16 @@ Before opening a PR, verify: --- -# Key Policy Documents (moko-platform) +# Key Policy Documents (MokoCLI) | Document | Purpose | |----------|---------| -| [file-header-standards.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/file-header-standards.md) | Copyright-header rules for every file type | -| [coding-style-guide.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/coding-style-guide.md) | Naming and formatting conventions | -| [branching-strategy.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/branching-strategy.md) | Branch naming, hierarchy, and release workflow | -| [merge-strategy.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/merge-strategy.md) | Squash-merge policy and PR conventions | -| [changelog-standards.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/changelog-standards.md) | How and when to update CHANGELOG.md | -| [joomla-development-guide.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/guide/waas/joomla-development-guide.md) | MokoWaaS Joomla extension development guide | +| [file-header-standards.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/file-header-standards.md) | Copyright-header rules for every file type | +| [coding-style-guide.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/coding-style-guide.md) | Naming and formatting conventions | +| [branching-strategy.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/branching-strategy.md) | Branch naming, hierarchy, and release workflow | +| [merge-strategy.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/merge-strategy.md) | Squash-merge policy and PR conventions | +| [changelog-standards.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/changelog-standards.md) | How and when to update CHANGELOG.md | +| [joomla-development-guide.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/guide/waas/joomla-development-guide.md) | MokoWaaS Joomla extension development guide | ### Update Server Priority diff --git a/templates/mokogitea/CLAUDE.md.template b/templates/mokogitea/CLAUDE.md.template index cfc5c54..1493e0c 100644 --- a/templates/mokogitea/CLAUDE.md.template +++ b/templates/mokogitea/CLAUDE.md.template @@ -31,4 +31,4 @@ make clean # Clean build artifacts - **Attribution**: `Authored-by: Moko Consulting` - **Workflow directory**: `.mokogitea/` (not `.gitea/` or `.github/`) - **Wiki**: documentation lives in the Gitea wiki, not `docs/` files -- **Standards**: [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki/Home) +- **Standards**: [MokoCLI](https://git.mokoconsulting.tech/MokoConsulting/mokocli/wiki/Home) diff --git a/templates/mokogitea/ISSUE_TEMPLATE/config.yml b/templates/mokogitea/ISSUE_TEMPLATE/config.yml index 06221e2..bbaebdc 100644 --- a/templates/mokogitea/ISSUE_TEMPLATE/config.yml +++ b/templates/mokogitea/ISSUE_TEMPLATE/config.yml @@ -7,8 +7,8 @@ contact_links: - name: 💬 Ask a Question url: https://mokoconsulting.tech/ about: Get help or ask questions through our website - - name: 📚 moko-platform Documentation - url: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + - name: 📚 MokoCLI Documentation + url: https://git.mokoconsulting.tech/MokoConsulting/mokocli about: View our coding standards and best practices - name: 🔒 Report a Security Vulnerability url: https://git.mokoconsulting.tech/mokoconsulting-tech/.github-private/security/advisories/new diff --git a/templates/mokogitea/ISSUE_TEMPLATE/documentation.md b/templates/mokogitea/ISSUE_TEMPLATE/documentation.md index 648dab9..8156651 100644 --- a/templates/mokogitea/ISSUE_TEMPLATE/documentation.md +++ b/templates/mokogitea/ISSUE_TEMPLATE/documentation.md @@ -42,7 +42,7 @@ Suggested text here ## Standards Alignment -- [ ] Follows moko-platform documentation guidelines +- [ ] Follows MokoCLI documentation guidelines - [ ] Uses en_US/en_GB localization - [ ] Includes proper SPDX headers where applicable diff --git a/templates/mokogitea/ISSUE_TEMPLATE/dolibarr_module_id_request.md b/templates/mokogitea/ISSUE_TEMPLATE/dolibarr_module_id_request.md index 407fcb3..ea510a1 100644 --- a/templates/mokogitea/ISSUE_TEMPLATE/dolibarr_module_id_request.md +++ b/templates/mokogitea/ISSUE_TEMPLATE/dolibarr_module_id_request.md @@ -92,7 +92,7 @@ List Dolibarr hooks this module will use: ### ID Range Preference -Based on the [Dolibarr Module ID Policy](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/DOLIBARR_MODULE_ID_REQUEST.md): +Based on the [Dolibarr Module ID Policy](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/DOLIBARR_MODULE_ID_REQUEST.md): **Preferred Range** (will be assigned by coordinator): - [ ] Internal module (100000-109999) @@ -104,7 +104,7 @@ Based on the [Dolibarr Module ID Policy](https://git.mokoconsulting.tech/MokoCon ### Security and Compliance **For Public Modules** (required before external registration): -- [ ] Code follows moko-platform +- [ ] Code follows MokoCLI - [ ] Security review completed - [ ] No sensitive data or credentials in code - [ ] License properly defined (GPL-3.0-or-later) @@ -143,7 +143,7 @@ If similar modules exist, explain why a new module is needed: ### Acknowledgments -- [ ] I have read the [Dolibarr Module ID Policy](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/DOLIBARR_MODULE_ID_REQUEST.md) +- [ ] I have read the [Dolibarr Module ID Policy](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/DOLIBARR_MODULE_ID_REQUEST.md) - [ ] I understand internal modules use range 100000-119999 - [ ] I understand public modules require external registration with Dolibarr Foundation - [ ] I understand module IDs are never reused once allocated diff --git a/templates/mokogitea/ISSUE_TEMPLATE/feature_request.md b/templates/mokogitea/ISSUE_TEMPLATE/feature_request.md index 6d691a0..650523c 100644 --- a/templates/mokogitea/ISSUE_TEMPLATE/feature_request.md +++ b/templates/mokogitea/ISSUE_TEMPLATE/feature_request.md @@ -37,7 +37,7 @@ If you have ideas about how this could be implemented, share them here: Add any other context, mockups, or screenshots about the feature request here. ## Relevant Standards -Does this relate to any standards in [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform)? +Does this relate to any standards in [MokoCLI](https://git.mokoconsulting.tech/MokoConsulting/mokocli)? - [ ] Accessibility (WCAG 2.1 AA) - [ ] Localization (en_US/en_GB) - [ ] Security best practices diff --git a/templates/mokogitea/ISSUE_TEMPLATE/security.md b/templates/mokogitea/ISSUE_TEMPLATE/security.md index 56b6573..37a266d 100644 --- a/templates/mokogitea/ISSUE_TEMPLATE/security.md +++ b/templates/mokogitea/ISSUE_TEMPLATE/security.md @@ -35,7 +35,7 @@ Use this template only for: ## Standards Reference -Does this relate to security standards in [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform)? +Does this relate to security standards in [MokoCLI](https://git.mokoconsulting.tech/MokoConsulting/mokocli)? - [ ] SPDX license identifiers - [ ] Secret management - [ ] Dependency security diff --git a/templates/mokogitea/README.md b/templates/mokogitea/README.md index 1d7a831..5cef3a3 100644 --- a/templates/mokogitea/README.md +++ b/templates/mokogitea/README.md @@ -19,9 +19,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . # FILE INFORMATION -DEFGROUP: MokoPlatform.Templates -INGROUP: MokoPlatform.GitHub -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Templates +INGROUP: MokoCLI.GitHub +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/mokogitea/README.md BRIEF: GitHub-specific templates including issues, PRs, and CODEOWNERS --> @@ -149,10 +149,10 @@ your-repository/ blank_issues_enabled: false contact_links: - name: "📚 Documentation" - url: https://git.mokoconsulting.tech/MokoConsulting/moko-platform/docs + url: https://git.mokoconsulting.tech/MokoConsulting/mokocli/docs about: "Check the documentation first" - name: "💬 Discussions" - url: https://git.mokoconsulting.tech/MokoConsulting/moko-platform/discussions + url: https://git.mokoconsulting.tech/MokoConsulting/mokocli/discussions about: "Ask questions and discuss ideas" ``` @@ -367,12 +367,12 @@ Require status checks that verify: - [GitHub Issue Templates Documentation](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository) - [GitHub PR Templates Documentation](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/creating-a-pull-request-template-for-your-repository) - [GitHub CODEOWNERS Documentation](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners) -- [moko-platform Repository](https://git.mokoconsulting.tech/MokoConsulting/moko-platform) +- [MokoCLI Repository](https://git.mokoconsulting.tech/MokoConsulting/mokocli) ## Metadata * **Document**: templates/mokogitea/README.md -* **Repository**: [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform) +* **Repository**: [MokoCLI](https://git.mokoconsulting.tech/MokoConsulting/mokocli) * **Owner**: Moko Consulting Engineering Team * **Scope**: GitHub templates and configuration * **Lifecycle**: Active diff --git a/templates/mokogitea/copilot-instructions.dolibarr.md.template b/templates/mokogitea/copilot-instructions.dolibarr.md.template index 55006cd..db094af 100644 --- a/templates/mokogitea/copilot-instructions.dolibarr.md.template +++ b/templates/mokogitea/copilot-instructions.dolibarr.md.template @@ -6,9 +6,9 @@ This file is part of a Moko Consulting project. SPDX-License-Identifier: GPL-3.0-or-later # FILE INFORMATION -DEFGROUP: MokoPlatform.Templates.GitHub -INGROUP: MokoPlatform.Templates -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Templates.GitHub +INGROUP: MokoCLI.Templates +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/mokogitea/copilot-instructions.dolibarr.md.template VERSION: XX.YY.ZZ BRIEF: GitHub Copilot custom instructions template for Dolibarr/MokoCRM module repositories @@ -20,7 +20,7 @@ NOTE: Synced to .gitea/copilot-instructions.md in all Dolibarr/CRM module repos > [!IMPORTANT] > **🔧 AI Self-Update Required on First Use** > -> This file may contain unfilled `{{TOKEN}}` placeholders. The moko-platform bulk-sync system +> This file may contain unfilled `{{TOKEN}}` placeholders. The MokoCLI bulk-sync system > replaces them automatically at sync time; if you can still see them, sync has not yet run for > this repository — or this is a brand-new repo. > @@ -40,7 +40,7 @@ NOTE: Synced to .gitea/copilot-instructions.md in all Dolibarr/CRM module repos > | `{{REPO_URL}}` | Full GitHub URL, e.g. `https://git.mokoconsulting.tech/mokoconsulting-tech/` | > | `{{MODULE_NAME}}` | The module name as used in Dolibarr (lowercase, e.g. `mymodule`) — from the `langs/en_US/*.lang` filename or `$this->rights_class` in the module descriptor | > | `{{MODULE_CLASS}}` | PascalCase module class name (e.g. `MyModule`) — from the `src/core/modules/mod*.class.php` filename | -> | `{{MODULE_ID}}` | The `$this->numero` value in `src/core/modules/mod*.class.php`; check [module-registry.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/development/crm/module-registry.md) if creating a new module | +> | `{{MODULE_ID}}` | The `$this->numero` value in `src/core/modules/mod*.class.php`; check [module-registry.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/development/crm/module-registry.md) if creating a new module | > | `{{PRIMARY_LANGUAGE}}` | Primary programming language (usually `PHP`) | > > --- @@ -49,7 +49,7 @@ NOTE: Synced to .gitea/copilot-instructions.md in all Dolibarr/CRM module repos ## What This Repo Is -This is a **Moko Consulting MokoCRM** (Dolibarr) module repository governed by [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform). All coding standards, workflows, and policies are defined there and enforced here via bulk sync. +This is a **Moko Consulting MokoCRM** (Dolibarr) module repository governed by [MokoCLI](https://git.mokoconsulting.tech/MokoConsulting/mokocli). All coding standards, workflows, and policies are defined there and enforced here via bulk sync. Repository URL: {{REPO_URL}} Module name: **{{MODULE_NAME}}** @@ -232,7 +232,7 @@ class mod{{MODULE_CLASS}} extends DolibarrModules ``` **Key rules for the module descriptor:** -- `$this->numero` is a globally unique ID registered in [module-registry.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/development/crm/module-registry.md) — **never change it**. +- `$this->numero` is a globally unique ID registered in [module-registry.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/development/crm/module-registry.md) — **never change it**. - `$this->version` must exactly match the version in `README.md`. - Register new modules in the module registry before using any ID. @@ -262,19 +262,19 @@ PHP scripts read the token with: `getenv('GH_TOKEN') ?: getenv('GITHUB_TOKEN')` --- -## moko-platform Reference +## MokoCLI Reference -This repository is governed by [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform). Authoritative policies: +This repository is governed by [MokoCLI](https://git.mokoconsulting.tech/MokoConsulting/mokocli). Authoritative policies: | Document | Purpose | |----------|---------| -| [file-header-standards.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/file-header-standards.md) | Copyright-header rules for every file type | -| [coding-style-guide.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/coding-style-guide.md) | Naming and formatting conventions | -| [branching-strategy.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/branching-strategy.md) | Branch naming, hierarchy, and release workflow | -| [merge-strategy.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/merge-strategy.md) | Squash-merge policy and PR title/body conventions | -| [changelog-standards.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/changelog-standards.md) | How and when to update CHANGELOG.md | -| [module-registry.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/development/crm/module-registry.md) | Dolibarr module ID registry — check before reserving a new ID | -| [crm-development-standards.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/crm/development-standards.md) | MokoCRM Dolibarr module development standards | +| [file-header-standards.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/file-header-standards.md) | Copyright-header rules for every file type | +| [coding-style-guide.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/coding-style-guide.md) | Naming and formatting conventions | +| [branching-strategy.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/branching-strategy.md) | Branch naming, hierarchy, and release workflow | +| [merge-strategy.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/merge-strategy.md) | Squash-merge policy and PR title/body conventions | +| [changelog-standards.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/changelog-standards.md) | How and when to update CHANGELOG.md | +| [module-registry.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/development/crm/module-registry.md) | Dolibarr module ID registry — check before reserving a new ID | +| [crm-development-standards.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/crm/development-standards.md) | MokoCRM Dolibarr module development standards | --- diff --git a/templates/mokogitea/copilot-instructions.joomla.md.template b/templates/mokogitea/copilot-instructions.joomla.md.template index 23107af..f91b25d 100644 --- a/templates/mokogitea/copilot-instructions.joomla.md.template +++ b/templates/mokogitea/copilot-instructions.joomla.md.template @@ -6,9 +6,9 @@ This file is part of a Moko Consulting project. SPDX-License-Identifier: GPL-3.0-or-later # FILE INFORMATION -DEFGROUP: MokoPlatform.Templates.GitHub -INGROUP: MokoPlatform.Templates -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Templates.GitHub +INGROUP: MokoCLI.Templates +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/mokogitea/copilot-instructions.joomla.md.template VERSION: XX.YY.ZZ BRIEF: GitHub Copilot custom instructions template for Joomla/MokoWaaS governed repositories @@ -20,7 +20,7 @@ NOTE: Synced to .gitea/copilot-instructions.md in all Joomla/WaaS repos via bulk > [!IMPORTANT] > **🔧 AI Self-Update Required on First Use** > -> This file may contain unfilled `{{TOKEN}}` placeholders. The moko-platform bulk-sync system +> This file may contain unfilled `{{TOKEN}}` placeholders. The MokoCLI bulk-sync system > replaces them automatically at sync time; if you can still see them, sync has not yet run for > this repository — or this is a brand-new repo. > @@ -48,7 +48,7 @@ NOTE: Synced to .gitea/copilot-instructions.md in all Joomla/WaaS repos via bulk ## What This Repo Is -This is a **Moko Consulting MokoWaaS** (Joomla) repository governed by [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform). All coding standards, workflows, and policies are defined there and enforced here via bulk sync. +This is a **Moko Consulting MokoWaaS** (Joomla) repository governed by [MokoCLI](https://git.mokoconsulting.tech/MokoConsulting/mokocli). All coding standards, workflows, and policies are defined there and enforced here via bulk sync. Repository URL: {{REPO_URL}} Extension name: **{{EXTENSION_NAME}}** @@ -239,18 +239,18 @@ token: ${{ secrets.GITHUB_TOKEN }} --- -## moko-platform Reference +## MokoCLI Reference -This repository is governed by [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform). Authoritative policies: +This repository is governed by [MokoCLI](https://git.mokoconsulting.tech/MokoConsulting/mokocli). Authoritative policies: | Document | Purpose | |----------|---------| -| [file-header-standards.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/file-header-standards.md) | Copyright-header rules for every file type | -| [coding-style-guide.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/coding-style-guide.md) | Naming and formatting conventions | -| [branching-strategy.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/branching-strategy.md) | Branch naming, hierarchy, and release workflow | -| [merge-strategy.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/merge-strategy.md) | Squash-merge policy and PR title/body conventions | -| [changelog-standards.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/changelog-standards.md) | How and when to update CHANGELOG.md | -| [joomla-development-guide.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/guide/waas/joomla-development-guide.md) | MokoWaaS Joomla extension development guide | +| [file-header-standards.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/file-header-standards.md) | Copyright-header rules for every file type | +| [coding-style-guide.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/coding-style-guide.md) | Naming and formatting conventions | +| [branching-strategy.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/branching-strategy.md) | Branch naming, hierarchy, and release workflow | +| [merge-strategy.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/merge-strategy.md) | Squash-merge policy and PR title/body conventions | +| [changelog-standards.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/changelog-standards.md) | How and when to update CHANGELOG.md | +| [joomla-development-guide.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/guide/waas/joomla-development-guide.md) | MokoWaaS Joomla extension development guide | --- diff --git a/templates/mokogitea/copilot-instructions.md.template b/templates/mokogitea/copilot-instructions.md.template index fc93f28..17011c8 100644 --- a/templates/mokogitea/copilot-instructions.md.template +++ b/templates/mokogitea/copilot-instructions.md.template @@ -6,9 +6,9 @@ This file is part of a Moko Consulting project. SPDX-License-Identifier: GPL-3.0-or-later # FILE INFORMATION -DEFGROUP: MokoPlatform.Templates.GitHub -INGROUP: MokoPlatform.Templates -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Templates.GitHub +INGROUP: MokoCLI.Templates +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/mokogitea/copilot-instructions.md.template VERSION: XX.YY.ZZ BRIEF: Standard GitHub Copilot custom instructions template for Moko Consulting governed repositories @@ -19,7 +19,7 @@ NOTE: Synced to .gitea/copilot-instructions.md in all governed repositories via > [!IMPORTANT] > **🔧 AI Self-Update Required on First Use** > -> This file may contain unfilled `{{TOKEN}}` placeholders. The moko-platform bulk-sync system +> This file may contain unfilled `{{TOKEN}}` placeholders. The MokoCLI bulk-sync system > replaces them automatically at sync time; if you can still see them, sync has not yet run for > this repository — or this is a brand-new repo. > @@ -46,7 +46,7 @@ NOTE: Synced to .gitea/copilot-instructions.md in all governed repositories via ## What This Repo Is -This is a **Moko Consulting** repository governed by [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform). All coding standards, workflows, and policies are defined there and enforced here via bulk sync. +This is a **Moko Consulting** repository governed by [MokoCLI](https://git.mokoconsulting.tech/MokoConsulting/mokocli). All coding standards, workflows, and policies are defined there and enforced here via bulk sync. Repository URL: {{REPO_URL}} Primary language: **{{PRIMARY_LANGUAGE}}** @@ -56,7 +56,7 @@ Platform type: **{{PLATFORM_TYPE}}** ## Primary Language -**{{PRIMARY_LANGUAGE}} is the primary language for this repository.** Follow the conventions documented in [moko-platform coding-style-guide](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/coding-style-guide.md). +**{{PRIMARY_LANGUAGE}} is the primary language for this repository.** Follow the conventions documented in [MokoCLI coding-style-guide](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/coding-style-guide.md). YAML uses 2-space indentation (spaces, not tabs). All other text files use tabs per `.editorconfig`. @@ -131,7 +131,7 @@ Each badge type has a designated color — no two types share the same color: | PHP | `777BB4` | `badge/PHP-8.2%2B-777BB4?logo=php` | | Joomla | `red` | `badge/Joomla-5.x-red?logo=joomla` | | Dolibarr | `red` | `badge/Dolibarr-20.x-red` | -| moko-platform | `orange` | `badge/moko--platform-04.06.00-orange` | +| MokoCLI | `orange` | `badge/moko--platform-04.06.00-orange` | --- @@ -161,14 +161,14 @@ PHP scripts read the token with: `getenv('GH_TOKEN') ?: getenv('GITHUB_TOKEN')` ## Composer Package (PHP repositories) -This repository requires the moko-platform enterprise library. The `composer.json` must include: +This repository requires the MokoCLI enterprise library. The `composer.json` must include: ```json { "repositories": [ { "type": "vcs", - "url": "https://git.mokoconsulting.tech/MokoConsulting/moko-platform" + "url": "https://git.mokoconsulting.tech/MokoConsulting/mokocli" } ], "require": { @@ -177,7 +177,7 @@ This repository requires the moko-platform enterprise library. The `composer.jso } ``` -Run `composer install` after adding the dependency. See [package-installation.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/guide/package-installation.md) for full instructions. +Run `composer install` after adding the dependency. See [package-installation.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/guide/package-installation.md) for full instructions. --- @@ -313,16 +313,16 @@ If your code change makes any existing doc sentence false or incomplete, fix the --- -## moko-platform Reference +## MokoCLI Reference -This repository is governed by [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform). Authoritative policies: +This repository is governed by [MokoCLI](https://git.mokoconsulting.tech/MokoConsulting/mokocli). Authoritative policies: | Document | Purpose | |----------|---------| -| [file-header-standards.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/file-header-standards.md) | Copyright-header rules for every file type | -| [coding-style-guide.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/coding-style-guide.md) | Naming and formatting conventions | -| [branching-strategy.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/branching-strategy.md) | Branch naming, hierarchy, and release workflow | -| [merge-strategy.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/merge-strategy.md) | Squash-merge policy and PR title/body conventions | -| [changelog-standards.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/changelog-standards.md) | How and when to update CHANGELOG.md | -| [scripting-standards.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/policy/scripting-standards.md) | PHP script requirements and CliFramework usage | -| [package-installation.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/guide/package-installation.md) | Installing `mokoconsulting/mokostandards` via Composer | +| [file-header-standards.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/file-header-standards.md) | Copyright-header rules for every file type | +| [coding-style-guide.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/coding-style-guide.md) | Naming and formatting conventions | +| [branching-strategy.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/branching-strategy.md) | Branch naming, hierarchy, and release workflow | +| [merge-strategy.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/merge-strategy.md) | Squash-merge policy and PR title/body conventions | +| [changelog-standards.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/changelog-standards.md) | How and when to update CHANGELOG.md | +| [scripting-standards.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/policy/scripting-standards.md) | PHP script requirements and CliFramework usage | +| [package-installation.md](https://git.mokoconsulting.tech/MokoConsulting/mokocli/blob/main/docs/guide/package-installation.md) | Installing `mokoconsulting/mokostandards` via Composer | diff --git a/templates/mokogitea/dependabot.yml.template b/templates/mokogitea/dependabot.yml.template index f4b3f02..b0e5d6b 100644 --- a/templates/mokogitea/dependabot.yml.template +++ b/templates/mokogitea/dependabot.yml.template @@ -6,8 +6,8 @@ # # FILE INFORMATION # DEFGROUP: GitHub.Dependabot -# INGROUP: MokoPlatform.Security -# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +# INGROUP: MokoCLI.Security +# REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli # PATH: /templates/mokogitea/dependabot.yml.template # VERSION: XX.YY.ZZ # BRIEF: Template Dependabot configuration for governed repositories diff --git a/templates/mokogitea/override.tf.template b/templates/mokogitea/override.tf.template index 43df6fd..05723f9 100644 --- a/templates/mokogitea/override.tf.template +++ b/templates/mokogitea/override.tf.template @@ -2,9 +2,9 @@ # Location: .gitea/override.tf # # This file allows repository-specific customization of health checks. -# It overrides the default configuration from moko-platform. +# It overrides the default configuration from MokoCLI. # -# AUTO-GENERATED: This file is automatically synced from moko-platform +# AUTO-GENERATED: This file is automatically synced from MokoCLI # To customize: Edit this file and it will be preserved on future syncs locals { diff --git a/templates/required/README.md b/templates/required/README.md index d74edc3..251d7f5 100644 --- a/templates/required/README.md +++ b/templates/required/README.md @@ -2,20 +2,20 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Index -INGROUP: MokoPlatform.Templates.Required -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Index +INGROUP: MokoCLI.Templates.Required +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/required/README.md BRIEF: Required templates README --> # Required Templates -This directory contains **REQUIRED** files that must be present in all moko-platform-compliant repositories. +This directory contains **REQUIRED** files that must be present in all MokoCLI-compliant repositories. ## Overview -Required templates are essential files that provide core functionality and ensure consistency across all repositories in the organization. These files must be copied to target repositories and kept synchronized with moko-platform updates. +Required templates are essential files that provide core functionality and ensure consistency across all repositories in the organization. These files must be copied to target repositories and kept synchronized with MokoCLI updates. ## Required Files @@ -28,11 +28,11 @@ Required templates are essential files that provide core functionality and ensur **Installation**: ```bash # Quick install -curl -fsSL https://raw.githubusercontent.com/MokoConsulting/moko-platform/main/templates/required/setup-labels.sh > scripts/maintenance/setup-labels.sh +curl -fsSL https://raw.githubusercontent.com/MokoConsulting/MokoCLI/main/templates/required/setup-labels.sh > scripts/maintenance/setup-labels.sh chmod +x scripts/maintenance/setup-labels.sh -# Or copy from moko-platform -cp /path/to/moko-platform/templates/required/setup-labels.sh scripts/maintenance/setup-labels.sh +# Or copy from MokoCLI +cp /path/to/MokoCLI/templates/required/setup-labels.sh scripts/maintenance/setup-labels.sh chmod +x scripts/maintenance/setup-labels.sh ``` @@ -50,7 +50,7 @@ chmod +x scripts/maintenance/setup-labels.sh - Project types (joomla, dolibarr, generic) - Languages (php, javascript, typescript, python, css, html) - Components (documentation, ci-cd, docker, tests, security, dependencies, config, build) -- Workflow (automation, moko-platform, needs-review, work-in-progress, breaking-change) +- Workflow (automation, MokoCLI, needs-review, work-in-progress, breaking-change) - Priority (critical, high, medium, low) - Type (bug, feature, enhancement, refactor, chore) - Status (pending, in-progress, blocked, on-hold, wontfix) @@ -95,10 +95,10 @@ done ### Automated Compliance -Use the moko-platform validation scripts: +Use the MokoCLI validation scripts: ```bash -# From moko-platform repository +# From MokoCLI repository python3 scripts/validate/validate_repo_health.py --check-required-files # Or use bulk validation @@ -107,14 +107,14 @@ php scripts/automation/bulk_update_repos.php --validate-only ## Syncing Updates -Required files should be kept in sync with moko-platform: +Required files should be kept in sync with MokoCLI: ```bash # Update single file -curl -fsSL https://raw.githubusercontent.com/MokoConsulting/moko-platform/main/templates/required/setup-labels.sh > scripts/maintenance/setup-labels.sh +curl -fsSL https://raw.githubusercontent.com/MokoConsulting/MokoCLI/main/templates/required/setup-labels.sh > scripts/maintenance/setup-labels.sh # Or use bulk sync -cd /path/to/moko-platform +cd /path/to/MokoCLI ./scripts/automation/bulk_update_repos.sh --org MokoConsulting --sync-required ``` @@ -123,26 +123,26 @@ cd /path/to/moko-platform To deploy required files to a repository using GitHub Copilot: ```markdown -Deploy required moko-platform files to this repository. +Deploy required MokoCLI files to this repository. Required files to deploy: 1. setup-labels.sh - Label deployment script Process: 1. Create scripts/maintenance/ directory if not exists -2. Download setup-labels.sh from MokoConsulting/moko-platform +2. Download setup-labels.sh from MokoConsulting/MokoCLI 3. Copy to scripts/maintenance/setup-labels.sh 4. Make executable: chmod +x scripts/maintenance/setup-labels.sh 5. Test with dry-run: ./scripts/maintenance/setup-labels.sh --dry-run 6. Deploy labels: ./scripts/maintenance/setup-labels.sh 7. Verify labels in repository settings -Source: https://git.mokoconsulting.tech/MokoConsulting/moko-platform/tree/main/templates/required +Source: https://git.mokoconsulting.tech/MokoConsulting/mokocli/tree/main/templates/required ``` ## Future Required Files -As moko-platform evolves, additional required files may be added: +As MokoCLI evolves, additional required files may be added: - **PLANNED**: `.github/labeler.yml` - Auto-labeling configuration - **PLANNED**: `.editorconfig` - Editor configuration @@ -153,7 +153,7 @@ As moko-platform evolves, additional required files may be added: - **Documentation**: [Copilot Sync Standards Guide](../../docs/guide/copilot-sync-standards.md) - **Label Guide**: [Label Deployment Guide](../../docs/guides/label-deployment.md) -- **Issues**: https://git.mokoconsulting.tech/MokoConsulting/moko-platform/issues +- **Issues**: https://git.mokoconsulting.tech/MokoConsulting/mokocli/issues - **Contact**: hello@mokoconsulting.tech ## Related Documentation @@ -167,4 +167,4 @@ As moko-platform evolves, additional required files may be added: **Last Updated**: 2026-01-28 **Version**: 03.01.00 -**Maintained By**: moko-platform Team +**Maintained By**: MokoCLI Team diff --git a/templates/schemas/README.md b/templates/schemas/README.md index b6dd2aa..f945101 100644 --- a/templates/schemas/README.md +++ b/templates/schemas/README.md @@ -2,9 +2,9 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Index -INGROUP: MokoPlatform.Templates.Schemas -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Index +INGROUP: MokoCLI.Templates.Schemas +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/schemas/README.md BRIEF: Schema templates README --> diff --git a/templates/schemas/manifest-schema.xsd b/templates/schemas/manifest-schema.xsd index b866f5b..a8e39b1 100644 --- a/templates/schemas/manifest-schema.xsd +++ b/templates/schemas/manifest-schema.xsd @@ -3,19 +3,19 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later - moko-platform Manifest Schema v09.01.00 + MokoCLI Manifest Schema v09.01.00 Defines the structure of .mokogitea/manifest.xml Validate: xmllint - -schema definitions/manifest-schema.xsd .mokogitea/manifest.xml --> - + diff --git a/templates/schemas/moko-platform-schema.xsd b/templates/schemas/moko-platform-schema.xsd index 537535f..42c6b5c 100644 --- a/templates/schemas/moko-platform-schema.xsd +++ b/templates/schemas/moko-platform-schema.xsd @@ -3,22 +3,22 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION - DEFGROUP: MokoPlatform.Schema - INGROUP: MokoPlatform.Governance - REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform - PATH: /templates/schemas/moko-platform-schema.xsd + DEFGROUP: MokoCLI.Schema + INGROUP: MokoCLI.Governance + REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli + PATH: /templates/schemas/MokoCLI-schema.xsd BRIEF: XML Schema Definition for the manifest.xml repository manifest file --> - + Root element of the manifest.xml repository manifest. @@ -27,7 +27,7 @@ - + @@ -76,12 +76,12 @@ - Binds this repository to a moko-platform platform definition and + Binds this repository to a MokoCLI platform definition and tracks the governance source and version. diff --git a/templates/schemas/mokostandards-schema.xsd b/templates/schemas/mokostandards-schema.xsd index 79dc408..b562f28 100644 --- a/templates/schemas/mokostandards-schema.xsd +++ b/templates/schemas/mokostandards-schema.xsd @@ -3,22 +3,22 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION - DEFGROUP: MokoPlatform.Schema - INGROUP: MokoPlatform.Governance - REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + DEFGROUP: MokoCLI.Schema + INGROUP: MokoCLI.Governance + REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /docs/standards/mokostandards-schema.xsd BRIEF: XML Schema Definition for the .mokostandards repository manifest file --> - + Root element of the .mokostandards repository manifest. @@ -27,7 +27,7 @@ - + @@ -76,12 +76,12 @@ - Binds this repository to a moko-platform platform definition and + Binds this repository to a MokoCLI platform definition and tracks the governance source and version. diff --git a/templates/schemas/schemas/README.md b/templates/schemas/schemas/README.md index 40e4113..39823e2 100644 --- a/templates/schemas/schemas/README.md +++ b/templates/schemas/schemas/README.md @@ -2,9 +2,9 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Index -INGROUP: MokoPlatform.Templates.Schemas -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Index +INGROUP: MokoCLI.Templates.Schemas +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/schemas/schemas/README.md BRIEF: Deprecated schema directory README --> diff --git a/templates/schemas/template-repository-structure.xml b/templates/schemas/template-repository-structure.xml index 9e656ca..4c7dba7 100644 --- a/templates/schemas/template-repository-structure.xml +++ b/templates/schemas/template-repository-structure.xml @@ -20,9 +20,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . FILE INFORMATION -DEFGROUP: MokoPlatform.Templates.Schemas -INGROUP: MokoPlatform.Templates -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Templates.Schemas +INGROUP: MokoCLI.Templates +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/schemas/template-repository-structure.xml BRIEF: Template for defining custom repository structure schemas --> diff --git a/templates/scripts/README.md b/templates/scripts/README.md index feb6bf0..110d864 100644 --- a/templates/scripts/README.md +++ b/templates/scripts/README.md @@ -2,9 +2,9 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Index -INGROUP: MokoPlatform.Templates.Scripts -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Index +INGROUP: MokoCLI.Templates.Scripts +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/scripts/README.md BRIEF: Script templates README --> @@ -116,7 +116,7 @@ These are template scripts. Adapt them to your project's specific needs: ## Standards Compliance -All scripts follow moko-platform requirements: +All scripts follow MokoCLI requirements: - SPDX license headers - GPL-3.0-or-later license diff --git a/templates/scripts/common/CliBase.template.php b/templates/scripts/common/CliBase.template.php index 15f013d..b995f8d 100644 --- a/templates/scripts/common/CliBase.template.php +++ b/templates/scripts/common/CliBase.template.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Templates.Common - * INGROUP: MokoPlatform.Templates - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Templates.Common + * INGROUP: MokoCLI.Templates + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /templates/scripts/common/CliBase.template.php * BRIEF: PHP CLI script template — extends MokoEnterprise\CliFramework * NOTE: Copy this file as a starting point for new PHP CLI scripts in governed repos. diff --git a/templates/scripts/fix/index.md b/templates/scripts/fix/index.md index 53c323c..7d4403d 100644 --- a/templates/scripts/fix/index.md +++ b/templates/scripts/fix/index.md @@ -2,9 +2,9 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Index -INGROUP: MokoPlatform.Templates.Scripts.Fix -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Index +INGROUP: MokoCLI.Templates.Scripts.Fix +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/scripts/fix/index.md BRIEF: Fix scripts directory index --> diff --git a/templates/scripts/index.md b/templates/scripts/index.md index ad222e3..585d7f8 100644 --- a/templates/scripts/index.md +++ b/templates/scripts/index.md @@ -2,9 +2,9 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Index -INGROUP: MokoPlatform.Templates.Scripts -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Index +INGROUP: MokoCLI.Templates.Scripts +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/scripts/index.md BRIEF: Script templates directory index --> diff --git a/templates/scripts/release/index.md b/templates/scripts/release/index.md index ba6b630..5f1bb16 100644 --- a/templates/scripts/release/index.md +++ b/templates/scripts/release/index.md @@ -2,9 +2,9 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Index -INGROUP: MokoPlatform.Templates.Scripts.Release -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Index +INGROUP: MokoCLI.Templates.Scripts.Release +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/scripts/release/index.md BRIEF: Release scripts directory index --> diff --git a/templates/scripts/release/package_dolibarr.php b/templates/scripts/release/package_dolibarr.php index 5109f1b..09ee1a2 100644 --- a/templates/scripts/release/package_dolibarr.php +++ b/templates/scripts/release/package_dolibarr.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Templates.Scripts.Release - * INGROUP: MokoPlatform.Templates - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Templates.Scripts.Release + * INGROUP: MokoCLI.Templates + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /templates/scripts/release/package_dolibarr.php * BRIEF: Build a distributable ZIP package for a Dolibarr module * NOTE: Deployed to bin/build_package.php in governed Dolibarr module repos. diff --git a/templates/scripts/release/package_joomla.php b/templates/scripts/release/package_joomla.php index 9b8352c..228db7f 100644 --- a/templates/scripts/release/package_joomla.php +++ b/templates/scripts/release/package_joomla.php @@ -8,9 +8,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Templates.Scripts.Release - * INGROUP: MokoPlatform.Templates - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Templates.Scripts.Release + * INGROUP: MokoCLI.Templates + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /templates/scripts/release/package_joomla.php * BRIEF: Build a distributable ZIP package for a Joomla component * NOTE: Deployed to bin/build_package.php in governed WaaS component repos. diff --git a/templates/scripts/sftp-config/README.md b/templates/scripts/sftp-config/README.md index 1a4c1f3..31a0565 100644 --- a/templates/scripts/sftp-config/README.md +++ b/templates/scripts/sftp-config/README.md @@ -6,9 +6,9 @@ This file is part of a Moko Consulting project. SPDX-License-Identifier: GPL-3.0-or-later # FILE INFORMATION -DEFGROUP: MokoPlatform.Templates.Scripts -INGROUP: MokoPlatform.Templates -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Templates.Scripts +INGROUP: MokoCLI.Templates +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/scripts/sftp-config/README.md BRIEF: Setup guide for local SFTP deployment configuration files --> @@ -26,14 +26,14 @@ GitHub Actions workflows. ## Quick Setup -1. **Copy the example templates** from moko-platform: +1. **Copy the example templates** from MokoCLI: ```bash # From your repo root mkdir -p scripts/sftp-config scripts/keys - cp path/to/moko-platform/templates/scripts/deploy/sftp-config.dev.json.example \ + cp path/to/MokoCLI/templates/scripts/deploy/sftp-config.dev.json.example \ scripts/sftp-config/sftp-config.dev.json - cp path/to/moko-platform/templates/scripts/deploy/sftp-config.rs.json.example \ + cp path/to/MokoCLI/templates/scripts/deploy/sftp-config.rs.json.example \ scripts/sftp-config/sftp-config.rs.json ``` @@ -76,21 +76,21 @@ GitHub Actions workflows. ```bash # Preview what would be uploaded (no connection made) -php path/to/moko-platform/api/deploy/deploy-sftp.php \ +php path/to/MokoCLI/api/deploy/deploy-sftp.php \ --path . --env dev --dry-run --verbose # Deploy src/ to dev -php path/to/moko-platform/api/deploy/deploy-sftp.php \ +php path/to/MokoCLI/api/deploy/deploy-sftp.php \ --path . --env dev # Deploy src/ to production -php path/to/moko-platform/api/deploy/deploy-sftp.php \ +php path/to/MokoCLI/api/deploy/deploy-sftp.php \ --path . --env rs ``` For full option reference run: ```bash -php path/to/moko-platform/api/deploy/deploy-sftp.php --help +php path/to/MokoCLI/api/deploy/deploy-sftp.php --help ``` --- diff --git a/templates/scripts/validate/dolibarr_module.php b/templates/scripts/validate/dolibarr_module.php index d9e3e87..90d442a 100644 --- a/templates/scripts/validate/dolibarr_module.php +++ b/templates/scripts/validate/dolibarr_module.php @@ -8,11 +8,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Templates.Scripts.Validate - * INGROUP: MokoPlatform.Templates - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Templates.Scripts.Validate + * INGROUP: MokoCLI.Templates + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /templates/scripts/validate/dolibarr_module.php - * BRIEF: Validate a Dolibarr module repository against moko-platform requirements + * BRIEF: Validate a Dolibarr module repository against MokoCLI requirements * NOTE: Deployed to bin/validate_module.php in governed Dolibarr module repos. * Run: php bin/validate_module.php [--path DIR] [--verbose] [--json] */ @@ -25,7 +25,7 @@ require_once __DIR__ . '/../vendor/autoload.php'; use MokoEnterprise\CliFramework; /** - * Validates a Dolibarr module repository against moko-platform requirements. + * Validates a Dolibarr module repository against MokoCLI requirements. * * Checks performed: * - Required directories (src/, src/core/modules/, langs/en_US/, img/) @@ -39,7 +39,7 @@ class ValidateDolibarrModule extends CliFramework { protected function configure(): void { - $this->setDescription('Validate a Dolibarr module repository against moko-platform requirements'); + $this->setDescription('Validate a Dolibarr module repository against MokoCLI requirements'); $this->addArgument('--path', 'Repository root to validate', '.'); } @@ -173,5 +173,5 @@ class ValidateDolibarrModule extends CliFramework } } -$script = new ValidateDolibarrModule('validate_module', 'Validate a Dolibarr module repository against moko-platform requirements'); +$script = new ValidateDolibarrModule('validate_module', 'Validate a Dolibarr module repository against MokoCLI requirements'); exit($script->execute()); diff --git a/templates/scripts/validate/index.md b/templates/scripts/validate/index.md index c2562b7..036b951 100644 --- a/templates/scripts/validate/index.md +++ b/templates/scripts/validate/index.md @@ -2,9 +2,9 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Index -INGROUP: MokoPlatform.Templates.Scripts.Validate -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Index +INGROUP: MokoCLI.Templates.Scripts.Validate +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/scripts/validate/index.md BRIEF: Validate scripts directory index --> diff --git a/templates/scripts/validate/validate_manifest.php b/templates/scripts/validate/validate_manifest.php index e6b7dea..dbc382e 100644 --- a/templates/scripts/validate/validate_manifest.php +++ b/templates/scripts/validate/validate_manifest.php @@ -8,11 +8,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Templates.Scripts.Validate - * INGROUP: MokoPlatform.Templates - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Templates.Scripts.Validate + * INGROUP: MokoCLI.Templates + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /templates/scripts/validate/validate_manifest.php - * BRIEF: Validate a Joomla component XML manifest against moko-platform requirements + * BRIEF: Validate a Joomla component XML manifest against MokoCLI requirements * NOTE: Deployed to bin/validate_manifest.php in governed WaaS component repos. * Run: php bin/validate_manifest.php [--path DIR] [--verbose] */ @@ -25,7 +25,7 @@ require_once __DIR__ . '/../vendor/autoload.php'; use MokoEnterprise\CliFramework; /** - * Validates a Joomla component XML manifest against moko-platform requirements. + * Validates a Joomla component XML manifest against MokoCLI requirements. * * Checks performed: * - XML manifest exists and is well-formed @@ -41,7 +41,7 @@ class ValidateJoomlaManifest extends CliFramework { protected function configure(): void { - $this->setDescription('Validate a Joomla component XML manifest against moko-platform requirements'); + $this->setDescription('Validate a Joomla component XML manifest against MokoCLI requirements'); $this->addArgument('--path', 'Repository root to validate', '.'); } @@ -188,5 +188,5 @@ class ValidateJoomlaManifest extends CliFramework } } -$script = new ValidateJoomlaManifest('validate_manifest', 'Validate a Joomla component XML manifest against moko-platform requirements'); +$script = new ValidateJoomlaManifest('validate_manifest', 'Validate a Joomla component XML manifest against MokoCLI requirements'); exit($script->execute()); diff --git a/templates/scripts/validate/validate_structure.php b/templates/scripts/validate/validate_structure.php index f1dbf08..b83c416 100644 --- a/templates/scripts/validate/validate_structure.php +++ b/templates/scripts/validate/validate_structure.php @@ -8,11 +8,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Templates.Scripts.Validate - * INGROUP: MokoPlatform.Templates - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Templates.Scripts.Validate + * INGROUP: MokoCLI.Templates + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /templates/scripts/validate/validate_structure.php - * BRIEF: Validate a repository structure against moko-platform requirements + * BRIEF: Validate a repository structure against MokoCLI requirements * NOTE: Deployed to bin/validate_structure.php in governed generic/default repos. * Run: php bin/validate_structure.php [--path DIR] [--verbose] */ @@ -25,7 +25,7 @@ require_once __DIR__ . '/../vendor/autoload.php'; use MokoEnterprise\CliFramework; /** - * Validates a generic repository structure against moko-platform requirements. + * Validates a generic repository structure against MokoCLI requirements. * * Checks performed: * - Required root files present (README.md, CHANGELOG.md, LICENSE, CONTRIBUTING.md, @@ -40,7 +40,7 @@ class ValidateStructure extends CliFramework { protected function configure(): void { - $this->setDescription('Validate a repository structure against moko-platform requirements'); + $this->setDescription('Validate a repository structure against MokoCLI requirements'); $this->addArgument('--path', 'Repository root to validate', '.'); } @@ -72,7 +72,7 @@ class ValidateStructure extends CliFramework } // ── Governance attachment ───────────────────────────────────────── - $this->section('moko-platform governance'); + $this->section('MokoCLI governance'); $mokoFile = file_exists("{$path}/.mokogitea/manifest.xml") || file_exists("{$path}/.github/.mokostandards") || file_exists("{$path}/.mokostandards"); @@ -87,7 +87,7 @@ class ValidateStructure extends CliFramework ? "{$path}/.github/.mokostandards" : "{$path}/.mokostandards"); $manifestContent = file_get_contents($manifestPath); - $isXml = str_contains($manifestContent, 'status($isXml, 'manifest.xml uses XML format'); $isXml ? $passed++ : $failed++; } @@ -172,5 +172,5 @@ class ValidateStructure extends CliFramework } } -$script = new ValidateStructure('validate_structure', 'Validate a repository structure against moko-platform requirements'); +$script = new ValidateStructure('validate_structure', 'Validate a repository structure against MokoCLI requirements'); exit($script->execute()); diff --git a/templates/security/README.md b/templates/security/README.md index b39bff8..ff9e8a8 100644 --- a/templates/security/README.md +++ b/templates/security/README.md @@ -2,16 +2,16 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoPlatform.Index -INGROUP: MokoPlatform.Templates.Security -REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform +DEFGROUP: MokoCLI.Index +INGROUP: MokoCLI.Templates.Security +REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli PATH: /templates/security/README.md BRIEF: Security templates README --> # Security Templates -This directory contains security-related templates for moko-platform repositories. +This directory contains security-related templates for MokoCLI repositories. ## index.html - Directory Listing Prevention (Static) diff --git a/templates/security/index.php b/templates/security/index.php index 5abfa6a..020d58c 100644 --- a/templates/security/index.php +++ b/templates/security/index.php @@ -6,9 +6,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Templates.Security - * INGROUP: MokoPlatform.Templates - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Templates.Security + * INGROUP: MokoCLI.Templates + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /templates/security/index.php * BRIEF: Directory listing prevention script * diff --git a/templates/stubs/dolibarr.php b/templates/stubs/dolibarr.php index 44fe174..21f2372 100644 --- a/templates/stubs/dolibarr.php +++ b/templates/stubs/dolibarr.php @@ -5,9 +5,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Stubs - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Stubs + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /templates/stubs/dolibarr.php * BRIEF: PHPStan stub declarations for Dolibarr core classes * diff --git a/templates/stubs/joomla.php b/templates/stubs/joomla.php index 4a32846..8712df1 100644 --- a/templates/stubs/joomla.php +++ b/templates/stubs/joomla.php @@ -5,9 +5,9 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoPlatform.Stubs - * INGROUP: MokoPlatform - * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * DEFGROUP: MokoCLI.Stubs + * INGROUP: MokoCLI + * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /templates/stubs/joomla.php * BRIEF: PHPStan stub declarations for Joomla framework classes * diff --git a/templates/web/index.php b/templates/web/index.php index c2ce465..339fd9c 100644 --- a/templates/web/index.php +++ b/templates/web/index.php @@ -5,14 +5,14 @@ declare(strict_types=1); /** * Web Application Entry Point * - * This is the main entry point for the moko-platform web-based management system. + * This is the main entry point for the MokoCLI web-based management system. * Handles all HTTP requests and routes them to appropriate controllers. * * Copyright (C) 2026 Moko Consulting * * SPDX-License-Identifier: GPL-3.0-or-later * - * @package MokoPlatform + * @package MokoCLI * @version 04.00.04 */ @@ -90,7 +90,7 @@ function handleDashboard(): Response - moko-platform - Repository Management + MokoCLI - Repository Management