Skip to content

Commit e6c6bdb

Browse files
feat: setup CI/CD and organize documentation
- Add GitHub Actions workflow for automated testing and npm publishing - Configure semantic-release for automatic version bumping and releases - Organize all documentation into docs/ folder structure: * Move development docs to docs/development/ (CI/CD, release config) * Move contributing guides to docs/contributing/ (testing, benchmarks, examples) * Create comprehensive documentation index and organization guide - Add release checklist and configuration guides - Update .npmignore to exclude docs from npm package - Fix documentation references and links This enables automated releases on merge to main branch with semantic versioning.
1 parent 10e2f0d commit e6c6bdb

18 files changed

+698
-6
lines changed

.github/workflows/publish.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Publish to npm
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
test:
10+
name: Run Tests
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [18.x, 20.x]
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
cache: 'npm'
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Run tests
31+
run: npm test
32+
33+
release:
34+
name: Release and Publish
35+
needs: test
36+
runs-on: ubuntu-latest
37+
if: github.ref == 'refs/heads/main'
38+
39+
steps:
40+
- name: Checkout code
41+
uses: actions/checkout@v4
42+
with:
43+
fetch-depth: 0
44+
45+
- name: Setup Node.js
46+
uses: actions/setup-node@v4
47+
with:
48+
node-version: '20.x'
49+
registry-url: 'https://registry.npmjs.org'
50+
cache: 'npm'
51+
52+
- name: Install dependencies
53+
run: npm ci
54+
55+
- name: Run tests
56+
run: npm test
57+
58+
- name: Release
59+
run: npm run release
60+
env:
61+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+

.npmignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ README_SCREENSHOTS.md
2222
*.md
2323

2424
# Development documentation
25+
docs/
2526
API_CHANGES.md
2627
COMMIT_MESSAGE.md
2728
MITIGATION_PLAN.md
@@ -30,10 +31,6 @@ ARCHITECTURE.md
3031
PERFORMANCE.md
3132
SECURITY.md
3233
LIMITATIONS.md
33-
test/README.md
34-
scripts/README.md
35-
examples/README.md
36-
examples/DASHBOARD_SECURITY.md
3734

3835
# Demo files
3936
test/manual-demo.js

.releaserc-always-bump.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"branches": [
3+
"main"
4+
],
5+
"plugins": [
6+
[
7+
"@semantic-release/commit-analyzer",
8+
{
9+
"preset": "angular",
10+
"releaseRules": [
11+
{ "type": "feat", "release": "minor" },
12+
{ "type": "fix", "release": "patch" },
13+
{ "type": "perf", "release": "patch" },
14+
{ "type": "revert", "release": "patch" },
15+
{ "breaking": true, "release": "major" },
16+
{ "type": "docs", "release": false },
17+
{ "type": "style", "release": false },
18+
{ "type": "chore", "release": false },
19+
{ "type": "refactor", "release": false },
20+
{ "type": "test", "release": false },
21+
{ "type": "build", "release": false },
22+
{ "type": "ci", "release": false },
23+
{ "release": "patch" }
24+
]
25+
}
26+
],
27+
"@semantic-release/release-notes-generator",
28+
"@semantic-release/changelog",
29+
"@semantic-release/npm",
30+
[
31+
"@semantic-release/git",
32+
{
33+
"assets": ["package.json", "CHANGELOG.md"],
34+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
35+
}
36+
],
37+
"@semantic-release/github"
38+
]
39+
}
40+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"branches": [
3+
"main"
4+
],
5+
"plugins": [
6+
"@semantic-release/commit-analyzer",
7+
"@semantic-release/release-notes-generator",
8+
"@semantic-release/changelog",
9+
"@semantic-release/npm",
10+
[
11+
"@semantic-release/git",
12+
{
13+
"assets": ["package.json", "CHANGELOG.md"],
14+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
15+
}
16+
],
17+
"@semantic-release/github"
18+
]
19+
}
20+

