Skip to content

Commit fb02666

Browse files
committed
init: Initial Release
0 parents  commit fb02666

235 files changed

Lines changed: 31639 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/ci.yml‎

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
lint:
15+
name: Lint
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: pnpm/action-setup@v4
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: 22
23+
cache: pnpm
24+
- run: pnpm install --frozen-lockfile
25+
- run: pnpm run lint
26+
27+
format:
28+
name: Format
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
- uses: pnpm/action-setup@v4
33+
- uses: actions/setup-node@v4
34+
with:
35+
node-version: 22
36+
cache: pnpm
37+
- run: pnpm install --frozen-lockfile
38+
- run: pnpm run format:check
39+
40+
typecheck:
41+
name: Typecheck (Node ${{ matrix.node-version }})
42+
runs-on: ubuntu-latest
43+
strategy:
44+
matrix:
45+
node-version: [20, 22]
46+
steps:
47+
- uses: actions/checkout@v4
48+
- uses: pnpm/action-setup@v4
49+
- uses: actions/setup-node@v4
50+
with:
51+
node-version: ${{ matrix.node-version }}
52+
cache: pnpm
53+
- run: pnpm install --frozen-lockfile
54+
- run: pnpm run typecheck
55+
56+
test:
57+
name: Test (Node ${{ matrix.node-version }})
58+
runs-on: ubuntu-latest
59+
strategy:
60+
matrix:
61+
node-version: [20, 22]
62+
steps:
63+
- uses: actions/checkout@v4
64+
- uses: pnpm/action-setup@v4
65+
- uses: actions/setup-node@v4
66+
with:
67+
node-version: ${{ matrix.node-version }}
68+
cache: pnpm
69+
- run: pnpm install --frozen-lockfile
70+
- run: pnpm test
71+
72+
build:
73+
name: Build
74+
runs-on: ubuntu-latest
75+
steps:
76+
- uses: actions/checkout@v4
77+
- uses: pnpm/action-setup@v4
78+
- uses: actions/setup-node@v4
79+
with:
80+
node-version: 22
81+
cache: pnpm
82+
- run: pnpm install --frozen-lockfile
83+
- run: pnpm run build
84+
- name: Verify dist/cli entrypoint
85+
run: |
86+
test -f dist/cli/index.js
87+
head -n1 dist/cli/index.js | grep -q '^#!/usr/bin/env node'

‎.gitignore‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
node_modules/
2+
.env
3+
.env.*
4+
!.env.example
5+
.DS_Store
6+
*.log
7+
.worktrees/
8+
dist/
9+
build/
10+
coverage/
11+
output/
12+
.next/
13+
DerivedData/
14+
.build/
15+
vendor/
16+
Pods/
17+
.vscode/
18+
*.tgz

‎.prettierrc.json‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"trailingComma": "es5",
5+
"printWidth": 100,
6+
"tabWidth": 2,
7+
"useTabs": false,
8+
"arrowParens": "always"
9+
}

‎CHANGELOG.md‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Changelog
2+
3+
All notable changes to `@iwritec0de/wpdocs` will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6+
7+
## [Unreleased]
8+
9+
## [1.0.0] — 2026-04-17
10+
11+
Initial stable release.
12+
13+
### Parsers
14+
15+
- PHP: functions, classes (methods, properties, constants, visibility), constants, file headers, PHPDoc (`@param`, `@return`, `@since`, `@deprecated`).
16+
- WordPress: `add_action` / `add_filter` / `do_action` / `apply_filters` hook detection, `register_rest_route` and `register_rest_field`, `readme.txt`, plugin/theme headers, `block.json`, `CHANGELOG.md`.
17+
- JavaScript: JSDoc extraction via Babel, `wp.hooks` / `wp.data` detection.
18+
- CSS: file-level doc blocks, custom properties (design tokens) via PostCSS.
19+
- Collection mode: multiple plugins parsed into a unified reference.
20+
21+
### Generators
22+
23+
- Static Next.js 16 site with sidebar nav, FlexSearch command-palette search, dark mode, MDX guides.
24+
- 8 built-in skins: default, dark-pro, midnight, sandstone, sunset, syntax, terminal, wordpress.
25+
- Custom skin JSON and token override support.
26+
- Reference overrides via `overrides.yaml` or `overrides.json` — user-supplied tips and code examples merged onto parsed items.
27+
- MCP reference generator (JSON) and standalone MCP HTTP server with 11 routes.
28+
29+
### CLI
30+
31+
- Commands: `generate`, `init`, `validate`, `preview`, `mcp`, `themes`, `build`.
32+
- `--json` output mode for CI integration.
33+
- `--dry-run` flag.
34+
- Ink-based interactive UI.
35+
36+
### Infrastructure
37+
38+
- Node 20 and 22 tested in CI.
39+
- 743 tests across 41 files.
40+
- TypeScript, ESLint, Prettier, tsup build.
41+
42+
[Unreleased]: https://github.com/iwritec0de/wordpress-dev-docs/compare/v1.0.0...HEAD
43+
[1.0.0]: https://github.com/iwritec0de/wordpress-dev-docs/releases/tag/v1.0.0

‎CONTRIBUTING.md‎

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Contributing to wpdocs
2+
3+
Thanks for your interest. This is a small project but contributions are welcome — bug reports, feature requests, and PRs.
4+
5+
## Getting set up
6+
7+
```bash
8+
git clone https://github.com/iwritec0de/wordpress-dev-docs.git
9+
cd wordpress-dev-docs
10+
pnpm install
11+
pnpm test
12+
```
13+
14+
Node 20 or 22 is required. The repo uses **pnpm** (pinned via `packageManager` in `package.json`). Enable it via Corepack (`corepack enable`) or install directly (`npm install -g pnpm`).
15+
16+
## Development loop
17+
18+
```bash
19+
# One-shot run — exits when the command finishes.
20+
pnpm run dev -- generate ./examples/example-plugin
21+
22+
# Same, but against the theme fixture
23+
pnpm run dev -- generate ./examples/example-theme
24+
25+
# Or the collection fixture
26+
pnpm run dev -- generate ./examples/example-plugin-suite
27+
28+
# Watch mode — reruns on src/ changes. Useful for long-lived commands
29+
# like `preview` or `mcp` while iterating on the CLI code.
30+
pnpm run dev:watch -- preview ./examples/example-plugin
31+
```
32+
33+
Generated sites are self-contained and don't use pnpm — users run whichever package manager they prefer inside the output directory. `cd` into `<target>/docs-output/` and run `npm install && npm run dev` (or `pnpm install && pnpm run dev`) to serve it in a browser.
34+
35+
## Running checks locally
36+
37+
Before pushing a PR:
38+
39+
```bash
40+
pnpm run typecheck
41+
pnpm run lint
42+
pnpm run format:check
43+
pnpm test
44+
pnpm run build
45+
```
46+
47+
CI runs the same five jobs on Node 20 and Node 22.
48+
49+
## Branching
50+
51+
- `main` is protected. All work lands on `develop` via PRs.
52+
- Feature branches: `feature/<short-description>` or `feature/<task-id>-<description>`.
53+
- Bugfixes: `bugfix/<short-description>`.
54+
55+
## Repository layout
56+
57+
```
58+
src/
59+
cli/ # Ink CLI app + commands (generate, init, validate, preview, mcp)
60+
parser/ # PHP, JS, CSS parsers + WordPress-specific extractors
61+
generator/ # Site scaffold + MCP reference builder
62+
config/ # Config schema (Zod) + loader
63+
overrides/ # User-supplied tip/code overrides loader + merge engine
64+
validator/ # Source validation rules
65+
mcp-server/ # MCP server runtime (HTTP)
66+
lib/ # Small shared helpers
67+
68+
packages/
69+
site-template/ # Next.js 16 site template + 8 built-in skins
70+
71+
examples/
72+
example-plugin/ # Single WordPress plugin fixture
73+
example-theme/ # WordPress block theme fixture
74+
example-plugin-suite/ # Plugin collection fixture
75+
```
76+
77+
## Adding a parser rule
78+
79+
1. Add the extraction logic under `src/parser/<php|js|css>/` or `src/parser/wordpress/` for WP-specific patterns.
80+
2. Add a test alongside in `__tests__/`.
81+
3. If the output needs to surface in the generated site, update `src/generator/site/nav.ts` and the relevant page under `packages/site-template/template/app/`.
82+
4. If it needs to surface in the MCP reference, update `src/generator/mcp/` and the MCP server routes in `src/mcp-server/`.
83+
84+
## Adding a skin
85+
86+
1. Create `packages/site-template/skins/<name>.json` following the shape of `default.json`.
87+
2. Add the name to `BUILT_IN_SKINS` in `src/generator/site/tokens.ts`.
88+
3. Add tests under `src/generator/site/__tests__/tokens.test.ts` for any unusual token values.
89+
90+
Skin tokens are validated against a Zod schema — `xl` radius and dark overrides are optional.
91+
92+
## Tests
93+
94+
Tests live next to their source in `__tests__/` directories, named `*.test.ts` or `*.test.tsx`. We use Vitest. Run a single file with `npx vitest run <path>`.
95+
96+
## Commit messages
97+
98+
Conventional-style prefixes are preferred but not required: `feat:`, `fix:`, `chore:`, `docs:`, `test:`, `refactor:`. Include scope when helpful: `feat(parser): …`, `fix(site-template): …`.
99+
100+
## Filing issues
101+
102+
- **Bugs:** include the command run, the expected vs actual output, and the plugin/theme structure (sanitized) that reproduces it.
103+
- **Features:** describe the use case first, not the implementation.
104+
105+
## License
106+
107+
By contributing you agree that your contributions will be licensed under the repository's [MIT license](LICENSE).

‎LICENSE‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Chris Kelley
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)