chore(script): list latest package versions from registry
This commit is contained in:
@@ -25,6 +25,7 @@
|
|||||||
"release:patch": "release-it patch",
|
"release:patch": "release-it patch",
|
||||||
"pretest": "pnpm build",
|
"pretest": "pnpm build",
|
||||||
"reinstall": "./scripts/reinstall.sh",
|
"reinstall": "./scripts/reinstall.sh",
|
||||||
|
"release:list:beta": "./scripts/list_published_packages.sh beta",
|
||||||
"test": "pnpm test:int && pnpm test:components && pnpm test:e2e",
|
"test": "pnpm test:int && pnpm test:components && pnpm test:e2e",
|
||||||
"test:components": "cross-env jest --config=jest.components.config.js",
|
"test:components": "cross-env jest --config=jest.components.config.js",
|
||||||
"test:e2e": "npx playwright install --with-deps && ts-node -T ./test/runE2E.ts",
|
"test:e2e": "npx playwright install --with-deps && ts-node -T ./test/runE2E.ts",
|
||||||
|
|||||||
29
scripts/list_published_packages.sh
Executable file
29
scripts/list_published_packages.sh
Executable file
@@ -0,0 +1,29 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# List all published packages
|
||||||
|
|
||||||
|
# parse params: tag=beta or blank string ''
|
||||||
|
tag=${1:-}
|
||||||
|
|
||||||
|
echo
|
||||||
|
|
||||||
|
if [ -n "$tag" ]; then
|
||||||
|
echo "Listing packages with tag: $tag"
|
||||||
|
tag="@$tag"
|
||||||
|
else
|
||||||
|
echo "Listing latest packages"
|
||||||
|
tag=""
|
||||||
|
fi
|
||||||
|
echo
|
||||||
|
|
||||||
|
packages=$(find packages -name package.json -type f -exec grep -L '"private": true' {} \; | xargs jq -r '.name')
|
||||||
|
|
||||||
|
# sort alphabetically
|
||||||
|
packages=$(echo "$packages" | tr ' ' '\n' | sort -u | tr '\n' ' ')
|
||||||
|
|
||||||
|
# Loop through each package and print the name and version. Print as table
|
||||||
|
|
||||||
|
for package in $packages; do
|
||||||
|
version=$(npm view "$package""$tag" version 2> /dev/null || echo "N/A")
|
||||||
|
printf "%-30s %s\n" "$package" "$version"
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user