@nx/angular 20.3.0-canary.20241210-ecba861 → 20.3.0-canary.20241212-0d1c960

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/migrations.json CHANGED
@@ -1368,6 +1368,35 @@
1368
1368
  "alwaysAddToPackageJson": false
1369
1369
  }
1370
1370
  }
1371
+ },
1372
+ "20.2.2-angular-eslint": {
1373
+ "version": "20.2.2-beta.0",
1374
+ "requires": {
1375
+ "eslint": "^8.57.0 || ^9.0.0",
1376
+ "@angular/core": ">= 19.0.0 < 20.0.0"
1377
+ },
1378
+ "packages": {
1379
+ "angular-eslint": {
1380
+ "version": "^19.0.2",
1381
+ "alwaysAddToPackageJson": false
1382
+ },
1383
+ "@angular-eslint/eslint-plugin": {
1384
+ "version": "^19.0.2",
1385
+ "alwaysAddToPackageJson": false
1386
+ },
1387
+ "@angular-eslint/eslint-plugin-template": {
1388
+ "version": "^19.0.2",
1389
+ "alwaysAddToPackageJson": false
1390
+ },
1391
+ "@angular-eslint/template-parser": {
1392
+ "version": "^19.0.2",
1393
+ "alwaysAddToPackageJson": false
1394
+ },
1395
+ "@angular-eslint/utils": {
1396
+ "version": "^19.0.2",
1397
+ "alwaysAddToPackageJson": false
1398
+ }
1399
+ }
1371
1400
  }
1372
1401
  }
1373
1402
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/angular",
3
- "version": "20.3.0-canary.20241210-ecba861",
3
+ "version": "20.3.0-canary.20241212-0d1c960",
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": {
@@ -71,13 +71,13 @@
71
71
  "semver": "^7.5.3",
72
72
  "tslib": "^2.3.0",
73
73
  "webpack-merge": "^5.8.0",
74
- "@nx/devkit": "20.3.0-canary.20241210-ecba861",
75
- "@nx/js": "20.3.0-canary.20241210-ecba861",
76
- "@nx/eslint": "20.3.0-canary.20241210-ecba861",
77
- "@nx/webpack": "20.3.0-canary.20241210-ecba861",
78
- "@nx/module-federation": "20.3.0-canary.20241210-ecba861",
79
- "@nx/web": "20.3.0-canary.20241210-ecba861",
80
- "@nx/workspace": "20.3.0-canary.20241210-ecba861",
74
+ "@nx/devkit": "20.3.0-canary.20241212-0d1c960",
75
+ "@nx/js": "20.3.0-canary.20241212-0d1c960",
76
+ "@nx/eslint": "20.3.0-canary.20241212-0d1c960",
77
+ "@nx/webpack": "20.3.0-canary.20241212-0d1c960",
78
+ "@nx/module-federation": "20.3.0-canary.20241212-0d1c960",
79
+ "@nx/web": "20.3.0-canary.20241212-0d1c960",
80
+ "@nx/workspace": "20.3.0-canary.20241212-0d1c960",
81
81
  "piscina": "^4.4.0"
82
82
  },
83
83
  "peerDependencies": {
@@ -24,10 +24,11 @@ function normalizeOptions(options) {
24
24
  }
25
25
  }
26
26
  }
27
- return {
28
- ...options,
29
- appShell: angularMajorVersion < 19 ? options.appShell ?? false : undefined,
30
- prerender: angularMajorVersion < 19 ? options.prerender ?? false : undefined,
31
- security,
32
- };
27
+ let appShell = options.appShell;
28
+ let prerender = options.prerender;
29
+ if (angularMajorVersion < 19) {
30
+ appShell ??= false;
31
+ prerender ??= false;
32
+ }
33
+ return { ...options, appShell, prerender, security };
33
34
  }
