@module-federation/sdk 0.11.4 → 0.12.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.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var polyfills = require('./polyfills.cjs.js');
3
+ var polyfills = require('./polyfills.cjs.cjs');
4
4
 
5
5
  const FederationModuleManifest = 'federation-manifest.json';
6
6
  const MANIFEST_EXT = '.json';
@@ -339,24 +339,24 @@ function generateSnapshotFromManifest(manifest, options = {}) {
339
339
  };
340
340
  if ((_manifest_metaData = manifest.metaData) == null ? void 0 : _manifest_metaData.prefetchInterface) {
341
341
  const prefetchInterface = manifest.metaData.prefetchInterface;
342
- basicRemoteSnapshot = polyfills._extends({}, basicRemoteSnapshot, {
342
+ basicRemoteSnapshot = polyfills._({}, basicRemoteSnapshot, {
343
343
  prefetchInterface
344
344
  });
345
345
  }
346
346
  if ((_manifest_metaData1 = manifest.metaData) == null ? void 0 : _manifest_metaData1.prefetchEntry) {
347
347
  const { path, name, type } = manifest.metaData.prefetchEntry;
348
- basicRemoteSnapshot = polyfills._extends({}, basicRemoteSnapshot, {
348
+ basicRemoteSnapshot = polyfills._({}, basicRemoteSnapshot, {
349
349
  prefetchEntry: simpleJoinRemoteEntry(path, name),
350
350
  prefetchEntryType: type
351
351
  });
352
352
  }
353
353
  if ('publicPath' in manifest.metaData) {
354
- remoteSnapshot = polyfills._extends({}, basicRemoteSnapshot, {
354
+ remoteSnapshot = polyfills._({}, basicRemoteSnapshot, {
355
355
  publicPath: getPublicPath(),
356
356
  ssrPublicPath: manifest.metaData.ssrPublicPath
357
357
  });
358
358
  } else {
359
- remoteSnapshot = polyfills._extends({}, basicRemoteSnapshot, {
359
+ remoteSnapshot = polyfills._({}, basicRemoteSnapshot, {
360
360
  getPublicPath: getPublicPath()
361
361
  });
362
362
  }
@@ -600,7 +600,7 @@ function loadScript(url, info) {
600
600
  url,
601
601
  cb: resolve,
602
602
  onErrorCallback: reject,
603
- attrs: polyfills._extends({
603
+ attrs: polyfills._({
604
604
  fetchpriority: 'high'
605
605
  }, attrs),
606
606
  createScriptHook,
@@ -757,7 +757,7 @@ function normalizeOptions(enableDefault, defaultOptions, key) {
757
757
  return defaultOptions;
758
758
  }
759
759
  if (options && typeof options === 'object') {
760
- return polyfills._extends({}, defaultOptions, options);
760
+ return polyfills._({}, defaultOptions, options);
761
761
  }
762
762
  throw new Error(`Unexpected type for \`${key}\`, expect boolean/undefined/object, got: ${typeof options}`);
763
763
  };
@@ -1,4 +1,4 @@
1
- import { _ as _extends } from './polyfills.esm.mjs';
1
+ import { _ as _extends } from './polyfills.esm.js';
2
2
 
3
3
  const FederationModuleManifest = 'federation-manifest.json';
4
4
  const MANIFEST_EXT = '.json';
@@ -11,4 +11,4 @@ function _extends() {
11
11
  return _extends.apply(this, arguments);
12
12
  }
13
13
 
14
- exports._extends = _extends;
14
+ exports._ = _extends;
@@ -66,7 +66,7 @@ export interface ContainerPluginOptions {
66
66
  /**
67
67
  * The name of the share scope which is shared with the host (defaults to 'default').
68
68
  */
69
- shareScope?: string;
69
+ shareScope?: string | string[];
70
70
  /**
71
71
  * Runtime plugin file paths or package name.
72
72
  */
@@ -26,7 +26,7 @@ export interface ContainerReferencePluginOptions {
26
26
  /**
27
27
  * The name of the share scope shared with all remotes (defaults to 'default').
28
28
  */
29
- shareScope?: string;
29
+ shareScope?: string | string[];
30
30
  }
31
31
  /**
32
32
  * Container locations from which modules should be resolved and loaded at runtime. Property names are used as request scopes.
@@ -48,5 +48,5 @@ export interface RemotesConfig {
48
48
  /**
49
49
  * The name of the share scope shared with this remote.
50
50
  */
51
- shareScope?: string;
51
+ shareScope?: string | string[];
52
52
  }
@@ -116,7 +116,9 @@ export interface DtsRemoteOptions {
116
116
  compileInChildProcess?: boolean;
117
117
  compilerInstance?: 'tsc' | 'vue-tsc' | 'tspc' | string;
118
118
  generateAPITypes?: boolean;
119
- extractThirdParty?: boolean;
119
+ extractThirdParty?: boolean | {
120
+ exclude?: Array<string | RegExp>;
121
+ };
120
122
  extractRemoteTypes?: boolean;
121
123
  abortOnError?: boolean;
122
124
  }
@@ -165,7 +167,7 @@ export interface ModuleFederationPluginOptions {
165
167
  /**
166
168
  * Share scope name used for all shared modules (defaults to 'default').
167
169
  */
168
- shareScope?: string;
170
+ shareScope?: string | string[];
169
171
  /**
170
172
  * load shared strategy(defaults to 'version-first').
171
173
  */
@@ -318,7 +320,7 @@ export interface RemotesConfig {
318
320
  /**
319
321
  * The name of the share scope shared with this remote.
320
322
  */
321
- shareScope?: string;
323
+ shareScope?: string | string[];
322
324
  }
323
325
  /**
324
326
  * Modules that should be shared in the share scope. Property names are used to match requested modules in this compilation. Relative requests are resolved, module requests are matched unresolved, absolute paths will match resolved requests. A trailing slash will match all requests with this prefix. In this case shareKey must also have a trailing slash.
@@ -357,7 +359,7 @@ export interface SharedConfig {
357
359
  /**
358
360
  * Share scope name.
359
361
  */
360
- shareScope?: string;
362
+ shareScope?: string | string[];
361
363
  /**
362
364
  * load shared strategy(defaults to 'version-first').
363
365
  */
@@ -13,7 +13,7 @@ export interface SharePluginOptions {
13
13
  /**
14
14
  * Share scope name used for all shared modules (defaults to 'default').
15
15
  */
16
- shareScope?: string;
16
+ shareScope?: string | string[];
17
17
  /**
18
18
  * Modules that should be shared in the share scope. When provided, property names are used to match requested modules in this compilation.
19
19
  */
@@ -55,7 +55,7 @@ export interface SharedConfig {
55
55
  /**
56
56
  * Share scope name.
57
57
  */
58
- shareScope?: string;
58
+ shareScope?: string | string[];
59
59
  /**
60
60
  * Allow only a single version of the shared module in share scope (disabled by default).
61
61
  */
@@ -69,3 +69,10 @@ export interface SharedConfig {
69
69
  */
70
70
  version?: false | string;
71
71
  }
72
+ export declare class SharePlugin {
73
+ constructor(options: SharePluginOptions);
74
+ /**
75
+ * Apply the plugin
76
+ */
77
+ apply(compiler: any): void;
78
+ }
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@module-federation/sdk",
3
- "version": "0.11.4",
3
+ "version": "0.12.0",
4
+ "type": "module",
4
5
  "license": "MIT",
5
6
  "description": "A sdk for support module federation",
6
7
  "keywords": [
@@ -9,7 +10,8 @@
9
10
  ],
10
11
  "files": [
11
12
  "dist/",
12
- "README.md"
13
+ "README.md",
14
+ "LICENSE"
13
15
  ],
14
16
  "repository": {
15
17
  "type": "git",
@@ -21,19 +23,29 @@
21
23
  },
22
24
  "author": "zhanghang <hanric.zhang@gmail.com>",
23
25
  "sideEffects": false,
24
- "main": "./dist/index.cjs.js",
25
- "module": "./dist/index.esm.mjs",
26
+ "main": "./dist/index.cjs.cjs",
27
+ "module": "./dist/index.esm.js",
26
28
  "types": "./dist/index.cjs.d.ts",
27
29
  "exports": {
28
30
  ".": {
29
- "types": "./dist/index.cjs.d.ts",
30
- "import": "./dist/index.esm.mjs",
31
- "require": "./dist/index.cjs.js"
31
+ "import": {
32
+ "types": "./dist/index.esm.d.ts",
33
+ "default": "./dist/index.esm.js"
34
+ },
35
+ "require": {
36
+ "types": "./dist/index.cjs.d.ts",
37
+ "default": "./dist/index.cjs.cjs"
38
+ }
32
39
  },
33
40
  "./normalize-webpack-path": {
34
- "types": "./dist/normalize-webpack-path.cjs.d.ts",
35
- "import": "./dist/normalize-webpack-path.esm.mjs",
36
- "require": "./dist/normalize-webpack-path.cjs.js"
41
+ "import": {
42
+ "types": "./dist/normalize-webpack-path.esm.d.ts",
43
+ "default": "./dist/normalize-webpack-path.esm.js"
44
+ },
45
+ "require": {
46
+ "types": "./dist/normalize-webpack-path.cjs.d.ts",
47
+ "default": "./dist/normalize-webpack-path.cjs.cjs"
48
+ }
37
49
  }
38
50
  },
39
51
  "typesVersions": {
File without changes