@rolemodel/optics 2.4.0 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,143 @@
1
+ ---
2
+ name: github-release
3
+ description: Draft, write, and publish an Optics release on GitHub — checks the version bump, resolves the previous tag, generates notes from the release.yml categories, adds a plain-language line under each PR, and publishes, which ships the package to npm and GitHub Packages and redeploys the docs site. Use this whenever the user mentions cutting a release, bumping the version, drafting or writing release notes, publishing to npm, "what's going out", or updating the CHANGELOG for a release — even if they don't say the words "release notes".
4
+ ---
5
+
6
+ # Optics Release
7
+
8
+ Adapted from the `github-release` skill in RoleModel/bgea_volunteer_care.
9
+
10
+ A release is two steps, with a person in between:
11
+
12
+ 1. **Draft** — check the version, write the notes, save an unpublished draft.
13
+ 2. **Publish** — only once the user says go. Publishing ships the package.
14
+
15
+ Keep them apart. Publishing a release fires `deploy-to-npm.yml` and `deploy-to-ghp.yml`, which
16
+ publish `@rolemodel/optics` to npm and GitHub Packages. An npm version number can never be
17
+ reused, so a mistake means another release.
18
+
19
+ | | |
20
+ | -------- | --------------------------------------------------------------- |
21
+ | Tag | `v2.5.0` (semver, lowercase `v`) |
22
+ | Title | Same as the tag |
23
+ | Baseline | The latest published release |
24
+ | Ships | The tip of `main` |
25
+ | Notes | The categories in `.github/release.yml`, one line under each PR |
26
+
27
+ ---
28
+
29
+ ## Phase 1 — Draft
30
+
31
+ ### 1. Check the version bump is on main
32
+
33
+ The version is bumped in a pull request, not at release time. Before drafting, `main` must have:
34
+
35
+ - `package.json` `"version"` set to the new number
36
+ - The three `.storybook/assets/*.html` example pages pointing at the new CDN version
37
+ - A `## [X.Y.Z] - YYYY-MM-DD` section at the top of `CHANGELOG.md`
38
+
39
+ ```bash
40
+ git fetch origin --tags
41
+ git show origin/main:package.json | grep '"version"'
42
+ grep -o 'optics@[0-9.]*' .storybook/assets/*.html
43
+ gh release list --limit 3
44
+ ```
45
+
46
+ If the version on `main` is not higher than the latest release, stop. Offer to open the bump PR
47
+ instead. Pick the number from what changed: breaking changes are a major bump, anything new is a
48
+ minor bump, and fixes only are a patch.
49
+
50
+ ### 2. Get the change list
51
+
52
+ ```bash
53
+ gh api repos/RoleModel/optics/releases/generate-notes \
54
+ -f tag_name=v<new> -f target_commitish=main -f previous_tag_name=<latest release tag> \
55
+ --jq .body
56
+ ```
57
+
58
+ GitHub sorts PRs into the `.github/release.yml` categories by label. Act on:
59
+
60
+ - **Unlabeled Changes (please categorize these)** — label each PR on GitHub, then generate again.
61
+ Don't ship this heading.
62
+ - **A PR listed twice** — GitHub puts a PR in the first category that matches. Move it only if
63
+ that category is wrong for what it did.
64
+ - **Commits with no PR** — `git log <latest tag>..origin/main --oneline` shows them. Mention one
65
+ only if it changed the shipped CSS.
66
+
67
+ Report what you found, for example "6 PRs: 1 component, 1 dependency, 4 docs; 1 unlabeled".
68
+
69
+ ### 3. Write a line under each PR
70
+
71
+ The readers are developers who use Optics in their apps. Under each PR, add one indented line
72
+ that says what changed for them: the class, token, or variable name, and what it now does. The
73
+ PR body's **Why?** and **What Changed** sections are the best source.
74
+
75
+ | Weak | Strong |
76
+ | ---------------------- | -------------------------------------------------------------------------------------------- |
77
+ | Update icon libraries | The icon library addons point at the latest versions, so every icon in each set is available |
78
+ | Fix documentation site | Fixed the sidebar examples and the switch syntax example on the documentation site |
79
+
80
+ - Dependency PRs: say whether they change the shipped CSS. They usually don't.
81
+ - A PR with nothing to explain (an admin or repo setting) can stand without a line.
82
+ - Keep GitHub's **New Contributors** and **Full Changelog** lines.
83
+
84
+ ### 4. Match the CHANGELOG
85
+
86
+ The `CHANGELOG.md` section for this version should list the same PRs in the same categories.
87
+ If it is missing one, say so. The fix is a follow-up PR, not an edit during the release.
88
+
89
+ ### 5. Create the draft
90
+
91
+ ```bash
92
+ gh release create v<new> --draft --title "v<new>" --notes-file <path> --target main
93
+ ```
94
+
95
+ A draft creates no tag and fires no workflow, so it is safe to redo (`gh release edit`,
96
+ `gh release delete`). Show the user the URL and print the full notes in the chat. Then stop.
97
+
98
+ ---
99
+
100
+ ## Phase 2 — Publish
101
+
102
+ Only after the user says to publish.
103
+
104
+ ```bash
105
+ gh release edit v<new> --draft=false --latest
106
+ ```
107
+
108
+ Then check the three release workflows:
109
+
110
+ ```bash
111
+ gh run list --workflow deploy-to-npm.yml --limit 1
112
+ gh run list --workflow deploy-to-ghp.yml --limit 1
113
+ gh run list --workflow publish-storybook.yml --limit 1
114
+ ```
115
+
116
+ - `publish-storybook.yml` runs on `release: created`. GitHub does not send `created` when a
117
+ draft is published, so the docs site likely did not redeploy. Run it:
118
+ `gh workflow run publish-storybook.yml --ref main`
119
+ - `deploy-to-npm.yml` publishes with npm Trusted Publishing (OIDC), so there is no token. If it
120
+ fails with `E404` or `ENEEDAUTH`, the trusted publisher on npmjs.com (package Settings → Trusted
121
+ Publisher) doesn't match this repo and workflow file. Someone with npm admin access fixes it
122
+ there. Never switch back to an `NPM_TOKEN` that bypasses 2FA.
123
+ - To retry, `gh run rerun <run id> --failed` builds from the tag with the workflow file as it was
124
+ at the tag. If the workflow was fixed after the tag, use
125
+ `gh workflow run deploy-to-npm.yml --ref main` instead, and only if `main` has no CSS changes
126
+ since the tag.
127
+
128
+ Confirm the package is out:
129
+
130
+ ```bash
131
+ npm view @rolemodel/optics version
132
+ ```
133
+
134
+ Finally, give the user the notes as a copyable block for Slack, without the Full Changelog link.
135
+
136
+ ---
137
+
138
+ ## Guardrails
139
+
140
+ - **Never publish without the user's go-ahead.** It ships a package version that can't be taken
141
+ back.
142
+ - **Never release from a branch.** The target is always `main`, after the bump PR has merged.
143
+ - **Never invent a PR or what it did.** If a PR body is thin, say the line is a guess and ask.
@@ -4,8 +4,12 @@ on:
4
4
  workflow_dispatch:
