import { Lazy } from "lazy-val" import { executeAppBuilderAsJson } from "./appBuilder" export function createLazyProductionDeps(projectDir: string, excludedDependencies: Array | null, flatten: T) { return new Lazy(async () => { const args = ["node-dep-tree", "--dir", projectDir] if (flatten) args.push("--flatten") if (excludedDependencies != null) { for (const name of excludedDependencies) { args.push("--exclude-dep", name) } } return executeAppBuilderAsJson>(args) }) } export interface NodeModuleDirInfo { readonly dir: string readonly deps: Array } export interface NodeModuleInfo { readonly name: string readonly version: string readonly dir: string readonly dependencies?: Array }