@xylabs/ts-scripts-yarn3 7.4.18 → 7.4.20

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.
Files changed (182) hide show
  1. package/README.body.md +86 -0
  2. package/README.md +108 -0
  3. package/dist/actions/claude-commands.mjs +6 -2
  4. package/dist/actions/claude-commands.mjs.map +1 -1
  5. package/dist/actions/claude-rules.mjs +6 -2
  6. package/dist/actions/claude-rules.mjs.map +1 -1
  7. package/dist/actions/claude-skills.mjs +120 -0
  8. package/dist/actions/claude-skills.mjs.map +1 -0
  9. package/dist/actions/compile.mjs.map +1 -1
  10. package/dist/actions/cycle.mjs.map +1 -1
  11. package/dist/actions/dead.mjs.map +1 -1
  12. package/dist/actions/deploy-major.mjs.map +1 -1
  13. package/dist/actions/deploy-minor.mjs.map +1 -1
  14. package/dist/actions/deploy-next.mjs.map +1 -1
  15. package/dist/actions/deploy.mjs.map +1 -1
  16. package/dist/actions/fix.mjs.map +1 -1
  17. package/dist/actions/gen-docs.mjs.map +1 -1
  18. package/dist/actions/index.mjs +367 -160
  19. package/dist/actions/index.mjs.map +1 -1
  20. package/dist/actions/knip.mjs.map +1 -1
  21. package/dist/actions/lint.mjs.map +1 -1
  22. package/dist/actions/publint.mjs.map +1 -1
  23. package/dist/actions/publish.mjs.map +1 -1
  24. package/dist/actions/readme-gen.mjs +136 -20
  25. package/dist/actions/readme-gen.mjs.map +1 -1
  26. package/dist/actions/readme-init.mjs +83 -0
  27. package/dist/actions/readme-init.mjs.map +1 -0
  28. package/dist/actions/rebuild.mjs.map +1 -1
  29. package/dist/actions/reinstall.mjs.map +1 -1
  30. package/dist/actions/relint.mjs.map +1 -1
  31. package/dist/actions/retest.mjs +2 -2
  32. package/dist/actions/retest.mjs.map +1 -1
  33. package/dist/actions/sonar.mjs.map +1 -1
  34. package/dist/actions/test.mjs.map +1 -1
  35. package/dist/actions/up.mjs.map +1 -1
  36. package/dist/actions/updo.mjs.map +1 -1
  37. package/dist/actions/upplug.mjs.map +1 -1
  38. package/dist/actions/upyarn.mjs.map +1 -1
  39. package/dist/bin/xy.mjs +982 -642
  40. package/dist/bin/xy.mjs.map +1 -1
  41. package/dist/index.d.ts +46 -13
  42. package/dist/index.mjs +1044 -695
  43. package/dist/index.mjs.map +1 -1
  44. package/dist/lib/claudeMdTemplate.mjs +28 -3
  45. package/dist/lib/claudeMdTemplate.mjs.map +1 -1
  46. package/dist/lib/generateReadmeFiles.mjs +118 -21
  47. package/dist/lib/generateReadmeFiles.mjs.map +1 -1
  48. package/dist/lib/index.mjs +146 -24
  49. package/dist/lib/index.mjs.map +1 -1
  50. package/dist/lib/runSteps.mjs.map +1 -1
  51. package/dist/lib/runXy.mjs.map +1 -1
  52. package/dist/xy/{xyBuildCommands.mjs → build-commands/build.mjs} +107 -94
  53. package/dist/xy/build-commands/build.mjs.map +1 -0
  54. package/dist/xy/build-commands/index.mjs +502 -0
  55. package/dist/xy/build-commands/index.mjs.map +1 -0
  56. package/dist/xy/common/claude/commandsCommand.mjs +111 -0
  57. package/dist/xy/common/claude/commandsCommand.mjs.map +1 -0
  58. package/dist/xy/common/claude/index.mjs +441 -0
  59. package/dist/xy/common/claude/index.mjs.map +1 -0
  60. package/dist/xy/common/claude/initCommand.mjs +393 -0
  61. package/dist/xy/common/claude/initCommand.mjs.map +1 -0
  62. package/dist/xy/common/claude/rulesCommand.mjs +133 -0
  63. package/dist/xy/common/claude/rulesCommand.mjs.map +1 -0
  64. package/dist/xy/common/claude/settingsCommand.mjs +90 -0
  65. package/dist/xy/common/claude/settingsCommand.mjs.map +1 -0
  66. package/dist/xy/common/claude/skillsCommand.mjs +129 -0
  67. package/dist/xy/common/claude/skillsCommand.mjs.map +1 -0
  68. package/dist/xy/common/cleanDocsCommand.mjs +45 -0
  69. package/dist/xy/common/cleanDocsCommand.mjs.map +1 -0
  70. package/dist/xy/common/deadCommand.mjs +116 -0
  71. package/dist/xy/common/deadCommand.mjs.map +1 -0
  72. package/dist/xy/common/genDocsCommand.mjs +125 -0
  73. package/dist/xy/common/genDocsCommand.mjs.map +1 -0
  74. package/dist/xy/common/gitignoreGenCommand.mjs +98 -0
  75. package/dist/xy/common/gitignoreGenCommand.mjs.map +1 -0
  76. package/dist/xy/common/gitlintCommand.mjs +82 -0
  77. package/dist/xy/common/gitlintCommand.mjs.map +1 -0
  78. package/dist/xy/{xyCommonCommands.mjs → common/index.mjs} +561 -242
  79. package/dist/xy/common/index.mjs.map +1 -0
  80. package/dist/xy/common/licenseCommand.mjs +100 -0
  81. package/dist/xy/common/licenseCommand.mjs.map +1 -0
  82. package/dist/xy/common/npmignoreGenCommand.mjs +98 -0
  83. package/dist/xy/common/npmignoreGenCommand.mjs.map +1 -0
  84. package/dist/xy/common/readme/genCommand.mjs +321 -0
  85. package/dist/xy/common/readme/genCommand.mjs.map +1 -0
  86. package/dist/xy/common/readme/index.mjs +361 -0
  87. package/dist/xy/common/readme/index.mjs.map +1 -0
  88. package/dist/xy/common/readme/initCommand.mjs +103 -0
  89. package/dist/xy/common/readme/initCommand.mjs.map +1 -0
  90. package/dist/xy/common/retestCommand.mjs +111 -0
  91. package/dist/xy/common/retestCommand.mjs.map +1 -0
  92. package/dist/xy/common/testCommand.mjs +108 -0
  93. package/dist/xy/common/testCommand.mjs.map +1 -0
  94. package/dist/xy/common/upplugCommand.mjs +113 -0
  95. package/dist/xy/common/upplugCommand.mjs.map +1 -0
  96. package/dist/xy/common/upyarnCommand.mjs +108 -0
  97. package/dist/xy/common/upyarnCommand.mjs.map +1 -0
  98. package/dist/xy/common/yarn3OnlyCommand.mjs +70 -0
  99. package/dist/xy/common/yarn3OnlyCommand.mjs.map +1 -0
  100. package/dist/xy/deploy/deployCommand.mjs +139 -0
  101. package/dist/xy/deploy/deployCommand.mjs.map +1 -0
  102. package/dist/xy/deploy/deployMajorCommand.mjs +139 -0
  103. package/dist/xy/deploy/deployMajorCommand.mjs.map +1 -0
  104. package/dist/xy/deploy/deployMinorCommand.mjs +139 -0
  105. package/dist/xy/deploy/deployMinorCommand.mjs.map +1 -0
  106. package/dist/xy/deploy/deployNextCommand.mjs +139 -0
  107. package/dist/xy/deploy/deployNextCommand.mjs.map +1 -0
  108. package/dist/xy/{xyDeployCommands.mjs → deploy/index.mjs} +53 -53
  109. package/dist/xy/deploy/index.mjs.map +1 -0
  110. package/dist/xy/deploy/publishCommand.mjs +108 -0
  111. package/dist/xy/deploy/publishCommand.mjs.map +1 -0
  112. package/dist/xy/index.mjs +982 -642
  113. package/dist/xy/index.mjs.map +1 -1
  114. package/dist/xy/install/cleanCommand.mjs +140 -0
  115. package/dist/xy/install/cleanCommand.mjs.map +1 -0
  116. package/dist/xy/install/dupdepsCommand.mjs +191 -0
  117. package/dist/xy/install/dupdepsCommand.mjs.map +1 -0
  118. package/dist/xy/{xyInstallCommands.mjs → install/index.mjs} +71 -68
  119. package/dist/xy/install/index.mjs.map +1 -0
  120. package/dist/xy/install/reinstallCommand.mjs +140 -0
  121. package/dist/xy/install/reinstallCommand.mjs.map +1 -0
  122. package/dist/xy/install/staticsCommand.mjs +191 -0
  123. package/dist/xy/install/staticsCommand.mjs.map +1 -0
  124. package/dist/{actions/clean-jest.mjs → xy/install/upCommand.mjs} +15 -6
  125. package/dist/xy/install/upCommand.mjs.map +1 -0
  126. package/dist/xy/install/updoCommand.mjs +112 -0
  127. package/dist/xy/install/updoCommand.mjs.map +1 -0
  128. package/dist/xy/lint/cycleCommand.mjs +163 -0
  129. package/dist/xy/lint/cycleCommand.mjs.map +1 -0
  130. package/dist/xy/lint/deplintCommand.mjs +814 -0
  131. package/dist/xy/lint/deplintCommand.mjs.map +1 -0
  132. package/dist/xy/lint/fixCommand.mjs +168 -0
  133. package/dist/xy/lint/fixCommand.mjs.map +1 -0
  134. package/dist/xy/{xyLintCommands.mjs → lint/index.mjs} +176 -145
  135. package/dist/xy/lint/index.mjs.map +1 -0
  136. package/dist/xy/lint/knipCommand.mjs +121 -0
  137. package/dist/xy/lint/knipCommand.mjs.map +1 -0
  138. package/dist/xy/lint/lintCommand.mjs +186 -0
  139. package/dist/xy/lint/lintCommand.mjs.map +1 -0
  140. package/dist/xy/lint/publintCommand.mjs +187 -0
  141. package/dist/xy/lint/publintCommand.mjs.map +1 -0
  142. package/dist/xy/lint/relintCommand.mjs +163 -0
  143. package/dist/xy/lint/relintCommand.mjs.map +1 -0
  144. package/dist/xy/lint/sonarCommand.mjs +121 -0
  145. package/dist/xy/lint/sonarCommand.mjs.map +1 -0
  146. package/dist/xy/xy.mjs +980 -640
  147. package/dist/xy/xy.mjs.map +1 -1
  148. package/package.json +2 -2
  149. package/templates/claude/skills/xylabs-e2e-setup/SKILL.md +196 -0
  150. package/templates/readme/README.body.md +11 -0
  151. package/templates/readme/README.template.md +22 -0
  152. package/dist/actions/clean-jest.mjs.map +0 -1
  153. package/dist/xy/xyBuildCommands.mjs.map +0 -1
  154. package/dist/xy/xyCommonCommands.mjs.map +0 -1
  155. package/dist/xy/xyDeployCommands.mjs.map +0 -1
  156. package/dist/xy/xyInstallCommands.mjs.map +0 -1
  157. package/dist/xy/xyLintCommands.mjs.map +0 -1
  158. /package/templates/{CLAUDE-project.md → claude/CLAUDE-project.md} +0 -0
  159. /package/templates/{commands → claude/commands}/xylabs-build.md +0 -0
  160. /package/templates/{commands → claude/commands}/xylabs-clean.md +0 -0
  161. /package/templates/{commands → claude/commands}/xylabs-compile.md +0 -0
  162. /package/templates/{commands → claude/commands}/xylabs-cycle.md +0 -0
  163. /package/templates/{commands → claude/commands}/xylabs-deplint.md +0 -0
  164. /package/templates/{commands → claude/commands}/xylabs-deploy-major.md +0 -0
  165. /package/templates/{commands → claude/commands}/xylabs-deploy-minor.md +0 -0
  166. /package/templates/{commands → claude/commands}/xylabs-deploy.md +0 -0
  167. /package/templates/{commands → claude/commands}/xylabs-fix.md +0 -0
  168. /package/templates/{commands → claude/commands}/xylabs-knip.md +0 -0
  169. /package/templates/{commands → claude/commands}/xylabs-lint.md +0 -0
  170. /package/templates/{commands → claude/commands}/xylabs-publint.md +0 -0
  171. /package/templates/{commands → claude/commands}/xylabs-rebuild.md +0 -0
  172. /package/templates/{commands → claude/commands}/xylabs-test.md +0 -0
  173. /package/templates/{rules → claude/rules}/xylabs-architecture.md +0 -0
  174. /package/templates/{rules → claude/rules}/xylabs-build.md +0 -0
  175. /package/templates/{rules → claude/rules}/xylabs-dependencies.md +0 -0
  176. /package/templates/{rules → claude/rules}/xylabs-error-handling.md +0 -0
  177. /package/templates/{rules → claude/rules}/xylabs-frameworks.md +0 -0
  178. /package/templates/{rules → claude/rules}/xylabs-git-workflow.md +0 -0
  179. /package/templates/{rules → claude/rules}/xylabs-linting.md +0 -0
  180. /package/templates/{rules → claude/rules}/xylabs-naming.md +0 -0
  181. /package/templates/{rules → claude/rules}/xylabs-style.md +0 -0
  182. /package/templates/{rules → claude/rules}/xylabs-typescript.md +0 -0
