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