Skip to content

Commit afe0efd

Browse files
tylerbutleralexvy86CraigMacomber
authored
build: Remove lerna from client and build-tools (#16161)
We currently use lerna in some places in CI, but it is called via npx and thus its depednencies are not locked to a particular version., This means that lerna releases can break our pipelines. This PR removes lerna from the client and build-tools pipelines, as well as the independent package pipelines. Server release groups are left alone. - Removes all lerna dependencies from the client and build-tools release groups. - `lerna ls --toposort` has been replaced by a new command, `flub list`. The output of this command does not exactly match lerna's but it still seems to be sorted appropriately. - `lerna exec` uses in the pipeline have been replaced by `flub exec`. - Adds a .releaseGroup file to the root of each release group. I couldn't think of a simpler way to make the pipeline behave differently for release groups vs. independent packages. This is needed because the pack step in the pipeline uses the presence of the file to determine whether it needs to pack multiple packages or not. ### Not included in this PR Server release groups still use lerna. Changing them will be more difficult because they build in a docker context that is rooted at the release gropup root. I need to figure out a solution for them, so I'll do that separately from this PR. --------- Co-authored-by: Alex Villarreal <716334+alexvy86@users.noreply.github.com> Co-authored-by: Craig Macomber (Microsoft) <42876482+CraigMacomber@users.noreply.github.com>
1 parent 9bbb75c commit afe0efd

File tree

11 files changed

+406
-2122
lines changed

11 files changed

+406
-2122
lines changed

.releaseGroup

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The presence of this file in a directory indicates it is the root of a release group.

build-tools/.releaseGroup

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The presence of this file in a directory indicates it is the root of a release group.

build-tools/package.json

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,23 @@
1212
"author": "Microsoft and contributors",
1313
"scripts": {
1414
"build": "npm run build:compile && npm run lint && npm run build:docs",
15-
"build:ci": "lerna run build:compile --stream",
16-
"build:compile": "lerna run build:compile --stream",
17-
"build:docs": "lerna run build:docs --stream --parallel",
15+
"build:compile": "pnpm run -r --stream build:compile",
16+
"build:docs": "pnpm run -r --no-sort --stream build:docs",
1817
"build:fast": "fluid-build --root .. -g build-tools",
1918
"changelog": "conventional-changelog -p conventionalcommits -i CHANGELOG.md -s -r 2 --commit-path . -t build-tools_v --context lerna.json",
20-
"ci:build": "lerna run build:compile --stream",
21-
"ci:build:docs": "lerna run ci:build:docs --stream --parallel",
22-
"ci:eslint": "lerna run eslint --no-sort --stream",
23-
"ci:test": "npm run test:report ; t1=$? ; npm run test:copyresults ; exit $t1",
19+
"ci:build": "npm run build",
20+
"ci:eslint": "pnpm run -r --no-sort --stream --no-bail eslint",
21+
"ci:test": "npm run test:mocha:report",
2422
"ci:test:coverage": "npm run test:coverage ; t1=$? ; npm run test:copyresults ; exit $t1",
25-
"clean": "lerna run clean --stream --parallel && npm run clean:docs && npm run clean:nyc",
23+
"clean": "pnpm run -r --no-sort --stream clean && npm run clean:docs && npm run clean:nyc",
2624
"clean:docs": "rimraf --glob \"**/_api-extractor-temp\" \"docs/api/*/**\"",
2725
"clean:nyc": "rimraf --glob \"nyc/**\"",
2826
"commit": "git-cz",
2927
"format": "npm run prettier:fix",
3028
"preinstall": "node ../scripts/only-pnpm.cjs",
3129
"install:commitlint": "npm install --global @commitlint/config-conventional",
32-
"lint": "npm run prettier && npm run ci:eslint",
33-
"lint:fix": "lerna run lint:fix --no-sort --stream",
30+
"lint": "npm run syncpack:deps && npm run syncpack:versions && npm run prettier && npm run ci:eslint",
31+
"lint:fix": "npm run syncpack:deps:fix && npm run syncpack:versions:fix && npm run prettier:fix && pnpm run -r --no-sort --stream lint:fix",
3432
"policy-check": "node packages/build-cli/bin/dev check policy",
3533
"policy-check:asserts": "node packages/build-cli/bin/dev check policy --handler assert-short-codes --fix",
3634
"policy-check:fix": "node packages/build-cli/bin/dev check policy --excludeHandler assert-short-codes --fix",
@@ -43,14 +41,13 @@
4341
"test": "npm run test:mocha",
4442
"test:bail": "npm run test:mocha:bail",
4543
"test:copyresults": "copyfiles --exclude \"**/node_modules/**\" \"**/nyc/**\" nyc",
46-
"test:coverage": "c8 npm run test:report",
47-
"test:mocha": "lerna run test:mocha --stream --no-bail --no-sort",
48-
"test:mocha:bail": "lerna run test:mocha --stream",
49-
"test:mocha:report": "lerna run test:mocha --stream --no-bail --no-sort -- -- --reporter xunit --reporter-option output=nyc/mocha-junit-report.xml",
50-
"test:report": "npm run test:mocha:report",
51-
"tsc": "lerna run tsc --stream",
52-
"tsc:fast": "fluid-build --root .. -t tsc --buildTools",
53-
"watch": "lerna run --parallel tsc -- -- --watch"
44+
"test:coverage": "c8 npm run test:mocha:report",
45+
"test:mocha": "pnpm run -r --no-sort --stream --no-bail test:mocha --color",
46+
"test:mocha:bail": "pnpm run -r --no-sort --stream test:mocha",
47+
"test:mocha:report": "pnpm run -r --no-sort --stream --no-bail test:mocha:multireport -- --timeout 4s",
48+
"tsc": "fluid-build --task tsc",
49+
"tsc:fast": "fluid-build --root . --task tsc --worker",
50+
"watch": "pnpm run -r --parallel tsc --watch"
5451
},
5552
"nyc": {
5653
"all": true,
@@ -69,8 +66,9 @@
6966
"@commitlint/cli": "^17.6.6",
7067
"@commitlint/config-conventional": "^17.6.6",
7168
"@commitlint/cz-commitlint": "^17.5.0",
69+
"@fluid-tools/build-cli": "^0.22.0",
7270
"@fluidframework/build-common": "^2.0.0",
73-
"@fluidframework/build-tools": "^0.21.0",
71+
"@fluidframework/build-tools": "^0.22.0",
7472
"@microsoft/api-documenter": "^7.22.24",
7573
"@microsoft/api-extractor": "^7.36.1",
7674
"c8": "^7.14.0",
@@ -82,7 +80,6 @@
8280
"cz-conventional-changelog": "^3.3.0",
8381
"cz-customizable": "^7.0.0",
8482
"inquirer": "^8.2.5",
85-
"lerna": "^5.6.2",
8683
"prettier": "~2.6.2",
8784
"rimraf": "^4.4.1",
8885
"run-script-os": "^1.1.6",

0 commit comments

Comments
 (0)