UNPKG

69.3 kBSource Map (JSON)View Raw
1{"version":3,"file":"index.cjs.js","sources":["../src/fs/path-utils.ts","../src/compiler/create-parse-config-host.ts","../src/compiler/config-parser.ts","../src/compiler/create-compiler-host.ts","../src/cache.ts","../src/fs/file-utils.ts","../src/cache/directory-entries-cache-delegate.ts","../src/cache/directory-entries-cache.ts","../src/compiler/input-io.ts","../src/helpers.ts","../src/compiler/output-patcher.ts","../src/fs/parse-path.ts","../src/cache/path-info-cache-delegate.ts","../src/cache/path-info-cache.ts","../src/fs/resolve.ts","../src/cache/resolution-cache-delegate.ts","../src/cache/resolution-cache.ts","../src/compiler/path-resolver.ts","../src/compiler/source-cache.ts","../src/compiler.ts","../src/diagnostics-handler.ts","../src/normalize-options.ts","../src/plugin.ts","../src/compat/filter.ts"],"sourcesContent":["import * as ts from \"typescript\";\nimport { AbsolutePath, CanonicalPath } from \"../interfaces\";\n\nconst enum CharCode {\n Slash = 47,\n}\n\nexport const useCaseSensitiveFileNames = ts.sys.useCaseSensitiveFileNames;\nexport const getCanonicalFileName = ts.sys.useCaseSensitiveFileNames\n ? (fileName: string) => fileName\n : (fileName: string) => fileName.toLowerCase();\n\nexport const defaultLibLocation = ts.getDirectoryPath(\n toCanonicalPath(ts.sys.getExecutingFilePath())\n);\n\nexport function normalizePath(path: string) {\n if (path.length === 0) {\n return path;\n }\n return trimTrailingSlash(ts.normalizePath(path));\n}\n\nexport function isWithin(rootPath: AbsolutePath, path: AbsolutePath) {\n return (\n path.length > rootPath.length &&\n path.lastIndexOf(rootPath, 0) === 0 &&\n path.charCodeAt(rootPath.length) === CharCode.Slash\n );\n}\n\nexport function relativePathWithin(\n root: AbsolutePath,\n path: AbsolutePath\n): string | undefined {\n let relativePath: string | undefined;\n if (\n path.length > root.length &&\n path.lastIndexOf(root, 0) === 0 &&\n path.charCodeAt(root.length) === CharCode.Slash\n ) {\n relativePath = path.substring(root.length + 1);\n } else if (path === root) {\n relativePath = \"\";\n }\n return relativePath;\n}\n\nexport function toCanonicalPath(\n fileName: string,\n basePath?: AbsolutePath | CanonicalPath\n): CanonicalPath {\n const p = ts.toPath(\n fileName,\n basePath === undefined ? currentDirectory() : basePath,\n getCanonicalFileName\n );\n return trimTrailingSlash(p);\n}\n\nexport function toAbsolutePath(\n fileName: string,\n basePath?: AbsolutePath\n): AbsolutePath {\n const p = ts.toPath(\n fileName,\n basePath === undefined ? currentDirectory() : basePath,\n name => name\n );\n\n return (trimTrailingSlash(p) as string) as AbsolutePath;\n}\n\nexport { getDirectoryPath } from \"typescript\";\n\nfunction trimTrailingSlash(path: CanonicalPath): CanonicalPath;\nfunction trimTrailingSlash(path: AbsolutePath): AbsolutePath;\nfunction trimTrailingSlash(path: string): string;\nfunction trimTrailingSlash(path: string) {\n if (path.charCodeAt(path.length - 1) === CharCode.Slash) {\n return path.slice(0, path.length - 1);\n }\n return path;\n}\n\nfunction currentDirectory() {\n return normalizePath(process.cwd()) as CanonicalPath;\n}\n\n// tslint:disable\ndeclare module \"typescript\" {\n export function getDirectoryPath(path: ts.Path): ts.Path;\n export function getDirectoryPath(path: string): string;\n\n export function normalizePath(path: string): string;\n export function toPath(\n fileName: string,\n basePath: string,\n getCanonicalFileName: (path: string) => string\n ): ts.Path;\n}\n","import { matchFiles, ParseConfigHost } from \"typescript\";\nimport { useCaseSensitiveFileNames } from \"../fs/path-utils\";\nimport { AbsolutePath } from \"../interfaces\";\nimport InputIO from \"./input-io\";\n\nexport default function createParseConfigHost(\n workingPath: AbsolutePath,\n input: InputIO\n): ParseConfigHost {\n function getFileSystemEntries(path: string) {\n return input.getFileSystemEntries(path);\n }\n\n function realpath(path: string): string {\n return input.realpath(path) || path;\n }\n\n function readDirectory(\n rootDir: string,\n extensions: ReadonlyArray<string>,\n excludes: ReadonlyArray<string>,\n includes: ReadonlyArray<string>,\n depth?: number\n ): string[] {\n return matchFiles(\n rootDir,\n extensions,\n excludes,\n includes,\n useCaseSensitiveFileNames,\n workingPath,\n depth,\n getFileSystemEntries,\n realpath\n );\n }\n\n function fileExists(path: string): boolean {\n return input.fileExists(path);\n }\n\n function readFile(path: string): string {\n return input.readFile(path) as string;\n }\n\n return {\n fileExists,\n readDirectory,\n readFile,\n useCaseSensitiveFileNames,\n };\n}\n\n// tslint:disable\ndeclare module \"typescript\" {\n export interface FileSystemEntries {\n files: ReadonlyArray<string>;\n directories: ReadonlyArray<string>;\n }\n export function matchFiles(\n path: string,\n extensions: ReadonlyArray<string>,\n excludes: ReadonlyArray<string>,\n includes: ReadonlyArray<string>,\n useCaseSensitiveFileNames: boolean,\n currentDirectory: string,\n depth: number | undefined,\n getFileSystemEntries: (path: string) => FileSystemEntries,\n realpath: (path: string) => string,\n ): string[];\n}\n","import * as ts from \"typescript\";\nimport { getDirectoryPath } from \"../fs/path-utils\";\nimport {\n AbsolutePath,\n CompilerOptionsConfig,\n TypescriptConfig,\n} from \"../interfaces\";\nimport createParseConfigHost from \"./create-parse-config-host\";\nimport Input from \"./input-io\";\n\nexport default class ConfigParser {\n private host: ts.ParseConfigHost;\n\n constructor(\n private projectPath: AbsolutePath,\n private rawConfig: TypescriptConfig | undefined,\n private configFileName: string | undefined,\n private compilerOptions: CompilerOptionsConfig | undefined,\n workingPath: AbsolutePath,\n input: Input\n ) {\n this.host = createParseConfigHost(workingPath, input);\n }\n\n public parseConfig(): ts.ParsedCommandLine {\n const configFileName = this.resolveConfigFileName();\n const basePath = this.getBasePath(configFileName);\n const existingOptions = this.convertExistingOptions(basePath);\n\n const result = this.parseConfigContent(\n configFileName,\n basePath,\n existingOptions.options\n );\n\n if (existingOptions.errors.length > 0) {\n result.errors = existingOptions.errors.concat(result.errors);\n }\n\n if (result.options.noEmit === true) {\n result.options.noEmit = false;\n }\n\n return result;\n }\n\n private resolveConfigFileName(): AbsolutePath | undefined {\n if (this.rawConfig !== undefined) {\n return;\n }\n return ts.findConfigFile(\n this.projectPath,\n this.host.fileExists,\n this.configFileName\n ) as AbsolutePath;\n }\n\n private getBasePath(configFilePath: AbsolutePath | undefined): AbsolutePath {\n if (configFilePath === undefined) {\n return this.projectPath;\n }\n return getDirectoryPath(configFilePath) as AbsolutePath;\n }\n\n private convertExistingOptions(basePath: AbsolutePath) {\n const { compilerOptions } = this;\n if (compilerOptions === undefined) {\n return {\n errors: [] as ts.Diagnostic[],\n options: undefined,\n };\n }\n return ts.convertCompilerOptionsFromJson(this.compilerOptions, basePath);\n }\n\n private readConfigSourceFile(\n configFilePath: AbsolutePath | undefined\n ): ts.JsonSourceFile | undefined {\n if (configFilePath === undefined) {\n return;\n }\n const configFileText = this.host.readFile(configFilePath);\n if (configFileText === undefined) {\n throw new Error(`File '${configFilePath}' not found.`);\n }\n return ts.parseJsonText(configFilePath, configFileText);\n }\n\n private parseConfigContent(\n configFileName: AbsolutePath | undefined,\n basePath: AbsolutePath,\n existingOptions: ts.CompilerOptions | undefined\n ) {\n const configSourceFile = this.readConfigSourceFile(configFileName);\n if (configSourceFile === undefined) {\n return ts.parseJsonConfigFileContent(\n this.rawConfig || {},\n this.host,\n basePath,\n existingOptions\n );\n }\n return ts.parseJsonSourceFileConfigFileContent(\n configSourceFile,\n this.host,\n basePath,\n existingOptions,\n configFileName\n );\n }\n}\n","import {\n CompilerHost,\n CompilerOptions,\n getDefaultLibFileName,\n NewLineKind,\n SourceFile,\n sys,\n} from \"typescript\";\nimport {\n defaultLibLocation,\n getCanonicalFileName,\n toCanonicalPath,\n useCaseSensitiveFileNames,\n} from \"../fs/path-utils\";\nimport { AbsolutePath } from \"../interfaces\";\nimport InputIO from \"./input-io\";\nimport SourceCache from \"./source-cache\";\n\nexport default function createCompilerHost(\n workingPath: AbsolutePath,\n input: InputIO,\n sourceCache: SourceCache,\n compilerOptions: CompilerOptions\n): CompilerHost {\n const newLine = getNewLine(compilerOptions);\n return {\n directoryExists: path => input.directoryExists(path),\n fileExists: path => input.fileExists(path),\n getCanonicalFileName,\n getCurrentDirectory: () => workingPath,\n getDefaultLibFileName: options =>\n toCanonicalPath(getDefaultLibFileName(options), defaultLibLocation),\n getDefaultLibLocation: () => defaultLibLocation,\n getDirectories: path => input.getDirectories(path),\n getNewLine: () => newLine,\n getSourceFile: fileName =>\n sourceCache.getSourceFile(fileName) as SourceFile,\n getSourceFileByPath: (fileName, path) =>\n sourceCache.getSourceFileByPath(fileName, path) as SourceFile,\n readFile: path => input.readFile(path) as string,\n realpath: path => input.realpath(path) as string,\n trace: s => sys.write(s + newLine),\n useCaseSensitiveFileNames: () => useCaseSensitiveFileNames,\n writeFile: () => {\n // we provide a write file on emit.\n throw new Error(\"compiler host does not write output\");\n },\n };\n}\n\nfunction getNewLine(options: CompilerOptions): string {\n let newLine;\n if (options.newLine === undefined) {\n newLine = sys.newLine;\n } else {\n newLine = options.newLine === NewLineKind.LineFeed ? \"\\n\" : \"\\r\\n\";\n }\n return newLine;\n}\n","import { CacheDelegate } from \"./interfaces\";\n\nexport default class Cache<K, CK, V> {\n public hits = 0;\n public misses = 0;\n private store = new Map<CK, V>();\n constructor(private delegate: CacheDelegate<K, CK, V>) {}\n\n public get(key: K): V {\n const cacheKey = this.delegate.cacheKey(key);\n let value = this.store.get(cacheKey);\n if (value === undefined) {\n this.misses++;\n value = this.delegate.create(key);\n this.store.set(cacheKey, value);\n } else {\n this.hits++;\n }\n return value;\n }\n\n public clear() {\n this.store.clear();\n }\n}\n","import { createHash } from \"crypto\";\nimport { readdirSync, readFileSync, Stats, statSync } from \"fs\";\nimport {\n AbsolutePath,\n CanonicalPath,\n DirEntries,\n FileContent,\n PathResolver,\n Resolution,\n} from \"../interfaces\";\n\nexport function readFile(path: AbsolutePath): FileContent {\n const buffer = readFileSync(path);\n const hash = createHash(\"sha1\");\n hash.update(buffer);\n return { buffer, version: hash.digest(\"hex\") };\n}\n\nexport function readFileResolution(resolution: Resolution) {\n let path: AbsolutePath | undefined;\n if (resolution.isFile()) {\n if (resolution.isInput()) {\n path = resolution.pathInInput;\n } else {\n path = resolution.path;\n }\n }\n if (path) {\n return readFile(path);\n }\n}\n\nexport function stat(path: AbsolutePath): Stats | undefined {\n try {\n return statSync(path);\n } catch (e) {\n if (e.code === \"ENOENT\" || e.code === \"EACCES\") {\n return;\n }\n throw e;\n }\n}\n\nexport function readdir(\n path: CanonicalPath,\n resolver: PathResolver\n): DirEntries {\n const prefix = path + \"/\";\n const files: string[] = [];\n const directories: string[] = [];\n for (const entry of readdirSync(path).sort()) {\n const resolution = resolver.resolve(prefix + entry);\n if (resolution.isFile()) {\n files.push(entry);\n } else if (resolution.isDirectory()) {\n directories.push(entry);\n }\n }\n return { files, directories };\n}\n","import { readdir } from \"../fs/file-utils\";\nimport {\n CacheDelegate,\n CanonicalPath,\n DirEntries,\n PathResolver,\n} from \"../interfaces\";\n\nexport default class DirEntriesCacheDelegate\n implements CacheDelegate<CanonicalPath, CanonicalPath, DirEntries> {\n constructor(private resolver: PathResolver) {}\n\n public cacheKey(path: CanonicalPath): CanonicalPath {\n return path;\n }\n\n public create(path: CanonicalPath): DirEntries {\n return readdir(path, this.resolver);\n }\n}\n","import Cache from \"../cache\";\nimport { CanonicalPath, DirEntries, PathResolver } from \"../interfaces\";\nimport DirEntriesCacheDelegate from \"./directory-entries-cache-delegate\";\n\nexport default class DirEntriesCache extends Cache<\n CanonicalPath,\n CanonicalPath,\n DirEntries\n> {\n constructor(resolver: PathResolver) {\n super(new DirEntriesCacheDelegate(resolver));\n }\n}\n","import { realpathSync } from \"fs\";\nimport * as ts from \"typescript\";\nimport DirectoryEntriesCache from \"../cache/directory-entries-cache\";\nimport {\n AbsolutePath,\n CanonicalPath,\n DirEntries,\n PathResolver,\n Resolution,\n} from \"../interfaces\";\n\nexport default class Input {\n private entriesCache: DirectoryEntriesCache;\n private realpathCache: { [path: string]: string } = Object.create(null);\n\n constructor(private resolver: PathResolver) {\n this.entriesCache = new DirectoryEntriesCache(resolver);\n }\n\n public fileExists(path: string) {\n return this.resolve(path).isFile();\n }\n\n public directoryExists(path: string) {\n return this.resolve(path).isDirectory();\n }\n\n /**\n * Used for type resolution.\n *\n * Will merge the view of input path and root path.\n */\n public getDirectories(path: string): string[] {\n const resolution = this.resolve(path);\n let directories: string[];\n if (resolution.isDirectory()) {\n if (resolution.isInput()) {\n directories = this.readdir(resolution.canonicalPathInInput).directories;\n if (resolution.isMerged()) {\n for (const other in this.readdir(resolution.canonicalPath)\n .directories) {\n if (directories.indexOf(other) === -1) {\n directories.push(other);\n }\n }\n }\n } else {\n directories = this.readdir(resolution.canonicalPath).directories;\n }\n } else {\n directories = [];\n }\n return directories;\n }\n\n /**\n * Used by config parser for matching input.\n *\n * Unlike getDirectories which merges the view of input node and root.\n * We only allow this to return entries for things within the\n * broccoli input node.\n */\n public getFileSystemEntries(path: string) {\n const resolution = this.resolve(path);\n let entries: DirEntries;\n if (resolution.isDirectory() && resolution.isInput()) {\n entries = this.readdir(resolution.canonicalPathInInput);\n } else {\n entries = { files: [], directories: [] };\n }\n return entries;\n }\n\n public readFile(path: string): string | undefined {\n const resolution = this.resolve(path);\n let resolved: AbsolutePath | undefined;\n if (resolution.isFile()) {\n if (resolution.isInput()) {\n resolved = resolution.pathInInput;\n } else {\n resolved = resolution.path;\n }\n }\n if (resolved !== undefined) {\n return ts.sys.readFile(resolved);\n }\n }\n\n public relativePath(path: string): string | undefined {\n return this.resolve(path).relativePath;\n }\n\n public realpath(path: string): AbsolutePath | undefined {\n const resolution = this.resolve(path);\n if (resolution.isInput()) {\n return resolution.path;\n } else if (resolution.exists()) {\n const realpath = realpathSync(resolution.path, this.realpathCache);\n return this.resolve(realpath).path;\n }\n }\n\n public reset() {\n this.entriesCache.clear();\n this.realpathCache = Object.create(null);\n }\n\n private resolve(path: string): Resolution {\n return this.resolver.resolve(path);\n }\n\n private readdir(path: CanonicalPath) {\n return this.entriesCache.get(path);\n }\n}\n","export const FSTree: FSTree.Static = require(\"fs-tree-diff\");\nexport const BroccoliPlugin: BroccoliPlugin.Static = require(\"broccoli-plugin\");\nexport const walkSync: WalkSync = require(\"walk-sync\");\nexport const md5Hex: MD5Hex = require(\"md5-hex\");\nexport const heimdall: Heimdall = require(\"heimdalljs\");\n\ndeclare function require(id: string): any;\n\nexport interface Token {\n __tokenBrand: any;\n}\n\nexport interface Heimdall {\n start(name: string): Token;\n stop(token: Token): void;\n}\n\nexport type MD5Hex = (str: string) => string;\n\nexport namespace BroccoliPlugin {\n export interface PluginOptions {\n name?: string;\n annotation?: string;\n persistentOutput?: boolean;\n }\n\n export interface Plugin {\n inputPaths: string[];\n outputPath: string;\n cachePath: string;\n }\n\n export type Static = new (inputNodes: any[], options?: any) => Plugin;\n}\n\nexport interface WalkSync {\n (path: string, options?: any): string[];\n entries(path: string, options?: any): WalkSync.Entry[];\n}\n\nexport namespace WalkSync {\n export type Row = string | RegExp[];\n\n export interface Entry {\n relativePath: string;\n basePath: string;\n fullPath: string;\n checksum: string;\n mode: number;\n size: number;\n mtime: Date;\n isDirectory(): boolean;\n }\n}\n\nexport interface FSTree {\n calculatePatch(\n next: FSTree,\n isUnchanged?: (a: WalkSync.Entry, b: WalkSync.Entry) => {}\n ): FSTree.PatchOp[];\n}\n\nexport namespace FSTree {\n export type Op = \"unlink\" | \"create\" | \"mkdir\" | \"rmdir\" | \"change\";\n\n export type PatchOp = [Op, string, WalkSync.Entry];\n\n export interface Static {\n fromEntries(\n entries: WalkSync.Entry[],\n options?: {\n sortAndExpand?: boolean;\n }\n ): FSTree;\n }\n}\n","import * as fs from \"fs\";\nimport { FSTree, md5Hex, walkSync, WalkSync } from \"../helpers\";\n\nexport default class OutputPatcher {\n private entries: WalkSync.Entry[] = [];\n private contents = new Map<string, string>();\n private lastTree: FSTree | undefined = undefined;\n private isUnchanged: (a: Entry, b: Entry) => boolean;\n\n constructor(private outputPath: string) {\n this.isUnchanged = (entryA, entryB) => {\n if (entryA.isDirectory() && entryB.isDirectory()) {\n return true;\n }\n if (entryA.mode === entryB.mode && entryA.checksum === entryB.checksum) {\n return true;\n }\n return false;\n };\n }\n\n // relativePath should be without leading '/' and use forward slashes\n public add(relativePath: string, content: string): void {\n this.entries.push(\n new Entry(this.outputPath, relativePath, md5Hex(content))\n );\n this.contents.set(relativePath, content);\n }\n\n public patch() {\n try {\n this.lastTree = this._patch();\n } catch (e) {\n // walkSync(output);\n this.lastTree = undefined;\n throw e;\n } finally {\n this.entries = [];\n this.contents = new Map<string, string>();\n }\n }\n\n private _patch() {\n const entries = this.entries;\n let lastTree = this.lastTree;\n const isUnchanged = this.isUnchanged;\n const outputPath = this.outputPath;\n const contents = this.contents;\n const nextTree = FSTree.fromEntries(entries, { sortAndExpand: true });\n if (!lastTree) {\n lastTree = FSTree.fromEntries(walkSync.entries(outputPath));\n }\n const patch = lastTree.calculatePatch(nextTree, isUnchanged);\n patch.forEach(change => {\n const op = change[0];\n const path = change[1];\n const entry = change[2];\n switch (op) {\n case \"mkdir\":\n // the expanded dirs don't have a base\n fs.mkdirSync(outputPath + \"/\" + path);\n break;\n case \"rmdir\":\n // the expanded dirs don't have a base\n fs.rmdirSync(outputPath + \"/\" + path);\n break;\n case \"unlink\":\n fs.unlinkSync(entry.fullPath);\n break;\n case \"create\":\n case \"change\":\n fs.writeFileSync(entry.fullPath, contents.get(path) ?? \"\");\n break;\n default:\n throw new Error(`unrecognized case ${op}`);\n }\n });\n return nextTree;\n }\n}\n\n/* tslint:disable:max-classes-per-file */\nclass Entry implements WalkSync.Entry {\n public fullPath: string;\n public mode: number = 0;\n public size: number = 0;\n public mtime: Date = new Date();\n\n constructor(\n public basePath: string,\n public relativePath: string,\n public checksum: string\n ) {\n this.fullPath = basePath + \"/\" + relativePath;\n this.checksum = checksum;\n }\n\n public isDirectory() {\n return false;\n }\n}\n","import { AbsolutePath, PathInfo } from \"../interfaces\";\nimport {\n relativePathWithin,\n toAbsolutePath,\n toCanonicalPath,\n} from \"./path-utils\";\n\nexport default function parsePath(\n rootPath: AbsolutePath,\n inputPath: AbsolutePath,\n rawPath: string\n): PathInfo {\n let path = toAbsolutePath(rawPath, rootPath);\n let pathInInput: AbsolutePath | undefined;\n let relativePath = relativePathWithin(rootPath, path);\n if (relativePath === undefined) {\n relativePath = relativePathWithin(inputPath, path);\n if (relativePath !== undefined) {\n pathInInput = path;\n path = toAbsolutePath(relativePath, rootPath);\n }\n } else {\n pathInInput = toAbsolutePath(relativePath, inputPath);\n }\n\n const canonicalPath = toCanonicalPath(path);\n const canonicalPathInInput = pathInInput && toCanonicalPath(pathInInput);\n\n return {\n canonicalPath,\n canonicalPathInInput,\n path,\n pathInInput,\n relativePath,\n };\n}\n","import parsePath from \"../fs/parse-path\";\nimport { toCanonicalPath } from \"../fs/path-utils\";\nimport {\n AbsolutePath,\n CacheDelegate,\n CanonicalPath,\n PathInfo,\n} from \"../interfaces\";\n\nexport default class PathInfoCacheDelegate\n implements CacheDelegate<string, CanonicalPath, PathInfo> {\n constructor(\n private rootPath: AbsolutePath,\n private inputPath: AbsolutePath\n ) {}\n\n public cacheKey(key: string): CanonicalPath {\n return toCanonicalPath(key, this.rootPath);\n }\n\n public create(key: string) {\n return parsePath(this.rootPath, this.inputPath, key);\n }\n}\n","import Cache from \"../cache\";\nimport { AbsolutePath, CanonicalPath, PathInfo } from \"../interfaces\";\nimport PathInfoCacheDelegate from \"./path-info-cache-delegate\";\n\nexport default class PathInfoCache extends Cache<\n string,\n CanonicalPath,\n PathInfo\n> {\n constructor(rootPath: AbsolutePath, inputPath: AbsolutePath) {\n super(new PathInfoCacheDelegate(rootPath, inputPath));\n }\n}\n","import { Stats } from \"fs\";\nimport {\n AbsolutePath,\n CanonicalPath,\n DirectoryResolution,\n FileResolution,\n InputDirectoryResolution,\n InputFileResolution,\n MergedDirectoryResolution,\n PathInfo,\n Resolution,\n} from \"../interfaces\";\nimport { stat } from \"./file-utils\";\n\nexport default function resolve(pathInfo: PathInfo): Resolution {\n let flags = ResolutionFlags.None;\n let stats: Stats | undefined;\n let otherStats: Stats | undefined;\n if (pathInfo.pathInInput) {\n stats = stat(pathInfo.pathInInput);\n if (stats !== undefined) {\n flags |= ResolutionFlags.Input;\n }\n }\n if (stats === undefined) {\n stats = stat(pathInfo.path);\n }\n if (stats !== undefined) {\n flags |= stats.isDirectory() ? ResolutionFlags.Dir : ResolutionFlags.File;\n }\n if ((flags & ResolutionFlags.InputDir) === ResolutionFlags.InputDir) {\n otherStats = stat(pathInfo.path);\n if (otherStats !== undefined && otherStats.isDirectory()) {\n flags |= ResolutionFlags.Merge;\n }\n }\n return new ResolutionImpl(pathInfo, stats, otherStats, flags);\n}\n\nconst enum ResolutionFlags {\n None = 0,\n File = 1 << 0,\n Dir = 1 << 1,\n Input = 1 << 2,\n Merge = 1 << 3,\n InputDir = Dir | Input,\n}\n\nclass ResolutionImpl implements Resolution {\n public canonicalPath: CanonicalPath;\n public canonicalPathInInput: CanonicalPath | undefined;\n public path: AbsolutePath;\n public pathInInput: AbsolutePath | undefined;\n public relativePath: string | undefined;\n\n constructor(\n pathInfo: PathInfo,\n public stats: Stats | undefined,\n public otherStats: Stats | undefined,\n private flags: ResolutionFlags\n ) {\n this.canonicalPath = pathInfo.canonicalPath;\n this.canonicalPathInInput = pathInfo.canonicalPathInInput;\n this.path = pathInfo.path;\n this.pathInInput = pathInfo.pathInInput;\n this.relativePath = pathInfo.relativePath;\n }\n\n public isInput(): this is InputDirectoryResolution | InputFileResolution {\n return this.hasFlag(ResolutionFlags.Input);\n }\n\n public isFile(): this is FileResolution | InputFileResolution {\n return this.hasFlag(ResolutionFlags.File);\n }\n\n public isDirectory(): this is DirectoryResolution | InputDirectoryResolution {\n return this.hasFlag(ResolutionFlags.Dir);\n }\n\n public isMerged(): this is MergedDirectoryResolution {\n return this.hasFlag(ResolutionFlags.File);\n }\n\n public exists(): this is FileResolution | DirectoryResolution {\n return this.stats !== undefined;\n }\n\n private hasFlag(flag: ResolutionFlags) {\n return (this.flags & flag) === flag;\n }\n}\n","import resolve from \"../fs/resolve\";\nimport {\n CacheDelegate,\n CanonicalPath,\n PathInfo,\n Resolution,\n} from \"../interfaces\";\n\nexport default class ResolutionCacheDelegate\n implements CacheDelegate<PathInfo, CanonicalPath, Resolution> {\n public cacheKey(pathInfo: PathInfo): CanonicalPath {\n return pathInfo.canonicalPath;\n }\n\n public create(pathInfo: PathInfo) {\n return resolve(pathInfo);\n }\n}\n","import Cache from \"../cache\";\nimport { CanonicalPath, PathInfo, Resolution } from \"../interfaces\";\nimport ResolutionCacheDelegate from \"./resolution-cache-delegate\";\n\nexport default class ResolutionCache extends Cache<\n PathInfo,\n CanonicalPath,\n Resolution\n> {\n constructor() {\n super(new ResolutionCacheDelegate());\n }\n}\n","import PathInfoCache from \"../cache/path-info-cache\";\nimport ResolutionCache from \"../cache/resolution-cache\";\nimport { AbsolutePath, PathResolver, Resolution } from \"../interfaces\";\n\nexport default class PathResolverImpl implements PathResolver {\n private pathInfoCache: PathInfoCache;\n private resolutionCache = new ResolutionCache();\n\n constructor(rootPath: AbsolutePath, inputPath: AbsolutePath) {\n this.pathInfoCache = new PathInfoCache(rootPath, inputPath);\n }\n\n public resolve(path: string): Resolution {\n const pathInfo = this.pathInfoCache.get(path);\n return this.resolutionCache.get(pathInfo);\n }\n\n public reset() {\n // PathInfo cache is not build specific\n // resolutions are\n this.resolutionCache.clear();\n }\n}\n","import * as ts from \"typescript\";\nimport { readFileResolution } from \"../fs/file-utils\";\nimport {\n CanonicalPath,\n FileContent,\n PathResolver,\n Resolution,\n} from \"../interfaces\";\n\nconst SharedRegistry = ts.createDocumentRegistry();\n\ninterface VersionedSourceFile {\n sourceFile: ts.SourceFile;\n version: string;\n}\n\nexport default class SourceCache {\n private bucketKey: ts.DocumentRegistryBucketKey;\n\n private sourceFiles = new Map<CanonicalPath, VersionedSourceFile>();\n\n constructor(\n private resolver: PathResolver,\n private options: ts.CompilerOptions,\n ) {\n this.bucketKey = SharedRegistry.getKeyForCompilationSettings(options);\n }\n\n public updateOptions(options: ts.CompilerOptions) {\n const bucketKey = SharedRegistry.getKeyForCompilationSettings(options);\n this.options = options;\n if (this.bucketKey !== bucketKey) {\n this.releaseAll();\n this.bucketKey = bucketKey;\n }\n }\n\n public getSourceFile(fileName: string): ts.SourceFile | undefined {\n const resolution = this.resolve(fileName);\n return this.getSourceFileByPath(fileName, resolution.canonicalPath);\n }\n\n public getSourceFileByPath(\n fileName: string,\n path: CanonicalPath,\n ): ts.SourceFile | undefined {\n const resolution = this.resolve(path);\n return this.getSourceFileByResolution(resolution, fileName, path);\n }\n\n public releaseUnusedSourceFiles(program: ts.Program) {\n const bucketKey = this.bucketKey;\n for (const path of this.sourceFiles.keys()) {\n if (program.getSourceFileByPath(path) === undefined) {\n SharedRegistry.releaseDocumentWithKey(path, bucketKey);\n }\n }\n }\n\n public releaseAll() {\n const { bucketKey } = this;\n const paths = this.sourceFiles.keys();\n for (const path of paths) {\n SharedRegistry.releaseDocumentWithKey(path, bucketKey);\n }\n this.sourceFiles.clear();\n }\n\n private resolve(fileName: string) {\n return this.resolver.resolve(fileName);\n }\n\n private getSourceFileByResolution(\n resolution: Resolution,\n fileName: string,\n path: CanonicalPath,\n ): ts.SourceFile | undefined {\n const content = readFileResolution(resolution);\n if (content) {\n return this.getOrUpdateSourceFile(fileName, path, content);\n }\n }\n\n private getOrUpdateSourceFile(\n fileName: string,\n path: CanonicalPath,\n content: FileContent,\n ) {\n const existing = this.sourceFiles.get(path);\n if (existing) {\n return this.updateSourceFile(existing, fileName, path, content);\n } else {\n return this.createSourceFile(fileName, path, content);\n }\n }\n\n private updateSourceFile(\n existing: VersionedSourceFile,\n fileName: string,\n path: CanonicalPath,\n content: FileContent,\n ) {\n const { version } = content;\n const { options, bucketKey } = this;\n const sourceFile = SharedRegistry.updateDocumentWithKey(\n fileName,\n path,\n options,\n bucketKey,\n snapshot(content.buffer),\n version,\n );\n existing.sourceFile = sourceFile;\n existing.version = version;\n return sourceFile;\n }\n\n private createSourceFile(\n fileName: string,\n path: CanonicalPath,\n content: FileContent,\n ) {\n const { options, bucketKey, sourceFiles } = this;\n const { buffer, version } = content;\n const sourceFile = SharedRegistry.acquireDocumentWithKey(\n fileName,\n path,\n options,\n bucketKey,\n snapshot(buffer),\n version,\n );\n sourceFiles.set(path, { sourceFile, version });\n return sourceFile;\n }\n}\n\nfunction snapshot(buffer: Buffer) {\n return ts.ScriptSnapshot.fromString(buffer.toString(\"utf8\"));\n}\n","import * as ts from \"typescript\";\nimport ConfigParser from \"./compiler/config-parser\";\nimport createCompilerHost from \"./compiler/create-compiler-host\";\nimport Input from \"./compiler/input-io\";\nimport OutputPatcher from \"./compiler/output-patcher\";\nimport PathResolver from \"./compiler/path-resolver\";\nimport SourceCache from \"./compiler/source-cache\";\nimport {\n normalizePath,\n relativePathWithin,\n toAbsolutePath,\n} from \"./fs/path-utils\";\nimport { heimdall } from \"./helpers\";\nimport {\n AbsolutePath,\n DiagnosticsHandler,\n NormalizedOptions,\n} from \"./interfaces\";\n\nexport default class Compiler {\n private resolver: PathResolver;\n private workingPath: AbsolutePath;\n private rootPath: AbsolutePath;\n private buildPath: AbsolutePath | undefined;\n private input: Input;\n private configParser: ConfigParser;\n private sourceCache: SourceCache | undefined;\n private output: OutputPatcher;\n private program: ts.Program | undefined;\n\n constructor(\n public inputPath: AbsolutePath,\n public outputPath: AbsolutePath,\n public options: NormalizedOptions,\n private diagnosticsHandler: DiagnosticsHandler\n ) {\n const workingPath = (this.workingPath = options.workingPath);\n const rootPath = (this.rootPath = options.rootPath);\n this.buildPath = options.buildPath;\n const resolver = (this.resolver = new PathResolver(rootPath, inputPath));\n const input = (this.input = new Input(resolver));\n this.configParser = new ConfigParser(\n options.projectPath,\n options.rawConfig,\n options.configFileName,\n options.compilerOptions,\n workingPath,\n input\n );\n this.output = new OutputPatcher(outputPath);\n }\n\n public compile() {\n const config = this.parseConfig();\n\n const sourceCache = this.getSourceCache(config.options);\n\n const program = this.createProgram(config, sourceCache);\n\n this.emitDiagnostics(program);\n\n sourceCache.releaseUnusedSourceFiles(program);\n\n this.emitProgram(program, this.resolveBuildPath(config.options));\n\n this.patchOutput();\n\n this.resetCaches();\n }\n\n protected parseConfig() {\n const token = heimdall.start(\"TypeScript:parseConfig\");\n const config = this.configParser.parseConfig();\n heimdall.stop(token);\n return config;\n }\n\n protected getSourceCache(options: ts.CompilerOptions) {\n let sourceCache = this.sourceCache;\n if (sourceCache === undefined) {\n sourceCache = this.sourceCache = new SourceCache(this.resolver, options);\n } else {\n sourceCache.updateOptions(options);\n }\n return sourceCache;\n }\n\n protected createProgram(\n config: ts.ParsedCommandLine,\n sourceCache: SourceCache\n ): ts.Program {\n const token = heimdall.start(\"TypeScript:createProgram\");\n\n const host = createCompilerHost(\n this.workingPath,\n this.input,\n sourceCache,\n config.options\n );\n\n const oldProgram = this.program;\n const program = ts.createProgram(\n config.fileNames,\n config.options,\n host,\n oldProgram\n );\n this.program = program;\n\n heimdall.stop(token);\n return program;\n }\n\n protected emitDiagnostics(program: ts.Program) {\n // this is where bindings are resolved and typechecking is done\n const token = heimdall.start(\"TypeScript:emitDiagnostics\");\n const diagnostics = ts.getPreEmitDiagnostics(program);\n heimdall.stop(token);\n this.diagnosticsHandler.check(diagnostics);\n }\n\n protected resolveBuildPath(options: ts.CompilerOptions): AbsolutePath {\n if (this.buildPath !== undefined) {\n return this.buildPath;\n }\n if (options.outDir !== undefined) {\n return normalizePath(options.outDir) as AbsolutePath;\n }\n return this.rootPath;\n }\n\n protected emitProgram(program: ts.Program, buildPath: AbsolutePath) {\n const token = heimdall.start(\"TypeScript:emitProgram\");\n const { output } = this;\n\n const emitResult = program.emit(\n undefined,\n (fileName: string, data: string) => {\n /* tslint:disable:no-console */\n // the fileName is absolute but not normalized if outDir is not normalized\n const relativePath = relativePathWithin(\n buildPath,\n toAbsolutePath(fileName, this.workingPath)\n );\n if (relativePath) {\n output.add(relativePath, data);\n }\n }\n );\n heimdall.stop(token);\n this.diagnosticsHandler.check(emitResult.diagnostics);\n }\n\n protected patchOutput() {\n const token = heimdall.start(\"TypeScript:patchOutput\");\n this.output.patch();\n heimdall.stop(token);\n }\n\n protected resetCaches() {\n this.resolver.reset();\n this.input.reset();\n }\n}\n","import {\n Diagnostic,\n formatDiagnostics,\n FormatDiagnosticsHost,\n sys,\n} from \"typescript\";\nimport { getCanonicalFileName } from \"./fs/path-utils\";\nimport {\n AbsolutePath,\n DiagnosticsHandler,\n NormalizedOptions,\n} from \"./interfaces\";\n\nexport default class DiagnosticsHandlerImpl implements DiagnosticsHandler {\n private throwOnError: boolean;\n private host: FormatDiagnosticsHost;\n private write = sys.write;\n\n constructor(options: NormalizedOptions) {\n this.throwOnError = options.throwOnError;\n this.host = createFormatDiagnosticsHost(options.workingPath);\n }\n\n public setWrite(write: (s: string) => void) {\n this.write = write;\n }\n\n public check(\n diagnostics: Diagnostic | Diagnostic[] | undefined,\n throwOnError?: boolean\n ): boolean {\n const normalized = normalize(diagnostics);\n if (normalized === undefined) {\n return false;\n }\n const message = this.format(normalized);\n if (this.throwOnError || throwOnError === true) {\n throw new Error(message);\n }\n this.write(message);\n return true;\n }\n\n public format(diagnostics: Diagnostic[]) {\n return formatDiagnostics(diagnostics, this.host);\n }\n}\n\nfunction normalize(\n diagnostics: Diagnostic | Diagnostic[] | undefined\n): Diagnostic[] | undefined {\n if (diagnostics === undefined) {\n return undefined;\n }\n if (Array.isArray(diagnostics)) {\n return diagnostics.length === 0 ? undefined : diagnostics;\n }\n return [diagnostics];\n}\n\nfunction createFormatDiagnosticsHost(\n rootPath: AbsolutePath\n): FormatDiagnosticsHost {\n const newLine = sys.newLine;\n\n return {\n getCanonicalFileName,\n getCurrentDirectory: () => rootPath,\n getNewLine: () => newLine,\n };\n}\n","import { isWithin, normalizePath, toAbsolutePath } from \"./fs/path-utils\";\nimport {\n CompilerOptionsConfig,\n NormalizedOptions,\n TypescriptCompilerOptions,\n} from \"./interfaces\";\n\nexport default function normalizeOptions(\n options: TypescriptCompilerOptions\n): NormalizedOptions {\n const workingPath = toAbsolutePath(\n options.workingPath === undefined ? process.cwd() : options.workingPath\n );\n const rootPath =\n options.rootPath === undefined\n ? workingPath\n : toAbsolutePath(options.rootPath, workingPath);\n const projectPath =\n options.projectPath === undefined\n ? rootPath\n : toAbsolutePath(options.projectPath, workingPath);\n const buildPath =\n options.buildPath === undefined\n ? undefined\n : toAbsolutePath(options.buildPath, workingPath);\n const tsconfig = options.tsconfig;\n\n if (\n buildPath !== undefined &&\n !(rootPath === buildPath || isWithin(rootPath, buildPath))\n ) {\n throw new Error(\n `buildPath \"${buildPath}\" must be at or within rootPath \"${rootPath}\"`\n );\n }\n\n let configFileName: string | undefined;\n let rawConfig: CompilerOptionsConfig | undefined;\n if (typeof tsconfig === \"object\") {\n configFileName = undefined;\n rawConfig = tsconfig;\n } else if (tsconfig) {\n configFileName = normalizePath(tsconfig);\n rawConfig = undefined;\n }\n\n let throwOnError = options.throwOnError;\n if (throwOnError === undefined) {\n throwOnError = process.env.NODE_ENV === \"production\";\n }\n\n return {\n buildPath,\n compilerOptions: options.compilerOptions,\n configFileName,\n projectPath,\n rawConfig,\n rootPath,\n throwOnError,\n workingPath,\n };\n}\n","import Compiler from \"./compiler\";\nimport DiagnosticsHandler from \"./diagnostics-handler\";\nimport { toAbsolutePath } from \"./fs/path-utils\";\nimport { BroccoliPlugin, heimdall } from \"./helpers\";\nimport { NormalizedOptions, TypescriptCompilerOptions } from \"./interfaces\";\nimport normalizeOptions from \"./normalize-options\";\n\n/**\n * Returns a Broccoli plugin instance that compiles\n * the files in the tsconfig.\n *\n * It is rooted to the inputNode's outputPath, all\n * files it imports must be resolvable from its input\n * except for the default library file.\n *\n * Errors are logged and it will try to emit whatever\n * it could successfully compile.\n *\n * It will only emit based on the root source files\n * you give it, by default it will look for all .ts\n * files, but if you specify a files or filesGlob\n * it will use these as entry points and only compile\n * the files and files they reference from the input.\n */\nexport function typescript(\n inputNode: any,\n options?: TypescriptCompilerOptions\n) {\n return new TypescriptCompiler(inputNode, options);\n}\n\n/**\n * TypeScript Broccoli plugin class.\n */\nexport class TypescriptCompiler extends BroccoliPlugin {\n private compiler: Compiler | undefined;\n private diagnosticHandler: DiagnosticsHandler;\n private options: NormalizedOptions;\n\n constructor(inputNode: any, options?: TypescriptCompilerOptions) {\n super([inputNode], {\n annotation: options && options.annotation,\n name: \"broccoli-typescript-compiler\",\n persistentOutput: true,\n });\n const normalizedOptions = normalizeOptions(options || {});\n this.options = normalizedOptions;\n this.diagnosticHandler = new DiagnosticsHandler(normalizedOptions);\n }\n\n public build() {\n const token = heimdall.start(\"TypeScript:compile\");\n let compiler = this.compiler;\n if (!compiler) {\n compiler = this.compiler = new Compiler(\n toAbsolutePath(this.inputPaths[0]),\n toAbsolutePath(this.outputPath),\n this.options,\n this.diagnosticHandler\n );\n }\n compiler.compile();\n heimdall.stop(token);\n }\n\n public setDiagnosticWriter(write: (message: string) => void) {\n this.diagnosticHandler.setWrite(write);\n }\n}\n","import { TypescriptCompilerOptions } from \"../interfaces\";\nimport { TypescriptCompiler } from \"../plugin\";\n\nconst Funnel: any = require(\"broccoli-funnel\");\nconst MergeTrees: any = require(\"broccoli-merge-trees\");\n\n/**\n * Backwards compat filter behavior.\n *\n * Preserves the filter aspect of compiling only .ts\n * and passing through all other files.\n */\nexport default function filterLike(\n inputNode: any,\n options?: TypescriptCompilerOptions\n) {\n const passthrough = new Funnel(inputNode, {\n annotation: \"TypeScript passthrough\",\n exclude: [\"**/*.ts\"],\n });\n const filter = new Funnel(inputNode, {\n annotation: \"TypeScript input\",\n include: [\"**/*.ts\"],\n });\n return new MergeTrees(\n [passthrough, new TypescriptCompiler(filter, options)],\n {\n annotation: \"TypeScript passthrough + output\",\n overwrite: true,\n }\n );\n}\n"],"names":["ts.sys","ts.getDirectoryPath","ts.normalizePath","ts.toPath","matchFiles","ts.findConfigFile","getDirectoryPath","ts.convertCompilerOptionsFromJson","ts.parseJsonText","ts.parseJsonConfigFileContent","ts.parseJsonSourceFileConfigFileContent","getDefaultLibFileName","sys","NewLineKind","readFileSync","createHash","statSync","readdirSync","DirectoryEntriesCache","realpathSync","fs.mkdirSync","fs.rmdirSync","fs.unlinkSync","fs.writeFileSync","ts.createDocumentRegistry","ts.ScriptSnapshot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