@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/index.mjs CHANGED
@@ -20,7 +20,7 @@ import { createRequire } from "module";
20
20
  import PATH from "path";
21
21
  var require2 = createRequire(import.meta.url);
22
22
  var packageRoot = PATH.dirname(require2.resolve("@xylabs/ts-scripts-yarn3/package.json"));
23
- var templatesDir = PATH.resolve(packageRoot, "templates");
23
+ var templatesDir = PATH.resolve(packageRoot, "templates", "claude");
24
24
  var XYLABS_RULES_PREFIX = "xylabs-";
25
25
  var XYLABS_COMMANDS_PREFIX = "xylabs-";
26
26
  var claudeMdRuleTemplates = () => {
@@ -381,10 +381,19 @@ var generateIgnoreFiles = (filename3, pkg) => {
381
381
 
382
382
  // src/lib/generateReadmeFiles.ts
383
383
  import { execSync as execSync2 } from "child_process";
384
- import FS from "fs";
385
- import { readFile, writeFile } from "fs/promises";
384
+ import FS, { readFileSync as readFileSync5 } from "fs";
385
+ import {
386
+ mkdir,
387
+ readFile,
388
+ writeFile
389
+ } from "fs/promises";
390
+ import { createRequire as createRequire2 } from "module";
386
391
  import PATH2 from "path";
392
+ import { createInterface } from "readline";
387
393
  import chalk5 from "chalk";
394
+ var require3 = createRequire2(import.meta.url);
395
+ var packageRoot2 = PATH2.dirname(require3.resolve("@xylabs/ts-scripts-yarn3/package.json"));
396
+ var readmeTemplatesDir = PATH2.resolve(packageRoot2, "templates", "readme");
388
397
  function fillTemplate(template, data) {
389
398
  const additionalData = { ...data, safeName: data.name.replaceAll("/", "__").replaceAll("@", "") };
390
399
  return template.replaceAll(/\{\{(.*?)\}\}/g, (_, key) => additionalData[key.trim()] ?? "");
@@ -474,37 +483,120 @@ ${indent}### ${item.name}
474
483
  }
475
484
  return content;
476
485
  }
486
+ function askConfirmation(question) {
487
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
488
+ return new Promise((resolve) => {
489
+ rl.question(question, (answer) => {
490
+ rl.close();
491
+ resolve(answer.toLowerCase() === "y" || answer.toLowerCase() === "yes");
492
+ });
493
+ });
494
+ }
495
+ var DEFAULT_README_TEMPLATE = readFileSync5(PATH2.resolve(readmeTemplatesDir, "README.template.md"), "utf8");
496
+ var DEFAULT_README_BODY = readFileSync5(PATH2.resolve(readmeTemplatesDir, "README.body.md"), "utf8");
497
+ function applyLogoConfig(template, logoUrl, logoLinkUrl) {
498
+ let result = template;
499
+ if (logoUrl) {
500
+ result = result.replace(/\[logo]: .+/, `[logo]: ${logoUrl}`);
501
+ if (logoLinkUrl) {
502
+ result = result.replace(/\[!\[logo]\[]][^)]*\)/, `[![logo][]](${logoLinkUrl})`);
503
+ }
504
+ } else {
505
+ result = result.replace(/\[!\[logo]\[]][^\n]*\n*/, "");
506
+ result = result.replace(/\[logo]: [^\n]*\n?/, "");
507
+ }
508
+ return result;
509
+ }
510
+ function resolveTemplatePath(templatePath) {
511
+ const cwd5 = INIT_CWD() ?? ".";
512
+ return templatePath ?? PATH2.join(cwd5, ".xy", "README.template.md");
513
+ }
514
+ async function loadOrCreateTemplate(resolvedTemplatePath) {
515
+ try {
516
+ const template = await readFile(resolvedTemplatePath, "utf8");
517
+ return { created: false, template };
518
+ } catch {
519
+ console.log(chalk5.yellow(`Template not found: ${resolvedTemplatePath}`));
520
+ const shouldCreate = await askConfirmation("Would you like to create a stock template? (y/N) ");
521
+ if (!shouldCreate) {
522
+ throw new Error("Template creation declined");
523
+ }
524
+ const template = DEFAULT_README_TEMPLATE;
525
+ await scaffoldTemplate(resolvedTemplatePath, template);
526
+ return { created: true, template };
527
+ }
528
+ }
529
+ async function scaffoldTemplate(resolvedTemplatePath, template) {
530
+ const xyDir = PATH2.dirname(resolvedTemplatePath);
531
+ await mkdir(xyDir, { recursive: true });
532
+ await writeFile(resolvedTemplatePath, template);
533
+ console.log(chalk5.green(`Created template: ${resolvedTemplatePath}`));
534
+ const bodyPath = PATH2.join(xyDir, "README.body.md");
535
+ await writeFile(bodyPath, DEFAULT_README_BODY);
536
+ console.log(chalk5.green(`Created body template: ${bodyPath}`));
537
+ }
538
+ async function resolveBody(location, defaultBody) {
539
+ const localBodyPath = PATH2.join(location, "README.body.md");
540
+ try {
541
+ return await readFile(localBodyPath, "utf8");
542
+ } catch {
543
+ return defaultBody;
544
+ }
545
+ }
546
+ async function generateReadmeForWorkspace(location, name, template, defaultBody, typedoc, verbose) {
547
+ try {
548
+ const pkgJsonPath = PATH2.join(location, "package.json");
549
+ const pkgJson = JSON.parse(await readFile(pkgJsonPath, "utf8"));
550
+ const body = await resolveBody(location, defaultBody);
551
+ const typedocContent = typedoc ? generateTypedoc(location, ["src/index*.ts"]) : "";
552
+ const readmeContent = fillTemplate(template, {
553
+ ...pkgJson,
554
+ body,
555
+ typedoc: typedocContent
556
+ });
557
+ await writeFile(PATH2.join(location, "README.md"), readmeContent);
558
+ if (verbose) console.log(chalk5.green(` ${name}`));
559
+ return true;
560
+ } catch (ex) {
561
+ const error = ex;
562
+ console.warn(chalk5.yellow(` Skipped ${location}: ${error.message}`));
563
+ return false;
564
+ }
565
+ }
477
566
  async function generateReadmeFiles({
567
+ logoLinkUrl,
568
+ logoUrl,
478
569
  pkg,
479
570
  templatePath,
480
571
  typedoc = false,
481
- verbose
572
+ verbose = false
482
573
  }) {
483
574
  console.log(chalk5.green("Generate README Files"));
484
- const cwd5 = INIT_CWD() ?? ".";
485
- const resolvedTemplatePath = templatePath ?? PATH2.join(cwd5, "scripts", "README.template.md");
575
+ const resolvedTemplatePath = resolveTemplatePath(templatePath);
486
576
  let template;
577
+ let templateCreated;
487
578
  try {
488
- template = await readFile(resolvedTemplatePath, "utf8");
579
+ ({ template, created: templateCreated } = await loadOrCreateTemplate(resolvedTemplatePath));
489
580
  } catch {
490
- console.error(chalk5.red(`Template not found: ${resolvedTemplatePath}`));
491
581
  return 1;
492
582
  }
493
- const workspaces = pkg ? [yarnWorkspace(pkg)] : yarnWorkspaces();
583
+ template = applyLogoConfig(template, logoUrl, logoLinkUrl);
584
+ if (templateCreated) {
585
+ console.log(chalk5.green("Generating README files for all packages..."));
586
+ }
587
+ const xyDir = PATH2.dirname(resolvedTemplatePath);
588
+ const xyBodyPath = PATH2.join(xyDir, "README.body.md");
589
+ let defaultBody;
590
+ try {
591
+ defaultBody = await readFile(xyBodyPath, "utf8");
592
+ } catch {
593
+ defaultBody = DEFAULT_README_BODY;
594
+ }
595
+ const workspaces = pkg && !templateCreated ? [yarnWorkspace(pkg)] : yarnWorkspaces();
494
596
  let failed = false;
495
597
  for (const { location, name } of workspaces) {
496
- try {
497
- const pkgJsonPath = PATH2.join(location, "package.json");
498
- const pkgJson = JSON.parse(await readFile(pkgJsonPath, "utf8"));
499
- const typedocContent = typedoc ? generateTypedoc(location, ["src/index*.ts"]) : "";
500
- const readmeContent = fillTemplate(template, { ...pkgJson, typedoc: typedocContent });
501
- await writeFile(PATH2.join(location, "README.md"), readmeContent);
502
- if (verbose) console.log(chalk5.green(` ${name}`));
503
- } catch (ex) {
504
- const error = ex;
505
- console.warn(chalk5.yellow(` Skipped ${location}: ${error.message}`));
506
- failed = true;
507
- }
598
+ const success = await generateReadmeForWorkspace(location, name, template, defaultBody, typedoc, verbose);
599
+ if (!success) failed = true;
508
600
  }
509
601
  return failed ? 1 : 0;
510
602
  }
@@ -531,10 +623,10 @@ var loadConfig = async (params) => {
531
623
  };
532
624
 
533
625
  // src/lib/parsedPackageJSON.ts
534
- import { readFileSync as readFileSync5 } from "fs";
626
+ import { readFileSync as readFileSync6 } from "fs";
535
627
  var parsedPackageJSON = (path14) => {
536
628
  const pathToPackageJSON = path14 ?? process.env.npm_package_json ?? "";
537
- const packageJSON = readFileSync5(pathToPackageJSON).toString();
629
+ const packageJSON = readFileSync6(pathToPackageJSON).toString();
538
630
  return JSON.parse(packageJSON);
539
631
  };
540
632
 
@@ -667,7 +759,7 @@ import {
667
759
  existsSync as existsSync5,
668
760
  mkdirSync,
669
761
  readdirSync as readdirSync2,
670
- readFileSync as readFileSync6,
762
+ readFileSync as readFileSync7,
671
763
  unlinkSync,
672
764
  writeFileSync as writeFileSync2
673
765
  } from "fs";
@@ -680,7 +772,7 @@ var syncCommandFiles = (commandsDir) => {
680
772
  let created = 0;
681
773
  for (const [filename3, content] of Object.entries(templates)) {
682
774
  const targetPath = PATH3.resolve(commandsDir, filename3);
683
- const existing = existsSync5(targetPath) ? readFileSync6(targetPath, "utf8") : void 0;
775
+ const existing = existsSync5(targetPath) ? readFileSync7(targetPath, "utf8") : void 0;
684
776
  if (existing === content) continue;
685
777
  writeFileSync2(targetPath, content, "utf8");
686
778
  if (existing) {
@@ -737,7 +829,7 @@ import {
737
829
  existsSync as existsSync6,
738
830
  mkdirSync as mkdirSync2,
739
831
  readdirSync as readdirSync3,
740
- readFileSync as readFileSync7,
832
+ readFileSync as readFileSync8,
741
833
  unlinkSync as unlinkSync2,
742
834
  writeFileSync as writeFileSync3
743
835
  } from "fs";
@@ -750,7 +842,7 @@ var syncRuleFiles = (rulesDir) => {
750
842
  let created = 0;
751
843
  for (const [filename3, content] of Object.entries(templates)) {
752
844
  const targetPath = PATH4.resolve(rulesDir, filename3);
753
- const existing = existsSync6(targetPath) ? readFileSync7(targetPath, "utf8") : void 0;
845
+ const existing = existsSync6(targetPath) ? readFileSync8(targetPath, "utf8") : void 0;
754
846
  if (existing === content) continue;
755
847
  writeFileSync3(targetPath, content, "utf8");
756
848
  if (existing) {
@@ -822,7 +914,7 @@ import {
822
914
  writeFileSync as writeFileSync4
823
915
  } from "fs";
824
916
  import PATH5 from "path";
825
- import { createInterface } from "readline";
917
+ import { createInterface as createInterface2 } from "readline";
826
918
  import chalk13 from "chalk";
827
919
  var DEFAULT_SETTINGS = {
828
920
  permissions: {
@@ -857,8 +949,8 @@ var DEFAULT_SETTINGS = {
857
949
  ]
858
950
  }
859
951
  };
860
- function askConfirmation(question) {
861
- const rl = createInterface({ input: process.stdin, output: process.stdout });
952
+ function askConfirmation2(question) {
953
+ const rl = createInterface2({ input: process.stdin, output: process.stdout });
862
954
  return new Promise((resolve) => {
863
955
  rl.question(question, (answer) => {
864
956
  rl.close();
@@ -872,7 +964,7 @@ async function claudeSettings() {
872
964
  const settingsPath = PATH5.resolve(claudeDir, "settings.local.json");
873
965
  mkdirSync3(claudeDir, { recursive: true });
874
966
  if (existsSync7(settingsPath)) {
875
- const confirmed = await askConfirmation(
967
+ const confirmed = await askConfirmation2(
876
968
  chalk13.yellow(`${settingsPath} already exists. Replace it? (y/N) `)
877
969
  );
878
970
  if (!confirmed) {
@@ -1798,11 +1890,11 @@ var deplint = async ({
1798
1890
  };
1799
1891
 
1800
1892
  // src/actions/deploy.ts
1801
- import { readFileSync as readFileSync8 } from "fs";
1893
+ import { readFileSync as readFileSync9 } from "fs";
1802
1894
  var privatePackageExcludeList = () => {
1803
1895
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1804
1896
  workspace,
1805
- JSON.parse(readFileSync8(`${workspace.location}/package.json`, { encoding: "utf8" }))
1897
+ JSON.parse(readFileSync9(`${workspace.location}/package.json`, { encoding: "utf8" }))
1806
1898
  ]);
1807
1899
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1808
1900
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -1822,11 +1914,11 @@ var deploy = () => {
1822
1914
  };
1823
1915
 
1824
1916
  // src/actions/deploy-major.ts
1825
- import { readFileSync as readFileSync9 } from "fs";
1917
+ import { readFileSync as readFileSync10 } from "fs";
1826
1918
  var privatePackageExcludeList2 = () => {
1827
1919
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1828
1920
  workspace,
1829
- JSON.parse(readFileSync9(`${workspace.location}/package.json`, { encoding: "utf8" }))
1921
+ JSON.parse(readFileSync10(`${workspace.location}/package.json`, { encoding: "utf8" }))
1830
1922
  ]);
1831
1923
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1832
1924
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -1846,11 +1938,11 @@ var deployMajor = () => {
1846
1938
  };
1847
1939
 
1848
1940
  // src/actions/deploy-minor.ts
1849
- import { readFileSync as readFileSync10 } from "fs";
1941
+ import { readFileSync as readFileSync11 } from "fs";
1850
1942
  var privatePackageExcludeList3 = () => {
1851
1943
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1852
1944
  workspace,
1853
- JSON.parse(readFileSync10(`${workspace.location}/package.json`, { encoding: "utf8" }))
1945
+ JSON.parse(readFileSync11(`${workspace.location}/package.json`, { encoding: "utf8" }))
1854
1946
  ]);
1855
1947
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1856
1948
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -1870,11 +1962,11 @@ var deployMinor = () => {
1870
1962
  };
1871
1963
 
1872
1964
  // src/actions/deploy-next.ts
1873
- import { readFileSync as readFileSync11 } from "fs";
1965
+ import { readFileSync as readFileSync12 } from "fs";
1874
1966
  var privatePackageExcludeList4 = () => {
1875
1967
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1876
1968
  workspace,
1877
- JSON.parse(readFileSync11(`${workspace.location}/package.json`, { encoding: "utf8" }))
1969
+ JSON.parse(readFileSync12(`${workspace.location}/package.json`, { encoding: "utf8" }))
1878
1970
  ]);
1879
1971
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1880
1972
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -2918,7 +3010,10 @@ async function readmeGen({
2918
3010
  typedoc,
2919
3011
  verbose
2920
3012
  }) {
3013
+ const config2 = await loadConfig();
2921
3014
  return await generateReadmeFiles({
3015
+ logoLinkUrl: config2.readme?.logoLinkUrl,
3016
+ logoUrl: config2.readme?.logoUrl,
2922
3017
  pkg,
2923
3018
  templatePath,
2924
3019
  typedoc,
@@ -2926,6 +3021,15 @@ async function readmeGen({
2926
3021
  });
2927
3022
  }
2928
3023
 
3024
+ // src/actions/readme-init.ts
3025
+ async function readmeInit({ templatePath }) {
3026
+ const config2 = await loadConfig();
3027
+ const template = applyLogoConfig(DEFAULT_README_TEMPLATE, config2.readme?.logoUrl, config2.readme?.logoLinkUrl);
3028
+ const resolvedTemplatePath = resolveTemplatePath(templatePath);
3029
+ await scaffoldTemplate(resolvedTemplatePath, template);
3030
+ return 0;
3031
+ }
3032
+
2929
3033
  // src/actions/rebuild.ts
2930
3034
  var rebuild = ({ target }) => {
2931
3035
  return runSteps("Rebuild", [
@@ -3082,8 +3186,8 @@ var relintAllPackages = ({ fix: fix2 = false } = {}) => {
3082
3186
  // src/actions/retest.ts
3083
3187
  var retest = () => {
3084
3188
  return runSteps("Test", [
3085
- ["yarn", ["jest", "--clearCache"]],
3086
- ["yarn", ["jest", "."]]
3189
+ ["yarn", ["vitest", "--clearCache"]],
3190
+ ["yarn", ["vitest", "."]]
3087
3191
  ]);
3088
3192
  };
3089
3193
 
@@ -3152,105 +3256,200 @@ var loadPackageConfig = async () => {
3152
3256
  return JSON.parse(pkgConfig);
3153
3257
  };
3154
3258
 
3155
- // src/xy/xy.ts
3156
- import chalk43 from "chalk";
3157
-
3158
- // src/xy/xyBuildCommands.ts
3159
- var xyBuildCommands = (args) => {
3160
- return args.command(
3161
- "build [package]",
3162
- "Build - Compile & Lint",
3163
- (yargs2) => {
3164
- return yargs2.positional("package", { describe: "Specific package to build" });
3165
- },
3166
- async (argv) => {
3167
- if (argv.verbose) {
3168
- console.log(`Building: ${argv.package ?? "all"}`);
3169
- }
3170
- process.exitCode = await build({
3171
- incremental: !!argv.incremental,
3172
- jobs: argv.jobs,
3173
- pkg: argv.package,
3174
- target: argv.target,
3175
- verbose: !!argv.verbose
3176
- });
3177
- }
3178
- ).command(
3179
- "compile [package]",
3180
- "Compile with Typescript & Copy Images",
3181
- (yargs2) => {
3182
- return yargs2.positional("package", { describe: "Specific package to compile" });
3183
- },
3184
- (argv) => {
3185
- if (argv.verbose) {
3186
- console.log(`Compiling: ${argv.package ?? "all"}`);
3187
- }
3188
- process.exitCode = compile({
3189
- incremental: !!argv.incremental,
3190
- jobs: argv.jobs,
3191
- pkg: argv.package,
3192
- target: argv.target,
3193
- verbose: !!argv.verbose
3194
- });
3259
+ // src/xy/build/buildCommand.ts
3260
+ var buildCommand = {
3261
+ command: "build [package]",
3262
+ describe: "Build - Compile & Lint",
3263
+ builder: (yargs2) => {
3264
+ return yargs2.positional("package", { describe: "Specific package to build" });
3265
+ },
3266
+ handler: async (argv) => {
3267
+ if (argv.verbose) {
3268
+ console.log(`Building: ${argv.package ?? "all"}`);
3195
3269
  }
3196
- ).command(
3197
- "compile-only [package]",
3198
- "Compile with Typescript & Copy Images (No Publint)",
3199
- (yargs2) => {
3200
- return yargs2.positional("package", { describe: "Specific package to compile" });
3201
- },
3202
- (argv) => {
3203
- if (argv.verbose) {
3204
- console.log(`Compiling: ${argv.package ?? "all"}`);
3205
- }
3206
- process.exitCode = compile({
3207
- incremental: !!argv.incremental,
3208
- jobs: argv.jobs,
3209
- pkg: argv.package,
3210
- publint: false,
3211
- target: argv.target,
3212
- verbose: !!argv.verbose
3213
- });
3270
+ process.exitCode = await build({
3271
+ incremental: !!argv.incremental,
3272
+ jobs: argv.jobs,
3273
+ pkg: argv.package,
3274
+ target: argv.target,
3275
+ verbose: !!argv.verbose
3276
+ });
3277
+ }
3278
+ };
3279
+
3280
+ // src/xy/build/compileCommand.ts
3281
+ var compileCommand = {
3282
+ command: "compile [package]",
3283
+ describe: "Compile with Typescript & Copy Images",
3284
+ builder: (yargs2) => {
3285
+ return yargs2.positional("package", { describe: "Specific package to compile" });
3286
+ },
3287
+ handler: (argv) => {
3288
+ if (argv.verbose) {
3289
+ console.log(`Compiling: ${argv.package ?? "all"}`);
3214
3290
  }
3215
- ).command(
3216
- "recompile [package]",
3217
- "Re-compile with Typescript & Copy Images",
3218
- (yargs2) => {
3219
- return yargs2.positional("package", { describe: "Specific package to re-compile" });
3220
- },
3221
- async (argv) => {
3222
- if (argv.verbose) {
3223
- console.log(`Re-compiling: ${argv.package ?? "all"}`);
3224
- }
3225
- process.exitCode = await recompile({
3226
- incremental: !!argv.incremental,
3227
- jobs: argv.jobs,
3228
- pkg: argv.package,
3229
- target: argv.target,
3230
- verbose: !!argv.verbose
3231
- });
3291
+ process.exitCode = compile({
3292
+ incremental: !!argv.incremental,
3293
+ jobs: argv.jobs,
3294
+ pkg: argv.package,
3295
+ target: argv.target,
3296
+ verbose: !!argv.verbose
3297
+ });
3298
+ }
3299
+ };
3300
+
3301
+ // src/xy/build/compileOnlyCommand.ts
3302
+ var compileOnlyCommand = {
3303
+ command: "compile-only [package]",
3304
+ describe: "Compile with Typescript & Copy Images (No Publint)",
3305
+ builder: (yargs2) => {
3306
+ return yargs2.positional("package", { describe: "Specific package to compile" });
3307
+ },
3308
+ handler: (argv) => {
3309
+ if (argv.verbose) {
3310
+ console.log(`Compiling: ${argv.package ?? "all"}`);
3232
3311
  }
3233
- ).command(
3234
- "rebuild [package]",
3235
- "Rebuild - Clean, Compile & Lint",
3236
- (yargs2) => {
3237
- return yargs2.positional("package", { describe: "Specific package to rebuild" });
3238
- },
3239
- (argv) => {
3240
- if (argv.verbose) console.log(`Rebuilding: ${argv.package ?? "all"}`);
3241
- process.exitCode = rebuild({ target: argv.target });
3242
- }
3243
- ).command(
3244
- "copy-assets [package]",
3245
- "Copy Assets - Copy the assets from src to dist",
3246
- (yargs2) => {
3247
- return yargs2.positional("package", { describe: "Specific package to copy assets" });
3248
- },
3249
- async (argv) => {
3250
- if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? "all"}`);
3251
- process.exitCode = await copyAssets({ target: argv.target });
3312
+ process.exitCode = compile({
3313
+ incremental: !!argv.incremental,
3314
+ jobs: argv.jobs,
3315
+ pkg: argv.package,
3316
+ publint: false,
3317
+ target: argv.target,
3318
+ verbose: !!argv.verbose
3319
+ });
3320
+ }
3321
+ };
3322
+
3323
+ // src/xy/build/copyAssetsCommand.ts
3324
+ var copyAssetsCommand = {
3325
+ command: "copy-assets [package]",
3326
+ describe: "Copy Assets - Copy the assets from src to dist",
3327
+ builder: (yargs2) => {
3328
+ return yargs2.positional("package", { describe: "Specific package to copy assets" });
3329
+ },
3330
+ handler: async (argv) => {
3331
+ if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? "all"}`);
3332
+ process.exitCode = await copyAssets({ target: argv.target });
3333
+ }
3334
+ };
3335
+
3336
+ // src/xy/build/rebuildCommand.ts
3337
+ var rebuildCommand = {
3338
+ command: "rebuild [package]",
3339
+ describe: "Rebuild - Clean, Compile & Lint",
3340
+ builder: (yargs2) => {
3341
+ return yargs2.positional("package", { describe: "Specific package to rebuild" });
3342
+ },
3343
+ handler: (argv) => {
3344
+ if (argv.verbose) console.log(`Rebuilding: ${argv.package ?? "all"}`);
3345
+ process.exitCode = rebuild({ target: argv.target });
3346
+ }
3347
+ };
3348
+
3349
+ // src/xy/build/recompileCommand.ts
3350
+ var recompileCommand = {
3351
+ command: "recompile [package]",
3352
+ describe: "Re-compile with Typescript & Copy Images",
3353
+ builder: (yargs2) => {
3354
+ return yargs2.positional("package", { describe: "Specific package to re-compile" });
3355
+ },
3356
+ handler: async (argv) => {
3357
+ if (argv.verbose) {
3358
+ console.log(`Re-compiling: ${argv.package ?? "all"}`);
3252
3359
  }
3253
- );
3360
+ process.exitCode = await recompile({
3361
+ incremental: !!argv.incremental,
3362
+ jobs: argv.jobs,
3363
+ pkg: argv.package,
3364
+ target: argv.target,
3365
+ verbose: !!argv.verbose
3366
+ });
3367
+ }
3368
+ };
3369
+
3370
+ // src/xy/build/index.ts
3371
+ var xyBuildCommands = (args) => {
3372
+ return args.command(buildCommand).command(compileCommand).command(compileOnlyCommand).command(recompileCommand).command(rebuildCommand).command(copyAssetsCommand);
3373
+ };
3374
+
3375
+ // src/xy/common/claude/commandsCommand.ts
3376
+ var commandsCommand = {
3377
+ command: "commands",
3378
+ describe: "Sync XY Labs standard Claude slash commands to .claude/commands/",
3379
+ handler: (argv) => {
3380
+ if (argv.verbose) console.log("Claude Commands");
3381
+ process.exitCode = claudeCommands();
3382
+ }
3383
+ };
3384
+
3385
+ // src/xy/common/claude/initCommand.ts
3386
+ var initCommand = {
3387
+ builder: (yargs2) => {
3388
+ return yargs2.option("force", {
3389
+ alias: "f",
3390
+ default: false,
3391
+ description: "Overwrite existing CLAUDE.md",
3392
+ type: "boolean"
3393
+ });
3394
+ },
3395
+ command: "init",
3396
+ describe: "Initialize all Claude configuration (commands, rules, settings)",
3397
+ handler: async (argv) => {
3398
+ if (argv.verbose) console.log("Claude Init");
3399
+ const commandsResult = claudeCommands();
3400
+ const rulesResult = claudeRules({ force: argv.force });
3401
+ const settingsResult = await claudeSettings();
3402
+ process.exitCode = commandsResult || rulesResult || settingsResult;
3403
+ }
3404
+ };
3405
+
3406
+ // src/xy/common/claude/rulesCommand.ts
3407
+ var rulesCommand = {
3408
+ builder: (yargs2) => {
3409
+ return yargs2.option("force", {
3410
+ alias: "f",
3411
+ default: false,
3412
+ description: "Overwrite existing CLAUDE.md",
3413
+ type: "boolean"
3414
+ });
3415
+ },
3416
+ command: "rules",
3417
+ describe: "Sync XY Labs standard Claude rules to .claude/rules/",
3418
+ handler: (argv) => {
3419
+ if (argv.verbose) console.log("Claude Rules");
3420
+ process.exitCode = claudeRules({ force: argv.force });
3421
+ }
3422
+ };
3423
+
3424
+ // src/xy/common/claude/settingsCommand.ts
3425
+ var settingsCommand = {
3426
+ command: "settings",
3427
+ describe: "Initialize .claude/settings.local.json with XY Labs defaults",
3428
+ handler: async (argv) => {
3429
+ if (argv.verbose) console.log("Claude Settings");
3430
+ process.exitCode = await claudeSettings();
3431
+ }
3432
+ };
3433
+
3434
+ // src/xy/common/claude/index.ts
3435
+ var claudeCommand = {
3436
+ builder: (yargs2) => {
3437
+ return yargs2.command(commandsCommand).command(initCommand).command(rulesCommand).command(settingsCommand).demandCommand(1, "Please specify a claude subcommand");
3438
+ },
3439
+ command: "claude",
3440
+ describe: "Claude - Claude Code configuration utilities",
3441
+ handler: () => {
3442
+ }
3443
+ };
3444
+
3445
+ // src/xy/common/cleanDocsCommand.ts
3446
+ var cleanDocsCommand = {
3447
+ command: "clean-docs",
3448
+ describe: "CleanDocs - Clean TypeDocs",
3449
+ handler: (argv) => {
3450
+ if (argv.verbose) console.log("Cleaning TypeDocs: all");
3451
+ process.exitCode = cleanDocs();
3452
+ }
3254
3453
  };
3255
3454
 
3256
3455
  // src/xy/param.ts
@@ -3258,455 +3457,497 @@ var packagePositionalParam = (yargs2) => {
3258
3457
  return yargs2.positional("package", { describe: "Specific package to target", type: "string" });
3259
3458
  };
3260
3459
 
3261
- // src/xy/xyCommonCommands.ts
3460
+ // src/xy/common/deadCommand.ts
3461
+ var deadCommand = {
3462
+ builder: (yargs2) => {
3463
+ return packagePositionalParam(yargs2);
3464
+ },
3465
+ command: "dead [package]",
3466
+ describe: "Dead - Check for dead code",
3467
+ handler: (argv) => {
3468
+ if (argv.verbose) console.log("Dead");
3469
+ process.exitCode = dead();
3470
+ }
3471
+ };
3472
+
3473
+ // src/xy/common/genDocsCommand.ts
3474
+ var genDocsCommand = {
3475
+ builder: (yargs2) => {
3476
+ return packagePositionalParam(yargs2);
3477
+ },
3478
+ command: "gen-docs [package]",
3479
+ describe: "GenDocs - Generate TypeDocs",
3480
+ handler: (argv) => {
3481
+ if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? "all"}`);
3482
+ process.exitCode = genDocs({ incremental: !!argv.incremental, pkg: argv.package });
3483
+ }
3484
+ };
3485
+
3486
+ // src/xy/common/gitignoreGenCommand.ts
3487
+ var gitignoreGenCommand = {
3488
+ command: "gitignore-gen",
3489
+ describe: "GitIgnore Gen - Generate .gitignore files",
3490
+ handler: (argv) => {
3491
+ if (argv.verbose) console.log("GitIgnore Gen");
3492
+ process.exitCode = gitignoreGen();
3493
+ }
3494
+ };
3495
+
3496
+ // src/xy/common/gitlintCommand.ts
3497
+ var gitlintCommand = {
3498
+ command: "gitlint [package]",
3499
+ describe: "Gitlint - Lint your git config",
3500
+ handler: (argv) => {
3501
+ if (argv.verbose) console.log("Gitlint");
3502
+ process.exitCode = argv.fix ? gitlintFix() : gitlint();
3503
+ }
3504
+ };
3505
+
3506
+ // src/xy/common/licenseCommand.ts
3507
+ var licenseCommand = {
3508
+ builder: (yargs2) => {
3509
+ return packagePositionalParam(yargs2);
3510
+ },
3511
+ command: "license [package]",
3512
+ describe: "License - Check licenses of dependencies",
3513
+ handler: async (argv) => {
3514
+ if (argv.verbose) console.log(`License: ${argv.package ?? "all"}`);
3515
+ process.exitCode = await license();
3516
+ }
3517
+ };
3518
+
3519
+ // src/xy/common/npmignoreGenCommand.ts
3520
+ var npmignoreGenCommand = {
3521
+ command: "npmignore-gen",
3522
+ describe: "NpmIgnore Gen - Generate .npmignore files",
3523
+ handler: (argv) => {
3524
+ if (argv.verbose) console.log("NpmIgnore Gen");
3525
+ process.exitCode = npmignoreGen();
3526
+ }
3527
+ };
3528
+
3529
+ // src/xy/common/readme/genCommand.ts
3530
+ var genCommand = {
3531
+ builder: (yargs2) => {
3532
+ return packagePositionalParam(yargs2).option("template", {
3533
+ alias: "t",
3534
+ description: "Path to README.template.md",
3535
+ type: "string"
3536
+ }).option("typedoc", {
3537
+ default: false,
3538
+ description: "Generate TypeDoc reference sections",
3539
+ type: "boolean"
3540
+ });
3541
+ },
3542
+ aliases: ["$0"],
3543
+ command: "gen [package]",
3544
+ describe: "Generate README.md files from template",
3545
+ handler: async (argv) => {
3546
+ if (argv.verbose) console.log("Readme Gen");
3547
+ process.exitCode = await readmeGen({
3548
+ pkg: argv.package,
3549
+ templatePath: argv.template,
3550
+ typedoc: argv.typedoc,
3551
+ verbose: !!argv.verbose
3552
+ });
3553
+ }
3554
+ };
3555
+
3556
+ // src/xy/common/readme/initCommand.ts
3557
+ var initCommand2 = {
3558
+ builder: (yargs2) => {
3559
+ return yargs2.option("template", {
3560
+ alias: "t",
3561
+ description: "Path to README.template.md",
3562
+ type: "string"
3563
+ });
3564
+ },
3565
+ command: "init",
3566
+ describe: "Initialize README template and logo files",
3567
+ handler: async (argv) => {
3568
+ if (argv.verbose) console.log("Readme Init");
3569
+ process.exitCode = await readmeInit({
3570
+ templatePath: argv.template,
3571
+ verbose: !!argv.verbose
3572
+ });
3573
+ }
3574
+ };
3575
+
3576
+ // src/xy/common/readme/index.ts
3577
+ var readmeCommand = {
3578
+ builder: (yargs2) => {
3579
+ return yargs2.command(genCommand).command(initCommand2);
3580
+ },
3581
+ command: "readme",
3582
+ describe: "Readme - README file utilities",
3583
+ handler: () => {
3584
+ }
3585
+ };
3586
+
3587
+ // src/xy/common/retestCommand.ts
3588
+ var retestCommand = {
3589
+ command: "retest",
3590
+ describe: "Re-Test - Run Jest Tests with cleaned cache",
3591
+ handler: (argv) => {
3592
+ if (argv.verbose) console.log("Re-Testing");
3593
+ process.exitCode = retest();
3594
+ }
3595
+ };
3596
+
3597
+ // src/xy/common/testCommand.ts
3598
+ var testCommand = {
3599
+ command: "test",
3600
+ describe: "Test - Run Jest Tests",
3601
+ handler: (argv) => {
3602
+ if (argv.verbose) console.log("Testing");
3603
+ process.exitCode = test();
3604
+ }
3605
+ };
3606
+
3607
+ // src/xy/common/upplugCommand.ts
3608
+ var upplugCommand = {
3609
+ command: "upplug",
3610
+ describe: "UpPlug - Update Yarn Plugins",
3611
+ handler: (argv) => {
3612
+ if (argv.verbose) console.log("UpPlug");
3613
+ process.exitCode = updateYarnPlugins();
3614
+ }
3615
+ };
3616
+
3617
+ // src/xy/common/upyarnCommand.ts
3618
+ var upyarnCommand = {
3619
+ command: "upyarn",
3620
+ describe: "UpYarn - Update Yarn Version",
3621
+ handler: (argv) => {
3622
+ if (argv.verbose) console.log("UpYarn");
3623
+ process.exitCode = updateYarnVersion();
3624
+ }
3625
+ };
3626
+
3627
+ // src/xy/common/yarn3OnlyCommand.ts
3628
+ var yarn3OnlyCommand = {
3629
+ command: "yarn3only",
3630
+ describe: "Yarn3Only - Check if using Yarn v3",
3631
+ handler: (argv) => {
3632
+ if (argv.verbose) console.log("Yarn 3 Check");
3633
+ process.exitCode = yarn3Only();
3634
+ }
3635
+ };
3636
+
3637
+ // src/xy/common/index.ts
3262
3638
  var xyCommonCommands = (args) => {
3263
- return args.command(
3264
- "claude-commands",
3265
- "Claude Commands - Sync XY Labs standard Claude slash commands to .claude/commands/",
3266
- (yargs2) => yargs2,
3267
- (argv) => {
3268
- if (argv.verbose) console.log("Claude Commands");
3269
- process.exitCode = claudeCommands();
3270
- }
3271
- ).command(
3272
- "claude-settings",
3273
- "Claude Settings - Initialize .claude/settings.local.json with XY Labs defaults",
3274
- (yargs2) => yargs2,
3275
- async (argv) => {
3276
- if (argv.verbose) console.log("Claude Settings");
3277
- process.exitCode = await claudeSettings();
3278
- }
3279
- ).command(
3280
- "claude-rules",
3281
- "Claude Rules - Sync XY Labs standard Claude rules to .claude/rules/",
3282
- (yargs2) => {
3283
- return yargs2.option("force", {
3284
- alias: "f",
3285
- default: false,
3286
- description: "Overwrite existing CLAUDE.md",
3287
- type: "boolean"
3288
- });
3289
- },
3290
- (argv) => {
3291
- if (argv.verbose) console.log("Claude Rules");
3292
- process.exitCode = claudeRules({ force: argv.force });
3293
- }
3294
- ).command(
3295
- "license [package]",
3296
- "License - Check licenses of dependencies",
3297
- (yargs2) => {
3298
- return packagePositionalParam(yargs2);
3299
- },
3300
- async (argv) => {
3301
- if (argv.verbose) console.log(`License: ${argv.package ?? "all"}`);
3302
- process.exitCode = await license();
3303
- }
3304
- ).command(
3305
- "dead [package]",
3306
- "Dead - Check for dead code",
3307
- (yargs2) => {
3308
- return packagePositionalParam(yargs2);
3309
- },
3310
- (argv) => {
3311
- if (argv.verbose) console.log("Dead");
3312
- process.exitCode = dead();
3313
- }
3314
- ).command(
3315
- "gen-docs [package]",
3316
- "GenDocs - Generate TypeDocs",
3317
- (yargs2) => {
3318
- return packagePositionalParam(yargs2);
3319
- },
3320
- (argv) => {
3321
- if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? "all"}`);
3322
- process.exitCode = genDocs({ incremental: !!argv.incremental, pkg: argv.package });
3323
- }
3324
- ).command(
3325
- "clean-docs",
3326
- "CleanDocs - Clean TypeDocs",
3327
- (yargs2) => yargs2,
3328
- (argv) => {
3329
- if (argv.verbose) console.log("Cleaning TypeDocs: all");
3330
- process.exitCode = cleanDocs();
3331
- }
3332
- ).command(
3333
- "gitlint [package]",
3334
- "Gitlint - Lint your git config",
3335
- (yargs2) => {
3336
- return yargs2;
3337
- },
3338
- (argv) => {
3339
- if (argv.verbose) console.log("Gitlint");
3340
- process.exitCode = argv.fix ? gitlintFix() : gitlint();
3341
- }
3342
- ).command(
3343
- "gitignore-gen",
3344
- "GitIgnore Gen - Generate .gitignore files",
3345
- (yargs2) => {
3346
- return yargs2;
3347
- },
3348
- (argv) => {
3349
- if (argv.verbose) console.log("GitIgnore Gen");
3350
- process.exitCode = gitignoreGen();
3351
- }
3352
- ).command(
3353
- "npmignore-gen",
3354
- "NpmIgnore Gen - Generate .npmignore files",
3355
- (yargs2) => {
3356
- return yargs2;
3357
- },
3358
- (argv) => {
3359
- if (argv.verbose) console.log("NpmIgnore Gen");
3360
- process.exitCode = npmignoreGen();
3361
- }
3362
- ).command(
3363
- "readme-gen [package]",
3364
- "Readme Gen - Generate README.md files from template",
3365
- (yargs2) => {
3366
- return packagePositionalParam(yargs2).option("template", {
3367
- alias: "t",
3368
- description: "Path to README.template.md",
3369
- type: "string"
3370
- }).option("typedoc", {
3371
- default: false,
3372
- description: "Generate TypeDoc reference sections",
3373
- type: "boolean"
3374
- });
3375
- },
3376
- async (argv) => {
3377
- if (argv.verbose) console.log("Readme Gen");
3378
- process.exitCode = await readmeGen({
3379
- pkg: argv.package,
3380
- templatePath: argv.template,
3381
- typedoc: argv.typedoc,
3382
- verbose: !!argv.verbose
3383
- });
3384
- }
3385
- ).command(
3386
- "retest",
3387
- "Re-Test - Run Jest Tests with cleaned cache",
3388
- (yargs2) => {
3389
- return yargs2;
3390
- },
3391
- (argv) => {
3392
- if (argv.verbose) console.log("Re-Testing");
3393
- process.exitCode = retest();
3394
- }
3395
- ).command(
3396
- "test",
3397
- "Test - Run Jest Tests",
3398
- (yargs2) => {
3399
- return yargs2;
3400
- },
3401
- (argv) => {
3402
- if (argv.verbose) console.log("Testing");
3403
- process.exitCode = test();
3404
- }
3405
- ).command(
3406
- "upplug",
3407
- "UpPlug - Update Yarn Plugins",
3408
- (yargs2) => {
3409
- return yargs2;
3410
- },
3411
- (argv) => {
3412
- if (argv.verbose) console.log("UpPlug");
3413
- process.exitCode = updateYarnPlugins();
3414
- }
3415
- ).command(
3416
- "upyarn",
3417
- "UpYarn - Update Yarn Version",
3418
- (yargs2) => {
3419
- return yargs2;
3420
- },
3421
- (argv) => {
3422
- if (argv.verbose) console.log("UpYarn");
3423
- process.exitCode = updateYarnVersion();
3424
- }
3425
- ).command(
3426
- "yarn3only",
3427
- "Yarn3Only - Check if using Yarn v3",
3428
- (yargs2) => {
3429
- return yargs2;
3430
- },
3431
- (argv) => {
3432
- if (argv.verbose) console.log("Yarn 3 Check");
3433
- process.exitCode = yarn3Only();
3434
- }
3435
- );
3639
+ 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);
3640
+ };
3641
+
3642
+ // src/xy/deploy/deployCommand.ts
3643
+ var deployCommand = {
3644
+ command: "deploy",
3645
+ describe: "Deploy - Deploy patch",
3646
+ handler: (argv) => {
3647
+ if (argv.verbose) console.log("Deploy patch");
3648
+ process.exitCode = deploy();
3649
+ }
3650
+ };
3651
+
3652
+ // src/xy/deploy/deployMajorCommand.ts
3653
+ var deployMajorCommand = {
3654
+ command: "deploy-major",
3655
+ describe: "Deploy - Deploy major",
3656
+ handler: (argv) => {
3657
+ if (argv.verbose) console.log("Deploy major");
3658
+ process.exitCode = deployMajor();
3659
+ }
3660
+ };
3661
+
3662
+ // src/xy/deploy/deployMinorCommand.ts
3663
+ var deployMinorCommand = {
3664
+ command: "deploy-minor",
3665
+ describe: "Deploy - Deploy minor",
3666
+ handler: (argv) => {
3667
+ if (argv.verbose) console.log("Deploy minor");
3668
+ process.exitCode = deployMinor();
3669
+ }
3670
+ };
3671
+
3672
+ // src/xy/deploy/deployNextCommand.ts
3673
+ var deployNextCommand = {
3674
+ command: "deploy-next",
3675
+ describe: "Deploy - Deploy next",
3676
+ handler: (argv) => {
3677
+ if (argv.verbose) console.log("Deploy next");
3678
+ process.exitCode = deployNext();
3679
+ }
3680
+ };
3681
+
3682
+ // src/xy/deploy/publishCommand.ts
3683
+ var publishCommand = {
3684
+ command: "publish",
3685
+ describe: "Publish - Publish packages to npmjs",
3686
+ handler: (argv) => {
3687
+ if (argv.verbose) console.log("Publish packages to npmjs");
3688
+ process.exitCode = publish();
3689
+ }
3436
3690
  };
3437
3691
 
3438
- // src/xy/xyDeployCommands.ts
3692
+ // src/xy/deploy/index.ts
3439
3693
  var xyDeployCommands = (args) => {
3440
- return args.command(
3441
- "deploy",
3442
- "Deploy - Deploy patch",
3443
- (yargs2) => {
3444
- return yargs2;
3445
- },
3446
- (argv) => {
3447
- if (argv.verbose) console.log("Deploy patch");
3448
- process.exitCode = deploy();
3449
- }
3450
- ).command(
3451
- "deploy-minor",
3452
- "Deploy - Deploy minor",
3453
- (yargs2) => {
3454
- return yargs2;
3455
- },
3456
- (argv) => {
3457
- if (argv.verbose) console.log("Deploy minor");
3458
- process.exitCode = deployMinor();
3459
- }
3460
- ).command(
3461
- "deploy-major",
3462
- "Deploy - Deploy major",
3463
- (yargs2) => {
3464
- return yargs2;
3465
- },
3466
- (argv) => {
3467
- if (argv.verbose) console.log("Deploy major");
3468
- process.exitCode = deployMajor();
3469
- }
3470
- ).command(
3471
- "deploy-next",
3472
- "Deploy - Deploy next",
3473
- (yargs2) => {
3474
- return yargs2;
3475
- },
3476
- (argv) => {
3477
- if (argv.verbose) console.log("Deploy next");
3478
- process.exitCode = deployNext();
3479
- }
3480
- ).command(
3481
- "publish",
3482
- "Publish - Publish packages to npmjs",
3483
- (yargs2) => {
3484
- return yargs2;
3485
- },
3486
- (argv) => {
3487
- if (argv.verbose) console.log("Publish packages to npmjs");
3488
- process.exitCode = publish();
3694
+ return args.command(deployCommand).command(deployMinorCommand).command(deployMajorCommand).command(deployNextCommand).command(publishCommand);
3695
+ };
3696
+
3697
+ // src/xy/install/cleanCommand.ts
3698
+ var cleanCommand = {
3699
+ command: "clean [package]",
3700
+ describe: "Clean",
3701
+ builder: (yargs2) => {
3702
+ return yargs2.positional("package", { describe: "Specific package to clean" });
3703
+ },
3704
+ handler: async (argv) => {
3705
+ if (argv.verbose) {
3706
+ console.log(`Cleaning: ${argv.package ?? "all"}`);
3489
3707
  }
3490
- );
3708
+ process.exitCode = await clean({
3709
+ pkg: argv.package,
3710
+ verbose: !!argv.verbose
3711
+ });
3712
+ }
3491
3713
  };
3492
3714
 
3493
- // src/xy/xyInstallCommands.ts
3715
+ // src/xy/install/dupdepsCommand.ts
3716
+ var dupdepsCommand = {
3717
+ command: "dupdeps",
3718
+ describe: "Dupdeps - Duplicate Dependencies in package.json",
3719
+ handler: (argv) => {
3720
+ if (argv.verbose) console.log("Dupdeps");
3721
+ process.exitCode = dupdeps();
3722
+ }
3723
+ };
3724
+
3725
+ // src/xy/install/reinstallCommand.ts
3726
+ var reinstallCommand = {
3727
+ command: "reinstall",
3728
+ describe: "Reinstall - Clean & Install",
3729
+ handler: (argv) => {
3730
+ if (argv.verbose) console.log("Reinstalling");
3731
+ process.exitCode = reinstall();
3732
+ }
3733
+ };
3734
+
3735
+ // src/xy/install/staticsCommand.ts
3736
+ var staticsCommand = {
3737
+ command: "statics",
3738
+ describe: "Statics - Confirming Static Packages",
3739
+ handler: (argv) => {
3740
+ if (argv.verbose) console.log("Statics");
3741
+ process.exitCode = statics();
3742
+ }
3743
+ };
3744
+
3745
+ // src/xy/install/upCommand.ts
3746
+ var upCommand = {
3747
+ command: "up",
3748
+ describe: "Up - Update dependencies",
3749
+ handler: (argv) => {
3750
+ if (argv.verbose) console.log("Up");
3751
+ process.exitCode = up();
3752
+ }
3753
+ };
3754
+
3755
+ // src/xy/install/updoCommand.ts
3756
+ var updoCommand = {
3757
+ command: "updo",
3758
+ describe: "Updo - Update dependencies [Interactive]",
3759
+ handler: (argv) => {
3760
+ if (argv.verbose) console.log("Updo");
3761
+ process.exitCode = updo();
3762
+ }
3763
+ };
3764
+
3765
+ // src/xy/install/index.ts
3494
3766
  var xyInstallCommands = (args) => {
3495
- return args.command(
3496
- "clean [package]",
3497
- "Clean",
3498
- (yargs2) => {
3499
- return yargs2.positional("package", { describe: "Specific package to clean" });
3500
- },
3501
- async (argv) => {
3502
- if (argv.verbose) {
3503
- console.log(`Cleaning: ${argv.package ?? "all"}`);
3504
- }
3505
- process.exitCode = await clean({
3506
- pkg: argv.package,
3507
- verbose: !!argv.verbose
3508
- });
3509
- }
3510
- ).command(
3511
- "reinstall",
3512
- "Reinstall - Clean & Install",
3513
- (yargs2) => {
3514
- return yargs2;
3515
- },
3516
- (argv) => {
3517
- if (argv.verbose) console.log("Reinstalling");
3518
- process.exitCode = reinstall();
3519
- }
3520
- ).command(
3521
- "up",
3522
- "Up - Update dependencies",
3523
- (yargs2) => {
3524
- return yargs2;
3525
- },
3526
- (argv) => {
3527
- if (argv.verbose) console.log("Up");
3528
- process.exitCode = up();
3529
- }
3530
- ).command(
3531
- "updo",
3532
- "Updo - Update dependencies [Interactive]",
3533
- (yargs2) => {
3534
- return yargs2;
3535
- },
3536
- (argv) => {
3537
- if (argv.verbose) console.log("Updo");
3538
- process.exitCode = updo();
3539
- }
3540
- ).command(
3541
- "statics",
3542
- "Statics - Confirming Static Packages",
3543
- (yargs2) => {
3544
- return yargs2;
3545
- },
3546
- (argv) => {
3547
- if (argv.verbose) console.log("Statics");
3548
- process.exitCode = statics();
3549
- }
3550
- ).command(
3551
- "dupdeps",
3552
- "Dupdeps - Duplicate Dependencies in package.json",
3553
- (yargs2) => {
3554
- return yargs2;
3555
- },
3556
- (argv) => {
3557
- if (argv.verbose) console.log("Dupdeps");
3558
- process.exitCode = dupdeps();
3559
- }
3560
- );
3767
+ return args.command(cleanCommand).command(reinstallCommand).command(upCommand).command(updoCommand).command(staticsCommand).command(dupdepsCommand);
3561
3768
  };
3562
3769
 
3563
- // src/xy/xyLintCommands.ts
3770
+ // src/xy/lint/cycleCommand.ts
3564
3771
  import chalk42 from "chalk";
3772
+ var cycleCommand = {
3773
+ command: "cycle [package]",
3774
+ describe: "Cycle - Check for dependency cycles",
3775
+ builder: (yargs2) => {
3776
+ return packagePositionalParam(yargs2);
3777
+ },
3778
+ handler: async (argv) => {
3779
+ const start = Date.now();
3780
+ if (argv.verbose) console.log("Cycle");
3781
+ process.exitCode = await cycle({ pkg: argv.package });
3782
+ console.log(chalk42.blue(`Finished in ${Date.now() - start}ms`));
3783
+ }
3784
+ };
3785
+
3786
+ // src/xy/lint/deplintCommand.ts
3787
+ import chalk43 from "chalk";
3788
+ var deplintCommand = {
3789
+ command: "deplint [package]",
3790
+ describe: "Deplint - Run Deplint",
3791
+ builder: (yargs2) => {
3792
+ return packagePositionalParam(yargs2).option("deps", {
3793
+ alias: "d",
3794
+ default: false,
3795
+ description: "Check dependencies",
3796
+ type: "boolean"
3797
+ }).option("devDeps", {
3798
+ alias: "v",
3799
+ default: false,
3800
+ description: "Check devDependencies",
3801
+ type: "boolean"
3802
+ }).option("peerDeps", {
3803
+ alias: "p",
3804
+ default: false,
3805
+ description: "Check peerDependencies",
3806
+ type: "boolean"
3807
+ }).option("exclude", {
3808
+ alias: "e",
3809
+ description: "Package names to exclude from unused checks (comma-separated or repeated)",
3810
+ type: "array"
3811
+ });
3812
+ },
3813
+ handler: async (argv) => {
3814
+ if (argv.verbose) console.log("Deplint");
3815
+ const start = Date.now();
3816
+ const cliExclude = argv.exclude?.flatMap((v) => String(v).split(",")).map((v) => v.trim()).filter(Boolean);
3817
+ process.exitCode = await deplint({
3818
+ cliExclude,
3819
+ pkg: argv.package,
3820
+ deps: !!argv.deps,
3821
+ devDeps: !!argv.devDeps,
3822
+ peerDeps: !!argv.peerDeps,
3823
+ verbose: !!argv.verbose
3824
+ });
3825
+ console.log(chalk43.blue(`Finished in ${Date.now() - start}ms`));
3826
+ }
3827
+ };
3828
+
3829
+ // src/xy/lint/fixCommand.ts
3830
+ import chalk44 from "chalk";
3831
+ var fixCommand = {
3832
+ command: "fix [package]",
3833
+ describe: "Fix - Run Eslint w/fix",
3834
+ builder: (yargs2) => {
3835
+ return packagePositionalParam(yargs2);
3836
+ },
3837
+ handler: (argv) => {
3838
+ const start = Date.now();
3839
+ if (argv.verbose) console.log("Fix");
3840
+ process.exitCode = fix();
3841
+ console.log(chalk44.blue(`Finished in ${Date.now() - start}ms`));
3842
+ }
3843
+ };
3844
+
3845
+ // src/xy/lint/knipCommand.ts
3846
+ import chalk45 from "chalk";
3847
+ var knipCommand = {
3848
+ command: "knip",
3849
+ describe: "Knip - Run Knip",
3850
+ builder: (yargs2) => {
3851
+ return packagePositionalParam(yargs2);
3852
+ },
3853
+ handler: (argv) => {
3854
+ if (argv.verbose) console.log("Knip");
3855
+ const start = Date.now();
3856
+ process.exitCode = knip();
3857
+ console.log(chalk45.blue(`Knip finished in ${Date.now() - start}ms`));
3858
+ }
3859
+ };
3860
+
3861
+ // src/xy/lint/lintCommand.ts
3862
+ import chalk46 from "chalk";
3863
+ var lintCommand = {
3864
+ command: "lint [package]",
3865
+ describe: "Lint - Run Eslint",
3866
+ builder: (yargs2) => {
3867
+ return packagePositionalParam(yargs2).option("fix", {
3868
+ alias: "f",
3869
+ default: false,
3870
+ description: "Fix fixable issues",
3871
+ type: "boolean"
3872
+ }).option("cache", {
3873
+ alias: "c",
3874
+ default: false,
3875
+ description: "Use caching for performance",
3876
+ type: "boolean"
3877
+ });
3878
+ },
3879
+ handler: (argv) => {
3880
+ if (argv.verbose) console.log("Lint");
3881
+ const start = Date.now();
3882
+ process.exitCode = argv.fix ? fix({
3883
+ pkg: argv.package,
3884
+ cache: argv.cache,
3885
+ verbose: !!argv.verbose
3886
+ }) : lint({
3887
+ pkg: argv.package,
3888
+ cache: argv.cache,
3889
+ verbose: !!argv.verbose
3890
+ });
3891
+ console.log(chalk46.blue(`Finished in ${Date.now() - start}ms`));
3892
+ }
3893
+ };
3894
+
3895
+ // src/xy/lint/publintCommand.ts
3896
+ import chalk47 from "chalk";
3897
+ var publintCommand = {
3898
+ command: "publint [package]",
3899
+ describe: "Publint - Run Publint",
3900
+ builder: (yargs2) => {
3901
+ return packagePositionalParam(yargs2);
3902
+ },
3903
+ handler: async (argv) => {
3904
+ if (argv.verbose) console.log("Publint");
3905
+ const start = Date.now();
3906
+ process.exitCode = await publint({ pkg: argv.package, verbose: !!argv.verbose });
3907
+ console.log(chalk47.blue(`Finished in ${Date.now() - start}ms`));
3908
+ }
3909
+ };
3910
+
3911
+ // src/xy/lint/relintCommand.ts
3912
+ import chalk48 from "chalk";
3913
+ var relintCommand = {
3914
+ command: "relint [package]",
3915
+ describe: "Relint - Clean & Lint",
3916
+ builder: (yargs2) => {
3917
+ return packagePositionalParam(yargs2);
3918
+ },
3919
+ handler: (argv) => {
3920
+ if (argv.verbose) console.log("Relinting");
3921
+ const start = Date.now();
3922
+ process.exitCode = relint();
3923
+ console.log(chalk48.blue(`Finished in ${Date.now() - start}ms`));
3924
+ }
3925
+ };
3926
+
3927
+ // src/xy/lint/sonarCommand.ts
3928
+ import chalk49 from "chalk";
3929
+ var sonarCommand = {
3930
+ command: "sonar",
3931
+ describe: "Sonar - Run Sonar Check",
3932
+ builder: (yargs2) => {
3933
+ return packagePositionalParam(yargs2);
3934
+ },
3935
+ handler: (argv) => {
3936
+ const start = Date.now();
3937
+ if (argv.verbose) console.log("Sonar Check");
3938
+ process.exitCode = sonar();
3939
+ console.log(chalk49.blue(`Finished in ${Date.now() - start}ms`));
3940
+ }
3941
+ };
3942
+
3943
+ // src/xy/lint/index.ts
3565
3944
  var xyLintCommands = (args) => {
3566
- return args.command(
3567
- "cycle [package]",
3568
- "Cycle - Check for dependency cycles",
3569
- (yargs2) => {
3570
- return packagePositionalParam(yargs2);
3571
- },
3572
- async (argv) => {
3573
- const start = Date.now();
3574
- if (argv.verbose) console.log("Cycle");
3575
- process.exitCode = await cycle({ pkg: argv.package });
3576
- console.log(chalk42.blue(`Finished in ${Date.now() - start}ms`));
3577
- }
3578
- ).command(
3579
- "lint [package]",
3580
- "Lint - Run Eslint",
3581
- (yargs2) => {
3582
- return packagePositionalParam(yargs2).option("fix", {
3583
- alias: "f",
3584
- default: false,
3585
- description: "Fix fixable issues",
3586
- type: "boolean"
3587
- }).option("cache", {
3588
- alias: "c",
3589
- default: false,
3590
- description: "Use caching for performance",
3591
- type: "boolean"
3592
- });
3593
- },
3594
- (argv) => {
3595
- if (argv.verbose) console.log("Lint");
3596
- const start = Date.now();
3597
- process.exitCode = argv.fix ? fix({
3598
- pkg: argv.package,
3599
- cache: argv.cache,
3600
- verbose: !!argv.verbose
3601
- }) : lint({
3602
- pkg: argv.package,
3603
- cache: argv.cache,
3604
- verbose: !!argv.verbose
3605
- });
3606
- console.log(chalk42.blue(`Finished in ${Date.now() - start}ms`));
3607
- }
3608
- ).command(
3609
- "deplint [package]",
3610
- "Deplint - Run Deplint",
3611
- (yargs2) => {
3612
- return packagePositionalParam(yargs2).option("deps", {
3613
- alias: "d",
3614
- default: false,
3615
- description: "Check dependencies",
3616
- type: "boolean"
3617
- }).option("devDeps", {
3618
- alias: "v",
3619
- default: false,
3620
- description: "Check devDependencies",
3621
- type: "boolean"
3622
- }).option("peerDeps", {
3623
- alias: "p",
3624
- default: false,
3625
- description: "Check peerDependencies",
3626
- type: "boolean"
3627
- }).option("exclude", {
3628
- alias: "e",
3629
- description: "Package names to exclude from unused checks (comma-separated or repeated)",
3630
- type: "array"
3631
- });
3632
- },
3633
- async (argv) => {
3634
- if (argv.verbose) console.log("Deplint");
3635
- const start = Date.now();
3636
- const cliExclude = argv.exclude?.flatMap((v) => String(v).split(",")).map((v) => v.trim()).filter(Boolean);
3637
- process.exitCode = await deplint({
3638
- cliExclude,
3639
- pkg: argv.package,
3640
- deps: !!argv.deps,
3641
- devDeps: !!argv.devDeps,
3642
- peerDeps: !!argv.peerDeps,
3643
- verbose: !!argv.verbose
3644
- });
3645
- console.log(chalk42.blue(`Finished in ${Date.now() - start}ms`));
3646
- }
3647
- ).command(
3648
- "fix [package]",
3649
- "Fix - Run Eslint w/fix",
3650
- (yargs2) => {
3651
- return packagePositionalParam(yargs2);
3652
- },
3653
- (argv) => {
3654
- const start = Date.now();
3655
- if (argv.verbose) console.log("Fix");
3656
- process.exitCode = fix();
3657
- console.log(chalk42.blue(`Finished in ${Date.now() - start}ms`));
3658
- }
3659
- ).command(
3660
- "relint [package]",
3661
- "Relint - Clean & Lint",
3662
- (yargs2) => {
3663
- return packagePositionalParam(yargs2);
3664
- },
3665
- (argv) => {
3666
- if (argv.verbose) console.log("Relinting");
3667
- const start = Date.now();
3668
- process.exitCode = relint();
3669
- console.log(chalk42.blue(`Finished in ${Date.now() - start}ms`));
3670
- }
3671
- ).command(
3672
- "publint [package]",
3673
- "Publint - Run Publint",
3674
- (yargs2) => {
3675
- return packagePositionalParam(yargs2);
3676
- },
3677
- async (argv) => {
3678
- if (argv.verbose) console.log("Publint");
3679
- const start = Date.now();
3680
- process.exitCode = await publint({ pkg: argv.package, verbose: !!argv.verbose });
3681
- console.log(chalk42.blue(`Finished in ${Date.now() - start}ms`));
3682
- }
3683
- ).command(
3684
- "knip",
3685
- "Knip - Run Knip",
3686
- (yargs2) => {
3687
- return packagePositionalParam(yargs2);
3688
- },
3689
- (argv) => {
3690
- if (argv.verbose) console.log("Knip");
3691
- const start = Date.now();
3692
- process.exitCode = knip();
3693
- console.log(chalk42.blue(`Knip finished in ${Date.now() - start}ms`));
3694
- }
3695
- ).command(
3696
- "sonar",
3697
- "Sonar - Run Sonar Check",
3698
- (yargs2) => {
3699
- return packagePositionalParam(yargs2);
3700
- },
3701
- (argv) => {
3702
- const start = Date.now();
3703
- if (argv.verbose) console.log("Sonar Check");
3704
- process.exitCode = sonar();
3705
- console.log(chalk42.blue(`Finished in ${Date.now() - start}ms`));
3706
- }
3707
- );
3945
+ return args.command(cycleCommand).command(lintCommand).command(deplintCommand).command(fixCommand).command(relintCommand).command(publintCommand).command(knipCommand).command(sonarCommand);
3708
3946
  };
3709
3947
 
3948
+ // src/xy/xy.ts
3949
+ import chalk50 from "chalk";
3950
+
3710
3951
  // src/xy/xyParseOptions.ts
3711
3952
  import yargs from "yargs";
3712
3953
  import { hideBin } from "yargs/helpers";
@@ -3738,17 +3979,20 @@ var xyParseOptions = () => {
3738
3979
  var xy = async () => {
3739
3980
  const options = xyParseOptions();
3740
3981
  return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
3741
- console.error(chalk43.yellow(`Command not found [${chalk43.magenta(process.argv[2])}]`));
3742
- console.log(chalk43.gray("Try 'yarn xy --help' for list of commands"));
3982
+ console.error(chalk50.yellow(`Command not found [${chalk50.magenta(process.argv[2])}]`));
3983
+ console.log(chalk50.gray("Try 'yarn xy --help' for list of commands"));
3743
3984
  }).version().help().argv;
3744
3985
  };
3745
3986
  export {
3746
3987
  CROSS_PLATFORM_NEWLINE,
3988
+ DEFAULT_README_BODY,
3989
+ DEFAULT_README_TEMPLATE,
3747
3990
  DuplicateDetector,
3748
3991
  INIT_CWD,
3749
3992
  WINDOWS_NEWLINE_REGEX,
3750
3993
  XYLABS_COMMANDS_PREFIX,
3751
3994
  XYLABS_RULES_PREFIX,
3995
+ applyLogoConfig,
3752
3996
  build,
3753
3997
  bundleDts,
3754
3998
  checkResult,
@@ -3824,6 +4068,7 @@ export {
3824
4068
  readLines,
3825
4069
  readNonEmptyLines,
3826
4070
  readmeGen,
4071
+ readmeInit,
3827
4072
  rebuild,
3828
4073
  recompile,
3829
4074
  recompileAll,
@@ -3832,6 +4077,7 @@ export {
3832
4077
  relint,
3833
4078
  relintAllPackages,
3834
4079
  relintPackage,
4080
+ resolveTemplatePath,
3835
4081
  retest,
3836
4082
  runStepAsync,
3837
4083
  runSteps,
@@ -3840,6 +4086,7 @@ export {
3840
4086
  runXyWithWarning,
3841
4087
  safeExit,
3842
4088
  safeExitAsync,
4089
+ scaffoldTemplate,
3843
4090
  sonar,
3844
4091
  statics,
3845
4092
  test,