@nx/angular 17.2.0-beta.0 → 17.2.0-beta.1

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": "17.2.0-beta.0",
3
+ "version": "17.2.0-beta.1",
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,15 +78,15 @@
78
78
  "tslib": "^2.3.0",
79
79
  "webpack": "^5.80.0",
80
80
  "webpack-merge": "^5.8.0",
81
- "@nx/devkit": "17.2.0-beta.0",
82
- "@nx/cypress": "17.2.0-beta.0",
83
- "@nx/jest": "17.2.0-beta.0",
84
- "@nx/js": "17.2.0-beta.0",
85
- "@nx/eslint": "17.2.0-beta.0",
86
- "@nx/webpack": "17.2.0-beta.0",
87
- "@nx/web": "17.2.0-beta.0",
88
- "@nx/workspace": "17.2.0-beta.0",
89
- "@nrwl/angular": "17.2.0-beta.0"
81
+ "@nx/devkit": "17.2.0-beta.1",
82
+ "@nx/cypress": "17.2.0-beta.1",
83
+ "@nx/jest": "17.2.0-beta.1",
84
+ "@nx/js": "17.2.0-beta.1",
85
+ "@nx/eslint": "17.2.0-beta.1",
86
+ "@nx/webpack": "17.2.0-beta.1",
87
+ "@nx/web": "17.2.0-beta.1",
88
+ "@nx/workspace": "17.2.0-beta.1",
89
+ "@nrwl/angular": "17.2.0-beta.1"
90
90
  },
91
91
  "peerDependencies": {
92
92
  "@angular-devkit/build-angular": ">= 15.0.0 < 18.0.0",
@@ -43,7 +43,7 @@ ${e.stack ? e.stack : e}`);
43
43
  const ctContext = (0, ct_helpers_1.createExecutorContext)(graph, ctProjectConfig.targets, ctProjectConfig.name, options?.ctTargetName || 'component-test', ctConfigurationName);
44
44
  const buildTarget = getBuildableTarget(ctContext);
45
45
  if (!buildTarget.project && !graph.nodes?.[buildTarget.project]?.data) {
46
- throw new Error((0, devkit_1.stripIndents) `Unable to find project configuration for build target.
46
+ throw new Error((0, devkit_1.stripIndents) `Unable to find project configuration for build target.
47
47
  Project Name? ${buildTarget.project}
48
48
  Has project config? ${!!graph.nodes?.[buildTarget.project]?.data}`);
49
49
  }
@@ -199,8 +199,8 @@ Note: this may fail, setting the correct 'sourceRoot' for ${buildContext.project
199
199
  };
200
200
  }
201
201
  function withSchemaDefaults(options) {
202
- if (!options.main) {
203
- throw new Error('Missing executor options "main"');
202
+ if (!options.main && !options.browser) {
203
+ throw new Error('Missing executor options "main" and "browser"');
204
204
  }
205
205
  if (!options.index) {
206
206
  throw new Error('Missing executor options "index"');
@@ -225,6 +225,7 @@ function withSchemaDefaults(options) {
225
225
  options.outputHashing ??= 'none';
226
226
  options.progress ??= true;
227
227
  options.scripts ??= [];
228
+ options.main = options.main ??= options.browser;
228
229
  return options;
229
230
  }
230
231
  /**
@@ -56,9 +56,7 @@ async function compileSourceFiles(graph, tsConfig, moduleResolutionCache, option
56
56
  cache.oldNgtscProgram = angularProgram;
57
57
  }
58
58
  else {
59
- // When not in watch mode, the startup cost of the incremental analysis can be avoided by
60
- // using an abstract builder that only wraps a TypeScript program.
61
- builder = ts.createAbstractBuilder(typeScriptProgram, tsCompilerHost);
59
+ builder = ts.createEmitAndSemanticDiagnosticsBuilderProgram(typeScriptProgram, tsCompilerHost);
62
60
  }
63
61
  // Update semantic diagnostics cache
64
62
  const affectedFiles = new Set();
@@ -59,9 +59,7 @@ async function compileSourceFiles(graph, tsConfig, moduleResolutionCache, option
59
59
  cache.oldNgtscProgram = angularProgram;
60
60
  }
61
61
  else {
62
- // When not in watch mode, the startup cost of the incremental analysis can be avoided by
63
- // using an abstract builder that only wraps a TypeScript program.
64
- builder = ts.createAbstractBuilder(typeScriptProgram, tsCompilerHost);
62
+ builder = ts.createEmitAndSemanticDiagnosticsBuilderProgram(typeScriptProgram, tsCompilerHost);
65
63
  }
66
64
  // Update semantic diagnostics cache
67
65
  const affectedFiles = new Set();
@@ -1,3 +1,3 @@
1
- import { Tree } from 'nx/src/generators/tree';
2
- import { NormalizedSchema } from './normalized-schema';
1
+ import { type Tree } from '@nx/devkit';
2
+ import type { NormalizedSchema } from './normalized-schema';
3
3
  export declare function addStandaloneComponent(tree: Tree, { libraryOptions, componentOptions }: NormalizedSchema): Promise<void>;
@@ -1,17 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addStandaloneComponent = void 0;
4
+ const devkit_1 = require("@nx/devkit");
4
5
  const component_1 = require("../../component/component");
5
- const add_load_children_1 = require("./add-load-children");
6
6
  const add_children_1 = require("./add-children");
7
+ const add_load_children_1 = require("./add-load-children");
7
8
  async function addStandaloneComponent(tree, { libraryOptions, componentOptions }) {
8
- await (0, component_1.default)(tree, {
9
+ await (0, component_1.componentGenerator)(tree, {
9
10
  ...componentOptions,
10
11
  name: componentOptions.name,
12
+ directory: (0, devkit_1.joinPathFragments)(libraryOptions.projectRoot, 'src', 'lib', componentOptions.flat ? '' : componentOptions.name),
13
+ nameAndDirectoryFormat: 'as-provided',
11
14
  standalone: true,
12
15
  export: true,
13
- project: libraryOptions.name,
14
- flat: componentOptions.flat,
15
16
  skipFormat: true,
16
17
  });
17
18
  if (libraryOptions.routing) {