diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..8b1099a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,139 @@ +# Contributing to nodeup + +Thanks for considering a contribution. `nodeup` is a small Go CLI with a +single maintainer and a strict, automated workflow — read this once before +opening an issue or a PR. + +## Quick orientation + +- **Language / runtime:** Go 1.22+ +- **Architecture:** see the `How it works` section in [`README.md`](./README.md) + for the high-level pipeline. The single source of truth for implementation + details is the Go source under `internal/` plus inline godoc. +- **Branching:** always branch from `main`. `main` is protected — every + change ships via PR and is squash-merged with the source branch deleted. +- **Releases:** tag-driven. Pushing a `v*.*.*` tag to `origin` fires the + GoReleaser workflow (`.github/workflows/release.yml` → + [Homebrew tap](https://github.com/dipto0321/homebrew-tap), + [Scoop bucket](https://github.com/dipto0321/scoop-bucket), npm wrapper). + +## Branching conventions + +Branch names use one of: + +| Prefix | Use for | +|---|---| +| `feat//` | New user-facing feature | +| `fix//` | Bug fix | +| `chore//` | Maintenance, deps, refactors with no behavior change | +| `docs/` | Documentation only | +| `ci/` | CI/CD only | +| `test//` | Tests only | +| `refactor//` | Refactor only | + +`` is one of the commitlint scopes (see below). Examples: +`feat/check/dist-index-fetcher`, `fix/detector/nvm-windows-registry`, +`docs/clarify-installation`, `ci/bump-golangci-lint`. + +## Commit messages — Conventional Commits + +Enforced by [commitlint](https://github.com/conventional-changelog/commitlint) +in CI (`wagoid/commitlint-github-action@v5`). Local check: `npx commitlint --edit`. + +**Allowed types:** `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, +`test`, `build`, `ci`, `chore`, `revert`. + +**Allowed scopes:** `detector`, `manager`, `packages`, `node`, `config`, +`ui`, `platform`, `cli`, `deps`, `release`, `ci`, `docs`, `lint`. + +**Breaking changes:** append `!` after the type/scope and add a +`BREAKING CHANGE:` footer in the commit body, e.g.: + +``` +feat(config)!: drop legacy manager=auto key + +BREAKING CHANGE: config.manager=auto is no longer recognized. Use +config.manager= explicitly, or omit the key for auto-detect. +``` + +**Format:** + +``` +(): # imperative mood, <= 100 chars, no trailing period + + # explain *what* and *why*, not how + +