@angular-architects/native-federation 0.9.0 → 0.9.2

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 (53) hide show
  1. package/README.md +314 -259
  2. package/builders.json +10 -10
  3. package/collection.json +17 -17
  4. package/executors.json +10 -10
  5. package/generators.json +12 -12
  6. package/package.json +19 -9
  7. package/src/builders/build/builder.js +99 -177
  8. package/src/builders/build/builder.js.map +1 -1
  9. package/src/builders/build/schema.d.ts +3 -3
  10. package/src/builders/build/schema.json +550 -550
  11. package/src/config.d.ts +2 -2
  12. package/src/config.js +7 -7
  13. package/src/config.js.map +1 -1
  14. package/src/executors/build/schema.d.ts +1 -1
  15. package/src/executors/build/schema.json +9 -9
  16. package/src/generators/native-federation/schema.d.ts +5 -5
  17. package/src/generators/native-federation/schema.json +29 -29
  18. package/src/index.d.ts +1 -1
  19. package/src/index.js +1 -1
  20. package/src/index.js.map +1 -1
  21. package/src/schematics/init/files/{federation.config.js → federation.config.js__tmpl__} +0 -4
  22. package/src/schematics/init/schema.d.ts +6 -6
  23. package/src/schematics/init/schema.json +34 -34
  24. package/src/schematics/init/schematic.js +35 -29
  25. package/src/schematics/init/schematic.js.map +1 -1
  26. package/src/utils/angular-esbuild-adapter.d.ts +3 -0
  27. package/src/utils/angular-esbuild-adapter.js +88 -0
  28. package/src/utils/angular-esbuild-adapter.js.map +1 -0
  29. package/src/utils/rollup.d.ts +1 -0
  30. package/src/utils/rollup.js +58 -0
  31. package/src/utils/rollup.js.map +1 -0
  32. package/src/utils/shared-mappings-plugin.d.ts +1 -1
  33. package/src/config/federation-config.d.ts +0 -26
  34. package/src/config/federation-config.js +0 -3
  35. package/src/config/federation-config.js.map +0 -1
  36. package/src/config/index.d.ts +0 -2
  37. package/src/config/index.js +0 -10
  38. package/src/config/index.js.map +0 -1
  39. package/src/config/with-native-federation.d.ts +0 -2
  40. package/src/config/with-native-federation.js +0 -53
  41. package/src/config/with-native-federation.js.map +0 -1
  42. package/src/utils/build-utils.d.ts +0 -9
  43. package/src/utils/build-utils.js +0 -38
  44. package/src/utils/build-utils.js.map +0 -1
  45. package/src/utils/hash-file.d.ts +0 -1
  46. package/src/utils/hash-file.js +0 -13
  47. package/src/utils/hash-file.js.map +0 -1
  48. package/src/utils/mapped-paths.d.ts +0 -10
  49. package/src/utils/mapped-paths.js +0 -37
  50. package/src/utils/mapped-paths.js.map +0 -1
  51. package/src/utils/package-info.d.ts +0 -7
  52. package/src/utils/package-info.js +0 -94
  53. package/src/utils/package-info.js.map +0 -1
