@xylabs/ts-scripts-yarn3 7.4.18 → 7.4.19

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 (187) hide show
  1. package/README.body.md +86 -0
  2. package/README.md +108 -0
  3. package/dist/actions/claude-commands.mjs +1 -1
  4. package/dist/actions/claude-commands.mjs.map +1 -1
  5. package/dist/actions/claude-rules.mjs +1 -1
  6. package/dist/actions/claude-rules.mjs.map +1 -1
  7. package/dist/actions/compile.mjs.map +1 -1
  8. package/dist/actions/cycle.mjs.map +1 -1
  9. package/dist/actions/dead.mjs.map +1 -1
  10. package/dist/actions/deploy-major.mjs.map +1 -1
  11. package/dist/actions/deploy-minor.mjs.map +1 -1
  12. package/dist/actions/deploy-next.mjs.map +1 -1
  13. package/dist/actions/deploy.mjs.map +1 -1
  14. package/dist/actions/fix.mjs.map +1 -1
  15. package/dist/actions/gen-docs.mjs.map +1 -1
  16. package/dist/actions/index.mjs +146 -41
  17. package/dist/actions/index.mjs.map +1 -1
  18. package/dist/actions/knip.mjs.map +1 -1
  19. package/dist/actions/lint.mjs.map +1 -1
  20. package/dist/actions/publint.mjs.map +1 -1
  21. package/dist/actions/publish.mjs.map +1 -1
  22. package/dist/actions/readme-gen.mjs +136 -20
  23. package/dist/actions/readme-gen.mjs.map +1 -1
  24. package/dist/actions/readme-init.mjs +83 -0
  25. package/dist/actions/readme-init.mjs.map +1 -0
  26. package/dist/actions/rebuild.mjs.map +1 -1
  27. package/dist/actions/reinstall.mjs.map +1 -1
  28. package/dist/actions/relint.mjs.map +1 -1
  29. package/dist/actions/retest.mjs +2 -2
  30. package/dist/actions/retest.mjs.map +1 -1
  31. package/dist/actions/sonar.mjs.map +1 -1
  32. package/dist/actions/test.mjs.map +1 -1
  33. package/dist/actions/up.mjs.map +1 -1
  34. package/dist/actions/updo.mjs.map +1 -1
  35. package/dist/actions/upplug.mjs.map +1 -1
  36. package/dist/actions/upyarn.mjs.map +1 -1
  37. package/dist/bin/xy.mjs +817 -576
  38. package/dist/bin/xy.mjs.map +1 -1
  39. package/dist/index.d.ts +42 -13
  40. package/dist/index.mjs +820 -573
  41. package/dist/index.mjs.map +1 -1
  42. package/dist/lib/claudeMdTemplate.mjs +1 -1
  43. package/dist/lib/claudeMdTemplate.mjs.map +1 -1
  44. package/dist/lib/generateReadmeFiles.mjs +118 -21
  45. package/dist/lib/generateReadmeFiles.mjs.map +1 -1
  46. package/dist/lib/index.mjs +120 -23
  47. package/dist/lib/index.mjs.map +1 -1
  48. package/dist/lib/runSteps.mjs.map +1 -1
  49. package/dist/lib/runXy.mjs.map +1 -1
  50. package/dist/xy/build/buildCommand.mjs +161 -0
  51. package/dist/xy/build/buildCommand.mjs.map +1 -0
  52. package/dist/xy/build/compileCommand.mjs +174 -0
  53. package/dist/xy/build/compileCommand.mjs.map +1 -0
  54. package/dist/xy/build/compileOnlyCommand.mjs +175 -0
  55. package/dist/xy/build/compileOnlyCommand.mjs.map +1 -0
  56. package/dist/xy/build/copyAssetsCommand.mjs +84 -0
  57. package/dist/xy/build/copyAssetsCommand.mjs.map +1 -0
  58. package/dist/xy/{xyBuildCommands.mjs → build/index.mjs} +111 -93
  59. package/dist/xy/build/index.mjs.map +1 -0
  60. package/dist/xy/build/rebuildCommand.mjs +114 -0
  61. package/dist/xy/build/rebuildCommand.mjs.map +1 -0
  62. package/dist/xy/build/recompileCommand.mjs +204 -0
  63. package/dist/xy/build/recompileCommand.mjs.map +1 -0
  64. package/dist/xy/common/claude/commandsCommand.mjs +107 -0
  65. package/dist/xy/common/claude/commandsCommand.mjs.map +1 -0
  66. package/dist/xy/common/claude/index.mjs +332 -0
  67. package/dist/xy/common/claude/index.mjs.map +1 -0
  68. package/dist/xy/common/claude/initCommand.mjs +283 -0
  69. package/dist/xy/common/claude/initCommand.mjs.map +1 -0
  70. package/dist/xy/common/claude/rulesCommand.mjs +129 -0
  71. package/dist/xy/common/claude/rulesCommand.mjs.map +1 -0
  72. package/dist/xy/common/claude/settingsCommand.mjs +90 -0
  73. package/dist/xy/common/claude/settingsCommand.mjs.map +1 -0
  74. package/dist/xy/common/cleanDocsCommand.mjs +45 -0
  75. package/dist/xy/common/cleanDocsCommand.mjs.map +1 -0
  76. package/dist/xy/common/deadCommand.mjs +116 -0
  77. package/dist/xy/common/deadCommand.mjs.map +1 -0
  78. package/dist/xy/common/genDocsCommand.mjs +125 -0
  79. package/dist/xy/common/genDocsCommand.mjs.map +1 -0
  80. package/dist/xy/common/gitignoreGenCommand.mjs +98 -0
  81. package/dist/xy/common/gitignoreGenCommand.mjs.map +1 -0
  82. package/dist/xy/common/gitlintCommand.mjs +82 -0
  83. package/dist/xy/common/gitlintCommand.mjs.map +1 -0
  84. package/dist/xy/{xyCommonCommands.mjs → common/index.mjs} +451 -241
  85. package/dist/xy/common/index.mjs.map +1 -0
  86. package/dist/xy/common/licenseCommand.mjs +100 -0
  87. package/dist/xy/common/licenseCommand.mjs.map +1 -0
  88. package/dist/xy/common/npmignoreGenCommand.mjs +98 -0
  89. package/dist/xy/common/npmignoreGenCommand.mjs.map +1 -0
  90. package/dist/xy/common/readme/genCommand.mjs +321 -0
  91. package/dist/xy/common/readme/genCommand.mjs.map +1 -0
  92. package/dist/xy/common/readme/index.mjs +361 -0
  93. package/dist/xy/common/readme/index.mjs.map +1 -0
  94. package/dist/xy/common/readme/initCommand.mjs +103 -0
  95. package/dist/xy/common/readme/initCommand.mjs.map +1 -0
  96. package/dist/xy/common/retestCommand.mjs +111 -0
  97. package/dist/xy/common/retestCommand.mjs.map +1 -0
  98. package/dist/xy/common/testCommand.mjs +108 -0
  99. package/dist/xy/common/testCommand.mjs.map +1 -0
  100. package/dist/xy/common/upplugCommand.mjs +113 -0
  101. package/dist/xy/common/upplugCommand.mjs.map +1 -0
  102. package/dist/xy/common/upyarnCommand.mjs +108 -0
  103. package/dist/xy/common/upyarnCommand.mjs.map +1 -0
  104. package/dist/xy/common/yarn3OnlyCommand.mjs +70 -0
  105. package/dist/xy/common/yarn3OnlyCommand.mjs.map +1 -0
  106. package/dist/xy/deploy/deployCommand.mjs +139 -0
  107. package/dist/xy/deploy/deployCommand.mjs.map +1 -0
  108. package/dist/xy/deploy/deployMajorCommand.mjs +139 -0
  109. package/dist/xy/deploy/deployMajorCommand.mjs.map +1 -0
  110. package/dist/xy/deploy/deployMinorCommand.mjs +139 -0
  111. package/dist/xy/deploy/deployMinorCommand.mjs.map +1 -0
  112. package/dist/xy/deploy/deployNextCommand.mjs +139 -0
  113. package/dist/xy/deploy/deployNextCommand.mjs.map +1 -0
  114. package/dist/xy/{xyDeployCommands.mjs → deploy/index.mjs} +53 -53
  115. package/dist/xy/deploy/index.mjs.map +1 -0
  116. package/dist/xy/deploy/publishCommand.mjs +108 -0
  117. package/dist/xy/deploy/publishCommand.mjs.map +1 -0
  118. package/dist/xy/index.mjs +817 -576
  119. package/dist/xy/index.mjs.map +1 -1
  120. package/dist/xy/install/cleanCommand.mjs +140 -0
  121. package/dist/xy/install/cleanCommand.mjs.map +1 -0
  122. package/dist/xy/install/dupdepsCommand.mjs +191 -0
  123. package/dist/xy/install/dupdepsCommand.mjs.map +1 -0
  124. package/dist/xy/{xyInstallCommands.mjs → install/index.mjs} +71 -68
  125. package/dist/xy/install/index.mjs.map +1 -0
  126. package/dist/xy/install/reinstallCommand.mjs +140 -0
  127. package/dist/xy/install/reinstallCommand.mjs.map +1 -0
  128. package/dist/xy/install/staticsCommand.mjs +191 -0
  129. package/dist/xy/install/staticsCommand.mjs.map +1 -0
  130. package/dist/{actions/clean-jest.mjs → xy/install/upCommand.mjs} +15 -6
  131. package/dist/xy/install/upCommand.mjs.map +1 -0
  132. package/dist/xy/install/updoCommand.mjs +112 -0
  133. package/dist/xy/install/updoCommand.mjs.map +1 -0
  134. package/dist/xy/lint/cycleCommand.mjs +163 -0
  135. package/dist/xy/lint/cycleCommand.mjs.map +1 -0
  136. package/dist/xy/lint/deplintCommand.mjs +814 -0
  137. package/dist/xy/lint/deplintCommand.mjs.map +1 -0
  138. package/dist/xy/lint/fixCommand.mjs +168 -0
  139. package/dist/xy/lint/fixCommand.mjs.map +1 -0
  140. package/dist/xy/{xyLintCommands.mjs → lint/index.mjs} +176 -145
  141. package/dist/xy/lint/index.mjs.map +1 -0
  142. package/dist/xy/lint/knipCommand.mjs +121 -0
  143. package/dist/xy/lint/knipCommand.mjs.map +1 -0
  144. package/dist/xy/lint/lintCommand.mjs +186 -0
  145. package/dist/xy/lint/lintCommand.mjs.map +1 -0
  146. package/dist/xy/lint/publintCommand.mjs +187 -0
  147. package/dist/xy/lint/publintCommand.mjs.map +1 -0
  148. package/dist/xy/lint/relintCommand.mjs +163 -0
  149. package/dist/xy/lint/relintCommand.mjs.map +1 -0
  150. package/dist/xy/lint/sonarCommand.mjs +121 -0
  151. package/dist/xy/lint/sonarCommand.mjs.map +1 -0
  152. package/dist/xy/xy.mjs +815 -574
  153. package/dist/xy/xy.mjs.map +1 -1
  154. package/package.json +2 -2
  155. package/templates/readme/README.body.md +11 -0
  156. package/templates/readme/README.template.md +22 -0
  157. package/dist/actions/clean-jest.mjs.map +0 -1
  158. package/dist/xy/xyBuildCommands.mjs.map +0 -1
  159. package/dist/xy/xyCommonCommands.mjs.map +0 -1
  160. package/dist/xy/xyDeployCommands.mjs.map +0 -1
  161. package/dist/xy/xyInstallCommands.mjs.map +0 -1
  162. package/dist/xy/xyLintCommands.mjs.map +0 -1
  163. /package/templates/{CLAUDE-project.md → claude/CLAUDE-project.md} +0 -0
  164. /package/templates/{commands → claude/commands}/xylabs-build.md +0 -0
  165. /package/templates/{commands → claude/commands}/xylabs-clean.md +0 -0
  166. /package/templates/{commands → claude/commands}/xylabs-compile.md +0 -0
  167. /package/templates/{commands → claude/commands}/xylabs-cycle.md +0 -0
  168. /package/templates/{commands → claude/commands}/xylabs-deplint.md +0 -0
  169. /package/templates/{commands → claude/commands}/xylabs-deploy-major.md +0 -0
  170. /package/templates/{commands → claude/commands}/xylabs-deploy-minor.md +0 -0
  171. /package/templates/{commands → claude/commands}/xylabs-deploy.md +0 -0
  172. /package/templates/{commands → claude/commands}/xylabs-fix.md +0 -0
  173. /package/templates/{commands → claude/commands}/xylabs-knip.md +0 -0
  174. /package/templates/{commands → claude/commands}/xylabs-lint.md +0 -0
  175. /package/templates/{commands → claude/commands}/xylabs-publint.md +0 -0
  176. /package/templates/{commands → claude/commands}/xylabs-rebuild.md +0 -0
  177. /package/templates/{commands → claude/commands}/xylabs-test.md +0 -0
  178. /package/templates/{rules → claude/rules}/xylabs-architecture.md +0 -0
  179. /package/templates/{rules → claude/rules}/xylabs-build.md +0 -0
  180. /package/templates/{rules → claude/rules}/xylabs-dependencies.md +0 -0
  181. /package/templates/{rules → claude/rules}/xylabs-error-handling.md +0 -0
  182. /package/templates/{rules → claude/rules}/xylabs-frameworks.md +0 -0
  183. /package/templates/{rules → claude/rules}/xylabs-git-workflow.md +0 -0
  184. /package/templates/{rules → claude/rules}/xylabs-linting.md +0 -0
  185. /package/templates/{rules → claude/rules}/xylabs-naming.md +0 -0
  186. /package/templates/{rules → claude/rules}/xylabs-style.md +0 -0
  187. /package/templates/{rules → claude/rules}/xylabs-typescript.md +0 -0
