Skip to content

Commit ee99d08

Browse files
authored
docs: added writing changeset docs (#5440)
* docs: init changeset docs * docs: updated changeset docs * docs: changed title * docs: updated link text
1 parent cd1ab2f commit ee99d08

3 files changed

Lines changed: 145 additions & 2 deletions

File tree

.changeset/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,12 @@ A typical changeset file looks like this:
3939
'@spectrum-web-components/theme': patch
4040
---
4141
42-
Added new variant to button component and fixed theme compatibility issues
42+
- **Added**: Added new variant `tertiary` to `<sp-button>` component [#9999](https://github.com/adobe/spectrum-web-components/pull/9999)
43+
- **Fixed**: Fixed `<sp-theme>` theme compatibility issues [#10000](https://github.com/adobe/spectrum-web-components/pull/10000)
4344
```
4445
46+
For our guidelines on writing changesets, see [our writing changesets guide](https://opensource.adobe.com/spectrum-web-components/guides/writing-changesets/).
47+
4548
## Common Questions
4649
4750
We have a quick list of common questions to get you started engaging with this project in

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ The project will be linted on a pre-commit hook, but you can also run the lint s
103103

104104
### Dependency linting
105105

106-
There are downstream issues that can arise from multiple packages in this mono-repo using dependencies with mismatched version strings. By default, changesets will bump version numbers of internal dependencies when the various packages are published and the depended version is pointing to the latest release, which can help to mitigate this issue. Running `yarn lint:versions` will check that all version strings for each dependency match across the repo.
106+
There are downstream issues that can arise from multiple packages in this mono-repo using dependencies with mismatched version strings. By default, [changesets](https://opensource.adobe.com/spectrum-web-components/guides/writing-changesets/) will bump version numbers of internal dependencies when the various packages are published and the depended version is pointing to the latest release, which can help to mitigate this issue. Running `yarn lint:versions` will check that all version strings for each dependency match across the repo.
107107

108108
`yarn list:versions --fix` will modify the `package.json` files, updating all dependencies to the latest version available in the library — _a potentially dangerous operation_. If this is what you want to do when `yarn lint:versions` discovers mismatched versions, this step can greatly reduce the amount of work to achieve matching version numbers.
109109

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
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

Comments
 (0)