@nrwl/angular 15.3.0-beta.1 → 15.3.0-beta.11

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.
Files changed (97) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/executors.d.ts +1 -0
  3. package/executors.js +1 -0
  4. package/executors.js.map +1 -1
  5. package/executors.json +9 -4
  6. package/migrations.json +38 -0
  7. package/ng-package.json +1 -0
  8. package/package.json +12 -11
  9. package/src/builders/module-federation-dev-server/module-federation-dev-server.impl.js +4 -66
  10. package/src/builders/module-federation-dev-server/module-federation-dev-server.impl.js.map +1 -1
  11. package/src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl.d.ts +6 -0
  12. package/src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl.js +85 -0
  13. package/src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl.js.map +1 -0
  14. package/src/builders/module-federation-dev-ssr/schema.d.ts +16 -0
  15. package/src/builders/module-federation-dev-ssr/schema.json +84 -0
  16. package/src/builders/utilities/module-federation.d.ts +7 -0
  17. package/src/builders/utilities/module-federation.js +70 -0
  18. package/src/builders/utilities/module-federation.js.map +1 -0
  19. package/src/executors/delegate-build/schema.json +1 -1
  20. package/src/executors/file-server/schema.json +1 -1
  21. package/src/executors/ng-packagr-lite/schema.json +1 -1
  22. package/src/executors/package/schema.json +1 -1
  23. package/src/generators/add-linting/add-linting.d.ts +1 -1
  24. package/src/generators/add-linting/add-linting.js +21 -10
  25. package/src/generators/add-linting/add-linting.js.map +1 -1
  26. package/src/generators/add-linting/lib/add-angular-eslint-dependencies.d.ts +2 -2
  27. package/src/generators/add-linting/lib/add-angular-eslint-dependencies.js +1 -1
  28. package/src/generators/add-linting/lib/add-angular-eslint-dependencies.js.map +1 -1
  29. package/src/generators/add-linting/lib/add-project-lint-target.js +4 -2
  30. package/src/generators/add-linting/lib/add-project-lint-target.js.map +1 -1
  31. package/src/generators/add-linting/lib/create-eslint-configuration.d.ts +75 -0
  32. package/src/generators/add-linting/lib/create-eslint-configuration.js +41 -1
  33. package/src/generators/add-linting/lib/create-eslint-configuration.js.map +1 -1
  34. package/src/generators/application/application.js +1 -1
  35. package/src/generators/application/application.js.map +1 -1
  36. package/src/generators/application/lib/add-unit-test-runner.js +1 -0
  37. package/src/generators/application/lib/add-unit-test-runner.js.map +1 -1
  38. package/src/generators/application/lib/normalize-options.js +5 -3
  39. package/src/generators/application/lib/normalize-options.js.map +1 -1
  40. package/src/generators/component/component.js +1 -1
  41. package/src/generators/component/component.js.map +1 -1
  42. package/src/generators/component/lib/normalize-options.d.ts +1 -1
  43. package/src/generators/component/lib/normalize-options.js +17 -9
  44. package/src/generators/component/lib/normalize-options.js.map +1 -1
  45. package/src/generators/host/files/src/main.server.ts__tmpl__ +66 -0
  46. package/src/generators/host/files/webpack.server.config.js__tmpl__ +3 -0
  47. package/src/generators/host/host.d.ts +1 -1
  48. package/src/generators/host/host.js +9 -2
  49. package/src/generators/host/host.js.map +1 -1
  50. package/src/generators/host/lib/add-ssr.d.ts +3 -0
  51. package/src/generators/host/lib/add-ssr.js +40 -0
  52. package/src/generators/host/lib/add-ssr.js.map +1 -0
  53. package/src/generators/host/lib/index.d.ts +1 -0
  54. package/src/generators/host/lib/index.js +5 -0
  55. package/src/generators/host/lib/index.js.map +1 -0
  56. package/src/generators/host/schema.d.ts +1 -0
  57. package/src/generators/host/schema.json +5 -0
  58. package/src/generators/init/angular-v14/init.d.ts +4 -0
  59. package/src/generators/init/angular-v14/init.js +122 -0
  60. package/src/generators/init/angular-v14/init.js.map +1 -0
  61. package/src/generators/init/angular-v14/schema.d.ts +13 -0
  62. package/src/generators/init/init.d.ts +1 -1
  63. package/src/generators/init/init.js +15 -7
  64. package/src/generators/init/init.js.map +1 -1
  65. package/src/generators/library/lib/normalize-options.js +9 -9
  66. package/src/generators/library/lib/normalize-options.js.map +1 -1
  67. package/src/generators/ng-add/migrate-from-angular-cli.d.ts +2 -2
  68. package/src/generators/ng-add/migrate-from-angular-cli.js +14 -10
  69. package/src/generators/ng-add/migrate-from-angular-cli.js.map +1 -1
  70. package/src/generators/ng-add/utilities/format-files-task.d.ts +2 -0
  71. package/src/generators/ng-add/utilities/format-files-task.js +19 -0
  72. package/src/generators/ng-add/utilities/format-files-task.js.map +1 -0
  73. package/src/generators/ng-add/utilities/index.d.ts +1 -0
  74. package/src/generators/ng-add/utilities/index.js +1 -0
  75. package/src/generators/ng-add/utilities/index.js.map +1 -1
  76. package/src/generators/ng-add/utilities/workspace.d.ts +4 -1
  77. package/src/generators/ng-add/utilities/workspace.js +76 -16
  78. package/src/generators/ng-add/utilities/workspace.js.map +1 -1
  79. package/src/generators/ngrx/files/__directory__/__fileName__.facade.ts__tmpl__ +5 -5
  80. package/src/generators/ngrx/files/__directory__/__fileName__.selectors.spec.ts__tmpl__ +8 -8
  81. package/src/generators/ngrx/files/__directory__/__fileName__.selectors.ts__tmpl__ +14 -14
  82. package/src/generators/remote/files/src/main.server.ts__tmpl__ +8 -0
  83. package/src/generators/remote/lib/add-ssr.d.ts +4 -2
  84. package/src/generators/remote/lib/add-ssr.js +10 -2
  85. package/src/generators/remote/lib/add-ssr.js.map +1 -1
  86. package/src/generators/remote/remote.js +1 -1
  87. package/src/generators/remote/remote.js.map +1 -1
  88. package/src/generators/setup-ssr/files/src/main.ts__tpl__ +1 -1
  89. package/src/generators/setup-ssr/lib/update-project-config.js +1 -0
  90. package/src/generators/setup-ssr/lib/update-project-config.js.map +1 -1
  91. package/src/generators/storybook-configuration/schema.json +1 -2
  92. package/src/utils/get-generator-directory-for-ng-version.d.ts +2 -0
  93. package/src/utils/get-generator-directory-for-ng-version.js +20 -0
  94. package/src/utils/get-generator-directory-for-ng-version.js.map +1 -0
  95. package/src/utils/versions.d.ts +39 -2
  96. package/src/utils/versions.js +40 -3
  97. package/src/utils/versions.js.map +1 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,6 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- # [15.3.0-beta.1](https://github.com/nrwl/nx/compare/15.2.0...15.3.0-beta.1) (2022-11-24)