package/dist/bin/xy.mjs CHANGED
@@ -1,8 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- // src/xy/xy.ts
4
- import chalk31 from "chalk";
5
-
6
3
  // src/actions/build.ts
7
4
  import chalk9 from "chalk";
8
5
 
@@ -25,7 +22,7 @@ import { createRequire } from "module";
25
22
  import PATH from "path";
26
23
  var require2 = createRequire(import.meta.url);
27
24
  var packageRoot = PATH.dirname(require2.resolve("@xylabs/ts-scripts-yarn3/package.json"));
28
- var templatesDir = PATH.resolve(packageRoot, "templates");
25
+ var templatesDir = PATH.resolve(packageRoot, "templates", "claude");
29
26
  var XYLABS_RULES_PREFIX = "xylabs-";
30
27
  var XYLABS_COMMANDS_PREFIX = "xylabs-";
31
28
  var claudeMdRuleTemplates = () => {
@@ -328,10 +325,19 @@ var generateIgnoreFiles = (filename3, pkg) => {
328
325
 
329
326
  // src/lib/generateReadmeFiles.ts
330
327
  import { execSync as execSync2 } from "child_process";
331
- import FS from "fs";
332
- import { readFile, writeFile } from "fs/promises";
328
+ import FS, { readFileSync as readFileSync3 } from "fs";
329
+ import {
330
+ mkdir,
331
+ readFile,
332
+ writeFile
333
+ } from "fs/promises";
334
+ import { createRequire as createRequire2 } from "module";
333
335
  import PATH2 from "path";
336
+ import { createInterface } from "readline";
334
337
  import chalk5 from "chalk";
338
+ var require3 = createRequire2(import.meta.url);
339
+ var packageRoot2 = PATH2.dirname(require3.resolve("@xylabs/ts-scripts-yarn3/package.json"));
340
+ var readmeTemplatesDir = PATH2.resolve(packageRoot2, "templates", "readme");
335
341
  function fillTemplate(template, data) {
336
342
  const additionalData = { ...data, safeName: data.name.replaceAll("/", "__").replaceAll("@", "") };
337
343
  return template.replaceAll(/\{\{(.*?)\}\}/g, (_, key) => additionalData[key.trim()] ?? "");
@@ -421,37 +427,120 @@ ${indent}### ${item.name}
421
427
  }
422
428
  return content;
423
429
  }
430
+ function askConfirmation(question) {
431
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
432
+ return new Promise((resolve) => {
433
+ rl.question(question, (answer) => {
434
+ rl.close();
435
+ resolve(answer.toLowerCase() === "y" || answer.toLowerCase() === "yes");
436
+ });
437
+ });
438
+ }
439
+ var DEFAULT_README_TEMPLATE = readFileSync3(PATH2.resolve(readmeTemplatesDir, "README.template.md"), "utf8");
440
+ var DEFAULT_README_BODY = readFileSync3(PATH2.resolve(readmeTemplatesDir, "README.body.md"), "utf8");
441
+ function applyLogoConfig(template, logoUrl, logoLinkUrl) {
442
+ let result = template;
443
+ if (logoUrl) {
444
+ result = result.replace(/\[logo]: .+/, `[logo]: ${logoUrl}`);
445
+ if (logoLinkUrl) {
446
+ result = result.replace(/\[!\[logo]\[]][^)]*\)/, `[![logo][]](${logoLinkUrl})`);
447
+ }
448
+ } else {
449
+ result = result.replace(/\[!\[logo]\[]][^\n]*\n*/, "");
450
+ result = result.replace(/\[logo]: [^\n]*\n?/, "");
451
+ }
452
+ return result;
453
+ }
454
+ function resolveTemplatePath(templatePath) {
455
+ const cwd = INIT_CWD() ?? ".";
456
+ return templatePath ?? PATH2.join(cwd, ".xy", "README.template.md");
457
+ }
458
+ async function loadOrCreateTemplate(resolvedTemplatePath) {
459
+ try {
460
+ const template = await readFile(resolvedTemplatePath, "utf8");
461
+ return { created: false, template };
462
+ } catch {
463
+ console.log(chalk5.yellow(`Template not found: ${resolvedTemplatePath}`));
464
+ const shouldCreate = await askConfirmation("Would you like to create a stock template? (y/N) ");
465
+ if (!shouldCreate) {
466
+ throw new Error("Template creation declined");
467
+ }
468
+ const template = DEFAULT_README_TEMPLATE;
469
+ await scaffoldTemplate(resolvedTemplatePath, template);
470
+ return { created: true, template };
471
+ }
472
+ }
473
+ async function scaffoldTemplate(resolvedTemplatePath, template) {
474
+ const xyDir = PATH2.dirname(resolvedTemplatePath);
475
+ await mkdir(xyDir, { recursive: true });
476
+ await writeFile(resolvedTemplatePath, template);
477
+ console.log(chalk5.green(`Created template: ${resolvedTemplatePath}`));
478
+ const bodyPath = PATH2.join(xyDir, "README.body.md");
479
+ await writeFile(bodyPath, DEFAULT_README_BODY);
480
+ console.log(chalk5.green(`Created body template: ${bodyPath}`));
481
+ }
482
+ async function resolveBody(location, defaultBody) {
483
+ const localBodyPath = PATH2.join(location, "README.body.md");
484
+ try {
485
+ return await readFile(localBodyPath, "utf8");
486
+ } catch {
487
+ return defaultBody;
488
+ }
489
+ }
490
+ async function generateReadmeForWorkspace(location, name, template, defaultBody, typedoc, verbose) {
491
+ try {
492
+ const pkgJsonPath = PATH2.join(location, "package.json");
493
+ const pkgJson = JSON.parse(await readFile(pkgJsonPath, "utf8"));
494
+ const body = await resolveBody(location, defaultBody);
495
+ const typedocContent = typedoc ? generateTypedoc(location, ["src/index*.ts"]) : "";
496
+ const readmeContent = fillTemplate(template, {
497
+ ...pkgJson,
498
+ body,
499
+ typedoc: typedocContent
500
+ });
501
+ await writeFile(PATH2.join(location, "README.md"), readmeContent);
502
+ if (verbose) console.log(chalk5.green(` ${name}`));
503
+ return true;
504
+ } catch (ex) {
505
+ const error = ex;
506
+ console.warn(chalk5.yellow(` Skipped ${location}: ${error.message}`));
507
+ return false;
508
+ }
509
+ }
424
510
  async function generateReadmeFiles({
511
+ logoLinkUrl,
512
+ logoUrl,
425
513
  pkg,
426
514
  templatePath,
427
515
  typedoc = false,
428
- verbose
516
+ verbose = false
429
517
  }) {
430
518
  console.log(chalk5.green("Generate README Files"));
431
- const cwd = INIT_CWD() ?? ".";
432
- const resolvedTemplatePath = templatePath ?? PATH2.join(cwd, "scripts", "README.template.md");
519
+ const resolvedTemplatePath = resolveTemplatePath(templatePath);
433
520
  let template;
521
+ let templateCreated;
434
522
  try {
435
- template = await readFile(resolvedTemplatePath, "utf8");
523
+ ({ template, created: templateCreated } = await loadOrCreateTemplate(resolvedTemplatePath));
436
524
  } catch {
437
- console.error(chalk5.red(`Template not found: ${resolvedTemplatePath}`));
438
525
  return 1;
439
526
  }
440
- const workspaces = pkg ? [yarnWorkspace(pkg)] : yarnWorkspaces();
527
+ template = applyLogoConfig(template, logoUrl, logoLinkUrl);
528
+ if (templateCreated) {
529
+ console.log(chalk5.green("Generating README files for all packages..."));
530
+ }
531
+ const xyDir = PATH2.dirname(resolvedTemplatePath);
532
+ const xyBodyPath = PATH2.join(xyDir, "README.body.md");
533
+ let defaultBody;
534
+ try {
535
+ defaultBody = await readFile(xyBodyPath, "utf8");
536
+ } catch {
537
+ defaultBody = DEFAULT_README_BODY;
538
+ }
539
+ const workspaces = pkg && !templateCreated ? [yarnWorkspace(pkg)] : yarnWorkspaces();
441
540
  let failed = false;
442
541
  for (const { location, name } of workspaces) {
443
- try {
444
- const pkgJsonPath = PATH2.join(location, "package.json");
445
- const pkgJson = JSON.parse(await readFile(pkgJsonPath, "utf8"));
446
- const typedocContent = typedoc ? generateTypedoc(location, ["src/index*.ts"]) : "";
447
- const readmeContent = fillTemplate(template, { ...pkgJson, typedoc: typedocContent });
448
- await writeFile(PATH2.join(location, "README.md"), readmeContent);
449
- if (verbose) console.log(chalk5.green(` ${name}`));
450
- } catch (ex) {
451
- const error = ex;
452
- console.warn(chalk5.yellow(` Skipped ${location}: ${error.message}`));
453
- failed = true;
454
- }
542
+ const success = await generateReadmeForWorkspace(location, name, template, defaultBody, typedoc, verbose);
543
+ if (!success) failed = true;
455
544
  }
456
545
  return failed ? 1 : 0;
457
546
  }
