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
pull/2748/head
Alexandru Dima 6 years ago committed by GitHub
commit c9f75d56c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,25 @@
# triggered by schedule at 5am to try make sure it's done after the TS daily build
schedules:
- cron: '0 5 * * *'
displayName: Daily 5am build
branches:
include:
- master
always: true
pr: none
pool:
vmImage: 'ubuntu-latest'
steps:
- bash: |
npm install
npm run run-nightly
displayName: 'Update & Build'
- bash: |
echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
npm publish --tag next
displayName: 'Publish to NPM'

6
package-lock.json generated

@ -52,9 +52,9 @@
"dev": true
},
"typescript": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.1.tgz",
"integrity": "sha512-64HkdiRv1yYZsSe4xC1WVgamNigVYjlssIoaH2HcZF0+ijsk5YK2g0G34w9wJkze8+5ow4STd22AynfO6ZYYLw==",
"version": "3.6.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.2.tgz",
"integrity": "sha512-lmQ4L+J6mnu3xweP8+rOrUwzmN+MRAj7TgtJtDaXE5PMyX2kCrklhg3rvOsOIfNeAWMQWO2F1GPc1kMD2vLAfw==",
"dev": true
},
"uglify-js": {

@ -8,7 +8,8 @@
"compile": "mrmdir ./release && npm run compile-amd && npm run compile-esm",
"watch": "tsc -p ./src --watch",
"prepublishOnly": "npm run compile && node ./scripts/bundle && mcopy ./src/monaco.d.ts ./release/monaco.d.ts",
"import-typescript": "node ./scripts/importTypescript"
"import-typescript": "node ./scripts/importTypescript",
"run-nightly": "node ./scripts/runDaily"
},
"author": "Microsoft Corporation",
"license": "MIT",
@ -24,7 +25,7 @@
"monaco-languages": "^1.7.0",
"monaco-plugin-helpers": "^1.0.2",
"requirejs": "^2.3.6",
"typescript": "^3.5.1",
"typescript": "^3.6.2",
"uglify-js": "^3.4.9"
}
}

@ -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() {

@ -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");

@ -23,26 +23,29 @@ enum IndentStyle {
Smart = 2
}
function flattenDiagnosticMessageText(messageText: string | ts.DiagnosticMessageChain, newLine: '\n'): string {
if (typeof messageText === "string") {
return messageText;
} else {
let diagnosticChain = messageText;
let result = "";
let indent = 0;
while (diagnosticChain) {
if (indent) {
result += newLine;
for (let i = 0; i < indent; i++) {
result += " ";
}
}
result += diagnosticChain.messageText;
indent++;
diagnosticChain = diagnosticChain.next;
export function flattenDiagnosticMessageText(diag: string | ts.DiagnosticMessageChain | undefined, newLine: string, indent = 0): string {
if (typeof diag === "string") {
return diag;
}
else if (diag === undefined) {
return "";
}
let result = "";
if (indent) {
result += newLine;
for (let i = 0; i < indent; i++) {
result += " ";
}
}
result += diag.messageText;
indent++;
if (diag.next) {
for (const kid of diag.next) {
result += flattenDiagnosticMessageText(kid, newLine, indent);
}
return result;
}
return result;
}
function displayPartsToString(displayParts: ts.SymbolDisplayPart[]): string {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

@ -152,18 +152,21 @@ enum ModuleKind {
UMD = 3,
System = 4,
ES2015 = 5,
ESNext = 6
ESNext = 99
}
enum JsxEmit {
None = 0,
Preserve = 1,
React = 2,
ReactNative = 3
}
enum NewLineKind {
CarriageReturnLineFeed = 0,
LineFeed = 1
}
enum ScriptTarget {
ES3 = 0,
ES5 = 1,
@ -171,10 +174,13 @@ enum ScriptTarget {
ES2016 = 3,
ES2017 = 4,
ES2018 = 5,
ESNext = 6,
ES2019 = 6,
ES2020 = 7,
ESNext = 99,
JSON = 100,
Latest = 6
Latest = ESNext,
}
enum ModuleResolutionKind {
Classic = 1,
NodeJs = 2

9
src/monaco.d.ts vendored

@ -8,8 +8,9 @@ declare module monaco.languages.typescript {
UMD = 3,
System = 4,
ES2015 = 5,
ESNext = 6
ESNext = 99
}
enum JsxEmit {
None = 0,
Preserve = 1,
@ -28,9 +29,11 @@ declare module monaco.languages.typescript {
ES2016 = 3,
ES2017 = 4,
ES2018 = 5,
ESNext = 6,
ES2019 = 6,
ES2020 = 7,
ESNext = 99,
JSON = 100,
Latest = 6
Latest = ESNext,
}
export enum ModuleResolutionKind {

Loading…
Cancel
Save