|
| 1 | +--- |
| 2 | +name: writing-changesets |
| 3 | +description: Create changeset files for user-facing changes. Use when making schema changes, modifying types, or any change that affects package consumers. |
| 4 | +--- |
| 5 | + |
| 6 | +# Writing Changesets |
| 7 | + |
| 8 | +Create a changeset file to document user-facing changes for release. |
| 9 | + |
| 10 | +## When to Use |
| 11 | + |
| 12 | +Add a changeset when making changes that affect consumers: |
| 13 | + |
| 14 | +- Adding new lexicons |
| 15 | +- Modifying existing lexicon schemas (breaking or non-breaking) |
| 16 | +- Changing TypeScript type exports |
| 17 | +- Renaming any exported constants, types, or functions |
| 18 | +- Modifying generation scripts that affect exported code |
| 19 | +- Any change that requires a version bump or affects package consumers |
| 20 | + |
| 21 | +Skip changesets for internal changes (build scripts, documentation only). |
| 22 | + |
| 23 | +## Format |
| 24 | + |
| 25 | +Create in `.changeset/` a Markdown file with a descriptive name (e.g., |
| 26 | +`add-attachment-outcome-types.md`) in this format: |
| 27 | + |
| 28 | +```markdown |
| 29 | +--- |
| 30 | +"@hypercerts-org/lexicon": minor |
| 31 | +--- |
| 32 | + |
| 33 | +Add new attachment and outcome record types to support rich media claims |
| 34 | +``` |
| 35 | + |
| 36 | +### Frontmatter Fields |
| 37 | + |
| 38 | +There should be a frontmatter field for each package being changed. |
| 39 | +The field name should be the package name, and the field value should |
| 40 | +be one of the following change types: |
| 41 | + |
| 42 | +- `patch` - Bug fixes, non-breaking changes |
| 43 | +- `minor` - New features, non-breaking additions (also breaking |
| 44 | + changes if the version in `package.json` is still 0.x.y) |
| 45 | +- `major` - Breaking changes (_ONLY_ use if the version in `package.json` |
| 46 | + is already greater than 0.x.y) |
| 47 | + |
| 48 | +### Description |
| 49 | + |
| 50 | +In the body after the frontmatter field(s), write a clear, concise |
| 51 | +description following conventional commit style. Focus on what changed |
| 52 | +and why. |
| 53 | + |
| 54 | +## Example Changesets |
| 55 | + |
| 56 | +**New lexicon type:** |
| 57 | + |
| 58 | +```markdown |
| 59 | +--- |
| 60 | +"@hypercerts-org/lexicon": minor |
| 61 | +--- |
| 62 | + |
| 63 | +Add attachment record type for supporting rich media evidence on claims |
| 64 | +``` |
| 65 | + |
| 66 | +**Schema change:** |
| 67 | + |
| 68 | +```markdown |
| 69 | +--- |
| 70 | +"@hypercerts-org/lexicon": minor |
| 71 | +--- |
| 72 | + |
| 73 | +Convert location field to locations array across activity, evaluation, and measurement records |
| 74 | +``` |
| 75 | + |
| 76 | +**Breaking change when package version is 1.x.y:** |
| 77 | + |
| 78 | +```markdown |
| 79 | +--- |
| 80 | +"@hypercerts-org/lexicon": major |
| 81 | +--- |
| 82 | + |
| 83 | +Rename evidence record to attachment and outcome, requiring migration of existing records |
| 84 | +``` |
| 85 | + |
| 86 | +**Breaking change when package version is 0.x.y:** |
| 87 | + |
| 88 | +```markdown |
| 89 | +--- |
| 90 | +"@hypercerts-org/lexicon": minor |
| 91 | +--- |
| 92 | + |
| 93 | +Rename evidence record to attachment and outcome, requiring migration of existing records |
| 94 | +``` |
| 95 | + |
| 96 | +## Key Files |
| 97 | + |
| 98 | +- `.changeset/config.json` - Changeset configuration |
| 99 | +- Existing changeset files in `.changeset/` - Reference for naming and format |
| 100 | +- `package.json` - Contains version and release scripts |
0 commit comments