diff --git a/package.json b/package.json index a1418c67b..8505611d2 100644 --- a/package.json +++ b/package.json @@ -47,8 +47,7 @@ "authenticate-e2e-profile": "source scripts/cloud-utils.sh && authenticateWithE2EProfile", "extract-dependency-licenses": "./scripts/extract-dependency-licenses.sh", "verify-dependency-licenses-extract": "yarn extract-dependency-licenses && ./scripts/verify-dependency-licenses.sh", - "deprecate": "ts-node scripts/deprecate_release.ts", - "postinstall": "./scripts/postinstall.sh" + "deprecate": "ts-node scripts/deprecate_release.ts" }, "bugs": { "url": "https://github.com/aws-amplify/amplify-codegen/issues" diff --git a/scripts/postinstall.sh b/scripts/create-private-package-manifest.sh similarity index 60% rename from scripts/postinstall.sh rename to scripts/create-private-package-manifest.sh index c77951130..65fa57533 100755 --- a/scripts/postinstall.sh +++ b/scripts/create-private-package-manifest.sh @@ -1,5 +1,11 @@ #!/bin/bash +# set exit on error to true +set -e + +# create a new file to store the private packages +# this will be imported and used in the Git Client to determine the packages to deprecate + echo 'export default [' > scripts/components/private_packages.ts grep -l packages/*/package.json -e '"private": "\?true"\?' | xargs cat | jq .name | tr -s '\n' ',' >> scripts/components/private_packages.ts echo '];' >> scripts/components/private_packages.ts diff --git a/shared-scripts.sh b/shared-scripts.sh index f024f69fd..8334b778d 100644 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -475,6 +475,10 @@ function _deploy { function _deprecate { loadCacheFromLinuxBuildJob echo "Deprecate" + + echo "creating private package manifest" + ./scripts/create-private-package-manifest.sh + echo "Authenticate with NPM" if [ "$USE_NPM_REGISTRY" == "true" ]; then PUBLISH_TOKEN=$(echo "$NPM_PUBLISH_TOKEN" | jq -r '.token')