.releaserc.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"branches": [
3+
"main"
4+
],
5+
"plugins": [
6+
[
7+
"@semantic-release/commit-analyzer",
8+
{
9+
"preset": "angular",
10+
"releaseRules": [
11+
{ "type": "feat", "release": "minor" },
12+
{ "type": "fix", "release": "patch" },
13+
{ "type": "perf", "release": "patch" },
14+
{ "type": "revert", "release": "patch" },
15+
{ "breaking": true, "release": "major" },
16+
{ "type": "docs", "release": false },
17+
{ "type": "style", "release": false },
18+
{ "type": "chore", "release": false },
19+
{ "type": "refactor", "release": false },
20+
{ "type": "test", "release": false },
21+
{ "type": "build", "release": false },
22+
{ "type": "ci", "release": false },
23+
{ "release": "patch" }
24+
]
25+
}
26+
],
27+
"@semantic-release/release-notes-generator",
28+
"@semantic-release/changelog",
29+
"@semantic-release/npm",
30+
[
31+
"@semantic-release/git",
32+
{
33+
"assets": ["package.json", "CHANGELOG.md"],
34+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
35+
}
36+
],
37+
"@semantic-release/github"
38+
]
39+
}
40+

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ app.get('/users/:id', async (req, res) => {
135135

136136
**Key Insight:** Crashless is **~2.2× faster** than express-async-errors with full observability.
137137

138-
[Run benchmarks yourself →](benchmark/README.md)
138+
[Run benchmarks yourself →](docs/contributing/BENCHMARKS.md)
139139

140140
---
141141

benchmark/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ echo ""
4646
echo "✅ Benchmark complete!"
4747
echo "📄 Results saved to: benchmark/results.json"
4848
echo ""
49-
echo "💡 Tip: Check benchmark/README.md for interpretation guide"
49+
echo "💡 Tip: Check docs/contributing/BENCHMARKS.md for interpretation guide"
5050

docs/ORGANIZATION.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Documentation Organization
2+
3+
This document describes how documentation is organized in the Crashless project.
4+
5+
## Structure
6+
7+
```
8+
docs/
9+
├── README.md # Main documentation index
10+
├── API_CHANGES.md # API version history
11+
├── ARCHITECTURE.md # System architecture
12+
├── LIMITATIONS.md # Known limitations
13+
├── PERFORMANCE.md # Performance guide
14+
├── SECURITY.md # Security documentation
15+
16+
├── development/ # Development & release docs
17+
│ ├── CI_CD.md # CI/CD workflow setup
18+
│ ├── RELEASE_CONFIG.md # Semantic-release configuration
19+
│ └── RELEASE_CHECKLIST.md # Pre-release checklist
20+
21+
└── contributing/ # Contributing guides
22+
├── BENCHMARKS.md # Benchmarking guide
23+
├── DASHBOARD_SECURITY.md # Dashboard security examples
24+
├── EXAMPLES.md # Example usage guide
25+
└── TESTING.md # Testing guide
26+
```
27+
28+
## Documentation Types
29+
30+
### Core Documentation
31+
Located in `docs/` root:
32+
- **API_CHANGES.md** - API versioning and migration guides
33+
- **ARCHITECTURE.md** - System design and architecture decisions
34+
- **LIMITATIONS.md** - Known limitations and workarounds
35+
- **PERFORMANCE.md** - Performance characteristics and optimization
36+
- **SECURITY.md** - Security features and best practices
37+
38+
### Development Documentation
39+
Located in `docs/development/`:
40+
- **CI_CD.md** - GitHub Actions workflow, npm publishing setup
41+
- **RELEASE_CONFIG.md** - Semantic-release configuration guide
42+
- **RELEASE_CHECKLIST.md** - Pre-release verification checklist
43+
44+
### Contributing Documentation
45+
Located in `docs/contributing/`:
46+
- **BENCHMARKS.md** - How to run and interpret benchmarks
47+
- **DASHBOARD_SECURITY.md** - Dashboard security examples and best practices
48+
- **EXAMPLES.md** - Example usage and configurations
49+
- **TESTING.md** - How to run and write tests
50+
51+
## Migration Notes
52+
53+
All documentation has been moved from various locations to the `docs/` folder:
54+
55+
- `.github/README.md``docs/development/CI_CD.md`
56+
- `.releaserc-README.md``docs/development/RELEASE_CONFIG.md`
57+
- `test/README.md``docs/contributing/TESTING.md`
58+
- `benchmark/README.md``docs/contributing/BENCHMARKS.md`
59+
- `examples/README.md``docs/contributing/EXAMPLES.md`
60+
- `examples/DASHBOARD_SECURITY.md``docs/contributing/DASHBOARD_SECURITY.md`
61+
62+
## Accessing Documentation
63+
64+
- **Main Index**: [docs/README.md](README.md)
65+
- **External Docs**: [Documentation Site](https://sunnyghodeswar.github.io/crashless/)
66+
- **Root README**: [../README.md](../README.md) - Quick start and overview
67+
68+
## NPM Package
69+
70+
Documentation files are excluded from the npm package via `.npmignore`. Only source code (`src/`), type definitions (`index.d.ts`), and license (`LICENSE`) are published.
71+

docs/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Crashless Documentation
2+
3+
Complete documentation for the Crashless observability middleware.
4+
5+
## 📚 Documentation Index
6+
7+
### Core Documentation
8+
9+
- **[API Changes](API_CHANGES.md)** - API version history and migration guides
10+
- **[Architecture](ARCHITECTURE.md)** - System architecture and design decisions
11+
- **[Performance](PERFORMANCE.md)** - Performance characteristics and optimization
12+
- **[Security](SECURITY.md)** - Security features and best practices
13+
- **[Limitations](LIMITATIONS.md)** - Known limitations and workarounds
14+
15+
### Development & Release
16+
17+
- **[CI/CD Setup](development/CI_CD.md)** - GitHub Actions workflow and npm publishing
18+
- **[Release Configuration](development/RELEASE_CONFIG.md)** - Semantic release setup and versioning
19+
- **[Release Checklist](development/RELEASE_CHECKLIST.md)** - Pre-release verification checklist
20+
21+
### Contributing
22+
23+
- **[Testing Guide](contributing/TESTING.md)** - How to run and write tests
24+
- **[Benchmarks](contributing/BENCHMARKS.md)** - Performance benchmarking guide
25+
- **[Examples](contributing/EXAMPLES.md)** - Example usage and configurations
26+
- **[Dashboard Security](contributing/DASHBOARD_SECURITY.md)** - Securing dashboard access
27+
28+
## 🚀 Quick Links
29+
30+
- [Getting Started](https://sunnyghodeswar.github.io/crashless/getting-started) - Installation guide
31+
- [API Reference](https://sunnyghodeswar.github.io/crashless/api-reference) - Complete API docs
32+
- [Configuration Guide](https://sunnyghodeswar.github.io/crashless/configuration) - All options
33+
- [Examples](https://sunnyghodeswar.github.io/crashless/examples) - Common use cases
34+
35+
## 📖 External Documentation
36+
37+
- **[Full Documentation Site](https://sunnyghodeswar.github.io/crashless/)** - Complete interactive documentation
38+
- **[npm Package](https://www.npmjs.com/package/crashless)** - Package page
39+
- **[GitHub Repository](https://github.com/sunnyghodeswar/crashless)** - Source code
40+
File renamed without changes.

0 commit comments

Comments
 (0)