@ankhorage/devtools 2.3.9 → 2.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
@@ -3,7 +3,7 @@
3
3
 
4
4
  # @ankhorage/devtools
5
5
 
6
- ![license: MIT](././paradox/badges/license.svg) ![npm: v2.3.9](././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) ![paradox: warnings](././paradox/badges/docs.svg)
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v2.3.11](././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) ![paradox: warnings](././paradox/badges/docs.svg)
7
7
 
8
8
  Shared tooling, repository automation, and agent standards for Ankhorage TypeScript projects
9
9
 
@@ -1,6 +1,6 @@
1
1
  /*** Materialize the trusted canonical capability surface for one package checkout. */
2
- import { access } from 'node:fs/promises';
3
- import { resolve } from 'node:path';
2
+ import { access, mkdtemp, rm } from 'node:fs/promises';
3
+ import { join, resolve } from 'node:path';
4
4
  import { pathToFileURL } from 'node:url';
5
5
  import { isCapability, normalizeCapability } from '@ankhorage/capability';
6
6
  const CAPABILITIES_SOURCE_PATH = 'src/capabilities/index.ts';
@@ -21,7 +21,7 @@ export async function resolvePackageCapabilitiesAsync(targetDirectory, manifest)
21
21
  if (!isRecord(manifest.ankh)) {
22
22
  throw new Error(`${CAPABILITIES_SOURCE_PATH} requires package.json ankh discovery metadata for publication.`);
23
23
  }
24
- const source = await import(pathToFileURL(sourcePath).href);
24
+ const source = await loadCapabilityCatalogAsync(targetDirectory, sourcePath);
25
25
  const catalog = isRecord(source) ? source.CAPABILITIES : undefined;
26
26
  if (!Array.isArray(catalog)) {
27
27
  throw new Error(`${CAPABILITIES_SOURCE_PATH} must export CAPABILITIES as an array.`);
@@ -35,6 +35,27 @@ export async function resolvePackageCapabilitiesAsync(targetDirectory, manifest)
35
35
  assertUniqueCapabilityIds(capabilities);
36
36
  return capabilities;
37
37
  }
38
+ /*** Build and load the catalog's local TypeScript module closure through Bun resolution. */
39
+ async function loadCapabilityCatalogAsync(targetDirectory, sourcePath) {
40
+ const buildDirectory = await mkdtemp(join(targetDirectory, '.ankh-capability-catalog-'));
41
+ try {
42
+ const build = await Bun.build({
43
+ entrypoints: [sourcePath],
44
+ outdir: buildDirectory,
45
+ naming: 'catalog.[ext]',
46
+ format: 'esm',
47
+ sourcemap: 'none',
48
+ target: 'bun',
49
+ });
50
+ if (!build.success) {
51
+ throw new Error(`Unable to build ${CAPABILITIES_SOURCE_PATH} for materialization.`);
52
+ }
53
+ return await import(pathToFileURL(join(buildDirectory, 'catalog.js')).href);
54
+ }
55
+ finally {
56
+ await rm(buildDirectory, { force: true, recursive: true });
57
+ }
58
+ }
38
59
  /*** Check whether a manifest declares published capability discovery metadata. */
39
60
  function hasCapabilityMetadata(manifest) {
40
61
  return isRecord(manifest.ankh) && Object.hasOwn(manifest.ankh, 'capabilities');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ankhorage/devtools",
3
- "version": "2.3.9",
3
+ "version": "2.3.11",
4
4
  "description": "Shared tooling, repository automation, and agent standards for Ankhorage TypeScript projects",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/ankhorage/devtools#readme",
@@ -517,11 +517,11 @@
517
517
  },
518
518
  "devDependencies": {
519
519
  "@ankhorage/paradox": "^0.3.1",
520
- "@ankhorage/ankh": "^0.12.2",
521
- "@ankhorage/doctor": "0.14.6",
520
+ "@ankhorage/ankh": "^0.13.0",
521
+ "@ankhorage/doctor": "0.14.11",
522
522
  "@techstark/opencv-js": "^5.0.0-release.1",
523
523
  "@types/bun": "^1.4.2",
524
- "@types/node": "^26.6.4",
524
+ "@types/node": "^26.6.5",
525
525
  "sharp": "^0.35.5"
526
526
  },
527
527
  "packageManager": "bun@1.4.2"