This repository has been archived by the owner on May 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(deep-linking): convert deep linking to use TS Transform. DeepLink…
…ing now works on TypeScript src instead of on transpiled JS code
- Loading branch information
1 parent
ab31be4
commit 63c4c7f
Showing
17 changed files
with
484 additions
and
1,538 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import { CompilerOptions } from 'typescript'; | ||
import { NgcCompilerHost } from './compiler-host'; | ||
import { InMemoryCompilerHost } from './compiler-host'; | ||
import { getInstance as getFileSystemInstance } from '../util/hybrid-file-system-factory'; | ||
|
||
let instance: NgcCompilerHost = null; | ||
let instance: InMemoryCompilerHost = null; | ||
|
||
export function getInstance(options: CompilerOptions) { | ||
export function getInMemoryCompilerHostInstance(options: CompilerOptions) { | ||
if (!instance) { | ||
instance = new NgcCompilerHost(options, getFileSystemInstance(false)); | ||
instance = new InMemoryCompilerHost(options, getFileSystemInstance(false)); | ||
} | ||
return instance; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { join } from 'path'; | ||
import { GlobResult, globAll } from '../util/glob-util'; | ||
import { readFileAsync } from '../util/helpers'; | ||
import { BuildContext } from '../util/interfaces'; | ||
|
||
export function scanSrcTsFiles(context: BuildContext) { | ||
const tsFileGlob = join(context.srcDir, '**', '*.ts'); | ||
return globAll([tsFileGlob]).then((results: GlobResult[]) => { | ||
const promises = results.map(result => { | ||
const promise = readFileAsync(result.absolutePath); | ||
promise.then((fileContent: string) => { | ||
context.fileCache.set(result.absolutePath, { path: result.absolutePath, content: fileContent}); | ||
}); | ||
return promise; | ||
}); | ||
return Promise.all(promises); | ||
}); | ||
} |
Oops, something went wrong.