mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-27 08:32:56 +00:00
84 lines
2.5 KiB
TypeScript
84 lines
2.5 KiB
TypeScript
//#region src/MFContext.d.ts
|
|
type PackageManager = 'pnpm' | 'yarn' | 'npm' | 'bun';
|
|
type MFRole = 'host' | 'remote' | 'host+remote' | 'unknown';
|
|
type BundlerName = 'webpack' | 'rspack' | 'rsbuild' | 'vite' | 'unknown';
|
|
/** A single remote entry, mirrors runtime-core's Remote type (simplified for diagnostics) */
|
|
interface MFRemoteEntry {
|
|
name: string;
|
|
alias?: string;
|
|
/** URL or version string */
|
|
entry?: string;
|
|
version?: string;
|
|
type?: string;
|
|
entryGlobalName?: string;
|
|
shareScope?: string | string[];
|
|
}
|
|
/** Shared package entry, mirrors runtime-core's SharedConfig (simplified) */
|
|
interface MFSharedEntry {
|
|
version?: string;
|
|
singleton?: boolean;
|
|
requiredVersion?: string | false;
|
|
eager?: boolean;
|
|
strictVersion?: boolean;
|
|
}
|
|
/** Module Federation plugin configuration, extracted from bundler config file */
|
|
interface MFConfigInfo {
|
|
name?: string;
|
|
filename?: string;
|
|
remotes?: MFRemoteEntry[];
|
|
exposes?: Record<string, string>;
|
|
shared?: Record<string, MFSharedEntry>;
|
|
}
|
|
/** Basic project metadata */
|
|
interface MFProjectInfo {
|
|
name?: string;
|
|
root?: string;
|
|
packageManager?: PackageManager;
|
|
mfRole?: MFRole;
|
|
}
|
|
/** Bundler in use */
|
|
interface MFBundlerInfo {
|
|
name?: BundlerName;
|
|
configFile?: string;
|
|
version?: string;
|
|
}
|
|
/** Runtime environment snapshot */
|
|
interface MFEnvironmentInfo {
|
|
nodeVersion?: string;
|
|
os?: string;
|
|
isCI?: boolean;
|
|
}
|
|
/** Most recent observability event (from .mf/observability/latest.json) */
|
|
interface MFLatestErrorEvent {
|
|
code: string;
|
|
message: string;
|
|
args?: Record<string, unknown>;
|
|
timestamp: number;
|
|
}
|
|
/** Build artifacts from dist/ */
|
|
interface MFBuildArtifacts {
|
|
manifest?: Record<string, unknown>;
|
|
stats?: Record<string, unknown>;
|
|
}
|
|
/**
|
|
* Module Federation context.
|
|
*
|
|
* Produced by the `mf-context` Claude skill for full project analysis,
|
|
* or contributed partially by the runtime when an error occurs (only fields
|
|
* known at the time of the error are set).
|
|
*
|
|
* All fields are optional so both full and partial contexts are valid.
|
|
*/
|
|
interface MFContext {
|
|
project?: MFProjectInfo;
|
|
bundler?: MFBundlerInfo;
|
|
mfConfig?: MFConfigInfo;
|
|
/** Installed dependency versions: packageName → version */
|
|
dependencies?: Record<string, string>;
|
|
environment?: MFEnvironmentInfo;
|
|
latestErrorEvent?: MFLatestErrorEvent;
|
|
buildArtifacts?: MFBuildArtifacts;
|
|
}
|
|
//#endregion
|
|
export { BundlerName, MFBuildArtifacts, MFBundlerInfo, MFConfigInfo, MFContext, MFEnvironmentInfo, MFLatestErrorEvent, MFProjectInfo, MFRemoteEntry, MFRole, MFSharedEntry, PackageManager };
|
|
//# sourceMappingURL=MFContext.d.ts.map
|