import type { BundleRequest } from '../types/BundleRequest.js'; import type { Context } from '../types/Context.js'; import type { TargetEnvironment, WithOptional } from '@ms-cloudpack/common-types'; /** * Input for `ensurePackageBundled`. */ export interface EnsurePackageBundledInput extends Pick { /** Package name */ name: string; /** * Target environment for the bundle. * @default 'browser' */ targetEnvironment?: TargetEnvironment; /** Whether to also ensure dependencies are bundled */ enqueueDependencies?: boolean; /** Whether to re-run the bundle task */ shouldRerun?: boolean; /** * Whether to watch for changes (internal packages only). * NOTE: requires `ctx.bus` and `ctx.watcher` to be set. */ shouldWatch?: boolean; /** Whether to force re-bundling */ shouldForce?: boolean; /** Whether to disable caching. */ disableCache?: boolean; /** Whether to support incremental rebuilds. Defaults to true for internal libraries. */ isIncremental?: boolean; /** * Whether to use a hash as the bundle id instead of the path. * Reduces performance when used with shouldForce as it hashes twice, * but eliminates task cache artifacts when handling many apps. */ useHashAsId?: boolean; /** Priority for bundling. Greater priority will be scheduled first (defaults to 0). */ priority?: number; } /** * Result of ensuring a single package is bundled. */ export interface EnsurePackageBundledResult extends Omit, 'rebuild' | 'dispose' | 'bundlerName' | 'inputPath'> { /** Package name */ name: string; /** Package version */ version: string; /** Package dependency names (prod and peer) */ dependencies?: string[]; /** Whether the package is external (not defined in this repo). Unset if it's not found. */ isExternal?: boolean; /** Absolute path of the package. Will be unset if the package couldn't be found. */ inputPath?: string; } /** * Complete output for `ensurePackageBundled`. */ export interface EnsurePackageBundledOutput { /** Result of bundling this package */ result: EnsurePackageBundledResult; /** Results of bundling dependencies */ dependencies: Promise; } /** * Context for `ensurePackageBundled`. `bus` and `watcher` are only needed if `shouldWatch` is true. */ export type EnsurePackageBundledContext = WithOptional; /** * Checks if the package is bundled or needs bundling, and returns the result. * For internal packages, we also notify the watcher to monitor for code changes. */ export declare function ensurePackageBundled(input: EnsurePackageBundledInput, ctx: EnsurePackageBundledContext): Promise; //# sourceMappingURL=ensurePackageBundled.d.ts.map