@xylabs/ts-scripts-yarn3 7.4.17 → 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 (199) 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/deplint/checkPackage/checkPackage.mjs +3 -0
  11. package/dist/actions/deplint/checkPackage/checkPackage.mjs.map +1 -1
  12. package/dist/actions/deplint/checkPackage/index.mjs +3 -0
  13. package/dist/actions/deplint/checkPackage/index.mjs.map +1 -1
  14. package/dist/actions/deplint/deplint.mjs +3 -0
  15. package/dist/actions/deplint/deplint.mjs.map +1 -1
  16. package/dist/actions/deplint/getExternalImportsFromFiles.mjs +3 -0
  17. package/dist/actions/deplint/getExternalImportsFromFiles.mjs.map +1 -1
  18. package/dist/actions/deplint/getImportsFromFile.mjs +3 -0
  19. package/dist/actions/deplint/getImportsFromFile.mjs.map +1 -1
  20. package/dist/actions/deplint/index.mjs +3 -0
  21. package/dist/actions/deplint/index.mjs.map +1 -1
  22. package/dist/actions/deploy-major.mjs.map +1 -1
  23. package/dist/actions/deploy-minor.mjs.map +1 -1
  24. package/dist/actions/deploy-next.mjs.map +1 -1
  25. package/dist/actions/deploy.mjs.map +1 -1
  26. package/dist/actions/fix.mjs.map +1 -1
  27. package/dist/actions/gen-docs.mjs.map +1 -1
  28. package/dist/actions/index.mjs +149 -41
  29. package/dist/actions/index.mjs.map +1 -1
  30. package/dist/actions/knip.mjs.map +1 -1
  31. package/dist/actions/lint.mjs.map +1 -1
  32. package/dist/actions/publint.mjs.map +1 -1
  33. package/dist/actions/publish.mjs.map +1 -1
  34. package/dist/actions/readme-gen.mjs +136 -20
  35. package/dist/actions/readme-gen.mjs.map +1 -1
  36. package/dist/actions/readme-init.mjs +83 -0
  37. package/dist/actions/readme-init.mjs.map +1 -0
  38. package/dist/actions/rebuild.mjs.map +1 -1
  39. package/dist/actions/reinstall.mjs.map +1 -1
  40. package/dist/actions/relint.mjs.map +1 -1
  41. package/dist/actions/retest.mjs +2 -2
  42. package/dist/actions/retest.mjs.map +1 -1
  43. package/dist/actions/sonar.mjs.map +1 -1
  44. package/dist/actions/test.mjs.map +1 -1
  45. package/dist/actions/up.mjs.map +1 -1
  46. package/dist/actions/updo.mjs.map +1 -1
  47. package/dist/actions/upplug.mjs.map +1 -1
  48. package/dist/actions/upyarn.mjs.map +1 -1
  49. package/dist/bin/xy.mjs +820 -576
  50. package/dist/bin/xy.mjs.map +1 -1
  51. package/dist/index.d.ts +42 -13
  52. package/dist/index.mjs +823 -573
  53. package/dist/index.mjs.map +1 -1
  54. package/dist/lib/claudeMdTemplate.mjs +1 -1
  55. package/dist/lib/claudeMdTemplate.mjs.map +1 -1
  56. package/dist/lib/generateReadmeFiles.mjs +118 -21
  57. package/dist/lib/generateReadmeFiles.mjs.map +1 -1
  58. package/dist/lib/index.mjs +120 -23
  59. package/dist/lib/index.mjs.map +1 -1
  60. package/dist/lib/runSteps.mjs.map +1 -1
  61. package/dist/lib/runXy.mjs.map +1 -1
  62. package/dist/xy/build/buildCommand.mjs +161 -0
  63. package/dist/xy/build/buildCommand.mjs.map +1 -0
  64. package/dist/xy/build/compileCommand.mjs +174 -0
  65. package/dist/xy/build/compileCommand.mjs.map +1 -0
  66. package/dist/xy/build/compileOnlyCommand.mjs +175 -0
  67. package/dist/xy/build/compileOnlyCommand.mjs.map +1 -0
  68. package/dist/xy/build/copyAssetsCommand.mjs +84 -0
  69. package/dist/xy/build/copyAssetsCommand.mjs.map +1 -0
  70. package/dist/xy/{xyBuildCommands.mjs → build/index.mjs} +111 -93
  71. package/dist/xy/build/index.mjs.map +1 -0
  72. package/dist/xy/build/rebuildCommand.mjs +114 -0
  73. package/dist/xy/build/rebuildCommand.mjs.map +1 -0
  74. package/dist/xy/build/recompileCommand.mjs +204 -0
  75. package/dist/xy/build/recompileCommand.mjs.map +1 -0
  76. package/dist/xy/common/claude/commandsCommand.mjs +107 -0
  77. package/dist/xy/common/claude/commandsCommand.mjs.map +1 -0
  78. package/dist/xy/common/claude/index.mjs +332 -0
  79. package/dist/xy/common/claude/index.mjs.map +1 -0
  80. package/dist/xy/common/claude/initCommand.mjs +283 -0
  81. package/dist/xy/common/claude/initCommand.mjs.map +1 -0
  82. package/dist/xy/common/claude/rulesCommand.mjs +129 -0
  83. package/dist/xy/common/claude/rulesCommand.mjs.map +1 -0
  84. package/dist/xy/common/claude/settingsCommand.mjs +90 -0
  85. package/dist/xy/common/claude/settingsCommand.mjs.map +1 -0
  86. package/dist/xy/common/cleanDocsCommand.mjs +45 -0
  87. package/dist/xy/common/cleanDocsCommand.mjs.map +1 -0
  88. package/dist/xy/common/deadCommand.mjs +116 -0
  89. package/dist/xy/common/deadCommand.mjs.map +1 -0
  90. package/dist/xy/common/genDocsCommand.mjs +125 -0
  91. package/dist/xy/common/genDocsCommand.mjs.map +1 -0
  92. package/dist/xy/common/gitignoreGenCommand.mjs +98 -0
  93. package/dist/xy/common/gitignoreGenCommand.mjs.map +1 -0
  94. package/dist/xy/common/gitlintCommand.mjs +82 -0
  95. package/dist/xy/common/gitlintCommand.mjs.map +1 -0
  96. package/dist/xy/{xyCommonCommands.mjs → common/index.mjs} +451 -241
  97. package/dist/xy/common/index.mjs.map +1 -0
  98. package/dist/xy/common/licenseCommand.mjs +100 -0
  99. package/dist/xy/common/licenseCommand.mjs.map +1 -0
  100. package/dist/xy/common/npmignoreGenCommand.mjs +98 -0
  101. package/dist/xy/common/npmignoreGenCommand.mjs.map +1 -0
  102. package/dist/xy/common/readme/genCommand.mjs +321 -0
  103. package/dist/xy/common/readme/genCommand.mjs.map +1 -0
  104. package/dist/xy/common/readme/index.mjs +361 -0
  105. package/dist/xy/common/readme/index.mjs.map +1 -0
  106. package/dist/xy/common/readme/initCommand.mjs +103 -0
  107. package/dist/xy/common/readme/initCommand.mjs.map +1 -0
  108. package/dist/xy/common/retestCommand.mjs +111 -0
  109. package/dist/xy/common/retestCommand.mjs.map +1 -0
  110. package/dist/xy/common/testCommand.mjs +108 -0
  111. package/dist/xy/common/testCommand.mjs.map +1 -0
  112. package/dist/xy/common/upplugCommand.mjs +113 -0
  113. package/dist/xy/common/upplugCommand.mjs.map +1 -0
  114. package/dist/xy/common/upyarnCommand.mjs +108 -0
  115. package/dist/xy/common/upyarnCommand.mjs.map +1 -0
  116. package/dist/xy/common/yarn3OnlyCommand.mjs +70 -0
  117. package/dist/xy/common/yarn3OnlyCommand.mjs.map +1 -0
  118. package/dist/xy/deploy/deployCommand.mjs +139 -0
  119. package/dist/xy/deploy/deployCommand.mjs.map +1 -0
  120. package/dist/xy/deploy/deployMajorCommand.mjs +139 -0
  121. package/dist/xy/deploy/deployMajorCommand.mjs.map +1 -0
  122. package/dist/xy/deploy/deployMinorCommand.mjs +139 -0
  123. package/dist/xy/deploy/deployMinorCommand.mjs.map +1 -0
  124. package/dist/xy/deploy/deployNextCommand.mjs +139 -0
  125. package/dist/xy/deploy/deployNextCommand.mjs.map +1 -0
  126. package/dist/xy/{xyDeployCommands.mjs → deploy/index.mjs} +53 -53
  127. package/dist/xy/deploy/index.mjs.map +1 -0
  128. package/dist/xy/deploy/publishCommand.mjs +108 -0
  129. package/dist/xy/deploy/publishCommand.mjs.map +1 -0
  130. package/dist/xy/index.mjs +820 -576
  131. package/dist/xy/index.mjs.map +1 -1
  132. package/dist/xy/install/cleanCommand.mjs +140 -0
  133. package/dist/xy/install/cleanCommand.mjs.map +1 -0
  134. package/dist/xy/install/dupdepsCommand.mjs +191 -0
  135. package/dist/xy/install/dupdepsCommand.mjs.map +1 -0
  136. package/dist/xy/{xyInstallCommands.mjs → install/index.mjs} +71 -68
  137. package/dist/xy/install/index.mjs.map +1 -0
  138. package/dist/xy/install/reinstallCommand.mjs +140 -0
  139. package/dist/xy/install/reinstallCommand.mjs.map +1 -0
  140. package/dist/xy/install/staticsCommand.mjs +191 -0
  141. package/dist/xy/install/staticsCommand.mjs.map +1 -0
  142. package/dist/{actions/clean-jest.mjs → xy/install/upCommand.mjs} +15 -6
  143. package/dist/xy/install/upCommand.mjs.map +1 -0
  144. package/dist/xy/install/updoCommand.mjs +112 -0
  145. package/dist/xy/install/updoCommand.mjs.map +1 -0
  146. package/dist/xy/lint/cycleCommand.mjs +163 -0
  147. package/dist/xy/lint/cycleCommand.mjs.map +1 -0
  148. package/dist/xy/lint/deplintCommand.mjs +814 -0
  149. package/dist/xy/lint/deplintCommand.mjs.map +1 -0
  150. package/dist/xy/lint/fixCommand.mjs +168 -0
  151. package/dist/xy/lint/fixCommand.mjs.map +1 -0
  152. package/dist/xy/{xyLintCommands.mjs → lint/index.mjs} +179 -145
  153. package/dist/xy/lint/index.mjs.map +1 -0
  154. package/dist/xy/lint/knipCommand.mjs +121 -0
  155. package/dist/xy/lint/knipCommand.mjs.map +1 -0
  156. package/dist/xy/lint/lintCommand.mjs +186 -0
  157. package/dist/xy/lint/lintCommand.mjs.map +1 -0
  158. package/dist/xy/lint/publintCommand.mjs +187 -0
  159. package/dist/xy/lint/publintCommand.mjs.map +1 -0
  160. package/dist/xy/lint/relintCommand.mjs +163 -0
  161. package/dist/xy/lint/relintCommand.mjs.map +1 -0
  162. package/dist/xy/lint/sonarCommand.mjs +121 -0
  163. package/dist/xy/lint/sonarCommand.mjs.map +1 -0
  164. package/dist/xy/xy.mjs +818 -574
  165. package/dist/xy/xy.mjs.map +1 -1
  166. package/package.json +2 -2
  167. package/templates/readme/README.body.md +11 -0
  168. package/templates/readme/README.template.md +22 -0
  169. package/dist/actions/clean-jest.mjs.map +0 -1
  170. package/dist/xy/xyBuildCommands.mjs.map +0 -1
  171. package/dist/xy/xyCommonCommands.mjs.map +0 -1
  172. package/dist/xy/xyDeployCommands.mjs.map +0 -1
  173. package/dist/xy/xyInstallCommands.mjs.map +0 -1
  174. package/dist/xy/xyLintCommands.mjs.map +0 -1
  175. /package/templates/{CLAUDE-project.md → claude/CLAUDE-project.md} +0 -0
  176. /package/templates/{commands → claude/commands}/xylabs-build.md +0 -0
  177. /package/templates/{commands → claude/commands}/xylabs-clean.md +0 -0
  178. /package/templates/{commands → claude/commands}/xylabs-compile.md +0 -0
  179. /package/templates/{commands → claude/commands}/xylabs-cycle.md +0 -0
  180. /package/templates/{commands → claude/commands}/xylabs-deplint.md +0 -0
  181. /package/templates/{commands → claude/commands}/xylabs-deploy-major.md +0 -0
  182. /package/templates/{commands → claude/commands}/xylabs-deploy-minor.md +0 -0
  183. /package/templates/{commands → claude/commands}/xylabs-deploy.md +0 -0
  184. /package/templates/{commands → claude/commands}/xylabs-fix.md +0 -0
  185. /package/templates/{commands → claude/commands}/xylabs-knip.md +0 -0
  186. /package/templates/{commands → claude/commands}/xylabs-lint.md +0 -0
  187. /package/templates/{commands → claude/commands}/xylabs-publint.md +0 -0
  188. /package/templates/{commands → claude/commands}/xylabs-rebuild.md +0 -0
  189. /package/templates/{commands → claude/commands}/xylabs-test.md +0 -0
  190. /package/templates/{rules → claude/rules}/xylabs-architecture.md +0 -0
  191. /package/templates/{rules → claude/rules}/xylabs-build.md +0 -0
  192. /package/templates/{rules → claude/rules}/xylabs-dependencies.md +0 -0
  193. /package/templates/{rules → claude/rules}/xylabs-error-handling.md +0 -0
  194. /package/templates/{rules → claude/rules}/xylabs-frameworks.md +0 -0
  195. /package/templates/{rules → claude/rules}/xylabs-git-workflow.md +0 -0
  196. /package/templates/{rules → claude/rules}/xylabs-linting.md +0 -0
  197. /package/templates/{rules → claude/rules}/xylabs-naming.md +0 -0
  198. /package/templates/{rules → claude/rules}/xylabs-style.md +0 -0
  199. /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) {
@@ -1224,6 +1316,9 @@ function getImportsFromFile(filePath, importPaths, typeImportPaths) {
1224
1316
  ts.forEachChild(node, visit);
1225
1317
  }
1226
1318
  visit(sourceFile);
1319
+ for (const ref of sourceFile.typeReferenceDirectives) {
1320
+ typeImports.push(ref.fileName);
1321
+ }
1227
1322
  const importsStartsWithExcludes = [".", "#", "node:"];
1228
1323
  const isValidImport = (imp) => !importsStartsWithExcludes.some((exc) => imp.startsWith(exc)) && !imp.includes("*") && !imp.includes("!");
1229
1324
  const cleanedImports = imports.filter(isValidImport).map(getBasePackageName);
@@ -1795,11 +1890,11 @@ var deplint = async ({
1795
1890
  };
1796
1891
 
1797
1892
  // src/actions/deploy.ts
1798
- import { readFileSync as readFileSync8 } from "fs";
1893
+ import { readFileSync as readFileSync9 } from "fs";
1799
1894
  var privatePackageExcludeList = () => {
1800
1895
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1801
1896
  workspace,
1802
- JSON.parse(readFileSync8(`${workspace.location}/package.json`, { encoding: "utf8" }))
1897
+ JSON.parse(readFileSync9(`${workspace.location}/package.json`, { encoding: "utf8" }))
1803
1898
  ]);
1804
1899
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1805
1900
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -1819,11 +1914,11 @@ var deploy = () => {
1819
1914
  };
1820
1915
 
1821
1916
  // src/actions/deploy-major.ts
1822
- import { readFileSync as readFileSync9 } from "fs";
1917
+ import { readFileSync as readFileSync10 } from "fs";
1823
1918
  var privatePackageExcludeList2 = () => {
1824
1919
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1825
1920
  workspace,
1826
- JSON.parse(readFileSync9(`${workspace.location}/package.json`, { encoding: "utf8" }))
1921
+ JSON.parse(readFileSync10(`${workspace.location}/package.json`, { encoding: "utf8" }))
1827
1922
  ]);
