@softarc/native-federation 1.1.1 → 2.0.0

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 (77) hide show
  1. package/README.md +9 -9
  2. package/build.d.ts +1 -1
  3. package/build.js +4 -4
  4. package/package.json +4 -3
  5. package/src/build.d.ts +16 -18
  6. package/src/build.js +30 -34
  7. package/src/build.js.map +1 -1
  8. package/src/config.d.ts +1 -1
  9. package/src/config.js +5 -5
  10. package/src/index.d.ts +1 -1
  11. package/src/index.js +4 -4
  12. package/src/lib/config/configuration-context.d.ts +7 -7
  13. package/src/lib/config/configuration-context.js +16 -16
  14. package/src/lib/config/configuration-context.js.map +1 -1
  15. package/src/lib/config/federation-config.d.ts +29 -29
  16. package/src/lib/config/federation-config.js +2 -2
  17. package/src/lib/config/share-utils.d.ts +16 -16
  18. package/src/lib/config/share-utils.js +235 -235
  19. package/src/lib/config/share-utils.js.map +1 -1
  20. package/src/lib/config/with-native-federation.d.ts +2 -2
  21. package/src/lib/config/with-native-federation.js +58 -58
  22. package/src/lib/core/build-adapter.d.ts +25 -16
  23. package/src/lib/core/build-adapter.js +18 -17
  24. package/src/lib/core/build-adapter.js.map +1 -1
  25. package/src/lib/core/build-for-federation.d.ts +8 -8
  26. package/src/lib/core/build-for-federation.js +36 -33
  27. package/src/lib/core/build-for-federation.js.map +1 -1
  28. package/src/lib/core/bundle-exposed-and-mappings.d.ts +10 -0
  29. package/src/lib/core/bundle-exposed-and-mappings.js +106 -0
  30. package/src/lib/core/bundle-exposed-and-mappings.js.map +1 -0
  31. package/src/lib/core/bundle-shared.d.ts +4 -4
  32. package/src/lib/core/bundle-shared.js +91 -101
  33. package/src/lib/core/bundle-shared.js.map +1 -1
  34. package/src/lib/core/default-skip-list.d.ts +12 -12
  35. package/src/lib/core/default-skip-list.js +46 -39
  36. package/src/lib/core/default-skip-list.js.map +1 -1
  37. package/src/lib/core/federation-builder.d.ts +18 -16
  38. package/src/lib/core/federation-builder.js +44 -39
  39. package/src/lib/core/federation-builder.js.map +1 -1
  40. package/src/lib/core/federation-options.d.ts +10 -10
  41. package/src/lib/core/federation-options.js +2 -2
  42. package/src/lib/core/get-externals.d.ts +2 -2
  43. package/src/lib/core/get-externals.js +12 -11
  44. package/src/lib/core/get-externals.js.map +1 -1
  45. package/src/lib/core/load-federation-config.d.ts +3 -3
  46. package/src/lib/core/load-federation-config.js +17 -17
  47. package/src/lib/core/load-federation-config.js.map +1 -1
  48. package/src/lib/core/write-federation-info.d.ts +3 -3
  49. package/src/lib/core/write-federation-info.js +11 -11
  50. package/src/lib/core/write-import-map.d.ts +3 -3
  51. package/src/lib/core/write-import-map.js +15 -15
  52. package/src/lib/utils/build-result-map.d.ts +3 -0
  53. package/src/lib/utils/build-result-map.js +28 -0
  54. package/src/lib/utils/build-result-map.js.map +1 -0
  55. package/src/lib/utils/build-utils.d.ts +2 -2
  56. package/src/lib/utils/build-utils.js +12 -12
  57. package/src/lib/utils/build-utils.js.map +1 -1
  58. package/src/lib/utils/copy-src-map-if-exists.d.ts +1 -1
  59. package/src/lib/utils/copy-src-map-if-exists.js +13 -13
  60. package/src/lib/utils/hash-file.d.ts +1 -1
  61. package/src/lib/utils/hash-file.js +13 -13
  62. package/src/lib/utils/logger.d.ts +10 -10
  63. package/src/lib/utils/logger.js +38 -38
  64. package/src/lib/utils/mapped-paths.d.ts +10 -10
  65. package/src/lib/utils/mapped-paths.js +37 -37
  66. package/src/lib/utils/normalize.d.ts +1 -1
  67. package/src/lib/utils/normalize.js +17 -17
  68. package/src/lib/utils/normalize.js.map +1 -1
  69. package/src/lib/utils/package-info.d.ts +22 -22
  70. package/src/lib/utils/package-info.js +270 -250
  71. package/src/lib/utils/package-info.js.map +1 -1
  72. package/src/lib/core/bundle-exposed.d.ts +0 -5
  73. package/src/lib/core/bundle-exposed.js +0 -75
  74. package/src/lib/core/bundle-exposed.js.map +0 -1
  75. package/src/lib/core/bundle-shared-mappings.d.ts +0 -5
  76. package/src/lib/core/bundle-shared-mappings.js +0 -104
  77. package/src/lib/core/bundle-shared-mappings.js.map +0 -1
