mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 15:05:39 +01:00
Adopt latest monaco-editor-core
This commit is contained in:
parent
be4df5641b
commit
13fb3f4b6c
4 changed files with 28 additions and 16 deletions
34
gulpfile.js
34
gulpfile.js
|
|
@ -33,6 +33,9 @@ gulp.task('release', ['clean-release'], function() {
|
||||||
// min folder
|
// min folder
|
||||||
releaseOne('min'),
|
releaseOne('min'),
|
||||||
|
|
||||||
|
// // esm folder
|
||||||
|
// releaseESM(),
|
||||||
|
|
||||||
// package.json
|
// package.json
|
||||||
gulp.src('package.json')
|
gulp.src('package.json')
|
||||||
.pipe(es.through(function(data) {
|
.pipe(es.through(function(data) {
|
||||||
|
|
@ -71,6 +74,12 @@ function releaseOne(type) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// function releaseESM() {
|
||||||
|
// // return es.merge(
|
||||||
|
// // gulp.src('node_modules/monaco-editor-core/esm/**/*')
|
||||||
|
// // )
|
||||||
|
// }
|
||||||
|
|
||||||
function pluginStreams(type, destinationPath) {
|
function pluginStreams(type, destinationPath) {
|
||||||
return es.merge(
|
return es.merge(
|
||||||
metadata.METADATA.PLUGINS.map(function(plugin) {
|
metadata.METADATA.PLUGINS.map(function(plugin) {
|
||||||
|
|
@ -95,7 +104,7 @@ function pluginStream(plugin, type, destinationPath) {
|
||||||
/**
|
/**
|
||||||
* Edit editor.main.js:
|
* Edit editor.main.js:
|
||||||
* - rename the AMD module 'vs/editor/editor.main' to 'vs/editor/edcore.main'
|
* - rename the AMD module 'vs/editor/editor.main' to 'vs/editor/edcore.main'
|
||||||
* - append contribs from plugins
|
* - append monaco.contribution modules from plugins
|
||||||
* - append new AMD module 'vs/editor/editor.main' that stiches things together
|
* - append new AMD module 'vs/editor/editor.main' that stiches things together
|
||||||
*/
|
*/
|
||||||
function addPluginContribs(type) {
|
function addPluginContribs(type) {
|
||||||
|
|
@ -118,22 +127,25 @@ function addPluginContribs(type) {
|
||||||
var contribPath = path.join(__dirname, pluginPath, plugin.contrib.substr(plugin.modulePrefix.length)) + '.js';
|
var contribPath = path.join(__dirname, pluginPath, plugin.contrib.substr(plugin.modulePrefix.length)) + '.js';
|
||||||
var contribContents = fs.readFileSync(contribPath).toString();
|
var contribContents = fs.readFileSync(contribPath).toString();
|
||||||
|
|
||||||
// Check for the anonymous define call case
|
// Check for the anonymous define call case 1
|
||||||
var contribDefineIndexCase0 = contribContents.indexOf('define(function');
|
// transform define(function() {...}) to define("moduleId",["require"],function() {...})
|
||||||
if (contribDefineIndexCase0 >= 0) {
|
var anonymousContribDefineCase1 = contribContents.indexOf('define(function');
|
||||||
|
if (anonymousContribDefineCase1 >= 0) {
|
||||||
contribContents = (
|
contribContents = (
|
||||||
contribContents.substring(0, contribDefineIndexCase0)
|
contribContents.substring(0, anonymousContribDefineCase1)
|
||||||
+ `define("${plugin.contrib}",["require"],function`
|
+ `define("${plugin.contrib}",["require"],function`
|
||||||
+ contribContents.substring(contribDefineIndexCase0 + 'define(function'.length)
|
+ contribContents.substring(anonymousContribDefineCase1 + 'define(function'.length)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
var contribDefineIndexCase1 = contribContents.indexOf('define([');
|
// Check for the anonymous define call case 2
|
||||||
if (contribDefineIndexCase1 >= 0) {
|
// transform define([ to define("moduleId",[
|
||||||
|
var anonymousContribDefineCase2 = contribContents.indexOf('define([');
|
||||||
|
if (anonymousContribDefineCase2 >= 0) {
|
||||||
contribContents = (
|
contribContents = (
|
||||||
contribContents.substring(0, contribDefineIndexCase1)
|
contribContents.substring(0, anonymousContribDefineCase2)
|
||||||
+ `define("${plugin.contrib}",[`
|
+ `define("${plugin.contrib}",[`
|
||||||
+ contribContents.substring(contribDefineIndexCase1 + 'define(['.length)
|
+ contribContents.substring(anonymousContribDefineCase2 + 'define(['.length)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -149,7 +161,7 @@ function addPluginContribs(type) {
|
||||||
process.exit(-1);
|
process.exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
contribContents = contribContents.substring(0, depsEndIndex) + ',"vs/editor/edcore.main"' + contribContents.substring(depsEndIndex);
|
contribContents = contribContents.substring(0, depsEndIndex) + ',"vs/editor/editor.api"' + contribContents.substring(depsEndIndex);
|
||||||
|
|
||||||
extraContent.push(contribContents);
|
extraContent.push(contribContents);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
contrib: 'vs/language/json/monaco.contribution',
|
contrib: 'vs/language/json/monaco.contribution',
|
||||||
modulePrefix: 'vs/language/json',
|
modulePrefix: 'vs/language/json',
|
||||||
paths: {
|
paths: {
|
||||||
src: '/monaco-json/release/min',
|
src: '/monaco-json/release/dev',
|
||||||
'npm/dev': 'node_modules/monaco-json/release/dev',
|
'npm/dev': 'node_modules/monaco-json/release/dev',
|
||||||
'npm/min': 'node_modules/monaco-json/release/min',
|
'npm/min': 'node_modules/monaco-json/release/min',
|
||||||
}
|
}
|
||||||
|
|
|
||||||
6
package-lock.json
generated
6
package-lock.json
generated
|
|
@ -2377,9 +2377,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"monaco-editor-core": {
|
"monaco-editor-core": {
|
||||||
"version": "0.11.1",
|
"version": "0.11.3",
|
||||||
"resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.11.1.tgz",
|
"resolved": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.11.3.tgz",
|
||||||
"integrity": "sha512-zbi+FI4Bm1B48AvAVjir0XUJlH85ZyFHaBcXvZjfy+mui8VaE7Run2ai/l9cvb6oqzTKQwg/UpYDu0BWyB8K5w==",
|
"integrity": "sha512-e6o/TInK+sRgWaWNj8kIaNinfmTC1vQdwF6QUaZ7h0OT+xILM6zxl+4B0imIbKm7iBYSZR2avH8Hbg8h6qQ2+g==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"monaco-html": {
|
"monaco-html": {
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
"gulp-typedoc": "^2.0.0",
|
"gulp-typedoc": "^2.0.0",
|
||||||
"http-server": "^0.9.0",
|
"http-server": "^0.9.0",
|
||||||
"monaco-css": "2.0.0",
|
"monaco-css": "2.0.0",
|
||||||
"monaco-editor-core": "0.11.1",
|
"monaco-editor-core": "0.11.3",
|
||||||
"monaco-html": "2.0.1",
|
"monaco-html": "2.0.1",
|
||||||
"monaco-json": "2.0.0",
|
"monaco-json": "2.0.0",
|
||||||
"monaco-languages": "1.0.0",
|
"monaco-languages": "1.0.0",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue