@nx/angular 0.0.0-pr-22179-271588f → 0.0.0-pr-26482-ebe2dba

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 (187) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +1 -1
  3. package/executors.d.ts +1 -1
  4. package/executors.json +9 -9
  5. package/migrations.json +209 -0
  6. package/package.json +18 -17
  7. package/plugins/component-testing.d.ts +2 -2
  8. package/plugins/component-testing.js +1 -1
  9. package/src/builders/dev-server/dev-server.impl.js +1 -1
  10. package/src/builders/dev-server/lib/validate-options.js +1 -1
  11. package/src/builders/dev-server/schema.json +3 -3
  12. package/src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl.js +9 -6
  13. package/src/builders/module-federation-dev-ssr/schema.json +1 -1
  14. package/src/builders/utilities/module-federation.d.ts +7 -2
  15. package/src/builders/utilities/module-federation.js +20 -4
  16. package/src/builders/webpack-browser/schema.d.ts +2 -2
  17. package/src/builders/webpack-browser/schema.json +10 -10
  18. package/src/builders/webpack-browser/webpack-browser.impl.js +2 -8
  19. package/src/builders/webpack-server/schema.json +13 -13
  20. package/src/builders/webpack-server/webpack-server.impl.js +3 -5
  21. package/src/executors/application/application.impl.d.ts +2 -1
  22. package/src/executors/application/application.impl.js +2 -2
  23. package/src/executors/application/schema.json +11 -6
  24. package/src/executors/application/utils/validate-options.js +5 -0
  25. package/src/executors/browser-esbuild/browser-esbuild.impl.d.ts +2 -7
  26. package/src/executors/browser-esbuild/browser-esbuild.impl.js +2 -2
  27. package/src/executors/browser-esbuild/schema.json +8 -8
  28. package/src/executors/extract-i18n/extract-i18n.impl.js +2 -2
  29. package/src/executors/module-federation-dev-server/lib/build-static-remotes.js +11 -3
  30. package/src/executors/module-federation-dev-server/lib/normalize-options.js +1 -0
  31. package/src/executors/module-federation-dev-server/lib/start-dev-remotes.d.ts +1 -5
  32. package/src/executors/module-federation-dev-server/lib/start-dev-remotes.js +16 -15
  33. package/src/executors/module-federation-dev-server/lib/start-static-remotes-file-server.js +2 -1
  34. package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +16 -8
  35. package/src/executors/module-federation-dev-server/schema.d.ts +4 -1
  36. package/src/executors/module-federation-dev-server/schema.json +22 -5
  37. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-packagr.js +6 -6
  38. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/compile-ngc.transform.js +3 -2
  39. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/write-package.transform.js +2 -1
  40. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/options.di.js +3 -2
  41. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ngc/compile-source-files.d.ts +1 -2
  42. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ngc/compile-source-files.js +5 -4
  43. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/styles/stylesheet-processor.js +12 -12
  44. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-package.transform.js +2 -1
  45. package/src/executors/ng-packagr-lite/ng-packagr-lite.impl.js +1 -1
  46. package/src/executors/ng-packagr-lite/schema.json +1 -1
  47. package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.js +5 -4
  48. package/src/executors/package/ng-packagr-adjustments/ng-package/options.di.js +3 -2
  49. package/src/executors/package/ng-packagr-adjustments/ng-packagr.js +4 -4
  50. package/src/executors/package/ng-packagr-adjustments/ngc/compile-source-files.d.ts +1 -2
  51. package/src/executors/package/ng-packagr-adjustments/ngc/compile-source-files.js +5 -4
  52. package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.js +12 -12
  53. package/src/executors/package/package.impl.js +1 -1
  54. package/src/executors/package/schema.json +1 -1
  55. package/src/executors/utilities/esbuild-extensions.d.ts +2 -4
  56. package/src/executors/utilities/module-loader.d.ts +1 -2
  57. package/src/executors/utilities/ng-packagr/stylesheet-processor.d.ts +22 -0
  58. package/src/executors/utilities/ng-packagr/stylesheet-processor.di.d.ts +1 -1
  59. package/src/executors/utilities/ng-packagr/stylesheet-processor.di.js +7 -1
  60. package/src/executors/utilities/ng-packagr/stylesheet-processor.js +100 -7
  61. package/src/executors/utilities/typescript.d.ts +1 -2
  62. package/src/executors/utilities/typescript.js +4 -3
  63. package/src/generators/add-linting/add-linting.d.ts +1 -1
  64. package/src/generators/add-linting/add-linting.js +7 -11
  65. package/src/generators/add-linting/lib/add-angular-eslint-dependencies.d.ts +2 -2
  66. package/src/generators/add-linting/lib/add-angular-eslint-dependencies.js +15 -6
  67. package/src/generators/add-linting/lib/buildable-project.d.ts +2 -0
  68. package/src/generators/add-linting/lib/buildable-project.js +9 -0
  69. package/src/generators/add-linting/lib/create-eslint-configuration.d.ts +2 -2
  70. package/src/generators/add-linting/schema.json +1 -1
  71. package/src/generators/application/application.js +4 -1
  72. package/src/generators/application/files/base-pre18/src/favicon.ico +0 -0
  73. package/src/generators/application/files/ng-module/src/main.ts__tpl__ +3 -1
  74. package/src/generators/application/files/standalone-components/src/app/app.config.ts__tpl__ +2 -2
  75. package/src/generators/application/lib/add-e2e.js +9 -6
  76. package/src/generators/application/lib/add-linting.js +2 -1
  77. package/src/generators/application/lib/create-files.js +7 -0
  78. package/src/generators/application/lib/create-project.js +12 -5
  79. package/src/generators/application/lib/normalize-options.js +15 -1
  80. package/src/generators/application/lib/normalized-schema.d.ts +3 -0
  81. package/src/generators/application/schema.json +2 -2
  82. package/src/generators/component/schema.d.ts +3 -3
  83. package/src/generators/component/schema.json +2 -2
  84. package/src/generators/component-test/component-test.js +1 -1
  85. package/src/generators/convert-to-application-executor/convert-to-application-executor.js +6 -4
  86. package/src/generators/cypress-component-configuration/cypress-component-configuration.js +3 -3
  87. package/src/generators/directive/schema.d.ts +3 -3
  88. package/src/generators/directive/schema.json +2 -2
  89. package/src/generators/federate-module/lib/add-remote.js +2 -1
  90. package/src/generators/host/host.js +14 -2
  91. package/src/generators/host/lib/update-ssr-setup.js +9 -7
  92. package/src/generators/host/schema.json +2 -2
  93. package/src/generators/library/files/base/package.json__tpl__ +0 -3
  94. package/src/generators/library/library.js +17 -8
  95. package/src/generators/ng-add/migrators/builders/angular-devkit-karma.migrator.js +3 -2
  96. package/src/generators/ng-add/migrators/migrator.d.ts +1 -1
  97. package/src/generators/ng-add/migrators/migrator.js +7 -7
  98. package/src/generators/ng-add/migrators/projects/app.migrator.js +2 -2
  99. package/src/generators/ng-add/migrators/projects/e2e.migrator.js +1 -1
  100. package/src/generators/ng-add/utilities/validation-logging.js +2 -1
  101. package/src/generators/ngrx-root-store/ngrx-root-store.js +2 -1
  102. package/src/generators/pipe/schema.d.ts +3 -3
  103. package/src/generators/pipe/schema.json +2 -2
  104. package/src/generators/remote/lib/update-ssr-setup.d.ts +2 -1
  105. package/src/generators/remote/lib/update-ssr-setup.js +10 -8
  106. package/src/generators/remote/remote.js +8 -4
  107. package/src/generators/remote/schema.json +2 -2
  108. package/src/generators/scam/schema.d.ts +3 -3
  109. package/src/generators/scam/schema.json +2 -2
  110. package/src/generators/scam-directive/schema.d.ts +3 -3
  111. package/src/generators/scam-directive/schema.json +2 -2
  112. package/src/generators/scam-pipe/schema.d.ts +3 -3
  113. package/src/generators/scam-pipe/schema.json +2 -2
  114. package/src/generators/setup-mf/files/ts-webpack/module-federation.config.ts__tmpl__ +1 -1
  115. package/src/generators/setup-mf/files/webpack/module-federation.config.js__tmpl__ +1 -1
  116. package/src/generators/setup-mf/lib/add-remote-to-host.d.ts +7 -2
  117. package/src/generators/setup-mf/lib/add-remote-to-host.js +15 -19
  118. package/src/generators/setup-mf/lib/fix-bootstrap.d.ts +1 -1
  119. package/src/generators/setup-mf/lib/fix-bootstrap.js +12 -5
  120. package/src/generators/setup-mf/lib/generate-config.js +1 -0
  121. package/src/generators/setup-mf/lib/setup-host-if-dynamic.js +5 -1
  122. package/src/generators/setup-mf/lib/update-host-app-routes.js +1 -4
  123. package/src/generators/setup-mf/setup-mf.js +21 -4
  124. package/src/generators/setup-ssr/files/server/application-builder/__serverFileName__ +4 -3
  125. package/src/generators/setup-ssr/files/server/server-builder/v17+/__serverFileName__ +4 -3
  126. package/src/generators/setup-ssr/lib/add-dependencies.js +2 -1
  127. package/src/generators/setup-ssr/lib/generate-files.js +1 -7
  128. package/src/generators/setup-ssr/lib/index.d.ts +0 -1
  129. package/src/generators/setup-ssr/lib/index.js +0 -1
  130. package/src/generators/setup-ssr/lib/validate-options.js +0 -13
  131. package/src/generators/setup-ssr/schema.d.ts +1 -0
  132. package/src/generators/setup-ssr/schema.json +10 -3
  133. package/src/generators/setup-ssr/setup-ssr.js +3 -4
  134. package/src/generators/stories/stories.js +3 -2
  135. package/src/generators/storybook-configuration/lib/generate-stories.js +1 -1
  136. package/src/generators/storybook-configuration/schema.json +3 -3
  137. package/src/generators/utils/add-jest.js +1 -2
  138. package/src/generators/utils/add-mf-env-to-inputs.js +4 -1
  139. package/src/generators/utils/ensure-angular-dependencies.d.ts +1 -1
  140. package/src/generators/utils/ensure-angular-dependencies.js +44 -27
  141. package/src/generators/utils/storybook-ast/tree-utilities.js +2 -1
  142. package/src/generators/utils/testing.js +0 -17
  143. package/src/generators/utils/version-utils.d.ts +1 -2
  144. package/src/generators/utils/version-utils.js +5 -16
  145. package/src/migrations/update-15-2-0/remove-browserlist-config.d.ts +1 -0
  146. package/src/migrations/update-15-2-0/remove-browserlist-config.js +2 -1
  147. package/src/migrations/update-15-2-0/remove-platform-server-exports.js +2 -1
  148. package/src/migrations/update-15-2-0/update-karma-main-file.js +2 -1
  149. package/src/migrations/update-16-1-0/remove-render-module-platform-server-exports.js +2 -1
  150. package/src/migrations/update-16-1-0/update-server-executor-config.js +2 -2
  151. package/src/migrations/update-18-1-1/fix-target-defaults-inputs.d.ts +2 -0
  152. package/src/migrations/update-18-1-1/fix-target-defaults-inputs.js +53 -0
  153. package/src/migrations/update-18-2-0/update-angular-cli.d.ts +3 -0
  154. package/src/migrations/update-18-2-0/update-angular-cli.js +23 -0
  155. package/src/migrations/update-19-1-0/update-angular-cli.d.ts +3 -0
  156. package/src/migrations/update-19-1-0/update-angular-cli.js +23 -0
  157. package/src/migrations/update-19-2-1/add-typescript-eslint-utils.d.ts +3 -0
  158. package/src/migrations/update-19-2-1/add-typescript-eslint-utils.js +19 -0
  159. package/src/utils/backward-compatible-versions.d.ts +10 -5
  160. package/src/utils/backward-compatible-versions.js +18 -19
  161. package/src/utils/file-change-recorder.js +2 -1
  162. package/src/utils/{public-api.d.ts → index.d.ts} +5 -0
  163. package/src/utils/{public-api.js → index.js} +5 -0
  164. package/src/utils/mf/utils.js +1 -0
  165. package/src/utils/mf/with-module-federation-ssr.js +3 -0
  166. package/src/utils/mf/with-module-federation.js +6 -2
  167. package/src/utils/version-utils.d.ts +2 -2
  168. package/src/utils/version-utils.js +2 -1
  169. package/src/utils/versions.d.ts +6 -5
  170. package/src/utils/versions.js +7 -6
  171. package/index.js +0 -8
  172. package/mf/index.js +0 -7
  173. package/mf/mf.js +0 -53
  174. package/src/builders/webpack-server/validate-options.d.ts +0 -2
  175. package/src/builders/webpack-server/validate-options.js +0 -33
  176. package/src/executors/utilities/ng-compiler-cli.d.ts +0 -1
  177. package/src/executors/utilities/ng-compiler-cli.js +0 -8
  178. package/src/generators/setup-ssr/files/ngmodule/pre-v15-2/src/main.ts__tpl__ +0 -14
  179. package/src/generators/setup-ssr/lib/update-app-module.d.ts +0 -3
  180. package/src/generators/setup-ssr/lib/update-app-module.js +0 -27
  181. package/src/runtime/nx/data-persistence.js +0 -350
  182. package/testing/index.js +0 -6
  183. package/testing/src/testing-utils.js +0 -40
  184. /package/src/generators/application/files/{base/src → base-18+/public}/favicon.ico +0 -0
  185. /package/src/generators/application/files/{base → base-pre18}/src/assets/.gitkeep__tpl__ +0 -0
  186. /package/src/generators/setup-ssr/files/ngmodule/{base/src → src}/__main__ +0 -0
  187. /package/src/generators/setup-ssr/files/ngmodule/{base/src → src}/app/__rootModuleFileName__ +0 -0
