Updates to support the TS 3.6.0 beta, and adds a daily run-script (#36)

Updates to support the TS 3.6.0 beta, and adds a daily run-script
This commit is contained in:
Alexandru Dima 2019-08-30 14:57:45 +02:00 committed by GitHub
commit c9f75d56c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 15645 additions and 8673 deletions

View file

@ -39,6 +39,12 @@ const TYPESCRIPT_LIB_DESTINATION = path.join(__dirname, '../src/lib');
tsServices.replace(/return require\(fileNameToRequire\);/, `// MONACOCHANGE\n return undefined;\n // END MONACOCHANGE`)
);
// Make sure process.args don't get called in the browser, this
// should only happen in TS 2.6.2
const beforeProcess = `ts.perfLogger.logInfoEvent("Starting TypeScript v" + ts.versionMajorMinor + " with command line: " + JSON.stringify(process.argv));`
const afterProcess = `// MONACOCHANGE\n ts.perfLogger.logInfoEvent("Starting TypeScript v" + ts.versionMajorMinor + " with command line: " + JSON.stringify([]));\n// END MONACOCHANGE`
tsServices = tsServices.replace(beforeProcess, afterProcess);
var tsServices_amd = tsServices +
`
// MONACOCHANGE
@ -73,6 +79,7 @@ export = ts;
// END MONACOCHANGE
`;
fs.writeFileSync(path.join(TYPESCRIPT_LIB_DESTINATION, 'typescriptServices.d.ts'), dtsServices);
})();
function importLibs() {

29
scripts/runDaily.js Normal file
View file

@ -0,0 +1,29 @@
// @ts-check
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
const { execSync } = require("child_process");
const { join } = require("path");
const { readFileSync, writeFileSync } = require("fs");
// Update to the daily build
execSync("npm install --save typescript@next");
// Update the dts files
execSync("npm run import-typescript");
// Sync the versions
const packagePath = join(__dirname, "../package.json");
const package = JSON.parse(readFileSync(packagePath, "utf8"));
const tsPackagePath = join(__dirname, "../node_modules/typescript/package.json");
const tsPackage = JSON.parse(readFileSync(tsPackagePath, "utf8"));
// Set the monaco-typescript version to directly match the typescript nightly version
package.version = tsPackage.version;
writeFileSync(packagePath, JSON.stringify(package), "utf8");
// Update the dts files
execSync("npm run compile");