@module-federation/error-codes 0.0.0-feat-skill-20260303081221 → 0.0.0-feat-runtime-010-20260304084757

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.
Files changed (51) hide show
  1. package/dist/desc.cjs +32 -0
  2. package/dist/desc.cjs.map +1 -0
  3. package/dist/desc.d.mts +38 -0
  4. package/dist/desc.d.ts +38 -0
  5. package/dist/desc.mjs +29 -0
  6. package/dist/desc.mjs.map +1 -0
  7. package/dist/error-codes.cjs +31 -0
  8. package/dist/error-codes.cjs.map +1 -0
  9. package/dist/error-codes.d.mts +17 -0
  10. package/dist/error-codes.d.ts +17 -0
  11. package/dist/error-codes.mjs +18 -0
  12. package/dist/error-codes.mjs.map +1 -0
  13. package/dist/getShortErrorMsg.cjs +16 -0
  14. package/dist/getShortErrorMsg.cjs.map +1 -0
  15. package/dist/getShortErrorMsg.d.mts +5 -0
  16. package/dist/getShortErrorMsg.d.ts +5 -0
  17. package/dist/getShortErrorMsg.mjs +15 -0
  18. package/dist/getShortErrorMsg.mjs.map +1 -0
  19. package/dist/index.cjs +23 -0
  20. package/dist/index.d.mts +4 -0
  21. package/dist/index.d.ts +4 -1
  22. package/dist/index.mjs +5 -0
  23. package/package.json +11 -22
  24. package/dist/browser.cjs.js +0 -23
  25. package/dist/browser.cjs.js.map +0 -1
  26. package/dist/browser.d.ts +0 -1
  27. package/dist/browser.esm.d.ts +0 -1
  28. package/dist/browser.esm.mjs +0 -21
  29. package/dist/browser.esm.mjs.map +0 -1
  30. package/dist/getShortErrorMsg.cjs.js +0 -16
  31. package/dist/getShortErrorMsg.cjs.js.map +0 -1
  32. package/dist/getShortErrorMsg.esm.mjs +0 -14
  33. package/dist/getShortErrorMsg.esm.mjs.map +0 -1
  34. package/dist/index.cjs.js +0 -62
  35. package/dist/index.cjs.js.map +0 -1
  36. package/dist/index.esm.d.ts +0 -1
  37. package/dist/index.esm.mjs +0 -43
  38. package/dist/index.esm.mjs.map +0 -1
  39. package/dist/node.cjs.js +0 -28
  40. package/dist/node.cjs.js.map +0 -1
  41. package/dist/node.d.ts +0 -1
  42. package/dist/node.esm.d.ts +0 -1
  43. package/dist/node.esm.mjs +0 -26
  44. package/dist/node.esm.mjs.map +0 -1
  45. package/dist/src/MFContext.d.ts +0 -80
  46. package/dist/src/browser.d.ts +0 -9
  47. package/dist/src/desc.d.ts +0 -34
  48. package/dist/src/error-codes.d.ts +0 -13
  49. package/dist/src/getShortErrorMsg.d.ts +0 -1
  50. package/dist/src/index.d.ts +0 -4
  51. package/dist/src/node.d.ts +0 -2