5
5
  release:
6
6
  types: [published]
7
+ # npm Trusted Publishing: GitHub proves who is publishing with a short-lived OIDC token, so there
8
+ # is no NPM_TOKEN to expire or leak. The trusted publisher is set on npmjs.com under the package's
9
+ # settings, and names this workflow file.
7
10
  permissions:
8
- contents: write
11
+ contents: read
12
+ id-token: write
9
13
  jobs:
10
14
  build-npm:
11
15
  runs-on: ubuntu-latest
@@ -15,8 +19,8 @@ jobs:
15
19
  with:
16
20
  node-version: '24.x'
17
21
  registry-url: 'https://registry.npmjs.org'
22
+ # Trusted Publishing needs npm 11.5.1 or later.
23
+ - run: npm install -g npm@latest
18
24
  - run: yarn install --immutable
19
25
  - run: yarn build
20
26
  - run: npm publish --access public
21
- env:
22
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -33,5 +33,7 @@ jobs:
33
33
  run: yarn build:css
34
34
  - name: Build Tokens
35
35
  run: yarn build:tokens
36
+ - name: Build LLMS Docs
37
+ run: yarn build-docs:llms
36
38
  - name: Build Storybook
37
- run: yarn build-storybook
39
+ run: yarn build-docs:storybook
@@ -24,12 +24,12 @@ jobs:
24
24
  yarn install --immutable
25
25
  - name: Build 🔧
26
26
  run: | # build the Storybook files
27
- yarn build-storybook
27
+ yarn build-docs
28
28
  - name: Deploy 🚀
29
29
  uses: JamesIves/github-pages-deploy-action@3.6.2
30
30
  with:
31
31
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32
32
  BRANCH: gh-pages # The branch the action should deploy to.
33
- FOLDER: storybook-static # The folder that the build-storybook script generates files.
33
+ FOLDER: storybook-static # The folder that the build-docs:storybook script generates files.
34
34
  CLEAN: true # Automatically remove deleted files from the deploy branch
35
35
  TARGET_FOLDER: docs # The folder that we serve our Storybook files from
package/.prettierignore CHANGED
@@ -2,3 +2,6 @@
2
2
  tools/templates
3
3
  .yarn/*
4
4
  optics-design-system.code-workspace
5
+
6
+ # Generated docs
7
+ llms-docs
Binary file