Skip to content

Commit

Permalink
build: update replace-packages for npm build
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Apr 26, 2024
1 parent b8140f3 commit d4ec8b0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/replace-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@ DSTDIR=${2-$PWD/node_modules}
pushd "$SRCDIR"
yarn install
yarn build
# use yarn to ensure these run in topological order
yarn lerna run prepack
npm query .workspace | jq -r '.[].location' | while read -r dir; do
# Skip private packages.
test "$(jq .private < "$dir/package.json")" != true || continue

# Create the tarball.
pushd "$dir"
name=$(jq -r .name < package.json)
stem=$(echo "$name" | sed -e 's!^@!!; s!/!-!g;')
rm -f "${stem}"-*.tgz
rm -f package.tgz
yarn pack
tar -xvf "${stem}"-*.tgz
tar -xvf package.tgz

# Replace the destination package.
rm -rf "${DSTDIR:?}/$name"
Expand Down

0 comments on commit d4ec8b0

Please sign in to comment.