@@ -4,46 +4,12 @@ exports.addVitest = addVitest;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const versions_1 = require("../../utils/versions");
6
6
  async function addVitest(tree, options) {
7
- if (!options.skipPackageJson) {
8
- (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
9
- '@analogjs/vitest-angular': versions_1.analogVitestAngular,
10
- '@analogjs/vite-plugin-angular': versions_1.analogVitestAngular,
11
- }, undefined, true);
12
- }
13
- const { createOrEditViteConfig, vitestGenerator } = (0, devkit_1.ensurePackage)('@nx/vite', versions_1.nxVersion);
14
- const relativeTestSetupPath = (0, devkit_1.joinPathFragments)('src', 'test-setup.ts');
15
- const setupFile = (0, devkit_1.joinPathFragments)(options.projectRoot, relativeTestSetupPath);
16
- if (!tree.exists(setupFile)) {
17
- tree.write(setupFile, `import '@analogjs/vitest-angular/setup-zone';
18
-
19
- import {
20
- BrowserDynamicTestingModule,
21
- platformBrowserDynamicTesting,
22
- } from '@angular/platform-browser-dynamic/testing';
23
- import { getTestBed } from '@angular/core/testing';
24
-
25
- getTestBed().initTestEnvironment(
26
- BrowserDynamicTestingModule,
27
- platformBrowserDynamicTesting()
28
- );
29
- `);
30
- await vitestGenerator(tree, {
31
- project: options.name,
32
- uiFramework: 'none',
33
- skipViteConfig: true,
34
- testEnvironment: 'jsdom',
35
- coverageProvider: 'v8',
36
- addPlugin: false,
37
- });
38
- createOrEditViteConfig(tree, {
39
- project: options.name,
40
- includeLib: false,
41
- includeVitest: true,
42
- inSourceTests: false,
43
- imports: [`import angular from '@analogjs/vite-plugin-angular'`],
44
- plugins: ['angular()'],
45
- setupFile: relativeTestSetupPath,
46
- useEsmExtension: true,
47
- }, true);
48
- }
7
+ const { vitestGenerator } = (0, devkit_1.ensurePackage)('@nx/vite', versions_1.nxVersion);
8
+ await vitestGenerator(tree, {
9
+ project: options.name,
10
+ uiFramework: 'angular',
11
+ testEnvironment: 'jsdom',
12
+ coverageProvider: 'v8',
13
+ addPlugin: false,
14
+ });
49
15
  }
@@ -1,2 +1,3 @@
1
1
  import { type Tree } from '@nx/devkit';
2
+ export declare const rulesToRemove: string[];
2
3
  export default function (tree: Tree): Promise<void>;
@@ -1,33 +1,62 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rulesToRemove = void 0;
3
4
  exports.default = default_1;
4
5
  const devkit_1 = require("@nx/devkit");
5
6
  const eslint_file_1 = require("@nx/eslint/src/generators/utils/eslint-file");
6
7
  const projects_1 = require("../utils/projects");
8
+ exports.rulesToRemove = [
9
+ '@angular-eslint/no-host-metadata-property',
10
+ '@angular-eslint/sort-ngmodule-metadata-arrays',
11
+ '@angular-eslint/prefer-standalone-component',
12
+ ];
7
13
  async function default_1(tree) {
8
14
  const projects = await (0, projects_1.getProjectsFilteredByDependencies)(tree, [
9
15
  'npm:@angular/core',
10
16
  ]);
17
+ let hasRootProject = false;
11
18
  for (const { project: { root }, } of projects) {
12
19
  if (!(0, eslint_file_1.isEslintConfigSupported)(tree, root)) {
13
20
  // ESLint config is not supported, skip
14
21
  continue;
15
22
  }
16
- removeRule(tree, root, '@angular-eslint/no-host-metadata-property');
17
- removeRule(tree, root, '@angular-eslint/sort-ngmodule-metadata-arrays');
18
- removeRule(tree, root, '@angular-eslint/prefer-standalone-component');
23
+ if (root === '.') {
24
+ hasRootProject = true;
25
+ }
26
+ removeRules(tree, root);
27
+ }
28
+ /**
29
+ * We need to handle both a root config file (e.g. eslint.config.js) and a
30
+ * potential base config file (e.g. eslint.base.config.js). We can't use
31
+ * `findEslintFile` because it would return only one or the other depending
32
+ * on whether a root is provided and the existence of the files. So, we
33
+ * handle each of them separately.
34
+ */
35
+ // check root config, provide a root so it doesn't try to lookup a base config
36
+ if (!hasRootProject) {
37
+ // if there is no root project the root eslint config has not been processed
38
+ if ((0, eslint_file_1.isEslintConfigSupported)(tree, '')) {
39
+ removeRules(tree, '');
40
+ }
41
+ }
42
+ // handle root base config, not providing a root will prioritize a base config
43
+ const baseEslintConfig = (0, eslint_file_1.findEslintFile)(tree);
44
+ if (baseEslintConfig && baseEslintConfig.includes('.base.')) {
45
+ removeRules(tree, baseEslintConfig);
19
46
  }
20
47
  await (0, devkit_1.formatFiles)(tree);
21
48
  }
