Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .changeset/changelog.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// @changesets/apply-release-plan resolves the changelog generator with
// `import-meta-resolve`, which is not Yarn PnP-aware, so the bare package name
// fails under `nodeLinker: pnp`. A relative path resolves as a file URL instead.
export { default } from '@changesets/changelog-github';
4 changes: 2 additions & 2 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "toss/react-simplikit" }],
"$schema": "https://unpkg.com/@changesets/config@4.0.0/schema.json",
"changelog": ["./changelog.mjs", { "repo": "toss/react-simplikit" }],
"commit": false,
"fixed": [],
"linked": [],
Expand Down
35 changes: 19 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,30 @@ jobs:
- name: Type Check
run: yarn run test:type

- name: Create Release Pull Request
# v2.1.1, not v2.1.0: v2.1.0 ignores `commit-message` due to a typo.
# Publishing goes through `yarn npm publish` (changesets v3 + Yarn Berry), so
# provenance is Yarn's setting; `NPM_CONFIG_PROVENANCE` would be ignored.
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@198f833dd7d863100ea6e28967bc9a9fdefadb0a # v2.1.0
uses: changesets/action@8488615a623b1b9c987934bb89eae8af6a946ac1 # v2.1.1
with:
title: 'chore: version packages'
commit: 'chore: version packages'
version: yarn run changeset:version
pr-title: 'chore: version packages'
commit-message: 'chore: version packages'
version-script: yarn run changeset:version
publish-script: yarn run changeset:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
YARN_NPM_PUBLISH_PROVENANCE: true

- name: Publish to npm
if: steps.changesets.outputs.hasChangesets == 'false'
run: yarn run changeset:publish
- name: Summarize published packages
if: steps.changesets.outputs.published == 'true'
env:
NPM_CONFIG_PROVENANCE: true

# changeset publish creates tags locally but never pushes them.
# --tags, not --follow-tags: changesets creates lightweight tags.
- name: Push tags
if: steps.changesets.outputs.hasChangesets == 'false'
run: git push origin --tags
PUBLISHED_PACKAGES: ${{ steps.changesets.outputs.published-packages }}
run: |
{
echo "## Published to npm"
echo
echo "$PUBLISHED_PACKAGES" | jq -r '.[] | "- [\(.name)@\(.version)](https://www.npmjs.com/package/\(.name)/v/\(.version))"'
} >> "$GITHUB_STEP_SUMMARY"

get-diffs:
runs-on: ubuntu-latest
Expand Down
897 changes: 281 additions & 616 deletions .pnp.cjs

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
17 changes: 11 additions & 6 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,27 +145,32 @@ Uses **Changesets** + **GitHub Actions OIDC** for automated releases.
```
PR with changeset merged → release.yml triggers
→ changesets/action detects changeset → creates "Version PR"
→ Version PR merged → changesets/action: hasChangesets=false
→ "Publish to npm" step → changeset publish (uses npm publish internally)
→ Version PR merged → changesets/action: has-changesets=false
→ action runs `publish-script` (changeset publish → `yarn npm publish`), pushes tags, creates GitHub Releases
```

### Changesets v3 + Yarn PnP

- `changesets/action` v2 requires `@changesets/cli` v3 — bump both majors together.
- `.changeset/config.json` points `changelog` at the shim `.changeset/changelog.mjs`, not `@changesets/changelog-github` directly — the bare package name does not resolve under PnP (see the shim). Do not "simplify" it back.

### Critical: publishConfig does NOT work with npm

**npm does NOT support `publishConfig` overrides for manifest fields** (`main`, `types`, `module`, `exports`). Only `access`, `registry`, `tag` are supported. See [npm/cli#7586](https://github.com/npm/cli/issues/7586).

- `yarn npm publish` DOES support publishConfig field overrides
- `changeset publish` internally calls `npm publish` (not yarn)
- `changeset publish` v3 calls `yarn npm publish` for Yarn Berry, but manifests must stay valid for plain `npm pack` (`verify-pack`)
- Therefore: **always declare `main`/`types`/`module`/`exports` at the top level** of package.json
- `publishConfig` should only contain `access: "public"`

### OIDC Trusted Publishing

- npm auth uses GitHub Actions OIDC (no secret tokens needed)
- Requires `id-token: write` permission in workflow
- OIDC publishing requires npm >= 11.5.0 ([npm/cli#8336](https://github.com/npm/cli/pull/8336)); Node 24 bundles npm 11.17+, so no manual npm upgrade is needed
- The OIDC exchange is done by Yarn (`yarn npm publish`; the pinned `yarnPath` 4.18 supports it), not by the npm CLI
- Do NOT reinstate `npm install -g npm@latest` — it is unpinned, and it broke the release job once npm 12 raised its Node floor above `.nvmrc`
- `changesets/action` must NOT have `publish` option (it overwrites `.npmrc` and breaks OIDC)
- Publish is done in a separate step after changesets/action
- Publish runs via the action's `publish-script`; it must keep invoking the Changesets CLI (it reads `CHANGESETS_OUTPUT` to know what to tag/release)
- Provenance: `YARN_NPM_PUBLISH_PROVENANCE: true` — `NPM_CONFIG_PROVENANCE` is ignored by Yarn

### Snapshot/Canary Releases

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"@babel/core": "^7.29.0",
"@babel/preset-react": "^7.27.0",
"@babel/preset-typescript": "^7.28.0",
"@changesets/changelog-github": "^0.5.1",
"@changesets/cli": "^2.29.7",
"@changesets/changelog-github": "^1.0.0",
"@changesets/cli": "^3.0.1",
"@eslint/js": "^9.39.3",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
"@babel/core": "^7.29.0",
"@babel/preset-react": "^7.27.0",
"@babel/preset-typescript": "^7.28.0",
"@changesets/changelog-github": "^0.5.1",
"@changesets/cli": "^2.29.7",
"@changesets/changelog-github": "^1.0.0",
"@changesets/cli": "^3.0.1",
"@eslint/js": "^9.16.0",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
Expand Down
Loading
Loading