Merge pull request #225695 from microsoft/ben/handsome-squirrel
esm - add `yarn watch-esm` and `watch-client-esm`pull/166033/head
commit
b96404323b
|
@ -34,11 +34,15 @@ gulp.task(compileClientTask);
|
||||||
const watchClientTask = task.define('watch-client', task.series(util.rimraf('out'), util.buildWebNodePaths('out'), task.parallel(watchTask('out', false), watchApiProposalNamesTask)));
|
const watchClientTask = task.define('watch-client', task.series(util.rimraf('out'), util.buildWebNodePaths('out'), task.parallel(watchTask('out', false), watchApiProposalNamesTask)));
|
||||||
gulp.task(watchClientTask);
|
gulp.task(watchClientTask);
|
||||||
|
|
||||||
|
const watchClientESMTask = task.define('watch-client-esm', task.series(util.rimraf('out'), util.buildWebNodePaths('out'), task.parallel(watchTask('out', false, 'src2'), watchApiProposalNamesTask)));
|
||||||
|
gulp.task(watchClientESMTask);
|
||||||
|
|
||||||
// All
|
// All
|
||||||
const _compileTask = task.define('compile', task.parallel(monacoTypecheckTask, compileClientTask, compileExtensionsTask, compileExtensionMediaTask));
|
const _compileTask = task.define('compile', task.parallel(monacoTypecheckTask, compileClientTask, compileExtensionsTask, compileExtensionMediaTask));
|
||||||
gulp.task(_compileTask);
|
gulp.task(_compileTask);
|
||||||
|
|
||||||
gulp.task(task.define('watch', task.parallel(/* monacoTypecheckWatchTask, */ watchClientTask, watchExtensionsTask)));
|
gulp.task(task.define('watch', task.parallel(/* monacoTypecheckWatchTask, */ watchClientTask, watchExtensionsTask)));
|
||||||
|
gulp.task(task.define('watch-esm', task.parallel(/* monacoTypecheckWatchTask, */ watchClientESMTask, watchExtensionsTask)));
|
||||||
|
|
||||||
// Default
|
// Default
|
||||||
gulp.task('default', _compileTask);
|
gulp.task('default', _compileTask);
|
||||||
|
|
|
@ -139,11 +139,11 @@ function compileTask(src, out, build, options = {}) {
|
||||||
task.taskName = `compile-${path.basename(src)}`;
|
task.taskName = `compile-${path.basename(src)}`;
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
function watchTask(out, build) {
|
function watchTask(out, build, srcPath = 'src') {
|
||||||
const task = () => {
|
const task = () => {
|
||||||
const compile = createCompile('src', { build, emitError: false, transpileOnly: false, preserveEnglish: false });
|
const compile = createCompile(srcPath, { build, emitError: false, transpileOnly: false, preserveEnglish: false });
|
||||||
const src = gulp.src('src/**', { base: 'src' });
|
const src = gulp.src(`${srcPath}/**`, { base: srcPath });
|
||||||
const watchSrc = watch('src/**', { base: 'src', readDelay: 200 });
|
const watchSrc = watch(`${srcPath}/**`, { base: srcPath, readDelay: 200 });
|
||||||
const generator = new MonacoGenerator(true);
|
const generator = new MonacoGenerator(true);
|
||||||
generator.execute();
|
generator.execute();
|
||||||
return watchSrc
|
return watchSrc
|
||||||
|
|
|
@ -170,13 +170,13 @@ export function compileTask(src: string, out: string, build: boolean, options: {
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function watchTask(out: string, build: boolean): task.StreamTask {
|
export function watchTask(out: string, build: boolean, srcPath: string = 'src'): task.StreamTask {
|
||||||
|
|
||||||
const task = () => {
|
const task = () => {
|
||||||
const compile = createCompile('src', { build, emitError: false, transpileOnly: false, preserveEnglish: false });
|
const compile = createCompile(srcPath, { build, emitError: false, transpileOnly: false, preserveEnglish: false });
|
||||||
|
|
||||||
const src = gulp.src('src/**', { base: 'src' });
|
const src = gulp.src(`${srcPath}/**`, { base: srcPath });
|
||||||
const watchSrc = watch('src/**', { base: 'src', readDelay: 200 });
|
const watchSrc = watch(`${srcPath}/**`, { base: srcPath, readDelay: 200 });
|
||||||
|
|
||||||
const generator = new MonacoGenerator(true);
|
const generator = new MonacoGenerator(true);
|
||||||
generator.execute();
|
generator.execute();
|
||||||
|
|
|
@ -31,7 +31,7 @@ const binaryFileExtensions = new Set([
|
||||||
|
|
||||||
function migrate() {
|
function migrate() {
|
||||||
console.log(`~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`);
|
console.log(`~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`);
|
||||||
console.log(`STARTING MIGRATION of src to src2.`);
|
console.log(`STARTING AMD->ESM MIGRATION of src to src2.`);
|
||||||
|
|
||||||
// installing watcher quickly to avoid missing early events
|
// installing watcher quickly to avoid missing early events
|
||||||
const watchSrc = enableWatching ? watch('src/**', { base: 'src', readDelay: 200 }) : undefined;
|
const watchSrc = enableWatching ? watch('src/**', { base: 'src', readDelay: 200 }) : undefined;
|
||||||
|
@ -49,7 +49,8 @@ function migrate() {
|
||||||
writeFileSync(join(dstFolder, '.gitignore'), `*`);
|
writeFileSync(join(dstFolder, '.gitignore'), `*`);
|
||||||
|
|
||||||
console.log(`~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`);
|
console.log(`~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`);
|
||||||
console.log(`COMPLETED MIGRATION of src to src2. You can now launch yarn watch or yarn watch-client`);
|
console.log(`COMPLETED AMD->ESM MIGRATION of src to src2. You can now launch yarn watch-esm or yarn watch-client-esm`);
|
||||||
|
console.log(`Make sure to set the environment variable VSCODE_BUILD_ESM to a string of value 'true' if you want to build VS Code`);
|
||||||
|
|
||||||
if (watchSrc) {
|
if (watchSrc) {
|
||||||
console.log(`WATCHING src for changes...`);
|
console.log(`WATCHING src for changes...`);
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
"postinstall": "node build/npm/postinstall.js",
|
"postinstall": "node build/npm/postinstall.js",
|
||||||
"compile": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js compile",
|
"compile": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js compile",
|
||||||
"watch": "npm-run-all -lp watch-client watch-extensions",
|
"watch": "npm-run-all -lp watch-client watch-extensions",
|
||||||
|
"watch-esm": "npm-run-all -lp watch-client-esm watch-extensions",
|
||||||
"watchd": "deemon yarn watch",
|
"watchd": "deemon yarn watch",
|
||||||
"watch-webd": "deemon yarn watch-web",
|
"watch-webd": "deemon yarn watch-web",
|
||||||
"kill-watchd": "deemon --kill yarn watch",
|
"kill-watchd": "deemon --kill yarn watch",
|
||||||
|
@ -25,6 +26,7 @@
|
||||||
"restart-watchd": "deemon --restart yarn watch",
|
"restart-watchd": "deemon --restart yarn watch",
|
||||||
"restart-watch-webd": "deemon --restart yarn watch-web",
|
"restart-watch-webd": "deemon --restart yarn watch-web",
|
||||||
"watch-client": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js watch-client",
|
"watch-client": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js watch-client",
|
||||||
|
"watch-client-esm": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js watch-client-esm",
|
||||||
"watch-clientd": "deemon yarn watch-client",
|
"watch-clientd": "deemon yarn watch-client",
|
||||||
"kill-watch-clientd": "deemon --kill yarn watch-client",
|
"kill-watch-clientd": "deemon --kill yarn watch-client",
|
||||||
"watch-extensions": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js watch-extensions watch-extension-media",
|
"watch-extensions": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js watch-extensions watch-extension-media",
|
||||||
|
|
Loading…
Reference in New Issue