@commitlint/config-lerna-scopes 18.4.4 → 19.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +10 -7
- package/package.json +10 -7
- package/readme.md +6 -6
package/index.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const importFrom = require('import-from');
|
|
4
|
-
const semver = require('semver');
|
|
1
|
+
import {createRequire} from 'module';
|
|
2
|
+
import Path from 'path';
|
|
5
3
|
|
|
6
|
-
|
|
4
|
+
import {globSync} from 'glob';
|
|
5
|
+
import importFrom from 'import-from';
|
|
6
|
+
import semver from 'semver';
|
|
7
|
+
|
|
8
|
+
const require = createRequire(import.meta.url);
|
|
9
|
+
|
|
10
|
+
export default {
|
|
7
11
|
utils: {getPackages},
|
|
8
12
|
rules: {
|
|
9
13
|
'scope-enum': (ctx) =>
|
|
@@ -23,7 +27,7 @@ function getPackages(context) {
|
|
|
23
27
|
|
|
24
28
|
const wsGlobs = workspaces.flatMap((ws) => {
|
|
25
29
|
const path = Path.posix.join(ws, 'package.json');
|
|
26
|
-
return
|
|
30
|
+
return globSync(path, {cwd, ignore: ['**/node_modules/**']});
|
|
27
31
|
});
|
|
28
32
|
|
|
29
33
|
return wsGlobs.map((pJson) => require(Path.join(cwd, pJson)));
|
|
@@ -62,6 +66,5 @@ function getLernaVersion(cwd) {
|
|
|
62
66
|
'lerna'
|
|
63
67
|
);
|
|
64
68
|
const modulePackageJson = Path.join(moduleDir, 'package.json');
|
|
65
|
-
|
|
66
69
|
return require(modulePackageJson).version;
|
|
67
70
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commitlint/config-lerna-scopes",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "19.0.0",
|
|
4
5
|
"description": "Shareable commitlint config enforcing lerna package and workspace names as scopes",
|
|
6
|
+
"main": "index.js",
|
|
5
7
|
"files": [
|
|
6
8
|
"index.js"
|
|
7
9
|
],
|
|
@@ -39,13 +41,14 @@
|
|
|
39
41
|
},
|
|
40
42
|
"dependencies": {
|
|
41
43
|
"@lerna/project": "^6.0.0",
|
|
42
|
-
"glob": "^
|
|
43
|
-
"import-from": "4.0.0",
|
|
44
|
-
"semver": "7.
|
|
44
|
+
"glob": "^10.3.10",
|
|
45
|
+
"import-from": "^4.0.0",
|
|
46
|
+
"semver": "^7.6.0"
|
|
45
47
|
},
|
|
46
48
|
"devDependencies": {
|
|
47
|
-
"@commitlint/test": "^
|
|
48
|
-
"@commitlint/utils": "^
|
|
49
|
+
"@commitlint/test": "^19.0.0",
|
|
50
|
+
"@commitlint/utils": "^19.0.0",
|
|
51
|
+
"@types/glob": "^8.1.0"
|
|
49
52
|
},
|
|
50
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "f1ff12159d627ee63bf8982ab02e6cca8f10b09f"
|
|
51
54
|
}
|
package/readme.md
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
> Lint your lerna project commits
|
|
2
|
-
|
|
3
1
|
# @commitlint/config-lerna-scopes
|
|
4
2
|
|
|
3
|
+
Lint your lerna project commits
|
|
4
|
+
|
|
5
5
|
Shareable `commitlint` config enforcing lerna package and workspace names as scopes.
|
|
6
6
|
Use with [@commitlint/cli](../cli) and [@commitlint/prompt-cli](../prompt-cli).
|
|
7
7
|
|
|
8
8
|
## Getting started
|
|
9
9
|
|
|
10
|
-
```
|
|
10
|
+
```sh
|
|
11
11
|
npm install --save-dev @commitlint/config-lerna-scopes @commitlint/cli
|
|
12
|
-
echo "
|
|
12
|
+
echo "export default {extends: ['@commitlint/config-lerna-scopes']};" > commitlint.config.js
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## Examples
|
|
16
16
|
|
|
17
|
-
```
|
|
17
|
+
```text
|
|
18
18
|
❯ cat commitlint.config.js
|
|
19
19
|
{
|
|
20
20
|
extends: ['@commitlint/config-lerna-scopes']
|
|
@@ -41,4 +41,4 @@ packages
|
|
|
41
41
|
✔ found 0 problems, 0 warnings
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
Consult [
|
|
44
|
+
Consult [Rules reference](https://commitlint.js.org/reference/rules) for a list of available rules.
|