Skip to content

Commit 88d02c6

Browse files
chore(project): update documentation and release scripts
- Update PRD.md with website and release automation features - Update README.md with website local dev instructions - Update CONTRIBUTING.md with website verification step - Fix syntax error in release.cjs - Add update-web-version.js script
1 parent 90339ca commit 88d02c6

7 files changed

Lines changed: 67 additions & 7 deletions

File tree

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ Closes #123
9393
3. Add tests for new features
9494
4. Ensure all tests pass: `npm test`
9595
5. Update the README.md if needed
96-
6. Create a Pull Request with a clear description
96+
6. If modifying the website, verify changes with `npm run web`
97+
7. Create a Pull Request with a clear description
9798

9899
## Release Process
99100

PRD.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,13 @@ Growing teams often struggle to keep release processes consistent: commit messag
2828
- Detects release type from CLI args or npm context.
2929
- Runs project tests via detected package manager before releasing.
3030
- Invokes `standard-version` with additional flags (e.g., preload patch for deprecated APIs).
31+
- **[NEW]** Automatically updates website version in `web/index.html`.
3132
- **Preload Patching (`scripts/preload/fs-f-ok.cjs`)**
3233
- Hooks Node’s module loader to transparently replace deprecated `fs.F_OK` usages in `standard-version` without altering `node_modules`.
34+
- **Website & Documentation**
35+
- Professional landing page in `web/` directory.
36+
- Automated GitHub Releases generation.
37+
- Open Graph social media preview support.
3338
- **Testing**
3439
- Suite executed via `node --test` covers setup utilities, release argument parsing, and the preload patch.
3540

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,21 @@ To see what would happen without making changes:
186186
npm run release -- --dry-run
187187
```
188188

189-
## Contributing
189+
## Website
190+
191+
The project includes a professional landing page in the `web/` directory.
192+
193+
### Local Development
194+
195+
To run the website locally:
196+
197+
```bash
198+
npm run web
199+
```
200+
201+
This will serve the website at `http://localhost:3000`.
202+
203+
## Contributing
190204

191205
Contributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.
192206

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
"release": "node scripts/release.cjs",
1313
"release:major": "node scripts/release.cjs major",
1414
"release:minor": "node scripts/release.cjs minor",
15-
"release:patch": "node scripts/release.cjs patch"
15+
"release:patch": "node scripts/release.cjs patch",
16+
"web": "npx serve web",
17+
"update:web": "node scripts/update-web-version.js"
1618
},
1719
"keywords": [
1820
"commit",
@@ -91,4 +93,4 @@
9193
"husky": "^9.1.7",
9294
"standard-version": "^9.5.0"
9395
}
94-
}
96+
}

scripts/release.cjs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,21 @@ function runRelease({
188188
}
189189
}
190190

191+
// Update website version
192+
try {
193+
console.log('🌐 Updating website version...');
194+
const updateWebResult = spawnSync('npm', ['run', 'update:web'], { stdio: 'inherit', cwd });
195+
if (updateWebResult.status === 0) {
196+
spawnSync('git', ['add', 'web/index.html'], { stdio: 'inherit', cwd });
197+
} else {
198+
console.warn('⚠️ Failed to update website version');
199+
}
200+
} catch (error) {
201+
console.warn(`⚠️ Skipping website version update: ${error.message}`);
202+
}
203+
191204
return releaseResult;
192205
}
193-
194206
if (require.main === module) {
195207
try {
196208
const result = runRelease();

scripts/update-web-version.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
4+
// Get current version from package.json
5+
const packageJson = require('../package.json');
6+
const version = packageJson.version;
7+
8+
const indexPath = path.join(__dirname, '../web/index.html');
9+
let content = fs.readFileSync(indexPath, 'utf8');
10+
11+
// Update version in the badge
12+
// Matches: <span>v1.1.9 - Latest Release</span>
13+
content = content.replace(
14+
/<span>v\d+\.\d+\.\d+ - Latest Release<\/span>/,
15+
`<span>v${version} - Latest Release</span>`
16+
);
17+
18+
// Update version in the stats
19+
// Matches: <div class="stat-value">1.1.9</div>
20+
content = content.replace(
21+
/<div class="stat-value">\d+\.\d+\.\d+<\/div>(\s*<div class="stat-label">Latest Version<\/div>)/,
22+
`<div class="stat-value">${version}</div>$1`
23+
);
24+
25+
fs.writeFileSync(indexPath, content);
26+
console.log(`✅ Updated website to version ${version}`);

web/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
<div class="hero-content">
6767
<div class="hero-badge">
6868
<span class="badge-dot"></span>
69-
<span>v1.1.9 - Latest Release</span>
69+
<span>v1.1.11 - Latest Release</span>
7070
</div>
7171
<h1 class="hero-title">
7272
Ship Releases with <span class="gradient-text">Confidence</span>
@@ -90,7 +90,7 @@ <h1 class="hero-title">
9090
</div>
9191
<div class="hero-stats">
9292
<div class="stat-item">
93-
<div class="stat-value">1.1.9</div>
93+
<div class="stat-value">1.1.11</div>
9494
<div class="stat-label">Latest Version</div>
9595
</div>
9696
<div class="stat-item">

0 commit comments

Comments
 (0)