Skip to content

Commit 4c4d518

Browse files
authored
Merge pull request #73 from script-development/engineer/contributing-md-rewrite
2 parents ba1a16e + 9b968b4 commit 4c4d518

1 file changed

Lines changed: 24 additions & 15 deletions

File tree

docs/contributing.md

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
## Prerequisites
44

5-
- **Node.js** 22+
6-
- **npm** 11+
5+
- **Node.js** 24+ (matches root `engines.node: ">=24.0.0"`)
6+
- **npm** 11+ (no enforced constraint, but matches the version bundled with Node 24)
77

88
Clone the repository and install dependencies:
99

@@ -146,13 +146,15 @@ Follow the conventions:
146146
- **Factory pattern:** Export a `createXxxService()` function that returns a plain object.
147147
- **No default exports.**
148148

149-
### 5. Create a changeset
149+
### 5. Bump the package version
150150

151-
```bash
152-
npx changeset
153-
```
151+
Set `version` in your new package's `package.json` to `0.1.0` (the conventional starting version for new packages). When making subsequent changes to existing packages, bump the `version` field manually following semver:
152+
153+
- **patch** (`0.1.0``0.1.1`) — bug fixes, doc-only changes, or peer-range widenings.
154+
- **minor** (`0.1.0``0.2.0`) — new features, new exports, or any pre-1.0 breaking change (caret semver treats minor bumps as breaking pre-1.0; expect a peer-range cascade — see the territory's `CLAUDE.md` § "Versioning Discipline (Pre-1.0)").
155+
- **major** (`0.1.0``1.0.0`) — package crosses the stability boundary; document the contract guarantees that ship at 1.0.
154156

155-
Select your package, choose the version bump type (major/minor/patch), and write a description of the change. Changesets are how we track what changed and generate changelogs.
157+
Push to `main` triggers an automatic publish (see [Publishing](#publishing) below).
156158

157159
## Conventions
158160

@@ -190,9 +192,13 @@ export type {ExampleService, ExampleConfig} from './types';
190192
If your package depends on another `@script-development/fs-*` package, declare it as a **peer dependency**, not a regular dependency. This prevents duplicate installations:
191193

192194
```json
193-
{"peerDependencies": {"@script-development/fs-http": "^1.0.0"}}
195+
{"peerDependencies": {"@script-development/fs-http": "^0.3.0"}}
194196
```
195197

198+
::: warning Pre-1.0 caret semantics
199+
Under npm caret semantics, `^0.3.0` matches only `0.3.x` — the next minor (`0.4.0`) is treated as breaking. Cross-minor consumers must widen the range (e.g. `"^0.3.0 || ^0.4.0"`) and patch-bump the affected sibling. See the territory's `CLAUDE.md` § "Versioning Discipline (Pre-1.0)" for the full mechanical checklist.
200+
:::
201+
196202
### Testing
197203

198204
Write tests alongside your source code in the `tests/` directory. Use `describe` + `it` blocks:
@@ -211,12 +217,15 @@ describe('createExampleService', () => {
211217

212218
## Publishing
213219

214-
Packages are published to npm via **OIDC Trusted Publishing** — no stored tokens. The publish workflow triggers automatically when changesets are merged to `main`.
220+
Packages are published to npm via **OIDC Trusted Publishing** — no stored tokens. The publish workflow (`.github/workflows/publish.yml`) triggers automatically on push to `main` when any `**/package.json` file changes.
221+
222+
The flow:
215223

216-
To prepare a release:
224+
1. Create your changes on a branch (including a `version` bump in the affected package's `package.json` per the rules in [Adding a New Package § 5](#_5-bump-the-package-version)).
225+
2. Open a PR — CI runs all 8 gates (audit → format → lint → build → typecheck → lint:pkg → coverage → mutation).
226+
3. On merge to `main`, the publish workflow detects the `package.json` change and:
227+
- Builds all packages and uploads `dist/` artifacts.
228+
- For each package whose published version differs from the local `package.json#version`, publishes the new version via OIDC Trusted Publishing.
229+
- Provenance attestation is enabled (`NPM_CONFIG_PROVENANCE=true`).
217230

218-
1. Create your changes on a branch
219-
2. Run `npx changeset` to describe what changed
220-
3. Open a PR — CI runs all 8 gates
221-
4. After merge, the changeset bot creates a "Version Packages" PR
222-
5. Merging that PR triggers the publish workflow
231+
There is no changeset bot and no "Version Packages" intermediate PR. Version bumps are author-managed in the source PR; the publish step reacts to whatever shipped on `main`.

0 commit comments

Comments
 (0)