Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add gulp task to verify successful compilation of API
  • Loading branch information
Kartik Raj
Kartik Raj committed Jul 14, 2023
commit c354b6c9acedc21ff4468a79b34344e7603f434b
18 changes: 17 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const tsProject = ts.createProject('./tsconfig.json', { typescript });

const isCI = process.env.TRAVIS === 'true' || process.env.TF_BUILD !== undefined;

gulp.task('compile', (done) => {
gulp.task('compileCore', (done) => {
let failed = false;
tsProject
.src()
Expand All @@ -39,6 +39,22 @@ gulp.task('compile', (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;
})
.js.pipe(gulp.dest('./pythonExtensionApi/out'))
.on('finish', () => (failed ? done(new Error('TypeScript compilation errors')) : done()));
});

gulp.task('compile', gulp.series('compileCore', 'compileApi'));

gulp.task('precommit', (done) => run({ exitOnError: true, mode: 'staged' }, done));

gulp.task('output:clean', () => del(['coverage']));
Expand Down
2 changes: 1 addition & 1 deletion pythonExtensionApi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ First we need to define a `package.json` for the extension that wants to use the
// Depend on the Python extension facade npm module to get easier API access to the
// core extension.
"dependencies": {
"@vscode/pythonExtensionApi": "..."
"@vscode/python-extension": "..."
},
}
```
Expand Down
8 changes: 4 additions & 4 deletions pythonExtensionApi/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"compilerOptions": {
"composite": true,
"incremental": true,
"baseUrl": ".",
"paths": {
"*": ["types/*"]
},
"module": "commonjs",
"target": "es2018",
"outDir": "./out",
Expand All @@ -24,8 +25,7 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"resolveJsonModule": true,
"removeComments": true,
"tsBuildInfoFile": "./out/tsconfig.tsbuildInfo",
"removeComments": true
},
"exclude": [
"node_modules",
Expand Down