Grafana UI: Expose unstable entrypoint (#97080)
* feat(grafana-ui): build unstable entrypoint for experimental components * feat(plugins): expose grafana/ui/unstable * build(grafana-ui): add rollup plugin to create alias package.json for unstable entrypoint * build(packages): rewrite prepare npm script to generate alias packagejson files * chore(packages): use relative paths in publishConfig for exports generation * chore(frontend): move npmcli/package-json package to root package.json * revert(grafana-ui): remove rollup plugin for generating alias package.json files * chore(grafana-ui): clean up unstable directory postpack to prevent yarn lock issues * build(packages): fix scope for pkgName usage * feat(packages): create separate cjs and esm builds that validate with arethetypeswrong cli * chore(yarn): refresh lock file * fix(packages): make sure alias package.jsons point to existing files
This commit is contained in:
@@ -43,14 +43,14 @@ for file in "$ARTIFACTS_DIR"/*.tgz; do
|
||||
fi
|
||||
|
||||
# Assert commonjs builds
|
||||
if [ ! -d dist ] || [ ! -f dist/index.js ] || [ ! -f dist/index.d.ts ]; then
|
||||
if [ ! -d dist ] || [ ! -f dist/cjs/index.cjs ] || [ ! -f dist/cjs/index.d.cts ]; then
|
||||
echo -e "❌ Failed: Missing 'dist' directory or required commonjs files in package $dir_name.\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$(jq -r '.main' package.json)" != "dist/index.js" ] || \
|
||||
[ "$(jq -r '.types' package.json)" != "dist/index.d.ts" ]; then
|
||||
echo -e "❌ Failed: Incorrect package.json properties in package $dir_name.\n"
|
||||
if [ "$(jq -r '.main' package.json)" != "./dist/cjs/index.cjs" ] || \
|
||||
[ "$(jq -r '.types' package.json)" != "./dist/cjs/index.d.cts" ]; then
|
||||
echo -e "❌ Failed: Incorrect cjs package.json properties in package $dir_name.\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -58,13 +58,13 @@ for file in "$ARTIFACTS_DIR"/*.tgz; do
|
||||
esm_packages=("grafana-data" "grafana-ui" "grafana-runtime" "grafana-e2e-selectors" "grafana-schema")
|
||||
for esm_package in "${esm_packages[@]}"; do
|
||||
if [[ "$dir_name" == "$esm_package" ]]; then
|
||||
if [ ! -d dist/esm ] || [ ! -f dist/esm/index.js ]; then
|
||||
if [ ! -d dist/esm ] || [ ! -f dist/esm/index.mjs ]; then
|
||||
echo -e "❌ Failed: Missing 'dist/esm' directory or required esm files in package $dir_name.\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$(jq -r '.module' package.json)" != "dist/esm/index.js" ]; then
|
||||
echo -e "❌ Failed: Incorrect package.json properties in package $dir_name.\n"
|
||||
if [ "$(jq -r '.module' package.json)" != "./dist/esm/index.mjs" ]; then
|
||||
echo -e "❌ Failed: Incorrect esm package.json properties in package $dir_name.\n"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user