# Contributing

Thanks for contributing to `@bayudwiyansatria/cloudflare`.

Please follow the [Code of Conduct](CODE_OF_CONDUCT.md). Report security vulnerabilities privately as described in the
[security policy](SECURITY.md); do not open a public issue for them. Use the [support guide](SUPPORT.md) for usage
questions, and search existing issues before proposing a change.

## Prerequisites

- Node.js 22
- npm
- A GitHub classic personal access token with `read:packages` permission and access to the package

The repository's `.npmrc` reads the token from `NPM_AUTH_TOKEN`. Do not put a literal token in that file or commit one.

PowerShell:

```powershell
$env:NPM_AUTH_TOKEN = 'your-token'
npm install
```

POSIX shells:

```bash
export NPM_AUTH_TOKEN='your-token'
npm install
```

## Development workflow

Create a focused branch, make the smallest coherent change, and add or update tests for behavior changes.

```bash
npm test
npm run build
npm run build:docs
npm run build:docs:book
```

Useful commands:

| Command                     | Purpose                                      |
| --------------------------- | -------------------------------------------- |
| `npm run dev`               | Rebuild both package entries on file changes |
| `npm run lint:run`          | Lint the TypeScript source                   |
| `npm run test:run`          | Run the Jest suite                           |
| `npm run format`            | Format source and configuration files        |
| `npm run format:docs`       | Format Markdown files                        |
| `npm run format:docs:check` | Check Markdown formatting                    |
| `npm run docs:check`        | Check local Markdown links and anchors       |

The TypeDoc build treats warnings as errors. Public exports therefore need useful documentation and valid
cross-references.

## Pull requests

In the pull request:

1. Explain the problem, the approach, and any compatibility impact.
2. Include tests or explain why they are not applicable.
3. Update public documentation when behavior or API usage changes.
4. Add or update the dated file in `docs/changes-log/` for notable user-facing changes. Typographical and
   dependency-only changes do not require an entry.
5. Confirm `npm test`, `npm run build`, and the relevant documentation builds pass.

Keep commits focused and descriptive. Maintainers may ask for commits to be reorganized before merging.

## Versioning

The project follows [Semantic Versioning](https://semver.org/). Call out breaking changes explicitly in the pull request
and changelog entry.