@@ -478,10 +567,10 @@ var loadConfig = async (params) => {
478
567
  };
479
568
 
480
569
  // src/lib/parsedPackageJSON.ts
481
- import { readFileSync as readFileSync3 } from "fs";
570
+ import { readFileSync as readFileSync4 } from "fs";
482
571
  var parsedPackageJSON = (path8) => {
483
572
  const pathToPackageJSON = path8 ?? process.env.npm_package_json ?? "";
484
- const packageJSON = readFileSync3(pathToPackageJSON).toString();
573
+ const packageJSON = readFileSync4(pathToPackageJSON).toString();
485
574
  return JSON.parse(packageJSON);
486
575
  };
487
576
 
@@ -596,7 +685,7 @@ import {
596
685
  existsSync as existsSync4,
597
686
  mkdirSync,
598
687
  readdirSync as readdirSync2,
599
- readFileSync as readFileSync4,
688
+ readFileSync as readFileSync5,
600
689
  unlinkSync,
601
690
  writeFileSync as writeFileSync2
602
691
  } from "fs";
@@ -609,7 +698,7 @@ var syncCommandFiles = (commandsDir) => {
609
698
  let created = 0;
610
699
  for (const [filename3, content] of Object.entries(templates)) {
611
700
  const targetPath = PATH3.resolve(commandsDir, filename3);
612
- const existing = existsSync4(targetPath) ? readFileSync4(targetPath, "utf8") : void 0;
701
+ const existing = existsSync4(targetPath) ? readFileSync5(targetPath, "utf8") : void 0;
613
702
  if (existing === content) continue;
614
703
  writeFileSync2(targetPath, content, "utf8");
615
704
  if (existing) {
@@ -666,7 +755,7 @@ import {
666
755
  existsSync as existsSync5,
667
756
  mkdirSync as mkdirSync2,
668
757
  readdirSync as readdirSync3,
669
- readFileSync as readFileSync5,
758
+ readFileSync as readFileSync6,
670
759
  unlinkSync as unlinkSync2,
671
760
  writeFileSync as writeFileSync3
672
761
  } from "fs";
@@ -679,7 +768,7 @@ var syncRuleFiles = (rulesDir) => {
679
768
  let created = 0;
680
769
  for (const [filename3, content] of Object.entries(templates)) {
681
770
  const targetPath = PATH4.resolve(rulesDir, filename3);
682
- const existing = existsSync5(targetPath) ? readFileSync5(targetPath, "utf8") : void 0;
771
+ const existing = existsSync5(targetPath) ? readFileSync6(targetPath, "utf8") : void 0;
683
772
  if (existing === content) continue;
684
773
  writeFileSync3(targetPath, content, "utf8");
685
774
  if (existing) {
@@ -751,7 +840,7 @@ import {
751
840
  writeFileSync as writeFileSync4
752
841
  } from "fs";
753
842
  import PATH5 from "path";
754
- import { createInterface } from "readline";
843
+ import { createInterface as createInterface2 } from "readline";
755
844
  import chalk12 from "chalk";
756
845
  var DEFAULT_SETTINGS = {
757
846
  permissions: {
@@ -786,8 +875,8 @@ var DEFAULT_SETTINGS = {
786
875
  ]
787
876
  }
788
877
  };
789
- function askConfirmation(question) {
790
- const rl = createInterface({ input: process.stdin, output: process.stdout });
878
+ function askConfirmation2(question) {
879
+ const rl = createInterface2({ input: process.stdin, output: process.stdout });
791
880
  return new Promise((resolve) => {
792
881
  rl.question(question, (answer) => {
793
882
  rl.close();
@@ -801,7 +890,7 @@ async function claudeSettings() {
801
890
  const settingsPath = PATH5.resolve(claudeDir, "settings.local.json");
802
891
  mkdirSync3(claudeDir, { recursive: true });
803
892
  if (existsSync6(settingsPath)) {
804
- const confirmed = await askConfirmation(
893
+ const confirmed = await askConfirmation2(
805
894
  chalk12.yellow(`${settingsPath} already exists. Replace it? (y/N) `)
806
895
  );
807
896
  if (!confirmed) {
@@ -1727,11 +1816,11 @@ var deplint = async ({
1727
1816
  };
1728
1817
 
1729
1818
  // src/actions/deploy.ts
1730
- import { readFileSync as readFileSync6 } from "fs";
1819
+ import { readFileSync as readFileSync7 } from "fs";
1731
1820
  var privatePackageExcludeList = () => {
1732
1821
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1733
1822
  workspace,
1734
- JSON.parse(readFileSync6(`${workspace.location}/package.json`, { encoding: "utf8" }))
1823
+ JSON.parse(readFileSync7(`${workspace.location}/package.json`, { encoding: "utf8" }))
1735
1824
  ]);
1736
1825
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1737
1826
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -1751,11 +1840,11 @@ var deploy = () => {
1751
1840
  };
1752
1841
 
1753
1842
  // src/actions/deploy-major.ts
1754
- import { readFileSync as readFileSync7 } from "fs";
1843
+ import { readFileSync as readFileSync8 } from "fs";
1755
1844
  var privatePackageExcludeList2 = () => {
1756
1845
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1757
1846
  workspace,
1758
- JSON.parse(readFileSync7(`${workspace.location}/package.json`, { encoding: "utf8" }))
1847
+ JSON.parse(readFileSync8(`${workspace.location}/package.json`, { encoding: "utf8" }))
1759
1848
  ]);
1760
1849
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1761
1850
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -1775,11 +1864,11 @@ var deployMajor = () => {
1775
1864
  };
1776
1865
 
1777
1866
  // src/actions/deploy-minor.ts
1778
- import { readFileSync as readFileSync8 } from "fs";
1867
+ import { readFileSync as readFileSync9 } from "fs";
1779
1868
  var privatePackageExcludeList3 = () => {
1780
1869
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1781
1870
  workspace,
1782
- JSON.parse(readFileSync8(`${workspace.location}/package.json`, { encoding: "utf8" }))
1871
+ JSON.parse(readFileSync9(`${workspace.location}/package.json`, { encoding: "utf8" }))
1783
1872
  ]);
1784
1873
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1785
1874
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -1799,11 +1888,11 @@ var deployMinor = () => {
1799
1888
  };
1800
1889
 
1801
1890
  // src/actions/deploy-next.ts
1802
- import { readFileSync as readFileSync9 } from "fs";
1891
+ import { readFileSync as readFileSync10 } from "fs";
1803
1892
  var privatePackageExcludeList4 = () => {
1804
1893
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1805
1894
  workspace,
1806
- JSON.parse(readFileSync9(`${workspace.location}/package.json`, { encoding: "utf8" }))
1895
+ JSON.parse(readFileSync10(`${workspace.location}/package.json`, { encoding: "utf8" }))
1807
1896
  ]);
1808
1897
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1809
1898
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -2070,7 +2159,10 @@ async function readmeGen({
2070
2159
  typedoc,
2071
2160
  verbose
2072
2161
  }) {
2162
+ const config2 = await loadConfig();
2073
2163
  return await generateReadmeFiles({
2164
+ logoLinkUrl: config2.readme?.logoLinkUrl,
2165
+ logoUrl: config2.readme?.logoUrl,
2074
2166
  pkg,
2075
2167
  templatePath,
2076
2168
  typedoc,
@@ -2078,6 +2170,15 @@ async function readmeGen({
2078
2170
  });
2079
2171
  }
2080
2172
 
2173
+ // src/actions/readme-init.ts
2174
+ async function readmeInit({ templatePath }) {
2175
+ const config2 = await loadConfig();
2176
+ const template = applyLogoConfig(DEFAULT_README_TEMPLATE, config2.readme?.logoUrl, config2.readme?.logoLinkUrl);
2177
+ const resolvedTemplatePath = resolveTemplatePath(templatePath);
2178
+ await scaffoldTemplate(resolvedTemplatePath, template);
2179
+ return 0;
2180
+ }
2181
+
2081
2182
  // src/actions/rebuild.ts
2082
2183
  var rebuild = ({ target }) => {
2083
2184
  return runSteps("Rebuild", [
@@ -2234,8 +2335,8 @@ var relintAllPackages = ({ fix: fix2 = false } = {}) => {
2234
2335
  // src/actions/retest.ts
2235
2336
  var retest = () => {
2236
2337
  return runSteps("Test", [
2237
- ["yarn", ["jest", "--clearCache"]],
2238
- ["yarn", ["jest", "."]]
2338
+ ["yarn", ["vitest", "--clearCache"]],
2339
+ ["yarn", ["vitest", "."]]
2239
2340
  ]);
2240
2341
  };
2241
2342
 
@@ -2296,102 +2397,200 @@ var yarn3Only = () => {
2296
2397
  return 0;
2297
2398
  };
2298
2399
 
2299
- // src/xy/xyBuildCommands.ts
2400
+ // src/xy/build/buildCommand.ts
2401
+ var buildCommand = {
2402
+ command: "build [package]",
2403
+ describe: "Build - Compile & Lint",
2404
+ builder: (yargs2) => {
2405
+ return yargs2.positional("package", { describe: "Specific package to build" });
2406
+ },
2407
+ handler: async (argv) => {
2408
+ if (argv.verbose) {
2409
+ console.log(`Building: ${argv.package ?? "all"}`);
2410
+ }
2411
+ process.exitCode = await build({
2412
+ incremental: !!argv.incremental,
2413
+ jobs: argv.jobs,
2414
+ pkg: argv.package,
2415
+ target: argv.target,
2416
+ verbose: !!argv.verbose
2417
+ });
2418
+ }
2419
+ };
2420
+
2421
+ // src/xy/build/compileCommand.ts
2422
+ var compileCommand = {
2423
+ command: "compile [package]",
2424
+ describe: "Compile with Typescript & Copy Images",
2425
+ builder: (yargs2) => {
2426
+ return yargs2.positional("package", { describe: "Specific package to compile" });
2427
+ },
2428
+ handler: (argv) => {
2429
+ if (argv.verbose) {
2430
+ console.log(`Compiling: ${argv.package ?? "all"}`);
2431
+ }
2432
+ process.exitCode = compile({
2433
+ incremental: !!argv.incremental,
2434
+ jobs: argv.jobs,
2435
+ pkg: argv.package,
2436
+ target: argv.target,
2437
+ verbose: !!argv.verbose
2438
+ });
2439
+ }
2440
+ };
2441
+
2442
+ // src/xy/build/compileOnlyCommand.ts
2443
+ var compileOnlyCommand = {
2444
+ command: "compile-only [package]",
2445
+ describe: "Compile with Typescript & Copy Images (No Publint)",
2446
+ builder: (yargs2) => {
2447
+ return yargs2.positional("package", { describe: "Specific package to compile" });
2448
+ },
2449
+ handler: (argv) => {
2450
+ if (argv.verbose) {
2451
+ console.log(`Compiling: ${argv.package ?? "all"}`);
2452
+ }
2453
+ process.exitCode = compile({
2454
+ incremental: !!argv.incremental,
2455
+ jobs: argv.jobs,
2456
+ pkg: argv.package,
2457
+ publint: false,
2458
+ target: argv.target,
2459
+ verbose: !!argv.verbose
2460
+ });
2461
+ }
2462
+ };
2463
+
2464
+ // src/xy/build/copyAssetsCommand.ts
2465
+ var copyAssetsCommand = {
2466
+ command: "copy-assets [package]",
2467
+ describe: "Copy Assets - Copy the assets from src to dist",
2468
+ builder: (yargs2) => {
2469
+ return yargs2.positional("package", { describe: "Specific package to copy assets" });
2470
+ },
2471
+ handler: async (argv) => {
2472
+ if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? "all"}`);
2473
+ process.exitCode = await copyAssets({ target: argv.target });
2474
+ }
2475
+ };
2476
+
2477
+ // src/xy/build/rebuildCommand.ts
2478
+ var rebuildCommand = {
2479
+ command: "rebuild [package]",
2480
+ describe: "Rebuild - Clean, Compile & Lint",
2481
+ builder: (yargs2) => {
2482
+ return yargs2.positional("package", { describe: "Specific package to rebuild" });
2483
+ },
2484
+ handler: (argv) => {
2485
+ if (argv.verbose) console.log(`Rebuilding: ${argv.package ?? "all"}`);
2486
+ process.exitCode = rebuild({ target: argv.target });
2487
+ }
2488
+ };
2489
+
2490
+ // src/xy/build/recompileCommand.ts
2491
+ var recompileCommand = {
2492
+ command: "recompile [package]",
2493
+ describe: "Re-compile with Typescript & Copy Images",
2494
+ builder: (yargs2) => {
2495
+ return yargs2.positional("package", { describe: "Specific package to re-compile" });
2496
+ },
2497
+ handler: async (argv) => {
2498
+ if (argv.verbose) {
2499
+ console.log(`Re-compiling: ${argv.package ?? "all"}`);
2500
+ }
2501
+ process.exitCode = await recompile({
2502
+ incremental: !!argv.incremental,
2503
+ jobs: argv.jobs,
2504
+ pkg: argv.package,
2505
+ target: argv.target,
2506
+ verbose: !!argv.verbose
2507
+ });
2508
+ }
2509
+ };
2510
+
2511
+ // src/xy/build/index.ts
2300
2512
  var xyBuildCommands = (args) => {
2301
- return args.command(
2302
- "build [package]",
2303
- "Build - Compile & Lint",
2304
- (yargs2) => {
2305
- return yargs2.positional("package", { describe: "Specific package to build" });
2306
- },
2307
- async (argv) => {
2308
- if (argv.verbose) {
2309
- console.log(`Building: ${argv.package ?? "all"}`);
2310
- }
2311
- process.exitCode = await build({
2312
- incremental: !!argv.incremental,
2313
- jobs: argv.jobs,
2314
- pkg: argv.package,
2315
- target: argv.target,
2316
- verbose: !!argv.verbose
2317
- });
2318
- }
2319
- ).command(
2320
- "compile [package]",
2321
- "Compile with Typescript & Copy Images",
2322
- (yargs2) => {
2323
- return yargs2.positional("package", { describe: "Specific package to compile" });
2324
- },
2325
- (argv) => {
2326
- if (argv.verbose) {
2327
- console.log(`Compiling: ${argv.package ?? "all"}`);
2328
- }
2329
- process.exitCode = compile({
2330
- incremental: !!argv.incremental,
2331
- jobs: argv.jobs,
2332
- pkg: argv.package,
2333
- target: argv.target,
2334
- verbose: !!argv.verbose
2335
- });
2336
- }
2337
- ).command(
2338
- "compile-only [package]",
2339
- "Compile with Typescript & Copy Images (No Publint)",
2340
- (yargs2) => {
2341
- return yargs2.positional("package", { describe: "Specific package to compile" });
2342
- },
2343
- (argv) => {
2344
- if (argv.verbose) {
2345
- console.log(`Compiling: ${argv.package ?? "all"}`);
2346
- }
2347
- process.exitCode = compile({
2348
- incremental: !!argv.incremental,
2349
- jobs: argv.jobs,
2350
- pkg: argv.package,
2351
- publint: false,
2352
- target: argv.target,
2353
- verbose: !!argv.verbose
2354
- });
2355
- }
2356
- ).command(
2357
- "recompile [package]",
2358
- "Re-compile with Typescript & Copy Images",
2359
- (yargs2) => {
2360
- return yargs2.positional("package", { describe: "Specific package to re-compile" });
2361
- },
2362
- async (argv) => {
2363
- if (argv.verbose) {
2364
- console.log(`Re-compiling: ${argv.package ?? "all"}`);
2365
- }
2366
- process.exitCode = await recompile({
2367
- incremental: !!argv.incremental,
2368
- jobs: argv.jobs,
2369
- pkg: argv.package,
2370
- target: argv.target,
2371
- verbose: !!argv.verbose
2372
- });
2373
- }
2374
- ).command(
2375
- "rebuild [package]",
2376
- "Rebuild - Clean, Compile & Lint",
2377
- (yargs2) => {
2378
- return yargs2.positional("package", { describe: "Specific package to rebuild" });
2379
- },
2380
- (argv) => {
2381
- if (argv.verbose) console.log(`Rebuilding: ${argv.package ?? "all"}`);
2382
- process.exitCode = rebuild({ target: argv.target });
2383
- }
2384
- ).command(
2385
- "copy-assets [package]",
2386
- "Copy Assets - Copy the assets from src to dist",
2387
- (yargs2) => {
2388
- return yargs2.positional("package", { describe: "Specific package to copy assets" });
2389
- },
2390
- async (argv) => {
2391
- if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? "all"}`);
2392
- process.exitCode = await copyAssets({ target: argv.target });
2393
- }
2394
- );
2513
+ return args.command(buildCommand).command(compileCommand).command(compileOnlyCommand).command(recompileCommand).command(rebuildCommand).command(copyAssetsCommand);
2514
+ };
2515
+
2516
+ // src/xy/common/claude/commandsCommand.ts
2517
+ var commandsCommand = {
2518
+ command: "commands",
2519
+ describe: "Sync XY Labs standard Claude slash commands to .claude/commands/",
2520
+ handler: (argv) => {
2521
+ if (argv.verbose) console.log("Claude Commands");
2522
+ process.exitCode = claudeCommands();
2523
+ }
2524
+ };
2525
+
2526
+ // src/xy/common/claude/initCommand.ts
2527
+ var initCommand = {
2528
+ builder: (yargs2) => {
2529
+ return yargs2.option("force", {
2530
+ alias: "f",
2531
+ default: false,
2532
+ description: "Overwrite existing CLAUDE.md",
2533
+ type: "boolean"
2534
+ });
2535
+ },
2536
+ command: "init",
2537
+ describe: "Initialize all Claude configuration (commands, rules, settings)",
2538
+ handler: async (argv) => {
2539
+ if (argv.verbose) console.log("Claude Init");
2540
+ const commandsResult = claudeCommands();
2541
+ const rulesResult = claudeRules({ force: argv.force });
2542
+ const settingsResult = await claudeSettings();
2543
+ process.exitCode = commandsResult || rulesResult || settingsResult;
2544
+ }
2545
+ };
2546
+
2547
+ // src/xy/common/claude/rulesCommand.ts
2548
+ var rulesCommand = {
2549
+ builder: (yargs2) => {
2550
+ return yargs2.option("force", {
2551
+ alias: "f",
2552
+ default: false,
2553
+ description: "Overwrite existing CLAUDE.md",
2554
+ type: "boolean"
2555
+ });
2556
+ },
2557
+ command: "rules",
2558
+ describe: "Sync XY Labs standard Claude rules to .claude/rules/",
2559
+ handler: (argv) => {
2560
+ if (argv.verbose) console.log("Claude Rules");
2561
+ process.exitCode = claudeRules({ force: argv.force });
2562
+ }
2563
+ };
2564
+
2565
+ // src/xy/common/claude/settingsCommand.ts
2566
+ var settingsCommand = {
2567
+ command: "settings",
2568
+ describe: "Initialize .claude/settings.local.json with XY Labs defaults",
2569
+ handler: async (argv) => {
2570
+ if (argv.verbose) console.log("Claude Settings");
2571
+ process.exitCode = await claudeSettings();
2572
+ }
2573
+ };
2574
+
2575
+ // src/xy/common/claude/index.ts
2576
+ var claudeCommand = {
2577
+ builder: (yargs2) => {
2578
+ return yargs2.command(commandsCommand).command(initCommand).command(rulesCommand).command(settingsCommand).demandCommand(1, "Please specify a claude subcommand");
2579
+ },
2580
+ command: "claude",
2581
+ describe: "Claude - Claude Code configuration utilities",
2582
+ handler: () => {
2583
+ }
2584
+ };
2585
+
2586
+ // src/xy/common/cleanDocsCommand.ts
2587
+ var cleanDocsCommand = {
2588
+ command: "clean-docs",
2589
+ describe: "CleanDocs - Clean TypeDocs",
2590
+ handler: (argv) => {
2591
+ if (argv.verbose) console.log("Cleaning TypeDocs: all");
2592
+ process.exitCode = cleanDocs();
2593
+ }
2395
2594
  };
2396
2595
 
2397
2596
  // src/xy/param.ts
@@ -2399,455 +2598,497 @@ var packagePositionalParam = (yargs2) => {
2399
2598
  return yargs2.positional("package", { describe: "Specific package to target", type: "string" });
2400
2599
  };
2401
2600
 
2402
- // src/xy/xyCommonCommands.ts
2601
+ // src/xy/common/deadCommand.ts
2602
+ var deadCommand = {
2603
+ builder: (yargs2) => {
2604
+ return packagePositionalParam(yargs2);
2605
+ },
2606
+ command: "dead [package]",
2607
+ describe: "Dead - Check for dead code",
2608
+ handler: (argv) => {
2609
+ if (argv.verbose) console.log("Dead");
2610
+ process.exitCode = dead();
2611
+ }
2612
+ };
2613
+
2614
+ // src/xy/common/genDocsCommand.ts
2615
+ var genDocsCommand = {
2616
+ builder: (yargs2) => {
2617
+ return packagePositionalParam(yargs2);
2618
+ },
2619
+ command: "gen-docs [package]",
2620
+ describe: "GenDocs - Generate TypeDocs",
2621
+ handler: (argv) => {
2622
+ if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? "all"}`);
2623
+ process.exitCode = genDocs({ incremental: !!argv.incremental, pkg: argv.package });
2624
+ }
2625
+ };
2626
+
2627
+ // src/xy/common/gitignoreGenCommand.ts
2628
+ var gitignoreGenCommand = {
2629
+ command: "gitignore-gen",
2630
+ describe: "GitIgnore Gen - Generate .gitignore files",
2631
+ handler: (argv) => {
2632
+ if (argv.verbose) console.log("GitIgnore Gen");
2633
+ process.exitCode = gitignoreGen();
2634
+ }
2635
+ };
2636
+
2637
+ // src/xy/common/gitlintCommand.ts
2638
+ var gitlintCommand = {
2639
+ command: "gitlint [package]",
2640
+ describe: "Gitlint - Lint your git config",
2641
+ handler: (argv) => {
2642
+ if (argv.verbose) console.log("Gitlint");
2643
+ process.exitCode = argv.fix ? gitlintFix() : gitlint();
2644
+ }
2645
+ };
2646
+
2647
+ // src/xy/common/licenseCommand.ts
2648
+ var licenseCommand = {
2649
+ builder: (yargs2) => {
2650
+ return packagePositionalParam(yargs2);
2651
+ },
2652
+ command: "license [package]",
2653
+ describe: "License - Check licenses of dependencies",
2654
+ handler: async (argv) => {
2655
+ if (argv.verbose) console.log(`License: ${argv.package ?? "all"}`);
2656
+ process.exitCode = await license();
2657
+ }
2658
+ };
2659
+
2660
+ // src/xy/common/npmignoreGenCommand.ts
2661
+ var npmignoreGenCommand = {
2662
+ command: "npmignore-gen",
2663
+ describe: "NpmIgnore Gen - Generate .npmignore files",
2664
+ handler: (argv) => {
2665
+ if (argv.verbose) console.log("NpmIgnore Gen");
2666
+ process.exitCode = npmignoreGen();
2667
+ }
2668
+ };
2669
+
2670
+ // src/xy/common/readme/genCommand.ts
2671
+ var genCommand = {
2672
+ builder: (yargs2) => {
2673
+ return packagePositionalParam(yargs2).option("template", {
2674
+ alias: "t",
2675
+ description: "Path to README.template.md",
2676
+ type: "string"
2677
+ }).option("typedoc", {
2678
+ default: false,
2679
+ description: "Generate TypeDoc reference sections",
2680
+ type: "boolean"
2681
+ });
2682
+ },
2683
+ aliases: ["$0"],
2684
+ command: "gen [package]",
2685
+ describe: "Generate README.md files from template",
2686
+ handler: async (argv) => {
2687
+ if (argv.verbose) console.log("Readme Gen");
2688
+ process.exitCode = await readmeGen({
2689
+ pkg: argv.package,
2690
+ templatePath: argv.template,
2691
+ typedoc: argv.typedoc,
2692
+ verbose: !!argv.verbose
2693
+ });
2694
+ }
2695
+ };
2696
+
2697
+ // src/xy/common/readme/initCommand.ts
2698
+ var initCommand2 = {
2699
+ builder: (yargs2) => {
2700
+ return yargs2.option("template", {
2701
+ alias: "t",
2702
+ description: "Path to README.template.md",
2703
+ type: "string"
2704
+ });
2705
+ },
2706
+ command: "init",
2707
+ describe: "Initialize README template and logo files",
2708
+ handler: async (argv) => {
2709
+ if (argv.verbose) console.log("Readme Init");
2710
+ process.exitCode = await readmeInit({
2711
+ templatePath: argv.template,
2712
+ verbose: !!argv.verbose
2713
+ });
2714
+ }
2715
+ };
2716
+
2717
+ // src/xy/common/readme/index.ts
2718
+ var readmeCommand = {
2719
+ builder: (yargs2) => {
2720
+ return yargs2.command(genCommand).command(initCommand2);
2721
+ },
2722
+ command: "readme",
2723
+ describe: "Readme - README file utilities",
2724
+ handler: () => {
2725
+ }
2726
+ };
2727
+
2728
+ // src/xy/common/retestCommand.ts
2729
+ var retestCommand = {
2730
+ command: "retest",
2731
+ describe: "Re-Test - Run Jest Tests with cleaned cache",
2732
+ handler: (argv) => {
2733
+ if (argv.verbose) console.log("Re-Testing");
2734
+ process.exitCode = retest();
2735
+ }
2736
+ };
2737
+
2738
+ // src/xy/common/testCommand.ts
2739
+ var testCommand = {
2740
+ command: "test",
2741
+ describe: "Test - Run Jest Tests",
2742
+ handler: (argv) => {
2743
+ if (argv.verbose) console.log("Testing");
2744
+ process.exitCode = test();
2745
+ }
2746
+ };
2747
+
2748
+ // src/xy/common/upplugCommand.ts
2749
+ var upplugCommand = {
2750
+ command: "upplug",
2751
+ describe: "UpPlug - Update Yarn Plugins",
2752
+ handler: (argv) => {
2753
+ if (argv.verbose) console.log("UpPlug");
2754
+ process.exitCode = updateYarnPlugins();
2755
+ }
2756
+ };
2757
+
2758
+ // src/xy/common/upyarnCommand.ts
2759
+ var upyarnCommand = {
2760
+ command: "upyarn",
2761
+ describe: "UpYarn - Update Yarn Version",
2762
+ handler: (argv) => {
2763
+ if (argv.verbose) console.log("UpYarn");
2764
+ process.exitCode = updateYarnVersion();
2765
+ }
2766
+ };
2767
+
2768
+ // src/xy/common/yarn3OnlyCommand.ts
2769
+ var yarn3OnlyCommand = {
2770
+ command: "yarn3only",
2771
+ describe: "Yarn3Only - Check if using Yarn v3",
2772
+ handler: (argv) => {
2773
+ if (argv.verbose) console.log("Yarn 3 Check");
2774
+ process.exitCode = yarn3Only();
2775
+ }
2776
+ };
2777
+
2778
+ // src/xy/common/index.ts
2403
2779
  var xyCommonCommands = (args) => {
2404
- return args.command(
2405
- "claude-commands",
2406
- "Claude Commands - Sync XY Labs standard Claude slash commands to .claude/commands/",
2407
- (yargs2) => yargs2,
2408
- (argv) => {
2409
- if (argv.verbose) console.log("Claude Commands");
2410
- process.exitCode = claudeCommands();
2411
- }
2412
- ).command(
2413
- "claude-settings",
2414
- "Claude Settings - Initialize .claude/settings.local.json with XY Labs defaults",
2415
- (yargs2) => yargs2,
2416
- async (argv) => {
2417
- if (argv.verbose) console.log("Claude Settings");
2418
- process.exitCode = await claudeSettings();
2419
- }
2420
- ).command(
2421
- "claude-rules",
2422
- "Claude Rules - Sync XY Labs standard Claude rules to .claude/rules/",
2423
- (yargs2) => {
2424
- return yargs2.option("force", {
2425
- alias: "f",
2426
- default: false,
2427
- description: "Overwrite existing CLAUDE.md",
2428
- type: "boolean"
2429
- });
2430
- },
2431
- (argv) => {
2432
- if (argv.verbose) console.log("Claude Rules");
2433
- process.exitCode = claudeRules({ force: argv.force });
2434
- }
2435
- ).command(
2436
- "license [package]",
2437
- "License - Check licenses of dependencies",
2438
- (yargs2) => {
2439
- return packagePositionalParam(yargs2);
2440
- },
2441
- async (argv) => {
2442
- if (argv.verbose) console.log(`License: ${argv.package ?? "all"}`);
2443
- process.exitCode = await license();
2444
- }
2445
- ).command(
2446
- "dead [package]",
2447
- "Dead - Check for dead code",
2448
- (yargs2) => {
2449
- return packagePositionalParam(yargs2);
2450
- },
2451
- (argv) => {
2452
- if (argv.verbose) console.log("Dead");
2453
- process.exitCode = dead();
2454
- }
2455
- ).command(
2456
- "gen-docs [package]",
2457
- "GenDocs - Generate TypeDocs",
2458
- (yargs2) => {
2459
- return packagePositionalParam(yargs2);
2460
- },
2461
- (argv) => {
2462
- if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? "all"}`);
2463
- process.exitCode = genDocs({ incremental: !!argv.incremental, pkg: argv.package });
2464
- }
2465
- ).command(
2466
- "clean-docs",
2467
- "CleanDocs - Clean TypeDocs",
2468
- (yargs2) => yargs2,
2469
- (argv) => {
2470
- if (argv.verbose) console.log("Cleaning TypeDocs: all");
2471
- process.exitCode = cleanDocs();
2472
- }
2473
- ).command(
2474
- "gitlint [package]",
2475
- "Gitlint - Lint your git config",
2476
- (yargs2) => {
2477
- return yargs2;
2478
- },
2479
- (argv) => {
2480
- if (argv.verbose) console.log("Gitlint");
2481
- process.exitCode = argv.fix ? gitlintFix() : gitlint();
2482
- }
2483
- ).command(
2484
- "gitignore-gen",
2485
- "GitIgnore Gen - Generate .gitignore files",
2486
- (yargs2) => {
2487
- return yargs2;
2488
- },
2489
- (argv) => {
2490
- if (argv.verbose) console.log("GitIgnore Gen");
2491
- process.exitCode = gitignoreGen();
2492
- }
2493
- ).command(
2494
- "npmignore-gen",
2495
- "NpmIgnore Gen - Generate .npmignore files",
2496
- (yargs2) => {
2497
- return yargs2;
2498
- },
2499
- (argv) => {
2500
- if (argv.verbose) console.log("NpmIgnore Gen");
2501
- process.exitCode = npmignoreGen();
2502
- }
2503
- ).command(
2504
- "readme-gen [package]",
2505
- "Readme Gen - Generate README.md files from template",
2506
- (yargs2) => {
2507
- return packagePositionalParam(yargs2).option("template", {
2508
- alias: "t",
2509
- description: "Path to README.template.md",
2510
- type: "string"
2511
- }).option("typedoc", {
2512
- default: false,
2513
- description: "Generate TypeDoc reference sections",
2514
- type: "boolean"
2515
- });
2516
- },
2517
- async (argv) => {
2518
- if (argv.verbose) console.log("Readme Gen");
2519
- process.exitCode = await readmeGen({
2520
- pkg: argv.package,
2521
- templatePath: argv.template,
2522
- typedoc: argv.typedoc,
2523
- verbose: !!argv.verbose
2524
- });
2525
- }
2526
- ).command(
2527
- "retest",
2528
- "Re-Test - Run Jest Tests with cleaned cache",
2529
- (yargs2) => {
2530
- return yargs2;
2531
- },
2532
- (argv) => {
2533
- if (argv.verbose) console.log("Re-Testing");
2534
- process.exitCode = retest();
2535
- }
2536
- ).command(
2537
- "test",
2538
- "Test - Run Jest Tests",
2539
- (yargs2) => {
2540
- return yargs2;
2541
- },
2542
- (argv) => {
2543
- if (argv.verbose) console.log("Testing");
2544
- process.exitCode = test();
2545
- }
2546
- ).command(
2547
- "upplug",
2548
- "UpPlug - Update Yarn Plugins",
2549
- (yargs2) => {
2550
- return yargs2;
2551
- },
2552
- (argv) => {
2553
- if (argv.verbose) console.log("UpPlug");
2554
- process.exitCode = updateYarnPlugins();
2555
- }
2556
- ).command(
2557
- "upyarn",
2558
- "UpYarn - Update Yarn Version",
2559
- (yargs2) => {
2560
- return yargs2;
2561
- },
2562
- (argv) => {
2563
- if (argv.verbose) console.log("UpYarn");
2564
- process.exitCode = updateYarnVersion();
2565
- }
2566
- ).command(
2567
- "yarn3only",
2568
- "Yarn3Only - Check if using Yarn v3",
2569
- (yargs2) => {
2570
- return yargs2;
2571
- },
2572
- (argv) => {
2573
- if (argv.verbose) console.log("Yarn 3 Check");
2574
- process.exitCode = yarn3Only();
2575
- }
2576
- );
2780
+ 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);
2781
+ };
2782
+
2783
+ // src/xy/deploy/deployCommand.ts
2784
+ var deployCommand = {
2785
+ command: "deploy",
2786
+ describe: "Deploy - Deploy patch",
2787
+ handler: (argv) => {
2788
+ if (argv.verbose) console.log("Deploy patch");
2789
+ process.exitCode = deploy();
2790
+ }
2791
+ };
2792
+
2793
+ // src/xy/deploy/deployMajorCommand.ts
2794
+ var deployMajorCommand = {
2795
+ command: "deploy-major",
2796
+ describe: "Deploy - Deploy major",
2797
+ handler: (argv) => {
2798
+ if (argv.verbose) console.log("Deploy major");
2799
+ process.exitCode = deployMajor();
2800
+ }
2801
+ };
2802
+
2803
+ // src/xy/deploy/deployMinorCommand.ts
2804
+ var deployMinorCommand = {
2805
+ command: "deploy-minor",
2806
+ describe: "Deploy - Deploy minor",
2807
+ handler: (argv) => {
2808
+ if (argv.verbose) console.log("Deploy minor");
2809
+ process.exitCode = deployMinor();
2810
+ }
2811
+ };
2812
+
2813
+ // src/xy/deploy/deployNextCommand.ts
2814
+ var deployNextCommand = {
2815
+ command: "deploy-next",
2816
+ describe: "Deploy - Deploy next",
2817
+ handler: (argv) => {
2818
+ if (argv.verbose) console.log("Deploy next");
2819
+ process.exitCode = deployNext();
2820
+ }
2577
2821
  };
2578
2822
 
2579
- // src/xy/xyDeployCommands.ts
2823
+ // src/xy/deploy/publishCommand.ts
2824
+ var publishCommand = {
2825
+ command: "publish",
2826
+ describe: "Publish - Publish packages to npmjs",
2827
+ handler: (argv) => {
2828
+ if (argv.verbose) console.log("Publish packages to npmjs");
2829
+ process.exitCode = publish();
2830
+ }
2831
+ };
2832
+
2833
+ // src/xy/deploy/index.ts
2580
2834
  var xyDeployCommands = (args) => {
2581
- return args.command(
2582
- "deploy",
2583
- "Deploy - Deploy patch",
2584
- (yargs2) => {
2585
- return yargs2;
2586
- },
2587
- (argv) => {
2588
- if (argv.verbose) console.log("Deploy patch");
2589
- process.exitCode = deploy();
2590
- }
2591
- ).command(
2592
- "deploy-minor",
2593
- "Deploy - Deploy minor",
2594
- (yargs2) => {
2595
- return yargs2;
2596
- },
2597
- (argv) => {
2598
- if (argv.verbose) console.log("Deploy minor");
2599
- process.exitCode = deployMinor();
2600
- }
2601
- ).command(
2602
- "deploy-major",
2603
- "Deploy - Deploy major",
2604
- (yargs2) => {
2605
- return yargs2;
2606
- },
2607
- (argv) => {
2608
- if (argv.verbose) console.log("Deploy major");
2609
- process.exitCode = deployMajor();
2610
- }
2611
- ).command(
2612
- "deploy-next",
2613
- "Deploy - Deploy next",
2614
- (yargs2) => {
2615
- return yargs2;
2616
- },
2617
- (argv) => {
2618
- if (argv.verbose) console.log("Deploy next");
2619
- process.exitCode = deployNext();
2620
- }
2621
- ).command(
2622
- "publish",
2623
- "Publish - Publish packages to npmjs",
2624
- (yargs2) => {
2625
- return yargs2;
2626
- },
2627
- (argv) => {
2628
- if (argv.verbose) console.log("Publish packages to npmjs");
2629
- process.exitCode = publish();
2835
+ return args.command(deployCommand).command(deployMinorCommand).command(deployMajorCommand).command(deployNextCommand).command(publishCommand);
2836
+ };
2837
+
2838
+ // src/xy/install/cleanCommand.ts
2839
+ var cleanCommand = {
2840
+ command: "clean [package]",
2841
+ describe: "Clean",
2842
+ builder: (yargs2) => {
2843
+ return yargs2.positional("package", { describe: "Specific package to clean" });
2844
+ },
2845
+ handler: async (argv) => {
2846
+ if (argv.verbose) {
2847
+ console.log(`Cleaning: ${argv.package ?? "all"}`);
2630
2848
  }
2631
- );
2849
+ process.exitCode = await clean({
2850
+ pkg: argv.package,
2851
+ verbose: !!argv.verbose
2852
+ });
2853
+ }
2854
+ };
2855
+
2856
+ // src/xy/install/dupdepsCommand.ts
2857
+ var dupdepsCommand = {
2858
+ command: "dupdeps",
2859
+ describe: "Dupdeps - Duplicate Dependencies in package.json",
2860
+ handler: (argv) => {
2861
+ if (argv.verbose) console.log("Dupdeps");
2862
+ process.exitCode = dupdeps();
2863
+ }
2632
2864
  };
2633
2865
 
2634
- // src/xy/xyInstallCommands.ts
2866
+ // src/xy/install/reinstallCommand.ts
2867
+ var reinstallCommand = {
2868
+ command: "reinstall",
2869
+ describe: "Reinstall - Clean & Install",
2870
+ handler: (argv) => {
2871
+ if (argv.verbose) console.log("Reinstalling");
2872
+ process.exitCode = reinstall();
2873
+ }
2874
+ };
2875
+
2876
+ // src/xy/install/staticsCommand.ts
2877
+ var staticsCommand = {
2878
+ command: "statics",
2879
+ describe: "Statics - Confirming Static Packages",
2880
+ handler: (argv) => {
2881
+ if (argv.verbose) console.log("Statics");
2882
+ process.exitCode = statics();
2883
+ }
2884
+ };
2885
+
2886
+ // src/xy/install/upCommand.ts
2887
+ var upCommand = {
2888
+ command: "up",
2889
+ describe: "Up - Update dependencies",
2890
+ handler: (argv) => {
2891
+ if (argv.verbose) console.log("Up");
2892
+ process.exitCode = up();
2893
+ }
2894
+ };
2895
+
2896
+ // src/xy/install/updoCommand.ts
2897
+ var updoCommand = {
2898
+ command: "updo",
2899
+ describe: "Updo - Update dependencies [Interactive]",
2900
+ handler: (argv) => {
2901
+ if (argv.verbose) console.log("Updo");
2902
+ process.exitCode = updo();
2903
+ }
2904
+ };
2905
+
2906
+ // src/xy/install/index.ts
2635
2907
  var xyInstallCommands = (args) => {
2636
- return args.command(
2637
- "clean [package]",
2638
- "Clean",
2639
- (yargs2) => {
2640
- return yargs2.positional("package", { describe: "Specific package to clean" });
2641
- },
2642
- async (argv) => {
2643
- if (argv.verbose) {
2644
- console.log(`Cleaning: ${argv.package ?? "all"}`);
2645
- }
2646
- process.exitCode = await clean({
2647
- pkg: argv.package,
2648
- verbose: !!argv.verbose
2649
- });
2650
- }
2651
- ).command(
2652
- "reinstall",
2653
- "Reinstall - Clean & Install",
2654
- (yargs2) => {
2655
- return yargs2;
2656
- },
2657
- (argv) => {
2658
- if (argv.verbose) console.log("Reinstalling");
2659
- process.exitCode = reinstall();
2660
- }
2661
- ).command(
2662
- "up",
2663
- "Up - Update dependencies",
2664
- (yargs2) => {
2665
- return yargs2;
2666
- },
2667
- (argv) => {
2668
- if (argv.verbose) console.log("Up");
2669
- process.exitCode = up();
2670
- }
2671
- ).command(
2672
- "updo",
2673
- "Updo - Update dependencies [Interactive]",
2674
- (yargs2) => {
2675
- return yargs2;
2676
- },
2677
- (argv) => {
2678
- if (argv.verbose) console.log("Updo");
2679
- process.exitCode = updo();
2680
- }
2681
- ).command(
2682
- "statics",
2683
- "Statics - Confirming Static Packages",
2684
- (yargs2) => {
2685
- return yargs2;
2686
- },
2687
- (argv) => {
2688
- if (argv.verbose) console.log("Statics");
2689
- process.exitCode = statics();
2690
- }
2691
- ).command(
2692
- "dupdeps",
2693
- "Dupdeps - Duplicate Dependencies in package.json",
2694
- (yargs2) => {
2695
- return yargs2;
2696
- },
2697
- (argv) => {
2698
- if (argv.verbose) console.log("Dupdeps");
2699
- process.exitCode = dupdeps();
2700
- }
2701
- );
2908
+ return args.command(cleanCommand).command(reinstallCommand).command(upCommand).command(updoCommand).command(staticsCommand).command(dupdepsCommand);
2702
2909
  };
2703
2910
 
2704
- // src/xy/xyLintCommands.ts
2911
+ // src/xy/lint/cycleCommand.ts
2705
2912
  import chalk30 from "chalk";
2913
+ var cycleCommand = {
2914
+ command: "cycle [package]",
2915
+ describe: "Cycle - Check for dependency cycles",
2916
+ builder: (yargs2) => {
2917
+ return packagePositionalParam(yargs2);
2918
+ },
2919
+ handler: async (argv) => {
2920
+ const start = Date.now();
2921
+ if (argv.verbose) console.log("Cycle");
2922
+ process.exitCode = await cycle({ pkg: argv.package });
2923
+ console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2924
+ }
2925
+ };
2926
+
2927
+ // src/xy/lint/deplintCommand.ts
2928
+ import chalk31 from "chalk";
2929
+ var deplintCommand = {
2930
+ command: "deplint [package]",
2931
+ describe: "Deplint - Run Deplint",
2932
+ builder: (yargs2) => {
2933
+ return packagePositionalParam(yargs2).option("deps", {
2934
+ alias: "d",
2935
+ default: false,
2936
+ description: "Check dependencies",
2937
+ type: "boolean"
2938
+ }).option("devDeps", {
2939
+ alias: "v",
2940
+ default: false,
2941
+ description: "Check devDependencies",
2942
+ type: "boolean"
2943
+ }).option("peerDeps", {
2944
+ alias: "p",
2945
+ default: false,
2946
+ description: "Check peerDependencies",
2947
+ type: "boolean"
2948
+ }).option("exclude", {
2949
+ alias: "e",
2950
+ description: "Package names to exclude from unused checks (comma-separated or repeated)",
2951
+ type: "array"
2952
+ });
2953
+ },
2954
+ handler: async (argv) => {
2955
+ if (argv.verbose) console.log("Deplint");
2956
+ const start = Date.now();
2957
+ const cliExclude = argv.exclude?.flatMap((v) => String(v).split(",")).map((v) => v.trim()).filter(Boolean);
2958
+ process.exitCode = await deplint({
2959
+ cliExclude,
2960
+ pkg: argv.package,
2961
+ deps: !!argv.deps,
2962
+ devDeps: !!argv.devDeps,
2963
+ peerDeps: !!argv.peerDeps,
2964
+ verbose: !!argv.verbose
2965
+ });
2966
+ console.log(chalk31.blue(`Finished in ${Date.now() - start}ms`));
2967
+ }
2968
+ };
2969
+
2970
+ // src/xy/lint/fixCommand.ts
2971
+ import chalk32 from "chalk";
2972
+ var fixCommand = {
2973
+ command: "fix [package]",
2974
+ describe: "Fix - Run Eslint w/fix",
2975
+ builder: (yargs2) => {
2976
+ return packagePositionalParam(yargs2);
2977
+ },
2978
+ handler: (argv) => {
2979
+ const start = Date.now();
2980
+ if (argv.verbose) console.log("Fix");
2981
+ process.exitCode = fix();
2982
+ console.log(chalk32.blue(`Finished in ${Date.now() - start}ms`));
2983
+ }
2984
+ };
2985
+
2986
+ // src/xy/lint/knipCommand.ts
2987
+ import chalk33 from "chalk";
2988
+ var knipCommand = {
2989
+ command: "knip",
2990
+ describe: "Knip - Run Knip",
2991
+ builder: (yargs2) => {
2992
+ return packagePositionalParam(yargs2);
2993
+ },
2994
+ handler: (argv) => {
2995
+ if (argv.verbose) console.log("Knip");
2996
+ const start = Date.now();
2997
+ process.exitCode = knip();
2998
+ console.log(chalk33.blue(`Knip finished in ${Date.now() - start}ms`));
2999
+ }
3000
+ };
3001
+
3002
+ // src/xy/lint/lintCommand.ts
3003
+ import chalk34 from "chalk";
3004
+ var lintCommand = {
3005
+ command: "lint [package]",
3006
+ describe: "Lint - Run Eslint",
3007
+ builder: (yargs2) => {
3008
+ return packagePositionalParam(yargs2).option("fix", {
3009
+ alias: "f",
3010
+ default: false,
3011
+ description: "Fix fixable issues",
3012
+ type: "boolean"
3013
+ }).option("cache", {
3014
+ alias: "c",
3015
+ default: false,
3016
+ description: "Use caching for performance",
3017
+ type: "boolean"
3018
+ });
3019
+ },
3020
+ handler: (argv) => {
3021
+ if (argv.verbose) console.log("Lint");
3022
+ const start = Date.now();
3023
+ process.exitCode = argv.fix ? fix({
3024
+ pkg: argv.package,
3025
+ cache: argv.cache,
3026
+ verbose: !!argv.verbose
3027
+ }) : lint({
3028
+ pkg: argv.package,
3029
+ cache: argv.cache,
3030
+ verbose: !!argv.verbose
3031
+ });
3032
+ console.log(chalk34.blue(`Finished in ${Date.now() - start}ms`));
3033
+ }
3034
+ };
3035
+
3036
+ // src/xy/lint/publintCommand.ts
3037
+ import chalk35 from "chalk";
3038
+ var publintCommand = {
3039
+ command: "publint [package]",
3040
+ describe: "Publint - Run Publint",
3041
+ builder: (yargs2) => {
3042
+ return packagePositionalParam(yargs2);
3043
+ },
3044
+ handler: async (argv) => {
3045
+ if (argv.verbose) console.log("Publint");
3046
+ const start = Date.now();
3047
+ process.exitCode = await publint({ pkg: argv.package, verbose: !!argv.verbose });
3048
+ console.log(chalk35.blue(`Finished in ${Date.now() - start}ms`));
3049
+ }
3050
+ };
3051
+
3052
+ // src/xy/lint/relintCommand.ts
3053
+ import chalk36 from "chalk";
3054
+ var relintCommand = {
3055
+ command: "relint [package]",
3056
+ describe: "Relint - Clean & Lint",
3057
+ builder: (yargs2) => {
3058
+ return packagePositionalParam(yargs2);
3059
+ },
3060
+ handler: (argv) => {
3061
+ if (argv.verbose) console.log("Relinting");
3062
+ const start = Date.now();
3063
+ process.exitCode = relint();
3064
+ console.log(chalk36.blue(`Finished in ${Date.now() - start}ms`));
3065
+ }
3066
+ };
3067
+
3068
+ // src/xy/lint/sonarCommand.ts
3069
+ import chalk37 from "chalk";
3070
+ var sonarCommand = {
3071
+ command: "sonar",
3072
+ describe: "Sonar - Run Sonar Check",
3073
+ builder: (yargs2) => {
3074
+ return packagePositionalParam(yargs2);
3075
+ },
3076
+ handler: (argv) => {
3077
+ const start = Date.now();
3078
+ if (argv.verbose) console.log("Sonar Check");
3079
+ process.exitCode = sonar();
3080
+ console.log(chalk37.blue(`Finished in ${Date.now() - start}ms`));
3081
+ }
3082
+ };
3083
+
3084
+ // src/xy/lint/index.ts
2706
3085
  var xyLintCommands = (args) => {
2707
- return args.command(
2708
- "cycle [package]",
2709
- "Cycle - Check for dependency cycles",
2710
- (yargs2) => {
2711
- return packagePositionalParam(yargs2);
2712
- },
2713
- async (argv) => {
2714
- const start = Date.now();
2715
- if (argv.verbose) console.log("Cycle");
2716
- process.exitCode = await cycle({ pkg: argv.package });
2717
- console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2718
- }
2719
- ).command(
2720
- "lint [package]",
2721
- "Lint - Run Eslint",
2722
- (yargs2) => {
2723
- return packagePositionalParam(yargs2).option("fix", {
2724
- alias: "f",
2725
- default: false,
2726
- description: "Fix fixable issues",
2727
- type: "boolean"
2728
- }).option("cache", {
2729
- alias: "c",
2730
- default: false,
2731
- description: "Use caching for performance",
2732
- type: "boolean"
2733
- });
2734
- },
2735
- (argv) => {
2736
- if (argv.verbose) console.log("Lint");
2737
- const start = Date.now();
2738
- process.exitCode = argv.fix ? fix({
2739
- pkg: argv.package,
2740
- cache: argv.cache,
2741
- verbose: !!argv.verbose
2742
- }) : lint({
2743
- pkg: argv.package,
2744
- cache: argv.cache,
2745
- verbose: !!argv.verbose
2746
- });
2747
- console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2748
- }
2749
- ).command(
2750
- "deplint [package]",
2751
- "Deplint - Run Deplint",
2752
- (yargs2) => {
2753
- return packagePositionalParam(yargs2).option("deps", {
2754
- alias: "d",
2755
- default: false,
2756
- description: "Check dependencies",
2757
- type: "boolean"
2758
- }).option("devDeps", {
2759
- alias: "v",
2760
- default: false,
2761
- description: "Check devDependencies",
2762
- type: "boolean"
2763
- }).option("peerDeps", {
2764
- alias: "p",
2765
- default: false,
2766
- description: "Check peerDependencies",
2767
- type: "boolean"
2768
- }).option("exclude", {
2769
- alias: "e",
2770
- description: "Package names to exclude from unused checks (comma-separated or repeated)",
2771
- type: "array"
2772
- });
2773
- },
2774
- async (argv) => {
2775
- if (argv.verbose) console.log("Deplint");
2776
- const start = Date.now();
2777
- const cliExclude = argv.exclude?.flatMap((v) => String(v).split(",")).map((v) => v.trim()).filter(Boolean);
2778
- process.exitCode = await deplint({
2779
- cliExclude,
2780
- pkg: argv.package,
2781
- deps: !!argv.deps,
2782
- devDeps: !!argv.devDeps,
2783
- peerDeps: !!argv.peerDeps,
2784
- verbose: !!argv.verbose
2785
- });
2786
- console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2787
- }
2788
- ).command(
2789
- "fix [package]",
2790
- "Fix - Run Eslint w/fix",
2791
- (yargs2) => {
2792
- return packagePositionalParam(yargs2);
2793
- },
2794
- (argv) => {
2795
- const start = Date.now();
2796
- if (argv.verbose) console.log("Fix");
2797
- process.exitCode = fix();
2798
- console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2799
- }
2800
- ).command(
2801
- "relint [package]",
2802
- "Relint - Clean & Lint",
2803
- (yargs2) => {
2804
- return packagePositionalParam(yargs2);
2805
- },
2806
- (argv) => {
2807
- if (argv.verbose) console.log("Relinting");
2808
- const start = Date.now();
2809
- process.exitCode = relint();
2810
- console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2811
- }
2812
- ).command(
2813
- "publint [package]",
2814
- "Publint - Run Publint",
2815
- (yargs2) => {
2816
- return packagePositionalParam(yargs2);
2817
- },
2818
- async (argv) => {
2819
- if (argv.verbose) console.log("Publint");
2820
- const start = Date.now();
2821
- process.exitCode = await publint({ pkg: argv.package, verbose: !!argv.verbose });
2822
- console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2823
- }
2824
- ).command(
2825
- "knip",
2826
- "Knip - Run Knip",
2827
- (yargs2) => {
2828
- return packagePositionalParam(yargs2);
2829
- },
2830
- (argv) => {
2831
- if (argv.verbose) console.log("Knip");
2832
- const start = Date.now();
2833
- process.exitCode = knip();
2834
- console.log(chalk30.blue(`Knip finished in ${Date.now() - start}ms`));
2835
- }
2836
- ).command(
2837
- "sonar",
2838
- "Sonar - Run Sonar Check",
2839
- (yargs2) => {
2840
- return packagePositionalParam(yargs2);
2841
- },
2842
- (argv) => {
2843
- const start = Date.now();
2844
- if (argv.verbose) console.log("Sonar Check");
2845
- process.exitCode = sonar();
2846
- console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2847
- }
2848
- );
3086
+ return args.command(cycleCommand).command(lintCommand).command(deplintCommand).command(fixCommand).command(relintCommand).command(publintCommand).command(knipCommand).command(sonarCommand);
2849
3087
  };
2850
3088
 
3089
+ // src/xy/xy.ts
3090
+ import chalk38 from "chalk";
3091
+
2851
3092
  // src/xy/xyParseOptions.ts
2852
3093
  import yargs from "yargs";
2853
3094
  import { hideBin } from "yargs/helpers";
@@ -2879,8 +3120,8 @@ var xyParseOptions = () => {
2879
3120
  var xy = async () => {
2880
3121
  const options = xyParseOptions();
2881
3122
  return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
2882
- console.error(chalk31.yellow(`Command not found [${chalk31.magenta(process.argv[2])}]`));
2883
- console.log(chalk31.gray("Try 'yarn xy --help' for list of commands"));
3123
+ console.error(chalk38.yellow(`Command not found [${chalk38.magenta(process.argv[2])}]`));
3124
+ console.log(chalk38.gray("Try 'yarn xy --help' for list of commands"));
2884
3125
  }).version().help().argv;
2885
3126
  };
2886
3127