@ankhorage/devtools 2.3.5 → 2.3.7

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.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) ![paradox: warnings](././paradox/badges/docs.svg)
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v2.3.7](././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,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { runApmReleaseCommandAsync } from '../runApmReleaseCommandAsync.js';
2
+ import { runApmReleaseCommandAsync } from '../commands/apm/runApmReleaseCommandAsync.js';
3
3
  const [operation, ...argv] = process.argv.slice(2);
4
4
  if (operation !== 'sync' && operation !== 'validate') {
5
5
  console.error('Usage: ankhorage-apm-release <sync|validate> [directory] [--allow-owner-code] [--artifact path] [--expected-integrity value]');
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { runStructureGenerationCommandAsync } from '../runStructureGenerationCommandAsync.js';
2
+ import { runStructureGenerationCommandAsync } from '../commands/structure/runStructureGenerationCommandAsync.js';
3
3
  const [operation, ...argv] = process.argv.slice(2);
4
4
  if (operation !== 'build' && operation !== 'check') {
5
5
  console.error('Usage: ankhorage-structure <build|check> [directory]');
@@ -1,6 +1,6 @@
1
1
  import { resolve } from 'node:path';
2
- import { synchronizeApmReleaseDescriptorAsync } from '../features/apm-release-validation/composition/synchronizeApmReleaseDescriptorAsync.js';
3
- import { validatePackedApmReleaseAsync } from '../features/apm-release-validation/composition/validatePackedApmReleaseAsync.js';
2
+ import { synchronizeApmReleaseDescriptorAsync } from '../../../features/apm-release-validation/composition/synchronizeApmReleaseDescriptorAsync.js';
3
+ import { validatePackedApmReleaseAsync } from '../../../features/apm-release-validation/composition/validatePackedApmReleaseAsync.js';
4
4
  /*** Parse release CLI input and report the same structured validation result on every entrypoint. */
5
5
  export async function runApmReleaseCommandAsync(operation, argv, context) {
6
6
  try {
@@ -1,4 +1,4 @@
1
- import type { DevtoolsProviderCommandContext } from '../../runProviderCommand.js';
1
+ import type { DevtoolsProviderCommandContext } from '../../../types/provider-command.js';
2
2
  /*** Adapt the public APM release sync command to the shared release boundary. */
3
3
  export declare function sync(argv: readonly string[], context: DevtoolsProviderCommandContext): Promise<{
4
4
  readonly exitCode: number;
@@ -1,4 +1,4 @@
1
- import { runApmReleaseCommandAsync } from '../../runApmReleaseCommandAsync.js';
1
+ import { runApmReleaseCommandAsync } from './runApmReleaseCommandAsync.js';
2
2
  /*** Adapt the public APM release sync command to the shared release boundary. */
3
3
  export async function sync(argv, context) {
4
4
  return runApmReleaseCommandAsync('sync', argv, context);
@@ -1,4 +1,4 @@
1
- import type { DevtoolsProviderCommandContext } from '../../runProviderCommand.js';
1
+ import type { DevtoolsProviderCommandContext } from '../../../types/provider-command.js';
2
2
  /*** Adapt the public APM release validate command to the shared release boundary. */
3
3
  export declare function validate(argv: readonly string[], context: DevtoolsProviderCommandContext): Promise<{
4
4
  readonly exitCode: number;
@@ -1,4 +1,4 @@
1
- import { runApmReleaseCommandAsync } from '../../runApmReleaseCommandAsync.js';
1
+ import { runApmReleaseCommandAsync } from './runApmReleaseCommandAsync.js';
2
2
  /*** Adapt the public APM release validate command to the shared release boundary. */
3
3
  export async function validate(argv, context) {
4
4
  return runApmReleaseCommandAsync('validate', argv, context);
@@ -1,4 +1,4 @@
1
- import type { DevtoolsProviderCommandContext } from '../../runProviderCommand.js';
1
+ import type { DevtoolsProviderCommandContext } from '../../../types/provider-command.js';
2
2
  /*** Adapt the public structure build command to deterministic owner artifact generation. */
3
3
  export declare function build(argv: readonly string[], context: DevtoolsProviderCommandContext): Promise<{
4
4
  readonly exitCode: number;
@@ -1,4 +1,4 @@
1
- import { runStructureGenerationCommandAsync } from '../../runStructureGenerationCommandAsync.js';
1
+ import { runStructureGenerationCommandAsync } from './runStructureGenerationCommandAsync.js';
2
2
  /*** Adapt the public structure build command to deterministic owner artifact generation. */
3
3
  export async function build(argv, context) {
4
4
  return runStructureGenerationCommandAsync('build', argv, context);
@@ -1,4 +1,4 @@
1
- import type { DevtoolsProviderCommandContext } from '../../runProviderCommand.js';
1
+ import type { DevtoolsProviderCommandContext } from '../../../types/provider-command.js';
2
2
  /*** Adapt the public structure check command to deterministic owner artifact verification. */
3
3
  export declare function check(argv: readonly string[], context: DevtoolsProviderCommandContext): Promise<{
4
4
  readonly exitCode: number;
@@ -1,4 +1,4 @@
1
- import { runStructureGenerationCommandAsync } from '../../runStructureGenerationCommandAsync.js';
1
+ import { runStructureGenerationCommandAsync } from './runStructureGenerationCommandAsync.js';
2
2
  /*** Adapt the public structure check command to deterministic owner artifact verification. */
3
3
  export async function check(argv, context) {
4
4
  return runStructureGenerationCommandAsync('check', argv, context);
@@ -1,5 +1,5 @@
1
1
  import { resolve } from 'node:path';
2
- import { synchronizeStructureArtifactForDirectoryAsync } from '../features/structure-descriptor-generation/composition/synchronizeStructureArtifactForDirectoryAsync.js';
2
+ import { synchronizeStructureArtifactForDirectoryAsync } from '../../../features/structure-descriptor-generation/composition/synchronizeStructureArtifactForDirectoryAsync.js';
3
3
  /*** Parse structure build/check CLI input and emit one machine-readable result. */
4
4
  export async function runStructureGenerationCommandAsync(operation, argv, context) {
5
5
  try {
@@ -1,8 +1,5 @@
1
+ import type { DevtoolsProviderCommandContext } from '../types/provider-command.js';
1
2
  import type { DevtoolsCommandDefinition } from './commands.js';
2
- import { type DevtoolsRepositoryCommandContext } from './runRepositoryCommand.js';
3
- export interface DevtoolsProviderCommandContext extends DevtoolsRepositoryCommandContext {
4
- readonly env: Readonly<Record<string, string | undefined>>;
5
- }
6
3
  export declare function runProviderCommand(command: DevtoolsCommandDefinition, argv: readonly string[], context: DevtoolsProviderCommandContext): Promise<{
7
4
  readonly exitCode: number;
8
5
  }>;
@@ -3,7 +3,7 @@ import { validate } from './commands/apm/validate.js';
3
3
  import { build } from './commands/structure/build.js';
4
4
  import { check } from './commands/structure/check.js';
5
5
  import { runExternalTool } from './runExternalTool.js';
6
- import { runRepositoryCommand, } from './runRepositoryCommand.js';
6
+ import { runRepositoryCommand } from './runRepositoryCommand.js';
7
7
  export async function runProviderCommand(command, argv, context) {
8
8
  if (command.kind === 'apm-release') {
9
9
  return command.operation === 'sync' ? sync(argv, context) : validate(argv, context);
@@ -1,11 +1,5 @@
1
- import { type ManagedFileSyncResult } from '../features/managed-files/managedFiles.js';
1
+ import type { DevtoolsRepositoryCommandContext } from '../types/provider-command.js';
2
2
  import type { DevtoolsRepositoryCommandDefinition } from './commands.js';
3
- export interface DevtoolsRepositoryCommandContext {
4
- readonly cwd: string;
5
- readonly syncDependencies?: (targetDirectory: string) => Promise<ManagedFileSyncResult>;
6
- writeStdout(text: string): void;
7
- writeStderr(text: string): void;
8
- }
9
3
  export interface DevtoolsRepositoryCommandResult {
10
4
  readonly exitCode: number;
11
5
  }
@@ -0,0 +1,2 @@
1
+ /*** Format YAML with the published Devtools Prettier policy. */
2
+ export declare function formatYamlAsync(contents: string): Promise<string>;
@@ -0,0 +1,11 @@
1
+ import { createRequire } from 'node:module';
2
+ import { format } from 'prettier';
3
+ const require = createRequire(import.meta.url);
4
+ const sharedPrettierConfig = require('./index.cjs');
5
+ /*** Format YAML with the published Devtools Prettier policy. */
6
+ export async function formatYamlAsync(contents) {
7
+ return await format(contents, {
8
+ ...sharedPrettierConfig,
9
+ parser: 'yaml',
10
+ });
11
+ }
@@ -1,5 +1,6 @@
1
1
  import { readFile } from 'node:fs/promises';
2
2
  import { REPOSITORY_RULE_METADATA } from '@ankhorage/rules-repository';
3
+ import { formatYamlAsync } from '../prettier/formatYamlAsync.js';
3
4
  /*** Renders one workflow template with the canonical runtime, Doctor, and Changesets policy. */
4
5
  export async function renderWorkflowAsync(sourceUrl, policy) {
5
6
  const template = await readFile(sourceUrl, 'utf8');
@@ -13,7 +14,7 @@ export async function renderWorkflowAsync(sourceUrl, policy) {
13
14
  .replaceAll('__ANKH_APM_RELEASE_COMMAND__', policy.apmReleaseCommand ?? './node_modules/.bin/ankhorage-apm-release')
14
15
  .replaceAll('__ANKH_STRUCTURE_RELEASE_COMMAND__', policy.structureReleaseCommand ?? './node_modules/.bin/ankhorage-structure')
15
16
  .replaceAll(NODE_VERSION_TOKEN, policy.nodeVersion);
16
- return `${rendered.trimEnd()}\n`;
17
+ return await formatYamlAsync(`${rendered.trimEnd()}\n`);
17
18
  }
18
19
  const BUN_VERSION_TOKEN = '__ANKH_BUN_VERSION__';
19
20
  const CHANGESETS_PUBLISH_COMMAND_TOKEN = '__ANKH_CHANGESETS_PUBLISH_COMMAND__';
@@ -0,0 +1,12 @@
1
+ import type { ManagedFileSyncResult } from '../features/managed-files/managedFiles.js';
2
+ /*** Shared process context for repository-management command adapters. */
3
+ export interface DevtoolsRepositoryCommandContext {
4
+ readonly cwd: string;
5
+ readonly syncDependencies?: (targetDirectory: string) => Promise<ManagedFileSyncResult>;
6
+ writeStdout(text: string): void;
7
+ writeStderr(text: string): void;
8
+ }
9
+ /*** Shared process context for all Devtools provider command adapters. */
10
+ export interface DevtoolsProviderCommandContext extends DevtoolsRepositoryCommandContext {
11
+ readonly env: Readonly<Record<string, string | undefined>>;
12
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ankhorage/devtools",
3
- "version": "2.3.5",
3
+ "version": "2.3.7",
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,7 +517,7 @@
517
517
  "devDependencies": {
518
518
  "@ankhorage/paradox": "^0.3.1",
519
519
  "@ankhorage/ankh": "^0.12.2",
520
- "@ankhorage/doctor": "0.14.2",
520
+ "@ankhorage/doctor": "0.14.6",
521
521
  "@techstark/opencv-js": "^5.0.0-release.1",
522
522
  "@types/bun": "^1.4.2",
523
523
  "@types/node": "^26.6.4",