nodejs-packaging-bundler: recursively bundle modules for all packages found
This commit is contained in:
parent
3c8da6aa4e
commit
53057fc311
@ -64,15 +64,20 @@ else
|
||||
fi
|
||||
tar xfz *.tgz
|
||||
cd package
|
||||
echo " Downloading prod dependencies"
|
||||
npm install --no-optional --only=prod
|
||||
if [ $? -ge 1 ] ; then
|
||||
echo " ERROR WILL ROBINSON"
|
||||
for packagejson in $(find . -type d -name node_modules\* -prune -o -type f -name package.json -print); do
|
||||
pushd $(dirname $packagejson)
|
||||
echo " Downloading prod dependencies"
|
||||
npm install --no-optional --only=prod
|
||||
if [ $? -ge 1 ] ; then
|
||||
echo " ERROR WILL ROBINSON"
|
||||
rm -rf node_modules
|
||||
else
|
||||
echo " Successful prod dependencies download"
|
||||
else
|
||||
echo " Successful prod dependencies download"
|
||||
mv node_modules/ node_modules_prod
|
||||
fi
|
||||
fi
|
||||
popd
|
||||
done
|
||||
|
||||
echo "LICENSES IN BUNDLE:"
|
||||
find . -name "package.json" -exec jq '.license | strings' {} \; >> ${TMP_DIR}/${PACKAGE_SAFE}-${VERSION}-bundled-licenses.txt
|
||||
find . -name "package.json" -exec jq '.license | objects | .type' {} \; >> ${TMP_DIR}/${PACKAGE_SAFE}-${VERSION}-bundled-licenses.txt 2>/dev/null
|
||||
@ -89,19 +94,23 @@ if [ -s ${TMP_DIR}/nolicense.txt ]; then
|
||||
fi
|
||||
|
||||
|
||||
echo " Downloading dev dependencies"
|
||||
npm install --no-optional --only=dev
|
||||
if [ $? -ge 1 ] ; then
|
||||
echo " ERROR WILL ROBINSON"
|
||||
else
|
||||
echo " Successful dev dependencies download"
|
||||
for packagejson in $(find . -type d -name node_modules\* -prune -o -type f -name package.json -print); do
|
||||
pushd $(dirname $packagejson)
|
||||
echo " Downloading dev dependencies"
|
||||
npm install --no-optional --only=dev
|
||||
if [ $? -ge 1 ] ; then
|
||||
echo " ERROR WILL ROBINSON"
|
||||
else
|
||||
echo " Successful dev dependencies download"
|
||||
mv node_modules/ node_modules_dev
|
||||
fi
|
||||
fi
|
||||
popd
|
||||
done
|
||||
if [ -d node_modules_prod ] ; then
|
||||
tar cfz ../${PACKAGE_SAFE}-${VERSION}-nm-prod.tgz node_modules_prod
|
||||
tar cfz ../${PACKAGE_SAFE}-${VERSION}-nm-prod.tgz $(find . -type d -name node_modules_prod)
|
||||
fi
|
||||
if [ -d node_modules_dev ] ; then
|
||||
tar cfz ../${PACKAGE_SAFE}-${VERSION}-nm-dev.tgz node_modules_dev
|
||||
tar cfz ../${PACKAGE_SAFE}-${VERSION}-nm-dev.tgz $(find . -type d -name node_modules_dev)
|
||||
fi
|
||||
cd ..
|
||||
cp -v ${PACKAGE_SAFE}-${VERSION}* "${OUTPUT_DIR}"
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
Name: nodejs-packaging
|
||||
Version: 2021.06
|
||||
Release: 6%{?dist}
|
||||
Release: 7%{?dist}
|
||||
Summary: RPM Macros and Utilities for Node.js Packaging
|
||||
BuildArch: noarch
|
||||
License: MIT
|
||||
@ -84,6 +84,9 @@ install -Dpm0755 nodejs-packaging-bundler %{buildroot}%{_bindir}/nodejs-packagin
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Oct 18 2022 Davide Cavalca <dcavalca@fedoraproject.org> - 2021.06-7
|
||||
- NPM bundler: recursively bundle modules for all packages found
|
||||
|
||||
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2021.06-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user