mirror of
https://github.com/grafana/grafana.git
synced 2026-04-27 17:27:15 -04:00
* fix(grafana-data): copy theme schema json to types so declaration resolves * refactor(grafana-data): move node scripts out of source code * feat(grafana-data): generate types for theme schema * chore(codeowners): update for grafana-data/scripts file move * feat(grafana-data): put back copy plugin for theme json files * revert(grafana-data): remove definition output * feat(grafana-data): make builds great again * minor tidy up --------- Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
38 lines
1.1 KiB
Bash
Executable file
38 lines
1.1 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
# 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"
|
|
|
|
failed_checks=()
|
|
|
|
for file in "$ARTIFACTS_DIR"/*.tgz; do
|
|
echo "🔍 Checking NPM package: $file"
|
|
|
|
# If you need to debug ATTW issues, pass "--format json" to get verbose output.
|
|
if ! NODE_OPTIONS="-C @grafana-app/source" yarn attw "$file" --ignore-rules "false-cjs" --profile "node16"; then
|
|
echo "attw check failed for $file"
|
|
echo ""
|
|
failed_checks+=("$file - yarn attw")
|
|
fi
|
|
|
|
if ! yarn publint "$file"; then
|
|
echo "publint check failed for $file"
|
|
echo ""
|
|
failed_checks+=("$file - yarn publint")
|
|
fi
|
|
done
|
|
|
|
if (( ${#failed_checks[@]} > 0 )); then
|
|
echo ""
|
|
echo "❌ The following NPM package checks failed:"
|
|
for check in "${failed_checks[@]}"; do
|
|
echo " - $check"
|
|
done
|
|
exit 1
|
|
fi
|
|
|
|
echo "🚀 All NPM package checks passed! 🚀"
|
|
exit 0
|