@nrwl/angular 13.10.0-beta.6 → 13.10.0-beta.7

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 (87) hide show
  1. package/executors.json +4 -4
  2. package/fesm2015/nrwl-angular-mfe.mjs.map +1 -1
  3. package/fesm2020/nrwl-angular-mfe.mjs.map +1 -1
  4. package/generators.json +8 -8
  5. package/migrations.json +2 -407
  6. package/package.json +7 -7
  7. package/src/builders/webpack-browser/schema.json +33 -1
  8. package/src/builders/webpack-server/schema.json +6 -0
  9. package/src/executors/ng-packagr-lite/schema.json +14 -0
  10. package/src/executors/package/schema.json +14 -0
  11. package/src/generators/application/schema.json +3 -3
  12. package/src/generators/component/schema.json +4 -4
  13. package/src/generators/convert-to-with-mf/convert-to-with-mf.js +2 -1
  14. package/src/generators/convert-to-with-mf/convert-to-with-mf.js.map +1 -1
  15. package/src/generators/convert-to-with-mf/lib/write-new-webpack-config.d.ts +1 -1
  16. package/src/generators/convert-to-with-mf/lib/write-new-webpack-config.js +17 -14
  17. package/src/generators/convert-to-with-mf/lib/write-new-webpack-config.js.map +1 -1
  18. package/src/generators/convert-tslint-to-eslint/schema.json +4 -4
  19. package/src/generators/downgrade-module/schema.json +1 -0
  20. package/src/generators/init/schema.json +1 -1
  21. package/src/generators/karma/karma.d.ts +1 -1
  22. package/src/generators/karma/karma.js +17 -15
  23. package/src/generators/karma/karma.js.map +1 -1
  24. package/src/generators/karma/schema.json +1 -0
  25. package/src/generators/karma-project/karma-project.js +2 -0
  26. package/src/generators/karma-project/karma-project.js.map +1 -1
  27. package/src/generators/karma-project/schema.d.ts +1 -0
  28. package/src/generators/karma-project/schema.json +6 -0
  29. package/src/generators/library/schema.json +2 -1
  30. package/src/generators/library-secondary-entry-point/schema.json +1 -0
  31. package/src/generators/mfe-host/schema.json +1 -1
  32. package/src/generators/mfe-remote/schema.json +2 -2
  33. package/src/generators/move/schema.json +3 -3
  34. package/src/generators/ngrx/schema.json +1 -0
  35. package/src/generators/scam/schema.json +6 -6
  36. package/src/generators/scam-directive/schema.json +3 -3
  37. package/src/generators/scam-pipe/schema.json +1 -1
  38. package/src/generators/setup-mfe/files/webpack/mfe.config.js__tmpl__ +7 -0
  39. package/src/generators/setup-mfe/files/webpack/webpack.config.js__tmpl__ +2 -7
  40. package/src/generators/setup-mfe/lib/add-remote-to-host.js +7 -8
  41. package/src/generators/setup-mfe/lib/add-remote-to-host.js.map +1 -1
  42. package/src/generators/setup-mfe/lib/generate-config.js +2 -1
  43. package/src/generators/setup-mfe/lib/generate-config.js.map +1 -1
  44. package/src/generators/setup-mfe/schema.json +1 -1
  45. package/src/generators/stories/schema.json +2 -0
  46. package/src/generators/storybook-configuration/schema.json +2 -0
  47. package/src/generators/storybook-migrate-defaults-5-to-6/schema.json +2 -0
  48. package/src/generators/storybook-migrate-stories-to-6-2/schema.json +2 -0
  49. package/src/generators/upgrade-module/schema.json +1 -0
  50. package/src/migrations/update-12-3-0/update-storybook.js +1 -1
  51. package/src/utils/mfe/with-module-federation.js +4 -1
  52. package/src/utils/mfe/with-module-federation.js.map +1 -1
  53. package/src/utils/versions.js +1 -1
  54. package/src/migrations/update-10-0-0/update-10-0-0.d.ts +0 -1
  55. package/src/migrations/update-10-0-0/update-10-0-0.js +0 -15
  56. package/src/migrations/update-10-0-0/update-10-0-0.js.map +0 -1
  57. package/src/migrations/update-10-2-0/update-10-2-0.d.ts +0 -1
  58. package/src/migrations/update-10-2-0/update-10-2-0.js +0 -14
  59. package/src/migrations/update-10-2-0/update-10-2-0.js.map +0 -1
  60. package/src/migrations/update-10-3-0/files/tsconfig.editor.json +0 -11
  61. package/src/migrations/update-10-3-0/update-10-3-0.d.ts +0 -2
  62. package/src/migrations/update-10-3-0/update-10-3-0.js +0 -79
  63. package/src/migrations/update-10-3-0/update-10-3-0.js.map +0 -1
  64. package/src/migrations/update-10-4-0/update-10-4-0.d.ts +0 -2
  65. package/src/migrations/update-10-4-0/update-10-4-0.js +0 -36
  66. package/src/migrations/update-10-4-0/update-10-4-0.js.map +0 -1
  67. package/src/migrations/update-10-5-0/add-template-support-and-presets-to-eslint.d.ts +0 -2
  68. package/src/migrations/update-10-5-0/add-template-support-and-presets-to-eslint.js +0 -118
  69. package/src/migrations/update-10-5-0/add-template-support-and-presets-to-eslint.js.map +0 -1
  70. package/src/migrations/update-11-0-0/update-builders-config.d.ts +0 -2
  71. package/src/migrations/update-11-0-0/update-builders-config.js +0 -55
  72. package/src/migrations/update-11-0-0/update-builders-config.js.map +0 -1
  73. package/src/migrations/update-8-12-0/change-angular-lib-builder.d.ts +0 -2
  74. package/src/migrations/update-8-12-0/change-angular-lib-builder.js +0 -25
  75. package/src/migrations/update-8-12-0/change-angular-lib-builder.js.map +0 -1
  76. package/src/migrations/update-8-3-0/upgrade-ngrx-8-0.d.ts +0 -1
  77. package/src/migrations/update-8-3-0/upgrade-ngrx-8-0.js +0 -49
  78. package/src/migrations/update-8-3-0/upgrade-ngrx-8-0.js.map +0 -1
  79. package/src/migrations/update-8-5-0/upgrade-cli-8-3.d.ts +0 -1
  80. package/src/migrations/update-8-5-0/upgrade-cli-8-3.js +0 -55
  81. package/src/migrations/update-8-5-0/upgrade-cli-8-3.js.map +0 -1
  82. package/src/migrations/update-9-0-0/add-postinstall.d.ts +0 -1
  83. package/src/migrations/update-9-0-0/add-postinstall.js +0 -22
  84. package/src/migrations/update-9-0-0/add-postinstall.js.map +0 -1
  85. package/src/migrations/update-9-0-0/update-9-0-0.d.ts +0 -2
  86. package/src/migrations/update-9-0-0/update-9-0-0.js +0 -18
  87. package/src/migrations/update-9-0-0/update-9-0-0.js.map +0 -1
@@ -4,6 +4,20 @@
4
4
  "description": "ng-packagr target options for Build Architect. Use to build library projects.",
5
5
  "cli": "nx",
6
6
  "type": "object",
7
+ "presets": [
8
+ {
9
+ "name": "Buildable Library with Tailwind",
10
+ "keys": ["project", "tailwindConfig"]
11
+ },
12
+ {
13
+ "name": "Updating Project Dependencies for Buildable Library",
14
+ "keys": [
15
+ "project",
16
+ "updateBuildableProjectDepsInPackageJson",
17
+ "buildableProjectDepsInPackageJsonType"
18
+ ]
19
+ }
20
+ ],
7
21
  "properties": {
8
22
  "project": {
9
23
  "type": "string",
@@ -4,6 +4,20 @@
4
4
  "description": "ng-packagr target options for Build Architect. Use to build and package library projects for publishing.",
5
5
  "cli": "nx",
6
6
  "type": "object",
7
+ "presets": [
8
+ {
9
+ "name": "Publishable Library with Tailwind",
10
+ "keys": ["project", "tailwindConfig"]
11
+ },
12
+ {
13
+ "name": "Updating Project Dependencies for Publishable Library",
14
+ "keys": [
15
+ "project",
16
+ "updateBuildableProjectDepsInPackageJson",
17
+ "buildableProjectDepsInPackageJsonType"
18
+ ]
19
+ }
20
+ ],
7
21
  "properties": {
8
22
  "project": {
9
23
  "type": "string",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/schema",
3
3
  "$id": "GeneratorNxApp",
4
- "title": "Nx Application Options Schema",
4
+ "title": "Creates an Angular application.",
5
5
  "type": "object",
6
6
  "cli": "nx",
7
7
  "properties": {
@@ -101,7 +101,7 @@
101
101
  "e2eTestRunner": {
102
102
  "type": "string",
103
103
  "enum": ["protractor", "cypress", "none"],
104
- "description": "Test runner to use for end to end (e2e) tests.",
104
+ "description": "Test runner to use for end to end (E2E) tests.",
105
105
  "default": "cypress"
106
106
  },
107
107
  "tags": {
@@ -152,7 +152,7 @@
152
152
  },
153
153
  "setParserOptionsProject": {
154
154
  "type": "boolean",
155
- "description": "Whether or not to configure the ESLint \"parserOptions.project\" option. We do not do this by default for lint performance reasons.",
155
+ "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
156
156
  "default": false
157
157
  },
158
158
  "addTailwind": {
@@ -61,14 +61,14 @@
61
61
  "alias": "c"
62
62
  },
63
63
  "style": {
64
- "description": "The file extension or preprocessor to use for style files, or 'none' to skip generating the style file.",
64
+ "description": "The file extension or preprocessor to use for style files, or `none` to skip generating the style file.",
65
65
  "type": "string",
66
66
  "default": "css",
67
67
  "enum": ["css", "scss", "sass", "less", "none"]
68
68
  },
69
69
  "skipTests": {
70
70
  "type": "boolean",
71
- "description": "Do not create \"spec.ts\" test files for the new component.",
71
+ "description": "Do not create `spec.ts` test files for the new component.",
72
72
  "default": false
73
73
  },
74
74
  "flat": {
@@ -88,12 +88,12 @@
88
88
  },
89
89
  "type": {
90
90
  "type": "string",
91
- "description": "Adds a developer-defined type to the filename, in the format \"name.type.ts\".",
91
+ "description": "Adds a developer-defined type to the filename, in the format `name.type.ts`.",
92
92
  "default": "component"
93
93
  },
94
94
  "export": {
95
95
  "type": "boolean",
96
- "description": "Specifies if the component should be exported in the declaring NgModule. Additionally, if the project is a library, the component will be exported from the project's entry point (normally `index.ts`).",
96
+ "description": "Specifies if the component should be exported in the declaring `NgModule`. Additionally, if the project is a library, the component will be exported from the project's entry point (normally `index.ts`).",
97
97
  "default": false
98
98
  }
99
99
  },
@@ -23,8 +23,9 @@ function convertToWithMF(tree, schema) {
23
23
  There are npm packages being shared with a custom configuration in webpack config (${pathToWebpackConfig}).`);
24
24
  }
25
25
  devkit_1.logger.warn(`This Micro Frontend configuration conversion will overwrite "${schema.project}"'s current webpack config. If you have anything custom that is not related to Micro Frontends, it will be lost. You should be able to see the changes in your version control system.`);
26
- const updatedWebpackConfig = (0, lib_1.writeNewWebpackConfig)(webpackAst, (0, lib_1.isHostRemoteConfig)(webpackAst), schema.project);
26
+ const [updatedWebpackConfig, mfeConfig] = (0, lib_1.writeNewWebpackConfig)(webpackAst, (0, lib_1.isHostRemoteConfig)(webpackAst), schema.project);
27
27
  tree.write(pathToWebpackConfig, updatedWebpackConfig);
28
+ tree.write((0, devkit_1.joinPathFragments)(project.root, 'mfe.config.js'), mfeConfig);
28
29
  yield (0, devkit_2.formatFiles)(tree);
29
30
  });
30
31
  }
@@ -1 +1 @@
1
- {"version":3,"file":"convert-to-with-mf.js","sourceRoot":"","sources":["../../../../../../packages/angular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C,KAAK,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,CAAC;QAEtD,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAvCD,kCAuCC"}
1
+ {"version":3,"file":"convert-to-with-mf.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.ts"],"names":[],"mappings":";;;AAAA,yCAA+D;AAG/D,yCAAqE;AACrE,mEAA8D;AAC9D,+BAOe;AAEf,SAA8B,eAAe,CAAC,IAAU,EAAE,MAAc;;QACtE,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,IAAA,iCAAc,EAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAEjE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE;YACjC,MAAM,IAAI,KAAK,CACb,2BAA2B,MAAM,CAAC,OAAO,iIAAiI,CAC3K,CAAC;SACH;QAED,MAAM,OAAO,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QAC/D,MAAM,mBAAmB,GAAG,IAAA,0BAAoB,EAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QAC1E,MAAM,UAAU,GAAG,IAAA,6BAAuB,EAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;QAEtE,IAAI,CAAC,IAAA,uCAAiC,EAAC,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE;YAClE,MAAM,IAAI,KAAK,CACb,iCAAiC,MAAM,CAAC,OAAO;wCACb,mBAAmB,gCAAgC,CACtF,CAAC;SACH;QAED,IAAI,CAAC,IAAA,yCAAmC,EAAC,UAAU,CAAC,EAAE;YACpD,MAAM,IAAI,KAAK,CACb,iCAAiC,MAAM,CAAC,OAAO;6FACwC,mBAAmB,IAAI,CAC/G,CAAC;SACH;QAED,eAAM,CAAC,IAAI,CACT,gEAAgE,MAAM,CAAC,OAAO,wLAAwL,CACvQ,CAAC;QAEF,MAAM,CAAC,oBAAoB,EAAE,SAAS,CAAC,GAAG,IAAA,2BAAqB,EAC7D,UAAU,EACV,IAAA,wBAAkB,EAAC,UAAU,CAAC,EAC9B,MAAM,CAAC,OAAO,CACf,CAAC;QACF,IAAI,CAAC,KAAK,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,CAAC;QACtD,IAAI,CAAC,KAAK,CAAC,IAAA,0BAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,eAAe,CAAC,EAAE,SAAS,CAAC,CAAC;QAExE,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAxCD,kCAwCC"}
@@ -1,3 +1,3 @@
1
1
  import type { SourceFile } from 'typescript';
2
2
  import { IsHostRemoteConfigResult } from './is-host-remote-config';
3
- export declare function writeNewWebpackConfig(ast: SourceFile, mfType: IsHostRemoteConfigResult, projectName: string): string;
3
+ export declare function writeNewWebpackConfig(ast: SourceFile, mfType: IsHostRemoteConfigResult, projectName: string): string[];
@@ -3,40 +3,43 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.writeNewWebpackConfig = void 0;
4
4
  const is_host_remote_config_1 = require("./is-host-remote-config");
5
5
  function writeNewWebpackConfig(ast, mfType, projectName) {
6
- let webpackConfig = '';
6
+ const webpackConfig = `const { withModuleFederation } = require('@nrwl/angular/module-federation');
7
+ const config = require('./mfe.config');
8
+ module.exports = withModuleFederation(config);`;
9
+ let mfeConfig = '';
7
10
  if (!mfType) {
8
- webpackConfig = `const { withModuleFederation } = require('@nrwl/angular/module-federation');
9
- module.exports = withModuleFederation({
11
+ mfeConfig = `
12
+ module.exports = {
10
13
  name: '${projectName}',
11
- });`;
14
+ };`;
12
15
  }
13
16
  else if (mfType === 'host') {
14
17
  const remotes = hostRemotesToString(ast);
15
- webpackConfig = `const { withModuleFederation } = require('@nrwl/angular/module-federation');
16
- module.exports = withModuleFederation({
18
+ mfeConfig = `
19
+ module.exports = {
17
20
  name: '${projectName}',
18
21
  remotes: ${remotes},
19
- });`;
22
+ };`;
20
23
  }
21
24
  else if (mfType === 'remote') {
22
25
  const exposedModules = (0, is_host_remote_config_1.getExposedModulesFromRemote)(ast);
23
- webpackConfig = `const { withModuleFederation } = require('@nrwl/angular/module-federation');
24
- module.exports = withModuleFederation({
26
+ mfeConfig = `
27
+ module.exports = {
25
28
  name: '${projectName}',
26
29
  exposes: ${exposedModules},
27
- });`;
30
+ };`;
28
31
  }
