@nx/angular 18.0.6 → 18.0.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/angular",
3
- "version": "18.0.6",
3
+ "version": "18.0.8",
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, 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- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
6
6
  "repository": {
@@ -78,16 +78,16 @@
78
78
  "tslib": "^2.3.0",
79
79
  "webpack": "^5.80.0",
80
80
  "webpack-merge": "^5.8.0",
81
- "@nx/devkit": "18.0.6",
82
- "@nx/cypress": "18.0.6",
83
- "@nx/jest": "18.0.6",
84
- "@nx/js": "18.0.6",
85
- "@nx/eslint": "18.0.6",
86
- "@nx/webpack": "18.0.6",
87
- "@nx/web": "18.0.6",
88
- "@nx/workspace": "18.0.6",
81
+ "@nx/devkit": "18.0.8",
82
+ "@nx/cypress": "18.0.8",
83
+ "@nx/jest": "18.0.8",
84
+ "@nx/js": "18.0.8",
85
+ "@nx/eslint": "18.0.8",
86
+ "@nx/webpack": "18.0.8",
87
+ "@nx/web": "18.0.8",
88
+ "@nx/workspace": "18.0.8",
89
89
  "piscina": "^4.2.1",
90
- "@nrwl/angular": "18.0.6"
90
+ "@nrwl/angular": "18.0.8"
91
91
  },