package/src/config.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from './config/with-native-federation';
2
- export { findRootTsConfigJson, share, shareAll, } from '@angular-architects/module-federation/webpack';
1
+ export { withNativeFederation } from '@softarc/native-federation/build';
2
+ export { findRootTsConfigJson, share, shareAll, } from '@softarc/native-federation/build';
package/src/config.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.shareAll = exports.share = exports.findRootTsConfigJson = void 0;
4
- const tslib_1 = require("tslib");
5
- tslib_1.__exportStar(require("./config/with-native-federation"), exports);
6
- var webpack_1 = require("@angular-architects/module-federation/webpack");
7
- Object.defineProperty(exports, "findRootTsConfigJson", { enumerable: true, get: function () { return webpack_1.findRootTsConfigJson; } });
8
- Object.defineProperty(exports, "share", { enumerable: true, get: function () { return webpack_1.share; } });
9
- Object.defineProperty(exports, "shareAll", { enumerable: true, get: function () { return webpack_1.shareAll; } });
3
+ exports.shareAll = exports.share = exports.findRootTsConfigJson = exports.withNativeFederation = void 0;
4
+ var build_1 = require("@softarc/native-federation/build");
5
+ Object.defineProperty(exports, "withNativeFederation", { enumerable: true, get: function () { return build_1.withNativeFederation; } });
6
+ var build_2 = require("@softarc/native-federation/build");
7
+ Object.defineProperty(exports, "findRootTsConfigJson", { enumerable: true, get: function () { return build_2.findRootTsConfigJson; } });
8
+ Object.defineProperty(exports, "share", { enumerable: true, get: function () { return build_2.share; } });
9
+ Object.defineProperty(exports, "shareAll", { enumerable: true, get: function () { return build_2.shareAll; } });
10
10
  //# sourceMappingURL=config.js.map
