@nrwl/angular 13.10.0-beta.1 → 13.10.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/mfe/index.mjs +2 -0
- package/esm2020/mfe/mfe.mjs +45 -0
- package/esm2020/mfe/nrwl-angular-mfe.mjs +5 -0
- package/executors.json +4 -4
- package/fesm2015/nrwl-angular-mfe.mjs +57 -0
- package/fesm2015/nrwl-angular-mfe.mjs.map +1 -0
- package/fesm2020/nrwl-angular-mfe.mjs +51 -0
- package/fesm2020/nrwl-angular-mfe.mjs.map +1 -0
- package/generators.json +10 -0
- package/mfe/index.d.ts +1 -0
- package/mfe/index.js +7 -0
- package/mfe/index.js.map +1 -0
- package/mfe/mfe.d.ts +4 -0
- package/mfe/mfe.js +56 -0
- package/mfe/mfe.js.map +1 -0
- package/mfe/ng-package.json +6 -0
- package/mfe/nrwl-angular-mfe.d.ts +5 -0
- package/mfe/package.json +10 -0
- package/module-federation/index.d.ts +1 -0
- package/module-federation/index.js +6 -0
- package/module-federation/index.js.map +1 -0
- package/package.json +15 -7
- package/scripts/nx-cli-warning.js +1 -1
- package/src/builders/webpack-browser/schema.json +3 -2
- package/src/builders/webpack-browser/webpack-browser.impl.js +3 -3
- package/src/builders/webpack-browser/webpack-browser.impl.js.map +1 -1
- package/src/builders/webpack-server/schema.json +3 -2
- package/src/builders/webpack-server/webpack-server.impl.js +1 -2
- package/src/builders/webpack-server/webpack-server.impl.js.map +1 -1
- package/src/executors/delegate-build/delegate-build.impl.js +2 -2
- package/src/executors/delegate-build/delegate-build.impl.js.map +1 -1
- package/src/executors/package/package.impl.js +4 -4
- package/src/executors/package/package.impl.js.map +1 -1
- package/src/executors/utilities/tailwindcss.js +3 -3
- package/src/executors/utilities/tailwindcss.js.map +1 -1
- package/src/generators/convert-to-with-mf/convert-to-with-mf.compat.d.ts +2 -0
- package/src/generators/convert-to-with-mf/convert-to-with-mf.compat.js +6 -0
- package/src/generators/convert-to-with-mf/convert-to-with-mf.compat.js.map +1 -0
- package/src/generators/convert-to-with-mf/convert-to-with-mf.d.ts +3 -0
- package/src/generators/convert-to-with-mf/convert-to-with-mf.js +32 -0
- package/src/generators/convert-to-with-mf/convert-to-with-mf.js.map +1 -0
- package/src/generators/convert-to-with-mf/convert-to-with-mf.test-data.d.ts +5 -0
- package/src/generators/convert-to-with-mf/convert-to-with-mf.test-data.js +449 -0
- package/src/generators/convert-to-with-mf/convert-to-with-mf.test-data.js.map +1 -0
- package/src/generators/convert-to-with-mf/lib/check-name-matches.d.ts +2 -0
- package/src/generators/convert-to-with-mf/lib/check-name-matches.js +24 -0
- package/src/generators/convert-to-with-mf/lib/check-name-matches.js.map +1 -0
- package/src/generators/convert-to-with-mf/lib/check-shared-npm-packages.d.ts +2 -0
- package/src/generators/convert-to-with-mf/lib/check-shared-npm-packages.js +49 -0
- package/src/generators/convert-to-with-mf/lib/check-shared-npm-packages.js.map +1 -0
- package/src/generators/convert-to-with-mf/lib/get-webpack-config-path.d.ts +2 -0
- package/src/generators/convert-to-with-mf/lib/get-webpack-config-path.js +20 -0
- package/src/generators/convert-to-with-mf/lib/get-webpack-config-path.js.map +1 -0
- package/src/generators/convert-to-with-mf/lib/index.d.ts +6 -0
- package/src/generators/convert-to-with-mf/lib/index.js +10 -0
- package/src/generators/convert-to-with-mf/lib/index.js.map +1 -0
- package/src/generators/convert-to-with-mf/lib/is-host-remote-config.d.ts +5 -0
- package/src/generators/convert-to-with-mf/lib/is-host-remote-config.js +63 -0
- package/src/generators/convert-to-with-mf/lib/is-host-remote-config.js.map +1 -0
- package/src/generators/convert-to-with-mf/lib/parse-ast-webpack-config.d.ts +2 -0
- package/src/generators/convert-to-with-mf/lib/parse-ast-webpack-config.js +13 -0
- package/src/generators/convert-to-with-mf/lib/parse-ast-webpack-config.js.map +1 -0
- package/src/generators/convert-to-with-mf/lib/write-new-webpack-config.d.ts +3 -0
- package/src/generators/convert-to-with-mf/lib/write-new-webpack-config.js +48 -0
- package/src/generators/convert-to-with-mf/lib/write-new-webpack-config.js.map +1 -0
- package/src/generators/convert-to-with-mf/schema.d.ts +3 -0
- package/src/generators/convert-to-with-mf/schema.json +20 -0
- package/src/generators/mfe-host/schema.json +1 -1
- package/src/generators/mfe-remote/mfe-remote.js +14 -1
- package/src/generators/mfe-remote/mfe-remote.js.map +1 -1
- package/src/generators/mfe-remote/schema.json +1 -1
- package/src/generators/move/lib/update-ng-package.js +2 -2
- package/src/generators/move/lib/update-ng-package.js.map +1 -1
- package/src/generators/ng-add/files/decorate-angular-cli/decorate-angular-cli.js__tmpl__ +1 -1
- package/src/generators/ng-add/files/root/nx.json__tmpl__ +1 -1
- package/src/generators/ng-add/migrate-from-angular-cli.js +2 -8
- package/src/generators/ng-add/migrate-from-angular-cli.js.map +1 -1
- package/src/generators/setup-mfe/files/webpack/webpack.config.js__tmpl__ +8 -59
- package/src/generators/setup-mfe/lib/add-remote-to-host.d.ts +1 -0
- package/src/generators/setup-mfe/lib/add-remote-to-host.js +15 -6
- package/src/generators/setup-mfe/lib/add-remote-to-host.js.map +1 -1
- package/src/generators/setup-mfe/lib/generate-config.js +1 -12
- package/src/generators/setup-mfe/lib/generate-config.js.map +1 -1
- package/src/generators/setup-mfe/setup-mfe.d.ts +2 -2
- package/src/generators/setup-mfe/setup-mfe.js +0 -9
- package/src/generators/setup-mfe/setup-mfe.js.map +1 -1
- package/src/migrations/update-10-5-0/add-template-support-and-presets-to-eslint.js +2 -2
- package/src/migrations/update-10-5-0/add-template-support-and-presets-to-eslint.js.map +1 -1
- package/src/utils/get-mfe-projects.d.ts +3 -1
- package/src/utils/get-mfe-projects.js +5 -2
- package/src/utils/get-mfe-projects.js.map +1 -1
- package/src/utils/mfe/mfe-webpack.js +2 -3
- package/src/utils/mfe/mfe-webpack.js.map +1 -1
- package/src/utils/mfe/with-module-federation.js +6 -9
- package/src/utils/mfe/with-module-federation.js.map +1 -1
- package/src/utils/versions.d.ts +0 -1
- package/src/utils/versions.js +2 -3
- package/src/utils/versions.js.map +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getTailwindPostCssPlugins = exports.getTailwindSetup = exports.tailwindDirectives = void 0;
|
|
4
4
|
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
-
const
|
|
5
|
+
const devkit_2 = require("@nrwl/devkit");
|
|
6
6
|
const fs_1 = require("fs");
|
|
7
7
|
const path_1 = require("path");
|
|
8
8
|
const postcssImport = require("postcss-import");
|
|
@@ -19,7 +19,7 @@ function getTailwindSetup(basePath, tailwindConfig) {
|
|
|
19
19
|
if (!tailwindConfigPath) {
|
|
20
20
|
// Try to find TailwindCSS configuration file in the project or workspace root.
|
|
21
21
|
const tailwindConfigFile = 'tailwind.config.js';
|
|
22
|
-
for (const path of [basePath,
|
|
22
|
+
for (const path of [basePath, devkit_2.appRootPath]) {
|
|
23
23
|
const fullPath = (0, path_1.join)(path, tailwindConfigFile);
|
|
24
24
|
if ((0, fs_1.existsSync)(fullPath)) {
|
|
25
25
|
tailwindConfigPath = fullPath;
|
|
@@ -36,7 +36,7 @@ function getTailwindSetup(basePath, tailwindConfig) {
|
|
|
36
36
|
tailwindPackagePath = require.resolve('tailwindcss');
|
|
37
37
|
}
|
|
38
38
|
catch (_a) {
|
|
39
|
-
const relativeTailwindConfigPath = (0, path_1.relative)(
|
|
39
|
+
const relativeTailwindConfigPath = (0, path_1.relative)(devkit_2.appRootPath, tailwindConfigPath);
|
|
40
40
|
devkit_1.logger.warn(`Tailwind CSS configuration file found (${relativeTailwindConfigPath})` +
|
|
41
41
|
` but the 'tailwindcss' package is not installed.` +
|
|
42
42
|
` To enable Tailwind CSS, please install the 'tailwindcss' package.`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tailwindcss.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/executors/utilities/tailwindcss.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AACtC,
|
|
1
|
+
{"version":3,"file":"tailwindcss.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/executors/utilities/tailwindcss.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AACtC,yCAA2C;AAC3C,2BAAgC;AAChC,+BAAsC;AACtC,gDAAgD;AAOnC,QAAA,kBAAkB,GAAG;IAChC,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,aAAa;IACb,SAAS;CACV,CAAC;AAEF,SAAgB,gBAAgB,CAC9B,QAAgB,EAChB,cAAuB;IAEvB,IAAI,kBAAkB,GAAG,cAAc,CAAC;IAExC,IAAI,CAAC,kBAAkB,EAAE;QACvB,+EAA+E;QAC/E,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;QAChD,KAAK,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,oBAAW,CAAC,EAAE;YAC1C,MAAM,QAAQ,GAAG,IAAA,WAAI,EAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;YAChD,IAAI,IAAA,eAAU,EAAC,QAAQ,CAAC,EAAE;gBACxB,kBAAkB,GAAG,QAAQ,CAAC;gBAC9B,MAAM;aACP;SACF;KACF;IAED,iEAAiE;IACjE,IAAI,CAAC,kBAAkB,EAAE;QACvB,OAAO,SAAS,CAAC;KAClB;IAED,IAAI,mBAAuC,CAAC;IAC5C,IAAI;QACF,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;KACtD;IAAC,WAAM;QACN,MAAM,0BAA0B,GAAG,IAAA,eAAQ,EACzC,oBAAW,EACX,kBAAkB,CACnB,CAAC;QACF,eAAM,CAAC,IAAI,CACT,0CAA0C,0BAA0B,GAAG;YACrE,kDAAkD;YAClD,oEAAoE,CACvE,CAAC;QAEF,OAAO,SAAS,CAAC;KAClB;IAED,IAAI,CAAC,mBAAmB,EAAE;QACxB,OAAO,SAAS,CAAC;KAClB;IAED,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,CAAC;AACrD,CAAC;AA7CD,4CA6CC;AAED,SAAgB,yBAAyB,CACvC,EAAE,kBAAkB,EAAE,mBAAmB,EAAiB,EAC1D,YAAuB,EACvB,KAAe;IAEf,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,KAAK,SAAS,EAAE;QAC9C,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;KAC1D;IAED,OAAO;QACL,aAAa,CAAC;YACZ,qBAAqB,EAAE,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,EAAE;YACzC,OAAO,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;SACzE,CAAC;QACF,OAAO,CAAC,mBAAmB,CAAC,CAAC,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;KAC7D,CAAC;AACJ,CAAC;AAhBD,8DAgBC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
4
|
+
const convert_to_with_mf_1 = require("./convert-to-with-mf");
|
|
5
|
+
exports.default = (0, devkit_1.convertNxGenerator)(convert_to_with_mf_1.default);
|
|
6
|
+
//# sourceMappingURL=convert-to-with-mf.compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-to-with-mf.compat.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.compat.ts"],"names":[],"mappings":";;AAAA,yCAAkD;AAClD,6DAAmD;AAEnD,kBAAe,IAAA,2BAAkB,EAAC,4BAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
const devkit_2 = require("@nrwl/devkit");
|
|
6
|
+
const get_mfe_projects_1 = require("../../utils/get-mfe-projects");
|
|
7
|
+
const lib_1 = require("./lib");
|
|
8
|
+
function convertToWithMF(tree, schema) {
|
|
9
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
10
|
+
const projects = new Set((0, get_mfe_projects_1.getMfeProjects)(tree, { legacy: true }));
|
|
11
|
+
if (!projects.has(schema.project)) {
|
|
12
|
+
throw new Error(`Could not find project "${schema.project}" with a Micro Frontend configuration in your workspace. Please check the name of the project you're wishing to convert exists.`);
|
|
13
|
+
}
|
|
14
|
+
const project = (0, devkit_2.readProjectConfiguration)(tree, schema.project);
|
|
15
|
+
const pathToWebpackConfig = (0, lib_1.getWebpackConfigPath)(project, schema.project);
|
|
16
|
+
const webpackAst = (0, lib_1.parseASTOfWebpackConfig)(tree, pathToWebpackConfig);
|
|
17
|
+
if (!(0, lib_1.checkOutputNameMatchesProjectName)(webpackAst, schema.project)) {
|
|
18
|
+
throw new Error(`Cannot automatically migrate "${schema.project}" to "withModuleFederation" micro frontend webpack config.
|
|
19
|
+
"uniqueName" in webpack config (${pathToWebpackConfig}) does not match project name.`);
|
|
20
|
+
}
|
|
21
|
+
if (!(0, lib_1.checkSharedNpmPackagesMatchExpected)(webpackAst)) {
|
|
22
|
+
throw new Error(`Cannot automatically migrate "${schema.project}" to "withModuleFederation" micro frontend webpack config.
|
|
23
|
+
There are npm packages being shared with a custom configuration in webpack config (${pathToWebpackConfig}).`);
|
|
24
|
+
}
|
|
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);
|
|
27
|
+
tree.write(pathToWebpackConfig, updatedWebpackConfig);
|
|
28
|
+
yield (0, devkit_2.formatFiles)(tree);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
exports.default = convertToWithMF;
|
|
32
|
+
//# sourceMappingURL=convert-to-with-mf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,yCAA4C;AAG5C,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,oBAAoB,GAAG,IAAA,2BAAqB,EAChD,UAAU,EACV,IAAA,wBAAkB,EAAC,UAAU,CAAC,EAC9B,MAAM,CAAC,OAAO,CACf,CAAC;QACF,IAAI,CAAC,KAAK,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,CAAC;QAEtD,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAvCD,kCAuCC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const STANDARD_HOST_MFE_CONFIG = "const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');\nconst mf = require('@angular-architects/module-federation/webpack');\nconst path = require('path');\nconst share = mf.share;\n\n/**\n * We use the NX_TSCONFIG_PATH environment variable when using the @nrwl/angular:webpack-browser\n * builder as it will generate a temporary tsconfig file which contains any required remappings of\n * shared libraries.\n * A remapping will occur when a library is buildable, as webpack needs to know the location of the\n * built files for the buildable library.\n * This NX_TSCONFIG_PATH environment variable is set by the @nrwl/angular:webpack-browser and it contains\n * the location of the generated temporary tsconfig file.\n */\nconst tsConfigPath =\n process.env.NX_TSCONFIG_PATH ??\n path.join(__dirname, '../../tsconfig.base.json');\n\nconst workspaceRootPath = path.join(__dirname, '../../');\nconst sharedMappings = new mf.SharedMappings();\nsharedMappings.register(\n tsConfigPath,\n [\n /* mapped paths to share */\n ],\n workspaceRootPath\n);\n\nmodule.exports = {\n output: {\n uniqueName: 'host1',\n publicPath: 'auto',\n },\n optimization: {\n runtimeChunk: false,\n },\n experiments: {\n outputModule: true,\n },\n resolve: {\n alias: {\n ...sharedMappings.getAliases(),\n },\n },\n plugins: [\n new ModuleFederationPlugin({\n remotes: {\n remote1: 'http://localhost:4201/remoteEntry.mjs',\n },\n shared: share({\n '@angular/core': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n '@angular/common': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n '@angular/common/http': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n '@angular/router': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n rxjs: {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n ...sharedMappings.getDescriptors(),\n }),\n library: {\n type: 'module',\n },\n }),\n sharedMappings.getPlugin(),\n ],\n};\n";
|
|
2
|
+
export declare const STANDARD_REMOTE_MFE_CONFIG = "const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');\nconst mf = require('@angular-architects/module-federation/webpack');\nconst path = require('path');\nconst share = mf.share;\n\n/**\n * We use the NX_TSCONFIG_PATH environment variable when using the @nrwl/angular:webpack-browser\n * builder as it will generate a temporary tsconfig file which contains any required remappings of\n * shared libraries.\n * A remapping will occur when a library is buildable, as webpack needs to know the location of the\n * built files for the buildable library.\n * This NX_TSCONFIG_PATH environment variable is set by the @nrwl/angular:webpack-browser and it contains\n * the location of the generated temporary tsconfig file.\n */\nconst tsConfigPath =\n process.env.NX_TSCONFIG_PATH ??\n path.join(__dirname, '../../tsconfig.base.json');\n\nconst workspaceRootPath = path.join(__dirname, '../../');\nconst sharedMappings = new mf.SharedMappings();\nsharedMappings.register(\n tsConfigPath,\n [\n /* mapped paths to share */\n ],\n workspaceRootPath\n);\n\nmodule.exports = {\n output: {\n uniqueName: 'remote1',\n publicPath: 'auto',\n },\n optimization: {\n runtimeChunk: false,\n },\n experiments: {\n outputModule: true,\n },\n resolve: {\n alias: {\n ...sharedMappings.getAliases(),\n },\n },\n plugins: [\n new ModuleFederationPlugin({\n name: 'remote1',\n filename: 'remoteEntry.js',\n exposes: {\n './Module': 'apps/remote1/src/app/remote-entry/entry.module.ts',\n },\n shared: share({\n '@angular/core': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n '@angular/common': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n '@angular/common/http': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n '@angular/router': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n rxjs: {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n ...sharedMappings.getDescriptors(),\n }),\n library: {\n type: 'module',\n },\n }),\n sharedMappings.getPlugin(),\n ],\n};\n";
|
|
3
|
+
export declare const OLD_OBJECT_SHARED_SYNTAX = "const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');\nconst mf = require('@angular-architects/module-federation/webpack');\nconst path = require('path');\nconst share = mf.share;\n\n/**\n * We use the NX_TSCONFIG_PATH environment variable when using the @nrwl/angular:webpack-browser\n * builder as it will generate a temporary tsconfig file which contains any required remappings of\n * shared libraries.\n * A remapping will occur when a library is buildable, as webpack needs to know the location of the\n * built files for the buildable library.\n * This NX_TSCONFIG_PATH environment variable is set by the @nrwl/angular:webpack-browser and it contains\n * the location of the generated temporary tsconfig file.\n */\nconst tsConfigPath =\n process.env.NX_TSCONFIG_PATH ??\n path.join(__dirname, '../../tsconfig.base.json');\n\nconst workspaceRootPath = path.join(__dirname, '../../');\nconst sharedMappings = new mf.SharedMappings();\nsharedMappings.register(\n tsConfigPath,\n [\n /* mapped paths to share */\n ],\n workspaceRootPath\n);\n\nmodule.exports = {\n output: {\n uniqueName: 'remote1',\n publicPath: 'auto',\n },\n optimization: {\n runtimeChunk: false,\n },\n experiments: {\n outputModule: true,\n },\n resolve: {\n alias: {\n ...sharedMappings.getAliases(),\n },\n },\n plugins: [\n new ModuleFederationPlugin({\n name: 'remote1',\n filename: 'remoteEntry.js',\n exposes: {\n './Module': 'apps/remote1/src/app/remote-entry/entry.module.ts',\n },\n shared: {\n '@angular/core': {\n singleton: true,\n strictVersion: true,\n },\n '@angular/common': {\n singleton: true,\n strictVersion: true,\n },\n '@angular/common/http': {\n singleton: true,\n strictVersion: true,\n },\n '@angular/router': {\n singleton: true,\n strictVersion: true,\n },\n rxjs: {\n singleton: true,\n strictVersion: true,\n },\n ...sharedMappings.getDescriptors(),\n },\n library: {\n type: 'module',\n },\n }),\n sharedMappings.getPlugin(),\n ],\n};";
|
|
4
|
+
export declare const ERROR_NAME_DOESNT_MATCH = "const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');\nconst mf = require('@angular-architects/module-federation/webpack');\nconst path = require('path');\nconst share = mf.share;\n\n/**\n * We use the NX_TSCONFIG_PATH environment variable when using the @nrwl/angular:webpack-browser\n * builder as it will generate a temporary tsconfig file which contains any required remappings of\n * shared libraries.\n * A remapping will occur when a library is buildable, as webpack needs to know the location of the\n * built files for the buildable library.\n * This NX_TSCONFIG_PATH environment variable is set by the @nrwl/angular:webpack-browser and it contains\n * the location of the generated temporary tsconfig file.\n */\nconst tsConfigPath =\n process.env.NX_TSCONFIG_PATH ??\n path.join(__dirname, '../../tsconfig.base.json');\n\nconst workspaceRootPath = path.join(__dirname, '../../');\nconst sharedMappings = new mf.SharedMappings();\nsharedMappings.register(\n tsConfigPath,\n [\n /* mapped paths to share */\n ],\n workspaceRootPath\n);\n\nmodule.exports = {\n output: {\n uniqueName: 'somethingelse',\n publicPath: 'auto',\n },\n optimization: {\n runtimeChunk: false,\n },\n experiments: {\n outputModule: true,\n },\n resolve: {\n alias: {\n ...sharedMappings.getAliases(),\n },\n },\n plugins: [\n new ModuleFederationPlugin({\n name: 'remote1',\n filename: 'remoteEntry.js',\n exposes: {\n './Module': 'apps/remote1/src/app/remote-entry/entry.module.ts',\n },\n shared: share({\n '@angular/core': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n '@angular/common': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n '@angular/common/http': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n '@angular/router': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n rxjs: {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n ...sharedMappings.getDescriptors(),\n }),\n library: {\n type: 'module',\n },\n }),\n sharedMappings.getPlugin(),\n ],\n};\n";
|
|
5
|
+
export declare const ERROR_SHARED_PACKAGES_DOESNT_MATCH = "const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');\nconst mf = require('@angular-architects/module-federation/webpack');\nconst path = require('path');\nconst share = mf.share;\n\n/**\n * We use the NX_TSCONFIG_PATH environment variable when using the @nrwl/angular:webpack-browser\n * builder as it will generate a temporary tsconfig file which contains any required remappings of\n * shared libraries.\n * A remapping will occur when a library is buildable, as webpack needs to know the location of the\n * built files for the buildable library.\n * This NX_TSCONFIG_PATH environment variable is set by the @nrwl/angular:webpack-browser and it contains\n * the location of the generated temporary tsconfig file.\n */\nconst tsConfigPath =\n process.env.NX_TSCONFIG_PATH ??\n path.join(__dirname, '../../tsconfig.base.json');\n\nconst workspaceRootPath = path.join(__dirname, '../../');\nconst sharedMappings = new mf.SharedMappings();\nsharedMappings.register(\n tsConfigPath,\n [\n /* mapped paths to share */\n ],\n workspaceRootPath\n);\n\nmodule.exports = {\n output: {\n uniqueName: 'host1',\n publicPath: 'auto',\n },\n optimization: {\n runtimeChunk: false,\n },\n experiments: {\n outputModule: true,\n },\n resolve: {\n alias: {\n ...sharedMappings.getAliases(),\n },\n },\n plugins: [\n new ModuleFederationPlugin({\n remotes: {\n remote1: 'http://localhost:4201/remoteEntry.mjs',\n },\n shared: share({\n '@angular/core': {\n singleton: true,\n strictVersion: true,\n requiredVersion: '13.0.0',\n includeSecondaries: true,\n },\n '@angular/common': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n '@angular/common/http': {\n singleton: true,\n strictVersion: false,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n '@angular/router': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n rxjs: {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n ...sharedMappings.getDescriptors(),\n }),\n library: {\n type: 'module',\n },\n }),\n sharedMappings.getPlugin(),\n ],\n};\n";
|
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ERROR_SHARED_PACKAGES_DOESNT_MATCH = exports.ERROR_NAME_DOESNT_MATCH = exports.OLD_OBJECT_SHARED_SYNTAX = exports.STANDARD_REMOTE_MFE_CONFIG = exports.STANDARD_HOST_MFE_CONFIG = void 0;
|
|
4
|
+
exports.STANDARD_HOST_MFE_CONFIG = `const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');
|
|
5
|
+
const mf = require('@angular-architects/module-federation/webpack');
|
|
6
|
+
const path = require('path');
|
|
7
|
+
const share = mf.share;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* We use the NX_TSCONFIG_PATH environment variable when using the @nrwl/angular:webpack-browser
|
|
11
|
+
* builder as it will generate a temporary tsconfig file which contains any required remappings of
|
|
12
|
+
* shared libraries.
|
|
13
|
+
* A remapping will occur when a library is buildable, as webpack needs to know the location of the
|
|
14
|
+
* built files for the buildable library.
|
|
15
|
+
* This NX_TSCONFIG_PATH environment variable is set by the @nrwl/angular:webpack-browser and it contains
|
|
16
|
+
* the location of the generated temporary tsconfig file.
|
|
17
|
+
*/
|
|
18
|
+
const tsConfigPath =
|
|
19
|
+
process.env.NX_TSCONFIG_PATH ??
|
|
20
|
+
path.join(__dirname, '../../tsconfig.base.json');
|
|
21
|
+
|
|
22
|
+
const workspaceRootPath = path.join(__dirname, '../../');
|
|
23
|
+
const sharedMappings = new mf.SharedMappings();
|
|
24
|
+
sharedMappings.register(
|
|
25
|
+
tsConfigPath,
|
|
26
|
+
[
|
|
27
|
+
/* mapped paths to share */
|
|
28
|
+
],
|
|
29
|
+
workspaceRootPath
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
module.exports = {
|
|
33
|
+
output: {
|
|
34
|
+
uniqueName: 'host1',
|
|
35
|
+
publicPath: 'auto',
|
|
36
|
+
},
|
|
37
|
+
optimization: {
|
|
38
|
+
runtimeChunk: false,
|
|
39
|
+
},
|
|
40
|
+
experiments: {
|
|
41
|
+
outputModule: true,
|
|
42
|
+
},
|
|
43
|
+
resolve: {
|
|
44
|
+
alias: {
|
|
45
|
+
...sharedMappings.getAliases(),
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
plugins: [
|
|
49
|
+
new ModuleFederationPlugin({
|
|
50
|
+
remotes: {
|
|
51
|
+
remote1: 'http://localhost:4201/remoteEntry.mjs',
|
|
52
|
+
},
|
|
53
|
+
shared: share({
|
|
54
|
+
'@angular/core': {
|
|
55
|
+
singleton: true,
|
|
56
|
+
strictVersion: true,
|
|
57
|
+
requiredVersion: 'auto',
|
|
58
|
+
includeSecondaries: true,
|
|
59
|
+
},
|
|
60
|
+
'@angular/common': {
|
|
61
|
+
singleton: true,
|
|
62
|
+
strictVersion: true,
|
|
63
|
+
requiredVersion: 'auto',
|
|
64
|
+
includeSecondaries: true,
|
|
65
|
+
},
|
|
66
|
+
'@angular/common/http': {
|
|
67
|
+
singleton: true,
|
|
68
|
+
strictVersion: true,
|
|
69
|
+
requiredVersion: 'auto',
|
|
70
|
+
includeSecondaries: true,
|
|
71
|
+
},
|
|
72
|
+
'@angular/router': {
|
|
73
|
+
singleton: true,
|
|
74
|
+
strictVersion: true,
|
|
75
|
+
requiredVersion: 'auto',
|
|
76
|
+
includeSecondaries: true,
|
|
77
|
+
},
|
|
78
|
+
rxjs: {
|
|
79
|
+
singleton: true,
|
|
80
|
+
strictVersion: true,
|
|
81
|
+
requiredVersion: 'auto',
|
|
82
|
+
includeSecondaries: true,
|
|
83
|
+
},
|
|
84
|
+
...sharedMappings.getDescriptors(),
|
|
85
|
+
}),
|
|
86
|
+
library: {
|
|
87
|
+
type: 'module',
|
|
88
|
+
},
|
|
89
|
+
}),
|
|
90
|
+
sharedMappings.getPlugin(),
|
|
91
|
+
],
|
|
92
|
+
};
|
|
93
|
+
`;
|
|
94
|
+
exports.STANDARD_REMOTE_MFE_CONFIG = `const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');
|
|
95
|
+
const mf = require('@angular-architects/module-federation/webpack');
|
|
96
|
+
const path = require('path');
|
|
97
|
+
const share = mf.share;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* We use the NX_TSCONFIG_PATH environment variable when using the @nrwl/angular:webpack-browser
|
|
101
|
+
* builder as it will generate a temporary tsconfig file which contains any required remappings of
|
|
102
|
+
* shared libraries.
|
|
103
|
+
* A remapping will occur when a library is buildable, as webpack needs to know the location of the
|
|
104
|
+
* built files for the buildable library.
|
|
105
|
+
* This NX_TSCONFIG_PATH environment variable is set by the @nrwl/angular:webpack-browser and it contains
|
|
106
|
+
* the location of the generated temporary tsconfig file.
|
|
107
|
+
*/
|
|
108
|
+
const tsConfigPath =
|
|
109
|
+
process.env.NX_TSCONFIG_PATH ??
|
|
110
|
+
path.join(__dirname, '../../tsconfig.base.json');
|
|
111
|
+
|
|
112
|
+
const workspaceRootPath = path.join(__dirname, '../../');
|
|
113
|
+
const sharedMappings = new mf.SharedMappings();
|
|
114
|
+
sharedMappings.register(
|
|
115
|
+
tsConfigPath,
|
|
116
|
+
[
|
|
117
|
+
/* mapped paths to share */
|
|
118
|
+
],
|
|
119
|
+
workspaceRootPath
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
module.exports = {
|
|
123
|
+
output: {
|
|
124
|
+
uniqueName: 'remote1',
|
|
125
|
+
publicPath: 'auto',
|
|
126
|
+
},
|
|
127
|
+
optimization: {
|
|
128
|
+
runtimeChunk: false,
|
|
129
|
+
},
|
|
130
|
+
experiments: {
|
|
131
|
+
outputModule: true,
|
|
132
|
+
},
|
|
133
|
+
resolve: {
|
|
134
|
+
alias: {
|
|
135
|
+
...sharedMappings.getAliases(),
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
plugins: [
|
|
139
|
+
new ModuleFederationPlugin({
|
|
140
|
+
name: 'remote1',
|
|
141
|
+
filename: 'remoteEntry.js',
|
|
142
|
+
exposes: {
|
|
143
|
+
'./Module': 'apps/remote1/src/app/remote-entry/entry.module.ts',
|
|
144
|
+
},
|
|
145
|
+
shared: share({
|
|
146
|
+
'@angular/core': {
|
|
147
|
+
singleton: true,
|
|
148
|
+
strictVersion: true,
|
|
149
|
+
requiredVersion: 'auto',
|
|
150
|
+
includeSecondaries: true,
|
|
151
|
+
},
|
|
152
|
+
'@angular/common': {
|
|
153
|
+
singleton: true,
|
|
154
|
+
strictVersion: true,
|
|
155
|
+
requiredVersion: 'auto',
|
|
156
|
+
includeSecondaries: true,
|
|
157
|
+
},
|
|
158
|
+
'@angular/common/http': {
|
|
159
|
+
singleton: true,
|
|
160
|
+
strictVersion: true,
|
|
161
|
+
requiredVersion: 'auto',
|
|
162
|
+
includeSecondaries: true,
|
|
163
|
+
},
|
|
164
|
+
'@angular/router': {
|
|
165
|
+
singleton: true,
|
|
166
|
+
strictVersion: true,
|
|
167
|
+
requiredVersion: 'auto',
|
|
168
|
+
includeSecondaries: true,
|
|
169
|
+
},
|
|
170
|
+
rxjs: {
|
|
171
|
+
singleton: true,
|
|
172
|
+
strictVersion: true,
|
|
173
|
+
requiredVersion: 'auto',
|
|
174
|
+
includeSecondaries: true,
|
|
175
|
+
},
|
|
176
|
+
...sharedMappings.getDescriptors(),
|
|
177
|
+
}),
|
|
178
|
+
library: {
|
|
179
|
+
type: 'module',
|
|
180
|
+
},
|
|
181
|
+
}),
|
|
182
|
+
sharedMappings.getPlugin(),
|
|
183
|
+
],
|
|
184
|
+
};
|
|
185
|
+
`;
|
|
186
|
+
exports.OLD_OBJECT_SHARED_SYNTAX = `const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');
|
|
187
|
+
const mf = require('@angular-architects/module-federation/webpack');
|
|
188
|
+
const path = require('path');
|
|
189
|
+
const share = mf.share;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* We use the NX_TSCONFIG_PATH environment variable when using the @nrwl/angular:webpack-browser
|
|
193
|
+
* builder as it will generate a temporary tsconfig file which contains any required remappings of
|
|
194
|
+
* shared libraries.
|
|
195
|
+
* A remapping will occur when a library is buildable, as webpack needs to know the location of the
|
|
196
|
+
* built files for the buildable library.
|
|
197
|
+
* This NX_TSCONFIG_PATH environment variable is set by the @nrwl/angular:webpack-browser and it contains
|
|
198
|
+
* the location of the generated temporary tsconfig file.
|
|
199
|
+
*/
|
|
200
|
+
const tsConfigPath =
|
|
201
|
+
process.env.NX_TSCONFIG_PATH ??
|
|
202
|
+
path.join(__dirname, '../../tsconfig.base.json');
|
|
203
|
+
|
|
204
|
+
const workspaceRootPath = path.join(__dirname, '../../');
|
|
205
|
+
const sharedMappings = new mf.SharedMappings();
|
|
206
|
+
sharedMappings.register(
|
|
207
|
+
tsConfigPath,
|
|
208
|
+
[
|
|
209
|
+
/* mapped paths to share */
|
|
210
|
+
],
|
|
211
|
+
workspaceRootPath
|
|
212
|
+
);
|
|
213
|
+
|
|
214
|
+
module.exports = {
|
|
215
|
+
output: {
|
|
216
|
+
uniqueName: 'remote1',
|
|
217
|
+
publicPath: 'auto',
|
|
218
|
+
},
|
|
219
|
+
optimization: {
|
|
220
|
+
runtimeChunk: false,
|
|
221
|
+
},
|
|
222
|
+
experiments: {
|
|
223
|
+
outputModule: true,
|
|
224
|
+
},
|
|
225
|
+
resolve: {
|
|
226
|
+
alias: {
|
|
227
|
+
...sharedMappings.getAliases(),
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
plugins: [
|
|
231
|
+
new ModuleFederationPlugin({
|
|
232
|
+
name: 'remote1',
|
|
233
|
+
filename: 'remoteEntry.js',
|
|
234
|
+
exposes: {
|
|
235
|
+
'./Module': 'apps/remote1/src/app/remote-entry/entry.module.ts',
|
|
236
|
+
},
|
|
237
|
+
shared: {
|
|
238
|
+
'@angular/core': {
|
|
239
|
+
singleton: true,
|
|
240
|
+
strictVersion: true,
|
|
241
|
+
},
|
|
242
|
+
'@angular/common': {
|
|
243
|
+
singleton: true,
|
|
244
|
+
strictVersion: true,
|
|
245
|
+
},
|
|
246
|
+
'@angular/common/http': {
|
|
247
|
+
singleton: true,
|
|
248
|
+
strictVersion: true,
|
|
249
|
+
},
|
|
250
|
+
'@angular/router': {
|
|
251
|
+
singleton: true,
|
|
252
|
+
strictVersion: true,
|
|
253
|
+
},
|
|
254
|
+
rxjs: {
|
|
255
|
+
singleton: true,
|
|
256
|
+
strictVersion: true,
|
|
257
|
+
},
|
|
258
|
+
...sharedMappings.getDescriptors(),
|
|
259
|
+
},
|
|
260
|
+
library: {
|
|
261
|
+
type: 'module',
|
|
262
|
+
},
|
|
263
|
+
}),
|
|
264
|
+
sharedMappings.getPlugin(),
|
|
265
|
+
],
|
|
266
|
+
};`;
|
|
267
|
+
exports.ERROR_NAME_DOESNT_MATCH = `const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');
|
|
268
|
+
const mf = require('@angular-architects/module-federation/webpack');
|
|
269
|
+
const path = require('path');
|
|
270
|
+
const share = mf.share;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* We use the NX_TSCONFIG_PATH environment variable when using the @nrwl/angular:webpack-browser
|
|
274
|
+
* builder as it will generate a temporary tsconfig file which contains any required remappings of
|
|
275
|
+
* shared libraries.
|
|
276
|
+
* A remapping will occur when a library is buildable, as webpack needs to know the location of the
|
|
277
|
+
* built files for the buildable library.
|
|
278
|
+
* This NX_TSCONFIG_PATH environment variable is set by the @nrwl/angular:webpack-browser and it contains
|
|
279
|
+
* the location of the generated temporary tsconfig file.
|
|
280
|
+
*/
|
|
281
|
+
const tsConfigPath =
|
|
282
|
+
process.env.NX_TSCONFIG_PATH ??
|
|
283
|
+
path.join(__dirname, '../../tsconfig.base.json');
|
|
284
|
+
|
|
285
|
+
const workspaceRootPath = path.join(__dirname, '../../');
|
|
286
|
+
const sharedMappings = new mf.SharedMappings();
|
|
287
|
+
sharedMappings.register(
|
|
288
|
+
tsConfigPath,
|
|
289
|
+
[
|
|
290
|
+
/* mapped paths to share */
|
|
291
|
+
],
|
|
292
|
+
workspaceRootPath
|
|
293
|
+
);
|
|
294
|
+
|
|
295
|
+
module.exports = {
|
|
296
|
+
output: {
|
|
297
|
+
uniqueName: 'somethingelse',
|
|
298
|
+
publicPath: 'auto',
|
|
299
|
+
},
|
|
300
|
+
optimization: {
|
|
301
|
+
runtimeChunk: false,
|
|
302
|
+
},
|
|
303
|
+
experiments: {
|
|
304
|
+
outputModule: true,
|
|
305
|
+
},
|
|
306
|
+
resolve: {
|
|
307
|
+
alias: {
|
|
308
|
+
...sharedMappings.getAliases(),
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
plugins: [
|
|
312
|
+
new ModuleFederationPlugin({
|
|
313
|
+
name: 'remote1',
|
|
314
|
+
filename: 'remoteEntry.js',
|
|
315
|
+
exposes: {
|
|
316
|
+
'./Module': 'apps/remote1/src/app/remote-entry/entry.module.ts',
|
|
317
|
+
},
|
|
318
|
+
shared: share({
|
|
319
|
+
'@angular/core': {
|
|
320
|
+
singleton: true,
|
|
321
|
+
strictVersion: true,
|
|
322
|
+
requiredVersion: 'auto',
|
|
323
|
+
includeSecondaries: true,
|
|
324
|
+
},
|
|
325
|
+
'@angular/common': {
|
|
326
|
+
singleton: true,
|
|
327
|
+
strictVersion: true,
|
|
328
|
+
requiredVersion: 'auto',
|
|
329
|
+
includeSecondaries: true,
|
|
330
|
+
},
|
|
331
|
+
'@angular/common/http': {
|
|
332
|
+
singleton: true,
|
|
333
|
+
strictVersion: true,
|
|
334
|
+
requiredVersion: 'auto',
|
|
335
|
+
includeSecondaries: true,
|
|
336
|
+
},
|
|
337
|
+
'@angular/router': {
|
|
338
|
+
singleton: true,
|
|
339
|
+
strictVersion: true,
|
|
340
|
+
requiredVersion: 'auto',
|
|
341
|
+
includeSecondaries: true,
|
|
342
|
+
},
|
|
343
|
+
rxjs: {
|
|
344
|
+
singleton: true,
|
|
345
|
+
strictVersion: true,
|
|
346
|
+
requiredVersion: 'auto',
|
|
347
|
+
includeSecondaries: true,
|
|
348
|
+
},
|
|
349
|
+
...sharedMappings.getDescriptors(),
|
|
350
|
+
}),
|
|
351
|
+
library: {
|
|
352
|
+
type: 'module',
|
|
353
|
+
},
|
|
354
|
+
}),
|
|
355
|
+
sharedMappings.getPlugin(),
|
|
356
|
+
],
|
|
357
|
+
};
|
|
358
|
+
`;
|
|
359
|
+
exports.ERROR_SHARED_PACKAGES_DOESNT_MATCH = `const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');
|
|
360
|
+
const mf = require('@angular-architects/module-federation/webpack');
|
|
361
|
+
const path = require('path');
|
|
362
|
+
const share = mf.share;
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* We use the NX_TSCONFIG_PATH environment variable when using the @nrwl/angular:webpack-browser
|
|
366
|
+
* builder as it will generate a temporary tsconfig file which contains any required remappings of
|
|
367
|
+
* shared libraries.
|
|
368
|
+
* A remapping will occur when a library is buildable, as webpack needs to know the location of the
|
|
369
|
+
* built files for the buildable library.
|
|
370
|
+
* This NX_TSCONFIG_PATH environment variable is set by the @nrwl/angular:webpack-browser and it contains
|
|
371
|
+
* the location of the generated temporary tsconfig file.
|
|
372
|
+
*/
|
|
373
|
+
const tsConfigPath =
|
|
374
|
+
process.env.NX_TSCONFIG_PATH ??
|
|
375
|
+
path.join(__dirname, '../../tsconfig.base.json');
|
|
376
|
+
|
|
377
|
+
const workspaceRootPath = path.join(__dirname, '../../');
|
|
378
|
+
const sharedMappings = new mf.SharedMappings();
|
|
379
|
+
sharedMappings.register(
|
|
380
|
+
tsConfigPath,
|
|
381
|
+
[
|
|
382
|
+
/* mapped paths to share */
|
|
383
|
+
],
|
|
384
|
+
workspaceRootPath
|
|
385
|
+
);
|
|
386
|
+
|
|
387
|
+
module.exports = {
|
|
388
|
+
output: {
|
|
389
|
+
uniqueName: 'host1',
|
|
390
|
+
publicPath: 'auto',
|
|
391
|
+
},
|
|
392
|
+
optimization: {
|
|
393
|
+
runtimeChunk: false,
|
|
394
|
+
},
|
|
395
|
+
experiments: {
|
|
396
|
+
outputModule: true,
|
|
397
|
+
},
|
|
398
|
+
resolve: {
|
|
399
|
+
alias: {
|
|
400
|
+
...sharedMappings.getAliases(),
|
|
401
|
+
},
|
|
402
|
+
},
|
|
403
|
+
plugins: [
|
|
404
|
+
new ModuleFederationPlugin({
|
|
405
|
+
remotes: {
|
|
406
|
+
remote1: 'http://localhost:4201/remoteEntry.mjs',
|
|
407
|
+
},
|
|
408
|
+
shared: share({
|
|
409
|
+
'@angular/core': {
|
|
410
|
+
singleton: true,
|
|
411
|
+
strictVersion: true,
|
|
412
|
+
requiredVersion: '13.0.0',
|
|
413
|
+
includeSecondaries: true,
|
|
414
|
+
},
|
|
415
|
+
'@angular/common': {
|
|
416
|
+
singleton: true,
|
|
417
|
+
strictVersion: true,
|
|
418
|
+
requiredVersion: 'auto',
|
|
419
|
+
includeSecondaries: true,
|
|
420
|
+
},
|
|
421
|
+
'@angular/common/http': {
|
|
422
|
+
singleton: true,
|
|
423
|
+
strictVersion: false,
|
|
424
|
+
requiredVersion: 'auto',
|
|
425
|
+
includeSecondaries: true,
|
|
426
|
+
},
|
|
427
|
+
'@angular/router': {
|
|
428
|
+
singleton: true,
|
|
429
|
+
strictVersion: true,
|
|
430
|
+
requiredVersion: 'auto',
|
|
431
|
+
includeSecondaries: true,
|
|
432
|
+
},
|
|
433
|
+
rxjs: {
|
|
434
|
+
singleton: true,
|
|
435
|
+
strictVersion: true,
|
|
436
|
+
requiredVersion: 'auto',
|
|
437
|
+
includeSecondaries: true,
|
|
438
|
+
},
|
|
439
|
+
...sharedMappings.getDescriptors(),
|
|
440
|
+
}),
|
|
441
|
+
library: {
|
|
442
|
+
type: 'module',
|
|
443
|
+
},
|
|
444
|
+
}),
|
|
445
|
+
sharedMappings.getPlugin(),
|
|
446
|
+
],
|
|
447
|
+
};
|
|
448
|
+
`;
|
|
449
|
+
//# sourceMappingURL=convert-to-with-mf.test-data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-to-with-mf.test-data.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.test-data.ts"],"names":[],"mappings":";;;AAAa,QAAA,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyFvC,CAAC;AAEW,QAAA,0BAA0B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2FzC,CAAC;AAEW,QAAA,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgFrC,CAAC;AAES,QAAA,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2FtC,CAAC;AAEW,QAAA,kCAAkC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyFjD,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkOutputNameMatchesProjectName = void 0;
|
|
4
|
+
const tsquery_1 = require("@phenomnomnominal/tsquery");
|
|
5
|
+
function checkOutputNameMatchesProjectName(ast, projectName) {
|
|
6
|
+
const OUTPUT_SELECTOR = 'PropertyAssignment:has(Identifier[name=output]) > ObjectLiteralExpression:has(PropertyAssignment:has(Identifier[name=uniqueName]))';
|
|
7
|
+
const UNIQUENAME_SELECTOR = 'ObjectLiteralExpression > PropertyAssignment:has(Identifier[name=uniqueName]) > StringLiteral';
|
|
8
|
+
const outputNodes = (0, tsquery_1.tsquery)(ast, OUTPUT_SELECTOR, { visitAllChildren: true });
|
|
9
|
+
if (outputNodes.length === 0) {
|
|
10
|
+
// If the output isnt set in the config, then we can still set the project name correctly
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
const uniqueNameNodes = (0, tsquery_1.tsquery)(outputNodes[0], UNIQUENAME_SELECTOR, {
|
|
14
|
+
visitAllChildren: true,
|
|
15
|
+
});
|
|
16
|
+
if (uniqueNameNodes.length === 0) {
|
|
17
|
+
// If the uniqeName isnt set in the config, then we can still set the project name correctly
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
const uniqueName = uniqueNameNodes[0].getText().replace(/'/g, '');
|
|
21
|
+
return uniqueName === projectName;
|
|
22
|
+
}
|
|
23
|
+
exports.checkOutputNameMatchesProjectName = checkOutputNameMatchesProjectName;
|
|
24
|
+
//# sourceMappingURL=check-name-matches.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-name-matches.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/convert-to-with-mf/lib/check-name-matches.ts"],"names":[],"mappings":";;;AACA,uDAAoD;AAEpD,SAAgB,iCAAiC,CAC/C,GAAe,EACf,WAAmB;IAEnB,MAAM,eAAe,GACnB,oIAAoI,CAAC;IACvI,MAAM,mBAAmB,GACvB,+FAA+F,CAAC;IAElG,MAAM,WAAW,GAAG,IAAA,iBAAO,EAAC,GAAG,EAAE,eAAe,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9E,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;QAC5B,yFAAyF;QACzF,OAAO,IAAI,CAAC;KACb;IAED,MAAM,eAAe,GAAG,IAAA,iBAAO,EAAC,WAAW,CAAC,CAAC,CAAC,EAAE,mBAAmB,EAAE;QACnE,gBAAgB,EAAE,IAAI;KACvB,CAAC,CAAC;IACH,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE;QAChC,4FAA4F;QAC5F,OAAO,IAAI,CAAC;KACb;IACD,MAAM,UAAU,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAElE,OAAO,UAAU,KAAK,WAAW,CAAC;AACpC,CAAC;AAzBD,8EAyBC"}
|