From d63c89d8327cf9b5f90d29cca8970a62798d79b4 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Thu, 29 Sep 2022 15:08:53 -0700 Subject: [PATCH] Use typescript.js as source for typescriptServices --- build/importTypescript.ts | 14 +++----------- .../typescript/lib/typescriptServices-amd.js | 1 + .../typescript/lib/typescriptServices.d.ts | 4 +--- src/language/typescript/lib/typescriptServices.js | 1 + 4 files changed, 6 insertions(+), 14 deletions(-) diff --git a/build/importTypescript.ts b/build/importTypescript.ts index 930469cc..ff05bcff 100644 --- a/build/importTypescript.ts +++ b/build/importTypescript.ts @@ -35,9 +35,7 @@ const TYPESCRIPT_LIB_DESTINATION = path.join(REPO_ROOT, 'src/language/typescript export const typescriptVersion = "${typeScriptDependencyVersion}";\n` ); - let tsServices = fs - .readFileSync(path.join(TYPESCRIPT_LIB_SOURCE, 'typescriptServices.js')) - .toString(); + let tsServices = fs.readFileSync(path.join(TYPESCRIPT_LIB_SOURCE, 'typescript.js')).toString(); // Ensure we never run into the node system... // (this also removes require calls that trick webpack into shimming those modules...) @@ -149,14 +147,8 @@ export var typescript = ts; stripSourceMaps(tsServices_esm) ); - let dtsServices = fs - .readFileSync(path.join(TYPESCRIPT_LIB_SOURCE, 'typescriptServices.d.ts')) - .toString(); - dtsServices += ` -// MONACOCHANGE -export = ts; -// END MONACOCHANGE -`; + let dtsServices = fs.readFileSync(path.join(TYPESCRIPT_LIB_SOURCE, 'typescript.d.ts')).toString(); + fs.writeFileSync( path.join(TYPESCRIPT_LIB_DESTINATION, 'typescriptServices.d.ts'), generatedNote + dtsServices diff --git a/src/language/typescript/lib/typescriptServices-amd.js b/src/language/typescript/lib/typescriptServices-amd.js index 1a6f3511..55d72f7b 100644 --- a/src/language/typescript/lib/typescriptServices-amd.js +++ b/src/language/typescript/lib/typescriptServices-amd.js @@ -163529,6 +163529,7 @@ var ts; + // MONACOCHANGE // Defining the entire module name because r.js has an issue and cannot bundle this file // correctly with an anonymous define call diff --git a/src/language/typescript/lib/typescriptServices.d.ts b/src/language/typescript/lib/typescriptServices.d.ts index 99187a6f..f600542b 100644 --- a/src/language/typescript/lib/typescriptServices.d.ts +++ b/src/language/typescript/lib/typescriptServices.d.ts @@ -7594,6 +7594,4 @@ declare namespace ts { const isIdentifierOrPrivateIdentifier: (node: Node) => node is MemberName; } -// MONACOCHANGE -export = ts; -// END MONACOCHANGE +export = ts; \ No newline at end of file diff --git a/src/language/typescript/lib/typescriptServices.js b/src/language/typescript/lib/typescriptServices.js index 49b7ebb8..fec0134f 100644 --- a/src/language/typescript/lib/typescriptServices.js +++ b/src/language/typescript/lib/typescriptServices.js @@ -163529,6 +163529,7 @@ var ts; + // MONACOCHANGE export var createClassifier = ts.createClassifier; export var createLanguageService = ts.createLanguageService;