Skip to content

Commit bcb1763

Browse files
committed
chore: migrate from Yarn Classic to pnpm
Replace Yarn 1.x with pnpm 10 as the workspace package manager. - Add pnpm-workspace.yaml and .npmrc (frozen-lockfile, save-exact, registry pin, shamefully-hoist) - Add packageManager field for Corepack support - Update CI workflows with pnpm/action-setup and dependency caching - Convert workspace cross-reference from link: to workspace: protocol - Drop lockfile-lint (pnpm lockfile not vulnerable to URL injection; .npmrc registry pin provides equivalent protection) - Replace npm-run-all in root ci script with plain && chain (npm-run-all2 v5+ delegates to pnpm which chokes on the commitizen config block in package.json) - Add pnpmDedupe to Renovate postUpdateOptions - Update documentation
1 parent ec2b0a5 commit bcb1763

21 files changed

Lines changed: 12319 additions & 11109 deletions

File tree

‎.changeset/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ We have a quick list of common questions to get you started engaging with this p
1212
This monorepo replaced Lerna with [Changesets](https://github.com/changesets/changesets) for
1313
versioning and releases. The flow is:
1414

15-
1. **In your PR**, run `yarn changeset` and answer the prompts (which packages, semver level,
15+
1. **In your PR**, run `pnpm changeset` and answer the prompts (which packages, semver level,
1616
summary). Commit the generated `.changeset/<random-name>.md` file alongside your code change.
1717
2. When your PR is merged to `main`, the **Release** workflow opens (or updates) a single
1818
`Version Packages` PR that aggregates all pending changesets — bumping versions and updating
@@ -23,4 +23,4 @@ versioning and releases. The flow is:
2323
Private packages (`test-packages/*`, `demos/*`) are skipped automatically by `changeset publish`.
2424
Only the public packages under `packages/*` are released.
2525

26-
If a change does not warrant a release (docs-only, internal tooling, test refactors, etc.) run `yarn changeset:empty` and commit the generated file — it satisfies the required changeset check without producing any package bump.
26+
If a change does not warrant a release (docs-only, internal tooling, test refactors, etc.) run `pnpm changeset:empty` and commit the generated file — it satisfies the required changeset check without producing any package bump.

‎.changeset/wicked-views-behave.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

‎.github/workflows/changeset.yml‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,24 @@ jobs:
3333
# Full history so `changeset status --since=origin/main` can diff.
3434
fetch-depth: 0
3535

36+
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
3637
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
3738
with:
3839
node-version: 24.x
40+
cache: "pnpm"
3941

4042
- name: Install dependencies
41-
run: yarn --frozen-lockfile
43+
run: pnpm install --frozen-lockfile
4244

4345
# Fails the PR if no changeset describes the change.
44-
# Add one with `yarn changeset` (or `yarn changeset:empty` for PRs
46+
# Add one with `pnpm changeset` (or `pnpm changeset:empty` for PRs
4547
# that don't need a release entry) and commit it.
4648
# We check `.changesets` (not `.releases`) so that empty changesets
4749
# — which have 0 package bumps but still document the PR — pass.
4850
- name: Verify changeset is present
4951
run: |
50-
yarn changeset status --since=origin/main --output=/tmp/cs.json
52+
pnpm changeset status --since=origin/main --output=/tmp/cs.json
5153
if [ "$(jq '.changesets | length' /tmp/cs.json)" -eq 0 ]; then
52-
echo "::error::No changeset found on this PR. Run 'yarn changeset' (or 'yarn changeset:empty' for PRs that don't need a release entry) and commit the file."
54+
echo "::error::No changeset found on this PR. Run 'pnpm changeset' (or 'pnpm changeset:empty' for PRs that don't need a release entry) and commit the file."
5355
exit 1
5456
fi

‎.github/workflows/ci.yml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,14 @@ jobs:
3232
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
3333
with:
3434
ref: ${{ inputs.pr_number && format('refs/pull/{0}/head', inputs.pr_number) || '' }}
35+
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
3536
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
3637
with:
3738
node-version: ${{ matrix.node_version }}
39+
cache: "pnpm"
3840

3941
- name: Install dependencies
40-
run: yarn --frozen-lockfile
42+
run: pnpm install --frozen-lockfile
4143

4244
- name: Build
43-
run: yarn run ci
45+
run: pnpm run ci

‎.github/workflows/release.yml‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,21 @@ jobs:
2828
with:
2929
fetch-depth: 0
3030

31+
- name: Setup pnpm
32+
uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
33+
3134
- name: Setup node
3235
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
3336
with:
3437
node-version: 24.15.0
3538
registry-url: https://registry.npmjs.org
39+
cache: "pnpm"
3640

3741
- name: Install dependencies
38-
run: yarn --frozen-lockfile
42+
run: pnpm install --frozen-lockfile
3943

4044
- name: Build
41-
run: yarn build
45+
run: pnpm run build
4246

4347
- name: Detect auth mode (OIDC vs token)
4448
env:
@@ -61,8 +65,8 @@ jobs:
6165
id: changesets
6266
uses: changesets/action@63a615b9cd06ba9a3e6d13796c7fbcb080a60a0b # v1.8.0
6367
with:
64-
version: yarn run version-packages
65-
publish: yarn run release-publish
68+
version: pnpm run version-packages
69+
publish: pnpm run release-publish
6670
commit: "chore(release): publish"
6771
title: "chore(release): publish"
6872
env:

‎.gitignore‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
logs
33
*.log
44
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
5+
pnpm-debug.log*
76

87
# Some Mac stuff
98
.DS_Store
@@ -54,17 +53,15 @@ typings/
5453
# Output of 'npm pack'
5554
*.tgz
5655

57-
# Yarn Integrity file
58-
.yarn-integrity
59-
6056
# dotenv environment variables file
6157
.env
6258

6359
# next.js build output
6460
.next
6561

66-
# npm lock file
62+
# Other package manager lockfiles (this repo uses pnpm)
6763
package-lock.json
64+
yarn.lock
6865
.idea
6966

7067
# build results

‎.npmrc‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Supply-chain hardening — registry and auth only (pnpm 12+).
2+
# All other settings live in pnpm-workspace.yaml.
3+
4+
# Explicit registry — prevents dependency confusion.
5+
registry=https://registry.npmjs.org/

‎.yarnrc‎

Lines changed: 0 additions & 11 deletions
This file was deleted.

‎CONTRIBUTING.md‎

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ A reproducible example (a minimal repo or a [TypeScript Hello World](https://git
3232
### Pre-requisites
3333

3434
- A current [Long-Term Support version](https://nodejs.org/en/about/releases/) of Node.js (>= 22; CI tests on 22.x and 24.x).
35-
- [Yarn 1.x](https://classic.yarnpkg.com/lang/en/docs/install/) — this repo uses yarn classic with workspaces.
35+
- [pnpm](https://pnpm.io/installation) — this repo uses pnpm workspaces. If you have [Corepack](https://nodejs.org/api/corepack.html) enabled (`corepack enable`), pnpm will be installed automatically from the `packageManager` field in package.json.
3636
- (optional) [commitizen](https://github.com/commitizen/cz-cli#installing-the-command-line-tool) for managing commit messages.
3737

3838
### Initial Setup
3939

4040
The initial setup is trivial:
4141

4242
- clone this repo
43-
- `yarn`
43+
- `pnpm install`
4444

45-
The repo's `.yarnrc` enforces `--frozen-lockfile`, exact-version saves (`save-prefix ""`), and a pinned registry — that's intentional supply-chain hardening, please don't loosen it without discussion.
45+
The repo's `.npmrc` enforces `frozen-lockfile=true`, exact-version saves (`save-exact=true`), and a pinned registry — that's intentional supply-chain hardening, please don't loosen it without discussion.
4646

4747
### Repository Layout
4848

@@ -82,7 +82,7 @@ fix(ts-interface-generator): handle aggregations with cardinality 0..1
8282
chore: bump root devDependencies
8383
```
8484

85-
The scope is also what `yarn changeset:auto` uses to figure out which packages to bump (see [Releases](#release-process) below). Breaking changes are signalled with a `!` after the type/scope **or** a `BREAKING CHANGE:` footer in the body — either flips the bump to `major`.
85+
The scope is also what `pnpm changeset:auto` uses to figure out which packages to bump (see [Releases](#release-process) below). Breaking changes are signalled with a `!` after the type/scope **or** a `BREAKING CHANGE:` footer in the body — either flips the bump to `major`.
8686

8787
### Formatting
8888

@@ -93,8 +93,8 @@ However, this does mean that dev flows that do not use a full dev env (e.g editi
9393
To run it manually:
9494

9595
```sh
96-
yarn format:fix # rewrite files
97-
yarn format:validate # check, no rewrite (this is what CI runs)
96+
pnpm format:fix # rewrite files
97+
pnpm format:validate # check, no rewrite (this is what CI runs)
9898
```
9999

100100
### Compiling
@@ -104,14 +104,14 @@ See the respective sub-packages for instructions (if needed at all).
104104
To build both publishable packages from the root:
105105

106106
```sh
107-
yarn build
107+
pnpm run build
108108
```
109109

110-
Per-package work uses yarn's workspace shorthand:
110+
Per-package work uses pnpm's filter shorthand:
111111

112112
```sh
113-
yarn workspace @ui5/dts-generator build
114-
yarn workspace @ui5/ts-interface-generator test
113+
pnpm --filter @ui5/dts-generator run build
114+
pnpm --filter @ui5/ts-interface-generator run test
115115
```
116116

117117
### Testing
@@ -121,14 +121,14 @@ yarn workspace @ui5/ts-interface-generator test
121121
[mocha]: https://mochajs.org/
122122
[chai]: https://www.chaijs.com
123123

124-
- To run the tests, execute `yarn test` in a specific sub-package.
124+
- To run the tests, execute `pnpm run test` in a specific sub-package.
125125
- Note that not all sub-packages contain tests.
126126

127127
When adding a feature or fixing a bug, **please add or extend a test**. PRs without tests will get a friendly nudge.
128128

129129
### Full Build
130130

131-
To run the full **C**ontinuous **I**ntegration build run `yarn ci` in either the top-level package or a specific subpackage.
131+
To run the full **C**ontinuous **I**ntegration build run `pnpm run ci` in either the top-level package or a specific subpackage.
132132

133133
## Pull Requests
134134

@@ -155,13 +155,13 @@ When your PR changes one or more public packages, add a changeset alongside your
155155

156156
| Command | When to use |
157157
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
158-
| `yarn changeset:auto` | **Recommended for most PRs.** Walks the conventional-commit history on your branch and writes one `.changeset/auto-<sha>.md` per qualifying commit (packages from the commit `scope`, bump from the `type`, summary from the `subject`). Idempotent — safe to re-run. Already-covered commits are skipped, so any hand-written changeset always wins. |
159-
| `yarn changeset` | Interactive — pick packages, bump type, and write a summary by hand. Use when the auto-derived bump or summary is wrong (e.g. a `chore:` commit that secretly contains a `feat:`). The next `:auto` run will then skip the commit because it's covered. |
160-
| `yarn changeset:empty` | Docs- or tooling-only PRs that touch no public package. Writes an empty `.changeset/*.md` so the "no changeset detected" hint goes away without producing any CHANGELOG entry. |
158+
| `pnpm changeset:auto` | **Recommended for most PRs.** Walks the conventional-commit history on your branch and writes one `.changeset/auto-<sha>.md` per qualifying commit (packages from the commit `scope`, bump from the `type`, summary from the `subject`). Idempotent — safe to re-run. Already-covered commits are skipped, so any hand-written changeset always wins. |
159+
| `pnpm changeset` | Interactive — pick packages, bump type, and write a summary by hand. Use when the auto-derived bump or summary is wrong (e.g. a `chore:` commit that secretly contains a `feat:`). The next `:auto` run will then skip the commit because it's covered. |
160+
| `pnpm changeset:empty` | Docs- or tooling-only PRs that touch no public package. Writes an empty `.changeset/*.md` so the "no changeset detected" hint goes away without producing any CHANGELOG entry. |
161161

162162
Whichever you pick, **commit the resulting `.changeset/*.md` file alongside your code change**.
163163

164-
How `yarn changeset:auto` chooses the bump:
164+
How `pnpm changeset:auto` chooses the bump:
165165

166166
| Conventional-commit `type` (or marker) | Bump |
167167
| ---------------------------------------------------------- | ------- |
@@ -173,13 +173,13 @@ How `yarn changeset:auto` chooses the bump:
173173

174174
Commits whose only file changes are under `packages/<pkg>/test/` are also skipped — test-only changes don't ship in the published tarball.
175175

176-
If a change does not warrant a release at all (CI tweaks, internal tooling, etc.) run `yarn changeset:empty` and commit the generated file — it satisfies the required changeset check without producing any package release.
176+
If a change does not warrant a release at all (CI tweaks, internal tooling, etc.) run `pnpm changeset:empty` and commit the generated file — it satisfies the required changeset check without producing any package release.
177177

178178
### For maintainers — cutting a release
179179

180180
The release itself happens entirely on GitHub. You don't need npm credentials or a clean local checkout.
181181

182-
1. When a PR with at least one changeset is merged into `main`, the [`Release`](.github/workflows/release.yml) workflow opens (or updates) a single **`Version Packages`** PR. That PR aggregates every pending changeset, bumps the affected `package.json` versions, regenerates each package's `CHANGELOG.md`, and refreshes `yarn.lock`.
182+
1. When a PR with at least one changeset is merged into `main`, the [`Release`](.github/workflows/release.yml) workflow opens (or updates) a single **`Version Packages`** PR. That PR aggregates every pending changeset, bumps the affected `package.json` versions, regenerates each package's `CHANGELOG.md`, and refreshes `pnpm-lock.yaml`.
183183
2. Review and merge that **`Version Packages`** PR when you're ready to cut a release.
184184
3. Merging it triggers the same workflow again, this time on the `publish` path: `changeset publish` runs, the new versions go to npm (with [npm provenance](https://docs.npmjs.com/generating-provenance-statements)), and matching git tags are pushed.
185185
4. Spot-check the newly published artifacts on [npmjs.com](https://www.npmjs.com/package/@ui5/dts-generator).
@@ -199,10 +199,10 @@ Not currently configured. If we need them, [`changeset pre enter <tag>`](https:/
199199
To upgrade the version of the dependencies, [`npm-check-updates`](https://github.com/raineorshine/npm-check-updates) is wired up at the root:
200200

201201
```sh
202-
yarn ncu # list outdated packages across the workspace
203-
yarn ncu-u # apply the bumps to every package.json
204-
yarn install # refresh yarn.lock
205-
yarn ci # sanity-check before opening the PR
202+
pnpm ncu # list outdated packages across the workspace
203+
pnpm ncu-u # apply the bumps to every package.json
204+
pnpm install # refresh pnpm-lock.yaml
205+
pnpm run ci # sanity-check before opening the PR
206206
```
207207

208208
## Where to ask questions

‎README.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ With Yarn
3434

3535
`yarn add @sapui5/types --dev`
3636

37+
With pnpm
38+
39+
`pnpm add @sapui5/types --save-dev`
40+
3741
> **NOTE:** the type definitions define ES6-style module names for the entities. They require the usage of modern JavaScript syntax with ES modules and classes, which requires an additional transformation step that can be run together with the anyway required TypeScript transpilation.
3842
>
3943
> Before the type definitions were generated in ES module style, they did declare all APIs with their global names, which are discouraged to be used and will no longer be available in UI5 2.x. The dts-generator still has the capability to generate this legacy "globals" version of the type definitions, for compatibility reasons. These legacy definitions are released as "ts-types" instead of "types", but will no longer be produced for UI5 2.x.

0 commit comments

Comments
 (0)