@module-federation/error-codes 0.19.1 → 0.21.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.
- package/dist/index.cjs.js +11 -22
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.mjs +11 -22
- package/dist/index.esm.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -13,33 +13,18 @@ const TYPE_001 = 'TYPE-001';
|
|
|
13
13
|
const BUILD_001 = 'BUILD-001';
|
|
14
14
|
const BUILD_002 = 'BUILD-002';
|
|
15
15
|
|
|
16
|
-
const getDocsUrl = (errorCode)=>{
|
|
16
|
+
const getDocsUrl = (errorCode) => {
|
|
17
17
|
const type = errorCode.split('-')[0].toLowerCase();
|
|
18
18
|
return `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${type}/${errorCode}`;
|
|
19
19
|
};
|
|
20
|
-
const getShortErrorMsg = (errorCode, errorDescMap, args, originalErrorMsg)=>{
|
|
21
|
-
const msg = [
|
|
22
|
-
`${[
|
|
23
|
-
errorDescMap[errorCode]
|
|
24
|
-
]} #${errorCode}`
|
|
25
|
-
];
|
|
20
|
+
const getShortErrorMsg = (errorCode, errorDescMap, args, originalErrorMsg) => {
|
|
21
|
+
const msg = [`${[errorDescMap[errorCode]]} #${errorCode}`];
|
|
26
22
|
args && msg.push(`args: ${JSON.stringify(args)}`);
|
|
27
23
|
msg.push(getDocsUrl(errorCode));
|
|
28
24
|
originalErrorMsg && msg.push(`Original Error Message:\n ${originalErrorMsg}`);
|
|
29
25
|
return msg.join('\n');
|
|
30
26
|
};
|
|
31
27
|
|
|
32
|
-
function _extends() {
|
|
33
|
-
_extends = Object.assign || function assign(target) {
|
|
34
|
-
for(var i = 1; i < arguments.length; i++){
|
|
35
|
-
var source = arguments[i];
|
|
36
|
-
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
37
|
-
}
|
|
38
|
-
return target;
|
|
39
|
-
};
|
|
40
|
-
return _extends.apply(this, arguments);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
28
|
const runtimeDescMap = {
|
|
44
29
|
[RUNTIME_001]: 'Failed to get remoteEntry exports.',
|
|
45
30
|
[RUNTIME_002]: 'The remote entry interface does not contain "init"',
|
|
@@ -49,16 +34,20 @@ const runtimeDescMap = {
|
|
|
49
34
|
[RUNTIME_006]: 'Invalid loadShareSync function call from runtime',
|
|
50
35
|
[RUNTIME_007]: 'Failed to get remote snapshot.',
|
|
51
36
|
[RUNTIME_008]: 'Failed to load script resources.',
|
|
52
|
-
[RUNTIME_009]: 'Please call createInstance first.'
|
|
37
|
+
[RUNTIME_009]: 'Please call createInstance first.',
|
|
53
38
|
};
|
|
54
39
|
const typeDescMap = {
|
|
55
|
-
[TYPE_001]: 'Failed to generate type declaration. Execute the below cmd to reproduce and fix the error.'
|
|
40
|
+
[TYPE_001]: 'Failed to generate type declaration. Execute the below cmd to reproduce and fix the error.',
|
|
56
41
|
};
|
|
57
42
|
const buildDescMap = {
|
|
58
43
|
[BUILD_001]: 'Failed to find expose module.',
|
|
59
|
-
[BUILD_002]: 'PublicPath is required in prod mode.'
|
|
44
|
+
[BUILD_002]: 'PublicPath is required in prod mode.',
|
|
45
|
+
};
|
|
46
|
+
const errorDescMap = {
|
|
47
|
+
...runtimeDescMap,
|
|
48
|
+
...typeDescMap,
|
|
49
|
+
...buildDescMap,
|
|
60
50
|
};
|
|
61
|
-
const errorDescMap = _extends({}, runtimeDescMap, typeDescMap, buildDescMap);
|
|
62
51
|
|
|
63
52
|
exports.BUILD_001 = BUILD_001;
|
|
64
53
|
exports.BUILD_002 = BUILD_002;
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/error-codes.ts","../src/getShortErrorMsg.ts","../src/desc.ts"],"sourcesContent":[null,null,null],"names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AG,0BAA0B;IACzC,CAAC,WAAW,GAAG,0DAA0D;IACzE,CAAC,WAAW,GAAG,kDAAkD;IACjE,CAAC,WAAW,GAAG,gCAAgC;IAC/C,CAAC,WAAW,GAAG,kCAAkC;IACjD,CAAC,WAAW,GAAG,mCAAmC;;AAGvC,MAAA,WAAW,GAAG;IACzB,CAAC,QAAQ,GACP,4FAA4F;;AAGnF,MAAA,YAAY,GAAG;IAC1B,CAAC,SAAS,GAAG,+BAA+B;IAC5C,CAAC,SAAS,GAAG,sCAAsC;;AAGxC,MAAA,YAAY,GAAG;AAC1B,IAAA,GAAG,cAAc;AACjB,IAAA,GAAG,WAAW;AACd,IAAA,GAAG,YAAY;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.esm.mjs
CHANGED
|
@@ -11,33 +11,18 @@ const TYPE_001 = 'TYPE-001';
|
|
|
11
11
|
const BUILD_001 = 'BUILD-001';
|
|
12
12
|
const BUILD_002 = 'BUILD-002';
|
|
13
13
|
|
|
14
|
-
const getDocsUrl = (errorCode)=>{
|
|
14
|
+
const getDocsUrl = (errorCode) => {
|
|
15
15
|
const type = errorCode.split('-')[0].toLowerCase();
|
|
16
16
|
return `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${type}/${errorCode}`;
|
|
17
17
|
};
|
|
18
|
-
const getShortErrorMsg = (errorCode, errorDescMap, args, originalErrorMsg)=>{
|
|
19
|
-
const msg = [
|
|
20
|
-
`${[
|
|
21
|
-
errorDescMap[errorCode]
|
|
22
|
-
]} #${errorCode}`
|
|
23
|
-
];
|
|
18
|
+
const getShortErrorMsg = (errorCode, errorDescMap, args, originalErrorMsg) => {
|
|
19
|
+
const msg = [`${[errorDescMap[errorCode]]} #${errorCode}`];
|
|
24
20
|
args && msg.push(`args: ${JSON.stringify(args)}`);
|
|
25
21
|
msg.push(getDocsUrl(errorCode));
|
|
26
22
|
originalErrorMsg && msg.push(`Original Error Message:\n ${originalErrorMsg}`);
|
|
27
23
|
return msg.join('\n');
|
|
28
24
|
};
|
|
29
25
|
|
|
30
|
-
function _extends() {
|
|
31
|
-
_extends = Object.assign || function assign(target) {
|
|
32
|
-
for(var i = 1; i < arguments.length; i++){
|
|
33
|
-
var source = arguments[i];
|
|
34
|
-
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
35
|
-
}
|
|
36
|
-
return target;
|
|
37
|
-
};
|
|
38
|
-
return _extends.apply(this, arguments);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
26
|
const runtimeDescMap = {
|
|
42
27
|
[RUNTIME_001]: 'Failed to get remoteEntry exports.',
|
|
43
28
|
[RUNTIME_002]: 'The remote entry interface does not contain "init"',
|
|
@@ -47,16 +32,20 @@ const runtimeDescMap = {
|
|
|
47
32
|
[RUNTIME_006]: 'Invalid loadShareSync function call from runtime',
|
|
48
33
|
[RUNTIME_007]: 'Failed to get remote snapshot.',
|
|
49
34
|
[RUNTIME_008]: 'Failed to load script resources.',
|
|
50
|
-
[RUNTIME_009]: 'Please call createInstance first.'
|
|
35
|
+
[RUNTIME_009]: 'Please call createInstance first.',
|
|
51
36
|
};
|
|
52
37
|
const typeDescMap = {
|
|
53
|
-
[TYPE_001]: 'Failed to generate type declaration. Execute the below cmd to reproduce and fix the error.'
|
|
38
|
+
[TYPE_001]: 'Failed to generate type declaration. Execute the below cmd to reproduce and fix the error.',
|
|
54
39
|
};
|
|
55
40
|
const buildDescMap = {
|
|
56
41
|
[BUILD_001]: 'Failed to find expose module.',
|
|
57
|
-
[BUILD_002]: 'PublicPath is required in prod mode.'
|
|
42
|
+
[BUILD_002]: 'PublicPath is required in prod mode.',
|
|
43
|
+
};
|
|
44
|
+
const errorDescMap = {
|
|
45
|
+
...runtimeDescMap,
|
|
46
|
+
...typeDescMap,
|
|
47
|
+
...buildDescMap,
|
|
58
48
|
};
|
|
59
|
-
const errorDescMap = _extends({}, runtimeDescMap, typeDescMap, buildDescMap);
|
|
60
49
|
|
|
61
50
|
export { BUILD_001, BUILD_002, RUNTIME_001, RUNTIME_002, RUNTIME_003, RUNTIME_004, RUNTIME_005, RUNTIME_006, RUNTIME_007, RUNTIME_008, RUNTIME_009, TYPE_001, buildDescMap, errorDescMap, getShortErrorMsg, runtimeDescMap, typeDescMap };
|
|
62
51
|
//# sourceMappingURL=index.esm.mjs.map
|
package/dist/index.esm.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.mjs","sources":["
|
|
1
|
+
{"version":3,"file":"index.esm.mjs","sources":["../src/error-codes.ts","../src/getShortErrorMsg.ts","../src/desc.ts"],"sourcesContent":[null,null,null],"names":[],"mappings":"AAAO,MAAM,WAAW,GAAG;AACpB,MAAM,WAAW,GAAG;AACpB,MAAM,WAAW,GAAG;AACpB,MAAM,WAAW,GAAG;AACpB,MAAM,WAAW,GAAG;AACpB,MAAM,WAAW,GAAG;AACpB,MAAM,WAAW,GAAG;AACpB,MAAM,WAAW,GAAG;AACpB,MAAM,WAAW,GAAG;AAEpB,MAAM,QAAQ,GAAG;AACjB,MAAM,SAAS,GAAG;AAClB,MAAM,SAAS,GAAG;;ACZzB,MAAM,UAAU,GAAG,CAAC,SAAiB,KAAI;AACvC,IAAA,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE;AAClD,IAAA,OAAO,CAAyF,sFAAA,EAAA,IAAI,CAAI,CAAA,EAAA,SAAS,EAAE;AACrH,CAAC;AAEM,MAAM,gBAAgB,GAAG,CAC9B,SAAiB,EACjB,YAAoC,EACpC,IAA8B,EAC9B,gBAAyB,KACvB;AACF,IAAA,MAAM,GAAG,GAAG,CAAC,CAAA,EAAG,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAA,EAAA,EAAK,SAAS,CAAA,CAAE,CAAC;AAC1D,IAAA,IAAI,IAAI,GAAG,CAAC,IAAI,CAAC,CAAS,MAAA,EAAA,IAAI,CAAC,SAAS,CAAC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