package/src/config.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../libs/native-federation/src/config.ts"],"names":[],"mappings":";;;;AAAA,0EAAgD;AAChD,yEAIuD;AAHrD,+GAAA,oBAAoB,OAAA;AACpB,gGAAA,KAAK,OAAA;AACL,mGAAA,QAAQ,OAAA"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../libs/native-federation/src/config.ts"],"names":[],"mappings":";;;AAAA,0DAAwE;AAA/D,6GAAA,oBAAoB,OAAA;AAC7B,0DAI0C;AAHxC,6GAAA,oBAAoB,OAAA;AACpB,8FAAA,KAAK,OAAA;AACL,iGAAA,QAAQ,OAAA"}
@@ -1 +1 @@
1
- export interface BuildExecutorSchema {} // eslint-disable-line
1
+ export interface BuildExecutorSchema {} // eslint-disable-line
@@ -1,9 +1,9 @@
1
- {
2
- "$schema": "http://json-schema.org/schema",
3
- "cli": "nx",
4
- "title": "Build executor",
5
- "description": "",
6
- "type": "object",
7
- "properties": {},
8
- "required": []
9
- }
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "cli": "nx",
4
+ "title": "Build executor",
5
+ "description": "",
6
+ "type": "object",
7
+ "properties": {},
8
+ "required": []
9
+ }
@@ -1,5 +1,5 @@
1
- export interface NativeFederationGeneratorSchema {
2
- name: string;
3
- tags?: string;
4
- directory?: string;
5
- }
1
+ export interface NativeFederationGeneratorSchema {
2
+ name: string;
3
+ tags?: string;
4
+ directory?: string;
5
+ }
@@ -1,29 +1,29 @@
1
- {
2
- "$schema": "http://json-schema.org/schema",
3
- "cli": "nx",
4
- "$id": "NativeFederation",
5
- "title": "",
6
- "type": "object",
7
- "properties": {
8
- "name": {
9
- "type": "string",
10
- "description": "",
11
- "$default": {
12
- "$source": "argv",
13
- "index": 0
14
- },
15
- "x-prompt": "What name would you like to use?"
16
- },
17
- "tags": {
18
- "type": "string",
19
- "description": "Add tags to the project (used for linting)",
20
- "alias": "t"
21
- },
22
- "directory": {
23
- "type": "string",
24
- "description": "A directory where the project is placed",
25
- "alias": "d"
26
- }
27
- },
28
- "required": ["name"]
29
- }
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "cli": "nx",
4
+ "$id": "NativeFederation",
5
+ "title": "",
6
+ "type": "object",
7
+ "properties": {
8
+ "name": {
9
+ "type": "string",
10
+ "description": "",
11
+ "$default": {
12
+ "$source": "argv",
13
+ "index": 0
14
+ },
15
+ "x-prompt": "What name would you like to use?"
16
+ },
17
+ "tags": {
18
+ "type": "string",
19
+ "description": "Add tags to the project (used for linting)",
20
+ "alias": "t"
21
+ },
22
+ "directory": {
23
+ "type": "string",
24
+ "description": "A directory where the project is placed",
25
+ "alias": "d"
26
+ }
27
+ },
28
+ "required": ["name"]
29
+ }
package/src/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from '@angular-architects/native-federation-runtime';
1
+ export * from '@softarc/native-federation-runtime';
package/src/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("@angular-architects/native-federation-runtime"), exports);
4
+ tslib_1.__exportStar(require("@softarc/native-federation-runtime"), exports);
5
5
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/native-federation/src/index.ts"],"names":[],"mappings":";;;AAAA,wFAA8D"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/native-federation/src/index.ts"],"names":[],"mappings":";;;AAAA,6EAAmD"}
@@ -7,10 +7,6 @@ module.exports = withNativeFederation({
7
7
  exposes: {
8
8
  './Component': './<%=projectSourceRoot%>/app/app.component.ts',
9
9
  },
10
- <% } else if (type === 'host') { %>
11
- remotes: {<% for (key in remoteMap) { %>
12
- "<%=key%>": "<%=remoteMap[key]%>",<% } %>
13
- },
14
10
  <% } %>
15
11
  shared: {
16
12
  ...shareAll({ singleton: true, strictVersion: true, requiredVersion: 'auto' }),
@@ -1,6 +1,6 @@
1
- export interface MfSchematicSchema {
2
- project: string;
3
- port: string;
4
- nxBuilders: boolean | undefined;
5
- type: 'host' | 'dynamic-host' | 'remote';
6
- }
1
+ export interface MfSchematicSchema {
2
+ project: string;
3
+ port: string;
4
+ nxBuilders: boolean | undefined;
5
+ type: 'host' | 'dynamic-host' | 'remote';
6
+ }
@@ -1,34 +1,34 @@
1
- {
2
- "$schema": "http://json-schema.org/schema",
3
- "$id": "mf",
4
- "title": "",
5
- "type": "object",
6
- "properties": {
7
- "project": {
8
- "type": "string",
9
- "description": "The project to add module federation",
10
- "$default": {
11
- "$source": "argv",
12
- "index": 0
13
- },
14
- "x-prompt": "Project name (press enter for default project)"
15
- },
16
- "port": {
17
- "type": "number",
18
- "description": "The port to use for the federated module (remote, micro frontend, etc.)",
19
- "$default": {
20
- "$source": "argv",
21
- "index": 1
22
- }
23
- },
24
- "type": {
25
- "enum": ["host", "dynamic-host", "remote"],
26
- "type": "string",
27
- "default": "remote"
28
- },
29
- "nxBuilders": {
30
- "type": "boolean",
31
- "description": "Use builders provided by Nx instead of ngx-build-plus? Defaults to true for Nx workspaces and false for CLI workspaces."
32
- }
33
- }
34
- }
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "mf",
4
+ "title": "",
5
+ "type": "object",
6
+ "properties": {
7
+ "project": {
8
+ "type": "string",
9
+ "description": "The project to add module federation",
10
+ "$default": {
11
+ "$source": "argv",
12
+ "index": 0
13
+ },
14
+ "x-prompt": "Project name (press enter for default project)"
15
+ },
16
+ "port": {
17
+ "type": "number",
18
+ "description": "The port to use for the federated module (remote, micro frontend, etc.)",
19
+ "$default": {
20
+ "$source": "argv",
21
+ "index": 1
22
+ }
23
+ },
24
+ "type": {
25
+ "enum": ["host", "dynamic-host", "remote"],
26
+ "type": "string",
27
+ "default": "remote"
28
+ },
29
+ "nxBuilders": {
30
+ "type": "boolean",
31
+ "description": "Use builders provided by Nx instead of ngx-build-plus? Defaults to true for Nx workspaces and false for CLI workspaces."
32
+ }
33
+ }
34
+ }
@@ -12,7 +12,7 @@ function config(options) {
12
12
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
13
13
  const workspaceFileName = getWorkspaceFileName(tree);
14
14
  const workspace = JSON.parse(tree.read(workspaceFileName).toString('utf8'));
15
- const { polyfills, projectName, projectRoot, projectSourceRoot, manifestPath, projectConfig, main } = normalizeOptions(options, workspace);
15
+ const { polyfills, projectName, projectRoot, projectSourceRoot, manifestPath, projectConfig, main, } = normalizeOptions(options, workspace);
16
16
  updatePolyfills(tree, polyfills);
17
17
  const remoteMap = yield generateRemoteMap(workspace, projectName);
18
18
  if (options.type === 'dynamic-host') {
@@ -27,10 +27,7 @@ function config(options) {
27
27
  overwrite: false,
28
28
  });
29
29
  context.addTask(new tasks_1.NodePackageInstallTask());
30
- return (0, schematics_1.chain)([
31
- generateRule,
32
- makeMainAsync(main, options, remoteMap),
33
- ]);
30
+ return (0, schematics_1.chain)([generateRule, makeMainAsync(main, options, remoteMap)]);
34
31
  });
