Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 166 additions & 0 deletions .github/CONTRIBUTION.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
# 📄 `CONTRIBUTING.md`

````md
# Contributing to vfetch

Thanks for your interest in contributing.

This project is designed to be **strict, predictable, and production-grade**. Contributions must follow the guidelines below to be accepted.

---

## 🛠️ Getting Started

Clone the repo and install dependencies:

```bash
git clone https://github.com/Gab-codes/vfetch.git
cd vfetch
npm install
```
````

Run tests:

```bash
npm run test
```

Run coverage:

```bash
npm run coverage
```

---

## 📁 Project Structure

```
src/ → core implementation
tests/ → unit tests
tests/integration/ → integration tests
```

Do **not** mix concerns:

- Unit tests stay in `tests/`
- Full flow / real API tests go in `tests/integration/`

---

## 📏 Rules & Standards

### 1. No breaking changes without discussion

If your change alters behavior, open an issue first.

---

### 2. Tests are mandatory

- Every feature or fix **must include tests**
- No exceptions
- If it’s not tested, it won’t be merged

---

### 3. Keep types strict

- Avoid `any` unless absolutely necessary
- Prefer explicit types
- Maintain full TypeScript safety

---

### 4. Do not modify unrelated code

Only change what your PR is responsible for.

---

### 5. Maintain existing design decisions

This library prioritizes:

- Predictable `{ ok: boolean }` responses
- No throwing for HTTP errors
- Transport-layer responsibility only (no schema validation)

Do not introduce patterns that break this philosophy.

---

### 6. Keep it lightweight

This is a **zero-dependency** library.

Do not add dependencies unless absolutely justified.

---

## 🧪 Testing Guidelines

- Use **Vitest**
- Use mocks for controlled behavior
- Keep tests isolated and deterministic
- Avoid unnecessary real API calls (only in integration tests)

---

## 🚀 Pull Request Process

1. Fork the repo
2. Create a new branch:

```bash
git checkout -b feat/your-feature
```

3. Make your changes
4. Add/Update tests
5. Ensure everything passes:

```bash
npm run coverage
```

6. Open a PR

---

## ✅ PR Requirements

- All tests must pass
- Coverage must not decrease
- No TypeScript errors
- Clear description of what changed and why

---

## ❌ What Will Be Rejected

- PRs without tests
- Introducing unnecessary dependencies
- Weak typing (`any` abuse)
- Breaking core API design without discussion

---

## 💡 Philosophy

vfetch is built to be:

- Predictable
- Lightweight
- Safe under concurrency

Keep that in mind when contributing.

---

## Thanks for contributing.

```

```
31 changes: 31 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## Description

Briefly describe the changes introduced by this PR. Include any relevant background context.

## Type of Change

- [ ] New Feature
- [ ] Bug Fix
- [ ] Refactor (no functional changes)
- [ ] Documentation Update
- [ ] Configuration Change

## Semantic Naming Verification

- [ ] Does this PR follow the project's semantic naming convention?

## Testing Report

Please document how you tested your changes.

### Automated Tests

- [ ] npm test passes
- [ ] New unit/component tests added (if applicable)

## Checklist

- [ ] My code follows the project guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] My changes generate no new warnings
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
test:
Expand All @@ -31,3 +32,25 @@ jobs:

- name: Run tests with coverage
run: npm run coverage

build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: "20.x"

- name: Install dependencies
run: npm ci

- name: Build package
run: npm run build

- name: Validate build output
run: |
test -f dist/index.js || exit 1
test -f dist/index.cjs || exit 1
test -f dist/index.d.ts || exit 1
25 changes: 25 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 📄 `LICENSE` (MIT)

```md
MIT License

Copyright (c) 2026 Toru Gabriel

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vfetch-client",
"version": "0.1.0",
"version": "0.1.1",
"description": "A modern Axios alternative built on native fetch with interceptors, automatic token refresh, retries, and predictable response handling",
"type": "module",
"main": "./dist/index.cjs",
Expand Down Expand Up @@ -51,5 +51,9 @@
"tsup": "^8.5.1",
"typescript": "^6.0.3",
"vitest": "^4.1.5"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/gab-codes"
}
}
Loading