6
+ # [15.3.0-beta.11](https://github.com/nrwl/nx/compare/15.2.0...15.3.0-beta.11) (2022-12-01)
7
7
 
8
8
  **Note:** Version bump only for package @nrwl/angular
package/executors.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './src/builders/module-federation-dev-server/module-federation-dev-server.impl';
2
+ export * from './src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl';
2
3
  export * from './src/builders/webpack-browser/webpack-browser.impl';
3
4
  export * from './src/builders/webpack-dev-server/webpack-dev-server.impl';
4
5
  export * from './src/builders/webpack-server/webpack-server.impl';
package/executors.js CHANGED
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./src/builders/module-federation-dev-server/module-federation-dev-server.impl"), exports);
5
+ tslib_1.__exportStar(require("./src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl"), exports);
5
6
  tslib_1.__exportStar(require("./src/builders/webpack-browser/webpack-browser.impl"), exports);
6
7
  tslib_1.__exportStar(require("./src/builders/webpack-dev-server/webpack-dev-server.impl"), exports);
7
8
  tslib_1.__exportStar(require("./src/builders/webpack-server/webpack-server.impl"), exports);
package/executors.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"executors.js","sourceRoot":"","sources":["../../../packages/angular/executors.ts"],"names":[],"mappings":";;;AAAA,wHAA8F;AAC9F,8FAAoE;AACpE,oGAA0E;AAC1E,4FAAkE;AAClE,6FAAmE;AACnE,+FAAqE;AACrE,+EAAqD"}
1
+ {"version":3,"file":"executors.js","sourceRoot":"","sources":["../../../packages/angular/executors.ts"],"names":[],"mappings":";;;AAAA,wHAA8F;AAC9F,kHAAwF;AACxF,8FAAoE;AACpE,oGAA0E;AAC1E,4FAAkE;AAClE,6FAAmE;AACnE,+FAAqE;AACrE,+EAAqD"}
package/executors.json CHANGED
@@ -8,17 +8,17 @@
8
8
  "ng-packagr-lite": {
9
9
  "implementation": "./src/executors/ng-packagr-lite/ng-packagr-lite.impl",
10
10
  "schema": "./src/executors/ng-packagr-lite/schema.json",
11
- "description": "Builds a library with support for incremental builds."
11
+ "description": "Builds a library with support for incremental builds.\nThis executor is meant to be used with buildable libraries in an incremental build scenario. It is similar to the `@nrwl/angular:package` executor but with some key differences:\n- It doesn't run `ngcc` automatically (`ngcc` needs to be run separately beforehand if needed, this can be done in a `postinstall` hook on `package.json`).\n- It only produces ESM2020 bundles.\n- It doesn't generate package exports in the `package.json`."
12
12
  },
13
13
  "package": {
14
14
  "implementation": "./src/executors/package/package.impl",
15
15
  "schema": "./src/executors/package/schema.json",
16
- "description": "Builds and packages an Angular library to be distributed as an NPM package. It supports incremental builds."
16
+ "description": "Builds and packages an Angular library producing an output following the Angular Package Format (APF) to be distributed as an NPM package.\nThis executor is similar to the `@angular-devkit/build-angular:ng-packagr` with additional support for incremental builds."
17
17
  },
18
18
  "file-server": {
19
19
  "implementation": "./src/executors/file-server/file-server.impl",
20
20
  "schema": "./src/executors/file-server/schema.json",
21
- "description": "Serve a web application from a folder."
21
+ "description": "Serves a static web application from a folder."
22
22
  }
23
23
  },