1828
1923
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1829
1924
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -1843,11 +1938,11 @@ var deployMajor = () => {
1843
1938
  };
1844
1939
 
1845
1940
  // src/actions/deploy-minor.ts
1846
- import { readFileSync as readFileSync10 } from "fs";
1941
+ import { readFileSync as readFileSync11 } from "fs";
1847
1942
  var privatePackageExcludeList3 = () => {
1848
1943
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1849
1944
  workspace,
1850
- JSON.parse(readFileSync10(`${workspace.location}/package.json`, { encoding: "utf8" }))
1945
+ JSON.parse(readFileSync11(`${workspace.location}/package.json`, { encoding: "utf8" }))
1851
1946
  ]);
1852
1947
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1853
1948
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -1867,11 +1962,11 @@ var deployMinor = () => {
1867
1962
  };
1868
1963
 
1869
1964
  // src/actions/deploy-next.ts
1870
- import { readFileSync as readFileSync11 } from "fs";
1965
+ import { readFileSync as readFileSync12 } from "fs";
1871
1966
  var privatePackageExcludeList4 = () => {
1872
1967
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1873
1968
  workspace,
1874
- JSON.parse(readFileSync11(`${workspace.location}/package.json`, { encoding: "utf8" }))
1969
+ JSON.parse(readFileSync12(`${workspace.location}/package.json`, { encoding: "utf8" }))
1875
1970
  ]);
