Skip to content

Commit 7398ed1

Browse files
committed
docs: expand README with installation, usage, and CI/CD details
Signed-off-by: Rafael Julio <development@rafifos.dev>
1 parent 3dec76f commit 7398ed1

1 file changed

Lines changed: 86 additions & 0 deletions

File tree

README.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,89 @@
44
[![jsrepo Blocks](https://jsrepo.dev/badges/registry/blocks?url=github/rafifos/bits)](https://jsrepo.dev/registry?url=github/rafifos/bits)
55
[![jsrepo Categories](https://jsrepo.dev/badges/registry/categories?url=github/rafifos/bits)](https://jsrepo.dev/registry?url=github/rafifos/bits)
66
[![jsrepo Dependencies](https://jsrepo.dev/badges/registry/dependencies?url=github/rafifos/bits)](https://jsrepo.dev/registry?url=github/rafifos/bits)
7+
8+
A collection of reusable TypeScript utility functions and helpers that are too small to be their own libraries.
9+
10+
## Overview
11+
12+
This repository contains small, focused utility functions that can be easily imported into your projects using [jsrepo](https://jsrepo.dev). Each utility is thoroughly tested and follows modern TypeScript best practices.
13+
14+
## Installation
15+
16+
This library is distributed via jsrepo, which allows you to import just the specific utilities you need without any additional dependencies.
17+
18+
1. Setup jsrepo if you haven't already:
19+
20+
```bash
21+
npx jsrepo init --project
22+
```
23+
24+
2. Use any utility directly in your project:
25+
26+
```bash
27+
npx jsrepo add github/rafifos/bits/utils/handle-async
28+
```
29+
30+
## Available Utilities
31+
32+
- [handle-async](src/utils/handle-async.ts): A utility for handling async functions with proper error handling.
33+
- [should-never-happen](src/utils//should-never-happen.ts): A utility for handling cases that should never occur in your application flow.
34+
35+
## Development
36+
37+
### Prerequisites
38+
39+
- Node.js ≥ 22
40+
- pnpm ≥ 10
41+
42+
### Setup
43+
44+
1. Clone the repository:
45+
46+
```bash
47+
git clone https://github.com/rafifos/bits.git
48+
cd bits
49+
```
50+
51+
2. Install dependencies:
52+
53+
```bash
54+
pnpm install
55+
```
56+
57+
### Commands
58+
59+
- `pnpm build` - Builds the jsrepo registry
60+
- `pnpm test` - Runs tests with Jest
61+
- `pnpm lint` - Runs Biome linter and formatter
62+
63+
### Adding a New Utility
64+
65+
1. Create a new file in the appropriate category directory (e.g., `src/utils/my-utility.ts`)
66+
2. Add tests in a corresponding `my-utility.test.ts` file
67+
3. Run `pnpm build` to update the jsrepo manifest
68+
4. Run `pnpm test` to ensure everything works correctly
69+
70+
### Commit Guidelines
71+
72+
This project uses [Conventional Commits](https://www.conventionalcommits.org/) for commit messages, enforced by commitlint.
73+
74+
Examples:
75+
76+
- `feat: add new handle-error utility`
77+
- `fix: correct type definition in handle-async`
78+
- `docs: update usage examples`
79+
- `test: add more test cases for should-never-happen`
80+
81+
## CI/CD
82+
83+
This project uses GitHub Actions for continuous integration:
84+
85+
- Code quality checks with Biome
86+
- Unit tests with Jest
87+
- Commit message validation with commitlint
88+
- Automatic jsrepo manifest updates
89+
90+
## License
91+
92+
MIT License - see the [LICENSE](LICENSE) file for details.

0 commit comments

Comments
 (0)