Skip to content

docs: overhaul consumer and maintainer documentation - #95

Open
divyarajmasani wants to merge 1 commit into
mainfrom
gh/92-documentation
Open

docs: overhaul consumer and maintainer documentation#95
divyarajmasani wants to merge 1 commit into
mainfrom
gh/92-documentation

Conversation

@divyarajmasani

@divyarajmasani divyarajmasani commented Sep 3, 2026

Copy link
Copy Markdown

What this PR does

Overhauls the framework documentation so implementors can integrate the library from a complete example and maintainers have an explicit development workflow. It also audits the existing reference material against the shipped implementation, correcting stale behavior and filling the highest-impact API, installation, upgrade, and troubleshooting gaps.

Closes

Closes #92

Changes

  • Add a complete getting-started guide covering installation, plugin/theme bootstrap, modules, registration, and intentionally shared services.
  • Add maintainer, upgrading, and troubleshooting guides, and connect them through the README and documentation index.
  • Correct the Composer installation path for a package that is not published on public Packagist.
  • Correct Singleton, Loader, AbstractRESTController, and AbstractSettingsPage behavior to match the implementation.
  • Document PHP, WordPress, and optional OpenSSL requirements and clarify the zero-Composer-runtime-dependency guarantee.
  • Expand reference coverage for WP-CLI, asset helpers, loader hooks, Cache/SWR, FeatureSelector, Timer, Logger, and Transients.
  • Replace the misleading host-side composer check workflow with the actual PHPCS, PHPStan, and wp-env test commands.
  • Update contributor, AI-review, class-inventory, and changelog documentation.

How I verified

$ git diff --check
# no output

$ # Validate every repository-local Markdown link target.
Local Markdown links: OK

$ # Compare the documented class inventory with inc/.
# no undocumented shipped class, interface, or trait reported

The branch changes documentation and instruction files only; no inc/ runtime file is modified.

Acceptance criteria

Runtime behavior

  • No runtime behavior changes.
  • Documented examples and behavior were checked against the implementation and tests.

Code quality

  • Diff whitespace validation passes.
  • Repository-local Markdown links resolve.
  • Shipped class/interface/trait inventory is represented in the documentation.
  • PHP lint, static analysis, and PHPUnit were not rerun because this is a documentation-only change.

Housekeeping

  • CHANGELOG.md entry added under ## [Unreleased].

Reviewer notes

  • The versioning guide keeps inc/Contracts/ as the explicitly documented contract surface while treating removal of a public class or method as a major consumer impact.
  • Branching, release publication, security policy, and automated documentation-drift enforcement are not invented here; the maintainer guide calls out that a complete authoritative release procedure is not currently defined.
  • The quickstart is framework-generic and does not assume an unpublished skeleton-specific file layout.

AI assistance

I gathered the initial requirements and defined the documentation direction. AI was used to audit the repository against those requirements, expand the identified topics, and assist with drafting and refining the documentation.

Screenshots / terminal output

Not applicable; documentation-only change.

Audits the docs against the code and closes the gaps a consumer hits
first. No `inc/` behavior changes.

New pages:
- getting-started.md — smallest complete integration: install, a
  Registrable service, a module, bootstrap, and Shareable/get_shared().
- upgrading.md — the versioning promise stated against inc/Contracts/,
  plus the 1.0.0 -> 1.0.1 Singleton migration.
- troubleshooting.md — symptom -> cause for the framework's exceptions,
  _doing_it_wrong() notices, and silent no-ops.
- maintainers.md — environment, checks, test conventions, change
  checklist per surface.
- issues/maintainer-documentation-gaps.md — a filled-in task issue for
  the maintainer-side gaps: release procedure, SECURITY.md, the wp-env
  mount note, a doc-drift guard, and the composer.json script
  contradiction. Four open decisions left for the maintainers.

Install path corrected: the package is not on public Packagist
(repo.packagist.org 404s for rtcamp/wp-framework), so the documented
`composer require` could not resolve. README and getting-started now
show the VCS `repositories` entry and a `^1.0` constraint.

Accuracy fixes:
- architecture.md — the load-loop snippet claimed
  `array_unique( $classes )`; Loader::load() uses a `$seen` map.
- abstracts.md — the `option_page_capability_{group}` filter is
  unconditional; a lowered capability is the case where it matters, not
  the trigger. AbstractRESTController throws \LogicException, not a bare
  \Exception.
- contracts.md, architecture.md — Singleton behavior corrected to match
  the 1.0.1 fix: the re-entrancy guard and the shared subclass slot.

Coverage: a worked WP-CLI example (CLICommand was the only contract
without one); AssetLoader path safety and handle helpers; the component
and template hook tables; the Cache, FeatureSelector, and Timer APIs;
README requirements, a quick-look snippet, and the missing utilities.

Contributor workflow: CONTRIBUTING and README route to `composer lint`,
`composer analyse`, `npm run test:php` — `composer check`/`test` run
PHPUnit on the host and need a separate WordPress test suite.
AGENTS.md and .github/instructions/ gain AbstractFeature, which was
missing from the class inventory.

All relative links verified to resolve.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comment thread docs/maintainers.md
```bash
composer lint
composer analyse
npm run test:php

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test command, may need some confirmation and consolidation. If we are planning to only support the wp-env lead test setup we can just update the composer script to run this npm script.

Comment thread README.md
Comment on lines +24 to +27
- PHP 8.2+
- WordPress 6.5+
- Composer
- The OpenSSL PHP extension when using `Encryptor`

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clear dependencies, we may want to amend these, but need to keep at the top.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document WP Framework

1 participant