24
24
  "builders": {
@@ -30,7 +30,7 @@
30
30
  "ng-packagr-lite": {
31
31
  "implementation": "./src/executors/ng-packagr-lite/compat",
32
32
  "schema": "./src/executors/ng-packagr-lite/schema.json",
33
- "description": "Builds a library with support for incremental builds."
33
+ "description": "Builds a library with support for incremental builds.\nThis executor is meant to be used with buildable libraries in an incremental build scenario. It is similar to the `@nrwl/angular:package` executor but with some key differences:\n- It doesn't run `ngcc` automatically (`ngcc` needs to be run separately beforehand if needed, this can be done in a `postinstall` hook on `package.json`)\n- It only produces ESM2020 bundles\n- It doesn't generate package exports in the `package.json`"
34
34
  },
35
35
  "package": {
36
36
  "implementation": "./src/executors/package/compat",
@@ -57,6 +57,11 @@
57
57
  "schema": "./src/builders/module-federation-dev-server/schema.json",
58
58
  "description": "The module-federation-dev-server executor is reserved exclusively for use with host Module Federation applications. It allows the user to specify which remote applications should be served with the host."
59
59
  },
60
+ "module-federation-dev-ssr": {
61
+ "implementation": "./src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl",
62
+ "schema": "./src/builders/module-federation-dev-ssr/schema.json",
63
+ "description": "The module-federation-dev-ssr executor is reserved exclusively for use with host Module Federation applications that use SSR. It allows the user to specify which remote applications should be served with the host."
64
+ },
60
65
  "file-server": {
61
66
  "implementation": "./src/executors/file-server/compat",
62
67
  "schema": "./src/executors/file-server/schema.json",
package/migrations.json CHANGED
@@ -1665,6 +1665,44 @@
1665
1665
  "@angular-eslint/template-parser": {
1666
1666
  "version": "~15.0.0",
1667
1667
  "alwaysAddToPackageJson": false
1668
+ },
1669
+ "jest-preset-angular": {
1670
+ "version": "12.2.3",
1671
+ "alwaysAddToPackageJson": false
1672
+ }
1673
+ }
1674
+ },
1675
+ "15.2.4": {
1676
+ "version": "15.2.4-beta.0",
1677
+ "packages": {
1678
+ "packages": {
1679
+ "@ngrx/store": {
1680
+ "version": "~15.0.0",
1681
+ "alwaysAddToPackageJson": false
1682
+ },
1683
+ "@ngrx/effects": {
1684
+ "version": "~15.0.0",
1685
+ "alwaysAddToPackageJson": false
1686
+ },
1687
+ "@ngrx/entity": {
1688
+ "version": "~15.0.0",
1689
+ "alwaysAddToPackageJson": false
1690
+ },
1691
+ "@ngrx/router-store": {
1692
+ "version": "~15.0.0",
1693
+ "alwaysAddToPackageJson": false
1694
+ },
1695
+ "@ngrx/schematics": {
1696
+ "version": "~15.0.0",
1697
+ "alwaysAddToPackageJson": false
1698
+ },
1699
+ "@ngrx/store-devtools": {
1700
+ "version": "~15.0.0",
1701
+ "alwaysAddToPackageJson": false
1702
+ },
1703
+ "@ngrx/component-store": {
1704
+ "version": "~15.0.0"
1705
+ }
1668
1706
  }
1669
1707
  }
1670
1708
  }
package/ng-package.json CHANGED
@@ -7,6 +7,7 @@
7
7
  "@nrwl/",
8
8
  "@angular-devkit",
9
9
  "@angular-eslint/",
10
+ "@nguniversal/builders",
10
11
  "@schematics",
11
12
  "@phenomnomnominal/tsquery",
12
13
  "@typescript-eslint/",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nrwl/angular",
3
- "version": "15.3.0-beta.1",
3
+ "version": "15.3.0-beta.11",
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, Cypress, Karma, and Protractor. \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": {
@@ -66,16 +66,17 @@
66
66
  "migrations": "./migrations.json"
67
67
  },
68
68
  "dependencies": {
69
- "@angular-devkit/schematics": "~15.0.0",
70
- "@nrwl/cypress": "15.3.0-beta.1",
71
- "@nrwl/devkit": "15.3.0-beta.1",
72
- "@nrwl/jest": "15.3.0-beta.1",
73
- "@nrwl/linter": "15.3.0-beta.1",
74
- "@nrwl/storybook": "15.3.0-beta.1",
75
- "@nrwl/webpack": "15.3.0-beta.1",
76
- "@nrwl/workspace": "15.3.0-beta.1",
69
+ "@angular-devkit/schematics": "~15.0.1",
70
+ "@nguniversal/builders": "~15.0.0",
71
+ "@nrwl/cypress": "15.3.0-beta.11",
72
+ "@nrwl/devkit": "15.3.0-beta.11",
73
+ "@nrwl/jest": "15.3.0-beta.11",
74
+ "@nrwl/linter": "15.3.0-beta.11",
75
+ "@nrwl/storybook": "15.3.0-beta.11",
76
+ "@nrwl/webpack": "15.3.0-beta.11",
77
+ "@nrwl/workspace": "15.3.0-beta.11",
77
78
  "@phenomnomnominal/tsquery": "4.1.1",
78
- "@schematics/angular": "~15.0.0",
79
+ "@schematics/angular": "~15.0.1",
79
80
  "chalk": "4.1.0",
80
81
  "chokidar": "^3.5.1",
81
82
  "http-server": "^14.1.0",
@@ -99,5 +100,5 @@
99
100
  "fesm2015": "fesm2015/nrwl-angular.mjs",
100
101
  "typings": "index.d.ts",
101
102
  "sideEffects": false,
102
- "gitHead": "2d43fddb87f6044faf72cb3d3bc7ca82d36b3237"
103
+ "gitHead": "4c723de4448fef0b7d0da2f47af3b27d847b2816"
103
104
  }
@@ -5,71 +5,9 @@ const tslib_1 = require("tslib");
5
5
  const devkit_1 = require("@nrwl/devkit");
6
6
  const ngcli_adapter_1 = require("nx/src/adapter/ngcli-adapter");
7
7
  const architect_1 = require("@angular-devkit/architect");
8
- const path_1 = require("path");
9
8
  const webpack_dev_server_impl_1 = require("../webpack-dev-server/webpack-dev-server.impl");
10
- const fs_1 = require("fs");
11
9
  const project_graph_1 = require("nx/src/project-graph/project-graph");
