From 994b5d31e97a63b840f71a7e8a8a1e2d02281a76 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 13 Mar 2018 17:30:03 +0100 Subject: [PATCH] Adopt latest deps --- gulpfile.js | 25 ++++++++++++++++++++++--- package-lock.json | 6 +++--- package.json | 2 +- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 322a6b0f..a79a780f 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -101,6 +101,17 @@ function pluginStream(plugin, type, destinationPath) { pluginPath + '/**/*', '!' + contribPath ]) + .pipe(es.through(function(data) { + if (!/_\.contribution/.test(data.path)) { + this.emit('data', data); + return; + } + + let contents = data.contents.toString(); + contents = contents.replace('define(["require", "exports"],', 'define(["require", "exports", "vs/editor/editor.api"],'); + data.contents = new Buffer(contents); + this.emit('data', data); + })) .pipe(gulp.dest(destinationPath + plugin.modulePrefix)) ); } @@ -155,8 +166,11 @@ function addPluginContribs(type) { var contribDefineIndex = contribContents.indexOf('define("' + plugin.contrib); if (contribDefineIndex === -1) { - console.error('(1) CANNOT DETERMINE AMD define location for contribution', pluginPath); - process.exit(-1); + contribDefineIndex = contribContents.indexOf('define(\'' + plugin.contrib); + if (contribDefineIndex === -1) { + console.error('(1) CANNOT DETERMINE AMD define location for contribution', pluginPath); + process.exit(-1); + } } var depsEndIndex = contribContents.indexOf(']', contribDefineIndex); @@ -167,6 +181,11 @@ function addPluginContribs(type) { contribContents = contribContents.substring(0, depsEndIndex) + ',"vs/editor/editor.api"' + contribContents.substring(depsEndIndex); + contribContents = contribContents.replace( + 'define("vs/basic-languages/_.contribution",["require","exports"],', + 'define("vs/basic-languages/_.contribution",["require","exports","vs/editor/editor.api"],', + ); + extraContent.push(contribContents); }); @@ -232,7 +251,7 @@ function ESM_pluginStream(plugin, destinationPath) { if (!/(^\.\/)|(^\.\.\/)/.test(importText)) { // non-relative import if (!/^monaco-editor-core/.test(importText)) { - console.error(`Non-relative import for unknown module: ${importText}`); + console.error(`Non-relative import for unknown module: ${importText} in ${data.path}`); process.exit(0); } diff --git a/package-lock.json b/package-lock.json index 32ab6d31..846c8ebd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2395,9 +2395,9 @@ "dev": true }, "monaco-languages": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/monaco-languages/-/monaco-languages-1.0.1.tgz", - "integrity": "sha512-s1/fMbR3DM04wCxlL03ZFe6aMFrnTusLoIz/rNNGdPYceAyBM7NXt62c6wm3wsBlo4/M698dWRj1p7FEgGdiRg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/monaco-languages/-/monaco-languages-1.0.2.tgz", + "integrity": "sha512-xQEdlbw7nEQoopkPwQTHx3EFPflTrYOqxhY4gGFunbnjY5pIsqROH5/THALSYf3ZWXAZ3vlMxp/lS4eegTdowA==", "dev": true }, "monaco-typescript": { diff --git a/package.json b/package.json index c16df47f..429a514b 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "monaco-editor-core": "0.11.3", "monaco-html": "2.0.2", "monaco-json": "2.0.1", - "monaco-languages": "1.0.1", + "monaco-languages": "1.0.2", "monaco-typescript": "3.0.0", "rimraf": "^2.5.2", "typedoc": "^0.8.0",