@@ -1,40 +1,47 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isInSkipList = exports.prepareSkipList = exports.PREPARED_DEFAULT_SKIP_LIST = exports.DEFAULT_SKIP_LIST = void 0;
4
- exports.DEFAULT_SKIP_LIST = [
5
- '@softarc/native-federation-runtime',
6
- '@softarc/native-federation',
7
- '@softarc/native-federation-core',
8
- '@softarc/native-federation-esbuild',
9
- '@angular-architects/native-federation',
10
- '@angular-architects/native-federation-runtime',
11
- 'es-module-shims',
12
- 'zone.js',
13
- // 'tslib',
14
- /\/schematics(\/|$)/,
15
- (pkg) => pkg.startsWith('@angular/') && !!pkg.match(/\/testing(\/|$)/),
16
- (pkg) => pkg.startsWith('@types/'),
17
- ];
18
- exports.PREPARED_DEFAULT_SKIP_LIST = prepareSkipList(exports.DEFAULT_SKIP_LIST);
19
- function prepareSkipList(skipList) {
20
- return {
21
- strings: new Set(skipList.filter((e) => typeof e === 'string')),
22
- functions: skipList.filter((e) => typeof e === 'function'),
23
- regexps: skipList.filter((e) => typeof e === 'object'),
24
- };
25
- }
26
- exports.prepareSkipList = prepareSkipList;
27
- function isInSkipList(entry, skipList) {
28
- if (skipList.strings.has(entry)) {
29
- return true;
30
- }
31
- if (skipList.functions.find((f) => f(entry))) {
32
- return true;
33
- }
34
- if (skipList.regexps.find((r) => r.test(entry))) {
35
- return true;
36
- }
37
- return false;
38
- }
39
- exports.isInSkipList = isInSkipList;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isInSkipList = exports.prepareSkipList = exports.PREPARED_DEFAULT_SKIP_LIST = exports.DEFAULT_SKIP_LIST = void 0;
4
+ exports.DEFAULT_SKIP_LIST = [
5
+ '@softarc/native-federation-runtime',
6
+ '@softarc/native-federation',
7
+ '@softarc/native-federation-core',
8
+ '@softarc/native-federation-esbuild',
9
+ '@angular-architects/native-federation',
10
+ '@angular-architects/native-federation-runtime',
11
+ 'es-module-shims',
12
+ 'zone.js',
13
+ 'tslib/',
14
+ '@angular/localize',
15
+ '@angular/localize/init',
16
+ '@angular/localize/tools',
17
+ '@angular/platform-server',
18
+ '@angular/platform-server/init',
19
+ '@angular/ssr',
20
+ 'express',
21
+ /\/schematics(\/|$)/,
22
+ (pkg) => pkg.startsWith('@angular/') && !!pkg.match(/\/testing(\/|$)/),
23
+ (pkg) => pkg.startsWith('@types/'),
24
+ ];
25
+ exports.PREPARED_DEFAULT_SKIP_LIST = prepareSkipList(exports.DEFAULT_SKIP_LIST);
26
+ function prepareSkipList(skipList) {
27
+ return {
28
+ strings: new Set(skipList.filter((e) => typeof e === 'string')),
29
+ functions: skipList.filter((e) => typeof e === 'function'),
30
+ regexps: skipList.filter((e) => typeof e === 'object'),
31
+ };
32
+ }
33
+ exports.prepareSkipList = prepareSkipList;
34
+ function isInSkipList(entry, skipList) {
35
+ if (skipList.strings.has(entry)) {
36
+ return true;
37
+ }
38
+ if (skipList.functions.find((f) => f(entry))) {
39
+ return true;
40
+ }
41
+ if (skipList.regexps.find((r) => r.test(entry))) {
42
+ return true;
43
+ }
44
+ return false;
45
+ }
46
+ exports.isInSkipList = isInSkipList;
40
47
  //# sourceMappingURL=default-skip-list.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"default-skip-list.js","sourceRoot":"","sources":["../../../../../../libs/native-federation-core/src/lib/core/default-skip-list.ts"],"names":[],"mappings":";;;AAIa,QAAA,iBAAiB,GAAa;IACzC,oCAAoC;IACpC,4BAA4B;IAC5B,iCAAiC;IACjC,oCAAoC;IACpC,uCAAuC;IACvC,+CAA+C;IAC/C,iBAAiB;IACjB,SAAS;IACT,WAAW;IACX,oBAAoB;IACpB,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,iBAAiB,CAAC;IACtE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC;CACnC,CAAC;AAEW,QAAA,0BAA0B,GAAG,eAAe,CAAC,yBAAiB,CAAC,CAAC;AAQ7E,SAAgB,eAAe,CAAC,QAAkB;IAChD,OAAO;QACL,OAAO,EAAE,IAAI,GAAG,CACd,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAa,CAC1D;QACD,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,UAAU,CAAa;QACtE,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAa;KACnE,CAAC;AACJ,CAAC;AARD,0CAQC;AAED,SAAgB,YAAY,CAC1B,KAAa,EACb,QAA0B;IAE1B,IAAI,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QAC/B,OAAO,IAAI,CAAC;KACb;IAED,IAAI,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE;QAC5C,OAAO,IAAI,CAAC;KACb;IAED,IAAI,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE;QAC/C,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAjBD,oCAiBC"}
1
+ {"version":3,"file":"default-skip-list.js","sourceRoot":"","sources":["../../../../../../libs/native-federation-core/src/lib/core/default-skip-list.ts"],"names":[],"mappings":";;;AAIa,QAAA,iBAAiB,GAAa;IACzC,oCAAoC;IACpC,4BAA4B;IAC5B,iCAAiC;IACjC,oCAAoC;IACpC,uCAAuC;IACvC,+CAA+C;IAC/C,iBAAiB;IACjB,SAAS;IACT,QAAQ;IACR,mBAAmB;IACnB,wBAAwB;IACxB,yBAAyB;IACzB,0BAA0B;IAC1B,+BAA+B;IAC/B,cAAc;IACd,SAAS;IACT,oBAAoB;IACpB,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,iBAAiB,CAAC;IACtE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC;CACnC,CAAC;AAEW,QAAA,0BAA0B,GAAG,eAAe,CAAC,yBAAiB,CAAC,CAAC;AAQ7E,SAAgB,eAAe,CAAC,QAAkB;IAChD,OAAO;QACL,OAAO,EAAE,IAAI,GAAG,CACd,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAa,CAC1D;QACD,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,UAAU,CAAa;QACtE,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAa;KACnE,CAAC;AACJ,CAAC;AARD,0CAQC;AAED,SAAgB,YAAY,CAC1B,KAAa,EACb,QAA0B;IAE1B,IAAI,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QAC/B,OAAO,IAAI,CAAC;KACb;IAED,IAAI,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE;QAC5C,OAAO,IAAI,CAAC;KACb;IAED,IAAI,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE;QAC/C,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAjBD,oCAiBC"}
@@ -1,16 +1,18 @@
1
- import { NormalizedFederationConfig } from '../config/federation-config';
2
- import { BuildAdapter } from './build-adapter';
3
- import { FederationOptions } from './federation-options';
4
- export interface BuildHelperParams {
5
- options: FederationOptions;
6
- adapter: BuildAdapter;
7
- }
8
- declare function init(params: BuildHelperParams): Promise<void>;
9
- declare function build(buildParams?: import("./build-for-federation").BuildParams): Promise<void>;
10
- export declare const federationBuilder: {
11
- init: typeof init;
12
- build: typeof build;
13
- readonly externals: string[];
14
- readonly config: NormalizedFederationConfig;
15
- };
16
- export {};
1
+ import { FederationInfo } from '@softarc/native-federation-runtime';
2
+ import { NormalizedFederationConfig } from '../config/federation-config';
3
+ import { BuildAdapter } from './build-adapter';
4
+ import { FederationOptions } from './federation-options';
5
+ export interface BuildHelperParams {
6
+ options: FederationOptions;
7
+ adapter: BuildAdapter;
8
+ }
9
+ declare function init(params: BuildHelperParams): Promise<void>;
10
+ declare function build(buildParams?: import("./build-for-federation").BuildParams): Promise<void>;
11
+ export declare const federationBuilder: {
12
+ init: typeof init;
13
+ build: typeof build;
14
+ readonly federationInfo: FederationInfo;
15
+ readonly externals: string[];
16
+ readonly config: NormalizedFederationConfig;
17
+ };
18
+ export {};
@@ -1,40 +1,45 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.federationBuilder = void 0;
4
- const tslib_1 = require("tslib");
5
- const configuration_context_1 = require("../config/configuration-context");
6
- const build_adapter_1 = require("./build-adapter");
7
- const build_for_federation_1 = require("./build-for-federation");
8
- const get_externals_1 = require("./get-externals");
9
- const load_federation_config_1 = require("./load-federation-config");
10
- let externals = [];
11
- let config;
12
- let fedOptions;
13
- function init(params) {
14
- var _a;
15
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
16
- (0, build_adapter_1.setBuildAdapter)(params.adapter);
17
- fedOptions = params.options;
18
- (0, configuration_context_1.useWorkspace)(params.options.workspaceRoot);
19
- (0, configuration_context_1.usePackageJson)(params.options.packageJson);
20
- config = yield (0, load_federation_config_1.loadFederationConfig)(fedOptions);
21
- params.options.workspaceRoot = (_a = (0, configuration_context_1.getConfigContext)().workspaceRoot) !== null && _a !== void 0 ? _a : params.options.workspaceRoot;
22
- externals = (0, get_externals_1.getExternals)(config);
23
- });
24
- }
25
- function build(buildParams = build_for_federation_1.defaultBuildParams) {
26
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
27
- yield (0, build_for_federation_1.buildForFederation)(config, fedOptions, externals, buildParams);
28
- });
29
- }
30
- exports.federationBuilder = {
31
- init,
32
- build,
33
- get externals() {
34
- return externals;
35
- },
36
- get config() {
37
- return config;
38
- },
39
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.federationBuilder = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const configuration_context_1 = require("../config/configuration-context");
6
+ const build_adapter_1 = require("./build-adapter");
7
+ const build_for_federation_1 = require("./build-for-federation");
8
+ const get_externals_1 = require("./get-externals");
9
+ const load_federation_config_1 = require("./load-federation-config");
10
+ let externals = [];
11
+ let config;
12
+ let fedOptions;
13
+ let fedInfo;
14
+ function init(params) {
15
+ var _a;
16
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
17
+ (0, build_adapter_1.setBuildAdapter)(params.adapter);
18
+ fedOptions = params.options;
19
+ (0, configuration_context_1.useWorkspace)(params.options.workspaceRoot);
20
+ (0, configuration_context_1.usePackageJson)(params.options.packageJson);
21
+ config = yield (0, load_federation_config_1.loadFederationConfig)(fedOptions);
22
+ params.options.workspaceRoot =
23
+ (_a = (0, configuration_context_1.getConfigContext)().workspaceRoot) !== null && _a !== void 0 ? _a : params.options.workspaceRoot;
24
+ externals = (0, get_externals_1.getExternals)(config);
25
+ });
26
+ }
27
+ function build(buildParams = build_for_federation_1.defaultBuildParams) {
28
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
29
+ fedInfo = yield (0, build_for_federation_1.buildForFederation)(config, fedOptions, externals, buildParams);
30
+ });
31
+ }
32
+ exports.federationBuilder = {
33
+ init,
34
+ build,
35
+ get federationInfo() {
36
+ return fedInfo;
37
+ },
38
+ get externals() {
39
+ return externals;
40
+ },
41
+ get config() {
42
+ return config;
43
+ },
44
+ };
40
45
  //# sourceMappingURL=federation-builder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"federation-builder.js","sourceRoot":"","sources":["../../../../../../libs/native-federation-core/src/lib/core/federation-builder.ts"],"names":[],"mappings":";;;;AAAA,2EAAiG;AAEjG,mDAAgE;AAChE,iEAAgF;AAEhF,mDAA+C;AAC/C,qEAAgE;AAOhE,IAAI,SAAS,GAAa,EAAE,CAAC;AAC7B,IAAI,MAAkC,CAAC;AACvC,IAAI,UAA6B,CAAC;AAElC,SAAe,IAAI,CAAC,MAAyB;;;QAC3C,IAAA,+BAAe,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAChC,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC;QAC5B,IAAA,oCAAY,EAAC,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QAC3C,IAAA,sCAAc,EAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAC3C,MAAM,GAAG,MAAM,IAAA,6CAAoB,EAAC,UAAU,CAAC,CAAC;QAChD,MAAM,CAAC,OAAO,CAAC,aAAa,GAAG,MAAA,IAAA,wCAAgB,GAAE,CAAC,aAAa,mCAAI,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC;QAChG,SAAS,GAAG,IAAA,4BAAY,EAAC,MAAM,CAAC,CAAC;;CAClC;AAED,SAAe,KAAK,CAAC,WAAW,GAAG,yCAAkB;;QACnD,MAAM,IAAA,yCAAkB,EAAC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;IACvE,CAAC;CAAA;AAEY,QAAA,iBAAiB,GAAG;IAC/B,IAAI;IACJ,KAAK;IACL,IAAI,SAAS;QACX,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,MAAM;QACR,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC"}
