import type { BuildEnvironment } from './core'; import type { ParsedModuleConfig } from './module-config'; /** * Manifest protocol version emitted by the bundler plugins (RFC 0001 §5). * The linker rejects manifests whose `protocol` is HIGHER than this value. */ export declare const MANIFEST_PROTOCOL_VERSION = 2; export interface ManifestJson { /** * Manifest protocol version (RFC 0001 §5). Absent in pre-v2 manifests; * readers treat absence as protocol 1 and skip v2-only checks. */ protocol: number; /** * Module name */ name: string; /** * Module version, transcribed from the module's package.json at build * time (RFC 0001 §5). Pre-v2 manifests default to '0.0.0' at read time. */ version: string; /** * Resolved versions for every pkg-export (`pkg: true`) package, captured * at build time (RFC 0001 §5). * Type: Record */ provides: Record; /** * Consumption edges transcribed from the module's package.json `esmx.uses` * declaration (RFC 0001 §5). Pre-v2 manifests default to [] at read time. */ uses: string[]; /** * Scope-specific import mappings * Type: Record */ scopes: Record>; /** * Export item configuration * Type: Record */ exports: ManifestJsonExports; /** * Build output files */ files: string[]; /** * Compiled file information * Type: Record */ chunks: ManifestJsonChunks; /** * Subresource Integrity (SRI) hashes for build output files. * Only generated in production builds to avoid development overhead. * Type: Record */ integrity?: Record; } /** * Build-time facts about one provided (pkg-export) package (RFC 0001 §5). */ export interface ManifestJsonProvide { /** * The RESOLVED installed version of the provided package at build time, * read from node_modules//package.json relative to the module root. * Subpath specifiers (e.g. `vue/jsx-runtime`) resolve via their parent * package. '0.0.0' when the package could not be resolved. */ version: string; } /** * Export item configuration mapping * Type: Record */ export type ManifestJsonExports = Record; /** * Export item information */ export interface ManifestJsonExport { /** * Export item name */ name: string; /** * Whether to rewrite module import paths * - true: Rewrite to '{serviceName}/{exportName}' format * - false: Maintain original import paths */ pkg: boolean; /** * File path corresponding to the export item */ file: string; /** * Identifier for the export item */ identifier: string; } export type ManifestJsonChunks = Record; export interface ManifestJsonChunk { name: string; /** * Current compiled JS file. */ js: string; /** * Current compiled CSS files. */ css: string[]; /** * Other resource files. */ resources: string[]; } /** * The RFC 0001 §5 protocol fields shared by every bundler manifest plugin. */ export interface ManifestProtocolFields { protocol: number; version: string; provides: Record; uses: string[]; } /** * Builds the RFC 0001 §5 manifest protocol fields (`protocol`, `version`, * `provides`, `uses`) from the module root's package.json plus the list of * pkg-export package specifiers the bundler plugin computed. Shared by the * @esmx/rspack, @esmx/rsbuild and @esmx/vite manifest plugins so their output * cannot drift. */ export declare function buildManifestProtocolFields(moduleRoot: string, provides: string[]): ManifestProtocolFields; /** * Get service manifest files */ export declare function getManifestList(env: BuildEnvironment, moduleConfig: ParsedModuleConfig): Promise;