@@ -12,14 +12,19 @@ var checkResult = (name, result, level = "error", exitOnFail = false) => {
12
12
  };
13
13
 
14
14
  // src/lib/claudeMdTemplate.ts
15
- import { readdirSync, readFileSync } from "fs";
15
+ import {
16
+ readdirSync,
17
+ readFileSync,
18
+ statSync
19
+ } from "fs";
16
20
  import { createRequire } from "module";
17
21
  import PATH from "path";
18
22
  var require2 = createRequire(import.meta.url);
19
23
  var packageRoot = PATH.dirname(require2.resolve("@xylabs/ts-scripts-yarn3/package.json"));
20
- var templatesDir = PATH.resolve(packageRoot, "templates");
24
+ var templatesDir = PATH.resolve(packageRoot, "templates", "claude");
21
25
  var XYLABS_RULES_PREFIX = "xylabs-";
22
26
  var XYLABS_COMMANDS_PREFIX = "xylabs-";
27
+ var XYLABS_SKILLS_PREFIX = "xylabs-";
23
28
  var claudeMdRuleTemplates = () => {
24
29
  const rulesDir = PATH.resolve(templatesDir, "rules");
25
30
  const files = readdirSync(rulesDir).filter((f) => f.startsWith(XYLABS_RULES_PREFIX) && f.endsWith(".md"));
@@ -38,6 +43,24 @@ var claudeCommandTemplates = () => {
38
43
  }
39
44
  return result;
40
45
  };
