diff --git a/gulpfile.js b/gulpfile.js index 66f96bf48ec0..4dcc03252d16 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -39,18 +39,19 @@ gulp.task('compileCore', (done) => { .on('finish', () => (failed ? done(new Error('TypeScript compilation errors')) : done())); }); -const apiTsProject = ts.createProject('./pythonExtensionApi/tsconfig.json', { typescript }); - gulp.task('compileApi', (done) => { - let failed = false; - apiTsProject - .src() - .pipe(apiTsProject()) - .on('error', () => { - failed = true; + spawnAsync('npm', ['run', 'compileApi'], undefined, true) + .then((stdout) => { + if (stdout.includes('error')) { + done(new Error(stdout)); + } else { + done(); + } }) - .js.pipe(gulp.dest('./pythonExtensionApi/out')) - .on('finish', () => (failed ? done(new Error('TypeScript compilation errors')) : done())); + .catch((ex) => { + console.log(ex); + done(new Error('TypeScript compilation errors', ex)); + }); }); gulp.task('compile', gulp.series('compileCore', 'compileApi')); diff --git a/package.json b/package.json index 4d6943a7dfe7..bfb44322227c 100644 --- a/package.json +++ b/package.json @@ -2070,6 +2070,7 @@ "package": "gulp clean && gulp prePublishBundle && vsce package -o ms-python-insiders.vsix", "prePublish": "gulp clean && gulp prePublishNonBundle", "compile": "tsc -watch -p ./", + "compileApi": "node ./node_modules/typescript/lib/tsc.js -b ./pythonExtensionApi/tsconfig.json", "compiled": "deemon npm run compile", "kill-compiled": "deemon --kill npm run compile", "checkDependencies": "gulp checkDependencies", @@ -2189,7 +2190,7 @@ "flat": "^5.0.2", "get-port": "^5.1.1", "gulp": "^4.0.0", - "gulp-typescript": "^5.0.0", + "gulp-typescript": "^6.0.0-alpha.1", "mocha": "^9.2.2", "mocha-junit-reporter": "^2.0.2", "mocha-multi-reporters": "^1.1.7",