@ankhorage/devtools 1.15.4 → 1.15.6
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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# @ankhorage/devtools
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Shared tooling, repository automation, runtime policies, and agent standards for Ankhorage TypeScript projects
|
|
9
9
|
|
|
@@ -231,12 +231,7 @@ async function loadInstalledZoraPluginMetadata(
|
|
|
231
231
|
|
|
232
232
|
const loaded: { metadata: Record<string, unknown>; packageName: string; version: string }[] = [];
|
|
233
233
|
for (const packageName of [...packageNames].filter(isZoraPluginPackage).sort()) {
|
|
234
|
-
const minimumVersion =
|
|
235
|
-
packageName === '@ankhorage/zora-chess'
|
|
236
|
-
? '0.2.0'
|
|
237
|
-
: packageName === '@ankhorage/zora-tabletop'
|
|
238
|
-
? '0.1.0'
|
|
239
|
-
: '0.0.0';
|
|
234
|
+
const minimumVersion = resolvePluginMinimumVersion(targetManifest, packageName);
|
|
240
235
|
const requirement: OwnerRequirement = {
|
|
241
236
|
packageName,
|
|
242
237
|
minimumVersion,
|
|
@@ -255,6 +250,42 @@ function isZoraPluginPackage(packageName: string): boolean {
|
|
|
255
250
|
return packageName.startsWith('@ankhorage/zora-') && packageName !== '@ankhorage/zora';
|
|
256
251
|
}
|
|
257
252
|
|
|
253
|
+
/*** Resolve one ZORA plugin minimum version from the target package declaration or owner package itself. */
|
|
254
|
+
function resolvePluginMinimumVersion(
|
|
255
|
+
targetManifest: Record<string, unknown>,
|
|
256
|
+
packageName: string,
|
|
257
|
+
): string {
|
|
258
|
+
if (targetManifest.name === packageName) {
|
|
259
|
+
const { version } = targetManifest;
|
|
260
|
+
if (typeof version === 'string' && parseVersion(version)[0] >= 0) return version;
|
|
261
|
+
throw new Error(`ZORA plugin owner package ${packageName} must declare a semantic version.`);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
for (const field of ['dependencies', 'devDependencies', 'peerDependencies']) {
|
|
265
|
+
const dependencies = targetManifest[field];
|
|
266
|
+
if (!isRecord(dependencies)) continue;
|
|
267
|
+
const specifier = dependencies[packageName];
|
|
268
|
+
if (typeof specifier === 'string') {
|
|
269
|
+
return readPluginMinimumVersion(packageName, specifier);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
throw new Error(`ZORA plugin ${packageName} must be declared by the target package.`);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/*** Read the semantic lower bound from one supported published dependency specifier. */
|
|
277
|
+
function readPluginMinimumVersion(packageName: string, specifier: string): string {
|
|
278
|
+
const normalized = specifier.trim().replace(/^workspace:/u, '');
|
|
279
|
+
const match = /^(?:\^|~|>=)?(\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?)$/u.exec(normalized);
|
|
280
|
+
const minimumVersion = match?.[1];
|
|
281
|
+
if (minimumVersion === undefined) {
|
|
282
|
+
throw new Error(
|
|
283
|
+
`ZORA plugin ${packageName} must use an exact, caret, tilde, or >= semantic dependency range; found ${specifier}.`,
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
return minimumVersion;
|
|
287
|
+
}
|
|
288
|
+
|
|
258
289
|
/*** Load only Contracts for tooling that runs before another owner package has been built. */
|
|
259
290
|
export async function loadContractsApi(targetDirectory = process.cwd()): Promise<ContractsApi> {
|
|
260
291
|
const loaded = await loadOwnerModule(targetDirectory, OWNER_REQUIREMENTS.contracts);
|
|
@@ -147,34 +147,44 @@ jobs:
|
|
|
147
147
|
registry_evidence="${RUNNER_TEMP}/npm-publish-verification.json"
|
|
148
148
|
artifact="${RUNNER_TEMP}/npm-publish-verification.tgz"
|
|
149
149
|
pack_dir="${RUNNER_TEMP}/npm-pack-verification"
|
|
150
|
-
max_attempts=
|
|
150
|
+
max_attempts=60
|
|
151
151
|
retry_seconds=30
|
|
152
152
|
mkdir -p "$pack_dir"
|
|
153
153
|
|
|
154
|
+
last_stage="registry-metadata"
|
|
154
155
|
for attempt in $(seq 1 "$max_attempts"); do
|
|
155
156
|
echo "Verifying ${package_spec} on npm (attempt ${attempt}/${max_attempts})..."
|
|
157
|
+
last_stage="registry-metadata"
|
|
158
|
+
|
|
156
159
|
if npm view "$package_spec" version dist.tarball dist.integrity --json > "$registry_evidence"; then
|
|
157
160
|
resolved_version="$(node -e "const p=require(process.argv[1]); process.stdout.write(p.version ?? '')" "$registry_evidence")"
|
|
158
161
|
tarball="$(node -e "const p=require(process.argv[1]); process.stdout.write(p['dist.tarball'] ?? '')" "$registry_evidence")"
|
|
159
162
|
integrity="$(node -e "const p=require(process.argv[1]); process.stdout.write(p['dist.integrity'] ?? '')" "$registry_evidence")"
|
|
160
163
|
|
|
161
164
|
if [ "$resolved_version" = "$PUBLISHED_PACKAGE_VERSION" ] && [ -n "$tarball" ] && [ -n "$integrity" ]; then
|
|
165
|
+
last_stage="tarball-download"
|
|
162
166
|
if curl --fail --location --silent --show-error --output "$artifact" "$tarball"; then
|
|
167
|
+
last_stage="integrity"
|
|
163
168
|
if EXPECTED_INTEGRITY="$integrity" ARTIFACT="$artifact" node -e "const { createHash }=require('node:crypto'); const { readFileSync }=require('node:fs'); const actual='sha512-'+createHash('sha512').update(readFileSync(process.env.ARTIFACT)).digest('base64'); if(actual!==process.env.EXPECTED_INTEGRITY){console.error('Downloaded npm tarball integrity mismatch.'); process.exit(1)}"; then
|
|
164
|
-
npm
|
|
165
|
-
|
|
166
|
-
|
|
169
|
+
last_stage="npm-pack"
|
|
170
|
+
attempt_pack_dir="$pack_dir/attempt-${attempt}"
|
|
171
|
+
mkdir -p "$attempt_pack_dir"
|
|
172
|
+
if npm pack "$package_spec" --pack-destination "$attempt_pack_dir" >/dev/null; then
|
|
173
|
+
echo "Verified ${package_spec}: metadata, integrity, tarball download, and npm pack are available."
|
|
174
|
+
exit 0
|
|
175
|
+
fi
|
|
167
176
|
fi
|
|
168
177
|
fi
|
|
169
178
|
fi
|
|
170
179
|
fi
|
|
171
180
|
|
|
181
|
+
echo "Published npm artifact not ready at stage: ${last_stage}."
|
|
172
182
|
if [ "$attempt" -lt "$max_attempts" ]; then
|
|
173
183
|
sleep "$retry_seconds"
|
|
174
184
|
fi
|
|
175
185
|
done
|
|
176
186
|
|
|
177
|
-
echo "Published npm artifact did not become retrievable after ${max_attempts} attempts."
|
|
187
|
+
echo "Published npm artifact did not become retrievable after ${max_attempts} attempts; last stage: ${last_stage}."
|
|
178
188
|
cat "$registry_evidence" 2>/dev/null || true
|
|
179
189
|
exit 1
|
|
180
190
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/devtools",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.6",
|
|
4
4
|
"description": "Shared tooling, repository automation, runtime policies, and agent standards for Ankhorage TypeScript projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/ankhorage/devtools#readme",
|