How to use the sys function from typescript
Find comprehensive JavaScript typescript.sys code examples handpicked from public code repositorys.
GitHub: VKCOM/VKUI
49 50 51 52 53 54 55 56 57 58
}, getCurrentDirectory: () => process.cwd(), getCompilationSettings: () => compilerOptions, getDefaultLibFileName: (options) => ts.getDefaultLibFilePath(options), fileExists: ts.sys.fileExists, readFile: ts.sys.readFile, readDirectory: ts.sys.readDirectory, }; }
174
755
34
+ 2 other calls in file
989 990 991 992 993 994 995 996 997 998 999
// p = bazel-out/darwin_arm64-fastbuild/bin/0.params // currentDir = bazel-out/darwin_arm64-fastbuild/bin p = path.resolve('..', '..', '..', p.slice(1)); } const args = fs.readFileSync(p).toString().trim().split('\n'); ts.sys.args = process.argv = [process.argv0, process.argv[1], ...args]; execute(ts.sys, ts.noop, args); } module.exports.__do_not_use_test_only__ = { createFilesystemTree: createFilesystemTree, emit: emit, workers: workers };
26
48
4
+ 2847 other calls in file
GitHub: spryker/oryx
23 24 25 26 27 28 29 30 31 32
}; }; function compile(fileName, options) { const program = (0, typescript_1.createProgram)([fileName], options); const emitResult = program.emit(undefined, (fileName, content) => { typescript_1.sys.writeFile(fileName, `${typescript_1.sys.newLine}${content}`); }, undefined, undefined, { before: [(ctx) => pathsTransformer(ctx, options)], }); return !emitResult.emitSkipped;
0
24
10
115 116 117 118 119 120 121 122 123 124
} return projectFiles; } normalizePath(...paths) { const project = this, resolvedPath = project.resolvedPath; let path = typescript_1.sys.resolvePath(path_1.default.join(...paths)); // .replace(/(?:\.d)?\.[jt]sx?$/, ''); if (path_1.default.isAbsolute(path)) { path = path_1.default.relative(resolvedPath, path); }
2
4
15
34 35 36 37 38 39 40 41 42 43
}, getCurrentDirectory() { return ''; }, getDefaultLibFileName: () => 'lib.d.ts', getNewLine: () => ts.sys.newLine, getSourceFile(filename, languageVersion) { let source; const libRegex = /lib\.(.+\.)?d\.ts$/; const jestRegex = /jest\.d\.ts/;
0
0
1
+ 3 other calls in file
6 7 8 9 10 11 12 13 14 15 16
module.exports = (configPath) => { // Parse the tsconfig.json file and resolve every file name & compiler options const { errors, ...configOptions } = ts.getParsedCommandLineOfConfigFile( configPath, undefined, ts.sys ); // If there are errors in the tsconfig.json // file, report them and exit early
0
0
1
+ 598 other calls in file
39 40 41 42 43 44 45 46 47 48
if (fileName === FILE_NAME) { text = currentTextDocument.getText(); } } else { text = ts.sys.readFile(fileName) || ''; } return { getText: function (start, end) { return text.substring(start, end); }, getLength: function () { return text.length; },
0
0
1
+ 182 other calls in file
6 7 8 9 10 11 12 13 14 15
const hasError = diagnostics.some(diag => diag.category === ts.DiagnosticCategory.Error); if (hasError) { // Throw only if we're in strict mode, otherwise return original content. if (strict) { const errorMessages = ts.formatDiagnostics(diagnostics, { getCurrentDirectory: () => ts.sys.getCurrentDirectory(), getNewLine: () => ts.sys.newLine, getCanonicalFileName: (f) => f, }); throw new Error(`
0
0
1
+ 3 other calls in file
typescript.SyntaxKind is the most popular function in typescript (82777 examples)