mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 23:13:02 +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
25
azure-pipelines.yml
Normal file
25
azure-pipelines.yml
Normal file
|
|
@ -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
6
package-lock.json
generated
|
|
@ -52,9 +52,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"typescript": {
|
"typescript": {
|
||||||
"version": "3.5.1",
|
"version": "3.6.2",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.2.tgz",
|
||||||
"integrity": "sha512-64HkdiRv1yYZsSe4xC1WVgamNigVYjlssIoaH2HcZF0+ijsk5YK2g0G34w9wJkze8+5ow4STd22AynfO6ZYYLw==",
|
"integrity": "sha512-lmQ4L+J6mnu3xweP8+rOrUwzmN+MRAj7TgtJtDaXE5PMyX2kCrklhg3rvOsOIfNeAWMQWO2F1GPc1kMD2vLAfw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"uglify-js": {
|
"uglify-js": {
|
||||||
|
|
|
||||||
|
|
@ -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",
|
||||||
|
|
@ -24,7 +25,7 @@
|
||||||
"monaco-languages": "^1.7.0",
|
"monaco-languages": "^1.7.0",
|
||||||
"monaco-plugin-helpers": "^1.0.2",
|
"monaco-plugin-helpers": "^1.0.2",
|
||||||
"requirejs": "^2.3.6",
|
"requirejs": "^2.3.6",
|
||||||
"typescript": "^3.5.1",
|
"typescript": "^3.6.2",
|
||||||
"uglify-js": "^3.4.9"
|
"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`)
|
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 +
|
var tsServices_amd = tsServices +
|
||||||
`
|
`
|
||||||
// MONACOCHANGE
|
// MONACOCHANGE
|
||||||
|
|
@ -73,6 +79,7 @@ export = ts;
|
||||||
// END MONACOCHANGE
|
// END MONACOCHANGE
|
||||||
`;
|
`;
|
||||||
fs.writeFileSync(path.join(TYPESCRIPT_LIB_DESTINATION, 'typescriptServices.d.ts'), dtsServices);
|
fs.writeFileSync(path.join(TYPESCRIPT_LIB_DESTINATION, 'typescriptServices.d.ts'), dtsServices);
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
function importLibs() {
|
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");
|
||||||
|
|
@ -23,27 +23,30 @@ 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 {
|
||||||
if (displayParts) {
|
if (displayParts) {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1306
src/lib/typescriptServices.d.ts
vendored
1306
src/lib/typescriptServices.d.ts
vendored
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,
|
UMD = 3,
|
||||||
System = 4,
|
System = 4,
|
||||||
ES2015 = 5,
|
ES2015 = 5,
|
||||||
ESNext = 6
|
ESNext = 99
|
||||||
}
|
}
|
||||||
|
|
||||||
enum JsxEmit {
|
enum JsxEmit {
|
||||||
None = 0,
|
None = 0,
|
||||||
Preserve = 1,
|
Preserve = 1,
|
||||||
React = 2,
|
React = 2,
|
||||||
ReactNative = 3
|
ReactNative = 3
|
||||||
}
|
}
|
||||||
|
|
||||||
enum NewLineKind {
|
enum NewLineKind {
|
||||||
CarriageReturnLineFeed = 0,
|
CarriageReturnLineFeed = 0,
|
||||||
LineFeed = 1
|
LineFeed = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ScriptTarget {
|
enum ScriptTarget {
|
||||||
ES3 = 0,
|
ES3 = 0,
|
||||||
ES5 = 1,
|
ES5 = 1,
|
||||||
|
|
@ -171,10 +174,13 @@ enum ScriptTarget {
|
||||||
ES2016 = 3,
|
ES2016 = 3,
|
||||||
ES2017 = 4,
|
ES2017 = 4,
|
||||||
ES2018 = 5,
|
ES2018 = 5,
|
||||||
ESNext = 6,
|
ES2019 = 6,
|
||||||
|
ES2020 = 7,
|
||||||
|
ESNext = 99,
|
||||||
JSON = 100,
|
JSON = 100,
|
||||||
Latest = 6
|
Latest = ESNext,
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ModuleResolutionKind {
|
enum ModuleResolutionKind {
|
||||||
Classic = 1,
|
Classic = 1,
|
||||||
NodeJs = 2
|
NodeJs = 2
|
||||||
|
|
|
||||||
9
src/monaco.d.ts
vendored
9
src/monaco.d.ts
vendored
|
|
@ -8,8 +8,9 @@ declare module monaco.languages.typescript {
|
||||||
UMD = 3,
|
UMD = 3,
|
||||||
System = 4,
|
System = 4,
|
||||||
ES2015 = 5,
|
ES2015 = 5,
|
||||||
ESNext = 6
|
ESNext = 99
|
||||||
}
|
}
|
||||||
|
|
||||||
enum JsxEmit {
|
enum JsxEmit {
|
||||||
None = 0,
|
None = 0,
|
||||||
Preserve = 1,
|
Preserve = 1,
|
||||||
|
|
@ -28,9 +29,11 @@ declare module monaco.languages.typescript {
|
||||||
ES2016 = 3,
|
ES2016 = 3,
|
||||||
ES2017 = 4,
|
ES2017 = 4,
|
||||||
ES2018 = 5,
|
ES2018 = 5,
|
||||||
ESNext = 6,
|
ES2019 = 6,
|
||||||
|
ES2020 = 7,
|
||||||
|
ESNext = 99,
|
||||||
JSON = 100,
|
JSON = 100,
|
||||||
Latest = 6
|
Latest = ESNext,
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum ModuleResolutionKind {
|
export enum ModuleResolutionKind {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue