mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 11:35:40 +01:00
Adds support for running on TS 3.6.0, and adds a daily update script
This commit is contained in:
parent
34095b6b55
commit
8440cba727
3 changed files with 52 additions and 21 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "monaco-typescript",
|
||||
"version": "3.5.0",
|
||||
"version": "3.6.0",
|
||||
"description": "TypeScript and JavaScript language support for Monaco Editor",
|
||||
"scripts": {
|
||||
"compile-amd": "mcopy ./src/lib/typescriptServices-amd.js ./release/dev/lib/typescriptServices.js && tsc -p ./src/tsconfig.json",
|
||||
|
|
@ -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",
|
||||
|
|
|
|||
27
scripts/runDaily.js
Normal file
27
scripts/runDaily.js
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
// @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")
|
||||
|
||||
|
|
@ -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;
|
||||
}
|
||||
return result;
|
||||
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;
|
||||
}
|
||||
|
||||
function displayPartsToString(displayParts: ts.SymbolDisplayPart[]): string {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue