Add encryption reference and refine documentation

This commit is contained in:
rosetta
2026-07-30 18:16:03 -07:00
parent 5d26ef6d89
commit 179e2e65c6
19 changed files with 957 additions and 124 deletions

View File

@@ -1,7 +1,7 @@
import { access, mkdir, readFile, readdir, writeFile } from 'node:fs/promises';
import { basename, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { isMap, isSeq, parseDocument } from 'yaml';
import { isMap, isSeq, parseDocument, stringify } from 'yaml';
const projectRoot = resolve(fileURLToPath(new URL('..', import.meta.url)));
const sourceDirectory = resolve(
@@ -74,6 +74,10 @@ function mapNamedCollection(node, kind) {
pair.value?.commentBefore,
pair.value?.comment,
);
const yaml = stringify(
{ [name]: pair.value.toJSON() },
{ indent: 2, lineWidth: 0 },
).trimEnd();
if (kind === 'enum') {
const values = pair.value.get('values', true);
@@ -81,6 +85,7 @@ function mapNamedCollection(node, kind) {
name,
type: String(pair.value.get('type')),
description,
yaml,
values: isSeq(values)
? values.items.map((value) => {
const json = value.toJSON();
@@ -105,6 +110,7 @@ function mapNamedCollection(node, kind) {
name,
id: kind === 'packet' ? Number(pair.value.get('id')) : undefined,
description,
yaml,
fields,
};
});