package/dist/desc.cjs ADDED
@@ -0,0 +1,32 @@
1
+ const require_error_codes = require('./error-codes.cjs');
2
+
3
+ //#region src/desc.ts
4
+ const runtimeDescMap = {
5
+ [require_error_codes.RUNTIME_001]: "Failed to get remoteEntry exports.",
6
+ [require_error_codes.RUNTIME_002]: "The remote entry interface does not contain \"init\"",
7
+ [require_error_codes.RUNTIME_003]: "Failed to get manifest.",
8
+ [require_error_codes.RUNTIME_004]: "Failed to locate remote.",
9
+ [require_error_codes.RUNTIME_005]: "Invalid loadShareSync function call from bundler runtime",
10
+ [require_error_codes.RUNTIME_006]: "Invalid loadShareSync function call from runtime",
11
+ [require_error_codes.RUNTIME_007]: "Failed to get remote snapshot.",
12
+ [require_error_codes.RUNTIME_008]: "Failed to load script resources.",
13
+ [require_error_codes.RUNTIME_009]: "Please call createInstance first.",
14
+ [require_error_codes.RUNTIME_010]: "The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use \"createInstance\" api."
15
+ };
16
+ const typeDescMap = { [require_error_codes.TYPE_001]: "Failed to generate type declaration. Execute the below cmd to reproduce and fix the error." };
17
+ const buildDescMap = {
18
+ [require_error_codes.BUILD_001]: "Failed to find expose module.",
19
+ [require_error_codes.BUILD_002]: "PublicPath is required in prod mode."
20
+ };
21
+ const errorDescMap = {
22
+ ...runtimeDescMap,
23
+ ...typeDescMap,
24
+ ...buildDescMap
25
+ };
26
+
27
+ //#endregion
28
+ exports.buildDescMap = buildDescMap;
29
+ exports.errorDescMap = errorDescMap;
30
+ exports.runtimeDescMap = runtimeDescMap;
31
+ exports.typeDescMap = typeDescMap;
32
+ //# sourceMappingURL=desc.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"desc.cjs","names":["RUNTIME_001","RUNTIME_002","RUNTIME_003","RUNTIME_004","RUNTIME_005","RUNTIME_006","RUNTIME_007","RUNTIME_008","RUNTIME_009","RUNTIME_010","TYPE_001","BUILD_001","BUILD_002"],"sources":["../src/desc.ts"],"sourcesContent":["import {\n RUNTIME_001,\n RUNTIME_002,\n RUNTIME_003,\n RUNTIME_004,\n RUNTIME_005,\n RUNTIME_006,\n RUNTIME_007,\n RUNTIME_008,\n RUNTIME_009,\n RUNTIME_010,\n TYPE_001,\n BUILD_001,\n BUILD_002,\n} from './error-codes';\n\nexport const runtimeDescMap = {\n [RUNTIME_001]: 'Failed to get remoteEntry exports.',\n [RUNTIME_002]: 'The remote entry interface does not contain \"init\"',\n [RUNTIME_003]: 'Failed to get manifest.',\n [RUNTIME_004]: 'Failed to locate remote.',\n [RUNTIME_005]: 'Invalid loadShareSync function call from bundler runtime',\n [RUNTIME_006]: 'Invalid loadShareSync function call from runtime',\n [RUNTIME_007]: 'Failed to get remote snapshot.',\n [RUNTIME_008]: 'Failed to load script resources.',\n [RUNTIME_009]: 'Please call createInstance first.',\n [RUNTIME_010]:\n 'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use \"createInstance\" api.',\n};\n\nexport const typeDescMap = {\n [TYPE_001]:\n 'Failed to generate type declaration. Execute the below cmd to reproduce and fix the error.',\n};\n\nexport const buildDescMap = {\n [BUILD_001]: 'Failed to find expose module.',\n [BUILD_002]: 'PublicPath is required in prod mode.',\n};\n\nexport const errorDescMap = {\n ...runtimeDescMap,\n ...typeDescMap,\n ...buildDescMap,\n};\n"],"mappings":";;;AAgBA,MAAa,iBAAiB;EAC3BA,kCAAc;EACdC,kCAAc;EACdC,kCAAc;EACdC,kCAAc;EACdC,kCAAc;EACdC,kCAAc;EACdC,kCAAc;EACdC,kCAAc;EACdC,kCAAc;EACdC,kCACC;CACH;AAED,MAAa,cAAc,GACxBC,+BACC,8FACH;AAED,MAAa,eAAe;EACzBC,gCAAY;EACZC,gCAAY;CACd;AAED,MAAa,eAAe;CAC1B,GAAG;CACH,GAAG;CACH,GAAG;CACJ"}
@@ -0,0 +1,38 @@
1
+ //#region src/desc.d.ts
2
+ declare const runtimeDescMap: {
3
+ "RUNTIME-001": string;
4
+ "RUNTIME-002": string;
5
+ "RUNTIME-003": string;
6
+ "RUNTIME-004": string;
7
+ "RUNTIME-005": string;
8
+ "RUNTIME-006": string;
9
+ "RUNTIME-007": string;
10
+ "RUNTIME-008": string;
11
+ "RUNTIME-009": string;
12
+ "RUNTIME-010": string;
13
+ };
14
+ declare const typeDescMap: {
15
+ "TYPE-001": string;
16
+ };
17
+ declare const buildDescMap: {
18
+ "BUILD-001": string;
19
+ "BUILD-002": string;
20
+ };
21
+ declare const errorDescMap: {
22
+ "BUILD-001": string;
23
+ "BUILD-002": string;
24
+ "TYPE-001": string;
25
+ "RUNTIME-001": string;
26
+ "RUNTIME-002": string;
27
+ "RUNTIME-003": string;
28
+ "RUNTIME-004": string;
29
+ "RUNTIME-005": string;
30
+ "RUNTIME-006": string;
31
+ "RUNTIME-007": string;
32
+ "RUNTIME-008": string;
33
+ "RUNTIME-009": string;
34
+ "RUNTIME-010": string;
35
+ };
36
+ //#endregion
37
+ export { buildDescMap, errorDescMap, runtimeDescMap, typeDescMap };
38
+ //# sourceMappingURL=desc.d.mts.map
package/dist/desc.d.ts ADDED
@@ -0,0 +1,38 @@
1
+ //#region src/desc.d.ts
2
+ declare const runtimeDescMap: {
3
+ "RUNTIME-001": string;
4
+ "RUNTIME-002": string;
5
+ "RUNTIME-003": string;
6
+ "RUNTIME-004": string;
7
+ "RUNTIME-005": string;
8
+ "RUNTIME-006": string;
9
+ "RUNTIME-007": string;
10
+ "RUNTIME-008": string;
11
+ "RUNTIME-009": string;
12
+ "RUNTIME-010": string;
13
+ };
14
+ declare const typeDescMap: {
15
+ "TYPE-001": string;
16
+ };
17
+ declare const buildDescMap: {
18
+ "BUILD-001": string;
19
+ "BUILD-002": string;
20
+ };
21
+ declare const errorDescMap: {
22
+ "BUILD-001": string;
23
+ "BUILD-002": string;
24
+ "TYPE-001": string;
25
+ "RUNTIME-001": string;
26
+ "RUNTIME-002": string;
27
+ "RUNTIME-003": string;
28
+ "RUNTIME-004": string;
29
+ "RUNTIME-005": string;
30
+ "RUNTIME-006": string;
31
+ "RUNTIME-007": string;
32
+ "RUNTIME-008": string;
33
+ "RUNTIME-009": string;
34
+ "RUNTIME-010": string;
35
+ };
36
+ //#endregion
37
+ export { buildDescMap, errorDescMap, runtimeDescMap, typeDescMap };
38
+ //# sourceMappingURL=desc.d.ts.map
package/dist/desc.mjs ADDED
@@ -0,0 +1,29 @@
1
+ import { BUILD_001, BUILD_002, RUNTIME_001, RUNTIME_002, RUNTIME_003, RUNTIME_004, RUNTIME_005, RUNTIME_006, RUNTIME_007, RUNTIME_008, RUNTIME_009, RUNTIME_010, TYPE_001 } from "./error-codes.mjs";
2
+
3
+ //#region src/desc.ts
4
+ const runtimeDescMap = {
5
+ [RUNTIME_001]: "Failed to get remoteEntry exports.",
6
+ [RUNTIME_002]: "The remote entry interface does not contain \"init\"",
7
+ [RUNTIME_003]: "Failed to get manifest.",
8
+ [RUNTIME_004]: "Failed to locate remote.",
9
+ [RUNTIME_005]: "Invalid loadShareSync function call from bundler runtime",
10
+ [RUNTIME_006]: "Invalid loadShareSync function call from runtime",
11
+ [RUNTIME_007]: "Failed to get remote snapshot.",
12
+ [RUNTIME_008]: "Failed to load script resources.",
13
+ [RUNTIME_009]: "Please call createInstance first.",
14
+ [RUNTIME_010]: "The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use \"createInstance\" api."
15
+ };
16
+ const typeDescMap = { [TYPE_001]: "Failed to generate type declaration. Execute the below cmd to reproduce and fix the error." };
17
+ const buildDescMap = {
18
+ [BUILD_001]: "Failed to find expose module.",
19
+ [BUILD_002]: "PublicPath is required in prod mode."
20
+ };
21
+ const errorDescMap = {
22
+ ...runtimeDescMap,
23
+ ...typeDescMap,
24
+ ...buildDescMap
25
+ };
26
+
27
+ //#endregion
28
+ export { buildDescMap, errorDescMap, runtimeDescMap, typeDescMap };
29
+ //# sourceMappingURL=desc.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"desc.mjs","names":[],"sources":["../src/desc.ts"],"sourcesContent":["import {\n RUNTIME_001,\n RUNTIME_002,\n RUNTIME_003,\n RUNTIME_004,\n RUNTIME_005,\n RUNTIME_006,\n RUNTIME_007,\n RUNTIME_008,\n RUNTIME_009,\n RUNTIME_010,\n TYPE_001,\n BUILD_001,\n BUILD_002,\n} from './error-codes';\n\nexport const runtimeDescMap = {\n [RUNTIME_001]: 'Failed to get remoteEntry exports.',\n [RUNTIME_002]: 'The remote entry interface does not contain \"init\"',\n [RUNTIME_003]: 'Failed to get manifest.',\n [RUNTIME_004]: 'Failed to locate remote.',\n [RUNTIME_005]: 'Invalid loadShareSync function call from bundler runtime',\n [RUNTIME_006]: 'Invalid loadShareSync function call from runtime',\n [RUNTIME_007]: 'Failed to get remote snapshot.',\n [RUNTIME_008]: 'Failed to load script resources.',\n [RUNTIME_009]: 'Please call createInstance first.',\n [RUNTIME_010]:\n 'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use \"createInstance\" api.',\n};\n\nexport const typeDescMap = {\n [TYPE_001]:\n 'Failed to generate type declaration. Execute the below cmd to reproduce and fix the error.',\n};\n\nexport const buildDescMap = {\n [BUILD_001]: 'Failed to find expose module.',\n [BUILD_002]: 'PublicPath is required in prod mode.',\n};\n\nexport const errorDescMap = {\n ...runtimeDescMap,\n ...typeDescMap,\n ...buildDescMap,\n};\n"],"mappings":";;;AAgBA,MAAa,iBAAiB;EAC3B,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cACC;CACH;AAED,MAAa,cAAc,GACxB,WACC,8FACH;AAED,MAAa,eAAe;EACzB,YAAY;EACZ,YAAY;CACd;AAED,MAAa,eAAe;CAC1B,GAAG;CACH,GAAG;CACH,GAAG;CACJ"}
@@ -0,0 +1,31 @@
1
+
2
+ //#region src/error-codes.ts
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 RUNTIME_010 = "RUNTIME-010";
13
+ const TYPE_001 = "TYPE-001";
14
+ const BUILD_001 = "BUILD-001";
15
+ const BUILD_002 = "BUILD-002";
16
+
17
+ //#endregion
18
+ exports.BUILD_001 = BUILD_001;
19
+ exports.BUILD_002 = BUILD_002;
20
+ exports.RUNTIME_001 = RUNTIME_001;
21
+ exports.RUNTIME_002 = RUNTIME_002;
22
+ exports.RUNTIME_003 = RUNTIME_003;
23
+ exports.RUNTIME_004 = RUNTIME_004;
24
+ exports.RUNTIME_005 = RUNTIME_005;
25
+ exports.RUNTIME_006 = RUNTIME_006;
26
+ exports.RUNTIME_007 = RUNTIME_007;
27
+ exports.RUNTIME_008 = RUNTIME_008;
28
+ exports.RUNTIME_009 = RUNTIME_009;
29
+ exports.RUNTIME_010 = RUNTIME_010;
30
+ exports.TYPE_001 = TYPE_001;
31
+ //# sourceMappingURL=error-codes.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-codes.cjs","names":[],"sources":["../src/error-codes.ts"],"sourcesContent":["export const RUNTIME_001 = 'RUNTIME-001';\nexport const RUNTIME_002 = 'RUNTIME-002';\nexport const RUNTIME_003 = 'RUNTIME-003';\nexport const RUNTIME_004 = 'RUNTIME-004';\nexport const RUNTIME_005 = 'RUNTIME-005';\nexport const RUNTIME_006 = 'RUNTIME-006';\nexport const RUNTIME_007 = 'RUNTIME-007';\nexport const RUNTIME_008 = 'RUNTIME-008';\nexport const RUNTIME_009 = 'RUNTIME-009';\nexport const RUNTIME_010 = 'RUNTIME-010';\n\nexport const TYPE_001 = 'TYPE-001';\nexport const BUILD_001 = 'BUILD-001';\nexport const BUILD_002 = 'BUILD-002';\n"],"mappings":";;AAAA,MAAa,cAAc;AAC3B,MAAa,cAAc;AAC3B,MAAa,cAAc;AAC3B,MAAa,cAAc;AAC3B,MAAa,cAAc;AAC3B,MAAa,cAAc;AAC3B,MAAa,cAAc;AAC3B,MAAa,cAAc;AAC3B,MAAa,cAAc;AAC3B,MAAa,cAAc;AAE3B,MAAa,WAAW;AACxB,MAAa,YAAY;AACzB,MAAa,YAAY"}
@@ -0,0 +1,17 @@
1
+ //#region src/error-codes.d.ts
2
+ declare const RUNTIME_001 = "RUNTIME-001";
3
+ declare const RUNTIME_002 = "RUNTIME-002";
4
+ declare const RUNTIME_003 = "RUNTIME-003";
5
+ declare const RUNTIME_004 = "RUNTIME-004";
6
+ declare const RUNTIME_005 = "RUNTIME-005";
7
+ declare const RUNTIME_006 = "RUNTIME-006";
8
+ declare const RUNTIME_007 = "RUNTIME-007";
9
+ declare const RUNTIME_008 = "RUNTIME-008";
10
+ declare const RUNTIME_009 = "RUNTIME-009";
11
+ declare const RUNTIME_010 = "RUNTIME-010";
12
+ declare const TYPE_001 = "TYPE-001";
13
+ declare const BUILD_001 = "BUILD-001";
14
+ declare const BUILD_002 = "BUILD-002";
15
+ //#endregion
16
+ export { BUILD_001, BUILD_002, RUNTIME_001, RUNTIME_002, RUNTIME_003, RUNTIME_004, RUNTIME_005, RUNTIME_006, RUNTIME_007, RUNTIME_008, RUNTIME_009, RUNTIME_010, TYPE_001 };
17
+ //# sourceMappingURL=error-codes.d.mts.map
@@ -0,0 +1,17 @@
1
+ //#region src/error-codes.d.ts
2
+ declare const RUNTIME_001 = "RUNTIME-001";
3
+ declare const RUNTIME_002 = "RUNTIME-002";
4
+ declare const RUNTIME_003 = "RUNTIME-003";
5
+ declare const RUNTIME_004 = "RUNTIME-004";
6
+ declare const RUNTIME_005 = "RUNTIME-005";
7
+ declare const RUNTIME_006 = "RUNTIME-006";
8
+ declare const RUNTIME_007 = "RUNTIME-007";
9
+ declare const RUNTIME_008 = "RUNTIME-008";
10
+ declare const RUNTIME_009 = "RUNTIME-009";
11
+ declare const RUNTIME_010 = "RUNTIME-010";
12
+ declare const TYPE_001 = "TYPE-001";
13
+ declare const BUILD_001 = "BUILD-001";
14
+ declare const BUILD_002 = "BUILD-002";
15
+ //#endregion
16
+ export { BUILD_001, BUILD_002, RUNTIME_001, RUNTIME_002, RUNTIME_003, RUNTIME_004, RUNTIME_005, RUNTIME_006, RUNTIME_007, RUNTIME_008, RUNTIME_009, RUNTIME_010, TYPE_001 };
17
+ //# sourceMappingURL=error-codes.d.ts.map
@@ -0,0 +1,18 @@
1
+ //#region src/error-codes.ts
2
+ const RUNTIME_001 = "RUNTIME-001";
3
+ const RUNTIME_002 = "RUNTIME-002";
4
+ const RUNTIME_003 = "RUNTIME-003";
5
+ const RUNTIME_004 = "RUNTIME-004";
6
+ const RUNTIME_005 = "RUNTIME-005";
7
+ const RUNTIME_006 = "RUNTIME-006";
8
+ const RUNTIME_007 = "RUNTIME-007";
9
+ const RUNTIME_008 = "RUNTIME-008";
10
+ const RUNTIME_009 = "RUNTIME-009";
11
+ const RUNTIME_010 = "RUNTIME-010";
12
+ const TYPE_001 = "TYPE-001";
13
+ const BUILD_001 = "BUILD-001";
14
+ const BUILD_002 = "BUILD-002";
15
+
16
+ //#endregion
17
+ export { BUILD_001, BUILD_002, RUNTIME_001, RUNTIME_002, RUNTIME_003, RUNTIME_004, RUNTIME_005, RUNTIME_006, RUNTIME_007, RUNTIME_008, RUNTIME_009, RUNTIME_010, TYPE_001 };
18
+ //# sourceMappingURL=error-codes.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-codes.mjs","names":[],"sources":["../src/error-codes.ts"],"sourcesContent":["export const RUNTIME_001 = 'RUNTIME-001';\nexport const RUNTIME_002 = 'RUNTIME-002';\nexport const RUNTIME_003 = 'RUNTIME-003';\nexport const RUNTIME_004 = 'RUNTIME-004';\nexport const RUNTIME_005 = 'RUNTIME-005';\nexport const RUNTIME_006 = 'RUNTIME-006';\nexport const RUNTIME_007 = 'RUNTIME-007';\nexport const RUNTIME_008 = 'RUNTIME-008';\nexport const RUNTIME_009 = 'RUNTIME-009';\nexport const RUNTIME_010 = 'RUNTIME-010';\n\nexport const TYPE_001 = 'TYPE-001';\nexport const BUILD_001 = 'BUILD-001';\nexport const BUILD_002 = 'BUILD-002';\n"],"mappings":";AAAA,MAAa,cAAc;AAC3B,MAAa,cAAc;AAC3B,MAAa,cAAc;AAC3B,MAAa,cAAc;AAC3B,MAAa,cAAc;AAC3B,MAAa,cAAc;AAC3B,MAAa,cAAc;AAC3B,MAAa,cAAc;AAC3B,MAAa,cAAc;AAC3B,MAAa,cAAc;AAE3B,MAAa,WAAW;AACxB,MAAa,YAAY;AACzB,MAAa,YAAY"}
@@ -0,0 +1,16 @@
1
+
2
+ //#region src/getShortErrorMsg.ts
3
+ const getDocsUrl = (errorCode) => {
4
+ return `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${errorCode.split("-")[0].toLowerCase()}#${errorCode.toLowerCase()}`;
5
+ };
6
+ const getShortErrorMsg = (errorCode, errorDescMap, args, originalErrorMsg) => {
7
+ const msg = [`${[errorDescMap[errorCode]]} #${errorCode}`];
8
+ args && msg.push(`args: ${JSON.stringify(args)}`);
9
+ msg.push(getDocsUrl(errorCode));
10
+ originalErrorMsg && msg.push(`Original Error Message:\n ${originalErrorMsg}`);
11
+ return msg.join("\n");
12
+ };
13
+
14
+ //#endregion
15
+ exports.getShortErrorMsg = getShortErrorMsg;
16
+ //# sourceMappingURL=getShortErrorMsg.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getShortErrorMsg.cjs","names":[],"sources":["../src/getShortErrorMsg.ts"],"sourcesContent":["const getDocsUrl = (errorCode: string) => {\n const type = errorCode.split('-')[0].toLowerCase();\n return `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${type}#${errorCode.toLowerCase()}`;\n};\n\nexport const getShortErrorMsg = (\n errorCode: string,\n errorDescMap: Record<string, string>,\n args?: Record<string, unknown>,\n originalErrorMsg?: string,\n) => {\n const msg = [`${[errorDescMap[errorCode]]} #${errorCode}`];\n args && msg.push(`args: ${JSON.stringify(args)}`);\n msg.push(getDocsUrl(errorCode));\n originalErrorMsg && msg.push(`Original Error Message:\\n ${originalErrorMsg}`);\n return msg.join('\\n');\n};\n"],"mappings":";;AAAA,MAAM,cAAc,cAAsB;AAExC,QAAO,yFADM,UAAU,MAAM,IAAI,CAAC,GAAG,aAAa,CACmD,GAAG,UAAU,aAAa;;AAGjI,MAAa,oBACX,WACA,cACA,MACA,qBACG;CACH,MAAM,MAAM,CAAC,GAAG,CAAC,aAAa,WAAW,CAAC,IAAI,YAAY;AAC1D,SAAQ,IAAI,KAAK,SAAS,KAAK,UAAU,KAAK,GAAG;AACjD,KAAI,KAAK,WAAW,UAAU,CAAC;AAC/B,qBAAoB,IAAI,KAAK,6BAA6B,mBAAmB;AAC7E,QAAO,IAAI,KAAK,KAAK"}
@@ -0,0 +1,5 @@
1
+ //#region src/getShortErrorMsg.d.ts
2
+ declare const getShortErrorMsg: (errorCode: string, errorDescMap: Record<string, string>, args?: Record<string, unknown>, originalErrorMsg?: string) => string;
3
+ //#endregion
4
+ export { getShortErrorMsg };
5
+ //# sourceMappingURL=getShortErrorMsg.d.mts.map
@@ -0,0 +1,5 @@
1
+ //#region src/getShortErrorMsg.d.ts
2
+ declare const getShortErrorMsg: (errorCode: string, errorDescMap: Record<string, string>, args?: Record<string, unknown>, originalErrorMsg?: string) => string;
3
+ //#endregion
4
+ export { getShortErrorMsg };
5
+ //# sourceMappingURL=getShortErrorMsg.d.ts.map
@@ -0,0 +1,15 @@
1
+ //#region src/getShortErrorMsg.ts
2
+ const getDocsUrl = (errorCode) => {
3
+ return `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${errorCode.split("-")[0].toLowerCase()}#${errorCode.toLowerCase()}`;
4
+ };
5
+ const getShortErrorMsg = (errorCode, errorDescMap, args, originalErrorMsg) => {
6
+ const msg = [`${[errorDescMap[errorCode]]} #${errorCode}`];
7
+ args && msg.push(`args: ${JSON.stringify(args)}`);
8
+ msg.push(getDocsUrl(errorCode));
9
+ originalErrorMsg && msg.push(`Original Error Message:\n ${originalErrorMsg}`);
10
+ return msg.join("\n");
11
+ };
12
+
13
+ //#endregion
14
+ export { getShortErrorMsg };
15
+ //# sourceMappingURL=getShortErrorMsg.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getShortErrorMsg.mjs","names":[],"sources":["../src/getShortErrorMsg.ts"],"sourcesContent":["const getDocsUrl = (errorCode: string) => {\n const type = errorCode.split('-')[0].toLowerCase();\n return `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${type}#${errorCode.toLowerCase()}`;\n};\n\nexport const getShortErrorMsg = (\n errorCode: string,\n errorDescMap: Record<string, string>,\n args?: Record<string, unknown>,\n originalErrorMsg?: string,\n) => {\n const msg = [`${[errorDescMap[errorCode]]} #${errorCode}`];\n args && msg.push(`args: ${JSON.stringify(args)}`);\n msg.push(getDocsUrl(errorCode));\n originalErrorMsg && msg.push(`Original Error Message:\\n ${originalErrorMsg}`);\n return msg.join('\\n');\n};\n"],"mappings":";AAAA,MAAM,cAAc,cAAsB;AAExC,QAAO,yFADM,UAAU,MAAM,IAAI,CAAC,GAAG,aAAa,CACmD,GAAG,UAAU,aAAa;;AAGjI,MAAa,oBACX,WACA,cACA,MACA,qBACG;CACH,MAAM,MAAM,CAAC,GAAG,CAAC,aAAa,WAAW,CAAC,IAAI,YAAY;AAC1D,SAAQ,IAAI,KAAK,SAAS,KAAK,UAAU,KAAK,GAAG;AACjD,KAAI,KAAK,WAAW,UAAU,CAAC;AAC/B,qBAAoB,IAAI,KAAK,6BAA6B,mBAAmB;AAC7E,QAAO,IAAI,KAAK,KAAK"}
package/dist/index.cjs ADDED
@@ -0,0 +1,23 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_error_codes = require('./error-codes.cjs');
3
+ const require_getShortErrorMsg = require('./getShortErrorMsg.cjs');
4
+ const require_desc = require('./desc.cjs');
5
+
6
+ exports.BUILD_001 = require_error_codes.BUILD_001;
7
+ exports.BUILD_002 = require_error_codes.BUILD_002;
8
+ exports.RUNTIME_001 = require_error_codes.RUNTIME_001;
9
+ exports.RUNTIME_002 = require_error_codes.RUNTIME_002;
10
+ exports.RUNTIME_003 = require_error_codes.RUNTIME_003;
11
+ exports.RUNTIME_004 = require_error_codes.RUNTIME_004;
12
+ exports.RUNTIME_005 = require_error_codes.RUNTIME_005;
13
+ exports.RUNTIME_006 = require_error_codes.RUNTIME_006;
14
+ exports.RUNTIME_007 = require_error_codes.RUNTIME_007;
15
+ exports.RUNTIME_008 = require_error_codes.RUNTIME_008;
16
+ exports.RUNTIME_009 = require_error_codes.RUNTIME_009;
17
+ exports.RUNTIME_010 = require_error_codes.RUNTIME_010;
18
+ exports.TYPE_001 = require_error_codes.TYPE_001;
19
+ exports.buildDescMap = require_desc.buildDescMap;
20
+ exports.errorDescMap = require_desc.errorDescMap;
21
+ exports.getShortErrorMsg = require_getShortErrorMsg.getShortErrorMsg;
22
+ exports.runtimeDescMap = require_desc.runtimeDescMap;
23
+ exports.typeDescMap = require_desc.typeDescMap;
@@ -0,0 +1,4 @@
1
+ import { BUILD_001, BUILD_002, RUNTIME_001, RUNTIME_002, RUNTIME_003, RUNTIME_004, RUNTIME_005, RUNTIME_006, RUNTIME_007, RUNTIME_008, RUNTIME_009, RUNTIME_010, TYPE_001 } from "./error-codes.mjs";
2
+ import { getShortErrorMsg } from "./getShortErrorMsg.mjs";
3
+ import { buildDescMap, errorDescMap, runtimeDescMap, typeDescMap } from "./desc.mjs";
4
+ export { BUILD_001, BUILD_002, RUNTIME_001, RUNTIME_002, RUNTIME_003, RUNTIME_004, RUNTIME_005, RUNTIME_006, RUNTIME_007, RUNTIME_008, RUNTIME_009, RUNTIME_010, TYPE_001, buildDescMap, errorDescMap, getShortErrorMsg, runtimeDescMap, typeDescMap };
package/dist/index.d.ts CHANGED
@@ -1 +1,4 @@
1
- export * from "./src/index";
1
+ import { BUILD_001, BUILD_002, RUNTIME_001, RUNTIME_002, RUNTIME_003, RUNTIME_004, RUNTIME_005, RUNTIME_006, RUNTIME_007, RUNTIME_008, RUNTIME_009, RUNTIME_010, TYPE_001 } from "./error-codes.js";
2
+ import { getShortErrorMsg } from "./getShortErrorMsg.js";
3
+ import { buildDescMap, errorDescMap, runtimeDescMap, typeDescMap } from "./desc.js";
4
+ export { BUILD_001, BUILD_002, RUNTIME_001, RUNTIME_002, RUNTIME_003, RUNTIME_004, RUNTIME_005, RUNTIME_006, RUNTIME_007, RUNTIME_008, RUNTIME_009, RUNTIME_010, TYPE_001, buildDescMap, errorDescMap, getShortErrorMsg, runtimeDescMap, typeDescMap };
package/dist/index.mjs ADDED
@@ -0,0 +1,5 @@
1
+ import { BUILD_001, BUILD_002, RUNTIME_001, RUNTIME_002, RUNTIME_003, RUNTIME_004, RUNTIME_005, RUNTIME_006, RUNTIME_007, RUNTIME_008, RUNTIME_009, RUNTIME_010, TYPE_001 } from "./error-codes.mjs";
2
+ import { getShortErrorMsg } from "./getShortErrorMsg.mjs";
3
+ import { buildDescMap, errorDescMap, runtimeDescMap, typeDescMap } from "./desc.mjs";
4
+
5
+ export { BUILD_001, BUILD_002, RUNTIME_001, RUNTIME_002, RUNTIME_003, RUNTIME_004, RUNTIME_005, RUNTIME_006, RUNTIME_007, RUNTIME_008, RUNTIME_009, RUNTIME_010, TYPE_001, buildDescMap, errorDescMap, getShortErrorMsg, runtimeDescMap, typeDescMap };
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "author": "zhanghang <hanric.zhang@gmail.com>",
5
5
  "public": true,
6
6
  "sideEffects": false,
7
- "version": "0.0.0-feat-skill-20260303081221",
7
+ "version": "0.0.0-feat-runtime-010-20260304084757",
8
8
  "license": "MIT",
9
9
  "repository": {
10
10
  "type": "git",
@@ -25,36 +25,25 @@
25
25
  "browser": {
26
26
  "url": false
27
27
  },
28
- "main": "./dist/index.cjs.js",
29
- "module": "./dist/index.esm.mjs",
28
+ "main": "./dist/index.cjs",
29
+ "module": "./dist/index.mjs",
30
30
  "types": "./dist/index.d.ts",
31
31
  "exports": {
32
32
  ".": {
33
- "types": "./dist/index.d.ts",
34
- "import": "./dist/index.esm.mjs",
35
- "require": "./dist/index.cjs.js"
36
- },
37
- "./browser": {
38
- "types": "./dist/browser.d.ts",
39
- "import": "./dist/browser.esm.mjs",
40
- "require": "./dist/browser.cjs.js"
41
- },
42
- "./node": {
43
- "types": "./dist/node.d.ts",
44
- "import": "./dist/node.esm.mjs",
45
- "require": "./dist/node.cjs.js"
33
+ "import": {
34
+ "types": "./dist/index.d.mts",
35
+ "default": "./dist/index.mjs"
36
+ },
37
+ "require": {
38
+ "types": "./dist/index.d.ts",
39
+ "default": "./dist/index.cjs"
40
+ }
46
41
  }
47
42
  },
48
43
  "typesVersions": {
49
44
  "*": {
50
45
  ".": [
51
46
  "./dist/index.d.ts"
52
- ],
53
- "browser": [
54
- "./dist/browser.d.ts"
55
- ],
56
- "node": [
57
- "./dist/node.d.ts"
58
47
  ]
59
48
  }
60
49
  }
@@ -1,23 +0,0 @@
1
- 'use strict';
2
-
3
- var getShortErrorMsg = require('./getShortErrorMsg.cjs.js');
4
-
5
- function reportDiagnostic(entry) {
6
- if (typeof window !== 'undefined') {
7
- window.dispatchEvent(new CustomEvent('mf:diagnostic', { detail: entry }));
8
- }
9
- }
10
- function logAndReport(code, descMap, args, logger, originalErrorMsg, context) {
11
- const msg = getShortErrorMsg.getShortErrorMsg(code, descMap, args, originalErrorMsg);
12
- reportDiagnostic({
13
- code,
14
- message: msg,
15
- args,
16
- context,
17
- timestamp: Date.now(),
18
- });
19
- return logger(msg);
20
- }
21
-
22
- exports.logAndReport = logAndReport;
23
- //# sourceMappingURL=browser.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"browser.cjs.js","sources":["../src/browser.ts"],"sourcesContent":[null],"names":["getShortErrorMsg"],"mappings":";;;;AAWA,SAAS,gBAAgB,CAAC,KAAsB,EAAA;AAC9C,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACjC,QAAA,MAAM,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,eAAe,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3E;AACF;AAEM,SAAU,YAAY,CAC1B,IAAY,EACZ,OAA+B,EAC/B,IAA6B,EAC7B,MAAS,EACT,gBAAyB,EACzB,OAA4B,EAAA;AAE5B,IAAA,MAAM,GAAG,GAAGA,iCAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,CAAC;AACnE,IAAA,gBAAgB,CAAC;QACf,IAAI;AACJ,QAAA,OAAO,EAAE,GAAG;QACZ,IAAI;QACJ,OAAO;AACP,QAAA,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;AACtB,KAAA,CAAC;AACF,IAAA,OAAO,MAAM,CAAC,GAAG,CAAkB;AACrC;;;;"}
package/dist/browser.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./src/browser";
@@ -1 +0,0 @@
1
- export * from "./src/browser";
@@ -1,21 +0,0 @@
1
- import { g as getShortErrorMsg } from './getShortErrorMsg.esm.mjs';
2
-
3
- function reportDiagnostic(entry) {
4
- if (typeof window !== 'undefined') {
5
- window.dispatchEvent(new CustomEvent('mf:diagnostic', { detail: entry }));
6
- }
7
- }
8
- function logAndReport(code, descMap, args, logger, originalErrorMsg, context) {
9
- const msg = getShortErrorMsg(code, descMap, args, originalErrorMsg);
10
- reportDiagnostic({
11
- code,
12
- message: msg,
13
- args,
14
- context,
15
- timestamp: Date.now(),
16
- });
17
- return logger(msg);
18
- }
19
-
20
- export { logAndReport };
21
- //# sourceMappingURL=browser.esm.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"browser.esm.mjs","sources":["../src/browser.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAWA,SAAS,gBAAgB,CAAC,KAAsB,EAAA;AAC9C,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACjC,QAAA,MAAM,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,eAAe,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3E;AACF;AAEM,SAAU,YAAY,CAC1B,IAAY,EACZ,OAA+B,EAC/B,IAA6B,EAC7B,MAAS,EACT,gBAAyB,EACzB,OAA4B,EAAA;AAE5B,IAAA,MAAM,GAAG,GAAG,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,CAAC;AACnE,IAAA,gBAAgB,CAAC;QACf,IAAI;AACJ,QAAA,OAAO,EAAE,GAAG;QACZ,IAAI;QACJ,OAAO;AACP,QAAA,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;AACtB,KAAA,CAAC;AACF,IAAA,OAAO,MAAM,CAAC,GAAG,CAAkB;AACrC;;;;"}
@@ -1,16 +0,0 @@
1
- 'use strict';
2
-
3
- const getDocsUrl = (errorCode) => {
4
- const type = errorCode.split('-')[0].toLowerCase();
5
- return `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${type}#${errorCode.toLowerCase()}`;
6
- };
7
- const getShortErrorMsg = (errorCode, errorDescMap, args, originalErrorMsg) => {
8
- const msg = [`${[errorDescMap[errorCode]]} #${errorCode}`];
9
- args && msg.push(`args: ${JSON.stringify(args)}`);
10
- msg.push(getDocsUrl(errorCode));
11
- originalErrorMsg && msg.push(`Original Error Message:\n ${originalErrorMsg}`);
12
- return msg.join('\n');
13
- };
14
-
15
- exports.getShortErrorMsg = getShortErrorMsg;
16
- //# sourceMappingURL=getShortErrorMsg.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getShortErrorMsg.cjs.js","sources":["../src/getShortErrorMsg.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA,MAAM,UAAU,GAAG,CAAC,SAAiB,KAAI;AACvC,IAAA,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE;IAClD,OAAO,CAAA,sFAAA,EAAyF,IAAI,CAAA,CAAA,EAAI,SAAS,CAAC,WAAW,EAAE,EAAE;AACnI,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,CAAA,MAAA,EAAS,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,CAAA,0BAAA,EAA6B,gBAAgB,CAAA,CAAE,CAAC;AAC7E,IAAA,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;AACvB;;;;"}
@@ -1,14 +0,0 @@
1
- const getDocsUrl = (errorCode) => {
2
- const type = errorCode.split('-')[0].toLowerCase();
3
- return `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${type}#${errorCode.toLowerCase()}`;
4
- };
5
- const getShortErrorMsg = (errorCode, errorDescMap, args, originalErrorMsg) => {
6
- const msg = [`${[errorDescMap[errorCode]]} #${errorCode}`];
7
- args && msg.push(`args: ${JSON.stringify(args)}`);
8
- msg.push(getDocsUrl(errorCode));
9
- originalErrorMsg && msg.push(`Original Error Message:\n ${originalErrorMsg}`);
10
- return msg.join('\n');
11
- };
12
-
13
- export { getShortErrorMsg as g };
14
- //# sourceMappingURL=getShortErrorMsg.esm.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getShortErrorMsg.esm.mjs","sources":["../src/getShortErrorMsg.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG,CAAC,SAAiB,KAAI;AACvC,IAAA,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE;IAClD,OAAO,CAAA,sFAAA,EAAyF,IAAI,CAAA,CAAA,EAAI,SAAS,CAAC,WAAW,EAAE,EAAE;AACnI,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,CAAA,MAAA,EAAS,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,CAAA,0BAAA,EAA6B,gBAAgB,CAAA,CAAE,CAAC;AAC7E,IAAA,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;AACvB;;;;"}
package/dist/index.cjs.js DELETED
@@ -1,62 +0,0 @@
1
- 'use strict';
2
-
3
- var getShortErrorMsg = require('./getShortErrorMsg.cjs.js');
4
-
5
- const RUNTIME_001 = 'RUNTIME-001';
6
- const RUNTIME_002 = 'RUNTIME-002';
7
- const RUNTIME_003 = 'RUNTIME-003';
8
- const RUNTIME_004 = 'RUNTIME-004';
9
- const RUNTIME_005 = 'RUNTIME-005';
10
- const RUNTIME_006 = 'RUNTIME-006';
11
- const RUNTIME_007 = 'RUNTIME-007';
12
- const RUNTIME_008 = 'RUNTIME-008';
13
- const RUNTIME_009 = 'RUNTIME-009';
14
- const RUNTIME_010 = 'RUNTIME-010';
15
- const TYPE_001 = 'TYPE-001';
16
- const BUILD_001 = 'BUILD-001';
17
- const BUILD_002 = 'BUILD-002';
18
-
19
- const runtimeDescMap = {
20
- [RUNTIME_001]: 'Failed to get remoteEntry exports.',
21
- [RUNTIME_002]: 'The remote entry interface does not contain "init"',
22
- [RUNTIME_003]: 'Failed to get manifest.',
23
- [RUNTIME_004]: 'Failed to locate remote.',
24
- [RUNTIME_005]: 'Invalid loadShareSync function call from bundler runtime',
25
- [RUNTIME_006]: 'Invalid loadShareSync function call from runtime',
26
- [RUNTIME_007]: 'Failed to get remote snapshot.',
27
- [RUNTIME_008]: 'Failed to load script resources.',
28
- [RUNTIME_009]: 'Please call createInstance first.',
29
- [RUNTIME_010]: 'The remoteEntry URL is missing from the remote snapshot.',
30
- };
31
- const typeDescMap = {
32
- [TYPE_001]: 'Failed to generate type declaration. Execute the below cmd to reproduce and fix the error.',
33
- };
34
- const buildDescMap = {
35
- [BUILD_001]: 'Failed to find expose module.',
36
- [BUILD_002]: 'PublicPath is required in prod mode.',
37
- };
38
- const errorDescMap = {
39
- ...runtimeDescMap,
40
- ...typeDescMap,
41
- ...buildDescMap,
42
- };
43
-
44
- exports.getShortErrorMsg = getShortErrorMsg.getShortErrorMsg;
45
- exports.BUILD_001 = BUILD_001;
46
- exports.BUILD_002 = BUILD_002;
47
- exports.RUNTIME_001 = RUNTIME_001;
48
- exports.RUNTIME_002 = RUNTIME_002;
49
- exports.RUNTIME_003 = RUNTIME_003;
50
- exports.RUNTIME_004 = RUNTIME_004;
51
- exports.RUNTIME_005 = RUNTIME_005;
52
- exports.RUNTIME_006 = RUNTIME_006;
53
- exports.RUNTIME_007 = RUNTIME_007;
54
- exports.RUNTIME_008 = RUNTIME_008;
55
- exports.RUNTIME_009 = RUNTIME_009;
56
- exports.RUNTIME_010 = RUNTIME_010;
57
- exports.TYPE_001 = TYPE_001;
58
- exports.buildDescMap = buildDescMap;
59
- exports.errorDescMap = errorDescMap;
60
- exports.runtimeDescMap = runtimeDescMap;
61
- exports.typeDescMap = typeDescMap;
62
- //# sourceMappingURL=index.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/error-codes.ts","../src/desc.ts"],"sourcesContent":[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;AACpB,MAAM,WAAW,GAAG;AAEpB,MAAM,QAAQ,GAAG;AACjB,MAAM,SAAS,GAAG;AAClB,MAAM,SAAS,GAAG;;ACGlB,MAAM,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;IAClD,CAAC,WAAW,GAAG,0DAA0D;;AAGpE,MAAM,WAAW,GAAG;IACzB,CAAC,QAAQ,GACP,4FAA4F;;AAGzF,MAAM,YAAY,GAAG;IAC1B,CAAC,SAAS,GAAG,+BAA+B;IAC5C,CAAC,SAAS,GAAG,sCAAsC;;AAG9C,MAAM,YAAY,GAAG;AAC1B,IAAA,GAAG,cAAc;AACjB,IAAA,GAAG,WAAW;AACd,IAAA,GAAG,YAAY;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- export * from "./src/index";
@@ -1,43 +0,0 @@
1
- export { g as getShortErrorMsg } from './getShortErrorMsg.esm.mjs';
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 RUNTIME_010 = 'RUNTIME-010';
13
- const TYPE_001 = 'TYPE-001';
14
- const BUILD_001 = 'BUILD-001';
15
- const BUILD_002 = 'BUILD-002';
16
-
17
- const runtimeDescMap = {
18
- [RUNTIME_001]: 'Failed to get remoteEntry exports.',
19
- [RUNTIME_002]: 'The remote entry interface does not contain "init"',
20
- [RUNTIME_003]: 'Failed to get manifest.',
21
- [RUNTIME_004]: 'Failed to locate remote.',
22
- [RUNTIME_005]: 'Invalid loadShareSync function call from bundler runtime',
23
- [RUNTIME_006]: 'Invalid loadShareSync function call from runtime',
24
- [RUNTIME_007]: 'Failed to get remote snapshot.',
25
- [RUNTIME_008]: 'Failed to load script resources.',
26
- [RUNTIME_009]: 'Please call createInstance first.',
27
- [RUNTIME_010]: 'The remoteEntry URL is missing from the remote snapshot.',
28
- };
29
- const typeDescMap = {
30
- [TYPE_001]: 'Failed to generate type declaration. Execute the below cmd to reproduce and fix the error.',
31
- };
32
- const buildDescMap = {
33
- [BUILD_001]: 'Failed to find expose module.',
34
- [BUILD_002]: 'PublicPath is required in prod mode.',
35
- };
36
- const errorDescMap = {
37
- ...runtimeDescMap,
38
- ...typeDescMap,
39
- ...buildDescMap,
40
- };
41
-
42
- export { BUILD_001, BUILD_002, RUNTIME_001, RUNTIME_002, RUNTIME_003, RUNTIME_004, RUNTIME_005, RUNTIME_006, RUNTIME_007, RUNTIME_008, RUNTIME_009, RUNTIME_010, TYPE_001, buildDescMap, errorDescMap, runtimeDescMap, typeDescMap };
43
- //# sourceMappingURL=index.esm.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.esm.mjs","sources":["../src/error-codes.ts","../src/desc.ts"],"sourcesContent":[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;AACpB,MAAM,WAAW,GAAG;AAEpB,MAAM,QAAQ,GAAG;AACjB,MAAM,SAAS,GAAG;AAClB,MAAM,SAAS,GAAG;;ACGlB,MAAM,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;IAClD,CAAC,WAAW,GAAG,0DAA0D;;AAGpE,MAAM,WAAW,GAAG;IACzB,CAAC,QAAQ,GACP,4FAA4F;;AAGzF,MAAM,YAAY,GAAG;IAC1B,CAAC,SAAS,GAAG,+BAA+B;IAC5C,CAAC,SAAS,GAAG,sCAAsC;;AAG9C,MAAM,YAAY,GAAG;AAC1B,IAAA,GAAG,cAAc;AACjB,IAAA,GAAG,WAAW;AACd,IAAA,GAAG,YAAY;;;;;"}
package/dist/node.cjs.js DELETED
@@ -1,28 +0,0 @@
1
- 'use strict';
2
-
3
- var fs = require('fs');
4
- var path = require('path');
5
- var getShortErrorMsg = require('./getShortErrorMsg.cjs.js');
6
-
7
- function reportDiagnostic(code, message, args, context) {
8
- try {
9
- const dir = path.resolve(process.cwd(), '.mf', 'diagnostics');
10
- fs.mkdirSync(dir, { recursive: true });
11
- const output = {
12
- ...context,
13
- latestErrorEvent: { code, message, args, timestamp: Date.now() },
14
- };
15
- fs.writeFileSync(path.join(dir, 'latest.json'), JSON.stringify(output, null, 2));
16
- }
17
- catch {
18
- // noop - don't let diagnostic writing fail the build
19
- }
20
- }
21
- function logAndReport(code, descMap, args, logger, originalErrorMsg, context) {
22
- const msg = getShortErrorMsg.getShortErrorMsg(code, descMap, args, originalErrorMsg);
23
- reportDiagnostic(code, msg, args, context);
24
- return logger(msg);
25
- }
26
-
27
- exports.logAndReport = logAndReport;
28
- //# sourceMappingURL=node.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node.cjs.js","sources":["../src/node.ts"],"sourcesContent":[null],"names":["getShortErrorMsg"],"mappings":";;;;;;AAKA,SAAS,gBAAgB,CACvB,IAAY,EACZ,OAAe,EACf,IAA6B,EAC7B,OAA4B,EAAA;AAE5B,IAAA,IAAI;AACF,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,aAAa,CAAC;QAC7D,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AACtC,QAAA,MAAM,MAAM,GAAc;AACxB,YAAA,GAAG,OAAO;AACV,YAAA,gBAAgB,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE;SACjE;QACD,EAAE,CAAC,aAAa,CACd,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,aAAa,CAAC,EAC7B,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAChC;IACH;AAAE,IAAA,MAAM;;IAER;AACF;AAEM,SAAU,YAAY,CAC1B,IAAY,EACZ,OAA+B,EAC/B,IAA6B,EAC7B,MAAS,EACT,gBAAyB,EACzB,OAA4B,EAAA;AAE5B,IAAA,MAAM,GAAG,GAAGA,iCAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,CAAC;IACnE,gBAAgB,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC;AAC1C,IAAA,OAAO,MAAM,CAAC,GAAG,CAAkB;AACrC;;;;"}
package/dist/node.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./src/node";
@@ -1 +0,0 @@
1
- export * from "./src/node";
package/dist/node.esm.mjs DELETED
@@ -1,26 +0,0 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
- import { g as getShortErrorMsg } from './getShortErrorMsg.esm.mjs';
4
-
5
- function reportDiagnostic(code, message, args, context) {
6
- try {
7
- const dir = path.resolve(process.cwd(), '.mf', 'diagnostics');
8
- fs.mkdirSync(dir, { recursive: true });
9
- const output = {
10
- ...context,
11
- latestErrorEvent: { code, message, args, timestamp: Date.now() },
12
- };
13
- fs.writeFileSync(path.join(dir, 'latest.json'), JSON.stringify(output, null, 2));
14
- }
15
- catch {
16
- // noop - don't let diagnostic writing fail the build
17
- }
18
- }
19
- function logAndReport(code, descMap, args, logger, originalErrorMsg, context) {
20
- const msg = getShortErrorMsg(code, descMap, args, originalErrorMsg);
21
- reportDiagnostic(code, msg, args, context);
22
- return logger(msg);
23
- }
24
-
25
- export { logAndReport };
26
- //# sourceMappingURL=node.esm.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node.esm.mjs","sources":["../src/node.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAKA,SAAS,gBAAgB,CACvB,IAAY,EACZ,OAAe,EACf,IAA6B,EAC7B,OAA4B,EAAA;AAE5B,IAAA,IAAI;AACF,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,aAAa,CAAC;QAC7D,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AACtC,QAAA,MAAM,MAAM,GAAc;AACxB,YAAA,GAAG,OAAO;AACV,YAAA,gBAAgB,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE;SACjE;QACD,EAAE,CAAC,aAAa,CACd,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,aAAa,CAAC,EAC7B,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAChC;IACH;AAAE,IAAA,MAAM;;IAER;AACF;AAEM,SAAU,YAAY,CAC1B,IAAY,EACZ,OAA+B,EAC/B,IAA6B,EAC7B,MAAS,EACT,gBAAyB,EACzB,OAA4B,EAAA;AAE5B,IAAA,MAAM,GAAG,GAAG,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,CAAC;IACnE,gBAAgB,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC;AAC1C,IAAA,OAAO,MAAM,CAAC,GAAG,CAAkB;AACrC;;;;"}
@@ -1,80 +0,0 @@
1
- export type PackageManager = 'pnpm' | 'yarn' | 'npm' | 'bun';
2
- export type MFRole = 'host' | 'remote' | 'host+remote' | 'unknown';
3
- export type BundlerName = 'webpack' | 'rspack' | 'rsbuild' | 'vite' | 'unknown';
4
- /** A single remote entry, mirrors runtime-core's Remote type (simplified for diagnostics) */
5
- export interface MFRemoteEntry {
6
- name: string;
7
- alias?: string;
8
- /** URL or version string */
9
- entry?: string;
10
- version?: string;
11
- type?: string;
12
- entryGlobalName?: string;
13
- shareScope?: string | string[];
14
- }
15
- /** Shared package entry, mirrors runtime-core's SharedConfig (simplified) */
16
- export interface MFSharedEntry {
17
- version?: string;
18
- singleton?: boolean;
19
- requiredVersion?: string | false;
20
- eager?: boolean;
21
- strictVersion?: boolean;
22
- }
23
- /** Module Federation plugin configuration, extracted from bundler config file */
24
- export interface MFConfigInfo {
25
- name?: string;
26
- filename?: string;
27
- remotes?: MFRemoteEntry[];
28
- exposes?: Record<string, string>;
29
- shared?: Record<string, MFSharedEntry>;
30
- }
31
- /** Basic project metadata */
32
- export interface MFProjectInfo {
33
- name?: string;
34
- root?: string;
35
- packageManager?: PackageManager;
36
- mfRole?: MFRole;
37
- }
38
- /** Bundler in use */
39
- export interface MFBundlerInfo {
40
- name?: BundlerName;
41
- configFile?: string;
42
- version?: string;
43
- }
44
- /** Runtime environment snapshot */
45
- export interface MFEnvironmentInfo {
46
- nodeVersion?: string;
47
- os?: string;
48
- isCI?: boolean;
49
- }
50
- /** Most recent diagnostic event (from .mf/diagnostics/latest.json) */
51
- export interface MFLatestErrorEvent {
52
- code: string;
53
- message: string;
54
- args?: Record<string, unknown>;
55
- timestamp: number;
56
- }
57
- /** Build artifacts from dist/ */
58
- export interface MFBuildArtifacts {
59
- manifest?: Record<string, unknown>;
60
- stats?: Record<string, unknown>;
61
- }
62
- /**
63
- * Module Federation context.
64
- *
65
- * Produced by the `mf-context` Claude skill for full project analysis,
66
- * or contributed partially by the runtime when an error occurs (only fields
67
- * known at the time of the error are set).
68
- *
69
- * All fields are optional so both full and partial contexts are valid.
70
- */
71
- export interface MFContext {
72
- project?: MFProjectInfo;
73
- bundler?: MFBundlerInfo;
74
- mfConfig?: MFConfigInfo;
75
- /** Installed dependency versions: packageName → version */
76
- dependencies?: Record<string, string>;
77
- environment?: MFEnvironmentInfo;
78
- latestErrorEvent?: MFLatestErrorEvent;
79
- buildArtifacts?: MFBuildArtifacts;
80
- }
@@ -1,9 +0,0 @@
1
- import type { MFContext } from './MFContext';
2
- export interface DiagnosticEntry {
3
- code: string;
4
- message: string;
5
- args?: Record<string, unknown>;
6
- context?: Partial<MFContext>;
7
- timestamp: number;
8
- }
9
- export declare function logAndReport<T extends (msg: string) => unknown>(code: string, descMap: Record<string, string>, args: Record<string, unknown>, logger: T, originalErrorMsg?: string, context?: Partial<MFContext>): ReturnType<T>;
@@ -1,34 +0,0 @@
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
- "RUNTIME-010": string;
12
- };
13
- export declare const typeDescMap: {
14
- "TYPE-001": string;
15
- };
16
- export declare const buildDescMap: {
17
- "BUILD-001": string;
18
- "BUILD-002": string;
19
- };
20
- export declare const errorDescMap: {
21
- "BUILD-001": string;
22
- "BUILD-002": string;
23
- "TYPE-001": string;
24
- "RUNTIME-001": string;
25
- "RUNTIME-002": string;
26
- "RUNTIME-003": string;
27
- "RUNTIME-004": string;
28
- "RUNTIME-005": string;
29
- "RUNTIME-006": string;
30
- "RUNTIME-007": string;
31
- "RUNTIME-008": string;
32
- "RUNTIME-009": string;
33
- "RUNTIME-010": string;
34
- };
@@ -1,13 +0,0 @@
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 RUNTIME_010 = "RUNTIME-010";
11
- export declare const TYPE_001 = "TYPE-001";
12
- export declare const BUILD_001 = "BUILD-001";
13
- export declare const BUILD_002 = "BUILD-002";
@@ -1 +0,0 @@
1
- export declare const getShortErrorMsg: (errorCode: string, errorDescMap: Record<string, string>, args?: Record<string, unknown>, originalErrorMsg?: string) => string;
@@ -1,4 +0,0 @@
1
- export * from './error-codes';
2
- export { getShortErrorMsg } from './getShortErrorMsg';
3
- export { runtimeDescMap, typeDescMap, errorDescMap, buildDescMap, } from './desc';
4
- export type { MFContext, MFConfigInfo, MFProjectInfo, MFBundlerInfo, MFRemoteEntry, MFSharedEntry, MFEnvironmentInfo, MFLatestErrorEvent, MFBuildArtifacts, PackageManager, MFRole, BundlerName, } from './MFContext';
@@ -1,2 +0,0 @@
1
- import type { MFContext } from './MFContext';
2
- export declare function logAndReport<T extends (msg: string) => unknown>(code: string, descMap: Record<string, string>, args: Record<string, unknown>, logger: T, originalErrorMsg?: string, context?: Partial<MFContext>): ReturnType<T>;