@xylabs/ts-scripts-yarn3 7.4.20 → 7.4.22

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 (109) hide show
  1. package/dist/actions/claude-clean.mjs +71 -0
  2. package/dist/actions/claude-clean.mjs.map +1 -0
  3. package/dist/actions/claude-commands.mjs +11 -2
  4. package/dist/actions/claude-commands.mjs.map +1 -1
  5. package/dist/actions/claude-rules.mjs +27 -7
  6. package/dist/actions/claude-rules.mjs.map +1 -1
  7. package/dist/actions/claude-skills.mjs.map +1 -1
  8. package/dist/actions/dupdeps.mjs +3 -2
  9. package/dist/actions/dupdeps.mjs.map +1 -1
  10. package/dist/actions/gitignore.mjs +152 -0
  11. package/dist/actions/gitignore.mjs.map +1 -0
  12. package/dist/actions/index.mjs +392 -206
  13. package/dist/actions/index.mjs.map +1 -1
  14. package/dist/bin/xy.mjs +432 -226
  15. package/dist/bin/xy.mjs.map +1 -1
  16. package/dist/index.d.ts +11 -3
  17. package/dist/index.mjs +495 -282
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/lib/claudeMdTemplate.mjs +5 -1
  20. package/dist/lib/claudeMdTemplate.mjs.map +1 -1
  21. package/dist/lib/gitignoreTemplate.mjs +12 -0
  22. package/dist/lib/gitignoreTemplate.mjs.map +1 -0
  23. package/dist/lib/index.mjs +17 -3
  24. package/dist/lib/index.mjs.map +1 -1
  25. package/dist/xy/build/buildCommand.mjs +161 -0
  26. package/dist/xy/build/buildCommand.mjs.map +1 -0
  27. package/dist/xy/build/compileCommand.mjs +174 -0
  28. package/dist/xy/build/compileCommand.mjs.map +1 -0
  29. package/dist/xy/build/compileOnlyCommand.mjs +175 -0
  30. package/dist/xy/build/compileOnlyCommand.mjs.map +1 -0
  31. package/dist/xy/build/copyAssetsCommand.mjs +84 -0
  32. package/dist/xy/build/copyAssetsCommand.mjs.map +1 -0
  33. package/dist/xy/{build-commands → build}/index.mjs +45 -40
  34. package/dist/xy/build/index.mjs.map +1 -0
  35. package/dist/xy/build/rebuildCommand.mjs +114 -0
  36. package/dist/xy/build/rebuildCommand.mjs.map +1 -0
  37. package/dist/xy/build/recompileCommand.mjs +204 -0
  38. package/dist/xy/build/recompileCommand.mjs.map +1 -0
  39. package/dist/xy/common/claude/cleanCommand.mjs +79 -0
  40. package/dist/xy/common/claude/cleanCommand.mjs.map +1 -0
  41. package/dist/xy/common/claude/commandsCommand.mjs +11 -2
  42. package/dist/xy/common/claude/commandsCommand.mjs.map +1 -1
  43. package/dist/xy/common/claude/index.mjs +171 -69
  44. package/dist/xy/common/claude/index.mjs.map +1 -1
  45. package/dist/xy/common/claude/initCommand.mjs +38 -115
  46. package/dist/xy/common/claude/initCommand.mjs.map +1 -1
  47. package/dist/xy/common/claude/rulesCommand.mjs +27 -7
  48. package/dist/xy/common/claude/rulesCommand.mjs.map +1 -1
  49. package/dist/xy/common/claude/skillsCommand.mjs.map +1 -1
  50. package/dist/xy/common/gitignoreCommand.mjs +158 -0
  51. package/dist/xy/common/gitignoreCommand.mjs.map +1 -0
  52. package/dist/xy/common/index.mjs +304 -109
  53. package/dist/xy/common/index.mjs.map +1 -1
  54. package/dist/xy/index.mjs +432 -226
  55. package/dist/xy/index.mjs.map +1 -1
  56. package/dist/xy/install/dupdepsCommand.mjs +3 -2
  57. package/dist/xy/install/dupdepsCommand.mjs.map +1 -1
  58. package/dist/xy/install/index.mjs +3 -2
  59. package/dist/xy/install/index.mjs.map +1 -1
  60. package/dist/xy/xy.mjs +432 -226
  61. package/dist/xy/xy.mjs.map +1 -1
  62. package/package.json +2 -2
  63. package/templates/claude/CLAUDE-local.md +4 -0
  64. package/templates/claude/commands/xy-dead.md +5 -0
  65. package/templates/claude/{rules/xylabs-dependencies.md → commands/xy-deps.md} +7 -7
  66. package/templates/claude/commands/xy-dupdeps.md +5 -0
  67. package/templates/claude/commands/xy-gen-docs.md +5 -0
  68. package/templates/claude/commands/xy-gitignore.md +5 -0
  69. package/templates/claude/commands/xy-gitlint.md +5 -0
  70. package/templates/claude/commands/xy-license.md +5 -0
  71. package/templates/claude/commands/xy-lint-rules.md +44 -0
  72. package/templates/claude/commands/xy-recompile.md +5 -0
  73. package/templates/claude/commands/xy-reinstall.md +5 -0
  74. package/templates/claude/commands/xy-relint.md +5 -0
  75. package/templates/claude/commands/xy-retest.md +5 -0
  76. package/templates/claude/commands/xy-sonar.md +5 -0
  77. package/templates/claude/commands/xy-up.md +7 -0
  78. package/templates/claude/rules/xylabs-architecture.md +4 -7
  79. package/templates/claude/rules/xylabs-build.md +6 -11
  80. package/templates/claude/rules/xylabs-git-workflow.md +3 -5
  81. package/templates/claude/rules/xylabs-naming.md +4 -7
  82. package/templates/claude/rules/xylabs-style.md +14 -19
  83. package/templates/claude/skills/xylabs-e2e-setup/SKILL.md +16 -2
  84. package/templates/gitignore/template.gitignore +40 -0
  85. package/dist/actions/gitignore-gen.mjs +0 -88
  86. package/dist/actions/gitignore-gen.mjs.map +0 -1
  87. package/dist/xy/build-commands/build.mjs +0 -502
  88. package/dist/xy/build-commands/build.mjs.map +0 -1
  89. package/dist/xy/build-commands/index.mjs.map +0 -1
  90. package/dist/xy/common/gitignoreGenCommand.mjs +0 -98
  91. package/dist/xy/common/gitignoreGenCommand.mjs.map +0 -1
  92. package/templates/claude/commands/xylabs-deploy-major.md +0 -7
  93. package/templates/claude/commands/xylabs-deploy-minor.md +0 -7
  94. package/templates/claude/commands/xylabs-deploy.md +0 -7
  95. package/templates/claude/rules/xylabs-error-handling.md +0 -7
  96. package/templates/claude/rules/xylabs-frameworks.md +0 -8
  97. package/templates/claude/rules/xylabs-linting.md +0 -55
  98. package/templates/claude/rules/xylabs-typescript.md +0 -11
  99. /package/templates/claude/commands/{xylabs-build.md → xy-build.md} +0 -0
  100. /package/templates/claude/commands/{xylabs-clean.md → xy-clean.md} +0 -0
  101. /package/templates/claude/commands/{xylabs-compile.md → xy-compile.md} +0 -0
  102. /package/templates/claude/commands/{xylabs-cycle.md → xy-cycle.md} +0 -0
  103. /package/templates/claude/commands/{xylabs-deplint.md → xy-deplint.md} +0 -0
  104. /package/templates/claude/commands/{xylabs-fix.md → xy-fix.md} +0 -0
  105. /package/templates/claude/commands/{xylabs-knip.md → xy-knip.md} +0 -0
  106. /package/templates/claude/commands/{xylabs-lint.md → xy-lint.md} +0 -0
  107. /package/templates/claude/commands/{xylabs-publint.md → xy-publint.md} +0 -0
  108. /package/templates/claude/commands/{xylabs-rebuild.md → xy-rebuild.md} +0 -0
  109. /package/templates/claude/commands/{xylabs-test.md → xy-test.md} +0 -0
package/dist/index.mjs CHANGED
@@ -26,7 +26,8 @@ var require2 = createRequire(import.meta.url);
26
26
  var packageRoot = PATH.dirname(require2.resolve("@xylabs/ts-scripts-yarn3/package.json"));
27
27
  var templatesDir = PATH.resolve(packageRoot, "templates", "claude");
28
28
  var XYLABS_RULES_PREFIX = "xylabs-";
29
- var XYLABS_COMMANDS_PREFIX = "xylabs-";
29
+ var XYLABS_COMMANDS_PREFIX = "xy-";
30
+ var LEGACY_COMMANDS_PREFIX = "xylabs-";
30
31
  var XYLABS_SKILLS_PREFIX = "xylabs-";
31
32
  var claudeMdRuleTemplates = () => {
32
33
  const rulesDir = PATH.resolve(templatesDir, "rules");
@@ -65,6 +66,7 @@ var claudeSkillTemplates = () => {
65
66
  return result;
66
67
  };
67
68
  var claudeMdProjectTemplate = () => readFileSync(PATH.resolve(templatesDir, "CLAUDE-project.md"), "utf8");
69
+ var claudeMdLocalTemplate = () => readFileSync(PATH.resolve(templatesDir, "CLAUDE-local.md"), "utf8");
68
70
 
69
71
  // src/lib/createBuildConfig.ts
70
72
  import { readFileSync as readFileSync2 } from "fs";
@@ -382,19 +384,19 @@ var INIT_CWD = () => {
382
384
  // src/lib/generateIgnoreFiles.ts
383
385
  var localeCompare = (a, b) => a.localeCompare(b);
384
386
  var mergeEntries = (a, b) => [...union(a, b)].toSorted(localeCompare);
385
- var generateIgnoreFiles = (filename3, pkg) => {
386
- console.log(chalk4.green(`Generate ${filename3} Files`));
387
+ var generateIgnoreFiles = (filename2, pkg) => {
388
+ console.log(chalk4.green(`Generate ${filename2} Files`));
387
389
  const cwd5 = INIT_CWD() ?? ".";
388
390
  const workspaces = pkg ? [yarnWorkspace(pkg)] : yarnWorkspaces();
389
- const readEntries = (location) => readNonEmptyLines(`${location}/${filename3}`);
390
- const writeEntries = (location, entries) => writeLines(`${location}/${filename3}`, entries);
391
+ const readEntries = (location) => readNonEmptyLines(`${location}/${filename2}`);
392
+ const writeEntries = (location, entries) => writeLines(`${location}/${filename2}`, entries);
391
393
  const results = workspaces.map(({ location, name }) => {
392
394
  try {
393
395
  writeEntries(location, mergeEntries(readEntries(cwd5), readEntries(location)));
394
396
  return 0;
395
397
  } catch (ex) {
396
398
  const error = ex;
397
- console.error(`Generate ${filename3} Files [${name}] [${error.message}]`);
399
+ console.error(`Generate ${filename2} Files [${name}] [${error.message}]`);
398
400
  return 1;
399
401
  }
400
402
  });
@@ -624,6 +626,15 @@ async function generateReadmeFiles({
624
626
  return failed ? 1 : 0;
625
627
  }
626
628
 
629
+ // src/lib/gitignoreTemplate.ts
630
+ import { readFileSync as readFileSync6 } from "fs";
631
+ import { createRequire as createRequire3 } from "module";
632
+ import PATH3 from "path";
633
+ var require4 = createRequire3(import.meta.url);
634
+ var packageRoot3 = PATH3.dirname(require4.resolve("@xylabs/ts-scripts-yarn3/package.json"));
635
+ var templatesDir2 = PATH3.resolve(packageRoot3, "templates", "gitignore");
636
+ var gitignoreTemplate = () => readFileSync6(PATH3.resolve(templatesDir2, "template.gitignore"), "utf8");
637
+
627
638
  // src/lib/loadConfig.ts
628
639
  import chalk6 from "chalk";
629
640
  import { cosmiconfig } from "cosmiconfig";
@@ -646,10 +657,10 @@ var loadConfig = async (params) => {
646
657
  };
647
658
 
648
659
  // src/lib/parsedPackageJSON.ts
649
- import { readFileSync as readFileSync6 } from "fs";
660
+ import { readFileSync as readFileSync7 } from "fs";
650
661
  var parsedPackageJSON = (path14) => {
651
662
  const pathToPackageJSON = path14 ?? process.env.npm_package_json ?? "";
652
- const packageJSON = readFileSync6(pathToPackageJSON).toString();
663
+ const packageJSON = readFileSync7(pathToPackageJSON).toString();
653
664
  return JSON.parse(packageJSON);
654
665
  };
655
666
 
@@ -777,25 +788,85 @@ var build = async ({
777
788
  return result;
778
789
  };
779
790
 
780
- // src/actions/claude-commands.ts
791
+ // src/actions/claude-clean.ts
781
792
  import {
782
793
  existsSync as existsSync5,
783
- mkdirSync,
784
794
  readdirSync as readdirSync2,
785
- readFileSync as readFileSync7,
786
- unlinkSync,
787
- writeFileSync as writeFileSync2
795
+ rmSync,
796
+ unlinkSync
788
797
  } from "fs";
789
- import PATH3 from "path";
798
+ import PATH4 from "path";
790
799
  import chalk11 from "chalk";
800
+ function removeFile(filePath, label) {
801
+ if (existsSync5(filePath)) {
802
+ unlinkSync(filePath);
803
+ console.log(chalk11.yellow(` Removed ${label}`));
804
+ return true;
805
+ }
806
+ return false;
807
+ }
808
+ function removeDir(dirPath, label) {
809
+ if (existsSync5(dirPath)) {
810
+ rmSync(dirPath, { recursive: true });
811
+ console.log(chalk11.yellow(` Removed ${label}`));
812
+ return true;
813
+ }
814
+ return false;
815
+ }
816
+ function claudeClean() {
817
+ console.log(chalk11.green("Clean Claude configuration"));
818
+ const cwd5 = INIT_CWD() ?? process.cwd();
819
+ let removed = 0;
820
+ const rootFiles = ["CLAUDE.md", "CLAUDE.local.md"];
821
+ for (const file of rootFiles) {
822
+ if (removeFile(PATH4.resolve(cwd5, file), file)) removed++;
823
+ }
824
+ if (removeDir(PATH4.resolve(cwd5, ".claude"), ".claude/")) removed++;
825
+ const packagesDir = PATH4.resolve(cwd5, "packages");
826
+ if (existsSync5(packagesDir)) {
827
+ const findClaudeFiles = (dir, prefix) => {
828
+ const entries = readdirSync2(dir, { withFileTypes: true });
829
+ for (const entry of entries) {
830
+ const fullPath = PATH4.resolve(dir, entry.name);
831
+ const label = `${prefix}${entry.name}`;
832
+ if (entry.isFile() && (entry.name === "CLAUDE.md" || entry.name === "CLAUDE.local.md")) {
833
+ if (removeFile(fullPath, label)) removed++;
834
+ } else if (entry.isDirectory() && entry.name === ".claude") {
835
+ if (removeDir(fullPath, `${label}/`)) removed++;
836
+ } else if (entry.isDirectory() && entry.name !== "node_modules" && entry.name !== "dist") {
837
+ findClaudeFiles(fullPath, `${label}/`);
838
+ }
839
+ }
840
+ };
841
+ findClaudeFiles(packagesDir, "packages/");
842
+ }
843
+ if (removed > 0) {
844
+ console.log(chalk11.green(` Removed ${removed} item(s)`));
845
+ } else {
846
+ console.log(chalk11.gray(" Nothing to clean"));
847
+ }
848
+ return 0;
849
+ }
850
+
851
+ // src/actions/claude-commands.ts
852
+ import {
853
+ existsSync as existsSync6,
854
+ mkdirSync,
855
+ readdirSync as readdirSync3,
856
+ readFileSync as readFileSync8,
857
+ unlinkSync as unlinkSync2,
858
+ writeFileSync as writeFileSync2
859
+ } from "fs";
860
+ import PATH5 from "path";
861
+ import chalk12 from "chalk";
791
862
  var syncCommandFiles = (commandsDir) => {
792
863
  const templates = claudeCommandTemplates();
793
864
  const templateNames = new Set(Object.keys(templates));
794
865
  let updated = 0;
795
866
  let created = 0;
796
- for (const [filename3, content] of Object.entries(templates)) {
797
- const targetPath = PATH3.resolve(commandsDir, filename3);
798
- const existing = existsSync5(targetPath) ? readFileSync7(targetPath, "utf8") : void 0;
867
+ for (const [filename2, content] of Object.entries(templates)) {
868
+ const targetPath = PATH5.resolve(commandsDir, filename2);
869
+ const existing = existsSync6(targetPath) ? readFileSync8(targetPath, "utf8") : void 0;
799
870
  if (existing === content) continue;
800
871
  writeFileSync2(targetPath, content, "utf8");
801
872
  if (existing) {
@@ -811,16 +882,23 @@ var syncCommandFiles = (commandsDir) => {
811
882
  };
812
883
  };
813
884
  var removeStaleCommands = (commandsDir, templateNames) => {
814
- const existingCommands = readdirSync2(commandsDir).filter((f) => f.startsWith(XYLABS_COMMANDS_PREFIX) && f.endsWith(".md"));
885
+ const existingCommands = readdirSync3(commandsDir).filter((f) => f.startsWith(XYLABS_COMMANDS_PREFIX) && f.endsWith(".md"));
815
886
  let removed = 0;
816
887
  for (const file of existingCommands) {
817
888
  if (!templateNames.has(file)) {
818
- unlinkSync(PATH3.resolve(commandsDir, file));
889
+ unlinkSync2(PATH5.resolve(commandsDir, file));
819
890
  removed++;
820
891
  }
821
892
  }
822
893
  return removed;
823
894
  };
895
+ var removeLegacyCommands = (commandsDir) => {
896
+ const legacyFiles = readdirSync3(commandsDir).filter((f) => f.startsWith(LEGACY_COMMANDS_PREFIX) && f.endsWith(".md"));
897
+ for (const file of legacyFiles) {
898
+ unlinkSync2(PATH5.resolve(commandsDir, file));
899
+ }
900
+ return legacyFiles.length;
901
+ };
824
902
  var logCommandsResult = (created, updated, removed) => {
825
903
  if (created || updated || removed) {
826
904
  const parts = [
@@ -828,44 +906,46 @@ var logCommandsResult = (created, updated, removed) => {
828
906
  updated ? `${updated} updated` : "",
829
907
  removed ? `${removed} removed` : ""
830
908
  ].filter(Boolean);
831
- console.log(chalk11.green(`.claude/commands/${XYLABS_COMMANDS_PREFIX}*.md: ${parts.join(", ")}`));
909
+ console.log(chalk12.green(`.claude/commands/${XYLABS_COMMANDS_PREFIX}*.md: ${parts.join(", ")}`));
832
910
  } else {
833
- console.log(chalk11.gray(`.claude/commands/${XYLABS_COMMANDS_PREFIX}*.md: already up to date`));
911
+ console.log(chalk12.gray(`.claude/commands/${XYLABS_COMMANDS_PREFIX}*.md: already up to date`));
834
912
  }
835
913
  };
836
914
  var claudeCommands = () => {
837
915
  const cwd5 = INIT_CWD() ?? process.cwd();
838
- const commandsDir = PATH3.resolve(cwd5, ".claude", "commands");
916
+ const commandsDir = PATH5.resolve(cwd5, ".claude", "commands");
839
917
  mkdirSync(commandsDir, { recursive: true });
918
+ const legacy = removeLegacyCommands(commandsDir);
840
919
  const {
841
920
  created,
842
921
  templateNames,
843
922
  updated
844
923
  } = syncCommandFiles(commandsDir);
845
924
  const removed = removeStaleCommands(commandsDir, templateNames);
846
- logCommandsResult(created, updated, removed);
925
+ logCommandsResult(created, updated, removed + legacy);
847
926
  return 0;
848
927
  };
849
928
 
850
929
  // src/actions/claude-rules.ts
930
+ import { spawnSync as spawnSync4 } from "child_process";
851
931
  import {
852
- existsSync as existsSync6,
932
+ existsSync as existsSync7,
853
933
  mkdirSync as mkdirSync2,
854
- readdirSync as readdirSync3,
855
- readFileSync as readFileSync8,
856
- unlinkSync as unlinkSync2,
934
+ readdirSync as readdirSync4,
935
+ readFileSync as readFileSync9,
936
+ unlinkSync as unlinkSync3,
857
937
  writeFileSync as writeFileSync3
858
938
  } from "fs";
859
- import PATH4 from "path";
860
- import chalk12 from "chalk";
939
+ import PATH6 from "path";
940
+ import chalk13 from "chalk";
861
941
  var syncRuleFiles = (rulesDir) => {
862
942
  const templates = claudeMdRuleTemplates();
863
943
  const templateNames = new Set(Object.keys(templates));
864
944
  let updated = 0;
865
945
  let created = 0;
866
- for (const [filename3, content] of Object.entries(templates)) {
867
- const targetPath = PATH4.resolve(rulesDir, filename3);
868
- const existing = existsSync6(targetPath) ? readFileSync8(targetPath, "utf8") : void 0;
946
+ for (const [filename2, content] of Object.entries(templates)) {
947
+ const targetPath = PATH6.resolve(rulesDir, filename2);
948
+ const existing = existsSync7(targetPath) ? readFileSync9(targetPath, "utf8") : void 0;
869
949
  if (existing === content) continue;
870
950
  writeFileSync3(targetPath, content, "utf8");
871
951
  if (existing) {
@@ -881,11 +961,11 @@ var syncRuleFiles = (rulesDir) => {
881
961
  };
882
962
  };
883
963
  var removeStaleRules = (rulesDir, templateNames) => {
884
- const existingRules = readdirSync3(rulesDir).filter((f) => f.startsWith(XYLABS_RULES_PREFIX) && f.endsWith(".md"));
964
+ const existingRules = readdirSync4(rulesDir).filter((f) => f.startsWith(XYLABS_RULES_PREFIX) && f.endsWith(".md"));
885
965
  let removed = 0;
886
966
  for (const file of existingRules) {
887
967
  if (!templateNames.has(file)) {
888
- unlinkSync2(PATH4.resolve(rulesDir, file));
968
+ unlinkSync3(PATH6.resolve(rulesDir, file));
889
969
  removed++;
890
970
  }
891
971
  }
@@ -898,26 +978,44 @@ var logRulesResult = (created, updated, removed) => {
898
978
  updated ? `${updated} updated` : "",
899
979
  removed ? `${removed} removed` : ""
900
980
  ].filter(Boolean);
901
- console.log(chalk12.green(`.claude/rules/${XYLABS_RULES_PREFIX}*.md: ${parts.join(", ")}`));
981
+ console.log(chalk13.green(`.claude/rules/${XYLABS_RULES_PREFIX}*.md: ${parts.join(", ")}`));
902
982
  } else {
903
- console.log(chalk12.gray(`.claude/rules/${XYLABS_RULES_PREFIX}*.md: already up to date`));
983
+ console.log(chalk13.gray(`.claude/rules/${XYLABS_RULES_PREFIX}*.md: already up to date`));
904
984
  }
905
985
  };
906
986
  var ensureProjectClaudeMd = (cwd5, force) => {
907
- const projectPath = PATH4.resolve(cwd5, "CLAUDE.md");
908
- if (!existsSync6(projectPath) || force) {
909
- if (force && existsSync6(projectPath)) {
910
- console.log(chalk12.yellow("Overwriting existing CLAUDE.md"));
987
+ const projectPath = PATH6.resolve(cwd5, "CLAUDE.md");
988
+ if (!existsSync7(projectPath) || force) {
989
+ if (force && existsSync7(projectPath)) {
990
+ console.log(chalk13.yellow("Regenerating CLAUDE.md"));
991
+ }
992
+ console.log(chalk13.green("Generating CLAUDE.md via claude /init..."));
993
+ const result = spawnSync4("claude", ["-p", "/init", "--allowedTools", "Read", "Write", "Glob", "Grep"], {
994
+ cwd: cwd5,
995
+ shell: true,
996
+ stdio: "inherit"
997
+ });
998
+ if (result.status !== 0) {
999
+ console.error(chalk13.red("claude /init failed \u2014 is Claude Code installed?"));
1000
+ return 1;
911
1001
  }
912
- writeFileSync3(projectPath, claudeMdProjectTemplate(), "utf8");
913
- console.log(chalk12.green("Generated CLAUDE.md"));
914
1002
  } else {
915
- console.log(chalk12.gray("CLAUDE.md already exists (skipped)"));
1003
+ console.log(chalk13.gray("CLAUDE.md already exists (skipped, use --force to regenerate)"));
1004
+ }
1005
+ return 0;
1006
+ };
1007
+ var ensureLocalClaudeMd = (cwd5) => {
1008
+ const localPath = PATH6.resolve(cwd5, "CLAUDE.local.md");
1009
+ if (existsSync7(localPath)) {
1010
+ console.log(chalk13.gray("CLAUDE.local.md already exists (skipped)"));
1011
+ } else {
1012
+ writeFileSync3(localPath, claudeMdLocalTemplate(), "utf8");
1013
+ console.log(chalk13.green("Generated CLAUDE.local.md"));
916
1014
  }
917
1015
  };
918
1016
  var claudeRules = ({ force } = {}) => {
919
1017
  const cwd5 = INIT_CWD() ?? process.cwd();
920
- const rulesDir = PATH4.resolve(cwd5, ".claude", "rules");
1018
+ const rulesDir = PATH6.resolve(cwd5, ".claude", "rules");
921
1019
  mkdirSync2(rulesDir, { recursive: true });
922
1020
  const {
923
1021
  created,
@@ -926,19 +1024,20 @@ var claudeRules = ({ force } = {}) => {
926
1024
  } = syncRuleFiles(rulesDir);
927
1025
  const removed = removeStaleRules(rulesDir, templateNames);
928
1026
  logRulesResult(created, updated, removed);
929
- ensureProjectClaudeMd(cwd5, force);
930
- return 0;
1027
+ const claudeMdResult = ensureProjectClaudeMd(cwd5, force);
1028
+ ensureLocalClaudeMd(cwd5);
1029
+ return claudeMdResult ?? 0;
931
1030
  };
932
1031
 
933
1032
  // src/actions/claude-settings.ts
934
1033
  import {
935
- existsSync as existsSync7,
1034
+ existsSync as existsSync8,
936
1035
  mkdirSync as mkdirSync3,
937
1036
  writeFileSync as writeFileSync4
938
1037
  } from "fs";
939
- import PATH5 from "path";
1038
+ import PATH7 from "path";
940
1039
  import { createInterface as createInterface2 } from "readline";
941
- import chalk13 from "chalk";
1040
+ import chalk14 from "chalk";
942
1041
  var DEFAULT_SETTINGS = {
943
1042
  permissions: {
944
1043
  allow: [
@@ -983,48 +1082,48 @@ function askConfirmation2(question) {
983
1082
  }
984
1083
  async function claudeSettings() {
985
1084
  const cwd5 = INIT_CWD() ?? process.cwd();
986
- const claudeDir = PATH5.resolve(cwd5, ".claude");
987
- const settingsPath = PATH5.resolve(claudeDir, "settings.local.json");
1085
+ const claudeDir = PATH7.resolve(cwd5, ".claude");
1086
+ const settingsPath = PATH7.resolve(claudeDir, "settings.local.json");
988
1087
  mkdirSync3(claudeDir, { recursive: true });
989
- if (existsSync7(settingsPath)) {
1088
+ if (existsSync8(settingsPath)) {
990
1089
  const confirmed = await askConfirmation2(
991
- chalk13.yellow(`${settingsPath} already exists. Replace it? (y/N) `)
1090
+ chalk14.yellow(`${settingsPath} already exists. Replace it? (y/N) `)
992
1091
  );
993
1092
  if (!confirmed) {
994
- console.log(chalk13.gray("Skipped \u2014 existing settings.local.json preserved"));
1093
+ console.log(chalk14.gray("Skipped \u2014 existing settings.local.json preserved"));
995
1094
  return 0;
996
1095
  }
997
1096
  }
998
1097
  writeFileSync4(settingsPath, `${JSON.stringify(DEFAULT_SETTINGS, null, 2)}
999
1098
  `, "utf8");
1000
- console.log(chalk13.green("Generated .claude/settings.local.json"));
1099
+ console.log(chalk14.green("Generated .claude/settings.local.json"));
1001
1100
  return 0;
1002
1101
  }
1003
1102
 
1004
1103
  // src/actions/claude-skills.ts
1005
1104
  import {
1006
- existsSync as existsSync8,
1105
+ existsSync as existsSync9,
1007
1106
  mkdirSync as mkdirSync4,
1008
- readdirSync as readdirSync4,
1009
- readFileSync as readFileSync9,
1010
- rmSync,
1107
+ readdirSync as readdirSync5,
1108
+ readFileSync as readFileSync10,
1109
+ rmSync as rmSync2,
1011
1110
  statSync as statSync2,
1012
1111
  writeFileSync as writeFileSync5
1013
1112
  } from "fs";
1014
- import PATH6 from "path";
1015
- import chalk14 from "chalk";
1113
+ import PATH8 from "path";
1114
+ import chalk15 from "chalk";
1016
1115
  var syncSkillFiles = (skillsDir) => {
1017
1116
  const templates = claudeSkillTemplates();
1018
1117
  const templateNames = new Set(Object.keys(templates));
1019
1118
  let updated = 0;
1020
1119
  let created = 0;
1021
1120
  for (const [skillName, files] of Object.entries(templates)) {
1022
- const skillDir = PATH6.resolve(skillsDir, skillName);
1121
+ const skillDir = PATH8.resolve(skillsDir, skillName);
1023
1122
  mkdirSync4(skillDir, { recursive: true });
1024
- for (const [filename3, content] of Object.entries(files)) {
1025
- const targetPath = PATH6.resolve(skillDir, filename3);
1026
- mkdirSync4(PATH6.dirname(targetPath), { recursive: true });
1027
- const existing = existsSync8(targetPath) ? readFileSync9(targetPath, "utf8") : void 0;
1123
+ for (const [filename2, content] of Object.entries(files)) {
1124
+ const targetPath = PATH8.resolve(skillDir, filename2);
1125
+ mkdirSync4(PATH8.dirname(targetPath), { recursive: true });
1126
+ const existing = existsSync9(targetPath) ? readFileSync10(targetPath, "utf8") : void 0;
1028
1127
  if (existing === content) continue;
1029
1128
  writeFileSync5(targetPath, content, "utf8");
1030
1129
  if (existing) {
@@ -1041,13 +1140,13 @@ var syncSkillFiles = (skillsDir) => {
1041
1140
  };
1042
1141
  };
1043
1142
  var removeStaleSkills = (skillsDir, templateNames) => {
1044
- const existingSkills = readdirSync4(skillsDir).filter(
1045
- (f) => f.startsWith(XYLABS_SKILLS_PREFIX) && statSync2(PATH6.resolve(skillsDir, f)).isDirectory()
1143
+ const existingSkills = readdirSync5(skillsDir).filter(
1144
+ (f) => f.startsWith(XYLABS_SKILLS_PREFIX) && statSync2(PATH8.resolve(skillsDir, f)).isDirectory()
1046
1145
  );
1047
1146
  let removed = 0;
1048
1147
  for (const dir of existingSkills) {
1049
1148
  if (!templateNames.has(dir)) {
1050
- rmSync(PATH6.resolve(skillsDir, dir), { recursive: true });
1149
+ rmSync2(PATH8.resolve(skillsDir, dir), { recursive: true });
1051
1150
  removed++;
1052
1151
  }
1053
1152
  }
@@ -1060,14 +1159,14 @@ var logSkillsResult = (created, updated, removed) => {
1060
1159
  updated ? `${updated} updated` : "",
1061
1160
  removed ? `${removed} removed` : ""
1062
1161
  ].filter(Boolean);
1063
- console.log(chalk14.green(`.claude/skills/${XYLABS_SKILLS_PREFIX}*/: ${parts.join(", ")}`));
1162
+ console.log(chalk15.green(`.claude/skills/${XYLABS_SKILLS_PREFIX}*/: ${parts.join(", ")}`));
1064
1163
  } else {
1065
- console.log(chalk14.gray(`.claude/skills/${XYLABS_SKILLS_PREFIX}*/: already up to date`));
1164
+ console.log(chalk15.gray(`.claude/skills/${XYLABS_SKILLS_PREFIX}*/: already up to date`));
1066
1165
  }
1067
1166
  };
1068
1167
  var claudeSkills = () => {
1069
1168
  const cwd5 = INIT_CWD() ?? process.cwd();
1070
- const skillsDir = PATH6.resolve(cwd5, ".claude", "skills");
1169
+ const skillsDir = PATH8.resolve(cwd5, ".claude", "skills");
1071
1170
  mkdirSync4(skillsDir, { recursive: true });
1072
1171
  const {
1073
1172
  created,
@@ -1093,16 +1192,16 @@ var cleanAll = ({ verbose }) => {
1093
1192
 
1094
1193
  // src/actions/clean-docs.ts
1095
1194
  import path from "path";
1096
- import chalk15 from "chalk";
1195
+ import chalk16 from "chalk";
1097
1196
  var cleanDocs = () => {
1098
1197
  const pkgName = process.env.npm_package_name;
1099
- console.log(chalk15.green(`Cleaning Docs [${pkgName}]`));
1198
+ console.log(chalk16.green(`Cleaning Docs [${pkgName}]`));
1100
1199
  for (const { location } of yarnWorkspaces()) deleteGlob(path.join(location, "docs"));
1101
1200
  return 0;
1102
1201
  };
1103
1202
 
1104
1203
  // src/actions/compile.ts
1105
- import chalk16 from "chalk";
1204
+ import chalk17 from "chalk";
1106
1205
  var compile = ({
1107
1206
  verbose,
1108
1207
  target,
@@ -1143,7 +1242,7 @@ var compileAll = ({
1143
1242
  const incrementalOptions = incremental ? ["--since", "-Ap", "--topological-dev"] : ["--parallel", "-Ap", "--topological-dev"];
1144
1243
  const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
1145
1244
  if (jobs) {
1146
- console.log(chalk16.blue(`Jobs set to [${jobs}]`));
1245
+ console.log(chalk17.blue(`Jobs set to [${jobs}]`));
1147
1246
  }
1148
1247
  const result = runSteps(`Compile${incremental ? "-Incremental" : ""} [All]`, [
1149
1248
  ["yarn", [
@@ -1157,13 +1256,13 @@ var compileAll = ({
1157
1256
  ...targetOptions
1158
1257
  ]]
1159
1258
  ]);
1160
- console.log(`${chalk16.gray("Compiled in")} [${chalk16.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk16.gray("seconds")}`);
1259
+ console.log(`${chalk17.gray("Compiled in")} [${chalk17.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk17.gray("seconds")}`);
1161
1260
  return result;
1162
1261
  };
1163
1262
 
1164
1263
  // src/actions/copy-assets.ts
1165
1264
  import path2 from "path/posix";
1166
- import chalk17 from "chalk";
1265
+ import chalk18 from "chalk";
1167
1266
  import cpy from "cpy";
1168
1267
  var copyPackageTargetAssets = async (target, name, location) => {
1169
1268
  try {
@@ -1186,7 +1285,7 @@ var copyPackageTargetAssets = async (target, name, location) => {
1186
1285
  };
1187
1286
  var copyTargetAssets = async (target, pkg) => {
1188
1287
  const workspaces = yarnWorkspaces();
1189
- console.log(chalk17.green(`Copying Assets [${target.toUpperCase()}]`));
1288
+ console.log(chalk18.green(`Copying Assets [${target.toUpperCase()}]`));
1190
1289
  const workspaceList = workspaces.filter(({ name }) => {
1191
1290
  return pkg === void 0 || name === pkg;
1192
1291
  });
@@ -1270,7 +1369,7 @@ var dead = () => {
1270
1369
  };
1271
1370
 
1272
1371
  // src/actions/deplint/deplint.ts
1273
- import chalk23 from "chalk";
1372
+ import chalk24 from "chalk";
1274
1373
 
1275
1374
  // src/actions/deplint/findFiles.ts
1276
1375
  import fs2 from "fs";
@@ -1475,7 +1574,7 @@ function getExternalImportsFromFiles({
1475
1574
 
1476
1575
  // src/actions/deplint/checkPackage/getUnlistedDependencies.ts
1477
1576
  import { builtinModules } from "module";
1478
- import chalk18 from "chalk";
1577
+ import chalk19 from "chalk";
1479
1578
  function isRuntimeImportListed(imp, name, dependencies, peerDependencies) {
1480
1579
  return dependencies.includes(imp) || imp === name || peerDependencies.includes(imp) || builtinModules.includes(imp);
1481
1580
  }
@@ -1483,7 +1582,7 @@ function isTypeImportListed(imp, name, dependencies, devDependencies, peerDepend
1483
1582
  return dependencies.includes(imp) || imp === name || dependencies.includes(`@types/${imp}`) || peerDependencies.includes(imp) || peerDependencies.includes(`@types/${imp}`) || devDependencies.includes(`@types/${imp}`) || builtinModules.includes(imp);
1484
1583
  }
1485
1584
  function logMissing(name, imp, importPaths) {
1486
- console.log(`[${chalk18.blue(name)}] Missing dependency in package.json: ${chalk18.red(imp)}`);
1585
+ console.log(`[${chalk19.blue(name)}] Missing dependency in package.json: ${chalk19.red(imp)}`);
1487
1586
  if (importPaths[imp]) {
1488
1587
  console.log(` ${importPaths[imp].join("\n ")}`);
1489
1588
  }
@@ -1512,7 +1611,7 @@ function getUnlistedDependencies({ name, location }, {
1512
1611
  }
1513
1612
  if (unlistedDependencies > 0) {
1514
1613
  const packageLocation = `${location}/package.json`;
1515
- console.log(` ${chalk18.yellow(packageLocation)}
1614
+ console.log(` ${chalk19.yellow(packageLocation)}
1516
1615
  `);
1517
1616
  }
1518
1617
  return unlistedDependencies;
@@ -1520,7 +1619,7 @@ function getUnlistedDependencies({ name, location }, {
1520
1619
 
1521
1620
  // src/actions/deplint/checkPackage/getUnlistedDevDependencies.ts
1522
1621
  import { builtinModules as builtinModules2 } from "module";
1523
- import chalk19 from "chalk";
1622
+ import chalk20 from "chalk";
1524
1623
  function getUnlistedDevDependencies({ name, location }, {
1525
1624
  devDependencies,
1526
1625
  dependencies,
@@ -1534,7 +1633,7 @@ function getUnlistedDevDependencies({ name, location }, {
1534
1633
  for (const imp of externalAllImports) {
1535
1634
  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)) {
1536
1635
  unlistedDevDependencies++;
1537
- console.log(`[${chalk19.blue(name)}] Missing devDependency in package.json: ${chalk19.red(imp)}`);
1636
+ console.log(`[${chalk20.blue(name)}] Missing devDependency in package.json: ${chalk20.red(imp)}`);
1538
1637
  if (allImportPaths[imp]) {
1539
1638
  console.log(` ${allImportPaths[imp].join("\n ")}`);
1540
1639
  }
@@ -1542,14 +1641,14 @@ function getUnlistedDevDependencies({ name, location }, {
1542
1641
  }
1543
1642
  if (unlistedDevDependencies > 0) {
1544
1643
  const packageLocation = `${location}/package.json`;
1545
- console.log(` ${chalk19.yellow(packageLocation)}
1644
+ console.log(` ${chalk20.yellow(packageLocation)}
1546
1645
  `);
1547
1646
  }
1548
1647
  return unlistedDevDependencies;
1549
1648
  }
1550
1649
 
1551
1650
  // src/actions/deplint/checkPackage/getUnusedDependencies.ts
1552
- import chalk20 from "chalk";
1651
+ import chalk21 from "chalk";
1553
1652
  function getUnusedDependencies({ name, location }, { dependencies }, {
1554
1653
  externalDistImports,
1555
1654
  externalDistTypeImports,
@@ -1561,22 +1660,22 @@ function getUnusedDependencies({ name, location }, { dependencies }, {
1561
1660
  if (!externalDistImports.includes(dep) && !externalDistImports.includes(dep.replace(/^@types\//, "")) && !externalDistTypeImports.includes(dep) && !externalDistTypeImports.includes(dep.replace(/^@types\//, ""))) {
1562
1661
  unusedDependencies++;
1563
1662
  if (externalAllImports.includes(dep)) {
1564
- console.log(`[${chalk20.blue(name)}] dependency should be devDependency in package.json: ${chalk20.red(dep)}`);
1663
+ console.log(`[${chalk21.blue(name)}] dependency should be devDependency in package.json: ${chalk21.red(dep)}`);
1565
1664
  } else {
1566
- console.log(`[${chalk20.blue(name)}] Unused dependency in package.json: ${chalk20.red(dep)}`);
1665
+ console.log(`[${chalk21.blue(name)}] Unused dependency in package.json: ${chalk21.red(dep)}`);
1567
1666
  }
1568
1667
  }
1569
1668
  }
1570
1669
  if (unusedDependencies > 0) {
1571
1670
  const packageLocation = `${location}/package.json`;
1572
- console.log(` ${chalk20.yellow(packageLocation)}
1671
+ console.log(` ${chalk21.yellow(packageLocation)}
1573
1672
  `);
1574
1673
  }
1575
1674
  return unusedDependencies;
1576
1675
  }
1577
1676
 
1578
1677
  // src/actions/deplint/checkPackage/getUnusedDevDependencies.ts
1579
- import chalk21 from "chalk";
1678
+ import chalk22 from "chalk";
1580
1679
 
1581
1680
  // src/actions/deplint/getCliReferencedPackagesFromFiles.ts
1582
1681
  import fs8 from "fs";
@@ -1860,19 +1959,19 @@ function getUnusedDevDependencies({ name, location }, {
1860
1959
  if (dependencies.includes(dep) || peerDependencies.includes(dep)) continue;
1861
1960
  if (!isDevDepUsed(dep, allImports, implicitDeps, requiredPeers, scriptRefs, cliRefs)) {
1862
1961
  unusedDevDependencies++;
1863
- console.log(`[${chalk21.blue(name)}] Unused devDependency in package.json: ${chalk21.red(dep)}`);
1962
+ console.log(`[${chalk22.blue(name)}] Unused devDependency in package.json: ${chalk22.red(dep)}`);
1864
1963
  }
1865
1964
  }
1866
1965
  if (unusedDevDependencies > 0) {
1867
1966
  const packageLocation = `${location}/package.json`;
1868
- console.log(` ${chalk21.yellow(packageLocation)}
1967
+ console.log(` ${chalk22.yellow(packageLocation)}
1869
1968
  `);
1870
1969
  }
1871
1970
  return unusedDevDependencies;
1872
1971
  }
1873
1972
 
1874
1973
  // src/actions/deplint/checkPackage/getUnusedPeerDependencies.ts
1875
- import chalk22 from "chalk";
1974
+ import chalk23 from "chalk";
1876
1975
  function getUnusedPeerDependencies({ name, location }, { peerDependencies, dependencies }, { externalDistImports, externalDistTypeImports }, exclude) {
1877
1976
  let unusedDependencies = 0;
1878
1977
  for (const dep of peerDependencies) {
@@ -1880,15 +1979,15 @@ function getUnusedPeerDependencies({ name, location }, { peerDependencies, depen
1880
1979
  if (!externalDistImports.includes(dep) && !externalDistImports.includes(dep.replace(/^@types\//, "")) && !externalDistTypeImports.includes(dep) && !externalDistTypeImports.includes(dep.replace(/^@types\//, ""))) {
1881
1980
  unusedDependencies++;
1882
1981
  if (dependencies.includes(dep)) {
1883
- console.log(`[${chalk22.blue(name)}] Unused peerDependency [already a dependency] in package.json: ${chalk22.red(dep)}`);
1982
+ console.log(`[${chalk23.blue(name)}] Unused peerDependency [already a dependency] in package.json: ${chalk23.red(dep)}`);
1884
1983
  } else {
1885
- console.log(`[${chalk22.blue(name)}] Unused peerDependency in package.json: ${chalk22.red(dep)}`);
1984
+ console.log(`[${chalk23.blue(name)}] Unused peerDependency in package.json: ${chalk23.red(dep)}`);
1886
1985
  }
1887
1986
  }
1888
1987
  }
1889
1988
  if (unusedDependencies > 0) {
1890
1989
  const packageLocation = `${location}/package.json`;
1891
- console.log(` ${chalk22.yellow(packageLocation)}
1990
+ console.log(` ${chalk23.yellow(packageLocation)}
1892
1991
  `);
1893
1992
  }
1894
1993
  return unusedDependencies;
@@ -1983,19 +2082,19 @@ var deplint = async ({
1983
2082
  });
1984
2083
  }
1985
2084
  if (totalErrors > 0) {
1986
- console.warn(`Deplint: Found ${chalk23.red(totalErrors)} dependency problems. ${chalk23.red("\u2716")}`);
2085
+ console.warn(`Deplint: Found ${chalk24.red(totalErrors)} dependency problems. ${chalk24.red("\u2716")}`);
1987
2086
  } else {
1988
- console.info(`Deplint: Found no dependency problems. ${chalk23.green("\u2714")}`);
2087
+ console.info(`Deplint: Found no dependency problems. ${chalk24.green("\u2714")}`);
1989
2088
  }
1990
2089
  return 0;
1991
2090
  };
1992
2091
 
1993
2092
  // src/actions/deploy.ts
1994
- import { readFileSync as readFileSync10 } from "fs";
2093
+ import { readFileSync as readFileSync11 } from "fs";
1995
2094
  var privatePackageExcludeList = () => {
1996
2095
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1997
2096
  workspace,
1998
- JSON.parse(readFileSync10(`${workspace.location}/package.json`, { encoding: "utf8" }))
2097
+ JSON.parse(readFileSync11(`${workspace.location}/package.json`, { encoding: "utf8" }))
1999
2098
  ]);
2000
2099
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
2001
2100
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -2015,11 +2114,11 @@ var deploy = () => {
2015
2114
  };
2016
2115
 
2017
2116
  // src/actions/deploy-major.ts
2018
- import { readFileSync as readFileSync11 } from "fs";
2117
+ import { readFileSync as readFileSync12 } from "fs";
2019
2118
  var privatePackageExcludeList2 = () => {
2020
2119
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
2021
2120
  workspace,
2022
- JSON.parse(readFileSync11(`${workspace.location}/package.json`, { encoding: "utf8" }))
2121
+ JSON.parse(readFileSync12(`${workspace.location}/package.json`, { encoding: "utf8" }))
2023
2122
  ]);
2024
2123
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
2025
2124
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -2039,11 +2138,11 @@ var deployMajor = () => {
2039
2138
  };
2040
2139
 
2041
2140
  // src/actions/deploy-minor.ts
2042
- import { readFileSync as readFileSync12 } from "fs";
2141
+ import { readFileSync as readFileSync13 } from "fs";
2043
2142
  var privatePackageExcludeList3 = () => {
2044
2143
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
2045
2144
  workspace,
2046
- JSON.parse(readFileSync12(`${workspace.location}/package.json`, { encoding: "utf8" }))
2145
+ JSON.parse(readFileSync13(`${workspace.location}/package.json`, { encoding: "utf8" }))
2047
2146
  ]);
2048
2147
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
2049
2148
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -2063,11 +2162,11 @@ var deployMinor = () => {
2063
2162
  };
2064
2163
 
2065
2164
  // src/actions/deploy-next.ts
2066
- import { readFileSync as readFileSync13 } from "fs";
2165
+ import { readFileSync as readFileSync14 } from "fs";
2067
2166
  var privatePackageExcludeList4 = () => {
2068
2167
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
2069
2168
  workspace,
2070
- JSON.parse(readFileSync13(`${workspace.location}/package.json`, { encoding: "utf8" }))
2169
+ JSON.parse(readFileSync14(`${workspace.location}/package.json`, { encoding: "utf8" }))
2071
2170
  ]);
2072
2171
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
2073
2172
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -2087,22 +2186,23 @@ var deployNext = () => {
2087
2186
  };
2088
2187
 
2089
2188
  // src/actions/dupdeps.ts
2090
- import chalk24 from "chalk";
2189
+ import chalk25 from "chalk";
2091
2190
  var dupdeps = () => {
2092
- console.log(chalk24.green("Checking all Dependencies for Duplicates"));
2093
- const allDependencies = parsedPackageJSON()?.dependencies;
2094
- const dependencies = Object.entries(allDependencies).map(([k]) => k);
2191
+ console.log(chalk25.green("Checking all Dependencies for Duplicates"));
2192
+ const pkg = parsedPackageJSON();
2193
+ const allDependencies = { ...pkg?.dependencies, ...pkg?.devDependencies };
2194
+ const dependencies = Object.keys(allDependencies);
2095
2195
  return detectDuplicateDependencies(dependencies);
2096
2196
  };
2097
2197
 
2098
2198
  // src/actions/lint.ts
2099
- import chalk25 from "chalk";
2199
+ import chalk26 from "chalk";
2100
2200
  var lintPackage = ({
2101
2201
  pkg,
2102
2202
  fix: fix2,
2103
2203
  verbose
2104
2204
  }) => {
2105
- console.log(chalk25.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
2205
+ console.log(chalk26.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
2106
2206
  const start = Date.now();
2107
2207
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
2108
2208
  ["yarn", [
@@ -2112,7 +2212,7 @@ var lintPackage = ({
2112
2212
  fix2 ? "package-fix" : verbose ? "package-lint-verbose" : "package-lint"
2113
2213
  ]]
2114
2214
  ]);
2115
- console.log(chalk25.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk25.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk25.gray("seconds")}`));
2215
+ console.log(chalk26.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk26.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk26.gray("seconds")}`));
2116
2216
  return result;
2117
2217
  };
2118
2218
  var lint = ({
@@ -2132,13 +2232,13 @@ var lint = ({
2132
2232
  });
2133
2233
  };
2134
2234
  var lintAllPackages = ({ fix: fix2 = false } = {}) => {
2135
- console.log(chalk25.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
2235
+ console.log(chalk26.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
2136
2236
  const start = Date.now();
2137
2237
  const fixOptions = fix2 ? ["--fix"] : [];
2138
2238
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
2139
2239
  ["yarn", ["eslint", "--cache", "--cache-location", ".eslintcache", "--cache-strategy", "content", ...fixOptions]]
2140
2240
  ]);
2141
- console.log(chalk25.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk25.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk25.gray("seconds")}`));
2241
+ console.log(chalk26.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk26.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk26.gray("seconds")}`));
2142
2242
  return result;
2143
2243
  };
2144
2244
 
@@ -2161,12 +2261,97 @@ var genDocsAll = ({ incremental }) => {
2161
2261
  return runSteps(`GenDocs [All${incremental ? "-Incremental" : ""}]`, [...steps]);
2162
2262
  };
2163
2263
 
2164
- // src/actions/gitignore-gen.ts
2165
- var filename = ".gitignore";
2166
- var gitignoreGen = (pkg) => generateIgnoreFiles(filename, pkg);
2264
+ // src/actions/gitignore.ts
2265
+ import { unlinkSync as unlinkSync4 } from "fs";
2266
+ import chalk27 from "chalk";
2267
+ var COMMENT_PREFIX = "#";
2268
+ var isComment = (line) => line.startsWith(COMMENT_PREFIX);
2269
+ var isNegation = (line) => line.startsWith("!");
2270
+ function parseTemplateSections(lines) {
2271
+ const sections = [];
2272
+ let current = [];
2273
+ for (const line of lines) {
2274
+ if (isComment(line)) {
2275
+ if (current.length > 0) {
2276
+ sections.push(current);
2277
+ }
2278
+ current = [line];
2279
+ } else {
2280
+ current.push(line);
2281
+ }
2282
+ }
2283
+ if (current.length > 0) {
2284
+ sections.push(current);
2285
+ }
2286
+ return sections;
2287
+ }
2288
+ function mergeWithTemplate(existing, templateContent) {
2289
+ const templateLines = templateContent.split("\n").filter((line) => line.trim().length > 0);
2290
+ const sections = parseTemplateSections(templateLines);
2291
+ const existingEntries = new Set(existing.filter((line) => !isComment(line)));
2292
+ const templateEntries = new Set(templateLines.filter((line) => !isComment(line)));
2293
+ const customEntries = [...existingEntries].filter((entry) => !templateEntries.has(entry));
2294
+ const result = [];
2295
+ for (const section of sections) {
2296
+ for (const line of section) {
2297
+ result.push(line);
2298
+ }
2299
+ result.push("");
2300
+ }
2301
+ if (customEntries.length > 0) {
2302
+ result.push("# Custom");
2303
+ const sorted = [...union(customEntries, [])].toSorted((a, b) => {
2304
+ if (isNegation(a) && !isNegation(b)) return 1;
2305
+ if (!isNegation(a) && isNegation(b)) return -1;
2306
+ return a.localeCompare(b);
2307
+ });
2308
+ for (const entry of sorted) {
2309
+ result.push(entry);
2310
+ }
2311
+ result.push("");
2312
+ }
2313
+ return result;
2314
+ }
2315
+ function removePackageGitignores(cwd5) {
2316
+ let removed = 0;
2317
+ const workspaces = yarnWorkspaces();
2318
+ for (const { location } of workspaces) {
2319
+ if (location === ".") continue;
2320
+ const filePath = `${cwd5}/${location}/.gitignore`;
2321
+ try {
2322
+ unlinkSync4(filePath);
2323
+ console.log(chalk27.yellow(` Removed ${location}/.gitignore`));
2324
+ removed++;
2325
+ } catch {
2326
+ }
2327
+ }
2328
+ return removed;
2329
+ }
2330
+ var gitignoreGen = gitignore;
2331
+ function gitignore() {
2332
+ console.log(chalk27.green("Generate .gitignore"));
2333
+ const cwd5 = INIT_CWD() ?? ".";
2334
+ const gitignorePath = `${cwd5}/.gitignore`;
2335
+ try {
2336
+ const templateContent = gitignoreTemplate();
2337
+ const existing = readNonEmptyLines(gitignorePath);
2338
+ const merged = mergeWithTemplate(existing, templateContent);
2339
+ writeLines(gitignorePath, merged);
2340
+ console.log(chalk27.green(" Root .gitignore updated"));
2341
+ const removed = removePackageGitignores(cwd5);
2342
+ if (removed > 0) {
2343
+ console.log(chalk27.green(` Removed ${removed} package .gitignore file(s)`));
2344
+ }
2345
+ return 0;
2346
+ } catch (ex) {
2347
+ const error = ex;
2348
+ console.error(chalk27.red(`Generate .gitignore failed: ${error.message}`));
2349
+ return 1;
2350
+ }
2351
+ }
2167
2352
 
2168
2353
  // src/actions/gitlint.ts
2169
- import chalk26 from "chalk";
2354
+ import chalk28 from "chalk";
2170
2355
  import ParseGitConfig from "parse-git-config";
2171
2356
  var gitlint = () => {
2172
2357
  console.log(`
@@ -2177,7 +2362,7 @@ Gitlint Start [${process.cwd()}]
2177
2362
  const errors = 0;
2178
2363
  const gitConfig = ParseGitConfig.sync();
2179
2364
  const warn = (message) => {
2180
- console.warn(chalk26.yellow(`Warning: ${message}`));
2365
+ console.warn(chalk28.yellow(`Warning: ${message}`));
2181
2366
  warnings++;
2182
2367
  };
2183
2368
  if (gitConfig.core.ignorecase) {
@@ -2197,13 +2382,13 @@ Gitlint Start [${process.cwd()}]
2197
2382
  }
2198
2383
  const resultMessages = [];
2199
2384
  if (valid > 0) {
2200
- resultMessages.push(chalk26.green(`Passed: ${valid}`));
2385
+ resultMessages.push(chalk28.green(`Passed: ${valid}`));
2201
2386
  }
2202
2387
  if (warnings > 0) {
2203
- resultMessages.push(chalk26.yellow(`Warnings: ${warnings}`));
2388
+ resultMessages.push(chalk28.yellow(`Warnings: ${warnings}`));
2204
2389
  }
2205
2390
  if (errors > 0) {
2206
- resultMessages.push(chalk26.red(` Errors: ${errors}`));
2391
+ resultMessages.push(chalk28.red(` Errors: ${errors}`));
2207
2392
  }
2208
2393
  console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
2209
2394
  `);
@@ -2212,7 +2397,7 @@ Gitlint Start [${process.cwd()}]
2212
2397
 
2213
2398
  // src/actions/gitlint-fix.ts
2214
2399
  import { execSync as execSync3 } from "child_process";
2215
- import chalk27 from "chalk";
2400
+ import chalk29 from "chalk";
2216
2401
  import ParseGitConfig2 from "parse-git-config";
2217
2402
  var gitlintFix = () => {
2218
2403
  console.log(`
@@ -2221,15 +2406,15 @@ Gitlint Fix Start [${process.cwd()}]
2221
2406
  const gitConfig = ParseGitConfig2.sync();
2222
2407
  if (gitConfig.core.ignorecase) {
2223
2408
  execSync3("git config core.ignorecase false", { stdio: "inherit" });
2224
- console.warn(chalk27.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
2409
+ console.warn(chalk29.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
2225
2410
  }
2226
2411
  if (gitConfig.core.autocrlf !== false) {
2227
2412
  execSync3("git config core.autocrlf false", { stdio: "inherit" });
2228
- console.warn(chalk27.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
2413
+ console.warn(chalk29.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
2229
2414
  }
2230
2415
  if (gitConfig.core.eol !== "lf") {
2231
2416
  execSync3("git config core.eol lf", { stdio: "inherit" });
2232
- console.warn(chalk27.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
2417
+ console.warn(chalk29.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
2233
2418
  }
2234
2419
  return 1;
2235
2420
  };
@@ -2240,7 +2425,7 @@ var knip = () => {
2240
2425
  };
2241
2426
 
2242
2427
  // src/actions/license.ts
2243
- import chalk28 from "chalk";
2428
+ import chalk30 from "chalk";
2244
2429
  import { init } from "license-checker";
2245
2430
  var license = async (pkg) => {
2246
2431
  const workspaces = yarnWorkspaces();
@@ -2265,18 +2450,18 @@ var license = async (pkg) => {
2265
2450
  "LGPL-3.0-or-later",
2266
2451
  "Python-2.0"
2267
2452
  ]);
2268
- console.log(chalk28.green("License Checker"));
2453
+ console.log(chalk30.green("License Checker"));
2269
2454
  return (await Promise.all(
2270
2455
  workspaceList.map(({ location, name }) => {
2271
2456
  return new Promise((resolve) => {
2272
2457
  init({ production: true, start: location }, (error, packages) => {
2273
2458
  if (error) {
2274
- console.error(chalk28.red(`License Checker [${name}] Error`));
2275
- console.error(chalk28.gray(error));
2459
+ console.error(chalk30.red(`License Checker [${name}] Error`));
2460
+ console.error(chalk30.gray(error));
2276
2461
  console.log("\n");
2277
2462
  resolve(1);
2278
2463
  } else {
2279
- console.log(chalk28.green(`License Checker [${name}]`));
2464
+ console.log(chalk30.green(`License Checker [${name}]`));
2280
2465
  let count = 0;
2281
2466
  for (const [name2, info] of Object.entries(packages)) {
2282
2467
  const licenses = Array.isArray(info.licenses) ? info.licenses : [info.licenses];
@@ -2292,7 +2477,7 @@ var license = async (pkg) => {
2292
2477
  }
2293
2478
  if (!orLicenseFound) {
2294
2479
  count++;
2295
- console.warn(chalk28.yellow(`${name2}: Package License not allowed [${license2}]`));
2480
+ console.warn(chalk30.yellow(`${name2}: Package License not allowed [${license2}]`));
2296
2481
  }
2297
2482
  }
2298
2483
  }
@@ -2307,17 +2492,17 @@ var license = async (pkg) => {
2307
2492
  };
2308
2493
 
2309
2494
  // src/actions/npmignore-gen.ts
2310
- var filename2 = ".npmignore";
2311
- var npmignoreGen = (pkg) => generateIgnoreFiles(filename2, pkg);
2495
+ var filename = ".npmignore";
2496
+ var npmignoreGen = (pkg) => generateIgnoreFiles(filename, pkg);
2312
2497
 
2313
2498
  // src/actions/package/clean-outputs.ts
2314
2499
  import path8 from "path";
2315
- import chalk29 from "chalk";
2500
+ import chalk31 from "chalk";
2316
2501
  var packageCleanOutputs = () => {
2317
2502
  const pkg = process.env.INIT_CWD ?? ".";
2318
2503
  const pkgName = process.env.npm_package_name;
2319
2504
  const folders = [path8.join(pkg, "dist"), path8.join(pkg, "build"), path8.join(pkg, "docs")];
2320
- console.log(chalk29.green(`Cleaning Outputs [${pkgName}]`));
2505
+ console.log(chalk31.green(`Cleaning Outputs [${pkgName}]`));
2321
2506
  for (let folder of folders) {
2322
2507
  deleteGlob(folder);
2323
2508
  }
@@ -2326,11 +2511,11 @@ var packageCleanOutputs = () => {
2326
2511
 
2327
2512
  // src/actions/package/clean-typescript.ts
2328
2513
  import path9 from "path";
2329
- import chalk30 from "chalk";
2514
+ import chalk32 from "chalk";
2330
2515
  var packageCleanTypescript = () => {
2331
2516
  const pkg = process.env.INIT_CWD ?? ".";
2332
2517
  const pkgName = process.env.npm_package_name;
2333
- console.log(chalk30.green(`Cleaning Typescript [${pkgName}]`));
2518
+ console.log(chalk32.green(`Cleaning Typescript [${pkgName}]`));
2334
2519
  const files = [path9.join(pkg, "*.tsbuildinfo"), path9.join(pkg, ".tsconfig.*"), path9.join(pkg, ".eslintcache")];
2335
2520
  for (let file of files) {
2336
2521
  deleteGlob(file);
@@ -2344,26 +2529,26 @@ var packageClean = async () => {
2344
2529
  };
2345
2530
 
2346
2531
  // src/actions/package/compile/compile.ts
2347
- import chalk35 from "chalk";
2532
+ import chalk37 from "chalk";
2348
2533
 
2349
2534
  // src/actions/package/compile/packageCompileTsup.ts
2350
- import chalk34 from "chalk";
2535
+ import chalk36 from "chalk";
2351
2536
  import { build as build2, defineConfig } from "tsup";
2352
2537
 
2353
2538
  // src/actions/package/compile/inputs.ts
2354
- import chalk31 from "chalk";
2539
+ import chalk33 from "chalk";
2355
2540
  import { glob as glob2 } from "glob";
2356
2541
  var getAllInputs = (srcDir, verbose = false) => {
2357
2542
  return [...glob2.sync(`${srcDir}/**/*.ts`, { posix: true }).map((file) => {
2358
2543
  const result = file.slice(Math.max(0, srcDir.length + 1));
2359
2544
  if (verbose) {
2360
- console.log(chalk31.gray(`getAllInputs: ${JSON.stringify(result, null, 2)}`));
2545
+ console.log(chalk33.gray(`getAllInputs: ${JSON.stringify(result, null, 2)}`));
2361
2546
  }
2362
2547
  return result;
2363
2548
  }), ...glob2.sync(`${srcDir}/**/*.tsx`, { posix: true }).map((file) => {
2364
2549
  const result = file.slice(Math.max(0, srcDir.length + 1));
2365
2550
  if (verbose) {
2366
- console.log(chalk31.gray(`getAllInputs: ${JSON.stringify(result, null, 2)}`));
2551
+ console.log(chalk33.gray(`getAllInputs: ${JSON.stringify(result, null, 2)}`));
2367
2552
  }
2368
2553
  return result;
2369
2554
  })];
@@ -2425,7 +2610,7 @@ function deepMergeObjects(objects) {
2425
2610
 
2426
2611
  // src/actions/package/compile/packageCompileTsc.ts
2427
2612
  import { cwd as cwd2 } from "process";
2428
- import chalk32 from "chalk";
2613
+ import chalk34 from "chalk";
2429
2614
  import { createProgramFromConfig } from "tsc-prog";
2430
2615
  import ts3, {
2431
2616
  DiagnosticCategory,
@@ -2447,7 +2632,7 @@ var getCompilerOptions = (options = {}, fileName = "tsconfig.json") => {
2447
2632
  var packageCompileTsc = (platform, entries, srcDir = "src", outDir = "dist", compilerOptionsParam, verbose = false) => {
2448
2633
  const pkg = process.env.INIT_CWD ?? cwd2();
2449
2634
  if (verbose) {
2450
- console.log(chalk32.cyan(`Validating code START: ${entries.length} files to ${outDir} from ${srcDir}`));
2635
+ console.log(chalk34.cyan(`Validating code START: ${entries.length} files to ${outDir} from ${srcDir}`));
2451
2636
  }
2452
2637
  const configFilePath = ts3.findConfigFile(
2453
2638
  "./",
@@ -2470,10 +2655,10 @@ var packageCompileTsc = (platform, entries, srcDir = "src", outDir = "dist", com
2470
2655
  emitDeclarationOnly: true,
2471
2656
  noEmit: false
2472
2657
  };
2473
- console.log(chalk32.cyan(`Validating Files: ${entries.length}`));
2658
+ console.log(chalk34.cyan(`Validating Files: ${entries.length}`));
2474
2659
  if (verbose) {
2475
2660
  for (const entry of entries) {
2476
- console.log(chalk32.grey(`Validating: ${entry}`));
2661
+ console.log(chalk34.grey(`Validating: ${entry}`));
2477
2662
  }
2478
2663
  }
2479
2664
  try {
@@ -2509,7 +2694,7 @@ var packageCompileTsc = (platform, entries, srcDir = "src", outDir = "dist", com
2509
2694
  return 0;
2510
2695
  } finally {
2511
2696
  if (verbose) {
2512
- console.log(chalk32.cyan(`Validating code FINISH: ${entries.length} files to ${outDir} from ${srcDir}`));
2697
+ console.log(chalk34.cyan(`Validating code FINISH: ${entries.length} files to ${outDir} from ${srcDir}`));
2513
2698
  }
2514
2699
  }
2515
2700
  };
@@ -2517,7 +2702,7 @@ var packageCompileTsc = (platform, entries, srcDir = "src", outDir = "dist", com
2517
2702
  // src/actions/package/compile/packageCompileTscTypes.ts
2518
2703
  import path10 from "path";
2519
2704
  import { cwd as cwd3 } from "process";
2520
- import chalk33 from "chalk";
2705
+ import chalk35 from "chalk";
2521
2706
  import { rollup } from "rollup";
2522
2707
  import dts from "rollup-plugin-dts";
2523
2708
  import nodeExternals from "rollup-plugin-node-externals";
@@ -2542,8 +2727,8 @@ async function bundleDts(inputPath, outputPath, platform, options, verbose = fal
2542
2727
  if (ignoredWarningCodes.has(warning.code ?? "")) {
2543
2728
  return;
2544
2729
  }
2545
- console.warn(chalk33.yellow(`[${warning.code}] ${warning.message}`));
2546
- console.warn(chalk33.gray(inputPath));
2730
+ console.warn(chalk35.yellow(`[${warning.code}] ${warning.message}`));
2731
+ console.warn(chalk35.gray(inputPath));
2547
2732
  warn(warning);
2548
2733
  }
2549
2734
  });
@@ -2553,8 +2738,8 @@ async function bundleDts(inputPath, outputPath, platform, options, verbose = fal
2553
2738
  });
2554
2739
  } catch (ex) {
2555
2740
  const error = ex;
2556
- console.warn(chalk33.red(error));
2557
- console.warn(chalk33.gray(inputPath));
2741
+ console.warn(chalk35.red(error));
2742
+ console.warn(chalk35.gray(inputPath));
2558
2743
  }
2559
2744
  if (verbose) {
2560
2745
  console.log(`Bundled declarations written to ${outputPath}`);
@@ -2562,7 +2747,7 @@ async function bundleDts(inputPath, outputPath, platform, options, verbose = fal
2562
2747
  }
2563
2748
  var packageCompileTscTypes = async (entries, outDir, platform, srcDir = "build", verbose = false) => {
2564
2749
  if (verbose) {
2565
- console.log(chalk33.cyan(`Compiling Types START [${platform}]: ${entries.length} files to ${outDir} from ${srcDir}`));
2750
+ console.log(chalk35.cyan(`Compiling Types START [${platform}]: ${entries.length} files to ${outDir} from ${srcDir}`));
2566
2751
  console.log(`Entries: ${entries.join(", ")}`);
2567
2752
  }
2568
2753
  const pkg = process.env.INIT_CWD ?? cwd3();
@@ -2586,7 +2771,7 @@ var packageCompileTscTypes = async (entries, outDir, platform, srcDir = "build",
2586
2771
  await bundleDts(`${srcRoot}/${entryTypeName}`, `${outDir}/${entryTypeName}`, platform, { compilerOptions }, verbose);
2587
2772
  }));
2588
2773
  if (verbose) {
2589
- console.log(chalk33.cyan(`Compiling Types FINISH: ${entries.length} files to ${outDir} from ${srcDir}`));
2774
+ console.log(chalk35.cyan(`Compiling Types FINISH: ${entries.length} files to ${outDir} from ${srcDir}`));
2590
2775
  }
2591
2776
  return 0;
2592
2777
  };
@@ -2598,15 +2783,15 @@ var compileFolder = async (srcDir, entries, buildDir, options, bundleTypes = fal
2598
2783
  console.log(`compileFolder [${srcDir}, ${options?.outDir}]`);
2599
2784
  }
2600
2785
  if (entries.length === 0) {
2601
- console.warn(chalk34.yellow(`No entries found in ${srcDir} to compile`));
2786
+ console.warn(chalk36.yellow(`No entries found in ${srcDir} to compile`));
2602
2787
  return 0;
2603
2788
  }
2604
2789
  if (verbose) {
2605
- console.log(chalk34.gray(`buildDir [${buildDir}]`));
2790
+ console.log(chalk36.gray(`buildDir [${buildDir}]`));
2606
2791
  }
2607
2792
  const validationResult = packageCompileTsc(options?.platform ?? "neutral", entries, srcDir, buildDir, void 0, verbose);
2608
2793
  if (validationResult !== 0) {
2609
- console.error(chalk34.red(`Compile:Validation had ${validationResult} errors`));
2794
+ console.error(chalk36.red(`Compile:Validation had ${validationResult} errors`));
2610
2795
  return validationResult;
2611
2796
  }
2612
2797
  const optionsParams = tsupOptions([{
@@ -2631,12 +2816,12 @@ var compileFolder = async (srcDir, entries, buildDir, options, bundleTypes = fal
2631
2816
  })
2632
2817
  )).flat();
2633
2818
  if (verbose) {
2634
- console.log(chalk34.cyan(`TSUP:build:start [${srcDir}]`));
2635
- console.log(chalk34.gray(`TSUP:build:options [${JSON.stringify(optionsList, null, 2)}]`));
2819
+ console.log(chalk36.cyan(`TSUP:build:start [${srcDir}]`));
2820
+ console.log(chalk36.gray(`TSUP:build:options [${JSON.stringify(optionsList, null, 2)}]`));
2636
2821
  }
2637
2822
  await Promise.all(optionsList.map((options2) => build2(options2)));
2638
2823
  if (verbose) {
2639
- console.log(chalk34.cyan(`TSUP:build:stop [${srcDir}]`));
2824
+ console.log(chalk36.cyan(`TSUP:build:stop [${srcDir}]`));
2640
2825
  }
2641
2826
  if (bundleTypes) {
2642
2827
  await packageCompileTscTypes(entries, outDir, options?.platform ?? "neutral", buildDir, verbose);
@@ -2747,14 +2932,14 @@ var packageCompileTsup = async (config2) => {
2747
2932
  // src/actions/package/compile/compile.ts
2748
2933
  var packageCompile = async (inConfig = {}) => {
2749
2934
  const pkg = process.env.INIT_CWD;
2750
- console.log(chalk35.green(`Compiling ${pkg}`));
2935
+ console.log(chalk37.green(`Compiling ${pkg}`));
2751
2936
  const config2 = await loadConfig(inConfig);
2752
2937
  return await packageCompileTsup(config2);
2753
2938
  };
2754
2939
 
2755
2940
  // src/actions/package/copy-assets.ts
2756
2941
  import path11 from "path/posix";
2757
- import chalk36 from "chalk";
2942
+ import chalk38 from "chalk";
2758
2943
  import cpy2 from "cpy";
2759
2944
  var copyTargetAssets2 = async (target, name, location) => {
2760
2945
  try {
@@ -2767,7 +2952,7 @@ var copyTargetAssets2 = async (target, name, location) => {
2767
2952
  }
2768
2953
  );
2769
2954
  if (values.length > 0) {
2770
- console.log(chalk36.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
2955
+ console.log(chalk38.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
2771
2956
  }
2772
2957
  for (const value of values) {
2773
2958
  console.log(`${value.split("/").pop()} => ./dist/${target}`);
@@ -2832,9 +3017,9 @@ var packageCycle = async () => {
2832
3017
  };
2833
3018
 
2834
3019
  // src/actions/package/gen-docs.ts
2835
- import { existsSync as existsSync9 } from "fs";
3020
+ import { existsSync as existsSync10 } from "fs";
2836
3021
  import path12 from "path";
2837
- import chalk37 from "chalk";
3022
+ import chalk39 from "chalk";
2838
3023
  import {
2839
3024
  Application,
2840
3025
  ArgumentsReader,
@@ -2852,7 +3037,7 @@ var ExitCodes = {
2852
3037
  };
2853
3038
  var packageGenDocs = async () => {
2854
3039
  const pkg = process.env.INIT_CWD;
2855
- if (pkg !== void 0 && !existsSync9(path12.join(pkg, "typedoc.json"))) {
3040
+ if (pkg !== void 0 && !existsSync10(path12.join(pkg, "typedoc.json"))) {
2856
3041
  return;
2857
3042
  }
2858
3043
  const app = await Application.bootstrap({
@@ -2938,16 +3123,16 @@ var runTypeDoc = async (app) => {
2938
3123
  return ExitCodes.OutputError;
2939
3124
  }
2940
3125
  }
2941
- console.log(chalk37.green(`${pkgName} - Ok`));
3126
+ console.log(chalk39.green(`${pkgName} - Ok`));
2942
3127
  return ExitCodes.Ok;
2943
3128
  };
2944
3129
 
2945
3130
  // src/actions/package/lint.ts
2946
- import { readdirSync as readdirSync5 } from "fs";
3131
+ import { readdirSync as readdirSync6 } from "fs";
2947
3132
  import path13 from "path";
2948
3133
  import { cwd as cwd4 } from "process";
2949
3134
  import { pathToFileURL } from "url";
2950
- import chalk38 from "chalk";
3135
+ import chalk40 from "chalk";
2951
3136
  import { ESLint } from "eslint";
2952
3137
  import { findUp } from "find-up";
2953
3138
  import picomatch from "picomatch";
@@ -2956,14 +3141,14 @@ var dumpMessages = (lintResults) => {
2956
3141
  const severity = ["none", "warning", "error"];
2957
3142
  for (const lintResult of lintResults) {
2958
3143
  if (lintResult.messages.length > 0) {
2959
- console.log(chalk38.gray(`
3144
+ console.log(chalk40.gray(`
2960
3145
  ${lintResult.filePath}`));
2961
3146
  for (const message of lintResult.messages) {
2962
3147
  console.log(
2963
- chalk38.gray(` ${message.line}:${message.column}`),
2964
- chalk38[colors[message.severity]](` ${severity[message.severity]}`),
2965
- chalk38.white(` ${message.message}`),
2966
- chalk38.gray(` ${message.ruleId}`)
3148
+ chalk40.gray(` ${message.line}:${message.column}`),
3149
+ chalk40[colors[message.severity]](` ${severity[message.severity]}`),
3150
+ chalk40.white(` ${message.message}`),
3151
+ chalk40.gray(` ${message.ruleId}`)
2967
3152
  );
2968
3153
  }
2969
3154
  }
@@ -2980,7 +3165,7 @@ function getFiles(dir, ignoreFolders) {
2980
3165
  const currentDirectory = cwd4();
2981
3166
  const subDirectory = dir.split(currentDirectory)[1]?.split("/")[1];
2982
3167
  if (ignoreFolders.includes(subDirectory)) return [];
2983
- return readdirSync5(dir, { withFileTypes: true }).flatMap((dirent) => {
3168
+ return readdirSync6(dir, { withFileTypes: true }).flatMap((dirent) => {
2984
3169
  const res = path13.resolve(dir, dirent.name);
2985
3170
  const relativePath = subDirectory === void 0 ? dirent.name : `${subDirectory}/${dirent.name}`;
2986
3171
  const ignoreMatchers = ignoreFolders.map((pattern) => picomatch(pattern));
@@ -3001,10 +3186,10 @@ var packageLint = async (fix2 = false, verbose = false, cache = true) => {
3001
3186
  cache
3002
3187
  });
3003
3188
  const files = getFiles(cwd4(), ignoreFolders);
3004
- console.log(chalk38.green(`Linting ${pkg} [files = ${files.length}]`));
3189
+ console.log(chalk40.green(`Linting ${pkg} [files = ${files.length}]`));
3005
3190
  if (verbose) {
3006
3191
  for (const file of files) {
3007
- console.log(chalk38.gray(` ${file}`));
3192
+ console.log(chalk40.gray(` ${file}`));
3008
3193
  }
3009
3194
  }
3010
3195
  const lintResults = await engine.lintFiles(files);
@@ -3015,32 +3200,32 @@ var packageLint = async (fix2 = false, verbose = false, cache = true) => {
3015
3200
  const filesCountColor = files.length < 100 ? "green" : files.length < 1e3 ? "yellow" : "red";
3016
3201
  const lintTime = Date.now() - start;
3017
3202
  const lintTimeColor = lintTime < 1e3 ? "green" : lintTime < 3e3 ? "yellow" : "red";
3018
- console.log(chalk38.white(`Linted ${chalk38[filesCountColor](files.length)} files in ${chalk38[lintTimeColor](lintTime)}ms`));
3203
+ console.log(chalk40.white(`Linted ${chalk40[filesCountColor](files.length)} files in ${chalk40[lintTimeColor](lintTime)}ms`));
3019
3204
  return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
3020
3205
  };
3021
3206
 
3022
3207
  // src/actions/package/publint.ts
3023
3208
  import { promises as fs10 } from "fs";
3024
- import chalk39 from "chalk";
3209
+ import chalk41 from "chalk";
3025
3210
  import sortPackageJson from "sort-package-json";
3026
3211
  var customPubLint = (pkg) => {
3027
3212
  let errorCount = 0;
3028
3213
  let warningCount = 0;
3029
3214
  if (pkg.files === void 0) {
3030
- console.warn(chalk39.yellow('Publint [custom]: "files" field is missing'));
3215
+ console.warn(chalk41.yellow('Publint [custom]: "files" field is missing'));
3031
3216
  warningCount++;
3032
3217
  }
3033
3218
  if (pkg.main !== void 0) {
3034
- console.warn(chalk39.yellow('Publint [custom]: "main" field is deprecated, use "exports" instead'));
3219
+ console.warn(chalk41.yellow('Publint [custom]: "main" field is deprecated, use "exports" instead'));
3035
3220
  warningCount++;
3036
3221
  }
3037
3222
  if (pkg.sideEffects !== false) {
3038
- console.warn(chalk39.yellow('Publint [custom]: "sideEffects" field should be set to false'));
3223
+ console.warn(chalk41.yellow('Publint [custom]: "sideEffects" field should be set to false'));
3039
3224
  warningCount++;
3040
3225
  }
3041
3226
  if (pkg.resolutions !== void 0) {
3042
- console.warn(chalk39.yellow('Publint [custom]: "resolutions" in use'));
3043
- console.warn(chalk39.gray(JSON.stringify(pkg.resolutions, null, 2)));
3227
+ console.warn(chalk41.yellow('Publint [custom]: "resolutions" in use'));
3228
+ console.warn(chalk41.gray(JSON.stringify(pkg.resolutions, null, 2)));
3044
3229
  warningCount++;
3045
3230
  }
3046
3231
  return [errorCount, warningCount];
@@ -3050,8 +3235,8 @@ var packagePublint = async ({ strict = true, verbose = false } = {}) => {
3050
3235
  const sortedPkg = sortPackageJson(await fs10.readFile(`${pkgDir}/package.json`, "utf8"));
3051
3236
  await fs10.writeFile(`${pkgDir}/package.json`, sortedPkg);
3052
3237
  const pkg = JSON.parse(await fs10.readFile(`${pkgDir}/package.json`, "utf8"));
3053
- console.log(chalk39.green(`Publint: ${pkg.name}`));
3054
- console.log(chalk39.gray(pkgDir));
3238
+ console.log(chalk41.green(`Publint: ${pkg.name}`));
3239
+ console.log(chalk41.gray(pkgDir));
3055
3240
  const { publint: publint2 } = await import("publint");
3056
3241
  const { messages } = await publint2({
3057
3242
  level: "suggestion",
@@ -3062,22 +3247,22 @@ var packagePublint = async ({ strict = true, verbose = false } = {}) => {
3062
3247
  for (const message of messages) {
3063
3248
  switch (message.type) {
3064
3249
  case "error": {
3065
- console.error(chalk39.red(`[${message.code}] ${formatMessage(message, pkg)}`));
3250
+ console.error(chalk41.red(`[${message.code}] ${formatMessage(message, pkg)}`));
3066
3251
  break;
3067
3252
  }
3068
3253
  case "warning": {
3069
- console.warn(chalk39.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
3254
+ console.warn(chalk41.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
3070
3255
  break;
3071
3256
  }
3072
3257
  default: {
3073
- console.log(chalk39.white(`[${message.code}] ${formatMessage(message, pkg)}`));
3258
+ console.log(chalk41.white(`[${message.code}] ${formatMessage(message, pkg)}`));
3074
3259
  break;
3075
3260
  }
3076
3261
  }
3077
3262
  }
3078
3263
  const [errorCount, warningCount] = customPubLint(pkg);
3079
3264
  if (verbose) {
3080
- console.log(chalk39.gray(`Publint [Finish]: ${pkgDir} [${messages.length + errorCount + warningCount} messages]`));
3265
+ console.log(chalk41.gray(`Publint [Finish]: ${pkgDir} [${messages.length + errorCount + warningCount} messages]`));
3081
3266
  }
3082
3267
  return messages.filter((message) => message.type === "error").length + errorCount;
3083
3268
  };
@@ -3140,7 +3325,7 @@ var rebuild = ({ target }) => {
3140
3325
  };
3141
3326
 
3142
3327
  // src/actions/recompile.ts
3143
- import chalk40 from "chalk";
3328
+ import chalk42 from "chalk";
3144
3329
  var recompile = async ({
3145
3330
  verbose,
3146
3331
  target,
@@ -3176,7 +3361,7 @@ var recompileAll = async ({
3176
3361
  const incrementalOptions = incremental ? ["--since", "-Apt", "--topological-dev"] : ["--parallel", "-Apt", "--topological-dev"];
3177
3362
  const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
3178
3363
  if (jobs) {
3179
- console.log(chalk40.blue(`Jobs set to [${jobs}]`));
3364
+ console.log(chalk42.blue(`Jobs set to [${jobs}]`));
3180
3365
  }
3181
3366
  const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
3182
3367
  [
@@ -3207,7 +3392,7 @@ var recompileAll = async ({
3207
3392
  ]
3208
3393
  ]);
3209
3394
  console.log(
3210
- `${chalk40.gray("Recompiled in")} [${chalk40.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk40.gray("seconds")}`
3395
+ `${chalk42.gray("Recompiled in")} [${chalk42.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk42.gray("seconds")}`
3211
3396
  );
3212
3397
  return result;
3213
3398
  };
@@ -3216,7 +3401,7 @@ var recompileAll = async ({
3216
3401
  import {
3217
3402
  closeSync,
3218
3403
  openSync,
3219
- rmSync as rmSync2
3404
+ rmSync as rmSync3
3220
3405
  } from "fs";
3221
3406
  var reinstall = () => {
3222
3407
  console.log("Reinstall [Clear Lock File]");
@@ -3226,7 +3411,7 @@ var reinstall = () => {
3226
3411
  const result = workspaces.map(({ location, name }) => {
3227
3412
  const dist = `${location}/node_modules`;
3228
3413
  try {
3229
- rmSync2(dist, { force: true, recursive: true });
3414
+ rmSync3(dist, { force: true, recursive: true });
3230
3415
  return 0;
3231
3416
  } catch (ex) {
3232
3417
  const error = ex;
@@ -3238,13 +3423,13 @@ var reinstall = () => {
3238
3423
  };
3239
3424
 
3240
3425
  // src/actions/relint.ts
3241
- import chalk41 from "chalk";
3426
+ import chalk43 from "chalk";
3242
3427
  var relintPackage = ({
3243
3428
  pkg,
3244
3429
  fix: fix2,
3245
3430
  verbose
3246
3431
  }) => {
3247
- console.log(chalk41.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
3432
+ console.log(chalk43.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
3248
3433
  const start = Date.now();
3249
3434
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
3250
3435
  ["yarn", [
@@ -3254,7 +3439,7 @@ var relintPackage = ({
3254
3439
  fix2 ? "package-fix" : verbose ? "package-lint-verbose" : "package-lint"
3255
3440
  ]]
3256
3441
  ]);
3257
- console.log(chalk41.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk41.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk41.gray("seconds")}`));
3442
+ console.log(chalk43.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk43.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk43.gray("seconds")}`));
3258
3443
  return result;
3259
3444
  };
3260
3445
  var relint = ({
@@ -3274,13 +3459,13 @@ var relint = ({
3274
3459
  });
3275
3460
  };
3276
3461
  var relintAllPackages = ({ fix: fix2 = false } = {}) => {
3277
- console.log(chalk41.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
3462
+ console.log(chalk43.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
3278
3463
  const start = Date.now();
3279
3464
  const fixOptions = fix2 ? ["--fix"] : [];
3280
3465
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
3281
3466
  ["yarn", ["eslint", ...fixOptions]]
3282
3467
  ]);
3283
- console.log(chalk41.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk41.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk41.gray("seconds")}`));
3468
+ console.log(chalk43.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk43.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk43.gray("seconds")}`));
3284
3469
  return result;
3285
3470
  };
3286
3471
 
@@ -3298,10 +3483,10 @@ var sonar = () => {
3298
3483
  };
3299
3484
 
3300
3485
  // src/actions/statics.ts
3301
- import chalk42 from "chalk";
3486
+ import chalk44 from "chalk";
3302
3487
  var DefaultDependencies = ["axios", "@xylabs/pixel", "react", "graphql", "react-router", "@mui/material", "@mui/system"];
3303
3488
  var statics = () => {
3304
- console.log(chalk42.green("Check Required Static Dependencies"));
3489
+ console.log(chalk44.green("Check Required Static Dependencies"));
3305
3490
  const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
3306
3491
  return detectDuplicateDependencies(statics2, DefaultDependencies);
3307
3492
  };
@@ -3357,18 +3542,13 @@ var loadPackageConfig = async () => {
3357
3542
  return JSON.parse(pkgConfig);
3358
3543
  };
3359
3544
 
3360
- // src/xy/param.ts
3361
- var packagePositionalParam = (yargs2) => {
3362
- return yargs2.positional("package", { describe: "Specific package to target", type: "string" });
3363
- };
3364
-
3365
- // src/xy/build-commands/build.ts
3545
+ // src/xy/build/buildCommand.ts
3366
3546
  var buildCommand = {
3367
- builder: (yargs2) => {
3368
- return packagePositionalParam(yargs2);
3369
- },
3370
3547
  command: "build [package]",
3371
3548
  describe: "Build - Compile & Lint",
3549
+ builder: (yargs2) => {
3550
+ return yargs2.positional("package", { describe: "Specific package to build" });
3551
+ },
3372
3552
  handler: async (argv) => {
3373
3553
  if (argv.verbose) {
3374
3554
  console.log(`Building: ${argv.package ?? "all"}`);
@@ -3382,12 +3562,14 @@ var buildCommand = {
3382
3562
  });
3383
3563
  }
3384
3564
  };
3565
+
3566
+ // src/xy/build/compileCommand.ts
3385
3567
  var compileCommand = {
3386
- builder: (yargs2) => {
3387
- return packagePositionalParam(yargs2);
3388
- },
3389
3568
  command: "compile [package]",
3390
3569
  describe: "Compile with Typescript & Copy Images",
3570
+ builder: (yargs2) => {
3571
+ return yargs2.positional("package", { describe: "Specific package to compile" });
3572
+ },
3391
3573
  handler: (argv) => {
3392
3574
  if (argv.verbose) {
3393
3575
  console.log(`Compiling: ${argv.package ?? "all"}`);
@@ -3401,12 +3583,14 @@ var compileCommand = {
3401
3583
  });
3402
3584
  }
3403
3585
  };
3586
+
3587
+ // src/xy/build/compileOnlyCommand.ts
3404
3588
  var compileOnlyCommand = {
3405
- builder: (yargs2) => {
3406
- return packagePositionalParam(yargs2);
3407
- },
3408
3589
  command: "compile-only [package]",
3409
3590
  describe: "Compile with Typescript & Copy Images (No Publint)",
3591
+ builder: (yargs2) => {
3592
+ return yargs2.positional("package", { describe: "Specific package to compile" });
3593
+ },
3410
3594
  handler: (argv) => {
3411
3595
  if (argv.verbose) {
3412
3596
  console.log(`Compiling: ${argv.package ?? "all"}`);
@@ -3421,51 +3605,67 @@ var compileOnlyCommand = {
3421
3605
  });
3422
3606
  }
3423
3607
  };
3424
- var recompileCommand = {
3608
+
3609
+ // src/xy/build/copyAssetsCommand.ts
3610
+ var copyAssetsCommand = {
3611
+ command: "copy-assets [package]",
3612
+ describe: "Copy Assets - Copy the assets from src to dist",
3425
3613
  builder: (yargs2) => {
3426
- return packagePositionalParam(yargs2);
3614
+ return yargs2.positional("package", { describe: "Specific package to copy assets" });
3427
3615
  },
3428
- command: "recompile [package]",
3429
- describe: "Re-compile with Typescript & Copy Images",
3430
3616
  handler: async (argv) => {
3431
- if (argv.verbose) {
3432
- console.log(`Re-compiling: ${argv.package ?? "all"}`);
3433
- }
3434
- process.exitCode = await recompile({
3435
- incremental: !!argv.incremental,
3436
- jobs: argv.jobs,
3437
- pkg: argv.package,
3438
- target: argv.target,
3439
- verbose: !!argv.verbose
3440
- });
3617
+ if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? "all"}`);
3618
+ process.exitCode = await copyAssets({ target: argv.target });
3441
3619
  }
3442
3620
  };
3621
+
3622
+ // src/xy/build/rebuildCommand.ts
3443
3623
  var rebuildCommand = {
3444
- builder: (yargs2) => {
3445
- return packagePositionalParam(yargs2);
3446
- },
3447
3624
  command: "rebuild [package]",
3448
3625
  describe: "Rebuild - Clean, Compile & Lint",
3626
+ builder: (yargs2) => {
3627
+ return yargs2.positional("package", { describe: "Specific package to rebuild" });
3628
+ },
3449
3629
  handler: (argv) => {
3450
3630
  if (argv.verbose) console.log(`Rebuilding: ${argv.package ?? "all"}`);
3451
3631
  process.exitCode = rebuild({ target: argv.target });
3452
3632
  }
3453
3633
  };
3454
- var copyAssetsCommand = {
3634
+
3635
+ // src/xy/build/recompileCommand.ts
3636
+ var recompileCommand = {
3637
+ command: "recompile [package]",
3638
+ describe: "Re-compile with Typescript & Copy Images",
3455
3639
  builder: (yargs2) => {
3456
- return packagePositionalParam(yargs2);
3640
+ return yargs2.positional("package", { describe: "Specific package to re-compile" });
3457
3641
  },
3458
- command: "copy-assets [package]",
3459
- describe: "Copy Assets - Copy the assets from src to dist",
3460
3642
  handler: async (argv) => {
3461
- if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? "all"}`);
3462
- process.exitCode = await copyAssets({ target: argv.target });
3643
+ if (argv.verbose) {
3644
+ console.log(`Re-compiling: ${argv.package ?? "all"}`);
3645
+ }
3646
+ process.exitCode = await recompile({
3647
+ incremental: !!argv.incremental,
3648
+ jobs: argv.jobs,
3649
+ pkg: argv.package,
3650
+ target: argv.target,
3651
+ verbose: !!argv.verbose
3652
+ });
3463
3653
  }
3464
3654
  };
3465
3655
 
3466
- // src/xy/build-commands/index.ts
3656
+ // src/xy/build/index.ts
3467
3657
  var xyBuildCommands = (args) => {
3468
- return args.command(buildCommand).command(compileCommand).command(compileOnlyCommand).command(rebuildCommand).command(recompileCommand).command(copyAssetsCommand);
3658
+ return args.command(buildCommand).command(compileCommand).command(compileOnlyCommand).command(recompileCommand).command(rebuildCommand).command(copyAssetsCommand);
3659
+ };
3660
+
3661
+ // src/xy/common/claude/cleanCommand.ts
3662
+ var cleanCommand = {
3663
+ command: "clean",
3664
+ describe: "Remove all Claude configuration files from the repo",
3665
+ handler: (argv) => {
3666
+ if (argv.verbose) console.log("Claude Clean");
3667
+ process.exitCode = claudeClean();
3668
+ }
3469
3669
  };
3470
3670
 
3471
3671
  // src/xy/common/claude/commandsCommand.ts
@@ -3498,14 +3698,6 @@ var initCommand = {
3498
3698
  process.exitCode = commandsResult || rulesResult || settingsResult;
3499
3699
  }
3500
3700
  };
3501
- var initClaudeSkillsCommand = {
3502
- command: "init:skills",
3503
- describe: "Initialize Claude skills configuration",
3504
- handler: () => {
3505
- const result = claudeSkills();
3506
- process.exitCode = result;
3507
- }
3508
- };
3509
3701
 
3510
3702
  // src/xy/common/claude/rulesCommand.ts
3511
3703
  var rulesCommand = {
@@ -3535,10 +3727,21 @@ var settingsCommand = {
3535
3727
  }
3536
3728
  };
3537
3729
 
3730
+ // src/xy/common/claude/skillsCommand.ts
3731
+ var skillsCommand = {
3732
+ builder: (yargs2) => yargs2,
3733
+ command: "skills",
3734
+ describe: "Sync XY Labs standard Claude skills to .claude/skills/",
3735
+ handler: (argv) => {
3736
+ if (argv.verbose) console.log("Claude Skills");
3737
+ process.exitCode = claudeSkills();
3738
+ }
3739
+ };
3740
+
3538
3741
  // src/xy/common/claude/index.ts
3539
3742
  var claudeCommand = {
3540
3743
  builder: (yargs2) => {
3541
- return yargs2.command(commandsCommand).command(initCommand).command(rulesCommand).command(settingsCommand).command(initClaudeSkillsCommand).demandCommand(1, "Please specify a claude subcommand");
3744
+ return yargs2.command(cleanCommand).command(commandsCommand).command(initCommand).command(rulesCommand).command(settingsCommand).command(skillsCommand).demandCommand(1, "Please specify a claude subcommand");
3542
3745
  },
3543
3746
  command: "claude",
3544
3747
  describe: "Claude - Claude Code configuration utilities",
@@ -3556,6 +3759,11 @@ var cleanDocsCommand = {
3556
3759
  }
3557
3760
  };
3558
3761
 
3762
+ // src/xy/param.ts
3763
+ var packagePositionalParam = (yargs2) => {
3764
+ return yargs2.positional("package", { describe: "Specific package to target", type: "string" });
3765
+ };
3766
+
3559
3767
  // src/xy/common/deadCommand.ts
3560
3768
  var deadCommand = {
3561
3769
  builder: (yargs2) => {
@@ -3582,13 +3790,13 @@ var genDocsCommand = {
3582
3790
  }
3583
3791
  };
3584
3792
 
3585
- // src/xy/common/gitignoreGenCommand.ts
3586
- var gitignoreGenCommand = {
3587
- command: "gitignore-gen",
3588
- describe: "GitIgnore Gen - Generate .gitignore files",
3793
+ // src/xy/common/gitignoreCommand.ts
3794
+ var gitignoreCommand = {
3795
+ command: "gitignore",
3796
+ describe: "GitIgnore - Generate root .gitignore and remove package .gitignore files",
3589
3797
  handler: (argv) => {
3590
- if (argv.verbose) console.log("GitIgnore Gen");
3591
- process.exitCode = gitignoreGen();
3798
+ if (argv.verbose) console.log("GitIgnore");
3799
+ process.exitCode = gitignore();
3592
3800
  }
3593
3801
  };
3594
3802
 
@@ -3735,7 +3943,7 @@ var yarn3OnlyCommand = {
3735
3943
 
3736
3944
  // src/xy/common/index.ts
3737
3945
  var xyCommonCommands = (args) => {
3738
- 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);
3946
+ return args.command(claudeCommand).command(licenseCommand).command(deadCommand).command(genDocsCommand).command(cleanDocsCommand).command(gitlintCommand).command(gitignoreCommand).command(npmignoreGenCommand).command(readmeCommand).command(retestCommand).command(testCommand).command(upplugCommand).command(upyarnCommand).command(yarn3OnlyCommand);
3739
3947
  };
3740
3948
 
3741
3949
  // src/xy/deploy/deployCommand.ts
@@ -3794,7 +4002,7 @@ var xyDeployCommands = (args) => {
3794
4002
  };
3795
4003
 
3796
4004
  // src/xy/install/cleanCommand.ts
3797
- var cleanCommand = {
4005
+ var cleanCommand2 = {
3798
4006
  command: "clean [package]",
3799
4007
  describe: "Clean",
3800
4008
  builder: (yargs2) => {
@@ -3863,11 +4071,11 @@ var updoCommand = {
3863
4071
 
3864
4072
  // src/xy/install/index.ts
3865
4073
  var xyInstallCommands = (args) => {
3866
- return args.command(cleanCommand).command(reinstallCommand).command(upCommand).command(updoCommand).command(staticsCommand).command(dupdepsCommand);
4074
+ return args.command(cleanCommand2).command(reinstallCommand).command(upCommand).command(updoCommand).command(staticsCommand).command(dupdepsCommand);
3867
4075
  };
3868
4076
 
3869
4077
  // src/xy/lint/cycleCommand.ts
3870
- import chalk43 from "chalk";
4078
+ import chalk45 from "chalk";
3871
4079
  var cycleCommand = {
3872
4080
  command: "cycle [package]",
3873
4081
  describe: "Cycle - Check for dependency cycles",
@@ -3878,12 +4086,12 @@ var cycleCommand = {
3878
4086
  const start = Date.now();
3879
4087
  if (argv.verbose) console.log("Cycle");
3880
4088
  process.exitCode = await cycle({ pkg: argv.package });
3881
- console.log(chalk43.blue(`Finished in ${Date.now() - start}ms`));
4089
+ console.log(chalk45.blue(`Finished in ${Date.now() - start}ms`));
3882
4090
  }
3883
4091
  };
3884
4092
 
3885
4093
  // src/xy/lint/deplintCommand.ts
3886
- import chalk44 from "chalk";
4094
+ import chalk46 from "chalk";
3887
4095
  var deplintCommand = {
3888
4096
  command: "deplint [package]",
3889
4097
  describe: "Deplint - Run Deplint",
@@ -3921,12 +4129,12 @@ var deplintCommand = {
3921
4129
  peerDeps: !!argv.peerDeps,
3922
4130
  verbose: !!argv.verbose
3923
4131
  });
3924
- console.log(chalk44.blue(`Finished in ${Date.now() - start}ms`));
4132
+ console.log(chalk46.blue(`Finished in ${Date.now() - start}ms`));
3925
4133
  }
3926
4134
  };
3927
4135
 
3928
4136
  // src/xy/lint/fixCommand.ts
3929
- import chalk45 from "chalk";
4137
+ import chalk47 from "chalk";
3930
4138
  var fixCommand = {
3931
4139
  command: "fix [package]",
3932
4140
  describe: "Fix - Run Eslint w/fix",
@@ -3937,12 +4145,12 @@ var fixCommand = {
3937
4145
  const start = Date.now();
3938
4146
  if (argv.verbose) console.log("Fix");
3939
4147
  process.exitCode = fix();
3940
- console.log(chalk45.blue(`Finished in ${Date.now() - start}ms`));
4148
+ console.log(chalk47.blue(`Finished in ${Date.now() - start}ms`));
3941
4149
  }
3942
4150
  };
3943
4151
 
3944
4152
  // src/xy/lint/knipCommand.ts
3945
- import chalk46 from "chalk";
4153
+ import chalk48 from "chalk";
3946
4154
  var knipCommand = {
3947
4155
  command: "knip",
3948
4156
  describe: "Knip - Run Knip",
@@ -3953,12 +4161,12 @@ var knipCommand = {
3953
4161
  if (argv.verbose) console.log("Knip");
3954
4162
  const start = Date.now();
3955
4163
  process.exitCode = knip();
3956
- console.log(chalk46.blue(`Knip finished in ${Date.now() - start}ms`));
4164
+ console.log(chalk48.blue(`Knip finished in ${Date.now() - start}ms`));
3957
4165
  }
3958
4166
  };
3959
4167
 
3960
4168
  // src/xy/lint/lintCommand.ts
3961
- import chalk47 from "chalk";
4169
+ import chalk49 from "chalk";
3962
4170
  var lintCommand = {
3963
4171
  command: "lint [package]",
3964
4172
  describe: "Lint - Run Eslint",
@@ -3987,12 +4195,12 @@ var lintCommand = {
3987
4195
  cache: argv.cache,
3988
4196
  verbose: !!argv.verbose
3989
4197
  });
3990
- console.log(chalk47.blue(`Finished in ${Date.now() - start}ms`));
4198
+ console.log(chalk49.blue(`Finished in ${Date.now() - start}ms`));
3991
4199
  }
3992
4200
  };
3993
4201
 
3994
4202
  // src/xy/lint/publintCommand.ts
3995
- import chalk48 from "chalk";
4203
+ import chalk50 from "chalk";
3996
4204
  var publintCommand = {
3997
4205
  command: "publint [package]",
3998
4206
  describe: "Publint - Run Publint",
@@ -4003,12 +4211,12 @@ var publintCommand = {
4003
4211
  if (argv.verbose) console.log("Publint");
4004
4212
  const start = Date.now();
4005
4213
  process.exitCode = await publint({ pkg: argv.package, verbose: !!argv.verbose });
4006
- console.log(chalk48.blue(`Finished in ${Date.now() - start}ms`));
4214
+ console.log(chalk50.blue(`Finished in ${Date.now() - start}ms`));
4007
4215
  }
4008
4216
  };
4009
4217
 
4010
4218
  // src/xy/lint/relintCommand.ts
4011
- import chalk49 from "chalk";
4219
+ import chalk51 from "chalk";
4012
4220
  var relintCommand = {
4013
4221
  command: "relint [package]",
4014
4222
  describe: "Relint - Clean & Lint",
@@ -4019,12 +4227,12 @@ var relintCommand = {
4019
4227
  if (argv.verbose) console.log("Relinting");
4020
4228
  const start = Date.now();
4021
4229
  process.exitCode = relint();
4022
- console.log(chalk49.blue(`Finished in ${Date.now() - start}ms`));
4230
+ console.log(chalk51.blue(`Finished in ${Date.now() - start}ms`));
4023
4231
  }
4024
4232
  };
4025
4233
 
4026
4234
  // src/xy/lint/sonarCommand.ts
4027
- import chalk50 from "chalk";
4235
+ import chalk52 from "chalk";
4028
4236
  var sonarCommand = {
4029
4237
  command: "sonar",
4030
4238
  describe: "Sonar - Run Sonar Check",
@@ -4035,7 +4243,7 @@ var sonarCommand = {
4035
4243
  const start = Date.now();
4036
4244
  if (argv.verbose) console.log("Sonar Check");
4037
4245
  process.exitCode = sonar();
4038
- console.log(chalk50.blue(`Finished in ${Date.now() - start}ms`));
4246
+ console.log(chalk52.blue(`Finished in ${Date.now() - start}ms`));
4039
4247
  }
4040
4248
  };
4041
4249
 
@@ -4045,7 +4253,7 @@ var xyLintCommands = (args) => {
4045
4253
  };
4046
4254
 
4047
4255
  // src/xy/xy.ts
4048
- import chalk51 from "chalk";
4256
+ import chalk53 from "chalk";
4049
4257
 
4050
4258
  // src/xy/xyParseOptions.ts
4051
4259
  import yargs from "yargs";
@@ -4078,8 +4286,8 @@ var xyParseOptions = () => {
4078
4286
  var xy = async () => {
4079
4287
  const options = xyParseOptions();
4080
4288
  return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
4081
- console.error(chalk51.yellow(`Command not found [${chalk51.magenta(process.argv[2])}]`));
4082
- console.log(chalk51.gray("Try 'yarn xy --help' for list of commands"));
4289
+ console.error(chalk53.yellow(`Command not found [${chalk53.magenta(process.argv[2])}]`));
4290
+ console.log(chalk53.gray("Try 'yarn xy --help' for list of commands"));
4083
4291
  }).version().help().argv;
4084
4292
  };
4085
4293
  export {
@@ -4088,6 +4296,7 @@ export {
4088
4296
  DEFAULT_README_TEMPLATE,
4089
4297
  DuplicateDetector,
4090
4298
  INIT_CWD,
4299
+ LEGACY_COMMANDS_PREFIX,
4091
4300
  WINDOWS_NEWLINE_REGEX,
4092
4301
  XYLABS_COMMANDS_PREFIX,
4093
4302
  XYLABS_RULES_PREFIX,
@@ -4096,8 +4305,10 @@ export {
4096
4305
  build,
4097
4306
  bundleDts,
4098
4307
  checkResult,
4308
+ claudeClean,
4099
4309
  claudeCommandTemplates,
4100
4310
  claudeCommands,
4311
+ claudeMdLocalTemplate,
4101
4312
  claudeMdProjectTemplate,
4102
4313
  claudeMdRuleTemplates,
4103
4314
  claudeRules,
@@ -4134,7 +4345,9 @@ export {
4134
4345
  genDocsPackage,
4135
4346
  generateIgnoreFiles,
4136
4347
  generateReadmeFiles,
4348
+ gitignore,
4137
4349
  gitignoreGen,
4350
+ gitignoreTemplate,
4138
4351
  gitlint,
4139
4352
  gitlintFix,
4140
4353
  isYarnVersionOrGreater,