92
92
  "peerDependencies": {
93
93
  "@angular-devkit/build-angular": ">= 15.0.0 < 18.0.0",
@@ -1,4 +1,4 @@
1
- import { GeneratorCallback, Tree } from '@nx/devkit';
1
+ import { type GeneratorCallback, type Tree } from '@nx/devkit';
2
2
  import type { AddLintingGeneratorSchema } from './schema';
3
3
  export declare function addLintingGenerator(tree: Tree, options: AddLintingGeneratorSchema): Promise<GeneratorCallback>;
4
4
  export default addLintingGenerator;
@@ -2,11 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addLintingGenerator = void 0;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const eslint_1 = require("@nx/eslint");
6
- const add_angular_eslint_dependencies_1 = require("./lib/add-angular-eslint-dependencies");
7
- const eslint_file_1 = require("@nx/eslint/src/generators/utils/eslint-file");
8
5
  const string_utils_1 = require("@nx/devkit/src/utils/string-utils");
6
+ const eslint_1 = require("@nx/eslint");
9
7
  const global_eslint_config_1 = require("@nx/eslint/src/generators/init/global-eslint-config");
8
+ const eslint_file_1 = require("@nx/eslint/src/generators/utils/eslint-file");
9
+ const add_angular_eslint_dependencies_1 = require("./lib/add-angular-eslint-dependencies");
10
+ const buildable_project_1 = require("./lib/buildable-project");
10
11
  async function addLintingGenerator(tree, options) {
11
12
  const tasks = [];
12
13
  const rootProject = options.projectRoot === '.' || options.projectRoot === '';
@@ -72,7 +73,7 @@ async function addLintingGenerator(tree, options) {
72
73
  */
73
74
  rules: {},
74
75
  },
75
- ...(isBuildableLibraryProject(tree, options.projectName)
76
+ ...((0, buildable_project_1.isBuildableLibraryProject)(tree, options.projectName)
76
77
  ? [
77
78
  {
78
79
  files: ['*.json'],
@@ -86,7 +87,7 @@ async function addLintingGenerator(tree, options) {
86
87
  ]);
87
88
  }
88
89
  if (!options.skipPackageJson) {
89
- const installTask = (0, add_angular_eslint_dependencies_1.addAngularEsLintDependencies)(tree);
90
+ const installTask = (0, add_angular_eslint_dependencies_1.addAngularEsLintDependencies)(tree, options.projectName);
90
91
  tasks.push(installTask);
91
92
  }
92
93
  if (!options.skipFormat) {
@@ -95,10 +96,4 @@ async function addLintingGenerator(tree, options) {
95
96
  return (0, devkit_1.runTasksInSerial)(...tasks);
96
97
  }
97
98
  exports.addLintingGenerator = addLintingGenerator;
98
- function isBuildableLibraryProject(tree, projectName) {
99
- const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, projectName);
100
- return (projectConfig.projectType === 'library' &&
101
- projectConfig.targets?.build &&
102
- !!projectConfig.targets.build);
103
- }
104
99
  exports.default = addLintingGenerator;
@@ -1,2 +1,2 @@
1
- import type { GeneratorCallback, Tree } from '@nx/devkit';
2
- export declare function addAngularEsLintDependencies(tree: Tree): GeneratorCallback;
1
+ import { type GeneratorCallback, type Tree } from '@nx/devkit';
2
+ export declare function addAngularEsLintDependencies(tree: Tree, projectName: string): GeneratorCallback;
@@ -3,14 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addAngularEsLintDependencies = void 0;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const version_utils_1 = require("../../utils/version-utils");
6
- function addAngularEsLintDependencies(tree) {
6
+ const buildable_project_1 = require("./buildable-project");
7
+ function addAngularEsLintDependencies(tree, projectName) {
7
8
  const angularEslintVersionToInstall = (0, version_utils_1.versions)(tree).angularEslintVersion;
8
- const jsoncEslintParserVersionToInstall = (0, version_utils_1.versions)(tree).jsoncEslintParserVersion;
9
- return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
9
+ const devDependencies = {
10
10
  '@angular-eslint/eslint-plugin': angularEslintVersionToInstall,
11
11
  '@angular-eslint/eslint-plugin-template': angularEslintVersionToInstall,
12
12
  '@angular-eslint/template-parser': angularEslintVersionToInstall,
13
- 'jsonc-eslint-parser': jsoncEslintParserVersionToInstall,
14
- });
13
+ };
14
+ if ((0, buildable_project_1.isBuildableLibraryProject)(tree, projectName)) {
15
+ const jsoncEslintParserVersionToInstall = (0, version_utils_1.versions)(tree).jsoncEslintParserVersion;
16
+ devDependencies['jsonc-eslint-parser'] = jsoncEslintParserVersionToInstall;
17
+ }
18
+ return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, devDependencies);
15
19
  }
16
20
  exports.addAngularEsLintDependencies = addAngularEsLintDependencies;
@@ -0,0 +1,2 @@
1
+ import { type Tree } from '@nx/devkit';
2
+ export declare function isBuildableLibraryProject(tree: Tree, projectName: string): boolean;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isBuildableLibraryProject = void 0;
4
+ const devkit_1 = require("@nx/devkit");
5
+ function isBuildableLibraryProject(tree, projectName) {
6
+ const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, projectName);
7
+ return (projectConfig.projectType === 'library' && !!projectConfig.targets?.build);
8
+ }
9
+ exports.isBuildableLibraryProject = isBuildableLibraryProject;
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.withModuleFederationForSSR = void 0;
4
4
  const utils_1 = require("./utils");
5
5
  async function withModuleFederationForSSR(options) {
6
+ if (global.NX_GRAPH_CREATION) {
7
+ return (config) => config;
8
+ }
6
9
  const { sharedLibraries, sharedDependencies, mappedRemotes } = await (0, utils_1.getModuleFederationConfig)(options, {
7
10
  isServer: true,
8
11
  });
@@ -4,6 +4,9 @@ exports.withModuleFederation = void 0;
4
4
  const utils_1 = require("./utils");
5
5
  const ModuleFederationPlugin = require("webpack/lib/container/ModuleFederationPlugin");
6
6
  async function withModuleFederation(options) {
7
+ if (global.NX_GRAPH_CREATION) {
8
+ return (config) => config;
9
+ }
7
10
  const { sharedLibraries, sharedDependencies, mappedRemotes } = await (0, utils_1.getModuleFederationConfig)(options);
8
11
  return (config) => ({
9
12
  ...(config ?? {}),