Skip to content

Commit

Permalink
build: use NPM to install node_modules
Browse files Browse the repository at this point in the history
`semver` is a prod dependency of `vscode-languageclient`.
In the old build pipeline, `vscode-languageclient` is declared in
`client/package.json`.
When yarn installs dependencies in the `client` directory, it will put `semver`
next to `vscode-languageclient` in `client/node_modules`.

In the new build pipeline, `vscode-languageclient` is declared in root
`package.json`.
When yarn installs dependencies in the root directory, it chooses not to hoist
`semver`, instead puts it in a nested node_modules under
`node_modules/vscode-languageclient/node_modules`.

There is a bug in vsce that causes it to ignore nested `node_modules`,
resulting in a `vsix` build that is broken. The issue is trackeed
[here](microsoft/vscode-vsce#432), but it does not
look like a fix will come any time soon.

For now we should install our dependencies using NPM.
  • Loading branch information
Keen Yee Liau committed Dec 4, 2020
1 parent 0714e9e commit 85f8212
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ rm -rf **/*.tsbuildinfo
yarn run compile

# Copy files to package root
cp package.json yarn.lock angular.png CHANGELOG.md README.md dist/npm
cp package.json angular.png CHANGELOG.md README.md dist/npm
# Copy files to server directory
cp server/package.json server/README.md dist/npm/server
# Build and copy files to syntaxes directory
Expand All @@ -23,9 +23,9 @@ mkdir dist/npm/syntaxes
cp syntaxes/!(tsconfig).json dist/npm/syntaxes

pushd dist/npm
yarn install --production --ignore-scripts
npm install --production --ignore-scripts

sed -i -e 's#./dist/client/extension#./index#' package.json
../../node_modules/.bin/vsce package --yarn --out ngls.vsix
../../node_modules/.bin/vsce package

popd

0 comments on commit 85f8212

Please sign in to comment.