UNPKG

docker-deps

Version:

Extract the minimal dependency definition files needed to build Docker image, also compatible with monorepo.

65 lines (62 loc) 1.68 kB
import { GlobOptions } from 'glob'; interface Config { /** * Specify the working directory, usually the directory of the Dockerfile, * other directory options are based on this. * * @default process.cwd() */ cwd?: string; /** * Specify the output directory. * * @default ".docker-deps" */ output?: string; /** * Available in monorepo. * * Provide a package name to extract only this package and its dependencies, * similar to the `-F` parameter of `turbo prune`. * * If not provided, all sub-packages will be extracted. */ filter?: string; /** * Disable most console output. * * @default false */ quiet?: boolean; /** * Only print actions to the console without actually executing them, ignore the `quiet` option. * * @default false */ dryRun?: boolean; /** * Specify files to be copied additionally, using glob pattern. */ include?: string | string[]; /** * Exclude specific files when copying, using glob pattern, higher priority than `include`. */ exclude?: string | string[]; /** * Passed through as a configuration option for `glob`. */ configGlob?: GlobOptions; } interface CopyFile { from: string; to: string; fromAbs: string; toAbs: string; } interface Result { copyFiles: CopyFile[]; configFromPackageJson?: Partial<Config>; } declare function dockerDepsSync(config?: Config): Result; declare function dockerDeps(config?: Config): Promise<Result>; export { type Config, type CopyFile, type Result, dockerDeps, dockerDepsSync };