@commitlint/config-lerna-scopes
Advanced tools
Comparing version 3.1.1 to 4.1.1
# Change Log | ||
All notable changes to this project will be documented in this file. | ||
See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. | ||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. | ||
<a name="4.1.1"></a> | ||
## [4.1.1](https://github.com/marionebl/commitlint/compare/v4.1.0...v4.1.1) (2017-10-09) | ||
### Bug Fixes | ||
* **config-lerna-scopes:** fix package list get with recent lerna versions ([8f35dae](https://github.com/marionebl/commitlint/commit/8f35dae)) | ||
<a name="3.0.4"></a> | ||
@@ -7,0 +18,0 @@ ## 3.0.4 (2017-08-04) |
21
index.js
@@ -1,2 +0,2 @@ | ||
const Repository = require('lerna/lib/Repository'); | ||
const importFrom = require('import-from'); | ||
@@ -6,11 +6,22 @@ module.exports = { | ||
rules: { | ||
'scope-enum': () => [2, 'always', getPackages()] | ||
'scope-enum': ctx => [2, 'always', getPackages(ctx)] | ||
} | ||
}; | ||
function getPackages() { | ||
const repo = new Repository(process.cwd()); | ||
return repo.packages | ||
function getPackages(context) { | ||
const ctx = context || {}; | ||
const cwd = ctx.cwd || process.cwd(); | ||
const Repository = importFrom(cwd, 'lerna/lib/Repository'); | ||
const PackageUtilities = importFrom(cwd, 'lerna/lib/PackageUtilities'); | ||
const repository = new Repository(cwd); | ||
const packages = PackageUtilities.getPackages({ | ||
packageConfigs: repository.packageConfigs, | ||
rootPath: cwd | ||
}); | ||
return packages | ||
.map(pkg => pkg.name) | ||
.map(name => (name.charAt(0) === '@' ? name.split('/')[1] : name)); | ||
} |
{ | ||
"name": "@commitlint/config-lerna-scopes", | ||
"version": "3.1.1", | ||
"version": "4.1.1", | ||
"description": "Shareable commitlint config enforcing lerna package names as scopes", | ||
"scripts": { | ||
"pretest": "dep-check", | ||
"test": "exit 0", | ||
"test": "ava", | ||
"clean": "exit 0" | ||
}, | ||
"xo": false, | ||
"ava": { | ||
"files": [ | ||
"test.js" | ||
], | ||
"sources": [ | ||
"index.js", | ||
"fixtures/**/*" | ||
] | ||
}, | ||
"repository": { | ||
@@ -28,7 +37,10 @@ "type": "git", | ||
"dependencies": { | ||
"import-from": "^2.1.0", | ||
"lerna": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"@commitlint/utils": "^3.1.1" | ||
"@commitlint/test": "^4.1.1", | ||
"@commitlint/utils": "^3.1.1", | ||
"ava": "^0.22.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8141
25
131
2
3
1
+ Addedimport-from@^2.1.0
+ Addedimport-from@2.1.0(transitive)
+ Addedresolve-from@3.0.0(transitive)