diff --git a/package.json b/package.json index 64b1ad473..99f40c54c 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "release:patch": "release-it patch", "pretest": "pnpm build", "reinstall": "./scripts/reinstall.sh", + "release:list:beta": "./scripts/list_published_packages.sh beta", "test": "pnpm test:int && pnpm test:components && pnpm test:e2e", "test:components": "cross-env jest --config=jest.components.config.js", "test:e2e": "npx playwright install --with-deps && ts-node -T ./test/runE2E.ts", diff --git a/scripts/list_published_packages.sh b/scripts/list_published_packages.sh new file mode 100755 index 000000000..ad8832630 --- /dev/null +++ b/scripts/list_published_packages.sh @@ -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