mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 16:15:41 +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",
|
"name": "monaco-typescript",
|
||||||
"version": "3.5.0",
|
"version": "3.6.0",
|
||||||
"description": "TypeScript and JavaScript language support for Monaco Editor",
|
"description": "TypeScript and JavaScript language support for Monaco Editor",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"compile-amd": "mcopy ./src/lib/typescriptServices-amd.js ./release/dev/lib/typescriptServices.js && tsc -p ./src/tsconfig.json",
|
"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",
|
"compile": "mrmdir ./release && npm run compile-amd && npm run compile-esm",
|
||||||
"watch": "tsc -p ./src --watch",
|
"watch": "tsc -p ./src --watch",
|
||||||
"prepublishOnly": "npm run compile && node ./scripts/bundle && mcopy ./src/monaco.d.ts ./release/monaco.d.ts",
|
"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",
|
"author": "Microsoft Corporation",
|
||||||
"license": "MIT",
|
"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
|
Smart = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
function flattenDiagnosticMessageText(messageText: string | ts.DiagnosticMessageChain, newLine: '\n'): string {
|
export function flattenDiagnosticMessageText(diag: string | ts.DiagnosticMessageChain | undefined, newLine: string, indent = 0): string {
|
||||||
if (typeof messageText === "string") {
|
if (typeof diag === "string") {
|
||||||
return messageText;
|
return diag;
|
||||||
} else {
|
}
|
||||||
let diagnosticChain = messageText;
|
else if (diag === undefined) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
let result = "";
|
let result = "";
|
||||||
let indent = 0;
|
|
||||||
while (diagnosticChain) {
|
|
||||||
if (indent) {
|
if (indent) {
|
||||||
result += newLine;
|
result += newLine;
|
||||||
|
|
||||||
for (let i = 0; i < indent; i++) {
|
for (let i = 0; i < indent; i++) {
|
||||||
result += " ";
|
result += " ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result += diagnosticChain.messageText;
|
result += diag.messageText;
|
||||||
indent++;
|
indent++;
|
||||||
diagnosticChain = diagnosticChain.next;
|
if (diag.next) {
|
||||||
|
for (const kid of diag.next) {
|
||||||
|
result += flattenDiagnosticMessageText(kid, newLine, indent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function displayPartsToString(displayParts: ts.SymbolDisplayPart[]): string {
|
function displayPartsToString(displayParts: ts.SymbolDisplayPart[]): string {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue