Skip to content

Commit

Permalink
build: cut-over dist/npm to bazel built artifacts (#1776)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan committed Oct 18, 2022
1 parent 4007657 commit f5f7bb1
Showing 1 changed file with 4 additions and 48 deletions.
52 changes: 4 additions & 48 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,51 +40,7 @@ yarn install
# Build the npm package with bazel
yarn bazel build //:npm

# Copy the bazel built package to dist/npm_bazel
# TODO: copy to dist/npm when ready to cut-over
mkdir -p dist/npm_bazel
cp -r bazel-bin/npm/ dist/npm_bazel
chmod -R +w dist/npm_bazel

################################################################################
#### LEGACY PRE-BAZEL BUILD --- can be removed after cut-over
################################################################################

# Enable extended pattern matching features
shopt -s extglob

# Clean up from last build
rm -rf **/*.tsbuildinfo

# Build the client and server
yarn run compile

# install npm packages in the pinned v12
pushd v12_language_service
yarn install
popd

# Copy files to package root
cp package.json angular.png CHANGELOG.md README.md dist/npm
# Copy files to server directory
cp -r server/package.json server/README.md server/bin dist/npm/server
cp -r v12_language_service dist/npm/v12_language_service
# Build and copy files to syntaxes directory
yarn run build:syntaxes
mkdir dist/npm/syntaxes
# Copy all json files in syntaxes/ except tsconfig.json
cp syntaxes/!(tsconfig).json dist/npm/syntaxes

pushd dist/npm
# TODO(kyliau): vsce does not bundle nested node_modules due to bug
# https://github.com/microsoft/vscode-vsce/issues/432 so install using NPM for now.
# Note: We also use `--force` as NPM incorrectly checks the dev dependencies even
# though we have limited the install to production-only dependencies. We know that
# our versions are compatible from the Yarn install, so it's acceptable to force proceed
# on peer dependency conflicts (like `tslint@6` not being supported by `tslint-eslint-rules`).
npm install --production --ignore-scripts --force

sed -i -e 's#./dist/client/src/extension#./index#' package.json
../../node_modules/.bin/vsce package

popd
# Copy the bazel built package to dist/npm
mkdir -p dist/npm
cp -r bazel-bin/npm/ dist/npm
chmod -R +w dist/npm

0 comments on commit f5f7bb1

Please sign in to comment.