46
+ var claudeSkillTemplates = () => {
47
+ const skillsDir = PATH.resolve(templatesDir, "skills");
48
+ const dirs = readdirSync(skillsDir).filter(
49
+ (f) => f.startsWith(XYLABS_SKILLS_PREFIX) && statSync(PATH.resolve(skillsDir, f)).isDirectory()
50
+ );
51
+ const result = {};
52
+ for (const dir of dirs) {
53
+ const dirPath = PATH.resolve(skillsDir, dir);
54
+ const files = readdirSync(dirPath, { recursive: true, encoding: "utf8" });
55
+ result[dir] = {};
56
+ for (const file of files) {
57
+ if (statSync(PATH.resolve(dirPath, file)).isFile()) {
58
+ result[dir][file] = readFileSync(PATH.resolve(dirPath, file), "utf8");
59
+ }
60
+ }
61
+ }
62
+ return result;
63
+ };
41
64
  var claudeMdProjectTemplate = () => readFileSync(PATH.resolve(templatesDir, "CLAUDE-project.md"), "utf8");
42
65
 
43
66
  // src/lib/deleteGlob.ts
@@ -194,10 +217,19 @@ var generateIgnoreFiles = (filename3, pkg) => {
194
217
 
195
218
  // src/lib/generateReadmeFiles.ts
196
219
  import { execSync } from "child_process";
197
- import FS from "fs";
198
- import { readFile, writeFile } from "fs/promises";
220
+ import FS, { readFileSync as readFileSync3 } from "fs";
221
+ import {
222
+ mkdir,
223
+ readFile,
224
+ writeFile
225
+ } from "fs/promises";
226
+ import { createRequire as createRequire2 } from "module";
199
227
  import PATH2 from "path";
228
+ import { createInterface } from "readline";
200
229
  import chalk4 from "chalk";
230
+ var require3 = createRequire2(import.meta.url);
231
+ var packageRoot2 = PATH2.dirname(require3.resolve("@xylabs/ts-scripts-yarn3/package.json"));
232
+ var readmeTemplatesDir = PATH2.resolve(packageRoot2, "templates", "readme");
201
233
  function fillTemplate(template, data) {
202
234
  const additionalData = { ...data, safeName: data.name.replaceAll("/", "__").replaceAll("@", "") };
203
235
  return template.replaceAll(/\{\{(.*?)\}\}/g, (_, key) => additionalData[key.trim()] ?? "");
@@ -287,60 +319,164 @@ ${indent}### ${item.name}
287
319
  }
288
320
  return content;
289
321
  }
322
+ function askConfirmation(question) {
323
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
324
+ return new Promise((resolve) => {
325
+ rl.question(question, (answer) => {
326
+ rl.close();
327
+ resolve(answer.toLowerCase() === "y" || answer.toLowerCase() === "yes");
328
+ });
329
+ });
330
+ }
331
+ var DEFAULT_README_TEMPLATE = readFileSync3(PATH2.resolve(readmeTemplatesDir, "README.template.md"), "utf8");
332
+ var DEFAULT_README_BODY = readFileSync3(PATH2.resolve(readmeTemplatesDir, "README.body.md"), "utf8");
333
+ function applyLogoConfig(template, logoUrl, logoLinkUrl) {
334
+ let result = template;
335
+ if (logoUrl) {
336
+ result = result.replace(/\[logo]: .+/, `[logo]: ${logoUrl}`);
337
+ if (logoLinkUrl) {
338
+ result = result.replace(/\[!\[logo]\[]][^)]*\)/, `[![logo][]](${logoLinkUrl})`);
339
+ }
340
+ } else {
341
+ result = result.replace(/\[!\[logo]\[]][^\n]*\n*/, "");
342
+ result = result.replace(/\[logo]: [^\n]*\n?/, "");
343
+ }
344
+ return result;
345
+ }
346
+ function resolveTemplatePath(templatePath) {
347
+ const cwd = INIT_CWD() ?? ".";
348
+ return templatePath ?? PATH2.join(cwd, ".xy", "README.template.md");
349
+ }
350
+ async function loadOrCreateTemplate(resolvedTemplatePath) {
351
+ try {
352
+ const template = await readFile(resolvedTemplatePath, "utf8");
353
+ return { created: false, template };
354
+ } catch {
355
+ console.log(chalk4.yellow(`Template not found: ${resolvedTemplatePath}`));
356
+ const shouldCreate = await askConfirmation("Would you like to create a stock template? (y/N) ");
357
+ if (!shouldCreate) {
358
+ throw new Error("Template creation declined");
359
+ }
360
+ const template = DEFAULT_README_TEMPLATE;
361
+ await scaffoldTemplate(resolvedTemplatePath, template);
362
+ return { created: true, template };
363
+ }
364
+ }
365
+ async function scaffoldTemplate(resolvedTemplatePath, template) {
366
+ const xyDir = PATH2.dirname(resolvedTemplatePath);
367
+ await mkdir(xyDir, { recursive: true });
368
+ await writeFile(resolvedTemplatePath, template);
369
+ console.log(chalk4.green(`Created template: ${resolvedTemplatePath}`));
370
+ const bodyPath = PATH2.join(xyDir, "README.body.md");
371
+ await writeFile(bodyPath, DEFAULT_README_BODY);
372
+ console.log(chalk4.green(`Created body template: ${bodyPath}`));
373
+ }
374
+ async function resolveBody(location, defaultBody) {
375
+ const localBodyPath = PATH2.join(location, "README.body.md");
376
+ try {
377
+ return await readFile(localBodyPath, "utf8");
378
+ } catch {
379
+ return defaultBody;
380
+ }
381
+ }
382
+ async function generateReadmeForWorkspace(location, name, template, defaultBody, typedoc, verbose) {
383
+ try {
384
+ const pkgJsonPath = PATH2.join(location, "package.json");
385
+ const pkgJson = JSON.parse(await readFile(pkgJsonPath, "utf8"));
386
+ const body = await resolveBody(location, defaultBody);
387
+ const typedocContent = typedoc ? generateTypedoc(location, ["src/index*.ts"]) : "";
388
+ const readmeContent = fillTemplate(template, {
389
+ ...pkgJson,
390
+ body,
391
+ typedoc: typedocContent
392
+ });
393
+ await writeFile(PATH2.join(location, "README.md"), readmeContent);
394
+ if (verbose) console.log(chalk4.green(` ${name}`));
395
+ return true;
396
+ } catch (ex) {
397
+ const error = ex;
398
+ console.warn(chalk4.yellow(` Skipped ${location}: ${error.message}`));
399
+ return false;
400
+ }
401
+ }
290
402
  async function generateReadmeFiles({
403
+ logoLinkUrl,
404
+ logoUrl,
291
405
  pkg,
292
406
  templatePath,
293
407
  typedoc = false,
294
- verbose
408
+ verbose = false
295
409
  }) {
296
410
  console.log(chalk4.green("Generate README Files"));
297
- const cwd = INIT_CWD() ?? ".";
298
- const resolvedTemplatePath = templatePath ?? PATH2.join(cwd, "scripts", "README.template.md");
411
+ const resolvedTemplatePath = resolveTemplatePath(templatePath);
299
412
  let template;
413
+ let templateCreated;
300
414
  try {
301
- template = await readFile(resolvedTemplatePath, "utf8");
415
+ ({ template, created: templateCreated } = await loadOrCreateTemplate(resolvedTemplatePath));
302
416
  } catch {
303
- console.error(chalk4.red(`Template not found: ${resolvedTemplatePath}`));
304
417
  return 1;
305
418
  }
306
- const workspaces = pkg ? [yarnWorkspace(pkg)] : yarnWorkspaces();
419
+ template = applyLogoConfig(template, logoUrl, logoLinkUrl);
420
+ if (templateCreated) {
421
+ console.log(chalk4.green("Generating README files for all packages..."));
422
+ }
423
+ const xyDir = PATH2.dirname(resolvedTemplatePath);
424
+ const xyBodyPath = PATH2.join(xyDir, "README.body.md");
425
+ let defaultBody;
426
+ try {
427
+ defaultBody = await readFile(xyBodyPath, "utf8");
428
+ } catch {
429
+ defaultBody = DEFAULT_README_BODY;
430
+ }
431
+ const workspaces = pkg && !templateCreated ? [yarnWorkspace(pkg)] : yarnWorkspaces();
307
432
  let failed = false;
308
433
  for (const { location, name } of workspaces) {
309
- try {
310
- const pkgJsonPath = PATH2.join(location, "package.json");
311
- const pkgJson = JSON.parse(await readFile(pkgJsonPath, "utf8"));
312
- const typedocContent = typedoc ? generateTypedoc(location, ["src/index*.ts"]) : "";
313
- const readmeContent = fillTemplate(template, { ...pkgJson, typedoc: typedocContent });
314
- await writeFile(PATH2.join(location, "README.md"), readmeContent);
315
- if (verbose) console.log(chalk4.green(` ${name}`));
316
- } catch (ex) {
317
- const error = ex;
318
- console.warn(chalk4.yellow(` Skipped ${location}: ${error.message}`));
319
- failed = true;
320
- }
434
+ const success = await generateReadmeForWorkspace(location, name, template, defaultBody, typedoc, verbose);
435
+ if (!success) failed = true;
321
436
  }
322
437
  return failed ? 1 : 0;
323
438
  }
