|
| 1 | +--- |
| 2 | +layout: guide.njk |
| 3 | +title: 'Writing Changesets' |
| 4 | +displayName: Writing Changesets |
| 5 | +slug: writing-changesets |
| 6 | +--- |
| 7 | + |
| 8 | +# What are changesets? |
| 9 | + |
| 10 | +Each changeset represents changes that have enough significance to warrant a new version. A changelog represents a single release. A changelog may contain several changesets. |
| 11 | + |
| 12 | +There are three levels of releases that a changeset can describe, which are described by semantic versioning: |
| 13 | + |
| 14 | +- **Patch** (1.0.0 → 1.0.1): Bug fixes and non-breaking changes |
| 15 | +- **Minor** (1.0.0 → 1.1.0): New features, backwards-compatible |
| 16 | +- **Major** (1.0.0 → 2.0.0): Breaking changes requiring user update |
| 17 | + |
| 18 | +Each change should be categorized under one of these types: |
| 19 | + |
| 20 | +- **Added**: New features or capabilities |
| 21 | +- **Changed**: Changes in existing functionality |
| 22 | +- **Deprecated**: Soon-to-be removed features |
| 23 | +- **Removed**: Features that have been removed |
| 24 | +- **Fixed**: Bug fixes |
| 25 | + |
| 26 | +## Writing changesets |
| 27 | + |
| 28 | +Changesets are different from commit messages. **Commit messages** are used to document the changes for _contributors_. **Changesets** are used to communicate the changes to the _consumers_ of the design system. |
| 29 | + |
| 30 | +### Be specific and component-focused |
| 31 | + |
| 32 | +Reference components by their tag names, include links to the PR, and be specific about changes, including: |
| 33 | + |
| 34 | +- What changed |
| 35 | +- Why it changed |
| 36 | +- How users should update their code (if applicable) |
| 37 | + |
| 38 | +Use package names and categories for better readability. Make content easily linkable for reference. |
| 39 | + |
| 40 | +#### ❌ Bad: not specific |
| 41 | + |
| 42 | +```md |
| 43 | +--- |
| 44 | +'@spectrum-web-components/alert': minor |
| 45 | +--- |
| 46 | + |
| 47 | +- Changed alert styles |
| 48 | +``` |
| 49 | + |
| 50 | +#### ✅ Good: very specific |
| 51 | + |
| 52 | +```md |
| 53 | +--- |
| 54 | +'@spectrum-web-components/alert': minor |
| 55 | +--- |
| 56 | + |
| 57 | +- **Fixed**: Updated `<sp-alert>` default styles for better contrast [#9999](https://github.com/adobe/spectrum-web-components/pull/9999) |
| 58 | +``` |
| 59 | + |
| 60 | +### Document breaking changes |
| 61 | + |
| 62 | +Clearly mark and explain breaking changes with migration guidance. List each change on its own line. |
| 63 | + |
| 64 | +#### ❌ Bad: doesn't list breaking changes |
| 65 | + |
| 66 | +```md |
| 67 | +--- |
| 68 | +'@spectrum-web-components/textfield': major |
| 69 | +--- |
| 70 | + |
| 71 | +- Changed how `<sp-textfield>` labels and placeholders work [#9999](https://github.com/adobe/spectrum-web-components/pull/9999) |
| 72 | +``` |
| 73 | + |
| 74 | +#### ✅ Good: lists breaking changes |
| 75 | + |
| 76 | +```md |
| 77 | +--- |
| 78 | +'@spectrum-web-components/textfield': major |
| 79 | +--- |
| 80 | + |
| 81 | +- **Deprecated**: Deprecated `label` attribute, which confused label with placeholder text. [#9999](https://github.com/adobe/spectrum-web-components/pull/9999) |
| 82 | +- **Added**: Added `hidden-label` attribute, for use with assistive technologies. (Before: `<sp-textfield label="Full Name"></sp-textfield>` / After: `<sp-textfield hidden-label="Full Name"></sp-textfield>`) |
| 83 | +- **Added**: Added `placeholder` attribute, for placeholder text. (Before: `<sp-textfield label="john.smith@example.com"></sp-textfield>` / After: `<sp-textfield placeholder="john.smith@example.com"></sp-textfield>`) |
| 84 | +``` |
| 85 | + |
| 86 | +### Focus on user impact |
| 87 | + |
| 88 | +Describe changes from the user's perspective, not implementation details. |
| 89 | + |
| 90 | +#### ❌ Bad: not user-focused |
| 91 | + |
| 92 | +```md |
| 93 | +--- |
| 94 | +'@spectrum-web-components/overlay': patch |
| 95 | +--- |
| 96 | + |
| 97 | +- Replace native `showModal()` for performance optimization [#9999](https://github.com/adobe/spectrum-web-components/pull/9999) |
| 98 | +``` |
| 99 | + |
| 100 | +#### ✅ Good: user-focused |
| 101 | + |
| 102 | +```md |
| 103 | +--- |
| 104 | +'@spectrum-web-components/overlay': patch |
| 105 | +--- |
| 106 | + |
| 107 | +- **Fixed**: Improved `<sp-overlay>` performance in Chromium-based browsers. [#9999](https://github.com/adobe/spectrum-web-components/pull/9999) |
| 108 | +``` |
| 109 | + |
| 110 | +### Use past tense |
| 111 | + |
| 112 | +Write changes in past tense to describe what has been modified. |
| 113 | + |
| 114 | +#### ❌ Bad: uses present tense |
| 115 | + |
| 116 | +```md |
| 117 | +--- |
| 118 | +'@spectrum-web-components/button': minor |
| 119 | +--- |
| 120 | + |
| 121 | +- **Fixed**: Resolves `<sp-button>` accessibility [#9999](https://github.com/adobe/spectrum-web-components/pull/9999) |
| 122 | +- **Added**: Adds new variant `tertiary` [#9999](https://github.com/adobe/spectrum-web-components/pull/9999) |
| 123 | +``` |
| 124 | + |
| 125 | +#### ✅ Good: usespast tense |
| 126 | + |
| 127 | +```md |
| 128 | +--- |
| 129 | +'@spectrum-web-components/button': minor |
| 130 | +--- |
| 131 | + |
| 132 | +- **Fixed**: Resolved `<sp-button>` accessibility [#9999](https://github.com/adobe/spectrum-web-components/pull/9999) |
| 133 | +- **Added**: Added new variant `tertiary` [#9999](https://github.com/adobe/spectrum-web-components/pull/9999) |
| 134 | +``` |
| 135 | + |
| 136 | +## Additional Resources |
| 137 | + |
| 138 | +- [Changesets Documentation](https://github.com/changesets/changesets) |
| 139 | +- [Common Questions](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) |
| 140 | +- [Detailed Release Process](https://github.com/changesets/changesets/blob/main/docs/detailed-explanation.md) |
0 commit comments