@nx/angular 19.2.0-canary.20240601-6f22300 → 19.2.0-canary.20240605-5a06daa

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.2.0-canary.20240601-6f22300",
3
+ "version": "19.2.0-canary.20240605-5a06daa",
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": {
@@ -79,14 +79,14 @@
79
79
  "tslib": "^2.3.0",
80
80
  "webpack": "^5.80.0",
81
81
  "webpack-merge": "^5.8.0",
82
- "@nx/devkit": "19.2.0-canary.20240601-6f22300",
83
- "@nx/js": "19.2.0-canary.20240601-6f22300",
84
- "@nx/eslint": "19.2.0-canary.20240601-6f22300",
85
- "@nx/webpack": "19.2.0-canary.20240601-6f22300",
86
- "@nx/web": "19.2.0-canary.20240601-6f22300",
87
- "@nx/workspace": "19.2.0-canary.20240601-6f22300",
82
+ "@nx/devkit": "19.2.0-canary.20240605-5a06daa",
83
+ "@nx/js": "19.2.0-canary.20240605-5a06daa",
84
+ "@nx/eslint": "19.2.0-canary.20240605-5a06daa",
85
+ "@nx/webpack": "19.2.0-canary.20240605-5a06daa",
86
+ "@nx/web": "19.2.0-canary.20240605-5a06daa",
87
+ "@nx/workspace": "19.2.0-canary.20240605-5a06daa",
88
88
  "piscina": "^4.4.0",
89
- "@nrwl/angular": "19.2.0-canary.20240601-6f22300"
89
+ "@nrwl/angular": "19.2.0-canary.20240605-5a06daa"
90
90
  },
