/** * Shared bundling orchestration for Pikku deploys. * * `BaseBundler` performs everything that is runtime-independent for each * deployment unit: * 1. Take a pre-generated entry point (provided by the deploy provider) * 2. Stub gen files / npm modules not needed by this unit * 3. Delegate the actual compile to a runtime backend (`compile`) * 4. Resolve external dependency versions into a minimal package.json * 5. Write all artifacts to `//` and hash them * * The runtime-specific compile step lives in `NodeBundler` (esbuild) and * `BunBundler` (Bun.build); the right one is injected from `services.ts`. */ import type { DeploymentManifest, BundleOutput } from './types.js'; import type { Bundler, BundleUnitsOptions, CompileInput, CompileResult } from './bundler.interface.js'; /** * Runtime-independent bundling orchestration. Subclasses implement only * `compile` — the actual esbuild / Bun.build invocation. */ export declare abstract class BaseBundler implements Bundler { /** * Runtime-specific compile step: write `input.bundlePath` (and its `.map` * when `input.sourcemap`) and return the external packages + optional * metafile JSON. */ protected abstract compile(input: CompileInput): Promise; bundleUnits(projectDir: string, manifest: DeploymentManifest, entryFiles: Map, outputDir?: string, options?: BundleUnitsOptions): Promise; private bundleUnit; }