1876
1971
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1877
1972
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -2915,7 +3010,10 @@ async function readmeGen({
2915
3010
  typedoc,
2916
3011
  verbose
2917
3012
  }) {
3013
+ const config2 = await loadConfig();
2918
3014
  return await generateReadmeFiles({
3015
+ logoLinkUrl: config2.readme?.logoLinkUrl,
3016
+ logoUrl: config2.readme?.logoUrl,
2919
3017
  pkg,
2920
3018
  templatePath,
2921
3019
  typedoc,
@@ -2923,6 +3021,15 @@ async function readmeGen({
2923
3021
  });
2924
3022
  }
2925
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
+
2926
3033
  // src/actions/rebuild.ts
2927
3034
  var rebuild = ({ target }) => {
2928
3035
  return runSteps("Rebuild", [
@@ -3079,8 +3186,8 @@ var relintAllPackages = ({ fix: fix2 = false } = {}) => {
3079
3186
  // src/actions/retest.ts
3080
3187
  var retest = () => {
3081
3188
  return runSteps("Test", [
3082
- ["yarn", ["jest", "--clearCache"]],
3083
- ["yarn", ["jest", "."]]
3189
+ ["yarn", ["vitest", "--clearCache"]],
3190
+ ["yarn", ["vitest", "."]]
3084
3191
  ]);
3085
3192
  };
3086
3193
 
@@ -3149,105 +3256,200 @@ var loadPackageConfig = async () => {
3149
3256
  return JSON.parse(pkgConfig);
3150
3257
  };
3151
3258
 
3152
- // src/xy/xy.ts
3153
- import chalk43 from "chalk";
3154
-
3155
- // src/xy/xyBuildCommands.ts
3156
- var xyBuildCommands = (args) => {
3157
- return args.command(
3158
- "build [package]",
3159
- "Build - Compile & Lint",
3160
- (yargs2) => {
3161
- return yargs2.positional("package", { describe: "Specific package to build" });
3162
- },
3163
- async (argv) => {
3164
- if (argv.verbose) {
3165
- console.log(`Building: ${argv.package ?? "all"}`);
3166
- }
3167
- process.exitCode = await build({
3168
- incremental: !!argv.incremental,
3169
- jobs: argv.jobs,
3170
- pkg: argv.package,
3171
- target: argv.target,
3172
- verbose: !!argv.verbose
3173
- });
3174
- }
3175
- ).command(
3176
- "compile [package]",
3177
- "Compile with Typescript & Copy Images",
3178
- (yargs2) => {
3179
- return yargs2.positional("package", { describe: "Specific package to compile" });
3180
- },
3181
- (argv) => {
3182
- if (argv.verbose) {
3183
- console.log(`Compiling: ${argv.package ?? "all"}`);
3184
- }
3185
- process.exitCode = compile({
3186
- incremental: !!argv.incremental,
3187
- jobs: argv.jobs,
3188
- pkg: argv.package,
3189
- target: argv.target,
3190
- verbose: !!argv.verbose
3191
- });
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"}`);
3192
3269
  }
3193
- ).command(
3194
- "compile-only [package]",
3195
- "Compile with Typescript & Copy Images (No Publint)",
3196
- (yargs2) => {
3197
- return yargs2.positional("package", { describe: "Specific package to compile" });
3198
- },
3199
- (argv) => {
3200
- if (argv.verbose) {
3201
- console.log(`Compiling: ${argv.package ?? "all"}`);
3202
- }
3203
- process.exitCode = compile({
3204
- incremental: !!argv.incremental,
3205
- jobs: argv.jobs,
3206
- pkg: argv.package,
3207
- publint: false,
3208
- target: argv.target,
3209
- verbose: !!argv.verbose
3210
- });
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"}`);
3211
3290
  }
3212
- ).command(
3213
- "recompile [package]",
3214
- "Re-compile with Typescript & Copy Images",
3215
- (yargs2) => {
3216
- return yargs2.positional("package", { describe: "Specific package to re-compile" });
3217
- },
3218
- async (argv) => {
3219
- if (argv.verbose) {
3220
- console.log(`Re-compiling: ${argv.package ?? "all"}`);
3221
- }
3222
- process.exitCode = await recompile({
3223
- incremental: !!argv.incremental,
3224
- jobs: argv.jobs,
3225
- pkg: argv.package,
3226
- target: argv.target,
3227
- verbose: !!argv.verbose
3228
- });
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"}`);
3229
3311
  }
3230
- ).command(
3231
- "rebuild [package]",
3232
- "Rebuild - Clean, Compile & Lint",
3233
- (yargs2) => {
3234
- return yargs2.positional("package", { describe: "Specific package to rebuild" });
3235
- },
3236
- (argv) => {
3237
- if (argv.verbose) console.log(`Rebuilding: ${argv.package ?? "all"}`);
3238
- process.exitCode = rebuild({ target: argv.target });
3239
- }
3240
- ).command(
3241
- "copy-assets [package]",
3242
- "Copy Assets - Copy the assets from src to dist",
3243
- (yargs2) => {
3244
- return yargs2.positional("package", { describe: "Specific package to copy assets" });
3245
- },
3246
- async (argv) => {
3247
- if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? "all"}`);
3248
- 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"}`);
3249
3359
  }
3250
- );
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
+ }
3251
3453
  };
3252
3454
 
3253
3455
  // src/xy/param.ts
@@ -3255,455 +3457,497 @@ var packagePositionalParam = (yargs2) => {
3255
3457
  return yargs2.positional("package", { describe: "Specific package to target", type: "string" });
3256
3458
  };
3257
3459
 
3258
- // 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
3259
3638
  var xyCommonCommands = (args) => {
3260
- return args.command(
3261
- "claude-commands",
3262
- "Claude Commands - Sync XY Labs standard Claude slash commands to .claude/commands/",
3263
- (yargs2) => yargs2,
3264
- (argv) => {
3265
- if (argv.verbose) console.log("Claude Commands");
3266
- process.exitCode = claudeCommands();
3267
- }
3268
- ).command(
3269
- "claude-settings",
3270
- "Claude Settings - Initialize .claude/settings.local.json with XY Labs defaults",
3271
- (yargs2) => yargs2,
3272
- async (argv) => {
3273
- if (argv.verbose) console.log("Claude Settings");
3274
- process.exitCode = await claudeSettings();
3275
- }
3276
- ).command(
3277
- "claude-rules",
3278
- "Claude Rules - Sync XY Labs standard Claude rules to .claude/rules/",
3279
- (yargs2) => {
3280
- return yargs2.option("force", {
3281
- alias: "f",
3282
- default: false,
3283
- description: "Overwrite existing CLAUDE.md",
3284
- type: "boolean"
3285
- });
3286
- },
3287
- (argv) => {
3288
- if (argv.verbose) console.log("Claude Rules");
3289
- process.exitCode = claudeRules({ force: argv.force });
3290
- }
3291
- ).command(
3292
- "license [package]",
3293
- "License - Check licenses of dependencies",
3294
- (yargs2) => {
3295
- return packagePositionalParam(yargs2);
3296
- },
3297
- async (argv) => {
3298
- if (argv.verbose) console.log(`License: ${argv.package ?? "all"}`);
3299
- process.exitCode = await license();
3300
- }
3301
- ).command(
3302
- "dead [package]",
3303
- "Dead - Check for dead code",
3304
- (yargs2) => {
3305
- return packagePositionalParam(yargs2);
3306
- },
3307
- (argv) => {
3308
- if (argv.verbose) console.log("Dead");
3309
- process.exitCode = dead();
3310
- }
3311
- ).command(
3312
- "gen-docs [package]",
3313
- "GenDocs - Generate TypeDocs",
3314
- (yargs2) => {
3315
- return packagePositionalParam(yargs2);
3316
- },
3317
- (argv) => {
3318
- if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? "all"}`);
3319
- process.exitCode = genDocs({ incremental: !!argv.incremental, pkg: argv.package });
3320
- }
3321
- ).command(
3322
- "clean-docs",
3323
- "CleanDocs - Clean TypeDocs",
3324
- (yargs2) => yargs2,
3325
- (argv) => {
3326
- if (argv.verbose) console.log("Cleaning TypeDocs: all");
3327
- process.exitCode = cleanDocs();
3328
- }
3329
- ).command(
3330
- "gitlint [package]",
3331
- "Gitlint - Lint your git config",
3332
- (yargs2) => {
3333
- return yargs2;
3334
- },
3335
- (argv) => {
3336
- if (argv.verbose) console.log("Gitlint");
3337
- process.exitCode = argv.fix ? gitlintFix() : gitlint();
3338
- }
3339
- ).command(
3340
- "gitignore-gen",
3341
- "GitIgnore Gen - Generate .gitignore files",
3342
- (yargs2) => {
3343
- return yargs2;
3344
- },
3345
- (argv) => {
3346
- if (argv.verbose) console.log("GitIgnore Gen");
3347
- process.exitCode = gitignoreGen();
3348
- }
3349
- ).command(
3350
- "npmignore-gen",
3351
- "NpmIgnore Gen - Generate .npmignore files",
3352
- (yargs2) => {
3353
- return yargs2;
3354
- },
3355
- (argv) => {
3356
- if (argv.verbose) console.log("NpmIgnore Gen");
3357
- process.exitCode = npmignoreGen();
3358
- }
3359
- ).command(
3360
- "readme-gen [package]",
3361
- "Readme Gen - Generate README.md files from template",
3362
- (yargs2) => {
3363
- return packagePositionalParam(yargs2).option("template", {
3364
- alias: "t",
3365
- description: "Path to README.template.md",
3366
- type: "string"
3367
- }).option("typedoc", {
3368
- default: false,
3369
- description: "Generate TypeDoc reference sections",
3370
- type: "boolean"
3371
- });
3372
- },
3373
- async (argv) => {
3374
- if (argv.verbose) console.log("Readme Gen");
3375
- process.exitCode = await readmeGen({
3376
- pkg: argv.package,
3377
- templatePath: argv.template,
3378
- typedoc: argv.typedoc,
3379
- verbose: !!argv.verbose
3380
- });
3381
- }
3382
- ).command(
3383
- "retest",
3384
- "Re-Test - Run Jest Tests with cleaned cache",
3385
- (yargs2) => {
3386
- return yargs2;
3387
- },
3388
- (argv) => {
3389
- if (argv.verbose) console.log("Re-Testing");
3390
- process.exitCode = retest();
3391
- }
3392
- ).command(
3393
- "test",
3394
- "Test - Run Jest Tests",
3395
- (yargs2) => {
3396
- return yargs2;
3397
- },
3398
- (argv) => {
3399
- if (argv.verbose) console.log("Testing");
3400
- process.exitCode = test();
3401
- }
3402
- ).command(
3403
- "upplug",
3404
- "UpPlug - Update Yarn Plugins",
3405
- (yargs2) => {
3406
- return yargs2;
3407
- },
3408
- (argv) => {
3409
- if (argv.verbose) console.log("UpPlug");
3410
- process.exitCode = updateYarnPlugins();
3411
- }
3412
- ).command(
3413
- "upyarn",
3414
- "UpYarn - Update Yarn Version",
3415
- (yargs2) => {
3416
- return yargs2;
3417
- },
3418
- (argv) => {
3419
- if (argv.verbose) console.log("UpYarn");
3420
- process.exitCode = updateYarnVersion();
3421
- }
3422
- ).command(
3423
- "yarn3only",
3424
- "Yarn3Only - Check if using Yarn v3",
3425
- (yargs2) => {
3426
- return yargs2;
3427
- },
3428
- (argv) => {
3429
- if (argv.verbose) console.log("Yarn 3 Check");
3430
- process.exitCode = yarn3Only();
3431
- }
3432
- );
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
+ }
3433
3690
  };
3434
3691
 
3435
- // src/xy/xyDeployCommands.ts
3692
+ // src/xy/deploy/index.ts
3436
3693
  var xyDeployCommands = (args) => {
3437
- return args.command(
3438
- "deploy",
3439
- "Deploy - Deploy patch",
3440
- (yargs2) => {
3441
- return yargs2;
3442
- },
3443
- (argv) => {
3444
- if (argv.verbose) console.log("Deploy patch");
3445
- process.exitCode = deploy();
3446
- }
3447
- ).command(
3448
- "deploy-minor",
3449
- "Deploy - Deploy minor",
3450
- (yargs2) => {
3451
- return yargs2;
3452
- },
3453
- (argv) => {
3454
- if (argv.verbose) console.log("Deploy minor");
3455
- process.exitCode = deployMinor();
3456
- }
3457
- ).command(
3458
- "deploy-major",
3459
- "Deploy - Deploy major",
3460
- (yargs2) => {
3461
- return yargs2;
3462
- },
3463
- (argv) => {
3464
- if (argv.verbose) console.log("Deploy major");
3465
- process.exitCode = deployMajor();
3466
- }
3467
- ).command(
3468
- "deploy-next",
3469
- "Deploy - Deploy next",
3470
- (yargs2) => {
3471
- return yargs2;
3472
- },
3473
- (argv) => {
3474
- if (argv.verbose) console.log("Deploy next");
3475
- process.exitCode = deployNext();
3476
- }
3477
- ).command(
3478
- "publish",
3479
- "Publish - Publish packages to npmjs",
3480
- (yargs2) => {
3481
- return yargs2;
3482
- },
3483
- (argv) => {
3484
- if (argv.verbose) console.log("Publish packages to npmjs");
3485
- 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"}`);
3486
3707
  }
3487
- );
3708
+ process.exitCode = await clean({
3709
+ pkg: argv.package,
3710
+ verbose: !!argv.verbose
3711
+ });
3712
+ }
3488
3713
  };
3489
3714
 
3490
- // 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
3491
3766
  var xyInstallCommands = (args) => {
3492
- return args.command(
3493
- "clean [package]",
3494
- "Clean",
3495
- (yargs2) => {
3496
- return yargs2.positional("package", { describe: "Specific package to clean" });
3497
- },
3498
- async (argv) => {
3499
- if (argv.verbose) {
3500
- console.log(`Cleaning: ${argv.package ?? "all"}`);
3501
- }
3502
- process.exitCode = await clean({
3503
- pkg: argv.package,
3504
- verbose: !!argv.verbose
3505
- });
3506
- }
3507
- ).command(
3508
- "reinstall",
3509
- "Reinstall - Clean & Install",
3510
- (yargs2) => {
3511
- return yargs2;
3512
- },
3513
- (argv) => {
3514
- if (argv.verbose) console.log("Reinstalling");
3515
- process.exitCode = reinstall();
3516
- }
3517
- ).command(
3518
- "up",
3519
- "Up - Update dependencies",
3520
- (yargs2) => {
3521
- return yargs2;
3522
- },
3523
- (argv) => {
3524
- if (argv.verbose) console.log("Up");
3525
- process.exitCode = up();
3526
- }
3527
- ).command(
3528
- "updo",
3529
- "Updo - Update dependencies [Interactive]",
3530
- (yargs2) => {
3531
- return yargs2;
3532
- },
3533
- (argv) => {
3534
- if (argv.verbose) console.log("Updo");
3535
- process.exitCode = updo();
3536
- }
3537
- ).command(
3538
- "statics",
3539
- "Statics - Confirming Static Packages",
3540
- (yargs2) => {
3541
- return yargs2;
3542
- },
3543
- (argv) => {
3544
- if (argv.verbose) console.log("Statics");
3545
- process.exitCode = statics();
3546
- }
3547
- ).command(
3548
- "dupdeps",
3549
- "Dupdeps - Duplicate Dependencies in package.json",
3550
- (yargs2) => {
3551
- return yargs2;
3552
- },
3553
- (argv) => {
3554
- if (argv.verbose) console.log("Dupdeps");
3555
- process.exitCode = dupdeps();
3556
- }
3557
- );
3767
+ return args.command(cleanCommand).command(reinstallCommand).command(upCommand).command(updoCommand).command(staticsCommand).command(dupdepsCommand);
3558
3768
  };
3559
3769
 
3560
- // src/xy/xyLintCommands.ts
3770
+ // src/xy/lint/cycleCommand.ts
3561
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
3562
3944
  var xyLintCommands = (args) => {
3563
- return args.command(
3564
- "cycle [package]",
3565
- "Cycle - Check for dependency cycles",
3566
- (yargs2) => {
3567
- return packagePositionalParam(yargs2);
3568
- },
3569
- async (argv) => {
3570
- const start = Date.now();
3571
- if (argv.verbose) console.log("Cycle");
3572
- process.exitCode = await cycle({ pkg: argv.package });
3573
- console.log(chalk42.blue(`Finished in ${Date.now() - start}ms`));
3574
- }
3575
- ).command(
3576
- "lint [package]",
3577
- "Lint - Run Eslint",
3578
- (yargs2) => {
3579
- return packagePositionalParam(yargs2).option("fix", {
3580
- alias: "f",
3581
- default: false,
3582
- description: "Fix fixable issues",
3583
- type: "boolean"
3584
- }).option("cache", {
3585
- alias: "c",
3586
- default: false,
3587
- description: "Use caching for performance",
3588
- type: "boolean"
3589
- });
3590
- },
3591
- (argv) => {
3592
- if (argv.verbose) console.log("Lint");
3593
- const start = Date.now();
3594
- process.exitCode = argv.fix ? fix({
3595
- pkg: argv.package,
3596
- cache: argv.cache,
3597
- verbose: !!argv.verbose
3598
- }) : lint({
3599
- pkg: argv.package,
3600
- cache: argv.cache,
3601
- verbose: !!argv.verbose
3602
- });
3603
- console.log(chalk42.blue(`Finished in ${Date.now() - start}ms`));
3604
- }
3605
- ).command(
3606
- "deplint [package]",
3607
- "Deplint - Run Deplint",
3608
- (yargs2) => {
3609
- return packagePositionalParam(yargs2).option("deps", {
3610
- alias: "d",
3611
- default: false,
3612
- description: "Check dependencies",
3613
- type: "boolean"
3614
- }).option("devDeps", {
3615
- alias: "v",
3616
- default: false,
3617
- description: "Check devDependencies",
3618
- type: "boolean"
3619
- }).option("peerDeps", {
3620
- alias: "p",
3621
- default: false,
3622
- description: "Check peerDependencies",
3623
- type: "boolean"
3624
- }).option("exclude", {
3625
- alias: "e",
3626
- description: "Package names to exclude from unused checks (comma-separated or repeated)",
3627
- type: "array"
3628
- });
3629
- },
3630
- async (argv) => {
3631
- if (argv.verbose) console.log("Deplint");
3632
- const start = Date.now();
3633
- const cliExclude = argv.exclude?.flatMap((v) => String(v).split(",")).map((v) => v.trim()).filter(Boolean);
3634
- process.exitCode = await deplint({
3635
- cliExclude,
3636
- pkg: argv.package,
3637
- deps: !!argv.deps,
3638
- devDeps: !!argv.devDeps,
3639
- peerDeps: !!argv.peerDeps,
3640
- verbose: !!argv.verbose
3641
- });
3642
- console.log(chalk42.blue(`Finished in ${Date.now() - start}ms`));
3643
- }
3644
- ).command(
3645
- "fix [package]",
3646
- "Fix - Run Eslint w/fix",
3647
- (yargs2) => {
3648
- return packagePositionalParam(yargs2);
3649
- },
3650
- (argv) => {
3651
- const start = Date.now();
3652
- if (argv.verbose) console.log("Fix");
3653
- process.exitCode = fix();
3654
- console.log(chalk42.blue(`Finished in ${Date.now() - start}ms`));
3655
- }
3656
- ).command(
3657
- "relint [package]",
3658
- "Relint - Clean & Lint",
3659
- (yargs2) => {
3660
- return packagePositionalParam(yargs2);
3661
- },
3662
- (argv) => {
3663
- if (argv.verbose) console.log("Relinting");
3664
- const start = Date.now();
3665
- process.exitCode = relint();
3666
- console.log(chalk42.blue(`Finished in ${Date.now() - start}ms`));
3667
- }
3668
- ).command(
3669
- "publint [package]",
3670
- "Publint - Run Publint",
3671
- (yargs2) => {
3672
- return packagePositionalParam(yargs2);
3673
- },
3674
- async (argv) => {
3675
- if (argv.verbose) console.log("Publint");
3676
- const start = Date.now();
3677
- process.exitCode = await publint({ pkg: argv.package, verbose: !!argv.verbose });
3678
- console.log(chalk42.blue(`Finished in ${Date.now() - start}ms`));
3679
- }
3680
- ).command(
3681
- "knip",
3682
- "Knip - Run Knip",
3683
- (yargs2) => {
3684
- return packagePositionalParam(yargs2);
3685
- },
3686
- (argv) => {
3687
- if (argv.verbose) console.log("Knip");
3688
- const start = Date.now();
3689
- process.exitCode = knip();
3690
- console.log(chalk42.blue(`Knip finished in ${Date.now() - start}ms`));
3691
- }
3692
- ).command(
3693
- "sonar",
3694
- "Sonar - Run Sonar Check",
3695
- (yargs2) => {
3696
- return packagePositionalParam(yargs2);
3697
- },
3698
- (argv) => {
3699
- const start = Date.now();
3700
- if (argv.verbose) console.log("Sonar Check");
3701
- process.exitCode = sonar();
3702
- console.log(chalk42.blue(`Finished in ${Date.now() - start}ms`));
3703
- }
3704
- );
3945
+ return args.command(cycleCommand).command(lintCommand).command(deplintCommand).command(fixCommand).command(relintCommand).command(publintCommand).command(knipCommand).command(sonarCommand);
3705
3946
  };
