@module-federation/managers 0.6.10 → 0.6.11

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/dist/index.cjs.js CHANGED
@@ -53,6 +53,7 @@ class PKGJsonManager {
53
53
  }
54
54
 
55
55
  const LOCAL_BUILD_VERSION = 'local';
56
+ const UNKNOWN_MODULE_NAME = 'UNKNOWN';
56
57
 
57
58
  function processFn(options, normalizeSimple, normalizeOptions, fn) {
58
59
  const object = (obj)=>{
@@ -108,17 +109,11 @@ function getBuildVersion() {
108
109
  function getBuildName() {
109
110
  return process.env['MF_BUILD_NAME'];
110
111
  }
111
- // RegExp for version string
112
- const VERSION_PATTERN_REGEXP = /^([\d^=v<>~]|[*xX]$)/;
113
- function isRequiredVersion(str) {
114
- return VERSION_PATTERN_REGEXP.test(str);
115
- }
116
112
 
117
113
  var utils = /*#__PURE__*/Object.freeze({
118
114
  __proto__: null,
119
115
  getBuildName: getBuildName,
120
116
  getBuildVersion: getBuildVersion,
121
- isRequiredVersion: isRequiredVersion,
122
117
  parseOptions: parseOptions
123
118
  });
124
119
 
@@ -290,7 +285,7 @@ let RemoteManager = class RemoteManager extends BasicPluginOptionsManager {
290
285
  curObj = {
291
286
  entry: normalizedOption.entry,
292
287
  alias: normalizedOption.alias,
293
- moduleName: normalizedOption.name,
288
+ moduleName: UNKNOWN_MODULE_NAME,
294
289
  federationContainerName: normalizedOption.name,
295
290
  consumingFederationContainerName: name,
296
291
  usedIn: []
@@ -298,7 +293,7 @@ let RemoteManager = class RemoteManager extends BasicPluginOptionsManager {
298
293
  } else {
299
294
  curObj = {
300
295
  alias: normalizedOption.alias,
301
- moduleName: normalizedOption.name,
296
+ moduleName: UNKNOWN_MODULE_NAME,
302
297
  version: normalizedOption.version,
303
298
  federationContainerName: normalizedOption.name,
304
299
  consumingFederationContainerName: name,
@@ -428,7 +423,7 @@ let SharedManager = class SharedManager extends BasicPluginOptionsManager {
428
423
  const normalizedShared = {};
429
424
  const sharedOptions = parseOptions(options, (item, key)=>{
430
425
  if (typeof item !== 'string') throw new Error('Unexpected array in shared');
431
- const config = item === key || !isRequiredVersion(item) ? {
426
+ const config = item === key || !sdk.isRequiredVersion(item) ? {
432
427
  import: item
433
428
  } : {
434
429
  import: key,
package/dist/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import path from 'path';
2
- import { MFModuleType, generateExposeFilename, composeKeyWithSeparator, parseEntry } from '@module-federation/sdk';
2
+ import { MFModuleType, generateExposeFilename, composeKeyWithSeparator, parseEntry, isRequiredVersion } from '@module-federation/sdk';
3
3
  import finder from 'find-pkg';
4
4
  import fs from 'fs';
5
5
  import fs$1 from 'fs-extra';
@@ -51,6 +51,7 @@ class PKGJsonManager {
51
51
  }
52
52
 
53
53
  const LOCAL_BUILD_VERSION = 'local';
54
+ const UNKNOWN_MODULE_NAME = 'UNKNOWN';
54
55
 
55
56
  function processFn(options, normalizeSimple, normalizeOptions, fn) {
56
57
  const object = (obj)=>{
@@ -106,17 +107,11 @@ function getBuildVersion() {
106
107
  function getBuildName() {
107
108
  return process.env['MF_BUILD_NAME'];
108
109
  }
109
- // RegExp for version string
110
- const VERSION_PATTERN_REGEXP = /^([\d^=v<>~]|[*xX]$)/;
111
- function isRequiredVersion(str) {
112
- return VERSION_PATTERN_REGEXP.test(str);
113
- }
114
110
 
115
111
  var utils = /*#__PURE__*/Object.freeze({
116
112
  __proto__: null,
117
113
  getBuildName: getBuildName,
118
114
  getBuildVersion: getBuildVersion,
119
- isRequiredVersion: isRequiredVersion,
120
115
  parseOptions: parseOptions
121
116
  });
122
117
 
@@ -288,7 +283,7 @@ let RemoteManager = class RemoteManager extends BasicPluginOptionsManager {
288
283
  curObj = {
289
284
  entry: normalizedOption.entry,
290
285
  alias: normalizedOption.alias,
291
- moduleName: normalizedOption.name,
286
+ moduleName: UNKNOWN_MODULE_NAME,
292
287
  federationContainerName: normalizedOption.name,
293
288
  consumingFederationContainerName: name,
294
289
  usedIn: []
@@ -296,7 +291,7 @@ let RemoteManager = class RemoteManager extends BasicPluginOptionsManager {
296
291
  } else {
297
292
  curObj = {
298
293
  alias: normalizedOption.alias,
299
- moduleName: normalizedOption.name,
294
+ moduleName: UNKNOWN_MODULE_NAME,
300
295
  version: normalizedOption.version,
301
296
  federationContainerName: normalizedOption.name,
302
297
  consumingFederationContainerName: name,
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/managers",
3
- "version": "0.6.10",
3
+ "version": "0.6.11",
4
4
  "license": "MIT",
5
5
  "description": "Provide managers for helping handle mf data .",
6
6
  "keywords": [
@@ -1 +1,2 @@
1
1
  export declare const LOCAL_BUILD_VERSION = "local";
2
+ export declare const UNKNOWN_MODULE_NAME = "UNKNOWN";
@@ -2,4 +2,3 @@ import { ContainerOptionsFormat, NormalizeSimple, NormalizeOptions, ParsedContai
2
2
  export declare function parseOptions<T, R>(options: ContainerOptionsFormat<T>, normalizeSimple: NormalizeSimple<R>, normalizeOptions: NormalizeOptions<T, R>): ParsedContainerOptions<R>;
3
3
  export declare function getBuildVersion(): string;
4
4
  export declare function getBuildName(): string | undefined;
5
- export declare function isRequiredVersion(str: string): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/managers",
3
- "version": "0.6.10",
3
+ "version": "0.6.11",
4
4
  "license": "MIT",
5
5
  "description": "Provide managers for helping handle mf data .",
6
6
  "keywords": [
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "find-pkg": "2.0.0",
23
23
  "fs-extra": "9.1.0",
24
- "@module-federation/sdk": "0.6.10"
24
+ "@module-federation/sdk": "0.6.11"
25
25
  },
26
26
  "devDependencies": {
27
27
  "webpack": "5.93.0"