mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 20:52:56 +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) {
|
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 (
|
return (
|
||||||
gulp.src([
|
gulp.src([
|
||||||
plugin.path + '/**/*',
|
plugin.paths.npm + '/**/*',
|
||||||
'!' + contribPath,
|
'!' + contribPath,
|
||||||
'!' + plugin.path + '/**/monaco.d.ts'
|
'!' + plugin.paths.npm + '/**/monaco.d.ts'
|
||||||
])
|
])
|
||||||
.pipe(gulp.dest(destinationPath + plugin.modulePrefix))
|
.pipe(gulp.dest(destinationPath + plugin.modulePrefix))
|
||||||
);
|
);
|
||||||
|
|
@ -105,7 +105,7 @@ function addPluginContribs() {
|
||||||
|
|
||||||
metadata.METADATA.PLUGINS.forEach(function(plugin) {
|
metadata.METADATA.PLUGINS.forEach(function(plugin) {
|
||||||
allPluginsModuleIds.push(plugin.contrib);
|
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 contribContents = fs.readFileSync(contribPath).toString();
|
||||||
|
|
||||||
var contribDefineIndex = contribContents.indexOf('define("' + plugin.contrib);
|
var contribDefineIndex = contribContents.indexOf('define("' + plugin.contrib);
|
||||||
|
|
@ -151,7 +151,7 @@ function addPluginDTS() {
|
||||||
|
|
||||||
var extraContent = [];
|
var extraContent = [];
|
||||||
metadata.METADATA.PLUGINS.forEach(function(plugin) {
|
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 {
|
try {
|
||||||
extraContent.push(fs.readFileSync(dtsPath).toString());
|
extraContent.push(fs.readFileSync(dtsPath).toString());
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
@ -181,7 +181,7 @@ function addPluginThirdPartyNotices() {
|
||||||
|
|
||||||
var extraContent = [];
|
var extraContent = [];
|
||||||
metadata.METADATA.PLUGINS.forEach(function(plugin) {
|
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 {
|
try {
|
||||||
var thirdPartyNoticeContent = fs.readFileSync(thirdPartyNoticePath).toString();
|
var thirdPartyNoticeContent = fs.readFileSync(thirdPartyNoticePath).toString();
|
||||||
thirdPartyNoticeContent = thirdPartyNoticeContent.split('\n').slice(8).join('\n');
|
thirdPartyNoticeContent = thirdPartyNoticeContent.split('\n').slice(8).join('\n');
|
||||||
|
|
|
||||||
32
metadata.js
32
metadata.js
|
|
@ -2,34 +2,44 @@
|
||||||
|
|
||||||
var METADATA = {
|
var METADATA = {
|
||||||
CORE: {
|
CORE: {
|
||||||
path: 'node_modules/monaco-editor-core/min/vs',
|
paths: {
|
||||||
srcPath: '/vscode/out/vs'
|
npm: 'node_modules/monaco-editor-core/min/vs',
|
||||||
// srcPath: '/vscode/out-monaco-editor-core/min/vs'
|
dev: '/vscode/out/vs'
|
||||||
|
// dev: '/vscode/out-monaco-editor-core/min/vs',
|
||||||
|
}
|
||||||
},
|
},
|
||||||
PLUGINS: [{
|
PLUGINS: [{
|
||||||
name: 'monaco-typescript',
|
name: 'monaco-typescript',
|
||||||
contrib: 'vs/language/typescript/src/monaco.contribution',
|
contrib: 'vs/language/typescript/src/monaco.contribution',
|
||||||
modulePrefix: 'vs/language/typescript',
|
modulePrefix: 'vs/language/typescript',
|
||||||
path: 'node_modules/monaco-typescript/release',
|
paths: {
|
||||||
srcPath: '/monaco-typescript/out'
|
npm: 'node_modules/monaco-typescript/release',
|
||||||
|
dev: '/monaco-typescript/out'
|
||||||
|
}
|
||||||
},{
|
},{
|
||||||
name: 'monaco-css',
|
name: 'monaco-css',
|
||||||
contrib: 'vs/language/css/monaco.contribution',
|
contrib: 'vs/language/css/monaco.contribution',
|
||||||
modulePrefix: 'vs/language/css',
|
modulePrefix: 'vs/language/css',
|
||||||
path: 'node_modules/monaco-css/release/min',
|
paths: {
|
||||||
srcPath: '/monaco-css/release/dev'
|
npm: 'node_modules/monaco-css/release/min',
|
||||||
|
dev: '/monaco-css/release/dev'
|
||||||
|
}
|
||||||
},{
|
},{
|
||||||
name: 'monaco-json',
|
name: 'monaco-json',
|
||||||
contrib: 'vs/language/json/monaco.contribution',
|
contrib: 'vs/language/json/monaco.contribution',
|
||||||
modulePrefix: 'vs/language/json',
|
modulePrefix: 'vs/language/json',
|
||||||
path: 'node_modules/monaco-json/release/min',
|
paths: {
|
||||||
srcPath: '/monaco-json/release/dev'
|
npm: 'node_modules/monaco-json/release/min',
|
||||||
|
dev: '/monaco-css/release/dev'
|
||||||
|
}
|
||||||
},{
|
},{
|
||||||
name: 'monaco-languages',
|
name: 'monaco-languages',
|
||||||
contrib: 'vs/basic-languages/src/monaco.contribution',
|
contrib: 'vs/basic-languages/src/monaco.contribution',
|
||||||
modulePrefix: 'vs/basic-languages',
|
modulePrefix: 'vs/basic-languages',
|
||||||
path: 'node_modules/monaco-languages/release',
|
paths: {
|
||||||
srcPath: '/monaco-languages/out'
|
npm: 'node_modules/monaco-languages/release',
|
||||||
|
dev: '/monaco-languages/out'
|
||||||
|
}
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,17 +10,17 @@
|
||||||
|
|
||||||
function resolveCorePath(core) {
|
function resolveCorePath(core) {
|
||||||
if (loadDevEditor()) {
|
if (loadDevEditor()) {
|
||||||
return core.srcPath;
|
return core.paths.dev;
|
||||||
} else {
|
} else {
|
||||||
return '/monaco-editor/' + core.path;
|
return '/monaco-editor/' + core.paths.npm;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function resolvePluginPath(plugin) {
|
function resolvePluginPath(plugin) {
|
||||||
if (plugin.srcPath && getQueryStringValue(plugin.name) === 'dev') {
|
if (plugin.paths.dev && getQueryStringValue(plugin.name) === 'dev') {
|
||||||
return plugin.srcPath;
|
return plugin.paths.dev;
|
||||||
} else {
|
} else {
|
||||||
return '/monaco-editor/' + plugin.path;
|
return '/monaco-editor/' + plugin.paths.npm;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue