diff --git a/.mokogitea/ISSUE_TEMPLATE/documentation.md b/.mokogitea/ISSUE_TEMPLATE/documentation.md index ed4dabc..648dab9 100644 --- a/.mokogitea/ISSUE_TEMPLATE/documentation.md +++ b/.mokogitea/ISSUE_TEMPLATE/documentation.md @@ -42,7 +42,7 @@ Suggested text here ## Standards Alignment -- [ ] Follows MokoStandards documentation guidelines +- [ ] Follows moko-platform 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 20544f9..6d691a0 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 [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/moko-platform)? +Does this relate to any standards in [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform)? - [ ] 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 6cdd84f..56b6573 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 [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/moko-platform)? +Does this relate to security standards in [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform)? - [ ] SPDX license identifiers - [ ] Secret management - [ ] Dependency security diff --git a/.mokogitea/branch-protection.yml b/.mokogitea/branch-protection.yml index 2dff8b9..d1bbbaf 100644 --- a/.mokogitea/branch-protection.yml +++ b/.mokogitea/branch-protection.yml @@ -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 MokoStandards moko-platform MokoTesting" + EXCLUDE="gitea-org-config org-profile gitea-private .mokogitea-private moko-platform 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/renovate.yml b/.mokogitea/renovate.yml index dd05e74..726dd4f 100644 --- a/.mokogitea/renovate.yml +++ b/.mokogitea/renovate.yml @@ -61,7 +61,7 @@ jobs: run: | API="${GITEA_URL}/api/v1" - EXCLUDE="gitea-org-config org-profile gitea-private .mokogitea-private MokoStandards moko-platform MokoTesting" + EXCLUDE="gitea-org-config org-profile gitea-private .mokogitea-private moko-platform 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/workflows/auto-bump.yml b/.mokogitea/workflows/auto-bump.yml index fb9dc82..28c50f4 100644 --- a/.mokogitea/workflows/auto-bump.yml +++ b/.mokogitea/workflows/auto-bump.yml @@ -7,7 +7,7 @@ # INGROUP: moko-platform.Release # REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform # PATH: /.mokogitea/workflows/auto-bump.yml -# VERSION: 09.02.00 +# VERSION: 09.22.00 # BRIEF: Auto patch-bump version on every push to dev (skips merge commits) name: "Universal: Auto Version Bump" diff --git a/.mokogitea/workflows/auto-release.yml b/.mokogitea/workflows/auto-release.yml index 1227ff8..779e493 100644 --- a/.mokogitea/workflows/auto-release.yml +++ b/.mokogitea/workflows/auto-release.yml @@ -7,7 +7,7 @@ # 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 +# VERSION: 09.22.00 # BRIEF: Universal build & release � detects platform from manifest.xml # # +========================================================================+ diff --git a/.mokogitea/workflows/branch-cleanup.yml b/.mokogitea/workflows/branch-cleanup.yml index e0ba128..54d2c03 100644 --- a/.mokogitea/workflows/branch-cleanup.yml +++ b/.mokogitea/workflows/branch-cleanup.yml @@ -4,10 +4,10 @@ # # FILE INFORMATION # DEFGROUP: Gitea.Workflow -# INGROUP: MokoStandards.Universal +# INGROUP: MokoPlatform.Universal # REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform # PATH: /.mokogitea/workflows/branch-cleanup.yml -# VERSION: 01.00.00 +# VERSION: 09.22.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 1585aa4..e258094 100644 --- a/.mokogitea/workflows/ci-platform.yml +++ b/.mokogitea/workflows/ci-platform.yml @@ -7,11 +7,11 @@ # INGROUP: moko-platform.CI # REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform # PATH: /.gitea/workflows/ci-platform.yml -# VERSION: 01.00.00 +# VERSION: 09.22.00 # BRIEF: moko-platform CI — the standards engine validates itself # # +========================================================================+ -# | MOKOSTANDARDS PLATFORM CI | +# | MOKO-PLATFORM CI | # +========================================================================+ # | | # | This is NOT a generic CI workflow. This is the self-validation | diff --git a/.mokogitea/workflows/cleanup.yml b/.mokogitea/workflows/cleanup.yml index 29ca4d4..596905f 100644 --- a/.mokogitea/workflows/cleanup.yml +++ b/.mokogitea/workflows/cleanup.yml @@ -7,7 +7,7 @@ # INGROUP: moko-platform.Maintenance # REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform # PATH: /.gitea/workflows/cleanup.yml -# VERSION: 01.00.00 +# VERSION: 09.22.00 # BRIEF: Scheduled cleanup — delete merged branches and old workflow runs name: "Universal: Repository Cleanup" diff --git a/.mokogitea/workflows/gitleaks.yml b/.mokogitea/workflows/gitleaks.yml index e0fdd1d..3a34a8a 100644 --- a/.mokogitea/workflows/gitleaks.yml +++ b/.mokogitea/workflows/gitleaks.yml @@ -7,7 +7,7 @@ # INGROUP: moko-platform.Security # REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/moko-platform # PATH: /templates/workflows/gitleaks.yml.template -# VERSION: 01.00.00 +# VERSION: 09.22.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 4690492..afda8d5 100644 --- a/.mokogitea/workflows/issue-branch.yml +++ b/.mokogitea/workflows/issue-branch.yml @@ -5,7 +5,7 @@ # FILE INFORMATION # DEFGROUP: Gitea.Workflow # INGROUP: moko-platform.Automation -# VERSION: 09.21.00 +# VERSION: 09.22.00 # 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 cde4541..9933965 100644 --- a/.mokogitea/workflows/notify.yml +++ b/.mokogitea/workflows/notify.yml @@ -7,7 +7,7 @@ # INGROUP: moko-platform.Notifications # REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform # PATH: /.gitea/workflows/notify.yml -# VERSION: 01.00.00 +# VERSION: 09.22.00 # BRIEF: Push notifications via ntfy on release success or workflow failure name: "Universal: Notifications" diff --git a/.mokogitea/workflows/pr-check.yml b/.mokogitea/workflows/pr-check.yml index ce64a27..48f1bd6 100644 --- a/.mokogitea/workflows/pr-check.yml +++ b/.mokogitea/workflows/pr-check.yml @@ -7,7 +7,7 @@ # INGROUP: moko-platform.CI # REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/moko-platform # PATH: /templates/workflows/universal/pr-check.yml.template -# VERSION: 05.00.00 +# VERSION: 09.22.00 # BRIEF: PR gate — branch policy + code validation before merge name: "Universal: PR Check" diff --git a/.mokogitea/workflows/pre-release.yml b/.mokogitea/workflows/pre-release.yml index 162b08f..6208b20 100644 --- a/.mokogitea/workflows/pre-release.yml +++ b/.mokogitea/workflows/pre-release.yml @@ -7,7 +7,7 @@ # INGROUP: moko-platform.Release # REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform # PATH: /templates/workflows/universal/pre-release.yml.template -# VERSION: 05.01.00 +# VERSION: 09.22.00 # BRIEF: Manual pre-release -- builds dev/alpha/beta/rc packages from any branch name: "Universal: Pre-Release" diff --git a/.mokogitea/workflows/repo-health.yml b/.mokogitea/workflows/repo-health.yml index be52e37..dba1f5d 100644 --- a/.mokogitea/workflows/repo-health.yml +++ b/.mokogitea/workflows/repo-health.yml @@ -10,7 +10,7 @@ # INGROUP: moko-platform.Validation # REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/moko-platform # PATH: /templates/workflows/joomla/repo_health.yml.template -# VERSION: 04.06.00 +# VERSION: 09.22.00 # BRIEF: Enforces repository guardrails by validating release configuration, scripts governance, tooling availability, and core repository health artifacts. # ============================================================================ diff --git a/.mokogitea/workflows/security-audit.yml b/.mokogitea/workflows/security-audit.yml index 714d407..d78edb2 100644 --- a/.mokogitea/workflows/security-audit.yml +++ b/.mokogitea/workflows/security-audit.yml @@ -7,7 +7,7 @@ # INGROUP: moko-platform.Security # REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform # PATH: /.gitea/workflows/security-audit.yml -# VERSION: 01.00.00 +# VERSION: 09.22.00 # BRIEF: Dependency vulnerability scanning for composer and npm packages name: "Universal: Security Audit" diff --git a/.mokogitea/workflows/update-server.yml b/.mokogitea/workflows/update-server.yml index 339d3f5..4382731 100644 --- a/.mokogitea/workflows/update-server.yml +++ b/.mokogitea/workflows/update-server.yml @@ -7,7 +7,7 @@ # INGROUP: moko-platform.Universal # REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform # PATH: /templates/workflows/update-server.yml -# VERSION: 05.00.00 +# VERSION: 09.22.00 # BRIEF: Pre-release build + update server XML for dev/alpha/beta/rc branches # # Thin wrapper around moko-platform CLI tools. diff --git a/.script-registry.json b/.script-registry.json index 618c467..2281cfb 100644 --- a/.script-registry.json +++ b/.script-registry.json @@ -1,7 +1,7 @@ { "metadata": { "generated_at": "2026-03-10T19:51:42.238134Z", - "repository": "mokoconsulting-tech/MokoStandards", + "repository": "MokoConsulting/moko-platform", "version": "1.0.0" }, "scripts": [ diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a6b7fc..bd66837 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,11 @@ BRIEF: Release changelog --> # Changelog + ## [Unreleased] +## [09.22.00] --- 2026-05-31 + ### Changed - **refactor(cli):** migrate 64 legacy scripts to CliFramework (#235) — all tools in cli/, automation/, maintenance/, deploy/, release/ now extend CliFramework with free --help, --verbose, --quiet, --dry-run, --json, banners, and coloured logging diff --git a/PLUGIN_SCRIPTS.md b/PLUGIN_SCRIPTS.md index b991eba..d016426 100644 --- a/PLUGIN_SCRIPTS.md +++ b/PLUGIN_SCRIPTS.md @@ -2,8 +2,8 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoStandards.Root -INGROUP: MokoStandards +DEFGROUP: MokoPlatform.Root +INGROUP: MokoPlatform REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform PATH: /PLUGIN_SCRIPTS.md BRIEF: Plugin system CLI documentation @@ -11,7 +11,7 @@ BRIEF: Plugin system CLI documentation # Plugin System CLI Scripts -Command-line scripts for validating, health checking, and managing projects using the MokoStandards plugin system. +Command-line scripts for validating, health checking, and managing projects using the moko-platform plugin system. ## Available Scripts diff --git a/README.md b/README.md index e545f0d..fa5b435 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: MokoStandards.Root -INGROUP: MokoStandards +DEFGROUP: MokoPlatform.Root +INGROUP: MokoPlatform REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform PATH: /README.md -VERSION: 09.21.00 +VERSION: 09.22.00 BRIEF: Project overview and documentation --> -# MokoStandards Enterprise API +# moko-platform 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 MokoStandards — enterprise standards, automation framework, workflow templates, and bulk sync tooling. +PHP implementation of moko-platform — 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 7a220ad..8e02640 100644 --- a/analysis/index.md +++ b/analysis/index.md @@ -2,8 +2,8 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoStandards.Index -INGROUP: MokoStandards.Analysis +DEFGROUP: MokoPlatform.Index +INGROUP: MokoPlatform.Analysis REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform PATH: /analysis/index.md BRIEF: Analysis directory index diff --git a/automation/bulk_joomla_template.php b/automation/bulk_joomla_template.php index 2f29d3e..5688281 100644 --- a/automation/bulk_joomla_template.php +++ b/automation/bulk_joomla_template.php @@ -9,8 +9,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Automation - * INGROUP: MokoStandards.Scripts + * DEFGROUP: MokoPlatform.Automation + * INGROUP: MokoPlatform.Scripts * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 MokoStandards files to existing template repositories + * --sync: Push moko-platform files to existing template repositories * --list: List all repositories tagged as joomla-template * * Works with both GitHub and Gitea via the PlatformAdapterFactory. @@ -50,7 +50,7 @@ use MokoEnterprise\{ class BulkJoomlaTemplate extends CliFramework { public const DEFAULT_ORG = 'MokoConsulting'; - public const VERSION = '04.06.10'; + public const VERSION = '09.22.00'; private GitPlatformAdapter $adapter; private Config $config; @@ -318,7 +318,7 @@ class BulkJoomlaTemplate extends CliFramework $name, $path, $content, - "chore: update {$path} from MokoStandards", + "chore: update {$path} from moko-platform", $existingSha, $branch ); diff --git a/automation/bulk_sync.php b/automation/bulk_sync.php index 76e4099..628a89d 100755 --- a/automation/bulk_sync.php +++ b/automation/bulk_sync.php @@ -9,8 +9,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Automation - * INGROUP: MokoStandards.Scripts + * DEFGROUP: MokoPlatform.Automation + * INGROUP: MokoPlatform.Scripts * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /automation/bulk_sync.php * BRIEF: Enterprise-grade bulk repository synchronization @@ -42,7 +42,7 @@ use MokoEnterprise\{ /** * Bulk Repository Synchronization Tool * - * Synchronizes MokoStandards files across multiple repositories using + * Synchronizes moko-platform files across multiple repositories using * the Enterprise library for robust, audited operations. */ class BulkSync extends CliFramework @@ -57,7 +57,7 @@ class BulkSync extends CliFramework * Script version number * Public to allow script instantiation with class constants */ - public const VERSION = '04.06.00'; + public const VERSION = '09.22.00'; public const VERSION_MINOR = '04.05'; private ApiClient $api; @@ -95,7 +95,7 @@ class BulkSync extends CliFramework */ protected function run(): int { - $this->log("🚀 MokoStandards Bulk Synchronization v" . self::VERSION, 'INFO'); + $this->log("🚀 moko-platform 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 MokoStandards + // Create/update tracking issue in moko-platform $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 = ['MokoStandards', '.github-private']; + private const ALWAYS_EXCLUDE = ['moko-platform', '.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 MokoStandards configuration", 'ERROR'); + $this->log(" 2. Apply file updates based on moko-platform 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 MokoStandards labels exist on a target repository. + * Ensure all standard moko-platform 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'], - ['mokostandards', 'B60205', 'MokoStandards compliance'], + ['moko-platform', 'B60205', 'moko-platform 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', 'MokoStandards sync update'], - ['standards-drift', 'FBCA04', 'Repository drifted from MokoStandards'], + ['standards-update', 'B60205', 'moko-platform sync update'], + ['standards-drift', 'FBCA04', 'Repository drifted from moko-platform'], ['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 'mokostandards' label, it was + // Quick check: if the repo already has the 'moko-platform' label, it was // provisioned previously — skip the expensive full label provisioning. try { - $probe = $this->api->get("/repos/{$org}/{$repo}/labels/mokostandards"); + $probe = $this->api->get("/repos/{$org}/{$repo}/labels/moko-platform"); 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-mokostandards-'; + $syncBranchPrefix = 'chore/sync-moko-platform-'; 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} (MokoStandards sync)", + 'commit_message' => "chore: merge {$defaultBranch} into {$branch} (moko-platform 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 - * MokoStandards version that was applied — giving each repo a clear audit + * moko-platform 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, 'MokoStandards'); - $branchName = 'chore/sync-mokostandards-v' . $minor; + $source = $this->adapter->getRepoWebUrl($org, 'moko-platform'); + $branchName = 'chore/sync-moko-platform-v' . $minor; $branchLink = $this->adapter->getBranchWebUrl($org, $repo, $branchName); - $title = "chore: MokoStandards v{$minor} sync tracking"; + $title = "chore: moko-platform v{$minor} sync tracking"; $body = <<resolveLabelIds($org, $repo, $labelNames); try { @@ -1213,7 +1213,7 @@ class BulkSync extends CliFramework } /** - * Create a tracking issue in MokoStandards for this sync run. + * Create a tracking issue in moko-platform 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: MokoStandards v" . self::VERSION_MINOR . " bulk sync report"; + $title = "sync: moko-platform 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}/MokoStandards/issues", [ + $existing = $this->api->get("/repos/{$org}/moko-platform/issues", [ 'labels' => 'sync-report', 'state' => 'all', 'per_page' => 1, @@ -1309,8 +1309,8 @@ class BulkSync extends CliFramework 'direction' => 'desc', ]); - $labelNames = ['sync-report', 'mokostandards', 'type: chore', 'automation']; - $labels = $this->resolveLabelIds($org, 'MokoStandards', $labelNames); + $labelNames = ['sync-report', 'moko-platform', 'type: chore', 'automation']; + $labels = $this->resolveLabelIds($org, 'moko-platform', $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}/MokoStandards/issues/{$issueNumber}", $patch); + $this->api->patch("/repos/{$org}/moko-platform/issues/{$issueNumber}", $patch); try { - $this->api->post("/repos/{$org}/MokoStandards/issues/{$issueNumber}/labels", ['labels' => $labels]); + $this->api->post("/repos/{$org}/moko-platform/issues/{$issueNumber}/labels", ['labels' => $labels]); } catch (\Exception $le) { /* non-fatal */ } - $this->log("📋 Sync report issue updated: {$org}/MokoStandards#{$issueNumber}", 'INFO'); + $this->log("📋 Sync report issue updated: {$org}/moko-platform#{$issueNumber}", 'INFO'); } else { - $issue = $this->api->post("/repos/{$org}/MokoStandards/issues", [ + $issue = $this->api->post("/repos/{$org}/moko-platform/issues", [ 'title' => $title, 'body' => $body, 'labels' => $labels, 'assignees' => ['jmiller'], ]); $issueNumber = $issue['number'] ?? '?'; - $this->log("📋 Sync report issue created: {$org}/MokoStandards#{$issueNumber}", 'INFO'); + $this->log("📋 Sync report issue created: {$org}/moko-platform#{$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 MokoStandards when repos fail to sync. + * Create or update a failure issue in moko-platform 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}/MokoStandards/issues", [ + $existing = $this->api->get("/repos/{$org}/moko-platform/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}/MokoStandards/issues/{$num}", $patch); - $this->log("🚨 Failure issue #{$num} updated: {$org}/MokoStandards#{$num}", 'WARN'); + $this->api->patch("/repos/{$org}/moko-platform/issues/{$num}", $patch); + $this->log("🚨 Failure issue #{$num} updated: {$org}/moko-platform#{$num}", 'WARN'); } else { - $issue = $this->api->post("/repos/{$org}/MokoStandards/issues", [ + $issue = $this->api->post("/repos/{$org}/moko-platform/issues", [ 'title' => $title, 'body' => $body, - 'labels' => $this->resolveLabelIds($org, 'MokoStandards', ['sync-failure']), + 'labels' => $this->resolveLabelIds($org, 'moko-platform', ['sync-failure']), 'assignees' => ['jmiller'], ]); $num = $issue['number'] ?? '?'; - $this->log("🚨 Failure issue created: {$org}/MokoStandards#{$num}", 'WARN'); + $this->log("🚨 Failure issue created: {$org}/moko-platform#{$num}", 'WARN'); } } catch (\Exception $e) { $this->log("⚠️ Could not create/update failure issue: " . $e->getMessage(), 'WARN'); diff --git a/automation/index.md b/automation/index.md index 31b76d1..f61d3d6 100644 --- a/automation/index.md +++ b/automation/index.md @@ -2,8 +2,8 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoStandards.Index -INGROUP: MokoStandards.Automation +DEFGROUP: MokoPlatform.Index +INGROUP: MokoPlatform.Automation REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform PATH: /automation/index.md BRIEF: Automation directory index diff --git a/automation/migrate_to_gitea.php b/automation/migrate_to_gitea.php index 780a9c1..d2f1c51 100644 --- a/automation/migrate_to_gitea.php +++ b/automation/migrate_to_gitea.php @@ -8,8 +8,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Automation - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Automation + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /automation/migrate_to_gitea.php * BRIEF: Migrate repositories from GitHub to self-hosted Gitea instance @@ -17,7 +17,7 @@ * 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 MokoStandards --skip-archived + * php automation/migrate_to_gitea.php --exclude moko-platform --skip-archived * php automation/migrate_to_gitea.php --resume */ @@ -278,7 +278,7 @@ class MigrateToGitea extends CliFramework try { $this->gitea->createIssue( $giteaOrg, - 'MokoStandards', + 'moko-platform', '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 5f7c554..6614627 100644 --- a/automation/push_files.php +++ b/automation/push_files.php @@ -9,8 +9,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Automation - * INGROUP: MokoStandards.Scripts + * DEFGROUP: MokoPlatform.Automation + * INGROUP: MokoPlatform.Scripts * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 MokoStandards templates to one or + * Pushes one or more specific files from moko-platform 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 @@ -53,7 +53,7 @@ use MokoEnterprise\{ class PushFiles extends CliFramework { public const DEFAULT_ORG = 'MokoConsulting'; - public const VERSION = '04.06.00'; + public const VERSION = '09.22.00'; private ApiClient $api; private GitPlatformAdapter $adapter; @@ -81,7 +81,7 @@ class PushFiles extends CliFramework */ protected function run(): int { - $this->log('📦 MokoStandards File Push v' . self::VERSION, 'INFO'); + $this->log('📦 moko-platform File Push v' . self::VERSION, 'INFO'); if (!$this->initializeComponents()) { return 1; @@ -336,7 +336,7 @@ class PushFiles extends CliFramework $prNumber = null; if (!$direct) { - $prTitle = "chore: push " . count($entries) . " file(s) from MokoStandards"; + $prTitle = "chore: push " . count($entries) . " file(s) from moko-platform"; $prBody = $this->buildPRBody($entries); $pr = $this->adapter->createPullRequest( $org, @@ -413,7 +413,7 @@ class PushFiles extends CliFramework $message = !empty($customMessage) ? $customMessage - : "chore: update {$destPath} from MokoStandards"; + : "chore: update {$destPath} from moko-platform"; // Fetch existing file SHA (needed for updates) $existingSha = null; @@ -456,9 +456,9 @@ class PushFiles extends CliFramework ): void { $now = gmdate('Y-m-d H:i:s') . ' UTC'; $version = self::VERSION; - $source = $this->adapter->getRepoWebUrl($org, 'MokoStandards'); + $source = $this->adapter->getRepoWebUrl($org, 'moko-platform'); - $title = "chore: MokoStandards file push tracking"; + $title = "chore: moko-platform file push tracking"; $deliveryLine = $prNumber !== null ? "| **Pull request** | [#{$prNumber}](" . $this->adapter->getPullRequestWebUrl($org, $repo, $prNumber) . ") |" @@ -470,9 +470,9 @@ class PushFiles extends CliFramework )); $body = <<api->get("/repos/{$org}/{$repo}/issues", [ @@ -549,7 +549,7 @@ class PushFiles extends CliFramework } /** - * Create or update a failure issue in MokoStandards when repos fail to receive files. + * Create or update a failure issue in moko-platform 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 @@ -597,7 +597,7 @@ class PushFiles extends CliFramework $body = preg_replace('/^ /m', '', $body); try { - $existing = $this->api->get("/repos/{$org}/MokoStandards/issues", [ + $existing = $this->api->get("/repos/{$org}/moko-platform/issues", [ 'labels' => 'push-failure', 'state' => 'all', 'per_page' => 1, @@ -612,17 +612,17 @@ class PushFiles extends CliFramework if (($existing[0]['state'] ?? 'open') === 'closed') { $patch['state'] = 'open'; } - $this->api->patch("/repos/{$org}/MokoStandards/issues/{$num}", $patch); - $this->log("🚨 Failure issue #{$num} updated: {$org}/MokoStandards#{$num}", 'WARN'); + $this->api->patch("/repos/{$org}/moko-platform/issues/{$num}", $patch); + $this->log("🚨 Failure issue #{$num} updated: {$org}/moko-platform#{$num}", 'WARN'); } else { - $issue = $this->api->post("/repos/{$org}/MokoStandards/issues", [ + $issue = $this->api->post("/repos/{$org}/moko-platform/issues", [ 'title' => $title, 'body' => $body, 'labels' => ['push-failure'], 'assignees' => ['jmiller'], ]); $num = $issue['number'] ?? '?'; - $this->log("🚨 Failure issue created: {$org}/MokoStandards#{$num}", 'WARN'); + $this->log("🚨 Failure issue created: {$org}/moko-platform#{$num}", 'WARN'); } } catch (\Exception $e) { $this->log("⚠️ Could not create/update failure issue: " . $e->getMessage(), 'WARN'); @@ -637,14 +637,14 @@ class PushFiles extends CliFramework private function buildPRBody(array $entries): string { $now = gmdate('Y-m-d H:i:s') . ' UTC'; - $lines = ["## MokoStandards File Push\n", "**Pushed:** {$now}\n", '### Files\n']; + $lines = ["## moko-platform File Push\n", "**Pushed:** {$now}\n", '### Files\n']; foreach ($entries as $entry) { $lines[] = "- `{$entry['destination']}`"; } - $sourceUrl = $this->adapter->getRepoWebUrl(self::DEFAULT_ORG, 'MokoStandards'); - $lines[] = "\n---\n*Generated by [MokoStandards]({$sourceUrl}) `push_files.php`*"; + $sourceUrl = $this->adapter->getRepoWebUrl(self::DEFAULT_ORG, 'moko-platform'); + $lines[] = "\n---\n*Generated by [moko-platform]({$sourceUrl}) `push_files.php`*"; return implode("\n", $lines); } diff --git a/automation/repo_cleanup.php b/automation/repo_cleanup.php index a2fba37..2c40a72 100644 --- a/automation/repo_cleanup.php +++ b/automation/repo_cleanup.php @@ -9,8 +9,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Automation - * INGROUP: MokoStandards.Scripts + * DEFGROUP: MokoPlatform.Automation + * INGROUP: MokoPlatform.Scripts * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /automation/repo_cleanup.php * BRIEF: Enterprise repository cleanup — branches, PRs, issues, workflows, labels, logs @@ -38,15 +38,15 @@ use MokoEnterprise\{ApiClient, AuditLogger, CliFramework, Config, GitPlatformAda */ class RepoCleanup extends CliFramework { - private const VERSION = '04.06.00'; - private const SYNC_PREFIX = 'chore/sync-mokostandards-'; - private const CURRENT_BRANCH = 'chore/sync-mokostandards-v04.02.00'; + private const VERSION = '09.22.00'; + private const SYNC_PREFIX = 'chore/sync-moko-platform-'; + private const CURRENT_BRANCH = 'chore/sync-moko-platform-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', 'mokostandards-script-runner.yml', 'unified-ci.yml', + 'flush-actions-cache.yml', 'moko-platform-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("🧹 MokoStandards Repository Cleanup v" . self::VERSION); + $this->logMsg("🧹 moko-platform 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'], ['MokoStandards', '.github-private'], true)); + return array_filter($allRepos, fn($r) => !in_array($r['name'], ['moko-platform', '.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/mokostandards"); + $this->api->get("/repos/{$org}/{$repo}/labels/moko-platform"); } catch (\Exception $e) { - $this->logMsg(" ⚠️ Missing 'mokostandards' label"); + $this->logMsg(" ⚠️ Missing 'moko-platform' label"); $results['labels_missing']++; $this->api->resetCircuitBreaker(); } @@ -479,9 +479,9 @@ class RepoCleanup extends CliFramework if (preg_match('/^\s*VERSION:\s*(\d{2}\.\d{2}\.\d{2})/m', $content, $m)) { $version = $m[1]; - // Check .mokostandards for the tracked MokoStandards version + // Check manifest.xml for the tracked moko-platform version try { - $mokoFile = $this->api->get("/repos/{$org}/{$repo}/contents/.mokostandards"); + $mokoFile = $this->api->get("/repos/{$org}/{$repo}/contents/.mokogitea/manifest.xml"); $mokoContent = base64_decode($mokoFile['content'] ?? ''); if (preg_match('/standards_version:\s*(\d{2}\.\d{2}\.\d{2})/m', $mokoContent, $vm)) { if ($vm[1] !== self::VERSION) { diff --git a/automation/server-autoheal.sh b/automation/server-autoheal.sh index 9d9019f..86e7b9a 100644 --- a/automation/server-autoheal.sh +++ b/automation/server-autoheal.sh @@ -4,8 +4,8 @@ # Copyright (C) 2026 Moko Consulting # SPDX-License-Identifier: GPL-3.0-or-later # -# DEFGROUP: MokoStandards.Automation.ServerAutoheal -# INGROUP: MokoStandards.Automation +# DEFGROUP: MokoPlatform.Automation.ServerAutoheal +# INGROUP: MokoPlatform.Automation # REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform # 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 1e501c2..6a05ff7 100644 --- a/bin/moko +++ b/bin/moko @@ -19,26 +19,22 @@ * php bin/moko [options] (all platforms) * ./bin/moko [options] (Unix, after: chmod +x bin/moko) * - * COMMANDS - * sync Bulk-sync MokoStandards to organisation repos - * health Full repository health check (runs most validators) - * inventory Refresh docs/reference/REPOSITORY_INVENTORY.md + * COMMANDS (run `php bin/moko list` for the full list — 97 commands) * - * check:syntax PHP syntax check (php -l) on all tracked .php files - * check:version Verify VERSION fields and badges match composer.json - * check:changelog Validate CHANGELOG.md format - * check:structure Verify required root files and directories - * check:headers Check SPDX-License-Identifier presence in source files - * check:secrets Scan for leaked credentials / API keys - * check:tabs Detect tab characters in YAML files - * check:paths Detect backslash path separators in PHP source - * check:xml Validate XML files are well-formed - * check:enterprise Full enterprise-readiness check (headers, strict types, PSR-12) - * check:dolibarr Validate Dolibarr module directory structure - * check:joomla Validate Joomla XML manifest - * check:language Validate Joomla/Dolibarr .ini language files - * detect Auto-detect repository platform type - * drift Scan org repos for drift from MokoStandards templates + * Automation sync, automation:cleanup, automation:migrate-gitea + * Validation health, detect, drift, check:syntax, check:version, ... + * Release release, release:joomla, release:create, release:publish, ... + * Version version:read, version:bump, version:auto-bump, ... + * Build build:package, build:joomla, build:updates-xml, ... + * Deploy deploy:joomla, deploy:dolibarr, deploy:sftp, deploy:rollback, ... + * Repository repo:create, repo:archive, repo:rename-branch, repo:reset-dev, ... + * Bulk Operations bulk:push-workflow, bulk:push-manifest, bulk:template-joomla, ... + * Maintenance maintenance:labels, maintenance:rotate-secrets, maintenance:pin-shas, ... + * Fix fix:line-endings, fix:tabs, fix:trailing, fix:permissions + * Monitoring dashboard, grafana, client:inventory, client:health-check + * Platform platform:detect, manifest:read, manifest:element + * Wiki wiki:sync + * Badges badge:update * * COMMON OPTIONS (passed through to each script) * --path Repository root to check (default: .) @@ -89,10 +85,18 @@ require_once $autoloader; */ const COMMAND_MAP = [ // Automation - 'sync' => 'automation/bulk_sync.php', + 'sync' => 'automation/bulk_sync.php', + 'automation:cleanup' => 'automation/repo_cleanup.php', + 'automation:migrate-gitea' => 'automation/migrate_to_gitea.php', // Maintenance - 'inventory' => 'maintenance/update_repo_inventory.php', + 'inventory' => 'maintenance/update_repo_inventory.php', + 'maintenance:pin-shas' => 'maintenance/pin_action_shas.php', + 'maintenance:inventory' => 'maintenance/repo_inventory.php', + 'maintenance:rotate-secrets' => 'maintenance/rotate_secrets.php', + 'maintenance:labels' => 'maintenance/setup_labels.php', + 'maintenance:sync-dolibarr' => 'maintenance/sync_dolibarr_readmes.php', + 'maintenance:update-shas' => 'maintenance/update_sha_hashes.php', // Validation — general 'health' => 'validate/check_repo_health.php', @@ -108,11 +112,13 @@ const COMMAND_MAP = [ 'check:enterprise' => 'validate/check_enterprise_readiness.php', // Validation — platform-specific - 'check:dolibarr' => 'validate/check_dolibarr_module.php', - 'check:joomla' => 'validate/check_joomla_manifest.php', - 'check:language' => 'validate/check_language_structure.php', - 'check:client' => 'validate/check_client_theme.php', - 'check:wiki' => 'validate/check_wiki_health.php', + 'check:dolibarr' => 'validate/check_dolibarr_module.php', + 'check:joomla' => 'validate/check_joomla_manifest.php', + 'check:joomla-compat' => 'cli/joomla_compat_check.php', + 'check:language' => 'validate/check_language_structure.php', + 'check:client' => 'validate/check_client_theme.php', + 'check:theme' => 'cli/theme_lint.php', + 'check:wiki' => 'validate/check_wiki_health.php', // Detection 'detect' => 'validate/auto_detect_platform.php', @@ -124,13 +130,18 @@ const COMMAND_MAP = [ 'release' => 'cli/release.php', 'release:notes' => 'cli/release_notes.php', 'release:validate' => 'cli/release_validate.php', - 'manifest:element' => 'cli/manifest_element.php', 'release:cascade' => 'cli/release_cascade.php', 'release:promote' => 'cli/release_promote.php', 'release:create' => 'cli/release_create.php', 'release:manage' => 'cli/release_manage.php', 'release:mirror' => 'cli/release_mirror.php', 'release:package' => 'cli/release_package.php', + 'release:joomla' => 'cli/joomla_release.php', + 'release:body-update' => 'cli/release_body_update.php', + 'release:publish' => 'cli/release_publish.php', + 'release:verify' => 'cli/release_verify.php', + 'release:gen-dolibarr' => 'release/generate_dolibarr_version_txt.php', + 'release:gen-joomla' => 'release/generate_joomla_update_xml.php', // Changelog 'changelog:promote' => 'cli/changelog_promote.php', @@ -143,31 +154,71 @@ const COMMAND_MAP = [ 'version:propagate' => 'maintenance/update_version_from_readme.php', 'version:set-platform' => 'cli/version_set_platform.php', 'version:reset-dev' => 'cli/version_reset_dev.php', + 'version:auto-bump' => 'cli/version_auto_bump.php', + 'version:bump-remote' => 'cli/version_bump_remote.php', // Build & package - 'build:package' => 'cli/package_build.php', - 'build:joomla' => 'cli/joomla_build.php', - 'build:updates-xml' => 'cli/updates_xml_build.php', + 'build:package' => 'cli/package_build.php', + 'build:joomla' => 'cli/joomla_build.php', + 'build:updates-xml' => 'cli/updates_xml_build.php', + 'build:updates-xml-sync' => 'cli/updates_xml_sync.php', - // Platform detection + // Platform detection & manifest 'platform:detect' => 'cli/platform_detect.php', 'manifest:read' => 'cli/manifest_read.php', + 'manifest:element' => 'cli/manifest_element.php', // Repository management 'repo:create' => 'cli/create_repo.php', + 'repo:create-project' => 'cli/create_project.php', 'repo:archive' => 'cli/archive_repo.php', 'repo:scaffold-client' => 'cli/scaffold_client.php', 'repo:provision' => 'cli/client_provision.php', + 'repo:rename-branch' => 'cli/branch_rename.php', + 'repo:reset-dev' => 'cli/dev_branch_reset.php', // Bulk operations - 'bulk:push-workflow' => 'cli/bulk_workflow_push.php', - 'bulk:trigger' => 'cli/bulk_workflow_trigger.php', - 'bulk:sync-rulesets' => 'cli/sync_rulesets.php', + 'bulk:push-workflow' => 'cli/bulk_workflow_push.php', + 'bulk:trigger' => 'cli/bulk_workflow_trigger.php', + 'bulk:sync-rulesets' => 'cli/sync_rulesets.php', + 'bulk:push-files' => 'automation/push_files.php', + 'bulk:push-manifest' => 'automation/push_manifest_xml.php', + 'bulk:push-mokostandards' => 'automation/push_mokostandards_xml.php', + 'bulk:enrich-manifest' => 'automation/enrich_manifest_xml.php', + 'bulk:enrich-mokostandards' => 'automation/enrich_mokostandards_xml.php', + 'bulk:template-joomla' => 'automation/bulk_joomla_template.php', + + // Deploy + 'deploy:joomla' => 'cli/deploy_joomla.php', + 'deploy:joomla-legacy' => 'deploy/deploy-joomla.php', + 'deploy:dolibarr' => 'deploy/deploy-dolibarr.php', + 'deploy:sftp' => 'deploy/deploy-sftp.php', + 'deploy:backup' => 'deploy/backup-before-deploy.php', + 'deploy:health-check' => 'deploy/health-check.php', + 'deploy:rollback' => 'deploy/rollback-joomla.php', + 'deploy:sync' => 'deploy/sync-joomla.php', + + // Fix / auto-remediation + 'fix:line-endings' => 'fix/fix_line_endings.php', + 'fix:tabs' => 'fix/fix_tabs.php', + 'fix:trailing' => 'fix/fix_trailing_spaces.php', + 'fix:permissions' => 'fix/fix_permissions.php', // Monitoring & dashboards 'dashboard' => 'cli/client_dashboard.php', 'grafana' => 'cli/grafana_dashboard.php', 'client:inventory' => 'cli/client_inventory.php', + 'client:health-check' => 'cli/client_health_check.php', + + // Badge & wiki + 'badge:update' => 'cli/badge_update.php', + 'wiki:sync' => 'cli/wiki_sync.php', + + // Licensing + 'license' => 'cli/license_manage.php', + + // Shell completion + 'completion' => 'cli/completion.php', // Module validation 'validate:module' => 'bin/validate-module', @@ -197,16 +248,28 @@ if ($command === 'list' || $command === 'commands') { // ── Dispatch ────────────────────────────────────────────────────────────────── -if (!array_key_exists($command, COMMAND_MAP)) { +$scriptRelative = null; + +if (array_key_exists($command, COMMAND_MAP)) { + $scriptRelative = COMMAND_MAP[$command]; +} else { + // Fall back to plugin-provided commands before giving up. + $pluginCommands = loadPluginCommands(); + if (isset($pluginCommands[$command]) && !empty($pluginCommands[$command]['script'])) { + $scriptRelative = $pluginCommands[$command]['script']; + } +} + +if ($scriptRelative === null) { fwrite(STDERR, "Error: Unknown command '{$command}'\n\n"); printCommandList(); exit(2); } -$scriptPath = $repoRoot . '/' . COMMAND_MAP[$command]; +$scriptPath = $repoRoot . '/' . $scriptRelative; if (!is_file($scriptPath)) { - fwrite(STDERR, "Error: Script not found: " . COMMAND_MAP[$command] . "\n"); + fwrite(STDERR, "Error: Script not found: {$scriptRelative}\n"); fwrite(STDERR, "Ensure the repository is complete and run: composer install\n"); exit(2); } @@ -268,6 +331,12 @@ function printCommandList(): void 'bulk' => 'Bulk Operations', 'client' => 'Client Management', 'validate' => 'Module Validation', + 'deploy' => 'Deploy', + 'fix' => 'Fix / Auto-remediation', + 'maintenance' => 'Maintenance', + 'automation' => 'Automation', + 'badge' => 'Badges', + 'wiki' => 'Wiki', default => ucfirst($prefix), }; } else { @@ -277,6 +346,8 @@ function printCommandList(): void 'health' => 'Validation', 'detect', 'drift' => 'Validation', 'dashboard', 'grafana' => 'Monitoring', + 'release' => 'Release', + 'license' => 'Licensing', default => 'Other', }; } diff --git a/cli/branch_rename.php b/cli/branch_rename.php index 0d0c772..74225dc 100644 --- a/cli/branch_rename.php +++ b/cli/branch_rename.php @@ -9,7 +9,7 @@ * INGROUP: moko-platform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /cli/branch_rename.php - * VERSION: 09.21.07 + * VERSION: 09.22.00 * 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 ba3168f..2554f39 100644 --- a/cli/bulk_workflow_push.php +++ b/cli/bulk_workflow_push.php @@ -12,7 +12,7 @@ * INGROUP: moko-platform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /cli/bulk_workflow_push.php - * VERSION: 09.21.07 + * VERSION: 09.22.00 * BRIEF: Push a workflow file to all governed repos via the Gitea Contents API */ diff --git a/cli/bulk_workflow_trigger.php b/cli/bulk_workflow_trigger.php index 794201e..7e1069f 100644 --- a/cli/bulk_workflow_trigger.php +++ b/cli/bulk_workflow_trigger.php @@ -11,7 +11,7 @@ * INGROUP: moko-platform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /cli/bulk_workflow_trigger.php - * VERSION: 09.21.07 + * VERSION: 09.22.00 * BRIEF: Trigger a workflow across multiple repos at once */ diff --git a/cli/client_dashboard.php b/cli/client_dashboard.php index bf0a119..ad9252b 100644 --- a/cli/client_dashboard.php +++ b/cli/client_dashboard.php @@ -12,7 +12,7 @@ * INGROUP: moko-platform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /cli/client_dashboard.php - * VERSION: 09.21.07 + * VERSION: 09.22.00 * BRIEF: Generate unified client dashboard HTML */ diff --git a/cli/client_inventory.php b/cli/client_inventory.php index c7804c3..936d10e 100644 --- a/cli/client_inventory.php +++ b/cli/client_inventory.php @@ -11,7 +11,7 @@ * INGROUP: moko-platform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /cli/client_inventory.php - * VERSION: 09.21.07 + * VERSION: 09.22.00 * 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 7e3b853..71e1af6 100644 --- a/cli/client_provision.php +++ b/cli/client_provision.php @@ -12,7 +12,7 @@ * INGROUP: moko-platform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /cli/client_provision.php - * VERSION: 09.21.07 + * VERSION: 09.22.00 * BRIEF: Provision a new client environment end-to-end */ diff --git a/cli/deploy_joomla.php b/cli/deploy_joomla.php new file mode 100644 index 0000000..3dcde46 --- /dev/null +++ b/cli/deploy_joomla.php @@ -0,0 +1,1079 @@ +#!/usr/bin/env php + + * + * This file is part of a Moko Consulting project. + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + * FILE INFORMATION + * DEFGROUP: MokoPlatform.CLI + * INGROUP: MokoPlatform + * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + * PATH: /cli/deploy_joomla.php + * BRIEF: Smart Joomla deploy — routes files to correct server directories by extension type + * + * Parses the Joomla XML manifest to auto-detect extension type and maps + * source directories to their correct Joomla installation paths. Supports + * all 8 extension types: component, module, plugin, template, library, + * package, file, and language. + * + * USAGE + * php bin/moko deploy:joomla --path /repos/my-extension --env dev + * php bin/moko deploy:joomla --path . --config /tmp/sftp-config.json + * php bin/moko deploy:joomla --path . --env dev --dry-run --verbose + */ + +declare(strict_types=1); + +require_once __DIR__ . '/../vendor/autoload.php'; + +require_once __DIR__ . '/../lib/Enterprise/CliFramework.php'; + +use MokoEnterprise\CliFramework; +use phpseclib3\Net\SFTP; +use phpseclib3\Crypt\PublicKeyLoader; + +/** + * Smart Joomla SFTP Deployment + * + * Reads the Joomla extension XML manifest to determine type, element name, + * client scope, and plugin group, then maps local source directories to their + * correct Joomla server paths. Supports all 8 Joomla extension types. + */ +class DeployJoomla extends CliFramework +{ + private int $uploaded = 0; + private int $unchanged = 0; + private int $skipped = 0; + private int $deleted = 0; + private int $errors = 0; + + /** @var array Parsed sftp-config.json */ + private array $sftpConfig = []; + + /** @var string[] Regex ignore patterns */ + private array $ignorePatterns = []; + + protected function configure(): void + { + $this->setDescription('Smart Joomla SFTP deploy — routes files by extension type'); + $this->addArgument('--path', 'Repository root (default: current directory)', '.'); + $this->addArgument('--src-dir', 'Source sub-directory to upload (default: auto-detect)', ''); + $this->addArgument('--env', 'Target environment: dev or rs', ''); + $this->addArgument('--config', 'Explicit sftp-config.json path (overrides --env)', ''); + $this->addArgument('--key-passphrase', 'Passphrase for encrypted SSH key', ''); + $this->addArgument('--delete', 'Delete remote files not present locally', false); + } + + protected function run(): int + { + $repoPath = $this->resolveRepoPath(); + $srcDir = $this->resolveSrcDir($repoPath); + + $this->log("Repository : {$repoPath}"); + $this->log("Source dir : {$srcDir}"); + + // ── Find and parse Joomla manifest ── + $manifestPath = $this->findJoomlaManifest($srcDir, $repoPath); + if ($manifestPath === null) { + $this->log('ERROR', "No Joomla XML manifest found"); + return 1; + } + $this->log("Manifest : {$manifestPath}"); + + $ext = $this->parseExtensionManifest($manifestPath); + if ($ext === null) { + $this->log('ERROR', "Failed to parse manifest"); + return 1; + } + + $this->log("Extension : {$ext['type']} / {$ext['element']} (client: {$ext['client']})"); + if ($ext['group'] !== '') { + $this->log("Group : {$ext['group']}"); + } + + // ── Load SFTP config ── + $configPath = $this->resolveConfigPath($repoPath); + $this->log("Config : {$configPath}"); + + if (!$this->loadSftpConfig($configPath)) { + return 1; + } + + // ── Build deployment map ── + $deployMap = $this->buildDeployMap($ext, $srcDir); + if (empty($deployMap)) { + $this->log('ERROR', "No deploy mappings for extension type: {$ext['type']}"); + return 1; + } + + $this->log(""); + $this->log("Deploy plan:"); + foreach ($deployMap as $map) { + $exists = is_dir($map['local']) ? '' : ' [not found]'; + $this->log(" {$map['local']} → {$map['remote']}{$exists}"); + } + + // Manifest destination + $manifestDest = $this->getManifestDestination($ext); + if ($manifestDest !== null) { + $this->log(" " . basename($manifestPath) . " → {$manifestDest}"); + } + + $this->log(""); + $this->printManifestChangeWarning($manifestPath); + + // ── Load ignore patterns ── + $this->ignorePatterns = $this->loadIgnorePatterns($srcDir, $repoPath); + + if ($this->dryRun) { + $this->log("[DRY RUN] Would deploy " . count($deployMap) . " directory mappings"); + $this->dryRunWalk($deployMap); + return 0; + } + + // ── Connect ── + $sftp = $this->connectSftp($repoPath); + if ($sftp === null) { + return 1; + } + + // ── Deploy each mapping ── + foreach ($deployMap as $map) { + if (!is_dir($map['local'])) { + $this->log('DEBUG', " SKIP: {$map['local']} (not found)"); + continue; + } + + $this->ensureRemoteDir($sftp, $map['remote']); + $this->uploadDirectory($sftp, $map['local'], $map['remote']); + } + + // ── Deploy manifest XML ── + if ($manifestDest !== null && file_exists($manifestPath)) { + $this->ensureRemoteDir($sftp, dirname($manifestDest)); + $this->uploadFile($sftp, $manifestPath, $manifestDest); + } + + // ── Summary ── + $this->log(""); + $this->log("Done."); + $this->log(" Uploaded : {$this->uploaded}"); + $this->log(" Unchanged : {$this->unchanged}"); + $this->log(" Skipped : {$this->skipped}"); + if ($this->deleted > 0) { + $this->log(" Deleted : {$this->deleted}"); + } + if ($this->errors > 0) { + $this->log('ERROR', " Errors : {$this->errors}"); + } + + if ($this->isJsonMode()) { + echo json_encode([ + 'extension' => $ext, + 'uploaded' => $this->uploaded, + 'unchanged' => $this->unchanged, + 'skipped' => $this->skipped, + 'deleted' => $this->deleted, + 'errors' => $this->errors, + ], JSON_PRETTY_PRINT) . "\n"; + } + + return $this->errors > 0 ? 1 : 0; + } + + // ═══════════════════════════════════════════════════════════════════════════ + // Manifest parsing + // ═══════════════════════════════════════════════════════════════════════════ + + /** + * Find the Joomla extension XML manifest. + * + * Searches: src dir root, repo root, then one level deep in each. + */ + private function findJoomlaManifest(string $srcDir, string $repoPath): ?string + { + foreach ([$srcDir, $repoPath] as $dir) { + // Direct children + $found = $this->scanDirForManifest($dir); + if ($found !== null) { + return $found; + } + // One level deep + foreach (new \DirectoryIterator($dir) as $sub) { + if ($sub->isDir() && !$sub->isDot()) { + $found = $this->scanDirForManifest($sub->getPathname()); + if ($found !== null) { + return $found; + } + } + } + } + return null; + } + + private function scanDirForManifest(string $dir): ?string + { + if (!is_dir($dir)) { + return null; + } + foreach (new \DirectoryIterator($dir) as $file) { + if ($file->isFile() && $file->getExtension() === 'xml') { + $content = file_get_contents($file->getPathname()); + if ($content !== false && str_contains($content, 'getPathname(); + } + } + } + return null; + } + + /** + * Parse extension metadata from the Joomla XML manifest. + * + * @return array{type:string, element:string, client:string, group:string, name:string, shortName:string, version:string, subExtensions:list}|null + */ + private function parseExtensionManifest(string $path): ?array + { + $xml = @simplexml_load_file($path); + if ($xml === false || $xml->getName() !== 'extension') { + return null; + } + + $type = (string) ($xml['type'] ?? 'component'); + $client = (string) ($xml['client'] ?? 'site'); + $group = (string) ($xml['group'] ?? ''); + $element = (string) ($xml->element ?? ''); + $name = (string) ($xml->name ?? ''); + $version = (string) ($xml->version ?? '0.0.0'); + + // Derive element from type + name if not explicit + if (empty($element)) { + $cleanName = strtolower(preg_replace('/[^a-zA-Z0-9_]/', '', $name)); + $element = match ($type) { + 'component' => "com_{$cleanName}", + 'module' => "mod_{$cleanName}", + 'plugin' => "plg_{$group}_{$cleanName}", + 'template' => "tpl_{$cleanName}", + 'library' => "lib_{$cleanName}", + default => $cleanName, + }; + } + + // Derive short name (without type prefix) for directory mapping + $shortName = $element; + if ($type === 'plugin' && preg_match('/^plg_\w+_(.+)$/', $element, $m)) { + $shortName = $m[1]; + } elseif ($type === 'template' && preg_match('/^tpl_(.+)$/', $element, $m)) { + $shortName = $m[1]; + } elseif ($type === 'library' && preg_match('/^lib_(.+)$/', $element, $m)) { + $shortName = $m[1]; + } elseif ($type === 'module' && preg_match('/^mod_(.+)$/', $element, $m)) { + $shortName = $m[1]; + } elseif ($type === 'component' && preg_match('/^com_(.+)$/', $element, $m)) { + $shortName = $m[1]; + } + + // Parse sub-extensions for packages + $subExtensions = []; + if ($type === 'package' && isset($xml->files)) { + foreach ($xml->files->children() as $child) { + $subType = $child->getName(); // file, folder, etc. + $subExtensions[] = [ + 'type' => (string) ($child['type'] ?? ''), + 'id' => (string) ($child['id'] ?? ''), + 'group' => (string) ($child['group'] ?? ''), + 'client' => (string) ($child['client'] ?? 'site'), + 'path' => (string) $child, + ]; + } + } + + return [ + 'type' => $type, + 'element' => $element, + 'client' => $client, + 'group' => $group, + 'name' => $name, + 'shortName' => $shortName, + 'version' => $version, + 'subExtensions' => $subExtensions, + ]; + } + + // ═══════════════════════════════════════════════════════════════════════════ + // Deploy map — extension type → directory mappings + // ═══════════════════════════════════════════════════════════════════════════ + + /** + * Build local→remote directory mappings based on extension type. + * + * @return array + */ + private function buildDeployMap(array $ext, string $srcDir): array + { + $remote = rtrim((string) $this->sftpConfig['remote_path'], '/'); + $map = []; + + switch ($ext['type']) { + case 'component': + $map = $this->mapComponent($ext, $srcDir, $remote); + break; + + case 'module': + $map = $this->mapModule($ext, $srcDir, $remote); + break; + + case 'plugin': + $map = $this->mapPlugin($ext, $srcDir, $remote); + break; + + case 'template': + $map = $this->mapTemplate($ext, $srcDir, $remote); + break; + + case 'library': + $map = $this->mapLibrary($ext, $srcDir, $remote); + break; + + case 'package': + $map = $this->mapPackage($ext, $srcDir, $remote); + break; + + case 'file': + $map = $this->mapFile($ext, $srcDir, $remote); + break; + + case 'language': + $map = $this->mapLanguage($ext, $srcDir, $remote); + break; + } + + return $map; + } + + /** + * Component: admin, site, media, api, language sections. + */ + private function mapComponent(array $ext, string $src, string $remote): array + { + $el = $ext['element']; + $map = []; + + // Admin files — check multiple conventions + $adminLocal = $this->firstExistingDir($src, ['admin', 'administrator', 'backend']); + if ($adminLocal !== null) { + $map[] = ['local' => $adminLocal, 'remote' => "{$remote}/administrator/components/{$el}"]; + } + + // Site files + $siteLocal = $this->firstExistingDir($src, ['site', 'frontend']); + if ($siteLocal !== null) { + $map[] = ['local' => $siteLocal, 'remote' => "{$remote}/components/{$el}"]; + } + + // Media files + if (is_dir("{$src}/media")) { + $map[] = ['local' => "{$src}/media", 'remote' => "{$remote}/media/{$el}"]; + } + + // API files (Joomla 4+) + if (is_dir("{$src}/api")) { + $map[] = ['local' => "{$src}/api", 'remote' => "{$remote}/api/components/{$el}"]; + } + + // Language files — admin + $langAdmin = $this->firstExistingDir($src, ['language/admin', 'admin/language']); + if ($langAdmin !== null) { + $map[] = ['local' => $langAdmin, 'remote' => "{$remote}/administrator/language"]; + } + + // Language files — site + $langSite = $this->firstExistingDir($src, ['language/site', 'site/language']); + if ($langSite !== null) { + $map[] = ['local' => $langSite, 'remote' => "{$remote}/language"]; + } + + return $map; + } + + /** + * Module: base dir + media, routed by client (site or administrator). + */ + private function mapModule(array $ext, string $src, string $remote): array + { + $el = $ext['element']; + $map = []; + + $base = $ext['client'] === 'administrator' + ? "{$remote}/administrator/modules/{$el}" + : "{$remote}/modules/{$el}"; + + // Module source — exclude media/ from base upload + $map[] = ['local' => $src, 'remote' => $base]; + + if (is_dir("{$src}/media")) { + $map[] = ['local' => "{$src}/media", 'remote' => "{$remote}/media/{$el}"]; + } + + // Language files + $langDir = $this->firstExistingDir($src, ['language']); + if ($langDir !== null) { + $langRemote = $ext['client'] === 'administrator' + ? "{$remote}/administrator/language" + : "{$remote}/language"; + $map[] = ['local' => $langDir, 'remote' => $langRemote]; + } + + return $map; + } + + /** + * Plugin: plugins/{group}/{shortName} + media. + */ + private function mapPlugin(array $ext, string $src, string $remote): array + { + $map = []; + $group = $ext['group'] ?: 'system'; + $name = $ext['shortName']; + + $map[] = ['local' => $src, 'remote' => "{$remote}/plugins/{$group}/{$name}"]; + + if (is_dir("{$src}/media")) { + $map[] = ['local' => "{$src}/media", 'remote' => "{$remote}/media/{$ext['element']}"]; + } + + // Language files + $langDir = $this->firstExistingDir($src, ['language']); + if ($langDir !== null) { + $map[] = ['local' => $langDir, 'remote' => "{$remote}/administrator/language"]; + } + + return $map; + } + + /** + * Template: templates/{name} or administrator/templates/{name} + media. + */ + private function mapTemplate(array $ext, string $src, string $remote): array + { + $map = []; + $name = $ext['shortName']; + + $clientDir = $ext['client'] === 'administrator' ? 'administrator/' : ''; + $map[] = ['local' => $src, 'remote' => "{$remote}/{$clientDir}templates/{$name}"]; + + if (is_dir("{$src}/media")) { + $mediaClient = $ext['client'] === 'administrator' ? 'administrator' : 'site'; + $map[] = ['local' => "{$src}/media", 'remote' => "{$remote}/media/templates/{$mediaClient}/{$name}"]; + } + + // Language files + $langDir = $this->firstExistingDir($src, ['language']); + if ($langDir !== null) { + $langRemote = $ext['client'] === 'administrator' + ? "{$remote}/administrator/language" + : "{$remote}/language"; + $map[] = ['local' => $langDir, 'remote' => $langRemote]; + } + + return $map; + } + + /** + * Library: libraries/{name} + media. + */ + private function mapLibrary(array $ext, string $src, string $remote): array + { + $map = []; + $name = $ext['shortName']; + + $map[] = ['local' => $src, 'remote' => "{$remote}/libraries/{$name}"]; + + if (is_dir("{$src}/media")) { + $map[] = ['local' => "{$src}/media", 'remote' => "{$remote}/media/{$ext['element']}"]; + } + + return $map; + } + + /** + * Package: deploy each sub-extension from packages/ directory. + * + * Reads from the package manifest to determine sub-extension types + * and deploy each one to its correct location. + */ + private function mapPackage(array $ext, string $src, string $remote): array + { + $map = []; + + // Packages contain sub-extensions in packages/ directory + $packagesDir = $this->firstExistingDir($src, ['packages', 'extensions']); + + if ($packagesDir !== null && !empty($ext['subExtensions'])) { + foreach ($ext['subExtensions'] as $sub) { + $subPath = "{$packagesDir}/{$sub['path']}"; + if (!is_dir($subPath) && !is_file($subPath)) { + $this->log(" Package sub-extension not found: {$sub['path']}", 'WARNING'); + continue; + } + + // If it's a directory with its own manifest, parse and map it + if (is_dir($subPath)) { + $subManifest = $this->scanDirForManifest($subPath); + if ($subManifest !== null) { + $subExt = $this->parseExtensionManifest($subManifest); + if ($subExt !== null) { + $subMaps = $this->buildDeployMap($subExt, $subPath); + $map = array_merge($map, $subMaps); + } + } + } + } + } elseif ($packagesDir !== null) { + // No in manifest — scan packages/ for sub-extension directories + foreach (new \DirectoryIterator($packagesDir) as $item) { + if ($item->isDot() || !$item->isDir()) { + continue; + } + $subManifest = $this->scanDirForManifest($item->getPathname()); + if ($subManifest !== null) { + $subExt = $this->parseExtensionManifest($subManifest); + if ($subExt !== null) { + $subMaps = $this->buildDeployMap($subExt, $item->getPathname()); + $map = array_merge($map, $subMaps); + } + } + } + } + + // Package language files at root + $langDir = $this->firstExistingDir($src, ['language']); + if ($langDir !== null) { + $map[] = ['local' => $langDir, 'remote' => "{$remote}/administrator/language"]; + } + + return $map; + } + + /** + * File extension: deploys file groups to root locations. + */ + private function mapFile(array $ext, string $src, string $remote): array + { + // File extensions typically deploy to the Joomla root + return [ + ['local' => $src, 'remote' => $remote], + ]; + } + + /** + * Language extension: deploys to language/{tag}/ directories. + */ + private function mapLanguage(array $ext, string $src, string $remote): array + { + $map = []; + + $langRemote = $ext['client'] === 'administrator' + ? "{$remote}/administrator/language" + : "{$remote}/language"; + + $map[] = ['local' => $src, 'remote' => $langRemote]; + + return $map; + } + + /** + * Determine where the manifest XML should be deployed. + * + * Joomla stores manifest copies differently per extension type. + */ + private function getManifestDestination(array $ext): ?string + { + $remote = rtrim((string) $this->sftpConfig['remote_path'], '/'); + + return match ($ext['type']) { + 'component' => "{$remote}/administrator/components/{$ext['element']}/" . $this->getManifestFilename($ext), + 'module' => ($ext['client'] === 'administrator' + ? "{$remote}/administrator/modules/{$ext['element']}" + : "{$remote}/modules/{$ext['element']}") . '/' . $this->getManifestFilename($ext), + 'plugin' => "{$remote}/plugins/{$ext['group']}/{$ext['shortName']}/" . $this->getManifestFilename($ext), + 'template' => ($ext['client'] === 'administrator' + ? "{$remote}/administrator/templates/{$ext['shortName']}" + : "{$remote}/templates/{$ext['shortName']}") . '/templateDetails.xml', + 'library' => "{$remote}/administrator/manifests/libraries/{$ext['element']}.xml", + 'package' => "{$remote}/administrator/manifests/packages/{$ext['element']}.xml", + 'file' => "{$remote}/administrator/manifests/files/{$ext['element']}.xml", + default => null, + }; + } + + private function getManifestFilename(array $ext): string + { + return match ($ext['type']) { + 'template' => 'templateDetails.xml', + default => "{$ext['element']}.xml", + }; + } + + // ═══════════════════════════════════════════════════════════════════════════ + // SFTP operations + // ═══════════════════════════════════════════════════════════════════════════ + + /** + * Upload a directory recursively, skipping unchanged files. + */ + private function uploadDirectory(SFTP $sftp, string $localDir, string $remoteDir): void + { + $iterator = new \RecursiveIteratorIterator( + new \RecursiveDirectoryIterator($localDir, \FilesystemIterator::SKIP_DOTS), + \RecursiveIteratorIterator::SELF_FIRST + ); + + $localFiles = []; + + foreach ($iterator as $item) { + $relativePath = substr($item->getPathname(), strlen($localDir) + 1); + $relativePath = str_replace('\\', '/', $relativePath); + $remotePath = "{$remoteDir}/{$relativePath}"; + + if ($this->shouldIgnore($relativePath)) { + $this->skipped++; + continue; + } + + $localFiles[dirname($relativePath) === '.' ? basename($relativePath) : $relativePath] = true; + + if ($item->isDir()) { + $this->ensureRemoteDir($sftp, $remotePath); + } else { + $this->uploadFile($sftp, $item->getPathname(), $remotePath); + } + } + + // Delete remote files not present locally (if --delete flag set) + if ($this->getArgument('--delete')) { + $this->deleteOrphans($sftp, $localDir, $remoteDir); + } + } + + /** + * Upload a single file, skipping if unchanged (smart diff). + */ + private function uploadFile(SFTP $sftp, string $localPath, string $remotePath): void + { + $localSize = filesize($localPath); + $remoteStat = @$sftp->stat($remotePath); + + // Smart diff: skip if same size and hash + if ($remoteStat !== false && ($remoteStat['size'] ?? -1) === $localSize) { + $remoteContent = @$sftp->get($remotePath); + if ($remoteContent !== false && md5($remoteContent) === md5_file($localPath)) { + $this->unchanged++; + return; + } + } + + // Ensure parent directory exists + $this->ensureRemoteDir($sftp, dirname($remotePath)); + + $result = $sftp->put($remotePath, $localPath, SFTP::SOURCE_LOCAL_FILE); + if ($result) { + $this->uploaded++; + $this->log('DEBUG', " PUT " . basename($localPath) . " → {$remotePath}"); + } else { + $this->log('ERROR', " FAIL {$remotePath}"); + $this->errors++; + } + } + + /** + * Delete remote files that no longer exist locally. + */ + private function deleteOrphans(SFTP $sftp, string $localDir, string $remoteDir): void + { + $remoteEntries = $sftp->nlist($remoteDir); + if (!is_array($remoteEntries)) { + return; + } + + foreach ($remoteEntries as $entry) { + if ($entry === '.' || $entry === '..') { + continue; + } + + $localPath = $localDir . DIRECTORY_SEPARATOR . $entry; + $remotePath = "{$remoteDir}/{$entry}"; + + if (!file_exists($localPath)) { + $remoteStat = @$sftp->stat($remotePath); + if ($remoteStat !== false && ($remoteStat['type'] ?? 0) === 2) { + $this->deleteRemoteDir($sftp, $remotePath); + } else { + $sftp->delete($remotePath); + } + $this->deleted++; + $this->log('DEBUG', " DEL {$remotePath}"); + } elseif (is_dir($localPath)) { + $this->deleteOrphans($sftp, $localPath, $remotePath); + } + } + } + + private function deleteRemoteDir(SFTP $sftp, string $path): void + { + $entries = $sftp->nlist($path); + if (is_array($entries)) { + foreach ($entries as $entry) { + if ($entry === '.' || $entry === '..') { + continue; + } + $full = "{$path}/{$entry}"; + $stat = @$sftp->stat($full); + if ($stat !== false && ($stat['type'] ?? 0) === 2) { + $this->deleteRemoteDir($sftp, $full); + } else { + $sftp->delete($full); + } + } + } + $sftp->rmdir($path); + } + + private function ensureRemoteDir(SFTP $sftp, string $path): void + { + $stat = @$sftp->stat($path); + if ($stat === false) { + $sftp->mkdir($path, -1, true); + } + } + + // ═══════════════════════════════════════════════════════════════════════════ + // Connection + // ═══════════════════════════════════════════════════════════════════════════ + + private function connectSftp(string $repoPath): ?SFTP + { + $host = (string) $this->sftpConfig['host']; + $port = (int) ($this->sftpConfig['port'] ?? 22); + $user = (string) $this->sftpConfig['user']; + + $this->log("Connecting to {$user}@{$host}:{$port}..."); + + try { + $sftp = new SFTP($host, $port, 30); + } catch (\Throwable $e) { + $this->log('ERROR', "Cannot reach {$host}:{$port} — " . $e->getMessage()); + return null; + } + + // Try key auth first + if (!empty($this->sftpConfig['ssh_key_file'])) { + $keyPath = $this->resolveKeyPath((string) $this->sftpConfig['ssh_key_file'], $repoPath); + if (file_exists($keyPath)) { + $passphrase = $this->getArgument('--key-passphrase') ?: ($this->sftpConfig['key_passphrase'] ?? ''); + try { + $keyData = file_get_contents($keyPath); + $key = $passphrase + ? PublicKeyLoader::load($keyData, $passphrase) + : PublicKeyLoader::load($keyData); + if ($sftp->login($user, $key)) { + $this->log("Connected via SSH key"); + return $sftp; + } + } catch (\Throwable $e) { + $this->log("Key auth failed: " . $e->getMessage(), 'WARNING'); + } + } else { + $this->log("SSH key not found: {$keyPath}", 'WARNING'); + } + } + + // Fallback to password + if (!empty($this->sftpConfig['password'])) { + if ($sftp->login($user, $this->sftpConfig['password'])) { + $this->log("Connected via password"); + return $sftp; + } + } + + $this->log('ERROR', "Authentication failed for {$user}@{$host}"); + return null; + } + + private function resolveKeyPath(string $configured, string $repoPath): string + { + if (str_starts_with($configured, '/') || preg_match('/^[A-Za-z]:[\/\\\\]/', $configured)) { + return $configured; + } + $candidate = $repoPath . '/scripts/keys/' . ltrim($configured, '/\\'); + return file_exists($candidate) ? $candidate : $configured; + } + + // ═══════════════════════════════════════════════════════════════════════════ + // Path resolution + // ═══════════════════════════════════════════════════════════════════════════ + + private function resolveRepoPath(): string + { + $raw = $this->getArgument('--path', '.'); + $path = realpath($raw); + if ($path === false || !is_dir($path)) { + $this->log('ERROR', "Repository path not found: {$raw}"); + exit(1); + } + return $path; + } + + /** + * Resolve source directory with smart fallback chain: + * 1. --src-dir flag (explicit) + * 2. .mokogitea/manifest.xml + * 3. src/ directory + * 4. htdocs/ directory + * 5. Repo root (for flat-layout extensions) + */ + private function resolveSrcDir(string $repoPath): string + { + // 1. Explicit --src-dir + $explicit = $this->getArgument('--src-dir') ?: null; + if ($explicit !== null) { + $dir = str_starts_with($explicit, '/') ? $explicit : "{$repoPath}/{$explicit}"; + if (is_dir($dir)) { + return $dir; + } + $this->log('ERROR', "Source directory not found: {$dir}"); + exit(1); + } + + // 2. Read from .mokogitea/manifest.xml + $mokoManifest = "{$repoPath}/.mokogitea/manifest.xml"; + if (file_exists($mokoManifest)) { + $xml = @simplexml_load_file($mokoManifest); + if ($xml !== false) { + $sourceDir = (string) ($xml->deploy->{'source-dir'} ?? ''); + if ($sourceDir !== '') { + $dir = "{$repoPath}/{$sourceDir}"; + if (is_dir($dir)) { + return $dir; + } + } + } + } + + // 3-5. Fallback chain + foreach (['src', 'htdocs'] as $candidate) { + if (is_dir("{$repoPath}/{$candidate}")) { + return "{$repoPath}/{$candidate}"; + } + } + + // Last resort: repo root itself + return $repoPath; + } + + private const ENV_CONFIG_MAP = [ + 'dev' => 'sftp-config.dev.json', + 'rs' => 'sftp-config.rs.json', + ]; + + private function resolveConfigPath(string $repoPath): string + { + $configDir = "{$repoPath}/scripts/sftp-config"; + + // 1. Explicit --config + $explicit = $this->getArgument('--config') ?: null; + if ($explicit !== null) { + $path = realpath($explicit); + if ($path === false) { + $this->log('ERROR', "Config file not found: {$explicit}"); + exit(1); + } + return $path; + } + + // 2. --env selects named config + $env = $this->getArgument('--env') ?: null; + if ($env !== null) { + $env = strtolower((string) $env); + if (!isset(self::ENV_CONFIG_MAP[$env])) { + $valid = implode(', ', array_keys(self::ENV_CONFIG_MAP)); + $this->log('ERROR', "Unknown --env '{$env}'. Valid: {$valid}"); + exit(2); + } + $envConfig = "{$configDir}/" . self::ENV_CONFIG_MAP[$env]; + if (!file_exists($envConfig)) { + $this->log('ERROR', "Config not found for --env {$env}: {$envConfig}"); + exit(1); + } + return $envConfig; + } + + // 3. Generic fallback + $default = "{$configDir}/sftp-config.json"; + if (!file_exists($default)) { + $this->log('ERROR', "No config found. Use --env dev, --env rs, or --config ."); + exit(1); + } + return $default; + } + + // ═══════════════════════════════════════════════════════════════════════════ + // Config loading + // ═══════════════════════════════════════════════════════════════════════════ + + private function loadSftpConfig(string $configPath): bool + { + $raw = file_get_contents($configPath); + if ($raw === false) { + $this->log('ERROR', "Cannot read config: {$configPath}"); + return false; + } + + // Strip // comments and trailing commas (Sublime Text SFTP format) + $stripped = preg_replace('#(?log('ERROR', "Invalid JSON in config: " . json_last_error_msg()); + return false; + } + + $this->sftpConfig = $decoded; + + // Validate required fields + $missing = []; + foreach (['host', 'user', 'remote_path'] as $key) { + if (empty($this->sftpConfig[$key])) { + $missing[] = $key; + } + } + if (empty($this->sftpConfig['ssh_key_file']) && empty($this->sftpConfig['password'])) { + $missing[] = 'ssh_key_file or password'; + } + if (!empty($missing)) { + $this->log("Missing config fields: " . implode(', ', $missing), 'ERROR'); + return false; + } + + return true; + } + + // ═══════════════════════════════════════════════════════════════════════════ + // Ignore patterns + // ═══════════════════════════════════════════════════════════════════════════ + + /** + * Load ignore patterns from .ftpignore and config. + * + * @return string[] + */ + private function loadIgnorePatterns(string $srcDir, string $repoPath): array + { + $patterns = []; + + // From sftp-config.json ignore_regexes + foreach ($this->sftpConfig['ignore_regexes'] ?? [] as $p) { + $patterns[] = (string) $p; + } + + // From .ftpignore files + foreach ([$srcDir, $repoPath] as $dir) { + $file = "{$dir}/.ftpignore"; + if (!is_file($file)) { + continue; + } + $lines = file($file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); + if ($lines === false) { + continue; + } + foreach ($lines as $line) { + $line = trim((string) preg_replace('/#.*$/', '', $line)); + if ($line === '' || str_starts_with($line, '!')) { + continue; + } + $line = rtrim($line, '/'); + $anchored = str_starts_with($line, '/'); + $line = ltrim($line, '/'); + + $regex = preg_quote($line, '/'); + $regex = str_replace('\*\*', '.*', $regex); + $regex = str_replace('\*', '[^/]*', $regex); + $regex = str_replace('\?', '[^/]', $regex); + $regex = $anchored ? '^' . $regex : '(^|/)' . $regex; + $patterns[] = $regex . '(/|$)'; + } + } + + return $patterns; + } + + private function shouldIgnore(string $relativePath): bool + { + // Always skip dotfiles (except .htaccess) + $basename = basename($relativePath); + if (str_starts_with($basename, '.') && $basename !== '.htaccess') { + return true; + } + + foreach ($this->ignorePatterns as $pattern) { + if (preg_match('#' . $pattern . '#i', $relativePath) === 1) { + return true; + } + } + return false; + } + + // ═══════════════════════════════════════════════════════════════════════════ + // Helpers + // ═══════════════════════════════════════════════════════════════════════════ + + /** + * Return the first existing directory from a list of candidates. + */ + private function firstExistingDir(string $base, array $candidates): ?string + { + foreach ($candidates as $sub) { + $path = "{$base}/{$sub}"; + if (is_dir($path)) { + return $path; + } + } + return null; + } + + private function printManifestChangeWarning(string $manifestPath): void + { + $name = basename($manifestPath); + $this->log("NOTE: If {$name} has changed (new fields, permissions, menu items,"); + $this->log(" database schema), reinstall the extension through Joomla."); + $this->log(" Code changes (PHP, JS, CSS, language) do NOT require reinstall."); + $this->log(""); + } + + /** + * Dry-run: walk the deploy map and show what would be uploaded. + */ + private function dryRunWalk(array $deployMap): void + { + foreach ($deployMap as $map) { + if (!is_dir($map['local'])) { + $this->log("[DRY RUN] SKIP: {$map['local']} (not found)"); + continue; + } + $count = iterator_count( + new \RecursiveIteratorIterator( + new \RecursiveDirectoryIterator($map['local'], \FilesystemIterator::SKIP_DOTS), + \RecursiveIteratorIterator::LEAVES_ONLY + ) + ); + $this->log("[DRY RUN] {$map['local']} ({$count} files) → {$map['remote']}"); + } + } +} + +$app = new DeployJoomla(); +exit($app->execute()); diff --git a/cli/grafana_dashboard.php b/cli/grafana_dashboard.php index 35514ec..833b792 100644 --- a/cli/grafana_dashboard.php +++ b/cli/grafana_dashboard.php @@ -12,7 +12,7 @@ * INGROUP: moko-platform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /cli/grafana_dashboard.php - * VERSION: 09.21.07 + * VERSION: 09.22.00 * BRIEF: Manage Grafana dashboards via API */ diff --git a/cli/joomla_build.php b/cli/joomla_build.php index cde2177..d1b54c2 100644 --- a/cli/joomla_build.php +++ b/cli/joomla_build.php @@ -9,7 +9,7 @@ * INGROUP: moko-platform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /cli/joomla_build.php - * VERSION: 09.21.07 + * VERSION: 09.22.00 * 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_release.php b/cli/joomla_release.php index 4845f0a..b136937 100644 --- a/cli/joomla_release.php +++ b/cli/joomla_release.php @@ -36,7 +36,7 @@ use MokoEnterprise\{ApiClient, AuditLogger, CliFramework, Config, PlatformAdapte */ class JoomlaRelease extends CliFramework { - private const VERSION = '04.06.00'; + private const VERSION = '09.22.00'; private const ORG = 'MokoConsulting'; private const STABILITY_TAGS = [ @@ -379,7 +379,7 @@ class JoomlaRelease extends CliFramework $this->api->post("/repos/{$repo}/releases", [ 'tag_name' => $tag, 'name' => $releaseName, - 'body' => "## {$version}\n\nCreated by MokoStandards release pipeline.", + 'body' => "## {$version}\n\nCreated by moko-platform release pipeline.", 'prerelease' => ($stability !== 'stable'), ]); } diff --git a/cli/license_manage.php b/cli/license_manage.php new file mode 100644 index 0000000..318999c --- /dev/null +++ b/cli/license_manage.php @@ -0,0 +1,683 @@ +#!/usr/bin/env php + + * + * 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 + * PATH: /cli/license_manage.php + * BRIEF: Manage license packages and keys via MokoGitea licensing API + * + * Usage: + * php bin/moko license:list --org MokoConsulting + * php bin/moko license:create-package --org MokoConsulting --name "Pro Annual" --duration 365 --max-sites 5 + * php bin/moko license:issue --org MokoConsulting --package-id 1 --licensee "Client Inc" --email client@example.com + * php bin/moko license:revoke --org MokoConsulting --key-id 42 + * php bin/moko license:renew --org MokoConsulting --key-id 42 --days 365 + * php bin/moko license:validate --key MOKO-ABCD-1234-EF56-7890 --domain example.com + * php bin/moko license:usage --org MokoConsulting --key-id 42 + * php bin/moko license:master-key --org MokoConsulting + */ + +declare(strict_types=1); + +require_once __DIR__ . '/../vendor/autoload.php'; +require_once __DIR__ . '/../lib/Enterprise/CliFramework.php'; + +use MokoEnterprise\CliFramework; + +class LicenseManage extends CliFramework +{ + private string $apiBase = ''; + private string $token = ''; + private string $subcommand = ''; + + protected function configure(): void + { + $this->setDescription('Manage license packages and keys via MokoGitea licensing API'); + $this->addArgument('--org', 'Organization name', ''); + $this->addArgument('--api-base', 'Gitea API base URL', ''); + $this->addArgument('--token', 'API token (or set GH_TOKEN env)', ''); + + // Package args + $this->addArgument('--name', 'Package name (for create-package)', ''); + $this->addArgument('--description', 'Package description', ''); + $this->addArgument('--duration', 'Duration in days (0 = lifetime)', '0'); + $this->addArgument('--max-sites', 'Max sites per key (0 = unlimited)', '0'); + $this->addArgument('--repo-scope', 'Repo scope: all or comma-separated repo IDs', 'all'); + $this->addArgument('--channels', 'Allowed channels: JSON array or comma-separated', ''); + + // Key args + $this->addArgument('--package-id', 'License package ID', ''); + $this->addArgument('--key-id', 'License key ID', ''); + $this->addArgument('--key', 'Raw license key string (for validate)', ''); + $this->addArgument('--licensee', 'Licensee name', ''); + $this->addArgument('--email', 'Licensee email', ''); + $this->addArgument('--domain', 'Domain restriction or validation domain', ''); + $this->addArgument('--domains', 'Comma-separated allowed domains', ''); + $this->addArgument('--payment-ref', 'Payment reference (idempotency key)', ''); + $this->addArgument('--days', 'Days to extend (for renew)', '365'); + $this->addArgument('--custom-key', 'Use a custom key string instead of auto-generated', ''); + + // Output + $this->addArgument('--json', 'Output as JSON', false); + } + + protected function initialize(): void + { + // Resolve API base + $this->apiBase = $this->getArgument('--api-base') + ?: getenv('GITEA_URL') + ?: 'https://git.mokoconsulting.tech'; + $this->apiBase = rtrim($this->apiBase, '/'); + + // Resolve token + $this->token = $this->getArgument('--token') + ?: getenv('GH_TOKEN') + ?: getenv('GITHUB_TOKEN') + ?: ''; + + if (empty($this->token)) { + $ghToken = trim((string) @shell_exec('gh auth token 2>/dev/null')); + if (!empty($ghToken)) { + $this->token = $ghToken; + } + } + + // Determine subcommand from argv + global $argv; + foreach ($argv as $arg) { + if (in_array($arg, [ + 'list', 'create-package', 'update-package', 'delete-package', + 'issue', 'revoke', 'activate', 'renew', 'validate', + 'usage', 'master-key', 'keys', 'packages', + ], true)) { + $this->subcommand = $arg; + break; + } + } + } + + protected function run(): int + { + if (empty($this->token)) { + $this->log('No API token found. Set GH_TOKEN or pass --token.', 'ERROR'); + return 1; + } + + return match ($this->subcommand) { + 'packages', 'list' => $this->listPackages(), + 'create-package' => $this->createPackage(), + 'update-package' => $this->updatePackage(), + 'delete-package' => $this->deletePackage(), + 'keys' => $this->listKeys(), + 'issue' => $this->issueKey(), + 'revoke' => $this->revokeKey(), + 'activate' => $this->activateKey(), + 'renew' => $this->renewKey(), + 'validate' => $this->validateKey(), + 'usage' => $this->viewUsage(), + 'master-key' => $this->ensureMasterKey(), + default => $this->showSubcommandHelp(), + }; + } + + // ── Subcommand help ────────────────────────────────────────────────── + + private function showSubcommandHelp(): int + { + $this->section('License Management — Subcommands'); + echo <<requireOrg(); + if ($org === null) { + return 1; + } + + $result = $this->apiGet("/orgs/{$org}/license-packages"); + if ($result === null) { + return 1; + } + + if ($this->getArgument('--json')) { + echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n"; + return 0; + } + + $this->section("License Packages — {$org}"); + if (empty($result)) { + $this->log('No packages found.', 'WARN'); + return 0; + } + + foreach ($result as $pkg) { + $duration = ($pkg['duration_days'] ?? 0) === 0 ? 'lifetime' : ($pkg['duration_days'] . ' days'); + $sites = ($pkg['max_sites'] ?? 0) === 0 ? 'unlimited' : (string)$pkg['max_sites']; + $active = ($pkg['is_active'] ?? true) ? 'active' : 'inactive'; + $this->status( + sprintf('#%d %s', $pkg['id'] ?? 0, $pkg['name'] ?? ''), + true, + sprintf('%s | %s sites | %s', $duration, $sites, $active) + ); + } + return 0; + } + + private function createPackage(): int + { + $org = $this->requireOrg(); + if ($org === null) { + return 1; + } + + $name = $this->getArgument('--name'); + if (empty($name)) { + $this->log('--name is required for create-package', 'ERROR'); + return 1; + } + + $channels = $this->getArgument('--channels'); + if (!empty($channels) && $channels[0] !== '[') { + $channels = json_encode(explode(',', $channels)); + } + + $data = [ + 'name' => $name, + 'description' => $this->getArgument('--description') ?: '', + 'duration_days' => (int) $this->getArgument('--duration'), + 'max_sites' => (int) $this->getArgument('--max-sites'), + 'repo_scope' => $this->getArgument('--repo-scope'), + 'allowed_channels' => $channels ?: '', + ]; + + if ($this->isDryRun()) { + $this->log('Would create package: ' . json_encode($data, JSON_PRETTY_PRINT), 'DRY-RUN'); + return 0; + } + + $result = $this->apiPost("/orgs/{$org}/license-packages", $data); + if ($result === null) { + return 1; + } + + if ($this->getArgument('--json')) { + echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n"; + } else { + $this->log(sprintf('Created package #%d: %s', $result['id'] ?? 0, $name), 'OK'); + } + return 0; + } + + private function updatePackage(): int + { + $org = $this->requireOrg(); + $pkgId = $this->getArgument('--package-id'); + if ($org === null || empty($pkgId)) { + $this->log('--org and --package-id are required', 'ERROR'); + return 1; + } + + $data = array_filter([ + 'name' => $this->getArgument('--name') ?: null, + 'description' => $this->getArgument('--description') ?: null, + 'duration_days' => $this->getArgument('--duration') !== '0' ? (int)$this->getArgument('--duration') : null, + 'max_sites' => $this->getArgument('--max-sites') !== '0' ? (int)$this->getArgument('--max-sites') : null, + ], fn($v) => $v !== null); + + if (empty($data)) { + $this->log('No fields to update. Pass --name, --description, --duration, or --max-sites.', 'WARN'); + return 1; + } + + if ($this->isDryRun()) { + $this->log("Would update package #{$pkgId}: " . json_encode($data), 'DRY-RUN'); + return 0; + } + + $result = $this->apiPatch("/orgs/{$org}/license-packages/{$pkgId}", $data); + if ($result === null) { + return 1; + } + + $this->log("Updated package #{$pkgId}", 'OK'); + return 0; + } + + private function deletePackage(): int + { + $org = $this->requireOrg(); + $pkgId = $this->getArgument('--package-id'); + if ($org === null || empty($pkgId)) { + $this->log('--org and --package-id are required', 'ERROR'); + return 1; + } + + if ($this->isDryRun()) { + $this->log("Would delete package #{$pkgId}", 'DRY-RUN'); + return 0; + } + + $result = $this->apiDelete("/orgs/{$org}/license-packages/{$pkgId}"); + if ($result === null) { + return 1; + } + + $this->log("Deleted package #{$pkgId}", 'OK'); + return 0; + } + + // ── Key operations ─────────────────────────────────────────────────── + + private function listKeys(): int + { + $org = $this->requireOrg(); + if ($org === null) { + return 1; + } + + $pkgId = $this->getArgument('--package-id'); + $endpoint = $pkgId + ? "/orgs/{$org}/license-packages/{$pkgId}/keys" + : "/orgs/{$org}/license-keys"; + + $result = $this->apiGet($endpoint); + if ($result === null) { + return 1; + } + + if ($this->getArgument('--json')) { + echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n"; + return 0; + } + + $this->section("License Keys — {$org}" . ($pkgId ? " (Package #{$pkgId})" : '')); + if (empty($result)) { + $this->log('No keys found.', 'WARN'); + return 0; + } + + foreach ($result as $key) { + $prefix = $key['key_prefix'] ?? '???'; + $licensee = $key['licensee_name'] ?? 'N/A'; + $active = ($key['is_active'] ?? true) ? 'active' : 'revoked'; + $internal = ($key['is_internal'] ?? false) ? ' [MASTER]' : ''; + $domains = $key['domain_restriction'] ?? ''; + $expires = ($key['expires_unix'] ?? 0) > 0 + ? date('Y-m-d', (int) $key['expires_unix']) + : 'never'; + + $this->status( + sprintf('#%d %s', $key['id'] ?? 0, $prefix), + $key['is_active'] ?? true, + sprintf('%s | %s | expires: %s | domains: %s%s', $licensee, $active, $expires, $domains ?: 'any', $internal) + ); + } + return 0; + } + + private function issueKey(): int + { + $org = $this->requireOrg(); + $pkgId = $this->getArgument('--package-id'); + if ($org === null || empty($pkgId)) { + $this->log('--org and --package-id are required', 'ERROR'); + return 1; + } + + $data = [ + 'package_id' => (int) $pkgId, + 'licensee_name' => $this->getArgument('--licensee') ?: '', + 'licensee_email' => $this->getArgument('--email') ?: '', + 'domain_restriction' => $this->getArgument('--domains') ?: '', + 'max_sites' => (int) $this->getArgument('--max-sites'), + 'payment_ref' => $this->getArgument('--payment-ref') ?: '', + ]; + + $customKey = $this->getArgument('--custom-key'); + if (!empty($customKey)) { + $data['custom_key'] = $customKey; + } + + if ($this->isDryRun()) { + $this->log('Would issue key: ' . json_encode($data, JSON_PRETTY_PRINT), 'DRY-RUN'); + return 0; + } + + $result = $this->apiPost("/orgs/{$org}/license-keys", $data); + if ($result === null) { + return 1; + } + + if ($this->getArgument('--json')) { + echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n"; + } else { + $rawKey = $result['raw_key'] ?? ''; + $this->section('License Key Issued'); + if (!empty($rawKey)) { + echo "\n"; + $this->log("Raw Key: {$rawKey}", 'OK'); + $this->log('This key will NOT be shown again. Save it now.', 'WARN'); + echo "\n"; + } + $this->log(sprintf('Key ID: #%d | Prefix: %s', $result['id'] ?? 0, $result['key_prefix'] ?? ''), 'INFO'); + } + return 0; + } + + private function revokeKey(): int + { + return $this->toggleKey(false); + } + + private function activateKey(): int + { + return $this->toggleKey(true); + } + + private function toggleKey(bool $activate): int + { + $org = $this->requireOrg(); + $keyId = $this->getArgument('--key-id'); + if ($org === null || empty($keyId)) { + $this->log('--org and --key-id are required', 'ERROR'); + return 1; + } + + $action = $activate ? 'activate' : 'revoke'; + + if ($this->isDryRun()) { + $this->log("Would {$action} key #{$keyId}", 'DRY-RUN'); + return 0; + } + + $result = $this->apiPatch("/orgs/{$org}/license-keys/{$keyId}", [ + 'is_active' => $activate, + ]); + if ($result === null) { + return 1; + } + + $label = $activate ? 'Activated' : 'Revoked'; + $this->log("{$label} key #{$keyId}", 'OK'); + return 0; + } + + private function renewKey(): int + { + $org = $this->requireOrg(); + $keyId = $this->getArgument('--key-id'); + $days = (int) $this->getArgument('--days'); + if ($org === null || empty($keyId)) { + $this->log('--org and --key-id are required', 'ERROR'); + return 1; + } + + if ($this->isDryRun()) { + $this->log("Would renew key #{$keyId} by {$days} days", 'DRY-RUN'); + return 0; + } + + $result = $this->apiPost("/orgs/{$org}/license-keys/{$keyId}/renew", [ + 'days' => $days, + ]); + if ($result === null) { + return 1; + } + + $newExpiry = isset($result['expires_unix']) && $result['expires_unix'] > 0 + ? date('Y-m-d', (int) $result['expires_unix']) + : 'never'; + $this->log("Renewed key #{$keyId} — new expiry: {$newExpiry}", 'OK'); + return 0; + } + + private function validateKey(): int + { + $rawKey = $this->getArgument('--key'); + if (empty($rawKey)) { + $this->log('--key is required for validate', 'ERROR'); + return 1; + } + + $data = ['key' => $rawKey]; + $domain = $this->getArgument('--domain'); + if (!empty($domain)) { + $data['domain'] = $domain; + } + + $result = $this->apiPost('/license-keys/validate', $data); + if ($result === null) { + return 1; + } + + if ($this->getArgument('--json')) { + echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n"; + return 0; + } + + $valid = $result['valid'] ?? false; + if ($valid) { + $this->status('License Valid', true, sprintf( + 'Package: %s | Expires: %s | Sites: %s', + $result['package_name'] ?? 'N/A', + isset($result['expires_unix']) && $result['expires_unix'] > 0 + ? date('Y-m-d', (int) $result['expires_unix']) : 'never', + $result['max_sites'] ?? 'unlimited' + )); + return 0; + } else { + $this->status('License Invalid', false, $result['error'] ?? 'Unknown reason'); + return 1; + } + } + + private function viewUsage(): int + { + $org = $this->requireOrg(); + $keyId = $this->getArgument('--key-id'); + if ($org === null || empty($keyId)) { + $this->log('--org and --key-id are required', 'ERROR'); + return 1; + } + + $result = $this->apiGet("/orgs/{$org}/license-keys/{$keyId}/usage"); + if ($result === null) { + return 1; + } + + if ($this->getArgument('--json')) { + echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n"; + return 0; + } + + $this->section("Usage — Key #{$keyId}"); + $entries = $result['entries'] ?? $result; + if (empty($entries)) { + $this->log('No usage recorded.', 'WARN'); + return 0; + } + + foreach ($entries as $u) { + $date = isset($u['created_unix']) ? date('Y-m-d H:i', (int) $u['created_unix']) : 'N/A'; + $domain = $u['domain'] ?? ''; + $ip = $u['ip_address'] ?? ''; + $from = $u['version_from'] ?? ''; + $this->log(sprintf('%s | %s | %s | from %s', $date, $domain ?: 'no domain', $ip, $from ?: 'unknown'), 'INFO'); + } + return 0; + } + + private function ensureMasterKey(): int + { + $org = $this->requireOrg(); + if ($org === null) { + return 1; + } + + if ($this->isDryRun()) { + $this->log("Would ensure master key for {$org}", 'DRY-RUN'); + return 0; + } + + $result = $this->apiPost("/orgs/{$org}/license-keys/master", []); + if ($result === null) { + return 1; + } + + if ($this->getArgument('--json')) { + echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n"; + return 0; + } + + $rawKey = $result['raw_key'] ?? ''; + if (!empty($rawKey)) { + $this->section('Master Key Created'); + echo "\n"; + $this->log("Raw Key: {$rawKey}", 'OK'); + $this->log('This key will NOT be shown again. Save it now.', 'WARN'); + echo "\n"; + } else { + $this->log('Master key already exists.', 'INFO'); + } + return 0; + } + + // ── Helpers ────────────────────────────────────────────────────────── + + private function requireOrg(): ?string + { + $org = $this->getArgument('--org'); + if (empty($org)) { + // Try to detect from git remote + $remote = trim((string) @shell_exec('git remote get-url origin 2>/dev/null')); + if (preg_match('#[/:]([^/]+)/[^/]+?(?:\.git)?$#', $remote, $m)) { + $org = $m[1]; + } + } + if (empty($org)) { + $this->log('--org is required (or must be detectable from git remote)', 'ERROR'); + return null; + } + return $org; + } + + private function apiGet(string $path): ?array + { + return $this->apiRequest('GET', $path); + } + + private function apiPost(string $path, array $data): ?array + { + return $this->apiRequest('POST', $path, $data); + } + + private function apiPatch(string $path, array $data): ?array + { + return $this->apiRequest('PATCH', $path, $data); + } + + private function apiDelete(string $path): ?array + { + return $this->apiRequest('DELETE', $path); + } + + private function apiRequest(string $method, string $path, ?array $data = null): ?array + { + $url = $this->apiBase . '/api/v1' . $path; + + $ch = curl_init(); + curl_setopt_array($ch, [ + CURLOPT_URL => $url, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_CUSTOMREQUEST => $method, + CURLOPT_HTTPHEADER => [ + 'Authorization: token ' . $this->token, + 'Content-Type: application/json', + 'Accept: application/json', + ], + CURLOPT_TIMEOUT => 30, + ]); + + if ($data !== null && in_array($method, ['POST', 'PUT', 'PATCH'], true)) { + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); + } + + if ($this->getArgument('--verbose')) { + $this->log("{$method} {$url}", 'DEBUG'); + } + + $response = curl_exec($ch); + $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); + $error = curl_error($ch); + curl_close($ch); + + if (!empty($error)) { + $this->log("API error: {$error}", 'ERROR'); + return null; + } + + if ($httpCode === 404) { + $this->log("API endpoint not found: {$path}", 'ERROR'); + $this->log('The licensing API may not be deployed yet. Check MokoGitea version.', 'WARN'); + return null; + } + + if ($httpCode === 204) { + return []; // success, no content + } + + if ($httpCode >= 400) { + $body = json_decode((string) $response, true); + $msg = $body['message'] ?? $response; + $this->log("API error ({$httpCode}): {$msg}", 'ERROR'); + return null; + } + + $decoded = json_decode((string) $response, true); + if ($decoded === null && !empty($response)) { + $this->log('Failed to parse API response', 'ERROR'); + return null; + } + + return $decoded ?? []; + } +} + +$app = new LicenseManage(); +exit($app->execute()); diff --git a/cli/manifest_read.php b/cli/manifest_read.php index afb05d2..684e728 100644 --- a/cli/manifest_read.php +++ b/cli/manifest_read.php @@ -9,7 +9,7 @@ * INGROUP: moko-platform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /cli/manifest_read.php - * VERSION: 09.21.07 + * VERSION: 09.22.00 * BRIEF: Parse .manifest.xml and output requested field(s) for CI consumption */ diff --git a/cli/release_cascade.php b/cli/release_cascade.php index 37371de..716b0e6 100644 --- a/cli/release_cascade.php +++ b/cli/release_cascade.php @@ -9,7 +9,7 @@ * INGROUP: moko-platform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /cli/release_cascade.php - * VERSION: 09.21.07 + * VERSION: 09.22.00 * BRIEF: DEPRECATED — cascade behavior removed. Each release stream is independent. */ diff --git a/cli/release_publish.php b/cli/release_publish.php index 81e5c34..53d1863 100644 --- a/cli/release_publish.php +++ b/cli/release_publish.php @@ -9,7 +9,7 @@ * INGROUP: moko-platform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /cli/release_publish.php - * VERSION: 09.21.07 + * VERSION: 09.22.00 * BRIEF: Publish a release and create copies for all lesser stability streams. */ diff --git a/cli/scaffold_client.php b/cli/scaffold_client.php index bc2bec7..7a8016b 100644 --- a/cli/scaffold_client.php +++ b/cli/scaffold_client.php @@ -11,7 +11,7 @@ * INGROUP: moko-platform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /cli/scaffold_client.php - * VERSION: 09.21.07 + * VERSION: 09.22.00 * BRIEF: Scaffold a new client-waas repo from Template-Client-WaaS with pre-configured settings */ diff --git a/cli/updates_xml_sync.php b/cli/updates_xml_sync.php index 01549f9..f9600a8 100644 --- a/cli/updates_xml_sync.php +++ b/cli/updates_xml_sync.php @@ -9,7 +9,7 @@ * INGROUP: moko-platform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /cli/updates_xml_sync.php - * VERSION: 09.21.07 + * VERSION: 09.22.00 * 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 1896e38..cc47925 100644 --- a/cli/version_auto_bump.php +++ b/cli/version_auto_bump.php @@ -9,7 +9,7 @@ * INGROUP: moko-platform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /cli/version_auto_bump.php - * VERSION: 09.21.07 + * VERSION: 09.22.00 * BRIEF: Auto patch-bump, set stability suffix, and commit — single CLI replacing inline workflow bash */ diff --git a/cli/version_check.php b/cli/version_check.php index a9d50ed..79aebb8 100644 --- a/cli/version_check.php +++ b/cli/version_check.php @@ -9,7 +9,7 @@ * INGROUP: moko-platform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /cli/version_check.php - * VERSION: 09.21.07 + * VERSION: 09.22.00 * BRIEF: Validate version consistency across README, manifests, and sub-packages */ diff --git a/cli/wiki_sync.php b/cli/wiki_sync.php index 4d10b83..c64e453 100644 --- a/cli/wiki_sync.php +++ b/cli/wiki_sync.php @@ -9,7 +9,7 @@ * INGROUP: moko-platform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /cli/wiki_sync.php - * VERSION: 09.21.07 + * VERSION: 09.22.00 * BRIEF: Sync select wiki pages from moko-platform to all template repos */ diff --git a/composer.json b/composer.json index 02f9725..9278ca2 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,8 @@ { "name": "mokoconsulting-tech/enterprise", - "description": "MokoStandards Enterprise API \u2014 PHP implementation", + "description": "moko-platform Enterprise API \u2014 PHP implementation", "type": "library", - "version": "09.01.00", + "version": "09.22.00", "license": "GPL-3.0-or-later", "authors": [ { diff --git a/deploy/backup-before-deploy.php b/deploy/backup-before-deploy.php index 274a304..6f6af33 100644 --- a/deploy/backup-before-deploy.php +++ b/deploy/backup-before-deploy.php @@ -11,7 +11,7 @@ * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /deploy/backup-before-deploy.php - * VERSION: 09.21.07 + * VERSION: 09.22.00 * BRIEF: Snapshot Joomla directories before deployment for rollback capability */ diff --git a/deploy/deploy-dolibarr.php b/deploy/deploy-dolibarr.php index 637f8ea..494b761 100644 --- a/deploy/deploy-dolibarr.php +++ b/deploy/deploy-dolibarr.php @@ -11,7 +11,7 @@ * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /deploy/deploy-dolibarr.php - * VERSION: 09.21.07 + * VERSION: 09.22.00 * BRIEF: Deploy Dolibarr module files to a remote server via SFTP/rsync */ diff --git a/deploy/health-check.php b/deploy/health-check.php index 5ff8920..9e30f30 100644 --- a/deploy/health-check.php +++ b/deploy/health-check.php @@ -11,7 +11,7 @@ * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /deploy/health-check.php - * VERSION: 09.21.07 + * VERSION: 09.22.00 * 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 fe5eaab..cfa6cd0 100644 --- a/deploy/rollback-joomla.php +++ b/deploy/rollback-joomla.php @@ -11,7 +11,7 @@ * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /deploy/rollback-joomla.php - * VERSION: 09.21.07 + * VERSION: 09.22.00 * 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 dc6c8ce..419c9ed 100644 --- a/deploy/sync-joomla.php +++ b/deploy/sync-joomla.php @@ -11,7 +11,7 @@ * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /deploy/sync-joomla.php - * VERSION: 09.21.07 + * VERSION: 09.22.00 * 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 b48a667..6f5d4d6 100644 --- a/fix/fix_line_endings.php +++ b/fix/fix_line_endings.php @@ -7,57 +7,43 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Scripts.Fix - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Scripts.Fix + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /fix/fix_line_endings.php - * BRIEF: CLI script to fix line endings (CRLF → LF) in tracked files + * BRIEF: CLI script to normalise CRLF/CR to LF in tracked source files */ declare(strict_types=1); -require_once __DIR__ . '/../lib/CliBase.php'; -require_once __DIR__ . '/../../vendor/autoload.php'; +require_once __DIR__ . '/../vendor/autoload.php'; +require_once __DIR__ . '/../lib/Enterprise/CliFramework.php'; +use MokoEnterprise\CliFramework; use MokoEnterprise\FileFixUtility; -/** - * CLI wrapper that delegates line-ending fixes to FileFixUtility. - */ -class FixLineEndings extends CliBase +class FixLineEndings extends CliFramework { - /** - * Print usage information. - */ - protected function showHelp(): void - { - echo "Usage: {$this->scriptName} [--path DIR] [--dry-run] [--help]\n\n"; - echo "Fixes CRLF line endings to LF in all tracked source files.\n\n"; - echo "OPTIONS:\n"; - echo " --path DIR Repository root (default: current directory)\n"; - echo " --dry-run Show what would be changed without modifying files\n"; - echo " --help Show this help message\n"; - } + protected function configure(): void + { + $this->setDescription('Normalise CRLF/CR to LF in tracked source files'); + $this->addArgument('--path', 'Repository root (default: current directory)', '.'); + } - /** - * Run the line-ending fix via FileFixUtility. - * - * @return int Exit code: 0 on success. - */ - protected function execute(): int - { - $path = (string) ($this->getOption('path') ?? '.'); - $files = FileFixUtility::fixLineEndings($path, $this->dryRun); + protected function run(): int + { + $path = (string) $this->getArgument('--path'); + $files = FileFixUtility::fixLineEndings($path, $this->dryRun); - foreach ($files as $f) { - $this->success("Fixed: {$f}"); - } + foreach ($files as $f) { + $this->status(true, "Fixed: {$f}"); + } - $label = $this->dryRun ? 'Would fix' : 'Fixed'; - $this->log("{$label} " . count($files) . ' file(s)'); - return 0; - } + $label = $this->dryRun ? 'Would fix' : 'Fixed'; + $this->log("{$label} " . count($files) . ' file(s)'); + return self::EXIT_SUCCESS; + } } -$script = new FixLineEndings($argv); -exit($script->run()); +$app = new FixLineEndings(); +exit($app->execute()); diff --git a/fix/fix_permissions.php b/fix/fix_permissions.php index 7f88cf9..615c915 100644 --- a/fix/fix_permissions.php +++ b/fix/fix_permissions.php @@ -7,57 +7,43 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Scripts.Fix - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Scripts.Fix + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /fix/fix_permissions.php - * BRIEF: CLI script to fix file permissions (dirs 755, files 644, scripts 755) + * BRIEF: CLI script to normalise file permissions (dirs 755, files 644, scripts 755) */ declare(strict_types=1); -require_once __DIR__ . '/../lib/CliBase.php'; -require_once __DIR__ . '/../../vendor/autoload.php'; +require_once __DIR__ . '/../vendor/autoload.php'; +require_once __DIR__ . '/../lib/Enterprise/CliFramework.php'; +use MokoEnterprise\CliFramework; use MokoEnterprise\FileFixUtility; -/** - * CLI wrapper that delegates permission fixes to FileFixUtility. - */ -class FixPermissions extends CliBase +class FixPermissions extends CliFramework { - /** - * Print usage information. - */ - protected function showHelp(): void - { - echo "Usage: {$this->scriptName} [--path DIR] [--dry-run] [--help]\n\n"; - echo "Fixes file permissions: 644 for files, 755 for dirs and *.php/*.sh scripts.\n\n"; - echo "OPTIONS:\n"; - echo " --path DIR Repository root (default: current directory)\n"; - echo " --dry-run Show what would be changed without modifying files\n"; - echo " --help Show this help message\n"; - } + protected function configure(): void + { + $this->setDescription('Normalise file permissions (dirs 755, files 644, scripts 755)'); + $this->addArgument('--path', 'Repository root (default: current directory)', '.'); + } - /** - * Run the permissions fix via FileFixUtility. - * - * @return int Exit code: 0 on success. - */ - protected function execute(): int - { - $path = (string) ($this->getOption('path') ?? '.'); + protected function run(): int + { + $path = (string) $this->getArgument('--path'); - if ($this->dryRun) { - $this->warning('[DRY-RUN] Would fix permissions (dirs 755, files 644, scripts 755)'); - return 0; - } + if ($this->dryRun) { + $this->log('WARNING', 'Would fix permissions (dirs 755, files 644, scripts 755)'); + return self::EXIT_SUCCESS; + } - FileFixUtility::fixPermissions($path, $this->dryRun); - $this->success('[OK] Permissions fixed'); - return 0; - } + FileFixUtility::fixPermissions($path, $this->dryRun); + $this->log('SUCCESS', 'Permissions fixed'); + return self::EXIT_SUCCESS; + } } -$script = new FixPermissions($argv); -exit($script->run()); +$app = new FixPermissions(); +exit($app->execute()); diff --git a/fix/fix_tabs.php b/fix/fix_tabs.php index 35508e3..13f5709 100644 --- a/fix/fix_tabs.php +++ b/fix/fix_tabs.php @@ -7,8 +7,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Scripts.Fix - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Scripts.Fix + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /fix/fix_tabs.php * BRIEF: CLI script to convert tabs to spaces in tracked source files @@ -16,57 +16,42 @@ declare(strict_types=1); -require_once __DIR__ . '/../lib/CliBase.php'; -require_once __DIR__ . '/../../vendor/autoload.php'; +require_once __DIR__ . '/../vendor/autoload.php'; +require_once __DIR__ . '/../lib/Enterprise/CliFramework.php'; +use MokoEnterprise\CliFramework; use MokoEnterprise\FileFixUtility; -/** - * CLI wrapper that delegates tab-to-space conversion to FileFixUtility. - */ -class FixTabs extends CliBase +class FixTabs extends CliFramework { - /** - * Print usage information. - */ - protected function showHelp(): void - { - echo "Usage: {$this->scriptName} [--path DIR] [--type TYPE] [--dry-run] [--help]\n\n"; - echo "Convert tabs to spaces in tracked source files.\n\n"; - echo "OPTIONS:\n"; - echo " --path DIR Repository root (default: current directory)\n"; - echo " --type TYPE File type: yaml, python, shell, all (default: all)\n"; - echo " --dry-run Show changes without modifying files\n"; - echo " --help Show this help message\n\n"; - echo "NOTE: Makefile variants are always skipped.\n"; - } + protected function configure(): void + { + $this->setDescription('Convert tabs to spaces in tracked source files'); + $this->addArgument('--path', 'Repository root (default: current directory)', '.'); + $this->addArgument('--type', 'File type: yaml, python, shell, all', 'all'); + } - /** - * Run the tab-fix via FileFixUtility. - * - * @return int Exit code: 0 on success, 2 on invalid arguments. - */ - protected function execute(): int - { - $path = (string) ($this->getOption('path') ?? '.'); - $fileType = (string) ($this->getOption('type') ?? 'all'); + protected function run(): int + { + $path = (string) $this->getArgument('--path'); + $fileType = (string) $this->getArgument('--type'); - try { - $files = FileFixUtility::fixTabs($path, $fileType, $this->dryRun); - } catch (\InvalidArgumentException $e) { - $this->log($e->getMessage(), 'ERROR'); - return 2; - } + try { + $files = FileFixUtility::fixTabs($path, $fileType, $this->dryRun); + } catch (\InvalidArgumentException $e) { + $this->log('ERROR', $e->getMessage()); + return self::EXIT_USAGE; + } - foreach ($files as $f) { - $this->success("Fixed: {$f}"); - } + foreach ($files as $f) { + $this->status(true, "Fixed: {$f}"); + } - $label = $this->dryRun ? 'Would fix' : 'Fixed'; - $this->log("{$label} " . count($files) . ' file(s)'); - return 0; - } + $label = $this->dryRun ? 'Would fix' : 'Fixed'; + $this->log("{$label} " . count($files) . ' file(s)'); + return self::EXIT_SUCCESS; + } } -$script = new FixTabs($argv); -exit($script->run()); +$app = new FixTabs(); +exit($app->execute()); diff --git a/fix/fix_trailing_spaces.php b/fix/fix_trailing_spaces.php index 1e868b1..699163b 100644 --- a/fix/fix_trailing_spaces.php +++ b/fix/fix_trailing_spaces.php @@ -7,8 +7,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Scripts.Fix - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Scripts.Fix + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /fix/fix_trailing_spaces.php * BRIEF: CLI script to remove trailing whitespace from tracked source files @@ -16,56 +16,42 @@ declare(strict_types=1); -require_once __DIR__ . '/../lib/CliBase.php'; -require_once __DIR__ . '/../../vendor/autoload.php'; +require_once __DIR__ . '/../vendor/autoload.php'; +require_once __DIR__ . '/../lib/Enterprise/CliFramework.php'; +use MokoEnterprise\CliFramework; use MokoEnterprise\FileFixUtility; -/** - * CLI wrapper that delegates trailing-space removal to FileFixUtility. - */ -class FixTrailingSpaces extends CliBase +class FixTrailingSpaces extends CliFramework { - /** - * Print usage information. - */ - protected function showHelp(): void - { - echo "Usage: {$this->scriptName} [--path DIR] [--type TYPE] [--dry-run] [--help]\n\n"; - echo "Remove trailing whitespace from tracked source files.\n\n"; - echo "OPTIONS:\n"; - echo " --path DIR Repository root (default: current directory)\n"; - echo " --type TYPE File type: yaml, python, shell, markdown, all (default: all)\n"; - echo " --dry-run Show changes without modifying files\n"; - echo " --help Show this help message\n"; - } + protected function configure(): void + { + $this->setDescription('Remove trailing whitespace from tracked source files'); + $this->addArgument('--path', 'Repository root (default: current directory)', '.'); + $this->addArgument('--type', 'File type: yaml, python, shell, all', 'all'); + } - /** - * Run the trailing-space fix via FileFixUtility. - * - * @return int Exit code: 0 on success, 2 on invalid arguments. - */ - protected function execute(): int - { - $path = (string) ($this->getOption('path') ?? '.'); - $fileType = (string) ($this->getOption('type') ?? 'all'); + protected function run(): int + { + $path = (string) $this->getArgument('--path'); + $fileType = (string) $this->getArgument('--type'); - try { - $files = FileFixUtility::fixTrailingSpaces($path, $fileType, $this->dryRun); - } catch (\InvalidArgumentException $e) { - $this->log($e->getMessage(), 'ERROR'); - return 2; - } + try { + $files = FileFixUtility::fixTrailingSpaces($path, $fileType, $this->dryRun); + } catch (\InvalidArgumentException $e) { + $this->log('ERROR', $e->getMessage()); + return self::EXIT_USAGE; + } - foreach ($files as $f) { - $this->success("Fixed: {$f}"); - } + foreach ($files as $f) { + $this->status(true, "Fixed: {$f}"); + } - $label = $this->dryRun ? 'Would fix' : 'Fixed'; - $this->log("{$label} " . count($files) . ' file(s)'); - return 0; - } + $label = $this->dryRun ? 'Would fix' : 'Fixed'; + $this->log("{$label} " . count($files) . ' file(s)'); + return self::EXIT_SUCCESS; + } } -$script = new FixTrailingSpaces($argv); -exit($script->run()); +$app = new FixTrailingSpaces(); +exit($app->execute()); diff --git a/fix/index.md b/fix/index.md index 8edfc19..d632e0b 100644 --- a/fix/index.md +++ b/fix/index.md @@ -2,8 +2,8 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoStandards.Index -INGROUP: MokoStandards.Fix +DEFGROUP: MokoPlatform.Index +INGROUP: MokoPlatform.Fix REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform PATH: /fix/index.md BRIEF: Fix directory index diff --git a/index.md b/index.md index 1433b96..a70f6be 100644 --- a/index.md +++ b/index.md @@ -2,8 +2,8 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoStandards.Root -INGROUP: MokoStandards +DEFGROUP: MokoPlatform.Root +INGROUP: MokoPlatform REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform PATH: /index.md BRIEF: Scripts directory index @@ -11,7 +11,7 @@ BRIEF: Scripts directory index # Scripts Index -Quick navigation for MokoStandards scripts organized by function. +Quick navigation for moko-platform scripts organized by function. ## Core Categories diff --git a/lib/CliBase.php b/lib/CliBase.php index f905ae7..2151b44 100644 --- a/lib/CliBase.php +++ b/lib/CliBase.php @@ -7,8 +7,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Lib - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Lib + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 c84b193..6621891 100644 --- a/lib/Common.php +++ b/lib/Common.php @@ -7,8 +7,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Lib - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Lib + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /lib/Common.php * BRIEF: Common utility functions for scripts @@ -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/MokoStandards'; + const REPO_URL_GITHUB = 'https://git.mokoconsulting.tech/MokoConsulting/moko-platform'; 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 40f4ff9..9a3794a 100644 --- a/lib/Enterprise/AbstractProjectPlugin.php +++ b/lib/Enterprise/AbstractProjectPlugin.php @@ -9,8 +9,8 @@ declare(strict_types=1); * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise.Plugins - * INGROUP: MokoStandards.Enterprise + * DEFGROUP: MokoPlatform.Enterprise.Plugins + * INGROUP: MokoPlatform.Enterprise * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 MokoStandards\Enterprise + * @package MokoPlatform\Enterprise * @version 1.0.0 */ abstract class AbstractProjectPlugin implements ProjectPluginInterface diff --git a/lib/Enterprise/ApiClient.php b/lib/Enterprise/ApiClient.php index af55001..4e81d74 100644 --- a/lib/Enterprise/ApiClient.php +++ b/lib/Enterprise/ApiClient.php @@ -9,8 +9,8 @@ declare(strict_types=1); * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise.API - * INGROUP: MokoStandards.Enterprise + * DEFGROUP: MokoPlatform.Enterprise.API + * INGROUP: MokoPlatform.Enterprise * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 MokoStandards\Enterprise + * @package MokoPlatform\Enterprise * @version 04.00.04 - * @author MokoStandards Team + * @author moko-platform Team * @license GPL-3.0-or-later */ @@ -138,7 +138,7 @@ class ApiClient 'circuit_breaker_trips' => 0, ]; - public const VERSION = '04.06.00'; + public const VERSION = '09.22.00'; /** * Initialize API client. diff --git a/lib/Enterprise/AuditLogger.php b/lib/Enterprise/AuditLogger.php index 85883a2..7585825 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: MokoStandards.Enterprise.Audit - * INGROUP: MokoStandards.Enterprise + * DEFGROUP: MokoPlatform.Enterprise.Audit + * INGROUP: MokoPlatform.Enterprise * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /lib/Enterprise/AuditLogger.php * BRIEF: Enterprise audit logging * - * @package MokoStandards\Enterprise + * @package MokoPlatform\Enterprise * @version 04.00.04 - * @author MokoStandards Team + * @author moko-platform Team * @license GPL-3.0-or-later */ @@ -91,7 +91,7 @@ class AuditLogger private array $transactionStack = []; /** @var string Version constant */ - public const VERSION = '04.06.00'; + public const VERSION = '09.22.00'; /** * Initialize audit logger. diff --git a/lib/Enterprise/CheckpointManager.php b/lib/Enterprise/CheckpointManager.php index 295327f..0ceb785 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: MokoStandards.Enterprise.Checkpoint - * INGROUP: MokoStandards.Enterprise + * DEFGROUP: MokoPlatform.Enterprise.Checkpoint + * INGROUP: MokoPlatform.Enterprise * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /lib/Enterprise/CheckpointManager.php * BRIEF: Checkpoint manager for resumable operations * - * @package MokoStandards\Enterprise + * @package MokoPlatform\Enterprise * @version 04.00.04 - * @author MokoStandards Team + * @author moko-platform Team * @license GPL-3.0-or-later */ @@ -48,7 +48,7 @@ class CheckpointManager { private string $checkpointDir; - public const VERSION = '04.06.00'; + public const VERSION = '09.22.00'; /** * Initialize checkpoint manager. diff --git a/lib/Enterprise/CliFramework.php b/lib/Enterprise/CliFramework.php index 52e08f9..fe68f33 100644 --- a/lib/Enterprise/CliFramework.php +++ b/lib/Enterprise/CliFramework.php @@ -7,13 +7,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise.CLI - * INGROUP: MokoStandards.Enterprise + * DEFGROUP: MokoPlatform.Enterprise.CLI + * INGROUP: MokoPlatform.Enterprise * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /lib/Enterprise/CliFramework.php - * BRIEF: CLI base classes — CliFramework (current) and CLIApp (legacy) - * NOTE: All new scripts must extend CliFramework, not CLIApp. - * CLIApp remains for backward-compatibility with existing scripts. + * BRIEF: CliFramework — unified base class for all moko-platform CLI scripts */ declare(strict_types=1); @@ -24,689 +22,12 @@ use DateTime; use DateTimeZone; use Exception; -/** - * Base class for CLI applications with common functionality - */ -abstract class CLIApp -{ - private const VERSION = '04.06.00'; - - protected string $name; - protected string $description; - protected string $version; - protected array $options = []; - protected array $arguments = []; - protected bool $verbose = false; - protected bool $quiet = false; - protected bool $dryRun = false; - protected bool $jsonOutput = false; - - // Enterprise features - protected ?MetricsCollector $metrics = null; - protected ?object $auditLogger = null; - - public function __construct(string $name, string $description = '', string $version = self::VERSION) - { - $this->name = $name; - $this->description = $description ?: "{$name} - MokoStandards CLI Tool"; - $this->version = $version; - } - - /** - * Setup script-specific arguments - * - * Return an associative array where keys are option specs and values are descriptions. - * Option spec format: 'name:' for required value, 'name::' for optional value, 'name' for flag - * - * @return array Option specifications and descriptions - */ - abstract protected function setupArguments(): array; - - /** - * Main execution logic - * - * @return int Exit code (0 for success, non-zero for error) - */ - abstract protected function run(): int; - - /** - * Get common CLI options - * - * @return array Common options - */ - protected function getCommonOptions(): array - { - return [ - 'version' => 'Display version information', - 'verbose' => 'Enable verbose output', - 'v' => 'Alias for --verbose', - 'quiet' => 'Suppress non-error output', - 'q' => 'Alias for --quiet', - 'dry-run' => 'Perform dry run without making changes', - 'json' => 'Output results in JSON format', - 'metrics' => 'Collect and display metrics', - 'help' => 'Display this help message', - 'h' => 'Alias for --help', - ]; - } - - /** - * Parse command line arguments - */ - protected function parseArguments(): void - { - $shortOpts = 'vqh'; - $longOpts = [ - 'version', - 'verbose', - 'quiet', - 'dry-run', - 'json', - 'metrics', - 'help', - ]; - - // Add custom options - $customOpts = $this->setupArguments(); - foreach (array_keys($customOpts) as $opt) { - if (str_ends_with($opt, '::')) { - $longOpts[] = rtrim($opt, ':') . '::'; - } elseif (str_ends_with($opt, ':')) { - $longOpts[] = rtrim($opt, ':') . ':'; - } else { - $longOpts[] = $opt; - } - } - - // Use $GLOBALS['argv'] instead of getopt() so that bin/moko's in-process - // dispatch (via require) is respected. PHP's getopt() reads from the C-level - // argv set at process start and ignores runtime changes to $argv/$_SERVER['argv']. - $this->options = $this->parseArgv($GLOBALS['argv'] ?? [], $longOpts, $shortOpts); - $this->arguments = array_slice($GLOBALS['argv'] ?? [], 1); - - // Handle common flags - if (isset($this->options['version'])) { - echo "{$this->name} v{$this->version}\n"; - exit(0); - } - - if (isset($this->options['help']) || isset($this->options['h'])) { - $this->printHelp(); - exit(0); - } - - $this->verbose = isset($this->options['verbose']) || isset($this->options['v']); - $this->quiet = isset($this->options['quiet']) || isset($this->options['q']); - $this->dryRun = isset($this->options['dry-run']); - $this->jsonOutput = isset($this->options['json']); - } - - /** - * Parse an argv array using getopt-compatible option specs. - * - * Replaces PHP's getopt() so callers can inject a custom argv (e.g. bin/moko - * in-process dispatch sets $GLOBALS['argv'] before require-ing a script). - * - * @param list $argv Full argv including $argv[0] (script path) - * @param list $longOpts Long option specs, e.g. ['verbose', 'repos:', 'path::'] - * @param string $shortOpts Short option chars, e.g. 'vqh' - * @return array> Parsed options (same shape as getopt()) - */ - private function parseArgv(array $argv, array $longOpts, string $shortOpts): array - { - $result = []; - $tokens = array_slice($argv, 1); - - // Build lookup: option-name → 0=flag, 1=required-value, 2=optional-value - $specs = []; - foreach ($longOpts as $spec) { - if (str_ends_with($spec, '::')) { - $specs[rtrim($spec, ':')] = 2; - } elseif (str_ends_with($spec, ':')) { - $specs[rtrim($spec, ':')] = 1; - } else { - $specs[$spec] = 0; - } - } - for ($i = 0, $len = strlen($shortOpts); $i < $len; $i++) { - $c = $shortOpts[$i]; - if ($c === ':') { - continue; - } - $mode = 0; - if (isset($shortOpts[$i + 1]) && $shortOpts[$i + 1] === ':') { - $mode = isset($shortOpts[$i + 2]) && $shortOpts[$i + 2] === ':' ? 2 : 1; - } - $specs[$c] = $mode; - } - - for ($i = 0, $n = count($tokens); $i < $n; $i++) { - $tok = $tokens[$i]; - - if ($tok === '--') { - break; // end of options - } - - if (str_starts_with($tok, '--')) { - $name = substr($tok, 2); - $val = null; - if (str_contains($name, '=')) { - [$name, $val] = explode('=', $name, 2); - } - $mode = $specs[$name] ?? -1; - if ($mode === -1) { - continue; // unknown option - } - if ($mode === 1 && $val === null) { - $val = $tokens[++$i] ?? false; - } elseif ($mode === 0) { - $val = false; - } elseif ($mode === 2 && $val === null) { - $val = false; - } - // Support repeated options as arrays (matches getopt() behaviour) - if (array_key_exists($name, $result)) { - $result[$name] = array_merge((array) $result[$name], [$val]); - } else { - $result[$name] = $val; - } - } elseif (str_starts_with($tok, '-') && strlen($tok) > 1) { - $chars = substr($tok, 1); - for ($j = 0, $jn = strlen($chars); $j < $jn; $j++) { - $c = $chars[$j]; - $mode = $specs[$c] ?? -1; - if ($mode === -1) { - continue; - } - $val = false; - if ($mode === 1) { - $rest = substr($chars, $j + 1); - if ($rest !== '') { - $val = $rest; - $j = $jn; // consumed rest of cluster - } else { - $val = $tokens[++$i] ?? false; - } - } - $result[$c] = $val; - } - } - } - - return $result; - } - - /** - * Print help message - */ - protected function printHelp(): void - { - echo "{$this->description}\n\n"; - echo "Usage: {$this->name} [options]\n\n"; - echo "Options:\n"; - - $allOpts = array_merge($this->getCommonOptions(), $this->setupArguments()); - - foreach ($allOpts as $opt => $desc) { - $optName = rtrim($opt, ':'); - $hasValue = str_ends_with($opt, ':'); - $optDisplay = strlen($optName) === 1 ? "-{$optName}" : "--{$optName}"; - - if ($hasValue) { - $optDisplay .= ' '; - } - - echo sprintf(" %-30s %s\n", $optDisplay, $desc); - } - - echo "\n"; - } - - /** - * Setup logging - */ - protected function setupLogging(): void - { - if ($this->quiet) { - error_reporting(E_ERROR); - } elseif ($this->verbose) { - error_reporting(E_ALL); - } - } - - /** - * Setup enterprise features - */ - protected function setupEnterpriseFeatures(): void - { - if (isset($this->options['metrics'])) { - try { - $this->metrics = new MetricsCollector($this->name); - $this->log("Metrics collection enabled", 'INFO'); - } catch (Exception $e) { - $this->log("Metrics collection unavailable: " . $e->getMessage(), 'WARNING'); - } - } - } - - /** - * Execute the CLI application - * - * @return int Exit code - */ - public function execute(): int - { - try { - $this->parseArguments(); - $this->setupLogging(); - $this->setupEnterpriseFeatures(); - - $this->log("Starting {$this->name} v{$this->version}", 'INFO'); - - if ($this->dryRun) { - $this->log("DRY RUN MODE - No changes will be made", 'INFO'); - } - - $startTime = microtime(true); - - if ($this->metrics !== null) { - $timer = $this->metrics->startTimer('main_execution'); - $exitCode = $this->run(); - $timer->stop($exitCode === 0); - } else { - $exitCode = $this->run(); - } - - $duration = microtime(true) - $startTime; - $this->log(sprintf("Completed {$this->name} with exit code %d (%.2fs)", $exitCode, $duration), 'INFO'); - - if ($this->metrics !== null && !$this->quiet) { - $this->metrics->printSummary(); - } - - return $exitCode; - } catch (Exception $e) { - $this->log("Unhandled exception: " . $e->getMessage(), 'ERROR'); - if ($this->verbose) { - $this->log($e->getTraceAsString(), 'ERROR'); - } - return 1; - } - } - - /** - * Get option value - * - * @param string $name Option name - * @param mixed $default Default value if not set - * @return mixed Option value - */ - protected function getOption(string $name, $default = null) - { - return $this->options[$name] ?? $default; - } - - /** - * Check if option is set - * - * @param string $name Option name - * @return bool True if option is set - */ - protected function hasOption(string $name): bool - { - return isset($this->options[$name]); - } - - /** - * Log a message - * - * @param string $message Message to log - * @param string $level Log level (INFO, WARNING, ERROR) - */ - protected function log(string $message, string $level = 'INFO'): void - { - if ($this->quiet && $level !== 'ERROR') { - return; - } - - if (!$this->verbose && $level === 'DEBUG') { - return; - } - - $timestamp = (new DateTime('now', new DateTimeZone('UTC')))->format('Y-m-d H:i:s'); - $formatted = "[{$timestamp}] {$level}: {$message}\n"; - - if ($level === 'ERROR') { - fwrite(STDERR, $formatted); - } else { - echo $formatted; - } - } - - /** - * Print result in appropriate format - * - * @param mixed $result Result to print - */ - protected function printResult($result): void - { - if ($this->jsonOutput) { - echo json_encode($result, JSON_PRETTY_PRINT) . "\n"; - } else { - if (is_array($result)) { - echo var_export($result, true) . "\n"; - } else { - echo $result . "\n"; - } - } - } - - /** - * Ask for user confirmation - * - * @param string $message Confirmation message - * @param bool $default Default response - * @return bool True if user confirms - */ - protected function confirm(string $message, bool $default = false): bool - { - if ($this->dryRun) { - $this->log("[DRY RUN] Would ask: {$message}", 'INFO'); - return false; - } - - $suffix = $default ? ' [Y/n]' : ' [y/N]'; - echo $message . $suffix . ': '; - - $handle = fopen('php://stdin', 'r'); - $response = trim(fgets($handle)); - fclose($handle); - - if (empty($response)) { - return $default; - } - - return in_array(strtolower($response), ['y', 'yes'], true); - } - - /** - * Print colored output (if terminal supports it) - * - * @param string $text Text to print - * @param string $color Color name (red, green, yellow, blue, cyan, gray, bold, dim) - */ - protected function printColored(string $text, string $color): void - { - $colors = [ - 'red' => "\033[31m", - 'green' => "\033[32m", - 'yellow' => "\033[33m", - 'blue' => "\033[34m", - 'cyan' => "\033[36m", - 'gray' => "\033[90m", - 'bold' => "\033[1m", - 'dim' => "\033[2m", - 'reset' => "\033[0m", - ]; - - if (isset($colors[$color]) && $this->isColorEnabled()) { - echo $colors[$color] . $text . $colors['reset']; - } else { - echo $text; - } - } - - // ========================================================================= - // Console graphics — visual primitives added to CLIApp - // ========================================================================= - - /** - * Return whether ANSI colour output is enabled. - * - * Disabled when --no-color is passed, NO_COLOR env var is set, or - * stdout is not an interactive terminal. - */ - protected function isColorEnabled(): bool - { - static $cache = null; - if ($cache !== null) { - return $cache; - } - if (in_array('--no-color', $_SERVER['argv'] ?? [], true) || getenv('NO_COLOR') !== false) { - return $cache = false; - } - return $cache = stream_isatty(STDOUT); - } - - /** - * Return the terminal width (defaults to 80). - */ - protected function termWidth(): int - { - $cols = (int) getenv('COLUMNS'); - return ($cols > 40) ? $cols : 80; - } - - /** - * Wrap text in an ANSI code; returns plain text when colour is off. - */ - protected function colorize(string $code, string $text): string - { - if (!$this->isColorEnabled()) { - return $text; - } - return $code . $text . "\033[0m"; - } - - /** - * Print a script header banner. - * - * @param string $name Script name (defaults to $this->name). - * @param string $desc One-line description. - * @param string $ver Version string (defaults to $this->version). - */ - protected function printBanner(string $name = '', string $desc = '', string $ver = ''): void - { - $name = $name ?: $this->name; - $ver = $ver ?: $this->version; - $w = min($this->termWidth(), 70); - $inner = $w - 2; - - $titlePad = str_pad(" {$name} v{$ver}", $inner); - $descPad = ($desc !== '') ? str_pad(" {$desc}", $inner) : null; - - echo "\n"; - echo $this->colorize( - "\033[36m", - "\u{250C}" . str_repeat("\u{2500}", $inner) . "\u{2510}" - ) . "\n"; - echo $this->colorize("\033[36m", "\u{2502}") - . $this->colorize("\033[1m", $titlePad) - . $this->colorize("\033[36m", "\u{2502}") . "\n"; - if ($descPad !== null) { - echo $this->colorize("\033[36m", "\u{2502}") - . $this->colorize("\033[2m", $descPad) - . $this->colorize("\033[36m", "\u{2502}") . "\n"; - } - echo $this->colorize( - "\033[36m", - "\u{2514}" . str_repeat("\u{2500}", $inner) . "\u{2518}" - ) . "\n\n"; - } - - /** - * Print a section header rule. - * - * Output example: ── Section Title ────────────────────────── - */ - protected function section(string $title): void - { - $w = $this->termWidth(); - $text = " {$title} "; - $fill = max(0, $w - strlen($text) - 4); - echo "\n"; - echo $this->colorize( - "\033[36m", - str_repeat("\u{2500}", 2) . $text . str_repeat("\u{2500}", $fill) - ) . "\n\n"; - } - - /** - * Print a plain horizontal divider. - */ - protected function printDivider(): void - { - echo $this->colorize("\033[2m", str_repeat("\u{2500}", $this->termWidth())) . "\n"; - } - - /** - * Print a single pass/fail status line. - * - * @param bool $passed Whether the check passed. - * @param string $label Check description. - * @param string $detail Optional detail in dim text. - */ - protected function statusLine(bool $passed, string $label, string $detail = ''): void - { - [$icon, $color] = $passed - ? ["\u{2713}", "\033[32m"] - : ["\u{2717}", "\033[31m"]; - - $suffix = ($detail !== '') - ? ' ' . $this->colorize("\033[2m", "— {$detail}") - : ''; - - echo ' ' . $this->colorize($color . "\033[1m", $icon) . ' ' . $label . $suffix . "\n"; - } - - /** - * Render an in-place progress bar. - * - * @param int $current Items done. - * @param int $total Total items. - * @param string $label Optional trailing label. - * @param bool $newline Finish bar with newline. - */ - protected function progress(int $current, int $total, string $label = '', bool $newline = false): void - { - $barWidth = min(30, $this->termWidth() - 22); - $filled = ($total > 0) ? (int) round($barWidth * $current / $total) : 0; - $pct = ($total > 0) ? (int) round(100 * $current / $total) : 0; - - $bar = $this->colorize("\033[32m", str_repeat("\u{2588}", $filled)) - . $this->colorize("\033[2m", str_repeat("\u{2591}", $barWidth - $filled)); - - $line = sprintf( - ' [%s] %s %s%s', - $bar, - $this->colorize("\033[1m", sprintf('%3d%%', $pct)), - $this->colorize("\033[2m", "({$current}/{$total})"), - ($label !== '') ? " {$label}" : '' - ); - - echo $newline ? "\r{$line}\n" : "\r{$line}"; - } - - /** - * Print a bordered summary box. - * - * @param array $rows Label => value pairs. - * @param bool|null $passed Border colour: green/red/cyan. - */ - protected function printSummaryBox(array $rows, ?bool $passed = null): void - { - $color = match ($passed) { - true => "\033[32m", - false => "\033[31m", - default => "\033[36m", - }; - - $maxKey = max(array_map('strlen', array_keys($rows))); - $inner = $maxKey + 20; - - echo "\n"; - echo $this->colorize($color, "\u{250C}" . str_repeat("\u{2500}", $inner) . "\u{2510}") . "\n"; - foreach ($rows as $label => $value) { - $valStr = (string) $value; - $padding = $inner - strlen($label) - strlen($valStr) - 4; - $row = ' ' . $this->colorize("\033[1m", $label) - . str_repeat(' ', max(1, $padding)) . $valStr . ' '; - echo $this->colorize($color, "\u{2502}") . $row . $this->colorize($color, "\u{2502}") . "\n"; - } - echo $this->colorize($color, "\u{2514}" . str_repeat("\u{2500}", $inner) . "\u{2518}") . "\n\n"; - } - - public function getVersion(): string - { - return $this->version; - } -} - -/** - * CLI for validation operations - */ -class ValidationCLI extends CLIApp -{ - protected function setupArguments(): array - { - return [ - 'check:' => 'Type of validation (all, paths, markdown, licenses, workflows, security)', - 'dir:' => 'Directory to validate (default: current directory)', - ]; - } - - protected function run(): int - { - $check = $this->getOption('check', 'all'); - $dir = $this->getOption('dir', '.'); - - $this->log("Running validation: {$check}", 'INFO'); - - try { - $validator = new UnifiedValidator(); - - if (in_array($check, ['all', 'paths'], true)) { - $validator->addPlugin(new PathValidatorPlugin()); - } - if (in_array($check, ['all', 'markdown'], true)) { - $validator->addPlugin(new MarkdownValidatorPlugin()); - } - - $context = [ - 'paths' => [$dir], - 'scan_dir' => $dir, - ]; - - $results = $validator->validateAll($context); - - if (!$this->jsonOutput) { - $validator->printSummary(); - } else { - $resultData = array_map(function ($r) { - return [ - 'plugin' => $r->pluginName, - 'passed' => $r->passed, - 'message' => $r->message, - 'details' => $r->details, - ]; - }, $results); - $this->printResult($resultData); - } - - return $validator->allPassed() ? 0 : 1; - } catch (Exception $e) { - $this->log("Validation error: " . $e->getMessage(), 'ERROR'); - return 1; - } - } -} - // ============================================================================= -// CliFramework — current base class for all MokoStandards CLI scripts +// CliFramework — current base class for all moko-platform CLI scripts // ============================================================================= /** - * Base class for MokoStandards CLI scripts. + * Base class for moko-platform CLI scripts. * * Provides argument parsing, a structured lifecycle, and a full console * graphics system (banners, coloured log levels, progress bars, status @@ -757,6 +78,25 @@ abstract class CliFramework protected const BAR_FILL = "\u{2588}"; // █ protected const BAR_EMPTY = "\u{2591}"; // ░ + // ------------------------------------------------------------------------- + // Standard exit codes (#237) + // ------------------------------------------------------------------------- + + /** Process completed successfully. */ + public const EXIT_SUCCESS = 0; + + /** General failure (assertion, business logic, validation). */ + public const EXIT_FAILURE = 1; + + /** Usage / argument error (wrong flags, missing required args). */ + public const EXIT_USAGE = 2; + + /** Resource not found (file, repo, API object). */ + public const EXIT_NOT_FOUND = 3; + + /** Permission or authentication error. */ + public const EXIT_PERMISSION = 4; + // ------------------------------------------------------------------------- // Script properties (set by configure()) // ------------------------------------------------------------------------- @@ -1458,4 +798,234 @@ abstract class CliFramework } return $text . str_repeat(' ', max(0, $width - $visibleLength)); } + + // ========================================================================= + // JSON output (#241) — standard envelope for --json mode + // ========================================================================= + + /** + * Whether --json mode is active. + */ + protected function isJsonMode(): bool + { + return $this->hasRawArg('--json'); + } + + /** + * Emit a standardised JSON envelope and exit. + * + * Envelope format: + * { + * "command": "check:syntax", + * "status": "pass|fail|error", + * "exit_code": 0, + * "data": { ... }, + * "errors": [], + * "warnings": [], + * "metadata": { "duration_ms": 123, "timestamp": "..." } + * } + * + * @param string $status One of "pass", "fail", "error". + * @param mixed $data Arbitrary payload. + * @param string[] $errors Error messages. + * @param string[] $warnings Warning messages. + * @param int $exitCode Process exit code. + * @return int The exit code (for use with `return $this->jsonOutput(...)`). + */ + protected function jsonOutput( + string $status, + mixed $data = null, + array $errors = [], + array $warnings = [], + int $exitCode = -1 + ): int { + if ($exitCode < 0) { + $exitCode = ($status === 'pass') ? self::EXIT_SUCCESS : self::EXIT_FAILURE; + } + + $envelope = [ + 'command' => $this->scriptName, + 'status' => $status, + 'exit_code' => $exitCode, + 'data' => $data, + 'errors' => $errors, + 'warnings' => $warnings, + 'metadata' => [ + 'duration_ms' => (int) round($this->elapsed() * 1000), + 'timestamp' => gmdate('Y-m-d\TH:i:s\Z'), + ], + ]; + + echo json_encode($envelope, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n"; + return $exitCode; + } + + // ========================================================================= + // Interactive prompts (#240) + // ========================================================================= + + /** + * Ask a yes/no confirmation question. + * + * Returns the default value when stdin is not interactive. + * + * @param string $message Question to display. + * @param bool $default Default answer when user presses Enter. + */ + protected function confirm(string $message, bool $default = false): bool + { + if (!stream_isatty(STDIN)) { + return $default; + } + + $hint = $default ? '[Y/n]' : '[y/N]'; + fwrite(STDOUT, "{$message} {$hint}: "); + $answer = strtolower(trim((string) fgets(STDIN))); + + if ($answer === '') { + return $default; + } + return in_array($answer, ['y', 'yes'], true); + } + + /** + * Prompt the user for free-text input. + * + * Returns the default value when stdin is not interactive (piped mode). + * + * @param string $prompt Question to display. + * @param string $default Default value shown in brackets. + */ + protected function input(string $prompt, string $default = ''): string + { + if (!stream_isatty(STDIN)) { + return $default; + } + + $hint = $default !== '' ? " [{$default}]" : ''; + fwrite(STDOUT, "{$prompt}{$hint}: "); + $line = trim((string) fgets(STDIN)); + return $line !== '' ? $line : $default; + } + + /** + * Present a numbered list and return the selected option. + * + * Returns the first option when stdin is not interactive. + * + * @param string $prompt Question to display. + * @param string[] $options List of choices. + * @return string The chosen option value. + */ + protected function select(string $prompt, array $options): string + { + if (empty($options)) { + return ''; + } + if (!stream_isatty(STDIN)) { + return $options[0]; + } + + echo "{$prompt}\n"; + foreach ($options as $i => $opt) { + printf(" %s%d%s) %s\n", self::C_CYAN, $i + 1, self::C_RESET, $opt); + } + fwrite(STDOUT, "Choice [1]: "); + $choice = trim((string) fgets(STDIN)); + $index = ($choice !== '' ? (int) $choice : 1) - 1; + + return $options[$index] ?? $options[0]; + } + + /** + * Render a simple ASCII table. + * + * @param string[] $headers Column headers. + * @param string[][] $rows Row data (each row is an array of cell strings). + */ + protected function table(array $headers, array $rows): void + { + if ($this->quiet) { + return; + } + + // Calculate column widths. + $widths = array_map('strlen', $headers); + foreach ($rows as $row) { + foreach ($row as $i => $cell) { + $widths[$i] = max($widths[$i] ?? 0, strlen((string) $cell)); + } + } + + // Build separator line. + $sep = '+'; + foreach ($widths as $w) { + $sep .= str_repeat('-', $w + 2) . '+'; + } + + // Header. + echo $sep . "\n"; + $headerLine = '|'; + foreach ($headers as $i => $h) { + $headerLine .= ' ' . $this->c(self::C_BOLD, str_pad($h, $widths[$i])) . ' |'; + } + echo $headerLine . "\n"; + echo $sep . "\n"; + + // Rows. + foreach ($rows as $row) { + $line = '|'; + foreach ($row as $i => $cell) { + $line .= ' ' . str_pad((string) $cell, $widths[$i]) . ' |'; + } + echo $line . "\n"; + } + echo $sep . "\n"; + } +} + +// ============================================================================= +// CLIApp — deprecated compatibility shim +// ============================================================================= + +/** + * @deprecated CLIApp has been consolidated into CliFramework. Use CliFramework instead. + * This stub prevents fatal errors if client repos still reference CLIApp. + */ +abstract class CLIApp extends CliFramework +{ + public function __construct(string $name = '', string $description = '', string $version = '04.06.00') + { + parent::__construct($name, $version); + } + + protected function configure(): void + { + // CLIApp subclasses use setupArguments() — bridge it. + $args = $this->setupArguments(); + foreach ($args as $spec => $desc) { + $name = '--' . rtrim($spec, ':'); + $default = str_ends_with($spec, ':') ? '' : false; + $this->addArgument($name, $desc, $default); + } + } + + /** @return array */ + protected function setupArguments(): array + { + return []; + } + + /** Bridge: CLIApp used getOption(), CliFramework uses getArgument(). */ + protected function getOption(string $name, mixed $default = null): mixed + { + return $this->getArgument('--' . $name, $default); + } + + /** Bridge: CLIApp used hasOption(). */ + protected function hasOption(string $name): bool + { + $val = $this->getArgument('--' . $name); + return $val !== null && $val !== false && $val !== ''; + } } diff --git a/lib/Enterprise/Config.php b/lib/Enterprise/Config.php index ef87348..71e37c3 100644 --- a/lib/Enterprise/Config.php +++ b/lib/Enterprise/Config.php @@ -9,8 +9,8 @@ declare(strict_types=1); * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise.Config - * INGROUP: MokoStandards.Enterprise + * DEFGROUP: MokoPlatform.Enterprise.Config + * INGROUP: MokoPlatform.Enterprise * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 MokoStandards\Enterprise + * @package MokoPlatform\Enterprise * @version 04.00.04 - * @author MokoStandards Team + * @author moko-platform Team * @license GPL-3.0-or-later */ @@ -120,7 +120,7 @@ class Config /** @var array Runtime override data */ private array $overrideData = []; - public const VERSION = '04.06.00'; + public const VERSION = '09.22.00'; /** * Constructor. diff --git a/lib/Enterprise/ConfigValidator.php b/lib/Enterprise/ConfigValidator.php index 7799951..941f105 100644 --- a/lib/Enterprise/ConfigValidator.php +++ b/lib/Enterprise/ConfigValidator.php @@ -7,8 +7,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise - * INGROUP: MokoStandards.Enterprise + * DEFGROUP: MokoPlatform.Enterprise + * INGROUP: MokoPlatform.Enterprise * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /lib/Enterprise/ConfigValidator.php * BRIEF: Validate project config against plugin JSON schema diff --git a/lib/Enterprise/EnterpriseReadinessValidator.php b/lib/Enterprise/EnterpriseReadinessValidator.php index f2f9a24..398ebf8 100644 --- a/lib/Enterprise/EnterpriseReadinessValidator.php +++ b/lib/Enterprise/EnterpriseReadinessValidator.php @@ -8,8 +8,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Enterprise + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /lib/Enterprise/EnterpriseReadinessValidator.php * BRIEF: Enterprise readiness validation library diff --git a/lib/Enterprise/ErrorRecovery.php b/lib/Enterprise/ErrorRecovery.php index c943451..03817b8 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: MokoStandards.Enterprise.Recovery - * INGROUP: MokoStandards.Enterprise + * DEFGROUP: MokoPlatform.Enterprise.Recovery + * INGROUP: MokoPlatform.Enterprise * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /lib/Enterprise/ErrorRecovery.php * BRIEF: Error recovery framework * - * @package MokoStandards\Enterprise + * @package MokoPlatform\Enterprise * @version 04.00.04 - * @author MokoStandards Team + * @author moko-platform 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 66c6930..e58b08e 100644 --- a/lib/Enterprise/FileFixUtility.php +++ b/lib/Enterprise/FileFixUtility.php @@ -7,8 +7,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise - * INGROUP: MokoStandards.Lib + * DEFGROUP: MokoPlatform.Enterprise + * INGROUP: MokoPlatform.Lib * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 d34e701..0dad9b3 100644 --- a/lib/Enterprise/GitHubAdapter.php +++ b/lib/Enterprise/GitHubAdapter.php @@ -7,8 +7,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise.Platform - * INGROUP: MokoStandards.Enterprise + * DEFGROUP: MokoPlatform.Enterprise.Platform + * INGROUP: MokoPlatform.Enterprise * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 MokoStandards\Enterprise + * @package MokoPlatform\Enterprise * @since 04.06.10 * @see GitPlatformAdapter */ diff --git a/lib/Enterprise/GitPlatformAdapter.php b/lib/Enterprise/GitPlatformAdapter.php index 776bc32..c359f33 100644 --- a/lib/Enterprise/GitPlatformAdapter.php +++ b/lib/Enterprise/GitPlatformAdapter.php @@ -7,8 +7,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise.Platform - * INGROUP: MokoStandards.Enterprise + * DEFGROUP: MokoPlatform.Enterprise.Platform + * INGROUP: MokoPlatform.Enterprise * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 MokoStandards automation. + * Defines all platform operations required by moko-platform automation. * Implementations exist for GitHub (GitHubAdapter) and Gitea (MokoGiteaAdapter), * allowing scripts to work against either platform transparently. * - * @package MokoStandards\Enterprise + * @package MokoPlatform\Enterprise * @version 04.06.10 */ interface GitPlatformAdapter diff --git a/lib/Enterprise/InputValidator.php b/lib/Enterprise/InputValidator.php index a19255f..b429d79 100644 --- a/lib/Enterprise/InputValidator.php +++ b/lib/Enterprise/InputValidator.php @@ -9,8 +9,8 @@ declare(strict_types=1); * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise.Validation - * INGROUP: MokoStandards.Enterprise + * DEFGROUP: MokoPlatform.Enterprise.Validation + * INGROUP: MokoPlatform.Enterprise * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 MokoStandards\Enterprise + * @package MokoPlatform\Enterprise * @version 04.00.04 - * @author MokoStandards Team + * @author moko-platform Team * @license GPL-3.0-or-later */ @@ -75,7 +75,7 @@ class ValidationError extends RuntimeException */ class InputValidator { - public const VERSION = '04.06.00'; + public const VERSION = '09.22.00'; /** * Validate and sanitize file paths to prevent path traversal. @@ -161,11 +161,11 @@ class InputValidator break; case 'moko': - // MokoStandards format: XX.YY.ZZ + // moko-platform format: XX.YY.ZZ $pattern = '/^\d{2}\.\d{2}\.\d{2}$/'; if (!preg_match($pattern, $version)) { throw new ValidationError( - "Invalid MokoStandards version format: {$version}. Expected: XX.YY.ZZ" + "Invalid moko-platform version format: {$version}. Expected: XX.YY.ZZ" ); } break; diff --git a/lib/Enterprise/MetricsCollector.php b/lib/Enterprise/MetricsCollector.php index fb25188..b1e789d 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: MokoStandards.Enterprise.Metrics - * INGROUP: MokoStandards.Enterprise + * DEFGROUP: MokoPlatform.Enterprise.Metrics + * INGROUP: MokoPlatform.Enterprise * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /lib/Enterprise/MetricsCollector.php * BRIEF: Metrics collection framework */ /** - * Metrics Collector for MokoStandards + * Metrics Collector for moko-platform * * 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 MokoStandards\Enterprise + * @package MokoPlatform\Enterprise * @version 04.00.04 - * @author MokoStandards Team + * @author moko-platform Team * @license GPL-3.0-or-later */ @@ -97,7 +97,7 @@ class MetricsTimer */ class MetricsCollector { - private const VERSION = '04.06.00'; + private const VERSION = '09.22.00'; private string $serviceName; private array $counters = []; diff --git a/lib/Enterprise/MokoGiteaAdapter.php b/lib/Enterprise/MokoGiteaAdapter.php index 5d973e7..f379b41 100644 --- a/lib/Enterprise/MokoGiteaAdapter.php +++ b/lib/Enterprise/MokoGiteaAdapter.php @@ -7,8 +7,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise.Platform - * INGROUP: MokoStandards.Enterprise + * DEFGROUP: MokoPlatform.Enterprise.Platform + * INGROUP: MokoPlatform.Enterprise * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 MokoStandards\Enterprise + * @package MokoPlatform\Enterprise * @since 04.06.10 * @see GitPlatformAdapter */ diff --git a/lib/Enterprise/MokoStandardsParser.php b/lib/Enterprise/MokoStandardsParser.php index 842f0f0..ad9427e 100644 --- a/lib/Enterprise/MokoStandardsParser.php +++ b/lib/Enterprise/MokoStandardsParser.php @@ -8,11 +8,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Enterprise + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /lib/Enterprise/MokoStandardsParser.php - * BRIEF: Parser for the XML-based .mokostandards repository manifest + * BRIEF: Parser for the XML-based manifest.xml repository manifest */ declare(strict_types=1); @@ -25,17 +25,17 @@ use SimpleXMLElement; /** * MokoStandards Parser * - * Reads, writes, and validates the .mokostandards repository manifest. - * The file uses XML format (no file extension) and lives at .mokogitea/.mokostandards. + * Reads, writes, and validates the manifest.xml repository manifest. + * The file uses XML format (no file extension) and lives at .mokogitea/manifest.xml. * - * @package MokoStandards\Enterprise + * @package MokoPlatform\Enterprise * @version 04.07.00 */ class MokoStandardsParser { public const SCHEMA_VERSION = '1.0'; - public const NAMESPACE_URI = 'https://git.mokoconsulting.tech/MokoConsulting/MokoStandards-API'; - public const STANDARDS_SOURCE = 'https://git.mokoconsulting.tech/MokoConsulting/MokoStandards'; + public const NAMESPACE_URI = 'https://standards.mokoconsulting.tech/moko-platform/1.0'; + public const STANDARDS_SOURCE = 'https://git.mokoconsulting.tech/MokoConsulting/moko-platform'; /** 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 MokoStandards version + * @type string $standards_version moko-platform 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 MokoStandards bulk sync.\n" + . " Auto-generated by moko-platform bulk sync.\n" . " Manual edits to and may be overwritten.\n" . " See: docs/standards/mokostandards-file-spec.md\n" )); @@ -316,7 +316,7 @@ class MokoStandardsParser { $id = $xml->identity ?? null; if ($id === null) { - throw new \RuntimeException('.mokostandards: missing required element'); + throw new \RuntimeException('manifest.xml: missing required element'); } $result = [ @@ -325,7 +325,7 @@ class MokoStandardsParser ]; if ($result['name'] === '') { - throw new \RuntimeException('.mokostandards: is required'); + throw new \RuntimeException('manifest.xml: is required'); } if (isset($id->description)) { @@ -352,7 +352,7 @@ class MokoStandardsParser { $gov = $xml->governance ?? null; if ($gov === null) { - throw new \RuntimeException('.mokostandards: missing required element'); + throw new \RuntimeException('manifest.xml: missing required element'); } $result = [ @@ -362,7 +362,7 @@ class MokoStandardsParser ]; if ($result['platform'] === '') { - throw new \RuntimeException('.mokostandards: is required'); + throw new \RuntimeException('manifest.xml: is required'); } if (isset($gov->{'last-synced'})) { diff --git a/lib/Enterprise/PackageBuilder.php b/lib/Enterprise/PackageBuilder.php index 2922029..46a05a3 100644 --- a/lib/Enterprise/PackageBuilder.php +++ b/lib/Enterprise/PackageBuilder.php @@ -7,8 +7,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise - * INGROUP: MokoStandards.Lib + * DEFGROUP: MokoPlatform.Enterprise + * INGROUP: MokoPlatform.Lib * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 cb801f4..9bf4d4e 100644 --- a/lib/Enterprise/PlatformAdapterFactory.php +++ b/lib/Enterprise/PlatformAdapterFactory.php @@ -7,8 +7,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise.Platform - * INGROUP: MokoStandards.Enterprise + * DEFGROUP: MokoPlatform.Enterprise.Platform + * INGROUP: MokoPlatform.Enterprise * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 MokoStandards\Enterprise + * @package MokoPlatform\Enterprise * @version 04.06.10 * * @since 04.00.00 diff --git a/lib/Enterprise/PluginFactory.php b/lib/Enterprise/PluginFactory.php index 3bb9488..a41eb01 100644 --- a/lib/Enterprise/PluginFactory.php +++ b/lib/Enterprise/PluginFactory.php @@ -9,8 +9,8 @@ declare(strict_types=1); * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise.Plugins - * INGROUP: MokoStandards.Enterprise + * DEFGROUP: MokoPlatform.Enterprise.Plugins + * INGROUP: MokoPlatform.Enterprise * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 MokoStandards\Enterprise + * @package MokoPlatform\Enterprise * @version 1.0.0 */ class PluginFactory diff --git a/lib/Enterprise/PluginRegistry.php b/lib/Enterprise/PluginRegistry.php index 9e3517d..72812c9 100644 --- a/lib/Enterprise/PluginRegistry.php +++ b/lib/Enterprise/PluginRegistry.php @@ -9,8 +9,8 @@ declare(strict_types=1); * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise.Plugins - * INGROUP: MokoStandards.Enterprise + * DEFGROUP: MokoPlatform.Enterprise.Plugins + * INGROUP: MokoPlatform.Enterprise * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 MokoStandards\Enterprise + * @package MokoPlatform\Enterprise * @version 1.0.0 */ class PluginRegistry diff --git a/lib/Enterprise/Plugins/ApiPlugin.php b/lib/Enterprise/Plugins/ApiPlugin.php index f7a3322..5b26bdf 100644 --- a/lib/Enterprise/Plugins/ApiPlugin.php +++ b/lib/Enterprise/Plugins/ApiPlugin.php @@ -8,8 +8,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise.Plugins - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Enterprise.Plugins + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 5d2cce9..f559fbf 100644 --- a/lib/Enterprise/Plugins/DocumentationPlugin.php +++ b/lib/Enterprise/Plugins/DocumentationPlugin.php @@ -8,8 +8,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise.Plugins - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Enterprise.Plugins + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 57a2620..87551cb 100644 --- a/lib/Enterprise/Plugins/DolibarrPlugin.php +++ b/lib/Enterprise/Plugins/DolibarrPlugin.php @@ -8,8 +8,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise.Plugins - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Enterprise.Plugins + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 aa3c915..5774606 100644 --- a/lib/Enterprise/Plugins/GenericPlugin.php +++ b/lib/Enterprise/Plugins/GenericPlugin.php @@ -8,8 +8,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise.Plugins - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Enterprise.Plugins + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 b6ce4d7..68b3417 100644 --- a/lib/Enterprise/Plugins/JoomlaPlugin.php +++ b/lib/Enterprise/Plugins/JoomlaPlugin.php @@ -8,8 +8,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise.Plugins - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Enterprise.Plugins + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 0c36c1f..87f40e9 100644 --- a/lib/Enterprise/Plugins/McpServerPlugin.php +++ b/lib/Enterprise/Plugins/McpServerPlugin.php @@ -8,8 +8,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise.Plugins - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Enterprise.Plugins + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 374a046..e3c0e6d 100644 --- a/lib/Enterprise/Plugins/MobilePlugin.php +++ b/lib/Enterprise/Plugins/MobilePlugin.php @@ -8,8 +8,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise.Plugins - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Enterprise.Plugins + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 c5e7ea1..ab2df6d 100644 --- a/lib/Enterprise/Plugins/NodeJsPlugin.php +++ b/lib/Enterprise/Plugins/NodeJsPlugin.php @@ -8,8 +8,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise.Plugins - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Enterprise.Plugins + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 2653602..640862d 100644 --- a/lib/Enterprise/Plugins/PythonPlugin.php +++ b/lib/Enterprise/Plugins/PythonPlugin.php @@ -8,8 +8,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise.Plugins - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Enterprise.Plugins + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 d58a86d..8a64280 100644 --- a/lib/Enterprise/Plugins/TerraformPlugin.php +++ b/lib/Enterprise/Plugins/TerraformPlugin.php @@ -8,8 +8,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise.Plugins - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Enterprise.Plugins + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 2f8734e..ef57c28 100644 --- a/lib/Enterprise/Plugins/WordPressPlugin.php +++ b/lib/Enterprise/Plugins/WordPressPlugin.php @@ -8,8 +8,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise.Plugins - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Enterprise.Plugins + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 4cd8a1a..6851e7b 100644 --- a/lib/Enterprise/ProjectConfigValidator.php +++ b/lib/Enterprise/ProjectConfigValidator.php @@ -8,8 +8,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise.ProjectTypes - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Enterprise.ProjectTypes + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 980aa52..becf791 100644 --- a/lib/Enterprise/ProjectMetricsCollector.php +++ b/lib/Enterprise/ProjectMetricsCollector.php @@ -8,8 +8,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise.ProjectTypes - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Enterprise.ProjectTypes + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 b230d07..0a7f895 100644 --- a/lib/Enterprise/ProjectPluginInterface.php +++ b/lib/Enterprise/ProjectPluginInterface.php @@ -9,8 +9,8 @@ declare(strict_types=1); * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise.Plugins - * INGROUP: MokoStandards.Enterprise + * DEFGROUP: MokoPlatform.Enterprise.Plugins + * INGROUP: MokoPlatform.Enterprise * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 MokoStandards\Enterprise + * @package MokoPlatform\Enterprise * @version 1.0.0 */ interface ProjectPluginInterface diff --git a/lib/Enterprise/ProjectTypeDetector.php b/lib/Enterprise/ProjectTypeDetector.php index 23447ad..63c8090 100644 --- a/lib/Enterprise/ProjectTypeDetector.php +++ b/lib/Enterprise/ProjectTypeDetector.php @@ -8,8 +8,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise.ProjectTypes - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Enterprise.ProjectTypes + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 96bfa7d..6effaae 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: MokoStandards.Enterprise.Recovery - * INGROUP: MokoStandards.Enterprise + * DEFGROUP: MokoPlatform.Enterprise.Recovery + * INGROUP: MokoPlatform.Enterprise * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /lib/Enterprise/RecoveryError.php * BRIEF: Recovery error exception class * - * @package MokoStandards\Enterprise + * @package MokoPlatform\Enterprise * @version 04.00.04 - * @author MokoStandards Team + * @author moko-platform Team * @license GPL-3.0-or-later */ diff --git a/lib/Enterprise/RecoveryManager.php b/lib/Enterprise/RecoveryManager.php index 1753c3e..5f8f03e 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: MokoStandards.Enterprise.Recovery - * INGROUP: MokoStandards.Enterprise + * DEFGROUP: MokoPlatform.Enterprise.Recovery + * INGROUP: MokoPlatform.Enterprise * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /lib/Enterprise/RecoveryManager.php * BRIEF: Recovery manager for failed operations * - * @package MokoStandards\Enterprise + * @package MokoPlatform\Enterprise * @version 04.00.04 - * @author MokoStandards Team + * @author moko-platform Team * @license GPL-3.0-or-later */ diff --git a/lib/Enterprise/RepositoryHealthChecker.php b/lib/Enterprise/RepositoryHealthChecker.php index ebb0be9..a181cbb 100644 --- a/lib/Enterprise/RepositoryHealthChecker.php +++ b/lib/Enterprise/RepositoryHealthChecker.php @@ -8,8 +8,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Enterprise + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /lib/Enterprise/RepositoryHealthChecker.php * BRIEF: Repository health checking enterprise library diff --git a/lib/Enterprise/RepositorySynchronizer.php b/lib/Enterprise/RepositorySynchronizer.php index a0b82d9..1be7584 100644 --- a/lib/Enterprise/RepositorySynchronizer.php +++ b/lib/Enterprise/RepositorySynchronizer.php @@ -8,8 +8,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Enterprise + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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__)); - // MokoStandards repo root (templates, configs) - $standardsRoot = getenv('MOKOSTANDARDS_ROOT') ?: dirname($repoRoot) . '/MokoStandards'; + // moko-platform repo root (templates, configs) + $standardsRoot = getenv('MOKOSTANDARDS_ROOT') ?: dirname($repoRoot) . '/moko-platform'; // Detect platform from repo metadata $repoInfo = $this->adapter->getRepo($org, $repo); @@ -266,7 +266,7 @@ class RepositorySynchronizer private const CRM_PLATFORM_REPOS = ['MokoDolibarr', 'MokoDoliMods']; /** - * Detect platform from the .mokostandards manifest (authoritative), falling + * Detect platform from the manifest.xml (authoritative), falling * back to name/topic/description heuristics when the manifest is missing or * unparseable. */ @@ -275,10 +275,10 @@ class RepositorySynchronizer $org = $repoInfo['full_name'] ? explode('/', $repoInfo['full_name'])[0] : ''; $name = $repoInfo['name'] ?? ''; - // ── 1. Try reading the XML .mokostandards manifest ────────────��─ + // ── 1. Try reading the XML manifest ────────────��─ $manifestPlatform = $this->readManifestPlatform($org, $name); if ($manifestPlatform !== null) { - $this->logger->logInfo("Platform for {$name} from .mokostandards manifest: {$manifestPlatform}"); + $this->logger->logInfo("Platform for {$name} from manifest.xml: {$manifestPlatform}"); return $manifestPlatform; } @@ -287,8 +287,8 @@ class RepositorySynchronizer } /** - * Read the platform slug from the remote .mokostandards manifest. - * Checks .mokogitea/.mokostandards, .github/.mokostandards, and root .mokostandards. + * Read the platform slug from the remote manifest.xml. + * Checks .mokogitea/manifest.xml, then legacy locations (.mokostandards, .github/.mokostandards). * * @return string|null Platform slug or null if not found/parseable */ @@ -296,6 +296,7 @@ class RepositorySynchronizer { $metaDir = $this->adapter->getMetadataDir(); $paths = [ + "{$metaDir}/manifest.xml", "{$metaDir}/.mokostandards", '.mokostandards', ]; @@ -321,7 +322,7 @@ class RepositorySynchronizer /** * Heuristic platform detection from repo name, topics, and description. - * Used as fallback when .mokostandards manifest is missing or unparseable. + * Used as fallback when manifest.xml manifest is missing or unparseable. */ private function detectPlatformByHeuristics(array $repoInfo): string { @@ -385,7 +386,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 MokoStandards repository root + * @param string $repoRoot Absolute path to the moko-platform repository root * @param bool $force When true, overwrite files even when always_overwrite = false * @return array{number: ?int, summary: array} */ @@ -432,7 +433,7 @@ class RepositorySynchronizer // Ensure composer.json requires mokoconsulting-tech/enterprise (default branch only) $this->ensureComposerEnterprise($org, $repo, $defaultBranch, $summary); - // Migrate .mokostandards to XML manifest (default branch only) + // Migrate legacy .mokostandards to XML manifest (default branch only) $this->migrateMokoStandards($org, $repo, $defaultBranch, $platform, $repoInfo, $summary); if (count($summary['copied']) === 0) { @@ -442,7 +443,7 @@ class RepositorySynchronizer // Create tracking issue (no PR — files pushed directly to default branch) $issueBody = $this->generatePRBody($summary); - $issueTitle = 'chore: MokoStandards v' . self::STANDARDS_MINOR . ' sync — ' . count($summary['copied']) . ' files updated'; + $issueTitle = 'chore: moko-platform v' . self::STANDARDS_MINOR . ' sync — ' . count($summary['copied']) . ' files updated'; $issueNumber = null; try { @@ -499,7 +500,7 @@ class RepositorySynchronizer * never added. * * @param string $existing Current file content from the remote repo - * @param string $template Template file content from MokoStandards + * @param string $template Template file content from moko-platform * @return string Merged content */ /** @@ -522,7 +523,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 MokoStandards root + * @param string $repoRoot Path to moko-platform root * @param bool $force Force overwrite * @param string $branchName Target branch * @param string|null $moduleId Dolibarr module ID (pre-fetched) @@ -604,7 +605,7 @@ class RepositorySynchronizer $repo, $targetPath, $content, - "chore: update {$targetPath} from MokoStandards", + "chore: update {$targetPath} from moko-platform", $existingFile['sha'] ?? null, $branchName ); @@ -618,7 +619,7 @@ class RepositorySynchronizer $repo, $targetPath, $content, - "chore: add {$targetPath} from MokoStandards", + "chore: add {$targetPath} from moko-platform", null, $branchName ); @@ -634,7 +635,7 @@ class RepositorySynchronizer $repo, $targetPath, $content, - "chore: update {$targetPath} from MokoStandards", + "chore: update {$targetPath} from moko-platform", $existing['sha'] ?? null, $branchName ); @@ -654,11 +655,11 @@ class RepositorySynchronizer } /** - * Migrate .mokostandards to the platform metadata dir (.gitea/ or .github/) + * Migrate legacy .mokostandards to the platform metadata dir (.gitea/ or .github/) * and convert legacy YAML-like format to the new XML manifest. * * Handles: - * 1. Location migration: root or .github/ → .mokogitea/.mokostandards + * 1. Location migration: root or .github/ → .mokogitea/manifest.xml * 2. Format migration: legacy "platform: xxx" → XML manifest * 3. Update existing XML: refresh timestamp */ @@ -671,7 +672,7 @@ class RepositorySynchronizer array &$summary ): void { $metaDir = $this->adapter->getMetadataDir(); - $targetPath = "{$metaDir}/.mokostandards"; + $targetPath = "{$metaDir}/manifest.xml"; // ── Collect existing files from all legacy locations ───────── $legacySources = ['.mokostandards']; @@ -731,8 +732,8 @@ class RepositorySynchronizer if ($needsUpdate) { $action = $isNew ? 'create' : 'update'; $commitMsg = $isNew - ? "chore: add XML .mokostandards manifest to {$metaDir}/" - : "chore: update .mokostandards manifest (XML format)"; + ? "chore: add XML manifest.xml to {$metaDir}/" + : "chore: update manifest.xml (XML format)"; try { $this->adapter->createOrUpdateFile( @@ -744,7 +745,7 @@ class RepositorySynchronizer $targetSha, $branchName ); - $this->logger->logInfo(ucfirst($action) . "d XML .mokostandards → {$targetPath}"); + $this->logger->logInfo(ucfirst($action) . "d XML manifest.xml → {$targetPath}"); $summary['copied'][] = ['file' => $targetPath, 'action' => "{$action}d (XML manifest)"]; } catch (Exception $e) { $this->adapter->getApiClient()->resetCircuitBreaker(); @@ -775,7 +776,7 @@ class RepositorySynchronizer } /** - * Generate an XML .mokostandards manifest for a repository. + * Generate an XML manifest.xml manifest for a repository. * * If existing content is valid XML, preserves user-edited sections * (build, deploy, scripts, overrides) and only refreshes governance metadata. @@ -803,7 +804,7 @@ class RepositorySynchronizer 'license' => 'GPL-3.0-or-later', 'topics' => $repoInfo['topics'] ?? [], 'language' => $repoInfo['language'] ?? MokoStandardsParser::platformLanguage($platform), - 'package_type' => MokoStandardsParser::platformPackageType($platform), + 'package_type' => moko-platformParser::platformPackageType($platform), 'last_synced' => date('c'), ]; @@ -825,7 +826,7 @@ class RepositorySynchronizer ); } catch (\RuntimeException $e) { // Existing XML is broken — regenerate from scratch - $this->logger->logInfo("Existing .mokostandards XML invalid, regenerating: " . $e->getMessage()); + $this->logger->logInfo("Existing manifest.xml XML invalid, regenerating: " . $e->getMessage()); } } @@ -833,7 +834,7 @@ class RepositorySynchronizer } /** - * Refresh only the fields in an existing XML .mokostandards, + * Refresh only the fields in an existing XML manifest.xml, * preserving all other sections (build, deploy, scripts, overrides). */ private function refreshGovernanceInXml( @@ -1131,7 +1132,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 MokoStandards bulk sync\n" + . "- **Never overwritten** by moko-platform 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", @@ -1282,7 +1283,7 @@ class RepositorySynchronizer // Append missing lines with a clear separator $merged = rtrim($existing) . "\n\n" - . "# ── MokoStandards sync (auto-appended) ────────────────────────────────\n" + . "# ── moko-platform sync (auto-appended) ────────────────────────────────\n" . implode("\n", $missing) . "\n"; return $merged; @@ -1334,7 +1335,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 MokoStandards stubs + // Single-brace tokens — used by GitHub repository templates and older moko-platform stubs '{REPO_NAME}' => $repoInfo['name'] ?? $repo, '{REPO_URL}' => "https://github.com/{$org}/{$repo}", '{REPO_DESCRIPTION}' => $repoInfo['description'] ?? '', @@ -1404,8 +1405,8 @@ class RepositorySynchronizer */ private function generatePRBody(array $summary): string { - $body = "## MokoStandards Synchronization\n\n"; - $body .= "This PR synchronizes workflows, configurations, and scripts from the MokoStandards repository.\n\n"; + $body = "## moko-platform Synchronization\n\n"; + $body .= "This PR synchronizes workflows, configurations, and scripts from the moko-platform repository.\n\n"; // Summary statistics $body .= "### Summary\n"; @@ -1440,7 +1441,7 @@ class RepositorySynchronizer $body .= "- Verify issue templates render correctly\n\n"; $body .= "---\n"; - $body .= "*This PR was automatically generated by the MokoStandards bulk sync process.*\n"; + $body .= "*This PR was automatically generated by the moko-platform bulk sync process.*\n"; return $body; } @@ -1545,7 +1546,7 @@ class RepositorySynchronizer default => 'EDEDED', }, match ($label) { - 'mokostandards' => 'MokoStandards compliance', + 'mokostandards' => 'moko-platform compliance', 'type: chore' => 'Maintenance tasks', 'automation' => 'Automated processes or scripts', default => '', diff --git a/lib/Enterprise/RetryHelper.php b/lib/Enterprise/RetryHelper.php index 5e084d6..84810b2 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: MokoStandards.Enterprise.Recovery - * INGROUP: MokoStandards.Enterprise + * DEFGROUP: MokoPlatform.Enterprise.Recovery + * INGROUP: MokoPlatform.Enterprise * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /lib/Enterprise/RetryHelper.php * BRIEF: Retry helper with exponential backoff * - * @package MokoStandards\Enterprise + * @package MokoPlatform\Enterprise * @version 04.00.04 - * @author MokoStandards Team + * @author moko-platform Team * @license GPL-3.0-or-later */ diff --git a/lib/Enterprise/SecurityValidator.php b/lib/Enterprise/SecurityValidator.php index c26f4da..baa5b70 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: MokoStandards.Enterprise.Security - * INGROUP: MokoStandards.Enterprise + * DEFGROUP: MokoPlatform.Enterprise.Security + * INGROUP: MokoPlatform.Enterprise * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /lib/Enterprise/SecurityValidator.php * BRIEF: Security validation library */ /** - * Security Validator for MokoStandards + * Security Validator for moko-platform * * 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 MokoStandards\Enterprise + * @package MokoPlatform\Enterprise * @version 04.00.04 - * @author MokoStandards Team + * @author moko-platform Team * @license GPL-3.0-or-later */ @@ -71,7 +71,7 @@ class SecurityViolation extends Exception */ class SecurityValidator { - private const VERSION = '04.06.00'; + private const VERSION = '09.22.00'; /** * Common patterns for credentials and secrets diff --git a/lib/Enterprise/SynchronizationException.php b/lib/Enterprise/SynchronizationException.php index 9620b63..2761b38 100644 --- a/lib/Enterprise/SynchronizationException.php +++ b/lib/Enterprise/SynchronizationException.php @@ -8,8 +8,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Enterprise - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Enterprise + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 b0e70af..b5922f4 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: MokoStandards.Enterprise.Transaction - * INGROUP: MokoStandards.Enterprise + * DEFGROUP: MokoPlatform.Enterprise.Transaction + * INGROUP: MokoPlatform.Enterprise * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /lib/Enterprise/TransactionManager.php * BRIEF: Transaction manager for atomic operations */ /** - * Transaction Manager for MokoStandards + * Transaction Manager for moko-platform * * 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 MokoStandards\Enterprise + * @package MokoPlatform\Enterprise * @version 04.00.04 - * @author MokoStandards Team + * @author moko-platform Team * @license GPL-3.0-or-later */ @@ -256,7 +256,7 @@ class Transaction */ class TransactionManager { - private const VERSION = '04.06.00'; + private const VERSION = '09.22.00'; /** @var array */ private array $transactions = []; diff --git a/lib/Enterprise/UnifiedValidation.php b/lib/Enterprise/UnifiedValidation.php index 80c6fe4..5b2c65d 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: MokoStandards.Enterprise.Validation - * INGROUP: MokoStandards.Enterprise + * DEFGROUP: MokoPlatform.Enterprise.Validation + * INGROUP: MokoPlatform.Enterprise * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /lib/Enterprise/UnifiedValidation.php * BRIEF: Unified validation framework */ /** - * Unified Validation Framework for MokoStandards + * Unified Validation Framework for moko-platform * * 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 MokoStandards\Enterprise + * @package MokoPlatform\Enterprise * @version 04.00.04 - * @author MokoStandards Team + * @author moko-platform Team * @license GPL-3.0-or-later */ @@ -383,7 +383,7 @@ class SecurityValidatorPlugin extends ValidationPlugin */ class UnifiedValidator { - private const VERSION = '04.06.00'; + private const VERSION = '09.22.00'; /** @var array */ private array $plugins = []; diff --git a/lib/index.md b/lib/index.md index b44c075..0feff20 100644 --- a/lib/index.md +++ b/lib/index.md @@ -2,8 +2,8 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoStandards.Index -INGROUP: MokoStandards.Lib +DEFGROUP: MokoPlatform.Index +INGROUP: MokoPlatform.Lib REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform PATH: /lib/index.md BRIEF: Library directory index diff --git a/lib/plugins/Joomla/UpdateXmlGenerator.php b/lib/plugins/Joomla/UpdateXmlGenerator.php index 0d6f98d..12cfada 100644 --- a/lib/plugins/Joomla/UpdateXmlGenerator.php +++ b/lib/plugins/Joomla/UpdateXmlGenerator.php @@ -8,8 +8,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Joomla - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Joomla + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 e8f6cc3..17da4a4 100644 --- a/maintenance/index.md +++ b/maintenance/index.md @@ -2,8 +2,8 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoStandards.Index -INGROUP: MokoStandards.Maintenance +DEFGROUP: MokoPlatform.Index +INGROUP: MokoPlatform.Maintenance REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform PATH: /maintenance/index.md BRIEF: Maintenance directory index diff --git a/maintenance/setup_labels.php b/maintenance/setup_labels.php index be6677f..f03078b 100644 --- a/maintenance/setup_labels.php +++ b/maintenance/setup_labels.php @@ -2,18 +2,18 @@ * - * REQUIRED FILE: This file must be present in all MokoStandards-compliant repositories + * REQUIRED FILE: This file must be present in all moko-platform-compliant repositories * * This file is part of a Moko Consulting project. * * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Scripts.Maintenance - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Scripts.Maintenance + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /maintenance/setup_labels.php - * BRIEF: REQUIRED label deployment script for all MokoStandards-governed repositories + * BRIEF: REQUIRED label deployment script for all moko-platform-governed repositories */ declare(strict_types=1); @@ -26,7 +26,7 @@ use MokoEnterprise\GitPlatformAdapter; use MokoEnterprise\PlatformAdapterFactory; /** - * Deploys the standard set of repository labels required by MokoStandards. + * Deploys the standard set of repository labels required by moko-platform. * * Uses the platform adapter (GitHub or Gitea) to create or update each label. * Supports --dry-run mode to preview without making changes. @@ -65,7 +65,7 @@ class SetupLabels extends CliFramework // Workflow / Process ['automation', '8B4513', 'Automated processes or scripts'], - ['mokostandards', 'B60205', 'MokoStandards compliance'], + ['moko-platform', 'B60205', 'moko-platform 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'], @@ -105,8 +105,8 @@ class SetupLabels extends CliFramework ['health: poor', 'FF6B6B', 'Health score below 50'], // Sync / Automation - ['standards-update', 'B60205', 'MokoStandards sync update'], - ['standards-drift', 'FBCA04', 'Repository drifted from MokoStandards'], + ['standards-update', 'B60205', 'moko-platform sync update'], + ['standards-drift', 'FBCA04', 'Repository drifted from moko-platform'], ['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 a05609f..2c1a69b 100644 --- a/maintenance/sync_dolibarr_readmes.php +++ b/maintenance/sync_dolibarr_readmes.php @@ -7,8 +7,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Scripts.Maintenance - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Scripts.Maintenance + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /maintenance/sync_dolibarr_readmes.php * BRIEF: Keeps root README.md and src/README.md in sync for Dolibarr module repositories @@ -76,8 +76,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', 'MokoStandards.Module'); - $ingroup = $this->extractField($rootContent, 'INGROUP', 'MokoStandards'); + $defgroup = $this->extractField($rootContent, 'DEFGROUP', 'MokoPlatform.Module'); + $ingroup = $this->extractField($rootContent, 'INGROUP', 'moko-platform'); $brief = $this->extractField($rootContent, 'BRIEF', "{$moduleName} end-user documentation"); $installSection = $this->extractSection($rootContent, 'Installation'); @@ -262,7 +262,7 @@ NOTE: This file is auto-generated by sync_dolibarr_readmes.php from root README. Last synced: {$today} --> -[![MokoStandards](https://img.shields.io/badge/MokoStandards-{$version}-blue)]({$repoUrl}) +[![moko-platform](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 9ec8d89..3b861c1 100644 --- a/maintenance/update_repo_inventory.php +++ b/maintenance/update_repo_inventory.php @@ -8,8 +8,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Scripts.Maintenance - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Scripts.Maintenance + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /maintenance/update_repo_inventory.php * BRIEF: Queries GitHub org repos and rewrites the auto-generated section of REPOSITORY_INVENTORY.md @@ -204,7 +204,7 @@ class UpdateRepoInventory extends CliFramework $lower = strtolower($name); - if (in_array('mokostandards-core', $topics, true) || $name === 'MokoStandards' || $name === '.github-private') { + if (in_array('mokostandards-core', $topics, true) || $name === 'moko-platform' || $name === '.github-private') { $groups['core'][] = $repo; } elseif ( in_array('dolibarr-module', $topics, true) diff --git a/maintenance/update_version_from_readme.php b/maintenance/update_version_from_readme.php index dbee952..2dd71ac 100644 --- a/maintenance/update_version_from_readme.php +++ b/maintenance/update_version_from_readme.php @@ -7,8 +7,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Scripts.Maintenance - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Scripts.Maintenance + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 @@ -28,7 +28,7 @@ use MokoEnterprise\{ApiClient, AuditLogger, CliFramework}; * badge and FILE INFORMATION VERSION field in the repository. * * Sources updated: - * - Markdown badge: [![MokoStandards](https://img.shields.io/badge/MokoStandards-OLD-blue)] + * - Markdown badge: [![moko-platform](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 @@ -219,7 +219,7 @@ class UpdateVersionFromReadme extends CliFramework $updated = $original; // ── Badge replacement (all file types) ─────────────────────────── - // shields.io badge: [![MokoStandards](...badge/MokoStandards-XX.YY.ZZ-color)] + // shields.io badge: [![moko-platform](...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}', @@ -251,9 +251,9 @@ class UpdateVersionFromReadme extends CliFramework ); // PHP class VERSION constants: - // private const VERSION = '04.06.00'; - // public const VERSION = '04.06.00'; - // private const VERSION = '04.06.00'; + // private const VERSION = '09.22.00'; + // public const VERSION = '09.22.00'; + // private const VERSION = '09.22.00'; $updated = preg_replace( '/((?:private|public|protected)\s+const\s+VERSION\s*=\s*[\'"])[0-9]{2}\.[0-9]{2}\.[0-9]{2}([\'"])/', '${1}' . $version . '${2}', diff --git a/mcp/config.example.json b/mcp/config.example.json index b05ea4f..82769cf 100644 --- a/mcp/config.example.json +++ b/mcp/config.example.json @@ -1,6 +1,6 @@ { - "apiPath": "A:/MokoStandards-API", - "standardsPath": "A:/MokoStandards", + "apiPath": "A:/moko-platform", + "standardsPath": "A:/moko-platform", "giteaUrl": "https://git.mokoconsulting.tech", "giteaToken": "your-gitea-api-token" } diff --git a/mcp/package.json b/mcp/package.json index 143a5fb..4bdc885 100644 --- a/mcp/package.json +++ b/mcp/package.json @@ -1,11 +1,11 @@ { - "name": "@mokoconsulting/mokostandards-mcp", + "name": "@mokoconsulting/moko-platform-mcp", "version": "1.0.0", - "description": "MCP server for MokoStandards governance — validation, compliance, platform detection, definitions browser", + "description": "MCP server for moko-platform governance — validation, compliance, platform detection, definitions browser", "type": "module", "main": "dist/index.js", "bin": { - "mokostandards-mcp": "dist/index.js" + "moko-platform-mcp": "dist/index.js" }, "scripts": { "build": "tsc", diff --git a/phpunit.xml b/phpunit.xml index 4f6e451..c440998 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -13,5 +13,8 @@ SPDX-License-Identifier: GPL-3.0-or-later tests/Unit + + tests/Enterprise + diff --git a/plugin_health_check.php b/plugin_health_check.php index 7aa9815..7bedb76 100755 --- a/plugin_health_check.php +++ b/plugin_health_check.php @@ -7,8 +7,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Scripts.Plugin - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Scripts.Plugin + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 3259c8d..4f55a51 100755 --- a/plugin_list.php +++ b/plugin_list.php @@ -7,8 +7,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Scripts.Plugin - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Scripts.Plugin + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 c8d6105..63214a5 100755 --- a/plugin_metrics.php +++ b/plugin_metrics.php @@ -7,8 +7,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Scripts.Plugin - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Scripts.Plugin + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 75dba45..ee55eb9 100755 --- a/plugin_readiness.php +++ b/plugin_readiness.php @@ -7,8 +7,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Scripts.Plugin - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Scripts.Plugin + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 e8011b1..24bd666 100755 --- a/plugin_validate.php +++ b/plugin_validate.php @@ -7,8 +7,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Scripts.Plugin - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Scripts.Plugin + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 f1d22f2..ce26988 100644 --- a/release/generate_dolibarr_version_txt.php +++ b/release/generate_dolibarr_version_txt.php @@ -54,7 +54,7 @@ use MokoEnterprise\{ApiClient, AuditLogger, Config}; class GenerateDolibarrVersionTxtCli extends CliFramework { - public const VERSION = '04.06.00'; + public const VERSION = '09.22.00'; private ?ApiClient $api = null; private AuditLogger $logger; diff --git a/release/generate_joomla_update_xml.php b/release/generate_joomla_update_xml.php index 715b835..3b6f8a1 100644 --- a/release/generate_joomla_update_xml.php +++ b/release/generate_joomla_update_xml.php @@ -54,7 +54,7 @@ use MokoStandards\Plugins\Joomla\UpdateXmlGenerator; class GenerateJoomlaUpdateXmlCli extends CliFramework { - public const VERSION = '04.06.00'; + public const VERSION = '09.22.00'; private ?ApiClient $api = null; private AuditLogger $logger; diff --git a/src/functions.php b/src/functions.php index 0f01e75..62d05c9 100644 --- a/src/functions.php +++ b/src/functions.php @@ -1,21 +1,21 @@ * * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Common - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Common + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /src/functions.php * BRIEF: Common utility functions * - * This file provides global helper functions for MokoStandards. + * This file provides global helper functions for moko-platform. * - * @package MokoStandards + * @package MokoPlatform * @version 04.00.04 */ @@ -23,7 +23,7 @@ declare(strict_types=1); if (!function_exists('mokostandards_version')) { /** - * Get the MokoStandards version + * Get the moko-platform version * * @return string Version number */ @@ -35,7 +35,7 @@ if (!function_exists('mokostandards_version')) { if (!function_exists('mokostandards_root_dir')) { /** - * Get the MokoStandards root directory + * Get the moko-platform root directory * * @return string Root directory path */ diff --git a/templates/configs/README.md b/templates/configs/README.md index eee5324..1a0aef2 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: MokoStandards.Templates -INGROUP: MokoStandards -REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoStandards +DEFGROUP: MokoPlatform.Templates +INGROUP: MokoPlatform +REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform 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 MokoStandards projects. +This directory contains standardized configuration files for code quality, linting, and security tools used across moko-platform projects. ## Available Configurations @@ -296,9 +296,9 @@ These tools work seamlessly with: ## Support and Updates -Configuration templates are maintained in the MokoStandards repository: -- **Repository**: https://git.mokoconsulting.tech/MokoConsulting/MokoStandards -- **Documentation**: https://git.mokoconsulting.tech/MokoConsulting/MokoStandards/tree/main/docs +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 - **Issues**: Report problems or suggest improvements via GitHub Issues ## Version History diff --git a/templates/configs/index.md b/templates/configs/index.md index 3f02245..f6e7e5d 100644 --- a/templates/configs/index.md +++ b/templates/configs/index.md @@ -2,8 +2,8 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoStandards.Index -INGROUP: MokoStandards.Templates.Configs +DEFGROUP: MokoPlatform.Index +INGROUP: MokoPlatform.Templates.Configs REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform PATH: /templates/configs/index.md BRIEF: Configuration templates directory index diff --git a/templates/configs/manifest.xml.template b/templates/configs/manifest.xml.template new file mode 100644 index 0000000..926fde8 --- /dev/null +++ b/templates/configs/manifest.xml.template @@ -0,0 +1,38 @@ + + + + + + {{REPO_NAME}} + {{org}} + {{REPO_DESCRIPTION}} + GNU General Public License v3 + + + + {{platform}} + {{standards_version}} + https://git.mokoconsulting.tech/MokoConsulting/moko-platform + + + + {{PRIMARY_LANGUAGE}} + + + diff --git a/templates/configs/manifest.yml.template b/templates/configs/manifest.yml.template new file mode 100644 index 0000000..4db407f --- /dev/null +++ b/templates/configs/manifest.yml.template @@ -0,0 +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 +# 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. +# 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 + +standards_source: "https://git.mokoconsulting.tech/MokoConsulting/moko-platform" +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 4b48379..dbfc296 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: MokoStandards.Templates.Config - INGROUP: MokoStandards.Templates - REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoStandards-API - PATH: /templates/configs/mokostandards.xml.template - BRIEF: XML manifest template — synced to .gitea/.mokostandards in every governed repository + DEFGROUP: MokoPlatform.Templates.Config + INGROUP: MokoPlatform.Templates + REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform + 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(). - MokoStandards Repository Manifest - Auto-generated by MokoStandards bulk sync. + moko-platform Repository Manifest + Auto-generated by moko-platform bulk sync. Manual edits to and may be overwritten. - See: docs/standards/mokostandards-file-spec.md + See: docs/standards/manifest-file-spec.md --> - @@ -28,11 +28,11 @@ {{platform}} {{standards_version}} - https://git.mokoconsulting.tech/MokoConsulting/MokoStandards + https://git.mokoconsulting.tech/MokoConsulting/moko-platform {{PRIMARY_LANGUAGE}} - + diff --git a/templates/configs/mokostandards.yml.template b/templates/configs/mokostandards.yml.template index bba82ed..4e3378c 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: MokoStandards.Templates.Config -# INGROUP: MokoStandards.Templates -# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards +# DEFGROUP: MokoPlatform.Templates.Config +# INGROUP: MokoPlatform.Templates +# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform # 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 MokoStandards bulk sync. +# This file is managed automatically by moko-platform bulk sync. # Do not edit manually — changes will be overwritten on the next sync. -# To update governance settings, open a PR in MokoStandards instead: -# https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards +# To update governance settings, open a PR in moko-platform instead: +# https://git.mokoconsulting.tech/MokoConsulting/moko-platform -standards_source: "https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards" +standards_source: "https://git.mokoconsulting.tech/MokoConsulting/moko-platform" standards_version: "{{standards_version}}" platform: "{{platform}}" governed_repo: "{{org}}/{{repo_name}}" diff --git a/templates/configs/phpcs.xml b/templates/configs/phpcs.xml index 11fe470..ddb471f 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 MokoStandards projects + + PHP_CodeSniffer configuration for moko-platform projects src diff --git a/templates/docs/README.md b/templates/docs/README.md index c6b80e4..dfec43a 100644 --- a/templates/docs/README.md +++ b/templates/docs/README.md @@ -2,8 +2,8 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoStandards.Index -INGROUP: MokoStandards.Templates.Docs +DEFGROUP: MokoPlatform.Index +INGROUP: MokoPlatform.Templates.Docs REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform 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 MokoStandards organization. These templates ensure consistency, completeness, and compliance across all documentation artifacts. +This directory contains governed documentation templates for the moko-platform organization. These templates ensure consistency, completeness, and compliance across all documentation artifacts. ## Intended Use diff --git a/templates/docs/dolibarr/update-server.md b/templates/docs/dolibarr/update-server.md index 39d1b26..f12524f 100644 --- a/templates/docs/dolibarr/update-server.md +++ b/templates/docs/dolibarr/update-server.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: MokoStandards.Documentation -INGROUP: MokoStandards.Templates -REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoStandards +DEFGROUP: MokoPlatform.Documentation +INGROUP: MokoPlatform.Templates +REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform PATH: /templates/docs/dolibarr/update-server.md BRIEF: Developer guide for wiring up Dolibarr module update checks — synced to docs/ in all CRM repos --> diff --git a/templates/docs/extra/README.md b/templates/docs/extra/README.md index 193d9f7..edafb43 100644 --- a/templates/docs/extra/README.md +++ b/templates/docs/extra/README.md @@ -2,8 +2,8 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoStandards.Index -INGROUP: MokoStandards.Templates.Docs.Extra +DEFGROUP: MokoPlatform.Index +INGROUP: MokoPlatform.Templates.Docs.Extra REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform 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 04939d0..5d85e61 100644 --- a/templates/docs/extra/index.md +++ b/templates/docs/extra/index.md @@ -2,8 +2,8 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoStandards.Index -INGROUP: MokoStandards.Templates.Docs.Extra +DEFGROUP: MokoPlatform.Index +INGROUP: MokoPlatform.Templates.Docs.Extra REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform 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 5892b90..b224004 100644 --- a/templates/docs/index.md +++ b/templates/docs/index.md @@ -2,8 +2,8 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoStandards.Index -INGROUP: MokoStandards.Templates.Docs +DEFGROUP: MokoPlatform.Index +INGROUP: MokoPlatform.Templates.Docs REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform 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 0abbf81..270eddd 100644 --- a/templates/docs/required/GOVERNANCE.md +++ b/templates/docs/required/GOVERNANCE.md @@ -17,14 +17,14 @@ FILE INFORMATION DEFGROUP: {{org}}.{{repo_name}} - INGROUP: MokoStandards.Governance + INGROUP: MokoPlatform.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}} --> -[![MokoStandards](https://img.shields.io/badge/MokoStandards-{{standards_version}}-blue)](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards) +[![moko-platform](https://img.shields.io/badge/moko--platform-{{standards_version}}-blue)](https://git.mokoconsulting.tech/MokoConsulting/moko-platform) # 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 -[MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards) v{{standards_version}}. +[moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform) v{{standards_version}}. -Full governance policy is defined in the MokoStandards source repository: -[docs/policy/GOVERNANCE.md](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards/blob/main/docs/policy/GOVERNANCE.md) +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) --- @@ -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/MokoStandards/blob/main/docs/policy/GOVERNANCE.md#sole-operator-policy) +[Sole Operator Policy](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/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 | MokoStandards v{{standards_version}} | +| Standards | moko-platform v{{standards_version}} | | Repo | https://github.com/{{org}}/{{repo_name}} | | Path | /GOVERNANCE.md | -| Status | Active — auto-maintained by MokoStandards | +| Status | Active — auto-maintained by moko-platform | diff --git a/templates/docs/required/README.md b/templates/docs/required/README.md index c2dca78..0c0a053 100644 --- a/templates/docs/required/README.md +++ b/templates/docs/required/README.md @@ -2,8 +2,8 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoStandards.Index -INGROUP: MokoStandards.Templates.Docs.Required +DEFGROUP: MokoPlatform.Index +INGROUP: MokoPlatform.Templates.Docs.Required REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform 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 MokoStandards 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 moko-platform 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 c11ca53..50e3e38 100644 --- a/templates/docs/required/index.md +++ b/templates/docs/required/index.md @@ -2,8 +2,8 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoStandards.Index -INGROUP: MokoStandards.Templates.Docs.Required +DEFGROUP: MokoPlatform.Index +INGROUP: MokoPlatform.Templates.Docs.Required REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform 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 5a6642e..16263db 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 **[MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards)** — the authoritative source of coding standards, workflows, and policies for all Moko Consulting repositories. +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. ## Branch Strategy @@ -49,9 +49,9 @@ This repository is governed by **[MokoStandards](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 MokoStandards) | +| `chore/` | Automated sync branches (managed by moko-platform) | -> **Never use** `feature/`, `hotfix/`, or `release/` prefixes — they are not part of the MokoStandards branch strategy. +> **Never use** `feature/`, `hotfix/`, or `release/` prefixes — they are not part of the moko-platform 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 [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards): +All contributions must follow [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform): | Standard | Reference | |----------|-----------| -| Coding Style | [coding-style-guide.md](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards/blob/main/docs/policy/coding-style-guide.md) | -| File Headers | [file-header-standards.md](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards/blob/main/docs/policy/file-header-standards.md) | -| Branching | [branch-release-strategy.md](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards/blob/main/docs/policy/branch-release-strategy.md) | -| Merge Strategy | [merge-strategy.md](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards/blob/main/docs/policy/merge-strategy.md) | -| Scripting | [scripting-standards.md](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards/blob/main/docs/policy/scripting-standards.md) | -| Build & Release | [build-release.md](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards/blob/main/docs/workflows/build-release.md) | +| 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) | ## PR Checklist @@ -109,12 +109,12 @@ All contributions must follow [MokoStandards](https://git.mokoconsulting.tech/Mo ## Custom Workflows -Place repo-specific workflows in `.mokogitea/workflows/custom/` — they are **never overwritten or deleted** by MokoStandards sync: +Place repo-specific workflows in `.mokogitea/workflows/custom/` — they are **never overwritten or deleted** by moko-platform sync: ``` .mokogitea/workflows/ -├── deploy-dev.yml ← Synced from MokoStandards -├── auto-release.yml ← Synced from MokoStandards +├── deploy-dev.yml ← Synced from moko-platform +├── auto-release.yml ← Synced from moko-platform └── 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 [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards). Do not edit directly — changes will be overwritten on the next sync.* +*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.* diff --git a/templates/docs/required/template-README.md b/templates/docs/required/template-README.md index 76d3c72..2a1f408 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) -[![MokoStandards](https://img.shields.io/badge/MokoStandards-{{standards_version}}-orange)](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards) +[![moko-platform](https://img.shields.io/badge/moko--platform-{{standards_version}}-orange)](https://git.mokoconsulting.tech/MokoConsulting/moko-platform) > {{REPO_DESCRIPTION}} @@ -40,7 +40,7 @@ BRIEF: {{REPO_DESCRIPTION}} ## Contributing -See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. This repository follows [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards). +See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. This repository follows [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform). ## License diff --git a/templates/docs/required/template-SECURITY.md b/templates/docs/required/template-SECURITY.md index 6e82f30..43d2940 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 MokoStandards: +For repositories adopting moko-platform: ### 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 MokoStandards. Deviations require documented justification and approval from the Security Owner. +This security policy is binding for all repositories governed by moko-platform. 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 MokoStandards | +| Applies To | All repositories governed by moko-platform | | Status | Active | | Effective | [YYYY-MM-DD] | diff --git a/templates/docs/required/template-update-server-dolibarr.md b/templates/docs/required/template-update-server-dolibarr.md index 6ef03cb..c29079d 100644 --- a/templates/docs/required/template-update-server-dolibarr.md +++ b/templates/docs/required/template-update-server-dolibarr.md @@ -7,7 +7,7 @@ SPDX-License-Identifier: GPL-3.0-or-later # FILE INFORMATION DEFGROUP: {{REPO_NAME}}.Documentation -INGROUP: MokoStandards.Templates +INGROUP: MokoPlatform.Templates REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/{{REPO_NAME}} PATH: /docs/update-server.md VERSION: {{standards_version}} @@ -16,7 +16,7 @@ BRIEF: How this module's update server file (update.txt) is managed # Dolibarr Update Server -[![MokoStandards](https://img.shields.io/badge/MokoStandards-{{standards_version}}-blue)](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards) +[![moko-platform](https://img.shields.io/badge/moko--platform-{{standards_version}}-blue)](https://git.mokoconsulting.tech/MokoConsulting/moko-platform) This document explains how `update.txt` is automatically managed for this Dolibarr module. @@ -67,4 +67,4 @@ The `repo_health.yml` workflow verifies on every commit: --- -*Managed by [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards). See [docs/workflows/update-server.md](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards/blob/main/docs/workflows/update-server.md) for the full specification.* +*Managed by [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform). See [docs/workflows/update-server.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/workflows/update-server.md) for the full specification.* diff --git a/templates/docs/required/template-update-server-joomla.md b/templates/docs/required/template-update-server-joomla.md index dc5e869..ae66059 100644 --- a/templates/docs/required/template-update-server-joomla.md +++ b/templates/docs/required/template-update-server-joomla.md @@ -7,7 +7,7 @@ SPDX-License-Identifier: GPL-3.0-or-later # FILE INFORMATION DEFGROUP: {{REPO_NAME}}.Documentation -INGROUP: MokoStandards.Templates +INGROUP: MokoPlatform.Templates REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/{{REPO_NAME}} PATH: /docs/update-server.md VERSION: {{standards_version}} @@ -16,13 +16,13 @@ BRIEF: How this extension's Joomla update server file (updates.xml) is managed # Joomla Update Server -[![MokoStandards](https://img.shields.io/badge/MokoStandards-{{standards_version}}-blue)](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards) +[![moko-platform](https://img.shields.io/badge/moko--platform-{{standards_version}}-blue)](https://git.mokoconsulting.tech/MokoConsulting/moko-platform) This document explains how `updates.xml` is automatically managed for this Joomla extension following the [Joomla Update Server specification](https://docs.joomla.org/Deploying_an_Update_Server). ## How It Works -Joomla checks for extension updates by fetching an XML file from the URL defined in the `` tag in the extension's XML manifest. MokoStandards generates this file automatically. +Joomla checks for extension updates by fetching an XML file from the URL defined in the `` tag in the extension's XML manifest. moko-platform generates this file automatically. ### Automatic Generation @@ -119,4 +119,4 @@ The `repo_health.yml` workflow verifies on every commit: --- -*Managed by [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards). See [docs/workflows/update-server.md](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards/blob/main/docs/workflows/update-server.md) for the full specification.* +*Managed by [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform). See [docs/workflows/update-server.md](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/blob/main/docs/workflows/update-server.md) for the full specification.* diff --git a/templates/index.md b/templates/index.md index 2c86d6c..1af4170 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: MokoStandards.Templates -INGROUP: MokoStandards -REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoStandards +DEFGROUP: MokoPlatform.Templates +INGROUP: MokoPlatform +REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform PATH: /templates/index.md -BRIEF: Comprehensive catalog of all templates in MokoStandards +BRIEF: Comprehensive catalog of all templates in moko-platform --> # Templates Catalog ## Overview -This directory contains all templates and reference implementations provided by MokoStandards. 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 moko-platform. 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 MokoStandards policies. +Documentation file templates aligned with moko-platform policies. **Templates:** - `README.md.template` - Repository README template @@ -396,7 +396,7 @@ To deprecate a template: ### Getting Help - Browse existing templates for examples -- Review MokoStandards repository as reference implementation +- Review moko-platform 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**: [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards) +* **Repository**: [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform) * **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 6025866..75345a2 100644 --- a/templates/licenses/README.md +++ b/templates/licenses/README.md @@ -2,8 +2,8 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoStandards.Index -INGROUP: MokoStandards.Templates.Licenses +DEFGROUP: MokoPlatform.Index +INGROUP: MokoPlatform.Templates.Licenses REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform 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/MokoStandards/templates/licenses/GPL-3.0 ./LICENSE + cp /path/to/moko-platform/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/MokoStandards/templates/licenses/GPL-3.0 +diff LICENSE /path/to/moko-platform/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) -- [MokoStandards License Policy](../../docs/policy/license-compliance.md) +- [moko-platform 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 MokoStandards repository +- **Issues**: Open an issue in moko-platform repository diff --git a/templates/licenses/index.md b/templates/licenses/index.md index d5a8655..0c39d9e 100644 --- a/templates/licenses/index.md +++ b/templates/licenses/index.md @@ -2,8 +2,8 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoStandards.Index -INGROUP: MokoStandards.Templates.Licenses +DEFGROUP: MokoPlatform.Index +INGROUP: MokoPlatform.Templates.Licenses REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform PATH: /templates/licenses/index.md BRIEF: License templates directory index diff --git a/templates/makefiles/README.md b/templates/makefiles/README.md index b10474d..e4fdc8a 100644 --- a/templates/makefiles/README.md +++ b/templates/makefiles/README.md @@ -2,8 +2,8 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoStandards.Index -INGROUP: MokoStandards.Templates.Makefiles +DEFGROUP: MokoPlatform.Index +INGROUP: MokoPlatform.Templates.Makefiles REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform 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 MokoStandards documentation +- See main moko-platform 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 6627454..1a94d67 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: MokoStandards.Templates.GitHub -INGROUP: MokoStandards.Templates -REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards +DEFGROUP: MokoPlatform.Templates.GitHub +INGROUP: MokoPlatform.Templates +REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform 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 MokoStandards bulk-sync system +> This file may contain unfilled `{{TOKEN}}` placeholders. The moko-platform 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-tech/MokoStandards/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/moko-platform/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-tech/MokoStandards/blob/main/docs/development/crm/module-registry.md))* +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))* Repository URL: {{REPO_URL}} -This repository is governed by [MokoStandards](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards) — 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 [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. --- @@ -89,7 +89,7 @@ This repository is governed by [MokoStandards](https://git.mokoconsulting.tech/m │ ├── unit/ │ └── integration/ ├── .gitea/ -│ ├── workflows/ # CI/CD workflows (synced from MokoStandards) +│ ├── workflows/ # CI/CD workflows (synced from moko-platform) │ ├── 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-tech/MokoStandards/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/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. 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 (MokoStandards) +# Key Policy Documents (moko-platform) | Document | Purpose | |----------|---------| -| [file-header-standards.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/file-header-standards.md) | Copyright-header rules for every file type | -| [coding-style-guide.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/coding-style-guide.md) | Naming and formatting conventions | -| [branching-strategy.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/branching-strategy.md) | Branch naming, hierarchy, and release workflow | -| [merge-strategy.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/merge-strategy.md) | Squash-merge policy and PR conventions | -| [changelog-standards.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/changelog-standards.md) | How and when to update CHANGELOG.md | -| [module-registry.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/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-tech/MokoStandards/blob/main/docs/policy/crm/development-standards.md) | MokoCRM Dolibarr module development standards | -| [dolibarr-development-guide.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/guide/crm/dolibarr-development-guide.md) | MokoCRM full development guide | +| [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 | diff --git a/templates/mokogitea/CLAUDE.joomla.md.template b/templates/mokogitea/CLAUDE.joomla.md.template index 1bb492f..b14c4bc 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: MokoStandards.Templates.GitHub -INGROUP: MokoStandards.Templates -REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards +DEFGROUP: MokoPlatform.Templates.GitHub +INGROUP: MokoPlatform.Templates +REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform 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 MokoStandards bulk-sync system +> This file may contain unfilled `{{TOKEN}}` placeholders. The moko-platform 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 [MokoStandards](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards) — 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 [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. --- @@ -81,7 +81,7 @@ This repository is governed by [MokoStandards](https://git.mokoconsulting.tech/m ├── docs/ # Technical documentation ├── tests/ # Test suite ├── .gitea/ -│ ├── workflows/ # CI/CD workflows (synced from MokoStandards) +│ ├── workflows/ # CI/CD workflows (synced from moko-platform) │ ├── 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 (MokoStandards) +# Key Policy Documents (moko-platform) | Document | Purpose | |----------|---------| -| [file-header-standards.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/file-header-standards.md) | Copyright-header rules for every file type | -| [coding-style-guide.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/coding-style-guide.md) | Naming and formatting conventions | -| [branching-strategy.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/branching-strategy.md) | Branch naming, hierarchy, and release workflow | -| [merge-strategy.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/merge-strategy.md) | Squash-merge policy and PR conventions | -| [changelog-standards.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/changelog-standards.md) | How and when to update CHANGELOG.md | -| [joomla-development-guide.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/guide/waas/joomla-development-guide.md) | MokoWaaS Joomla extension development guide | +| [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 | ### Update Server Priority diff --git a/templates/mokogitea/CLAUDE.md.template b/templates/mokogitea/CLAUDE.md.template index 86c3ae2..35bb5d9 100644 --- a/templates/mokogitea/CLAUDE.md.template +++ b/templates/mokogitea/CLAUDE.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: MokoStandards.Templates.GitHub -INGROUP: MokoStandards.Templates -REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards +DEFGROUP: MokoPlatform.Templates.GitHub +INGROUP: MokoPlatform.Templates +REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform PATH: /templates/mokogitea/CLAUDE.md.template VERSION: XX.YY.ZZ BRIEF: Standard CLAUDE.md template for Moko Consulting governed repositories @@ -19,7 +19,7 @@ NOTE: Synced to .gitea/CLAUDE.md in all governed repositories via bulk sync. > [!IMPORTANT] > **🔧 AI Self-Update Required on First Use** > -> This file may contain unfilled `{{TOKEN}}` placeholders. The MokoStandards bulk-sync system +> This file may contain unfilled `{{TOKEN}}` placeholders. The moko-platform 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. > @@ -51,7 +51,7 @@ NOTE: Synced to .gitea/CLAUDE.md in all governed repositories via bulk sync. Repository URL: {{REPO_URL}} -This repository is governed by [MokoStandards](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards) — 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 [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. --- @@ -63,8 +63,8 @@ This repository is governed by [MokoStandards](https://git.mokoconsulting.tech/m ├── docs/ # Documentation ├── tests/ # Test suite ├── .gitea/ -│ ├── workflows/ # CI/CD workflows (synced from MokoStandards) -│ ├── ISSUE_TEMPLATE/ # Issue templates (synced from MokoStandards) +│ ├── workflows/ # CI/CD workflows (synced from moko-platform) +│ ├── ISSUE_TEMPLATE/ # Issue templates (synced from moko-platform) │ ├── copilot-instructions.md # GitHub Copilot custom instructions │ ├── CLAUDE.md # This file — Claude AI assistant context │ └── override.tf # Repository-specific health-check overrides @@ -86,7 +86,7 @@ YAML uses 2-space indentation (spaces, not tabs). All other text files use tabs # Composer Package (PHP repositories) -This repository requires the MokoStandards enterprise library. The package is installed from the private GitHub VCS source. +This repository requires the moko-platform enterprise library. The package is installed from the private GitHub VCS source. `composer.json` must contain: @@ -95,7 +95,7 @@ This repository requires the MokoStandards enterprise library. The package is in "repositories": [ { "type": "vcs", - "url": "https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards" + "url": "https://git.mokoconsulting.tech/MokoConsulting/moko-platform" } ], "require": { @@ -353,14 +353,14 @@ If your code change makes any existing doc sentence false or incomplete, fix the --- -# Key Policy Documents (MokoStandards) +# Key Policy Documents (moko-platform) | Document | Purpose | |----------|---------| -| [file-header-standards.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/file-header-standards.md) | Copyright-header rules for every file type | -| [coding-style-guide.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/coding-style-guide.md) | Naming and formatting conventions | -| [branching-strategy.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/branching-strategy.md) | Branch naming, hierarchy, and release workflow | -| [merge-strategy.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/merge-strategy.md) | Squash-merge policy and PR conventions | -| [changelog-standards.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/changelog-standards.md) | How and when to update CHANGELOG.md | -| [scripting-standards.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/scripting-standards.md) | PHP script requirements and CliFramework usage | -| [package-installation.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/guide/package-installation.md) | Installing `mokoconsulting/mokostandards` via Composer | +| [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 | +| [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 | diff --git a/templates/mokogitea/ISSUE_TEMPLATE/config.yml b/templates/mokogitea/ISSUE_TEMPLATE/config.yml index d4d49ec..06221e2 100644 --- a/templates/mokogitea/ISSUE_TEMPLATE/config.yml +++ b/templates/mokogitea/ISSUE_TEMPLATE/config.yml @@ -7,7 +7,7 @@ contact_links: - name: 💬 Ask a Question url: https://mokoconsulting.tech/ about: Get help or ask questions through our website - - name: 📚 MokoStandards Documentation + - name: 📚 moko-platform Documentation url: https://git.mokoconsulting.tech/MokoConsulting/moko-platform about: View our coding standards and best practices - name: 🔒 Report a Security Vulnerability diff --git a/templates/mokogitea/ISSUE_TEMPLATE/documentation.md b/templates/mokogitea/ISSUE_TEMPLATE/documentation.md index ed4dabc..648dab9 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 MokoStandards documentation guidelines +- [ ] Follows moko-platform 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 1d625d2..407fcb3 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/MokoStandards/blob/main/docs/policy/DOLIBARR_MODULE_ID_REQUEST.md): +Based on the [Dolibarr Module ID Policy](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/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 MokoStandards +- [ ] Code follows moko-platform - [ ] 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/MokoStandards/blob/main/docs/policy/DOLIBARR_MODULE_ID_REQUEST.md) +- [ ] 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 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 7b76dc9..6d691a0 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 [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards)? +Does this relate to any standards in [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform)? - [ ] 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 f57b284..56b6573 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 [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards)? +Does this relate to security standards in [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform)? - [ ] SPDX license identifiers - [ ] Secret management - [ ] Dependency security diff --git a/templates/mokogitea/README.md b/templates/mokogitea/README.md index cb1011c..1d7a831 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: MokoStandards.Templates -INGROUP: MokoStandards.GitHub -REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoStandards +DEFGROUP: MokoPlatform.Templates +INGROUP: MokoPlatform.GitHub +REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform 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/MokoStandards/docs + url: https://git.mokoconsulting.tech/MokoConsulting/moko-platform/docs about: "Check the documentation first" - name: "💬 Discussions" - url: https://git.mokoconsulting.tech/MokoConsulting/MokoStandards/discussions + url: https://git.mokoconsulting.tech/MokoConsulting/moko-platform/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) -- [MokoStandards Repository](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards) +- [moko-platform Repository](https://git.mokoconsulting.tech/MokoConsulting/moko-platform) ## Metadata * **Document**: templates/mokogitea/README.md -* **Repository**: [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards) +* **Repository**: [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform) * **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 12847b6..55006cd 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: MokoStandards.Templates.GitHub -INGROUP: MokoStandards.Templates -REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards +DEFGROUP: MokoPlatform.Templates.GitHub +INGROUP: MokoPlatform.Templates +REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform 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 MokoStandards bulk-sync system +> This file may contain unfilled `{{TOKEN}}` placeholders. The moko-platform 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-tech/MokoStandards/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/moko-platform/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 [MokoStandards](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards). 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 [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform). 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-tech/MokoStandards/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/moko-platform/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')` --- -## MokoStandards Reference +## moko-platform Reference -This repository is governed by [MokoStandards](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards). Authoritative policies: +This repository is governed by [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform). Authoritative policies: | Document | Purpose | |----------|---------| -| [file-header-standards.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/file-header-standards.md) | Copyright-header rules for every file type | -| [coding-style-guide.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/coding-style-guide.md) | Naming and formatting conventions | -| [branching-strategy.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/branching-strategy.md) | Branch naming, hierarchy, and release workflow | -| [merge-strategy.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/merge-strategy.md) | Squash-merge policy and PR title/body conventions | -| [changelog-standards.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/changelog-standards.md) | How and when to update CHANGELOG.md | -| [module-registry.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/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-tech/MokoStandards/blob/main/docs/policy/crm/development-standards.md) | MokoCRM Dolibarr module development standards | +| [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 | --- diff --git a/templates/mokogitea/copilot-instructions.joomla.md.template b/templates/mokogitea/copilot-instructions.joomla.md.template index 52e2021..23107af 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: MokoStandards.Templates.GitHub -INGROUP: MokoStandards.Templates -REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards +DEFGROUP: MokoPlatform.Templates.GitHub +INGROUP: MokoPlatform.Templates +REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform 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 MokoStandards bulk-sync system +> This file may contain unfilled `{{TOKEN}}` placeholders. The moko-platform 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 [MokoStandards](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards). 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 [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform). 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 }} --- -## MokoStandards Reference +## moko-platform Reference -This repository is governed by [MokoStandards](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards). Authoritative policies: +This repository is governed by [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform). Authoritative policies: | Document | Purpose | |----------|---------| -| [file-header-standards.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/file-header-standards.md) | Copyright-header rules for every file type | -| [coding-style-guide.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/coding-style-guide.md) | Naming and formatting conventions | -| [branching-strategy.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/branching-strategy.md) | Branch naming, hierarchy, and release workflow | -| [merge-strategy.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/merge-strategy.md) | Squash-merge policy and PR title/body conventions | -| [changelog-standards.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/changelog-standards.md) | How and when to update CHANGELOG.md | -| [joomla-development-guide.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/guide/waas/joomla-development-guide.md) | MokoWaaS Joomla extension development guide | +| [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 | --- diff --git a/templates/mokogitea/copilot-instructions.md.template b/templates/mokogitea/copilot-instructions.md.template index 32fd6f1..9d8c534 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: MokoStandards.Templates.GitHub -INGROUP: MokoStandards.Templates -REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards +DEFGROUP: MokoPlatform.Templates.GitHub +INGROUP: MokoPlatform.Templates +REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform 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 MokoStandards bulk-sync system +> This file may contain unfilled `{{TOKEN}}` placeholders. The moko-platform 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 [MokoStandards](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards). All coding standards, workflows, and policies are defined there and enforced here via bulk sync. +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. 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 [MokoStandards coding-style-guide](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/coding-style-guide.md). +**{{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). 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` | -| MokoStandards | `orange` | `badge/MokoStandards-04.06.00-orange` | +| MokoStandards | `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 MokoStandards enterprise library. The `composer.json` must include: +This repository requires the moko-platform enterprise library. The `composer.json` must include: ```json { "repositories": [ { "type": "vcs", - "url": "https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards" + "url": "https://git.mokoconsulting.tech/MokoConsulting/moko-platform" } ], "require": { @@ -177,7 +177,7 @@ This repository requires the MokoStandards enterprise library. The `composer.jso } ``` -Run `composer install` after adding the dependency. See [package-installation.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/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/moko-platform/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 --- -## MokoStandards Reference +## moko-platform Reference -This repository is governed by [MokoStandards](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards). Authoritative policies: +This repository is governed by [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform). Authoritative policies: | Document | Purpose | |----------|---------| -| [file-header-standards.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/file-header-standards.md) | Copyright-header rules for every file type | -| [coding-style-guide.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/coding-style-guide.md) | Naming and formatting conventions | -| [branching-strategy.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/branching-strategy.md) | Branch naming, hierarchy, and release workflow | -| [merge-strategy.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/merge-strategy.md) | Squash-merge policy and PR title/body conventions | -| [changelog-standards.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/changelog-standards.md) | How and when to update CHANGELOG.md | -| [scripting-standards.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/policy/scripting-standards.md) | PHP script requirements and CliFramework usage | -| [package-installation.md](https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards/blob/main/docs/guide/package-installation.md) | Installing `mokoconsulting/mokostandards` via Composer | +| [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 | diff --git a/templates/mokogitea/dependabot.yml.template b/templates/mokogitea/dependabot.yml.template index 00550b2..f4b3f02 100644 --- a/templates/mokogitea/dependabot.yml.template +++ b/templates/mokogitea/dependabot.yml.template @@ -6,8 +6,8 @@ # # FILE INFORMATION # DEFGROUP: GitHub.Dependabot -# INGROUP: MokoStandards.Security -# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards +# INGROUP: MokoPlatform.Security +# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform # 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 067676f..43df6fd 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 MokoStandards. +# It overrides the default configuration from moko-platform. # -# AUTO-GENERATED: This file is automatically synced from MokoStandards +# AUTO-GENERATED: This file is automatically synced from moko-platform # 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 031bd50..399f7d5 100644 --- a/templates/required/README.md +++ b/templates/required/README.md @@ -2,8 +2,8 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoStandards.Index -INGROUP: MokoStandards.Templates.Required +DEFGROUP: MokoPlatform.Index +INGROUP: MokoPlatform.Templates.Required REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform PATH: /templates/required/README.md BRIEF: Required templates README @@ -11,11 +11,11 @@ BRIEF: Required templates README # Required Templates -This directory contains **REQUIRED** files that must be present in all MokoStandards-compliant repositories. +This directory contains **REQUIRED** files that must be present in all moko-platform-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 MokoStandards 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 moko-platform 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/MokoStandards/main/templates/required/setup-labels.sh > scripts/maintenance/setup-labels.sh +curl -fsSL https://raw.githubusercontent.com/MokoConsulting/moko-platform/main/templates/required/setup-labels.sh > scripts/maintenance/setup-labels.sh chmod +x scripts/maintenance/setup-labels.sh -# Or copy from MokoStandards -cp /path/to/MokoStandards/templates/required/setup-labels.sh 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 chmod +x scripts/maintenance/setup-labels.sh ``` @@ -95,10 +95,10 @@ done ### Automated Compliance -Use the MokoStandards validation scripts: +Use the moko-platform validation scripts: ```bash -# From MokoStandards repository +# From moko-platform 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 MokoStandards: +Required files should be kept in sync with moko-platform: ```bash # Update single file -curl -fsSL https://raw.githubusercontent.com/MokoConsulting/MokoStandards/main/templates/required/setup-labels.sh > scripts/maintenance/setup-labels.sh +curl -fsSL https://raw.githubusercontent.com/MokoConsulting/moko-platform/main/templates/required/setup-labels.sh > scripts/maintenance/setup-labels.sh # Or use bulk sync -cd /path/to/MokoStandards +cd /path/to/moko-platform ./scripts/automation/bulk_update_repos.sh --org MokoConsulting --sync-required ``` @@ -123,26 +123,26 @@ cd /path/to/MokoStandards To deploy required files to a repository using GitHub Copilot: ```markdown -Deploy required MokoStandards files to this repository. +Deploy required moko-platform 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/MokoStandards +2. Download setup-labels.sh from MokoConsulting/moko-platform 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/MokoStandards/tree/main/templates/required +Source: https://git.mokoconsulting.tech/MokoConsulting/moko-platform/tree/main/templates/required ``` ## Future Required Files -As MokoStandards evolves, additional required files may be added: +As moko-platform evolves, additional required files may be added: - **PLANNED**: `.github/labeler.yml` - Auto-labeling configuration - **PLANNED**: `.editorconfig` - Editor configuration @@ -153,7 +153,7 @@ As MokoStandards 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/MokoStandards/issues +- **Issues**: https://git.mokoconsulting.tech/MokoConsulting/moko-platform/issues - **Contact**: hello@mokoconsulting.tech ## Related Documentation @@ -167,4 +167,4 @@ As MokoStandards evolves, additional required files may be added: **Last Updated**: 2026-01-28 **Version**: 03.01.00 -**Maintained By**: MokoStandards Team +**Maintained By**: moko-platform Team diff --git a/templates/schemas/README.md b/templates/schemas/README.md index 2a6b190..b6dd2aa 100644 --- a/templates/schemas/README.md +++ b/templates/schemas/README.md @@ -2,8 +2,8 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoStandards.Index -INGROUP: MokoStandards.Templates.Schemas +DEFGROUP: MokoPlatform.Index +INGROUP: MokoPlatform.Templates.Schemas REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform PATH: /templates/schemas/README.md BRIEF: Schema templates README diff --git a/templates/schemas/manifest-schema.xsd b/templates/schemas/manifest-schema.xsd index 60e3d3c..b866f5b 100644 --- a/templates/schemas/manifest-schema.xsd +++ b/templates/schemas/manifest-schema.xsd @@ -3,7 +3,7 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later - MokoStandards Manifest Schema v09.01.00 + moko-platform 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 new file mode 100644 index 0000000..537535f --- /dev/null +++ b/templates/schemas/moko-platform-schema.xsd @@ -0,0 +1,272 @@ + + + + + + + + + Root element of the manifest.xml repository manifest. + Every governed repository MUST contain this file at .mokogitea/manifest.xml + + + + + + + + + + + + + + + + + + + + + Repository identity metadata. Provides authoritative repo-level + information consumed by sync tools, CI, and documentation generators. + + + + + + + + + + + + + + SPDX license identifier for the repository + + + + + + + + + + + + + + + + + + + Binds this repository to a moko-platform platform definition and + tracks the governance source and version. + + + + + + + + + + + + + + Platform slug — must match a .tf file in definitions/default/. + Controls which structure definition and workflows are synced. + + + + + + + + + + + + + + + + + + + Build and packaging configuration. Describes the toolchain, + entry points, and artifact outputs for this repository. + + + + + + + + + + + + + + + Describes the build output artifact (zip, phar, etc.) + + + + + + + + + + + + + + + + + + + + + + + + + Deployment targets. Each target maps to a CI workflow and + defines the connection method and remote path. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Repo-specific scripts and automation hooks. + Each script element defines a named command that CI or + developers can invoke via `make`, `composer run`, or directly. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Per-repo overrides for the bulk sync process. + Allows a repository to skip specific synced files or + opt out of certain governance features without forking + the entire platform definition. + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/schemas/mokostandards-schema.xsd b/templates/schemas/mokostandards-schema.xsd index 7b5cc54..79dc408 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: MokoStandards.Schema - INGROUP: MokoStandards.Governance + DEFGROUP: MokoPlatform.Schema + INGROUP: MokoPlatform.Governance REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform 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 MokoStandards platform definition and + Binds this repository to a moko-platform platform definition and tracks the governance source and version. diff --git a/templates/schemas/schemas/README.md b/templates/schemas/schemas/README.md index 3973737..40e4113 100644 --- a/templates/schemas/schemas/README.md +++ b/templates/schemas/schemas/README.md @@ -2,8 +2,8 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoStandards.Index -INGROUP: MokoStandards.Templates.Schemas +DEFGROUP: MokoPlatform.Index +INGROUP: MokoPlatform.Templates.Schemas REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform 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 b5e72c4..9e656ca 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: MokoStandards.Templates.Schemas -INGROUP: MokoStandards.Templates -REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/MokoStandards +DEFGROUP: MokoPlatform.Templates.Schemas +INGROUP: MokoPlatform.Templates +REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform PATH: /templates/schemas/template-repository-structure.xml BRIEF: Template for defining custom repository structure schemas --> @@ -126,8 +126,8 @@ BRIEF: Template for defining custom repository structure schemas - MokoStandards.override.xml - MokoStandards sync override configuration + moko-platform.override.xml + moko-platform sync override configuration optional false @@ -150,7 +150,7 @@ BRIEF: Template for defining custom repository structure schemas standards-compliance.yml - MokoStandards compliance validation + moko-platform compliance validation required diff --git a/templates/scripts/README.md b/templates/scripts/README.md index 6b43b24..feb6bf0 100644 --- a/templates/scripts/README.md +++ b/templates/scripts/README.md @@ -2,8 +2,8 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoStandards.Index -INGROUP: MokoStandards.Templates.Scripts +DEFGROUP: MokoPlatform.Index +INGROUP: MokoPlatform.Templates.Scripts REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform 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 MokoStandards requirements: +All scripts follow moko-platform 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 c02df2d..15f013d 100644 --- a/templates/scripts/common/CliBase.template.php +++ b/templates/scripts/common/CliBase.template.php @@ -8,8 +8,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Templates.Common - * INGROUP: MokoStandards.Templates + * DEFGROUP: MokoPlatform.Templates.Common + * INGROUP: MokoPlatform.Templates * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /templates/scripts/common/CliBase.template.php * BRIEF: PHP CLI script template — extends MokoEnterprise\CliFramework diff --git a/templates/scripts/fix/index.md b/templates/scripts/fix/index.md index 187592d..53c323c 100644 --- a/templates/scripts/fix/index.md +++ b/templates/scripts/fix/index.md @@ -2,8 +2,8 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoStandards.Index -INGROUP: MokoStandards.Templates.Scripts.Fix +DEFGROUP: MokoPlatform.Index +INGROUP: MokoPlatform.Templates.Scripts.Fix REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform PATH: /templates/scripts/fix/index.md BRIEF: Fix scripts directory index diff --git a/templates/scripts/index.md b/templates/scripts/index.md index 112f03f..ad222e3 100644 --- a/templates/scripts/index.md +++ b/templates/scripts/index.md @@ -2,8 +2,8 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoStandards.Index -INGROUP: MokoStandards.Templates.Scripts +DEFGROUP: MokoPlatform.Index +INGROUP: MokoPlatform.Templates.Scripts REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform 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 73e45d5..ba6b630 100644 --- a/templates/scripts/release/index.md +++ b/templates/scripts/release/index.md @@ -2,8 +2,8 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoStandards.Index -INGROUP: MokoStandards.Templates.Scripts.Release +DEFGROUP: MokoPlatform.Index +INGROUP: MokoPlatform.Templates.Scripts.Release REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform 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 6602466..5109f1b 100644 --- a/templates/scripts/release/package_dolibarr.php +++ b/templates/scripts/release/package_dolibarr.php @@ -8,8 +8,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Templates.Scripts.Release - * INGROUP: MokoStandards.Templates + * DEFGROUP: MokoPlatform.Templates.Scripts.Release + * INGROUP: MokoPlatform.Templates * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /templates/scripts/release/package_dolibarr.php * BRIEF: Build a distributable ZIP package for a Dolibarr module diff --git a/templates/scripts/release/package_joomla.php b/templates/scripts/release/package_joomla.php index a2810bf..9b8352c 100644 --- a/templates/scripts/release/package_joomla.php +++ b/templates/scripts/release/package_joomla.php @@ -8,8 +8,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Templates.Scripts.Release - * INGROUP: MokoStandards.Templates + * DEFGROUP: MokoPlatform.Templates.Scripts.Release + * INGROUP: MokoPlatform.Templates * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /templates/scripts/release/package_joomla.php * BRIEF: Build a distributable ZIP package for a Joomla component diff --git a/templates/scripts/sftp-config/README.md b/templates/scripts/sftp-config/README.md index f75e804..1a4c1f3 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: MokoStandards.Templates.Scripts -INGROUP: MokoStandards.Templates -REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoStandards +DEFGROUP: MokoPlatform.Templates.Scripts +INGROUP: MokoPlatform.Templates +REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform 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 MokoStandards: +1. **Copy the example templates** from moko-platform: ```bash # From your repo root mkdir -p scripts/sftp-config scripts/keys - cp path/to/MokoStandards/templates/scripts/deploy/sftp-config.dev.json.example \ + cp path/to/moko-platform/templates/scripts/deploy/sftp-config.dev.json.example \ scripts/sftp-config/sftp-config.dev.json - cp path/to/MokoStandards/templates/scripts/deploy/sftp-config.rs.json.example \ + cp path/to/moko-platform/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/MokoStandards/api/deploy/deploy-sftp.php \ +php path/to/moko-platform/api/deploy/deploy-sftp.php \ --path . --env dev --dry-run --verbose # Deploy src/ to dev -php path/to/MokoStandards/api/deploy/deploy-sftp.php \ +php path/to/moko-platform/api/deploy/deploy-sftp.php \ --path . --env dev # Deploy src/ to production -php path/to/MokoStandards/api/deploy/deploy-sftp.php \ +php path/to/moko-platform/api/deploy/deploy-sftp.php \ --path . --env rs ``` For full option reference run: ```bash -php path/to/MokoStandards/api/deploy/deploy-sftp.php --help +php path/to/moko-platform/api/deploy/deploy-sftp.php --help ``` --- diff --git a/templates/scripts/validate/dolibarr_module.php b/templates/scripts/validate/dolibarr_module.php index 36485c2..d9e3e87 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: MokoStandards.Templates.Scripts.Validate - * INGROUP: MokoStandards.Templates + * DEFGROUP: MokoPlatform.Templates.Scripts.Validate + * INGROUP: MokoPlatform.Templates * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /templates/scripts/validate/dolibarr_module.php - * BRIEF: Validate a Dolibarr module repository against MokoStandards requirements + * BRIEF: Validate a Dolibarr module repository against moko-platform 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 MokoStandards requirements. + * Validates a Dolibarr module repository against moko-platform 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 MokoStandards requirements'); + $this->setDescription('Validate a Dolibarr module repository against moko-platform 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 MokoStandards requirements'); +$script = new ValidateDolibarrModule('validate_module', 'Validate a Dolibarr module repository against moko-platform requirements'); exit($script->execute()); diff --git a/templates/scripts/validate/index.md b/templates/scripts/validate/index.md index 744b736..c2562b7 100644 --- a/templates/scripts/validate/index.md +++ b/templates/scripts/validate/index.md @@ -2,8 +2,8 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoStandards.Index -INGROUP: MokoStandards.Templates.Scripts.Validate +DEFGROUP: MokoPlatform.Index +INGROUP: MokoPlatform.Templates.Scripts.Validate REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform 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 3720783..e6b7dea 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: MokoStandards.Templates.Scripts.Validate - * INGROUP: MokoStandards.Templates + * DEFGROUP: MokoPlatform.Templates.Scripts.Validate + * INGROUP: MokoPlatform.Templates * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /templates/scripts/validate/validate_manifest.php - * BRIEF: Validate a Joomla component XML manifest against MokoStandards requirements + * BRIEF: Validate a Joomla component XML manifest against moko-platform 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 MokoStandards requirements. + * Validates a Joomla component XML manifest against moko-platform 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 MokoStandards requirements'); + $this->setDescription('Validate a Joomla component XML manifest against moko-platform 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 MokoStandards requirements'); +$script = new ValidateJoomlaManifest('validate_manifest', 'Validate a Joomla component XML manifest against moko-platform requirements'); exit($script->execute()); diff --git a/templates/scripts/validate/validate_structure.php b/templates/scripts/validate/validate_structure.php index 20d4627..f1dbf08 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: MokoStandards.Templates.Scripts.Validate - * INGROUP: MokoStandards.Templates + * DEFGROUP: MokoPlatform.Templates.Scripts.Validate + * INGROUP: MokoPlatform.Templates * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /templates/scripts/validate/validate_structure.php - * BRIEF: Validate a repository structure against MokoStandards requirements + * BRIEF: Validate a repository structure against moko-platform requirements * NOTE: Deployed to bin/validate_structure.php in governed generic/default repos. * Run: php bin/validate_structure.php [--path DIR] [--verbose] */ @@ -25,13 +25,13 @@ require_once __DIR__ . '/../vendor/autoload.php'; use MokoEnterprise\CliFramework; /** - * Validates a generic repository structure against MokoStandards requirements. + * Validates a generic repository structure against moko-platform requirements. * * Checks performed: * - Required root files present (README.md, CHANGELOG.md, LICENSE, CONTRIBUTING.md, * SECURITY.md, .gitignore, .editorconfig, composer.json) * - Required directories present (src/, docs/, tests/) - * - .mokogitea/.mokostandards XML governance manifest present + * - .mokogitea/manifest.xml XML governance manifest present * - SPDX-License-Identifier header present in all PHP source files * - No tab characters in YAML/JSON config files * - No Windows path separators in PHP source @@ -40,7 +40,7 @@ class ValidateStructure extends CliFramework { protected function configure(): void { - $this->setDescription('Validate a repository structure against MokoStandards requirements'); + $this->setDescription('Validate a repository structure against moko-platform requirements'); $this->addArgument('--path', 'Repository root to validate', '.'); } @@ -72,23 +72,23 @@ class ValidateStructure extends CliFramework } // ── Governance attachment ───────────────────────────────────────── - $this->section('MokoStandards governance'); - $mokoFile = file_exists("{$path}/.mokogitea/.mokostandards") + $this->section('moko-platform governance'); + $mokoFile = file_exists("{$path}/.mokogitea/manifest.xml") || file_exists("{$path}/.github/.mokostandards") || file_exists("{$path}/.mokostandards"); - $this->status($mokoFile, '.mokogitea/.mokostandards (XML manifest)'); + $this->status($mokoFile, '.mokogitea/manifest.xml (XML manifest)'); $mokoFile ? $passed++ : $failed++; // Validate XML format if file exists if ($mokoFile) { - $manifestPath = file_exists("{$path}/.mokogitea/.mokostandards") - ? "{$path}/.mokogitea/.mokostandards" + $manifestPath = file_exists("{$path}/.mokogitea/manifest.xml") + ? "{$path}/.mokogitea/manifest.xml" : (file_exists("{$path}/.github/.mokostandards") ? "{$path}/.github/.mokostandards" : "{$path}/.mokostandards"); $manifestContent = file_get_contents($manifestPath); - $isXml = str_contains($manifestContent, 'status($isXml, '.mokostandards uses XML format'); + $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 MokoStandards requirements'); +$script = new ValidateStructure('validate_structure', 'Validate a repository structure against moko-platform requirements'); exit($script->execute()); diff --git a/templates/security/README.md b/templates/security/README.md index dc56753..b39bff8 100644 --- a/templates/security/README.md +++ b/templates/security/README.md @@ -2,8 +2,8 @@ Copyright (C) 2026 Moko Consulting SPDX-License-Identifier: GPL-3.0-or-later FILE INFORMATION -DEFGROUP: MokoStandards.Index -INGROUP: MokoStandards.Templates.Security +DEFGROUP: MokoPlatform.Index +INGROUP: MokoPlatform.Templates.Security REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform PATH: /templates/security/README.md BRIEF: Security templates README @@ -11,7 +11,7 @@ BRIEF: Security templates README # Security Templates -This directory contains security-related templates for MokoStandards repositories. +This directory contains security-related templates for moko-platform repositories. ## index.html - Directory Listing Prevention (Static) diff --git a/templates/security/index.php b/templates/security/index.php index 99c2fd6..5abfa6a 100644 --- a/templates/security/index.php +++ b/templates/security/index.php @@ -6,8 +6,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Templates.Security - * INGROUP: MokoStandards.Templates + * DEFGROUP: MokoPlatform.Templates.Security + * INGROUP: MokoPlatform.Templates * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /templates/security/index.php * BRIEF: Directory listing prevention script diff --git a/templates/stubs/dolibarr.php b/templates/stubs/dolibarr.php index 5f87992..44fe174 100644 --- a/templates/stubs/dolibarr.php +++ b/templates/stubs/dolibarr.php @@ -5,8 +5,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Stubs - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Stubs + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 7dea606..4a32846 100644 --- a/templates/stubs/joomla.php +++ b/templates/stubs/joomla.php @@ -5,8 +5,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later * * FILE INFORMATION - * DEFGROUP: MokoStandards.Stubs - * INGROUP: MokoStandards + * DEFGROUP: MokoPlatform.Stubs + * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * 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 9bc6c4c..c2ce465 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 MokoStandards web-based management system. + * This is the main entry point for the moko-platform 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 MokoStandards + * @package MokoPlatform * @version 04.00.04 */ @@ -90,7 +90,7 @@ function handleDashboard(): Response - MokoStandards - Repository Management + moko-platform - Repository Management