From e3f97f26f016025353851327e24adbb8e752301f Mon Sep 17 00:00:00 2001 From: spypsy Date: Tue, 19 Sep 2023 11:14:29 +0100 Subject: [PATCH] fix: remove non-npm packages from end-to-end during canary flow (#2394) 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 --- .../end-to-end/scripts/setup_canary.sh | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/yarn-project/end-to-end/scripts/setup_canary.sh b/yarn-project/end-to-end/scripts/setup_canary.sh index 6d6806fed08..e7ea1020221 100755 --- a/yarn-project/end-to-end/scripts/setup_canary.sh +++ b/yarn-project/end-to-end/scripts/setup_canary.sh @@ -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