Skip to content

Commit

Permalink
feat!: update to lerna v4
Browse files Browse the repository at this point in the history
BREAKING CHANGE: upgrade to lerna v4
  • Loading branch information
escapedcat committed Feb 28, 2021
1 parent 0f1f5eb commit d63d7a4
Show file tree
Hide file tree
Showing 15 changed files with 1,492 additions and 1,675 deletions.
2 changes: 1 addition & 1 deletion @commitlint/config-lerna-scopes/fixtures/basic/lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lerna": "3.22.1",
"lerna": "4",
"version": "1.0.0",
"packages": ["packages/*"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "basic",
"version": "1.0.0",
"devDependencies": {
"lerna": "^3.0.0"
"lerna": "^4.0.0"
}
}
2 changes: 1 addition & 1 deletion @commitlint/config-lerna-scopes/fixtures/empty/lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lerna": "3.22.1",
"lerna": "4",
"version": "1.0.0",
"packages": ["packages/*"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "empty",
"version": "1.0.0",
"devDependencies": {
"lerna": "^3.0.0"
"lerna": "^4.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lerna": "2.4.0",
"lerna": "4",
"version": "1.0.0",
"packages": ["packages/*"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "version-mismatch",
"version": "1.0.0",
"devDependencies": {
"lerna": "^2.0.0"
"lerna": "^4.0.0"
}
}
2 changes: 1 addition & 1 deletion @commitlint/config-lerna-scopes/fixtures/scoped/lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lerna": "3.22.1",
"lerna": "4",
"version": "1.0.0",
"packages": ["@packages/*"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "scoped",
"version": "1.0.0",
"devDependencies": {
"lerna": "^3.0.0"
"lerna": "^4.0.0"
}
}
2 changes: 1 addition & 1 deletion @commitlint/config-lerna-scopes/fixtures/yarn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "yarn",
"version": "1.0.0",
"devDependencies": {
"lerna": "^3.0.0"
"lerna": "^4.0.0"
},
"workspaces": [
"@packages/*"
Expand Down
5 changes: 2 additions & 3 deletions @commitlint/config-lerna-scopes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ function getPackages(context) {
});
}

const Project = importFrom(cwd, '@lerna/project');
const project = new Project(cwd);
return project.getPackages();
const {getPackages} = importFrom(cwd, '@lerna/project');
return getPackages(cwd);
})
.then((packages) => {
return packages
Expand Down
2 changes: 1 addition & 1 deletion @commitlint/config-lerna-scopes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"homepage": "https://github.com/conventional-changelog/commitlint#readme",
"peerDependencies": {
"lerna": "^3.22.1"
"lerna": "^4.0.0"
},
"engines": {
"node": ">=v10"
Expand Down
8 changes: 2 additions & 6 deletions @packages/test/src/lerna.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'path';
import fs from 'fs-extra';
import path from 'path';
import resolvePkg from 'resolve-pkg';
import * as fix from './fix';

Expand All @@ -10,11 +10,7 @@ export async function bootstrap(
directory: string
): Promise<string> {
const cwd = await fix.bootstrap(`fixtures/${fixture}`, directory);
// this used to test lerna v2 and v3
// the v2 option is removed here, lerna version tests as well
// all the code to test differnt version is still in place
// cause i'm not sure how to remove this properly
const lerna = 'lerna-v3';
const lerna = 'lerna';
await fs.mkdirp(path.join(cwd, 'node_modules', '@lerna'));
await fs.symlink(
resolvePkg('@lerna/project')!,
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lerna": "3",
"lerna": "4",
"npmClient": "yarn",
"useWorkspaces": true,
"version": "12.0.1"
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@
"eslint-plugin-jest": "^24.0.0",
"husky": "^5.1.1",
"jest": "26.6.3",
"lerna": "^3.22.1",
"lerna-v3": "npm:lerna@3",
"lerna": "^4.0.0",
"lint-staged": "10.5.4",
"prettier": "^2.0.5",
"ts-jest": "26.5.2",
Expand Down
Loading

0 comments on commit d63d7a4

Please sign in to comment.