From d1d80b1a079aa29bac9587afd94e1d0b3e50529c Mon Sep 17 00:00:00 2001 From: tsjs-language-eng Date: Mon, 14 Aug 2023 03:16:55 -0700 Subject: [PATCH] Automated rollback of commit 73fbe6d63a696d8e19322e68e6efb509cbf5bc63. PiperOrigin-RevId: 556726604 --- src/externs.ts | 6 +++--- src/tsickle.ts | 10 +++++----- test/golden_tsickle_test.ts | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/externs.ts b/src/externs.ts index 77335032d..5f30fe362 100644 --- a/src/externs.ts +++ b/src/externs.ts @@ -129,7 +129,7 @@ const EXTERNS_HEADER = `/** * to this root. */ export function getGeneratedExterns( - externs: {[fileName: string]: {output: string, moduleNamespace: string}}, + externs: {[fileName: string]: {output: string, rootNamespace: string}}, rootDir: string): string { let allExterns = EXTERNS_HEADER; for (const fileName of Object.keys(externs)) { @@ -159,7 +159,7 @@ function isInGlobalAugmentation(declaration: ts.Declaration): boolean { export function generateExterns( typeChecker: ts.TypeChecker, sourceFile: ts.SourceFile, host: AnnotatorHost&GoogModuleProcessorHost): - {output: string, diagnostics: ts.Diagnostic[], moduleNamespace: string} { + {output: string, diagnostics: ts.Diagnostic[], rootNamespace: string} { let output = ''; const diagnostics: ts.Diagnostic[] = []; const isDts = isDtsFileName(sourceFile.fileName); @@ -282,7 +282,7 @@ export function generateExterns( } } - return {output, diagnostics, moduleNamespace}; + return {output, diagnostics, rootNamespace}; function emit(str: string) { output += str; diff --git a/src/tsickle.ts b/src/tsickle.ts index 6898dd6c5..08f5ddc7e 100644 --- a/src/tsickle.ts +++ b/src/tsickle.ts @@ -87,7 +87,7 @@ export function mergeEmitResults(emitResults: EmitResult[]): EmitResult { let emitSkipped = true; const emittedFiles: string[] = []; const externs: - {[fileName: string]: {output: string, moduleNamespace: string}} = {}; + {[fileName: string]: {output: string, rootNamespace: string}} = {}; const modulesManifest = new ModulesManifest(); const tsMigrationExportsShimFiles = new Map(); for (const er of emitResults) { @@ -120,7 +120,7 @@ export interface EmitResult extends ts.EmitResult { * externs.js files produced by tsickle, if any. module IDs are relative paths * from fileNameToModuleId. */ - externs: {[moduleId: string]: {output: string, moduleNamespace: string}}; + externs: {[moduleId: string]: {output: string, rootNamespace: string}}; /** * Content for the generated files, keyed by their intended filename. @@ -247,7 +247,7 @@ export function emit( tsTransformers); const externs: - {[fileName: string]: {output: string, moduleNamespace: string}} = {}; + {[fileName: string]: {output: string, rootNamespace: string}} = {}; if (host.transformTypesToClosure) { const sourceFiles = targetSourceFile ? [targetSourceFile] : program.getSourceFiles(); @@ -256,10 +256,10 @@ export function emit( if (isDts && host.shouldSkipTsickleProcessing(sourceFile.fileName)) { continue; } - const {output, diagnostics, moduleNamespace} = + const {output, diagnostics, rootNamespace} = generateExterns(typeChecker, sourceFile, host); if (output) { - externs[sourceFile.fileName] = {output, moduleNamespace}; + externs[sourceFile.fileName] = {output, rootNamespace}; } if (diagnostics) { tsickleDiagnostics.push(...diagnostics); diff --git a/test/golden_tsickle_test.ts b/test/golden_tsickle_test.ts index e37775f0b..7c8405c35 100644 --- a/test/golden_tsickle_test.ts +++ b/test/golden_tsickle_test.ts @@ -226,7 +226,7 @@ testFn('golden tests', () => { if (!test.name.endsWith('.no_externs')) { // Concatenate externs for the files that are in this tests sources (but // not other, shared .d.ts files). - const filteredExterns: {[k: string]: { output: string; moduleNamespace: string; }} = {}; + const filteredExterns: {[k: string]: { output: string; rootNamespace: string; }} = {}; let anyExternsGenerated = false; for (const fileName of tsSources.keys()) { if (externs[fileName]) {