Skip to content

Commit

Permalink
fix: remove non-npm packages from end-to-end during canary flow (#2394)
Browse files Browse the repository at this point in the history
To ensure we don't use any pre-built `workspace` dependences, This
script updates canary dependences to the version being released, as well
as removing remaining `@aztec/` packages from package.json
  • Loading branch information
spypsy authored Sep 19, 2023
1 parent fe5eedd commit e3f97f2
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions yarn-project/end-to-end/scripts/setup_canary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,24 @@ done
cd ..

echo "Updating external Aztec dependencies to version $VERSION"

# Packages that are publically available in npm
# TARGET_PKGS=("@aztec/aztec.js" "@aztec/cli" "@aztec/l1-artifacts" "@aztec/noir-contracts")
JSON_TARGET_PKGS=$(printf '%s\n' "${TARGET_PKGS[@]}" | jq -R -s -c 'split("\n") | map(select(. != ""))')

TMP=$(mktemp)
for PKG in "${TARGET_PKGS[@]}"; do
jq --arg v $VERSION ".dependencies[\"$PKG\"] = \$v" package.json > $TMP && mv $TMP package.json
done
jq --arg v $VERSION --argjson target_pkgs "$JSON_TARGET_PKGS" '
.dependencies |= with_entries(
select(
(.key | startswith("@aztec")) as $isAztec |
if $isAztec then
.key as $k | any($target_pkgs[]; . == $k)
else
true
end
) |
if .key as $k | any($target_pkgs[]; . == $k) then
.value = $v
else
.
end
)' package.json > $TMP && mv $TMP package.json

jq ".references = []" tsconfig.json > $TMP && mv $TMP tsconfig.json

0 comments on commit e3f97f2

Please sign in to comment.