Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions aztec-up/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ function build {
echo

# Create Verdaccio config.
# publish.allow_offline lets verdaccio accept publishes when the npmjs
# uplink is briefly unreachable, instead of returning 503. We never want
# the upstream existence check to gate these local fake-publishes.
cat > /tmp/verdaccio-config.yaml <<EOF
storage: $PWD/verdaccio-storage
max_body_size: 1000mb
Expand All @@ -25,6 +28,9 @@ uplinks:
npmjs:
url: https://registry.npmjs.org/

publish:
allow_offline: true

packages:
"@*/*":
access: \$all
Expand Down
30 changes: 27 additions & 3 deletions docs/examples/ts/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,20 @@
# Reads a config.yaml via yq and classifies each dependency entry into one of
# three global arrays:
# AZTEC_DEPS — @aztec/* packages resolved to pkg@link:<repo_root>/yarn-project/<name>
# Exceptions (not published locally) are routed to NPM_DEPS:
# - @aztec/viem (third-party fork pulled from npm)
# EXPLICIT_LINK_DEPS — link: packages resolved to pkg@link:<repo_root>/<path>
# NPM_DEPS — npm: packages (bare names, e.g. viem)
#
# Also sets PARSED_DEPS_FOUND to "true" if any dependency was found, "false" otherwise.

# @aztec/* packages that live on npm rather than in yarn-project/.
# When one of these appears bare (e.g. "@aztec/viem"), treat it as an npm dep
# instead of trying to link it from yarn-project/<name>.
AZTEC_NPM_EXCEPTIONS=(
"@aztec/viem"
)

parse_dependencies() {
local config_file=$1
local repo_root=$2
Expand Down Expand Up @@ -43,9 +53,23 @@ parse_dependencies() {
local link_path="${link_spec#*:}"
EXPLICIT_LINK_DEPS+=("${link_pkg_name}@link:${repo_root}/${link_path}")
elif [[ "$pkg" =~ ^@ ]]; then
# @aztec/* package - auto-link from yarn-project/
local pkg_name="${pkg#@aztec/}"
AZTEC_DEPS+=("${pkg}@link:${repo_root}/yarn-project/${pkg_name}")
# Exception list: some @aztec/* packages live on npm, not in yarn-project/.
local is_npm_exception=false
local exc
for exc in "${AZTEC_NPM_EXCEPTIONS[@]}"; do
if [ "$pkg" = "$exc" ]; then
is_npm_exception=true
break
fi
done

if [ "$is_npm_exception" = true ]; then
NPM_DEPS+=("$pkg")
else
# @aztec/* package - auto-link from yarn-project/
local pkg_name="${pkg#@aztec/}"
AZTEC_DEPS+=("${pkg}@link:${repo_root}/yarn-project/${pkg_name}")
fi
else
echo "Warning: Unknown dependency format '$pkg' (use '@aztec/pkg', 'link:pkg:path', or 'npm:pkg')" >&2
fi
Expand Down
Loading