@module-federation/error-codes 0.0.0-docs-remove-invalid-lark-link-20251205062649

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 ScriptedAlchemy LLC (Zack Jackson) Zhou Shaw (zhouxiao)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # `@module-federation/error-codes`
@@ -0,0 +1,69 @@
1
+ 'use strict';
2
+
3
+ const RUNTIME_001 = 'RUNTIME-001';
4
+ const RUNTIME_002 = 'RUNTIME-002';
5
+ const RUNTIME_003 = 'RUNTIME-003';
6
+ const RUNTIME_004 = 'RUNTIME-004';
7
+ const RUNTIME_005 = 'RUNTIME-005';
8
+ const RUNTIME_006 = 'RUNTIME-006';
9
+ const RUNTIME_007 = 'RUNTIME-007';
10
+ const RUNTIME_008 = 'RUNTIME-008';
11
+ const RUNTIME_009 = 'RUNTIME-009';
12
+ const TYPE_001 = 'TYPE-001';
13
+ const BUILD_001 = 'BUILD-001';
14
+ const BUILD_002 = 'BUILD-002';
15
+
16
+ const getDocsUrl = (errorCode) => {
17
+ const type = errorCode.split('-')[0].toLowerCase();
18
+ return `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${type}/${errorCode}`;
19
+ };
20
+ const getShortErrorMsg = (errorCode, errorDescMap, args, originalErrorMsg) => {
21
+ const msg = [`${[errorDescMap[errorCode]]} #${errorCode}`];
22
+ args && msg.push(`args: ${JSON.stringify(args)}`);
23
+ msg.push(getDocsUrl(errorCode));
24
+ originalErrorMsg && msg.push(`Original Error Message:\n ${originalErrorMsg}`);
25
+ return msg.join('\n');
26
+ };
27
+
28
+ const runtimeDescMap = {
29
+ [RUNTIME_001]: 'Failed to get remoteEntry exports.',
30
+ [RUNTIME_002]: 'The remote entry interface does not contain "init"',
31
+ [RUNTIME_003]: 'Failed to get manifest.',
32
+ [RUNTIME_004]: 'Failed to locate remote.',
33
+ [RUNTIME_005]: 'Invalid loadShareSync function call from bundler runtime',
34
+ [RUNTIME_006]: 'Invalid loadShareSync function call from runtime',
35
+ [RUNTIME_007]: 'Failed to get remote snapshot.',
36
+ [RUNTIME_008]: 'Failed to load script resources.',
37
+ [RUNTIME_009]: 'Please call createInstance first.',
38
+ };
39
+ const typeDescMap = {
40
+ [TYPE_001]: 'Failed to generate type declaration. Execute the below cmd to reproduce and fix the error.',
41
+ };
42
+ const buildDescMap = {
43
+ [BUILD_001]: 'Failed to find expose module.',
44
+ [BUILD_002]: 'PublicPath is required in prod mode.',
45
+ };
46
+ const errorDescMap = {
47
+ ...runtimeDescMap,
48
+ ...typeDescMap,
49
+ ...buildDescMap,
50
+ };
51
+
52
+ exports.BUILD_001 = BUILD_001;
53
+ exports.BUILD_002 = BUILD_002;
54
+ exports.RUNTIME_001 = RUNTIME_001;
55
+ exports.RUNTIME_002 = RUNTIME_002;
56
+ exports.RUNTIME_003 = RUNTIME_003;
57
+ exports.RUNTIME_004 = RUNTIME_004;
58
+ exports.RUNTIME_005 = RUNTIME_005;
59
+ exports.RUNTIME_006 = RUNTIME_006;
60
+ exports.RUNTIME_007 = RUNTIME_007;
61
+ exports.RUNTIME_008 = RUNTIME_008;
62
+ exports.RUNTIME_009 = RUNTIME_009;
63
+ exports.TYPE_001 = TYPE_001;
64
+ exports.buildDescMap = buildDescMap;
65
+ exports.errorDescMap = errorDescMap;
66
+ exports.getShortErrorMsg = getShortErrorMsg;
67
+ exports.runtimeDescMap = runtimeDescMap;
68
+ exports.typeDescMap = typeDescMap;
69
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","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,EAA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5
+ const RUNTIME_005 = 'RUNTIME-005';
6
+ const RUNTIME_006 = 'RUNTIME-006';
7
+ const RUNTIME_007 = 'RUNTIME-007';
8
+ const RUNTIME_008 = 'RUNTIME-008';
9
+ const RUNTIME_009 = 'RUNTIME-009';
10
+ const TYPE_001 = 'TYPE-001';
11
+ const BUILD_001 = 'BUILD-001';
12
+ const BUILD_002 = 'BUILD-002';
13
+
14
+ const getDocsUrl = (errorCode) => {
15
+ const type = errorCode.split('-')[0].toLowerCase();
16
+ return `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${type}/${errorCode}`;
17
+ };
18
+ const getShortErrorMsg = (errorCode, errorDescMap, args, originalErrorMsg) => {
19
+ const msg = [`${[errorDescMap[errorCode]]} #${errorCode}`];
20
+ args && msg.push(`args: ${JSON.stringify(args)}`);
21
+ msg.push(getDocsUrl(errorCode));
22
+ originalErrorMsg && msg.push(`Original Error Message:\n ${originalErrorMsg}`);
23
+ return msg.join('\n');
24
+ };
25
+
26
+ const runtimeDescMap = {
27
+ [RUNTIME_001]: 'Failed to get remoteEntry exports.',
28
+ [RUNTIME_002]: 'The remote entry interface does not contain "init"',
29
+ [RUNTIME_003]: 'Failed to get manifest.',
30
+ [RUNTIME_004]: 'Failed to locate remote.',
31
+ [RUNTIME_005]: 'Invalid loadShareSync function call from bundler runtime',
32
+ [RUNTIME_006]: 'Invalid loadShareSync function call from runtime',
33
+ [RUNTIME_007]: 'Failed to get remote snapshot.',
34
+ [RUNTIME_008]: 'Failed to load script resources.',
35
+ [RUNTIME_009]: 'Please call createInstance first.',
36
+ };
37
+ const typeDescMap = {
38
+ [TYPE_001]: 'Failed to generate type declaration. Execute the below cmd to reproduce and fix the error.',
39
+ };
40
+ const buildDescMap = {
41
+ [BUILD_001]: 'Failed to find expose module.',
42
+ [BUILD_002]: 'PublicPath is required in prod mode.',
43
+ };
44
+ const errorDescMap = {
45
+ ...runtimeDescMap,
46
+ ...typeDescMap,
47
+ ...buildDescMap,
48
+ };
49
+
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 };
51
+ //# sourceMappingURL=index.esm.mjs.map
@@ -0,0 +1 @@
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,IAAI,CAAC,CAAA,CAAE,CAAC;IACjD,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAC/B,gBAAgB,IAAI,GAAG,CAAC,IAAI,CAAC,CAA6B,0BAAA,EAAA,gBAAgB,CAAE,CAAA,CAAC;AAC7E,IAAA,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;AACvB;;ACDa,MAAA,cAAc,GAAG;IAC5B,CAAC,WAAW,GAAG,oCAAoC;IACnD,CAAC,WAAW,GAAG,oDAAoD;IACnE,CAAC,WAAW,GAAG,yBAAyB;IACxC,CAAC,WAAW,GAAG,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;;;;;"}
@@ -0,0 +1,32 @@
1
+ export declare const runtimeDescMap: {
2
+ "RUNTIME-001": string;
3
+ "RUNTIME-002": string;
4
+ "RUNTIME-003": string;
5
+ "RUNTIME-004": string;
6
+ "RUNTIME-005": string;
7
+ "RUNTIME-006": string;
8
+ "RUNTIME-007": string;
9
+ "RUNTIME-008": string;
10
+ "RUNTIME-009": string;
11
+ };
12
+ export declare const typeDescMap: {
13
+ "TYPE-001": string;
14
+ };
15
+ export declare const buildDescMap: {
16
+ "BUILD-001": string;
17
+ "BUILD-002": string;
18
+ };
19
+ export declare const errorDescMap: {
20
+ "BUILD-001": string;
21
+ "BUILD-002": string;
22
+ "TYPE-001": string;
23
+ "RUNTIME-001": string;
24
+ "RUNTIME-002": string;
25
+ "RUNTIME-003": string;
26
+ "RUNTIME-004": string;
27
+ "RUNTIME-005": string;
28
+ "RUNTIME-006": string;
29
+ "RUNTIME-007": string;
30
+ "RUNTIME-008": string;
31
+ "RUNTIME-009": string;
32
+ };
@@ -0,0 +1,12 @@
1
+ export declare const RUNTIME_001 = "RUNTIME-001";
2
+ export declare const RUNTIME_002 = "RUNTIME-002";
3
+ export declare const RUNTIME_003 = "RUNTIME-003";
4
+ export declare const RUNTIME_004 = "RUNTIME-004";
5
+ export declare const RUNTIME_005 = "RUNTIME-005";
6
+ export declare const RUNTIME_006 = "RUNTIME-006";
7
+ export declare const RUNTIME_007 = "RUNTIME-007";
8
+ export declare const RUNTIME_008 = "RUNTIME-008";
9
+ export declare const RUNTIME_009 = "RUNTIME-009";
10
+ export declare const TYPE_001 = "TYPE-001";
11
+ export declare const BUILD_001 = "BUILD-001";
12
+ export declare const BUILD_002 = "BUILD-002";
@@ -0,0 +1 @@
1
+ export declare const getShortErrorMsg: (errorCode: string, errorDescMap: Record<string, string>, args?: Record<string, unknown>, originalErrorMsg?: string) => string;
@@ -0,0 +1,3 @@
1
+ export * from './error-codes';
2
+ export { getShortErrorMsg } from './getShortErrorMsg';
3
+ export { runtimeDescMap, typeDescMap, errorDescMap, buildDescMap, } from './desc';
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@module-federation/error-codes",
3
+ "description": "Module Federation Error Codes",
4
+ "author": "zhanghang <hanric.zhang@gmail.com>",
5
+ "public": true,
6
+ "sideEffects": false,
7
+ "version": "0.0.0-docs-remove-invalid-lark-link-20251205062649",
8
+ "license": "MIT",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/module-federation/core.git",
12
+ "directory": "packages/error-codes"
13
+ },
14
+ "keywords": [
15
+ "Module Federation",
16
+ "error codes"
17
+ ],
18
+ "files": [
19
+ "dist/",
20
+ "README.md"
21
+ ],
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "main": "./dist/index.cjs.js",
26
+ "module": "./dist/index.esm.mjs",
27
+ "types": "./dist/index.d.ts",
28
+ "exports": {
29
+ ".": {
30
+ "import": "./dist/index.esm.mjs",
31
+ "require": "./dist/index.cjs.js"
32
+ }
33
+ },
34
+ "typesVersions": {
35
+ "*": {
36
+ ".": [
37
+ "./dist/index.d.ts"
38
+ ]
39
+ }
40
+ }
41
+ }