UNPKG

bit-bin

Version:

<a href="https://opensource.org/licenses/Apache-2.0"><img alt="apache" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a> <a href="https://github.com/teambit/bit/blob/master/CONTRIBUTING.md"><img alt="prs" src="https://img.shields.io/b

68 lines (67 loc) 2.83 kB
import { PathOsBased, PathOsBasedAbsolute, PathOsBasedRelative } from '../utils/path'; import { BitId } from '../bit-id'; import Consumer from '../consumer/consumer'; import Component from '../consumer/component/consumer-component'; import { RelativePath } from '../consumer/component/dependencies/dependency'; import ComponentMap from '../consumer/bit-map/component-map'; import BitMap from '../consumer/bit-map'; export declare type LinkFileType = { linkPath: string; linkContent: string; isEs6?: boolean; postInstallLink?: boolean; postInstallSymlink?: boolean; symlinkTo?: PathOsBased | null | undefined; customResolveMapping?: { [key: string]: string; } | null | undefined; }; export default class DependencyFileLinkGenerator { consumer: Consumer | null | undefined; bitMap: BitMap; component: Component; componentMap: ComponentMap; relativePath: RelativePath; dependencyId: BitId; dependencyComponent: Component; createNpmLinkFiles: boolean; targetDir: string | null | undefined; dependencyComponentMap: ComponentMap | null | undefined; linkFiles: LinkFileType[]; relativePathInDependency: PathOsBased; hasDist: boolean; shouldDistsBeInsideTheComponent: boolean; constructor({ consumer, bitMap, component, relativePath, dependencyComponent, createNpmLinkFiles, targetDir }: { consumer: Consumer | null | undefined; bitMap: BitMap; component: Component; relativePath: RelativePath; dependencyComponent: Component; createNpmLinkFiles: boolean; targetDir?: string; }); generate(): LinkFileType[]; generateForCustomResolve(): LinkFileType[]; generateForDist(): void; prepareLinkFile({ linkPath, relativePathInDependency, depRootDir }: { linkPath: PathOsBased; relativePathInDependency: PathOsBased; depRootDir: PathOsBasedAbsolute | null | undefined; }): LinkFileType; _getSymlinkDest(filePath: PathOsBased): string; getLinkContent(relativeFilePath: PathOsBased): string; _getPackagePath(): string; _getPackagePathByDistWithComponentPrefix(): any; _getPackageName(): string; _getPackagePathToInternalFile(filePath?: string): string; _getInternalFileInsidePackage(filePath: string): string; _getCustomResolveMapping(): {} | null; getTargetDir(): PathOsBasedRelative; getLinkPath(): PathOsBased; getLinkPathForCustomResolve(relativeDistExtInDependency: string): PathOsBased; _getDistRoot(): PathOsBasedRelative; _getRelativeDistPathInDependency(): any; _getImportSourcePathForCustomResolve(relativeDistExtInDependency: string): PathOsBased; _getDepRootDir(): PathOsBasedRelative | null | undefined; _getDepRootDirDist(): PathOsBasedRelative | null | undefined; }