29
32
  else if (mfType === 'both') {
30
33
  const remotes = hostRemotesToString(ast);
31
34
  const exposedModules = (0, is_host_remote_config_1.getExposedModulesFromRemote)(ast);
32
- webpackConfig = `const { withModuleFederation } = require('@nrwl/angular/module-federation');
33
- module.exports = withModuleFederation({
35
+ mfeConfig = `
36
+ module.exports = {
34
37
  name: '${projectName}',
35
38
  remotes: ${remotes},
36
39
  exposes: ${exposedModules},
37
- });`;
40
+ };`;
38
41
  }
39
- return webpackConfig;
42
+ return [webpackConfig, mfeConfig];
40
43
  }
41
44
  exports.writeNewWebpackConfig = writeNewWebpackConfig;
42
45
  function hostRemotesToString(ast) {
@@ -1 +1 @@
1
- {"version":3,"file":"write-new-webpack-config.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/convert-to-with-mf/lib/write-new-webpack-config.ts"],"names":[],"mappings":";;;AACA,mEAIiC;AAEjC,SAAgB,qBAAqB,CACnC,GAAe,EACf,MAAgC,EAChC,WAAmB;IAEnB,IAAI,aAAa,GAAG,EAAE,CAAC;IACvB,IAAI,CAAC,MAAM,EAAE;QACX,aAAa,GAAG;;mBAED,WAAW;YAClB,CAAC;KACV;SAAM,IAAI,MAAM,KAAK,MAAM,EAAE;QAC5B,MAAM,OAAO,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;QACzC,aAAa,GAAG;;mBAED,WAAW;qBACT,OAAO;YAChB,CAAC;KACV;SAAM,IAAI,MAAM,KAAK,QAAQ,EAAE;QAC9B,MAAM,cAAc,GAAG,IAAA,mDAA2B,EAAC,GAAG,CAAC,CAAC;QACxD,aAAa,GAAG;;mBAED,WAAW;qBACT,cAAc;YACvB,CAAC;KACV;SAAM,IAAI,MAAM,KAAK,MAAM,EAAE;QAC5B,MAAM,OAAO,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;QACzC,MAAM,cAAc,GAAG,IAAA,mDAA2B,EAAC,GAAG,CAAC,CAAC;QACxD,aAAa,GAAG;;eAEL,WAAW;iBACT,OAAO;iBACP,cAAc;QACvB,CAAC;KACN;IAED,OAAO,aAAa,CAAC;AACvB,CAAC;AArCD,sDAqCC;AAED,SAAS,mBAAmB,CAAC,GAAe;IAC1C,MAAM,OAAO,GAAW,IAAA,0CAAkB,EAAC,GAAG,CAAC;SAC5C,MAAM,CACL,CAAC,GAAG,EAAE,UAAU,EAAE,EAAE,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,OAAO,GAAG,EAAE,EACvE,EAAE,CACH;SACA,IAAI,EAAE,CAAC;IACV,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC;AACvE,CAAC"}
1
+ {"version":3,"file":"write-new-webpack-config.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/convert-to-with-mf/lib/write-new-webpack-config.ts"],"names":[],"mappings":";;;AACA,mEAIiC;AAEjC,SAAgB,qBAAqB,CACnC,GAAe,EACf,MAAgC,EAChC,WAAmB;IAEnB,MAAM,aAAa,GAAG;;iDAEyB,CAAC;IAEhD,IAAI,SAAS,GAAG,EAAE,CAAC;IACnB,IAAI,CAAC,MAAM,EAAE;QACX,SAAS,GAAG;;mBAEG,WAAW;WACnB,CAAC;KACT;SAAM,IAAI,MAAM,KAAK,MAAM,EAAE;QAC5B,MAAM,OAAO,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;QACzC,SAAS,GAAG;;mBAEG,WAAW;qBACT,OAAO;WACjB,CAAC;KACT;SAAM,IAAI,MAAM,KAAK,QAAQ,EAAE;QAC9B,MAAM,cAAc,GAAG,IAAA,mDAA2B,EAAC,GAAG,CAAC,CAAC;QACxD,SAAS,GAAG;;mBAEG,WAAW;qBACT,cAAc;WACxB,CAAC;KACT;SAAM,IAAI,MAAM,KAAK,MAAM,EAAE;QAC5B,MAAM,OAAO,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;QACzC,MAAM,cAAc,GAAG,IAAA,mDAA2B,EAAC,GAAG,CAAC,CAAC;QACxD,SAAS,GAAG;;eAED,WAAW;iBACT,OAAO;iBACP,cAAc;OACxB,CAAC;KACL;IAED,OAAO,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;AACpC,CAAC;AAzCD,sDAyCC;AAED,SAAS,mBAAmB,CAAC,GAAe;IAC1C,MAAM,OAAO,GAAW,IAAA,0CAAkB,EAAC,GAAG,CAAC;SAC5C,MAAM,CACL,CAAC,GAAG,EAAE,UAAU,EAAE,EAAE,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,OAAO,GAAG,EAAE,EACvE,EAAE,CACH;SACA,IAAI,EAAE,CAAC;IACV,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC;AACvE,CAAC"}
@@ -3,18 +3,18 @@
3
3
  "$id": "NxAngularConvertTSLintToESLintGenerator",
