-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
47e9369
commit 12c24a8
Showing
9 changed files
with
108 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright IBM Corp. 2018. All Rights Reserved. | ||
// Node module: loopback-next | ||
// This file is licensed under the MIT License. | ||
// License text available at https://opensource.org/licenses/MIT | ||
|
||
/** | ||
* This is an internal script to list lerna packages for loopback-next. | ||
* See https://github.com/marionebl/commitlint/pull/406 | ||
*/ | ||
'use strict'; | ||
|
||
const getPackages = require('@lerna/project').getPackages; | ||
module.exports = { | ||
rules: { | ||
// https://github.com/marionebl/commitlint/blob/master/docs/reference-rules.md | ||
'scope-enum': async ctx => [2, 'always', await listPackages(ctx)], | ||
}, | ||
}; | ||
|
||
async function listPackages(context) { | ||
const ctx = context || {}; | ||
const cwd = ctx.cwd || process.cwd(); | ||
// List all lerna packages | ||
const packages = await getPackages(cwd); | ||
|
||
// Get a list of names. Npm scopes will be removed, for example, | ||
// @loopback/core -> core | ||
return packages | ||
.map(pkg => pkg.name) | ||
.map(name => (name.charAt(0) === '@' ? name.split('/')[1] : name)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"lerna": "2.9.1", | ||
"lerna": "3.1.2", | ||
"packages": [ | ||
"benchmark", | ||
"docs", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters