@ankhorage/devtools 2.0.115 → 2.1.0
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 +1 -1
- package/dist/owner/synchronizeRenovateOwnerAsync.js +2 -2
- package/dist/policy/resolvePkgvizAuditPolicyAsync.js +2 -2
- package/dist/tools/package/index.js +8 -8
- package/dist/tools/skills/assets/ankhorage-coding-rules/SKILL.md +1 -1
- package/dist/tools/workflows/index.js +3 -3
- package/dist/tools/workflows/renderWorkflowAsync.js +4 -4
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# @ankhorage/devtools
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Shared tooling, repository automation, and agent standards for Ankhorage TypeScript projects
|
|
9
9
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process';
|
|
2
2
|
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
3
3
|
import { dirname, resolve } from 'node:path';
|
|
4
|
-
import {
|
|
4
|
+
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';
|
|
@@ -63,7 +63,7 @@ async function createWorkflowPolicyAsync(targetDirectory) {
|
|
|
63
63
|
structureReleaseCommand: await resolveStructureReleaseCommandAsync(targetDirectory),
|
|
64
64
|
bunVersion: DEVTOOLS_BUN_RUNTIME_POLICY.version,
|
|
65
65
|
doctorVersion: readCurrentDoctorVersion(),
|
|
66
|
-
nodeVersion:
|
|
66
|
+
nodeVersion: REPOSITORY_RULE_METADATA.runtime.node.setupVersion,
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
/*** Return owner-managed artifact paths whose current bytes differ from policy output. */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { stat } from 'node:fs/promises';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
-
import {
|
|
3
|
+
import { REPOSITORY_RULE_METADATA } from '@ankhorage/rules-repository';
|
|
4
4
|
/*** Resolve the central PKGViz CI audit for repositories with analyzable source. */
|
|
5
5
|
export async function resolvePkgvizAuditPolicyAsync(targetDirectory) {
|
|
6
6
|
if (!(await hasSourceDirectoryAsync(targetDirectory)))
|
|
7
7
|
return undefined;
|
|
8
|
-
const { artifactName, artifactPath, command } =
|
|
8
|
+
const { artifactName, artifactPath, command } = REPOSITORY_RULE_METADATA.pkgvizAudit;
|
|
9
9
|
return { artifactName, artifactPath, command };
|
|
10
10
|
}
|
|
11
11
|
/*** Detect whether the managed repository has a source tree that PKGViz can inspect. */
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
import { existsSync, readFileSync } from 'node:fs';
|
|
21
21
|
import { readFile, writeFile } from 'node:fs/promises';
|
|
22
22
|
import { resolve } from 'node:path';
|
|
23
|
-
import {
|
|
23
|
+
import { REPOSITORY_RULE_METADATA } from '@ankhorage/rules-repository';
|
|
24
24
|
import { applyBunRuntimePolicy } from '../../policy/applyBunRuntimePolicy.js';
|
|
25
25
|
import { DEVTOOLS_BUN_RUNTIME_POLICY } from '../../policy/bunRuntimePolicy.js';
|
|
26
26
|
const PACKAGE_PATH = 'package.json';
|
|
@@ -93,12 +93,12 @@ export function applyManagedPackageContract(manifest, devtoolsVersion, changeset
|
|
|
93
93
|
delete scripts.knip;
|
|
94
94
|
Object.assign(scripts, STANDARD_SCRIPTS);
|
|
95
95
|
if (changesetsEnabled) {
|
|
96
|
-
Object.assign(scripts,
|
|
96
|
+
Object.assign(scripts, REPOSITORY_RULE_METADATA.changesets.packageScripts);
|
|
97
97
|
}
|
|
98
98
|
const devDependencies = removeOwnedDependencies(toRecord(manifest.devDependencies));
|
|
99
99
|
const dependencies = toRecord(manifest.dependencies);
|
|
100
|
-
delete dependencies[
|
|
101
|
-
delete devDependencies[
|
|
100
|
+
delete dependencies[REPOSITORY_RULE_METADATA.changesets.packageName];
|
|
101
|
+
delete devDependencies[REPOSITORY_RULE_METADATA.changesets.packageName];
|
|
102
102
|
applyDevtoolsDependencyPlacement(dependencies, devDependencies, devtoolsVersion);
|
|
103
103
|
return applyBunRuntimePolicy({
|
|
104
104
|
...manifest,
|
|
@@ -121,8 +121,8 @@ export function isManagedPackageContractCurrent(manifest, devtoolsVersion, chang
|
|
|
121
121
|
const changesetsEnabled = isChangesetsEnabled(scripts, changesetsConfigExists);
|
|
122
122
|
return (hasStandardScripts(scripts) &&
|
|
123
123
|
DEVTOOLS_OWNED_DEV_DEPENDENCIES.every((name) => devDependencies[name] === undefined) &&
|
|
124
|
-
dependencies[
|
|
125
|
-
devDependencies[
|
|
124
|
+
dependencies[REPOSITORY_RULE_METADATA.changesets.packageName] === undefined &&
|
|
125
|
+
devDependencies[REPOSITORY_RULE_METADATA.changesets.packageName] === undefined &&
|
|
126
126
|
hasCurrentChangesetsScripts(scripts, changesetsEnabled) &&
|
|
127
127
|
hasCurrentDevtoolsDependencyPlacement(dependencies, devDependencies, devtoolsVersion));
|
|
128
128
|
}
|
|
@@ -189,12 +189,12 @@ function hasStandardScripts(scripts) {
|
|
|
189
189
|
/*** Check Changesets scripts when the repository participates in Changesets. */
|
|
190
190
|
function hasCurrentChangesetsScripts(scripts, changesetsEnabled) {
|
|
191
191
|
return (!changesetsEnabled ||
|
|
192
|
-
Object.entries(
|
|
192
|
+
Object.entries(REPOSITORY_RULE_METADATA.changesets.packageScripts).every(([name, command]) => scripts[name] === command));
|
|
193
193
|
}
|
|
194
194
|
/*** Determine whether the repository participates in Changesets synchronization. */
|
|
195
195
|
function isChangesetsEnabled(scripts, changesetsConfigExists) {
|
|
196
196
|
return (changesetsConfigExists ||
|
|
197
|
-
Object.keys(
|
|
197
|
+
Object.keys(REPOSITORY_RULE_METADATA.changesets.packageScripts).some((scriptName) => scripts[scriptName] !== undefined));
|
|
198
198
|
}
|
|
199
199
|
/*** Serialize a package manifest using the repository formatting contract. */
|
|
200
200
|
function serializePackageManifest(manifest) {
|
|
@@ -53,7 +53,7 @@ exceptions or replaced by generic preferences from this skill.
|
|
|
53
53
|
reason behind a decision. Do not narrate self-explanatory code or duplicate what names and types
|
|
54
54
|
already express.
|
|
55
55
|
- Paradox documentation metadata belongs only inside `/*** ... */` comments. The canonical tag
|
|
56
|
-
vocabulary is owned by `@ankhorage/
|
|
56
|
+
vocabulary is owned by `@ankhorage/rules-documentation`: `@readme`, `@usage`, `@config`, `@title`,
|
|
57
57
|
`@see`, and `@security`. Unsupported tag-shaped lines are invalid; `@example` does not exist.
|
|
58
58
|
Do not use JSDoc-only tags such as `@param` or `@returns` as Paradox metadata.
|
|
59
59
|
- Paradox comments contain documentation prose and metadata only. Fenced or indented code blocks are
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { access } from 'node:fs/promises';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
-
import {
|
|
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
6
|
import { DEVTOOLS_BUN_RUNTIME_POLICY } from '../../policy/bunRuntimePolicy.js';
|
|
@@ -41,7 +41,7 @@ function createWorkflowDefinition(relativePath, sourcePath) {
|
|
|
41
41
|
structureReleaseCommand: await resolveStructureReleaseCommandAsync(targetDirectory),
|
|
42
42
|
bunVersion: DEVTOOLS_BUN_RUNTIME_POLICY.version,
|
|
43
43
|
doctorVersion: readCurrentDoctorVersion(),
|
|
44
|
-
nodeVersion:
|
|
44
|
+
nodeVersion: REPOSITORY_RULE_METADATA.runtime.node.setupVersion,
|
|
45
45
|
pkgvizAudit: await resolvePkgvizAuditPolicyAsync(targetDirectory),
|
|
46
46
|
}),
|
|
47
47
|
};
|
|
@@ -56,7 +56,7 @@ function createRenovateWorkflowDefinition() {
|
|
|
56
56
|
structureReleaseCommand: await resolveStructureReleaseCommandAsync(targetDirectory),
|
|
57
57
|
bunVersion: DEVTOOLS_BUN_RUNTIME_POLICY.version,
|
|
58
58
|
doctorVersion: readCurrentDoctorVersion(),
|
|
59
|
-
nodeVersion:
|
|
59
|
+
nodeVersion: REPOSITORY_RULE_METADATA.runtime.node.setupVersion,
|
|
60
60
|
}),
|
|
61
61
|
};
|
|
62
62
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
|
-
import {
|
|
2
|
+
import { REPOSITORY_RULE_METADATA } from '@ankhorage/rules-repository';
|
|
3
3
|
/*** Renders one workflow template with the canonical runtime, Doctor, and Changesets policy. */
|
|
4
4
|
export async function renderWorkflowAsync(sourceUrl, policy) {
|
|
5
5
|
const template = await readFile(sourceUrl, 'utf8');
|
|
6
6
|
const rendered = template
|
|
7
7
|
.replaceAll(BUN_VERSION_TOKEN, policy.bunVersion)
|
|
8
8
|
.replaceAll(PKGVIZ_AUDIT_STEPS_TOKEN, renderPkgvizAuditSteps(policy))
|
|
9
|
-
.replaceAll(CHANGESETS_PUBLISH_COMMAND_TOKEN,
|
|
10
|
-
.replaceAll(CHANGESETS_STATUS_COMMAND_TOKEN,
|
|
11
|
-
.replaceAll(CHANGESETS_VERSION_COMMAND_TOKEN,
|
|
9
|
+
.replaceAll(CHANGESETS_PUBLISH_COMMAND_TOKEN, REPOSITORY_RULE_METADATA.changesets.workflowCommands.publish)
|
|
10
|
+
.replaceAll(CHANGESETS_STATUS_COMMAND_TOKEN, REPOSITORY_RULE_METADATA.changesets.workflowCommands.status)
|
|
11
|
+
.replaceAll(CHANGESETS_VERSION_COMMAND_TOKEN, REPOSITORY_RULE_METADATA.changesets.workflowCommands.version)
|
|
12
12
|
.replaceAll(DOCTOR_VERSION_TOKEN, policy.doctorVersion)
|
|
13
13
|
.replaceAll('__ANKH_APM_RELEASE_COMMAND__', policy.apmReleaseCommand ?? './node_modules/.bin/ankhorage-apm-release')
|
|
14
14
|
.replaceAll('__ANKH_STRUCTURE_RELEASE_COMMAND__', policy.structureReleaseCommand ?? './node_modules/.bin/ankhorage-structure')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/devtools",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
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,9 @@
|
|
|
122
122
|
},
|
|
123
123
|
"dependencies": {
|
|
124
124
|
"@ankhorage/apm": "^0.8.13",
|
|
125
|
+
"@ankhorage/contracts": "^22.8.93",
|
|
125
126
|
"@ankhorage/project-detector": "^0.3.3",
|
|
127
|
+
"@ankhorage/rules-repository": "^0.2.0",
|
|
126
128
|
"@ankhorage/utility": "^0.5.5",
|
|
127
129
|
"@changesets/cli": "^3.0.3",
|
|
128
130
|
"@eslint/compat": "^2.1.1",
|
|
@@ -140,15 +142,13 @@
|
|
|
140
142
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
141
143
|
"knip": "^6.39.0",
|
|
142
144
|
"prettier": "^3.9.9",
|
|
143
|
-
"typescript-eslint": "^8.71.0",
|
|
144
|
-
"@ankhorage/contracts": "^22.8.93",
|
|
145
145
|
"typescript": "~6.0.3",
|
|
146
|
-
"
|
|
146
|
+
"typescript-eslint": "^8.71.0"
|
|
147
147
|
},
|
|
148
148
|
"devDependencies": {
|
|
149
|
-
"@ankhorage/paradox": "^0.2.
|
|
149
|
+
"@ankhorage/paradox": "^0.2.26",
|
|
150
150
|
"@ankhorage/ankh": "^0.10.80",
|
|
151
|
-
"@ankhorage/doctor": "0.
|
|
151
|
+
"@ankhorage/doctor": "0.12.0",
|
|
152
152
|
"@techstark/opencv-js": "^5.0.0-release.1",
|
|
153
153
|
"@types/bun": "^1.4.2",
|
|
154
154
|
"@types/node": "^26.6.4",
|