@ankhorage/devtools 2.1.12 → 2.1.14

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.1.12](././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.1.14](././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
 
@@ -58,17 +58,16 @@ async function runStatus(scope, targetDirectory, devtoolsVersion, context) {
58
58
  }
59
59
  async function runSync(scope, targetDirectory, devtoolsVersion, dryRun, context) {
60
60
  const results = [];
61
- let packageDependenciesChanged = false;
62
61
  if (scope === 'all' || scope === 'package') {
63
62
  const packageResult = await syncPackageManifest(targetDirectory, devtoolsVersion, { dryRun });
64
63
  results.push(packageResult);
65
- packageDependenciesChanged = packageResult.action !== 'unchanged';
66
64
  }
67
65
  results.push(...(await syncManagedFiles(targetDirectory, getManagedFiles(scope), { dryRun })));
68
66
  if (scope === 'all' || scope === 'skills') {
69
67
  results.push(...(await syncManagedSkills(targetDirectory, devtoolsVersion, { dryRun })));
70
68
  }
71
- if (packageDependenciesChanged) {
69
+ const shouldSyncDependencies = scope === 'all' || scope === 'package';
70
+ if (shouldSyncDependencies) {
72
71
  if (dryRun) {
73
72
  results.push(planBunDependencySync(targetDirectory));
74
73
  }
@@ -1,10 +1,10 @@
1
- import { spawn } from 'node:child_process';
2
1
  import { mkdir, readFile, writeFile } from 'node:fs/promises';
3
2
  import { dirname, resolve } from 'node:path';
4
3
  import { REPOSITORY_RULE_METADATA } from '@ankhorage/rules-repository';
5
4
  import { resolveApmReleaseCommandAsync } from '../features/apm-release-validation/adapters/outbound/resolveApmReleaseCommandAsync.js';
6
5
  import { resolveStructureReleaseCommandAsync } from '../features/structure-descriptor-generation/adapters/outbound/resolveStructureReleaseCommandAsync.js';
7
6
  import { applyBunRuntimePolicy } from '../policy/applyBunRuntimePolicy.js';
7
+ import { refreshAnkhorageBunResolutionsAsync } from '../tools/package/refreshAnkhorageBunResolutionsAsync.js';
8
8
  import { readCurrentDoctorVersion } from '../tools/workflows/readCurrentDoctorVersion.js';
9
9
  import { renderRenovateWorkflowAsync } from '../tools/workflows/renderRenovateWorkflowAsync.js';
10
10
  import { renderWorkflowAsync, } from '../tools/workflows/renderWorkflowAsync.js';
@@ -85,25 +85,9 @@ function isNodeError(error) {
85
85
  function isRecord(value) {
86
86
  return typeof value === 'object' && value !== null && !Array.isArray(value);
87
87
  }
88
- /*** Synchronize or validate the target Bun lockfile through Bun itself. */
89
- async function runBunLockfileAsync(operation, targetDirectory) {
90
- const args = [
91
- 'install',
92
- '--cwd',
93
- targetDirectory,
94
- '--ignore-scripts',
95
- '--lockfile-only',
96
- '--registry=https://registry.npmjs.org',
97
- ];
98
- await new Promise((resolvePromise, rejectPromise) => {
99
- const child = spawn('bun', args, { stdio: 'inherit' });
100
- child.once('error', rejectPromise);
101
- child.once('exit', (code) => {
102
- if (code === 0)
103
- return resolvePromise();
104
- rejectPromise(new Error(`Bun lockfile ${operation} exited with code ${code ?? 'unknown'}.`));
105
- });
106
- });
88
+ /*** Synchronize the target Bun lock while refreshing every Ankhorage package within its declared range. */
89
+ async function runBunLockfileAsync(_operation, targetDirectory) {
90
+ await refreshAnkhorageBunResolutionsAsync(targetDirectory);
107
91
  }
108
92
  /*** Serialize a package manifest using repository formatting. */
109
93
  function serializePackageManifest(manifest) {
@@ -0,0 +1,4 @@
1
+ type BunCommandRunner = (args: readonly string[], targetDirectory: string) => Promise<void>;
2
+ /*** Refresh every Ankhorage package in a Bun lock within declared ranges without changing manifest ownership. */
3
+ export declare function refreshAnkhorageBunResolutionsAsync(targetDirectory: string, runCommand?: BunCommandRunner): Promise<void>;
4
+ export {};
@@ -0,0 +1,30 @@
1
+ import { spawn } from 'node:child_process';
2
+ import { readFile, writeFile } from 'node:fs/promises';
3
+ import { resolve } from 'node:path';
4
+ /*** Refresh every Ankhorage package in a Bun lock within declared ranges without changing manifest ownership. */
5
+ export async function refreshAnkhorageBunResolutionsAsync(targetDirectory, runCommand = runBunCommandAsync) {
6
+ const packagePath = resolve(targetDirectory, 'package.json');
7
+ const manifest = await readFile(packagePath, 'utf8');
8
+ await runCommand(['install', '--lockfile-only', '--ignore-scripts'], targetDirectory);
9
+ try {
10
+ await runCommand(['update', '@ankhorage/*', '--lockfile-only', '--ignore-scripts'], targetDirectory);
11
+ }
12
+ finally {
13
+ await writeFile(packagePath, manifest, 'utf8');
14
+ }
15
+ await runCommand(['install', '--lockfile-only', '--ignore-scripts'], targetDirectory);
16
+ }
17
+ /*** Execute one Bun package-manager command with inherited output and exact exit handling. */
18
+ async function runBunCommandAsync(args, targetDirectory) {
19
+ await new Promise((resolvePromise, rejectPromise) => {
20
+ const child = spawn('bun', [...args], { cwd: targetDirectory, stdio: 'inherit' });
21
+ child.once('error', rejectPromise);
22
+ child.once('exit', (code) => {
23
+ if (code === 0) {
24
+ resolvePromise();
25
+ return;
26
+ }
27
+ rejectPromise(new Error(`bun ${args.join(' ')} exited with code ${code ?? 'unknown'}.`));
28
+ });
29
+ });
30
+ }
@@ -1,6 +1,7 @@
1
1
  import { spawn } from 'node:child_process';
2
2
  import { existsSync } from 'node:fs';
3
3
  import { resolve } from 'node:path';
4
+ import { refreshAnkhorageBunResolutionsAsync } from './refreshAnkhorageBunResolutionsAsync.js';
4
5
  export function planBunDependencySync(targetDirectory) {
5
6
  return {
6
7
  relativePath: 'bun.lock',
@@ -9,6 +10,7 @@ export function planBunDependencySync(targetDirectory) {
9
10
  }
10
11
  export async function syncBunDependencies(targetDirectory) {
11
12
  const existed = existsSync(resolve(targetDirectory, 'bun.lock'));
13
+ await refreshAnkhorageBunResolutionsAsync(targetDirectory);
12
14
  await runBunInstall(targetDirectory);
13
15
  return {
14
16
  relativePath: 'bun.lock',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ankhorage/devtools",
3
- "version": "2.1.12",
3
+ "version": "2.1.14",
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",
@@ -122,7 +122,7 @@
122
122
  },
123
123
  "dependencies": {
124
124
  "@ankhorage/apm": "^0.8.14",
125
- "@ankhorage/contracts": "^22.8.103",
125
+ "@ankhorage/contracts": "^23.0.0",
126
126
  "@ankhorage/project-detector": "^0.3.3",
127
127
  "@ankhorage/rules-repository": "^0.2.0",
128
128
  "@ankhorage/utility": "^0.5.5",
@@ -148,7 +148,7 @@
148
148
  "devDependencies": {
149
149
  "@ankhorage/paradox": "^0.2.28",
150
150
  "@ankhorage/ankh": "^0.11.1",
151
- "@ankhorage/doctor": "0.12.13",
151
+ "@ankhorage/doctor": "0.12.16",
152
152
  "@techstark/opencv-js": "^5.0.0-release.1",
153
153
  "@types/bun": "^1.4.2",
154
154
  "@types/node": "^26.6.4",