Skip to content

Commit a8f5738

Browse files
committed
Use npm in CI & tidy README formatting
Switch CI from pnpm to npm: remove pnpm setup and store/cache steps, set workflow cache to npm, and replace pnpm install/build commands with npm ci and npm run build:static. Update README: change NEXT_PUBLIC_SITE_URL to http://localhost:3000, normalize string quoting and comma/array formatting in examples, and apply whitespace and minor documentation cleanups for improved consistency and readability.
1 parent a1f7849 commit a8f5738

File tree

2 files changed

+53
-48
lines changed

2 files changed

+53
-48
lines changed

.github/workflows/deploy.yml

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,18 @@ jobs:
2727
uses: actions/setup-node@v4
2828
with:
2929
node-version: "18"
30-
31-
- name: Setup pnpm
32-
uses: pnpm/action-setup@v2
33-
with:
34-
version: latest
35-
36-
- name: Get pnpm store directory
37-
shell: bash
38-
run: |
39-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
40-
41-
- name: Setup pnpm cache
42-
uses: actions/cache@v3
43-
with:
44-
path: ${{ env.STORE_PATH }}
45-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
46-
restore-keys: |
47-
${{ runner.os }}-pnpm-store-
30+
cache: "npm"
4831

4932
- name: Install dependencies
50-
run: pnpm install --frozen-lockfile
33+
run: npm ci
5134

5235
- name: Setup Pages
5336
uses: actions/configure-pages@v4
5437
with:
5538
static_site_generator: next
5639

5740
- name: Build with Next.js
58-
run: pnpm run build:static
41+
run: npm run build:static
5942
env:
6043
GITHUB_TOKEN: ${{ secrets.TOKEN }}
6144
NEXT_PUBLIC_SITE_URL: ${{ vars.NEXT_PUBLIC_SITE_URL || 'https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}' }}

README.md

Lines changed: 50 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Create a `.env.local` file in the root directory:
4040

4141
```env
4242
GITHUB_TOKEN=your_github_personal_access_token_here
43-
NEXT_PUBLIC_SITE_URL=http://localhost:3001
43+
NEXT_PUBLIC_SITE_URL=http://localhost:3000
4444
```
4545

4646
#### Getting a GitHub Token
@@ -118,32 +118,32 @@ Edit [`lib/config.ts`](lib/config.ts) and add your plugin to the `plugins` array
118118
export const config: Config = {
119119
plugins: [
120120
{
121-
id: 'your-plugin-slug',
122-
title: 'Your Plugin Name',
123-
description: 'Brief description of what your plugin does',
124-
repo: 'your-github-username/your-repo-name',
125-
latestVersion: '3.x',
121+
id: "your-plugin-slug",
122+
title: "Your Plugin Name",
123+
description: "Brief description of what your plugin does",
124+
repo: "your-github-username/your-repo-name",
125+
latestVersion: "3.x",
126126
versions: [
127127
{
128-
version: '1.x',
129-
github_branch: '1.x',
128+
version: "1.x",
129+
github_branch: "1.x",
130130
limited_files: [
131-
{ name: 'README.md', title: 'Overview', slug: 'overview' }
132-
]
131+
{ name: "README.md", title: "Overview", slug: "overview" },
132+
],
133133
},
134134
{
135-
version: '2.x',
136-
github_branch: '2.x',
135+
version: "2.x",
136+
github_branch: "2.x",
137137
limited_files: [
138-
{ name: 'README.md', title: 'Overview', slug: 'overview' }
139-
]
138+
{ name: "README.md", title: "Overview", slug: "overview" },
139+
],
140140
},
141141
{
142-
version: '3.x',
143-
github_branch: '3.x',
142+
version: "3.x",
143+
github_branch: "3.x",
144144
limited_files: [
145-
{ name: 'README.md', title: 'Overview', slug: 'overview' }
146-
]
145+
{ name: "README.md", title: "Overview", slug: "overview" },
146+
],
147147
},
148148
],
149149
},
@@ -179,16 +179,16 @@ Products are external links shown alongside plugins on the homepage:
179179
```typescript
180180
products: [
181181
{
182-
id: 'your-product-id',
183-
title: 'Your Product Name',
184-
description: 'What your product does',
185-
link: 'https://yourproduct.com',
182+
id: "your-product-id",
183+
title: "Your Product Name",
184+
description: "What your product does",
185+
link: "https://yourproduct.com",
186186
badge: {
187-
text: 'External',
188-
color: 'green'
187+
text: "External",
188+
color: "green",
189189
},
190190
},
191-
]
191+
];
192192
```
193193

194194
### Advanced: Complex Documentation Structure
@@ -233,6 +233,7 @@ For plugins with multiple documentation files organized in folders:
233233
### Initial Setup
234234

