mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 10:25:42 +01:00
append to monaco.d.ts from all plugins
This commit is contained in:
parent
99bc54b159
commit
3c8bc9b380
2 changed files with 32 additions and 11 deletions
37
gulpfile.js
37
gulpfile.js
|
|
@ -35,7 +35,7 @@ gulp.task('release', ['clean-release'], function() {
|
||||||
'node_modules/monaco-editor-core/monaco.d.ts',
|
'node_modules/monaco-editor-core/monaco.d.ts',
|
||||||
'node_modules/monaco-editor-core/ThirdPartyNotices.txt',
|
'node_modules/monaco-editor-core/ThirdPartyNotices.txt',
|
||||||
'README.md'
|
'README.md'
|
||||||
]).pipe(gulp.dest('release'))
|
]).pipe(addPluginDTS()).pipe(gulp.dest('release'))
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -48,13 +48,6 @@ function releaseOne(type) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function mergePluginsContribsIntoCore(coreStream) {
|
|
||||||
return (
|
|
||||||
coreStream
|
|
||||||
.pipe(addPluginContribs())
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function pluginStreams(destinationPath) {
|
function pluginStreams(destinationPath) {
|
||||||
return es.merge(
|
return es.merge(
|
||||||
metadata.METADATA.PLUGINS.map(function(plugin) {
|
metadata.METADATA.PLUGINS.map(function(plugin) {
|
||||||
|
|
@ -127,3 +120,31 @@ function addPluginContribs() {
|
||||||
this.emit('data', data);
|
this.emit('data', data);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Edit monaco.d.ts:
|
||||||
|
* - append monaco.d.ts from plugins
|
||||||
|
*/
|
||||||
|
function addPluginDTS() {
|
||||||
|
return es.through(function(data) {
|
||||||
|
if (!/monaco\.d\.ts$/.test(data.path)) {
|
||||||
|
this.emit('data', data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var contents = data.contents.toString();
|
||||||
|
|
||||||
|
var extraContent = [];
|
||||||
|
metadata.METADATA.PLUGINS.forEach(function(plugin) {
|
||||||
|
var dtsPath = path.join(plugin.path, 'monaco.d.ts');
|
||||||
|
try {
|
||||||
|
extraContent.push(fs.readFileSync(dtsPath).toString());
|
||||||
|
} catch (err) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
contents += '\n' + extraContent.join('\n');
|
||||||
|
data.contents = new Buffer(contents);
|
||||||
|
this.emit('data', data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -17,9 +17,9 @@
|
||||||
"event-stream": "^3.3.2",
|
"event-stream": "^3.3.2",
|
||||||
"gulp": "^3.9.1",
|
"gulp": "^3.9.1",
|
||||||
"http-server": "^0.9.0",
|
"http-server": "^0.9.0",
|
||||||
"monaco-editor-core": "0.3.1",
|
"monaco-editor-core": "0.4.0",
|
||||||
"monaco-languages": "0.1.1",
|
"monaco-languages": "0.2.0",
|
||||||
"monaco-typescript": "0.1.1",
|
"monaco-typescript": "0.2.0",
|
||||||
"rimraf": "^2.5.2"
|
"rimraf": "^2.5.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue