Skip to content
Merged
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
4 changes: 3 additions & 1 deletion cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ and pnpm fails minutes later with `ERR_PNPM_TARBALL_INTEGRITY`, then

`BE_NPM_CHECK` closes that gap. After the auth, it asks the registry for every
`@beplus` dependency of the packages you name (`dependencies`,
`devDependencies`, `optionalDependencies`; `workspace:` ones are skipped) —
`devDependencies`, `optionalDependencies`; `workspace:` ones are skipped, and an
npm alias such as `"@beplus/docs-legacy": "npm:@beplus/docs@0.4.2"` is asked for
as the package after `npm:`) —
through the registry Rush hands pnpm (`common/config/rush/.npmrc`), else npm's
own — and fails the step unless each comes back as a real package, naming the
cause: the stub (no token, or a refused one), or npm's own error (a 404 for a
Expand Down
13 changes: 9 additions & 4 deletions cli/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,11 @@ runs:
[ "$registry" != undefined ] || registry="npm's default registry (nothing maps @beplus)"
fi

# Each package's direct @beplus dependencies. A workspace project is
# built, not fetched.
# Each package's direct @beplus dependencies, by the package the registry
# serves: an npm alias (`"@beplus/docs-legacy": "npm:@beplus/docs@0.4.2"`)
# is fetched as the package after `npm:`, so that is the one to ask for,
# and an alias to a package outside @beplus is not ours to check. A
# workspace project is built, not fetched.
deps=""
for dir in $CHECK; do
if [ ! -f "$dir/package.json" ]; then
Expand All @@ -216,8 +219,10 @@ runs:
deps+="$(jq -r '
[.dependencies, .devDependencies, .optionalDependencies]
| map(objects | to_entries[]) | .[]
| select((.key | startswith("@beplus/")) and ((.value | tostring) | startswith("workspace:") | not))
| .key' "$dir/package.json")"$'\n'
| (.value | tostring) as $spec
| select($spec | startswith("workspace:") | not)
| (if ($spec | startswith("npm:")) then ($spec | capture("^npm:(?<name>@?[^@]+)").name) else .key end)
| select(startswith("@beplus/"))' "$dir/package.json")"$'\n'
done
mapfile -t wanted < <(printf '%s' "$deps" | sed '/^$/d' | sort -u)
if [ "${#wanted[@]}" -eq 0 ]; then
Expand Down
Loading