2023-04-18 16:19:37 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# This script is used to validate the npm packages that are published to npmjs.org are in the correct format.
|
|
|
|
# It won't catch things like malformed JS or Types but it will assert that the package has
|
|
|
|
# the correct files and package.json properties.
|
|
|
|
ARTIFACTS_DIR="./npm-artifacts"
|
|
|
|
|
|
|
|
for file in "$ARTIFACTS_DIR"/*.tgz; do
|
|
|
|
echo "🔍 Checking NPM package: $file"
|
2024-10-31 21:29:21 +08:00
|
|
|
|
|
|
|
# Ignore named-exports for now as builds aren't compatible yet.
|
2025-06-11 17:05:42 +08:00
|
|
|
yarn attw "$file" --ignore-rules "named-exports"
|
|
|
|
yarn publint "$file"
|
2023-04-18 16:19:37 +08:00
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "🚀 All NPM package checks passed! 🚀"
|
|
|
|
exit 0
|