jsii-release 0.3.9 → 0.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -86,6 +86,8 @@ npx publib-npm [DIR]
86
86
  | `AWS_SECRET_ACCESS_KEY` | Optional | Secret access key that belongs to the AWS access key. |
87
87
  | `AWS_ROLE_TO_ASSUME` | Optional | If AWS CodeArtifact is used as registry, an AWS role ARN to assume before authorizing. |
88
88
  | `DISABLE_HTTPS` | Optional | Connect to the registry with HTTP instead of HTTPS (defaults to false). |
89
+ | `VERIFY_PUBLISHED` | Optional | If "true", wait until every published version is available from the registry before exiting. Use this when packages that depend on the published ones are published next. |
90
+ | `VERIFY_PUBLISHED_TIMEOUT_SECONDS` | Optional | How long to wait, in seconds, for the published versions to be available when `VERIFY_PUBLISHED` is set (defaults to 3600). Fails if they are not available in time. |
89
91
 
90
92
  ## Maven
91
93
 
package/bin/publib-npm CHANGED
@@ -16,6 +16,8 @@ set -eu
16
16
  # AWS_SECRET_ACCESS_KEY (optional): Secret access key that belongs to the AWS access key.
17
17
  # AWS_ROLE_TO_ASSUME (optional): If AWS CodeArtifact is used as registry and need to assume role.
18
18
  # DISABLE_HTTPS (optional): connect to the registry with HTTP instead of HTTPS (defaults to false)
19
+ # VERIFY_PUBLISHED (optional): if "true", wait until every published version is available from the registry
20
+ # VERIFY_PUBLISHED_TIMEOUT_SECONDS (optional): seconds to wait for the published versions to be available (defaults to 3600)
19
21
  #
20
22
  ###
21
23
 
@@ -81,6 +83,13 @@ if [ -n "${NPM_ACCESS_LEVEL:-}" ]; then
81
83
  echo "Publishing package with access level: ${NPM_ACCESS_LEVEL}"
82
84
  fi
83
85
 
86
+ # verification timeout
87
+ verify_timeout_seconds="${VERIFY_PUBLISHED_TIMEOUT_SECONDS:-3600}"
88
+ if ! [[ "${verify_timeout_seconds}" =~ ^[0-9]+$ ]]; then
89
+ echo "Invalid VERIFY_PUBLISHED_TIMEOUT_SECONDS: ${verify_timeout_seconds}. Must be a number of seconds"
90
+ exit 1
91
+ fi
92
+
84
93
  log=$(mktemp -d)/npmlog.txt
85
94
 
86
95
  # Check for dry run
@@ -116,4 +125,25 @@ for file in ${dir}/**.tgz; do
116
125
  fi
117
126
  done
118
127
 
128
+ # The registry may not serve a version right after it was published (npmjs scans packages first,
129
+ # and larger packages take longer). Wait until it does, so that packages depending on it can be installed.
130
+ if [ "${VERIFY_PUBLISHED:-}" = "true" ]; then
131
+ deadline_seconds=$((SECONDS + verify_timeout_seconds))
132
+
133
+ for file in ${dir}/**.tgz; do
134
+ pkgdir=$(mktemp -d)
135
+ tar -xzf ${file} -C ${pkgdir} package/package.json
136
+ spec=$(node -p 'const p = require(process.argv[1]); `${p.name}@${p.version}`' ${pkgdir}/package/package.json)
137
+ until npm view ${spec} version --prefer-online > /dev/null 2>&1; do
138
+ if [ ${SECONDS} -ge ${deadline_seconds} ]; then
139
+ echo "ERROR: ${spec} is not available after ${verify_timeout_seconds} seconds"
140
+ exit 1
141
+ fi
142
+ echo "Waiting for ${spec} to be available..."
143
+ sleep 20
144
+ done
145
+ echo "${spec} is available"
146
+ done
147
+ fi
148
+
119
149
  echo "SUCCESS"
package/package.json CHANGED
@@ -56,7 +56,7 @@
56
56
  "organization": true
57
57
  },
58
58
  "devDependencies": {
59
- "@aws-sdk/client-sts": "^3.1152.0",
59
+ "@aws-sdk/client-sts": "^3.1156.0",
60
60
  "@smithy/types": "^4.19.0",
61
61
  "@stylistic/eslint-plugin": "^2",
62
62
  "@types/fs-extra": "^8.1.5",
@@ -79,8 +79,8 @@
79
79
  "typescript": "~6.0"
80
80
  },
81
81
  "dependencies": {
82
- "@aws-sdk/client-codeartifact": "^3.1152.0",
83
- "@aws-sdk/credential-providers": "^3.1152.0",
82
+ "@aws-sdk/client-codeartifact": "^3.1156.0",
83
+ "@aws-sdk/credential-providers": "^3.1156.0",
84
84
  "fs-extra": "^8.1.0",
85
85
  "p-queue": "6",
86
86
  "shlex": "^2.1.2",
@@ -99,7 +99,7 @@
99
99
  "publishConfig": {
100
100
  "access": "public"
101
101
  },
102
- "version": "0.3.9",
102
+ "version": "0.3.11",
103
103
  "jest": {
104
104
  "coverageProvider": "v8",
105
105
  "testMatch": [
package/package.json.bak CHANGED
@@ -56,7 +56,7 @@
56
56
  "organization": true
57
57
  },
58
58
  "devDependencies": {
59
- "@aws-sdk/client-sts": "^3.1152.0",
59
+ "@aws-sdk/client-sts": "^3.1156.0",
60
60
  "@smithy/types": "^4.19.0",
61
61
  "@stylistic/eslint-plugin": "^2",
62
62
  "@types/fs-extra": "^8.1.5",
@@ -79,8 +79,8 @@
79
79
  "typescript": "~6.0"
80
80
  },
81
81
  "dependencies": {
82
- "@aws-sdk/client-codeartifact": "^3.1152.0",
83
- "@aws-sdk/credential-providers": "^3.1152.0",
82
+ "@aws-sdk/client-codeartifact": "^3.1156.0",
83
+ "@aws-sdk/credential-providers": "^3.1156.0",
84
84
  "fs-extra": "^8.1.0",
85
85
  "p-queue": "6",
86
86
  "shlex": "^2.1.2",
@@ -99,7 +99,7 @@
99
99
  "publishConfig": {
100
100
  "access": "public"
101
101
  },
102
- "version": "0.3.9",
102
+ "version": "0.3.11",
103
103
  "jest": {
104
104
  "coverageProvider": "v8",
105
105
  "testMatch": [