@nx/angular 21.4.0-canary.20250813-811d184 → 21.4.0-canary.20250815-18ba315

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": "21.4.0-canary.20250813-811d184",
3
+ "version": "21.4.0-canary.20250815-18ba315",
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": {
@@ -58,14 +58,14 @@
58
58
  "migrations": "./migrations.json"
59
59
  },
60
60
  "dependencies": {
61
- "@nx/devkit": "21.4.0-canary.20250813-811d184",
62
- "@nx/eslint": "21.4.0-canary.20250813-811d184",
63
- "@nx/js": "21.4.0-canary.20250813-811d184",
64
- "@nx/module-federation": "21.4.0-canary.20250813-811d184",
65
- "@nx/rspack": "21.4.0-canary.20250813-811d184",
66
- "@nx/web": "21.4.0-canary.20250813-811d184",
67
- "@nx/webpack": "21.4.0-canary.20250813-811d184",
68
- "@nx/workspace": "21.4.0-canary.20250813-811d184",
61
+ "@nx/devkit": "21.4.0-canary.20250815-18ba315",
62
+ "@nx/eslint": "21.4.0-canary.20250815-18ba315",
63
+ "@nx/js": "21.4.0-canary.20250815-18ba315",
64
+ "@nx/module-federation": "21.4.0-canary.20250815-18ba315",
65
+ "@nx/rspack": "21.4.0-canary.20250815-18ba315",
66
+ "@nx/web": "21.4.0-canary.20250815-18ba315",
67
+ "@nx/webpack": "21.4.0-canary.20250815-18ba315",
68
+ "@nx/workspace": "21.4.0-canary.20250815-18ba315",
69
69
  "@phenomnomnominal/tsquery": "~5.0.1",
70
70
  "@typescript-eslint/type-utils": "^8.0.0",
71
71
  "enquirer": "~2.3.6",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "extends": "<%= rootTsConfig %>",
3
3
  "compilerOptions": {
4
- "outDir": "<%= rootOffset %>/out-tsc/worker",
4
+ "outDir": "<%= rootOffset %>out-tsc/worker",
5
5
  "lib": [
6
6
  "es2018",
7
7
  "webworker"
@@ -1 +1 @@
1
- {"version":3,"file":"add-snippet.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/web-worker/lib/add-snippet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGvC,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAoChE"}
1
+ {"version":3,"file":"add-snippet.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/web-worker/lib/add-snippet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGvC,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAuChE"}
@@ -6,12 +6,13 @@ function addSnippet(tree, name, path) {
6
6
  const fileRegExp = new RegExp(`^${name}.*\\.ts`);
7
7
  const siblingModules = tree
8
8
  .children(path)
9
- .filter((f) => fileRegExp.test(f) && !/(module|spec|config|routes)\.ts$/.test(f))
9
+ .filter((f) => fileRegExp.test(f) &&
10
+ !/\.(module|spec|config|routes)\.ts$/.test(f) &&
11
+ !f.endsWith('.worker.ts'))
10
12
  .sort();
11
13
  if (siblingModules.length === 0) {
12
14
  return;
13
15
  }
14
- const siblingModulePath = (0, devkit_1.joinPathFragments)(path, siblingModules[0]);
15
16
  const logMessage = 'console.log(`page got message ${data}`);';
16
17
  const workerCreationSnippet = (0, devkit_1.stripIndents) `
17
18
  if (typeof Worker !== 'undefined') {
@@ -26,7 +27,11 @@ function addSnippet(tree, name, path) {
26
27
  // You should add a fallback so that your program still executes correctly.
27
28
  }
28
29
  `;
30
+ // Add snippet to the first alphabetically sorted sibling file
31
+ const siblingModulePath = (0, devkit_1.joinPathFragments)(path, siblingModules[0]);
29
32
  const originalContent = tree.read(siblingModulePath, 'utf-8');
30
- tree.write(siblingModulePath, (0, devkit_1.stripIndents) `${originalContent}
31
- ${workerCreationSnippet}`);
33
+ const newContent = originalContent.trim()
34
+ ? `${originalContent}\n${workerCreationSnippet}`
35
+ : workerCreationSnippet;
36
+ tree.write(siblingModulePath, newContent);
32
37
  }