1
+ {"version":3,"file":"federation-builder.js","sourceRoot":"","sources":["../../../../../../libs/native-federation-core/src/lib/core/federation-builder.ts"],"names":[],"mappings":";;;;AACA,2EAIyC;AAEzC,mDAAgE;AAChE,iEAAgF;AAEhF,mDAA+C;AAC/C,qEAAgE;AAOhE,IAAI,SAAS,GAAa,EAAE,CAAC;AAC7B,IAAI,MAAkC,CAAC;AACvC,IAAI,UAA6B,CAAC;AAClC,IAAI,OAAuB,CAAC;AAE5B,SAAe,IAAI,CAAC,MAAyB;;;QAC3C,IAAA,+BAAe,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAChC,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC;QAC5B,IAAA,oCAAY,EAAC,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QAC3C,IAAA,sCAAc,EAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAC3C,MAAM,GAAG,MAAM,IAAA,6CAAoB,EAAC,UAAU,CAAC,CAAC;QAChD,MAAM,CAAC,OAAO,CAAC,aAAa;YAC1B,MAAA,IAAA,wCAAgB,GAAE,CAAC,aAAa,mCAAI,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC;QACnE,SAAS,GAAG,IAAA,4BAAY,EAAC,MAAM,CAAC,CAAC;;CAClC;AAED,SAAe,KAAK,CAAC,WAAW,GAAG,yCAAkB;;QACnD,OAAO,GAAG,MAAM,IAAA,yCAAkB,EAChC,MAAM,EACN,UAAU,EACV,SAAS,EACT,WAAW,CACZ,CAAC;IACJ,CAAC;CAAA;AAEY,QAAA,iBAAiB,GAAG;IAC/B,IAAI;IACJ,KAAK;IACL,IAAI,cAAc;QAChB,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,IAAI,SAAS;QACX,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,MAAM;QACR,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC"}
@@ -1,10 +1,10 @@
1
- export interface FederationOptions {
2
- workspaceRoot: string;
3
- outputPath: string;
4
- federationConfig: string;
5
- tsConfig?: string;
6
- verbose?: boolean;
7
- dev?: boolean;
8
- watch?: boolean;
9
- packageJson?: string;
10
- }
1
+ export interface FederationOptions {
2
+ workspaceRoot: string;
3
+ outputPath: string;
4
+ federationConfig: string;
5
+ tsConfig?: string;
6
+ verbose?: boolean;
7
+ dev?: boolean;
8
+ watch?: boolean;
9
+ packageJson?: string;
10
+ }
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=federation-options.js.map
@@ -1,2 +1,2 @@
1
- import { NormalizedFederationConfig } from '../config/federation-config';
2
- export declare function getExternals(config: NormalizedFederationConfig): string[];
1
+ import { NormalizedFederationConfig } from '../config/federation-config';
2
+ export declare function getExternals(config: NormalizedFederationConfig): string[];
@@ -1,12 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getExternals = void 0;
4
- function getExternals(config) {
5
- const shared = Object.keys(config.shared);
6
- const sharedMappings = config.sharedMappings.map((m) => m.key);
7
- const externals = [...shared, ...sharedMappings];
8
- return externals;
9
- // return externals.filter((p) => !isInSkipList(p, PREPARED_DEFAULT_SKIP_LIST));
10
- }
11
- exports.getExternals = getExternals;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getExternals = void 0;
4
+ // import { isInSkipList, PREPARED_DEFAULT_SKIP_LIST } from './default-skip-list';
5
+ function getExternals(config) {
6
+ const shared = Object.keys(config.shared);
7
+ const sharedMappings = config.sharedMappings.map((m) => m.key);
8
+ const externals = [...shared, ...sharedMappings];
9
+ return externals;
10
+ // return externals.filter((p) => !isInSkipList(p, PREPARED_DEFAULT_SKIP_LIST));
11
+ }
12
+ exports.getExternals = getExternals;
12
13
  //# sourceMappingURL=get-externals.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-externals.js","sourceRoot":"","sources":["../../../../../../libs/native-federation-core/src/lib/core/get-externals.ts"],"names":[],"mappings":";;;AAGA,SAAgB,YAAY,CAAC,MAAkC;IAC7D,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAE/D,MAAM,SAAS,GAAG,CAAC,GAAG,MAAM,EAAE,GAAG,cAAc,CAAC,CAAC;IAEjD,OAAO,SAAS,CAAC;IACjB,gFAAgF;AAClF,CAAC;AARD,oCAQC"}
