@ankhorage/devtools 2.3.35 → 2.3.36
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/policy/resolveAtlasAuditPolicyAsync.d.ts +8 -0
- package/dist/policy/{resolvePkgvizAuditPolicyAsync.js → resolveAtlasAuditPolicyAsync.js} +4 -4
- package/dist/tools/workflows/files/ci.yml +1 -1
- package/dist/tools/workflows/index.js +2 -2
- package/dist/tools/workflows/renderWorkflowAsync.d.ts +1 -1
- package/dist/tools/workflows/renderWorkflowAsync.js +11 -11
- package/package.json +2 -2
- package/dist/policy/resolvePkgvizAuditPolicyAsync.d.ts +0 -8
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
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/*** Resolve the central Atlas CI audit for repositories with analyzable source. */
|
|
2
|
+
export declare function resolveAtlasAuditPolicyAsync(targetDirectory: string): Promise<AtlasAuditPolicy | undefined>;
|
|
3
|
+
interface AtlasAuditPolicy {
|
|
4
|
+
readonly artifactName: string;
|
|
5
|
+
readonly artifactPath: string;
|
|
6
|
+
readonly command: string;
|
|
7
|
+
}
|
|
8
|
+
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { stat } from 'node:fs/promises';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { REPOSITORY_RULE_METADATA } from '@ankhorage/rules-repository';
|
|
4
|
-
/*** Resolve the central
|
|
5
|
-
export async function
|
|
4
|
+
/*** Resolve the central Atlas CI audit for repositories with analyzable source. */
|
|
5
|
+
export async function resolveAtlasAuditPolicyAsync(targetDirectory) {
|
|
6
6
|
if (!(await hasSourceDirectoryAsync(targetDirectory)))
|
|
7
7
|
return undefined;
|
|
8
|
-
const { artifactName, artifactPath, command } = REPOSITORY_RULE_METADATA.
|
|
8
|
+
const { artifactName, artifactPath, command } = REPOSITORY_RULE_METADATA.atlasAudit;
|
|
9
9
|
return { artifactName, artifactPath, command };
|
|
10
10
|
}
|
|
11
|
-
/*** Detect whether the managed repository has a source tree that
|
|
11
|
+
/*** Detect whether the managed repository has a source tree that Atlas can inspect. */
|
|
12
12
|
async function hasSourceDirectoryAsync(targetDirectory) {
|
|
13
13
|
try {
|
|
14
14
|
return (await stat(join(targetDirectory, 'src'))).isDirectory();
|
|
@@ -3,7 +3,7 @@ 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 {
|
|
6
|
+
import { resolveAtlasAuditPolicyAsync } from '../../policy/resolveAtlasAuditPolicyAsync.js';
|
|
7
7
|
import { readCurrentDoctorVersion } from './readCurrentDoctorVersion.js';
|
|
8
8
|
import { renderRenovateConfigAsync } from './renderRenovateConfigAsync.js';
|
|
9
9
|
import { renderRenovateWorkflowAsync } from './renderRenovateWorkflowAsync.js';
|
|
@@ -41,7 +41,7 @@ function createWorkflowDefinition(relativePath, sourcePath) {
|
|
|
41
41
|
bunVersion: REPOSITORY_RULE_METADATA.runtime.bun.version,
|
|
42
42
|
doctorVersion: readCurrentDoctorVersion(),
|
|
43
43
|
nodeVersion: REPOSITORY_RULE_METADATA.runtime.node.setupVersion,
|
|
44
|
-
|
|
44
|
+
atlasAudit: await resolveAtlasAuditPolicyAsync(targetDirectory),
|
|
45
45
|
}),
|
|
46
46
|
};
|
|
47
47
|
}
|
|
@@ -3,7 +3,7 @@ export interface WorkflowPolicy {
|
|
|
3
3
|
readonly doctorVersion: string;
|
|
4
4
|
readonly nodeVersion: string;
|
|
5
5
|
readonly apmReleaseCommand?: string;
|
|
6
|
-
readonly
|
|
6
|
+
readonly atlasAudit?: {
|
|
7
7
|
readonly artifactName: string;
|
|
8
8
|
readonly artifactPath: string;
|
|
9
9
|
readonly command: string;
|
|
@@ -6,7 +6,7 @@ export async function renderWorkflowAsync(sourceUrl, policy) {
|
|
|
6
6
|
const template = await readFile(sourceUrl, 'utf8');
|
|
7
7
|
const rendered = template
|
|
8
8
|
.replaceAll(BUN_VERSION_TOKEN, policy.bunVersion)
|
|
9
|
-
.replaceAll(
|
|
9
|
+
.replaceAll(ATLAS_AUDIT_STEPS_TOKEN, renderAtlasAuditSteps(policy))
|
|
10
10
|
.replaceAll(CHANGESETS_PUBLISH_COMMAND_TOKEN, REPOSITORY_RULE_METADATA.changesets.workflowCommands.publish)
|
|
11
11
|
.replaceAll(CHANGESETS_STATUS_COMMAND_TOKEN, REPOSITORY_RULE_METADATA.changesets.workflowCommands.status)
|
|
12
12
|
.replaceAll(CHANGESETS_VERSION_COMMAND_TOKEN, REPOSITORY_RULE_METADATA.changesets.workflowCommands.version)
|
|
@@ -22,19 +22,19 @@ const CHANGESETS_STATUS_COMMAND_TOKEN = '__ANKH_CHANGESETS_STATUS_COMMAND__';
|
|
|
22
22
|
const CHANGESETS_VERSION_COMMAND_TOKEN = '__ANKH_CHANGESETS_VERSION_COMMAND__';
|
|
23
23
|
const DOCTOR_VERSION_TOKEN = '__ANKH_DOCTOR_VERSION__';
|
|
24
24
|
const NODE_VERSION_TOKEN = '__ANKH_NODE_VERSION__';
|
|
25
|
-
/*** Render the centrally managed
|
|
26
|
-
function
|
|
27
|
-
if (policy.
|
|
25
|
+
/*** Render the centrally managed Atlas audit steps only for applicable repositories. */
|
|
26
|
+
function renderAtlasAuditSteps(policy) {
|
|
27
|
+
if (policy.atlasAudit === undefined)
|
|
28
28
|
return '';
|
|
29
|
-
return ` - name: Enforce
|
|
30
|
-
run: ${policy.
|
|
29
|
+
return ` - name: Enforce Atlas cyclic-dependencies rule
|
|
30
|
+
run: ${policy.atlasAudit.command}
|
|
31
31
|
|
|
32
|
-
- name: Upload
|
|
33
|
-
if: always() && hashFiles('${policy.
|
|
32
|
+
- name: Upload Atlas audit
|
|
33
|
+
if: always() && hashFiles('${policy.atlasAudit.artifactPath}') != ''
|
|
34
34
|
uses: actions/upload-artifact@v4
|
|
35
35
|
with:
|
|
36
|
-
name: ${policy.
|
|
37
|
-
path: ${policy.
|
|
36
|
+
name: ${policy.atlasAudit.artifactName}
|
|
37
|
+
path: ${policy.atlasAudit.artifactPath}
|
|
38
38
|
`;
|
|
39
39
|
}
|
|
40
|
-
const
|
|
40
|
+
const ATLAS_AUDIT_STEPS_TOKEN = ' # __ANKH_ATLAS_AUDIT_STEPS__';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/devtools",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.36",
|
|
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",
|
|
@@ -494,7 +494,7 @@
|
|
|
494
494
|
"@ankhorage/capability": "^0.2.2",
|
|
495
495
|
"@ankhorage/contracts": "^26.3.0",
|
|
496
496
|
"@ankhorage/project-detector": "^0.3.5",
|
|
497
|
-
"@ankhorage/rules-repository": "
|
|
497
|
+
"@ankhorage/rules-repository": "0.2.3",
|
|
498
498
|
"@ankhorage/utility": "^0.5.5",
|
|
499
499
|
"@changesets/cli": "^3.0.3",
|
|
500
500
|
"@eslint/compat": "^2.1.1",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/*** Resolve the central PKGViz CI audit for repositories with analyzable source. */
|
|
2
|
-
export declare function resolvePkgvizAuditPolicyAsync(targetDirectory: string): Promise<PkgvizAuditPolicy | undefined>;
|
|
3
|
-
interface PkgvizAuditPolicy {
|
|
4
|
-
readonly artifactName: string;
|
|
5
|
-
readonly artifactPath: string;
|
|
6
|
-
readonly command: string;
|
|
7
|
-
}
|
|
8
|
-
export {};
|