12
- function getDynamicRemotes(project, context, workspaceProjects, remotesToSkip) {
13
- // check for dynamic remotes
14
- // we should only check for dynamic based on what we generate
15
- // and fallback to empty array
16
- const standardPathToGeneratedMFManifestJson = (0, path_1.join)(context.workspaceRoot, project.sourceRoot, 'assets/module-federation.manifest.json');
17
- if (!(0, fs_1.existsSync)(standardPathToGeneratedMFManifestJson)) {
18
- return [];
19
- }
20
- const moduleFederationManifestJson = (0, fs_1.readFileSync)(standardPathToGeneratedMFManifestJson, 'utf-8');
21
- if (!moduleFederationManifestJson) {
22
- return [];
23
- }
24
- // This should have shape of
25
- // {
26
- // "remoteName": "remoteLocation",
27
- // }
28
- const parsedManifest = JSON.parse(moduleFederationManifestJson);
29
- if (!Object.keys(parsedManifest).every((key) => typeof key === 'string' && typeof parsedManifest[key] === 'string')) {
30
- return [];
31
- }
32
- const dynamicRemotes = Object.entries(parsedManifest)
33
- .map(([remoteName]) => remoteName)
34
- .filter((r) => !remotesToSkip.has(r));
35
- const invalidDynamicRemotes = dynamicRemotes.filter((remote) => !workspaceProjects[remote]);
36
- if (invalidDynamicRemotes.length) {
37
- throw new Error(invalidDynamicRemotes.length === 1
38
- ? `Invalid dynamic remote configured in "${standardPathToGeneratedMFManifestJson}": ${invalidDynamicRemotes[0]}.`
39
- : `Invalid dynamic remotes configured in "${standardPathToGeneratedMFManifestJson}": ${invalidDynamicRemotes.join(', ')}.`);
40
- }
41
- return dynamicRemotes;
42
- }
43
- function getStaticRemotes(project, context, workspaceProjects, remotesToSkip) {
44
- const mfConfigPath = (0, path_1.join)(context.workspaceRoot, project.root, 'module-federation.config.js');
45
- let mfeConfig;
46
- try {
47
- mfeConfig = require(mfConfigPath);
48
- }
49
- catch (_a) {
50
- throw new Error(`Could not load ${mfConfigPath}. Was this project generated with "@nrwl/angular:host"?`);
51
- }
52
- const remotesConfig = mfeConfig.remotes.length > 0 ? mfeConfig.remotes : [];
53
- const staticRemotes = remotesConfig
54
- .map((remoteDefinition) => Array.isArray(remoteDefinition) ? remoteDefinition[0] : remoteDefinition)
55
- .filter((r) => !remotesToSkip.has(r));
56
- const invalidStaticRemotes = staticRemotes.filter((remote) => !workspaceProjects[remote]);
57
- if (invalidStaticRemotes.length) {
58
- throw new Error(invalidStaticRemotes.length === 1
59
- ? `Invalid static remote configured in "${mfConfigPath}": ${invalidStaticRemotes[0]}.`
60
- : `Invalid static remotes configured in "${mfConfigPath}": ${invalidStaticRemotes.join(', ')}.`);
61
- }
62
- return staticRemotes;
63
- }
64
- function validateDevRemotes(options, workspaceProjects) {
65
- var _a;
66
- const invalidDevRemotes = (_a = options.devRemotes) === null || _a === void 0 ? void 0 : _a.filter((remote) => !workspaceProjects[remote]);
67
- if (invalidDevRemotes.length) {
68
- throw new Error(invalidDevRemotes.length === 1
69
- ? `Invalid dev remote provided: ${invalidDevRemotes[0]}.`
70
- : `Invalid dev remotes provided: ${invalidDevRemotes.join(', ')}.`);
71
- }
72
- }
10
+ const module_federation_1 = require("../utilities/module-federation");
73
11
  function executeModuleFederationDevServerBuilder(schema, context) {
74
12
  var _a, _b, _c;
75
13
  const options = tslib_1.__rest(schema, []);
@@ -77,10 +15,10 @@ function executeModuleFederationDevServerBuilder(schema, context) {
77
15
  const { projects: workspaceProjects } = (0, project_graph_1.readProjectsConfigurationFromProjectGraph)(projectGraph);
78
16
  const ws = new devkit_1.Workspaces(devkit_1.workspaceRoot);
79
17
  const project = workspaceProjects[context.target.project];
80
- validateDevRemotes(options, workspaceProjects);
18
+ (0, module_federation_1.validateDevRemotes)(options, workspaceProjects);
81
19
  const remotesToSkip = new Set((_a = options.skipRemotes) !== null && _a !== void 0 ? _a : []);
82
- const staticRemotes = getStaticRemotes(project, context, workspaceProjects, remotesToSkip);
83
- const dynamicRemotes = getDynamicRemotes(project, context, workspaceProjects, remotesToSkip);
20
+ const staticRemotes = (0, module_federation_1.getStaticRemotes)(project, context, workspaceProjects, remotesToSkip);
21
+ const dynamicRemotes = (0, module_federation_1.getDynamicRemotes)(project, context, workspaceProjects, remotesToSkip);
84
22
  const remotes = [...staticRemotes, ...dynamicRemotes];
85
23
  const devServeRemotes = !options.devRemotes
86
24
  ? []
@@ -1 +1 @@
1
- {"version":3,"file":"module-federation-dev-server.impl.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/builders/module-federation-dev-server/module-federation-dev-server.impl.ts"],"names":[],"mappings":";;;;AACA,yCAMsB;AACtB,gEAA8D;AAC9D,yDAA0E;AAE1E,+BAA4B;AAC5B,2FAA+F;AAC/F,2BAA8C;AAC9C,sEAA+F;AAE/F,SAAS,iBAAiB,CACxB,OAA6B,EAC7B,OAAuB,EACvB,iBAAuD,EACvD,aAA0B;IAE1B,4BAA4B;IAC5B,6DAA6D;IAC7D,8BAA8B;IAE9B,MAAM,qCAAqC,GAAG,IAAA,WAAI,EAChD,OAAO,CAAC,aAAa,EACrB,OAAO,CAAC,UAAU,EAClB,wCAAwC,CACzC,CAAC;IACF,IAAI,CAAC,IAAA,eAAU,EAAC,qCAAqC,CAAC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AC,aAAa,EACrB;YACE,OAAO,EAAE,MAAM;YACf,MAAM;YACN,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa;YAC3C,UAAU;SACX,EACD,OAAO,CAAC,OAAO,CAChB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;YACb,GAAG,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;gBAC5B,MAAM,IAAI,KAAK,CACb,WAAW,MAAM,yDAAyD,GAAG,CAAC,QAAQ,EAAE,EAAE,CAC3F,CAAC;YACJ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;KACJ;IAED,OAAO,IAAA,wDAA8B,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC1D,CAAC;AA9ED,0FA8EC;AAED,kBAAe,IAAA,yBAAa,EAC1B,uCAAuC,CACxC,CAAC"}
1
+ {"version":3,"file":"module-federation-dev-server.impl.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/builders/module-federation-dev-server/module-federation-dev-server.impl.ts"],"names":[],"mappings":";;;;AACA,yCAIsB;AACtB,gEAA8D;AAC9D,yDAA0E;AAE1E,2FAA+F;AAC/F,sEAA+F;AAC/F,sEAIwC;AAExC,SAAgB,uCAAuC,CACrD,MAAc,EACd,OAAuB;;IAEvB,MAAW,OAAO,kBAAK,MAAM,EAAvB,EAAc,CAAS,CAAC;IAC9B,MAAM,YAAY,GAAG,IAAA,+BAAsB,GAAE,CAAC;IAC9C,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GACnC,IAAA,yDAAyC,EAAC,YAAY,CAAC,CAAC;IAC1D,MAAM,EAAE,GAAG,IAAI,mBAAU,CAAC,sBAAa,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG,iBAAiB,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAE1D,IAAA,sCAAkB,EAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;IAE/C,MAAM,aAAa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U,EAAE,QAAQ,CAAC,GAC1B,iBAAiB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAChE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;YAEzD,IAAI,MAAM,CAAC,oBAAoB,IAAI,SAAS,IAAI,MAAM,CAAC,UAAU,EAAE;gBACjE,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;aACtC;SACF;QAED,IAAA,8BAAc,EACZ,OAAO,CAAC,aAAa,EACrB;YACE,OAAO,EAAE,MAAM;YACf,MAAM;YACN,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa;YAC3C,UAAU;SACX,EACD,OAAO,CAAC,OAAO,CAChB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;YACb,GAAG,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;gBAC5B,MAAM,IAAI,KAAK,CACb,WAAW,MAAM,yDAAyD,GAAG,CAAC,QAAQ,EAAE,EAAE,CAC3F,CAAC;YACJ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;KACJ;IAED,OAAO,IAAA,wDAA8B,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC1D,CAAC;AA9ED,0FA8EC;AAED,kBAAe,IAAA,yBAAa,EAC1B,uCAAuC,CACxC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { Schema } from './schema';
2
+ import type { BuilderContext } from '@angular-devkit/architect';
3
+ import type { JsonObject } from '@angular-devkit/core';
4
+ export declare function executeModuleFederationDevSSRBuilder(schema: Schema, context: BuilderContext): import("rxjs").Observable<import("@nguniversal/builders").SSRDevServerBuilderOutput>;
5
+ declare const _default: import("@angular-devkit/architect/src/internal").Builder<JsonObject & Schema>;
6
+ export default _default;
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.executeModuleFederationDevSSRBuilder = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const architect_1 = require("@angular-devkit/architect");
6
+ const builders_1 = require("@nguniversal/builders");
7
+ const project_graph_1 = require("nx/src/project-graph/project-graph");
8
+ const devkit_1 = require("@nrwl/devkit");
9
+ const module_federation_1 = require("../utilities/module-federation");
10
+ const operators_1 = require("rxjs/operators");
11
+ const rxjs_1 = require("rxjs");
12
+ const path_1 = require("path");
13
+ const child_process_1 = require("child_process");
14
+ const ngcli_adapter_1 = require("nx/src/adapter/ngcli-adapter");
15
+ function executeModuleFederationDevSSRBuilder(schema, context) {
16
+ var _a, _b, _c;
17
+ const options = tslib_1.__rest(schema, []);
18
+ const projectGraph = (0, devkit_1.readCachedProjectGraph)();
19
+ const { projects: workspaceProjects } = (0, project_graph_1.readProjectsConfigurationFromProjectGraph)(projectGraph);
20
+ const ws = new devkit_1.Workspaces(devkit_1.workspaceRoot);
21
+ const project = workspaceProjects[context.target.project];
22
+ (0, module_federation_1.validateDevRemotes)(options, workspaceProjects);
23
+ const remotesToSkip = new Set((_a = options.skipRemotes) !== null && _a !== void 0 ? _a : []);
24
+ const staticRemotes = (0, module_federation_1.getStaticRemotes)(project, context, workspaceProjects, remotesToSkip);
25
+ const dynamicRemotes = (0, module_federation_1.getDynamicRemotes)(project, context, workspaceProjects, remotesToSkip);
26
+ const remotes = [...staticRemotes, ...dynamicRemotes];
27
+ const devServeRemotes = !options.devRemotes
28
+ ? []
29
+ : Array.isArray(options.devRemotes)
30
+ ? options.devRemotes
31
+ : [options.devRemotes];
32
+ const remoteProcessPromises = [];
33
+ for (const remote of remotes) {
34
+ const isDev = devServeRemotes.includes(remote);
35
+ const target = isDev ? 'serve-ssr' : 'static-server';
36
+ if (!((_b = workspaceProjects[remote].targets) === null || _b === void 0 ? void 0 : _b[target])) {
37
+ throw new Error(`Could not find "${target}" target in "${remote}" project.`);
38
+ }
39
+ else if (!((_c = workspaceProjects[remote].targets) === null || _c === void 0 ? void 0 : _c[target].executor)) {
40
+ throw new Error(`Could not find executor for "${target}" target in "${remote}" project.`);
41
+ }
42
+ const runOptions = {};
43
+ if (options.verbose) {
44
+ const [collection, executor] = workspaceProjects[remote].targets[target].executor.split(':');
45
+ const { schema } = ws.readExecutor(collection, executor);
46
+ if (schema.additionalProperties || 'verbose' in schema.properties) {
47
+ runOptions.verbose = options.verbose;
48
+ }
49
+ }
50
+ const remotePromise = new Promise((res, rej) => {
51
+ if (target === 'static-server') {
52
+ const remoteProject = workspaceProjects[remote];
53
+ const remoteServerOutput = (0, path_1.join)(devkit_1.workspaceRoot, remoteProject.targets.server.options.outputPath, 'main.js');
54
+ (0, child_process_1.execSync)(`npx nx run ${remote}:server${context.target.configuration
55
+ ? `:${context.target.configuration}`
56
+ : ''}`, { stdio: 'inherit' });
57
+ const child = (0, child_process_1.fork)(remoteServerOutput, {
58
+ env: { PORT: remoteProject.targets['serve-ssr'].options.port },
59
+ });
60
+ child.on('message', (msg) => {
61
+ if (msg === 'nx.server.ready') {
62
+ res();
63
+ }
64
+ });
65
+ }
66
+ if (target === 'serve-ssr') {
67
+ (0, ngcli_adapter_1.scheduleTarget)(context.workspaceRoot, {
68
+ project: remote,
69
+ target,
70
+ configuration: context.target.configuration,
71
+ runOptions,
72
+ }, options.verbose).then((obs) => obs
73
+ .pipe((0, operators_1.tap)((result) => {
74
+ result.success && res();
75
+ }))
76
+ .toPromise());
77
+ }
78
+ });
79
+ remoteProcessPromises.push(remotePromise);
80
+ }
81
+ return (0, rxjs_1.from)(Promise.all(remoteProcessPromises)).pipe((0, operators_1.switchMap)(() => (0, builders_1.executeSSRDevServerBuilder)(options, context)));
82
+ }
83
+ exports.executeModuleFederationDevSSRBuilder = executeModuleFederationDevSSRBuilder;
84
+ exports.default = (0, architect_1.createBuilder)(executeModuleFederationDevSSRBuilder);
85
+ //# sourceMappingURL=module-federation-dev-ssr.impl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-federation-dev-ssr.impl.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl.ts"],"names":[],"mappings":";;;;AAEA,yDAA0D;AAE1D,oDAAmE;AACnE,sEAA+F;AAC/F,yCAIsB;AACtB,sEAIwC;AACxC,8CAAgD;AAChD,+BAA4B;AAC5B,+BAA4B;AAC5B,iDAA+C;AAC/C,gEAA8D;AAE9D,SAAgB,oCAAoC,CAClD,MAAc,EACd,OAAuB;;IAEvB,MAAW,OAAO,kBAAK,MAAM,EAAvB,EAAc,CAAS,CAAC;IAC9B,MAAM,YAAY,GAAG,IAAA,+BAAsB,GAAE,CAAC;IAC9C,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GACnC,IAAA,yDAAyC,EAAC,YAAY,CAAC,CAAC;IAC1D,MAAM,EAAE,GAAG,IAAI,mBAAU,CAAC,sBAAa,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG,iBAAiB,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAE1D,IAAA,sCAAkB,EAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;IAE/C,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,MAAA,OAAO,CAAC,WAAW,mCAAI,EAAE,CAAC,CAAC;IACzD,MAAM,aAAa,GAAG,IAAA,oCAAgB,EACpC,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,aAAa,CACd,CAAC;IACF,MAAM,cAAc,GAAG,IAAA,qCAAiB,EACtC,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,aAAa,CACd,CAAC;IACF,MAAM,OAAO,GAAG,CAAC,GAAG,aAAa,EAAE,GAAG,cAAc,CAAC,CAAC;IAEtD,MAAM,eAAe,GAAG,CAAC,OAAO,CAAC,UAAU;QACzC,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CA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,EAAE,CACf,CAAC;aACH;QACH,CAAC,CAAC,CAAC;QAEH,qBAAqB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;KAC3C;IAED,OAAO,IAAA,WAAI,EAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,CAAC,IAAI,CAClD,IAAA,qBAAS,EAAC,GAAG,EAAE,CAAC,IAAA,qCAA0B,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAC9D,CAAC;AACJ,CAAC;AAlHD,oFAkHC;AAED,kBAAe,IAAA,yBAAa,EAC1B,oCAAoC,CACrC,CAAC"}
@@ -0,0 +1,16 @@
1
+ export interface Schema {
2
+ browserTarget: string;
3
+ serverTarget: string;
4
+ host?: string;
5
+ port?: number;
6
+ progress: boolean;
7
+ open?: boolean;
8
+ publicHost?: string;
9
+ ssl?: boolean;
10
+ sslKey?: string;
11
+ sslCert?: string;
12
+ proxyConfig?: string;
13
+ devRemotes?: string[];
14
+ skipRemotes?: string[];
15
+ verbose?: boolean;
16
+ }
@@ -0,0 +1,84 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "title": "Module Federation SSR Dev Server Target",
4
+ "description": "SSR Dev Server target options for Module Federation host applications.",
5
+ "type": "object",
6
+ "properties": {
7
+ "browserTarget": {
8
+ "type": "string",
9
+ "description": "Browser target to build.",
10
+ "pattern": ".+:.+(:.+)?"
11
+ },
12
+ "serverTarget": {
13
+ "type": "string",
14
+ "description": "Server target to build.",
15
+ "pattern": ".+:.+(:.+)?"
16
+ },
17
+ "host": {
18
+ "type": "string",
19
+ "description": "Host to listen on.",
20
+ "default": "localhost"
21
+ },
22
+ "port": {
23
+ "type": "number",
24
+ "default": 4200,
25
+ "description": "Port to start the development server at. Default is 4200. Pass 0 to get a dynamically assigned port."
26
+ },
27
+ "publicHost": {
28
+ "type": "string",
29
+ "description": "The URL that the browser client should use to connect to the development server. Use for a complex dev server setup, such as one with reverse proxies."
30
+ },
31
+ "open": {
32
+ "type": "boolean",
33
+ "description": "Opens the url in default browser.",
34
+ "default": false,
35
+ "alias": "o"
36
+ },
37
+ "progress": {
38
+ "type": "boolean",
39
+ "description": "Log progress to the console while building."
40
+ },
41
+ "inspect": {
42
+ "type": "boolean",
43
+ "description": "Launch the development server in inspector mode and listen on address and port '127.0.0.1:9229'.",
44
+ "default": false
45
+ },
46
+ "ssl": {
47
+ "type": "boolean",
48
+ "description": "Serve using HTTPS.",
49
+ "default": false
50
+ },
51
+ "sslKey": {
52
+ "type": "string",
53
+ "description": "SSL key to use for serving HTTPS."
54
+ },
55
+ "sslCert": {
56
+ "type": "string",
57
+ "description": "SSL certificate to use for serving HTTPS."
58
+ },
59
+ "proxyConfig": {
60
+ "type": "string",
61
+ "description": "Proxy configuration file."
62
+ },
63
+ "devRemotes": {
64
+ "type": "array",
65
+ "items": {
66
+ "type": "string"
67
+ },
68
+ "description": "List of remote applications to run in development mode (i.e. using serve target)."
69
+ },
70
+ "skipRemotes": {
71
+ "type": "array",
72
+ "items": {
73
+ "type": "string"
74
+ },
75
+ "description": "List of remote applications to not automatically serve, either statically or in development mode. This can be useful for multi-repository module federation setups where the host application uses a remote application from an external repository."
76
+ },
77
+ "verbose": {
78
+ "type": "boolean",
79
+ "description": "Adds more details to output logging."
80
+ }
81
+ },
82
+ "additionalProperties": false,
83
+ "required": ["browserTarget", "serverTarget"]
84
+ }
@@ -0,0 +1,7 @@
1
+ import { ProjectConfiguration } from 'nx/src/config/workspace-json-project-json';
2
+ import { BuilderContext } from '@angular-devkit/architect';
3
+ export declare function getDynamicRemotes(project: ProjectConfiguration, context: BuilderContext, workspaceProjects: Record<string, ProjectConfiguration>, remotesToSkip: Set<string>): string[];
4
+ export declare function getStaticRemotes(project: ProjectConfiguration, context: BuilderContext, workspaceProjects: Record<string, ProjectConfiguration>, remotesToSkip: Set<string>): string[];
5
+ export declare function validateDevRemotes(options: {
6
+ devRemotes?: string[];
7
+ }, workspaceProjects: Record<string, ProjectConfiguration>): void;
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateDevRemotes = exports.getStaticRemotes = exports.getDynamicRemotes = void 0;
4
+ const path_1 = require("path");
5
+ const fs_1 = require("fs");
6
+ function getDynamicRemotes(project, context, workspaceProjects, remotesToSkip) {
7
+ // check for dynamic remotes
8
+ // we should only check for dynamic based on what we generate
9
+ // and fallback to empty array
10
+ const standardPathToGeneratedMFManifestJson = (0, path_1.join)(context.workspaceRoot, project.sourceRoot, 'assets/module-federation.manifest.json');
11
+ if (!(0, fs_1.existsSync)(standardPathToGeneratedMFManifestJson)) {
12
+ return [];
13
+ }
14
+ const moduleFederationManifestJson = (0, fs_1.readFileSync)(standardPathToGeneratedMFManifestJson, 'utf-8');
15
+ if (!moduleFederationManifestJson) {
16
+ return [];
17
+ }
18
+ // This should have shape of
19
+ // {
20
+ // "remoteName": "remoteLocation",
21
+ // }
22
+ const parsedManifest = JSON.parse(moduleFederationManifestJson);
23
+ if (!Object.keys(parsedManifest).every((key) => typeof key === 'string' && typeof parsedManifest[key] === 'string')) {
24
+ return [];
25
+ }
26
+ const dynamicRemotes = Object.entries(parsedManifest)
27
+ .map(([remoteName]) => remoteName)
28
+ .filter((r) => !remotesToSkip.has(r));
29
+ const invalidDynamicRemotes = dynamicRemotes.filter((remote) => !workspaceProjects[remote]);
30
+ if (invalidDynamicRemotes.length) {
31
+ throw new Error(invalidDynamicRemotes.length === 1
32
+ ? `Invalid dynamic remote configured in "${standardPathToGeneratedMFManifestJson}": ${invalidDynamicRemotes[0]}.`
33
+ : `Invalid dynamic remotes configured in "${standardPathToGeneratedMFManifestJson}": ${invalidDynamicRemotes.join(', ')}.`);
34
+ }
35
+ return dynamicRemotes;
36
+ }
37
+ exports.getDynamicRemotes = getDynamicRemotes;
38
+ function getStaticRemotes(project, context, workspaceProjects, remotesToSkip) {
39
+ const mfConfigPath = (0, path_1.join)(context.workspaceRoot, project.root, 'module-federation.config.js');
40
+ let mfeConfig;
41
+ try {
42
+ mfeConfig = require(mfConfigPath);
43
+ }
44
+ catch (_a) {
45
+ throw new Error(`Could not load ${mfConfigPath}. Was this project generated with "@nrwl/angular:host"?`);
46
+ }
47
+ const remotesConfig = mfeConfig.remotes.length > 0 ? mfeConfig.remotes : [];
48
+ const staticRemotes = remotesConfig
49
+ .map((remoteDefinition) => Array.isArray(remoteDefinition) ? remoteDefinition[0] : remoteDefinition)
50
+ .filter((r) => !remotesToSkip.has(r));
51
+ const invalidStaticRemotes = staticRemotes.filter((remote) => !workspaceProjects[remote]);
52
+ if (invalidStaticRemotes.length) {
53
+ throw new Error(invalidStaticRemotes.length === 1
54
+ ? `Invalid static remote configured in "${mfConfigPath}": ${invalidStaticRemotes[0]}.`
55
+ : `Invalid static remotes configured in "${mfConfigPath}": ${invalidStaticRemotes.join(', ')}.`);
56
+ }
57
+ return staticRemotes;
58
+ }
59
+ exports.getStaticRemotes = getStaticRemotes;
60
+ function validateDevRemotes(options, workspaceProjects) {
61
+ var _a;
62
+ const invalidDevRemotes = (_a = options.devRemotes) === null || _a === void 0 ? void 0 : _a.filter((remote) => !workspaceProjects[remote]);
63
+ if (invalidDevRemotes.length) {
64
+ throw new Error(invalidDevRemotes.length === 1
65
+ ? `Invalid dev remote provided: ${invalidDevRemotes[0]}.`
66
+ : `Invalid dev remotes provided: ${invalidDevRemotes.join(', ')}.`);
67
+ }
68
+ }
69
+ exports.validateDevRemotes = validateDevRemotes;
70
+ //# sourceMappingURL=module-federation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-federation.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/builders/utilities/module-federation.ts"],"names":[],"mappings":";;;AAEA,+BAA4B;AAC5B,2BAA8C;AAG9C,SAAgB,iBAAiB,CAC/B,OAA6B,EAC7B,OAAuB,EACvB,iBAAuD,EACvD,aAA0B;IAE1B,4BAA4B;IAC5B,6DAA6D;IAC7D,8BAA8B;IAE9B,MAAM,qCAAqC,GAAG,IAA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AAI,CAClF,IAAI,CACL,GAAG,CACT,CAAC;KACH;IAED,OAAO,aAAa,CAAC;AACvB,CAAC;AA1CD,4CA0CC;AAED,SAAgB,kBAAkB,CAChC,OAAkC,EAClC,iBAAuD;;IAEvD,MAAM,iBAAiB,GAAG,MAAA,OAAO,CAAC,UAAU,0CAAE,MAAM,CAClD,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC,CACvC,CAAC;IAEF,IAAI,iBAAiB,CAAC,MAAM,EAAE;QAC5B,MAAM,IAAI,KAAK,CACb,iBAAiB,CAAC,MAAM,KAAK,CAAC;YAC5B,CAAC,CAAC,gCAAgC,iBAAiB,CAAC,CAAC,CAAC,GAAG;YACzD,CAAC,CAAC,iCAAiC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACrE,CAAC;KACH;AACH,CAAC;AAfD,gDAeC"}
@@ -3,7 +3,7 @@
3
3
  "outputCapture": "direct-nodejs",