91
91
  "peerDependencies": {
92
92
  "@angular-devkit/build-angular": ">= 16.0.0 < 19.0.0",
@@ -31,16 +31,16 @@ function executeModuleFederationDevSSRBuilder(schema, context) {
31
31
  else {
32
32
  pathToManifestFile = (0, module_federation_1.getDynamicMfManifestFile)(project, context.workspaceRoot);
33
33
  }
34
- (0, module_federation_1.validateDevRemotes)(options, workspaceProjects);
35
- const remotesToSkip = new Set(options.skipRemotes ?? []);
36
- const staticRemotes = (0, module_federation_1.getStaticRemotes)(project, context, workspaceProjects, remotesToSkip);
37
- const dynamicRemotes = (0, module_federation_1.getDynamicRemotes)(project, context, workspaceProjects, remotesToSkip, pathToManifestFile);
38
- const remotes = [...staticRemotes, ...dynamicRemotes];
39
34
  const devServeRemotes = !options.devRemotes
40
35
  ? []
41
36
  : Array.isArray(options.devRemotes)
42
37
  ? options.devRemotes
43
38
  : [options.devRemotes];
39
+ (0, module_federation_1.validateDevRemotes)({ devRemotes: devServeRemotes }, workspaceProjects);
40
+ const remotesToSkip = new Set(options.skipRemotes ?? []);
41
+ const staticRemotes = (0, module_federation_1.getStaticRemotes)(project, context, workspaceProjects, remotesToSkip);
42
+ const dynamicRemotes = (0, module_federation_1.getDynamicRemotes)(project, context, workspaceProjects, remotesToSkip, pathToManifestFile);
43
+ const remotes = [...staticRemotes, ...dynamicRemotes];
44
44
  const remoteProcessPromises = [];
45
45
  for (const remote of remotes) {
46
46
  const isDev = devServeRemotes.includes(remote);
@@ -1,10 +1,11 @@
1
1
  import { ProjectConfiguration } from '@nx/devkit';
2
+ export type DevRemoteDefinition = string | {
3
+ remoteName: string;
4
+ configuration: string;
5
+ };
2
6
  export declare function getDynamicRemotes(project: ProjectConfiguration, context: import('@angular-devkit/architect').BuilderContext, workspaceProjects: Record<string, ProjectConfiguration>, remotesToSkip: Set<string>, pathToManifestFile: string | undefined): string[];
3
7
  export declare function getStaticRemotes(project: ProjectConfiguration, context: import('@angular-devkit/architect').BuilderContext, workspaceProjects: Record<string, ProjectConfiguration>, remotesToSkip: Set<string>): string[];
4
8
  export declare function validateDevRemotes(options: {
5
- devRemotes?: (string | {
6
- remoteName: string;
7
- configuration: string;
8
- })[];
9
+ devRemotes: DevRemoteDefinition[];
9
10
  }, workspaceProjects: Record<string, ProjectConfiguration>): void;
10
11
  export declare function getDynamicMfManifestFile(project: ProjectConfiguration, workspaceRoot: string): string | undefined;
@@ -86,7 +86,7 @@ function getStaticRemotes(project, context, workspaceProjects, remotesToSkip) {
86
86
  }
87
87
  exports.getStaticRemotes = getStaticRemotes;
88
88
  function validateDevRemotes(options, workspaceProjects) {
89
- const invalidDevRemotes = options.devRemotes?.filter((remote) => !(typeof remote === 'string'
89
+ const invalidDevRemotes = options.devRemotes.filter((remote) => !(typeof remote === 'string'
90
90
  ? workspaceProjects[remote]
91
91
  : workspaceProjects[remote.remoteName])) ?? [];
92
92
  if (invalidDevRemotes.length) {
@@ -30,7 +30,7 @@ async function buildStaticRemotes(staticRemotesConfig, nxBin, context, options)
30
30
  stdio: ['ignore', 'pipe', 'pipe', 'ipc'],
31
31
  });
32
32
  // File to debug build failures e.g. 2024-01-01T00_00_0_0Z-build.log'
33
- const remoteBuildLogFile = (0, node_path_1.join)(cache_directory_1.projectGraphCacheDirectory, `${new Date().toISOString().replace(/[:\.]/g, '_')}-build.log`);
33
+ const remoteBuildLogFile = (0, node_path_1.join)(cache_directory_1.workspaceDataDirectory, `${new Date().toISOString().replace(/[:\.]/g, '_')}-build.log`);
34
34
  const stdoutStream = (0, node_fs_1.createWriteStream)(remoteBuildLogFile);
35
35
  staticProcess.stdout.on('data', (data) => {
36
36
  const ANSII_CODE_REGEX = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;
@@ -13,6 +13,7 @@ function normalizeOptions(schema) {
13
13
  return {
14
14
  ...schema,
15
15
  buildTarget,
16
+ devRemotes: schema.devRemotes ?? [],
16
17
  host: schema.host ?? 'localhost',
17
18
  port: schema.port ?? 4200,
18
19
  liveReload: schema.liveReload ?? true,
@@ -56,7 +56,7 @@ async function* moduleFederationDevServerExecutor(schema, context) {
56
56
  }
57
57
  (0, module_federation_2.validateDevRemotes)(options, workspaceProjects);
58
58
  const moduleFederationConfig = (0, module_federation_1.getModuleFederationConfig)(project.targets.build.options.tsConfig, context.root, project.root, 'angular');
59
- const remoteNames = options.devRemotes?.map((r) => typeof r === 'string' ? r : r.remoteName);
59
+ const remoteNames = options.devRemotes.map((r) => typeof r === 'string' ? r : r.remoteName);
60
60
  const remotes = (0, module_federation_1.getRemotes)(remoteNames, options.skipRemotes, moduleFederationConfig, {
61
61
  projectName: project.name,
62
62
  projectGraph: context.projectGraph,
@@ -1,3 +1,5 @@
1
+ import type { DevRemoteDefinition } from '../../builders/utilities/module-federation';
2
+
1
3
  interface BaseSchema {
2
4
  port?: number;
3
5
  host?: string;
@@ -16,13 +18,7 @@ interface BaseSchema {
16
18
  hmr?: boolean;
17
19
  watch?: boolean;
18
20
  poll?: number;
19
- devRemotes?: (
20
- | string
21
- | {
22
- remoteName: string;
23
- configuration: string;
24
- }
25
- )[];
21
+ devRemotes?: DevRemoteDefinition[];
26
22
  skipRemotes?: string[];
27
23
  pathToManifestFile?: string;
28
24
  static?: boolean;
@@ -43,6 +39,7 @@ export type SchemaWithBuildTarget = BaseSchema & {
43
39
  export type Schema = SchemaWithBrowserTarget | SchemaWithBuildTarget;
44
40
 
45
41
  export type NormalizedSchema = SchemaWithBuildTarget & {
42
+ devRemotes: DevRemoteDefinition[];
46
43
  liveReload: boolean;
47
44
  open: boolean;
48
45
  ssl: boolean;
@@ -8,7 +8,7 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.NX_DEFAULT_OPTIONS_PROVIDER = exports.nxProvideOptions = exports.NX_OPTIONS_TOKEN = void 0;
10
10
  const tslib_1 = require("tslib");
11
- const findCacheDirectory = tslib_1.__importStar(require("find-cache-dir"));
11
+ const find_cache_dir_1 = tslib_1.__importDefault(require("find-cache-dir"));
12
12
  const injection_js_1 = require("injection-js");
13
13
  const os_1 = require("os");
14
14
  const path_1 = require("path");
@@ -31,5 +31,5 @@ function normalizeOptions(options = {}) {
31
31
  }
32
32
  function findCachePath() {
33
33
  const name = 'ng-packagr';
34
- return findCacheDirectory({ name }) || (0, path_1.resolve)((0, os_1.tmpdir)(), name);
34
+ return (0, find_cache_dir_1.default)({ name }) || (0, path_1.resolve)((0, os_1.tmpdir)(), name);
35
35
  }
@@ -15,7 +15,7 @@ const cache_1 = require("ng-packagr/lib/utils/cache");
15
15
  const log = tslib_1.__importStar(require("ng-packagr/lib/utils/log"));
16
16
  const path_1 = require("path");
17
17
  const autoprefixer_1 = tslib_1.__importDefault(require("autoprefixer"));
18
- const postcssUrl = tslib_1.__importStar(require("postcss-url"));
18
+ const postcss_url_1 = tslib_1.__importDefault(require("postcss-url"));
19
19
  const node_url_1 = require("node:url");
20
20
  const tailwindcss_1 = require("../../../../utilities/ng-packagr/tailwindcss");
21
21
  const postcss = require('postcss');
@@ -135,7 +135,7 @@ class StylesheetProcessor {
135
135
  postCssPlugins.push((0, tailwindcss_1.getTailwindPostCssPlugin)(tailwindSetup));
136
136
  }
137
137
  if (this.cssUrl !== CssUrl.none) {
138
- postCssPlugins.push(postcssUrl({ url: this.cssUrl }));
138
+ postCssPlugins.push((0, postcss_url_1.default)({ url: this.cssUrl }));
139
139
  }
140
140
  postCssPlugins.push((0, autoprefixer_1.default)({
141
141
  ignoreUnknownVersions: true,
@@ -8,7 +8,7 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.NX_DEFAULT_OPTIONS_PROVIDER = exports.nxProvideOptions = exports.NX_OPTIONS_TOKEN = void 0;
10
10
  const tslib_1 = require("tslib");
11
- const findCacheDirectory = tslib_1.__importStar(require("find-cache-dir"));
11
+ const find_cache_dir_1 = tslib_1.__importDefault(require("find-cache-dir"));
12
12
  const injection_js_1 = require("injection-js");
13
13
  const os_1 = require("os");
14
14
  const path_1 = require("path");
@@ -31,5 +31,5 @@ function normalizeOptions(options = {}) {
31
31
  }
32
32
  function findCachePath() {
33
33
  const name = 'ng-packagr';
34
- return findCacheDirectory({ name }) || (0, path_1.resolve)((0, os_1.tmpdir)(), name);
34
+ return (0, find_cache_dir_1.default)({ name }) || (0, path_1.resolve)((0, os_1.tmpdir)(), name);
35
35
  }
@@ -15,7 +15,7 @@ const cache_1 = require("ng-packagr/lib/utils/cache");
15
15
  const log = tslib_1.__importStar(require("ng-packagr/lib/utils/log"));
16
16
  const path_1 = require("path");
17
17
  const autoprefixer_1 = tslib_1.__importDefault(require("autoprefixer"));
18
- const postcssUrl = tslib_1.__importStar(require("postcss-url"));
18
+ const postcss_url_1 = tslib_1.__importDefault(require("postcss-url"));
19
19
  const node_url_1 = require("node:url");
20
20
  const tailwindcss_1 = require("../../../utilities/ng-packagr/tailwindcss");
21
21
  const postcss = require('postcss');
@@ -128,7 +128,7 @@ class StylesheetProcessor {
128
128
  postCssPlugins.push((0, tailwindcss_1.getTailwindPostCssPlugin)(tailwindSetup));
129
129
  }
130
130
  if (this.cssUrl !== CssUrl.none) {
131
- postCssPlugins.push(postcssUrl({ url: this.cssUrl }));
131
+ postCssPlugins.push((0, postcss_url_1.default)({ url: this.cssUrl }));
132
132
  }
133
133
  postCssPlugins.push((0, autoprefixer_1.default)({
134
134
  ignoreUnknownVersions: true,