3706
3947
 
3948
+ // src/xy/xy.ts
3949
+ import chalk50 from "chalk";
3950
+
3707
3951
  // src/xy/xyParseOptions.ts
3708
3952
  import yargs from "yargs";
3709
3953
  import { hideBin } from "yargs/helpers";
@@ -3735,17 +3979,20 @@ var xyParseOptions = () => {
3735
3979
  var xy = async () => {
3736
3980
  const options = xyParseOptions();
3737
3981
  return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
3738
- console.error(chalk43.yellow(`Command not found [${chalk43.magenta(process.argv[2])}]`));
3739
- 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"));
3740
3984
  }).version().help().argv;
3741
3985
  };
3742
3986
  export {
3743
3987
  CROSS_PLATFORM_NEWLINE,
3988
+ DEFAULT_README_BODY,
3989
+ DEFAULT_README_TEMPLATE,
3744
3990
  DuplicateDetector,
3745
3991
  INIT_CWD,
3746
3992
  WINDOWS_NEWLINE_REGEX,
3747
3993
  XYLABS_COMMANDS_PREFIX,
3748
3994
  XYLABS_RULES_PREFIX,
3995
+ applyLogoConfig,
3749
3996
  build,
3750
3997
  bundleDts,
3751
3998
  checkResult,
@@ -3821,6 +4068,7 @@ export {
3821
4068
  readLines,
3822
4069
  readNonEmptyLines,
3823
4070
  readmeGen,
4071
+ readmeInit,
3824
4072
  rebuild,
3825
4073
  recompile,
3826
4074
  recompileAll,
@@ -3829,6 +4077,7 @@ export {
3829
4077
  relint,
3830
4078
  relintAllPackages,
3831
4079
  relintPackage,
4080
+ resolveTemplatePath,
3832
4081
  retest,
3833
4082
  runStepAsync,
3834
4083
  runSteps,
@@ -3837,6 +4086,7 @@ export {
3837
4086
  runXyWithWarning,
3838
4087
  safeExit,
3839
4088
  safeExitAsync,
4089
+ scaffoldTemplate,
3840
4090
  sonar,
3841
4091
  statics,
3842
4092
  test,