4
4
  "$schema": "http://json-schema.org/draft-07/schema",
5
5
  "title": "Schema for an executor which delegates a build.",
6
- "description": "Options for delegating a build to a different target.",
6
+ "description": "Delegates the build to a different target while supporting incremental builds.",
7
7
  "cli": "nx",
8
8
  "type": "object",
9
9
  "properties": {
@@ -2,7 +2,7 @@
2
2
  "version": 2,
3
3
  "outputCapture": "direct-nodejs",
4
4
  "title": "File Server",
5
- "description": "Serve a web application from a folder.",
5
+ "description": "Serves a static web application from a folder.",
6
6
  "type": "object",
7
7
  "cli": "nx",
8
8
  "properties": {
@@ -3,7 +3,7 @@
3
3
  "outputCapture": "direct-nodejs",
4
4
  "$schema": "http://json-schema.org/schema",
5
5
  "title": "ng-packagr Target",
6
- "description": "ng-packagr target options for Build Architect. Use to build library projects.",
6
+ "description": "Builds a library with support for incremental builds.\n\nThis executor is meant to be used with buildable libraries in an incremental build scenario. It is similar to the `@nrwl/angular:package` executor but with some key differences:\n- It doesn't run `ngcc` automatically (`ngcc` needs to be run separately beforehand if needed, this can be done in a `postinstall` hook on `package.json`).\n- It only produces ESM2020 bundles.\n- It doesn't generate package exports in the `package.json`.",
7
7
  "cli": "nx",
8
8
  "type": "object",
9
9
  "presets": [
@@ -3,7 +3,7 @@
3
3
  "outputCapture": "direct-nodejs",
4
4
  "$schema": "http://json-schema.org/schema",
5
5
  "title": "ng-packagr Target",
6
- "description": "ng-packagr target options for Build Architect. Use to build and package library projects for publishing.",
6
+ "description": "Builds and packages an Angular library producing an output following the Angular Package Format (APF) to be distributed as an NPM package.\n\nThis executor is similar to the `@angular-devkit/build-angular:ng-packagr` with additional support for incremental builds.",
7
7
  "cli": "nx",
8
8
  "type": "object",
9
9
  "presets": [
@@ -1,4 +1,4 @@
1
- import type { GeneratorCallback, Tree } from '@nrwl/devkit';
1
+ import { GeneratorCallback, Tree } from '@nrwl/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;