Skip to content

Commit

Permalink
Add monaco-editor-setup script
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdima committed Oct 19, 2016
1 parent 37c04d7 commit 9e1b35b
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 15 deletions.
27 changes: 13 additions & 14 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
require('events').EventEmitter.defaultMaxListeners = 100;

This comment has been minimized.

Copy link
@bpasero

bpasero Oct 19, 2016

Member

@alexandrudima fyi builds go red after this (https://travis-ci.org/Microsoft/vscode/jobs/168986576, https://ci.appveyor.com/project/VSCode/vscode/build/1.0.9487):

Task 'compile-extensions' is not in your gulpfile

This comment has been minimized.

Copy link
@Tyriar

Tyriar Oct 20, 2016

Member

I did a little digging here, it's failing because the dependencies of the tasks in ./gulpfile.js are not taken into consideration, ie. watch needs watch-extensions which is in ./build/gulpfile.extensions.js.

This comment has been minimized.

Copy link
@bpasero

bpasero Oct 20, 2016

Member

@alexandrudima this was breaking my local development so I reverted the change because it was not obvious to me how to fix it. can you check again please.

This comment has been minimized.

Copy link
@alexdima

alexdima Oct 20, 2016

Author Member

Oh, I see, sorry about that, wasn't aware of our using gulp compile in the build scripts


const gulp = require('gulp');
// Record all defined tasks to determine later in this file (at the bottom)
// if further gulpfiles need to be included or not
var ALL_KNOWN_TASKS = [], originalGulpTask = gulp.task;
gulp.task = function() {
ALL_KNOWN_TASKS.push(arguments[0]);
return originalGulpTask.apply(gulp, Array.prototype.slice.call(arguments, 0));
};

const json = require('gulp-json-editor');
const buffer = require('gulp-buffer');
const tsb = require('gulp-tsb');
Expand Down Expand Up @@ -258,22 +266,13 @@ gulp.task('mixin', function () {
.pipe(gulp.dest('.'));
});

var ALL_EDITOR_TASKS = [
'clean-optimized-editor',
'optimize-editor',
'clean-minified-editor',
'minify-editor',
'clean-editor-distro',
'editor-distro',
'analyze-editor-distro'
];
var runningEditorTasks = process.argv.slice(2).every(function(arg) {
return (ALL_EDITOR_TASKS.indexOf(arg) !== -1);
require(`./build/gulpfile.editor`);

var runningKnownTasks = process.argv.slice(2).every(function(arg) {
return (ALL_KNOWN_TASKS.indexOf(arg) !== -1);
});

if (runningEditorTasks) {
require(`./build/gulpfile.editor`);
} else {
if (!runningKnownTasks) {
// Load all the gulpfiles only if running tasks other than the editor tasks
const build = path.join(__dirname, 'build');
glob.sync('gulpfile.*.js', { cwd: build })
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"test": "mocha",
"preinstall": "node build/npm/preinstall.js",
"postinstall": "node build/npm/postinstall.js",
"watch": "gulp watch"
"watch": "gulp watch",
"monaco-editor-setup": "node scripts/monaco-editor-setup.js"
},
"dependencies": {
"applicationinsights": "0.15.6",
Expand Down
55 changes: 55 additions & 0 deletions scripts/monaco-editor-setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@

var fs = require('fs');
var cp = require('child_process');
var path = require('path');

var keep = [
'azure-storage',
'clone',
'debounce',
'event-stream',
'glob',
'gulp-azure-storage',
'gulp-bom',
'gulp-buffer',
'gulp-concat',
'gulp-cssnano',
'gulp-filter',
'gulp-flatmap',
'gulp-json-editor',
'gulp-mocha',
'gulp-remote-src',
'gulp-rename',
'gulp-sourcemaps',
'gulp-tsb',
'gulp-uglify',
'gulp-util',
'gulp-vinyl-zip',
'gulp-watch',
'gulp',
'lazy.js',
'object-assign',
'pump',
'rimraf',
'source-map',
'typescript',
'underscore',
'vinyl',
'vscode-nls-dev',
];

var packageJSON = require('../package.json');
var modules = keep.map(function(module) {
var version = packageJSON.devDependencies[module];
if (version) {
return module + '@' + version.replace(/^\^/, '');
} else {
return module;
}
});

var cmd = `npm install ${modules.join(' ')}`;
console.log(cmd);
cp.execSync(cmd, {
cwd: path.join(__dirname, '..')
});

0 comments on commit 9e1b35b

Please sign in to comment.