Skip to content

Commit 6308242

Browse files
committed
feat: initial monorepo setup with typescript, turbo, and biome
0 parents  commit 6308242

27 files changed

+1069
-0
lines changed

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [18.x, 20.x]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Setup pnpm
21+
uses: pnpm/action-setup@v3
22+
with:
23+
version: 8
24+
25+
- name: Use Node.js ${{ matrix.node-version }}
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
cache: 'pnpm'
30+
31+
- name: Install dependencies
32+
run: pnpm install
33+
34+
- name: Lint
35+
run: pnpm lint
36+
37+
- name: Type check
38+
run: pnpm typecheck
39+
40+
- name: Test
41+
run: pnpm test
42+
43+
- name: Build
44+
run: pnpm build

.github/workflows/release.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
inputs:
9+
force_publish:
10+
description: 'Force publish all packages'
11+
type: boolean
12+
default: false
13+
14+
concurrency: ${{ github.workflow }}-${{ github.ref }}
15+
16+
jobs:
17+
build-test:
18+
name: Build and Test
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout Repo
22+
uses: actions/checkout@v4
23+
24+
- name: Setup pnpm
25+
uses: pnpm/action-setup@v3
26+
with:
27+
version: 8
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: 20
33+
cache: 'pnpm'
34+
registry-url: 'https://registry.npmjs.org'
35+
36+
- name: Install Dependencies
37+
run: pnpm install
38+
39+
- name: Lint
40+
run: pnpm lint
41+
42+
- name: Type Check
43+
run: pnpm typecheck
44+
45+
- name: Test
46+
run: pnpm test
47+
48+
- name: Build
49+
run: pnpm build
50+
51+
release:
52+
name: Release
53+
needs: build-test
54+
runs-on: ubuntu-latest
55+
steps:
56+
- name: Checkout Repo
57+
uses: actions/checkout@v4
58+
with:
59+
# This makes Actions fetch all Git history so that Changesets can generate changelogs
60+
fetch-depth: 0
61+
62+
- name: Setup pnpm
63+
uses: pnpm/action-setup@v3
64+
with:
65+
version: 8
66+
67+
- name: Setup Node.js
68+
uses: actions/setup-node@v4
69+
with:
70+
node-version: 20
71+
cache: 'pnpm'
72+
registry-url: 'https://registry.npmjs.org'
73+
74+
- name: Install Dependencies
75+
run: pnpm install
76+
77+
- name: Build Packages
78+
run: pnpm build
79+
80+
- name: Create Release Pull Request or Publish to npm
81+
id: changesets
82+
uses: changesets/action@v1
83+
with:
84+
version: pnpm changeset version
85+
publish: pnpm changeset publish
86+
commit: 'chore(release): version packages'
87+
title: 'chore(release): version packages'
88+
${{ inputs.force_publish && 'createGithubReleases: false' || '' }}
89+
env:
90+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
92+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Dependencies
2+
node_modules
3+
.pnp
4+
.pnp.js
5+
6+
# Build outputs
7+
dist
8+
build
9+
out
10+
.next
11+
.turbo
12+
13+
# TypeScript
14+
*.tsbuildinfo
15+
16+
# Testing
17+
coverage
18+
19+
# Debug
20+
npm-debug.log*
21+
yarn-debug.log*
22+
yarn-error.log*
23+
pnpm-debug.log*
24+
25+
# Environment
26+
.env
27+
.env.local
28+
.env.development.local
29+
.env.test.local
30+
.env.production.local
31+
32+
# Cache
33+
.eslintcache
34+
.cache
35+
36+
# Editor directories and files
37+
.idea
38+
.vscode/*
39+
!.vscode/extensions.json
40+
!.vscode/settings.json
41+
!.vscode/tasks.json
42+
!.vscode/launch.json
43+
*.suo
44+
*.ntvs*
45+
*.njsproj
46+
*.sln
47+
*.sw?
48+
49+
# OS
50+
.DS_Store
51+
Thumbs.db

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx --no -- commitlint --edit "$1"

.husky/pre-commit

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
# Get staged files
5+
files=$(git diff --cached --name-only --diff-filter=ACMR "*.ts" "*.tsx" "*.js" "*.jsx" | xargs)
6+
7+
if [ -n "$files" ]; then
8+
echo "Running Biome on staged files: $files"
9+
npx biome check --apply --no-errors-on-unmatched $files
10+
git add $files
11+
fi
12+
13+
# Run TypeScript type check
14+
npm run typecheck

CONTRIBUTING.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Contributing to TS Monorepo
2+
3+
Thank you for considering contributing to our TypeScript monorepo! This document outlines the process for contributing and the standards we follow.
4+
5+
## Development Process
6+
7+
1. **Fork and clone** the repository
8+
2. **Install dependencies**: `pnpm install`
9+
3. **Create a branch**: `git checkout -b feature/my-feature`
10+
4. **Make your changes**
11+
5. **Test your changes**: `pnpm test`
12+
6. **Ensure code quality**: `pnpm lint && pnpm typecheck`
13+
14+
## Commit Message Convention
15+
16+
We follow [Conventional Commits](https://www.conventionalcommits.org/) for commit messages. This is enforced using commitlint.
17+
18+
Format: `type(scope): subject`
19+
20+
Types:
21+
- `feat`: A new feature
22+
- `fix`: A bug fix
23+
- `docs`: Documentation changes
24+
- `style`: Changes that don't affect code meaning (formatting, etc.)
25+
- `refactor`: Code changes that neither fix bugs nor add features
26+
- `perf`: Performance improvements
27+
- `test`: Adding or fixing tests
28+
- `chore`: Changes to build process or auxiliary tools
29+
30+
Example:
31+
```
32+
feat(core): add new API method for authentication
33+
```
34+
35+
## Pull Request Process
36+
37+
1. Update the README.md if needed with details of changes to the interface.
38+
2. Add a changeset to document your changes: `pnpm changeset`
39+
3. Create a pull request to the `main` branch.
40+
4. The PR will be reviewed and merged if it meets our standards.
41+
42+
## Adding New Packages
43+
44+
1. Create a new directory in the `packages` folder.
45+
2. Create a `package.json`, `tsconfig.json`, and source files.
46+
3. Add the package to relevant workspace configurations.
47+
4. Update path mappings in the root `tsconfig.json`.
48+
49+
## Testing
50+
51+
- Write tests for all new features and bug fixes.
52+
- Run existing tests to ensure your changes don't break existing functionality.
53+
- Aim for good test coverage.
54+
55+
## Code Style
56+
57+
We use Biome for linting and formatting:
58+
59+
- Run `pnpm lint` to check code quality.
60+
- Run `pnpm format` to format the code.
61+
62+
All code must pass linting and typechecking before being merged.
63+
64+
## Versioning
65+
66+
We use [Changesets](https://github.com/changesets/changesets) to manage versions and generate changelogs.
67+
68+
After making changes:
69+
1. Run `pnpm changeset`
70+
2. Follow the prompts to describe your changes
71+
3. Commit the generated changeset file
72+
73+
## Questions?
74+
75+
If you have any questions, please open an issue or discussion in the repository.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 prosdevlab
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)