Use const enums (and generate non-const ones for standalone editor)

This commit is contained in:
Alex Dima
2018-10-22 09:58:58 +02:00
parent e3f803d92c
commit 67eacaa4a8
21 changed files with 811 additions and 505 deletions

View File

@@ -199,6 +199,7 @@ class MonacoGenerator {
const result = this._run();
if (!result) {
// nothing really changed
this._log(`monaco.d.ts is unchanged - total time took ${Date.now() - startTime} ms`);
return;
}
if (result.isTheSame) {
@@ -206,6 +207,7 @@ class MonacoGenerator {
return;
}
fs.writeFileSync(result.filePath, result.content);
fs.writeFileSync(path.join(REPO_SRC_FOLDER, 'vs/editor/common/standalone/standaloneEnums.ts'), result.enums);
this._log(`monaco.d.ts is changed - total time took ${Date.now() - startTime} ms`);
if (!this._isWatch) {
this.stream.emit('error', 'monaco.d.ts is no longer up to date. Please run gulp watch and commit the new file.');