@xylabs/ts-scripts-yarn3 7.4.18 → 7.4.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/README.body.md +86 -0
  2. package/README.md +108 -0
  3. package/dist/actions/claude-commands.mjs +6 -2
  4. package/dist/actions/claude-commands.mjs.map +1 -1
  5. package/dist/actions/claude-rules.mjs +6 -2
  6. package/dist/actions/claude-rules.mjs.map +1 -1
  7. package/dist/actions/claude-skills.mjs +120 -0
  8. package/dist/actions/claude-skills.mjs.map +1 -0
  9. package/dist/actions/compile.mjs.map +1 -1
  10. package/dist/actions/cycle.mjs.map +1 -1
  11. package/dist/actions/dead.mjs.map +1 -1
  12. package/dist/actions/deploy-major.mjs.map +1 -1
  13. package/dist/actions/deploy-minor.mjs.map +1 -1
  14. package/dist/actions/deploy-next.mjs.map +1 -1
  15. package/dist/actions/deploy.mjs.map +1 -1
  16. package/dist/actions/fix.mjs.map +1 -1
  17. package/dist/actions/gen-docs.mjs.map +1 -1
  18. package/dist/actions/index.mjs +367 -160
  19. package/dist/actions/index.mjs.map +1 -1
  20. package/dist/actions/knip.mjs.map +1 -1
  21. package/dist/actions/lint.mjs.map +1 -1
  22. package/dist/actions/publint.mjs.map +1 -1
  23. package/dist/actions/publish.mjs.map +1 -1
  24. package/dist/actions/readme-gen.mjs +136 -20
  25. package/dist/actions/readme-gen.mjs.map +1 -1
  26. package/dist/actions/readme-init.mjs +83 -0
  27. package/dist/actions/readme-init.mjs.map +1 -0
  28. package/dist/actions/rebuild.mjs.map +1 -1
  29. package/dist/actions/reinstall.mjs.map +1 -1
  30. package/dist/actions/relint.mjs.map +1 -1
  31. package/dist/actions/retest.mjs +2 -2
  32. package/dist/actions/retest.mjs.map +1 -1
  33. package/dist/actions/sonar.mjs.map +1 -1
  34. package/dist/actions/test.mjs.map +1 -1
  35. package/dist/actions/up.mjs.map +1 -1
  36. package/dist/actions/updo.mjs.map +1 -1
  37. package/dist/actions/upplug.mjs.map +1 -1
  38. package/dist/actions/upyarn.mjs.map +1 -1
  39. package/dist/bin/xy.mjs +982 -642
  40. package/dist/bin/xy.mjs.map +1 -1
  41. package/dist/index.d.ts +46 -13
  42. package/dist/index.mjs +1044 -695
  43. package/dist/index.mjs.map +1 -1
  44. package/dist/lib/claudeMdTemplate.mjs +28 -3
  45. package/dist/lib/claudeMdTemplate.mjs.map +1 -1
  46. package/dist/lib/generateReadmeFiles.mjs +118 -21
  47. package/dist/lib/generateReadmeFiles.mjs.map +1 -1
  48. package/dist/lib/index.mjs +146 -24
  49. package/dist/lib/index.mjs.map +1 -1
  50. package/dist/lib/runSteps.mjs.map +1 -1
  51. package/dist/lib/runXy.mjs.map +1 -1
  52. package/dist/xy/{xyBuildCommands.mjs → build-commands/build.mjs} +107 -94
  53. package/dist/xy/build-commands/build.mjs.map +1 -0
  54. package/dist/xy/build-commands/index.mjs +502 -0
  55. package/dist/xy/build-commands/index.mjs.map +1 -0
  56. package/dist/xy/common/claude/commandsCommand.mjs +111 -0
  57. package/dist/xy/common/claude/commandsCommand.mjs.map +1 -0
  58. package/dist/xy/common/claude/index.mjs +441 -0
  59. package/dist/xy/common/claude/index.mjs.map +1 -0
  60. package/dist/xy/common/claude/initCommand.mjs +393 -0
  61. package/dist/xy/common/claude/initCommand.mjs.map +1 -0
  62. package/dist/xy/common/claude/rulesCommand.mjs +133 -0
  63. package/dist/xy/common/claude/rulesCommand.mjs.map +1 -0
  64. package/dist/xy/common/claude/settingsCommand.mjs +90 -0
  65. package/dist/xy/common/claude/settingsCommand.mjs.map +1 -0
  66. package/dist/xy/common/claude/skillsCommand.mjs +129 -0
  67. package/dist/xy/common/claude/skillsCommand.mjs.map +1 -0
  68. package/dist/xy/common/cleanDocsCommand.mjs +45 -0
  69. package/dist/xy/common/cleanDocsCommand.mjs.map +1 -0
  70. package/dist/xy/common/deadCommand.mjs +116 -0
  71. package/dist/xy/common/deadCommand.mjs.map +1 -0
  72. package/dist/xy/common/genDocsCommand.mjs +125 -0
  73. package/dist/xy/common/genDocsCommand.mjs.map +1 -0
  74. package/dist/xy/common/gitignoreGenCommand.mjs +98 -0
  75. package/dist/xy/common/gitignoreGenCommand.mjs.map +1 -0
  76. package/dist/xy/common/gitlintCommand.mjs +82 -0
  77. package/dist/xy/common/gitlintCommand.mjs.map +1 -0
  78. package/dist/xy/{xyCommonCommands.mjs → common/index.mjs} +561 -242
  79. package/dist/xy/common/index.mjs.map +1 -0
  80. package/dist/xy/common/licenseCommand.mjs +100 -0
  81. package/dist/xy/common/licenseCommand.mjs.map +1 -0
  82. package/dist/xy/common/npmignoreGenCommand.mjs +98 -0
  83. package/dist/xy/common/npmignoreGenCommand.mjs.map +1 -0
  84. package/dist/xy/common/readme/genCommand.mjs +321 -0
  85. package/dist/xy/common/readme/genCommand.mjs.map +1 -0
  86. package/dist/xy/common/readme/index.mjs +361 -0
  87. package/dist/xy/common/readme/index.mjs.map +1 -0
  88. package/dist/xy/common/readme/initCommand.mjs +103 -0
  89. package/dist/xy/common/readme/initCommand.mjs.map +1 -0
  90. package/dist/xy/common/retestCommand.mjs +111 -0
  91. package/dist/xy/common/retestCommand.mjs.map +1 -0
  92. package/dist/xy/common/testCommand.mjs +108 -0
  93. package/dist/xy/common/testCommand.mjs.map +1 -0
  94. package/dist/xy/common/upplugCommand.mjs +113 -0
  95. package/dist/xy/common/upplugCommand.mjs.map +1 -0
  96. package/dist/xy/common/upyarnCommand.mjs +108 -0
  97. package/dist/xy/common/upyarnCommand.mjs.map +1 -0
  98. package/dist/xy/common/yarn3OnlyCommand.mjs +70 -0
  99. package/dist/xy/common/yarn3OnlyCommand.mjs.map +1 -0
  100. package/dist/xy/deploy/deployCommand.mjs +139 -0
  101. package/dist/xy/deploy/deployCommand.mjs.map +1 -0
  102. package/dist/xy/deploy/deployMajorCommand.mjs +139 -0
  103. package/dist/xy/deploy/deployMajorCommand.mjs.map +1 -0
  104. package/dist/xy/deploy/deployMinorCommand.mjs +139 -0
  105. package/dist/xy/deploy/deployMinorCommand.mjs.map +1 -0
  106. package/dist/xy/deploy/deployNextCommand.mjs +139 -0
  107. package/dist/xy/deploy/deployNextCommand.mjs.map +1 -0
  108. package/dist/xy/{xyDeployCommands.mjs → deploy/index.mjs} +53 -53
  109. package/dist/xy/deploy/index.mjs.map +1 -0
  110. package/dist/xy/deploy/publishCommand.mjs +108 -0
  111. package/dist/xy/deploy/publishCommand.mjs.map +1 -0
  112. package/dist/xy/index.mjs +982 -642
  113. package/dist/xy/index.mjs.map +1 -1
  114. package/dist/xy/install/cleanCommand.mjs +140 -0
  115. package/dist/xy/install/cleanCommand.mjs.map +1 -0
  116. package/dist/xy/install/dupdepsCommand.mjs +191 -0
  117. package/dist/xy/install/dupdepsCommand.mjs.map +1 -0
  118. package/dist/xy/{xyInstallCommands.mjs → install/index.mjs} +71 -68
  119. package/dist/xy/install/index.mjs.map +1 -0
  120. package/dist/xy/install/reinstallCommand.mjs +140 -0
  121. package/dist/xy/install/reinstallCommand.mjs.map +1 -0
  122. package/dist/xy/install/staticsCommand.mjs +191 -0
  123. package/dist/xy/install/staticsCommand.mjs.map +1 -0
  124. package/dist/{actions/clean-jest.mjs → xy/install/upCommand.mjs} +15 -6
  125. package/dist/xy/install/upCommand.mjs.map +1 -0
  126. package/dist/xy/install/updoCommand.mjs +112 -0
  127. package/dist/xy/install/updoCommand.mjs.map +1 -0
  128. package/dist/xy/lint/cycleCommand.mjs +163 -0
  129. package/dist/xy/lint/cycleCommand.mjs.map +1 -0
  130. package/dist/xy/lint/deplintCommand.mjs +814 -0
  131. package/dist/xy/lint/deplintCommand.mjs.map +1 -0
  132. package/dist/xy/lint/fixCommand.mjs +168 -0
  133. package/dist/xy/lint/fixCommand.mjs.map +1 -0
  134. package/dist/xy/{xyLintCommands.mjs → lint/index.mjs} +176 -145
  135. package/dist/xy/lint/index.mjs.map +1 -0
  136. package/dist/xy/lint/knipCommand.mjs +121 -0
  137. package/dist/xy/lint/knipCommand.mjs.map +1 -0
  138. package/dist/xy/lint/lintCommand.mjs +186 -0
  139. package/dist/xy/lint/lintCommand.mjs.map +1 -0
  140. package/dist/xy/lint/publintCommand.mjs +187 -0
  141. package/dist/xy/lint/publintCommand.mjs.map +1 -0
  142. package/dist/xy/lint/relintCommand.mjs +163 -0
  143. package/dist/xy/lint/relintCommand.mjs.map +1 -0
  144. package/dist/xy/lint/sonarCommand.mjs +121 -0
  145. package/dist/xy/lint/sonarCommand.mjs.map +1 -0
  146. package/dist/xy/xy.mjs +980 -640
  147. package/dist/xy/xy.mjs.map +1 -1
  148. package/package.json +2 -2
  149. package/templates/claude/skills/xylabs-e2e-setup/SKILL.md +196 -0
  150. package/templates/readme/README.body.md +11 -0
  151. package/templates/readme/README.template.md +22 -0
  152. package/dist/actions/clean-jest.mjs.map +0 -1
  153. package/dist/xy/xyBuildCommands.mjs.map +0 -1
  154. package/dist/xy/xyCommonCommands.mjs.map +0 -1
  155. package/dist/xy/xyDeployCommands.mjs.map +0 -1
  156. package/dist/xy/xyInstallCommands.mjs.map +0 -1
  157. package/dist/xy/xyLintCommands.mjs.map +0 -1
  158. /package/templates/{CLAUDE-project.md → claude/CLAUDE-project.md} +0 -0
  159. /package/templates/{commands → claude/commands}/xylabs-build.md +0 -0
  160. /package/templates/{commands → claude/commands}/xylabs-clean.md +0 -0
  161. /package/templates/{commands → claude/commands}/xylabs-compile.md +0 -0
  162. /package/templates/{commands → claude/commands}/xylabs-cycle.md +0 -0
  163. /package/templates/{commands → claude/commands}/xylabs-deplint.md +0 -0
  164. /package/templates/{commands → claude/commands}/xylabs-deploy-major.md +0 -0
  165. /package/templates/{commands → claude/commands}/xylabs-deploy-minor.md +0 -0
  166. /package/templates/{commands → claude/commands}/xylabs-deploy.md +0 -0
  167. /package/templates/{commands → claude/commands}/xylabs-fix.md +0 -0
  168. /package/templates/{commands → claude/commands}/xylabs-knip.md +0 -0
  169. /package/templates/{commands → claude/commands}/xylabs-lint.md +0 -0
  170. /package/templates/{commands → claude/commands}/xylabs-publint.md +0 -0
  171. /package/templates/{commands → claude/commands}/xylabs-rebuild.md +0 -0
  172. /package/templates/{commands → claude/commands}/xylabs-test.md +0 -0
  173. /package/templates/{rules → claude/rules}/xylabs-architecture.md +0 -0
  174. /package/templates/{rules → claude/rules}/xylabs-build.md +0 -0
  175. /package/templates/{rules → claude/rules}/xylabs-dependencies.md +0 -0
  176. /package/templates/{rules → claude/rules}/xylabs-error-handling.md +0 -0
  177. /package/templates/{rules → claude/rules}/xylabs-frameworks.md +0 -0
  178. /package/templates/{rules → claude/rules}/xylabs-git-workflow.md +0 -0
  179. /package/templates/{rules → claude/rules}/xylabs-linting.md +0 -0
  180. /package/templates/{rules → claude/rules}/xylabs-naming.md +0 -0
  181. /package/templates/{rules → claude/rules}/xylabs-style.md +0 -0
  182. /package/templates/{rules → claude/rules}/xylabs-typescript.md +0 -0
package/dist/xy/index.mjs CHANGED
@@ -1,6 +1,3 @@
1
- // src/xy/xy.ts
2
- import chalk31 from "chalk";
3
-
4
1
  // src/actions/build.ts
5
2
  import chalk9 from "chalk";
6
3
 
@@ -18,14 +15,19 @@ var checkResult = (name, result, level = "error", exitOnFail = false) => {
18
15
  };
19
16
 
20
17
  // src/lib/claudeMdTemplate.ts
21
- import { readdirSync, readFileSync } from "fs";
18
+ import {
19
+ readdirSync,
20
+ readFileSync,
21
+ statSync
22
+ } from "fs";
22
23
  import { createRequire } from "module";
23
24
  import PATH from "path";
24
25
  var require2 = createRequire(import.meta.url);
25
26
  var packageRoot = PATH.dirname(require2.resolve("@xylabs/ts-scripts-yarn3/package.json"));
26
- var templatesDir = PATH.resolve(packageRoot, "templates");
27
+ var templatesDir = PATH.resolve(packageRoot, "templates", "claude");
27
28
  var XYLABS_RULES_PREFIX = "xylabs-";
28
29
  var XYLABS_COMMANDS_PREFIX = "xylabs-";
30
+ var XYLABS_SKILLS_PREFIX = "xylabs-";
29
31
  var claudeMdRuleTemplates = () => {
30
32
  const rulesDir = PATH.resolve(templatesDir, "rules");
31
33
  const files = readdirSync(rulesDir).filter((f) => f.startsWith(XYLABS_RULES_PREFIX) && f.endsWith(".md"));
@@ -44,6 +46,24 @@ var claudeCommandTemplates = () => {
44
46
  }
45
47
  return result;
46
48
  };
49
+ var claudeSkillTemplates = () => {
50
+ const skillsDir = PATH.resolve(templatesDir, "skills");
51
+ const dirs = readdirSync(skillsDir).filter(
52
+ (f) => f.startsWith(XYLABS_SKILLS_PREFIX) && statSync(PATH.resolve(skillsDir, f)).isDirectory()
53
+ );
54
+ const result = {};
55
+ for (const dir of dirs) {
56
+ const dirPath = PATH.resolve(skillsDir, dir);
57
+ const files = readdirSync(dirPath, { recursive: true, encoding: "utf8" });
58
+ result[dir] = {};
59
+ for (const file of files) {
60
+ if (statSync(PATH.resolve(dirPath, file)).isFile()) {
61
+ result[dir][file] = readFileSync(PATH.resolve(dirPath, file), "utf8");
62
+ }
63
+ }
64
+ }
65
+ return result;
66
+ };
47
67
  var claudeMdProjectTemplate = () => readFileSync(PATH.resolve(templatesDir, "CLAUDE-project.md"), "utf8");
48
68
 
49
69
  // src/lib/deleteGlob.ts
@@ -326,10 +346,19 @@ var generateIgnoreFiles = (filename3, pkg) => {
326
346
 
327
347
  // src/lib/generateReadmeFiles.ts
328
348
  import { execSync as execSync2 } from "child_process";
329
- import FS from "fs";
330
- import { readFile, writeFile } from "fs/promises";
349
+ import FS, { readFileSync as readFileSync3 } from "fs";
350
+ import {
351
+ mkdir,
352
+ readFile,
353
+ writeFile
354
+ } from "fs/promises";
355
+ import { createRequire as createRequire2 } from "module";
331
356
  import PATH2 from "path";
357
+ import { createInterface } from "readline";
332
358
  import chalk5 from "chalk";
359
+ var require3 = createRequire2(import.meta.url);
360
+ var packageRoot2 = PATH2.dirname(require3.resolve("@xylabs/ts-scripts-yarn3/package.json"));
361
+ var readmeTemplatesDir = PATH2.resolve(packageRoot2, "templates", "readme");
333
362
  function fillTemplate(template, data) {
334
363
  const additionalData = { ...data, safeName: data.name.replaceAll("/", "__").replaceAll("@", "") };
335
364
  return template.replaceAll(/\{\{(.*?)\}\}/g, (_, key) => additionalData[key.trim()] ?? "");
@@ -419,37 +448,120 @@ ${indent}### ${item.name}
419
448
  }
420
449
  return content;
421
450
  }
451
+ function askConfirmation(question) {
452
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
453
+ return new Promise((resolve) => {
454
+ rl.question(question, (answer) => {
455
+ rl.close();
456
+ resolve(answer.toLowerCase() === "y" || answer.toLowerCase() === "yes");
457
+ });
458
+ });
459
+ }
460
+ var DEFAULT_README_TEMPLATE = readFileSync3(PATH2.resolve(readmeTemplatesDir, "README.template.md"), "utf8");
461
+ var DEFAULT_README_BODY = readFileSync3(PATH2.resolve(readmeTemplatesDir, "README.body.md"), "utf8");
462
+ function applyLogoConfig(template, logoUrl, logoLinkUrl) {
463
+ let result = template;
464
+ if (logoUrl) {
465
+ result = result.replace(/\[logo]: .+/, `[logo]: ${logoUrl}`);
466
+ if (logoLinkUrl) {
467
+ result = result.replace(/\[!\[logo]\[]][^)]*\)/, `[![logo][]](${logoLinkUrl})`);
468
+ }
469
+ } else {
470
+ result = result.replace(/\[!\[logo]\[]][^\n]*\n*/, "");
471
+ result = result.replace(/\[logo]: [^\n]*\n?/, "");
472
+ }
473
+ return result;
474
+ }
475
+ function resolveTemplatePath(templatePath) {
476
+ const cwd = INIT_CWD() ?? ".";
477
+ return templatePath ?? PATH2.join(cwd, ".xy", "README.template.md");
478
+ }
479
+ async function loadOrCreateTemplate(resolvedTemplatePath) {
480
+ try {
481
+ const template = await readFile(resolvedTemplatePath, "utf8");
482
+ return { created: false, template };
483
+ } catch {
484
+ console.log(chalk5.yellow(`Template not found: ${resolvedTemplatePath}`));
485
+ const shouldCreate = await askConfirmation("Would you like to create a stock template? (y/N) ");
486
+ if (!shouldCreate) {
487
+ throw new Error("Template creation declined");
488
+ }
489
+ const template = DEFAULT_README_TEMPLATE;
490
+ await scaffoldTemplate(resolvedTemplatePath, template);
491
+ return { created: true, template };
492
+ }
493
+ }
494
+ async function scaffoldTemplate(resolvedTemplatePath, template) {
495
+ const xyDir = PATH2.dirname(resolvedTemplatePath);
496
+ await mkdir(xyDir, { recursive: true });
497
+ await writeFile(resolvedTemplatePath, template);
498
+ console.log(chalk5.green(`Created template: ${resolvedTemplatePath}`));
499
+ const bodyPath = PATH2.join(xyDir, "README.body.md");
500
+ await writeFile(bodyPath, DEFAULT_README_BODY);
501
+ console.log(chalk5.green(`Created body template: ${bodyPath}`));
502
+ }
503
+ async function resolveBody(location, defaultBody) {
504
+ const localBodyPath = PATH2.join(location, "README.body.md");
505
+ try {
506
+ return await readFile(localBodyPath, "utf8");
507
+ } catch {
508
+ return defaultBody;
509
+ }
510
+ }
511
+ async function generateReadmeForWorkspace(location, name, template, defaultBody, typedoc, verbose) {
512
+ try {
513
+ const pkgJsonPath = PATH2.join(location, "package.json");
514
+ const pkgJson = JSON.parse(await readFile(pkgJsonPath, "utf8"));
515
+ const body = await resolveBody(location, defaultBody);
516
+ const typedocContent = typedoc ? generateTypedoc(location, ["src/index*.ts"]) : "";
517
+ const readmeContent = fillTemplate(template, {
518
+ ...pkgJson,
519
+ body,
520
+ typedoc: typedocContent
521
+ });
522
+ await writeFile(PATH2.join(location, "README.md"), readmeContent);
523
+ if (verbose) console.log(chalk5.green(` ${name}`));
524
+ return true;
525
+ } catch (ex) {
526
+ const error = ex;
527
+ console.warn(chalk5.yellow(` Skipped ${location}: ${error.message}`));
528
+ return false;
529
+ }
530
+ }
422
531
  async function generateReadmeFiles({
532
+ logoLinkUrl,
533
+ logoUrl,
423
534
  pkg,
424
535
  templatePath,
425
536
  typedoc = false,
426
- verbose
537
+ verbose = false
427
538
  }) {
428
539
  console.log(chalk5.green("Generate README Files"));
429
- const cwd = INIT_CWD() ?? ".";
430
- const resolvedTemplatePath = templatePath ?? PATH2.join(cwd, "scripts", "README.template.md");
540
+ const resolvedTemplatePath = resolveTemplatePath(templatePath);
431
541
  let template;
542
+ let templateCreated;
432
543
  try {
433
- template = await readFile(resolvedTemplatePath, "utf8");
544
+ ({ template, created: templateCreated } = await loadOrCreateTemplate(resolvedTemplatePath));
434
545
  } catch {
435
- console.error(chalk5.red(`Template not found: ${resolvedTemplatePath}`));
436
546
  return 1;
437
547
  }
438
- const workspaces = pkg ? [yarnWorkspace(pkg)] : yarnWorkspaces();
548
+ template = applyLogoConfig(template, logoUrl, logoLinkUrl);
549
+ if (templateCreated) {
550
+ console.log(chalk5.green("Generating README files for all packages..."));
551
+ }
552
+ const xyDir = PATH2.dirname(resolvedTemplatePath);
553
+ const xyBodyPath = PATH2.join(xyDir, "README.body.md");
554
+ let defaultBody;
555
+ try {
556
+ defaultBody = await readFile(xyBodyPath, "utf8");
557
+ } catch {
558
+ defaultBody = DEFAULT_README_BODY;
559
+ }
560
+ const workspaces = pkg && !templateCreated ? [yarnWorkspace(pkg)] : yarnWorkspaces();
439
561
  let failed = false;
440
562
  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
- }
563
+ const success = await generateReadmeForWorkspace(location, name, template, defaultBody, typedoc, verbose);
564
+ if (!success) failed = true;
453
565
  }
454
566
  return failed ? 1 : 0;
455
567
  }
@@ -476,10 +588,10 @@ var loadConfig = async (params) => {
476
588
  };
477
589
 
478
590
  // src/lib/parsedPackageJSON.ts
479
- import { readFileSync as readFileSync3 } from "fs";
591
+ import { readFileSync as readFileSync4 } from "fs";
480
592
  var parsedPackageJSON = (path8) => {
481
593
  const pathToPackageJSON = path8 ?? process.env.npm_package_json ?? "";
482
- const packageJSON = readFileSync3(pathToPackageJSON).toString();
594
+ const packageJSON = readFileSync4(pathToPackageJSON).toString();
483
595
  return JSON.parse(packageJSON);
484
596
  };
485
597
 
@@ -594,7 +706,7 @@ import {
594
706
  existsSync as existsSync4,
595
707
  mkdirSync,
596
708
  readdirSync as readdirSync2,
597
- readFileSync as readFileSync4,
709
+ readFileSync as readFileSync5,
598
710
  unlinkSync,
599
711
  writeFileSync as writeFileSync2
600
712
  } from "fs";
@@ -607,7 +719,7 @@ var syncCommandFiles = (commandsDir) => {
607
719
  let created = 0;
608
720
  for (const [filename3, content] of Object.entries(templates)) {
609
721
  const targetPath = PATH3.resolve(commandsDir, filename3);
610
- const existing = existsSync4(targetPath) ? readFileSync4(targetPath, "utf8") : void 0;
722
+ const existing = existsSync4(targetPath) ? readFileSync5(targetPath, "utf8") : void 0;
611
723
  if (existing === content) continue;
612
724
  writeFileSync2(targetPath, content, "utf8");
613
725
  if (existing) {
@@ -664,7 +776,7 @@ import {
664
776
  existsSync as existsSync5,
665
777
  mkdirSync as mkdirSync2,
666
778
  readdirSync as readdirSync3,
667
- readFileSync as readFileSync5,
779
+ readFileSync as readFileSync6,
668
780
  unlinkSync as unlinkSync2,
669
781
  writeFileSync as writeFileSync3
670
782
  } from "fs";
@@ -677,7 +789,7 @@ var syncRuleFiles = (rulesDir) => {
677
789
  let created = 0;
678
790
  for (const [filename3, content] of Object.entries(templates)) {
679
791
  const targetPath = PATH4.resolve(rulesDir, filename3);
680
- const existing = existsSync5(targetPath) ? readFileSync5(targetPath, "utf8") : void 0;
792
+ const existing = existsSync5(targetPath) ? readFileSync6(targetPath, "utf8") : void 0;
681
793
  if (existing === content) continue;
682
794
  writeFileSync3(targetPath, content, "utf8");
683
795
  if (existing) {
@@ -749,7 +861,7 @@ import {
749
861
  writeFileSync as writeFileSync4
750
862
  } from "fs";
751
863
  import PATH5 from "path";
752
- import { createInterface } from "readline";
864
+ import { createInterface as createInterface2 } from "readline";
753
865
  import chalk12 from "chalk";
754
866
  var DEFAULT_SETTINGS = {
755
867
  permissions: {
@@ -784,8 +896,8 @@ var DEFAULT_SETTINGS = {
784
896
  ]
785
897
  }
786
898
  };
787
- function askConfirmation(question) {
788
- const rl = createInterface({ input: process.stdin, output: process.stdout });
899
+ function askConfirmation2(question) {
900
+ const rl = createInterface2({ input: process.stdin, output: process.stdout });
789
901
  return new Promise((resolve) => {
790
902
  rl.question(question, (answer) => {
791
903
  rl.close();
@@ -799,7 +911,7 @@ async function claudeSettings() {
799
911
  const settingsPath = PATH5.resolve(claudeDir, "settings.local.json");
800
912
  mkdirSync3(claudeDir, { recursive: true });
801
913
  if (existsSync6(settingsPath)) {
802
- const confirmed = await askConfirmation(
914
+ const confirmed = await askConfirmation2(
803
915
  chalk12.yellow(`${settingsPath} already exists. Replace it? (y/N) `)
804
916
  );
805
917
  if (!confirmed) {
@@ -813,6 +925,84 @@ async function claudeSettings() {
813
925
  return 0;
814
926
  }
815
927
 
928
+ // src/actions/claude-skills.ts
929
+ import {
930
+ existsSync as existsSync7,
931
+ mkdirSync as mkdirSync4,
932
+ readdirSync as readdirSync4,
933
+ readFileSync as readFileSync7,
934
+ rmSync,
935
+ statSync as statSync2,
936
+ writeFileSync as writeFileSync5
937
+ } from "fs";
938
+ import PATH6 from "path";
939
+ import chalk13 from "chalk";
940
+ var syncSkillFiles = (skillsDir) => {
941
+ const templates = claudeSkillTemplates();
942
+ const templateNames = new Set(Object.keys(templates));
943
+ let updated = 0;
944
+ let created = 0;
945
+ for (const [skillName, files] of Object.entries(templates)) {
946
+ const skillDir = PATH6.resolve(skillsDir, skillName);
947
+ mkdirSync4(skillDir, { recursive: true });
948
+ for (const [filename3, content] of Object.entries(files)) {
949
+ const targetPath = PATH6.resolve(skillDir, filename3);
950
+ mkdirSync4(PATH6.dirname(targetPath), { recursive: true });
951
+ const existing = existsSync7(targetPath) ? readFileSync7(targetPath, "utf8") : void 0;
952
+ if (existing === content) continue;
953
+ writeFileSync5(targetPath, content, "utf8");
954
+ if (existing) {
955
+ updated++;
956
+ } else {
957
+ created++;
958
+ }
959
+ }
960
+ }
961
+ return {
962
+ created,
963
+ templateNames,
964
+ updated
965
+ };
966
+ };
967
+ var removeStaleSkills = (skillsDir, templateNames) => {
968
+ const existingSkills = readdirSync4(skillsDir).filter(
969
+ (f) => f.startsWith(XYLABS_SKILLS_PREFIX) && statSync2(PATH6.resolve(skillsDir, f)).isDirectory()
970
+ );
971
+ let removed = 0;
972
+ for (const dir of existingSkills) {
973
+ if (!templateNames.has(dir)) {
974
+ rmSync(PATH6.resolve(skillsDir, dir), { recursive: true });
975
+ removed++;
976
+ }
977
+ }
978
+ return removed;
979
+ };
980
+ var logSkillsResult = (created, updated, removed) => {
981
+ if (created || updated || removed) {
982
+ const parts = [
983
+ created ? `${created} created` : "",
984
+ updated ? `${updated} updated` : "",
985
+ removed ? `${removed} removed` : ""
986
+ ].filter(Boolean);
987
+ console.log(chalk13.green(`.claude/skills/${XYLABS_SKILLS_PREFIX}*/: ${parts.join(", ")}`));
988
+ } else {
989
+ console.log(chalk13.gray(`.claude/skills/${XYLABS_SKILLS_PREFIX}*/: already up to date`));
990
+ }
991
+ };
992
+ var claudeSkills = () => {
993
+ const cwd = INIT_CWD() ?? process.cwd();
994
+ const skillsDir = PATH6.resolve(cwd, ".claude", "skills");
995
+ mkdirSync4(skillsDir, { recursive: true });
996
+ const {
997
+ created,
998
+ templateNames,
999
+ updated
1000
+ } = syncSkillFiles(skillsDir);
1001
+ const removed = removeStaleSkills(skillsDir, templateNames);
1002
+ logSkillsResult(created, updated, removed);
1003
+ return 0;
1004
+ };
1005
+
816
1006
  // src/actions/clean.ts
817
1007
  var clean = async ({ verbose, pkg }) => {
818
1008
  return pkg ? await cleanPackage({ pkg, verbose }) : cleanAll({ verbose });
@@ -827,16 +1017,16 @@ var cleanAll = ({ verbose }) => {
827
1017
 
828
1018
  // src/actions/clean-docs.ts
829
1019
  import path from "path";
830
- import chalk13 from "chalk";
1020
+ import chalk14 from "chalk";
831
1021
  var cleanDocs = () => {
832
1022
  const pkgName = process.env.npm_package_name;
833
- console.log(chalk13.green(`Cleaning Docs [${pkgName}]`));
1023
+ console.log(chalk14.green(`Cleaning Docs [${pkgName}]`));
834
1024
  for (const { location } of yarnWorkspaces()) deleteGlob(path.join(location, "docs"));
835
1025
  return 0;
836
1026
  };
837
1027
 
838
1028
  // src/actions/compile.ts
839
- import chalk14 from "chalk";
1029
+ import chalk15 from "chalk";
840
1030
  var compile = ({
841
1031
  verbose,
842
1032
  target,
@@ -877,7 +1067,7 @@ var compileAll = ({
877
1067
  const incrementalOptions = incremental ? ["--since", "-Ap", "--topological-dev"] : ["--parallel", "-Ap", "--topological-dev"];
878
1068
  const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
879
1069
  if (jobs) {
880
- console.log(chalk14.blue(`Jobs set to [${jobs}]`));
1070
+ console.log(chalk15.blue(`Jobs set to [${jobs}]`));
881
1071
  }
882
1072
  const result = runSteps(`Compile${incremental ? "-Incremental" : ""} [All]`, [
883
1073
  ["yarn", [
@@ -891,13 +1081,13 @@ var compileAll = ({
891
1081
  ...targetOptions
892
1082
  ]]
893
1083
  ]);
894
- console.log(`${chalk14.gray("Compiled in")} [${chalk14.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk14.gray("seconds")}`);
1084
+ console.log(`${chalk15.gray("Compiled in")} [${chalk15.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk15.gray("seconds")}`);
895
1085
  return result;
896
1086
  };
897
1087
 
898
1088
  // src/actions/copy-assets.ts
899
1089
  import path2 from "path/posix";
900
- import chalk15 from "chalk";
1090
+ import chalk16 from "chalk";
901
1091
  import cpy from "cpy";
902
1092
  var copyPackageTargetAssets = async (target, name, location) => {
903
1093
  try {
@@ -920,7 +1110,7 @@ var copyPackageTargetAssets = async (target, name, location) => {
920
1110
  };
921
1111
  var copyTargetAssets = async (target, pkg) => {
922
1112
  const workspaces = yarnWorkspaces();
923
- console.log(chalk15.green(`Copying Assets [${target.toUpperCase()}]`));
1113
+ console.log(chalk16.green(`Copying Assets [${target.toUpperCase()}]`));
924
1114
  const workspaceList = workspaces.filter(({ name }) => {
925
1115
  return pkg === void 0 || name === pkg;
926
1116
  });
@@ -1004,7 +1194,7 @@ var dead = () => {
1004
1194
  };
1005
1195
 
1006
1196
  // src/actions/deplint/deplint.ts
1007
- import chalk21 from "chalk";
1197
+ import chalk22 from "chalk";
1008
1198
 
1009
1199
  // src/actions/deplint/findFiles.ts
1010
1200
  import fs2 from "fs";
@@ -1209,7 +1399,7 @@ function getExternalImportsFromFiles({
1209
1399
 
1210
1400
  // src/actions/deplint/checkPackage/getUnlistedDependencies.ts
1211
1401
  import { builtinModules } from "module";
1212
- import chalk16 from "chalk";
1402
+ import chalk17 from "chalk";
1213
1403
  function isRuntimeImportListed(imp, name, dependencies, peerDependencies) {
1214
1404
  return dependencies.includes(imp) || imp === name || peerDependencies.includes(imp) || builtinModules.includes(imp);
1215
1405
  }
@@ -1217,7 +1407,7 @@ function isTypeImportListed(imp, name, dependencies, devDependencies, peerDepend
1217
1407
  return dependencies.includes(imp) || imp === name || dependencies.includes(`@types/${imp}`) || peerDependencies.includes(imp) || peerDependencies.includes(`@types/${imp}`) || devDependencies.includes(`@types/${imp}`) || builtinModules.includes(imp);
1218
1408
  }
1219
1409
  function logMissing(name, imp, importPaths) {
1220
- console.log(`[${chalk16.blue(name)}] Missing dependency in package.json: ${chalk16.red(imp)}`);
1410
+ console.log(`[${chalk17.blue(name)}] Missing dependency in package.json: ${chalk17.red(imp)}`);
1221
1411
  if (importPaths[imp]) {
1222
1412
  console.log(` ${importPaths[imp].join("\n ")}`);
1223
1413
  }
@@ -1246,7 +1436,7 @@ function getUnlistedDependencies({ name, location }, {
1246
1436
  }
1247
1437
  if (unlistedDependencies > 0) {
1248
1438
  const packageLocation = `${location}/package.json`;
1249
- console.log(` ${chalk16.yellow(packageLocation)}
1439
+ console.log(` ${chalk17.yellow(packageLocation)}
1250
1440
  `);
1251
1441
  }
1252
1442
  return unlistedDependencies;
@@ -1254,7 +1444,7 @@ function getUnlistedDependencies({ name, location }, {
1254
1444
 
1255
1445
  // src/actions/deplint/checkPackage/getUnlistedDevDependencies.ts
1256
1446
  import { builtinModules as builtinModules2 } from "module";
1257
- import chalk17 from "chalk";
1447
+ import chalk18 from "chalk";
1258
1448
  function getUnlistedDevDependencies({ name, location }, {
1259
1449
  devDependencies,
1260
1450
  dependencies,
@@ -1268,7 +1458,7 @@ function getUnlistedDevDependencies({ name, location }, {
1268
1458
  for (const imp of externalAllImports) {
1269
1459
  if (!distImports.includes(imp) && imp !== name && !dependencies.includes(imp) && !dependencies.includes(`@types/${imp}`) && !peerDependencies.includes(imp) && !peerDependencies.includes(`@types/${imp}`) && !devDependencies.includes(imp) && !devDependencies.includes(`@types/${imp}`) && !builtinModules2.includes(imp)) {
1270
1460
  unlistedDevDependencies++;
1271
- console.log(`[${chalk17.blue(name)}] Missing devDependency in package.json: ${chalk17.red(imp)}`);
1461
+ console.log(`[${chalk18.blue(name)}] Missing devDependency in package.json: ${chalk18.red(imp)}`);
1272
1462
  if (allImportPaths[imp]) {
1273
1463
  console.log(` ${allImportPaths[imp].join("\n ")}`);
1274
1464
  }
@@ -1276,14 +1466,14 @@ function getUnlistedDevDependencies({ name, location }, {
1276
1466
  }
1277
1467
  if (unlistedDevDependencies > 0) {
1278
1468
  const packageLocation = `${location}/package.json`;
1279
- console.log(` ${chalk17.yellow(packageLocation)}
1469
+ console.log(` ${chalk18.yellow(packageLocation)}
1280
1470
  `);
1281
1471
  }
1282
1472
  return unlistedDevDependencies;
1283
1473
  }
1284
1474
 
1285
1475
  // src/actions/deplint/checkPackage/getUnusedDependencies.ts
1286
- import chalk18 from "chalk";
1476
+ import chalk19 from "chalk";
1287
1477
  function getUnusedDependencies({ name, location }, { dependencies }, {
1288
1478
  externalDistImports,
1289
1479
  externalDistTypeImports,
@@ -1295,22 +1485,22 @@ function getUnusedDependencies({ name, location }, { dependencies }, {
1295
1485
  if (!externalDistImports.includes(dep) && !externalDistImports.includes(dep.replace(/^@types\//, "")) && !externalDistTypeImports.includes(dep) && !externalDistTypeImports.includes(dep.replace(/^@types\//, ""))) {
1296
1486
  unusedDependencies++;
1297
1487
  if (externalAllImports.includes(dep)) {
1298
- console.log(`[${chalk18.blue(name)}] dependency should be devDependency in package.json: ${chalk18.red(dep)}`);
1488
+ console.log(`[${chalk19.blue(name)}] dependency should be devDependency in package.json: ${chalk19.red(dep)}`);
1299
1489
  } else {
1300
- console.log(`[${chalk18.blue(name)}] Unused dependency in package.json: ${chalk18.red(dep)}`);
1490
+ console.log(`[${chalk19.blue(name)}] Unused dependency in package.json: ${chalk19.red(dep)}`);
1301
1491
  }
1302
1492
  }
1303
1493
  }
1304
1494
  if (unusedDependencies > 0) {
1305
1495
  const packageLocation = `${location}/package.json`;
1306
- console.log(` ${chalk18.yellow(packageLocation)}
1496
+ console.log(` ${chalk19.yellow(packageLocation)}
1307
1497
  `);
1308
1498
  }
1309
1499
  return unusedDependencies;
1310
1500
  }
1311
1501
 
1312
1502
  // src/actions/deplint/checkPackage/getUnusedDevDependencies.ts
1313
- import chalk19 from "chalk";
1503
+ import chalk20 from "chalk";
1314
1504
 
1315
1505
  // src/actions/deplint/getCliReferencedPackagesFromFiles.ts
1316
1506
  import fs8 from "fs";
@@ -1594,19 +1784,19 @@ function getUnusedDevDependencies({ name, location }, {
1594
1784
  if (dependencies.includes(dep) || peerDependencies.includes(dep)) continue;
1595
1785
  if (!isDevDepUsed(dep, allImports, implicitDeps, requiredPeers, scriptRefs, cliRefs)) {
1596
1786
  unusedDevDependencies++;
1597
- console.log(`[${chalk19.blue(name)}] Unused devDependency in package.json: ${chalk19.red(dep)}`);
1787
+ console.log(`[${chalk20.blue(name)}] Unused devDependency in package.json: ${chalk20.red(dep)}`);
1598
1788
  }
1599
1789
  }
1600
1790
  if (unusedDevDependencies > 0) {
1601
1791
  const packageLocation = `${location}/package.json`;
1602
- console.log(` ${chalk19.yellow(packageLocation)}
1792
+ console.log(` ${chalk20.yellow(packageLocation)}
1603
1793
  `);
1604
1794
  }
1605
1795
  return unusedDevDependencies;
1606
1796
  }
1607
1797
 
1608
1798
  // src/actions/deplint/checkPackage/getUnusedPeerDependencies.ts
1609
- import chalk20 from "chalk";
1799
+ import chalk21 from "chalk";
1610
1800
  function getUnusedPeerDependencies({ name, location }, { peerDependencies, dependencies }, { externalDistImports, externalDistTypeImports }, exclude) {
1611
1801
  let unusedDependencies = 0;
1612
1802
  for (const dep of peerDependencies) {
@@ -1614,15 +1804,15 @@ function getUnusedPeerDependencies({ name, location }, { peerDependencies, depen
1614
1804
  if (!externalDistImports.includes(dep) && !externalDistImports.includes(dep.replace(/^@types\//, "")) && !externalDistTypeImports.includes(dep) && !externalDistTypeImports.includes(dep.replace(/^@types\//, ""))) {
1615
1805
  unusedDependencies++;
1616
1806
  if (dependencies.includes(dep)) {
1617
- console.log(`[${chalk20.blue(name)}] Unused peerDependency [already a dependency] in package.json: ${chalk20.red(dep)}`);
1807
+ console.log(`[${chalk21.blue(name)}] Unused peerDependency [already a dependency] in package.json: ${chalk21.red(dep)}`);
1618
1808
  } else {
1619
- console.log(`[${chalk20.blue(name)}] Unused peerDependency in package.json: ${chalk20.red(dep)}`);
1809
+ console.log(`[${chalk21.blue(name)}] Unused peerDependency in package.json: ${chalk21.red(dep)}`);
1620
1810
  }
1621
1811
  }
1622
1812
  }
1623
1813
  if (unusedDependencies > 0) {
1624
1814
  const packageLocation = `${location}/package.json`;
1625
- console.log(` ${chalk20.yellow(packageLocation)}
1815
+ console.log(` ${chalk21.yellow(packageLocation)}
1626
1816
  `);
1627
1817
  }
1628
1818
  return unusedDependencies;
@@ -1717,19 +1907,19 @@ var deplint = async ({
1717
1907
  });
1718
1908
  }
1719
1909
  if (totalErrors > 0) {
1720
- console.warn(`Deplint: Found ${chalk21.red(totalErrors)} dependency problems. ${chalk21.red("\u2716")}`);
1910
+ console.warn(`Deplint: Found ${chalk22.red(totalErrors)} dependency problems. ${chalk22.red("\u2716")}`);
1721
1911
  } else {
1722
- console.info(`Deplint: Found no dependency problems. ${chalk21.green("\u2714")}`);
1912
+ console.info(`Deplint: Found no dependency problems. ${chalk22.green("\u2714")}`);
1723
1913
  }
1724
1914
  return 0;
1725
1915
  };
1726
1916
 
1727
1917
  // src/actions/deploy.ts
1728
- import { readFileSync as readFileSync6 } from "fs";
1918
+ import { readFileSync as readFileSync8 } from "fs";
1729
1919
  var privatePackageExcludeList = () => {
1730
1920
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1731
1921
  workspace,
1732
- JSON.parse(readFileSync6(`${workspace.location}/package.json`, { encoding: "utf8" }))
1922
+ JSON.parse(readFileSync8(`${workspace.location}/package.json`, { encoding: "utf8" }))
1733
1923
  ]);
1734
1924
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1735
1925
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -1749,11 +1939,11 @@ var deploy = () => {
1749
1939
  };
1750
1940
 
1751
1941
  // src/actions/deploy-major.ts
1752
- import { readFileSync as readFileSync7 } from "fs";
1942
+ import { readFileSync as readFileSync9 } from "fs";
1753
1943
  var privatePackageExcludeList2 = () => {
1754
1944
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1755
1945
  workspace,
1756
- JSON.parse(readFileSync7(`${workspace.location}/package.json`, { encoding: "utf8" }))
1946
+ JSON.parse(readFileSync9(`${workspace.location}/package.json`, { encoding: "utf8" }))
1757
1947
  ]);
1758
1948
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1759
1949
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -1773,11 +1963,11 @@ var deployMajor = () => {
1773
1963
  };
1774
1964
 
1775
1965
  // src/actions/deploy-minor.ts
1776
- import { readFileSync as readFileSync8 } from "fs";
1966
+ import { readFileSync as readFileSync10 } from "fs";
1777
1967
  var privatePackageExcludeList3 = () => {
1778
1968
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1779
1969
  workspace,
1780
- JSON.parse(readFileSync8(`${workspace.location}/package.json`, { encoding: "utf8" }))
1970
+ JSON.parse(readFileSync10(`${workspace.location}/package.json`, { encoding: "utf8" }))
1781
1971
  ]);
1782
1972
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1783
1973
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -1797,11 +1987,11 @@ var deployMinor = () => {
1797
1987
  };
1798
1988
 
1799
1989
  // src/actions/deploy-next.ts
1800
- import { readFileSync as readFileSync9 } from "fs";
1990
+ import { readFileSync as readFileSync11 } from "fs";
1801
1991
  var privatePackageExcludeList4 = () => {
1802
1992
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1803
1993
  workspace,
1804
- JSON.parse(readFileSync9(`${workspace.location}/package.json`, { encoding: "utf8" }))
1994
+ JSON.parse(readFileSync11(`${workspace.location}/package.json`, { encoding: "utf8" }))
1805
1995
  ]);
1806
1996
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1807
1997
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -1821,22 +2011,22 @@ var deployNext = () => {
1821
2011
  };
1822
2012
 
1823
2013
  // src/actions/dupdeps.ts
1824
- import chalk22 from "chalk";
2014
+ import chalk23 from "chalk";
1825
2015
  var dupdeps = () => {
1826
- console.log(chalk22.green("Checking all Dependencies for Duplicates"));
2016
+ console.log(chalk23.green("Checking all Dependencies for Duplicates"));
1827
2017
  const allDependencies = parsedPackageJSON()?.dependencies;
1828
2018
  const dependencies = Object.entries(allDependencies).map(([k]) => k);
1829
2019
  return detectDuplicateDependencies(dependencies);
1830
2020
  };
1831
2021
 
1832
2022
  // src/actions/lint.ts
1833
- import chalk23 from "chalk";
2023
+ import chalk24 from "chalk";
1834
2024
  var lintPackage = ({
1835
2025
  pkg,
1836
2026
  fix: fix2,
1837
2027
  verbose
1838
2028
  }) => {
1839
- console.log(chalk23.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
2029
+ console.log(chalk24.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
1840
2030
  const start = Date.now();
1841
2031
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
1842
2032
  ["yarn", [
@@ -1846,7 +2036,7 @@ var lintPackage = ({
1846
2036
  fix2 ? "package-fix" : verbose ? "package-lint-verbose" : "package-lint"
1847
2037
  ]]
1848
2038
  ]);
1849
- console.log(chalk23.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk23.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk23.gray("seconds")}`));
2039
+ console.log(chalk24.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk24.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk24.gray("seconds")}`));
1850
2040
  return result;
1851
2041
  };
1852
2042
  var lint = ({
@@ -1866,13 +2056,13 @@ var lint = ({
1866
2056
  });
1867
2057
  };
1868
2058
  var lintAllPackages = ({ fix: fix2 = false } = {}) => {
1869
- console.log(chalk23.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
2059
+ console.log(chalk24.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
1870
2060
  const start = Date.now();
1871
2061
  const fixOptions = fix2 ? ["--fix"] : [];
1872
2062
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
1873
2063
  ["yarn", ["eslint", "--cache", "--cache-location", ".eslintcache", "--cache-strategy", "content", ...fixOptions]]
1874
2064
  ]);
1875
- console.log(chalk23.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk23.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk23.gray("seconds")}`));
2065
+ console.log(chalk24.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk24.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk24.gray("seconds")}`));
1876
2066
  return result;
1877
2067
  };
1878
2068
 
@@ -1900,7 +2090,7 @@ var filename = ".gitignore";
1900
2090
  var gitignoreGen = (pkg) => generateIgnoreFiles(filename, pkg);
1901
2091
 
1902
2092
  // src/actions/gitlint.ts
1903
- import chalk24 from "chalk";
2093
+ import chalk25 from "chalk";
1904
2094
  import ParseGitConfig from "parse-git-config";
1905
2095
  var gitlint = () => {
1906
2096
  console.log(`
@@ -1911,7 +2101,7 @@ Gitlint Start [${process.cwd()}]
1911
2101
  const errors = 0;
1912
2102
  const gitConfig = ParseGitConfig.sync();
1913
2103
  const warn = (message) => {
1914
- console.warn(chalk24.yellow(`Warning: ${message}`));
2104
+ console.warn(chalk25.yellow(`Warning: ${message}`));
1915
2105
  warnings++;
1916
2106
  };
1917
2107
  if (gitConfig.core.ignorecase) {
@@ -1931,13 +2121,13 @@ Gitlint Start [${process.cwd()}]
1931
2121
  }
1932
2122
  const resultMessages = [];
1933
2123
  if (valid > 0) {
1934
- resultMessages.push(chalk24.green(`Passed: ${valid}`));
2124
+ resultMessages.push(chalk25.green(`Passed: ${valid}`));
1935
2125
  }
1936
2126
  if (warnings > 0) {
1937
- resultMessages.push(chalk24.yellow(`Warnings: ${warnings}`));
2127
+ resultMessages.push(chalk25.yellow(`Warnings: ${warnings}`));
1938
2128
  }
1939
2129
  if (errors > 0) {
1940
- resultMessages.push(chalk24.red(` Errors: ${errors}`));
2130
+ resultMessages.push(chalk25.red(` Errors: ${errors}`));
1941
2131
  }
1942
2132
  console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
1943
2133
  `);
@@ -1946,7 +2136,7 @@ Gitlint Start [${process.cwd()}]
1946
2136
 
1947
2137
  // src/actions/gitlint-fix.ts
1948
2138
  import { execSync as execSync3 } from "child_process";
1949
- import chalk25 from "chalk";
2139
+ import chalk26 from "chalk";
1950
2140
  import ParseGitConfig2 from "parse-git-config";
1951
2141
  var gitlintFix = () => {
1952
2142
  console.log(`
@@ -1955,15 +2145,15 @@ Gitlint Fix Start [${process.cwd()}]
1955
2145
  const gitConfig = ParseGitConfig2.sync();
1956
2146
  if (gitConfig.core.ignorecase) {
1957
2147
  execSync3("git config core.ignorecase false", { stdio: "inherit" });
1958
- console.warn(chalk25.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
2148
+ console.warn(chalk26.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
1959
2149
  }
1960
2150
  if (gitConfig.core.autocrlf !== false) {
1961
2151
  execSync3("git config core.autocrlf false", { stdio: "inherit" });
1962
- console.warn(chalk25.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
2152
+ console.warn(chalk26.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
1963
2153
  }
1964
2154
  if (gitConfig.core.eol !== "lf") {
1965
2155
  execSync3("git config core.eol lf", { stdio: "inherit" });
1966
- console.warn(chalk25.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
2156
+ console.warn(chalk26.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
1967
2157
  }
1968
2158
  return 1;
1969
2159
  };
@@ -1974,7 +2164,7 @@ var knip = () => {
1974
2164
  };
1975
2165
 
1976
2166
  // src/actions/license.ts
1977
- import chalk26 from "chalk";
2167
+ import chalk27 from "chalk";
1978
2168
  import { init } from "license-checker";
1979
2169
  var license = async (pkg) => {
1980
2170
  const workspaces = yarnWorkspaces();
@@ -1999,18 +2189,18 @@ var license = async (pkg) => {
1999
2189
  "LGPL-3.0-or-later",
2000
2190
  "Python-2.0"
2001
2191
  ]);
2002
- console.log(chalk26.green("License Checker"));
2192
+ console.log(chalk27.green("License Checker"));
2003
2193
  return (await Promise.all(
2004
2194
  workspaceList.map(({ location, name }) => {
2005
2195
  return new Promise((resolve) => {
2006
2196
  init({ production: true, start: location }, (error, packages) => {
2007
2197
  if (error) {
2008
- console.error(chalk26.red(`License Checker [${name}] Error`));
2009
- console.error(chalk26.gray(error));
2198
+ console.error(chalk27.red(`License Checker [${name}] Error`));
2199
+ console.error(chalk27.gray(error));
2010
2200
  console.log("\n");
2011
2201
  resolve(1);
2012
2202
  } else {
2013
- console.log(chalk26.green(`License Checker [${name}]`));
2203
+ console.log(chalk27.green(`License Checker [${name}]`));
2014
2204
  let count = 0;
2015
2205
  for (const [name2, info] of Object.entries(packages)) {
2016
2206
  const licenses = Array.isArray(info.licenses) ? info.licenses : [info.licenses];
@@ -2026,7 +2216,7 @@ var license = async (pkg) => {
2026
2216
  }
2027
2217
  if (!orLicenseFound) {
2028
2218
  count++;
2029
- console.warn(chalk26.yellow(`${name2}: Package License not allowed [${license2}]`));
2219
+ console.warn(chalk27.yellow(`${name2}: Package License not allowed [${license2}]`));
2030
2220
  }
2031
2221
  }
2032
2222
  }
@@ -2068,7 +2258,10 @@ async function readmeGen({
2068
2258
  typedoc,
2069
2259
  verbose
2070
2260
  }) {
2261
+ const config2 = await loadConfig();
2071
2262
  return await generateReadmeFiles({
2263
+ logoLinkUrl: config2.readme?.logoLinkUrl,
2264
+ logoUrl: config2.readme?.logoUrl,
2072
2265
  pkg,
2073
2266
  templatePath,
2074
2267
  typedoc,
@@ -2076,6 +2269,15 @@ async function readmeGen({
2076
2269
  });
2077
2270
  }
2078
2271
 
2272
+ // src/actions/readme-init.ts
2273
+ async function readmeInit({ templatePath }) {
2274
+ const config2 = await loadConfig();
2275
+ const template = applyLogoConfig(DEFAULT_README_TEMPLATE, config2.readme?.logoUrl, config2.readme?.logoLinkUrl);
2276
+ const resolvedTemplatePath = resolveTemplatePath(templatePath);
2277
+ await scaffoldTemplate(resolvedTemplatePath, template);
2278
+ return 0;
2279
+ }
2280
+
2079
2281
  // src/actions/rebuild.ts
2080
2282
  var rebuild = ({ target }) => {
2081
2283
  return runSteps("Rebuild", [
@@ -2085,7 +2287,7 @@ var rebuild = ({ target }) => {
2085
2287
  };
2086
2288
 
2087
2289
  // src/actions/recompile.ts
2088
- import chalk27 from "chalk";
2290
+ import chalk28 from "chalk";
2089
2291
  var recompile = async ({
2090
2292
  verbose,
2091
2293
  target,
@@ -2121,7 +2323,7 @@ var recompileAll = async ({
2121
2323
  const incrementalOptions = incremental ? ["--since", "-Apt", "--topological-dev"] : ["--parallel", "-Apt", "--topological-dev"];
2122
2324
  const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
2123
2325
  if (jobs) {
2124
- console.log(chalk27.blue(`Jobs set to [${jobs}]`));
2326
+ console.log(chalk28.blue(`Jobs set to [${jobs}]`));
2125
2327
  }
2126
2328
  const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
2127
2329
  [
@@ -2152,7 +2354,7 @@ var recompileAll = async ({
2152
2354
  ]
2153
2355
  ]);
2154
2356
  console.log(
2155
- `${chalk27.gray("Recompiled in")} [${chalk27.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk27.gray("seconds")}`
2357
+ `${chalk28.gray("Recompiled in")} [${chalk28.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk28.gray("seconds")}`
2156
2358
  );
2157
2359
  return result;
2158
2360
  };
@@ -2161,7 +2363,7 @@ var recompileAll = async ({
2161
2363
  import {
2162
2364
  closeSync,
2163
2365
  openSync,
2164
- rmSync
2366
+ rmSync as rmSync2
2165
2367
  } from "fs";
2166
2368
  var reinstall = () => {
2167
2369
  console.log("Reinstall [Clear Lock File]");
@@ -2171,7 +2373,7 @@ var reinstall = () => {
2171
2373
  const result = workspaces.map(({ location, name }) => {
2172
2374
  const dist = `${location}/node_modules`;
2173
2375
  try {
2174
- rmSync(dist, { force: true, recursive: true });
2376
+ rmSync2(dist, { force: true, recursive: true });
2175
2377
  return 0;
2176
2378
  } catch (ex) {
2177
2379
  const error = ex;
@@ -2183,13 +2385,13 @@ var reinstall = () => {
2183
2385
  };
2184
2386
 
2185
2387
  // src/actions/relint.ts
2186
- import chalk28 from "chalk";
2388
+ import chalk29 from "chalk";
2187
2389
  var relintPackage = ({
2188
2390
  pkg,
2189
2391
  fix: fix2,
2190
2392
  verbose
2191
2393
  }) => {
2192
- console.log(chalk28.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
2394
+ console.log(chalk29.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
2193
2395
  const start = Date.now();
2194
2396
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
2195
2397
  ["yarn", [
@@ -2199,7 +2401,7 @@ var relintPackage = ({
2199
2401
  fix2 ? "package-fix" : verbose ? "package-lint-verbose" : "package-lint"
2200
2402
  ]]
2201
2403
  ]);
2202
- console.log(chalk28.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk28.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk28.gray("seconds")}`));
2404
+ console.log(chalk29.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk29.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk29.gray("seconds")}`));
2203
2405
  return result;
2204
2406
  };
2205
2407
  var relint = ({
@@ -2219,21 +2421,21 @@ var relint = ({
2219
2421
  });
2220
2422
  };
2221
2423
  var relintAllPackages = ({ fix: fix2 = false } = {}) => {
2222
- console.log(chalk28.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
2424
+ console.log(chalk29.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
2223
2425
  const start = Date.now();
2224
2426
  const fixOptions = fix2 ? ["--fix"] : [];
2225
2427
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
2226
2428
  ["yarn", ["eslint", ...fixOptions]]
2227
2429
  ]);
2228
- console.log(chalk28.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk28.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk28.gray("seconds")}`));
2430
+ console.log(chalk29.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk29.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk29.gray("seconds")}`));
2229
2431
  return result;
2230
2432
  };
2231
2433
 
2232
2434
  // src/actions/retest.ts
2233
2435
  var retest = () => {
2234
2436
  return runSteps("Test", [
2235
- ["yarn", ["jest", "--clearCache"]],
2236
- ["yarn", ["jest", "."]]
2437
+ ["yarn", ["vitest", "--clearCache"]],
2438
+ ["yarn", ["vitest", "."]]
2237
2439
  ]);
2238
2440
  };
2239
2441
 
@@ -2243,10 +2445,10 @@ var sonar = () => {
2243
2445
  };
2244
2446
 
2245
2447
  // src/actions/statics.ts
2246
- import chalk29 from "chalk";
2448
+ import chalk30 from "chalk";
2247
2449
  var DefaultDependencies = ["axios", "@xylabs/pixel", "react", "graphql", "react-router", "@mui/material", "@mui/system"];
2248
2450
  var statics = () => {
2249
- console.log(chalk29.green("Check Required Static Dependencies"));
2451
+ console.log(chalk30.green("Check Required Static Dependencies"));
2250
2452
  const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
2251
2453
  return detectDuplicateDependencies(statics2, DefaultDependencies);
2252
2454
  };
@@ -2294,558 +2496,696 @@ var yarn3Only = () => {
2294
2496
  return 0;
2295
2497
  };
2296
2498
 
2297
- // src/xy/xyBuildCommands.ts
2298
- var xyBuildCommands = (args) => {
2299
- return args.command(
2300
- "build [package]",
2301
- "Build - Compile & Lint",
2302
- (yargs2) => {
2303
- return yargs2.positional("package", { describe: "Specific package to build" });
2304
- },
2305
- async (argv) => {
2306
- if (argv.verbose) {
2307
- console.log(`Building: ${argv.package ?? "all"}`);
2308
- }
2309
- process.exitCode = await build({
2310
- incremental: !!argv.incremental,
2311
- jobs: argv.jobs,
2312
- pkg: argv.package,
2313
- target: argv.target,
2314
- verbose: !!argv.verbose
2315
- });
2316
- }
2317
- ).command(
2318
- "compile [package]",
2319
- "Compile with Typescript & Copy Images",
2320
- (yargs2) => {
2321
- return yargs2.positional("package", { describe: "Specific package to compile" });
2322
- },
2323
- (argv) => {
2324
- if (argv.verbose) {
2325
- console.log(`Compiling: ${argv.package ?? "all"}`);
2326
- }
2327
- process.exitCode = compile({
2328
- incremental: !!argv.incremental,
2329
- jobs: argv.jobs,
2330
- pkg: argv.package,
2331
- target: argv.target,
2332
- verbose: !!argv.verbose
2333
- });
2334
- }
2335
- ).command(
2336
- "compile-only [package]",
2337
- "Compile with Typescript & Copy Images (No Publint)",
2338
- (yargs2) => {
2339
- return yargs2.positional("package", { describe: "Specific package to compile" });
2340
- },
2341
- (argv) => {
2342
- if (argv.verbose) {
2343
- console.log(`Compiling: ${argv.package ?? "all"}`);
2344
- }
2345
- process.exitCode = compile({
2346
- incremental: !!argv.incremental,
2347
- jobs: argv.jobs,
2348
- pkg: argv.package,
2349
- publint: false,
2350
- target: argv.target,
2351
- verbose: !!argv.verbose
2352
- });
2353
- }
2354
- ).command(
2355
- "recompile [package]",
2356
- "Re-compile with Typescript & Copy Images",
2357
- (yargs2) => {
2358
- return yargs2.positional("package", { describe: "Specific package to re-compile" });
2359
- },
2360
- async (argv) => {
2361
- if (argv.verbose) {
2362
- console.log(`Re-compiling: ${argv.package ?? "all"}`);
2363
- }
2364
- process.exitCode = await recompile({
2365
- incremental: !!argv.incremental,
2366
- jobs: argv.jobs,
2367
- pkg: argv.package,
2368
- target: argv.target,
2369
- verbose: !!argv.verbose
2370
- });
2371
- }
2372
- ).command(
2373
- "rebuild [package]",
2374
- "Rebuild - Clean, Compile & Lint",
2375
- (yargs2) => {
2376
- return yargs2.positional("package", { describe: "Specific package to rebuild" });
2377
- },
2378
- (argv) => {
2379
- if (argv.verbose) console.log(`Rebuilding: ${argv.package ?? "all"}`);
2380
- process.exitCode = rebuild({ target: argv.target });
2381
- }
2382
- ).command(
2383
- "copy-assets [package]",
2384
- "Copy Assets - Copy the assets from src to dist",
2385
- (yargs2) => {
2386
- return yargs2.positional("package", { describe: "Specific package to copy assets" });
2387
- },
2388
- async (argv) => {
2389
- if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? "all"}`);
2390
- process.exitCode = await copyAssets({ target: argv.target });
2391
- }
2392
- );
2393
- };
2394
-
2395
2499
  // src/xy/param.ts
2396
2500
  var packagePositionalParam = (yargs2) => {
2397
2501
  return yargs2.positional("package", { describe: "Specific package to target", type: "string" });
2398
2502
  };
2399
2503
 
2400
- // src/xy/xyCommonCommands.ts
2504
+ // src/xy/build-commands/build.ts
2505
+ var buildCommand = {
2506
+ builder: (yargs2) => {
2507
+ return packagePositionalParam(yargs2);
2508
+ },
2509
+ command: "build [package]",
2510
+ describe: "Build - Compile & Lint",
2511
+ handler: async (argv) => {
2512
+ if (argv.verbose) {
2513
+ console.log(`Building: ${argv.package ?? "all"}`);
2514
+ }
2515
+ process.exitCode = await build({
2516
+ incremental: !!argv.incremental,
2517
+ jobs: argv.jobs,
2518
+ pkg: argv.package,
2519
+ target: argv.target,
2520
+ verbose: !!argv.verbose
2521
+ });
2522
+ }
2523
+ };
2524
+ var compileCommand = {
2525
+ builder: (yargs2) => {
2526
+ return packagePositionalParam(yargs2);
2527
+ },
2528
+ command: "compile [package]",
2529
+ describe: "Compile with Typescript & Copy Images",
2530
+ handler: (argv) => {
2531
+ if (argv.verbose) {
2532
+ console.log(`Compiling: ${argv.package ?? "all"}`);
2533
+ }
2534
+ process.exitCode = compile({
2535
+ incremental: !!argv.incremental,
2536
+ jobs: argv.jobs,
2537
+ pkg: argv.package,
2538
+ target: argv.target,
2539
+ verbose: !!argv.verbose
2540
+ });
2541
+ }
2542
+ };
2543
+ var compileOnlyCommand = {
2544
+ builder: (yargs2) => {
2545
+ return packagePositionalParam(yargs2);
2546
+ },
2547
+ command: "compile-only [package]",
2548
+ describe: "Compile with Typescript & Copy Images (No Publint)",
2549
+ handler: (argv) => {
2550
+ if (argv.verbose) {
2551
+ console.log(`Compiling: ${argv.package ?? "all"}`);
2552
+ }
2553
+ process.exitCode = compile({
2554
+ incremental: !!argv.incremental,
2555
+ jobs: argv.jobs,
2556
+ pkg: argv.package,
2557
+ publint: false,
2558
+ target: argv.target,
2559
+ verbose: !!argv.verbose
2560
+ });
2561
+ }
2562
+ };
2563
+ var recompileCommand = {
2564
+ builder: (yargs2) => {
2565
+ return packagePositionalParam(yargs2);
2566
+ },
2567
+ command: "recompile [package]",
2568
+ describe: "Re-compile with Typescript & Copy Images",
2569
+ handler: async (argv) => {
2570
+ if (argv.verbose) {
2571
+ console.log(`Re-compiling: ${argv.package ?? "all"}`);
2572
+ }
2573
+ process.exitCode = await recompile({
2574
+ incremental: !!argv.incremental,
2575
+ jobs: argv.jobs,
2576
+ pkg: argv.package,
2577
+ target: argv.target,
2578
+ verbose: !!argv.verbose
2579
+ });
2580
+ }
2581
+ };
2582
+ var rebuildCommand = {
2583
+ builder: (yargs2) => {
2584
+ return packagePositionalParam(yargs2);
2585
+ },
2586
+ command: "rebuild [package]",
2587
+ describe: "Rebuild - Clean, Compile & Lint",
2588
+ handler: (argv) => {
2589
+ if (argv.verbose) console.log(`Rebuilding: ${argv.package ?? "all"}`);
2590
+ process.exitCode = rebuild({ target: argv.target });
2591
+ }
2592
+ };
2593
+ var copyAssetsCommand = {
2594
+ builder: (yargs2) => {
2595
+ return packagePositionalParam(yargs2);
2596
+ },
2597
+ command: "copy-assets [package]",
2598
+ describe: "Copy Assets - Copy the assets from src to dist",
2599
+ handler: async (argv) => {
2600
+ if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? "all"}`);
2601
+ process.exitCode = await copyAssets({ target: argv.target });
2602
+ }
2603
+ };
2604
+
2605
+ // src/xy/build-commands/index.ts
2606
+ var xyBuildCommands = (args) => {
2607
+ return args.command(buildCommand).command(compileCommand).command(compileOnlyCommand).command(rebuildCommand).command(recompileCommand).command(copyAssetsCommand);
2608
+ };
2609
+
2610
+ // src/xy/common/claude/commandsCommand.ts
2611
+ var commandsCommand = {
2612
+ command: "commands",
2613
+ describe: "Sync XY Labs standard Claude slash commands to .claude/commands/",
2614
+ handler: (argv) => {
2615
+ if (argv.verbose) console.log("Claude Commands");
2616
+ process.exitCode = claudeCommands();
2617
+ }
2618
+ };
2619
+
2620
+ // src/xy/common/claude/initCommand.ts
2621
+ var initCommand = {
2622
+ builder: (yargs2) => {
2623
+ return yargs2.option("force", {
2624
+ alias: "f",
2625
+ default: false,
2626
+ description: "Overwrite existing CLAUDE.md",
2627
+ type: "boolean"
2628
+ });
2629
+ },
2630
+ command: "init",
2631
+ describe: "Initialize all Claude configuration (commands, rules, settings)",
2632
+ handler: async (argv) => {
2633
+ if (argv.verbose) console.log("Claude Init");
2634
+ const commandsResult = claudeCommands();
2635
+ const rulesResult = claudeRules({ force: argv.force });
2636
+ const settingsResult = await claudeSettings();
2637
+ process.exitCode = commandsResult || rulesResult || settingsResult;
2638
+ }
2639
+ };
2640
+ var initClaudeSkillsCommand = {
2641
+ command: "init:skills",
2642
+ describe: "Initialize Claude skills configuration",
2643
+ handler: () => {
2644
+ const result = claudeSkills();
2645
+ process.exitCode = result;
2646
+ }
2647
+ };
2648
+
2649
+ // src/xy/common/claude/rulesCommand.ts
2650
+ var rulesCommand = {
2651
+ builder: (yargs2) => {
2652
+ return yargs2.option("force", {
2653
+ alias: "f",
2654
+ default: false,
2655
+ description: "Overwrite existing CLAUDE.md",
2656
+ type: "boolean"
2657
+ });
2658
+ },
2659
+ command: "rules",
2660
+ describe: "Sync XY Labs standard Claude rules to .claude/rules/",
2661
+ handler: (argv) => {
2662
+ if (argv.verbose) console.log("Claude Rules");
2663
+ process.exitCode = claudeRules({ force: argv.force });
2664
+ }
2665
+ };
2666
+
2667
+ // src/xy/common/claude/settingsCommand.ts
2668
+ var settingsCommand = {
2669
+ command: "settings",
2670
+ describe: "Initialize .claude/settings.local.json with XY Labs defaults",
2671
+ handler: async (argv) => {
2672
+ if (argv.verbose) console.log("Claude Settings");
2673
+ process.exitCode = await claudeSettings();
2674
+ }
2675
+ };
2676
+
2677
+ // src/xy/common/claude/index.ts
2678
+ var claudeCommand = {
2679
+ builder: (yargs2) => {
2680
+ return yargs2.command(commandsCommand).command(initCommand).command(rulesCommand).command(settingsCommand).command(initClaudeSkillsCommand).demandCommand(1, "Please specify a claude subcommand");
2681
+ },
2682
+ command: "claude",
2683
+ describe: "Claude - Claude Code configuration utilities",
2684
+ handler: () => {
2685
+ }
2686
+ };
2687
+
2688
+ // src/xy/common/cleanDocsCommand.ts
2689
+ var cleanDocsCommand = {
2690
+ command: "clean-docs",
2691
+ describe: "CleanDocs - Clean TypeDocs",
2692
+ handler: (argv) => {
2693
+ if (argv.verbose) console.log("Cleaning TypeDocs: all");
2694
+ process.exitCode = cleanDocs();
2695
+ }
2696
+ };
2697
+
2698
+ // src/xy/common/deadCommand.ts
2699
+ var deadCommand = {
2700
+ builder: (yargs2) => {
2701
+ return packagePositionalParam(yargs2);
2702
+ },
2703
+ command: "dead [package]",
2704
+ describe: "Dead - Check for dead code",
2705
+ handler: (argv) => {
2706
+ if (argv.verbose) console.log("Dead");
2707
+ process.exitCode = dead();
2708
+ }
2709
+ };
2710
+
2711
+ // src/xy/common/genDocsCommand.ts
2712
+ var genDocsCommand = {
2713
+ builder: (yargs2) => {
2714
+ return packagePositionalParam(yargs2);
2715
+ },
2716
+ command: "gen-docs [package]",
2717
+ describe: "GenDocs - Generate TypeDocs",
2718
+ handler: (argv) => {
2719
+ if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? "all"}`);
2720
+ process.exitCode = genDocs({ incremental: !!argv.incremental, pkg: argv.package });
2721
+ }
2722
+ };
2723
+
2724
+ // src/xy/common/gitignoreGenCommand.ts
2725
+ var gitignoreGenCommand = {
2726
+ command: "gitignore-gen",
2727
+ describe: "GitIgnore Gen - Generate .gitignore files",
2728
+ handler: (argv) => {
2729
+ if (argv.verbose) console.log("GitIgnore Gen");
2730
+ process.exitCode = gitignoreGen();
2731
+ }
2732
+ };
2733
+
2734
+ // src/xy/common/gitlintCommand.ts
2735
+ var gitlintCommand = {
2736
+ command: "gitlint [package]",
2737
+ describe: "Gitlint - Lint your git config",
2738
+ handler: (argv) => {
2739
+ if (argv.verbose) console.log("Gitlint");
2740
+ process.exitCode = argv.fix ? gitlintFix() : gitlint();
2741
+ }
2742
+ };
2743
+
2744
+ // src/xy/common/licenseCommand.ts
2745
+ var licenseCommand = {
2746
+ builder: (yargs2) => {
2747
+ return packagePositionalParam(yargs2);
2748
+ },
2749
+ command: "license [package]",
2750
+ describe: "License - Check licenses of dependencies",
2751
+ handler: async (argv) => {
2752
+ if (argv.verbose) console.log(`License: ${argv.package ?? "all"}`);
2753
+ process.exitCode = await license();
2754
+ }
2755
+ };
2756
+
2757
+ // src/xy/common/npmignoreGenCommand.ts
2758
+ var npmignoreGenCommand = {
2759
+ command: "npmignore-gen",
2760
+ describe: "NpmIgnore Gen - Generate .npmignore files",
2761
+ handler: (argv) => {
2762
+ if (argv.verbose) console.log("NpmIgnore Gen");
2763
+ process.exitCode = npmignoreGen();
2764
+ }
2765
+ };
2766
+
2767
+ // src/xy/common/readme/genCommand.ts
2768
+ var genCommand = {
2769
+ builder: (yargs2) => {
2770
+ return packagePositionalParam(yargs2).option("template", {
2771
+ alias: "t",
2772
+ description: "Path to README.template.md",
2773
+ type: "string"
2774
+ }).option("typedoc", {
2775
+ default: false,
2776
+ description: "Generate TypeDoc reference sections",
2777
+ type: "boolean"
2778
+ });
2779
+ },
2780
+ aliases: ["$0"],
2781
+ command: "gen [package]",
2782
+ describe: "Generate README.md files from template",
2783
+ handler: async (argv) => {
2784
+ if (argv.verbose) console.log("Readme Gen");
2785
+ process.exitCode = await readmeGen({
2786
+ pkg: argv.package,
2787
+ templatePath: argv.template,
2788
+ typedoc: argv.typedoc,
2789
+ verbose: !!argv.verbose
2790
+ });
2791
+ }
2792
+ };
2793
+
2794
+ // src/xy/common/readme/initCommand.ts
2795
+ var initCommand2 = {
2796
+ builder: (yargs2) => {
2797
+ return yargs2.option("template", {
2798
+ alias: "t",
2799
+ description: "Path to README.template.md",
2800
+ type: "string"
2801
+ });
2802
+ },
2803
+ command: "init",
2804
+ describe: "Initialize README template and logo files",
2805
+ handler: async (argv) => {
2806
+ if (argv.verbose) console.log("Readme Init");
2807
+ process.exitCode = await readmeInit({
2808
+ templatePath: argv.template,
2809
+ verbose: !!argv.verbose
2810
+ });
2811
+ }
2812
+ };
2813
+
2814
+ // src/xy/common/readme/index.ts
2815
+ var readmeCommand = {
2816
+ builder: (yargs2) => {
2817
+ return yargs2.command(genCommand).command(initCommand2);
2818
+ },
2819
+ command: "readme",
2820
+ describe: "Readme - README file utilities",
2821
+ handler: () => {
2822
+ }
2823
+ };
2824
+
2825
+ // src/xy/common/retestCommand.ts
2826
+ var retestCommand = {
2827
+ command: "retest",
2828
+ describe: "Re-Test - Run Jest Tests with cleaned cache",
2829
+ handler: (argv) => {
2830
+ if (argv.verbose) console.log("Re-Testing");
2831
+ process.exitCode = retest();
2832
+ }
2833
+ };
2834
+
2835
+ // src/xy/common/testCommand.ts
2836
+ var testCommand = {
2837
+ command: "test",
2838
+ describe: "Test - Run Jest Tests",
2839
+ handler: (argv) => {
2840
+ if (argv.verbose) console.log("Testing");
2841
+ process.exitCode = test();
2842
+ }
2843
+ };
2844
+
2845
+ // src/xy/common/upplugCommand.ts
2846
+ var upplugCommand = {
2847
+ command: "upplug",
2848
+ describe: "UpPlug - Update Yarn Plugins",
2849
+ handler: (argv) => {
2850
+ if (argv.verbose) console.log("UpPlug");
2851
+ process.exitCode = updateYarnPlugins();
2852
+ }
2853
+ };
2854
+
2855
+ // src/xy/common/upyarnCommand.ts
2856
+ var upyarnCommand = {
2857
+ command: "upyarn",
2858
+ describe: "UpYarn - Update Yarn Version",
2859
+ handler: (argv) => {
2860
+ if (argv.verbose) console.log("UpYarn");
2861
+ process.exitCode = updateYarnVersion();
2862
+ }
2863
+ };
2864
+
2865
+ // src/xy/common/yarn3OnlyCommand.ts
2866
+ var yarn3OnlyCommand = {
2867
+ command: "yarn3only",
2868
+ describe: "Yarn3Only - Check if using Yarn v3",
2869
+ handler: (argv) => {
2870
+ if (argv.verbose) console.log("Yarn 3 Check");
2871
+ process.exitCode = yarn3Only();
2872
+ }
2873
+ };
2874
+
2875
+ // src/xy/common/index.ts
2401
2876
  var xyCommonCommands = (args) => {
2402
- return args.command(
2403
- "claude-commands",
2404
- "Claude Commands - Sync XY Labs standard Claude slash commands to .claude/commands/",
2405
- (yargs2) => yargs2,
2406
- (argv) => {
2407
- if (argv.verbose) console.log("Claude Commands");
2408
- process.exitCode = claudeCommands();
2409
- }
2410
- ).command(
2411
- "claude-settings",
2412
- "Claude Settings - Initialize .claude/settings.local.json with XY Labs defaults",
2413
- (yargs2) => yargs2,
2414
- async (argv) => {
2415
- if (argv.verbose) console.log("Claude Settings");
2416
- process.exitCode = await claudeSettings();
2417
- }
2418
- ).command(
2419
- "claude-rules",
2420
- "Claude Rules - Sync XY Labs standard Claude rules to .claude/rules/",
2421
- (yargs2) => {
2422
- return yargs2.option("force", {
2423
- alias: "f",
2424
- default: false,
2425
- description: "Overwrite existing CLAUDE.md",
2426
- type: "boolean"
2427
- });
2428
- },
2429
- (argv) => {
2430
- if (argv.verbose) console.log("Claude Rules");
2431
- process.exitCode = claudeRules({ force: argv.force });
2432
- }
2433
- ).command(
2434
- "license [package]",
2435
- "License - Check licenses of dependencies",
2436
- (yargs2) => {
2437
- return packagePositionalParam(yargs2);
2438
- },
2439
- async (argv) => {
2440
- if (argv.verbose) console.log(`License: ${argv.package ?? "all"}`);
2441
- process.exitCode = await license();
2442
- }
2443
- ).command(
2444
- "dead [package]",
2445
- "Dead - Check for dead code",
2446
- (yargs2) => {
2447
- return packagePositionalParam(yargs2);
2448
- },
2449
- (argv) => {
2450
- if (argv.verbose) console.log("Dead");
2451
- process.exitCode = dead();
2452
- }
2453
- ).command(
2454
- "gen-docs [package]",
2455
- "GenDocs - Generate TypeDocs",
2456
- (yargs2) => {
2457
- return packagePositionalParam(yargs2);
2458
- },
2459
- (argv) => {
2460
- if (argv.verbose) console.log(`Generating TypeDocs: ${argv.package ?? "all"}`);
2461
- process.exitCode = genDocs({ incremental: !!argv.incremental, pkg: argv.package });
2462
- }
2463
- ).command(
2464
- "clean-docs",
2465
- "CleanDocs - Clean TypeDocs",
2466
- (yargs2) => yargs2,
2467
- (argv) => {
2468
- if (argv.verbose) console.log("Cleaning TypeDocs: all");
2469
- process.exitCode = cleanDocs();
2470
- }
2471
- ).command(
2472
- "gitlint [package]",
2473
- "Gitlint - Lint your git config",
2474
- (yargs2) => {
2475
- return yargs2;
2476
- },
2477
- (argv) => {
2478
- if (argv.verbose) console.log("Gitlint");
2479
- process.exitCode = argv.fix ? gitlintFix() : gitlint();
2480
- }
2481
- ).command(
2482
- "gitignore-gen",
2483
- "GitIgnore Gen - Generate .gitignore files",
2484
- (yargs2) => {
2485
- return yargs2;
2486
- },
2487
- (argv) => {
2488
- if (argv.verbose) console.log("GitIgnore Gen");
2489
- process.exitCode = gitignoreGen();
2490
- }
2491
- ).command(
2492
- "npmignore-gen",
2493
- "NpmIgnore Gen - Generate .npmignore files",
2494
- (yargs2) => {
2495
- return yargs2;
2496
- },
2497
- (argv) => {
2498
- if (argv.verbose) console.log("NpmIgnore Gen");
2499
- process.exitCode = npmignoreGen();
2500
- }
2501
- ).command(
2502
- "readme-gen [package]",
2503
- "Readme Gen - Generate README.md files from template",
2504
- (yargs2) => {
2505
- return packagePositionalParam(yargs2).option("template", {
2506
- alias: "t",
2507
- description: "Path to README.template.md",
2508
- type: "string"
2509
- }).option("typedoc", {
2510
- default: false,
2511
- description: "Generate TypeDoc reference sections",
2512
- type: "boolean"
2513
- });
2514
- },
2515
- async (argv) => {
2516
- if (argv.verbose) console.log("Readme Gen");
2517
- process.exitCode = await readmeGen({
2518
- pkg: argv.package,
2519
- templatePath: argv.template,
2520
- typedoc: argv.typedoc,
2521
- verbose: !!argv.verbose
2522
- });
2523
- }
2524
- ).command(
2525
- "retest",
2526
- "Re-Test - Run Jest Tests with cleaned cache",
2527
- (yargs2) => {
2528
- return yargs2;
2529
- },
2530
- (argv) => {
2531
- if (argv.verbose) console.log("Re-Testing");
2532
- process.exitCode = retest();
2533
- }
2534
- ).command(
2535
- "test",
2536
- "Test - Run Jest Tests",
2537
- (yargs2) => {
2538
- return yargs2;
2539
- },
2540
- (argv) => {
2541
- if (argv.verbose) console.log("Testing");
2542
- process.exitCode = test();
2543
- }
2544
- ).command(
2545
- "upplug",
2546
- "UpPlug - Update Yarn Plugins",
2547
- (yargs2) => {
2548
- return yargs2;
2549
- },
2550
- (argv) => {
2551
- if (argv.verbose) console.log("UpPlug");
2552
- process.exitCode = updateYarnPlugins();
2553
- }
2554
- ).command(
2555
- "upyarn",
2556
- "UpYarn - Update Yarn Version",
2557
- (yargs2) => {
2558
- return yargs2;
2559
- },
2560
- (argv) => {
2561
- if (argv.verbose) console.log("UpYarn");
2562
- process.exitCode = updateYarnVersion();
2563
- }
2564
- ).command(
2565
- "yarn3only",
2566
- "Yarn3Only - Check if using Yarn v3",
2567
- (yargs2) => {
2568
- return yargs2;
2569
- },
2570
- (argv) => {
2571
- if (argv.verbose) console.log("Yarn 3 Check");
2572
- process.exitCode = yarn3Only();
2573
- }
2574
- );
2877
+ 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);
2575
2878
  };
2576
2879
 
2577
- // src/xy/xyDeployCommands.ts
2880
+ // src/xy/deploy/deployCommand.ts
2881
+ var deployCommand = {
2882
+ command: "deploy",
2883
+ describe: "Deploy - Deploy patch",
2884
+ handler: (argv) => {
2885
+ if (argv.verbose) console.log("Deploy patch");
2886
+ process.exitCode = deploy();
2887
+ }
2888
+ };
2889
+
2890
+ // src/xy/deploy/deployMajorCommand.ts
2891
+ var deployMajorCommand = {
2892
+ command: "deploy-major",
2893
+ describe: "Deploy - Deploy major",
2894
+ handler: (argv) => {
2895
+ if (argv.verbose) console.log("Deploy major");
2896
+ process.exitCode = deployMajor();
2897
+ }
2898
+ };
2899
+
2900
+ // src/xy/deploy/deployMinorCommand.ts
2901
+ var deployMinorCommand = {
2902
+ command: "deploy-minor",
2903
+ describe: "Deploy - Deploy minor",
2904
+ handler: (argv) => {
2905
+ if (argv.verbose) console.log("Deploy minor");
2906
+ process.exitCode = deployMinor();
2907
+ }
2908
+ };
2909
+
2910
+ // src/xy/deploy/deployNextCommand.ts
2911
+ var deployNextCommand = {
2912
+ command: "deploy-next",
2913
+ describe: "Deploy - Deploy next",
2914
+ handler: (argv) => {
2915
+ if (argv.verbose) console.log("Deploy next");
2916
+ process.exitCode = deployNext();
2917
+ }
2918
+ };
2919
+
2920
+ // src/xy/deploy/publishCommand.ts
2921
+ var publishCommand = {
2922
+ command: "publish",
2923
+ describe: "Publish - Publish packages to npmjs",
2924
+ handler: (argv) => {
2925
+ if (argv.verbose) console.log("Publish packages to npmjs");
2926
+ process.exitCode = publish();
2927
+ }
2928
+ };
2929
+
2930
+ // src/xy/deploy/index.ts
2578
2931
  var xyDeployCommands = (args) => {
2579
- return args.command(
2580
- "deploy",
2581
- "Deploy - Deploy patch",
2582
- (yargs2) => {
2583
- return yargs2;
2584
- },
2585
- (argv) => {
2586
- if (argv.verbose) console.log("Deploy patch");
2587
- process.exitCode = deploy();
2588
- }
2589
- ).command(
2590
- "deploy-minor",
2591
- "Deploy - Deploy minor",
2592
- (yargs2) => {
2593
- return yargs2;
2594
- },
2595
- (argv) => {
2596
- if (argv.verbose) console.log("Deploy minor");
2597
- process.exitCode = deployMinor();
2598
- }
2599
- ).command(
2600
- "deploy-major",
2601
- "Deploy - Deploy major",
2602
- (yargs2) => {
2603
- return yargs2;
2604
- },
2605
- (argv) => {
2606
- if (argv.verbose) console.log("Deploy major");
2607
- process.exitCode = deployMajor();
2608
- }
2609
- ).command(
2610
- "deploy-next",
2611
- "Deploy - Deploy next",
2612
- (yargs2) => {
2613
- return yargs2;
2614
- },
2615
- (argv) => {
2616
- if (argv.verbose) console.log("Deploy next");
2617
- process.exitCode = deployNext();
2618
- }
2619
- ).command(
2620
- "publish",
2621
- "Publish - Publish packages to npmjs",
2622
- (yargs2) => {
2623
- return yargs2;
2624
- },
2625
- (argv) => {
2626
- if (argv.verbose) console.log("Publish packages to npmjs");
2627
- process.exitCode = publish();
2932
+ return args.command(deployCommand).command(deployMinorCommand).command(deployMajorCommand).command(deployNextCommand).command(publishCommand);
2933
+ };
2934
+
2935
+ // src/xy/install/cleanCommand.ts
2936
+ var cleanCommand = {
2937
+ command: "clean [package]",
2938
+ describe: "Clean",
2939
+ builder: (yargs2) => {
2940
+ return yargs2.positional("package", { describe: "Specific package to clean" });
2941
+ },
2942
+ handler: async (argv) => {
2943
+ if (argv.verbose) {
2944
+ console.log(`Cleaning: ${argv.package ?? "all"}`);
2628
2945
  }
2629
- );
2946
+ process.exitCode = await clean({
2947
+ pkg: argv.package,
2948
+ verbose: !!argv.verbose
2949
+ });
2950
+ }
2630
2951
  };
2631
2952
 
2632
- // src/xy/xyInstallCommands.ts
2953
+ // src/xy/install/dupdepsCommand.ts
2954
+ var dupdepsCommand = {
2955
+ command: "dupdeps",
2956
+ describe: "Dupdeps - Duplicate Dependencies in package.json",
2957
+ handler: (argv) => {
2958
+ if (argv.verbose) console.log("Dupdeps");
2959
+ process.exitCode = dupdeps();
2960
+ }
2961
+ };
2962
+
2963
+ // src/xy/install/reinstallCommand.ts
2964
+ var reinstallCommand = {
2965
+ command: "reinstall",
2966
+ describe: "Reinstall - Clean & Install",
2967
+ handler: (argv) => {
2968
+ if (argv.verbose) console.log("Reinstalling");
2969
+ process.exitCode = reinstall();
2970
+ }
2971
+ };
2972
+
2973
+ // src/xy/install/staticsCommand.ts
2974
+ var staticsCommand = {
2975
+ command: "statics",
2976
+ describe: "Statics - Confirming Static Packages",
2977
+ handler: (argv) => {
2978
+ if (argv.verbose) console.log("Statics");
2979
+ process.exitCode = statics();
2980
+ }
2981
+ };
2982
+
2983
+ // src/xy/install/upCommand.ts
2984
+ var upCommand = {
2985
+ command: "up",
2986
+ describe: "Up - Update dependencies",
2987
+ handler: (argv) => {
2988
+ if (argv.verbose) console.log("Up");
2989
+ process.exitCode = up();
2990
+ }
2991
+ };
2992
+
2993
+ // src/xy/install/updoCommand.ts
2994
+ var updoCommand = {
2995
+ command: "updo",
2996
+ describe: "Updo - Update dependencies [Interactive]",
2997
+ handler: (argv) => {
2998
+ if (argv.verbose) console.log("Updo");
2999
+ process.exitCode = updo();
3000
+ }
3001
+ };
3002
+
3003
+ // src/xy/install/index.ts
2633
3004
  var xyInstallCommands = (args) => {
2634
- return args.command(
2635
- "clean [package]",
2636
- "Clean",
2637
- (yargs2) => {
2638
- return yargs2.positional("package", { describe: "Specific package to clean" });
2639
- },
2640
- async (argv) => {
2641
- if (argv.verbose) {
2642
- console.log(`Cleaning: ${argv.package ?? "all"}`);
2643
- }
2644
- process.exitCode = await clean({
2645
- pkg: argv.package,
2646
- verbose: !!argv.verbose
2647
- });
2648
- }
2649
- ).command(
2650
- "reinstall",
2651
- "Reinstall - Clean & Install",
2652
- (yargs2) => {
2653
- return yargs2;
2654
- },
2655
- (argv) => {
2656
- if (argv.verbose) console.log("Reinstalling");
2657
- process.exitCode = reinstall();
2658
- }
2659
- ).command(
2660
- "up",
2661
- "Up - Update dependencies",
2662
- (yargs2) => {
2663
- return yargs2;
2664
- },
2665
- (argv) => {
2666
- if (argv.verbose) console.log("Up");
2667
- process.exitCode = up();
2668
- }
2669
- ).command(
2670
- "updo",
2671
- "Updo - Update dependencies [Interactive]",
2672
- (yargs2) => {
2673
- return yargs2;
2674
- },
2675
- (argv) => {
2676
- if (argv.verbose) console.log("Updo");
2677
- process.exitCode = updo();
2678
- }
2679
- ).command(
2680
- "statics",
2681
- "Statics - Confirming Static Packages",
2682
- (yargs2) => {
2683
- return yargs2;
2684
- },
2685
- (argv) => {
2686
- if (argv.verbose) console.log("Statics");
2687
- process.exitCode = statics();
2688
- }
2689
- ).command(
2690
- "dupdeps",
2691
- "Dupdeps - Duplicate Dependencies in package.json",
2692
- (yargs2) => {
2693
- return yargs2;
2694
- },
2695
- (argv) => {
2696
- if (argv.verbose) console.log("Dupdeps");
2697
- process.exitCode = dupdeps();
2698
- }
2699
- );
3005
+ return args.command(cleanCommand).command(reinstallCommand).command(upCommand).command(updoCommand).command(staticsCommand).command(dupdepsCommand);
2700
3006
  };
2701
3007
 
2702
- // src/xy/xyLintCommands.ts
2703
- import chalk30 from "chalk";
3008
+ // src/xy/lint/cycleCommand.ts
3009
+ import chalk31 from "chalk";
3010
+ var cycleCommand = {
3011
+ command: "cycle [package]",
3012
+ describe: "Cycle - Check for dependency cycles",
3013
+ builder: (yargs2) => {
3014
+ return packagePositionalParam(yargs2);
3015
+ },
3016
+ handler: async (argv) => {
3017
+ const start = Date.now();
3018
+ if (argv.verbose) console.log("Cycle");
3019
+ process.exitCode = await cycle({ pkg: argv.package });
3020
+ console.log(chalk31.blue(`Finished in ${Date.now() - start}ms`));
3021
+ }
3022
+ };
3023
+
3024
+ // src/xy/lint/deplintCommand.ts
3025
+ import chalk32 from "chalk";
3026
+ var deplintCommand = {
3027
+ command: "deplint [package]",
3028
+ describe: "Deplint - Run Deplint",
3029
+ builder: (yargs2) => {
3030
+ return packagePositionalParam(yargs2).option("deps", {
3031
+ alias: "d",
3032
+ default: false,
3033
+ description: "Check dependencies",
3034
+ type: "boolean"
3035
+ }).option("devDeps", {
3036
+ alias: "v",
3037
+ default: false,
3038
+ description: "Check devDependencies",
3039
+ type: "boolean"
3040
+ }).option("peerDeps", {
3041
+ alias: "p",
3042
+ default: false,
3043
+ description: "Check peerDependencies",
3044
+ type: "boolean"
3045
+ }).option("exclude", {
3046
+ alias: "e",
3047
+ description: "Package names to exclude from unused checks (comma-separated or repeated)",
3048
+ type: "array"
3049
+ });
3050
+ },
3051
+ handler: async (argv) => {
3052
+ if (argv.verbose) console.log("Deplint");
3053
+ const start = Date.now();
3054
+ const cliExclude = argv.exclude?.flatMap((v) => String(v).split(",")).map((v) => v.trim()).filter(Boolean);
3055
+ process.exitCode = await deplint({
3056
+ cliExclude,
3057
+ pkg: argv.package,
3058
+ deps: !!argv.deps,
3059
+ devDeps: !!argv.devDeps,
3060
+ peerDeps: !!argv.peerDeps,
3061
+ verbose: !!argv.verbose
3062
+ });
3063
+ console.log(chalk32.blue(`Finished in ${Date.now() - start}ms`));
3064
+ }
3065
+ };
3066
+
3067
+ // src/xy/lint/fixCommand.ts
3068
+ import chalk33 from "chalk";
3069
+ var fixCommand = {
3070
+ command: "fix [package]",
3071
+ describe: "Fix - Run Eslint w/fix",
3072
+ builder: (yargs2) => {
3073
+ return packagePositionalParam(yargs2);
3074
+ },
3075
+ handler: (argv) => {
3076
+ const start = Date.now();
3077
+ if (argv.verbose) console.log("Fix");
3078
+ process.exitCode = fix();
3079
+ console.log(chalk33.blue(`Finished in ${Date.now() - start}ms`));
3080
+ }
3081
+ };
3082
+
3083
+ // src/xy/lint/knipCommand.ts
3084
+ import chalk34 from "chalk";
3085
+ var knipCommand = {
3086
+ command: "knip",
3087
+ describe: "Knip - Run Knip",
3088
+ builder: (yargs2) => {
3089
+ return packagePositionalParam(yargs2);
3090
+ },
3091
+ handler: (argv) => {
3092
+ if (argv.verbose) console.log("Knip");
3093
+ const start = Date.now();
3094
+ process.exitCode = knip();
3095
+ console.log(chalk34.blue(`Knip finished in ${Date.now() - start}ms`));
3096
+ }
3097
+ };
3098
+
3099
+ // src/xy/lint/lintCommand.ts
3100
+ import chalk35 from "chalk";
3101
+ var lintCommand = {
3102
+ command: "lint [package]",
3103
+ describe: "Lint - Run Eslint",
3104
+ builder: (yargs2) => {
3105
+ return packagePositionalParam(yargs2).option("fix", {
3106
+ alias: "f",
3107
+ default: false,
3108
+ description: "Fix fixable issues",
3109
+ type: "boolean"
3110
+ }).option("cache", {
3111
+ alias: "c",
3112
+ default: false,
3113
+ description: "Use caching for performance",
3114
+ type: "boolean"
3115
+ });
3116
+ },
3117
+ handler: (argv) => {
3118
+ if (argv.verbose) console.log("Lint");
3119
+ const start = Date.now();
3120
+ process.exitCode = argv.fix ? fix({
3121
+ pkg: argv.package,
3122
+ cache: argv.cache,
3123
+ verbose: !!argv.verbose
3124
+ }) : lint({
3125
+ pkg: argv.package,
3126
+ cache: argv.cache,
3127
+ verbose: !!argv.verbose
3128
+ });
3129
+ console.log(chalk35.blue(`Finished in ${Date.now() - start}ms`));
3130
+ }
3131
+ };
3132
+
3133
+ // src/xy/lint/publintCommand.ts
3134
+ import chalk36 from "chalk";
3135
+ var publintCommand = {
3136
+ command: "publint [package]",
3137
+ describe: "Publint - Run Publint",
3138
+ builder: (yargs2) => {
3139
+ return packagePositionalParam(yargs2);
3140
+ },
3141
+ handler: async (argv) => {
3142
+ if (argv.verbose) console.log("Publint");
3143
+ const start = Date.now();
3144
+ process.exitCode = await publint({ pkg: argv.package, verbose: !!argv.verbose });
3145
+ console.log(chalk36.blue(`Finished in ${Date.now() - start}ms`));
3146
+ }
3147
+ };
3148
+
3149
+ // src/xy/lint/relintCommand.ts
3150
+ import chalk37 from "chalk";
3151
+ var relintCommand = {
3152
+ command: "relint [package]",
3153
+ describe: "Relint - Clean & Lint",
3154
+ builder: (yargs2) => {
3155
+ return packagePositionalParam(yargs2);
3156
+ },
3157
+ handler: (argv) => {
3158
+ if (argv.verbose) console.log("Relinting");
3159
+ const start = Date.now();
3160
+ process.exitCode = relint();
3161
+ console.log(chalk37.blue(`Finished in ${Date.now() - start}ms`));
3162
+ }
3163
+ };
3164
+
3165
+ // src/xy/lint/sonarCommand.ts
3166
+ import chalk38 from "chalk";
3167
+ var sonarCommand = {
3168
+ command: "sonar",
3169
+ describe: "Sonar - Run Sonar Check",
3170
+ builder: (yargs2) => {
3171
+ return packagePositionalParam(yargs2);
3172
+ },
3173
+ handler: (argv) => {
3174
+ const start = Date.now();
3175
+ if (argv.verbose) console.log("Sonar Check");
3176
+ process.exitCode = sonar();
3177
+ console.log(chalk38.blue(`Finished in ${Date.now() - start}ms`));
3178
+ }
3179
+ };
3180
+
3181
+ // src/xy/lint/index.ts
2704
3182
  var xyLintCommands = (args) => {
2705
- return args.command(
2706
- "cycle [package]",
2707
- "Cycle - Check for dependency cycles",
2708
- (yargs2) => {
2709
- return packagePositionalParam(yargs2);
2710
- },
2711
- async (argv) => {
2712
- const start = Date.now();
2713
- if (argv.verbose) console.log("Cycle");
2714
- process.exitCode = await cycle({ pkg: argv.package });
2715
- console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2716
- }
2717
- ).command(
2718
- "lint [package]",
2719
- "Lint - Run Eslint",
2720
- (yargs2) => {
2721
- return packagePositionalParam(yargs2).option("fix", {
2722
- alias: "f",
2723
- default: false,
2724
- description: "Fix fixable issues",
2725
- type: "boolean"
2726
- }).option("cache", {
2727
- alias: "c",
2728
- default: false,
2729
- description: "Use caching for performance",
2730
- type: "boolean"
2731
- });
2732
- },
2733
- (argv) => {
2734
- if (argv.verbose) console.log("Lint");
2735
- const start = Date.now();
2736
- process.exitCode = argv.fix ? fix({
2737
- pkg: argv.package,
2738
- cache: argv.cache,
2739
- verbose: !!argv.verbose
2740
- }) : lint({
2741
- pkg: argv.package,
2742
- cache: argv.cache,
2743
- verbose: !!argv.verbose
2744
- });
2745
- console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2746
- }
2747
- ).command(
2748
- "deplint [package]",
2749
- "Deplint - Run Deplint",
2750
- (yargs2) => {
2751
- return packagePositionalParam(yargs2).option("deps", {
2752
- alias: "d",
2753
- default: false,
2754
- description: "Check dependencies",
2755
- type: "boolean"
2756
- }).option("devDeps", {
2757
- alias: "v",
2758
- default: false,
2759
- description: "Check devDependencies",
2760
- type: "boolean"
2761
- }).option("peerDeps", {
2762
- alias: "p",
2763
- default: false,
2764
- description: "Check peerDependencies",
2765
- type: "boolean"
2766
- }).option("exclude", {
2767
- alias: "e",
2768
- description: "Package names to exclude from unused checks (comma-separated or repeated)",
2769
- type: "array"
2770
- });
2771
- },
2772
- async (argv) => {
2773
- if (argv.verbose) console.log("Deplint");
2774
- const start = Date.now();
2775
- const cliExclude = argv.exclude?.flatMap((v) => String(v).split(",")).map((v) => v.trim()).filter(Boolean);
2776
- process.exitCode = await deplint({
2777
- cliExclude,
2778
- pkg: argv.package,
2779
- deps: !!argv.deps,
2780
- devDeps: !!argv.devDeps,
2781
- peerDeps: !!argv.peerDeps,
2782
- verbose: !!argv.verbose
2783
- });
2784
- console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2785
- }
2786
- ).command(
2787
- "fix [package]",
2788
- "Fix - Run Eslint w/fix",
2789
- (yargs2) => {
2790
- return packagePositionalParam(yargs2);
2791
- },
2792
- (argv) => {
2793
- const start = Date.now();
2794
- if (argv.verbose) console.log("Fix");
2795
- process.exitCode = fix();
2796
- console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2797
- }
2798
- ).command(
2799
- "relint [package]",
2800
- "Relint - Clean & Lint",
2801
- (yargs2) => {
2802
- return packagePositionalParam(yargs2);
2803
- },
2804
- (argv) => {
2805
- if (argv.verbose) console.log("Relinting");
2806
- const start = Date.now();
2807
- process.exitCode = relint();
2808
- console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2809
- }
2810
- ).command(
2811
- "publint [package]",
2812
- "Publint - Run Publint",
2813
- (yargs2) => {
2814
- return packagePositionalParam(yargs2);
2815
- },
2816
- async (argv) => {
2817
- if (argv.verbose) console.log("Publint");
2818
- const start = Date.now();
2819
- process.exitCode = await publint({ pkg: argv.package, verbose: !!argv.verbose });
2820
- console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2821
- }
2822
- ).command(
2823
- "knip",
2824
- "Knip - Run Knip",
2825
- (yargs2) => {
2826
- return packagePositionalParam(yargs2);
2827
- },
2828
- (argv) => {
2829
- if (argv.verbose) console.log("Knip");
2830
- const start = Date.now();
2831
- process.exitCode = knip();
2832
- console.log(chalk30.blue(`Knip finished in ${Date.now() - start}ms`));
2833
- }
2834
- ).command(
2835
- "sonar",
2836
- "Sonar - Run Sonar Check",
2837
- (yargs2) => {
2838
- return packagePositionalParam(yargs2);
2839
- },
2840
- (argv) => {
2841
- const start = Date.now();
2842
- if (argv.verbose) console.log("Sonar Check");
2843
- process.exitCode = sonar();
2844
- console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2845
- }
2846
- );
3183
+ return args.command(cycleCommand).command(lintCommand).command(deplintCommand).command(fixCommand).command(relintCommand).command(publintCommand).command(knipCommand).command(sonarCommand);
2847
3184
  };
2848
3185
 
3186
+ // src/xy/xy.ts
3187
+ import chalk39 from "chalk";
3188
+
2849
3189
  // src/xy/xyParseOptions.ts
2850
3190
  import yargs from "yargs";
2851
3191
  import { hideBin } from "yargs/helpers";
@@ -2877,8 +3217,8 @@ var xyParseOptions = () => {
2877
3217
  var xy = async () => {
2878
3218
  const options = xyParseOptions();
2879
3219
  return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
2880
- console.error(chalk31.yellow(`Command not found [${chalk31.magenta(process.argv[2])}]`));
2881
- console.log(chalk31.gray("Try 'yarn xy --help' for list of commands"));
3220
+ console.error(chalk39.yellow(`Command not found [${chalk39.magenta(process.argv[2])}]`));
3221
+ console.log(chalk39.gray("Try 'yarn xy --help' for list of commands"));
2882
3222
  }).version().help().argv;
2883
3223
  };
2884
3224
  export {