diff --git a/.github/CONTRIBUTION.MD b/.github/CONTRIBUTION.MD new file mode 100644 index 0000000..8a3482c --- /dev/null +++ b/.github/CONTRIBUTION.MD @@ -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. + +``` + +``` diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..89e5fb6 --- /dev/null +++ b/.github/pull_request_template.md @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8dc8e29..b80063a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,6 +5,7 @@ on: branches: [main] pull_request: branches: [main] + workflow_dispatch: jobs: test: @@ -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 diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..eb09d19 --- /dev/null +++ b/LICENSE.md @@ -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. +``` diff --git a/package-lock.json b/package-lock.json index 7298aa1..72388af 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vfetch-client", - "version": "0.1.0", + "version": "0.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "vfetch-client", - "version": "0.1.0", + "version": "0.1.1", "license": "MIT", "devDependencies": { "@types/node": "^25.6.0", diff --git a/package.json b/package.json index bbe9535..f16eb57 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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" } }