WIP: refactor(insight): rename element com_mokosuitesight → com_mokosuiteinsight + SHORT menu constant + install migration (#13) #16

Draft
jmiller wants to merge 3 commits from fix/rename-com-mokosuiteinsight into dev
Owner

⚠ BREAKING — component ELEMENT rename. Review + STAGING-TEST before release.

Draft / WIP — do NOT merge until the manual verification checklist below passes on staging. (Title prefixed WIP: because the API has no draft flag.)

Renames the component element com_mokosuitesightcom_mokosuiteinsight (repo/product is MokoSuiteInsight; the element was missing the "in"), adds the missing admin .sys.ini + _SHORT menu constant, and ships an idempotent install migration so existing sites don't end up with a duplicate/orphaned extension.

Resolves #13 (which also covered the COM_..._SHORT short-name ask — superseded here; no separate _SHORT_NAME duplicate issue exists).

Token changes (component-owned files)

token occurrences transformed
com_mokosuitesight com_mokosuiteinsight element/folder/manifest/access + pkg <file> + 5 webservices option refs
Moko\Component\MokoSuiteSight (MokoSuiteSight) …MokoSuiteInsight 6 component namespace decls + manifest <namespace>
COM_MOKOSUITESIGHT COM_MOKOSUITEINSIGHT manifest <menu> (now _SHORT) + new sys.ini

Residual legacy tokens in component-owned files: 0 functional. The only com_mokosuitesight / #__mokosuitesight strings left in source/script.php are the migration's deliberate references to the OLD names (it has to find them to reconcile). php -l clean.

Files created / renamed / modified

  • Renamed (history preserved via git mv): whole source/packages/com_mokosuitesight/**com_mokosuiteinsight/** (14 files) incl. manifest mokosuitesight.xmlmokosuiteinsight.xml.
  • Created: com_mokosuiteinsight/admin/language/en-GB/com_mokosuiteinsight.sys.iniCOM_MOKOSUITEINSIGHT="MokoSuite Insight", COM_MOKOSUITEINSIGHT_SHORT="Insight", COM_MOKOSUITEINSIGHT_XML_DESCRIPTION="…". Wired via <languages folder="admin/language"> in <administration>; <menu> now COM_MOKOSUITEINSIGHT_SHORT.
  • Modified: source/pkg_mokosuitesight.xml (component <file> id/zip → com_mokosuiteinsight), source/script.php (+migration), plg_webservices_.../src/Extension/MokoSuiteInsight.php (API route component option → com_mokosuiteinsight).
  • Deleted: none (all renames).

Migration (source/script.phpPkg_MokoSuiteInsightInstallerScript::postflight)

migrateLegacyInsightElement() — idempotent, fail-open, strict no-op on fresh installs (returns immediately if no legacy com_mokosuitesight row):

  1. #__extensions — if both legacy + fresh rows exist (upgrade): keep the fresh row, port legacy params/enabled when fresh is still default, delete the legacy orphan; else rename legacy element in place.
  2. #__menuREPLACE(link, 'option=com_mokosuitesight','option=com_mokosuiteinsight') + component_id repoint to the fresh extension id.
  3. #__assets — rename name com_mokosuitesightcom_mokosuiteinsight, clash-guarded.

Explicitly EXCLUDED (and why)

  • #__mokosuitesight_* data-table rename — those tables are created (plg_system_.../sql/*) and queried only by plg_system_mokosuitesight, which is not renamed here. Renaming them now would break the still-old plugin. Deferred to the plugin-rename follow-up. (No component sql/updates RENAME TABLE added, for the same reason — it would be authoritative for tables the component doesn't own.)
  • plg_system_mokosuitesight, plg_webservices_mokosuitesight element/folder/namespace renames and the pkg_mokosuitesight package element — sibling extensions, out of scope for #13, no separate rename issue exists yet. Only the component cross-references inside the webservices plugin were updated (content-only) so the API still points at the renamed component. The v1/mokosuitesight/... public API URL prefixes were left as-is (plugin-owned API contract).

Manual verification checklist (staging)

  • Fresh install of the package → migration is a no-op, no errors, component installs as com_mokosuiteinsight.
  • Upgrade from old build (site already has com_mokosuitesight) → exactly one component row remains (com_mokosuiteinsight), no duplicate/orphan in Extensions manager.
  • Admin Components menu label renders "Insight" (SHORT constant resolves).
  • Existing admin menu items still open the component (link + component_id repointed).
  • ACL asset intact (#__assets renamed, no clash).
  • Data tables still #__mokosuitesight_* and plugin still functional (table rename intentionally deferred).

Follow-up needed (human decision)

Track a sibling issue to rename plg_system_mokosuitesight / plg_webservices_mokosuitesight / pkg_mokosuitesight + the #__mokosuitesight_* tables (with matching migration) to fully unify the stem — analogous to the ERP repo's separate plugin-rename issue.

https://claude.ai/code/session_01B9aZHSWbiiZykJD88pYx8R

## ⚠ BREAKING — component ELEMENT rename. Review + STAGING-TEST before release. > Draft / WIP — do NOT merge until the manual verification checklist below passes on staging. (Title prefixed `WIP:` because the API has no draft flag.) Renames the component element **`com_mokosuitesight` → `com_mokosuiteinsight`** (repo/product is MokoSuiteInsight; the element was missing the "in"), adds the missing admin `.sys.ini` + `_SHORT` menu constant, and ships an idempotent install migration so existing sites don't end up with a duplicate/orphaned extension. Resolves #13 (which also covered the `COM_..._SHORT` short-name ask — superseded here; no separate `_SHORT_NAME` duplicate issue exists). ### Token changes (component-owned files) | token | → | occurrences transformed | |---|---|---| | `com_mokosuitesight` | `com_mokosuiteinsight` | element/folder/manifest/access + pkg `<file>` + 5 webservices option refs | | `Moko\Component\MokoSuiteSight` (`MokoSuiteSight`) | `…MokoSuiteInsight` | 6 component `namespace` decls + manifest `<namespace>` | | `COM_MOKOSUITESIGHT` | `COM_MOKOSUITEINSIGHT` | manifest `<menu>` (now `_SHORT`) + new sys.ini | **Residual legacy tokens in component-owned files: 0 functional.** The only `com_mokosuitesight` / `#__mokosuitesight` strings left in `source/script.php` are the migration's *deliberate* references to the OLD names (it has to find them to reconcile). `php -l` clean. ### Files created / renamed / modified - **Renamed (history preserved via `git mv`):** whole `source/packages/com_mokosuitesight/**` → `com_mokosuiteinsight/**` (14 files) incl. manifest `mokosuitesight.xml` → `mokosuiteinsight.xml`. - **Created:** `com_mokosuiteinsight/admin/language/en-GB/com_mokosuiteinsight.sys.ini` — `COM_MOKOSUITEINSIGHT="MokoSuite Insight"`, `COM_MOKOSUITEINSIGHT_SHORT="Insight"`, `COM_MOKOSUITEINSIGHT_XML_DESCRIPTION="…"`. Wired via `<languages folder="admin/language">` in `<administration>`; `<menu>` now `COM_MOKOSUITEINSIGHT_SHORT`. - **Modified:** `source/pkg_mokosuitesight.xml` (component `<file>` id/zip → `com_mokosuiteinsight`), `source/script.php` (+migration), `plg_webservices_.../src/Extension/MokoSuiteInsight.php` (API route `component` option → `com_mokosuiteinsight`). - **Deleted:** none (all renames). ### Migration (`source/script.php` → `Pkg_MokoSuiteInsightInstallerScript::postflight`) `migrateLegacyInsightElement()` — idempotent, **fail-open**, strict **no-op on fresh installs** (returns immediately if no legacy `com_mokosuitesight` row): 1. `#__extensions` — if both legacy + fresh rows exist (upgrade): keep the fresh row, port legacy `params`/`enabled` when fresh is still default, delete the legacy orphan; else rename legacy element in place. 2. `#__menu` — `REPLACE(link, 'option=com_mokosuitesight','option=com_mokosuiteinsight')` + `component_id` repoint to the fresh extension id. 3. `#__assets` — rename `name` `com_mokosuitesight` → `com_mokosuiteinsight`, clash-guarded. ### Explicitly EXCLUDED (and why) - **`#__mokosuitesight_*` data-table rename** — those tables are created (`plg_system_.../sql/*`) and queried **only** by `plg_system_mokosuitesight`, which is **not** renamed here. Renaming them now would break the still-old plugin. Deferred to the plugin-rename follow-up. (No component `sql/updates` RENAME TABLE added, for the same reason — it would be authoritative for tables the component doesn't own.) - **`plg_system_mokosuitesight`, `plg_webservices_mokosuitesight` element/folder/namespace renames** and the **`pkg_mokosuitesight` package element** — sibling extensions, out of scope for #13, no separate rename issue exists yet. Only the component *cross-references* inside the webservices plugin were updated (content-only) so the API still points at the renamed component. The `v1/mokosuitesight/...` public API URL prefixes were left as-is (plugin-owned API contract). ### Manual verification checklist (staging) - [ ] **Fresh install** of the package → migration is a no-op, no errors, component installs as `com_mokosuiteinsight`. - [ ] **Upgrade from old build** (site already has `com_mokosuitesight`) → exactly one component row remains (`com_mokosuiteinsight`), no duplicate/orphan in Extensions manager. - [ ] Admin **Components menu label renders "Insight"** (SHORT constant resolves). - [ ] Existing admin **menu items still open** the component (link + component_id repointed). - [ ] **ACL** asset intact (`#__assets` renamed, no clash). - [ ] Data tables still `#__mokosuitesight_*` and plugin still functional (table rename intentionally deferred). ### Follow-up needed (human decision) Track a sibling issue to rename `plg_system_mokosuitesight` / `plg_webservices_mokosuitesight` / `pkg_mokosuitesight` + the `#__mokosuitesight_*` tables (with matching migration) to fully unify the stem — analogous to the ERP repo's separate plugin-rename issue. https://claude.ai/code/session_01B9aZHSWbiiZykJD88pYx8R
jmiller added 2 commits 2026-07-07 06:20:03 +00:00
refactor(insight): rename element com_mokosuitesight -> com_mokosuiteinsight + SHORT menu constant + install migration (#13)
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 9s
fe900944b6
Rename the component element com_mokosuitesight -> com_mokosuiteinsight
(repo/product is MokoSuiteInsight; element was missing the "in").

- git mv component folder + manifest (mokosuitesight.xml -> mokosuiteinsight.xml)
- transform tokens in component: element, namespace Moko\Component\MokoSuiteSight
  -> MokoSuiteInsight, COM_MOKOSUITESIGHT -> COM_MOKOSUITEINSIGHT
- admin <menu> now uses COM_MOKOSUITEINSIGHT_SHORT; create + wire
  admin/language/en-GB/com_mokosuiteinsight.sys.ini (SHORT="Insight")
- pkg manifest: component <file> id/zip -> com_mokosuiteinsight
- webservices plugin: repoint API routes' component option to com_mokosuiteinsight
  (content-only cross-ref fix; plugin element NOT renamed)
- script.php postflight: idempotent, fail-open legacy-element migration
  (reconcile #__extensions, repoint #__menu, rename #__assets; no-op fresh install)

BREAKING: element rename. Data tables (#__mokosuitesight_*) are owned by
plg_system_mokosuitesight and intentionally left for a plugin-rename follow-up.

Resolves #13

Claude-Session: https://claude.ai/code/session_01B9aZHSWbiiZykJD88pYx8R
jmiller added 1 commit 2026-07-16 15:21:13 +00:00
This pull request has changes conflicting with the target branch.
  • .mokogit/workflows/auto-bump.yml
  • .mokogit/workflows/auto-release.yml
  • .mokogit/workflows/ci-generic.yml
  • .mokogit/workflows/cleanup.yml
  • .mokogit/workflows/gitleaks.yml
  • .mokogit/workflows/issue-branch.yml
  • .mokogit/workflows/notify.yml
  • .mokogit/workflows/pr-check.yml
  • .mokogit/workflows/pr-metadata-check.yml
  • .mokogit/workflows/pre-release.yml
This pull request is marked as a work in progress.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/rename-com-mokosuiteinsight:fix/rename-com-mokosuiteinsight
git checkout fix/rename-com-mokosuiteinsight
Sign in to join this conversation.
No Reviewers
Priority -
Type -
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoSuiteInsight#16