@ankhorage/devtools 2.1.0 → 2.1.1

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.0](././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.1](././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
 
@@ -5,7 +5,6 @@ import { REPOSITORY_RULE_METADATA } from '@ankhorage/rules-repository';
5
5
  import { resolveApmReleaseCommandAsync } from '../features/apm-release-validation/adapters/outbound/resolveApmReleaseCommandAsync.js';
6
6
  import { resolveStructureReleaseCommandAsync } from '../features/structure-descriptor-generation/adapters/outbound/resolveStructureReleaseCommandAsync.js';
7
7
  import { applyBunRuntimePolicy } from '../policy/applyBunRuntimePolicy.js';
8
- import { DEVTOOLS_BUN_RUNTIME_POLICY } from '../policy/bunRuntimePolicy.js';
9
8
  import { readCurrentDoctorVersion } from '../tools/workflows/readCurrentDoctorVersion.js';
10
9
  import { renderRenovateWorkflowAsync } from '../tools/workflows/renderRenovateWorkflowAsync.js';
11
10
  import { renderWorkflowAsync, } from '../tools/workflows/renderWorkflowAsync.js';
@@ -61,7 +60,7 @@ async function createWorkflowPolicyAsync(targetDirectory) {
61
60
  return {
62
61
  apmReleaseCommand: await resolveApmReleaseCommandAsync(targetDirectory),
63
62
  structureReleaseCommand: await resolveStructureReleaseCommandAsync(targetDirectory),
64
- bunVersion: DEVTOOLS_BUN_RUNTIME_POLICY.version,
63
+ bunVersion: REPOSITORY_RULE_METADATA.runtime.bun.version,
65
64
  doctorVersion: readCurrentDoctorVersion(),
66
65
  nodeVersion: REPOSITORY_RULE_METADATA.runtime.node.setupVersion,
67
66
  };
@@ -1,2 +1,2 @@
1
- /*** Apply the Devtools-owned Bun runtime policy to one package manifest. */
1
+ /*** Apply the Rules-owned Bun runtime contract to one package manifest. */
2
2
  export declare function applyBunRuntimePolicy(manifest: Record<string, unknown>): Record<string, unknown>;
@@ -1,17 +1,19 @@
1
- import { DEVTOOLS_BUN_RUNTIME_POLICY } from './bunRuntimePolicy.js';
2
- /*** Apply the Devtools-owned Bun runtime policy to one package manifest. */
1
+ import { REPOSITORY_RULE_METADATA } from '@ankhorage/rules-repository';
2
+ /*** Apply the Rules-owned Bun runtime contract to one package manifest. */
3
3
  export function applyBunRuntimePolicy(manifest) {
4
4
  const devDependencies = toRecord(manifest.devDependencies);
5
- devDependencies['@types/bun'] = DEVTOOLS_BUN_RUNTIME_POLICY.typesRange;
5
+ devDependencies['@types/bun'] = REPOSITORY_RULE_METADATA.runtime.bun.typesRange;
6
6
  return {
7
7
  ...manifest,
8
- packageManager: DEVTOOLS_BUN_RUNTIME_POLICY.packageManager,
8
+ packageManager: REPOSITORY_RULE_METADATA.runtime.bun.packageManager,
9
9
  devDependencies,
10
10
  };
11
11
  }
12
+ /*** Narrow an unknown JSON-like value to a non-array record. */
12
13
  function isRecord(value) {
13
14
  return typeof value === 'object' && value !== null && !Array.isArray(value);
14
15
  }
16
+ /*** Copy a JSON-like value to a mutable record or return an empty record. */
15
17
  function toRecord(value) {
16
18
  return isRecord(value) ? { ...value } : {};
17
19
  }
@@ -1,2 +1,2 @@
1
- /*** Render the managed Bun policy section while preserving the surrounding guide. */
1
+ /*** Render the managed Bun Rules section while preserving the surrounding guide. */
2
2
  export declare function renderBunPolicyDocumentation(readme: string): string;
@@ -1,5 +1,5 @@
1
- import { DEVTOOLS_BUN_RUNTIME_POLICY } from './bunRuntimePolicy.js';
2
- /*** Render the managed Bun policy section while preserving the surrounding guide. */
1
+ import { REPOSITORY_RULE_METADATA } from '@ankhorage/rules-repository';
2
+ /*** Render the managed Bun Rules section while preserving the surrounding guide. */
3
3
  export function renderBunPolicyDocumentation(readme) {
4
4
  const startIndex = readme.indexOf(README_POLICY_START);
5
5
  const endIndex = readme.indexOf(README_POLICY_END);
@@ -15,10 +15,11 @@ export function renderBunPolicyDocumentation(readme) {
15
15
  }
16
16
  /*** Format canonical runtime and type-package versions for the guide. */
17
17
  function renderReadmePolicy() {
18
+ const { packageManager, typesRange, version } = REPOSITORY_RULE_METADATA.runtime.bun;
18
19
  return `\`\`\`text
19
- Bun runtime ${DEVTOOLS_BUN_RUNTIME_POLICY.version}
20
- packageManager ${DEVTOOLS_BUN_RUNTIME_POLICY.packageManager}
21
- @types/bun ${DEVTOOLS_BUN_RUNTIME_POLICY.typesRange}
20
+ Bun runtime ${version}
21
+ packageManager ${packageManager}
22
+ @types/bun ${typesRange}
22
23
  \`\`\``;
23
24
  }
24
25
  const README_POLICY_END = '<!-- devtools-bun-policy:end -->';
@@ -22,7 +22,6 @@ import { readFile, writeFile } from 'node:fs/promises';
22
22
  import { resolve } from 'node:path';
23
23
  import { REPOSITORY_RULE_METADATA } from '@ankhorage/rules-repository';
24
24
  import { applyBunRuntimePolicy } from '../../policy/applyBunRuntimePolicy.js';
25
- import { DEVTOOLS_BUN_RUNTIME_POLICY } from '../../policy/bunRuntimePolicy.js';
26
25
  const PACKAGE_PATH = 'package.json';
27
26
  const DEVTOOLS_PACKAGE_NAME = '@ankhorage/devtools';
28
27
  const BUN_TYPES_PACKAGE_NAME = '@types/bun';
@@ -155,8 +154,8 @@ async function readPackageManifest(targetDirectory) {
155
154
  /*** Check the Bun package manager and Bun type dependency contract. */
156
155
  function hasCurrentBunRuntimePolicy(manifest) {
157
156
  const devDependencies = toRecord(manifest.devDependencies);
158
- return (manifest.packageManager === DEVTOOLS_BUN_RUNTIME_POLICY.packageManager &&
159
- devDependencies[BUN_TYPES_PACKAGE_NAME] === DEVTOOLS_BUN_RUNTIME_POLICY.typesRange);
157
+ return (manifest.packageManager === REPOSITORY_RULE_METADATA.runtime.bun.packageManager &&
158
+ devDependencies[BUN_TYPES_PACKAGE_NAME] === REPOSITORY_RULE_METADATA.runtime.bun.typesRange);
160
159
  }
161
160
  /*** Place Devtools in development dependencies for every consuming repository. */
162
161
  function applyDevtoolsDependencyPlacement(dependencies, devDependencies, devtoolsVersion) {
@@ -3,7 +3,6 @@ import { join } from 'node:path';
3
3
  import { REPOSITORY_RULE_METADATA } from '@ankhorage/rules-repository';
4
4
  import { resolveApmReleaseCommandAsync } from '../../features/apm-release-validation/adapters/outbound/resolveApmReleaseCommandAsync.js';
5
5
  import { resolveStructureReleaseCommandAsync } from '../../features/structure-descriptor-generation/adapters/outbound/resolveStructureReleaseCommandAsync.js';
6
- import { DEVTOOLS_BUN_RUNTIME_POLICY } from '../../policy/bunRuntimePolicy.js';
7
6
  import { resolvePkgvizAuditPolicyAsync } from '../../policy/resolvePkgvizAuditPolicyAsync.js';
8
7
  import { readCurrentDoctorVersion } from './readCurrentDoctorVersion.js';
9
8
  import { renderRenovateConfigAsync } from './renderRenovateConfigAsync.js';
@@ -39,7 +38,7 @@ function createWorkflowDefinition(relativePath, sourcePath) {
39
38
  render: async (targetDirectory) => await renderWorkflowAsync(sourceUrl, {
40
39
  apmReleaseCommand: await resolveApmReleaseCommandAsync(targetDirectory),
41
40
  structureReleaseCommand: await resolveStructureReleaseCommandAsync(targetDirectory),
42
- bunVersion: DEVTOOLS_BUN_RUNTIME_POLICY.version,
41
+ bunVersion: REPOSITORY_RULE_METADATA.runtime.bun.version,
43
42
  doctorVersion: readCurrentDoctorVersion(),
44
43
  nodeVersion: REPOSITORY_RULE_METADATA.runtime.node.setupVersion,
45
44
  pkgvizAudit: await resolvePkgvizAuditPolicyAsync(targetDirectory),
@@ -54,7 +53,7 @@ function createRenovateWorkflowDefinition() {
54
53
  render: async (targetDirectory) => await renderRenovateWorkflowAsync(sourceUrl, targetDirectory, {
55
54
  apmReleaseCommand: await resolveApmReleaseCommandAsync(targetDirectory),
56
55
  structureReleaseCommand: await resolveStructureReleaseCommandAsync(targetDirectory),
57
- bunVersion: DEVTOOLS_BUN_RUNTIME_POLICY.version,
56
+ bunVersion: REPOSITORY_RULE_METADATA.runtime.bun.version,
58
57
  doctorVersion: readCurrentDoctorVersion(),
59
58
  nodeVersion: REPOSITORY_RULE_METADATA.runtime.node.setupVersion,
60
59
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ankhorage/devtools",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
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",
@@ -1,5 +0,0 @@
1
- export declare const DEVTOOLS_BUN_RUNTIME_POLICY: {
2
- readonly packageManager: "bun@1.4.2";
3
- readonly typesRange: "^1.4.2";
4
- readonly version: "1.4.2";
5
- };
@@ -1,5 +0,0 @@
1
- export const DEVTOOLS_BUN_RUNTIME_POLICY = {
2
- packageManager: 'bun@1.4.2',
3
- typesRange: '^1.4.2',
4
- version: '1.4.2',
5
- };