@ankhorage/devtools 1.15.4 → 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
- ![license: MIT](././paradox/badges/license.svg) ![npm: v1.15.4](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v1.15.5](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ankhorage/devtools",
3
- "version": "1.15.4",
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",