324
439
 
440
+ // src/lib/loadConfig.ts
441
+ import chalk5 from "chalk";
442
+ import { cosmiconfig } from "cosmiconfig";
443
+ import { TypeScriptLoader } from "cosmiconfig-typescript-loader";
444
+ import deepmerge from "deepmerge";
445
+ var config;
446
+ var loadConfig = async (params) => {
447
+ if (config === void 0) {
448
+ const cosmicConfigResult = await cosmiconfig("xy", { cache: true, loaders: { ".ts": TypeScriptLoader() } }).search();
449
+ config = cosmicConfigResult?.config;
450
+ const configFilePath = cosmicConfigResult?.filepath;
451
+ if (configFilePath !== void 0) {
452
+ console.log(chalk5.green(`Loaded config from ${configFilePath}`));
453
+ if (config.verbose) {
454
+ console.log(chalk5.gray(`${JSON.stringify(config, null, 2)}`));
455
+ }
456
+ }
457
+ }
458
+ return deepmerge(config, params ?? {});
459
+ };
460
+
325
461
  // src/lib/runSteps.ts
326
462
  import { spawnSync as spawnSync3 } from "child_process";
327
463
  import { existsSync as existsSync2 } from "fs";
328
- import chalk5 from "chalk";
464
+ import chalk6 from "chalk";
329
465
  var runSteps = (name, steps, exitOnFail = true, messages) => {
330
466
  return safeExit(() => {
331
467
  const pkgName = process.env.npm_package_name;
332
- console.log(chalk5.green(`${name} [${pkgName}]`));
468
+ console.log(chalk6.green(`${name} [${pkgName}]`));
333
469
  let totalStatus = 0;
334
- for (const [i, [command, args, config]] of steps.entries()) {
470
+ for (const [i, [command, args, config2]] of steps.entries()) {
335
471
  if (messages?.[i]) {
336
- console.log(chalk5.gray(messages?.[i]));
472
+ console.log(chalk6.gray(messages?.[i]));
337
473
  }
338
474
  const argList = Array.isArray(args) ? args : args.split(" ");
339
475
  if (command === "node" && !existsSync2(argList[0])) {
340
476
  throw new Error(`File not found [${argList[0]}]`);
341
477
  }
342
478
  const status = spawnSync3(command, Array.isArray(args) ? args : args.split(" "), {
343
- ...config,
479
+ ...config2,
344
480
  encoding: "utf8",
345
481
  env: { FORCE_COLOR: "3", ...process.env },
346
482
  shell: true,
@@ -358,12 +494,12 @@ import {
358
494
  existsSync as existsSync3,
359
495
  mkdirSync,
360
496
  readdirSync as readdirSync2,
361
- readFileSync as readFileSync3,
497
+ readFileSync as readFileSync4,
362
498
  unlinkSync,
363
499
  writeFileSync as writeFileSync2
364
500
  } from "fs";
365
501
  import PATH3 from "path";
366
- import chalk6 from "chalk";
502
+ import chalk7 from "chalk";
367
503
  var syncCommandFiles = (commandsDir) => {
368
504
  const templates = claudeCommandTemplates();
369
505
  const templateNames = new Set(Object.keys(templates));
@@ -371,7 +507,7 @@ var syncCommandFiles = (commandsDir) => {
371
507
  let created = 0;
372
508
  for (const [filename3, content] of Object.entries(templates)) {
373
509
  const targetPath = PATH3.resolve(commandsDir, filename3);
374
- const existing = existsSync3(targetPath) ? readFileSync3(targetPath, "utf8") : void 0;
510
+ const existing = existsSync3(targetPath) ? readFileSync4(targetPath, "utf8") : void 0;
375
511
  if (existing === content) continue;
376
512
  writeFileSync2(targetPath, content, "utf8");
377
513
  if (existing) {
@@ -404,9 +540,9 @@ var logCommandsResult = (created, updated, removed) => {
404
540
  updated ? `${updated} updated` : "",
405
541
  removed ? `${removed} removed` : ""
406
542
  ].filter(Boolean);
407
- console.log(chalk6.green(`.claude/commands/${XYLABS_COMMANDS_PREFIX}*.md: ${parts.join(", ")}`));
543
+ console.log(chalk7.green(`.claude/commands/${XYLABS_COMMANDS_PREFIX}*.md: ${parts.join(", ")}`));
408
544
  } else {
409
- console.log(chalk6.gray(`.claude/commands/${XYLABS_COMMANDS_PREFIX}*.md: already up to date`));
545
+ console.log(chalk7.gray(`.claude/commands/${XYLABS_COMMANDS_PREFIX}*.md: already up to date`));
410
546
  }
411
547
  };
412
548
  var claudeCommands = () => {
@@ -428,12 +564,12 @@ import {
428
564
  existsSync as existsSync4,
429
565
  mkdirSync as mkdirSync2,
430
566
  readdirSync as readdirSync3,
431
- readFileSync as readFileSync4,
567
+ readFileSync as readFileSync5,
432
568
  unlinkSync as unlinkSync2,
433
569
  writeFileSync as writeFileSync3
434
570
  } from "fs";
435
571
  import PATH4 from "path";
436
- import chalk7 from "chalk";
572
+ import chalk8 from "chalk";
437
573
  var syncRuleFiles = (rulesDir) => {
438
574
  const templates = claudeMdRuleTemplates();
439
575
  const templateNames = new Set(Object.keys(templates));
@@ -441,7 +577,7 @@ var syncRuleFiles = (rulesDir) => {
441
577
  let created = 0;
442
578
  for (const [filename3, content] of Object.entries(templates)) {
443
579
  const targetPath = PATH4.resolve(rulesDir, filename3);
444
- const existing = existsSync4(targetPath) ? readFileSync4(targetPath, "utf8") : void 0;
580
+ const existing = existsSync4(targetPath) ? readFileSync5(targetPath, "utf8") : void 0;
445
581
  if (existing === content) continue;
446
582
  writeFileSync3(targetPath, content, "utf8");
447
583
  if (existing) {
@@ -474,21 +610,21 @@ var logRulesResult = (created, updated, removed) => {
474
610
  updated ? `${updated} updated` : "",
475
611
  removed ? `${removed} removed` : ""
476
612
  ].filter(Boolean);
477
- console.log(chalk7.green(`.claude/rules/${XYLABS_RULES_PREFIX}*.md: ${parts.join(", ")}`));
613
+ console.log(chalk8.green(`.claude/rules/${XYLABS_RULES_PREFIX}*.md: ${parts.join(", ")}`));
478
614
  } else {
479
- console.log(chalk7.gray(`.claude/rules/${XYLABS_RULES_PREFIX}*.md: already up to date`));
615
+ console.log(chalk8.gray(`.claude/rules/${XYLABS_RULES_PREFIX}*.md: already up to date`));
480
616
  }
481
617
  };
482
618
  var ensureProjectClaudeMd = (cwd, force) => {
483
619
  const projectPath = PATH4.resolve(cwd, "CLAUDE.md");
484
620
  if (!existsSync4(projectPath) || force) {
485
621
  if (force && existsSync4(projectPath)) {
486
- console.log(chalk7.yellow("Overwriting existing CLAUDE.md"));
622
+ console.log(chalk8.yellow("Overwriting existing CLAUDE.md"));
487
623
  }
488
624
  writeFileSync3(projectPath, claudeMdProjectTemplate(), "utf8");
489
- console.log(chalk7.green("Generated CLAUDE.md"));
625
+ console.log(chalk8.green("Generated CLAUDE.md"));
490
626
  } else {
491
- console.log(chalk7.gray("CLAUDE.md already exists (skipped)"));
627
+ console.log(chalk8.gray("CLAUDE.md already exists (skipped)"));
492
628
  }
493
629
  };
494
630
  var claudeRules = ({ force } = {}) => {
@@ -513,8 +649,8 @@ import {
513
649
  writeFileSync as writeFileSync4
514
650
  } from "fs";
515
651
  import PATH5 from "path";
516
- import { createInterface } from "readline";
517
- import chalk8 from "chalk";
652
+ import { createInterface as createInterface2 } from "readline";
653
+ import chalk9 from "chalk";
518
654
  var DEFAULT_SETTINGS = {
519
655
  permissions: {
520
656
  allow: [
@@ -548,8 +684,8 @@ var DEFAULT_SETTINGS = {
548
684
  ]
549
685
  }
550
686
  };
551
- function askConfirmation(question) {
552
- const rl = createInterface({ input: process.stdin, output: process.stdout });
687
+ function askConfirmation2(question) {
688
+ const rl = createInterface2({ input: process.stdin, output: process.stdout });
553
689
  return new Promise((resolve) => {
554
690
  rl.question(question, (answer) => {
555
691
  rl.close();
@@ -563,26 +699,104 @@ async function claudeSettings() {
563
699
  const settingsPath = PATH5.resolve(claudeDir, "settings.local.json");
564
700
  mkdirSync3(claudeDir, { recursive: true });
565
701
  if (existsSync5(settingsPath)) {
566
- const confirmed = await askConfirmation(
567
- chalk8.yellow(`${settingsPath} already exists. Replace it? (y/N) `)
702
+ const confirmed = await askConfirmation2(
703
+ chalk9.yellow(`${settingsPath} already exists. Replace it? (y/N) `)
568
704
  );
569
705
  if (!confirmed) {
570
- console.log(chalk8.gray("Skipped \u2014 existing settings.local.json preserved"));
706
+ console.log(chalk9.gray("Skipped \u2014 existing settings.local.json preserved"));
571
707
  return 0;
572
708
  }
573
709
  }
574
710
  writeFileSync4(settingsPath, `${JSON.stringify(DEFAULT_SETTINGS, null, 2)}
575
711
  `, "utf8");
576
- console.log(chalk8.green("Generated .claude/settings.local.json"));
712
+ console.log(chalk9.green("Generated .claude/settings.local.json"));
577
713
  return 0;
578
714
  }
579
715
 
716
+ // src/actions/claude-skills.ts
717
+ import {
718
+ existsSync as existsSync6,
719
+ mkdirSync as mkdirSync4,
720
+ readdirSync as readdirSync4,
721
+ readFileSync as readFileSync6,
722
+ rmSync,
723
+ statSync as statSync2,
724
+ writeFileSync as writeFileSync5
725
+ } from "fs";
726
+ import PATH6 from "path";
727
+ import chalk10 from "chalk";
728
+ var syncSkillFiles = (skillsDir) => {
729
+ const templates = claudeSkillTemplates();
730
+ const templateNames = new Set(Object.keys(templates));
731
+ let updated = 0;
732
+ let created = 0;
733
+ for (const [skillName, files] of Object.entries(templates)) {
734
+ const skillDir = PATH6.resolve(skillsDir, skillName);
735
+ mkdirSync4(skillDir, { recursive: true });
736
+ for (const [filename3, content] of Object.entries(files)) {
737
+ const targetPath = PATH6.resolve(skillDir, filename3);
738
+ mkdirSync4(PATH6.dirname(targetPath), { recursive: true });
739
+ const existing = existsSync6(targetPath) ? readFileSync6(targetPath, "utf8") : void 0;
740
+ if (existing === content) continue;
741
+ writeFileSync5(targetPath, content, "utf8");
742
+ if (existing) {
743
+ updated++;
744
+ } else {
745
+ created++;
746
+ }
747
+ }
748
+ }
749
+ return {
750
+ created,
751
+ templateNames,
752
+ updated
753
+ };
754
+ };
755
+ var removeStaleSkills = (skillsDir, templateNames) => {
756
+ const existingSkills = readdirSync4(skillsDir).filter(
757
+ (f) => f.startsWith(XYLABS_SKILLS_PREFIX) && statSync2(PATH6.resolve(skillsDir, f)).isDirectory()
758
+ );
759
+ let removed = 0;
760
+ for (const dir of existingSkills) {
761
+ if (!templateNames.has(dir)) {
762
+ rmSync(PATH6.resolve(skillsDir, dir), { recursive: true });
763
+ removed++;
764
+ }
765
+ }
766
+ return removed;
767
+ };
768
+ var logSkillsResult = (created, updated, removed) => {
769
+ if (created || updated || removed) {
770
+ const parts = [
771
+ created ? `${created} created` : "",
772
+ updated ? `${updated} updated` : "",
773
+ removed ? `${removed} removed` : ""
774
+ ].filter(Boolean);
775
+ console.log(chalk10.green(`.claude/skills/${XYLABS_SKILLS_PREFIX}*/: ${parts.join(", ")}`));
776
+ } else {
777
+ console.log(chalk10.gray(`.claude/skills/${XYLABS_SKILLS_PREFIX}*/: already up to date`));
778
+ }
779
+ };
780
+ var claudeSkills = () => {
781
+ const cwd = INIT_CWD() ?? process.cwd();
782
+ const skillsDir = PATH6.resolve(cwd, ".claude", "skills");
783
+ mkdirSync4(skillsDir, { recursive: true });
784
+ const {
785
+ created,
786
+ templateNames,
787
+ updated
788
+ } = syncSkillFiles(skillsDir);
789
+ const removed = removeStaleSkills(skillsDir, templateNames);
790
+ logSkillsResult(created, updated, removed);
791
+ return 0;
792
+ };
793
+
580
794
  // src/actions/clean-docs.ts
581
795
  import path from "path";
582
- import chalk9 from "chalk";
796
+ import chalk11 from "chalk";
583
797
  var cleanDocs = () => {
584
798
  const pkgName = process.env.npm_package_name;
585
- console.log(chalk9.green(`Cleaning Docs [${pkgName}]`));
799
+ console.log(chalk11.green(`Cleaning Docs [${pkgName}]`));
586
800
  for (const { location } of yarnWorkspaces()) deleteGlob(path.join(location, "docs"));
587
801
  return 0;
588
802
  };
@@ -611,7 +825,7 @@ var filename = ".gitignore";
611
825
  var gitignoreGen = (pkg) => generateIgnoreFiles(filename, pkg);
612
826
 
613
827
  // src/actions/gitlint.ts
614
- import chalk10 from "chalk";
828
+ import chalk12 from "chalk";
615
829
  import ParseGitConfig from "parse-git-config";
616
830
  var gitlint = () => {
617
831
  console.log(`
@@ -622,7 +836,7 @@ Gitlint Start [${process.cwd()}]
622
836
  const errors = 0;
623
837
  const gitConfig = ParseGitConfig.sync();
624
838
  const warn = (message) => {
625
- console.warn(chalk10.yellow(`Warning: ${message}`));
839
+ console.warn(chalk12.yellow(`Warning: ${message}`));
626
840
  warnings++;
627
841
  };
628
842
  if (gitConfig.core.ignorecase) {
@@ -642,13 +856,13 @@ Gitlint Start [${process.cwd()}]
642
856
  }
643
857
  const resultMessages = [];
644
858
  if (valid > 0) {
645
- resultMessages.push(chalk10.green(`Passed: ${valid}`));
859
+ resultMessages.push(chalk12.green(`Passed: ${valid}`));
646
860
  }
647
861
  if (warnings > 0) {
648
- resultMessages.push(chalk10.yellow(`Warnings: ${warnings}`));
862
+ resultMessages.push(chalk12.yellow(`Warnings: ${warnings}`));
649
863
  }
650
864
  if (errors > 0) {
651
- resultMessages.push(chalk10.red(` Errors: ${errors}`));
865
+ resultMessages.push(chalk12.red(` Errors: ${errors}`));
652
866
  }
653
867
  console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
654
868
  `);
@@ -657,7 +871,7 @@ Gitlint Start [${process.cwd()}]
657
871
 
658
872
  // src/actions/gitlint-fix.ts
659
873
  import { execSync as execSync2 } from "child_process";
660
- import chalk11 from "chalk";
874
+ import chalk13 from "chalk";
661
875
  import ParseGitConfig2 from "parse-git-config";
662
876
  var gitlintFix = () => {
663
877
  console.log(`
@@ -666,21 +880,21 @@ Gitlint Fix Start [${process.cwd()}]
666
880
  const gitConfig = ParseGitConfig2.sync();
667
881
  if (gitConfig.core.ignorecase) {
668
882
  execSync2("git config core.ignorecase false", { stdio: "inherit" });
669
- console.warn(chalk11.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
883
+ console.warn(chalk13.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
670
884
  }
671
885
  if (gitConfig.core.autocrlf !== false) {
672
886
  execSync2("git config core.autocrlf false", { stdio: "inherit" });
673
- console.warn(chalk11.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
887
+ console.warn(chalk13.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
674
888
  }
675
889
  if (gitConfig.core.eol !== "lf") {
676
890
  execSync2("git config core.eol lf", { stdio: "inherit" });
677
- console.warn(chalk11.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
891
+ console.warn(chalk13.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
678
892
  }
679
893
  return 1;
680
894
  };
681
895
 
682
896
  // src/actions/license.ts
683
- import chalk12 from "chalk";
897
+ import chalk14 from "chalk";
684
898
  import { init } from "license-checker";
685
899
  var license = async (pkg) => {
686
900
  const workspaces = yarnWorkspaces();
@@ -705,18 +919,18 @@ var license = async (pkg) => {
705
919
  "LGPL-3.0-or-later",
706
920
  "Python-2.0"
707
921
  ]);
708
- console.log(chalk12.green("License Checker"));
922
+ console.log(chalk14.green("License Checker"));
709
923
  return (await Promise.all(
710
924
  workspaceList.map(({ location, name }) => {
711
925
  return new Promise((resolve) => {
712
926
  init({ production: true, start: location }, (error, packages) => {
713
927
  if (error) {
714
- console.error(chalk12.red(`License Checker [${name}] Error`));
715
- console.error(chalk12.gray(error));
928
+ console.error(chalk14.red(`License Checker [${name}] Error`));
929
+ console.error(chalk14.gray(error));
716
930
  console.log("\n");
717
931
  resolve(1);
718
932
  } else {
719
- console.log(chalk12.green(`License Checker [${name}]`));
933
+ console.log(chalk14.green(`License Checker [${name}]`));
720
934
  let count = 0;
721
935
  for (const [name2, info] of Object.entries(packages)) {
722
936
  const licenses = Array.isArray(info.licenses) ? info.licenses : [info.licenses];
@@ -732,7 +946,7 @@ var license = async (pkg) => {
732
946
  }
733
947
  if (!orLicenseFound) {
734
948
  count++;
735
- console.warn(chalk12.yellow(`${name2}: Package License not allowed [${license2}]`));
949
+ console.warn(chalk14.yellow(`${name2}: Package License not allowed [${license2}]`));
736
950
  }
737
951
  }
738
952
  }
@@ -757,7 +971,10 @@ async function readmeGen({
757
971
  typedoc,
758
972
  verbose
759
973
  }) {
974
+ const config2 = await loadConfig();
760
975
  return await generateReadmeFiles({
976
+ logoLinkUrl: config2.readme?.logoLinkUrl,
977
+ logoUrl: config2.readme?.logoUrl,
761
978
  pkg,
762
979
  templatePath,
763
980
  typedoc,
@@ -765,11 +982,20 @@ async function readmeGen({
765
982
  });
766
983
  }
767
984
 
985
+ // src/actions/readme-init.ts
986
+ async function readmeInit({ templatePath }) {
987
+ const config2 = await loadConfig();
988
+ const template = applyLogoConfig(DEFAULT_README_TEMPLATE, config2.readme?.logoUrl, config2.readme?.logoLinkUrl);
989
+ const resolvedTemplatePath = resolveTemplatePath(templatePath);
990
+ await scaffoldTemplate(resolvedTemplatePath, template);
991
+ return 0;
992
+ }
993
+
768
994
  // src/actions/retest.ts
769
995
  var retest = () => {
770
996
  return runSteps("Test", [
771
- ["yarn", ["jest", "--clearCache"]],
772
- ["yarn", ["jest", "."]]
997
+ ["yarn", ["vitest", "--clearCache"]],
998
+ ["yarn", ["vitest", "."]]
773
999
  ]);
774
1000
  };
775
1001
 
@@ -802,188 +1028,281 @@ var yarn3Only = () => {
802
1028
  return 0;
803
1029
  };
804
1030
 
1031
+ // src/xy/common/claude/commandsCommand.ts
1032
+ var commandsCommand = {
1033
+ command: "commands",
1034
+ describe: "Sync XY Labs standard Claude slash commands to .claude/commands/",
1035
+ handler: (argv) => {
1036
+ if (argv.verbose) console.log("Claude Commands");
1037
+ process.exitCode = claudeCommands();
1038
+ }
1039
+ };
1040
+
1041
+ // src/xy/common/claude/initCommand.ts
1042
+ var initCommand = {
1043
+ builder: (yargs) => {
1044
+ return yargs.option("force", {
1045
+ alias: "f",
1046
+ default: false,
1047
+ description: "Overwrite existing CLAUDE.md",
1048
+ type: "boolean"
1049
+ });
1050
+ },
1051
+ command: "init",
1052
+ describe: "Initialize all Claude configuration (commands, rules, settings)",
1053
+ handler: async (argv) => {
1054
+ if (argv.verbose) console.log("Claude Init");
1055
+ const commandsResult = claudeCommands();
1056
+ const rulesResult = claudeRules({ force: argv.force });
1057
+ const settingsResult = await claudeSettings();
1058
+ process.exitCode = commandsResult || rulesResult || settingsResult;
1059
+ }
1060
+ };
1061
+ var initClaudeSkillsCommand = {
1062
+ command: "init:skills",
1063
+ describe: "Initialize Claude skills configuration",
1064
+ handler: () => {
1065
+ const result = claudeSkills();
1066
+ process.exitCode = result;
1067
+ }
1068
+ };
1069
+
1070
+ // src/xy/common/claude/rulesCommand.ts
1071
+ var rulesCommand = {
1072
+ builder: (yargs) => {
1073
+ return yargs.option("force", {
1074
+ alias: "f",
1075
+ default: false,
1076
+ description: "Overwrite existing CLAUDE.md",
1077
+ type: "boolean"
1078
+ });
1079
+ },
1080
+ command: "rules",
1081
+ describe: "Sync XY Labs standard Claude rules to .claude/rules/",
1082
+ handler: (argv) => {
1083
+ if (argv.verbose) console.log("Claude Rules");
1084
+ process.exitCode = claudeRules({ force: argv.force });
1085
+ }
1086
+ };
1087
+
1088
+ // src/xy/common/claude/settingsCommand.ts
1089
+ var settingsCommand = {
1090
+ command: "settings",
1091
+ describe: "Initialize .claude/settings.local.json with XY Labs defaults",
1092
+ handler: async (argv) => {
1093
+ if (argv.verbose) console.log("Claude Settings");
1094
+ process.exitCode = await claudeSettings();
1095
+ }
1096
+ };
1097
+
1098
+ // src/xy/common/claude/index.ts
1099
+ var claudeCommand = {
1100
+ builder: (yargs) => {
1101
+ return yargs.command(commandsCommand).command(initCommand).command(rulesCommand).command(settingsCommand).command(initClaudeSkillsCommand).demandCommand(1, "Please specify a claude subcommand");
1102
+ },
1103
+ command: "claude",
1104
+ describe: "Claude - Claude Code configuration utilities",
1105
+ handler: () => {
1106
+ }
1107
+ };
1108
+
1109
+ // src/xy/common/cleanDocsCommand.ts
1110
+ var cleanDocsCommand = {
1111
+ command: "clean-docs",
1112
+ describe: "CleanDocs - Clean TypeDocs",
1113
+ handler: (argv) => {
1114
+ if (argv.verbose) console.log("Cleaning TypeDocs: all");
1115
+ process.exitCode = cleanDocs();
1116
+ }
1117
+ };
1118
+
805
1119
  // src/xy/param.ts
806
1120
  var packagePositionalParam = (yargs) => {
807
1121
  return yargs.positional("package", { describe: "Specific package to target", type: "string" });
808
1122
  };
809
1123
 
810
- // src/xy/xyCommonCommands.ts
1124
+ // src/xy/common/deadCommand.ts
1125
+ var deadCommand = {
1126
+ builder: (yargs) => {
1127
+ return packagePositionalParam(yargs);
1128
+ },
1129
+ command: "dead [package]",
1130
+ describe: "Dead - Check for dead code",
1131
+ handler: (argv) => {
1132
+ if (argv.verbose) console.log("Dead");
1133
+ process.exitCode = dead();
1134
+ }
1135
+ };
1136
+
1137
+ // src/xy/common/genDocsCommand.ts
1138
+ var genDocsCommand = {
1139
+ builder: (yargs) => {
1140
+ return packagePositionalParam(yargs);
1141
+ },
1142
+ command: "gen-docs [package]",
1143
+ describe: "GenDocs - Generate TypeDocs",
1144
+ handler: (argv) => {
1145
+ if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? "all"}`);
1146
+ process.exitCode = genDocs({ incremental: !!argv.incremental, pkg: argv.package });
1147
+ }
1148
+ };
1149
+
1150
+ // src/xy/common/gitignoreGenCommand.ts
1151
+ var gitignoreGenCommand = {
1152
+ command: "gitignore-gen",
1153
+ describe: "GitIgnore Gen - Generate .gitignore files",
1154
+ handler: (argv) => {
1155
+ if (argv.verbose) console.log("GitIgnore Gen");
1156
+ process.exitCode = gitignoreGen();
1157
+ }
1158
+ };
1159
+
1160
+ // src/xy/common/gitlintCommand.ts
1161
+ var gitlintCommand = {
1162
+ command: "gitlint [package]",
1163
+ describe: "Gitlint - Lint your git config",
1164
+ handler: (argv) => {
1165
+ if (argv.verbose) console.log("Gitlint");
1166
+ process.exitCode = argv.fix ? gitlintFix() : gitlint();
1167
+ }
1168
+ };
1169
+
1170
+ // src/xy/common/licenseCommand.ts
1171
+ var licenseCommand = {
1172
+ builder: (yargs) => {
1173
+ return packagePositionalParam(yargs);
1174
+ },
1175
+ command: "license [package]",
1176
+ describe: "License - Check licenses of dependencies",
1177
+ handler: async (argv) => {
1178
+ if (argv.verbose) console.log(`License: ${argv.package ?? "all"}`);
1179
+ process.exitCode = await license();
1180
+ }
1181
+ };
1182
+
1183
+ // src/xy/common/npmignoreGenCommand.ts
1184
+ var npmignoreGenCommand = {
1185
+ command: "npmignore-gen",
1186
+ describe: "NpmIgnore Gen - Generate .npmignore files",
1187
+ handler: (argv) => {
1188
+ if (argv.verbose) console.log("NpmIgnore Gen");
1189
+ process.exitCode = npmignoreGen();
1190
+ }
1191
+ };
1192
+
1193
+ // src/xy/common/readme/genCommand.ts
1194
+ var genCommand = {
1195
+ builder: (yargs) => {
1196
+ return packagePositionalParam(yargs).option("template", {
1197
+ alias: "t",
1198
+ description: "Path to README.template.md",
1199
+ type: "string"
1200
+ }).option("typedoc", {
1201
+ default: false,
1202
+ description: "Generate TypeDoc reference sections",
1203
+ type: "boolean"
1204
+ });
1205
+ },
1206
+ aliases: ["$0"],
1207
+ command: "gen [package]",
1208
+ describe: "Generate README.md files from template",
1209
+ handler: async (argv) => {
1210
+ if (argv.verbose) console.log("Readme Gen");
1211
+ process.exitCode = await readmeGen({
1212
+ pkg: argv.package,
1213
+ templatePath: argv.template,
1214
+ typedoc: argv.typedoc,
1215
+ verbose: !!argv.verbose
1216
+ });
1217
+ }
1218
+ };
1219
+
1220
+ // src/xy/common/readme/initCommand.ts
1221
+ var initCommand2 = {
1222
+ builder: (yargs) => {
1223
+ return yargs.option("template", {
1224
+ alias: "t",
1225
+ description: "Path to README.template.md",
1226
+ type: "string"
1227
+ });
1228
+ },
1229
+ command: "init",
1230
+ describe: "Initialize README template and logo files",
1231
+ handler: async (argv) => {
1232
+ if (argv.verbose) console.log("Readme Init");
1233
+ process.exitCode = await readmeInit({
1234
+ templatePath: argv.template,
1235
+ verbose: !!argv.verbose
1236
+ });
1237
+ }
1238
+ };
1239
+
1240
+ // src/xy/common/readme/index.ts
1241
+ var readmeCommand = {
1242
+ builder: (yargs) => {
1243
+ return yargs.command(genCommand).command(initCommand2);
1244
+ },
1245
+ command: "readme",
1246
+ describe: "Readme - README file utilities",
1247
+ handler: () => {
1248
+ }
1249
+ };
1250
+
1251
+ // src/xy/common/retestCommand.ts
1252
+ var retestCommand = {
1253
+ command: "retest",
1254
+ describe: "Re-Test - Run Jest Tests with cleaned cache",
1255
+ handler: (argv) => {
1256
+ if (argv.verbose) console.log("Re-Testing");
1257
+ process.exitCode = retest();
1258
+ }
1259
+ };
1260
+
1261
+ // src/xy/common/testCommand.ts
1262
+ var testCommand = {
1263
+ command: "test",
1264
+ describe: "Test - Run Jest Tests",
1265
+ handler: (argv) => {
1266
+ if (argv.verbose) console.log("Testing");
1267
+ process.exitCode = test();
1268
+ }
1269
+ };
1270
+
1271
+ // src/xy/common/upplugCommand.ts
1272
+ var upplugCommand = {
1273
+ command: "upplug",
1274
+ describe: "UpPlug - Update Yarn Plugins",
1275
+ handler: (argv) => {
1276
+ if (argv.verbose) console.log("UpPlug");
1277
+ process.exitCode = updateYarnPlugins();
1278
+ }
1279
+ };
1280
+
1281
+ // src/xy/common/upyarnCommand.ts
1282
+ var upyarnCommand = {
1283
+ command: "upyarn",
1284
+ describe: "UpYarn - Update Yarn Version",
1285
+ handler: (argv) => {
1286
+ if (argv.verbose) console.log("UpYarn");
1287
+ process.exitCode = updateYarnVersion();
1288
+ }
1289
+ };
1290
+
1291
+ // src/xy/common/yarn3OnlyCommand.ts
1292
+ var yarn3OnlyCommand = {
1293
+ command: "yarn3only",
1294
+ describe: "Yarn3Only - Check if using Yarn v3",
1295
+ handler: (argv) => {
1296
+ if (argv.verbose) console.log("Yarn 3 Check");
1297
+ process.exitCode = yarn3Only();
1298
+ }
1299
+ };
1300
+
1301
+ // src/xy/common/index.ts
811
1302
  var xyCommonCommands = (args) => {
812
- return args.command(
813
- "claude-commands",
814
- "Claude Commands - Sync XY Labs standard Claude slash commands to .claude/commands/",
815
- (yargs) => yargs,
816
- (argv) => {
817
- if (argv.verbose) console.log("Claude Commands");
818
- process.exitCode = claudeCommands();
819
- }
820
- ).command(
821
- "claude-settings",
822
- "Claude Settings - Initialize .claude/settings.local.json with XY Labs defaults",
823
- (yargs) => yargs,
824
- async (argv) => {
825
- if (argv.verbose) console.log("Claude Settings");
826
- process.exitCode = await claudeSettings();
827
- }
828
- ).command(
829
- "claude-rules",
830
- "Claude Rules - Sync XY Labs standard Claude rules to .claude/rules/",
831
- (yargs) => {
832
- return yargs.option("force", {
833
- alias: "f",
834
- default: false,
835
- description: "Overwrite existing CLAUDE.md",
836
- type: "boolean"
837
- });
838
- },
839
- (argv) => {
840
- if (argv.verbose) console.log("Claude Rules");
841
- process.exitCode = claudeRules({ force: argv.force });
842
- }
843
- ).command(
844
- "license [package]",
845
- "License - Check licenses of dependencies",
846
- (yargs) => {
847
- return packagePositionalParam(yargs);
848
- },
849
- async (argv) => {
850
- if (argv.verbose) console.log(`License: ${argv.package ?? "all"}`);
851
- process.exitCode = await license();
852
- }
853
- ).command(
854
- "dead [package]",
855
- "Dead - Check for dead code",
856
- (yargs) => {
857
- return packagePositionalParam(yargs);
858
- },
859
- (argv) => {
860
- if (argv.verbose) console.log("Dead");
861
- process.exitCode = dead();
862
- }
863
- ).command(
864
- "gen-docs [package]",
865
- "GenDocs - Generate TypeDocs",
866
- (yargs) => {
867
- return packagePositionalParam(yargs);
868
- },
869
- (argv) => {
870
- if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? "all"}`);
871
- process.exitCode = genDocs({ incremental: !!argv.incremental, pkg: argv.package });
872
- }
873
- ).command(
874
- "clean-docs",
875
- "CleanDocs - Clean TypeDocs",
876
- (yargs) => yargs,
877
- (argv) => {
878
- if (argv.verbose) console.log("Cleaning TypeDocs: all");
879
- process.exitCode = cleanDocs();
880
- }
881
- ).command(
882
- "gitlint [package]",
883
- "Gitlint - Lint your git config",
884
- (yargs) => {
885
- return yargs;
886
- },
887
- (argv) => {
888
- if (argv.verbose) console.log("Gitlint");
889
- process.exitCode = argv.fix ? gitlintFix() : gitlint();
890
- }
891
- ).command(
892
- "gitignore-gen",
893
- "GitIgnore Gen - Generate .gitignore files",
894
- (yargs) => {
895
- return yargs;
896
- },
897
- (argv) => {
898
- if (argv.verbose) console.log("GitIgnore Gen");
899
- process.exitCode = gitignoreGen();
900
- }
901
- ).command(
902
- "npmignore-gen",
903
- "NpmIgnore Gen - Generate .npmignore files",
904
- (yargs) => {
905
- return yargs;
906
- },
907
- (argv) => {
908
- if (argv.verbose) console.log("NpmIgnore Gen");
909
- process.exitCode = npmignoreGen();
910
- }
911
- ).command(
912
- "readme-gen [package]",
913
- "Readme Gen - Generate README.md files from template",
914
- (yargs) => {
915
- return packagePositionalParam(yargs).option("template", {
916
- alias: "t",
917
- description: "Path to README.template.md",
918
- type: "string"
919
- }).option("typedoc", {
920
- default: false,
921
- description: "Generate TypeDoc reference sections",
922
- type: "boolean"
923
- });
924
- },
925
- async (argv) => {
926
- if (argv.verbose) console.log("Readme Gen");
927
- process.exitCode = await readmeGen({
928
- pkg: argv.package,
929
- templatePath: argv.template,
930
- typedoc: argv.typedoc,
931
- verbose: !!argv.verbose
932
- });
933
- }
934
- ).command(
935
- "retest",
936
- "Re-Test - Run Jest Tests with cleaned cache",
937
- (yargs) => {
938
- return yargs;
939
- },
940
- (argv) => {
941
- if (argv.verbose) console.log("Re-Testing");
942
- process.exitCode = retest();
943
- }
944
- ).command(
945
- "test",
946
- "Test - Run Jest Tests",
947
- (yargs) => {
948
- return yargs;
949
- },
950
- (argv) => {
951
- if (argv.verbose) console.log("Testing");
952
- process.exitCode = test();
953
- }
954
- ).command(
955
- "upplug",
956
- "UpPlug - Update Yarn Plugins",
957
- (yargs) => {
958
- return yargs;
959
- },
960
- (argv) => {
961
- if (argv.verbose) console.log("UpPlug");
962
- process.exitCode = updateYarnPlugins();
963
- }
964
- ).command(
965
- "upyarn",
966
- "UpYarn - Update Yarn Version",
967
- (yargs) => {
968
- return yargs;
969
- },
970
- (argv) => {
971
- if (argv.verbose) console.log("UpYarn");
972
- process.exitCode = updateYarnVersion();
973
- }
974
- ).command(
975
- "yarn3only",
976
- "Yarn3Only - Check if using Yarn v3",
977
- (yargs) => {
978
- return yargs;
979
- },
980
- (argv) => {
981
- if (argv.verbose) console.log("Yarn 3 Check");
982
- process.exitCode = yarn3Only();
983
- }
984
- );
1303
+ return args.command(claudeCommand).command(licenseCommand).command(deadCommand).command(genDocsCommand).command(cleanDocsCommand).command(gitlintCommand).command(gitignoreGenCommand).command(npmignoreGenCommand).command(readmeCommand).command(retestCommand).command(testCommand).command(upplugCommand).command(upyarnCommand).command(yarn3OnlyCommand);
985
1304
  };
986
1305
  export {
987
1306
  xyCommonCommands
988
1307
  };
989
- //# sourceMappingURL=xyCommonCommands.mjs.map
1308
+ //# sourceMappingURL=index.mjs.map