Skip to content

Commit d0c8488

Browse files
committed
Merge branch 'Ku-Tadao-main' into experimental
2 parents 7a2d581 + cdd1468 commit d0c8488

40 files changed

Lines changed: 2930 additions & 26 deletions
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Generate Wiki
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'src/**'
8+
- 'docs/**'
9+
- 'scripts/generate-wiki.mjs'
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
generate-wiki:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '20'
26+
27+
- name: Setup pnpm
28+
uses: pnpm/action-setup@v4
29+
with:
30+
version: 9
31+
32+
- name: Install dependencies
33+
run: pnpm install --frozen-lockfile
34+
35+
- name: Generate wiki pages
36+
run: node scripts/generate-wiki.mjs
37+
38+
- name: Push to wiki
39+
env:
40+
# Uses the built-in GITHUB_TOKEN.
41+
# If this fails with a 403, create a Personal Access Token (PAT) with
42+
# 'repo' scope, add it as a repository secret named WIKI_TOKEN, and
43+
# replace ${{ github.token }} with ${{ secrets.WIKI_TOKEN }} below.
44+
GH_TOKEN: ${{ github.token }}
45+
run: |
46+
# Configure git
47+
git config --global user.name "github-actions[bot]"
48+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
49+
50+
# Clone the wiki repo
51+
WIKI_URL="https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.wiki.git"
52+
WIKI_DIR_TMP=$(mktemp -d)
53+
54+
# Try cloning existing wiki; if it fails, initialize a new one
55+
if git clone "$WIKI_URL" "$WIKI_DIR_TMP" 2>/dev/null; then
56+
echo "Cloned existing wiki"
57+
else
58+
echo "No existing wiki found, initializing new one"
59+
cd "$WIKI_DIR_TMP"
60+
git init
61+
git remote add origin "$WIKI_URL"
62+
cd -
63+
fi
64+
65+
# Copy generated wiki pages (overwrite existing auto-generated ones)
66+
cp wiki/*.md "$WIKI_DIR_TMP/"
67+
68+
# Commit and push
69+
cd "$WIKI_DIR_TMP"
70+
git add -A
71+
if git diff --cached --quiet; then
72+
echo "No wiki changes to commit"
73+
else
74+
git commit -m "docs: auto-update wiki from ${GITHUB_SHA::7}"
75+
git push origin HEAD:master || git push origin HEAD:main
76+
echo "Wiki updated successfully"
77+
fi

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
.git/
22
dist/
33
node_modules/
4+
wiki/
45
src/elaina-theme-data/
6+
package-lock.json
57
ElainaV4-typescript.code-workspace
68
TODO-List

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged

.husky/pre-push

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pnpm run lint
2+
pnpm run wiki:check

.lintstagedrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"src/**/*.{ts,js}": ["eslint"]
3+
}

docs/DOCUMENTATION-STANDARD.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Documentation Standard
2+
3+
This project auto-generates wiki pages from source code JSDoc comments. Follow these standards to ensure proper wiki generation.
4+
5+
## Plugin Classes
6+
7+
Add a JSDoc block **directly above** every exported class in `src/src/plugins/`:
8+
9+
```typescript
10+
/**
11+
* @wiki Automatically accepts the matchmaking queue when a game is found.
12+
* @author Lyfhael
13+
* @modifier Elaina Da Catto
14+
* @usage
15+
* 1. Open League Client settings
16+
* 2. Navigate to **Elaina Theme** → **Plugin Settings**
17+
* 3. Toggle **Auto Accept** to enabled
18+
* @settings auto_accept, auto_accept_button
19+
*/
20+
export class AutoAccept {
21+
```
22+
23+
### Required Tags (enforced by ESLint)
24+
25+
| Tag | Purpose | Example |
26+
|-----|---------|---------|
27+
| `@wiki` | User-facing feature description (displayed in wiki) | `@wiki Adds a dodge button in champion select` |
28+
29+
### Recommended Tags
30+
31+
| Tag | Purpose | Example |
32+
|-----|---------|---------|
33+
| `@author` | Original author | `@author Elaina Da Catto` |
34+
| `@modifier` | Who modified the original code | `@modifier Elaina Da Catto` |
35+
| `@usage` | Step-by-step instructions for end users | See example above |
36+
| `@settings` | Comma-separated DataStore keys this plugin uses | `@settings dodge-button, auto_accept` |
37+
38+
### Notes
39+
40+
- Use `@wiki` instead of `@description` for user-facing text. `@description` is also supported but `@wiki` takes priority.
41+
- The `@usage` tag supports Markdown formatting.
42+
- The wiki generator also detects `ElainaData.get("key")` / `ElainaData.set("key")` calls to automatically find which settings a plugin uses.
43+
44+
## Settings Documentation
45+
46+
Settings descriptions live in `docs/settings-meta.json`. When you add a new setting to `datastoreDefault.js`:
47+
48+
1. Add the key to `docs/settings-meta.json` with a `category`, `description`, and `type`.
49+
2. The wiki generator will warn about any missing settings.
50+
51+
Example entry:
52+
```json
53+
{
54+
"auto_accept": {
55+
"category": "plugins",
56+
"description": "Automatically accept matchmaking queue when a game is found.",
57+
"type": "boolean"
58+
}
59+
}
60+
```
61+
62+
### Categories
63+
64+
| Key | Name | Used for |
65+
|-----|------|----------|
66+
| `theme-core` | Core Theme | Basic theme behavior, version |
67+
| `wallpaper-audio` | Wallpaper & Audio | Backgrounds, audio playback |
68+
| `theme-visual` | Visual Customization | Fonts, UI tweaks, colors |
69+
| `custom-assets` | Custom Assets | Icons, banners, avatars |
70+
| `plugins` | Plugin Settings | Per-plugin configuration |
71+
| `tft` | TFT Settings | TFT-specific toggles |
72+
| `backup` | Backup & Restore | Cloud backup settings |
73+
| `deprecated` | Deprecated | Unused settings |
74+
75+
New categories can be added to the `categories` object in `settings-meta.json`.
76+
77+
## ESLint Enforcement
78+
79+
The ESLint config (`eslint.config.js`) enforces documentation rules:
80+
81+
- **Current level**: `warn` — shows warnings but doesn't block commits
82+
- **To enforce strictly**: Change `warn``error` in `eslint.config.js` for `jsdoc/require-jsdoc` and `jsdoc/require-description`
83+
84+
## Git Hooks
85+
86+
- **Pre-commit**: Runs ESLint on staged files via `lint-staged`
87+
- **Pre-push**: Runs full lint + wiki validation (`--check` mode)
88+
89+
## Wiki Generation
90+
91+
```bash
92+
# Generate wiki locally
93+
pnpm run wiki:generate
94+
95+
# Check documentation coverage (no file writes)
96+
pnpm run wiki:check
97+
```
98+
99+
The GitHub Action (`.github/workflows/generate-wiki.yml`) runs on push to `main` and auto-publishes to the repo wiki.

0 commit comments

Comments
 (0)