Skip to content
This repository was archived by the owner on Apr 9, 2021. It is now read-only.

Commit

Permalink
build.js: fix build script
Browse files Browse the repository at this point in the history
vscode-html-languageserver's tsconfig changed.
 It extends `../../shared.tsconfig.json` that is
`https://github.com/microsoft/vscode/blob/master/extensions/shared.tsconfig.json` now.
So I copy and use shared.tsconfig.json. I don't want to keep up with changes in shared.tsconfig.json,
but I couldn't think of any other easy way.
The submodule directory has also been changed to match the relative path of extends in tsconfig.json.
  • Loading branch information
h-michael committed Dec 31, 2019
1 parent b796f6f commit d232171
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
9 changes: 3 additions & 6 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,14 @@ const throwIfError = res => {

console.log(green(`Installing ${cyan('vscode-html-languageserver')} dependencies`));
throwIfError(spawnSync('npm', ['install'], {
cwd: join(__dirname, 'vscode-html-languageserver'),
cwd: join(__dirname, 'submodule/vscode-html-languageserver'),
stdio: 'inherit'
}));

console.log(green(`Compiling ${cyan('vscode-html-languageserver')}`));
const tsconfig = require('./vscode-html-languageserver/tsconfig.json')
throwIfError(spawnSync('tsc', [
'-p', 'vscode-html-languageserver',
'-p', 'submodule/vscode-html-languageserver',
'--outDir', 'dist',
'--lib', tsconfig.compilerOptions.lib.concat(['dom']).join(','),
'--target', tsconfig.compilerOptions.target,
'--listEmittedFiles'
], {
cwd: __dirname,
Expand All @@ -39,7 +36,7 @@ writeFileSync(file, lines.join('\n'), 'utf8')

console.log(green(`Merging package.json files`));
const currentPackage = require('./package.json');
const HTMLLSPackage = require('./vscode-html-languageserver/package.json');
const HTMLLSPackage = require('./submodule/vscode-html-languageserver/package.json');

writeFileSync(join(__dirname, 'dist', 'package.json'), JSON.stringify(Object.assign(HTMLLSPackage, currentPackage, {
scripts: {},
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"chalk": "^2.3.0"
},
"dependencies": {
"typescript": "^2.9.1"
"typescript": "^3.7.3"
}
}
16 changes: 16 additions & 0 deletions shared.tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

{
"compilerOptions": {
"target": "es2018",
"module": "commonjs",
"strict": true,
"alwaysStrict": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true
},
"include": [
"./dir/vscode-html-hanguageserver/src/**/*"
]
}

0 comments on commit d232171

Please sign in to comment.