@nx/angular 19.8.0-canary.20240911-2a3307c → 19.8.0-canary.20240913-5bbaffb
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nx/angular",
|
3
|
-
"version": "19.8.0-canary.
|
3
|
+
"version": "19.8.0-canary.20240913-5bbaffb",
|
4
4
|
"private": false,
|
5
5
|
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, Playwright and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
6
6
|
"repository": {
|
@@ -69,7 +69,7 @@
|
|
69
69
|
},
|
70
70
|
"dependencies": {
|
71
71
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
72
|
-
"@typescript-eslint/type-utils": "^
|
72
|
+
"@typescript-eslint/type-utils": "^8.0.0",
|
73
73
|
"chalk": "^4.1.0",
|
74
74
|
"find-cache-dir": "^3.3.2",
|
75
75
|
"magic-string": "~0.30.2",
|
@@ -79,14 +79,14 @@
|
|
79
79
|
"webpack-merge": "^5.8.0",
|
80
80
|
"webpack": "^5.88.0",
|
81
81
|
"@module-federation/enhanced": "~0.6.0",
|
82
|
-
"@nx/devkit": "19.8.0-canary.
|
83
|
-
"@nx/js": "19.8.0-canary.
|
84
|
-
"@nx/eslint": "19.8.0-canary.
|
85
|
-
"@nx/webpack": "19.8.0-canary.
|
86
|
-
"@nx/web": "19.8.0-canary.
|
87
|
-
"@nx/workspace": "19.8.0-canary.
|
82
|
+
"@nx/devkit": "19.8.0-canary.20240913-5bbaffb",
|
83
|
+
"@nx/js": "19.8.0-canary.20240913-5bbaffb",
|
84
|
+
"@nx/eslint": "19.8.0-canary.20240913-5bbaffb",
|
85
|
+
"@nx/webpack": "19.8.0-canary.20240913-5bbaffb",
|
86
|
+
"@nx/web": "19.8.0-canary.20240913-5bbaffb",
|
87
|
+
"@nx/workspace": "19.8.0-canary.20240913-5bbaffb",
|
88
88
|
"piscina": "^4.4.0",
|
89
|
-
"@nrwl/angular": "19.8.0-canary.
|
89
|
+
"@nrwl/angular": "19.8.0-canary.20240913-5bbaffb"
|
90
90
|
},
|
91
91
|
"peerDependencies": {
|
92
92
|
"@angular-devkit/build-angular": ">= 16.0.0 < 19.0.0",
|
@@ -8,6 +8,7 @@ const global_eslint_config_1 = require("@nx/eslint/src/generators/init/global-es
|
|
8
8
|
const eslint_file_1 = require("@nx/eslint/src/generators/utils/eslint-file");
|
9
9
|
const add_angular_eslint_dependencies_1 = require("./lib/add-angular-eslint-dependencies");
|
10
10
|
const buildable_project_1 = require("./lib/buildable-project");
|
11
|
+
const flat_config_1 = require("@nx/eslint/src/utils/flat-config");
|
11
12
|
async function addLintingGenerator(tree, options) {
|
12
13
|
const tasks = [];
|
13
14
|
const rootProject = options.projectRoot === '.' || options.projectRoot === '';
|
@@ -32,21 +33,11 @@ async function addLintingGenerator(tree, options) {
|
|
32
33
|
const hasParserOptions = tree
|
33
34
|
.read((0, devkit_1.joinPathFragments)(options.projectRoot, eslintFile), 'utf8')
|
34
35
|
.includes(`${options.projectRoot}/tsconfig.*?.json`);
|
35
|
-
(0,
|
36
|
-
|
37
|
-
|
36
|
+
if ((0, flat_config_1.useFlatConfig)(tree)) {
|
37
|
+
(0, eslint_file_1.addPredefinedConfigToFlatLintConfig)(tree, options.projectRoot, 'flat/angular');
|
38
|
+
(0, eslint_file_1.addPredefinedConfigToFlatLintConfig)(tree, options.projectRoot, 'flat/angular-template');
|
39
|
+
(0, eslint_file_1.addOverrideToLintConfig)(tree, options.projectRoot, {
|
38
40
|
files: ['*.ts'],
|
39
|
-
...(hasParserOptions
|
40
|
-
? {
|
41
|
-
parserOptions: {
|
42
|
-
project: [`${options.projectRoot}/tsconfig.*?.json`],
|
43
|
-
},
|
44
|
-
}
|
45
|
-
: {}),
|
46
|
-
extends: [
|
47
|
-
'plugin:@nx/angular',
|
48
|
-
'plugin:@angular-eslint/template/process-inline-templates',
|
49
|
-
],
|
50
41
|
rules: {
|
51
42
|
'@angular-eslint/directive-selector': [
|
52
43
|
'error',
|
@@ -65,28 +56,92 @@ async function addLintingGenerator(tree, options) {
|
|
65
56
|
},
|
66
57
|
],
|
67
58
|
},
|
68
|
-
}
|
69
|
-
{
|
59
|
+
});
|
60
|
+
(0, eslint_file_1.addOverrideToLintConfig)(tree, options.projectRoot, {
|
70
61
|
files: ['*.html'],
|
71
|
-
extends: ['plugin:@nx/angular-template'],
|
72
|
-
/**
|
73
|
-
* Having an empty rules object present makes it more obvious to the user where they would
|
74
|
-
* extend things from if they needed to
|
75
|
-
*/
|
76
62
|
rules: {},
|
77
|
-
}
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
'
|
85
|
-
|
63
|
+
});
|
64
|
+
if ((0, buildable_project_1.isBuildableLibraryProject)(tree, options.projectName)) {
|
65
|
+
(0, eslint_file_1.addOverrideToLintConfig)(tree, '', {
|
66
|
+
files: ['*.json'],
|
67
|
+
parser: 'jsonc-eslint-parser',
|
68
|
+
rules: {
|
69
|
+
'@nx/dependency-checks': [
|
70
|
+
'error',
|
71
|
+
{
|
72
|
+
// With flat configs, we don't want to include imports in the eslint js/cjs/mjs files to be checked
|
73
|
+
ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs}'],
|
74
|
+
},
|
75
|
+
],
|
76
|
+
},
|
77
|
+
});
|
78
|
+
}
|
79
|
+
}
|
80
|
+
else {
|
81
|
+
(0, eslint_file_1.replaceOverridesInLintConfig)(tree, options.projectRoot, [
|
82
|
+
...(rootProject ? [global_eslint_config_1.typeScriptOverride, global_eslint_config_1.javaScriptOverride] : []),
|
83
|
+
{
|
84
|
+
files: ['*.ts'],
|
85
|
+
...(hasParserOptions
|
86
|
+
? {
|
87
|
+
parserOptions: {
|
88
|
+
project: [`${options.projectRoot}/tsconfig.*?.json`],
|
89
|
+
},
|
90
|
+
}
|
91
|
+
: {}),
|
92
|
+
extends: [
|
93
|
+
'plugin:@nx/angular',
|
94
|
+
'plugin:@angular-eslint/template/process-inline-templates',
|
95
|
+
],
|
96
|
+
rules: {
|
97
|
+
'@angular-eslint/directive-selector': [
|
98
|
+
'error',
|
99
|
+
{
|
100
|
+
type: 'attribute',
|
101
|
+
prefix: (0, string_utils_1.camelize)(options.prefix),
|
102
|
+
style: 'camelCase',
|
103
|
+
},
|
104
|
+
],
|
105
|
+
'@angular-eslint/component-selector': [
|
106
|
+
'error',
|
107
|
+
{
|
108
|
+
type: 'element',
|
109
|
+
prefix: (0, string_utils_1.dasherize)(options.prefix),
|
110
|
+
style: 'kebab-case',
|
111
|
+
},
|
112
|
+
],
|
86
113
|
},
|
87
|
-
|
88
|
-
|
89
|
-
|
114
|
+
},
|
115
|
+
{
|
116
|
+
files: ['*.html'],
|
117
|
+
extends: ['plugin:@nx/angular-template'],
|
118
|
+
/**
|
119
|
+
* Having an empty rules object present makes it more obvious to the user where they would
|
120
|
+
* extend things from if they needed to
|
121
|
+
*/
|
122
|
+
rules: {},
|
123
|
+
},
|
124
|
+
...((0, buildable_project_1.isBuildableLibraryProject)(tree, options.projectName)
|
125
|
+
? [
|
126
|
+
{
|
127
|
+
files: ['*.json'],
|
128
|
+
parser: 'jsonc-eslint-parser',
|
129
|
+
rules: {
|
130
|
+
'@nx/dependency-checks': [
|
131
|
+
'error',
|
132
|
+
{
|
133
|
+
// With flat configs, we don't want to include imports in the eslint js/cjs/mjs files to be checked
|
134
|
+
ignoredFiles: [
|
135
|
+
'{projectRoot}/eslint.config.{js,cjs,mjs}',
|
136
|
+
],
|
137
|
+
},
|
138
|
+
],
|
139
|
+
},
|
140
|
+
},
|
141
|
+
]
|
142
|
+
: []),
|
143
|
+
]);
|
144
|
+
}
|
90
145
|
}
|
91
146
|
if (!options.skipPackageJson) {
|
92
147
|
const installTask = (0, add_angular_eslint_dependencies_1.addAngularEsLintDependencies)(tree, options.projectName);
|
@@ -4,14 +4,19 @@ exports.addAngularEsLintDependencies = addAngularEsLintDependencies;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
5
5
|
const version_utils_1 = require("../../utils/version-utils");
|
6
6
|
const buildable_project_1 = require("./buildable-project");
|
7
|
+
const flat_config_1 = require("@nx/eslint/src/utils/flat-config");
|
7
8
|
function addAngularEsLintDependencies(tree, projectName) {
|
8
9
|
const compatVersions = (0, version_utils_1.versions)(tree);
|
9
10
|
const angularEslintVersionToInstall = compatVersions.angularEslintVersion;
|
10
|
-
const devDependencies =
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
const devDependencies = (0, flat_config_1.useFlatConfig)(tree)
|
12
|
+
? {
|
13
|
+
'angular-eslint': angularEslintVersionToInstall,
|
14
|
+
}
|
15
|
+
: {
|
16
|
+
'@angular-eslint/eslint-plugin': angularEslintVersionToInstall,
|
17
|
+
'@angular-eslint/eslint-plugin-template': angularEslintVersionToInstall,
|
18
|
+
'@angular-eslint/template-parser': angularEslintVersionToInstall,
|
19
|
+
};
|
15
20
|
if ('typescriptEslintVersion' in compatVersions) {
|
16
21
|
devDependencies['@typescript-eslint/utils'] =
|
17
22
|
compatVersions.typescriptEslintVersion;
|
package/src/utils/versions.d.ts
CHANGED
@@ -14,7 +14,7 @@ export declare const typesExpressVersion = "4.17.14";
|
|
14
14
|
export declare const browserSyncVersion = "^3.0.0";
|
15
15
|
export declare const moduleFederationNodeVersion = "~2.5.0";
|
16
16
|
export declare const moduleFederationEnhancedVersion = "~0.6.0";
|
17
|
-
export declare const angularEslintVersion = "^18.0
|
17
|
+
export declare const angularEslintVersion = "^18.3.0";
|
18
18
|
export declare const typescriptEslintVersion = "^7.16.0";
|
19
19
|
export declare const tailwindVersion = "^3.0.2";
|
20
20
|
export declare const postcssVersion = "^8.4.5";
|
package/src/utils/versions.js
CHANGED
@@ -17,7 +17,7 @@ exports.typesExpressVersion = '4.17.14';
|
|
17
17
|
exports.browserSyncVersion = '^3.0.0';
|
18
18
|
exports.moduleFederationNodeVersion = '~2.5.0';
|
19
19
|
exports.moduleFederationEnhancedVersion = '~0.6.0';
|
20
|
-
exports.angularEslintVersion = '^18.0
|
20
|
+
exports.angularEslintVersion = '^18.3.0';
|
21
21
|
exports.typescriptEslintVersion = '^7.16.0';
|
22
22
|
exports.tailwindVersion = '^3.0.2';
|
23
23
|
exports.postcssVersion = '^8.4.5';
|