docs: overhaul consumer and maintainer documentation - #95
Conversation
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>
| ```bash | ||
| composer lint | ||
| composer analyse | ||
| npm run test:php |
There was a problem hiding this comment.
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.
| - PHP 8.2+ | ||
| - WordPress 6.5+ | ||
| - Composer | ||
| - The OpenSSL PHP extension when using `Encryptor` |
There was a problem hiding this comment.
Clear dependencies, we may want to amend these, but need to keep at the top.
DocumentationURL: https://opensource.rtcamp.com/wp-framework/ SummaryAdds a Docusaurus documentation site and a GitHub Actions workflow to build and deploy it to GitHub Pages. Markdown stays in The implementation is self-contained and does not depend on the shared workflow being developed in Build and deploymentThe publishing workflow:
GitHub Pages serves the generated HTML, CSS, and JavaScript. No application server is required, and generated files are not committed to Git. The earlier Workflow triggers
Failed configuration runs and configuration PRs do not trigger production deployment. Production runs share a concurrency group to cancel superseded runs; PR validation runs are separate. Documentation behavior
Site URL and asset pathsDocusaurus derives its After changing the Pages domain or path, re-run all jobs on the publishing workflow to rebuild with the updated configuration. An empty commit will not trigger the workflow because its push trigger filters for changes to Local developmentRequires Node.js 22+. Create a separate configuration checkout beside the framework checkout: git clone --single-branch --branch docs-config \
https://github.com/rtCamp/wp-framework.git \
../wp-framework-docs-configFrom the framework checkout: export DOCS_SOURCE="$PWD"
export DOCS_SOURCE_REF="gh/92-documentation"
cd ../wp-framework-docs-config
npm ci
npm test
npm start -- --host 127.0.0.1 --no-openOpen To build and preview production output: npm run build
npm run serve -- --host 127.0.0.1 --no-openUse an HTTP server to preview downloaded artifacts; opening Permissions and dependencies
Before mergingThe deployment branch is temporarily configured for testing.
Deployments from the temporary branch update the existing live Pages site, not a separate preview URL. Validation
|
|
The need for a separate branch to keep the Docusaurus configs away from the main repository. This is an implementation of a concept, the Docusaurus config and the site build can be moved out to a shared GitHub workflow. And then we can use the same workflow for all repositories where we need the similar documentation. Shared workflow, config would allow us to set the same design / feature parity for the documentation. Cc: @aryanjasala |
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
Singleton,Loader,AbstractRESTController, andAbstractSettingsPagebehavior to match the implementation.composer checkworkflow with the actual PHPCS, PHPStan, and wp-env test commands.How I verified
The branch changes documentation and instruction files only; no
inc/runtime file is modified.Acceptance criteria
Runtime behavior
Code quality
Housekeeping
CHANGELOG.mdentry added under## [Unreleased].Reviewer notes
inc/Contracts/as the explicitly documented contract surface while treating removal of a public class or method as a major consumer impact.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.