@softarc/native-federation 0.9.1 → 0.9.2-beta.3

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/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@softarc/native-federation",
3
- "version": "0.9.1",
3
+ "version": "0.9.2-beta.3",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./src/index.d.ts",
7
7
  "dependencies": {},
8
8
  "peerDependencies": {
9
- "@softarc/native-federation-runtime": "0.9.1"
9
+ "@softarc/native-federation-runtime": "0.9.2-beta.3"
10
10
  }
11
11
  }
@@ -4,6 +4,7 @@ export interface SharedConfig {
4
4
  strictVersion?: boolean;
5
5
  requiredVersion?: string;
6
6
  version?: string;
7
+ includeSecondaries?: boolean;
7
8
  }
8
9
  export interface FederationConfig {
9
10
  name?: string;
@@ -17,6 +18,7 @@ export interface NormalizedSharedConfig {
17
18
  strictVersion: boolean;
18
19
  requiredVersion: string;
19
20
  version?: string;
21
+ includeSecondaries?: boolean;
20
22
  }
21
23
  export interface NormalizedFederationConfig {
22
24
  name: string;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.withNativeFederation = void 0;
4
4
  const mapped_paths_1 = require("../utils/mapped-paths");
5
- const config_1 = require("../config");
5
+ const share_utils_1 = require("./share-utils");
6
6
  function withNativeFederation(config) {
7
7
  var _a, _b, _c;
8
8
  const skip = (_a = new Set(config.skip)) !== null && _a !== void 0 ? _a : new Set();
@@ -18,7 +18,7 @@ function normalizeShared(config, skip) {
18
18
  let result = {};
19
19
  const shared = config.shared;
20
20
  if (!shared) {
21
- result = (0, config_1.shareAll)({
21
+ result = (0, share_utils_1.shareAll)({
22
22
  singleton: true,
23
23
  strictVersion: true,
24
24
  requiredVersion: 'auto',
@@ -32,9 +32,10 @@ function normalizeShared(config, skip) {
32
32
  singleton: (_b = shared[cur].singleton) !== null && _b !== void 0 ? _b : false,
33
33
  strictVersion: (_c = shared[cur].strictVersion) !== null && _c !== void 0 ? _c : false,
34
34
  version: shared[cur].version,
35
+ includeSecondaries: shared[cur].includeSecondaries
35
36
  } }));
36
37
  }, {});
37
- result = (0, config_1.share)(result);
38
+ result = (0, share_utils_1.share)(result);
38
39
  }
39
40
  result = Object.keys(result)
40
41
  .filter((key) => !skip.has(key))
@@ -42,7 +43,7 @@ function normalizeShared(config, skip) {
42
43
  return result;
43
44
  }
44
45
  function normalizeSharedMappings(config, skip) {
45
- const rootTsConfigPath = (0, config_1.findRootTsConfigJson)();
46
+ const rootTsConfigPath = (0, share_utils_1.findRootTsConfigJson)();
46
47
  const paths = (0, mapped_paths_1.getMappedPaths)({
47
48
  rootTsConfigPath,
48
49
  sharedMappings: config.sharedMappings,
@@ -1 +1 @@
1
- {"version":3,"file":"with-native-federation.js","sourceRoot":"","sources":["../../../../../../libs/native-federation-core/src/lib/config/with-native-federation.ts"],"names":[],"mappings":";;;AAAA,wDAAmE;AACnE,sCAAkE;AAOlE,SAAgB,oBAAoB,CAClC,MAAwB;;IAExB,MAAM,IAAI,GAAG,MAAA,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,mCAAI,IAAI,GAAG,EAAU,CAAC;IAEvD,OAAO;QACL,IAAI,EAAE,MAAA,MAAM,CAAC,IAAI,mCAAI,EAAE;QACvB,OAAO,EAAE,MAAA,MAAM,CAAC,OAAO,mCAAI,EAAE;QAC7B,MAAM,EAAE,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC;QACrC,cAAc,EAAE,uBAAuB,CAAC,MAAM,EAAE,IAAI,CAAC;KACtD,CAAC;AACJ,CAAC;AAXD,oDAWC;AAED,SAAS,eAAe,CACtB,MAAwB,EACxB,IAAiB;IAEjB,IAAI,MAAM,GAA2C,EAAE,CAAC;IAExD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAE7B,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,GAAG,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MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAErD,OAAO,MAAM,CAAC;AAChB,CAAC"}
1
+ {"version":3,"file":"with-native-federation.js","sourceRoot":"","sources":["../../../../../../libs/native-federation-core/src/lib/config/with-native-federation.ts"],"names":[],"mappings":";;;AAAA,wDAAmE;AACnE,+CAAsE;AAOtE,SAAgB,oBAAoB,CAClC,MAAwB;;IAExB,MAAM,IAAI,GAAG,MAAA,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,mCAAI,IAAI,GAAG,EAAU,CAAC;IAEvD,OAAO;QACL,IAAI,EAAE,MAAA,MAAM,CAAC,IAAI,mCAAI,EAAE;QACvB,OAAO,EAAE,MAAA,MAAM,CAAC,OAAO,mCAAI,EAAE;QAC7B,MAAM,EAAE,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC;QACrC,cAAc,EAAE,uBAAuB,CAAC,MAAM,EAAE,IAAI,CAAC;KACtD,CAAC;AACJ,CAAC;AAXD,oDAWC;AAED,SAAS,eAAe,CACtB,MAAwB,EACxB,IAAiB;IAEjB,IAAI,MAAM,GAA2C,EAAE,CAAC;IAExD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAE7B,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,GAAG,IAAA,sBAAQ,EAAC;YAChB,SAAS,EAAE,IAAI;YACf,aAAa,EAAE,IAAI;YACnB,eAAe,EAAE,MAAM;SACxB,CAA2C,CAAC;KAC9C;SAAM;QACL,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CACjC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;;YAAC,OAAA,iCACT,GAAG,KACN,CAAC,GAAG,CAAC,EAAE;oBACL,eAAe,EAAE,MAAA,MAAM,CAAC,GAAG,CAAC,CA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-federation-runtime',
6
6
  '@softarc/module-federation-core',
7
+ '@softarc/module-federation',
7
8
  '@angular-architects/native-federation',
8
9
  '@angular-architects/native-federation-runtime',
9
10
  'es-module-shims',
@@ -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":";;;AAAa,QAAA,iBAAiB,GAAG,IAAI,GAAG,CAAC;IACvC,oCAAoC;IACpC,iCAAiC;IACjC,uCAAuC;IACvC,+CAA+C;IAC/C,iBAAiB;CAClB,CAAC,CAAC"}
1
+ {"version":3,"file":"default-skip-list.js","sourceRoot":"","sources":["../../../../../../libs/native-federation-core/src/lib/core/default-skip-list.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG,IAAI,GAAG,CAAC;IACvC,oCAAoC;IACpC,iCAAiC;IACjC,4BAA4B;IAC5B,uCAAuC;IACvC,+CAA+C;IAC/C,iBAAiB;CAClB,CAAC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  export interface FederationOptions {
2
2
  workspaceRoot: string;
3
3
  outputPath: string;
4
+ federationConfig: string;
4
5
  tsConfig?: string;
5
6
  verbose?: boolean;
6
7
  }
@@ -1,2 +1,3 @@
1
1
  import { NormalizedFederationConfig } from '../config/federation-config';
2
- export declare function loadFederationConfig(fullConfigPath: string): Promise<NormalizedFederationConfig>;
2
+ import { FederationOptions } from './federation-options';
3
+ export declare function loadFederationConfig(fedOptions: FederationOptions): Promise<NormalizedFederationConfig>;
@@ -2,8 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadFederationConfig = void 0;
4
4
  const tslib_1 = require("tslib");
5
- function loadFederationConfig(fullConfigPath) {
5
+ const path = require("path");
6
+ const fs = require("fs");
7
+ function loadFederationConfig(fedOptions) {
6
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
+ }
7
13
  const config = (yield Promise.resolve().then(() => require(fullConfigPath)));
8
14
  return config;
9
15
  });
@@ -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,SAAsB,oBAAoB,CAAC,cAAsB;;QAC/D,MAAM,MAAM,GAAG,CAAC,2CAAa,cAAc,EAAC,CAA+B,CAAC;QAC5E,OAAO,MAAM,CAAC;IAChB,CAAC;CAAA;AAHD,oDAGC"}
1
+ {"version":3,"file":"load-federation-config.js","sourceRoot":"","sources":["../../../../../../libs/native-federation-core/src/lib/core/load-federation-config.ts"],"names":[],"mappings":";;;;AAEA,6BAA6B;AAC7B,yBAAyB;AAEzB,SAAsB,oBAAoB,CAAC,UAA6B;;QAEtE,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC;QAExF,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,2CAAa,cAAc,EAAC,CAA+B,CAAC;QAC5E,OAAO,MAAM,CAAC;IAChB,CAAC;CAAA;AAVD,oDAUC"}
@@ -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-core/src/lib/config/index.ts"],"names":[],"mappings":";;;;AAAA,mEAAyC;AACzC,yEAIuD;AAHrD,+GAAA,oBAAoB,OAAA;AACpB,gGAAA,KAAK,OAAA;AACL,mGAAA,QAAQ,OAAA"}