1
+ {"version":3,"file":"get-externals.js","sourceRoot":"","sources":["../../../../../../libs/native-federation-core/src/lib/core/get-externals.ts"],"names":[],"mappings":";;;AACA,kFAAkF;AAElF,SAAgB,YAAY,CAAC,MAAkC;IAC7D,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAE/D,MAAM,SAAS,GAAG,CAAC,GAAG,MAAM,EAAE,GAAG,cAAc,CAAC,CAAC;IAEjD,OAAO,SAAS,CAAC;IACjB,gFAAgF;AAClF,CAAC;AARD,oCAQC"}
@@ -1,3 +1,3 @@
1
- import { NormalizedFederationConfig } from '../config/federation-config';
2
- import { FederationOptions } from './federation-options';
3
- export declare function loadFederationConfig(fedOptions: FederationOptions): Promise<NormalizedFederationConfig>;
1
+ import { NormalizedFederationConfig } from '../config/federation-config';
2
+ import { FederationOptions } from './federation-options';
3
+ export declare function loadFederationConfig(fedOptions: FederationOptions): Promise<NormalizedFederationConfig>;
@@ -1,18 +1,18 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.loadFederationConfig = void 0;
4
- const tslib_1 = require("tslib");
5
- const path = tslib_1.__importStar(require("path"));
6
- const fs = tslib_1.__importStar(require("fs"));
7
- function loadFederationConfig(fedOptions) {
8
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
9
- const fullConfigPath = path.join(fedOptions.workspaceRoot, fedOptions.federationConfig);
10
- if (!fs.existsSync(fullConfigPath)) {
11
- throw new Error('Expected ' + fullConfigPath);
12
- }
13
- const config = (yield Promise.resolve().then(() => tslib_1.__importStar(require(fullConfigPath))));
14
- return config;
15
- });
16
- }
17
- exports.loadFederationConfig = loadFederationConfig;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.loadFederationConfig = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const path = tslib_1.__importStar(require("path"));
6
+ const fs = tslib_1.__importStar(require("fs"));
7
+ function loadFederationConfig(fedOptions) {
8
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
9
+ const fullConfigPath = path.join(fedOptions.workspaceRoot, fedOptions.federationConfig);
10
+ if (!fs.existsSync(fullConfigPath)) {
11
+ throw new Error('Expected ' + fullConfigPath);
12
+ }
13
+ const config = (yield Promise.resolve(`${fullConfigPath}`).then(s => tslib_1.__importStar(require(s))));
14
+ return config;
15
+ });
16
+ }
17
+ exports.loadFederationConfig = loadFederationConfig;
18
18
  //# sourceMappingURL=load-federation-config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"load-federation-config.js","sourceRoot":"","sources":["../../../../../../libs/native-federation-core/src/lib/core/load-federation-config.ts"],"names":[],"mappings":";;;;AAEA,mDAA6B;AAC7B,+CAAyB;AAEzB,SAAsB,oBAAoB,CACxC,UAA6B;;QAE7B,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAC9B,UAAU,CAAC,aAAa,EACxB,UAAU,CAAC,gBAAgB,CAC5B,CAAC;QAEF,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE;YAClC,MAAM,IAAI,KAAK,CAAC,WAAW,GAAG,cAAc,CAAC,CAAC;SAC/C;QAED,MAAM,MAAM,GAAG,CAAC,gEAAa,cAAc,GAAC,CAA+B,CAAC;QAC5E,OAAO,MAAM,CAAC;IAChB,CAAC;CAAA;AAdD,oDAcC"}
1
+ {"version":3,"file":"load-federation-config.js","sourceRoot":"","sources":["../../../../../../libs/native-federation-core/src/lib/core/load-federation-config.ts"],"names":[],"mappings":";;;;AAEA,mDAA6B;AAC7B,+CAAyB;AAEzB,SAAsB,oBAAoB,CACxC,UAA6B;;QAE7B,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAC9B,UAAU,CAAC,aAAa,EACxB,UAAU,CAAC,gBAAgB,CAC5B,CAAC;QAEF,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE;YAClC,MAAM,IAAI,KAAK,CAAC,WAAW,GAAG,cAAc,CAAC,CAAC;SAC/C;QAED,MAAM,MAAM,GAAG,CAAC,yBAAa,cAAc,+CAAC,CAA+B,CAAC;QAC5E,OAAO,MAAM,CAAC;IAChB,CAAC;CAAA;AAdD,oDAcC"}
@@ -1,3 +1,3 @@
1
- import { FederationInfo } from '@softarc/native-federation-runtime';
2
- import { FederationOptions } from './federation-options';
3
- export declare function writeFederationInfo(federationInfo: FederationInfo, fedOptions: FederationOptions): void;
1
+ import { FederationInfo } from '@softarc/native-federation-runtime';
2
+ import { FederationOptions } from './federation-options';
3
+ export declare function writeFederationInfo(federationInfo: FederationInfo, fedOptions: FederationOptions): void;
@@ -1,12 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.writeFederationInfo = void 0;
4
- const tslib_1 = require("tslib");
5
- const path = tslib_1.__importStar(require("path"));
6
- const fs = tslib_1.__importStar(require("fs"));
7
- function writeFederationInfo(federationInfo, fedOptions) {
8
- const metaDataPath = path.join(fedOptions.workspaceRoot, fedOptions.outputPath, 'remoteEntry.json');
9
- fs.writeFileSync(metaDataPath, JSON.stringify(federationInfo, null, 2));
10
- }
11
- exports.writeFederationInfo = writeFederationInfo;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.writeFederationInfo = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const path = tslib_1.__importStar(require("path"));
6
+ const fs = tslib_1.__importStar(require("fs"));
7
+ function writeFederationInfo(federationInfo, fedOptions) {
8
+ const metaDataPath = path.join(fedOptions.workspaceRoot, fedOptions.outputPath, 'remoteEntry.json');
9
+ fs.writeFileSync(metaDataPath, JSON.stringify(federationInfo, null, 2));
10
+ }
11
+ exports.writeFederationInfo = writeFederationInfo;
12
12
  //# sourceMappingURL=write-federation-info.js.map