4
4
  "cli": "nx",
5
5
  "title": "Convert an Angular project from TSLint to ESLint",
6
- "description": "NOTE: Does not work in --dry-run mode",
6
+ "description": "Convert an Angular project from TSLint to ESLint. NOTE: Does not work in `--dry-run mode`",
7
7
  "examples": [
8
8
  {
9
- "command": "g convert-tslint-to-eslint myapp",
9
+ "command": "nx g convert-tslint-to-eslint myapp",
10
10
  "description": "The following will first configure the project, `myapp`, the same way a _new_ project is configured i.e. It will use Nx's new recommended ESLint config. By default, this also adds the existing TSLint configuration on top of the default ESLint config from Nx to continue checking what it checks today. This is done by migrating TSLint rules to their equivalent ESLint rules to the best of its abilities. Some TSLint rules may not have ESLint equivalents and will be reported during the conversion"
11
11
  },
12
12
  {
13
- "command": "g convert-tslint-to-eslint myapp --ignoreExistingTslintConfig=true",
13
+ "command": "nx g convert-tslint-to-eslint myapp --ignoreExistingTslintConfig=true",
14
14
  "description": "If your TSLint config isn't extremely important to you, ignoring it makes this process more deterministic. Unlike the prior example, this will discard the existing TSLint configuration, meaning that the project will only have the Nx's latest recommended ESLint configuration which may be good enough for some workspaces"
15
15
  },
16
16
  {
17
- "command": "g convert-tslint-to-eslint myapp --removeTSLintIfNoMoreTSLintTargets=false",
17
+ "command": "nx g convert-tslint-to-eslint myapp --removeTSLintIfNoMoreTSLintTargets=false",
18
18
  "description": "By default, this process removes the TSLint related dependencies and configuration once no more projects use TSLint. This can be disabled with the following flag to keep TSLint related dependencies and configuration in the repo"
19
19
  }
20
20
  ],
@@ -2,6 +2,7 @@
2
2
  "$schema": "http://json-schema.org/schema",
3
3
  "$id": "NxDowngradeModuleGenerator",
4
4
  "title": "Generates downgradeModule setup.",
5
+ "description": "Sets up a Downgrade Module.",
5
6
  "cli": "nx",
6
7
  "type": "object",
