From 05f1eb4103b866f59caf12f07a52f418c220b3db Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Thu, 21 Nov 2024 10:58:32 -0500 Subject: [PATCH 1/2] Fix CLI package pointing to Zowe Artifactory Signed-off-by: Timothy Johnson --- scripts/repackage_tar.sh | 1 + scripts/rewrite-shrinkwrap.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/repackage_tar.sh b/scripts/repackage_tar.sh index a04b2da..aab59ae 100755 --- a/scripts/repackage_tar.sh +++ b/scripts/repackage_tar.sh @@ -9,6 +9,7 @@ # Copyright Contributors to the Zowe Project. # ### +set -e die () { echo "$@" diff --git a/scripts/rewrite-shrinkwrap.js b/scripts/rewrite-shrinkwrap.js index c57b488..421d78c 100644 --- a/scripts/rewrite-shrinkwrap.js +++ b/scripts/rewrite-shrinkwrap.js @@ -17,7 +17,7 @@ const data = require(_path); (async () => { const filterPkgs = async (obj, key) => { const _obj = {}; - for (const pkg of Object.keys(obj[key])) { + for (const pkg of Object.keys(obj[key] || {})) { if (obj[key][pkg].dev) continue; if (obj[key][pkg].peer) continue; if (obj[key][pkg].extraneous) continue; From 63f22425a929e0e9e0575749a35414fc3c58d462 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Thu, 21 Nov 2024 11:15:13 -0500 Subject: [PATCH 2/2] Assert that zowe.jfrog.io is removed from shrinkwrap Signed-off-by: Timothy Johnson --- scripts/repackage_tar.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/repackage_tar.sh b/scripts/repackage_tar.sh index aab59ae..0e16ace 100755 --- a/scripts/repackage_tar.sh +++ b/scripts/repackage_tar.sh @@ -47,7 +47,7 @@ npmDeps=`node -e "package = require('./package.json'); Object.entries(package.peerDependencies || {}).forEach(([name, version]) => console.log(name + '@' + version));"` for pkgSpec in $npmDeps; do echo "Validating dependency $pkgSpec..." - npm view $pkgSpec || exit 1 + npm view $pkgSpec || die "Validation of $pkgSpec failed" done # Update npm-shrinkwrap.json if necessary @@ -57,6 +57,7 @@ if [ -e "npm-shrinkwrap.json" ]; then # Rewrite the shrinkwrap file with only production dependencies and public npm resolved URLs node "../../scripts/rewrite-shrinkwrap.js" + (! grep -q zowe.jfrog.io npm-shrinkwrap.json) || die "Private registry found in shrinkwrap file" fi npm pack