UNPKG

lerna

Version:

Lerna is a fast, modern build system for managing and publishing multiple JavaScript/TypeScript packages from the same repository

23 lines (22 loc) 972 B
/** * Minimal line-diff implementation for lerna init dry-run output. * * Replaces jest-diff to eliminate the runtime dependency on jest packages and * their transitive dependencies (pretty-format, chalk, ansi-styles). * * Modeled on the equivalent replacement in Nx: * https://github.com/nrwl/nx/blob/master/packages/nx/src/command-line/release/utils/diff.ts * The hunk formatting is a faithful port of jest-diff's joinAlignedDiffsNoExpand, * but the line alignment uses a classic LCS table instead of @jest/diff-sequences, * which is more than fast enough for the small config files lerna init touches. */ export interface DiffOptions { contextLines?: number; expand?: boolean; aColor?: (s: string) => string; bColor?: (s: string) => string; commonColor?: (s: string) => string; patchColor?: (s: string) => string; omitAnnotationLines?: boolean; } export declare function diff(a: string, b: string, options?: DiffOptions): string;