@@ -67,7 +67,7 @@ async function convertProjectTargets(tree, projectName, angularVersion, isProvid
67
67
  warnIfProvided(`The provided project "${projectName}" is not an application. Skipping conversion.`);
68
68
  return false;
69
69
  }
70
- const { buildTargetName, serverTargetName } = getTargetsToConvert(project.targets);
70
+ const { buildTargetName, serverTargetName } = getTargetsToConvert(project.targets, angularVersion);
71
71
  if (!buildTargetName) {
72
72
  warnIfProvided(`The provided project "${projectName}" does not have any targets using on of the ` +
73
73
  `'@angular-devkit/build-angular:browser', '@angular-devkit/build-angular:browser-esbuild', ` +
@@ -125,7 +125,9 @@ async function convertProjectTargets(tree, projectName, angularVersion, isProvid
125
125
  }
126
126
  }
127
127
  // Delete removed options
128
- delete options['deployUrl'];
128
+ if ((0, semver_1.lt)(angularVersion, '17.3.0')) {
129
+ delete options['deployUrl'];
130
+ }
129
131
  delete options['vendorChunk'];
130
132
  delete options['commonChunk'];
131
133
  delete options['resourcesOutputPath'];
@@ -191,7 +193,7 @@ async function convertProjectTargets(tree, projectName, angularVersion, isProvid
191
193
  (0, devkit_1.updateProjectConfiguration)(tree, projectName, project);
192
194
  return true;
193
195
  }
194
- function getTargetsToConvert(targets) {
196
+ function getTargetsToConvert(targets, angularVersion) {
195
197
  let buildTargetName;
196
198
  let serverTargetName;
197
199
  for (const target of Object.keys(targets)) {
@@ -203,7 +205,7 @@ function getTargetsToConvert(targets) {
203
205
  // build target
204
206
  if (executorsToConvert.has(targets[target].executor)) {
205
207
  for (const [, options] of (0, targets_1.allTargetOptions)(targets[target])) {
206
- if (options.deployUrl) {
208
+ if ((0, semver_1.lt)(angularVersion, '17.3.0') && options.deployUrl) {
207
209
  devkit_1.logger.warn(`The project is using the "deployUrl" option which is not available in the application builder. Skipping conversion.`);
208
210
  return {};
209
211
  }
@@ -41,7 +41,7 @@ async function cypressComponentConfigurationInternal(tree, options) {
41
41
  exports.cypressComponentConfigurationInternal = cypressComponentConfigurationInternal;
42
42
  async function addFiles(tree, projectConfig, options) {
43
43
  const componentFile = (0, devkit_1.joinPathFragments)(projectConfig.root, 'cypress', 'support', 'component.ts');
44
- const { addMountDefinition } = await Promise.resolve().then(() => require('@nx/cypress/src/utils/config'));
44
+ const { addMountDefinition } = require('@nx/cypress/src/utils/config');
45
45
  const updatedCmpContents = await addMountDefinition(tree.read(componentFile, 'utf-8'));
46
46
  tree.write(componentFile, `import { mount } from 'cypress/angular';\n${updatedCmpContents}`);
47
47
  if (options.generateTests) {
@@ -69,7 +69,7 @@ async function addFiles(tree, projectConfig, options) {
69
69
  async function configureCypressCT(tree, options) {
70
70
  let found = { target: options.buildTarget, config: undefined };
71
71
  if (!options.buildTarget) {
72
- const { findBuildConfig } = await Promise.resolve().then(() => require('@nx/cypress/src/utils/find-target-options'));
72
+ const { findBuildConfig } = require('@nx/cypress/src/utils/find-target-options');
73
73
  found = await findBuildConfig(tree, {
74
74
  project: options.project,
75
75
  buildTarget: options.buildTarget,
@@ -95,7 +95,7 @@ async function configureCypressCT(tree, options) {
95
95
  else {
96
96
  ctConfigOptions.buildTarget = found.target;
97
97
  }
98
- const { addDefaultCTConfig, getProjectCypressConfigPath } = await Promise.resolve().then(() => require('@nx/cypress/src/utils/config'));
98
+ const { addDefaultCTConfig, getProjectCypressConfigPath } = require('@nx/cypress/src/utils/config');
99
99
  const cypressConfigPath = getProjectCypressConfigPath(tree, projectConfig.root);
100
100
  const updatedCyConfig = await addDefaultCTConfig(tree.read(cypressConfigPath, 'utf-8'), ctConfigOptions);
101
101
  tree.write(cypressConfigPath, `import { nxComponentTestingPreset } from '@nx/angular/plugins/component-testing';\n${updatedCyConfig}`);
@@ -13,15 +13,15 @@ export interface Schema {
13
13
  export?: boolean;
14
14
  skipFormat?: boolean;
15
15
  /**
16
- * @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v19.
16
+ * @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20.
17
17
  */
18
18
  flat?: boolean;
19
19
  /**
20
- * @deprecated Provide the `directory` option instead. It will be removed in Nx v19.
20
+ * @deprecated Provide the `directory` option instead. It will be removed in Nx v20.
21
21
  */
22
22
  path?: string;
23
23
  /**
24
- * @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v19.
24
+ * @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v20.
25
25
  */
26
26
  project?: string;
27
27
  }
@@ -34,7 +34,7 @@
34
34
  "$source": "projectName"
35
35
  },
36
36
  "x-dropdown": "projects",
37
- "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v19."
37
+ "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v20."
38
38
  },
39
39
  "prefix": {
40
40
  "type": "string",
@@ -74,7 +74,7 @@
74
74
  "type": "boolean",
75
75
  "description": "When true (the default), creates the new files at the top level of the current project.",
76
76
  "default": true,
77
- "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v19."
77
+ "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20."
78
78
  },
79
79
  "module": {
80
80
  "type": "string",
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addRemote = void 0;
4
+ const tslib_1 = require("tslib");
4
5
  const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
5
6
  const test_runners_1 = require("../../../utils/test-runners");
6
- const remote_1 = require("../../remote/remote");
7
+ const remote_1 = tslib_1.__importDefault(require("../../remote/remote"));
7
8
  const check_remote_exists_1 = require("./check-remote-exists");
8
9
  async function addRemote(tree, schema) {
9
10
  const tasks = [];
@@ -1,14 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.hostInternal = exports.host = void 0;
4
+ const tslib_1 = require("tslib");
4
5
  const devkit_1 = require("@nx/devkit");
5
6
  const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
6
7
  const test_runners_1 = require("../../utils/test-runners");
7
- const application_1 = require("../application/application");
8
- const remote_1 = require("../remote/remote");
8
+ const application_1 = tslib_1.__importDefault(require("../application/application"));
9
+ const remote_1 = tslib_1.__importDefault(require("../remote/remote"));
9
10
  const setup_mf_1 = require("../setup-mf/setup-mf");
10
11
  const lib_1 = require("./lib");
11
12
  const add_mf_env_to_inputs_1 = require("../utils/add-mf-env-to-inputs");
13
+ const js_1 = require("@nx/js");
12
14
  async function host(tree, options) {
13
15
  return await hostInternal(tree, {
14
16
  projectNameAndRootFormat: 'derived',
@@ -22,6 +24,16 @@ async function hostInternal(tree, schema) {
22
24
  const projects = (0, devkit_1.getProjects)(tree);
23
25
  const remotesToGenerate = [];
24
26
  const remotesToIntegrate = [];
27
+ // Check to see if remotes are provided and also check if --dynamic is provided
28
+ // if both are check that the remotes are valid names else throw an error.
29
+ if (options.dynamic && options.remotes?.length > 0) {
30
+ options.remotes.forEach((remote) => {
31
+ const isValidRemote = (0, js_1.isValidVariable)(remote);
32
+ if (!isValidRemote.isValid) {
33
+ throw new Error(`Invalid remote name provided: ${remote}. ${isValidRemote.message}`);
34
+ }
35
+ });
36
+ }
25
37
  if (options.remotes && options.remotes.length > 0) {
26
38
  options.remotes.forEach((remote) => {
27
39
  if (!projects.has(remote)) {
@@ -29,12 +29,14 @@ async function updateSsrSetup(tree, options, appName, typescriptConfiguration) {
29
29
  project.targets['serve-ssr'].executor =
30
30
  '@nx/angular:module-federation-dev-ssr';
31
31
  (0, devkit_1.updateProjectConfiguration)(tree, appName, project);
32
- const installTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {
33
- cors: versions_1.corsVersion,
34
- '@module-federation/node': versions_1.moduleFederationNodeVersion,
35
- }, {
36
- '@types/cors': versions_1.typesCorsVersion,
37
- });
38
- return installTask;
32
+ if (!options.skipPackageJson) {
33
+ return (0, devkit_1.addDependenciesToPackageJson)(tree, {
34
+ cors: versions_1.corsVersion,
35
+ '@module-federation/node': versions_1.moduleFederationNodeVersion,
36
+ }, {
37
+ '@types/cors': versions_1.typesCorsVersion,
38
+ });
39
+ }
40
+ return () => { };
39
41
  }
40
42
  exports.updateSsrSetup = updateSsrSetup;
@@ -117,10 +117,10 @@
117
117
  },
118
118
  "e2eTestRunner": {
119
119
  "type": "string",
120
- "enum": ["cypress", "playwright", "none"],
120
+ "enum": ["playwright", "cypress", "none"],
121
121
  "description": "Test runner to use for end to end (E2E) tests.",
122
122
  "x-prompt": "Which E2E test runner would you like to use?",
123
- "default": "cypress"
123
+ "default": "playwright"
124
124
  },
125
125
  "tags": {
126
126
  "type": "string",
@@ -5,8 +5,5 @@
5
5
  "@angular/common": "<%= angularPeerDepVersion %>",
6
6
  "@angular/core": "<%= angularPeerDepVersion %>"
7
7
  },
8
- "dependencies": {
9
- "tslib": "^2.3.0"
10
- },
11
8
  "sideEffects": false
12
9
  }
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.libraryGeneratorInternal = exports.libraryGenerator = void 0;
4
+ const tslib_1 = require("tslib");
4
5
  const devkit_1 = require("@nx/devkit");
5
6
  const eslint_1 = require("@nx/eslint");
6
7
  const js_1 = require("@nx/js");
7
- const init_1 = require("../../generators/init/init");
8
- const add_linting_1 = require("../add-linting/add-linting");
9
- const setup_tailwind_1 = require("../setup-tailwind/setup-tailwind");
8
+ const init_1 = tslib_1.__importDefault(require("../../generators/init/init"));
9
+ const add_linting_1 = tslib_1.__importDefault(require("../add-linting/add-linting"));
10
+ const setup_tailwind_1 = tslib_1.__importDefault(require("../setup-tailwind/setup-tailwind"));
10
11
  const version_utils_1 = require("../utils/version-utils");
11
12
  const dependencies_1 = require("../utils/dependencies");
12
13
  const add_module_1 = require("./lib/add-module");
@@ -44,9 +45,15 @@ async function libraryGeneratorInternal(tree, schema) {
44
45
  const options = await (0, normalize_options_1.normalizeOptions)(tree, schema);
45
46
  const { libraryOptions } = options;
46
47
  const pkgVersions = (0, version_utils_1.versions)(tree);
47
- await (0, js_1.initGenerator)(tree, { ...options, js: false, skipFormat: true });
48
+ await (0, js_1.initGenerator)(tree, {
49
+ ...libraryOptions,
50
+ js: false,
51
+ skipFormat: true,
52
+ });
48
53
  await (0, init_1.default)(tree, { ...libraryOptions, skipFormat: true });
49
- (0, ensure_angular_dependencies_1.ensureAngularDependencies)(tree);
54
+ if (!libraryOptions.skipPackageJson) {
55
+ (0, ensure_angular_dependencies_1.ensureAngularDependencies)(tree);
56
+ }
50
57
  const project = (0, add_project_1.addProject)(tree, libraryOptions);
51
58
  (0, create_files_1.createFiles)(tree, options, project);
52
59
  (0, update_tsconfig_1.updateTsConfig)(tree, libraryOptions);
@@ -65,12 +72,14 @@ async function libraryGeneratorInternal(tree, schema) {
65
72
  await (0, setup_tailwind_1.default)(tree, {
66
73
  project: libraryOptions.name,
67
74
  skipFormat: true,
75
+ skipPackageJson: libraryOptions.skipPackageJson,
68
76
  });
69
77
  }
70
- if (libraryOptions.buildable || libraryOptions.publishable) {
71
- (0, version_utils_1.addDependenciesToPackageJsonIfDontExist)(tree, {}, {
78
+ if ((libraryOptions.buildable || libraryOptions.publishable) &&
79
+ !libraryOptions.skipPackageJson) {
80
+ (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
72
81
  'ng-packagr': pkgVersions.ngPackagrVersion,
73
- });
82
+ }, undefined, true);
74
83
  (0, dependencies_1.addBuildableLibrariesPostCssDependencies)(tree);
75
84
  }
76
85
  (0, js_1.addTsConfigPath)(tree, libraryOptions.importPath, [
@@ -41,8 +41,9 @@ class AngularDevkitKarmaMigrator extends builder_migrator_1.BuilderMigrator {
41
41
  target.options.main =
42
42
  target.options.main && this.convertAsset(target.options.main);
43
43
  target.options.polyfills = Array.isArray(target.options.polyfills)
44
- ? target.options.polyfills.map((p) => this.convertAsset(p))
45
- : target.options.polyfills && this.convertAsset(target.options.polyfills);
44
+ ? target.options.polyfills.map((p) => this.convertSourceRootPath(p))
45
+ : target.options.polyfills &&
46
+ this.convertSourceRootPath(target.options.polyfills);
46
47
  target.options.tsConfig =
47
48
  target.options.tsConfig &&
48
49
  (0, devkit_1.joinPathFragments)(this.project.newRoot, (0, path_1.basename)(target.options.tsConfig));
@@ -12,12 +12,12 @@ export declare abstract class Migrator {
12
12
  abstract validate(): ValidationResult;
13
13
  protected convertAsset(asset: string | any): string | any;
14
14
  protected convertRootPath(originalPath: string): string;
15
+ protected convertSourceRootPath(originalPath: string): string;
15
16
  protected moveFile(from: string, to: string, required?: boolean): void;
16
17
  protected moveFilePathsFromTargetToProjectRoot(target: TargetConfiguration, options: string[]): void;
17
18
  protected moveProjectRootFile(filePath: string, isRequired?: boolean): void;
18
19
  protected updateCacheableOperations(targetNames: string[]): void;
19
20
  protected updateTsConfigFile(tsConfigPath: string, rootTsConfigFile: string, projectOffsetFromRoot: string): void;
20
- private convertSourceRootPath;
21
21
  private getTargetValuesForOption;
22
22
  private getValueForOption;
23
23
  }
@@ -12,10 +12,10 @@ class Migrator {
12
12
  }
13
13
  convertAsset(asset) {
14
14
  if (typeof asset === 'string') {
15
- return this.convertSourceRootPath(asset);
15
+ return this.convertRootPath(asset);
16
16
  }
17
17
  else {
18
- return { ...asset, input: this.convertSourceRootPath(asset.input) };
18
+ return { ...asset, input: this.convertRootPath(asset.input) };
19
19
  }
20
20
  }
21
21
  convertRootPath(originalPath) {
@@ -23,6 +23,11 @@ class Migrator {
23
23
  ? (0, devkit_1.joinPathFragments)(this.project.newRoot, originalPath.replace(this.project.oldRoot, ''))
24
24
  : originalPath;
25
25
  }
26
+ convertSourceRootPath(originalPath) {
27
+ return originalPath?.startsWith(this.project.oldSourceRoot)
28
+ ? (0, devkit_1.joinPathFragments)(this.project.newSourceRoot, originalPath.replace(this.project.oldSourceRoot, ''))
29
+ : originalPath;
30
+ }
26
31
  moveFile(from, to, required = true) {
27
32
  if (!this.tree.exists(from)) {
28
33
  if (required) {
@@ -78,11 +83,6 @@ class Migrator {
78
83
  return json;
79
84
  });
80
85
  }
81
- convertSourceRootPath(originalPath) {
82
- return originalPath?.startsWith(this.project.oldSourceRoot)
83
- ? (0, devkit_1.joinPathFragments)(this.project.newSourceRoot, originalPath.replace(this.project.oldSourceRoot, ''))
84
- : originalPath;
85
- }
86
86
  getTargetValuesForOption(target, optionPath) {
87
87
  const values = new Set();
88
88
  const value = this.getValueForOption(target.options, optionPath);
@@ -160,8 +160,8 @@ class AppMigrator extends project_migrator_1.ProjectMigrator {
160
160
  buildOptions.polyfills =
161
161
  buildOptions.polyfills &&
162
162
  (Array.isArray(buildOptions.polyfills)
163
- ? buildOptions.polyfills.map((asset) => this.convertAsset(asset))
164
- : this.convertAsset(buildOptions.polyfills));
163
+ ? buildOptions.polyfills.map((asset) => this.convertSourceRootPath(asset))
164
+ : this.convertSourceRootPath(buildOptions.polyfills));
165
165
  buildOptions.tsConfig =
166
166
  buildOptions.tsConfig &&
167
167
  (0, devkit_1.joinPathFragments)(this.project.newRoot, (0, path_1.basename)(buildOptions.tsConfig));
@@ -237,7 +237,7 @@ class E2eMigrator extends project_migrator_1.ProjectMigrator {
237
237
  const nxJson = (0, devkit_1.readNxJson)(this.tree) ?? {};
238
238
  const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
239
239
  nxJson.useInferencePlugins !== false;
240
- const { configurationGenerator } = await Promise.resolve().then(() => require('@nx/cypress'));
240
+ const { configurationGenerator } = (require('@nx/cypress'));
241
241
  await configurationGenerator(this.tree, {
242
242
  project: this.project.name,
243
243
  linter: this.isProjectUsingEsLint ? eslint_1.Linter.EsLint : eslint_1.Linter.None,
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getProjectValidationResultMessage = exports.arrayToString = void 0;
4
- const chalk = require("chalk");
4
+ const tslib_1 = require("tslib");
5
+ const chalk = tslib_1.__importStar(require("chalk"));
5
6
  function arrayToString(array) {
6
7
  if (array.length === 0) {
7
8
  return '';
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ngrxRootStoreGenerator = void 0;
4
+ const tslib_1 = require("tslib");
4
5
  const devkit_1 = require("@nx/devkit");
5
6
  const lib_1 = require("./lib");
6
- const ngrx_feature_store_1 = require("../ngrx-feature-store/ngrx-feature-store");
7
+ const ngrx_feature_store_1 = tslib_1.__importDefault(require("../ngrx-feature-store/ngrx-feature-store"));
7
8
  async function ngrxRootStoreGenerator(tree, schema) {
8
9
  (0, lib_1.validateOptions)(tree, schema);
9
10
  const options = (0, lib_1.normalizeOptions)(tree, schema);
@@ -11,15 +11,15 @@ export interface Schema {
11
11
  export?: boolean;
12
12
  skipFormat?: boolean;
13
13
  /**
14
- * @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v19.
14
+ * @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20.
15
15
  */
16
16
  flat?: boolean;
17
17
  /**
18
- * @deprecated Provide the `directory` option instead. It will be removed in Nx v19.
18
+ * @deprecated Provide the `directory` option instead. It will be removed in Nx v20.
19
19
  */
20
20
  path?: string;
21
21
  /**
22
- * @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v19.
22
+ * @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v20.
23
23
  */
24
24
  project?: string;
25
25
  }
@@ -34,13 +34,13 @@
34
34
  "$source": "projectName"
35
35
  },
36
36
  "x-dropdown": "projects",
37
- "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v19."
37
+ "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v20."
38
38
  },
39
39
  "flat": {
40
40
  "type": "boolean",
41
41
  "default": true,
42
42
  "description": "When true (the default) creates files at the top level of the project.",
43
- "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v19."
43
+ "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20."
44
44
  },
45
45
  "skipTests": {
46
46
  "type": "boolean",
@@ -1,7 +1,8 @@
1
1
  import type { Tree } from '@nx/devkit';
2
- export declare function updateSsrSetup(tree: Tree, { appName, port, standalone, typescriptConfiguration, }: {
2
+ export declare function updateSsrSetup(tree: Tree, { appName, port, standalone, typescriptConfiguration, skipPackageJson, }: {
3
3
  appName: string;
4
4
  port: number;
5
5
  standalone: boolean;
6
6
  typescriptConfiguration: boolean;
7
+ skipPackageJson?: boolean;
7
8
  }): Promise<import("@nx/devkit").GeneratorCallback>;
@@ -5,7 +5,7 @@ const devkit_1 = require("@nx/devkit");
5
5
  const path_1 = require("path");
6
6
  const versions_1 = require("../../../utils/versions");
7
7
  const version_utils_1 = require("../../utils/version-utils");
8
- async function updateSsrSetup(tree, { appName, port, standalone, typescriptConfiguration, }) {
8
+ async function updateSsrSetup(tree, { appName, port, standalone, typescriptConfiguration, skipPackageJson, }) {
9
9
  let project = (0, devkit_1.readProjectConfiguration)(tree, appName);
10
10
  tree.rename((0, devkit_1.joinPathFragments)(project.sourceRoot, 'main.server.ts'), (0, devkit_1.joinPathFragments)(project.sourceRoot, 'bootstrap.server.ts'));
11
11
  tree.write((0, devkit_1.joinPathFragments)(project.root, 'server.ts'), "import('./src/main.server');");
@@ -48,12 +48,14 @@ async function updateSsrSetup(tree, { appName, port, standalone, typescriptConfi
48
48
  },
49
49
  };
50
50
  (0, devkit_1.updateProjectConfiguration)(tree, appName, project);
51
- const installTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {
52
- cors: versions_1.corsVersion,
53
- '@module-federation/node': versions_1.moduleFederationNodeVersion,
54
- }, {
55
- '@types/cors': versions_1.typesCorsVersion,
56
- });
57
- return installTask;
51
+ if (!skipPackageJson) {
52
+ return (0, devkit_1.addDependenciesToPackageJson)(tree, {
53
+ cors: versions_1.corsVersion,
54
+ '@module-federation/node': versions_1.moduleFederationNodeVersion,
55
+ }, {
56
+ '@types/cors': versions_1.typesCorsVersion,
57
+ });
58
+ }
59
+ return () => { };
58
60
  }
59
61
  exports.updateSsrSetup = updateSsrSetup;
@@ -56,16 +56,20 @@ async function remoteInternal(tree, schema) {
56
56
  typescriptConfiguration,
57
57
  setParserOptionsProject: options.setParserOptionsProject,
58
58
  });
59
- const installSwcHelpersTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
60
- '@swc/helpers': versions_1.swcHelpersVersion,
61
- });
62
- let installTasks = [appInstallTask, installSwcHelpersTask];
59
+ const installTasks = [appInstallTask];
60
+ if (!options.skipPackageJson) {
61
+ const installSwcHelpersTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
62
+ '@swc/helpers': versions_1.swcHelpersVersion,
63
+ });
64
+ installTasks.push(installSwcHelpersTask);
65
+ }
63
66
  if (options.ssr) {
64
67
  let ssrInstallTask = await (0, lib_1.updateSsrSetup)(tree, {
65
68
  appName: remoteProjectName,
66
69
  port,
67
70
  typescriptConfiguration,
68
71
  standalone: options.standalone,
72
+ skipPackageJson: options.skipPackageJson,
69
73
  });
70
74
  installTasks.push(ssrInstallTask);
71
75
  }
@@ -111,10 +111,10 @@
111
111
  },
112
112
  "e2eTestRunner": {
113
113
  "type": "string",
114
- "enum": ["cypress", "playwright", "none"],
114
+ "enum": ["playwright", "cypress", "none"],
115
115
  "description": "Test runner to use for end to end (E2E) tests.",
116
116
  "x-prompt": "Which E2E test runner would you like to use?",
117
- "default": "cypress"
117
+ "default": "playwright"
118
118
  },
119
119
  "tags": {
120
120
  "type": "string",
@@ -19,15 +19,15 @@ export interface Schema {
19
19
  export?: boolean;
20
20
  skipFormat?: boolean;
21
21
  /**
22
- * @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v19.
22
+ * @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20.
23
23
  */
24
24
  flat?: boolean;
25
25
  /**
26
- * @deprecated Provide the `directory` option instead. It will be removed in Nx v19.
26
+ * @deprecated Provide the `directory` option instead. It will be removed in Nx v20.
27
27
  */
28
28
  path?: string;
29
29
  /**
30
- * @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v19.
30
+ * @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v20.
31
31
  */
32
32
  project?: string;
33
33
  }
@@ -40,7 +40,7 @@
40
40
  "$source": "projectName"
41
41
  },
42
42
  "x-dropdown": "projects",
43
- "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v19."
43
+ "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v20."
44
44
  },
45
45
  "displayBlock": {
46
46
  "description": "Specifies if the style will contain `:host { display: block; }`.",
@@ -94,7 +94,7 @@
94
94
  "type": "boolean",
95
95
  "description": "Create the new files at the top level of the current project.",
96
96
  "default": false,
97
- "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v19."
97
+ "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20."
98
98
  },
99
99
  "selector": {
100
100
  "type": "string",
@@ -11,15 +11,15 @@ export interface Schema {
11
11
  export?: boolean;
12
12
  skipFormat?: boolean;
13
13
  /**
14
- * @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v19.
14
+ * @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20.
15
15
  */
16
16
  flat?: boolean;
17
17
  /**
18
- * @deprecated Provide the `directory` option instead. It will be removed in Nx v19.
18
+ * @deprecated Provide the `directory` option instead. It will be removed in Nx v20.
19
19
  */
20
20
  path?: string;
21
21
  /**
22
- * @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v19.
22
+ * @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v20.
23
23
  */
24
24
  project?: string;
25
25
  }
@@ -41,7 +41,7 @@
41
41
  "$source": "projectName"
42
42
  },
43
43
  "x-dropdown": "projects",
44
- "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v19."
44
+ "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v20."
45
45
  },
46
46
  "skipTests": {
47
47
  "type": "boolean",
@@ -58,7 +58,7 @@
58
58
  "type": "boolean",
59
59
  "description": "Create the new files at the top level of the current project.",
60
60
  "default": true,
61
- "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v19."
61
+ "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20."
62
62
  },
63
63
  "selector": {
64
64
  "type": "string",
@@ -9,15 +9,15 @@ export interface Schema {
9
9
  export?: boolean;
10
10
  skipFormat?: boolean;
11
11
  /**
12
- * @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v19.
12
+ * @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20.
13
13
  */
14
14
  flat?: boolean;
15
15
  /**
16
- * @deprecated Provide the `directory` option instead. It will be removed in Nx v19.
16
+ * @deprecated Provide the `directory` option instead. It will be removed in Nx v20.
17
17
  */
18
18
  path?: string;
19
19
  /**
20
- * @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v19.
20
+ * @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v20.
21
21
  */
22
22
  project?: string;
23
23
  }
@@ -41,7 +41,7 @@
41
41
  "$source": "projectName"
42
42
  },
43
43
  "x-dropdown": "projects",
44
- "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v19."
44
+ "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v20."
45
45
  },
46
46
  "skipTests": {
47
47
  "type": "boolean",
@@ -58,7 +58,7 @@
58
58
  "type": "boolean",
59
59
  "description": "Create the new files at the top level of the current project.",
60
60
  "default": true,
61
- "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v19."
61
+ "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20."
62
62
  },
63
63
  "export": {
64
64
  "type": "boolean",
@@ -14,7 +14,7 @@ const config: ModuleFederationConfig = {
14
14
  * declare module 'my-external-remote';
15
15
  *
16
16
  */
17
- remotes: [<% remotes.forEach(function(remote) { %>'<%= remote.remoteName %>',<% }); %>]<% } %><% if(type === 'remote') { %>
17
+ remotes: [<% if (federationType === 'static') { remotes.forEach(function(remote) { %>'<%= remote.remoteName %>',<% }); } %>]<% } %><% if(type === 'remote') { %>
18
18
  exposes: {<% if(standalone) { %>
19
19
  './Routes': '<%= projectRoot %>/src/app/remote-entry/entry.routes.ts',<% } else { %>
20
20
  './Module': '<%= projectRoot %>/src/app/remote-entry/entry.module.ts',<% } %>
@@ -12,7 +12,7 @@ module.exports = {
12
12
  * declare module 'my-external-remote';
13
13
  *
14
14
  */
15
- remotes: [<% remotes.forEach(function(remote) { %>'<%= remote.remoteName %>',<% }); %>]<% } %><% if(type === 'remote') { %>
15
+ remotes: [<% if (federationType === 'static') { remotes.forEach(function(remote) { %>'<%= remote.remoteName %>',<% }); } %>]<% } %><% if(type === 'remote') { %>
16
16
  exposes: {<% if(standalone) { %>
17
17
  './Routes': '<%= projectRoot %>/src/app/remote-entry/entry.routes.ts',<% } else { %>
18
18
  './Module': '<%= projectRoot %>/src/app/remote-entry/entry.module.ts',<% } %>