Skip to content

Commit b1b54a2

Browse files
committed
chore: update documentation
1 parent af23758 commit b1b54a2

File tree

1 file changed

+51
-26
lines changed

1 file changed

+51
-26
lines changed

CONTRIBUTOR-DOCS/01_contributor-guides/06_releasing-swc.md

Lines changed: 51 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -98,27 +98,48 @@ If not logged in, run `npm login` to sign in to your account.
9898

9999
## Releasing to NPM — the good stuff
100100

101-
The publishing workflow is handled by a single unified script (`scripts/publish.js`) that publishes both 1st-gen and 2nd-gen packages. The script handles building, versioning, publishing, and git operations automatically.
102-
103-
1. Run `git checkout main && git fetch && git pull && git clean -dfX` to ensure you are working with the latest code
104-
2. Run `yarn install && yarn build` to install all dependencies and build the pre-processed assets for publication.
105-
1. Confirm no files were updated or modified
106-
3. Scan the version summary for any unexpected changes
107-
1. In your IDE search `': major` , `': minor`, `': patch` , based on the results in the order of this search list, the highest level takes precedence
108-
1. exclude files: `.changeset/README.md`
109-
4. Open your authenticator app to have it ready
110-
5. Run one of the following commands depending on the type of release:
111-
- **Regular release:** `yarn publish` (creates git tags, publishes both 1st-gen and 2nd-gen)
112-
- **Snapshot release:** `yarn publish:snapshot` (no git tags, uses `snapshot` npm tag)
113-
6. Enter the one-time password from your authenticator for NPM.
114-
1. Wait for a fresh password; a stale timer might cause issues.
115-
7. After the SWC packages are released, the React Wrapper packages will be generated.
116-
1. This multi-phase approach ensures that the wrapped packages share the same version as the standard packages.
117-
8. Enter a new one-time password from your authenticator for NPM.
118-
9. For regular releases, the `yarn publish` command will automatically commit the changes to main with a commit message of `chore: release new versions #publish`
119-
1. The docs site will publish automatically if the `#publish` string is included in the commit message and the check suite runs successfully.
120-
2. For snapshot/nightly releases, no git operations are performed.
121-
10. Confirm the build on `main` passes (regular releases only)
101+
The publishing workflow is handled by a single unified script (`scripts/publish.js`) that automates the entire process: cleaning, building, versioning, publishing, and git operations.
102+
103+
1. **Prepare your workspace:**
104+
- Run `git checkout main && git fetch && git pull` to ensure you have the latest code
105+
- Confirm the working directory is clean with `git status`
106+
2. **Review changesets:**
107+
- Scan the `.changeset` directory for pending changes
108+
- In your IDE search `': major`, `': minor`, `': patch` to verify the release impact
109+
- Exclude files: `.changeset/README.md`
110+
- The highest level takes precedence (major > minor > patch)
111+
- Confirm the changes match your expectations
112+
3. **Prepare for publishing:**
113+
- Open your authenticator app to have it ready
114+
- You'll need to enter a one-time password twice during the process:
115+
1. Once for the main SWC packages
116+
2. Once for the React wrapper packages
117+
4. **Run the publish command:**
118+
- **Regular release:** `yarn publish`
119+
- Creates git tags
120+
- Publishes to npm with `latest` tag
121+
- Commits changes to `main`
122+
- **Snapshot release:** `yarn publish:snapshot`
123+
- No git tags
124+
- Publishes to npm with `snapshot` tag
125+
- No git commits
126+
- **Custom tag release:** `node ./scripts/publish.js --snapshot --tag beta`
127+
- No git tags
128+
- Publishes to npm with custom tag (e.g., `beta`, `alpha`, `rc`, `nightly`)
129+
- No git commits
130+
5. **What happens during publishing:**
131+
1. The script cleans all build artifacts and reinstalls dependencies
132+
2. Builds all packages (1st-gen and 2nd-gen)
133+
3. Generates custom elements manifests
134+
4. Versions packages with changesets
135+
5. Publishes to npm (you'll enter your first OTP here)
136+
6. Builds React wrapper packages
137+
7. Publishes React wrappers to npm (you'll enter your second OTP here)
138+
8. For regular releases: commits changes and creates git tags
139+
6. **Verify the release:**
140+
- For regular releases, confirm the build on `main` passes
141+
- Check the [tags page](https://github.com/adobe/spectrum-web-components/tags) to verify new tags were created
142+
- The docs site will publish automatically if the commit message includes `#publish` and checks pass
122143

123144
### Troubleshooting
124145

@@ -127,9 +148,9 @@ If publishing fails with an error:
127148
- Check the [list of tags](https://github.com/adobe/spectrum-web-components/tags) to see if new tags have been released for your publishing attempt.
128149
- If they were, run `yarn publish` again (or the appropriate command for your release type).
129150

130-
### Advanced: Custom npm tags
151+
### Custom npm tags
131152

132-
For special releases like beta, alpha, or release candidates, you can use custom npm tags:
153+
For special releases like beta, alpha, nightly, or release candidates, you can use custom npm tags with the `--snapshot` and `--tag` flags:
133154

134155
```bash
135156
# Beta release
@@ -138,16 +159,20 @@ node ./scripts/publish.js --snapshot --tag beta
138159
# Alpha release
139160
node ./scripts/publish.js --snapshot --tag alpha
140161

162+
# Nightly release
163+
node ./scripts/publish.js --snapshot --tag nightly
164+
141165
# Release candidate
142166
node ./scripts/publish.js --snapshot --tag rc
143167
```
144168

145169
Users can then install these versions with:
146170

147171
```bash
148-
yarn install @spectrum-web-components/button@beta
149-
yarn install @spectrum-web-components/button@alpha
150-
yarn install @spectrum-web-components/button@rc
172+
yarn add @spectrum-web-components/button@beta
173+
yarn add @spectrum-web-components/button@alpha
174+
yarn add @spectrum-web-components/button@nightly
175+
yarn add @spectrum-web-components/button@rc
151176
```
152177

153178
---

0 commit comments

Comments
 (0)