mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
[PRODENG-211] update npm bundle check (#9103)
* update js-api bundle check * rework bundle checks
This commit is contained in:
parent
8687e86cf6
commit
4b3e101586
4
.github/actions/npm-check-bundle/action.yml
vendored
4
.github/actions/npm-check-bundle/action.yml
vendored
@ -23,6 +23,4 @@ runs:
|
||||
echo "TAG_NPM not set, aborting"
|
||||
exit 1
|
||||
fi
|
||||
ADF_VERSION=$(npm view @alfresco/adf-core@${TAG_NPM} version)
|
||||
echo "check bundle on TAG_NPM='${TAG_NPM}' and ADF_VERSION='${ADF_VERSION}'"
|
||||
./scripts/github/build/npm-check-bundles.sh -v ${ADF_VERSION}
|
||||
./scripts/github/build/npm-check-bundles.sh
|
||||
|
@ -2,37 +2,15 @@
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
eval VERSION=""
|
||||
|
||||
eval projects=( "adf-core"
|
||||
eval projects=( "js-api"
|
||||
"adf-core"
|
||||
"adf-insights"
|
||||
"adf-content-services"
|
||||
"adf-extensions"
|
||||
"adf-testing"
|
||||
"adf-process-services"
|
||||
"adf-process-services-cloud"
|
||||
"eslint-plugin-eslint-angular"
|
||||
"js-api" )
|
||||
|
||||
show_help() {
|
||||
echo "Usage: npm-check-bundles.sh"
|
||||
echo "-r or -registry to check -r 'http://npm.local.me:8080/' "
|
||||
echo "-v or -version to check -v 1.4.0 "
|
||||
echo ""
|
||||
}
|
||||
|
||||
change_registry() {
|
||||
echo $1
|
||||
npm set registry $1
|
||||
}
|
||||
|
||||
set_npm_registry() {
|
||||
npm set registry https://registry.npmjs.org/
|
||||
}
|
||||
|
||||
version() {
|
||||
VERSION=$1
|
||||
}
|
||||
"eslint-plugin-eslint-angular" )
|
||||
|
||||
error_out() {
|
||||
printf '\033[%sm%s\033[m\n' "$@"
|
||||
@ -43,15 +21,6 @@ error_out() {
|
||||
# bg: 40 black, 41 red, 44 blue, 45 purple
|
||||
}
|
||||
|
||||
while [[ $1 == -* ]]; do
|
||||
case "$1" in
|
||||
-h|--help|-\?) show_help; exit 0;;
|
||||
-r) change_registry $2; shift 2;;
|
||||
-v|--version) version $2; shift 2;;
|
||||
-*) echo "invalid option: $1" 1>&2; show_help; exit 1;;
|
||||
esac
|
||||
done
|
||||
|
||||
rm -rf temp
|
||||
mkdir temp
|
||||
cd temp
|
||||
@ -60,57 +29,67 @@ for PACKAGE in ${projects[@]}
|
||||
do
|
||||
mkdir $PACKAGE
|
||||
cd $PACKAGE
|
||||
npm pack '@alfresco/'$PACKAGE@$VERSION
|
||||
tar zxf 'alfresco-'$PACKAGE-$VERSION.tgz
|
||||
|
||||
PKG_VERSION=$(npm view @alfresco/$PACKAGE@alpha version)
|
||||
echo "Inspecting: $PACKAGE@$PKG_VERSION"
|
||||
|
||||
npm pack '@alfresco/'$PACKAGE@$PKG_VERSION
|
||||
tar zxf 'alfresco-'$PACKAGE-$PKG_VERSION.tgz
|
||||
|
||||
if [ $PACKAGE == 'js-api' ]; then
|
||||
if [ ! -f package/esm2020/'alfresco-js-api.mjs' ]; then
|
||||
error_out '31;1' "esm2020/alfresco-js-api.mjs not found!" >&2
|
||||
exit 1
|
||||
else
|
||||
echo "esm2020: ok"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $PACKAGE == 'adf-testing' ]; then
|
||||
if [ ! -f package/'main.js' ]; then
|
||||
error_out '31;1' "$PACKAGE testing not ok!" >&2
|
||||
error_out '31;1' "$PACKAGE testing: main.js not found!" >&2
|
||||
exit 1
|
||||
else
|
||||
echo "testing ok!"
|
||||
echo "testing: ok"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $PACKAGE == 'adf-core' ]; then
|
||||
if [ ! -f package/lib/prebuilt-themes/'adf-blue-orange.css' ]; then
|
||||
error_out '31;1' "$PACKAGE prebuilt-theme not found!" >&2
|
||||
error_out '31;1' "$PACKAGE prebuilt-theme: adf-blue-orange.css not found!" >&2
|
||||
exit 1
|
||||
else
|
||||
echo "prebuilt-theme ok!"
|
||||
echo "prebuilt-theme: ok"
|
||||
fi
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if [ $PACKAGE != 'adf-testing' ] && [ $PACKAGE != 'eslint-plugin-eslint-angular' ]; then
|
||||
|
||||
if [ $PACKAGE != 'adf-testing' ] && [ $PACKAGE != 'js-api' ] && [ $PACKAGE != 'eslint-plugin-eslint-angular' ]; then
|
||||
if [ ! -f package/fesm2015/$PACKAGE'.mjs' ]; then
|
||||
error_out '31;1' "fesm2015/$PACKAGE.mjs not found!" >&2
|
||||
exit 1
|
||||
else
|
||||
echo "fesm2015 ok!"
|
||||
echo "fesm2015: ok"
|
||||
fi
|
||||
|
||||
if [ ! -f package/esm2020/$PACKAGE'.mjs' ]; then
|
||||
error_out '31;1' "esm2020/$PACKAGE.mjs not found!" >&2
|
||||
exit 1
|
||||
else
|
||||
echo "esm2020 ok!"
|
||||
echo "esm2020: ok"
|
||||
fi
|
||||
|
||||
if [ ! -f package/fesm2020/$PACKAGE'.mjs' ]; then
|
||||
error_out '31;1' "fesm2020/$PACKAGE.mjs not found!" >&2
|
||||
exit 1
|
||||
else
|
||||
echo "fesm2020 ok!"
|
||||
echo "fesm2020: ok"
|
||||
fi
|
||||
|
||||
if [ ! -f package/README.md ]; then
|
||||
error_out '31;1' "$PACKAGE readme not found!" >&2
|
||||
exit 1
|
||||
else
|
||||
echo "readme ok!"
|
||||
echo "readme: ok"
|
||||
fi
|
||||
|
||||
if [ ! -f package/bundles/assets/$PACKAGE/i18n/en.json ]; then
|
||||
@ -123,15 +102,12 @@ if [ $PACKAGE != 'adf-testing' ] && [ $PACKAGE != 'eslint-plugin-eslint-angular'
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "i18n ok!"
|
||||
echo "i18n: ok"
|
||||
fi
|
||||
fi
|
||||
|
||||
cd ..
|
||||
done
|
||||
|
||||
cd ..
|
||||
|
||||
rm -rf temp
|
||||
|
||||
set_npm_registry
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user