[release-12.2.1] NPM: Backport NPM publishing from main (#112000)

* Backport npm publishing workflow from main

* Ignore false-cjs in validate-npm-packages

(cherry picked from commit 6916b39439)
(cherry picked from commit 1aba469bab)

* Ignore untyped-resolutions for grafana-i18n in validate-npm-packages

(cherry picked from commit b250fe8d22)
This commit is contained in:
Josh Hunt
2025-10-06 13:51:48 +01:00
committed by GitHub
parent cda0661803
commit aa00229a8b
2 changed files with 11 additions and 19 deletions
+8 -3
View File
@@ -1,4 +1,5 @@
#!/bin/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
@@ -8,10 +9,14 @@ ARTIFACTS_DIR="./npm-artifacts"
for file in "$ARTIFACTS_DIR"/*.tgz; do
echo "🔍 Checking NPM package: $file"
# Ignore named-exports for now as builds aren't compatible yet.
yarn attw "$file" --ignore-rules "named-exports"
if [[ "$file" == *"@grafana-i18n"* ]]; then
IGNORE_RULES="named-exports false-cjs untyped-resolution"
else
IGNORE_RULES="named-exports false-cjs"
fi
# shellcheck disable=SC2086
yarn attw "$file" --ignore-rules $IGNORE_RULES --profile node16
yarn publint "$file"
done
echo "🚀 All NPM package checks passed! 🚀"