235235
1. **Push your code to GitHub**:
236+
236237
```bash
237238
git add .
238239
git commit -m "Initial commit"
@@ -259,6 +260,7 @@ For plugins with multiple documentation files organized in folders:
259260
### Automatic Deployment
260261

261262
The GitHub Actions workflow automatically:
263+
262264
- ✅ Triggers on every push to `main` branch
263265
- ✅ Fetches latest documentation from configured repos
264266
- ✅ Builds the static site
@@ -267,13 +269,15 @@ The GitHub Actions workflow automatically:
267269
### Manual Deployment
268270

269271
You can also trigger deployment manually:
272+
270273
1. Go to Actions tab in your repository
271274
2. Select "Deploy to GitHub Pages" workflow
272275
3. Click "Run workflow"
273276

274277
### Rebuild Documentation
275278

276279
To rebuild docs without code changes:
280+
277281
```bash
278282
# Locally trigger a repository dispatch event
279283
curl -X POST \
@@ -312,11 +316,13 @@ npm run start # Serve the production build locally
312316
#### "No documentation found"
313317

314318
**Causes**:
319+
315320
- README.md doesn't exist in the specified GitHub repository/branch
316321
- GitHub token lacks proper permissions
317322
- Branch name doesn't match configuration
318323

319324
**Solutions**:
325+
320326
1. Verify the file exists: `https://github.com/[owner]/[repo]/blob/[branch]/README.md`
321327
2. Check your GitHub token has access to the repository
322328
3. Ensure `github_branch` in `lib/config.ts` matches the actual branch name
@@ -327,37 +333,41 @@ npm run start # Serve the production build locally
327333
**Cause**: GitHub API rate limiting (60 requests/hour without token, 5000 with token)
328334

329335
**Solutions**:
336+
330337
1. Add a GitHub token to `.env.local`
331338
2. Use cached documentation: `npm run build:cache`
332339
3. Wait for the rate limit to reset (check headers in error)
333340

334341
#### Build fails with "Cannot find module"
335342

336343
**Solutions**:
344+
337345
1. Delete `node_modules` and reinstall: `rm -rf node_modules && npm install`
338346
2. Clear Next.js cache: `rm -rf .next`
339347
3. Ensure all dependencies are installed: `npm install`
340348

341349
#### Images not loading
342350

343351
**Causes**:
352+
344353
- Images not in `public/images/` directory
345354
- Incorrect image paths in markdown
346355
- Base path not configured correctly
347356

348357
**Solutions**:
358+
349359
1. Ensure images are in `public/images/[plugin-name]/`
350360
2. Use relative paths in markdown: `![alt](./image.png)`
351361
3. Check `basePath` configuration in `next.config.mjs`
352362

353363
#### GitHub Actions deployment fails
354364

355365
**Common issues**:
356-
1. **Permissions error**:
366+
367+
1. **Permissions error**:
357368
- Go to Settings → Actions → General
358369
- Scroll to "Workflow permissions"
359370
- Select "Read and write permissions"
360-
361371
2. **Pages not enabled**:
362372
- Go to Settings → Pages
363373
- Set source to "GitHub Actions"
@@ -370,6 +380,7 @@ npm run start # Serve the production build locally
370380
#### Cache issues during development
371381

372382
**Solutions**:
383+
373384
```bash
374385
# Clear all caches
375386
rm -rf .next .cache node_modules/.cache
@@ -381,6 +392,7 @@ npm run build
381392
### Debug Mode
382393

383394
Enable verbose logging by checking:
395+
384396
1. Browser console for client-side errors
385397
2. Terminal output for build-time errors
386398
3. `.cache/` directory for fetched files
@@ -397,6 +409,7 @@ Enable verbose logging by checking:
397409
### Styling and Branding
398410

399411
**Update site colors** in [`app/global.css`](app/global.css):
412+
400413
```css
401414
:root {
402415
--primary: 220 90% 56%;
@@ -406,10 +419,11 @@ Enable verbose logging by checking:
406419
```
407420

408421
**Update navigation** in [`lib/layout.shared.tsx`](lib/layout.shared.tsx):
422+
409423
```typescript
410424
export const baseOptions: HomeLayoutProps = {
411425
nav: {
412-
title: 'Your Site Name',
426+
title: "Your Site Name",
413427
},
414428
links: [
415429
// Add custom navigation links
@@ -418,6 +432,7 @@ export const baseOptions: HomeLayoutProps = {
418432
```
419433

420434
**Customize MDX components** in [`mdx-components.tsx`](mdx-components.tsx):
435+
421436
```typescript
422437
export function useMDXComponents(components: MDXComponents): MDXComponents {
423438
return {
@@ -448,17 +463,23 @@ This project is open source. Please check the repository for license details.
448463
---
449464

450465
Built with ❤️ using [Next.js](https://nextjs.org/) and [Fumadocs](https://fumadocs.dev)
466+
451467
# Development server
468+
452469
npm run dev
453470

454471
# Type checking
472+
455473
npm run types:check
456474

457475
# Build for production
476+
458477
npm run build
459478

460479
# Preview production build
480+
461481
npm run start
482+
462483
```
463484
464485
## Contributing
@@ -471,3 +492,4 @@ npm run start
471492
## License
472493
473494
[Add your license here]
495+
```

0 commit comments

Comments
 (0)