mirror of
https://github.com/denoland/deno.git
synced 2025-07-24 05:35:33 +00:00
Remove ts_library_builder, maintain lib.deno_runtime.d.ts by hand (#2827)
This commit is contained in:
parent
5401cb7630
commit
c370f749b2
29 changed files with 2869 additions and 1753 deletions
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
||||
import * as ts from "typescript";
|
||||
import { assetSourceCode } from "./assets";
|
||||
import { bold, cyan, yellow } from "./colors";
|
||||
import { Console } from "./console";
|
||||
import { core } from "./core";
|
||||
|
@ -128,6 +127,10 @@ interface EmitResult {
|
|||
diagnostics?: Diagnostic;
|
||||
}
|
||||
|
||||
function fetchAsset(name: string): string {
|
||||
return sendSync(dispatch.OP_FETCH_ASSET, { name });
|
||||
}
|
||||
|
||||
/** Ops to Rust to resolve and fetch a modules meta data. */
|
||||
function fetchSourceFile(specifier: string, referrer: string): SourceFile {
|
||||
util.log("compiler.fetchSourceFile", { specifier, referrer });
|
||||
|
@ -222,8 +225,7 @@ class Host implements ts.CompilerHost {
|
|||
const assetName = moduleName.includes(".")
|
||||
? moduleName
|
||||
: `${moduleName}.d.ts`;
|
||||
assert(assetName in assetSourceCode, `No such asset "${assetName}"`);
|
||||
const sourceCode = assetSourceCode[assetName];
|
||||
const sourceCode = fetchAsset(assetName);
|
||||
const sourceFile = {
|
||||
moduleName,
|
||||
filename: specifier,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue