Skip to content

Commit 0dcbc3f

Browse files
committed
Restructure repo and enhance CI workflow
Moved community files (CODE_OF_CONDUCT.md, CONTRIBUTING.md, ISSUE_TEMPLATE.md, PULL_REQUEST_TEMPLATE.md) to the root directory and updated CONTRIBUTING.md with detailed guidelines. Added a comprehensive README.md. Improved .gitignore to cover more cases. Enhanced the CI workflow to support Node.js 18.x and 20.x, added caching, linting, and a release job.
1 parent cf86503 commit 0dcbc3f

File tree

9 files changed

+491
-41
lines changed

9 files changed

+491
-41
lines changed

β€Ž .gitignoreβ€Ž

Whitespace-only changes.

β€Ž.github/CONTRIBUTING.mdβ€Ž

Lines changed: 0 additions & 35 deletions
This file was deleted.

β€Ž.github/workflows/ci.ymlβ€Ž

Lines changed: 77 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,83 @@ on:
99
jobs:
1010
build:
1111
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [18.x, 20.x]
1216

1317
steps:
14-
- uses: actions/checkout@v3
15-
- uses: pnpm/action-setup@v2
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v4
1623
with:
17-
version: 8
18-
- run: pnpm install
19-
- run: pnpm build
20-
- run: pnpm test
24+
node-version: ${{ matrix.node-version }}
25+
cache: 'pnpm'
26+
27+
- name: Setup PNPM
28+
uses: pnpm/action-setup@v2
29+
with:
30+
version: 10
31+
run_install: false
32+
33+
- name: Get pnpm store directory
34+
shell: bash
35+
run: |
36+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
37+
38+
- name: Setup pnpm cache
39+
uses: actions/cache@v3
40+
with:
41+
path: ${{ env.STORE_PATH }}
42+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
43+
restore-keys: |
44+
${{ runner.os }}-pnpm-store-
45+
46+
- name: Install dependencies
47+
run: pnpm install
48+
49+
- name: Lint
50+
run: pnpm lint
51+
52+
- name: Build
53+
run: pnpm build
54+
55+
- name: Test
56+
run: pnpm test
57+
58+
release:
59+
needs: build
60+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
61+
runs-on: ubuntu-latest
62+
63+
steps:
64+
- name: Checkout repository
65+
uses: actions/checkout@v4
66+
with:
67+
fetch-depth: 0
68+
69+
- name: Setup Node.js
70+
uses: actions/setup-node@v4
71+
with:
72+
node-version: 20
73+
cache: 'pnpm'
74+
75+
- name: Setup PNPM
76+
uses: pnpm/action-setup@v2
77+
with:
78+
version: 10
79+
run_install: false
80+
81+
- name: Install dependencies
82+
run: pnpm install
83+
84+
- name: Create Release Pull Request or Publish to npm
85+
id: changesets
86+
uses: changesets/action@v1
87+
with:
88+
publish: pnpm release
89+
env:
90+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