35
32
  };
36
33
  }
@@ -40,7 +37,7 @@ function updateWorkspaceConfig(projectConfig, tree, workspaceFileName, workspace
40
37
  if (!((_a = projectConfig === null || projectConfig === void 0 ? void 0 : projectConfig.architect) === null || _a === void 0 ? void 0 : _a.build) || !((_b = projectConfig === null || projectConfig === void 0 ? void 0 : projectConfig.architect) === null || _b === void 0 ? void 0 : _b.serve)) {
41
38
  throw new Error(`The project doen't have a build or serve target in angular.json!`);
42
39
  }
43
- // TODO: When adding a builder for serve, we
40
+ // TODO: When adding a builder for serve, we
44
41
  // should set the port
45
42
  // const port = parseInt(options.port);
46
43
  // if (isNaN(port)) {
@@ -52,7 +49,8 @@ function updateWorkspaceConfig(projectConfig, tree, workspaceFileName, workspace
52
49
  if (!projectConfig.architect.serve.options) {
53
50
  projectConfig.architect.serve.options = {};
54
51
  }
55
- projectConfig.architect.build.builder = '@angular-architects/native-federation:build';
52
+ projectConfig.architect.build.builder =
53
+ '@angular-architects/native-federation:build';
56
54
  // projectConfig.architect.serve.builder = serveBuilder;
57
55
  // TODO: Register further builders when ready
58
56
  tree.overwrite(workspaceFileName, JSON.stringify(workspace, null, '\t'));
@@ -77,7 +75,15 @@ function normalizeOptions(options, workspace) {
77
75
  .replace(/\\/g, '/');
78
76
  const main = projectConfig.architect.build.options.main;
79
77
  const polyfills = projectConfig.architect.build.options.polyfills;
80
- return { polyfills, projectName, projectRoot, projectSourceRoot, manifestPath, projectConfig, main };
78
+ return {
79
+ polyfills,
80
+ projectName,
81
+ projectRoot,
82
+ projectSourceRoot,
83
+ manifestPath,
84
+ projectConfig,
85
+ main,
86
+ };
81
87
  }
82
88
  function updatePolyfills(tree, polyfills) {
83
89
  let polyfillsContent = tree.readText(polyfills);
@@ -118,31 +124,31 @@ function makeMainAsync(main, options, remoteMap) {
118
124
  tree.create(bootstrapName, mainContent);
119
125
  let newMainContent = '';
120
126
  if (options.type === 'dynamic-host') {
121
- newMainContent = `import { initFederation } from '@angular-architects/native-federation';
122
-
123
- initFederation('/assets/federation.manifest.json')
124
- .catch(err => console.error(err))
125
- .then(_ => import('./bootstrap'))
126
- .catch(err => console.error(err));
127
+ newMainContent = `import { initFederation } from '@angular-architects/native-federation';
128
+
129
+ initFederation('/assets/federation.manifest.json')
130
+ .catch(err => console.error(err))
131
+ .then(_ => import('./bootstrap'))
132
+ .catch(err => console.error(err));
127
133
  `;
128
134
  }
129
135
  else if (options.type === 'host') {
130
- const manifest = JSON.stringify(remoteMap, null, 2).replace(/"/g, '\'');
131
- newMainContent = `import { initFederation } from '@angular-architects/native-federation';
132
-
133
- initFederation(${manifest})
134
- .catch(err => console.error(err))
135
- .then(_ => import('./bootstrap'))
136
- .catch(err => console.error(err));
136
+ const manifest = JSON.stringify(remoteMap, null, 2).replace(/"/g, "'");
137
+ newMainContent = `import { initFederation } from '@angular-architects/native-federation';
138
+
139
+ initFederation(${manifest})
140
+ .catch(err => console.error(err))
141
+ .then(_ => import('./bootstrap'))
142
+ .catch(err => console.error(err));
137
143
  `;
138
144
  }
139
145
  else {
140
- newMainContent = `import { initFederation } from '@angular-architects/native-federation';
141
-
142
- initFederation()
143
- .catch(err => console.error(err))
144
- .then(_ => import('./bootstrap'))
145
- .catch(err => console.error(err));
146
+ newMainContent = `import { initFederation } from '@angular-architects/native-federation';
147
+
148
+ initFederation()
149
+ .catch(err => console.error(err))
150
+ .then(_ => import('./bootstrap'))
151
+ .catch(err => console.error(err));
146
152
  `;
147
153
  }
148
154
  tree.overwrite(main, newMainContent);
@@ -163,9 +169,9 @@ function generateFederationConfig(remoteMap, projectRoot, projectSourceRoot, opt
163
169
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
164
170
  const tmpl = (0, schematics_1.url)('./files');
165
171
  const applied = (0, schematics_1.apply)(tmpl, [
166
- (0, schematics_1.template)(Object.assign({ projectRoot,
172
+ (0, schematics_1.template)(Object.assign(Object.assign({ projectRoot,
167
173
  projectSourceRoot,
168
- remoteMap }, options)),
174
+ remoteMap }, options), { tmpl: '' })),
169
175
  (0, schematics_1.move)(projectRoot),
170
176
  ]);
171
177
  return (0, schematics_1.mergeWith)(applied);
@@ -1 +1 @@
1
- {"version":3,"file":"schematic.js","sourceRoot":"","sources":["../../../../../../libs/native-federation/src/schematics/init/schematic.ts"],"names":[],"mappings":";;;;AAAA,2DASoC;AAEpC,4DAA0E;AAC1E,+CAA+C;AAG/C,2EAGkD;AAElD,6BAA6B;AAY7B,SAAwB,MAAM,CAAC,OAA0B;IACvD,OAAO,UAAgB,IAAI,EAAE,OAAO;;YAElC,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;YACrD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI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MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;gBACxE,cAAc,GAAG;;iBAEN,QAAQ;;;;CAIxB,CAAC;aAEG;iBACI;gBACH,cAAc,GAAG;;;;;;CAMtB,CAAC;aAEG;YAED,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QACvC,CAAC;KAAA,CAAC;AACJ,CAAC;AAED,SAAgB,oBAAoB,CAAC,IAAU;IAC7C,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE;QAC/B,OAAO,cAAc,CAAC;KACvB;IACD,IAAI,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE;QACjC,OAAO,gBAAgB,CAAC;KACzB;IACD,MAAM,IAAI,KAAK,CACb,oFAAoF,CACrF,CAAC;AACJ,CAAC;AAVD,oDAUC;AAED,SAAe,wBAAwB,CACrC,SAAiC,EACjC,WAAmB,EACnB,iBAAyB,EACzB,OAA0B;;QAE1B,MAAM,IAAI,GAAG,IAAA,gBAAG,EAAC,SAAS,CAAC,CAAC;QAE5B,MAAM,OAAO,GAAG,IAAA,kBAAK,EAAC,IAAI,EAAE;YAC1B,IAAA,qBAAQ,kBACN,WAAW;gBACX,iBAAiB;gBACjB,SAAS,IACN,OAAO,EACV;YACF,IAAA,iBAAI,EAAC,WAAW,CAAC;SAClB,CAAC,CAAC;QAEH,OAAO,IAAA,sBAAS,EAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;CAAA"}
1
+ {"version":3,"file":"schematic.js","sourceRoot":"","sources":["../../../../../../libs/native-federation/src/schematics/init/schematic.ts"],"names":[],"mappings":";;;;AAAA,2DASoC;AAEpC,4DAA0E;AAC1E,+CAA+C;AAG/C,2EAGkD;AAElD,6BAA6B;AAY7B,SAAwB,MAAM,CAAC,OAA0B;IACvD,OAAO,UAAgB,IAAI,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BuildAdapter;
3
+ export declare function loadEsmModule<T>(modulePath: string | URL): Promise<T>;
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.loadEsmModule = exports.AngularEsBuildAdapter = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const build_1 = require("@softarc/native-federation/build");
6
+ const esbuild = require("esbuild");
7
+ const compiler_plugin_1 = require("@angular-devkit/build-angular/src/builders/browser-esbuild/compiler-plugin");
8
+ const shared_mappings_plugin_1 = require("./shared-mappings-plugin");
9
+ const rollup_1 = require("./rollup");
10
+ const fs = require("fs");
11
+ const core_1 = require("@babel/core");
12
+ const AngularEsBuildAdapter = (options) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
13
+ const { entryPoint, tsConfigPath, external, outfile, mappedPaths, kind } = options;
14
+ if (kind === 'shared-package') {
15
+ yield (0, rollup_1.runRollup)(entryPoint, external, outfile);
16
+ }
17
+ else {
18
+ yield runEsbuild(entryPoint, external, outfile, tsConfigPath, mappedPaths);
19
+ }
20
+ if (kind === 'shared-package' && fs.existsSync(outfile)) {
21
+ yield link(outfile);
22
+ }
23
+ });
24
+ exports.AngularEsBuildAdapter = AngularEsBuildAdapter;
25
+ function link(outfile) {
26
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
27
+ const code = fs.readFileSync(outfile, 'utf-8');
28
+ try {
29
+ const linkerEsm = yield loadEsmModule('@angular/compiler-cli/linker/babel');
30
+ const linker = linkerEsm.default;
31
+ const result = yield (0, core_1.transformAsync)(code, {
32
+ filename: outfile,
33
+ // inputSourceMap: (useInputSourcemap ? undefined : false) as undefined,
34
+ // sourceMaps: pluginOptions.sourcemap ? 'inline' : false,
35
+ compact: false,
36
+ configFile: false,
37
+ babelrc: false,
38
+ minified: true,
39
+ browserslistConfigFile: false,
40
+ plugins: [linker],
41
+ });
42
+ fs.writeFileSync(outfile, result.code, 'utf-8');
43
+ }
44
+ catch (e) {
45
+ build_1.logger.error('error linking');
46
+ if (fs.existsSync(`${outfile}.error`)) {
47
+ fs.unlinkSync(`${outfile}.error`);
48
+ }
49
+ fs.renameSync(outfile, `${outfile}.error`);
50
+ throw e;
51
+ }
52
+ });
53
+ }
54
+ function runEsbuild(entryPoint, external, outfile, tsConfigPath, mappedPaths, plugins = null) {
55
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
56
+ yield esbuild.build({
57
+ entryPoints: [entryPoint],
58
+ external,
59
+ outfile,
60
+ bundle: true,
61
+ sourcemap: true,
62
+ minify: true,
63
+ platform: 'browser',
64
+ format: 'esm',
65
+ target: ['esnext'],
66
+ plugins: plugins || [
67
+ (0, compiler_plugin_1.createCompilerPlugin)({
68
+ sourcemap: true,
69
+ tsconfig: tsConfigPath,
70
+ advancedOptimizations: true,
71
+ thirdPartySourcemaps: true,
72
+ }, {
73
+ optimization: true,
74
+ sourcemap: true,
75
+ workspaceRoot: __dirname,
76
+ }),
77
+ ...(mappedPaths && mappedPaths.length > 0
78
+ ? [(0, shared_mappings_plugin_1.createSharedMappingsPlugin)(mappedPaths)]
79
+ : []),
80
+ ],
81
+ });
82
+ });
83
+ }
84
+ function loadEsmModule(modulePath) {
85
+ return new Function('modulePath', `return import(modulePath);`)(modulePath);
86
+ }
87
+ exports.loadEsmModule = loadEsmModule;
88
+ //# sourceMappingURL=angular-esbuild-adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"angular-esbuild-adapter.js","sourceRoot":"","sources":["../../../../../libs/native-federation/src/utils/angular-esbuild-adapter.ts"],"names":[],"mappings":";;;;AAAA,4DAI0C;AAC1C,mCAAmC;AACnC,gHAAkH;AAClH,qEAAsE;AACtE,qCAAkD;AAElD,yBAAyB;AAEzB,sCAAyD;AAElD,MAAM,qBAAqB,GAAiB,CAAO,OAAO,EAAE,EAAE;IACnE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,GACtE,OAAO,CAAC;IAEV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YACD,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,OAAO,QAAQ,CAAC,CAAC;YAE3C,MAAM,CAAC,CAAC;SACT;IACH,CAAC;CAAA;AAED,SAAe,UAAU,CACvB,UAAkB,EAClB,QAAkB,EAClB,OAAe,EACf,YAAoB,EACpB,WAAyB,EACzB,UAAmC,IAAI;;QAEvC,MAAM,OAAO,CAAC,KAAK,CAAC;YAClB,WAAW,EAAE,CAAC,UAAU,CAAC;YACzB,QAAQ;YACR,OAAO;YACP,MAAM,EAAE,IAAI;YACZ,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,IAAI;YACZ,QAAQ,EAAE,SAAS;YACnB,MAAM,EAAE,KAAK;YACb,MAAM,EAAE,CAAC,QAAQ,CAAC;YAClB,OAAO,EAAE,OAAO,IAAI;gBAClB,IAAA,sCAAoB,EAClB;oBACE,SAAS,EAAE,IAAI;oBACf,QAAQ,EAAE,YAAY;oBACtB,qBAAqB,EAAE,IAAI;oBAC3B,oBAAoB,EAAE,IAAI;iBAC3B,EACD;oBACE,YAAY,EAAE,IAAI;oBAClB,SAAS,EAAE,IAAI;oBACf,aAAa,EAAE,SAAS;iBACzB,CACF;gBACD,GAAG,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC;oBACvC,CAAC,CAAC,CAAC,IAAA,mDAA0B,EAAC,WAAW,CAAC,CAAC;oBAC3C,CAAC,CAAC,EAAE,CAAC;aACR;SACF,CAAC,CAAC;IACL,CAAC;CAAA;AAED,SAAgB,aAAa,CAAI,UAAwB;IACvD,OAAO,IAAI,QAAQ,CAAC,YAAY,EAAE,4BAA4B,CAAC,CAC7D,UAAU,CACG,CAAC;AAClB,CAAC;AAJD,sCAIC"}
@@ -0,0 +1 @@
1
+ export declare function runRollup(entryPoint: string, external: string[], outfile: string): Promise<void>;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ //
3
+ // We stick with rollup for bundling shared npm packages, as esbuild
4
+ // does currently not allow to convert commonjs to esm
5
+ //
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.runRollup = void 0;
8
+ const tslib_1 = require("tslib");
9
+ const rollup_1 = require("rollup");
10
+ const plugin_node_resolve_1 = require("@rollup/plugin-node-resolve");
11
+ const rollup_plugin_node_externals_1 = require("rollup-plugin-node-externals");
12
+ const build_1 = require("@softarc/native-federation/build");
13
+ const rollup_plugin_terser_1 = require("rollup-plugin-terser");
14
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
15
+ const commonjs = require('@rollup/plugin-commonjs');
16
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
17
+ const replace = require('@rollup/plugin-replace');
18
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
19
+ const json = require('@rollup/plugin-json');
20
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
21
+ function runRollup(entryPoint, external, outfile) {
22
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
23
+ try {
24
+ const result = yield (0, rollup_1.rollup)({
25
+ input: entryPoint,
26
+ onwarn: (warning) => {
27
+ build_1.logger.verbose(warning);
28
+ },
29
+ plugins: [
30
+ json(),
31
+ commonjs(),
32
+ (0, rollup_plugin_node_externals_1.externals)({ include: external }),
33
+ (0, plugin_node_resolve_1.default)(),
34
+ replace({
35
+ preventAssignment: true,
36
+ values: {
37
+ 'process.env.NODE_ENV': '"development"',
38
+ },
39
+ }),
40
+ (0, rollup_plugin_terser_1.terser)(),
41
+ ],
42
+ });
43
+ yield result.write({
44
+ format: 'esm',
45
+ compact: true,
46
+ file: outfile,
47
+ sourcemap: true,
48
+ exports: 'named',
49
+ });
50
+ }
51
+ catch (e) {
52
+ build_1.logger.error('Rollup error');
53
+ throw e;
54
+ }
55
+ });
56
+ }
57
+ exports.runRollup = runRollup;
58
+ //# sourceMappingURL=rollup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rollup.js","sourceRoot":"","sources":["../../../../../libs/native-federation/src/utils/rollup.ts"],"names":[],"mappings":";AAAA,EAAE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,3 +1,3 @@
1
1
  import { Plugin } from 'esbuild';
2
- import { MappedPath } from './mapped-paths';
2
+ import { MappedPath } from '@softarc/native-federation/build';
3
3
  export declare function createSharedMappingsPlugin(mappedPaths: MappedPath[]): Plugin;
@@ -1,26 +0,0 @@
1
- import { MappedPath } from '../utils/mapped-paths';
2
- export interface SharedConfig {
3
- singleton?: boolean;
4
- strictVersion?: boolean;
5
- requiredVersion?: string;
6
- version?: string;
7
- }
8
- export interface FederationConfig {
9
- name?: string;
10
- exposes?: Record<string, string>;
11
- shared?: Record<string, SharedConfig>;
12
- sharedMappings?: Array<string>;
13
- skip?: Array<string>;
14
- }
15
- export interface NormalizedSharedConfig {
16
- singleton: boolean;
17
- strictVersion: boolean;
18
- requiredVersion: string;
19
- version?: string;
20
- }
21
- export interface NormalizedFederationConfig {
22
- name: string;
23
- exposes: Record<string, string>;
24
- shared: Record<string, NormalizedSharedConfig>;
25
- sharedMappings: Array<MappedPath>;
26
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=federation-config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"federation-config.js","sourceRoot":"","sources":["../../../../../libs/native-federation/src/config/federation-config.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export * from './with-native-federation';
2
- export { findRootTsConfigJson, share, shareAll, } from '@angular-architects/module-federation/webpack';
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.shareAll = exports.share = exports.findRootTsConfigJson = void 0;
4
- const tslib_1 = require("tslib");
5
- tslib_1.__exportStar(require("./with-native-federation"), exports);
6
- var webpack_1 = require("@angular-architects/module-federation/webpack");
7
- Object.defineProperty(exports, "findRootTsConfigJson", { enumerable: true, get: function () { return webpack_1.findRootTsConfigJson; } });
8
- Object.defineProperty(exports, "share", { enumerable: true, get: function () { return webpack_1.share; } });
9
- Object.defineProperty(exports, "shareAll", { enumerable: true, get: function () { return webpack_1.shareAll; } });
10
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/native-federation/src/config/index.ts"],"names":[],"mappings":";;;;AAAA,mEAAyC;AACzC,yEAIuD;AAHrD,+GAAA,oBAAoB,OAAA;AACpB,gGAAA,KAAK,OAAA;AACL,mGAAA,QAAQ,OAAA"}
@@ -1,2 +0,0 @@
1
- import { FederationConfig, NormalizedFederationConfig } from './federation-config';
2
- export declare function withNativeFederation(config: FederationConfig): NormalizedFederationConfig;