@stephansama/auto-readme 0.1.0 → 0.2.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 +127 -93
- package/config/schema.cjs +1 -0
- package/config/schema.cjs.map +1 -1
- package/config/schema.d.cts +2 -0
- package/config/schema.d.ts +2 -0
- package/config/schema.js +1 -0
- package/config/schema.js.map +1 -1
- package/config/schema.json +1 -1
- package/config/schema.yaml +6 -0
- package/dist/index.cjs +87 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +88 -38
- package/dist/index.js.map +1 -1
- package/package.json +11 -4
package/dist/index.js
CHANGED
|
@@ -5,31 +5,11 @@ import * as fsp3 from "fs/promises";
|
|
|
5
5
|
import ora from "ora";
|
|
6
6
|
|
|
7
7
|
// src/args.ts
|
|
8
|
+
import debug from "debug";
|
|
8
9
|
import yargs from "yargs";
|
|
9
10
|
import { hideBin } from "yargs/helpers";
|
|
10
11
|
import z2 from "zod";
|
|
11
12
|
|
|
12
|
-
// src/log.ts
|
|
13
|
-
import chalk from "chalk";
|
|
14
|
-
var verbosity = 0;
|
|
15
|
-
function ERROR(...rest) {
|
|
16
|
-
const [first, ...remaining] = rest;
|
|
17
|
-
console.error(chalk.red(first), ...remaining);
|
|
18
|
-
}
|
|
19
|
-
function INFO(...rest) {
|
|
20
|
-
if (verbosity < 1) return;
|
|
21
|
-
const [first, ...remaining] = rest;
|
|
22
|
-
console.info(chalk.blue(first), ...remaining);
|
|
23
|
-
}
|
|
24
|
-
function setVerbosity(input) {
|
|
25
|
-
verbosity = input;
|
|
26
|
-
}
|
|
27
|
-
function WARN(...rest) {
|
|
28
|
-
if (verbosity < 1) return;
|
|
29
|
-
const [first, ...remaining] = rest;
|
|
30
|
-
console.warn(chalk.yellow(first), ...remaining);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
13
|
// src/schema.js
|
|
34
14
|
import { z } from "zod";
|
|
35
15
|
var actionsSchema = z.enum(["ACTION", "PKG", "USAGE", "WORKSPACE", "ZOD"]).describe("Comment action options");
|
|
@@ -72,6 +52,7 @@ var defaultTemplates = templatesSchema.parse({});
|
|
|
72
52
|
var defaultTableHeadings = tableHeadingsSchema.parse(void 0);
|
|
73
53
|
var _configSchema = z.object({
|
|
74
54
|
affectedRegexes: z.string().array().optional().default([]),
|
|
55
|
+
collapseHeadings: z.string().array().optional().default([]),
|
|
75
56
|
defaultLanguage: languageSchema.meta({
|
|
76
57
|
alias: "l",
|
|
77
58
|
description: "Default language to infer projects from"
|
|
@@ -122,7 +103,12 @@ var _configSchema = z.object({
|
|
|
122
103
|
var configSchema = _configSchema.optional();
|
|
123
104
|
|
|
124
105
|
// src/args.ts
|
|
125
|
-
var complexOptions = [
|
|
106
|
+
var complexOptions = [
|
|
107
|
+
"affectedRegexes",
|
|
108
|
+
"collapseHeadings",
|
|
109
|
+
"headings",
|
|
110
|
+
"templates"
|
|
111
|
+
];
|
|
126
112
|
var args = {
|
|
127
113
|
...zodToYargs(),
|
|
128
114
|
changes: {
|
|
@@ -142,7 +128,7 @@ var args = {
|
|
|
142
128
|
async function parseArgs() {
|
|
143
129
|
const yargsInstance = yargs(hideBin(process.argv)).options(args).help("h").alias("h", "help").epilogue(`--> @stephansama open-source ${(/* @__PURE__ */ new Date()).getFullYear()}`);
|
|
144
130
|
const parsed = await yargsInstance.wrap(yargsInstance.terminalWidth()).parse();
|
|
145
|
-
if (parsed.verbose)
|
|
131
|
+
if (parsed.verbose) debug.enable("autoreadme*");
|
|
146
132
|
return parsed;
|
|
147
133
|
}
|
|
148
134
|
function zodToYargs() {
|
|
@@ -167,10 +153,31 @@ function zodToYargs() {
|
|
|
167
153
|
return Object.fromEntries(entries);
|
|
168
154
|
}
|
|
169
155
|
|
|
156
|
+
// src/comment.ts
|
|
157
|
+
import { commentMarker } from "mdast-comment-marker";
|
|
158
|
+
|
|
159
|
+
// src/log.ts
|
|
160
|
+
import debug2 from "debug";
|
|
161
|
+
var error = debug2("autoreadme:error");
|
|
162
|
+
var info = debug2("autoreadme:info");
|
|
163
|
+
var warn = debug2("autoreadme:warn");
|
|
164
|
+
function ERROR(...rest) {
|
|
165
|
+
const [first, ...remaining] = rest;
|
|
166
|
+
error(`${first} %O`, ...remaining);
|
|
167
|
+
}
|
|
168
|
+
function INFO(...rest) {
|
|
169
|
+
const [first, ...remaining] = rest;
|
|
170
|
+
info(`${first} %O`, ...remaining);
|
|
171
|
+
}
|
|
172
|
+
function WARN(...rest) {
|
|
173
|
+
const [first, ...remaining] = rest;
|
|
174
|
+
warn(`${first} %O`, ...remaining);
|
|
175
|
+
}
|
|
176
|
+
|
|
170
177
|
// src/comment.ts
|
|
171
178
|
var SEPARATOR = "-";
|
|
172
179
|
function loadAstComments(root) {
|
|
173
|
-
return root.children.map((child) => child.type === "html" && getComment(child
|
|
180
|
+
return root.children.map((child) => child.type === "html" && getComment(child)).filter((f) => f !== false);
|
|
174
181
|
}
|
|
175
182
|
function parseComment(comment) {
|
|
176
183
|
const input = trimComment(comment);
|
|
@@ -194,19 +201,26 @@ function trimComment(comment) {
|
|
|
194
201
|
return comment.replace(startComment, "").replace(/start|end/, "").replace(endComment, "").trim();
|
|
195
202
|
}
|
|
196
203
|
function getComment(comment) {
|
|
197
|
-
|
|
204
|
+
if (!isComment(comment.value)) return false;
|
|
205
|
+
const marker = commentMarker(comment);
|
|
206
|
+
if (!marker) return false;
|
|
207
|
+
return parseComment(comment.value);
|
|
198
208
|
}
|
|
199
209
|
function isComment(comment) {
|
|
200
210
|
return comment.startsWith(startComment) && comment.endsWith(endComment);
|
|
201
211
|
}
|
|
202
212
|
|
|
203
213
|
// src/config.ts
|
|
204
|
-
import
|
|
214
|
+
import toml from "@iarna/toml";
|
|
215
|
+
import { cosmiconfig, getDefaultSearchPlaces } from "cosmiconfig";
|
|
205
216
|
import deepmerge from "deepmerge";
|
|
217
|
+
var moduleName = "autoreadme";
|
|
218
|
+
var searchPlaces = getSearchPlaces();
|
|
219
|
+
var loaders = { [".toml"]: loadToml };
|
|
206
220
|
async function loadConfig(args2) {
|
|
207
|
-
const opts2 = {};
|
|
221
|
+
const opts2 = { loaders, searchPlaces };
|
|
208
222
|
if (args2.config) opts2.searchPlaces = [args2.config];
|
|
209
|
-
const explorer = cosmiconfig(
|
|
223
|
+
const explorer = cosmiconfig(moduleName, opts2);
|
|
210
224
|
const search = await explorer.search();
|
|
211
225
|
if (!search) {
|
|
212
226
|
const location = args2.config ? " at location: " + args2.config : "";
|
|
@@ -224,6 +238,21 @@ async function loadConfig(args2) {
|
|
|
224
238
|
})
|
|
225
239
|
);
|
|
226
240
|
}
|
|
241
|
+
function loadToml(_filepath, content) {
|
|
242
|
+
return toml.parse(content);
|
|
243
|
+
}
|
|
244
|
+
function getSearchPlaces() {
|
|
245
|
+
return [
|
|
246
|
+
...getDefaultSearchPlaces(moduleName),
|
|
247
|
+
`.${moduleName}rc.toml`,
|
|
248
|
+
`.config/.${moduleName}rc`,
|
|
249
|
+
`.config/${moduleName}rc.toml`,
|
|
250
|
+
`.config/.${moduleName}rc.toml`,
|
|
251
|
+
`.config/.${moduleName}rc.json`,
|
|
252
|
+
`.config/.${moduleName}rc.yaml`,
|
|
253
|
+
`.config/.${moduleName}rc.yml`
|
|
254
|
+
];
|
|
255
|
+
}
|
|
227
256
|
function removeFalsy(obj) {
|
|
228
257
|
return Object.fromEntries(
|
|
229
258
|
Object.entries(obj).map(([k, v]) => !v ? false : [k, v]).filter((e) => Boolean(e))
|
|
@@ -362,8 +391,8 @@ async function loadActionData(actions, file, root) {
|
|
|
362
391
|
}
|
|
363
392
|
const inputPath = find("path");
|
|
364
393
|
if (!inputPath) {
|
|
365
|
-
const
|
|
366
|
-
throw new Error(
|
|
394
|
+
const error2 = `no path found for zod table at markdown file ${file}`;
|
|
395
|
+
throw new Error(error2);
|
|
367
396
|
}
|
|
368
397
|
const body = await zod2md({
|
|
369
398
|
entry: path2.resolve(path2.dirname(file), inputPath),
|
|
@@ -387,8 +416,8 @@ async function loadActionYaml(baseDir) {
|
|
|
387
416
|
const actualPath = await fileExists(actionYamlPath) && actionYamlPath || await fileExists(actionYmlPath) && actionYmlPath;
|
|
388
417
|
if (!actualPath) {
|
|
389
418
|
const locations = [actionYmlPath, actionYamlPath];
|
|
390
|
-
const
|
|
391
|
-
throw new Error(
|
|
419
|
+
const error2 = `no yaml file found at locations: ${locations}`;
|
|
420
|
+
throw new Error(error2);
|
|
392
421
|
}
|
|
393
422
|
const actionFile = await fsp2.readFile(actualPath, { encoding: "utf8" });
|
|
394
423
|
return yaml.parse(actionFile);
|
|
@@ -397,9 +426,11 @@ async function loadActionYaml(baseDir) {
|
|
|
397
426
|
// src/pipeline.ts
|
|
398
427
|
import * as path4 from "path";
|
|
399
428
|
import { remark } from "remark";
|
|
429
|
+
import remarkCodeImport from "remark-code-import";
|
|
400
430
|
import remarkCollapse from "remark-collapse";
|
|
401
431
|
import remarkToc from "remark-toc";
|
|
402
432
|
import remarkUsage from "remark-usage";
|
|
433
|
+
import { VFile } from "vfile";
|
|
403
434
|
|
|
404
435
|
// src/plugin.ts
|
|
405
436
|
import Handlebars from "handlebars";
|
|
@@ -569,7 +600,7 @@ function loadTemplates(templates) {
|
|
|
569
600
|
|
|
570
601
|
// src/pipeline.ts
|
|
571
602
|
async function parse2(file, filepath, root, config, data) {
|
|
572
|
-
const pipeline = remark().use(autoReadmeRemarkPlugin, config, data);
|
|
603
|
+
const pipeline = remark().use(autoReadmeRemarkPlugin, config, data).use(remarkCodeImport, {});
|
|
573
604
|
const usage = data.find((d) => d.action === "USAGE");
|
|
574
605
|
if (usage?.action === "USAGE" || config.enableUsage) {
|
|
575
606
|
const find = createFindParameter(usage?.parameters || []);
|
|
@@ -578,7 +609,7 @@ async function parse2(file, filepath, root, config, data) {
|
|
|
578
609
|
const resolvePath = examplePath && path4.resolve(dirname4, examplePath);
|
|
579
610
|
const relativeProjectPath = config.usageFile && path4.relative(root, path4.resolve(dirname4, config.usageFile));
|
|
580
611
|
const example = examplePath && resolvePath && path4.relative(root, resolvePath) || relativeProjectPath || void 0;
|
|
581
|
-
if (await fileExists(example
|
|
612
|
+
if (example && await fileExists(example)) {
|
|
582
613
|
INFO("generating usage section");
|
|
583
614
|
pipeline.use(remarkUsage, {
|
|
584
615
|
example,
|
|
@@ -590,10 +621,23 @@ async function parse2(file, filepath, root, config, data) {
|
|
|
590
621
|
}
|
|
591
622
|
if (config.enableToc) {
|
|
592
623
|
INFO("generating table of contents section");
|
|
593
|
-
pipeline.use(remarkToc, { heading: config.tocHeading })
|
|
624
|
+
pipeline.use(remarkToc, { heading: config.tocHeading });
|
|
594
625
|
}
|
|
595
|
-
|
|
596
|
-
|
|
626
|
+
if (config.enableToc || config.collapseHeadings?.length) {
|
|
627
|
+
const additional = config.collapseHeadings?.length ? config.collapseHeadings : [];
|
|
628
|
+
const headings = [...additional, config.tocHeading];
|
|
629
|
+
pipeline.use(remarkCollapse, {
|
|
630
|
+
test: {
|
|
631
|
+
ignoreFinalDefinitions: true,
|
|
632
|
+
test: (value, _) => {
|
|
633
|
+
return headings.some((i) => value.trim() === i?.trim());
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
const vfile = new VFile({ path: path4.resolve(filepath), value: file });
|
|
639
|
+
const markdown = await pipeline.process(vfile);
|
|
640
|
+
return markdown.toString();
|
|
597
641
|
}
|
|
598
642
|
|
|
599
643
|
// src/index.ts
|
|
@@ -632,7 +676,13 @@ async function run() {
|
|
|
632
676
|
await fsp3.writeFile(path5, content);
|
|
633
677
|
})
|
|
634
678
|
);
|
|
635
|
-
|
|
679
|
+
const opts2 = { stdio: "inherit" };
|
|
680
|
+
INFO("formatting with prettier");
|
|
681
|
+
cp2.execFileSync("prettier", ["--write", ...paths], opts2);
|
|
682
|
+
if (isAffected) {
|
|
683
|
+
INFO("adding affected files to git stage");
|
|
684
|
+
cp2.execFileSync("git", ["add", ...paths], opts2);
|
|
685
|
+
}
|
|
636
686
|
if (spinner) spinner.stop();
|
|
637
687
|
}
|
|
638
688
|
export {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/args.ts","../src/log.ts","../src/schema.js","../src/comment.ts","../src/config.ts","../src/data.ts","../src/utils.ts","../src/pipeline.ts","../src/plugin.ts"],"sourcesContent":["import { fromMarkdown } from \"mdast-util-from-markdown\";\nimport * as cp from \"node:child_process\";\nimport * as fsp from \"node:fs/promises\";\nimport ora from \"ora\";\n\nimport type { Config } from \"./schema\";\n\nimport { parseArgs } from \"./args\";\nimport { loadAstComments } from \"./comment\";\nimport { loadConfig } from \"./config\";\nimport { loadActionData } from \"./data\";\nimport { ERROR, INFO, WARN } from \"./log\";\nimport { parse } from \"./pipeline\";\nimport { findAffectedMarkdowns, getGitRoot, getMarkdownPaths } from \"./utils\";\n\nexport async function run() {\n\tconst args = await parseArgs();\n\tconst config: Config = (await loadConfig(args)) || {};\n\n\tINFO(\"Loaded the following configuration:\", config);\n\n\tconst root = getGitRoot();\n\n\tconst isAffected = args.changes ? \"affected\" : \"\";\n\n\tINFO(`Loading ${!isAffected ? \"all \" : \"affected \"}files`);\n\n\tconst paths = isAffected\n\t\t? findAffectedMarkdowns(root, config)\n\t\t: await getMarkdownPaths(root, config);\n\n\tINFO(\"Loaded the following files:\", paths.join(\"\\n\"));\n\n\tconst type = args.onlyReadmes ? \"readmes\" : \"all markdown files\";\n\n\tif (!paths.length) {\n\t\treturn ERROR(`no ${isAffected} readmes found to update`);\n\t}\n\n\tconst spinner = !args.verbose && ora(`Updating ${type}`).start();\n\n\tawait Promise.all(\n\t\tpaths.map(async (path) => {\n\t\t\tconst file = await fsp.readFile(path, { encoding: \"utf8\" });\n\t\t\t// get rid of ast via garbage collector faster\n\t\t\tconst actions = (() => {\n\t\t\t\tconst ast = fromMarkdown(file);\n\t\t\t\treturn loadAstComments(ast);\n\t\t\t})();\n\n\t\t\tif (!actions.length) {\n\t\t\t\tWARN(`no action comments found in`, path);\n\t\t\t\tif (!config.enableUsage || !config.enableToc) {\n\t\t\t\t\treturn ERROR(\"no action or plugins found\");\n\t\t\t\t} else {\n\t\t\t\t\tINFO(\"plugins enabled. continuing parsing\", path);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst data = await loadActionData(actions, path, root);\n\n\t\t\tINFO(\"Loaded comment action data\", data);\n\n\t\t\tconst content = await parse(file, path, root, config, data);\n\t\t\tawait fsp.writeFile(path, content);\n\t\t}),\n\t);\n\n\tif (isAffected) cp.execFileSync(\"git\", [\"add\", ...paths]);\n\n\tif (spinner) spinner.stop();\n}\n","import yargs, { type Options } from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport z from \"zod\";\n\nimport { setVerbosity } from \"./log\";\nimport { configSchema } from \"./schema\";\n\nexport type Args = Awaited<ReturnType<typeof parseArgs>>;\n\nconst complexOptions = [\"affectedRegexes\", \"templates\", \"headings\"] as const;\n\ntype ComplexOptions = (typeof complexOptions)[number];\n\nconst args = {\n\t...zodToYargs(),\n\tchanges: {\n\t\talias: \"g\",\n\t\tdefault: false,\n\t\tdescription: \"Check only changed git files\",\n\t\ttype: \"boolean\",\n\t},\n\tcheck: {\n\t\talias: \"k\",\n\t\tdefault: false,\n\t\tdescription: \"Do not write to files. Only check for changes\",\n\t\ttype: \"boolean\",\n\t},\n\tconfig: { alias: \"c\", description: \"Path to config file\", type: \"string\" },\n} satisfies Record<string, Options>;\n\nexport async function parseArgs() {\n\tconst yargsInstance = yargs(hideBin(process.argv))\n\t\t.options(args)\n\t\t.help(\"h\")\n\t\t.alias(\"h\", \"help\")\n\t\t.epilogue(`--> @stephansama open-source ${new Date().getFullYear()}`);\n\n\tconst parsed = await yargsInstance\n\t\t.wrap(yargsInstance.terminalWidth())\n\t\t.parse();\n\n\tif (parsed.verbose) setVerbosity(1);\n\n\treturn parsed;\n}\n\nexport function zodToYargs(): Omit<\n\tRecord<keyof typeof shape, Options>,\n\tComplexOptions\n> {\n\tconst { shape } = configSchema.unwrap();\n\tconst entries = Object.entries(shape).map(([key, value]) => {\n\t\tif (complexOptions.includes(key as ComplexOptions)) return [];\n\t\tif (value.def.innerType instanceof z.ZodObject) return [];\n\t\tconst meta = value.meta();\n\t\tconst { innerType } = value.def;\n\t\tconst isBoolean = innerType instanceof z.ZodBoolean;\n\t\tconst isNumber = innerType instanceof z.ZodNumber;\n\t\tconst isArray = innerType instanceof z.ZodArray;\n\n\t\tconst yargType: Options[\"type\"] =\n\t\t\t(isArray && \"array\") ||\n\t\t\t(isNumber && \"number\") ||\n\t\t\t(isBoolean && \"boolean\") ||\n\t\t\t\"string\";\n\n\t\tconst options: Options = {\n\t\t\tdefault: value.def.defaultValue,\n\t\t\ttype: yargType,\n\t\t};\n\n\t\tif (meta?.alias) options.alias = meta.alias as string;\n\t\tif (meta?.description) options.description = meta.description;\n\n\t\treturn [key, options];\n\t});\n\n\treturn Object.fromEntries(entries);\n}\n","import chalk from \"chalk\";\n\nlet verbosity = 0;\n\nexport function ERROR(...rest: unknown[]) {\n\tconst [first, ...remaining] = rest;\n\tconsole.error(chalk.red(first), ...remaining);\n}\n\nexport function INFO(...rest: unknown[]) {\n\tif (verbosity < 1) return;\n\tconst [first, ...remaining] = rest;\n\tconsole.info(chalk.blue(first), ...remaining);\n}\n\nexport function setVerbosity(input: number) {\n\tverbosity = input;\n}\n\nexport function WARN(...rest: unknown[]) {\n\tif (verbosity < 1) return;\n\tconst [first, ...remaining] = rest;\n\tconsole.warn(chalk.yellow(first), ...remaining);\n}\n","import { z } from \"zod\";\n\nexport const actionsSchema = z\n\t.enum([\"ACTION\", \"PKG\", \"USAGE\", \"WORKSPACE\", \"ZOD\"])\n\t.describe(\"Comment action options\");\n\nexport const formatsSchema = z\n\t.enum([\"LIST\", \"TABLE\"])\n\t.default(\"TABLE\")\n\t.optional();\n\nexport const languageSchema = z.enum([\"JS\", \"RS\"]).optional().default(\"JS\");\n\nexport const headingsSchema = z\n\t.enum([\n\t\t\"default\",\n\t\t\"description\",\n\t\t\"devDependency\",\n\t\t\"downloads\",\n\t\t\"name\",\n\t\t\"private\",\n\t\t\"required\",\n\t\t\"version\",\n\t])\n\t.describe(\"Table heading options\");\n\nexport const tableHeadingsSchema = z\n\t.record(actionsSchema, headingsSchema.array().optional())\n\t.optional()\n\t.describe(\"Table heading action configuration\")\n\t.default({\n\t\tACTION: [\"name\", \"required\", \"default\", \"description\"],\n\t\tPKG: [\"name\", \"version\", \"devDependency\"],\n\t\tWORKSPACE: [\"name\", \"version\", \"downloads\", \"description\"],\n\t\tZOD: [],\n\t});\n\nexport const templatesSchema = z.object({\n\tdownloadImage: z\n\t\t.string()\n\t\t.optional()\n\t\t.default(\"https://img.shields.io/npm/dw/{{name}}?labelColor=211F1F\"),\n\temojis: z\n\t\t.record(headingsSchema, z.string())\n\t\t.optional()\n\t\t.describe(\"Table heading emojis used when enabled\")\n\t\t.default({\n\t\t\tdefault: \"⚙️\",\n\t\t\tdescription: \"📝\",\n\t\t\tdevDependency: \"💻\",\n\t\t\tdownloads: \"📥\",\n\t\t\tname: \"🏷️\",\n\t\t\tprivate: \"🔒\",\n\t\t\trequired: \"\",\n\t\t\tversion: \"\",\n\t\t}),\n\tregistryUrl: z\n\t\t.string()\n\t\t.optional()\n\t\t.default(\"https://www.npmjs.com/package/{{name}}\"),\n\tversionImage: z\n\t\t.string()\n\t\t.optional()\n\t\t.default(\n\t\t\t\"https://img.shields.io/npm/v/{{uri_name}}?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F\",\n\t\t),\n});\n\nexport const defaultTemplates = templatesSchema.parse({});\nexport const defaultTableHeadings = tableHeadingsSchema.parse(undefined);\n\nconst _configSchema = z.object({\n\taffectedRegexes: z.string().array().optional().default([]),\n\tdefaultLanguage: languageSchema.meta({\n\t\talias: \"l\",\n\t\tdescription: \"Default language to infer projects from\",\n\t}),\n\tdisableEmojis: z.boolean().default(false).meta({\n\t\talias: \"e\",\n\t\tdescription: \"Whether or not to use emojis in markdown table headings\",\n\t}),\n\tdisableMarkdownHeadings: z.boolean().default(false).meta({\n\t\tdescription: \"Whether or not to display markdown headings\",\n\t}),\n\tenableToc: z.boolean().default(false).meta({\n\t\talias: \"t\",\n\t\tdescription: \"generate table of contents for readmes\",\n\t}),\n\tenableUsage: z.boolean().optional().default(false).meta({\n\t\tdescription: \"Whether or not to enable usage plugin\",\n\t}),\n\theadings: tableHeadingsSchema\n\t\t.optional()\n\t\t.default(defaultTableHeadings)\n\t\t.describe(\"List of headings for different table outputs\"),\n\tonlyReadmes: z.boolean().default(true).meta({\n\t\talias: \"r\",\n\t\tdescription: \"Whether or not to only traverse readmes\",\n\t}),\n\tonlyShowPublicPackages: z.boolean().default(false).meta({\n\t\talias: \"p\",\n\t\tdescription: \"Only show public packages in workspaces\",\n\t}),\n\tremoveScope: z.string().optional().default(\"\").meta({\n\t\tdescription: \"Remove common workspace scope\",\n\t}),\n\ttemplates: templatesSchema\n\t\t.optional()\n\t\t.default(defaultTemplates)\n\t\t.describe(\n\t\t\t\"Handlebars templates used to fuel list and table generation\",\n\t\t),\n\ttocHeading: z.string().optional().default(\"Table of contents\").meta({\n\t\tdescription: \"Markdown heading used to generate table of contents\",\n\t}),\n\tusageFile: z.string().optional().default(\"\").meta({\n\t\tdescription: \"Workspace level usage file\",\n\t}),\n\tusageHeading: z.string().optional().default(\"Usage\").meta({\n\t\tdescription: \"Markdown heading used to generate usage example\",\n\t}),\n\tverbose: z.boolean().default(false).meta({\n\t\talias: \"v\",\n\t\tdescription: \"whether or not to display verbose logging\",\n\t}),\n});\n\nexport const configSchema = _configSchema.optional();\n\n/** @typedef {Partial<z.infer<typeof _configSchema>>} Config */\n","import type { Root } from \"mdast\";\n\nimport { INFO } from \"./log\";\nimport { actionsSchema, formatsSchema, languageSchema } from \"./schema\";\n\nexport const SEPARATOR = \"-\" as const;\n\nexport type AstComments = ReturnType<typeof loadAstComments>;\n\nexport function loadAstComments(root: Root) {\n\treturn root.children\n\t\t.map((child) => child.type === \"html\" && getComment(child.value))\n\t\t.filter((f): f is ReturnType<typeof parseComment> => f !== false);\n}\n\nexport function parseComment(comment: string) {\n\tconst input = trimComment(comment);\n\tconst [type, ...parameters] = input.split(\" \");\n\tconst [first, second, third] = type.split(SEPARATOR);\n\n\tINFO(\"parsing inputs\", { first, second, third });\n\n\tconst languageInput = third ? first : undefined;\n\tconst actionInput = third ? second : first;\n\tconst formatInput = third ? third : second;\n\tconst language = languageSchema.parse(languageInput);\n\tconst action = actionsSchema.parse(actionInput);\n\tconst format = formatsSchema.parse(formatInput);\n\tconst isStart = comment.includes(\"start\");\n\tconst parsed = { action, format, isStart, language, parameters };\n\n\tINFO(`Parsed comment ${comment}`, parsed);\n\n\treturn parsed;\n}\n\nconst startComment = \"<!--\";\nconst endComment = \"-->\";\n\nexport function trimComment(comment: string) {\n\treturn comment\n\t\t.replace(startComment, \"\")\n\t\t.replace(/start|end/, \"\")\n\t\t.replace(endComment, \"\")\n\t\t.trim();\n}\n\nfunction getComment(comment: string) {\n\treturn isComment(comment) && parseComment(comment);\n}\n\nfunction isComment(comment: string) {\n\treturn comment.startsWith(startComment) && comment.endsWith(endComment);\n}\n","import { cosmiconfig, type Options } from \"cosmiconfig\";\nimport deepmerge from \"deepmerge\";\n\nimport type { Args } from \"./args\";\n\nimport { INFO, WARN } from \"./log\";\nimport { configSchema } from \"./schema\";\n\nexport async function loadConfig(args: Partial<Args>) {\n\tconst opts: Partial<Options> = {};\n\n\tif (args.config) opts.searchPlaces = [args.config];\n\n\tconst explorer = cosmiconfig(\"autoreadme\", opts);\n\n\tconst search = await explorer.search();\n\n\tif (!search) {\n\t\tconst location = args.config ? \" at location: \" + args.config : \"\";\n\t\tWARN(`no config file found`, location);\n\t\tINFO(\"using default configuration\");\n\t} else {\n\t\tINFO(\"found configuration file at: \", search.filepath);\n\t\tINFO(\"loaded cosmiconfig\", search.config);\n\t}\n\n\targs = removeFalsy(args);\n\n\tINFO(\"merging config with args\", args);\n\n\treturn configSchema.parse(\n\t\tdeepmerge(search?.config || {}, args, {\n\t\t\tarrayMerge: (_, sourceArray) => sourceArray,\n\t\t}),\n\t);\n}\n\nexport function removeFalsy(obj: object) {\n\treturn Object.fromEntries(\n\t\tObject.entries(obj)\n\t\t\t.map(([k, v]) => (!v ? false : [k, v]))\n\t\t\t.filter((e): e is [string, unknown] => Boolean(e)),\n\t);\n}\n","import { getPackages } from \"@manypkg/get-packages\";\nimport * as fs from \"node:fs\";\nimport * as fsp from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport { readPackageJSON } from \"pkg-types\";\nimport * as yaml from \"yaml\";\nimport { zod2md } from \"zod2md\";\n\nimport type { AstComments } from \"./comment\";\n\nimport { fileExists } from \"./utils\";\n\nexport type ActionData = Awaited<ReturnType<typeof loadActionData>>;\n\nexport type ActionTableHeading = \"name\" | keyof ActionInput;\n\nexport type ActionYaml = { inputs?: Record<string, ActionInput> };\n\ntype ActionInput = {\n\tdefault?: string;\n\tdescription?: string;\n\trequired?: boolean;\n};\n\nexport function createFindParameter(parameterList: string[]) {\n\treturn function (parameterName: string) {\n\t\treturn parameterList\n\t\t\t?.find((p) => p.startsWith(parameterName))\n\t\t\t?.replace(parameterName + \"=\", \"\")\n\t\t\t?.replace(/\"/gi, \"\")\n\t\t\t?.replace(/_/gi, \" \");\n\t};\n}\n\nexport async function loadActionData(\n\tactions: AstComments,\n\tfile: string,\n\troot: string,\n) {\n\tconst startActions = actions.filter((action) => action.isStart);\n\treturn await Promise.all(\n\t\tstartActions.map(async (action) => {\n\t\t\tconst find = createFindParameter(action.parameters);\n\t\t\tswitch (action.action) {\n\t\t\t\tcase \"ACTION\": {\n\t\t\t\t\tconst baseDir = path.dirname(file);\n\t\t\t\t\tconst actionYaml = await loadActionYaml(baseDir);\n\t\t\t\t\treturn {\n\t\t\t\t\t\taction: action.action,\n\t\t\t\t\t\tactionYaml,\n\t\t\t\t\t\tparameters: action.parameters,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tcase \"PKG\": {\n\t\t\t\t\tconst inputPath = find(\"path\");\n\t\t\t\t\tconst filename = inputPath\n\t\t\t\t\t\t? path.resolve(path.dirname(file), inputPath)\n\t\t\t\t\t\t: path.dirname(file);\n\t\t\t\t\tconst pkgJson = await readPackageJSON(filename);\n\t\t\t\t\treturn {\n\t\t\t\t\t\taction: action.action,\n\t\t\t\t\t\tparameters: action.parameters,\n\t\t\t\t\t\tpkgJson,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tcase \"USAGE\": {\n\t\t\t\t\treturn {\n\t\t\t\t\t\taction: action.action,\n\t\t\t\t\t\tparameters: action.parameters,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tcase \"WORKSPACE\": {\n\t\t\t\t\tconst workspaces = await getPackages(process.cwd());\n\t\t\t\t\tconst pnpmPath = path.resolve(root, \"pnpm-workspace.yaml\");\n\t\t\t\t\tconst isPnpm = fs.existsSync(pnpmPath);\n\t\t\t\t\treturn {\n\t\t\t\t\t\taction: action.action,\n\t\t\t\t\t\tisPnpm,\n\t\t\t\t\t\tparameters: action.parameters,\n\t\t\t\t\t\troot,\n\t\t\t\t\t\tworkspaces,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tcase \"ZOD\": {\n\t\t\t\t\tif (action.format === \"LIST\") {\n\t\t\t\t\t\tthrow new Error(\"cannot display zod in list format\");\n\t\t\t\t\t}\n\n\t\t\t\t\tconst inputPath = find(\"path\");\n\t\t\t\t\tif (!inputPath) {\n\t\t\t\t\t\tconst error = `no path found for zod table at markdown file ${file}`;\n\t\t\t\t\t\tthrow new Error(error);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst body = await zod2md({\n\t\t\t\t\t\tentry: path.resolve(path.dirname(file), inputPath),\n\t\t\t\t\t\ttitle: find(\"title\") || \"Zod Schema\",\n\t\t\t\t\t});\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\taction: action.action,\n\t\t\t\t\t\tbody,\n\t\t\t\t\t\tparameters: action.parameters,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error(\"feature not yet implemented\");\n\t\t\t}\n\t\t}),\n\t);\n}\n\nasync function loadActionYaml(baseDir: string) {\n\tconst actionYmlPath = path.resolve(baseDir, \"action.yml\");\n\tconst actionYamlPath = path.resolve(baseDir, \"action.yaml\");\n\tconst actualPath =\n\t\t((await fileExists(actionYamlPath)) && actionYamlPath) ||\n\t\t((await fileExists(actionYmlPath)) && actionYmlPath);\n\n\tif (!actualPath) {\n\t\tconst locations = [actionYmlPath, actionYamlPath];\n\t\tconst error = `no yaml file found at locations: ${locations}`;\n\t\tthrow new Error(error);\n\t}\n\n\tconst actionFile = await fsp.readFile(actualPath, { encoding: \"utf8\" });\n\n\treturn yaml.parse(actionFile) as ActionYaml;\n}\n","import glob from \"fast-glob\";\nimport * as cp from \"node:child_process\";\nimport * as fs from \"node:fs\";\nimport * as fsp from \"node:fs/promises\";\nimport * as path from \"node:path\";\n\nimport type { Config } from \"./schema\";\n\nimport { ERROR, INFO } from \"./log\";\n\nconst sh = String.raw;\n\nconst opts: { encoding: BufferEncoding } = { encoding: \"utf8\" };\n\nconst ignore = [\"**/node_modules/**\"];\n\nconst matches = [\n\t/.*README\\.md$/gi,\n\t/.*Cargo\\.toml$/gi,\n\t/.*action\\.ya?ml$/gi,\n\t/.*package\\.json$/gi,\n\t/.*pnpm-workspace\\.yaml$/gi,\n];\n\nexport async function fileExists(file: string) {\n\treturn await fsp\n\t\t.access(file)\n\t\t.then(() => true)\n\t\t.catch(() => false);\n}\n\nexport function findAffectedMarkdowns(root: string, config: Config) {\n\tconst affected = cp\n\t\t/* cspell:disable-next-line because of the filter */\n\t\t.execSync(sh`git diff --cached --name-only --diff-filter=MACT`, opts)\n\t\t.trim()\n\t\t.split(\"\\n\")\n\t\t.filter(Boolean);\n\n\tif (!affected.length) ERROR(\"no staged files found\");\n\n\tif (config.affectedRegexes?.length) {\n\t\tINFO(\"adding the following expressions: \", config.affectedRegexes);\n\t}\n\n\tconst allMatches = [\n\t\t...matches,\n\t\t...(config.affectedRegexes?.map((r) => new RegExp(r)) || []),\n\t];\n\n\tINFO(\"Checking affected files against regexes\", affected, allMatches);\n\n\tconst eligible = affected.filter((a) => allMatches.some((m) => a.match(m)));\n\n\tINFO(\"Found the following eligible affected files\", eligible);\n\n\tconst md = eligible.map((e) => findNearestReadme(root, path.resolve(e)));\n\tconst rootMd = path.join(root, \"README.md\");\n\tconst dedupe = [...new Set(md), rootMd].filter((s): s is string =>\n\t\tBoolean(s),\n\t);\n\n\tINFO(\"Found the following readmes\", dedupe);\n\n\treturn dedupe;\n}\n\nexport function findNearestReadme(\n\tgitRoot: string,\n\tinputFile: string,\n\tmaxRotations = 15,\n) {\n\tlet dir = path.dirname(inputFile);\n\tlet rotations = 0;\n\n\twhile (true) {\n\t\tconst option = path.join(dir, \"README.md\");\n\n\t\tif (fs.existsSync(option)) return option;\n\n\t\tconst parent = path.dirname(dir);\n\n\t\tif (parent === dir || dir === gitRoot || ++rotations > maxRotations) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdir = parent;\n\t}\n\n\treturn null;\n}\n\nexport function getGitRoot() {\n\tconst root = cp.execSync(sh`git rev-parse --show-toplevel`, opts).trim();\n\n\tif (!root) {\n\t\tthrow new Error(\"must be ran within a git directory.\");\n\t}\n\n\tINFO(\"found git root at location: \", root);\n\n\treturn root;\n}\n\nexport async function getMarkdownPaths(cwd: string, config: Config) {\n\tconst pattern = `**/${config?.onlyReadmes ? \"README\" : \"*\"}.md`;\n\tconst readmes = await glob(pattern, { cwd, ignore });\n\treturn readmes.map((readme) => path.resolve(cwd, readme));\n}\n","import * as path from \"node:path\";\nimport { remark } from \"remark\";\nimport remarkCollapse from \"remark-collapse\";\nimport remarkToc from \"remark-toc\";\nimport remarkUsage from \"remark-usage\";\n\nimport type { ActionData } from \"./data\";\nimport type { Config } from \"./schema\";\n\nimport { createFindParameter } from \"./data\";\nimport { INFO, WARN } from \"./log\";\nimport { autoReadmeRemarkPlugin } from \"./plugin\";\nimport { fileExists } from \"./utils\";\n\nexport async function parse(\n\tfile: string,\n\tfilepath: string,\n\troot: string,\n\tconfig: Config,\n\tdata: ActionData,\n) {\n\tconst pipeline = remark().use(autoReadmeRemarkPlugin, config, data);\n\tconst usage = data.find((d) => d.action === \"USAGE\");\n\n\tif (usage?.action === \"USAGE\" || config.enableUsage) {\n\t\tconst find = createFindParameter(usage?.parameters || []);\n\t\tconst examplePath = find(\"path\");\n\t\tconst dirname = path.dirname(filepath);\n\t\tconst resolvePath = examplePath && path.resolve(dirname, examplePath);\n\t\tconst relativeProjectPath =\n\t\t\tconfig.usageFile &&\n\t\t\tpath.relative(root, path.resolve(dirname, config.usageFile));\n\t\tconst example =\n\t\t\t(examplePath && resolvePath && path.relative(root, resolvePath)) ||\n\t\t\trelativeProjectPath ||\n\t\t\tundefined;\n\n\t\tif (await fileExists(example || \"\")) {\n\t\t\tINFO(\"generating usage section\");\n\t\t\tpipeline.use(remarkUsage, {\n\t\t\t\texample,\n\t\t\t\theading: config.usageHeading,\n\t\t\t});\n\t\t} else {\n\t\t\tWARN(\"not able to find example file for readme\", filepath, example);\n\t\t}\n\t}\n\n\tif (config.enableToc) {\n\t\tINFO(\"generating table of contents section\");\n\t\tpipeline\n\t\t\t.use(remarkToc, { heading: config.tocHeading })\n\t\t\t.use(remarkCollapse, { test: config.tocHeading });\n\t}\n\n\tconst vfile = await pipeline.process(file);\n\treturn vfile.toString();\n}\n","import type { Root } from \"mdast\";\nimport type { Plugin } from \"unified\";\n\nimport Handlebars from \"handlebars\";\nimport { markdownTable } from \"markdown-table\";\nimport { fromMarkdown } from \"mdast-util-from-markdown\";\nimport { zone } from \"mdast-zone\";\nimport path from \"node:path\";\n\nimport type { ActionData } from \"./data\";\nimport type { Config } from \"./schema\";\n\nimport { parseComment } from \"./comment\";\nimport { defaultTableHeadings, defaultTemplates } from \"./schema\";\n\ntype TemplateContext = {\n\tname: string;\n\turi_name: string;\n};\n\nfunction createHeading(\n\theadings: (keyof NonNullable<Config[\"templates\"]>[\"emojis\"])[],\n\tdisableEmojis = false,\n\temojis: typeof defaultTemplates.emojis = defaultTemplates.emojis,\n) {\n\treturn headings.map(\n\t\t(h) =>\n\t\t\t`${disableEmojis ? \"\" : emojis[h] + \" \"}${h?.at(0)?.toUpperCase() + h?.slice(1)}`,\n\t);\n}\n\nfunction wrapRequired(required: boolean | undefined, input: string) {\n\tif (!required) return input;\n\treturn `<b>*${input}</b>`;\n}\n\nexport const autoReadmeRemarkPlugin: Plugin<[Config, ActionData], Root> =\n\t(config, data) => (tree) => {\n\t\tzone(tree, /.*ZOD.*/gi, function (start, _, end) {\n\t\t\tconst zod = data.find((d) => d?.action === \"ZOD\");\n\t\t\tif (!zod?.body) {\n\t\t\t\tthrow new Error(\"unable to load zod body\");\n\t\t\t}\n\n\t\t\tconst ast = fromMarkdown(zod.body);\n\t\t\treturn [start, ast, end];\n\t\t});\n\n\t\tzone(tree, /.*ACTION.*/gi, function (start, _, end) {\n\t\t\tconst value = start.type === \"html\" && start.value;\n\t\t\tconst options = value && parseComment(value);\n\t\t\tif (!options) throw new Error(\"not able to parse comment\");\n\n\t\t\tconst first = data.find((d) => d?.action === \"ACTION\");\n\t\t\tconst inputs = first?.actionYaml?.inputs || {};\n\t\t\tconst heading = `### ${config.disableEmojis ? \"\" : \"🧰\"} actions`;\n\n\t\t\tif (options.format === \"LIST\") {\n\t\t\t\tconst body =\n\t\t\t\t\t`${heading}\\n` +\n\t\t\t\t\tObject.entries(inputs)\n\t\t\t\t\t\t.sort((a) => (a[1].required ? -1 : 1))\n\t\t\t\t\t\t.map(([key, value]) => {\n\t\t\t\t\t\t\treturn `- ${wrapRequired(value.required, key)}: (default: ${value.default})\\n\\n${value.description}`;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join(\"\\n\");\n\t\t\t\tconst ast = fromMarkdown(body);\n\t\t\t\treturn [start, ast, end];\n\t\t\t}\n\n\t\t\tconst headings =\n\t\t\t\t(config.headings?.ACTION?.length && config.headings.ACTION) ||\n\t\t\t\tdefaultTableHeadings.ACTION!;\n\n\t\t\tconst table = markdownTable([\n\t\t\t\tcreateHeading(\n\t\t\t\t\theadings,\n\t\t\t\t\tconfig.disableEmojis,\n\t\t\t\t\tconfig.templates?.emojis,\n\t\t\t\t),\n\t\t\t\t...Object.entries(inputs).map(([k, v]) =>\n\t\t\t\t\theadings\n\t\t\t\t\t\t.map((heading) => v[heading as keyof typeof v] || k)\n\t\t\t\t\t\t.map(String),\n\t\t\t\t),\n\t\t\t]);\n\t\t\tconst body = [heading, \"\", table].join(\"\\n\");\n\t\t\tconst ast = fromMarkdown(body);\n\t\t\treturn [start, ast, end];\n\t\t});\n\n\t\tzone(tree, /.*WORKSPACE.*/gi, function (start, _, end) {\n\t\t\tconst value = start.type === \"html\" && start.value;\n\t\t\tconst comment = value && parseComment(value);\n\t\t\tconst workspace = data.find((d) => d?.action === \"WORKSPACE\");\n\t\t\tconst templates = loadTemplates(config.templates);\n\t\t\tconst packages = workspace?.workspaces?.packages || [];\n\t\t\tconst headings =\n\t\t\t\t(config.headings?.WORKSPACE?.length &&\n\t\t\t\t\tconfig.headings?.WORKSPACE) ||\n\t\t\t\tdefaultTableHeadings.WORKSPACE!;\n\n\t\t\tif (comment && comment.format === \"LIST\") {\n\t\t\t\t// throw new Error(\"List is currently not su\")\n\t\t\t}\n\n\t\t\tconst tableHeadings = createHeading(\n\t\t\t\theadings,\n\t\t\t\tconfig.disableEmojis,\n\t\t\t\tconfig.templates?.emojis,\n\t\t\t);\n\n\t\t\tconst table = markdownTable([\n\t\t\t\ttableHeadings,\n\t\t\t\t...packages\n\t\t\t\t\t.filter((pkg) =>\n\t\t\t\t\t\tconfig.onlyShowPublicPackages\n\t\t\t\t\t\t\t? !pkg.packageJson.private\n\t\t\t\t\t\t\t: true,\n\t\t\t\t\t)\n\t\t\t\t\t.map((pkg) => {\n\t\t\t\t\t\tconst { name } = pkg.packageJson;\n\t\t\t\t\t\treturn headings.map((heading) => {\n\t\t\t\t\t\t\tif (heading === \"name\") {\n\t\t\t\t\t\t\t\tconst scoped = config.removeScope\n\t\t\t\t\t\t\t\t\t? name.replace(config.removeScope, \"\")\n\t\t\t\t\t\t\t\t\t: name;\n\t\t\t\t\t\t\t\treturn `[${scoped}](${path.relative(\n\t\t\t\t\t\t\t\t\tprocess.cwd(),\n\t\t\t\t\t\t\t\t\tpath.resolve(pkg.dir, \"README.md\"),\n\t\t\t\t\t\t\t\t)})`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (heading === \"version\") {\n\t\t\t\t\t\t\t\treturn ` },\n\t\t\t\t\t\t\t\t)})`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (heading === \"downloads\") {\n\t\t\t\t\t\t\t\treturn `})`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (heading === \"description\") {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\tpkg.packageJson as { description?: string }\n\t\t\t\t\t\t\t\t)?.description;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn ``;\n\t\t\t\t\t\t});\n\t\t\t\t\t}),\n\t\t\t]);\n\n\t\t\tconst heading = `### ${config.disableEmojis ? \"\" : \"🏭\"} workspace`;\n\t\t\tconst body = [heading, \"\", table].join(\"\\n\");\n\t\t\tconst ast = fromMarkdown(body);\n\t\t\treturn [start, ast, end];\n\t\t});\n\n\t\tzone(tree, /.*PKG.*/gi, function (start, _, end) {\n\t\t\tconst value = start.type === \"html\" && start.value;\n\t\t\tconst comment = value && parseComment(value);\n\t\t\tconst first = data.find((d) => d?.action === \"PKG\");\n\t\t\tconst templates = loadTemplates(config.templates);\n\t\t\tconst headings =\n\t\t\t\t(config.headings?.PKG?.length && config.headings?.PKG) ||\n\t\t\t\tdefaultTableHeadings.PKG!;\n\n\t\t\tif (comment && comment.format === \"LIST\") {\n\t\t\t\tconst ast = fromMarkdown(\"\");\n\t\t\t\treturn [start, ast, end];\n\t\t\t}\n\n\t\t\tfunction mapDependencies(isDev: boolean) {\n\t\t\t\treturn function ([name, version]: [string, string]) {\n\t\t\t\t\tconst url = templates.registryUrl({ name });\n\t\t\t\t\treturn headings.map((key) => {\n\t\t\t\t\t\tif (key === \"devDependency\") {\n\t\t\t\t\t\t\tif (config.disableEmojis) {\n\t\t\t\t\t\t\t\treturn `\\`${isDev}\\``;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn `${isDev ? \"⌨️\" : \"👥\"}`;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (key === \"name\") {\n\t\t\t\t\t\t\treturn `[${name}](${url})`;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (key === \"version\") {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t[\"workspace\", \"catalog\", \"*\"].some((type) =>\n\t\t\t\t\t\t\t\t\tversion.includes(type),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\treturn `\\`${version}\\``;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn ` })})`;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst { dependencies = {}, devDependencies = {} } =\n\t\t\t\tfirst?.pkgJson || {};\n\n\t\t\tconst table = markdownTable([\n\t\t\t\tcreateHeading(\n\t\t\t\t\theadings,\n\t\t\t\t\tconfig.disableEmojis,\n\t\t\t\t\tconfig.templates?.emojis,\n\t\t\t\t),\n\t\t\t\t...Object.entries(devDependencies).map(mapDependencies(true)),\n\t\t\t\t...Object.entries(dependencies).map(mapDependencies(false)),\n\t\t\t]);\n\n\t\t\tconst heading = `### ${config.disableEmojis ? \"\" : \"📦\"} packages`;\n\t\t\tconst body = [heading, \"\", table].join(\"\\n\");\n\t\t\tconst tableAst = fromMarkdown(body);\n\n\t\t\treturn [start, tableAst, end];\n\t\t});\n\t};\n\nfunction loadTemplates(\n\ttemplates: Config[\"templates\"],\n): Record<\n\tkeyof NonNullable<Config[\"templates\"]>,\n\t(context: Partial<TemplateContext>) => string\n> {\n\tif (!templates) throw new Error(\"failed to load templates\");\n\n\treturn Object.fromEntries(\n\t\tObject.entries(templates).map(([key, value]) => {\n\t\t\tif (typeof value !== \"string\") return [];\n\t\t\treturn [key, Handlebars.compile(value)];\n\t\t}),\n\t);\n}\n"],"mappings":";AAAA,SAAS,gBAAAA,qBAAoB;AAC7B,YAAYC,SAAQ;AACpB,YAAYC,UAAS;AACrB,OAAO,SAAS;;;ACHhB,OAAO,WAA6B;AACpC,SAAS,eAAe;AACxB,OAAOC,QAAO;;;ACFd,OAAO,WAAW;AAElB,IAAI,YAAY;AAET,SAAS,SAAS,MAAiB;AACzC,QAAM,CAAC,OAAO,GAAG,SAAS,IAAI;AAC9B,UAAQ,MAAM,MAAM,IAAI,KAAK,GAAG,GAAG,SAAS;AAC7C;AAEO,SAAS,QAAQ,MAAiB;AACxC,MAAI,YAAY,EAAG;AACnB,QAAM,CAAC,OAAO,GAAG,SAAS,IAAI;AAC9B,UAAQ,KAAK,MAAM,KAAK,KAAK,GAAG,GAAG,SAAS;AAC7C;AAEO,SAAS,aAAa,OAAe;AAC3C,cAAY;AACb;AAEO,SAAS,QAAQ,MAAiB;AACxC,MAAI,YAAY,EAAG;AACnB,QAAM,CAAC,OAAO,GAAG,SAAS,IAAI;AAC9B,UAAQ,KAAK,MAAM,OAAO,KAAK,GAAG,GAAG,SAAS;AAC/C;;;ACvBA,SAAS,SAAS;AAEX,IAAM,gBAAgB,EAC3B,KAAK,CAAC,UAAU,OAAO,SAAS,aAAa,KAAK,CAAC,EACnD,SAAS,wBAAwB;AAE5B,IAAM,gBAAgB,EAC3B,KAAK,CAAC,QAAQ,OAAO,CAAC,EACtB,QAAQ,OAAO,EACf,SAAS;AAEJ,IAAM,iBAAiB,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,EAAE,SAAS,EAAE,QAAQ,IA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Y,IAAI,EAAE,EAAE,MAAM;AAE/D,QAAM,QAAQ;AAAA,IACb,MAAM,IAAI,OAAOC,UAAS;AACzB,YAAM,OAAO,MAAU,cAASA,OAAM,EAAE,UAAU,OAAO,CAAC;AAE1D,YAAM,WAAW,MAAM;AACtB,cAAM,MAAMC,cAAa,IAAI;AAC7B,eAAO,gBAAgB,GAAG;AAAA,MAC3B,GAAG;AAEH,UAAI,CAAC,QAAQ,QAAQ;AACpB,aAAK,+BAA+BD,KAAI;AACxC,YAAI,CAAC,OAAO,eAAe,CAAC,OAAO,WAAW;AAC7C,iBAAO,MAAM,4BAA4B;AAAA,QAC1C,OAAO;AACN,eAAK,uCAAuCA,KAAI;AAAA,QACjD;AAAA,MACD;AAEA,YAAM,OAAO,MAAM,eAAe,SAASA,OAAM,IAAI;AAErD,WAAK,8BAA8B,IAAI;AAEvC,YAAM,UAAU,MAAME,OAAM,MAAMF,OAAM,MAAM,QAAQ,IAAI;AAC1D,YAAU,eAAUA,OAAM,OAAO;AAAA,IAClC,CAAC;AAAA,EACF;AAEA,MAAI,WAAY,CAAG,iBAAa,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;AAExD,MAAI,QAAS,SAAQ,KAAK;AAC3B;","names":["fromMarkdown","cp","fsp","z","z","args","opts","fs","fsp","path","path","path","body","value","ast","heading","path","parse","dirname","args","path","fromMarkdown","parse"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/args.ts","../src/schema.js","../src/comment.ts","../src/log.ts","../src/config.ts","../src/data.ts","../src/utils.ts","../src/pipeline.ts","../src/plugin.ts"],"sourcesContent":["import { fromMarkdown } from \"mdast-util-from-markdown\";\nimport * as cp from \"node:child_process\";\nimport * as fsp from \"node:fs/promises\";\nimport ora from \"ora\";\n\nimport type { Config } from \"./schema\";\n\nimport { parseArgs } from \"./args\";\nimport { loadAstComments } from \"./comment\";\nimport { loadConfig } from \"./config\";\nimport { loadActionData } from \"./data\";\nimport { ERROR, INFO, WARN } from \"./log\";\nimport { parse } from \"./pipeline\";\nimport { findAffectedMarkdowns, getGitRoot, getMarkdownPaths } from \"./utils\";\n\nexport async function run() {\n\tconst args = await parseArgs();\n\tconst config: Config = (await loadConfig(args)) || {};\n\n\tINFO(\"Loaded the following configuration:\", config);\n\n\tconst root = getGitRoot();\n\n\tconst isAffected = args.changes ? \"affected\" : \"\";\n\n\tINFO(`Loading ${!isAffected ? \"all \" : \"affected \"}files`);\n\n\tconst paths = isAffected\n\t\t? findAffectedMarkdowns(root, config)\n\t\t: await getMarkdownPaths(root, config);\n\n\tINFO(\"Loaded the following files:\", paths.join(\"\\n\"));\n\n\tconst type = args.onlyReadmes ? \"readmes\" : \"all markdown files\";\n\n\tif (!paths.length) {\n\t\treturn ERROR(`no ${isAffected} readmes found to update`);\n\t}\n\n\tconst spinner = !args.verbose && ora(`Updating ${type}`).start();\n\n\tawait Promise.all(\n\t\tpaths.map(async (path) => {\n\t\t\tconst file = await fsp.readFile(path, { encoding: \"utf8\" });\n\t\t\t// get rid of ast via garbage collector faster\n\t\t\tconst actions = (() => {\n\t\t\t\tconst ast = fromMarkdown(file);\n\t\t\t\treturn loadAstComments(ast);\n\t\t\t})();\n\n\t\t\tif (!actions.length) {\n\t\t\t\tWARN(`no action comments found in`, path);\n\t\t\t\tif (!config.enableUsage || !config.enableToc) {\n\t\t\t\t\treturn ERROR(\"no action or plugins found\");\n\t\t\t\t} else {\n\t\t\t\t\tINFO(\"plugins enabled. continuing parsing\", path);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst data = await loadActionData(actions, path, root);\n\n\t\t\tINFO(\"Loaded comment action data\", data);\n\n\t\t\tconst content = await parse(file, path, root, config, data);\n\t\t\tawait fsp.writeFile(path, content);\n\t\t}),\n\t);\n\n\tconst opts: cp.CommonExecOptions = { stdio: \"inherit\" };\n\n\tINFO(\"formatting with prettier\");\n\n\tcp.execFileSync(\"prettier\", [\"--write\", ...paths], opts);\n\n\tif (isAffected) {\n\t\tINFO(\"adding affected files to git stage\");\n\n\t\tcp.execFileSync(\"git\", [\"add\", ...paths], opts);\n\t}\n\n\tif (spinner) spinner.stop();\n}\n","import debug from \"debug\";\nimport yargs, { type Options } from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport z from \"zod\";\n\nimport { configSchema } from \"./schema\";\n\nexport type Args = Awaited<ReturnType<typeof parseArgs>>;\n\nconst complexOptions = [\n\t\"affectedRegexes\",\n\t\"collapseHeadings\",\n\t\"headings\",\n\t\"templates\",\n] as const;\n\ntype ComplexOptions = (typeof complexOptions)[number];\n\nconst args = {\n\t...zodToYargs(),\n\tchanges: {\n\t\talias: \"g\",\n\t\tdefault: false,\n\t\tdescription: \"Check only changed git files\",\n\t\ttype: \"boolean\",\n\t},\n\tcheck: {\n\t\talias: \"k\",\n\t\tdefault: false,\n\t\tdescription: \"Do not write to files. Only check for changes\",\n\t\ttype: \"boolean\",\n\t},\n\tconfig: { alias: \"c\", description: \"Path to config file\", type: \"string\" },\n} satisfies Record<string, Options>;\n\nexport async function parseArgs() {\n\tconst yargsInstance = yargs(hideBin(process.argv))\n\t\t.options(args)\n\t\t.help(\"h\")\n\t\t.alias(\"h\", \"help\")\n\t\t.epilogue(`--> @stephansama open-source ${new Date().getFullYear()}`);\n\n\tconst parsed = await yargsInstance\n\t\t.wrap(yargsInstance.terminalWidth())\n\t\t.parse();\n\n\tif (parsed.verbose) debug.enable(\"autoreadme*\");\n\n\treturn parsed;\n}\n\nexport function zodToYargs(): Omit<\n\tRecord<keyof typeof shape, Options>,\n\tComplexOptions\n> {\n\tconst { shape } = configSchema.unwrap();\n\tconst entries = Object.entries(shape).map(([key, value]) => {\n\t\tif (complexOptions.includes(key as ComplexOptions)) return [];\n\t\tif (value.def.innerType instanceof z.ZodObject) return [];\n\t\tconst meta = value.meta();\n\t\tconst { innerType } = value.def;\n\t\tconst isBoolean = innerType instanceof z.ZodBoolean;\n\t\tconst isNumber = innerType instanceof z.ZodNumber;\n\t\tconst isArray = innerType instanceof z.ZodArray;\n\n\t\tconst yargType: Options[\"type\"] =\n\t\t\t(isArray && \"array\") ||\n\t\t\t(isNumber && \"number\") ||\n\t\t\t(isBoolean && \"boolean\") ||\n\t\t\t\"string\";\n\n\t\tconst options: Options = {\n\t\t\tdefault: value.def.defaultValue,\n\t\t\ttype: yargType,\n\t\t};\n\n\t\tif (meta?.alias) options.alias = meta.alias as string;\n\t\tif (meta?.description) options.description = meta.description;\n\n\t\treturn [key, options];\n\t});\n\n\treturn Object.fromEntries(entries);\n}\n","import { z } from \"zod\";\n\nexport const actionsSchema = z\n\t.enum([\"ACTION\", \"PKG\", \"USAGE\", \"WORKSPACE\", \"ZOD\"])\n\t.describe(\"Comment action options\");\n\nexport const formatsSchema = z\n\t.enum([\"LIST\", \"TABLE\"])\n\t.default(\"TABLE\")\n\t.optional();\n\nexport const languageSchema = z.enum([\"JS\", \"RS\"]).optional().default(\"JS\");\n\nexport const headingsSchema = z\n\t.enum([\n\t\t\"default\",\n\t\t\"description\",\n\t\t\"devDependency\",\n\t\t\"downloads\",\n\t\t\"name\",\n\t\t\"private\",\n\t\t\"required\",\n\t\t\"version\",\n\t])\n\t.describe(\"Table heading options\");\n\nexport const tableHeadingsSchema = z\n\t.record(actionsSchema, headingsSchema.array().optional())\n\t.optional()\n\t.describe(\"Table heading action configuration\")\n\t.default({\n\t\tACTION: [\"name\", \"required\", \"default\", \"description\"],\n\t\tPKG: [\"name\", \"version\", \"devDependency\"],\n\t\tWORKSPACE: [\"name\", \"version\", \"downloads\", \"description\"],\n\t\tZOD: [],\n\t});\n\nexport const templatesSchema = z.object({\n\tdownloadImage: z\n\t\t.string()\n\t\t.optional()\n\t\t.default(\"https://img.shields.io/npm/dw/{{name}}?labelColor=211F1F\"),\n\temojis: z\n\t\t.record(headingsSchema, z.string())\n\t\t.optional()\n\t\t.describe(\"Table heading emojis used when enabled\")\n\t\t.default({\n\t\t\tdefault: \"⚙️\",\n\t\t\tdescription: \"📝\",\n\t\t\tdevDependency: \"💻\",\n\t\t\tdownloads: \"📥\",\n\t\t\tname: \"🏷️\",\n\t\t\tprivate: \"🔒\",\n\t\t\trequired: \"\",\n\t\t\tversion: \"\",\n\t\t}),\n\tregistryUrl: z\n\t\t.string()\n\t\t.optional()\n\t\t.default(\"https://www.npmjs.com/package/{{name}}\"),\n\tversionImage: z\n\t\t.string()\n\t\t.optional()\n\t\t.default(\n\t\t\t\"https://img.shields.io/npm/v/{{uri_name}}?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F\",\n\t\t),\n});\n\nexport const defaultTemplates = templatesSchema.parse({});\nexport const defaultTableHeadings = tableHeadingsSchema.parse(undefined);\n\nconst _configSchema = z.object({\n\taffectedRegexes: z.string().array().optional().default([]),\n\tcollapseHeadings: z.string().array().optional().default([]),\n\tdefaultLanguage: languageSchema.meta({\n\t\talias: \"l\",\n\t\tdescription: \"Default language to infer projects from\",\n\t}),\n\tdisableEmojis: z.boolean().default(false).meta({\n\t\talias: \"e\",\n\t\tdescription: \"Whether or not to use emojis in markdown table headings\",\n\t}),\n\tdisableMarkdownHeadings: z.boolean().default(false).meta({\n\t\tdescription: \"Whether or not to display markdown headings\",\n\t}),\n\tenableToc: z.boolean().default(false).meta({\n\t\talias: \"t\",\n\t\tdescription: \"generate table of contents for readmes\",\n\t}),\n\tenableUsage: z.boolean().optional().default(false).meta({\n\t\tdescription: \"Whether or not to enable usage plugin\",\n\t}),\n\theadings: tableHeadingsSchema\n\t\t.optional()\n\t\t.default(defaultTableHeadings)\n\t\t.describe(\"List of headings for different table outputs\"),\n\tonlyReadmes: z.boolean().default(true).meta({\n\t\talias: \"r\",\n\t\tdescription: \"Whether or not to only traverse readmes\",\n\t}),\n\tonlyShowPublicPackages: z.boolean().default(false).meta({\n\t\talias: \"p\",\n\t\tdescription: \"Only show public packages in workspaces\",\n\t}),\n\tremoveScope: z.string().optional().default(\"\").meta({\n\t\tdescription: \"Remove common workspace scope\",\n\t}),\n\ttemplates: templatesSchema\n\t\t.optional()\n\t\t.default(defaultTemplates)\n\t\t.describe(\n\t\t\t\"Handlebars templates used to fuel list and table generation\",\n\t\t),\n\ttocHeading: z.string().optional().default(\"Table of contents\").meta({\n\t\tdescription: \"Markdown heading used to generate table of contents\",\n\t}),\n\tusageFile: z.string().optional().default(\"\").meta({\n\t\tdescription: \"Workspace level usage file\",\n\t}),\n\tusageHeading: z.string().optional().default(\"Usage\").meta({\n\t\tdescription: \"Markdown heading used to generate usage example\",\n\t}),\n\tverbose: z.boolean().default(false).meta({\n\t\talias: \"v\",\n\t\tdescription: \"whether or not to display verbose logging\",\n\t}),\n});\n\nexport const configSchema = _configSchema.optional();\n\n/** @typedef {Partial<z.infer<typeof _configSchema>>} Config */\n","import type { Html, Root } from \"mdast\";\n\nimport { commentMarker } from \"mdast-comment-marker\";\n\nimport { INFO } from \"./log\";\nimport { actionsSchema, formatsSchema, languageSchema } from \"./schema\";\n\nexport const SEPARATOR = \"-\" as const;\n\nexport type AstComments = ReturnType<typeof loadAstComments>;\n\nexport function loadAstComments(root: Root) {\n\treturn root.children\n\t\t.map((child) => child.type === \"html\" && getComment(child))\n\t\t.filter((f): f is ReturnType<typeof parseComment> => f !== false);\n}\n\nexport function parseComment(comment: string) {\n\tconst input = trimComment(comment);\n\tconst [type, ...parameters] = input.split(\" \");\n\tconst [first, second, third] = type.split(SEPARATOR);\n\n\tINFO(\"parsing inputs\", { first, second, third });\n\n\tconst languageInput = third ? first : undefined;\n\tconst actionInput = third ? second : first;\n\tconst formatInput = third ? third : second;\n\tconst language = languageSchema.parse(languageInput);\n\tconst action = actionsSchema.parse(actionInput);\n\tconst format = formatsSchema.parse(formatInput);\n\tconst isStart = comment.includes(\"start\");\n\tconst parsed = { action, format, isStart, language, parameters };\n\n\tINFO(`Parsed comment ${comment}`, parsed);\n\n\treturn parsed;\n}\n\nconst startComment = \"<!--\";\nconst endComment = \"-->\";\n\nexport function trimComment(comment: string) {\n\treturn comment\n\t\t.replace(startComment, \"\")\n\t\t.replace(/start|end/, \"\")\n\t\t.replace(endComment, \"\")\n\t\t.trim();\n}\n\nfunction getComment(comment: Html) {\n\tif (!isComment(comment.value)) return false;\n\n\tconst marker = commentMarker(comment);\n\tif (!marker) return false;\n\n\t// TODO: update parseComment to use comment marker\n\treturn parseComment(comment.value);\n}\n\nfunction isComment(comment: string) {\n\treturn comment.startsWith(startComment) && comment.endsWith(endComment);\n}\n","import debug from \"debug\";\n\nconst error = debug(\"autoreadme:error\");\nconst info = debug(\"autoreadme:info\");\nconst warn = debug(\"autoreadme:warn\");\n\nexport function ERROR(...rest: unknown[]) {\n\tconst [first, ...remaining] = rest;\n\terror(`${first} %O`, ...remaining);\n}\n\nexport function INFO(...rest: unknown[]) {\n\tconst [first, ...remaining] = rest;\n\tinfo(`${first} %O`, ...remaining);\n}\n\nexport function WARN(...rest: unknown[]) {\n\tconst [first, ...remaining] = rest;\n\twarn(`${first} %O`, ...remaining);\n}\n","import toml from \"@iarna/toml\";\nimport { cosmiconfig, getDefaultSearchPlaces, type Options } from \"cosmiconfig\";\nimport deepmerge from \"deepmerge\";\n\nimport type { Args } from \"./args\";\n\nimport { INFO, WARN } from \"./log\";\nimport { configSchema } from \"./schema\";\n\nconst moduleName = \"autoreadme\";\n\nconst searchPlaces = getSearchPlaces();\n\nconst loaders = { [\".toml\"]: loadToml };\n\nexport async function loadConfig(args: Partial<Args>) {\n\tconst opts: Partial<Options> = { loaders, searchPlaces };\n\n\tif (args.config) opts.searchPlaces = [args.config];\n\n\tconst explorer = cosmiconfig(moduleName, opts);\n\n\tconst search = await explorer.search();\n\n\tif (!search) {\n\t\tconst location = args.config ? \" at location: \" + args.config : \"\";\n\t\tWARN(`no config file found`, location);\n\t\tINFO(\"using default configuration\");\n\t} else {\n\t\tINFO(\"found configuration file at: \", search.filepath);\n\t\tINFO(\"loaded cosmiconfig\", search.config);\n\t}\n\n\targs = removeFalsy(args);\n\n\tINFO(\"merging config with args\", args);\n\n\treturn configSchema.parse(\n\t\tdeepmerge(search?.config || {}, args, {\n\t\t\tarrayMerge: (_, sourceArray) => sourceArray,\n\t\t}),\n\t);\n}\n\nexport function loadToml(_filepath: string, content: string) {\n\treturn toml.parse(content);\n}\n\nfunction getSearchPlaces() {\n\treturn [\n\t\t...getDefaultSearchPlaces(moduleName),\n\t\t`.${moduleName}rc.toml`,\n\t\t`.config/.${moduleName}rc`,\n\t\t`.config/${moduleName}rc.toml`,\n\t\t`.config/.${moduleName}rc.toml`,\n\t\t`.config/.${moduleName}rc.json`,\n\t\t`.config/.${moduleName}rc.yaml`,\n\t\t`.config/.${moduleName}rc.yml`,\n\t];\n}\n\nfunction removeFalsy(obj: object) {\n\treturn Object.fromEntries(\n\t\tObject.entries(obj)\n\t\t\t.map(([k, v]) => (!v ? false : [k, v]))\n\t\t\t.filter((e): e is [string, unknown] => Boolean(e)),\n\t);\n}\n","import { getPackages } from \"@manypkg/get-packages\";\nimport * as fs from \"node:fs\";\nimport * as fsp from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport { readPackageJSON } from \"pkg-types\";\nimport * as yaml from \"yaml\";\nimport { zod2md } from \"zod2md\";\n\nimport type { AstComments } from \"./comment\";\n\nimport { fileExists } from \"./utils\";\n\nexport type ActionData = Awaited<ReturnType<typeof loadActionData>>;\n\nexport type ActionTableHeading = \"name\" | keyof ActionInput;\n\nexport type ActionYaml = { inputs?: Record<string, ActionInput> };\n\ntype ActionInput = {\n\tdefault?: string;\n\tdescription?: string;\n\trequired?: boolean;\n};\n\nexport function createFindParameter(parameterList: string[]) {\n\treturn function (parameterName: string) {\n\t\treturn parameterList\n\t\t\t?.find((p) => p.startsWith(parameterName))\n\t\t\t?.replace(parameterName + \"=\", \"\")\n\t\t\t?.replace(/\"/gi, \"\")\n\t\t\t?.replace(/_/gi, \" \");\n\t};\n}\n\nexport async function loadActionData(\n\tactions: AstComments,\n\tfile: string,\n\troot: string,\n) {\n\tconst startActions = actions.filter((action) => action.isStart);\n\treturn await Promise.all(\n\t\tstartActions.map(async (action) => {\n\t\t\tconst find = createFindParameter(action.parameters);\n\t\t\tswitch (action.action) {\n\t\t\t\tcase \"ACTION\": {\n\t\t\t\t\tconst baseDir = path.dirname(file);\n\t\t\t\t\tconst actionYaml = await loadActionYaml(baseDir);\n\t\t\t\t\treturn {\n\t\t\t\t\t\taction: action.action,\n\t\t\t\t\t\tactionYaml,\n\t\t\t\t\t\tparameters: action.parameters,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tcase \"PKG\": {\n\t\t\t\t\tconst inputPath = find(\"path\");\n\t\t\t\t\tconst filename = inputPath\n\t\t\t\t\t\t? path.resolve(path.dirname(file), inputPath)\n\t\t\t\t\t\t: path.dirname(file);\n\t\t\t\t\tconst pkgJson = await readPackageJSON(filename);\n\t\t\t\t\treturn {\n\t\t\t\t\t\taction: action.action,\n\t\t\t\t\t\tparameters: action.parameters,\n\t\t\t\t\t\tpkgJson,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tcase \"USAGE\": {\n\t\t\t\t\treturn {\n\t\t\t\t\t\taction: action.action,\n\t\t\t\t\t\tparameters: action.parameters,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tcase \"WORKSPACE\": {\n\t\t\t\t\tconst workspaces = await getPackages(process.cwd());\n\t\t\t\t\tconst pnpmPath = path.resolve(root, \"pnpm-workspace.yaml\");\n\t\t\t\t\tconst isPnpm = fs.existsSync(pnpmPath);\n\t\t\t\t\treturn {\n\t\t\t\t\t\taction: action.action,\n\t\t\t\t\t\tisPnpm,\n\t\t\t\t\t\tparameters: action.parameters,\n\t\t\t\t\t\troot,\n\t\t\t\t\t\tworkspaces,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tcase \"ZOD\": {\n\t\t\t\t\tif (action.format === \"LIST\") {\n\t\t\t\t\t\tthrow new Error(\"cannot display zod in list format\");\n\t\t\t\t\t}\n\n\t\t\t\t\tconst inputPath = find(\"path\");\n\t\t\t\t\tif (!inputPath) {\n\t\t\t\t\t\tconst error = `no path found for zod table at markdown file ${file}`;\n\t\t\t\t\t\tthrow new Error(error);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst body = await zod2md({\n\t\t\t\t\t\tentry: path.resolve(path.dirname(file), inputPath),\n\t\t\t\t\t\ttitle: find(\"title\") || \"Zod Schema\",\n\t\t\t\t\t});\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\taction: action.action,\n\t\t\t\t\t\tbody,\n\t\t\t\t\t\tparameters: action.parameters,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error(\"feature not yet implemented\");\n\t\t\t}\n\t\t}),\n\t);\n}\n\nasync function loadActionYaml(baseDir: string) {\n\tconst actionYmlPath = path.resolve(baseDir, \"action.yml\");\n\tconst actionYamlPath = path.resolve(baseDir, \"action.yaml\");\n\tconst actualPath =\n\t\t((await fileExists(actionYamlPath)) && actionYamlPath) ||\n\t\t((await fileExists(actionYmlPath)) && actionYmlPath);\n\n\tif (!actualPath) {\n\t\tconst locations = [actionYmlPath, actionYamlPath];\n\t\tconst error = `no yaml file found at locations: ${locations}`;\n\t\tthrow new Error(error);\n\t}\n\n\tconst actionFile = await fsp.readFile(actualPath, { encoding: \"utf8\" });\n\n\treturn yaml.parse(actionFile) as ActionYaml;\n}\n","import glob from \"fast-glob\";\nimport * as cp from \"node:child_process\";\nimport * as fs from \"node:fs\";\nimport * as fsp from \"node:fs/promises\";\nimport * as path from \"node:path\";\n\nimport type { Config } from \"./schema\";\n\nimport { ERROR, INFO } from \"./log\";\n\nconst sh = String.raw;\n\nconst opts: { encoding: BufferEncoding } = { encoding: \"utf8\" };\n\nconst ignore = [\"**/node_modules/**\"];\n\nconst matches = [\n\t/.*README\\.md$/gi,\n\t/.*Cargo\\.toml$/gi,\n\t/.*action\\.ya?ml$/gi,\n\t/.*package\\.json$/gi,\n\t/.*pnpm-workspace\\.yaml$/gi,\n];\n\nexport async function fileExists(file: string) {\n\treturn await fsp\n\t\t.access(file)\n\t\t.then(() => true)\n\t\t.catch(() => false);\n}\n\nexport function findAffectedMarkdowns(root: string, config: Config) {\n\tconst affected = cp\n\t\t/* cspell:disable-next-line because of the filter */\n\t\t.execSync(sh`git diff --cached --name-only --diff-filter=MACT`, opts)\n\t\t.trim()\n\t\t.split(\"\\n\")\n\t\t.filter(Boolean);\n\n\tif (!affected.length) ERROR(\"no staged files found\");\n\n\tif (config.affectedRegexes?.length) {\n\t\tINFO(\"adding the following expressions: \", config.affectedRegexes);\n\t}\n\n\tconst allMatches = [\n\t\t...matches,\n\t\t...(config.affectedRegexes?.map((r) => new RegExp(r)) || []),\n\t];\n\n\tINFO(\"Checking affected files against regexes\", affected, allMatches);\n\n\tconst eligible = affected.filter((a) => allMatches.some((m) => a.match(m)));\n\n\tINFO(\"Found the following eligible affected files\", eligible);\n\n\tconst md = eligible.map((e) => findNearestReadme(root, path.resolve(e)));\n\tconst rootMd = path.join(root, \"README.md\");\n\tconst dedupe = [...new Set(md), rootMd].filter((s): s is string =>\n\t\tBoolean(s),\n\t);\n\n\tINFO(\"Found the following readmes\", dedupe);\n\n\treturn dedupe;\n}\n\nexport function findNearestReadme(\n\tgitRoot: string,\n\tinputFile: string,\n\tmaxRotations = 15,\n) {\n\tlet dir = path.dirname(inputFile);\n\tlet rotations = 0;\n\n\twhile (true) {\n\t\tconst option = path.join(dir, \"README.md\");\n\n\t\tif (fs.existsSync(option)) return option;\n\n\t\tconst parent = path.dirname(dir);\n\n\t\tif (parent === dir || dir === gitRoot || ++rotations > maxRotations) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdir = parent;\n\t}\n\n\treturn null;\n}\n\nexport function getGitRoot() {\n\tconst root = cp.execSync(sh`git rev-parse --show-toplevel`, opts).trim();\n\n\tif (!root) {\n\t\tthrow new Error(\"must be ran within a git directory.\");\n\t}\n\n\tINFO(\"found git root at location: \", root);\n\n\treturn root;\n}\n\nexport async function getMarkdownPaths(cwd: string, config: Config) {\n\tconst pattern = `**/${config?.onlyReadmes ? \"README\" : \"*\"}.md`;\n\tconst readmes = await glob(pattern, { cwd, ignore });\n\treturn readmes.map((readme) => path.resolve(cwd, readme));\n}\n","import * as path from \"node:path\";\nimport { remark } from \"remark\";\nimport remarkCodeImport from \"remark-code-import\";\nimport remarkCollapse from \"remark-collapse\";\nimport remarkToc from \"remark-toc\";\nimport remarkUsage from \"remark-usage\";\nimport { VFile } from \"vfile\";\n\nimport type { ActionData } from \"./data\";\nimport type { Config } from \"./schema\";\n\nimport { createFindParameter } from \"./data\";\nimport { INFO, WARN } from \"./log\";\nimport { autoReadmeRemarkPlugin } from \"./plugin\";\nimport { fileExists } from \"./utils\";\n\nexport async function parse(\n\tfile: string,\n\tfilepath: string,\n\troot: string,\n\tconfig: Config,\n\tdata: ActionData,\n) {\n\tconst pipeline = remark()\n\t\t.use(autoReadmeRemarkPlugin, config, data)\n\t\t.use(remarkCodeImport, {});\n\n\tconst usage = data.find((d) => d.action === \"USAGE\");\n\n\tif (usage?.action === \"USAGE\" || config.enableUsage) {\n\t\tconst find = createFindParameter(usage?.parameters || []);\n\t\tconst examplePath = find(\"path\");\n\t\tconst dirname = path.dirname(filepath);\n\t\tconst resolvePath = examplePath && path.resolve(dirname, examplePath);\n\t\tconst relativeProjectPath =\n\t\t\tconfig.usageFile &&\n\t\t\tpath.relative(root, path.resolve(dirname, config.usageFile));\n\t\tconst example =\n\t\t\t(examplePath && resolvePath && path.relative(root, resolvePath)) ||\n\t\t\trelativeProjectPath ||\n\t\t\tundefined;\n\n\t\tif (example && (await fileExists(example))) {\n\t\t\tINFO(\"generating usage section\");\n\t\t\tpipeline.use(remarkUsage, {\n\t\t\t\texample,\n\t\t\t\theading: config.usageHeading,\n\t\t\t});\n\t\t} else {\n\t\t\tWARN(\"not able to find example file for readme\", filepath, example);\n\t\t}\n\t}\n\n\tif (config.enableToc) {\n\t\tINFO(\"generating table of contents section\");\n\t\tpipeline.use(remarkToc, { heading: config.tocHeading });\n\t}\n\n\tif (config.enableToc || config.collapseHeadings?.length) {\n\t\tconst additional = config.collapseHeadings?.length\n\t\t\t? config.collapseHeadings\n\t\t\t: [];\n\t\tconst headings = [...additional, config.tocHeading];\n\t\tpipeline.use(remarkCollapse, {\n\t\t\ttest: {\n\t\t\t\tignoreFinalDefinitions: true,\n\t\t\t\ttest: (value, _) => {\n\t\t\t\t\treturn headings.some((i) => value.trim() === i?.trim());\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\t}\n\n\tconst vfile = new VFile({ path: path.resolve(filepath), value: file });\n\tconst markdown = await pipeline.process(vfile);\n\treturn markdown.toString();\n}\n","import type { Root } from \"mdast\";\nimport type { Plugin } from \"unified\";\n\nimport Handlebars from \"handlebars\";\nimport { markdownTable } from \"markdown-table\";\nimport { fromMarkdown } from \"mdast-util-from-markdown\";\nimport { zone } from \"mdast-zone\";\nimport path from \"node:path\";\n\nimport type { ActionData } from \"./data\";\nimport type { Config } from \"./schema\";\n\nimport { parseComment } from \"./comment\";\nimport { defaultTableHeadings, defaultTemplates } from \"./schema\";\n\ntype TemplateContext = {\n\tname: string;\n\turi_name: string;\n};\n\nfunction createHeading(\n\theadings: (keyof NonNullable<Config[\"templates\"]>[\"emojis\"])[],\n\tdisableEmojis = false,\n\temojis: typeof defaultTemplates.emojis = defaultTemplates.emojis,\n) {\n\treturn headings.map(\n\t\t(h) =>\n\t\t\t`${disableEmojis ? \"\" : emojis[h] + \" \"}${h?.at(0)?.toUpperCase() + h?.slice(1)}`,\n\t);\n}\n\nfunction wrapRequired(required: boolean | undefined, input: string) {\n\tif (!required) return input;\n\treturn `<b>*${input}</b>`;\n}\n\nexport const autoReadmeRemarkPlugin: Plugin<[Config, ActionData], Root> =\n\t(config, data) => (tree) => {\n\t\tzone(tree, /.*ZOD.*/gi, function (start, _, end) {\n\t\t\tconst zod = data.find((d) => d?.action === \"ZOD\");\n\t\t\tif (!zod?.body) {\n\t\t\t\tthrow new Error(\"unable to load zod body\");\n\t\t\t}\n\n\t\t\tconst ast = fromMarkdown(zod.body);\n\t\t\treturn [start, ast, end];\n\t\t});\n\n\t\tzone(tree, /.*ACTION.*/gi, function (start, _, end) {\n\t\t\tconst value = start.type === \"html\" && start.value;\n\t\t\tconst options = value && parseComment(value);\n\t\t\tif (!options) throw new Error(\"not able to parse comment\");\n\n\t\t\tconst first = data.find((d) => d?.action === \"ACTION\");\n\t\t\tconst inputs = first?.actionYaml?.inputs || {};\n\t\t\tconst heading = `### ${config.disableEmojis ? \"\" : \"🧰\"} actions`;\n\n\t\t\tif (options.format === \"LIST\") {\n\t\t\t\tconst body =\n\t\t\t\t\t`${heading}\\n` +\n\t\t\t\t\tObject.entries(inputs)\n\t\t\t\t\t\t.sort((a) => (a[1].required ? -1 : 1))\n\t\t\t\t\t\t.map(([key, value]) => {\n\t\t\t\t\t\t\treturn `- ${wrapRequired(value.required, key)}: (default: ${value.default})\\n\\n${value.description}`;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join(\"\\n\");\n\t\t\t\tconst ast = fromMarkdown(body);\n\t\t\t\treturn [start, ast, end];\n\t\t\t}\n\n\t\t\tconst headings =\n\t\t\t\t(config.headings?.ACTION?.length && config.headings.ACTION) ||\n\t\t\t\tdefaultTableHeadings.ACTION!;\n\n\t\t\tconst table = markdownTable([\n\t\t\t\tcreateHeading(\n\t\t\t\t\theadings,\n\t\t\t\t\tconfig.disableEmojis,\n\t\t\t\t\tconfig.templates?.emojis,\n\t\t\t\t),\n\t\t\t\t...Object.entries(inputs).map(([k, v]) =>\n\t\t\t\t\theadings\n\t\t\t\t\t\t.map((heading) => v[heading as keyof typeof v] || k)\n\t\t\t\t\t\t.map(String),\n\t\t\t\t),\n\t\t\t]);\n\t\t\tconst body = [heading, \"\", table].join(\"\\n\");\n\t\t\tconst ast = fromMarkdown(body);\n\t\t\treturn [start, ast, end];\n\t\t});\n\n\t\tzone(tree, /.*WORKSPACE.*/gi, function (start, _, end) {\n\t\t\tconst value = start.type === \"html\" && start.value;\n\t\t\tconst comment = value && parseComment(value);\n\t\t\tconst workspace = data.find((d) => d?.action === \"WORKSPACE\");\n\t\t\tconst templates = loadTemplates(config.templates);\n\t\t\tconst packages = workspace?.workspaces?.packages || [];\n\t\t\tconst headings =\n\t\t\t\t(config.headings?.WORKSPACE?.length &&\n\t\t\t\t\tconfig.headings?.WORKSPACE) ||\n\t\t\t\tdefaultTableHeadings.WORKSPACE!;\n\n\t\t\tif (comment && comment.format === \"LIST\") {\n\t\t\t\t// throw new Error(\"List is currently not su\")\n\t\t\t}\n\n\t\t\tconst tableHeadings = createHeading(\n\t\t\t\theadings,\n\t\t\t\tconfig.disableEmojis,\n\t\t\t\tconfig.templates?.emojis,\n\t\t\t);\n\n\t\t\tconst table = markdownTable([\n\t\t\t\ttableHeadings,\n\t\t\t\t...packages\n\t\t\t\t\t.filter((pkg) =>\n\t\t\t\t\t\tconfig.onlyShowPublicPackages\n\t\t\t\t\t\t\t? !pkg.packageJson.private\n\t\t\t\t\t\t\t: true,\n\t\t\t\t\t)\n\t\t\t\t\t.map((pkg) => {\n\t\t\t\t\t\tconst { name } = pkg.packageJson;\n\t\t\t\t\t\treturn headings.map((heading) => {\n\t\t\t\t\t\t\tif (heading === \"name\") {\n\t\t\t\t\t\t\t\tconst scoped = config.removeScope\n\t\t\t\t\t\t\t\t\t? name.replace(config.removeScope, \"\")\n\t\t\t\t\t\t\t\t\t: name;\n\t\t\t\t\t\t\t\treturn `[${scoped}](${path.relative(\n\t\t\t\t\t\t\t\t\tprocess.cwd(),\n\t\t\t\t\t\t\t\t\tpath.resolve(pkg.dir, \"README.md\"),\n\t\t\t\t\t\t\t\t)})`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (heading === \"version\") {\n\t\t\t\t\t\t\t\treturn ` },\n\t\t\t\t\t\t\t\t)})`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (heading === \"downloads\") {\n\t\t\t\t\t\t\t\treturn `})`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (heading === \"description\") {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\tpkg.packageJson as { description?: string }\n\t\t\t\t\t\t\t\t)?.description;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn ``;\n\t\t\t\t\t\t});\n\t\t\t\t\t}),\n\t\t\t]);\n\n\t\t\tconst heading = `### ${config.disableEmojis ? \"\" : \"🏭\"} workspace`;\n\t\t\tconst body = [heading, \"\", table].join(\"\\n\");\n\t\t\tconst ast = fromMarkdown(body);\n\t\t\treturn [start, ast, end];\n\t\t});\n\n\t\tzone(tree, /.*PKG.*/gi, function (start, _, end) {\n\t\t\tconst value = start.type === \"html\" && start.value;\n\t\t\tconst comment = value && parseComment(value);\n\t\t\tconst first = data.find((d) => d?.action === \"PKG\");\n\t\t\tconst templates = loadTemplates(config.templates);\n\t\t\tconst headings =\n\t\t\t\t(config.headings?.PKG?.length && config.headings?.PKG) ||\n\t\t\t\tdefaultTableHeadings.PKG!;\n\n\t\t\tif (comment && comment.format === \"LIST\") {\n\t\t\t\tconst ast = fromMarkdown(\"\");\n\t\t\t\treturn [start, ast, end];\n\t\t\t}\n\n\t\t\tfunction mapDependencies(isDev: boolean) {\n\t\t\t\treturn function ([name, version]: [string, string]) {\n\t\t\t\t\tconst url = templates.registryUrl({ name });\n\t\t\t\t\treturn headings.map((key) => {\n\t\t\t\t\t\tif (key === \"devDependency\") {\n\t\t\t\t\t\t\tif (config.disableEmojis) {\n\t\t\t\t\t\t\t\treturn `\\`${isDev}\\``;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn `${isDev ? \"⌨️\" : \"👥\"}`;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (key === \"name\") {\n\t\t\t\t\t\t\treturn `[${name}](${url})`;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (key === \"version\") {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t[\"workspace\", \"catalog\", \"*\"].some((type) =>\n\t\t\t\t\t\t\t\t\tversion.includes(type),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\treturn `\\`${version}\\``;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn ` })})`;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst { dependencies = {}, devDependencies = {} } =\n\t\t\t\tfirst?.pkgJson || {};\n\n\t\t\tconst table = markdownTable([\n\t\t\t\tcreateHeading(\n\t\t\t\t\theadings,\n\t\t\t\t\tconfig.disableEmojis,\n\t\t\t\t\tconfig.templates?.emojis,\n\t\t\t\t),\n\t\t\t\t...Object.entries(devDependencies).map(mapDependencies(true)),\n\t\t\t\t...Object.entries(dependencies).map(mapDependencies(false)),\n\t\t\t]);\n\n\t\t\tconst heading = `### ${config.disableEmojis ? \"\" : \"📦\"} packages`;\n\t\t\tconst body = [heading, \"\", table].join(\"\\n\");\n\t\t\tconst tableAst = fromMarkdown(body);\n\n\t\t\treturn [start, tableAst, end];\n\t\t});\n\t};\n\nfunction loadTemplates(\n\ttemplates: Config[\"templates\"],\n): Record<\n\tkeyof NonNullable<Config[\"templates\"]>,\n\t(context: Partial<TemplateContext>) => string\n> {\n\tif (!templates) throw new Error(\"failed to load templates\");\n\n\treturn Object.fromEntries(\n\t\tObject.entries(templates).map(([key, value]) => {\n\t\t\tif (typeof value !== \"string\") return [];\n\t\t\treturn [key, Handlebars.compile(value)];\n\t\t}),\n\t);\n}\n"],"mappings":";AAAA,SAAS,gBAAAA,qBAAoB;AAC7B,YAAYC,SAAQ;AACpB,YAAYC,UAAS;AACrB,OAAO,SAAS;;;ACHhB,OAAO,WAAW;AAClB,OAAO,WAA6B;AACpC,SAAS,eAAe;AACxB,OAAOC,QAAO;;;ACHd,SAAS,SAAS;AAEX,IAAM,gBAAgB,EAC3B,KAAK,CAAC,UAAU,OAAO,SAAS,aAAa,KAAK,CAAC,EACnD,SAAS,wBAAwB;AAE5B,IAAM,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QAAMG,QAA6B,EAAE,OAAO,UAAU;AAEtD,OAAK,0BAA0B;AAE/B,EAAG,iBAAa,YAAY,CAAC,WAAW,GAAG,KAAK,GAAGA,KAAI;AAEvD,MAAI,YAAY;AACf,SAAK,oCAAoC;AAEzC,IAAG,iBAAa,OAAO,CAAC,OAAO,GAAG,KAAK,GAAGA,KAAI;AAAA,EAC/C;AAEA,MAAI,QAAS,SAAQ,KAAK;AAC3B;","names":["fromMarkdown","cp","fsp","z","z","debug","args","opts","fs","fsp","path","error","path","path","body","value","ast","heading","path","parse","dirname","args","path","fromMarkdown","parse","opts"]}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stephansama/auto-readme",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Generate lists and tables for your README automagically based on your repository and comments",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/stephansama/packages",
|
|
7
7
|
"type": "git",
|
|
8
|
-
"directory": "
|
|
8
|
+
"directory": "core/auto-readme"
|
|
9
9
|
},
|
|
10
|
-
"homepage": "https://packages.stephansama.info/
|
|
10
|
+
"homepage": "https://packages.stephansama.info/api/@stephansama/auto-readme",
|
|
11
11
|
"author": {
|
|
12
12
|
"email": "stephanrandle.dev@gmail.com",
|
|
13
13
|
"name": "Stephan Randle",
|
|
@@ -48,29 +48,36 @@
|
|
|
48
48
|
"table"
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
|
+
"@iarna/toml": "^2.2.5",
|
|
51
52
|
"@manypkg/get-packages": "^3.1.0",
|
|
52
53
|
"chalk": "^5.5.0",
|
|
53
54
|
"cosmiconfig": "^9.0.0",
|
|
55
|
+
"debug": "^4.4.1",
|
|
54
56
|
"deepmerge": "^4.3.1",
|
|
55
57
|
"fast-glob": "^3.3.3",
|
|
56
58
|
"handlebars": "^4.7.8",
|
|
57
59
|
"markdown-table": "^3.0.4",
|
|
60
|
+
"mdast-comment-marker": "^3.0.0",
|
|
58
61
|
"mdast-util-from-markdown": "^2.0.2",
|
|
59
62
|
"mdast-util-gfm": "^3.1.0",
|
|
60
|
-
"mdast-zone": "
|
|
63
|
+
"mdast-zone": "github:stephansama/mdast-zone#1c5b08cd97240debeed4c9c6afad49df5877a132",
|
|
61
64
|
"ora": "^8.2.0",
|
|
62
65
|
"pkg-types": "^2.2.0",
|
|
63
66
|
"remark": "^15.0.1",
|
|
67
|
+
"remark-code-import": "^1.2.0",
|
|
64
68
|
"remark-collapse": "^0.1.2",
|
|
65
69
|
"remark-toc": "^9.0.0",
|
|
66
70
|
"remark-usage": "^11.0.1",
|
|
71
|
+
"vfile": "^6.0.3",
|
|
67
72
|
"yaml": "^2.8.1",
|
|
68
73
|
"yargs": "^18.0.0",
|
|
69
74
|
"zod": "^4.0.15",
|
|
70
75
|
"zod2md": "^0.2.4"
|
|
71
76
|
},
|
|
72
77
|
"devDependencies": {
|
|
78
|
+
"@types/debug": "^4.1.12",
|
|
73
79
|
"@types/mdast": "^4.0.4",
|
|
80
|
+
"@types/vfile": "^4.0.0",
|
|
74
81
|
"@types/yargs": "^17.0.33",
|
|
75
82
|
"mdast": "^3.0.0",
|
|
76
83
|
"tsup": "^8.3.6",
|