β€Ž.gitignoreβ€Ž

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Dependencies
2+
node_modules
3+
.pnp
4+
.pnp.js
5+
6+
# Build outputs
7+
dist
8+
build
9+
.next
10+
out
11+
12+
# Environment
13+
.env
14+
.env.local
15+
.env.development.local
16+
.env.test.local
17+
.env.production.local
18+
19+
# Logs
20+
logs
21+
*.log
22+
npm-debug.log*
23+
yarn-debug.log*
24+
yarn-error.log*
25+
pnpm-debug.log*
26+
27+
# Caches
28+
.turbo
29+
.vercel
30+
.cache
31+
tsconfig.tsbuildinfo
32+
33+
# System files
34+
.DS_Store
35+
*.pem
36+
37+
# Coverage
38+
coverage
39+
.nyc_output
40+
41+
# Misc
42+
.vscode/*
43+
!.vscode/extensions.json
44+
!.vscode/settings.json
45+
.idea
File renamed without changes.

β€ŽCONTRIBUTING.mdβ€Ž

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# Contributing to Ping-Me
2+
3+
Thank you for considering contributing to Ping-Me! This document provides guidelines and instructions to help you get started.
4+
5+
## πŸš€ Getting Started
6+
7+
### Prerequisites
8+
9+
- [Node.js](https://nodejs.org/) >= 18.x
10+
- [PNPM](https://pnpm.io/) >= 10.x
11+
12+
### Setting Up the Development Environment
13+
14+
1. Fork the repository on GitHub
15+
2. Clone your fork locally:
16+
```bash
17+
git clone https://github.com/YOUR-USERNAME/ping-me.git
18+
cd ping-me
19+
```
20+
3. Install dependencies:
21+
```bash
22+
pnpm install
23+
```
24+
4. Build all packages:
25+
```bash
26+
pnpm build
27+
```
28+
5. Start the development environment:
29+
```bash
30+
pnpm dev
31+
```
32+
33+
## πŸ“¦ Monorepo Structure
34+
35+
This project uses Turborepo to manage a monorepo with multiple packages:
36+
37+
- `packages/core`: The main framework-agnostic ping logic
38+
- `packages/express`, `packages/next`, etc.: Framework-specific adapters
39+
- `packages/cli`: CLI tool
40+
- `packages/metrics-server`: Standalone metrics server
41+
- `apps/dashboard`: Next.js dashboard application
42+
- `apps/api`: Backend API services
43+
- `apps/examples`: Example applications showcasing usage
44+
45+
## πŸ› οΈ Development Workflow
46+
47+
### Common Commands
48+
49+
- `pnpm dev`: Run all packages in development mode
50+
- `pnpm build`: Build all packages
51+
- `pnpm test`: Run all tests
52+
- `pnpm lint`: Lint all code
53+
- `pnpm clean`: Clean all build outputs
54+
55+
### Package-Specific Development
56+
57+
To work on a specific package:
58+
59+
```bash
60+
# Navigate to the package
61+
cd packages/core
62+
63+
# Run development mode
64+
pnpm dev
65+
66+
# Run tests
67+
pnpm test
68+
```
69+
70+
## πŸ“ Code Style and Quality
71+
72+
We use ESLint and Prettier to maintain code quality and consistent style:
73+
74+
- ESLint enforces coding standards
75+
- Prettier formats code consistently
76+
- TypeScript provides type safety
77+
78+
Before submitting a PR, ensure your code:
79+
80+
1. Has no linting errors: `pnpm lint`
81+
2. Passes all tests: `pnpm test`
82+
3. Is formatted properly: `pnpm format`
83+
84+
## πŸ“¦ Creating a New Package
85+
86+
To create a new package in the monorepo:
87+
88+
1. Create a new directory in `packages/`:
89+
```bash
90+
mkdir -p packages/my-package/src
91+
```
92+
93+
2. Create package files:
94+
- `packages/my-package/package.json`
95+
- `packages/my-package/tsconfig.json`
96+
- `packages/my-package/src/index.ts`
97+
98+
3. Add your package to the workspace in `pnpm-workspace.yaml`
99+
100+
## πŸ§ͺ Testing
101+
102+
We value tests! Please include tests for your contributions:
103+
104+
- Unit tests for utility functions and core logic
105+
- Integration tests for adapters and server code
106+
- End-to-end tests for CLI and user flows
107+
108+
Run tests with:
109+
110+
```bash
111+
pnpm test
112+
```
113+
114+
## πŸ“„ Pull Request Process
115+
116+
1. Create a new branch from `main`: `git checkout -b feature/your-feature-name`
117+
2. Make your changes, following the code style guidelines
118+
3. Add or update tests as needed
119+
4. Update documentation to reflect any changes
120+
5. Commit your changes following [Conventional Commits](https://www.conventionalcommits.org/) specification:
121+
```
122+
feat: add new feature
123+
fix: fix bug
124+
docs: update documentation
125+
chore: update build scripts
126+
```
127+
6. Push to your fork: `git push origin feature/your-feature-name`
128+
7. Create a Pull Request against the `main` branch
129+
130+
## πŸ“Œ Versioning
131+
132+
We use [Changesets](https://github.com/changesets/changesets) to manage versions and changelog:
133+
134+
1. After making changes, run: `pnpm changeset`
135+
2. Select the packages you modified
136+
3. Choose the semver bump type (patch, minor, major)
137+
4. Write a description of your changes
138+
5. Commit the generated changeset file
139+
140+
## πŸ“š Documentation
141+
142+
Documentation is crucial for a great developer experience. When contributing:
143+
144+
- Update README.md if necessary
145+
- Add or update JSDoc comments on exported functions
146+
- Update or add examples if you've changed an API
147+
148+
## 🧩 Dependency Management
149+
150+
- Use `pnpm add <package>` to add dependencies
151+
- Reference workspace packages with `workspace:*` version
152+
153+
## πŸ™ Thank You!
154+
155+
Your contributions make Ping-Me better for everyone. We appreciate your help!
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
Β (0)