diff --git a/boxes/token/README.md b/boxes/token/README.md index b4b38457432..8c9189ca67e 100644 --- a/boxes/token/README.md +++ b/boxes/token/README.md @@ -2,7 +2,7 @@ This is a minimal [Aztec](https://aztec.network/) Noir smart contract and frontend bootstrapped with [`aztec-cli unbox`](https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/cli). It is recommended you use the `aztec-cli unbox PrivateToken` command so that the repository is copied with needed modifications from the monorepo subpackage. -Some contract specific settings for `PrivateToken` are in a [config](src/config.ts) will require manual updates depending on your changes to the source code. `aztec-cli` can be installed with `npm i -g @aztec/cli`, if you don't have it already. +Some contract specific settings for `PrivateToken` are in a [config](src/config.ts) will require manual updates depending on your changes to the source code. ## Setup diff --git a/yarn-project/cli/aztec-cli b/yarn-project/cli/aztec-cli deleted file mode 100755 index 9f4ec5f3850..00000000000 --- a/yarn-project/cli/aztec-cli +++ /dev/null @@ -1,163 +0,0 @@ -#!/usr/bin/env bash - -# Wrapper script around @aztec/cli using Docker. This is intended to be used by devs that don't have -# a NodeJS environment setup locally. The script starts a Docker container passing any commands and -# arguments to the CLI running inside the container. -# If this wrapper script detects a global install of @aztec/cli it falls back on that instead of Docker. - -set -euo pipefail - -# use node.js aztec-cli if available -# check local node_modules (e.g. @aztec/cli is a dependency in current package.json) -# this doesn't check node_modules hierarchy -if [[ -f "$PWD/node_modules/.bin/aztec-cli" ]]; then - "$PWD/node_modules/.bin/aztec-cli" $@ - exit 0 -elif command -v npm &> /dev/null; then - # next look for a global install - # e.g. if user has run `npm install -g @aztec/cli` after playing with the cli in dockerized form - GLOBAL_NPM_BIN_DIR=$(npm --global prefix)/bin - if [[ -f "$GLOBAL_NPM_BIN_DIR/aztec-cli" ]]; then - "$GLOBAL_NPM_BIN_DIR/aztec-cli" $@ - exit 0 - fi -elif command -v yarn &> /dev/null; then - YARN_VER=$(yarn --version) - if [[ "$YARN_VER" =~ ^1\..* ]]; then - GLOBAL_YARN_BIN_DIR=$(yarn --global bin) - if [[ -f "$GLOBAL_YARN_BIN_DIR/aztec-cli" ]]; then - "$GLOBAL_YARN_BIN_DIR/aztec-cli" $@ - exit 0 - fi - fi -fi - -# fallback on docker - -CLI_IMAGE=${CLI_IMAGE:-"aztecprotocol/cli"} -CLI_VERSION=${CLI_VERSION:-"latest"} - -DOCKER_PATH="" - -# any host bindings we might send to the container -DOCKER_HOST="" - -# env vars to pass to the container -DOCKER_ENV="" - -# volumes to pass to the container -DOCKER_VOLUME="" - -# assume the sandbox is running on listening on the host interface -# unless something else was passed through -DEFAULT_PXE_URL="http://host.docker.internal:8080" -PXE_URL=${PXE_URL:-$DEFAULT_PXE_URL} - -# need to know if we're running on macOS or Linux -UNAME=$(uname -s) - -if command -v podman &> /dev/null; then - DOCKER_PATH="podman" -elif command -v docker &> /dev/null; then - DOCKER_PATH="docker" -else - echo "No docker or podman found" - exit 1 -fi - -# set up host.docker.internal alias on Linux, just like it is on mac -if [[ "$UNAME" == "Linux" && "$PXE_URL" == "$DEFAULT_PXE_URL" ]]; then - DOCKER_HOST="$DOCKER_HOST --add-host host.docker.internal:host-gateway" -fi - -# Build a list of mount points -function add_mount() { - DIR="$1" - - # grab its dirname if its a file - # e.g. passing the file path to a JSON artifact - if [[ -f "$DIR" ]]; then - DIR=$(dirname "$DIR") - fi - - if [[ ! -d "$DIR" ]]; then - return - fi - - # check if it's already been added - REALDIR=$(realpath $DIR) - if [[ "$DOCKER_VOLUME" =~ "$REALDIR:" ]]; then - return - fi - - DOCKER_VOLUME="$DOCKER_VOLUME -v $REALDIR:$REALDIR" -} - -# we need to look at which command was run in order to set up mount points -AZTEC_CLI_COMMAND="$1" -AZTEC_CLI_EXTRA_ARGS="" - -# aztec-cli unbox Token my_token_contract -# if my_token_contract is missing then pass current folder -if [[ "$AZTEC_CLI_COMMAND" == "unbox" ]]; then - # 2nd parameter is the contract name - # 3rd is the directory to unbox in - # this directory might not exist - DIR="${3:-$PWD}" - - if [[ ! -d "$DIR" ]]; then - mkdir -p "$DIR" - fi - - add_mount "$DIR" -fi - -if [[ "$AZTEC_CLI_COMMAND" == "update" ]]; then - # update command defaults to current directory - add_mount "$PWD" -fi - -# bash's builtin getops only works with single character flags -# GNU getopt doesn't exist on macOS -# process the flags manually -# -# go through each parameter (except the first one, which is the command) -# and check if it's either a filename or a directory. If it is then mount inside the container -# NOTE: this won't work with assignement-style flags, e.g. --outdir=/foo -for (( i=2; i <= "$#"; i++ )); do - arg_value=${!i} - if [[ -f "$arg_value" || -d "$arg_value" ]]; then - add_mount "$arg_value" - fi -done - -if [[ "$AZTEC_CLI_COMMAND" == "compile" ]]; then - # can't use Nargo inside the container - AZTEC_CLI_EXTRA_ARGS="$AZTEC_CLI_EXTRA_ARGS --compiler wasm" -fi - -DOCKER_ENV="$DOCKER_ENV -e PXE_URL=$PXE_URL" - -# pass along any private keys -if [[ ! -z "${PRIVATE_KEY:-}" ]]; then - DOCKER_ENV="$DOCKER_ENV -e PRIVATE_KEY=$PRIVATE_KEY" -fi - -# pass along the debug variable in case the dev wants to see what's happening inside the CLI -if [[ ! -z "${DEBUG:-}" ]]; then - DOCKER_ENV="$DOCKER_ENV -e DEBUG=$DEBUG" -fi - -COMPILER_CACHE="$HOME/.aztec/cache" -mkdir -p "$COMPILER_CACHE" -DOCKER_VOLUME="$DOCKER_VOLUME -v $COMPILER_CACHE:/cache" -DOCKER_ENV="$DOCKER_ENV -e XDG_CACHE_HOME=/cache" - -$DOCKER_PATH run \ - --rm \ - --user $(id -u):$(id -g) \ - --workdir "$PWD" \ - $DOCKER_HOST \ - $DOCKER_ENV \ - $DOCKER_VOLUME \ - $CLI_IMAGE:$CLI_VERSION $@ $AZTEC_CLI_EXTRA_ARGS diff --git a/yarn-project/cli/aztec-cli-dev b/yarn-project/cli/aztec-cli-dev deleted file mode 100755 index 1b2ed75dabc..00000000000 --- a/yarn-project/cli/aztec-cli-dev +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -# Add a symlink to this somewhere in your path. -# Now you can run aztec-cli-dev anywhere to execute latest code, no 'yarn build' required. -SCRIPT_PATH=$(dirname $(realpath $0)) -(cd $SCRIPT_PATH && yarn tsc -b) -node --no-warnings $SCRIPT_PATH/dest/bin/index.js $@ diff --git a/yarn-project/cli/src/update/npm.ts b/yarn-project/cli/src/update/npm.ts index 703dc29219f..ae085e6dfe7 100644 --- a/yarn-project/cli/src/update/npm.ts +++ b/yarn-project/cli/src/update/npm.ts @@ -9,7 +9,7 @@ import { SemVer, parse } from 'semver'; import { atomicUpdateFile } from '../utils.js'; import { DependencyChanges } from './common.js'; -const deprecatedNpmPackages = new Set([]); +const deprecatedNpmPackages = new Set(['@aztec/cli', '@aztec/aztec-sandbox']); const npmDeprecationMessage = ` The following packages have been deprecated and will no longer be updated on the npm registry: ${Array.from(deprecatedNpmPackages) diff --git a/yarn-project/deploy_npm.sh b/yarn-project/deploy_npm.sh index 68b1812195a..1db107eb1a4 100755 --- a/yarn-project/deploy_npm.sh +++ b/yarn-project/deploy_npm.sh @@ -88,7 +88,6 @@ deploy_package l1-artifacts deploy_package ethereum deploy_package noir-compiler deploy_package noir-contracts -deploy_package cli deploy_package merkle-tree deploy_package noir-protocol-circuits deploy_package acir-simulator @@ -99,4 +98,3 @@ deploy_package p2p deploy_package world-state deploy_package sequencer-client deploy_package aztec-node -deploy_package aztec-sandbox