mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 20:52:56 +01:00
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:
commit
c9f75d56c2
12 changed files with 15645 additions and 8673 deletions
|
|
@ -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
29
scripts/runDaily.js
Normal 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");
|
||||
Loading…
Add table
Add a link
Reference in a new issue