22
- function removeRule(tree, root, rule) {
23
- const lookup = (o) => !!o.rules?.[rule];
24
- if (!(0, eslint_file_1.lintConfigHasOverride)(tree, root, lookup, true)) {
25
- // it's not using the rule, skip
26
- return;
49
+ function removeRules(tree, root) {
50
+ for (const rule of exports.rulesToRemove) {
51
+ const lookup = (o) => !!o.rules?.[rule];
52
+ if (!(0, eslint_file_1.lintConfigHasOverride)(tree, root, lookup)) {
53
+ // it's not using the rule, skip
54
+ continue;
55
+ }
56
+ // there is an override containing the rule, remove the rule
57
+ (0, eslint_file_1.updateOverrideInLintConfig)(tree, root, lookup, (o) => {
58
+ delete o.rules[rule];
59
+ return o;
60
+ });
27
61
  }
28
- // there is an override containing the rule, remove the rule
29
- (0, eslint_file_1.updateOverrideInLintConfig)(tree, root, lookup, (o) => {
30
- delete o.rules[rule];
31
- return o;
32
- });
33
62
  }
@@ -4,7 +4,7 @@ type LatestPackageVersionNames = Exclude<keyof typeof latestVersions, 'nxVersion
4
4
  type CompatPackageVersionNames = LatestPackageVersionNames;
5
5
  export type PackageVersionNames = LatestPackageVersionNames | CompatPackageVersionNames;
6
6
  export type VersionMap = {
7
- angularV17: Record<Exclude<CompatPackageVersionNames, 'analogVitestAngular' | 'typescriptEslintVersion'>, string>;
7
+ angularV17: Record<Exclude<CompatPackageVersionNames, 'typescriptEslintVersion'>, string>;
8
8
  angularV18: Record<CompatPackageVersionNames, string>;
9
9
  };
10
10
  export type PackageLatestVersions = Record<LatestPackageVersionNames, string>;
@@ -55,7 +55,6 @@ exports.backwardCompatibleVersions = {
55
55
  jestPresetAngularVersion: '~14.1.0',
56
56
  typesNodeVersion: '18.16.9',
57
57
  jasmineMarblesVersion: '^0.9.2',
58
- analogVitestAngular: '~1.9.1',
59
58
  jsoncEslintParserVersion: '^2.1.0',
60
59
  },
61
60
  };
@@ -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.6.11";
16
16
  export declare const moduleFederationEnhancedVersion = "0.7.6";
17
- export declare const angularEslintVersion = "^19.0.0";
17
+ export declare const angularEslintVersion = "^19.0.2";
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";
@@ -24,5 +24,4 @@ export declare const tsNodeVersion = "10.9.1";
24
24
  export declare const jestPresetAngularVersion = "~14.4.0";
25
25
  export declare const typesNodeVersion = "18.16.9";
26
26
  export declare const jasmineMarblesVersion = "^0.9.2";
27
- export declare const analogVitestAngular = "~1.10.0";
28
27
  export declare const jsoncEslintParserVersion = "^2.1.0";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.jsoncEslintParserVersion = exports.analogVitestAngular = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssVersion = exports.tailwindVersion = exports.typescriptEslintVersion = exports.angularEslintVersion = exports.moduleFederationEnhancedVersion = exports.moduleFederationNodeVersion = exports.browserSyncVersion = exports.typesExpressVersion = exports.expressVersion = exports.typesCorsVersion = exports.corsVersion = exports.tsLibVersion = exports.angularJsVersion = exports.zoneJsVersion = exports.rxjsVersion = exports.ngrxVersion = exports.ngPackagrVersion = exports.angularDevkitVersion = exports.angularVersion = exports.nxVersion = void 0;
3
+ exports.jsoncEslintParserVersion = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssVersion = exports.tailwindVersion = exports.typescriptEslintVersion = exports.angularEslintVersion = exports.moduleFederationEnhancedVersion = exports.moduleFederationNodeVersion = exports.browserSyncVersion = exports.typesExpressVersion = exports.expressVersion = exports.typesCorsVersion = exports.corsVersion = exports.tsLibVersion = exports.angularJsVersion = exports.zoneJsVersion = exports.rxjsVersion = exports.ngrxVersion = exports.ngPackagrVersion = exports.angularDevkitVersion = exports.angularVersion = exports.nxVersion = void 0;
4
4
  exports.nxVersion = require('../../package.json').version;
5
5
  exports.angularVersion = '~19.0.0';
6
6
  exports.angularDevkitVersion = '~19.0.0';
@@ -17,7 +17,7 @@ exports.typesExpressVersion = '4.17.14';
17
17
  exports.browserSyncVersion = '^3.0.0';
18
18
  exports.moduleFederationNodeVersion = '~2.6.11';
19
19
  exports.moduleFederationEnhancedVersion = '0.7.6';
20
- exports.angularEslintVersion = '^19.0.0';
20
+ exports.angularEslintVersion = '^19.0.2';
21
21
  exports.typescriptEslintVersion = '^7.16.0';
22
22
  exports.tailwindVersion = '^3.0.2';
23
23
  exports.postcssVersion = '^8.4.5';
@@ -27,5 +27,4 @@ exports.tsNodeVersion = '10.9.1';
27
27
  exports.jestPresetAngularVersion = '~14.4.0';
28
28
  exports.typesNodeVersion = '18.16.9';
29
29
  exports.jasmineMarblesVersion = '^0.9.2';
30
- exports.analogVitestAngular = '~1.10.0';
31
30
  exports.jsoncEslintParserVersion = '^2.1.0';