diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-08-26 17:02:34 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-26 17:02:34 -0400 |
commit | f94900406d52a9d0a432ae9ebef65d46092afb41 (patch) | |
tree | 0a12b3201f8bdd0bbee1b6b1abf3f413d7d92e9f /tools/ts_library_builder/build_library.ts | |
parent | d8ada4d3fcc5dfe7f76103399a1d765fbab2ee45 (diff) |
Remove flatbuffers (#2818)
Diffstat (limited to 'tools/ts_library_builder/build_library.ts')
-rw-r--r-- | tools/ts_library_builder/build_library.ts | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/tools/ts_library_builder/build_library.ts b/tools/ts_library_builder/build_library.ts index 678a603ae..0a18abcbb 100644 --- a/tools/ts_library_builder/build_library.ts +++ b/tools/ts_library_builder/build_library.ts @@ -89,27 +89,6 @@ const libPreamble = `// Copyright 2018-2019 the Deno authors. All rights reserve `; -// The path to the msg_generated file relative to the build path -const MSG_GENERATED_PATH = "/gen/cli/msg_generated.ts"; - -// An array of enums we want to expose pub -const MSG_GENERATED_ENUMS = ["ErrorKind"]; - -/** Extracts enums from a source file */ -function extract(sourceFile: SourceFile, enumNames: string[]): string { - // Copy specified enums from msg_generated - let output = ""; - for (const enumName of enumNames) { - const enumDeclaration = sourceFile.getEnumOrThrow(enumName); - enumDeclaration.setHasDeclareKeyword(false); - // we are not copying JSDocs or other trivia here because msg_generated only - // contains some non-useful JSDocs and comments that are not ideal to copy - // over - output += enumDeclaration.getText(); - } - return output; -} - interface FlattenOptions { basePath: string; customSources: { [filePath: string]: string }; @@ -499,20 +478,8 @@ export function main({ // Deal with `js/deno.ts` - // `gen/msg_generated.d.ts` contains too much exported information that is not - // part of the public API surface of Deno, so we are going to extract just the - // information we need. - const msgGeneratedDts = inputProject.getSourceFileOrThrow( - `${buildPath}${MSG_GENERATED_PATH}` - ); - const msgGeneratedDtsText = extract(msgGeneratedDts, MSG_GENERATED_ENUMS); - // Generate a object hash of substitutions of modules to use when flattening - const customSources = { - [msgGeneratedDts.getFilePath().replace(/(\.d)?\.ts$/, "")]: `${ - debug ? getSourceComment(msgGeneratedDts, basePath) : "" - }${msgGeneratedDtsText}\n` - }; + const customSources = {}; const prepareForMergeOpts: PrepareFileForMergeOptions = { globalVarName: "window", |