Skip to content

Commit ec70719

Browse files
author
Kartik Raj
committed
Add gulp task to verify successful compilation of API
1 parent c6f3e68 commit ec70719

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

gulpfile.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ const os = require('os');
2323
const rmrf = require('rimraf');
2424
const typescript = require('typescript');
2525

26-
const tsProject = ts.createProject('./tsconfig.json', { typescript });
26+
const tsProject = ts.createProject('./pythonExtensionApi/tsconfig.json', { typescript });
2727

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

30-
gulp.task('compile', (done) => {
30+
gulp.task('compileCore', (done) => {
3131
let failed = false;
3232
tsProject
3333
.src()
@@ -39,6 +39,22 @@ gulp.task('compile', (done) => {
3939
.on('finish', () => (failed ? done(new Error('TypeScript compilation errors')) : done()));
4040
});
4141

42+
const apiTsProject = ts.createProject('./pythonExtensionApi/tsconfig.json', { typescript });
43+
44+
gulp.task('compileApi', (done) => {
45+
let failed = false;
46+
apiTsProject
47+
.src()
48+
.pipe(apiTsProject())
49+
.on('error', () => {
50+
failed = true;
51+
})
52+
.js.pipe(gulp.dest('./pythonExtensionApi/out'))
53+
.on('finish', () => (failed ? done(new Error('TypeScript compilation errors')) : done()));
54+
});
55+
56+
gulp.task('compile', gulp.series('compileCore', 'compileApi'));
57+
4258
gulp.task('precommit', (done) => run({ exitOnError: true, mode: 'staged' }, done));
4359

4460
gulp.task('output:clean', () => del(['coverage']));

pythonExtensionApi/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ First we need to define a `package.json` for the extension that wants to use the
1919
// Depend on the Python extension facade npm module to get easier API access to the
2020
// core extension.
2121
"dependencies": {
22-
"@vscode/pythonExtensionApi": "..."
22+
"@vscode/python-extension": "..."
2323
},
2424
}
2525
```

pythonExtensionApi/tsconfig.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"compilerOptions": {
3-
"composite": true,
4-
"incremental": true,
53
"baseUrl": ".",
4+
"paths": {
5+
"*": ["types/*"]
6+
},
67
"module": "commonjs",
78
"target": "es2018",
89
"outDir": "./out",
@@ -24,8 +25,7 @@
2425
"noUnusedParameters": true,
2526
"noFallthroughCasesInSwitch": true,
2627
"resolveJsonModule": true,
27-
"removeComments": true,
28-
"tsBuildInfoFile": "./out/tsconfig.tsbuildInfo",
28+
"removeComments": true
2929
},
3030
"exclude": [
3131
"node_modules",

0 commit comments

Comments
 (0)