isolate-package
Version:
Isolate a monorepo package with its shared dependencies to form a self-contained directory, compatible with Firebase deploy
38 lines (33 loc) • 1.16 kB
TypeScript
type IsolateConfigResolved = {
buildDirName?: string;
includeDevDependencies: boolean;
includePatchedDependencies: boolean;
isolateDirName: string;
logLevel: "info" | "debug" | "warn" | "error";
targetPackagePath?: string;
tsconfigPath: string;
workspacePackages?: string[];
workspaceRoot: string;
forceNpm: boolean;
pickFromScripts?: string[];
omitFromScripts?: string[];
omitPackageManager?: boolean;
};
type IsolateConfig = Partial<IsolateConfigResolved>;
declare function isolate(config?: IsolateConfig): Promise<string>;
/**
* The Logger defines an interface that can be used to pass in a different
* logger object in order to intercept all the logging output. We keep the
* handlers separate from the logger object itself, so that we can change the
* handlers but do not bother the user with having to handle logLevel.
*/
type Logger = {
debug(...args: unknown[]): void;
info(...args: unknown[]): void;
warn(...args: unknown[]): void;
error(...args: unknown[]): void;
};
type IsolateExports = {
isolate: typeof isolate;
};
export { type IsolateExports, type Logger, isolate };