Skip to content

Commit c78770c

Browse files
authored
Merge pull request #87 from bufferings/work
feat: add VitePress documentation site with GitHub Pages deployment
2 parents 13f114b + b45af94 commit c78770c

38 files changed

+12451
-141
lines changed

.cursor/rules/changeset.mdc

Lines changed: 5 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
description: 'Changeset operation rules for monorepo version management'
3-
globs: []
4-
alwaysApply: true
2+
description: 'Rules for creating changeset files for version management'
3+
globs: ['**/.changeset/**']
4+
alwaysApply: false
55
---
66

77
# Changeset Operation Rules
@@ -10,30 +10,21 @@ alwaysApply: true
1010

1111
This project uses [Changesets](https://github.com/changesets/changesets) for monorepo version management and publishing. Since the AI assistant cannot interact with CLI prompts, we use a manual changeset file creation approach.
1212

13-
## Current Status
14-
15-
- **Alpha Development Mode**: Currently in `alpha` prerelease mode
16-
- **Base Version**: Starting from `0.1.0-alpha.0`
17-
- **Target**: Working towards `0.1.0` stable release
18-
1913
## Workflow
2014

2115
### 1. Making Changes
2216

2317
When code changes are made that warrant a release:
2418

25-
1. User requests: "Release [package-name] with [description]"
19+
1. User requests: "Create changeset"
2620
2. AI assistant creates changeset file manually
27-
3. AI assistant runs `pnpm changeset version`
28-
4. AI assistant commits the changes
2921

3022
### 2. Changeset File Creation
3123

32-
**Manual Creation Process:**
33-
3424
- AI creates `.changeset/[descriptive-name].md` file
3525
- Uses patch/minor/major based on change type
3626
- Includes clear description in English
27+
- Focus on difference relative to original baseline, not just current working changes
3728

3829
**Example changeset file:**
3930

@@ -45,44 +36,8 @@ When code changes are made that warrant a release:
4536
Fix header configuration bug in CORS plugin
4637
```
4738

48-
### 3. Version Bumping Rules
49-
50-
**In Alpha Mode:**
51-
52-
- **Patch changes**: `0.1.0-alpha.0` → `0.1.0-alpha.1`
53-
- **Minor changes**: `0.1.0-alpha.0` → `0.1.0-alpha.1` (same increment)
54-
- **Major changes**: `0.1.0-alpha.0` → `0.2.0-alpha.0` (only for breaking changes)
55-
56-
**Default behavior**: Use `patch` for most changes during alpha development.
57-
58-
### 4. Package Configuration
59-
60-
**Included packages:**
61-
62-
- All packages in `packages/` directory
63-
- Published to npm with `"access": "public"`
64-
65-
**Excluded packages:**
66-
67-
- `@korix/example` (configured in `ignore` array)
68-
6939
## Commands
7040

71-
### Development Commands
72-
73-
```bash
74-
# Create changeset (manual file creation by AI)
75-
# File: .changeset/[name].md
76-
77-
# Apply version changes
78-
pnpm changeset version
79-
80-
# Publish to npm (when ready)
81-
pnpm changeset publish
82-
```
83-
84-
### Mode Management
85-
8641
```bash
8742
# Enter alpha mode (already done)
8843
pnpm changeset pre enter alpha
@@ -93,91 +48,3 @@ pnpm changeset pre exit
9348
# Re-enter alpha mode
9449
pnpm changeset pre enter alpha
9550
```
96-
97-
## Release Process
98-
99-
### Alpha Releases
100-
101-
1. Make code changes
102-
2. Request release: "Release [package] with [description]"
103-
3. AI creates changeset file
104-
4. AI runs `changeset version` to bump alpha number
105-
5. AI commits changes
106-
6. Continue development
107-
108-
### Stable Release (Future)
109-
110-
1. Complete alpha testing
111-
2. Run `pnpm changeset pre exit`
112-
3. Run `pnpm changeset version` → creates `0.1.0`
113-
4. Run `pnpm changeset publish`
114-
5. Tag and release
115-
116-
## Best Practices
117-
118-
### User Requests
119-
120-
- **Simple**: "Release cors-plugin with bug fix"
121-
- **Specific**: "Release kori with breaking API changes" (major)
122-
- **Multiple**: "Release cors-plugin and kori with new features"
123-
124-
### AI Response Pattern
125-
126-
1. Create appropriate changeset file(s)
127-
2. Run `changeset version`
128-
3. Show version changes
129-
4. Commit with descriptive message
130-
5. Confirm completion
131-
132-
### Version Strategy
133-
134-
- **Alpha phase**: Focus on `patch` increments
135-
- **Breaking changes**: Only use `major` for significant API changes
136-
- **New features**: Use `minor` sparingly during alpha
137-
- **Bug fixes**: Always use `patch`
138-
139-
## Configuration Files
140-
141-
### `.changeset/config.json`
142-
143-
```json
144-
{
145-
"access": "public",
146-
"baseBranch": "main",
147-
"updateInternalDependencies": "patch",
148-
"ignore": ["@korix/example"]
149-
}
150-
```
151-
152-
### Prerelease State
153-
154-
- Stored in `.changeset/pre.json`
155-
- Tracks current alpha mode
156-
- Automatically managed by changeset commands
157-
158-
## Troubleshooting
159-
160-
### Common Issues
161-
162-
1. **Interactive prompts**: AI cannot respond - use manual file creation
163-
2. **Version conflicts**: Reset and recreate changeset files
164-
3. **Missing main branch**: Ensure `main` branch exists for base comparison
165-
166-
### Recovery Steps
167-
168-
```bash
169-
# Reset if needed
170-
git checkout -- packages/*/package.json
171-
rm packages/*/CHANGELOG.md
172-
173-
# Recreate changeset
174-
# (AI creates new changeset file)
175-
pnpm changeset version
176-
```
177-
178-
## Notes
179-
180-
- Always commit changeset files along with code changes
181-
- CHANGELOG.md files are auto-generated
182-
- Package.json versions are automatically updated
183-
- Changeset files are consumed (deleted) after version bump

.cursor/rules/docs.mdc

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
description: 'Guidelines for writing accurate, well-structured documentation'
3+
globs: ['**/docs/**/*.md', '**/README.md', '**/*.mdc']
4+
alwaysApply: false
5+
---
6+
7+
# Documentation Writing Rules
8+
9+
## Core Principle: Source Code First
10+
11+
**NEVER use guesswork or assumptions when writing documentation.**
12+
13+
### Mandatory Process
14+
15+
1. **Read the Source Code**: Always read and understand the actual implementation before writing any documentation
16+
2. **Verify Examples**: All code examples must be based on real, working code from the codebase
17+
3. **Check API Usage**: Verify method signatures, parameter types, and return values from the actual source
18+
4. **Test Assumptions**: If unsure about any behavior, examine the code rather than guessing
19+
20+
### What to Read
21+
22+
- **Main API functions**: Understand how they work internally
23+
- **Type definitions**: Get accurate parameter and return types
24+
- **Example files**: Use patterns from existing examples in the codebase
25+
- **Plugin implementations**: Understand actual plugin architecture
26+
- **Test files**: See real usage patterns and edge cases
27+
28+
### Prohibited Practices
29+
30+
- ❌ Writing documentation based on common framework patterns
31+
- ❌ Assuming API behavior without checking source code
32+
- ❌ Copying examples from similar frameworks
33+
- ❌ Guessing method signatures or parameter types
34+
- ❌ Making up configuration options that don't exist
35+
36+
### Required Practices
37+
38+
- ✅ Read the actual source code before writing
39+
- ✅ Base all examples on real code from the repository
40+
- ✅ Verify all API calls against the implementation
41+
- ✅ Check type definitions for accuracy
42+
- ✅ Test examples against the actual codebase
43+
44+
### When in Doubt
45+
46+
- Read more source code
47+
- Look for existing examples in the codebase
48+
- Check test files for usage patterns
49+
- Never guess - always verify
50+
51+
## Writing Style Guidelines
52+
53+
### Clear Structure Over Bold Text
54+
55+
**Write documents that convey importance through structure, not formatting.**
56+
57+
### Mandatory Practices
58+
59+
- ✅ Use heading hierarchy (h1, h2, h3) to show importance and organization
60+
- ✅ Write complete, flowing sentences instead of bullet-pointed fragments
61+
- ✅ Let content organization and natural language convey emphasis
62+
- ✅ Use section structure to guide readers through logical progression
63+
64+
### Prohibited Practices
65+
66+
- ❌ Using bold text (**text**) to emphasize importance
67+
- ❌ Relying on formatting instead of clear writing to convey meaning
68+
- ❌ Creating bullet lists where prose would be more natural
69+
- ❌ Bold text in navigation links and call-to-action elements
70+
71+
### Writing Approach
72+
73+
- Use descriptive subheadings instead of bold keywords
74+
- Write cohesive paragraphs that flow naturally
75+
- Let the information hierarchy speak for itself
76+
- Make important points clear through placement and context, not bold formatting
77+
78+
### Exception
79+
80+
Bold text may be used sparingly for:
81+
82+
- ✅ True emphasis within technical explanations (very rare)
83+
- ✅ Highlighting critical warnings or errors
84+
85+
## Remember
86+
87+
Documentation that contains incorrect information is worse than no documentation at all. Accuracy is paramount.
88+
89+
Quality documentation guides readers through natural flow and clear structure, not visual emphasis.

.github/workflows/deploy-docs.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Deploy Docs to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'docs/**'
9+
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
concurrency:
16+
group: 'pages'
17+
cancel-in-progress: false
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 15
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: '20'
31+
32+
- name: Install pnpm
33+
uses: pnpm/action-setup@v4
34+
with:
35+
run_install: false
36+
37+
- name: Get pnpm store directory
38+
shell: bash
39+
run: |
40+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
41+
42+
- name: Setup pnpm cache
43+
uses: actions/cache@v4
44+
with:
45+
path: ${{ env.STORE_PATH }}
46+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
47+
restore-keys: |
48+
${{ runner.os }}-pnpm-store-
49+
50+
- name: Install dependencies
51+
run: pnpm install --frozen-lockfile
52+
53+
- name: Build VitePress site
54+
run: pnpm docs:build
55+
56+
- name: Upload artifact
57+
uses: actions/upload-pages-artifact@v3
58+
with:
59+
path: './docs/.vitepress/dist'
60+
61+
deploy:
62+
needs: build
63+
environment:
64+
name: github-pages
65+
url: ${{ steps.deployment.outputs.page_url }}
66+
runs-on: ubuntu-latest
67+
timeout-minutes: 15
68+
steps:
69+
- name: Deploy to GitHub Pages
70+
id: deployment
71+
uses: actions/deploy-pages@v4

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
release:
1313
name: Release
1414
runs-on: ubuntu-latest
15+
timeout-minutes: 15
1516

1617
permissions:
1718
pull-requests: write

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,7 @@ tsconfig.tsbuildinfo
3131

3232
# Turborepo
3333
.turbo/
34+
35+
# VitePress
36+
docs/.vitepress/dist
37+
docs/.vitepress/cache

0 commit comments

Comments
 (0)