Skip to content

Commit 73309c9

Browse files
committed
Fix buildProtocol to handle lib+noresolve
1 parent 4a4c47a commit 73309c9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

scripts/buildProtocol.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class DeclarationsWalker {
5555
if (declarations) {
5656
for (const decl of declarations) {
5757
const sourceFile = decl.getSourceFile();
58-
if (sourceFile === this.protocolFile || /lib\.(.*)\.d.ts/.test(path.basename(sourceFile.fileName))) {
58+
if (sourceFile === this.protocolFile || /lib(\..+)?\.d.ts/.test(path.basename(sourceFile.fileName))) {
5959
return;
6060
}
6161
if (decl.kind === ts.SyntaxKind.EnumDeclaration && !isStringEnum(decl as ts.EnumDeclaration)) {
@@ -121,14 +121,14 @@ class DeclarationsWalker {
121121
}
122122

123123
function writeProtocolFile(outputFile: string, protocolTs: string, typeScriptServicesDts: string) {
124-
const options = { target: ts.ScriptTarget.ES5, declaration: true, noResolve: true, types: <string[]>[], stripInternal: true };
124+
const options = { target: ts.ScriptTarget.ES5, declaration: true, noResolve: false, types: <string[]>[], stripInternal: true };
125125

126126
/**
127127
* 1st pass - generate a program from protocol.ts and typescriptservices.d.ts and emit core version of protocol.d.ts with all internal members stripped
128128
* @return text of protocol.d.t.s
129129
*/
130130
function getInitialDtsFileForProtocol() {
131-
const program = ts.createProgram([protocolTs, typeScriptServicesDts], options);
131+
const program = ts.createProgram([protocolTs, typeScriptServicesDts, path.join(typeScriptServicesDts, "../lib.es5.d.ts")], options);
132132

133133
let protocolDts: string | undefined;
134134
const emitResult = program.emit(program.getSourceFile(protocolTs), (file, content) => {

0 commit comments

Comments
 (0)