Skip to content

Commit 1953491

Browse files
docs: focus CONTRIBUTING on GitHub workflow, remove publishing
Made-with: Cursor
1 parent 028053d commit 1953491

1 file changed

Lines changed: 29 additions & 42 deletions

File tree

CONTRIBUTING.md

Lines changed: 29 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,69 @@
1-
# Contributing to @hamdymohamedak/openfetch
1+
# Contributing on GitHub
22

3-
Thank you for taking the time to improve this project. The following guidelines keep reviews predictable and the package stable across runtimes.
3+
This document describes how to participate in **@hamdymohamedak/openfetch** through GitHub: issues, discussions, and pull requests.
44

5-
## Ground rules
5+
## What we look for in changes
6+
7+
These rules keep reviews predictable and the library safe across runtimes:
68

79
1. **Stay on `fetch`.** Do not add XMLHttpRequest, alternate fetch shims as required dependencies, or polyfills that assume a browser.
810
2. **Avoid browser-only globals.** Do not reference `window`, `document`, `localStorage`, `sessionStorage`, `WebSocket`, or `EventSource` in library code.
911
3. **Keep the public API small.** Prefer new behavior as optional middleware or clearly documented config rather than breaking existing callers.
10-
4. **TypeScript source of truth.** All implementation lives under `src/`; `dist/` is compiled output from `npm run build`.
11-
12-
## How to contribute
12+
4. **TypeScript source of truth.** Implementation lives under `src/`; `dist/` is build output from `npm run build`.
1313

14-
### Reporting issues
14+
## Reporting issues
1515

16-
Open an issue with:
16+
[Open an issue](https://github.com/openfetch-js/OpenFetch/issues) on this repository with:
1717

1818
- Runtime and version (Node, Bun, Deno, worker, browser).
1919
- Minimal code sample and expected vs actual behavior.
2020
- If relevant, the target URL shape (without secrets).
2121

22-
### Suggesting features
22+
## Suggesting features
2323

24-
Describe the use case and whether it can live in userland (middleware) vs core. Large features should be discussed in an issue before a heavy pull request.
24+
Open an issue first. Describe the use case and whether it can live in userland (middleware) vs core. Large features should be agreed in an issue before a large pull request.
2525

26-
### Pull requests
26+
## Pull requests
2727

28-
#### Branch naming
28+
### Branch naming
2929

30-
Use **one branch per concern**: a single feature **or** a single bug fix, not unrelated changes in the same branch.
30+
Use **one branch per concern**: one feature **or** one bug fix, not unrelated changes together.
3131

32-
- **Features:** `features/<short-description>`for example `features/add-retry`, `features/cache-key-override`.
33-
- **Bug fixes:** `bugs/<short-description>`for example `bugs/timeout-signal`, `bugs/cache-key-collision`.
32+
- **Features:** `features/<short-description>`e.g. `features/add-retry`, `features/cache-key-override`.
33+
- **Bug fixes:** `bugs/<short-description>`e.g. `bugs/timeout-signal`, `bugs/cache-key-collision`.
3434

3535
Use **kebab-case** after the prefix. Keep the slug short but specific enough that reviewers can tell what the branch is for.
3636

37-
1. **Fork** the repository and create a branch from `main` following the [branch naming](#branch-naming) rules above.
38-
2. **Implement** your change in `src/`. Match existing formatting and naming.
39-
3. **Build** locally: `npm run build` (must pass with no TypeScript errors).
37+
### Workflow
38+
39+
1. **Fork** this repository and create a branch from `main` using the [branch naming](#branch-naming) rules above.
40+
2. **Implement** in `src/`. Match existing formatting and naming.
41+
3. **Build** locally: `npm run build` (no TypeScript errors).
4042
4. **Document** user-visible behavior in `README.md` and, if structural, in `docs/PROJECT_FLOW.md`.
41-
5. **Open a PR** into `main` with:
43+
5. **Open a pull request** into `main` with:
4244
- A clear title and description.
43-
- What changed and why (motivation).
45+
- What changed and why.
4446
- Any breaking changes called out explicitly.
4547

46-
### Commit messages
47-
48-
Use short, imperative subjects (for example `Add cache key override option`). Optional body for context. Consistent history helps maintainers and consumers.
49-
50-
### Code review
51-
52-
Maintainers may request tests, naming tweaks, or doc updates. Keeping changes scoped to one concern per PR speeds up merge.
48+
### Before you push
5349

54-
## Local development
50+
From a clone of your fork:
5551

5652
```bash
5753
npm install
5854
npm run build
5955
npm run test:security
6056
```
6157

62-
`npm run test:security` runs the checks under `security-tests/`. `tsc` remains the compile gate for every change.
58+
`npm run test:security` runs `security-tests/`. The TypeScript compile step is the gate for every change.
6359

64-
## Publishing
65-
66-
Publishing to npm is reserved for maintainers after version bump and changelog review. Consumers should install from the registry or from a tagged release, not from unreviewed branches.
67-
68-
npm **requires two-factor authentication** (or a granular access token with publish rights) for `npm publish`. Logging in with the browser (`npm login`) is not enough by itself.
60+
### Commit messages
6961

70-
1. On [npmjs.com](https://www.npmjs.com/) go to **Account → Two-Factor Authentication** and enable **Authorization and writes** (authenticator app recommended).
71-
2. From the package root:
62+
Use short, imperative subjects (e.g. `Add cache key override option`). Add a body when extra context helps reviewers reading the PR on GitHub.
7263

73-
```bash
74-
npm publish --access public --otp=123456
75-
```
76-
77-
Use the current 6-digit code from your authenticator app. Do not commit or share OTPs.
64+
### Code review
7865

79-
**Alternative:** create a **Granular Access Token** at npm with permission to publish this package (and “bypass 2FA” only if your org policy allows it), then configure npm to use that token for `registry.npmjs.org`.
66+
Maintainers may ask for tests, naming tweaks, or doc updates on the PR. Smaller, single-concern PRs are easier to review and merge.
8067

8168
## Code of conduct
8269

0 commit comments

Comments
 (0)