@module-federation/error-codes 0.0.0-chore-bump-node-22-20260710161714
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 +21 -0
- package/README.md +1 -0
- package/dist/MFContext.d.mts +84 -0
- package/dist/MFContext.d.ts +84 -0
- package/dist/_virtual/_rolldown/runtime.cjs +29 -0
- package/dist/browser.cjs +11 -0
- package/dist/browser.cjs.map +1 -0
- package/dist/browser.d.mts +7 -0
- package/dist/browser.d.ts +7 -0
- package/dist/browser.mjs +10 -0
- package/dist/browser.mjs.map +1 -0
- package/dist/desc.cjs +37 -0
- package/dist/desc.cjs.map +1 -0
- package/dist/desc.d.mts +48 -0
- package/dist/desc.d.ts +48 -0
- package/dist/desc.mjs +34 -0
- package/dist/desc.mjs.map +1 -0
- package/dist/error-codes.cjs +41 -0
- package/dist/error-codes.cjs.map +1 -0
- package/dist/error-codes.d.mts +22 -0
- package/dist/error-codes.d.ts +22 -0
- package/dist/error-codes.mjs +23 -0
- package/dist/error-codes.mjs.map +1 -0
- package/dist/getShortErrorMsg.cjs +16 -0
- package/dist/getShortErrorMsg.cjs.map +1 -0
- package/dist/getShortErrorMsg.d.mts +5 -0
- package/dist/getShortErrorMsg.d.ts +5 -0
- package/dist/getShortErrorMsg.mjs +15 -0
- package/dist/getShortErrorMsg.mjs.map +1 -0
- package/dist/index.cjs +28 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.mjs +5 -0
- package/dist/node.cjs +34 -0
- package/dist/node.cjs.map +1 -0
- package/dist/node.d.mts +7 -0
- package/dist/node.d.ts +7 -0
- package/dist/node.mjs +30 -0
- package/dist/node.mjs.map +1 -0
- package/package.json +83 -0
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,84 @@
|
|
|
1
|
+
//#region src/MFContext.d.ts
|
|
2
|
+
type PackageManager = 'pnpm' | 'yarn' | 'npm' | 'bun';
|
|
3
|
+
type MFRole = 'host' | 'remote' | 'host+remote' | 'unknown';
|
|
4
|
+
type BundlerName = 'webpack' | 'rspack' | 'rsbuild' | 'vite' | 'unknown';
|
|
5
|
+
/** A single remote entry, mirrors runtime-core's Remote type (simplified for diagnostics) */
|
|
6
|
+
interface MFRemoteEntry {
|
|
7
|
+
name: string;
|
|
8
|
+
alias?: string;
|
|
9
|
+
/** URL or version string */
|
|
10
|
+
entry?: string;
|
|
11
|
+
version?: string;
|
|
12
|
+
type?: string;
|
|
13
|
+
entryGlobalName?: string;
|
|
14
|
+
shareScope?: string | string[];
|
|
15
|
+
}
|
|
16
|
+
/** Shared package entry, mirrors runtime-core's SharedConfig (simplified) */
|
|
17
|
+
interface MFSharedEntry {
|
|
18
|
+
version?: string;
|
|
19
|
+
singleton?: boolean;
|
|
20
|
+
requiredVersion?: string | false;
|
|
21
|
+
eager?: boolean;
|
|
22
|
+
strictVersion?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/** Module Federation plugin configuration, extracted from bundler config file */
|
|
25
|
+
interface MFConfigInfo {
|
|
26
|
+
name?: string;
|
|
27
|
+
filename?: string;
|
|
28
|
+
remotes?: MFRemoteEntry[];
|
|
29
|
+
exposes?: Record<string, string>;
|
|
30
|
+
shared?: Record<string, MFSharedEntry>;
|
|
31
|
+
}
|
|
32
|
+
/** Basic project metadata */
|
|
33
|
+
interface MFProjectInfo {
|
|
34
|
+
name?: string;
|
|
35
|
+
root?: string;
|
|
36
|
+
packageManager?: PackageManager;
|
|
37
|
+
mfRole?: MFRole;
|
|
38
|
+
}
|
|
39
|
+
/** Bundler in use */
|
|
40
|
+
interface MFBundlerInfo {
|
|
41
|
+
name?: BundlerName;
|
|
42
|
+
configFile?: string;
|
|
43
|
+
version?: string;
|
|
44
|
+
}
|
|
45
|
+
/** Runtime environment snapshot */
|
|
46
|
+
interface MFEnvironmentInfo {
|
|
47
|
+
nodeVersion?: string;
|
|
48
|
+
os?: string;
|
|
49
|
+
isCI?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/** Most recent observability event (from .mf/observability/latest.json) */
|
|
52
|
+
interface MFLatestErrorEvent {
|
|
53
|
+
code: string;
|
|
54
|
+
message: string;
|
|
55
|
+
args?: Record<string, unknown>;
|
|
56
|
+
timestamp: number;
|
|
57
|
+
}
|
|
58
|
+
/** Build artifacts from dist/ */
|
|
59
|
+
interface MFBuildArtifacts {
|
|
60
|
+
manifest?: Record<string, unknown>;
|
|
61
|
+
stats?: Record<string, unknown>;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Module Federation context.
|
|
65
|
+
*
|
|
66
|
+
* Produced by the `mf-context` Claude skill for full project analysis,
|
|
67
|
+
* or contributed partially by the runtime when an error occurs (only fields
|
|
68
|
+
* known at the time of the error are set).
|
|
69
|
+
*
|
|
70
|
+
* All fields are optional so both full and partial contexts are valid.
|
|
71
|
+
*/
|
|
72
|
+
interface MFContext {
|
|
73
|
+
project?: MFProjectInfo;
|
|
74
|
+
bundler?: MFBundlerInfo;
|
|
75
|
+
mfConfig?: MFConfigInfo;
|
|
76
|
+
/** Installed dependency versions: packageName → version */
|
|
77
|
+
dependencies?: Record<string, string>;
|
|
78
|
+
environment?: MFEnvironmentInfo;
|
|
79
|
+
latestErrorEvent?: MFLatestErrorEvent;
|
|
80
|
+
buildArtifacts?: MFBuildArtifacts;
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
export { BundlerName, MFBuildArtifacts, MFBundlerInfo, MFConfigInfo, MFContext, MFEnvironmentInfo, MFLatestErrorEvent, MFProjectInfo, MFRemoteEntry, MFRole, MFSharedEntry, PackageManager };
|
|
84
|
+
//# sourceMappingURL=MFContext.d.mts.map
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
//#region src/MFContext.d.ts
|
|
2
|
+
type PackageManager = 'pnpm' | 'yarn' | 'npm' | 'bun';
|
|
3
|
+
type MFRole = 'host' | 'remote' | 'host+remote' | 'unknown';
|
|
4
|
+
type BundlerName = 'webpack' | 'rspack' | 'rsbuild' | 'vite' | 'unknown';
|
|
5
|
+
/** A single remote entry, mirrors runtime-core's Remote type (simplified for diagnostics) */
|
|
6
|
+
interface MFRemoteEntry {
|
|
7
|
+
name: string;
|
|
8
|
+
alias?: string;
|
|
9
|
+
/** URL or version string */
|
|
10
|
+
entry?: string;
|
|
11
|
+
version?: string;
|
|
12
|
+
type?: string;
|
|
13
|
+
entryGlobalName?: string;
|
|
14
|
+
shareScope?: string | string[];
|
|
15
|
+
}
|
|
16
|
+
/** Shared package entry, mirrors runtime-core's SharedConfig (simplified) */
|
|
17
|
+
interface MFSharedEntry {
|
|
18
|
+
version?: string;
|
|
19
|
+
singleton?: boolean;
|
|
20
|
+
requiredVersion?: string | false;
|
|
21
|
+
eager?: boolean;
|
|
22
|
+
strictVersion?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/** Module Federation plugin configuration, extracted from bundler config file */
|
|
25
|
+
interface MFConfigInfo {
|
|
26
|
+
name?: string;
|
|
27
|
+
filename?: string;
|
|
28
|
+
remotes?: MFRemoteEntry[];
|
|
29
|
+
exposes?: Record<string, string>;
|
|
30
|
+
shared?: Record<string, MFSharedEntry>;
|
|
31
|
+
}
|
|
32
|
+
/** Basic project metadata */
|
|
33
|
+
interface MFProjectInfo {
|
|
34
|
+
name?: string;
|
|
35
|
+
root?: string;
|
|
36
|
+
packageManager?: PackageManager;
|
|
37
|
+
mfRole?: MFRole;
|
|
38
|
+
}
|
|
39
|
+
/** Bundler in use */
|
|
40
|
+
interface MFBundlerInfo {
|
|
41
|
+
name?: BundlerName;
|
|
42
|
+
configFile?: string;
|
|
43
|
+
version?: string;
|
|
44
|
+
}
|
|
45
|
+
/** Runtime environment snapshot */
|
|
46
|
+
interface MFEnvironmentInfo {
|
|
47
|
+
nodeVersion?: string;
|
|
48
|
+
os?: string;
|
|
49
|
+
isCI?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/** Most recent observability event (from .mf/observability/latest.json) */
|
|
52
|
+
interface MFLatestErrorEvent {
|
|
53
|
+
code: string;
|
|
54
|
+
message: string;
|
|
55
|
+
args?: Record<string, unknown>;
|
|
56
|
+
timestamp: number;
|
|
57
|
+
}
|
|
58
|
+
/** Build artifacts from dist/ */
|
|
59
|
+
interface MFBuildArtifacts {
|
|
60
|
+
manifest?: Record<string, unknown>;
|
|
61
|
+
stats?: Record<string, unknown>;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Module Federation context.
|
|
65
|
+
*
|
|
66
|
+
* Produced by the `mf-context` Claude skill for full project analysis,
|
|
67
|
+
* or contributed partially by the runtime when an error occurs (only fields
|
|
68
|
+
* known at the time of the error are set).
|
|
69
|
+
*
|
|
70
|
+
* All fields are optional so both full and partial contexts are valid.
|
|
71
|
+
*/
|
|
72
|
+
interface MFContext {
|
|
73
|
+
project?: MFProjectInfo;
|
|
74
|
+
bundler?: MFBundlerInfo;
|
|
75
|
+
mfConfig?: MFConfigInfo;
|
|
76
|
+
/** Installed dependency versions: packageName → version */
|
|
77
|
+
dependencies?: Record<string, string>;
|
|
78
|
+
environment?: MFEnvironmentInfo;
|
|
79
|
+
latestErrorEvent?: MFLatestErrorEvent;
|
|
80
|
+
buildArtifacts?: MFBuildArtifacts;
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
export { BundlerName, MFBuildArtifacts, MFBundlerInfo, MFConfigInfo, MFContext, MFEnvironmentInfo, MFLatestErrorEvent, MFProjectInfo, MFRemoteEntry, MFRole, MFSharedEntry, PackageManager };
|
|
84
|
+
//# sourceMappingURL=MFContext.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
25
|
+
}) : target, mod));
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
|
|
29
|
+
exports.__toESM = __toESM;
|
package/dist/browser.cjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_getShortErrorMsg = require('./getShortErrorMsg.cjs');
|
|
3
|
+
|
|
4
|
+
//#region src/browser.ts
|
|
5
|
+
function logAndReport(code, descMap, args, logger, originalErrorMsg, context) {
|
|
6
|
+
return logger(require_getShortErrorMsg.getShortErrorMsg(code, descMap, args, originalErrorMsg));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
exports.logAndReport = logAndReport;
|
|
11
|
+
//# sourceMappingURL=browser.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.cjs","names":["getShortErrorMsg"],"sources":["../src/browser.ts"],"sourcesContent":["import { getShortErrorMsg } from './getShortErrorMsg';\nimport type { MFContext } from './MFContext';\n\nexport function logAndReport<T extends (msg: string) => unknown>(\n code: string,\n descMap: Record<string, string>,\n args: Record<string, unknown>,\n logger: T,\n originalErrorMsg?: string,\n context?: Partial<MFContext>,\n): ReturnType<T> {\n const msg = getShortErrorMsg(code, descMap, args, originalErrorMsg);\n return logger(msg) as ReturnType<T>;\n}\n"],"mappings":";;;;AAGA,SAAgB,aACd,MACA,SACA,MACA,QACA,kBACA,SACe;AAEf,QAAO,OADKA,0CAAiB,MAAM,SAAS,MAAM,iBAAiB,CACjD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MFContext } from "./MFContext.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/browser.d.ts
|
|
4
|
+
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>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { logAndReport };
|
|
7
|
+
//# sourceMappingURL=browser.d.mts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MFContext } from "./MFContext.js";
|
|
2
|
+
|
|
3
|
+
//#region src/browser.d.ts
|
|
4
|
+
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>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { logAndReport };
|
|
7
|
+
//# sourceMappingURL=browser.d.ts.map
|
package/dist/browser.mjs
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { getShortErrorMsg } from "./getShortErrorMsg.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/browser.ts
|
|
4
|
+
function logAndReport(code, descMap, args, logger, originalErrorMsg, context) {
|
|
5
|
+
return logger(getShortErrorMsg(code, descMap, args, originalErrorMsg));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { logAndReport };
|
|
10
|
+
//# sourceMappingURL=browser.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.mjs","names":[],"sources":["../src/browser.ts"],"sourcesContent":["import { getShortErrorMsg } from './getShortErrorMsg';\nimport type { MFContext } from './MFContext';\n\nexport function logAndReport<T extends (msg: string) => unknown>(\n code: string,\n descMap: Record<string, string>,\n args: Record<string, unknown>,\n logger: T,\n originalErrorMsg?: string,\n context?: Partial<MFContext>,\n): ReturnType<T> {\n const msg = getShortErrorMsg(code, descMap, args, originalErrorMsg);\n return logger(msg) as ReturnType<T>;\n}\n"],"mappings":";;;AAGA,SAAgB,aACd,MACA,SACA,MACA,QACA,kBACA,SACe;AAEf,QAAO,OADK,iBAAiB,MAAM,SAAS,MAAM,iBAAiB,CACjD"}
|
package/dist/desc.cjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
[require_error_codes.RUNTIME_011]: "The remoteEntry URL is missing from the remote snapshot.",
|
|
16
|
+
[require_error_codes.RUNTIME_012]: "The getter for the shared module is not a function. This may be caused by setting \"shared.import: false\" without the host providing the corresponding lib.",
|
|
17
|
+
[require_error_codes.RUNTIME_013]: "The manifest is not a valid Module Federation manifest.",
|
|
18
|
+
[require_error_codes.RUNTIME_014]: "The remote does not expose the requested module.",
|
|
19
|
+
[require_error_codes.RUNTIME_015]: "Remote container initialization failed."
|
|
20
|
+
};
|
|
21
|
+
const typeDescMap = { [require_error_codes.TYPE_001]: "Failed to generate type declaration. Execute the below cmd to reproduce and fix the error." };
|
|
22
|
+
const buildDescMap = {
|
|
23
|
+
[require_error_codes.BUILD_001]: "Failed to find expose module.",
|
|
24
|
+
[require_error_codes.BUILD_002]: "PublicPath is required in prod mode."
|
|
25
|
+
};
|
|
26
|
+
const errorDescMap = {
|
|
27
|
+
...runtimeDescMap,
|
|
28
|
+
...typeDescMap,
|
|
29
|
+
...buildDescMap
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
exports.buildDescMap = buildDescMap;
|
|
34
|
+
exports.errorDescMap = errorDescMap;
|
|
35
|
+
exports.runtimeDescMap = runtimeDescMap;
|
|
36
|
+
exports.typeDescMap = typeDescMap;
|
|
37
|
+
//# 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","RUNTIME_011","RUNTIME_012","RUNTIME_013","RUNTIME_014","RUNTIME_015","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 RUNTIME_011,\n RUNTIME_012,\n RUNTIME_013,\n RUNTIME_014,\n RUNTIME_015,\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 [RUNTIME_011]: 'The remoteEntry URL is missing from the remote snapshot.',\n [RUNTIME_012]:\n 'The getter for the shared module is not a function. This may be caused by setting \"shared.import: false\" without the host providing the corresponding lib.',\n [RUNTIME_013]: 'The manifest is not a valid Module Federation manifest.',\n [RUNTIME_014]: 'The remote does not expose the requested module.',\n [RUNTIME_015]: 'Remote container initialization failed.',\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":";;;AAqBA,MAAa,iBAAiB;EAC3BA,kCAAc;EACdC,kCAAc;EACdC,kCAAc;EACdC,kCAAc;EACdC,kCAAc;EACdC,kCAAc;EACdC,kCAAc;EACdC,kCAAc;EACdC,kCAAc;EACdC,kCACC;EACDC,kCAAc;EACdC,kCACC;EACDC,kCAAc;EACdC,kCAAc;EACdC,kCAAc;CAChB;AAED,MAAa,cAAc,GACxBC,+BACC,8FACH;AAED,MAAa,eAAe;EACzBC,gCAAY;EACZC,gCAAY;CACd;AAED,MAAa,eAAe;CAC1B,GAAG;CACH,GAAG;CACH,GAAG;CACJ"}
|
package/dist/desc.d.mts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
"RUNTIME-011": string;
|
|
14
|
+
"RUNTIME-012": string;
|
|
15
|
+
"RUNTIME-013": string;
|
|
16
|
+
"RUNTIME-014": string;
|
|
17
|
+
"RUNTIME-015": string;
|
|
18
|
+
};
|
|
19
|
+
declare const typeDescMap: {
|
|
20
|
+
"TYPE-001": string;
|
|
21
|
+
};
|
|
22
|
+
declare const buildDescMap: {
|
|
23
|
+
"BUILD-001": string;
|
|
24
|
+
"BUILD-002": string;
|
|
25
|
+
};
|
|
26
|
+
declare const errorDescMap: {
|
|
27
|
+
"BUILD-001": string;
|
|
28
|
+
"BUILD-002": string;
|
|
29
|
+
"TYPE-001": string;
|
|
30
|
+
"RUNTIME-001": string;
|
|
31
|
+
"RUNTIME-002": string;
|
|
32
|
+
"RUNTIME-003": string;
|
|
33
|
+
"RUNTIME-004": string;
|
|
34
|
+
"RUNTIME-005": string;
|
|
35
|
+
"RUNTIME-006": string;
|
|
36
|
+
"RUNTIME-007": string;
|
|
37
|
+
"RUNTIME-008": string;
|
|
38
|
+
"RUNTIME-009": string;
|
|
39
|
+
"RUNTIME-010": string;
|
|
40
|
+
"RUNTIME-011": string;
|
|
41
|
+
"RUNTIME-012": string;
|
|
42
|
+
"RUNTIME-013": string;
|
|
43
|
+
"RUNTIME-014": string;
|
|
44
|
+
"RUNTIME-015": string;
|
|
45
|
+
};
|
|
46
|
+
//#endregion
|
|
47
|
+
export { buildDescMap, errorDescMap, runtimeDescMap, typeDescMap };
|
|
48
|
+
//# sourceMappingURL=desc.d.mts.map
|
package/dist/desc.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
"RUNTIME-011": string;
|
|
14
|
+
"RUNTIME-012": string;
|
|
15
|
+
"RUNTIME-013": string;
|
|
16
|
+
"RUNTIME-014": string;
|
|
17
|
+
"RUNTIME-015": string;
|
|
18
|
+
};
|
|
19
|
+
declare const typeDescMap: {
|
|
20
|
+
"TYPE-001": string;
|
|
21
|
+
};
|
|
22
|
+
declare const buildDescMap: {
|
|
23
|
+
"BUILD-001": string;
|
|
24
|
+
"BUILD-002": string;
|
|
25
|
+
};
|
|
26
|
+
declare const errorDescMap: {
|
|
27
|
+
"BUILD-001": string;
|
|
28
|
+
"BUILD-002": string;
|
|
29
|
+
"TYPE-001": string;
|
|
30
|
+
"RUNTIME-001": string;
|
|
31
|
+
"RUNTIME-002": string;
|
|
32
|
+
"RUNTIME-003": string;
|
|
33
|
+
"RUNTIME-004": string;
|
|
34
|
+
"RUNTIME-005": string;
|
|
35
|
+
"RUNTIME-006": string;
|
|
36
|
+
"RUNTIME-007": string;
|
|
37
|
+
"RUNTIME-008": string;
|
|
38
|
+
"RUNTIME-009": string;
|
|
39
|
+
"RUNTIME-010": string;
|
|
40
|
+
"RUNTIME-011": string;
|
|
41
|
+
"RUNTIME-012": string;
|
|
42
|
+
"RUNTIME-013": string;
|
|
43
|
+
"RUNTIME-014": string;
|
|
44
|
+
"RUNTIME-015": string;
|
|
45
|
+
};
|
|
46
|
+
//#endregion
|
|
47
|
+
export { buildDescMap, errorDescMap, runtimeDescMap, typeDescMap };
|
|
48
|
+
//# sourceMappingURL=desc.d.ts.map
|
package/dist/desc.mjs
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
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, RUNTIME_011, RUNTIME_012, RUNTIME_013, RUNTIME_014, RUNTIME_015, 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
|
+
[RUNTIME_011]: "The remoteEntry URL is missing from the remote snapshot.",
|
|
16
|
+
[RUNTIME_012]: "The getter for the shared module is not a function. This may be caused by setting \"shared.import: false\" without the host providing the corresponding lib.",
|
|
17
|
+
[RUNTIME_013]: "The manifest is not a valid Module Federation manifest.",
|
|
18
|
+
[RUNTIME_014]: "The remote does not expose the requested module.",
|
|
19
|
+
[RUNTIME_015]: "Remote container initialization failed."
|
|
20
|
+
};
|
|
21
|
+
const typeDescMap = { [TYPE_001]: "Failed to generate type declaration. Execute the below cmd to reproduce and fix the error." };
|
|
22
|
+
const buildDescMap = {
|
|
23
|
+
[BUILD_001]: "Failed to find expose module.",
|
|
24
|
+
[BUILD_002]: "PublicPath is required in prod mode."
|
|
25
|
+
};
|
|
26
|
+
const errorDescMap = {
|
|
27
|
+
...runtimeDescMap,
|
|
28
|
+
...typeDescMap,
|
|
29
|
+
...buildDescMap
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { buildDescMap, errorDescMap, runtimeDescMap, typeDescMap };
|
|
34
|
+
//# 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 RUNTIME_011,\n RUNTIME_012,\n RUNTIME_013,\n RUNTIME_014,\n RUNTIME_015,\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 [RUNTIME_011]: 'The remoteEntry URL is missing from the remote snapshot.',\n [RUNTIME_012]:\n 'The getter for the shared module is not a function. This may be caused by setting \"shared.import: false\" without the host providing the corresponding lib.',\n [RUNTIME_013]: 'The manifest is not a valid Module Federation manifest.',\n [RUNTIME_014]: 'The remote does not expose the requested module.',\n [RUNTIME_015]: 'Remote container initialization failed.',\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":";;;AAqBA,MAAa,iBAAiB;EAC3B,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cACC;EACD,cAAc;EACd,cACC;EACD,cAAc;EACd,cAAc;EACd,cAAc;CAChB;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,41 @@
|
|
|
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 RUNTIME_011 = "RUNTIME-011";
|
|
14
|
+
const RUNTIME_012 = "RUNTIME-012";
|
|
15
|
+
const RUNTIME_013 = "RUNTIME-013";
|
|
16
|
+
const RUNTIME_014 = "RUNTIME-014";
|
|
17
|
+
const RUNTIME_015 = "RUNTIME-015";
|
|
18
|
+
const TYPE_001 = "TYPE-001";
|
|
19
|
+
const BUILD_001 = "BUILD-001";
|
|
20
|
+
const BUILD_002 = "BUILD-002";
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.BUILD_001 = BUILD_001;
|
|
24
|
+
exports.BUILD_002 = BUILD_002;
|
|
25
|
+
exports.RUNTIME_001 = RUNTIME_001;
|
|
26
|
+
exports.RUNTIME_002 = RUNTIME_002;
|
|
27
|
+
exports.RUNTIME_003 = RUNTIME_003;
|
|
28
|
+
exports.RUNTIME_004 = RUNTIME_004;
|
|
29
|
+
exports.RUNTIME_005 = RUNTIME_005;
|
|
30
|
+
exports.RUNTIME_006 = RUNTIME_006;
|
|
31
|
+
exports.RUNTIME_007 = RUNTIME_007;
|
|
32
|
+
exports.RUNTIME_008 = RUNTIME_008;
|
|
33
|
+
exports.RUNTIME_009 = RUNTIME_009;
|
|
34
|
+
exports.RUNTIME_010 = RUNTIME_010;
|
|
35
|
+
exports.RUNTIME_011 = RUNTIME_011;
|
|
36
|
+
exports.RUNTIME_012 = RUNTIME_012;
|
|
37
|
+
exports.RUNTIME_013 = RUNTIME_013;
|
|
38
|
+
exports.RUNTIME_014 = RUNTIME_014;
|
|
39
|
+
exports.RUNTIME_015 = RUNTIME_015;
|
|
40
|
+
exports.TYPE_001 = TYPE_001;
|
|
41
|
+
//# 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';\nexport const RUNTIME_011 = 'RUNTIME-011';\nexport const RUNTIME_012 = 'RUNTIME-012';\nexport const RUNTIME_013 = 'RUNTIME-013';\nexport const RUNTIME_014 = 'RUNTIME-014';\nexport const RUNTIME_015 = 'RUNTIME-015';\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;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,22 @@
|
|
|
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 RUNTIME_011 = "RUNTIME-011";
|
|
13
|
+
declare const RUNTIME_012 = "RUNTIME-012";
|
|
14
|
+
declare const RUNTIME_013 = "RUNTIME-013";
|
|
15
|
+
declare const RUNTIME_014 = "RUNTIME-014";
|
|
16
|
+
declare const RUNTIME_015 = "RUNTIME-015";
|
|
17
|
+
declare const TYPE_001 = "TYPE-001";
|
|
18
|
+
declare const BUILD_001 = "BUILD-001";
|
|
19
|
+
declare const BUILD_002 = "BUILD-002";
|
|
20
|
+
//#endregion
|
|
21
|
+
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, RUNTIME_011, RUNTIME_012, RUNTIME_013, RUNTIME_014, RUNTIME_015, TYPE_001 };
|
|
22
|
+
//# sourceMappingURL=error-codes.d.mts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
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 RUNTIME_011 = "RUNTIME-011";
|
|
13
|
+
declare const RUNTIME_012 = "RUNTIME-012";
|
|
14
|
+
declare const RUNTIME_013 = "RUNTIME-013";
|
|
15
|
+
declare const RUNTIME_014 = "RUNTIME-014";
|
|
16
|
+
declare const RUNTIME_015 = "RUNTIME-015";
|
|
17
|
+
declare const TYPE_001 = "TYPE-001";
|
|
18
|
+
declare const BUILD_001 = "BUILD-001";
|
|
19
|
+
declare const BUILD_002 = "BUILD-002";
|
|
20
|
+
//#endregion
|
|
21
|
+
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, RUNTIME_011, RUNTIME_012, RUNTIME_013, RUNTIME_014, RUNTIME_015, TYPE_001 };
|
|
22
|
+
//# sourceMappingURL=error-codes.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
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 RUNTIME_011 = "RUNTIME-011";
|
|
13
|
+
const RUNTIME_012 = "RUNTIME-012";
|
|
14
|
+
const RUNTIME_013 = "RUNTIME-013";
|
|
15
|
+
const RUNTIME_014 = "RUNTIME-014";
|
|
16
|
+
const RUNTIME_015 = "RUNTIME-015";
|
|
17
|
+
const TYPE_001 = "TYPE-001";
|
|
18
|
+
const BUILD_001 = "BUILD-001";
|
|
19
|
+
const BUILD_002 = "BUILD-002";
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
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, RUNTIME_011, RUNTIME_012, RUNTIME_013, RUNTIME_014, RUNTIME_015, TYPE_001 };
|
|
23
|
+
//# 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';\nexport const RUNTIME_011 = 'RUNTIME-011';\nexport const RUNTIME_012 = 'RUNTIME-012';\nexport const RUNTIME_013 = 'RUNTIME-013';\nexport const RUNTIME_014 = 'RUNTIME-014';\nexport const RUNTIME_015 = 'RUNTIME-015';\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;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,28 @@
|
|
|
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.RUNTIME_011 = require_error_codes.RUNTIME_011;
|
|
19
|
+
exports.RUNTIME_012 = require_error_codes.RUNTIME_012;
|
|
20
|
+
exports.RUNTIME_013 = require_error_codes.RUNTIME_013;
|
|
21
|
+
exports.RUNTIME_014 = require_error_codes.RUNTIME_014;
|
|
22
|
+
exports.RUNTIME_015 = require_error_codes.RUNTIME_015;
|
|
23
|
+
exports.TYPE_001 = require_error_codes.TYPE_001;
|
|
24
|
+
exports.buildDescMap = require_desc.buildDescMap;
|
|
25
|
+
exports.errorDescMap = require_desc.errorDescMap;
|
|
26
|
+
exports.getShortErrorMsg = require_getShortErrorMsg.getShortErrorMsg;
|
|
27
|
+
exports.runtimeDescMap = require_desc.runtimeDescMap;
|
|
28
|
+
exports.typeDescMap = require_desc.typeDescMap;
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BundlerName, MFBuildArtifacts, MFBundlerInfo, MFConfigInfo, MFContext, MFEnvironmentInfo, MFLatestErrorEvent, MFProjectInfo, MFRemoteEntry, MFRole, MFSharedEntry, PackageManager } from "./MFContext.mjs";
|
|
2
|
+
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, RUNTIME_011, RUNTIME_012, RUNTIME_013, RUNTIME_014, RUNTIME_015, TYPE_001 } from "./error-codes.mjs";
|
|
3
|
+
import { getShortErrorMsg } from "./getShortErrorMsg.mjs";
|
|
4
|
+
import { buildDescMap, errorDescMap, runtimeDescMap, typeDescMap } from "./desc.mjs";
|
|
5
|
+
export { BUILD_001, BUILD_002, type BundlerName, type MFBuildArtifacts, type MFBundlerInfo, type MFConfigInfo, type MFContext, type MFEnvironmentInfo, type MFLatestErrorEvent, type MFProjectInfo, type MFRemoteEntry, type MFRole, type MFSharedEntry, type PackageManager, RUNTIME_001, RUNTIME_002, RUNTIME_003, RUNTIME_004, RUNTIME_005, RUNTIME_006, RUNTIME_007, RUNTIME_008, RUNTIME_009, RUNTIME_010, RUNTIME_011, RUNTIME_012, RUNTIME_013, RUNTIME_014, RUNTIME_015, TYPE_001, buildDescMap, errorDescMap, getShortErrorMsg, runtimeDescMap, typeDescMap };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BundlerName, MFBuildArtifacts, MFBundlerInfo, MFConfigInfo, MFContext, MFEnvironmentInfo, MFLatestErrorEvent, MFProjectInfo, MFRemoteEntry, MFRole, MFSharedEntry, PackageManager } from "./MFContext.js";
|
|
2
|
+
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, RUNTIME_011, RUNTIME_012, RUNTIME_013, RUNTIME_014, RUNTIME_015, TYPE_001 } from "./error-codes.js";
|
|
3
|
+
import { getShortErrorMsg } from "./getShortErrorMsg.js";
|
|
4
|
+
import { buildDescMap, errorDescMap, runtimeDescMap, typeDescMap } from "./desc.js";
|
|
5
|
+
export { BUILD_001, BUILD_002, type BundlerName, type MFBuildArtifacts, type MFBundlerInfo, type MFConfigInfo, type MFContext, type MFEnvironmentInfo, type MFLatestErrorEvent, type MFProjectInfo, type MFRemoteEntry, type MFRole, type MFSharedEntry, type PackageManager, RUNTIME_001, RUNTIME_002, RUNTIME_003, RUNTIME_004, RUNTIME_005, RUNTIME_006, RUNTIME_007, RUNTIME_008, RUNTIME_009, RUNTIME_010, RUNTIME_011, RUNTIME_012, RUNTIME_013, RUNTIME_014, RUNTIME_015, 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, RUNTIME_011, RUNTIME_012, RUNTIME_013, RUNTIME_014, RUNTIME_015, 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, RUNTIME_011, RUNTIME_012, RUNTIME_013, RUNTIME_014, RUNTIME_015, TYPE_001, buildDescMap, errorDescMap, getShortErrorMsg, runtimeDescMap, typeDescMap };
|
package/dist/node.cjs
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_getShortErrorMsg = require('./getShortErrorMsg.cjs');
|
|
4
|
+
let fs = require("fs");
|
|
5
|
+
fs = require_runtime.__toESM(fs);
|
|
6
|
+
let path = require("path");
|
|
7
|
+
path = require_runtime.__toESM(path);
|
|
8
|
+
|
|
9
|
+
//#region src/node.ts
|
|
10
|
+
function reportDiagnostic(code, message, args, context) {
|
|
11
|
+
try {
|
|
12
|
+
const dir = path.default.resolve(process.cwd(), ".mf", "diagnostics");
|
|
13
|
+
fs.default.mkdirSync(dir, { recursive: true });
|
|
14
|
+
const output = {
|
|
15
|
+
...context,
|
|
16
|
+
latestErrorEvent: {
|
|
17
|
+
code,
|
|
18
|
+
message,
|
|
19
|
+
args,
|
|
20
|
+
timestamp: Date.now()
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
fs.default.writeFileSync(path.default.join(dir, "latest.json"), JSON.stringify(output, null, 2));
|
|
24
|
+
} catch {}
|
|
25
|
+
}
|
|
26
|
+
function logAndReport(code, descMap, args, logger, originalErrorMsg, context) {
|
|
27
|
+
const msg = require_getShortErrorMsg.getShortErrorMsg(code, descMap, args, originalErrorMsg);
|
|
28
|
+
reportDiagnostic(code, msg, args, context);
|
|
29
|
+
return logger(msg);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
exports.logAndReport = logAndReport;
|
|
34
|
+
//# sourceMappingURL=node.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.cjs","names":["getShortErrorMsg"],"sources":["../src/node.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport { getShortErrorMsg } from './getShortErrorMsg';\nimport type { MFContext } from './MFContext';\n\nfunction reportDiagnostic(\n code: string,\n message: string,\n args: Record<string, unknown>,\n context?: Partial<MFContext>,\n): void {\n try {\n const dir = path.resolve(process.cwd(), '.mf', 'diagnostics');\n fs.mkdirSync(dir, { recursive: true });\n const output: MFContext = {\n ...context,\n latestErrorEvent: { code, message, args, timestamp: Date.now() },\n };\n fs.writeFileSync(\n path.join(dir, 'latest.json'),\n JSON.stringify(output, null, 2),\n );\n } catch {\n // noop - don't let diagnostic writing fail the build\n }\n}\n\nexport function logAndReport<T extends (msg: string) => unknown>(\n code: string,\n descMap: Record<string, string>,\n args: Record<string, unknown>,\n logger: T,\n originalErrorMsg?: string,\n context?: Partial<MFContext>,\n): ReturnType<T> {\n const msg = getShortErrorMsg(code, descMap, args, originalErrorMsg);\n reportDiagnostic(code, msg, args, context);\n return logger(msg) as ReturnType<T>;\n}\n"],"mappings":";;;;;;;;;AAKA,SAAS,iBACP,MACA,SACA,MACA,SACM;AACN,KAAI;EACF,MAAM,MAAM,aAAK,QAAQ,QAAQ,KAAK,EAAE,OAAO,cAAc;AAC7D,aAAG,UAAU,KAAK,EAAE,WAAW,MAAM,CAAC;EACtC,MAAM,SAAoB;GACxB,GAAG;GACH,kBAAkB;IAAE;IAAM;IAAS;IAAM,WAAW,KAAK,KAAK;IAAE;GACjE;AACD,aAAG,cACD,aAAK,KAAK,KAAK,cAAc,EAC7B,KAAK,UAAU,QAAQ,MAAM,EAAE,CAChC;SACK;;AAKV,SAAgB,aACd,MACA,SACA,MACA,QACA,kBACA,SACe;CACf,MAAM,MAAMA,0CAAiB,MAAM,SAAS,MAAM,iBAAiB;AACnE,kBAAiB,MAAM,KAAK,MAAM,QAAQ;AAC1C,QAAO,OAAO,IAAI"}
|
package/dist/node.d.mts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MFContext } from "./MFContext.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/node.d.ts
|
|
4
|
+
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>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { logAndReport };
|
|
7
|
+
//# sourceMappingURL=node.d.mts.map
|
package/dist/node.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MFContext } from "./MFContext.js";
|
|
2
|
+
|
|
3
|
+
//#region src/node.d.ts
|
|
4
|
+
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>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { logAndReport };
|
|
7
|
+
//# sourceMappingURL=node.d.ts.map
|
package/dist/node.mjs
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { getShortErrorMsg } from "./getShortErrorMsg.mjs";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import path from "path";
|
|
4
|
+
|
|
5
|
+
//#region src/node.ts
|
|
6
|
+
function reportDiagnostic(code, message, args, context) {
|
|
7
|
+
try {
|
|
8
|
+
const dir = path.resolve(process.cwd(), ".mf", "diagnostics");
|
|
9
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
10
|
+
const output = {
|
|
11
|
+
...context,
|
|
12
|
+
latestErrorEvent: {
|
|
13
|
+
code,
|
|
14
|
+
message,
|
|
15
|
+
args,
|
|
16
|
+
timestamp: Date.now()
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
fs.writeFileSync(path.join(dir, "latest.json"), JSON.stringify(output, null, 2));
|
|
20
|
+
} catch {}
|
|
21
|
+
}
|
|
22
|
+
function logAndReport(code, descMap, args, logger, originalErrorMsg, context) {
|
|
23
|
+
const msg = getShortErrorMsg(code, descMap, args, originalErrorMsg);
|
|
24
|
+
reportDiagnostic(code, msg, args, context);
|
|
25
|
+
return logger(msg);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
export { logAndReport };
|
|
30
|
+
//# sourceMappingURL=node.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.mjs","names":[],"sources":["../src/node.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport { getShortErrorMsg } from './getShortErrorMsg';\nimport type { MFContext } from './MFContext';\n\nfunction reportDiagnostic(\n code: string,\n message: string,\n args: Record<string, unknown>,\n context?: Partial<MFContext>,\n): void {\n try {\n const dir = path.resolve(process.cwd(), '.mf', 'diagnostics');\n fs.mkdirSync(dir, { recursive: true });\n const output: MFContext = {\n ...context,\n latestErrorEvent: { code, message, args, timestamp: Date.now() },\n };\n fs.writeFileSync(\n path.join(dir, 'latest.json'),\n JSON.stringify(output, null, 2),\n );\n } catch {\n // noop - don't let diagnostic writing fail the build\n }\n}\n\nexport function logAndReport<T extends (msg: string) => unknown>(\n code: string,\n descMap: Record<string, string>,\n args: Record<string, unknown>,\n logger: T,\n originalErrorMsg?: string,\n context?: Partial<MFContext>,\n): ReturnType<T> {\n const msg = getShortErrorMsg(code, descMap, args, originalErrorMsg);\n reportDiagnostic(code, msg, args, context);\n return logger(msg) as ReturnType<T>;\n}\n"],"mappings":";;;;;AAKA,SAAS,iBACP,MACA,SACA,MACA,SACM;AACN,KAAI;EACF,MAAM,MAAM,KAAK,QAAQ,QAAQ,KAAK,EAAE,OAAO,cAAc;AAC7D,KAAG,UAAU,KAAK,EAAE,WAAW,MAAM,CAAC;EACtC,MAAM,SAAoB;GACxB,GAAG;GACH,kBAAkB;IAAE;IAAM;IAAS;IAAM,WAAW,KAAK,KAAK;IAAE;GACjE;AACD,KAAG,cACD,KAAK,KAAK,KAAK,cAAc,EAC7B,KAAK,UAAU,QAAQ,MAAM,EAAE,CAChC;SACK;;AAKV,SAAgB,aACd,MACA,SACA,MACA,QACA,kBACA,SACe;CACf,MAAM,MAAM,iBAAiB,MAAM,SAAS,MAAM,iBAAiB;AACnE,kBAAiB,MAAM,KAAK,MAAM,QAAQ;AAC1C,QAAO,OAAO,IAAI"}
|
package/package.json
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
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-chore-bump-node-22-20260710161714",
|
|
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
|
+
"browser": {
|
|
26
|
+
"url": false
|
|
27
|
+
},
|
|
28
|
+
"main": "./dist/index.cjs",
|
|
29
|
+
"module": "./dist/index.mjs",
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
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
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"./browser": {
|
|
43
|
+
"import": {
|
|
44
|
+
"types": "./dist/browser.d.mts",
|
|
45
|
+
"default": "./dist/browser.mjs"
|
|
46
|
+
},
|
|
47
|
+
"require": {
|
|
48
|
+
"types": "./dist/browser.d.ts",
|
|
49
|
+
"default": "./dist/browser.cjs"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"./node": {
|
|
53
|
+
"import": {
|
|
54
|
+
"types": "./dist/node.d.mts",
|
|
55
|
+
"default": "./dist/node.mjs"
|
|
56
|
+
},
|
|
57
|
+
"require": {
|
|
58
|
+
"types": "./dist/node.d.ts",
|
|
59
|
+
"default": "./dist/node.cjs"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"typesVersions": {
|
|
64
|
+
"*": {
|
|
65
|
+
".": [
|
|
66
|
+
"./dist/index.d.ts"
|
|
67
|
+
],
|
|
68
|
+
"browser": [
|
|
69
|
+
"./dist/browser.d.ts"
|
|
70
|
+
],
|
|
71
|
+
"node": [
|
|
72
|
+
"./dist/node.d.ts"
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"scripts": {
|
|
77
|
+
"build": "tsdown --config tsdown.config.ts --filter error-codes-build",
|
|
78
|
+
"lint": "ESLINT_USE_FLAT_CONFIG=false pnpm exec eslint --ignore-pattern node_modules \"**/*.ts\" \"package.json\"",
|
|
79
|
+
"test": "pnpm exec jest --config jest.config.js --passWithNoTests",
|
|
80
|
+
"test:ci": "pnpm exec jest --config jest.config.js --passWithNoTests --ci --coverage",
|
|
81
|
+
"pre-release": "pnpm run test && pnpm run build"
|
|
82
|
+
}
|
|
83
|
+
}
|