|
| 1 | + |
| 2 | +You are an expert release manager for a Yarn 4 monorepo who uses the npm CLI for quick version bumps and patch releases. |
| 3 | + |
| 4 | +# Versioning With npm CLI |
| 5 | + |
| 6 | +## Policy |
| 7 | +- Prefer small, fast patch releases for incremental work. |
| 8 | +- Treat new components and minor fixes as patch releases when they are additive and low-risk. |
| 9 | +- Reserve minor/major only for notable feature waves or breaking changes. |
| 10 | + |
| 11 | +Note: While the repo supports Changesets for broader release coordination, this rule documents the npm CLI flow for quick iterations. |
| 12 | + |
| 13 | +## What Counts As “Small” |
| 14 | +- Additive components (new UI or form wrappers) without breaking changes |
| 15 | +- Bug fixes, perf tweaks, a11y refinements, copy/docs updates |
| 16 | +- Internal refactors that don’t change public APIs |
| 17 | + |
| 18 | +## Pre-flight |
| 19 | +- Clean working tree: no uncommitted changes |
| 20 | +- On a release-worthy branch (e.g., `main`) |
| 21 | +- Build and tests pass: `yarn build && yarn test` |
| 22 | + |
| 23 | +## Patch Bump (Single Workspace) |
| 24 | +For the published package `@lambdacurry/forms`: |
| 25 | + |
| 26 | +```bash |
| 27 | +# Bump version with custom message |
| 28 | +npm version patch -w @lambdacurry/forms -m "Add DateField component and fix TextField accessibility" |
| 29 | + |
| 30 | +# The -m flag creates the git commit automatically with your message |
| 31 | +# No need for separate git add/commit steps |
| 32 | + |
| 33 | +## Post-version Steps |
| 34 | +After running `npm version patch`, you'll need to: |
| 35 | + |
| 36 | +1. **Return to top level**: `cd ../..` (if you're in the package directory) |
| 37 | +2. **Update lockfile**: `yarn install` to update `yarn.lock` with the new version |
| 38 | +3. **Commit lockfile**: `git add yarn.lock && git commit -m "Update yarn.lock for @lambdacurry/forms vX.Y.Z"` |
| 39 | + |
| 40 | +This ensures the lockfile reflects the new package version and maintains consistency across the monorepo. |
| 41 | +``` |
| 42 | + |
| 43 | +Guidelines: |
| 44 | +- Keep the summary one line and human-readable. |
| 45 | +- Examples: "Add DateField; fix TextField aria; smaller bundle". |
| 46 | +- This updates `packages/components/package.json` and creates a normal commit without tags. |
| 47 | + |
| 48 | +## Open PR and Merge |
| 49 | +- Push your branch and open a PR. |
| 50 | +- When the PR merges into `main`, GitHub CI publishes the package. No manual tagging or `npm publish` needed. |
| 51 | + |
| 52 | +## Minor / Major (When Needed) |
| 53 | +- Minor: larger feature sets or notable additions across multiple components |
| 54 | + ```bash |
| 55 | + npm version minor -w @lambdacurry/forms -m "Add comprehensive form validation and new field types" |
| 56 | + ``` |
| 57 | +- Major: any breaking change (API removals/renames, behavior changes) |
| 58 | + ```bash |
| 59 | + npm version major -w @lambdacurry/forms -m "Breaking: rename onSubmit to handleSubmit; remove deprecated props" |
| 60 | + ``` |
| 61 | + |
| 62 | +## Summary Message Tips |
| 63 | +- Keep it under ~100 chars; list 2–3 highlights separated by semicolons |
| 64 | +- Focus on user-visible changes first; include critical fixes |
| 65 | +- Avoid noisy implementation detail; link to PR/issue in the PR body |
| 66 | + |
| 67 | +## Coordination With Changesets |
| 68 | +- Use this npm CLI flow for quick, low-risk patches. |
| 69 | +- For multi-package changes, coordinated releases, or richer changelogs, prefer Changesets (`yarn changeset`) and follow the existing repo workflow. |
| 70 | + |
| 71 | + |
| 72 | +## Coordination With Changesets |
| 73 | +- Use this npm CLI flow for quick, low-risk patches. |
| 74 | +- For multi-package changes, coordinated releases, or richer changelogs, prefer Changesets (`yarn changeset`) and follow the existing repo workflow. |
0 commit comments