Skip to content

Commit 22e6f74

Browse files
authored
feat(config-nx-scopes): support latest nx version (#3728)
* fix(commitlint-config-nx-scopes): support nx version 17 updated peer dependencies to support nx version 17 * refactor(commitlint-config-nx-scopes): follow package name convention renamed packages in fixtures to follow the subsequent name convention
1 parent dcc0424 commit 22e6f74

File tree

8 files changed

+120
-1
lines changed

8 files changed

+120
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"affected": {
3+
"defaultBase": "main"
4+
},
5+
"cli": {
6+
"defaultCollection": "@nx/react"
7+
},
8+
"tasksRunnerOptions": {
9+
"default": {
10+
"runner": "nx-cloud",
11+
"options": {
12+
"cacheableOperations": [
13+
"build",
14+
"lint",
15+
"test",
16+
"e2e"
17+
]
18+
}
19+
}
20+
},
21+
"generators": {
22+
"@nx/react": {
23+
"application": {
24+
"style": "css",
25+
"linter": "eslint",
26+
"babel": true
27+
},
28+
"component": {
29+
"style": "css"
30+
},
31+
"library": {
32+
"style": "css",
33+
"linter": "eslint"
34+
}
35+
}
36+
},
37+
"defaultProject": "g"
38+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "g",
3+
"version": "1.0.0"
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"root": "nx/g",
3+
"sourceRoot": "nx/g/src",
4+
"projectType": "library",
5+
"targets": {
6+
"lint": {
7+
"executor": "@nx/linter:eslint",
8+
"outputs": [
9+
"{options.outputFile}"
10+
],
11+
"options": {
12+
"lintFilePatterns": [
13+
"nx/g/**/*.ts"
14+
]
15+
}
16+
},
17+
"test": {
18+
"executor": "@nx/jest:jest",
19+
"outputs": [
20+
"coverage/nx/g"
21+
],
22+
"options": {
23+
"jestConfig": "nx/g/jest.config.js",
24+
"passWithNoTests": true
25+
}
26+
}
27+
},
28+
"tags": []
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "h",
3+
"version": "1.0.0"
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"root": "nx/h",
3+
"sourceRoot": "nx/h/src",
4+
"projectType": "library",
5+
"targets": {
6+
"lint": {
7+
"executor": "@nx/linter:eslint",
8+
"outputs": [
9+
"{options.outputFile}"
10+
],
11+
"options": {
12+
"lintFilePatterns": [
13+
"nx/h/**/*.ts"
14+
]
15+
}
16+
},
17+
"test": {
18+
"executor": "@nx/jest:jest",
19+
"outputs": [
20+
"coverage/nx/h"
21+
],
22+
"options": {
23+
"jestConfig": "nx/h/jest.config.js",
24+
"passWithNoTests": true
25+
}
26+
}
27+
},
28+
"tags": []
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "basic",
3+
"version": "1.0.0",
4+
"devDependencies": {
5+
"nx": "^17.0.0"
6+
}
7+
}

@commitlint/config-nx-scopes/index.test.js

+8
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,11 @@ test('expect correct result from Nx 15', async () => {
7474
const [, , value] = await fn({cwd});
7575
expect(value).toEqual(['e', 'f']);
7676
});
77+
78+
test('expect correct result from Nx 17', async () => {
79+
const {'scope-enum': fn} = config.rules;
80+
const cwd = await npm.bootstrap('fixtures/nx17', __dirname);
81+
82+
const [, , value] = await fn({cwd});
83+
expect(value).toEqual(['g', 'h']);
84+
});

@commitlint/config-nx-scopes/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
},
2828
"homepage": "https://commitlint.js.org/",
2929
"peerDependencies": {
30-
"nx": "^14.0.0 || ^15.0.0 || ^16.0.0"
30+
"nx": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
3131
},
3232
"peerDependenciesMeta": {
3333
"nx": {

0 commit comments

Comments
 (0)