@ankhorage/devtools 1.15.3 → 1.15.5
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);
|
|
@@ -136,6 +136,48 @@ jobs:
|
|
|
136
136
|
git tag "v${package_version}"
|
|
137
137
|
fi
|
|
138
138
|
|
|
139
|
+
- name: Verify published npm artifact
|
|
140
|
+
if: steps.release.outputs.versioned == 'true'
|
|
141
|
+
env:
|
|
142
|
+
PUBLISHED_PACKAGE_NAME: ${{ steps.release.outputs.package_name }}
|
|
143
|
+
PUBLISHED_PACKAGE_VERSION: ${{ steps.release.outputs.package_version }}
|
|
144
|
+
run: |
|
|
145
|
+
set -euo pipefail
|
|
146
|
+
package_spec="${PUBLISHED_PACKAGE_NAME}@${PUBLISHED_PACKAGE_VERSION}"
|
|
147
|
+
registry_evidence="${RUNNER_TEMP}/npm-publish-verification.json"
|
|
148
|
+
artifact="${RUNNER_TEMP}/npm-publish-verification.tgz"
|
|
149
|
+
pack_dir="${RUNNER_TEMP}/npm-pack-verification"
|
|
150
|
+
max_attempts=30
|
|
151
|
+
retry_seconds=30
|
|
152
|
+
mkdir -p "$pack_dir"
|
|
153
|
+
|
|
154
|
+
for attempt in $(seq 1 "$max_attempts"); do
|
|
155
|
+
echo "Verifying ${package_spec} on npm (attempt ${attempt}/${max_attempts})..."
|
|
156
|
+
if npm view "$package_spec" version dist.tarball dist.integrity --json > "$registry_evidence"; then
|
|
157
|
+
resolved_version="$(node -e "const p=require(process.argv[1]); process.stdout.write(p.version ?? '')" "$registry_evidence")"
|
|
158
|
+
tarball="$(node -e "const p=require(process.argv[1]); process.stdout.write(p['dist.tarball'] ?? '')" "$registry_evidence")"
|
|
159
|
+
integrity="$(node -e "const p=require(process.argv[1]); process.stdout.write(p['dist.integrity'] ?? '')" "$registry_evidence")"
|
|
160
|
+
|
|
161
|
+
if [ "$resolved_version" = "$PUBLISHED_PACKAGE_VERSION" ] && [ -n "$tarball" ] && [ -n "$integrity" ]; then
|
|
162
|
+
if curl --fail --location --silent --show-error --output "$artifact" "$tarball"; then
|
|
163
|
+
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 pack "$package_spec" --pack-destination "$pack_dir" >/dev/null
|
|
165
|
+
echo "Verified ${package_spec}: metadata, integrity, tarball download, and npm pack are available."
|
|
166
|
+
exit 0
|
|
167
|
+
fi
|
|
168
|
+
fi
|
|
169
|
+
fi
|
|
170
|
+
fi
|
|
171
|
+
|
|
172
|
+
if [ "$attempt" -lt "$max_attempts" ]; then
|
|
173
|
+
sleep "$retry_seconds"
|
|
174
|
+
fi
|
|
175
|
+
done
|
|
176
|
+
|
|
177
|
+
echo "Published npm artifact did not become retrievable after ${max_attempts} attempts."
|
|
178
|
+
cat "$registry_evidence" 2>/dev/null || true
|
|
179
|
+
exit 1
|
|
180
|
+
|
|
139
181
|
- name: Finalize Changesets v3 tags and GitHub releases
|
|
140
182
|
if: hashFiles('.changeset/config.json') != ''
|
|
141
183
|
env:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/devtools",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.5",
|
|
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",
|