create vfs project

This commit is contained in:
Nathan Shively-Sanders
2022-03-01 09:58:59 -08:00
parent da2622cc7b
commit 9e0e980c7b
6 changed files with 36 additions and 8 deletions
+2 -5
View File
@@ -15,15 +15,12 @@
{ "path": "../services" },
{ "path": "../jsTyping" },
{ "path": "../server" },
{ "path": "../typingsInstallerCore" }
{ "path": "../typingsInstallerCore" },
{ "path": "../vfs" }
],
"files": [
"collectionsImpl.ts",
"util.ts",
"documentsUtil.ts",
"vpathUtil.ts",
"vfsUtil.ts",
"compilerImpl.ts",
"evaluatorImpl.ts",
"fakesHosts.ts",
@@ -2,13 +2,19 @@
// support the eventual conversion of harness into a modular system.
namespace documents {
export interface HarnessCompilerTestFile {
unitName: string;
content: string;
fileOptions?: any;
}
export class TextDocument {
public readonly meta: Map<string, string>;
public readonly file: string;
public readonly text: string;
private _lineStarts: readonly number[] | undefined;
private _testFile: Harness.Compiler.TestFile | undefined;
private _testFile: HarnessCompilerTestFile | undefined;
constructor(file: string, text: string, meta?: Map<string, string>) {
this.file = file;
@@ -20,7 +26,7 @@ namespace documents {
return this._lineStarts || (this._lineStarts = ts.computeLineStarts(this.text));
}
public static fromTestFile(file: Harness.Compiler.TestFile) {
public static fromTestFile(file: HarnessCompilerTestFile) {
return new TextDocument(
file.unitName,
file.content,
@@ -184,4 +190,4 @@ namespace documents {
return vlq;
}
}
}
}
+25
View File
@@ -0,0 +1,25 @@
{
"extends": "../tsconfig-base",
"compilerOptions": {
"outFile": "../../built/local/vfs.js",
"types": [
"node", "mocha", "chai"
],
"lib": [
"es6",
"scripthost"
]
},
"references": [
{ "path": "../compiler" },
{ "path": "../jsTyping" },
{ "path": "../services" }
],
"files": [
"collectionsImpl.ts",
"documentsUtil.ts",
"vpathUtil.ts",
"vfsUtil.ts"
]
}