@@ -1,3 +1,3 @@
1
- import { SharedInfo } from '@softarc/native-federation-runtime';
2
- import { FederationOptions } from './federation-options';
3
- export declare function writeImportMap(sharedInfo: SharedInfo[], fedOption: FederationOptions): void;
1
+ import { SharedInfo } from '@softarc/native-federation-runtime';
2
+ import { FederationOptions } from './federation-options';
3
+ export declare function writeImportMap(sharedInfo: SharedInfo[], fedOption: FederationOptions): void;
@@ -1,16 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.writeImportMap = void 0;
4
- const tslib_1 = require("tslib");
5
- const path = tslib_1.__importStar(require("path"));
6
- const fs = tslib_1.__importStar(require("fs"));
7
- function writeImportMap(sharedInfo, fedOption) {
8
- const imports = sharedInfo.reduce((acc, cur) => {
9
- return Object.assign(Object.assign({}, acc), { [cur.packageName]: cur.outFileName });
10
- }, {});
11
- const importMap = { imports };
12
- const importMapPath = path.join(fedOption.workspaceRoot, fedOption.outputPath, 'importmap.json');
13
- fs.writeFileSync(importMapPath, JSON.stringify(importMap, null, 2));
14
- }
15
- exports.writeImportMap = writeImportMap;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.writeImportMap = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const path = tslib_1.__importStar(require("path"));
6
+ const fs = tslib_1.__importStar(require("fs"));
7
+ function writeImportMap(sharedInfo, fedOption) {
8
+ const imports = sharedInfo.reduce((acc, cur) => {
9
+ return Object.assign(Object.assign({}, acc), { [cur.packageName]: cur.outFileName });
10
+ }, {});
11
+ const importMap = { imports };
12
+ const importMapPath = path.join(fedOption.workspaceRoot, fedOption.outputPath, 'importmap.json');
13
+ fs.writeFileSync(importMapPath, JSON.stringify(importMap, null, 2));
14
+ }
15
+ exports.writeImportMap = writeImportMap;
16
16
  //# sourceMappingURL=write-import-map.js.map
@@ -0,0 +1,3 @@
1
+ import { BuildResult } from '../core/build-adapter';
2
+ export declare function createBuildResultMap(buildResult: BuildResult[], isHashed: boolean): Record<string, string>;
3
+ export declare function lookupInResultMap(map: Record<string, string>, requestName: string): string;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.lookupInResultMap = exports.createBuildResultMap = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const path_1 = tslib_1.__importDefault(require("path"));
6
+ function createBuildResultMap(buildResult, isHashed) {
7
+ const map = {};
8
+ for (const item of buildResult) {
9
+ const resultName = path_1.default.basename(item.fileName);
10
+ let requestName = resultName;
11
+ if (isHashed) {
12
+ const start = resultName.lastIndexOf('-');
13
+ const end = resultName.lastIndexOf('.');
14
+ const part1 = resultName.substring(0, start);
15
+ const part2 = resultName.substring(end);
16
+ requestName = part1 + part2;
17
+ }
18
+ map[requestName] = resultName;
19
+ }
20
+ return map;
21
+ }
22
+ exports.createBuildResultMap = createBuildResultMap;
23
+ function lookupInResultMap(map, requestName) {
24
+ const key = path_1.default.basename(requestName);
25
+ return map[key];
26
+ }
27
+ exports.lookupInResultMap = lookupInResultMap;
28
+ //# sourceMappingURL=build-result-map.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-result-map.js","sourceRoot":"","sources":["../../../../../../libs/native-federation-core/src/lib/utils/build-result-map.ts"],"names":[],"mappings":";;;;AAAA,wDAAwB;AAGxB,SAAgB,oBAAoB,CAClC,WAA0B,EAC1B,QAAiB;IAEjB,MAAM,GAAG,GAA2B,EAAE,CAAC;IAEvC,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE;QAC9B,MAAM,UAAU,GAAG,cAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChD,IAAI,WAAW,GAAG,UAAU,CAAC;QAE7B,IAAI,QAAQ,EAAE;YACZ,MAAM,KAAK,GAAG,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;YAC1C,MAAM,GAAG,GAAG,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;YAExC,MAAM,KAAK,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;YAC7C,MAAM,KAAK,GAAG,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;YAExC,WAAW,GAAG,KAAK,GAAG,KAAK,CAAC;SAC7B;QACD,GAAG,CAAC,WAAW,CAAC,GAAG,UAAU,CAAC;KAC/B;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAvBD,oDAuBC;AAED,SAAgB,iBAAiB,CAC/B,GAA2B,EAC3B,WAAmB;IAEnB,MAAM,GAAG,GAAG,cAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IACvC,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;AAClB,CAAC;AAND,8CAMC"}
@@ -1,2 +1,2 @@
1
- import { BuildAdapterOptions } from '../core/build-adapter';
2
- export declare function bundle(options: BuildAdapterOptions): Promise<void>;
1
+ import { BuildAdapterOptions } from '../core/build-adapter';
2
+ export declare function bundle(options: BuildAdapterOptions): Promise<import("../core/build-adapter").BuildResult[]>;
@@ -1,13 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.bundle = void 0;
4
- const tslib_1 = require("tslib");
5
- const build_adapter_1 = require("../core/build-adapter");
6
- function bundle(options) {
7
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
- const adapter = (0, build_adapter_1.getBuildAdapter)();
9
- yield adapter(options);
10
- });
11
- }
12
- exports.bundle = bundle;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bundle = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const build_adapter_1 = require("../core/build-adapter");
6
+ function bundle(options) {
7
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
+ const adapter = (0, build_adapter_1.getBuildAdapter)();
9
+ return yield adapter(options);
10
+ });
11
+ }
12
+ exports.bundle = bundle;
13
13
  //# sourceMappingURL=build-utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-utils.js","sourceRoot":"","sources":["../../../../../../libs/native-federation-core/src/lib/utils/build-utils.ts"],"names":[],"mappings":";;;;AAAA,yDAA6E;AAE7E,SAAsB,MAAM,CAAC,OAA4B;;QACvD,MAAM,OAAO,GAAG,IAAA,+BAAe,GAAE,CAAC;QAClC,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;CAAA;AAHD,wBAGC"}
1
+ {"version":3,"file":"build-utils.js","sourceRoot":"","sources":["../../../../../../libs/native-federation-core/src/lib/utils/build-utils.ts"],"names":[],"mappings":";;;;AAAA,yDAA6E;AAE7E,SAAsB,MAAM,CAAC,OAA4B;;QACvD,MAAM,OAAO,GAAG,IAAA,+BAAe,GAAE,CAAC;QAClC,OAAO,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;CAAA;AAHD,wBAGC"}
@@ -1 +1 @@
1
- export declare function copySrcMapIfExists(cachedFile: string, fullOutputPath: string): void;
1
+ export declare function copySrcMapIfExists(cachedFile: string, fullOutputPath: string): void;
@@ -1,14 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.copySrcMapIfExists = void 0;
4
- const tslib_1 = require("tslib");
5
- const fs = tslib_1.__importStar(require("fs"));
6
- function copySrcMapIfExists(cachedFile, fullOutputPath) {
7
- const mapSrc = cachedFile + '.map';
8
- const mapDest = fullOutputPath + '.map';
9
- if (fs.existsSync(mapSrc)) {
10
- fs.copyFileSync(mapSrc, mapDest);
11
- }
12
- }
13
- exports.copySrcMapIfExists = copySrcMapIfExists;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.copySrcMapIfExists = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const fs = tslib_1.__importStar(require("fs"));
6
+ function copySrcMapIfExists(cachedFile, fullOutputPath) {
7
+ const mapSrc = cachedFile + '.map';
8
+ const mapDest = fullOutputPath + '.map';
9
+ if (fs.existsSync(mapSrc)) {
10
+ fs.copyFileSync(mapSrc, mapDest);
11
+ }
12
+ }
13
+ exports.copySrcMapIfExists = copySrcMapIfExists;
14
14
  //# sourceMappingURL=copy-src-map-if-exists.js.map
@@ -1 +1 @@
1
- export declare function hashFile(fileName: string): string;
1
+ export declare function hashFile(fileName: string): string;
@@ -1,14 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hashFile = void 0;
4
- const tslib_1 = require("tslib");
5
- const crypto = tslib_1.__importStar(require("crypto"));
6
- const fs = tslib_1.__importStar(require("fs"));
7
- function hashFile(fileName) {
8
- const fileBuffer = fs.readFileSync(fileName);
9
- const hashSum = crypto.createHash('md5');
10
- hashSum.update(fileBuffer);
11
- return hashSum.digest('hex');
12
- }
13
- exports.hashFile = hashFile;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hashFile = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const crypto = tslib_1.__importStar(require("crypto"));
6
+ const fs = tslib_1.__importStar(require("fs"));
7
+ function hashFile(fileName) {
8
+ const fileBuffer = fs.readFileSync(fileName);
9
+ const hashSum = crypto.createHash('md5');
10
+ hashSum.update(fileBuffer);
11
+ return hashSum.digest('hex');
12
+ }
13
+ exports.hashFile = hashFile;
14
14
  //# sourceMappingURL=hash-file.js.map
@@ -1,10 +1,10 @@
1
- import { LogLevels } from 'npmlog';
2
- export declare const logger: {
3
- error: (msg: any) => void;
4
- warn: (msg: any) => void;
5
- notice: (msg: any) => void;
6
- info: (msg: any) => void;
7
- verbose: (msg: any) => void;
8
- debug: (msg: any) => void;
9
- };
10
- export declare const setLogLevel: (level: LogLevels | 'debug') => void;
1
+ import { LogLevels } from 'npmlog';
2
+ export declare const logger: {
3
+ error: (msg: any) => void;
4
+ warn: (msg: any) => void;
5
+ notice: (msg: any) => void;
6
+ info: (msg: any) => void;
7
+ verbose: (msg: any) => void;
8
+ debug: (msg: any) => void;
9
+ };
10
+ export declare const setLogLevel: (level: LogLevels | 'debug') => void;