@commitlint/config-nx-scopes 19.1.0 → 19.3.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 +2 -2
- package/package.json +2 -2
- package/readme.md +49 -37
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {RuleConfigSeverity} from '@commitlint/types';
|
|
2
|
-
import {getProjects as getNXProjects} from 'nx/src/generators/utils/project-configuration';
|
|
3
|
-
import {FsTree} from 'nx/src/generators/tree';
|
|
2
|
+
import {getProjects as getNXProjects} from 'nx/src/generators/utils/project-configuration.js';
|
|
3
|
+
import {FsTree} from 'nx/src/generators/tree.js';
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
utils: {getProjects},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commitlint/config-nx-scopes",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "19.
|
|
4
|
+
"version": "19.3.0",
|
|
5
5
|
"description": "Shareable commitlint config enforcing nx project names as scopes",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"files": [
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"@commitlint/test": "^19.0.0",
|
|
47
47
|
"@commitlint/utils": "^19.0.0"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "447fd3b415d11cce15ec1af3b948a2c97cfdd8f5"
|
|
50
50
|
}
|
package/readme.md
CHANGED
|
@@ -21,26 +21,32 @@ As an example, the following code demonstrates how to select only applications t
|
|
|
21
21
|
In your .commitlintrc.js file:
|
|
22
22
|
|
|
23
23
|
```javascript
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
[
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
24
|
+
async function getConfig() {
|
|
25
|
+
const {
|
|
26
|
+
default: {
|
|
27
|
+
utils: {getProjects},
|
|
28
|
+
},
|
|
29
|
+
} = await import('@commitlint/config-nx-scopes');
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
rules: {
|
|
33
|
+
'scope-enum': async (ctx) => [
|
|
34
|
+
2,
|
|
35
|
+
'always',
|
|
36
|
+
[
|
|
37
|
+
...(await getProjects(
|
|
38
|
+
ctx,
|
|
39
|
+
({name, projectType}) =>
|
|
40
|
+
!name.includes('e2e') && projectType == 'application'
|
|
41
|
+
)),
|
|
42
|
+
],
|
|
39
43
|
],
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
+
},
|
|
45
|
+
// . . .
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
module.exports = getConfig();
|
|
44
50
|
```
|
|
45
51
|
|
|
46
52
|
Here is another example where projects tagged with 'stage:end-of-life' are not allowed to be used as the scope for a commit.
|
|
@@ -48,25 +54,31 @@ Here is another example where projects tagged with 'stage:end-of-life' are not a
|
|
|
48
54
|
In your .commitlintrc.js file:
|
|
49
55
|
|
|
50
56
|
```javascript
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
[
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
async function getConfig() {
|
|
58
|
+
const {
|
|
59
|
+
default: {
|
|
60
|
+
utils: {getProjects},
|
|
61
|
+
},
|
|
62
|
+
} = await import('@commitlint/config-nx-scopes');
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
rules: {
|
|
66
|
+
'scope-enum': async (ctx) => [
|
|
67
|
+
2,
|
|
68
|
+
'always',
|
|
69
|
+
[
|
|
70
|
+
...(await getProjects(
|
|
71
|
+
ctx,
|
|
72
|
+
({tags}) => !tags.includes('stage:end-of-life')
|
|
73
|
+
)),
|
|
74
|
+
],
|
|
65
75
|
],
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
76
|
+
},
|
|
77
|
+
// . . .
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
module.exports = getConfig();
|
|
70
82
|
```
|
|
71
83
|
|
|
72
84
|
## Examples
|