mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 16:15:41 +01:00
Change metadata format
This commit is contained in:
parent
a6e0092cd1
commit
e76aa16381
3 changed files with 32 additions and 22 deletions
12
gulpfile.js
12
gulpfile.js
|
|
@ -72,12 +72,12 @@ function pluginStreams(destinationPath) {
|
|||
}
|
||||
|
||||
function pluginStream(plugin, destinationPath) {
|
||||
var contribPath = path.join(plugin.path, plugin.contrib.substr(plugin.modulePrefix.length)) + '.js';
|
||||
var contribPath = path.join(plugin.paths.npm, plugin.contrib.substr(plugin.modulePrefix.length)) + '.js';
|
||||
return (
|
||||
gulp.src([
|
||||
plugin.path + '/**/*',
|
||||
plugin.paths.npm + '/**/*',
|
||||
'!' + contribPath,
|
||||
'!' + plugin.path + '/**/monaco.d.ts'
|
||||
'!' + plugin.paths.npm + '/**/monaco.d.ts'
|
||||
])
|
||||
.pipe(gulp.dest(destinationPath + plugin.modulePrefix))
|
||||
);
|
||||
|
|
@ -105,7 +105,7 @@ function addPluginContribs() {
|
|||
|
||||
metadata.METADATA.PLUGINS.forEach(function(plugin) {
|
||||
allPluginsModuleIds.push(plugin.contrib);
|
||||
var contribPath = path.join(__dirname, plugin.path, plugin.contrib.substr(plugin.modulePrefix.length)) + '.js';
|
||||
var contribPath = path.join(__dirname, plugin.paths.npm, plugin.contrib.substr(plugin.modulePrefix.length)) + '.js';
|
||||
var contribContents = fs.readFileSync(contribPath).toString();
|
||||
|
||||
var contribDefineIndex = contribContents.indexOf('define("' + plugin.contrib);
|
||||
|
|
@ -151,7 +151,7 @@ function addPluginDTS() {
|
|||
|
||||
var extraContent = [];
|
||||
metadata.METADATA.PLUGINS.forEach(function(plugin) {
|
||||
var dtsPath = path.join(plugin.path, 'monaco.d.ts');
|
||||
var dtsPath = path.join(plugin.paths.npm, 'monaco.d.ts');
|
||||
try {
|
||||
extraContent.push(fs.readFileSync(dtsPath).toString());
|
||||
} catch (err) {
|
||||
|
|
@ -181,7 +181,7 @@ function addPluginThirdPartyNotices() {
|
|||
|
||||
var extraContent = [];
|
||||
metadata.METADATA.PLUGINS.forEach(function(plugin) {
|
||||
var thirdPartyNoticePath = path.join(path.dirname(plugin.path), 'ThirdPartyNotices.txt');
|
||||
var thirdPartyNoticePath = path.join(path.dirname(plugin.paths.npm), 'ThirdPartyNotices.txt');
|
||||
try {
|
||||
var thirdPartyNoticeContent = fs.readFileSync(thirdPartyNoticePath).toString();
|
||||
thirdPartyNoticeContent = thirdPartyNoticeContent.split('\n').slice(8).join('\n');
|
||||
|
|
|
|||
32
metadata.js
32
metadata.js
|
|
@ -2,34 +2,44 @@
|
|||
|
||||
var METADATA = {
|
||||
CORE: {
|
||||
path: 'node_modules/monaco-editor-core/min/vs',
|
||||
srcPath: '/vscode/out/vs'
|
||||
// srcPath: '/vscode/out-monaco-editor-core/min/vs'
|
||||
paths: {
|
||||
npm: 'node_modules/monaco-editor-core/min/vs',
|
||||
dev: '/vscode/out/vs'
|
||||
// dev: '/vscode/out-monaco-editor-core/min/vs',
|
||||
}
|
||||
},
|
||||
PLUGINS: [{
|
||||
name: 'monaco-typescript',
|
||||
contrib: 'vs/language/typescript/src/monaco.contribution',
|
||||
modulePrefix: 'vs/language/typescript',
|
||||
path: 'node_modules/monaco-typescript/release',
|
||||
srcPath: '/monaco-typescript/out'
|
||||
paths: {
|
||||
npm: 'node_modules/monaco-typescript/release',
|
||||
dev: '/monaco-typescript/out'
|
||||
}
|
||||
},{
|
||||
name: 'monaco-css',
|
||||
contrib: 'vs/language/css/monaco.contribution',
|
||||
modulePrefix: 'vs/language/css',
|
||||
path: 'node_modules/monaco-css/release/min',
|
||||
srcPath: '/monaco-css/release/dev'
|
||||
paths: {
|
||||
npm: 'node_modules/monaco-css/release/min',
|
||||
dev: '/monaco-css/release/dev'
|
||||
}
|
||||
},{
|
||||
name: 'monaco-json',
|
||||
contrib: 'vs/language/json/monaco.contribution',
|
||||
modulePrefix: 'vs/language/json',
|
||||
path: 'node_modules/monaco-json/release/min',
|
||||
srcPath: '/monaco-json/release/dev'
|
||||
paths: {
|
||||
npm: 'node_modules/monaco-json/release/min',
|
||||
dev: '/monaco-css/release/dev'
|
||||
}
|
||||
},{
|
||||
name: 'monaco-languages',
|
||||
contrib: 'vs/basic-languages/src/monaco.contribution',
|
||||
modulePrefix: 'vs/basic-languages',
|
||||
path: 'node_modules/monaco-languages/release',
|
||||
srcPath: '/monaco-languages/out'
|
||||
paths: {
|
||||
npm: 'node_modules/monaco-languages/release',
|
||||
dev: '/monaco-languages/out'
|
||||
}
|
||||
}]
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,17 +10,17 @@
|
|||
|
||||
function resolveCorePath(core) {
|
||||
if (loadDevEditor()) {
|
||||
return core.srcPath;
|
||||
return core.paths.dev;
|
||||
} else {
|
||||
return '/monaco-editor/' + core.path;
|
||||
return '/monaco-editor/' + core.paths.npm;
|
||||
}
|
||||
}
|
||||
|
||||
function resolvePluginPath(plugin) {
|
||||
if (plugin.srcPath && getQueryStringValue(plugin.name) === 'dev') {
|
||||
return plugin.srcPath;
|
||||
if (plugin.paths.dev && getQueryStringValue(plugin.name) === 'dev') {
|
||||
return plugin.paths.dev;
|
||||
} else {
|
||||
return '/monaco-editor/' + plugin.path;
|
||||
return '/monaco-editor/' + plugin.paths.npm;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue