@ankhorage/devtools 2.3.5 → 2.3.6
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
|
-
         
|
|
7
7
|
|
|
8
8
|
Shared tooling, repository automation, and agent standards for Ankhorage TypeScript projects
|
|
9
9
|
|
|
@@ -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__';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/devtools",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.6",
|
|
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",
|