Skip to content

Commit 401ab13

Browse files
Migrate from Rush to pnpm workspaces + Chronus (#5190)
## Summary Migrates the monorepo from Rush to native pnpm workspaces with Chronus for changelog management. ### Changes - **Package management**: Rush → pnpm workspaces (via `pnpm-workspace.yaml`) - **Changelog/versioning**: `rush change` → `chronus add` / `chronus verify` / `chronus version` - **Root package.json**: Added with workspace-level scripts (`build`, `test:ci`, `lint`, `format`, `watch`, etc.) - **CI pipelines**: Updated all ADO pipelines and GitHub Actions to use `pnpm` and `chronus` commands - **Removed**: `rush.json`, `common/` directory, rush-specific eng scripts (`bump-for-prerelease.js`, `helpers.js`, `format.js`, etc.) - **Moved**: `common/config/webpack.base.config.js` → `eng/config/webpack.base.config.js` - **Simplified**: `workspace:~X.Y.Z` → `workspace:~` in all package.json files ### New developer workflow ```bash corepack enable pnpm install pnpm build pnpm test:ci pnpm change # add changelog entry (replaces rush change) ```
1 parent fc5918b commit 401ab13

62 files changed

Lines changed: 849 additions & 2664 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
changeKind: fix
3+
packages:
4+
- "@azure-tools/extension"
5+
---
6+
7+
Remove unused npm dependency; simplify to always use Yarn
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
changeKind: fix
3+
packages:
4+
- "@autorest/core"
5+
- "autorest"
6+
---
7+
8+
Update ExtensionManager.Create call after removing packageManagerType param

.chronus/config.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
baseBranch: main
2+
baseRemote: https://github.com/Azure/autorest
3+
changelog: ["@chronus/github/changelog", { repo: "Azure/autorest" }]
4+
5+
ignore:
6+
- "@autorest/test-public-packages"
7+
8+
changeKinds:
9+
breaking:
10+
versionType: major
11+
title: Breaking Changes
12+
description: Changes that break existing features
13+
14+
feature:
15+
versionType: minor
16+
title: Features
17+
description: New features added
18+
19+
fix:
20+
versionType: patch
21+
title: Bug Fixes
22+
description: Fixes to existing features
23+
24+
deprecation:
25+
versionType: minor
26+
title: Deprecations
27+
description: Deprecated features
28+
29+
internal:
30+
versionType: none
31+
title: Internal
32+
description: Internal changes that are not user facing
33+
34+
changedFiles:
35+
- "!**/*.md"
36+
- "!**/*.test.ts"

.default-eslintrc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ rules:
5656
"require-atomic-updates": off
5757

5858
# Prettier config https://github.com/prettier/eslint-plugin-prettier#recommended-configuration
59-
prettier/prettier: off # Don't run prettier in eslint we have rush check-format for that.
59+
prettier/prettier: off # Don't run prettier in eslint we have pnpm format:check for that.
6060
arrow-body-style: off
6161
prefer-arrow-callback: off
6262

.github/workflows/consitency-checks.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
uses: actions/setup-node@v4
1717
with:
1818
node-version: 22.x
19+
- run: corepack enable
20+
- run: pnpm install --frozen-lockfile
1921
- run: |
2022
LABEL_NAME=Publish
2123
LABEL_URL=https://api.github.com/repos/Azure/autorest/issues/$PR_NUMBER/labels
@@ -25,7 +27,7 @@ jobs:
2527
then
2628
echo "Publish label was included in the PR, won't be checking for changelog."
2729
else
28-
npx @microsoft/rush change --verify || { echo 'If you run the rush publish command locally and meant to publish the changes, add the publish label to the pr.' ; exit 1; }
30+
pnpm chronus verify || { echo 'If you meant to publish the changes, add the publish label to the pr.' ; exit 1; }
2931
fi
3032
env:
3133
PR_NUMBER: ${{ github.event.pull_request.number }}

.github/workflows/prepare-auto-release-branch.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ jobs:
2424
with:
2525
node-version: 22.x
2626

27-
- run: node common/scripts/install-run-rush.js install
27+
- run: corepack enable
28+
29+
- run: pnpm install --frozen-lockfile
2830
name: Install dependencies
2931

3032
- name: Create release branch
3133
run: node ./eng/scripts/publish.mjs
32-
33-
- run: node common/scripts/install-run-rush.js update
34-
name: Regen lock file

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,8 @@ jspm_packages/
285285
# Common toolchain intermediate files
286286
temp
287287

288-
# Rush files
289-
common/temp/**
290-
package-deps.json
291-
common/config/rush/shrinkwrap.yaml
288+
# pnpm
289+
.chronus/artifacts
292290

293291
# Code generation output for regression tests
294292
core/test/regression

.npmrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
enable-pre-post-scripts=true
2+
only-built-dependencies[]=tree-sitter
3+
only-built-dependencies[]=tree-sitter-javascript
4+
only-built-dependencies[]=tree-sitter-python
5+
only-built-dependencies[]=tree-sitter-typescript

CONTRIBUTING.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Then go to https://github.com/Azure/autorest/pull/new/publish/auto-release and c
1010
- **On windows**: Make sure to choose to install the native build dependencies in the setup
1111
- Alternatively follow instruction here https://github.com/nodejs/node-gyp
1212
- `python` 3.x
13+
- `pnpm` (enabled via corepack: `corepack enable`)
1314

1415
Optional recommendation:
1516

@@ -21,25 +22,25 @@ Optional recommendation:
2122

2223
## First build
2324

24-
1. Install [rush.js](https://rushjs.io/pages/intro/get_started/) using
25+
1. Enable corepack (if not already)
2526

2627
```bash
27-
npm install -g @microsoft/rush
28+
corepack enable
2829
```
2930

3031
2. Install dependencies
3132

3233
```bash
33-
rush update
34+
pnpm install
3435
```
3536

3637
3. Build
3738

3839
```bash
39-
rush build
40+
pnpm build
4041

4142
# or to do a force rebuild.
42-
rush rebuild
43+
pnpm rebuild
4344
```
4445

4546
## Run in watch mode
@@ -48,9 +49,9 @@ When working on autorest it is recommended to have the compiler run in watch mod
4849

4950
```bash
5051
# Run for all packages.
51-
rush watch
52+
pnpm watch
5253
# Run for a specific package.
53-
npm run watch
54+
pnpm run watch
5455
```
5556

5657
## Test
@@ -62,7 +63,7 @@ To run the test on the built product you have 2 options:
6263
1. Run all the tests using
6364

6465
```bash
65-
rush test:ci
66+
pnpm test:ci
6667
```
6768

6869
2. Run individual project tests(Recommended when working on test)
@@ -74,7 +75,7 @@ cd packages/<type>/<package>/
7475
# Run test in interactive mode
7576
npm test
7677

77-
# Alternatively you can run them once with coverage(Same as rush test:ci)
78+
# Alternatively you can run them once with coverage(Same as pnpm test:ci)
7879
npm run test:ci
7980
```
8081

@@ -84,7 +85,7 @@ npm run test:ci
8485

8586
```bash
8687
# Run for all packages.
87-
rush lint
88+
pnpm lint
8889
# Run for a specific package.
8990
npm run lint
9091
```
@@ -93,7 +94,7 @@ npm run lint
9394

9495
```bash
9596
# Run for all packages.
96-
rush clean
97+
pnpm clean
9798
# Run for a specific package.
9899
npm run clean
99100
```
@@ -124,10 +125,10 @@ node <path-to-repo>/packages/apps/autorest/entrypoints/app.js
124125

125126
Steps to do before making a pull request:
126127

127-
1. Run `rush change` and describe the change and if it should be a `major`, `minor` or `patch` version.
128+
1. Run `pnpm change` and describe the change and if it should be a `major`, `minor` or `patch` version.
128129

129130
- `major`: If there is a breaking change.(Except `autorest`, `@autorest/core` and `@autorest/modelefour` packages which should use minor bump for that.)
130131
- `minor`: If there is a new feature but not breaking(Except `autorest`, `@autorest/core` and `@autorest/modelefour` packages)
131132
- `patch`: For any bug fix.
132133

133-
2. Run `rush format` to ensure the code is formatted correctly.
134+
2. Run `pnpm format` to ensure the code is formatted correctly.

common/changes/@autorest/core/timotheeguerin-upgrade-rush-pnpm_2026-06-09-18-06.json

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

0 commit comments

Comments
 (0)