7
8
  "properties": {
@@ -3,7 +3,7 @@
3
3
  "$id": "SchematicsAngularModuleInit",
4
4
  "cli": "nx",
5
5
  "title": "Init Angular Plugin",
6
- "description": "NOTE: Does not work in the --dry-run mode",
6
+ "description": "Initializes the `@nrwl/angular` plugin. NOTE: Does not work in the `--dry-run` mode",
7
7
  "type": "object",
8
8
  "properties": {
9
9
  "unitTestRunner": {
@@ -1,4 +1,4 @@
1
1
  import type { Tree } from '@nrwl/devkit';
2
2
  import { GeneratorOptions } from './schema';
3
- export declare function karmaGenerator(tree: Tree, options: GeneratorOptions): import("@nrwl/devkit").GeneratorCallback;
3
+ export declare function karmaGenerator(tree: Tree, options: GeneratorOptions): () => void;
4
4
  export default karmaGenerator;
@@ -4,22 +4,24 @@ exports.karmaGenerator = void 0;
4
4
  const devkit_1 = require("@nrwl/devkit");
5
5
  function karmaGenerator(tree, options) {
6
6
  const packageJson = (0, devkit_1.readJson)(tree, 'package.json');
7
- if (packageJson.devDependencies['karma']) {
8
- return;
7
+ if (!tree.exists('karma.conf.js')) {
8
+ (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files'), '.', {
9
+ tmpl: '',
10
+ });
9
11
  }
10
- (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files'), '.', { tmpl: '' });
11
- return !options.skipPackageJson
12
- ? (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
13
- karma: '~6.3.0',
14
- 'karma-chrome-launcher': '~3.1.0',
15
- 'karma-coverage': '~2.2.0',
16
- 'karma-jasmine': '~4.0.0',
17
- 'karma-jasmine-html-reporter': '~1.7.0',
18
- 'jasmine-core': '~3.10.0',
19
- 'jasmine-spec-reporter': '~5.0.0',
20
- '@types/jasmine': '~3.5.0',
21
- })
22
- : () => { };
12
+ if (options.skipPackageJson || packageJson.devDependencies['karma']) {
13
+ return () => { };
14
+ }
15
+ return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
16
+ karma: '~6.3.0',
17
+ 'karma-chrome-launcher': '~3.1.0',
18
+ 'karma-coverage': '~2.2.0',
19
+ 'karma-jasmine': '~4.0.0',
20
+ 'karma-jasmine-html-reporter': '~1.7.0',
21
+ 'jasmine-core': '~3.10.0',
22
+ 'jasmine-spec-reporter': '~5.0.0',
23
+ '@types/jasmine': '~3.5.0',
24
+ });
23
25
  }
24
26
  exports.karmaGenerator = karmaGenerator;
25
27
  exports.default = karmaGenerator;
@@ -1 +1 @@
1
- {"version":3,"file":"karma.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/karma/karma.ts"],"names":[],"mappings":";;;AACA,yCAKsB;AAGtB,SAAgB,cAAc,CAAC,IAAU,EAAE,OAAyB;IAClE,MAAM,WAAW,GAAG,IAAA,iBAAQ,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IACnD,IAAI,WAAW,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE;QACxC,OAAO;KACR;IAED,IAAA,sBAAa,EAAC,IAAI,EAAE,IAAA,0BAAiB,EAAC,SAAS,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAE9E,OAAO,CAAC,OAAO,CAAC,eAAe;QAC7B,CAAC,CAAC,IAAA,qCAA4B,EAC1B,IAAI,EACJ,EAAE,EACF;YACE,KAAK,EAAE,QAAQ;YACf,uBAAuB,EAAE,QAAQ;YACjC,gBAAgB,EAAE,QAAQ;YAC1B,eAAe,EAAE,QAAQ;YACzB,6BAA6B,EAAE,QAAQ;YACvC,cAAc,EAAE,SAAS;YACzB,uBAAuB,EAAE,QAAQ;YACjC,gBAAgB,EAAE,QAAQ;SAC3B,CACF;QACH,CAAC,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC;AACf,CAAC;AAxBD,wCAwBC;AAED,kBAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"karma.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/karma/karma.ts"],"names":[],"mappings":";;;AACA,yCAKsB;AAGtB,SAAgB,cAAc,CAAC,IAAU,EAAE,OAAyB;IAClE,MAAM,WAAW,GAAG,IAAA,iBAAQ,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAEnD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE;QACjC,IAAA,sBAAa,EAAC,IAAI,EAAE,IAAA,0BAAiB,EAAC,SAAS,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE;YAC9D,IAAI,EAAE,EAAE;SACT,CAAC,CAAC;KACJ;IAED,IAAI,OAAO,CAAC,eAAe,IAAI,WAAW,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE;QACnE,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;KACjB;IACD,OAAO,IAAA,qCAA4B,EACjC,IAAI,EACJ,EAAE,EACF;QACE,KAAK,EAAE,QAAQ;QACf,uBAAuB,EAAE,QAAQ;QACjC,gBAAgB,EAAE,QAAQ;QAC1B,eAAe,EAAE,QAAQ;QACzB,6BAA6B,EAAE,QAAQ;QACvC,cAAc,EAAE,SAAS;QACzB,uBAAuB,EAAE,QAAQ;QACjC,gBAAgB,EAAE,QAAQ;KAC3B,CACF,CAAC;AACJ,CAAC;AA1BD,wCA0BC;AAED,kBAAe,cAAc,CAAC"}
@@ -2,6 +2,7 @@
2
2
  "$schema": "http://json-schema.org/schema",
3
3
  "$id": "NxAngularKarmaGenerator",
4
4
  "title": "Add Karma Configuration to the workspace.",
5
+ "description": "Add Karma configuration to an Nx workspace.",
5
6
  "cli": "nx",
6
7
  "type": "object",
7
8
  "properties": {
@@ -7,8 +7,10 @@ const check_test_target_1 = require("./lib/check-test-target");
7
7
  const generate_karma_project_files_1 = require("./lib/generate-karma-project-files");
8
8
  const update_tsconfig_1 = require("./lib/update-tsconfig");
9
9
  const update_workspace_config_1 = require("./lib/update-workspace-config");
10
+ const karma_1 = require("../karma/karma");
10
11
  function karmaProjectGenerator(tree, options) {
11
12
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
13
+ (0, karma_1.karmaGenerator)(tree, options);
12
14
  (0, check_test_target_1.checkProjectTestTarget)(tree, options.project);
13
15
  (0, generate_karma_project_files_1.generateKarmaProjectFiles)(tree, options.project);
14
16
  (0, update_tsconfig_1.updateTsConfigs)(tree, options.project);
@@ -1 +1 @@
1
- {"version":3,"file":"karma-project.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/karma-project/karma-project.ts"],"names":[],"mappings":";;;;AACA,yCAA2C;AAC3C,+DAAiE;AACjE,qFAA+E;AAC/E,2DAAwD;AACxD,2EAAsE;AAGtE,SAAsB,qBAAqB,CACzC,IAAU,EACV,OAA4B;;QAE5B,IAAA,0CAAsB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAA,wDAAyB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QACjD,IAAA,iCAAe,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QACvC,IAAA,+CAAqB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAC7C,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;IACH,CAAC;CAAA;AAXD,sDAWC;AAED,kBAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"karma-project.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/karma-project/karma-project.ts"],"names":[],"mappings":";;;;AACA,yCAA2C;AAC3C,+DAAiE;AACjE,qFAA+E;AAC/E,2DAAwD;AACxD,2EAAsE;AAEtE,0CAAgD;AAEhD,SAAsB,qBAAqB,CACzC,IAAU,EACV,OAA4B;;QAE5B,IAAA,sBAAc,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC9B,IAAA,0CAAsB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAA,wDAAyB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QACjD,IAAA,iCAAe,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QACvC,IAAA,+CAAqB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAC7C,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;IACH,CAAC;CAAA;AAZD,sDAYC;AAED,kBAAe,qBAAqB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export interface KarmaProjectOptions {
2
2
  project: string;
3
3
  skipFormat?: boolean;
4
+ skipPackageJson?: boolean;
4
5
  }
@@ -2,6 +2,7 @@
2
2
  "$schema": "http://json-schema.org/schema",
3
3
  "$id": "NxKarmaProjectGenerator",
4
4
  "title": "Create Karma Configuration for a project",
5
+ "description": "Add Karma configuration to an angular project.",
5
6
  "cli": "nx",
6
7
  "type": "object",
7
8
  "properties": {
@@ -16,6 +17,11 @@
16
17
  "description": "Skip formatting files.",
17
18
  "type": "boolean",
18
19
  "default": false
20
+ },
21
+ "skipPackageJson": {
22
+ "description": "Skip updating package.json.",
23
+ "type": "boolean",
24
+ "default": false
19
25
  }
20
26
  },
21
27
  "additionalProperties": false,
@@ -2,6 +2,7 @@
2
2
  "$schema": "http://json-schema.org/schema",
3
3
  "$id": "GeneratorAngularLibrary",
4
4
  "title": "Create a library",
5
+ "description": "Creates an Angular library.",
5
6
  "type": "object",
6
7
  "cli": "nx",
7
8
  "properties": {
@@ -110,7 +111,7 @@
110
111
  },
111
112
  "setParserOptionsProject": {
112
113
  "type": "boolean",
113
- "description": "Whether or not to configure the ESLint \"parserOptions.project\" option. We do not do this by default for lint performance reasons.",
114
+ "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
114
115
  "default": false
115
116
  },
116
117
  "addTailwind": {
@@ -2,6 +2,7 @@
2
2
  "$schema": "http://json-schema.org/schema",
3
3
  "$id": "NxAngularLibrarySecondaryEntryPoint",
4
4
  "title": "Creates a secondary entry point for a library",
5
+ "description": "Creates a secondary entry point for an Angular publishable library.",
5
6
  "type": "object",
6
7
  "cli": "nx",
7
8
  "properties": {
@@ -7,7 +7,7 @@
7
7
  "type": "object",
8
8
  "examples": [
9
9
  {
10
- "command": "g @nrwl/angular:mfe-host appName --remotes=remote1",
10
+ "command": "nx g @nrwl/angular:mfe-host appName --remotes=remote1",
11
11
  "description": "Create an Angular app with configuration in place for MFE. If remotes is provided, attach the remote app to this app's configuration."
12
12
  }
13
13
  ],
@@ -3,11 +3,11 @@
3
3
  "$id": "NxMFERemote",
4
4
  "cli": "nx",
5
5
  "title": "Nx MFE Remote App",
6
- "description": "Create an Angular Remote Micro Frontend Application",
6
+ "description": "Create an Angular Remote Micro Frontend Application.",
7
7
  "type": "object",
8
8
  "examples": [
9
9
  {
10
- "command": "g @nrwl/angular:mfe-remote appName --host=host --port=4201",
10
+ "command": "nx g @nrwl/angular:mfe-remote appName --host=host --port=4201",
11
11
  "description": "Create an Angular app with configuration in place for MFE. If host is provided, attach this remote app to host app's configuration."
12
12
  }
13
13
  ],
@@ -3,12 +3,12 @@
3
3
  "$id": "NxAngularMove",
4
4
  "cli": "nx",
5
5
  "title": "Nx Angular Move",
6
- "description": "Move an Angular project to another folder in the workspace",
6
+ "description": "Move an Angular project to another folder in the workspace.",
7
7
  "type": "object",
8
8
  "examples": [
9
9
  {
10
- "command": "g @nrwl/angular:move --project my-feature-lib shared/my-feature-lib",
11
- "description": "Move libs/my-feature-lib to libs/shared/my-feature-lib"
10
+ "command": "nx g @nrwl/angular:move --project my-feature-lib shared/my-feature-lib",
11
+ "description": "Move libs/my-feature-lib to libs/shared/my-feature-lib."
12
12
  }
13
13
  ],
14
14
  "properties": {
@@ -2,6 +2,7 @@
2
2
  "$schema": "http://json-schema.org/schema",
3
3
  "$id": "NxNgrxGenerator",
4
4
  "title": "Add NgRx support to an application or library.",
5
+ "description": "Adds NgRx support to an application or library.",
5
6
  "cli": "nx",
6
7
  "type": "object",
7
8
  "properties": {
@@ -36,13 +36,13 @@
36
36
  "alias": "b"
37
37
  },
38
38
  "inlineStyle": {
39
- "description": "Include styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file.",
39
+ "description": "Include styles inline in the `component.ts` file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the `component.ts` file.",
40
40
  "type": "boolean",
41
41
  "default": false,
42
42
  "alias": "s"
43
43
  },
44
44
  "inlineTemplate": {
45
- "description": "Include template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.",
45
+ "description": "Include template inline in the `component.ts` file. By default, an external template file is created and referenced in the `component.ts` file.",
46
46
  "type": "boolean",
47
47
  "default": false,
48
48
  "alias": "t"
@@ -68,12 +68,12 @@
68
68
  },
69
69
  "skipTests": {
70
70
  "type": "boolean",
71
- "description": "Do not create \"spec.ts\" test files for the new component.",
71
+ "description": "Do not create `spec.ts` test files for the new component.",
72
72
  "default": false
73
73
  },
74
74
  "inlineScam": {
75
75
  "type": "boolean",
76
- "description": "Create the NgModule in the same file as the Component.",
76
+ "description": "Create the `NgModule` in the same file as the component.",
77
77
  "default": true
78
78
  },
79
79
  "flat": {
@@ -84,7 +84,7 @@
84
84
  "selector": {
85
85
  "type": "string",
86
86
  "format": "html-selector",
87
- "description": "The HTML selector to use for this component."
87
+ "description": "The `HTML` selector to use for this component."
88
88
  },
89
89
  "skipSelector": {
90
90
  "type": "boolean",
@@ -93,7 +93,7 @@
93
93
  },
94
94
  "type": {
95
95
  "type": "string",
96
- "description": "Adds a developer-defined type to the filename, in the format \"name.type.ts\".",
96
+ "description": "Adds a developer-defined type to the filename, in the format `name.type.ts`.",
97
97
  "default": "component"
98
98
  },
99
99
  "prefix": {
@@ -31,12 +31,12 @@
31
31
  },
32
32
  "skipTests": {
33
33
  "type": "boolean",
34
- "description": "Do not create \"spec.ts\" test files for the new directive.",
34
+ "description": "Do not create `spec.ts` test files for the new directive.",
35
35
  "default": false
36
36
  },
37
37
  "inlineScam": {
38
38
  "type": "boolean",
39
- "description": "Create the NgModule in the same file as the Directive.",
39
+ "description": "Create the `NgModule` in the same file as the Directive.",
40
40
  "default": true
41
41
  },
42
42
  "flat": {
@@ -47,7 +47,7 @@
47
47
  "selector": {
48
48
  "type": "string",
49
49
  "format": "html-selector",
50
- "description": "The HTML selector to use for this directive."
50
+ "description": "The `HTML` selector to use for this directive."
51
51
  },
52
52
  "prefix": {
53
53
  "type": "string",
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "skipTests": {
33
33
  "type": "boolean",
34
- "description": "Do not create \"spec.ts\" test files for the new pipe.",
34
+ "description": "Do not create `spec.ts` test files for the new pipe.",
35
35
  "default": false
36
36
  },
37
37
  "inlineScam": {
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ name: '<%= name %>',<% if(type === 'host') { %>
3
+ remotes: [<% remotes.forEach(function(remote) { %>'<%= remote.remoteName %>',<% }); %>]<% } %><% if(type === 'remote') { %>
4
+ exposes: {
5
+ './Module': '<%= projectRoot %>/src/app/remote-entry/entry.module.ts',
6
+ },<% } %>
7
+ }
@@ -1,8 +1,3 @@
1
1
  const { withModuleFederation } = require('@nrwl/angular/module-federation');
2
- module.exports = withModuleFederation({
3
- name: '<%= name %>',<% if(type === 'host') { %>
4
- remotes: [<% remotes.forEach(function(remote) { %>'<%= remote.remoteName %>',<% }); %>]<% } %><% if(type === 'remote') { %>
5
- exposes: {
6
- './Module': '<%= projectRoot %>/src/app/remote-entry/entry.module.ts',
7
- },<% } %>
8
- });
2
+ const config = require('./mfe.config');
3
+ module.exports = withModuleFederation(config);
@@ -15,20 +15,19 @@ function checkIsCommaNeeded(mfeRemoteText) {
15
15
  }
16
16
  exports.checkIsCommaNeeded = checkIsCommaNeeded;
17
17
  function addRemoteToHost(host, options) {
18
- var _a;
19
18
  if (options.mfeType === 'remote' && options.host) {
20
19
  const hostProject = (0, devkit_1.readProjectConfiguration)(host, options.host);
21
- const hostWebpackPath = (_a = hostProject.targets['build'].options.customWebpackConfig) === null || _a === void 0 ? void 0 : _a.path;
22
- if (!hostWebpackPath || !host.exists(hostWebpackPath)) {
23
- throw new Error(`The selected host application, ${options.host}, does not contain a webpack.config.js. Are you sure it has been set up as a host application?`);
20
+ const hostMfeConfigPath = (0, devkit_1.joinPathFragments)(hostProject.root, 'mfe.config.js');
21
+ if (!hostMfeConfigPath || !host.exists(hostMfeConfigPath)) {
22
+ throw new Error(`The selected host application, ${options.host}, does not contain a mfe.config.js. Are you sure it has been set up as a host application?`);
24
23
  }
25
- const hostWebpackConfig = host.read(hostWebpackPath, 'utf-8');
26
- const webpackAst = tsquery_1.tsquery.ast(hostWebpackConfig);
24
+ const hostMFEConfig = host.read(hostMfeConfigPath, 'utf-8');
25
+ const webpackAst = tsquery_1.tsquery.ast(hostMFEConfig);
27
26
  const mfRemotesNode = (0, tsquery_1.tsquery)(webpackAst, 'Identifier[name=remotes] ~ ArrayLiteralExpression', { visitAllChildren: true })[0];
28
27
  const endOfPropertiesPos = mfRemotesNode.getEnd() - 1;
29
28
  const isCommaNeeded = checkIsCommaNeeded(mfRemotesNode.getText());
30
- const updatedConfig = `${hostWebpackConfig.slice(0, endOfPropertiesPos)}${isCommaNeeded ? ',' : ''}'${options.appName}',${hostWebpackConfig.slice(endOfPropertiesPos)}`;
31
- host.write(hostWebpackPath, updatedConfig);
29
+ const updatedConfig = `${hostMFEConfig.slice(0, endOfPropertiesPos)}${isCommaNeeded ? ',' : ''}'${options.appName}',${hostMFEConfig.slice(endOfPropertiesPos)}`;
30
+ host.write(hostMfeConfigPath, updatedConfig);
32
31
  const declarationFilePath = (0, devkit_1.joinPathFragments)(hostProject.sourceRoot, 'decl.d.ts');
33
32
  const declarationFileContent = (host.exists(declarationFilePath)
34
33
  ? host.read(declarationFilePath, 'utf-8')
@@ -1 +1 @@
1
- {"version":3,"file":"add-remote-to-host.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-mfe/lib/add-remote-to-host.ts"],"names":[],"mappings":";;;AAGA,yCAA2E;AAC3E,uDAAoD;AAEpD,kEAA8D;AAE9D,iCAAiC;AAEjC,SAAgB,kBAAkB,CAAC,aAAqB;IACtD,MAAM,UAAU,GAAG,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACrD,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,IA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,CAAC,OAAO;uCACM,OAAO,CAAC,OAAO;OAC/C,CACJ,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"add-remote-to-host.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-mfe/lib/add-remote-to-host.ts"],"names":[],"mappings":";;;AAGA,yCAA2E;AAC3E,uDAAoD;AAEpD,kEAA8D;AAE9D,iCAAiC;AAEjC,SAAgB,kBAAkB,CAAC,aAAqB;IACtD,MAAM,UAAU,GAAG,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACrD,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC;QAC/B,CAAC,CAAC,UAAU,KAAK,IAAI;YACnB,CAAC,CAAC,KAAK;YACP,CAAC,CAAC,IAAI;QACR,CAAC,CAAC,KAAK,CAAC;AACZ,CAAC;AAPD,gDAOC;AAED,SAAgB,eAAe,CAAC,IAAU,EAAE,OAAe;IACzD,IAAI,OAAO,CAAC,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,IAAI,EAAE;QAChD,MAAM,WAAW,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QACjE,MAAM,iBAAiB,GAAG,IAAA,0BAAiB,EACzC,WAAW,CAAC,IAAI,EAChB,eAAe,CAChB,CAAC;QAEF,IAAI,CAAC,iBAAiB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE;YACzD,MAAM,IAAI,KAAK,CACb,kCAAkC,OAAO,CAAC,IAAI,4FAA4F,CAC3I,CAAC;SACH;QAED,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;QAC5D,MAAM,UAAU,GAAG,iBAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAC9C,MAAM,aAAa,GAAG,IAAA,iBAAO,EAC3B,UAAU,EACV,mDAAmD,EACnD,EAAE,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R;IAED,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;IAC9D,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,uBAAuB,CAAC,EAAE;QACpD,OAAO;KACR;IAED,IAAI,UAAU,GAAG,EAAE,CAAC,gBAAgB,CAClC,mBAAmB,EACnB,aAAa,EACb,EAAE,CAAC,YAAY,CAAC,MAAM,EACtB,IAAI,CACL,CAAC;IAEF,UAAU,GAAG,IAAA,oBAAQ,EACnB,IAAI,EACJ,mBAAmB,EACnB,UAAU,EACV;kBACc,OAAO,CAAC,OAAO;uCACM,OAAO,CAAC,OAAO;OAC/C,CACJ,CAAC;AACJ,CAAC"}
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.generateWebpackConfig = void 0;
4
4
  const devkit_1 = require("@nrwl/devkit");
5
5
  function generateWebpackConfig(host, options, appRoot, remotesWithPorts) {
6
- if (host.exists(`${appRoot}/webpack.config.js`) ||
6
+ if (host.exists(`${appRoot}/mfe.config.js`) ||
7
+ host.exists(`${appRoot}/webpack.config.js`) ||
7
8
  host.exists(`${appRoot}/webpack.prod.config.js`)) {
8
9
  devkit_1.logger.warn(`NOTE: We encountered an existing webpack config for the app ${options.appName}. We have overwritten this file with the Module Federation Config.\n
9
10
  If this was not the outcome you expected, you can discard the changes we have made, create a backup of your current webpack config, and run the command again.`);
@@ -1 +1 @@
1
- {"version":3,"file":"generate-config.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-mfe/lib/generate-config.ts"],"names":[],"mappings":";;;AACA,yCAAwE;AAGxE,SAAgB,qBAAqB,CACnC,IAAU,EACV,OAAe,EACf,OAAe,EACf,gBAAwD;IAExD,IACE,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,oBAAoB,CAAC;QAC3C,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,yBAAyB,CAAC,EAChD;QACA,eAAM,CAAC,IAAI,CACT,+DAA+D,OAAO,CAAC,OAAO;qKACiF,CAChK,CAAC;KACH;IAED,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,kBAAkB,CAAC,EAChD,OAAO,EACP;QACE,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,OAAO,CAAC,OAAO;QACrB,IAAI,EAAE,OAAO,CAAC,OAAO;QACrB,OAAO,EAAE,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,EAAE;QAC/B,WAAW,EAAE,OAAO;KACrB,CACF,CAAC;AACJ,CAAC;AA5BD,sDA4BC"}
1
+ {"version":3,"file":"generate-config.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-mfe/lib/generate-config.ts"],"names":[],"mappings":";;;AACA,yCAAwE;AAGxE,SAAgB,qBAAqB,CACnC,IAAU,EACV,OAAe,EACf,OAAe,EACf,gBAAwD;IAExD,IACE,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,gBAAgB,CAAC;QACvC,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,oBAAoB,CAAC;QAC3C,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,yBAAyB,CAAC,EAChD;QACA,eAAM,CAAC,IAAI,CACT,+DAA+D,OAAO,CAAC,OAAO;qKACiF,CAChK,CAAC;KACH;IAED,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,kBAAkB,CAAC,EAChD,OAAO,EACP;QACE,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,OAAO,CAAC,OAAO;QACrB,IAAI,EAAE,OAAO,CAAC,OAAO;QACrB,OAAO,EAAE,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,EAAE;QAC/B,WAAW,EAAE,OAAO;KACrB,CACF,CAAC;AACJ,CAAC;AA7BD,sDA6BC"}