@xylabs/ts-scripts-yarn3 7.4.9 → 7.4.11

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 (55) hide show
  1. package/dist/actions/claude-commands.mjs +99 -0
  2. package/dist/actions/claude-commands.mjs.map +1 -0
  3. package/dist/actions/claude-rules.mjs.map +1 -1
  4. package/dist/actions/deplint/checkPackage/checkPackage.mjs +115 -16
  5. package/dist/actions/deplint/checkPackage/checkPackage.mjs.map +1 -1
  6. package/dist/actions/deplint/checkPackage/getUnusedDependencies.mjs +2 -1
  7. package/dist/actions/deplint/checkPackage/getUnusedDependencies.mjs.map +1 -1
  8. package/dist/actions/deplint/checkPackage/getUnusedDevDependencies.mjs +114 -20
  9. package/dist/actions/deplint/checkPackage/getUnusedDevDependencies.mjs.map +1 -1
  10. package/dist/actions/deplint/checkPackage/getUnusedPeerDependencies.mjs +2 -1
  11. package/dist/actions/deplint/checkPackage/getUnusedPeerDependencies.mjs.map +1 -1
  12. package/dist/actions/deplint/checkPackage/index.mjs +115 -16
  13. package/dist/actions/deplint/checkPackage/index.mjs.map +1 -1
  14. package/dist/actions/deplint/deplint.mjs +166 -38
  15. package/dist/actions/deplint/deplint.mjs.map +1 -1
  16. package/dist/actions/deplint/getCliReferencedPackagesFromFiles.mjs +140 -0
  17. package/dist/actions/deplint/getCliReferencedPackagesFromFiles.mjs.map +1 -0
  18. package/dist/actions/deplint/getScriptReferencedPackages.mjs +3 -1
  19. package/dist/actions/deplint/getScriptReferencedPackages.mjs.map +1 -1
  20. package/dist/actions/deplint/index.mjs +166 -38
  21. package/dist/actions/deplint/index.mjs.map +1 -1
  22. package/dist/actions/index.mjs +368 -180
  23. package/dist/actions/index.mjs.map +1 -1
  24. package/dist/bin/xy.mjs +356 -134
  25. package/dist/bin/xy.mjs.map +1 -1
  26. package/dist/index.d.ts +27 -2
  27. package/dist/index.mjs +398 -194
  28. package/dist/index.mjs.map +1 -1
  29. package/dist/lib/claudeMdTemplate.mjs +12 -0
  30. package/dist/lib/claudeMdTemplate.mjs.map +1 -1
  31. package/dist/lib/index.mjs +12 -0
  32. package/dist/lib/index.mjs.map +1 -1
  33. package/dist/xy/index.mjs +356 -134
  34. package/dist/xy/index.mjs.map +1 -1
  35. package/dist/xy/xy.mjs +356 -134
  36. package/dist/xy/xy.mjs.map +1 -1
  37. package/dist/xy/xyCommonCommands.mjs +122 -34
  38. package/dist/xy/xyCommonCommands.mjs.map +1 -1
  39. package/dist/xy/xyLintCommands.mjs +205 -71
  40. package/dist/xy/xyLintCommands.mjs.map +1 -1
  41. package/package.json +2 -2
  42. package/templates/commands/xylabs-build.md +5 -0
  43. package/templates/commands/xylabs-clean.md +5 -0
  44. package/templates/commands/xylabs-compile.md +5 -0
  45. package/templates/commands/xylabs-cycle.md +5 -0
  46. package/templates/commands/xylabs-deplint.md +5 -0
  47. package/templates/commands/xylabs-deploy-major.md +7 -0
  48. package/templates/commands/xylabs-deploy-minor.md +7 -0
  49. package/templates/commands/xylabs-deploy.md +7 -0
  50. package/templates/commands/xylabs-fix.md +5 -0
  51. package/templates/commands/xylabs-knip.md +5 -0
  52. package/templates/commands/xylabs-lint.md +5 -0
  53. package/templates/commands/xylabs-publint.md +5 -0
  54. package/templates/commands/xylabs-rebuild.md +5 -0
  55. package/templates/commands/xylabs-test.md +5 -0
package/dist/index.mjs CHANGED
@@ -22,6 +22,7 @@ var require2 = createRequire(import.meta.url);
22
22
  var packageRoot = PATH.dirname(require2.resolve("@xylabs/ts-scripts-yarn3/package.json"));
23
23
  var templatesDir = PATH.resolve(packageRoot, "templates");
24
24
  var XYLABS_RULES_PREFIX = "xylabs-";
25
+ var XYLABS_COMMANDS_PREFIX = "xylabs-";
25
26
  var claudeMdRuleTemplates = () => {
26
27
  const rulesDir = PATH.resolve(templatesDir, "rules");
27
28
  const files = readdirSync(rulesDir).filter((f) => f.startsWith(XYLABS_RULES_PREFIX) && f.endsWith(".md"));
@@ -31,6 +32,15 @@ var claudeMdRuleTemplates = () => {
31
32
  }
32
33
  return result;
33
34
  };
35
+ var claudeCommandTemplates = () => {
36
+ const commandsDir = PATH.resolve(templatesDir, "commands");
37
+ const files = readdirSync(commandsDir).filter((f) => f.startsWith(XYLABS_COMMANDS_PREFIX) && f.endsWith(".md"));
38
+ const result = {};
39
+ for (const file of files) {
40
+ result[file] = readFileSync(PATH.resolve(commandsDir, file), "utf8");
41
+ }
42
+ return result;
43
+ };
34
44
  var claudeMdProjectTemplate = () => readFileSync(PATH.resolve(templatesDir, "CLAUDE-project.md"), "utf8");
35
45
 
36
46
  // src/lib/createBuildConfig.ts
@@ -392,8 +402,8 @@ var loadConfig = async (params) => {
392
402
 
393
403
  // src/lib/parsedPackageJSON.ts
394
404
  import { readFileSync as readFileSync5 } from "fs";
395
- var parsedPackageJSON = (path13) => {
396
- const pathToPackageJSON = path13 ?? process.env.npm_package_json ?? "";
405
+ var parsedPackageJSON = (path14) => {
406
+ const pathToPackageJSON = path14 ?? process.env.npm_package_json ?? "";
397
407
  const packageJSON = readFileSync5(pathToPackageJSON).toString();
398
408
  return JSON.parse(packageJSON);
399
409
  };
@@ -522,7 +532,7 @@ var build = async ({
522
532
  return result;
523
533
  };
524
534
 
525
- // src/actions/claude-rules.ts
535
+ // src/actions/claude-commands.ts
526
536
  import {
527
537
  existsSync as existsSync5,
528
538
  mkdirSync,
@@ -533,13 +543,13 @@ import {
533
543
  } from "fs";
534
544
  import PATH2 from "path";
535
545
  import chalk10 from "chalk";
536
- var syncRuleFiles = (rulesDir) => {
537
- const templates = claudeMdRuleTemplates();
546
+ var syncCommandFiles = (commandsDir) => {
547
+ const templates = claudeCommandTemplates();
538
548
  const templateNames = new Set(Object.keys(templates));
539
549
  let updated = 0;
540
550
  let created = 0;
541
551
  for (const [filename3, content] of Object.entries(templates)) {
542
- const targetPath = PATH2.resolve(rulesDir, filename3);
552
+ const targetPath = PATH2.resolve(commandsDir, filename3);
543
553
  const existing = existsSync5(targetPath) ? readFileSync6(targetPath, "utf8") : void 0;
544
554
  if (existing === content) continue;
545
555
  writeFileSync2(targetPath, content, "utf8");
@@ -555,12 +565,82 @@ var syncRuleFiles = (rulesDir) => {
555
565
  updated
556
566
  };
557
567
  };
568
+ var removeStaleCommands = (commandsDir, templateNames) => {
569
+ const existingCommands = readdirSync2(commandsDir).filter((f) => f.startsWith(XYLABS_COMMANDS_PREFIX) && f.endsWith(".md"));
570
+ let removed = 0;
571
+ for (const file of existingCommands) {
572
+ if (!templateNames.has(file)) {
573
+ unlinkSync(PATH2.resolve(commandsDir, file));
574
+ removed++;
575
+ }
576
+ }
577
+ return removed;
578
+ };
579
+ var logCommandsResult = (created, updated, removed) => {
580
+ if (created || updated || removed) {
581
+ const parts = [
582
+ created ? `${created} created` : "",
583
+ updated ? `${updated} updated` : "",
584
+ removed ? `${removed} removed` : ""
585
+ ].filter(Boolean);
586
+ console.log(chalk10.green(`.claude/commands/${XYLABS_COMMANDS_PREFIX}*.md: ${parts.join(", ")}`));
587
+ } else {
588
+ console.log(chalk10.gray(`.claude/commands/${XYLABS_COMMANDS_PREFIX}*.md: already up to date`));
589
+ }
590
+ };
591
+ var claudeCommands = () => {
592
+ const cwd5 = INIT_CWD() ?? process.cwd();
593
+ const commandsDir = PATH2.resolve(cwd5, ".claude", "commands");
594
+ mkdirSync(commandsDir, { recursive: true });
595
+ const {
596
+ created,
597
+ templateNames,
598
+ updated
599
+ } = syncCommandFiles(commandsDir);
600
+ const removed = removeStaleCommands(commandsDir, templateNames);
601
+ logCommandsResult(created, updated, removed);
602
+ return 0;
603
+ };
604
+
605
+ // src/actions/claude-rules.ts
606
+ import {
607
+ existsSync as existsSync6,
608
+ mkdirSync as mkdirSync2,
609
+ readdirSync as readdirSync3,
610
+ readFileSync as readFileSync7,
611
+ unlinkSync as unlinkSync2,
612
+ writeFileSync as writeFileSync3
613
+ } from "fs";
614
+ import PATH3 from "path";
615
+ import chalk11 from "chalk";
616
+ var syncRuleFiles = (rulesDir) => {
617
+ const templates = claudeMdRuleTemplates();
618
+ const templateNames = new Set(Object.keys(templates));
619
+ let updated = 0;
620
+ let created = 0;
621
+ for (const [filename3, content] of Object.entries(templates)) {
622
+ const targetPath = PATH3.resolve(rulesDir, filename3);
623
+ const existing = existsSync6(targetPath) ? readFileSync7(targetPath, "utf8") : void 0;
624
+ if (existing === content) continue;
625
+ writeFileSync3(targetPath, content, "utf8");
626
+ if (existing) {
627
+ updated++;
628
+ } else {
629
+ created++;
630
+ }
631
+ }
632
+ return {
633
+ created,
634
+ templateNames,
635
+ updated
636
+ };
637
+ };
558
638
  var removeStaleRules = (rulesDir, templateNames) => {
559
- const existingRules = readdirSync2(rulesDir).filter((f) => f.startsWith(XYLABS_RULES_PREFIX) && f.endsWith(".md"));
639
+ const existingRules = readdirSync3(rulesDir).filter((f) => f.startsWith(XYLABS_RULES_PREFIX) && f.endsWith(".md"));
560
640
  let removed = 0;
561
641
  for (const file of existingRules) {
562
642
  if (!templateNames.has(file)) {
563
- unlinkSync(PATH2.resolve(rulesDir, file));
643
+ unlinkSync2(PATH3.resolve(rulesDir, file));
564
644
  removed++;
565
645
  }
566
646
  }
@@ -573,27 +653,27 @@ var logRulesResult = (created, updated, removed) => {
573
653
  updated ? `${updated} updated` : "",
574
654
  removed ? `${removed} removed` : ""
575
655
  ].filter(Boolean);
576
- console.log(chalk10.green(`.claude/rules/${XYLABS_RULES_PREFIX}*.md: ${parts.join(", ")}`));
656
+ console.log(chalk11.green(`.claude/rules/${XYLABS_RULES_PREFIX}*.md: ${parts.join(", ")}`));
577
657
  } else {
578
- console.log(chalk10.gray(`.claude/rules/${XYLABS_RULES_PREFIX}*.md: already up to date`));
658
+ console.log(chalk11.gray(`.claude/rules/${XYLABS_RULES_PREFIX}*.md: already up to date`));
579
659
  }
580
660
  };
581
661
  var ensureProjectClaudeMd = (cwd5, force) => {
582
- const projectPath = PATH2.resolve(cwd5, "CLAUDE.md");
583
- if (!existsSync5(projectPath) || force) {
584
- if (force && existsSync5(projectPath)) {
585
- console.log(chalk10.yellow("Overwriting existing CLAUDE.md"));
662
+ const projectPath = PATH3.resolve(cwd5, "CLAUDE.md");
663
+ if (!existsSync6(projectPath) || force) {
664
+ if (force && existsSync6(projectPath)) {
665
+ console.log(chalk11.yellow("Overwriting existing CLAUDE.md"));
586
666
  }
587
- writeFileSync2(projectPath, claudeMdProjectTemplate(), "utf8");
588
- console.log(chalk10.green("Generated CLAUDE.md"));
667
+ writeFileSync3(projectPath, claudeMdProjectTemplate(), "utf8");
668
+ console.log(chalk11.green("Generated CLAUDE.md"));
589
669
  } else {
590
- console.log(chalk10.gray("CLAUDE.md already exists (skipped)"));
670
+ console.log(chalk11.gray("CLAUDE.md already exists (skipped)"));
591
671
  }
592
672
  };
593
673
  var claudeRules = ({ force } = {}) => {
594
674
  const cwd5 = INIT_CWD() ?? process.cwd();
595
- const rulesDir = PATH2.resolve(cwd5, ".claude", "rules");
596
- mkdirSync(rulesDir, { recursive: true });
675
+ const rulesDir = PATH3.resolve(cwd5, ".claude", "rules");
676
+ mkdirSync2(rulesDir, { recursive: true });
597
677
  const {
598
678
  created,
599
679
  templateNames,
@@ -619,16 +699,16 @@ var cleanAll = ({ verbose }) => {
619
699
 
620
700
  // src/actions/clean-docs.ts
621
701
  import path from "path";
622
- import chalk11 from "chalk";
702
+ import chalk12 from "chalk";
623
703
  var cleanDocs = () => {
624
704
  const pkgName = process.env.npm_package_name;
625
- console.log(chalk11.green(`Cleaning Docs [${pkgName}]`));
705
+ console.log(chalk12.green(`Cleaning Docs [${pkgName}]`));
626
706
  for (const { location } of yarnWorkspaces()) deleteGlob(path.join(location, "docs"));
627
707
  return 0;
628
708
  };
629
709
 
630
710
  // src/actions/compile.ts
631
- import chalk12 from "chalk";
711
+ import chalk13 from "chalk";
632
712
  var compile = ({
633
713
  verbose,
634
714
  target,
@@ -669,7 +749,7 @@ var compileAll = ({
669
749
  const incrementalOptions = incremental ? ["--since", "-Ap", "--topological-dev"] : ["--parallel", "-Ap", "--topological-dev"];
670
750
  const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
671
751
  if (jobs) {
672
- console.log(chalk12.blue(`Jobs set to [${jobs}]`));
752
+ console.log(chalk13.blue(`Jobs set to [${jobs}]`));
673
753
  }
674
754
  const result = runSteps(`Compile${incremental ? "-Incremental" : ""} [All]`, [
675
755
  ["yarn", [
@@ -683,13 +763,13 @@ var compileAll = ({
683
763
  ...targetOptions
684
764
  ]]
685
765
  ]);
686
- console.log(`${chalk12.gray("Compiled in")} [${chalk12.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk12.gray("seconds")}`);
766
+ console.log(`${chalk13.gray("Compiled in")} [${chalk13.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk13.gray("seconds")}`);
687
767
  return result;
688
768
  };
689
769
 
690
770
  // src/actions/copy-assets.ts
691
771
  import path2 from "path/posix";
692
- import chalk13 from "chalk";
772
+ import chalk14 from "chalk";
693
773
  import cpy from "cpy";
694
774
  var copyPackageTargetAssets = async (target, name, location) => {
695
775
  try {
@@ -712,7 +792,7 @@ var copyPackageTargetAssets = async (target, name, location) => {
712
792
  };
713
793
  var copyTargetAssets = async (target, pkg) => {
714
794
  const workspaces = yarnWorkspaces();
715
- console.log(chalk13.green(`Copying Assets [${target.toUpperCase()}]`));
795
+ console.log(chalk14.green(`Copying Assets [${target.toUpperCase()}]`));
716
796
  const workspaceList = workspaces.filter(({ name }) => {
717
797
  return pkg === void 0 || name === pkg;
718
798
  });
@@ -796,7 +876,7 @@ var dead = () => {
796
876
  };
797
877
 
798
878
  // src/actions/deplint/deplint.ts
799
- import chalk19 from "chalk";
879
+ import chalk20 from "chalk";
800
880
 
801
881
  // src/actions/deplint/findFiles.ts
802
882
  import fs2 from "fs";
@@ -972,11 +1052,11 @@ function getExternalImportsFromFiles({
972
1052
  const allImportPaths = {};
973
1053
  const distImportPaths = {};
974
1054
  const distTypeImportPaths = {};
975
- for (const path13 of allFiles) getImportsFromFile(path13, allImportPaths, allImportPaths).flat();
1055
+ for (const path14 of allFiles) getImportsFromFile(path14, allImportPaths, allImportPaths).flat();
976
1056
  const distTypeFiles = distFiles.filter(isDeclarationFile);
977
1057
  const distCodeFiles = distFiles.filter((file) => !isDeclarationFile(file));
978
- for (const path13 of distCodeFiles) getImportsFromFile(path13, distImportPaths, distImportPaths).flat();
979
- for (const path13 of distTypeFiles) getImportsFromFile(path13, distTypeImportPaths, distTypeImportPaths).flat();
1058
+ for (const path14 of distCodeFiles) getImportsFromFile(path14, distImportPaths, distImportPaths).flat();
1059
+ for (const path14 of distTypeFiles) getImportsFromFile(path14, distTypeImportPaths, distTypeImportPaths).flat();
980
1060
  const allImports = Object.keys(allImportPaths);
981
1061
  const distImports = Object.keys(distImportPaths);
982
1062
  const externalAllImports = removeInternalImports(allImports);
@@ -998,12 +1078,12 @@ function getExternalImportsFromFiles({
998
1078
 
999
1079
  // src/actions/deplint/checkPackage/getUnlistedDependencies.ts
1000
1080
  import { builtinModules } from "module";
1001
- import chalk14 from "chalk";
1081
+ import chalk15 from "chalk";
1002
1082
  function isListedOrBuiltin(imp, name, dependencies, peerDependencies) {
1003
1083
  return dependencies.includes(imp) || imp === name || dependencies.includes(`@types/${imp}`) || peerDependencies.includes(imp) || peerDependencies.includes(`@types/${imp}`) || builtinModules.includes(imp) || builtinModules.includes(`@types/${imp}`);
1004
1084
  }
1005
1085
  function logMissing(name, imp, importPaths) {
1006
- console.log(`[${chalk14.blue(name)}] Missing dependency in package.json: ${chalk14.red(imp)}`);
1086
+ console.log(`[${chalk15.blue(name)}] Missing dependency in package.json: ${chalk15.red(imp)}`);
1007
1087
  if (importPaths[imp]) {
1008
1088
  console.log(` ${importPaths[imp].join("\n ")}`);
1009
1089
  }
@@ -1028,7 +1108,7 @@ function getUnlistedDependencies({ name, location }, { dependencies, peerDepende
1028
1108
  }
1029
1109
  if (unlistedDependencies > 0) {
1030
1110
  const packageLocation = `${location}/package.json`;
1031
- console.log(` ${chalk14.yellow(packageLocation)}
1111
+ console.log(` ${chalk15.yellow(packageLocation)}
1032
1112
  `);
1033
1113
  }
1034
1114
  return unlistedDependencies;
@@ -1036,7 +1116,7 @@ function getUnlistedDependencies({ name, location }, { dependencies, peerDepende
1036
1116
 
1037
1117
  // src/actions/deplint/checkPackage/getUnlistedDevDependencies.ts
1038
1118
  import { builtinModules as builtinModules2 } from "module";
1039
- import chalk15 from "chalk";
1119
+ import chalk16 from "chalk";
1040
1120
  function getUnlistedDevDependencies({ name, location }, {
1041
1121
  devDependencies,
1042
1122
  dependencies,
@@ -1050,7 +1130,7 @@ function getUnlistedDevDependencies({ name, location }, {
1050
1130
  for (const imp of externalAllImports) {
1051
1131
  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)) {
1052
1132
  unlistedDevDependencies++;
1053
- console.log(`[${chalk15.blue(name)}] Missing devDependency in package.json: ${chalk15.red(imp)}`);
1133
+ console.log(`[${chalk16.blue(name)}] Missing devDependency in package.json: ${chalk16.red(imp)}`);
1054
1134
  if (allImportPaths[imp]) {
1055
1135
  console.log(` ${allImportPaths[imp].join("\n ")}`);
1056
1136
  }
@@ -1058,40 +1138,50 @@ function getUnlistedDevDependencies({ name, location }, {
1058
1138
  }
1059
1139
  if (unlistedDevDependencies > 0) {
1060
1140
  const packageLocation = `${location}/package.json`;
1061
- console.log(` ${chalk15.yellow(packageLocation)}
1141
+ console.log(` ${chalk16.yellow(packageLocation)}
1062
1142
  `);
1063
1143
  }
1064
1144
  return unlistedDevDependencies;
1065
1145
  }
1066
1146
 
1067
1147
  // src/actions/deplint/checkPackage/getUnusedDependencies.ts
1068
- import chalk16 from "chalk";
1148
+ import chalk17 from "chalk";
1069
1149
  function getUnusedDependencies({ name, location }, { dependencies }, {
1070
1150
  externalDistImports,
1071
1151
  externalDistTypeImports,
1072
1152
  externalAllImports
1073
- }) {
1153
+ }, exclude) {
1074
1154
  let unusedDependencies = 0;
1075
1155
  for (const dep of dependencies) {
1156
+ if (exclude?.has(dep)) continue;
1076
1157
  if (!externalDistImports.includes(dep) && !externalDistImports.includes(dep.replace(/^@types\//, "")) && !externalDistTypeImports.includes(dep) && !externalDistTypeImports.includes(dep.replace(/^@types\//, ""))) {
1077
1158
  unusedDependencies++;
1078
1159
  if (externalAllImports.includes(dep)) {
1079
- console.log(`[${chalk16.blue(name)}] dependency should be devDependency in package.json: ${chalk16.red(dep)}`);
1160
+ console.log(`[${chalk17.blue(name)}] dependency should be devDependency in package.json: ${chalk17.red(dep)}`);
1080
1161
  } else {
1081
- console.log(`[${chalk16.blue(name)}] Unused dependency in package.json: ${chalk16.red(dep)}`);
1162
+ console.log(`[${chalk17.blue(name)}] Unused dependency in package.json: ${chalk17.red(dep)}`);
1082
1163
  }
1083
1164
  }
1084
1165
  }
1085
1166
  if (unusedDependencies > 0) {
1086
1167
  const packageLocation = `${location}/package.json`;
1087
- console.log(` ${chalk16.yellow(packageLocation)}
1168
+ console.log(` ${chalk17.yellow(packageLocation)}
1088
1169
  `);
1089
1170
  }
1090
1171
  return unusedDependencies;
1091
1172
  }
1092
1173
 
1093
1174
  // src/actions/deplint/checkPackage/getUnusedDevDependencies.ts
1094
- import chalk17 from "chalk";
1175
+ import chalk18 from "chalk";
1176
+
1177
+ // src/actions/deplint/getCliReferencedPackagesFromFiles.ts
1178
+ import fs8 from "fs";
1179
+ import path7 from "path";
1180
+ import ts2 from "typescript";
1181
+
1182
+ // src/actions/deplint/getScriptReferencedPackages.ts
1183
+ import fs7 from "fs";
1184
+ import path6 from "path";
1095
1185
 
1096
1186
  // src/actions/deplint/getRequiredPeerDependencies.ts
1097
1187
  import fs6 from "fs";
@@ -1126,8 +1216,6 @@ function getRequiredPeerDependencies(location, allDeps) {
1126
1216
  }
1127
1217
 
1128
1218
  // src/actions/deplint/getScriptReferencedPackages.ts
1129
- import fs7 from "fs";
1130
- import path6 from "path";
1131
1219
  function getBinNames(location, dep) {
1132
1220
  const depPkgPath = findDepPackageJson(location, dep);
1133
1221
  if (!depPkgPath) return [];
@@ -1177,15 +1265,101 @@ function getScriptReferencedPackages(location, allDeps) {
1177
1265
  return referenced;
1178
1266
  }
1179
1267
 
1268
+ // src/actions/deplint/getCliReferencedPackagesFromFiles.ts
1269
+ var shellCommandFunctions = /* @__PURE__ */ new Set(["execSync", "exec"]);
1270
+ var directExecFunctions = /* @__PURE__ */ new Set(["spawn", "spawnSync", "execFile", "execFileSync"]);
1271
+ var allExecFunctions = /* @__PURE__ */ new Set([...shellCommandFunctions, ...directExecFunctions]);
1272
+ function getCommandTokensFromFile(filePath) {
1273
+ const tokens = /* @__PURE__ */ new Set();
1274
+ let sourceCode;
1275
+ try {
1276
+ sourceCode = fs8.readFileSync(filePath, "utf8");
1277
+ } catch {
1278
+ return tokens;
1279
+ }
1280
+ const isMjsFile = filePath.endsWith(".mjs");
1281
+ const sourceFile = ts2.createSourceFile(
1282
+ path7.basename(filePath),
1283
+ sourceCode,
1284
+ ts2.ScriptTarget.Latest,
1285
+ true,
1286
+ isMjsFile ? ts2.ScriptKind.JS : void 0
1287
+ );
1288
+ function visit(node) {
1289
+ if (ts2.isCallExpression(node) && node.arguments.length > 0) {
1290
+ const fnName = getFunctionName(node.expression);
1291
+ if (fnName && allExecFunctions.has(fnName)) {
1292
+ const firstArg = node.arguments[0];
1293
+ if (ts2.isStringLiteral(firstArg) || ts2.isNoSubstitutionTemplateLiteral(firstArg)) {
1294
+ const value = firstArg.text;
1295
+ if (shellCommandFunctions.has(fnName)) {
1296
+ for (const token of tokenizeScript(value)) {
1297
+ tokens.add(token);
1298
+ }
1299
+ } else {
1300
+ tokens.add(value);
1301
+ }
1302
+ } else if (ts2.isTemplateExpression(firstArg)) {
1303
+ const head = firstArg.head.text;
1304
+ if (head) {
1305
+ for (const token of tokenizeScript(head)) {
1306
+ tokens.add(token);
1307
+ }
1308
+ }
1309
+ }
1310
+ }
1311
+ }
1312
+ ts2.forEachChild(node, visit);
1313
+ }
1314
+ visit(sourceFile);
1315
+ return tokens;
1316
+ }
1317
+ function getFunctionName(expr) {
1318
+ if (ts2.isIdentifier(expr)) {
1319
+ return expr.text;
1320
+ }
1321
+ if (ts2.isPropertyAccessExpression(expr) && ts2.isIdentifier(expr.name)) {
1322
+ return expr.name.text;
1323
+ }
1324
+ return void 0;
1325
+ }
1326
+ function getCliReferencedPackagesFromFiles(allFiles, location, allDeps) {
1327
+ const allTokens = /* @__PURE__ */ new Set();
1328
+ for (const file of allFiles) {
1329
+ for (const token of getCommandTokensFromFile(file)) {
1330
+ allTokens.add(token);
1331
+ }
1332
+ }
1333
+ if (allTokens.size === 0) return /* @__PURE__ */ new Set();
1334
+ const binToPackage = /* @__PURE__ */ new Map();
1335
+ for (const dep of allDeps) {
1336
+ for (const bin of getBinNames(location, dep)) {
1337
+ binToPackage.set(bin, dep);
1338
+ }
1339
+ }
1340
+ const referenced = /* @__PURE__ */ new Set();
1341
+ for (const token of allTokens) {
1342
+ const baseName = getBasePackageName(token);
1343
+ if (allDeps.includes(baseName)) {
1344
+ referenced.add(baseName);
1345
+ }
1346
+ const pkg = binToPackage.get(token);
1347
+ if (pkg) {
1348
+ referenced.add(pkg);
1349
+ }
1350
+ }
1351
+ return referenced;
1352
+ }
1353
+
1180
1354
  // src/actions/deplint/implicitDevDependencies.ts
1181
- import fs8 from "fs";
1355
+ import fs9 from "fs";
1182
1356
  var hasFileWithExtension = (files, extensions) => files.some((f) => extensions.some((ext) => f.endsWith(ext)));
1183
1357
  var tsExtensions = [".ts", ".tsx", ".mts", ".cts"];
1184
1358
  var hasTypescriptFiles = ({ allFiles }) => hasFileWithExtension(allFiles, tsExtensions);
1185
1359
  var decoratorPattern = /^\s*@[a-zA-Z]\w*/m;
1186
1360
  var hasDecorators = ({ allFiles }) => allFiles.filter((f) => tsExtensions.some((ext) => f.endsWith(ext))).some((file) => {
1187
1361
  try {
1188
- const content = fs8.readFileSync(file, "utf8");
1362
+ const content = fs9.readFileSync(file, "utf8");
1189
1363
  return decoratorPattern.test(content);
1190
1364
  } catch {
1191
1365
  return false;
@@ -1198,7 +1372,7 @@ function hasImportPlugin({ location, allDependencies }) {
1198
1372
  const pkgPath = findDepPackageJson(location, dep);
1199
1373
  if (!pkgPath) continue;
1200
1374
  try {
1201
- const pkg = JSON.parse(fs8.readFileSync(pkgPath, "utf8"));
1375
+ const pkg = JSON.parse(fs9.readFileSync(pkgPath, "utf8"));
1202
1376
  const transitiveDeps = [
1203
1377
  ...Object.keys(pkg.dependencies ?? {}),
1204
1378
  ...Object.keys(pkg.peerDependencies ?? {})
@@ -1250,10 +1424,11 @@ var allExternalImports = ({
1250
1424
  ...externalDistTypeImports
1251
1425
  ]);
1252
1426
  };
1253
- function isDevDepUsed(dep, allImports, implicitDeps, requiredPeers, scriptRefs) {
1427
+ function isDevDepUsed(dep, allImports, implicitDeps, requiredPeers, scriptRefs, cliRefs) {
1254
1428
  if (implicitDeps.has(dep)) return true;
1255
1429
  if (requiredPeers.has(dep)) return true;
1256
1430
  if (scriptRefs.has(dep)) return true;
1431
+ if (cliRefs.has(dep)) return true;
1257
1432
  if (dep.startsWith("@types/")) {
1258
1433
  const baseName = dep.replace(/^@types\//, "");
1259
1434
  return allImports.has(baseName) || allImports.has(dep) || implicitDeps.has(baseName);
@@ -1264,7 +1439,7 @@ function getUnusedDevDependencies({ name, location }, {
1264
1439
  devDependencies,
1265
1440
  dependencies,
1266
1441
  peerDependencies
1267
- }, sourceParams, fileContext) {
1442
+ }, sourceParams, fileContext, exclude) {
1268
1443
  const allImports = allExternalImports(sourceParams);
1269
1444
  const allDeps = [...dependencies, ...devDependencies, ...peerDependencies];
1270
1445
  const implicitDeps = getImplicitDevDependencies({
@@ -1274,39 +1449,42 @@ function getUnusedDevDependencies({ name, location }, {
1274
1449
  });
1275
1450
  const requiredPeers = getRequiredPeerDependencies(location, allDeps);
1276
1451
  const scriptRefs = getScriptReferencedPackages(location, allDeps);
1452
+ const cliRefs = getCliReferencedPackagesFromFiles(fileContext.allFiles, location, allDeps);
1277
1453
  let unusedDevDependencies = 0;
1278
1454
  for (const dep of devDependencies) {
1455
+ if (exclude?.has(dep)) continue;
1279
1456
  if (dependencies.includes(dep) || peerDependencies.includes(dep)) continue;
1280
- if (!isDevDepUsed(dep, allImports, implicitDeps, requiredPeers, scriptRefs)) {
1457
+ if (!isDevDepUsed(dep, allImports, implicitDeps, requiredPeers, scriptRefs, cliRefs)) {
1281
1458
  unusedDevDependencies++;
1282
- console.log(`[${chalk17.blue(name)}] Unused devDependency in package.json: ${chalk17.red(dep)}`);
1459
+ console.log(`[${chalk18.blue(name)}] Unused devDependency in package.json: ${chalk18.red(dep)}`);
1283
1460
  }
1284
1461
  }
1285
1462
  if (unusedDevDependencies > 0) {
1286
1463
  const packageLocation = `${location}/package.json`;
1287
- console.log(` ${chalk17.yellow(packageLocation)}
1464
+ console.log(` ${chalk18.yellow(packageLocation)}
1288
1465
  `);
1289
1466
  }
1290
1467
  return unusedDevDependencies;
1291
1468
  }
1292
1469
 
1293
1470
  // src/actions/deplint/checkPackage/getUnusedPeerDependencies.ts
1294
- import chalk18 from "chalk";
1295
- function getUnusedPeerDependencies({ name, location }, { peerDependencies, dependencies }, { externalDistImports, externalDistTypeImports }) {
1471
+ import chalk19 from "chalk";
1472
+ function getUnusedPeerDependencies({ name, location }, { peerDependencies, dependencies }, { externalDistImports, externalDistTypeImports }, exclude) {
1296
1473
  let unusedDependencies = 0;
1297
1474
  for (const dep of peerDependencies) {
1475
+ if (exclude?.has(dep)) continue;
1298
1476
  if (!externalDistImports.includes(dep) && !externalDistImports.includes(dep.replace(/^@types\//, "")) && !externalDistTypeImports.includes(dep) && !externalDistTypeImports.includes(dep.replace(/^@types\//, ""))) {
1299
1477
  unusedDependencies++;
1300
1478
  if (dependencies.includes(dep)) {
1301
- console.log(`[${chalk18.blue(name)}] Unused peerDependency [already a dependency] in package.json: ${chalk18.red(dep)}`);
1479
+ console.log(`[${chalk19.blue(name)}] Unused peerDependency [already a dependency] in package.json: ${chalk19.red(dep)}`);
1302
1480
  } else {
1303
- console.log(`[${chalk18.blue(name)}] Unused peerDependency in package.json: ${chalk18.red(dep)}`);
1481
+ console.log(`[${chalk19.blue(name)}] Unused peerDependency in package.json: ${chalk19.red(dep)}`);
1304
1482
  }
1305
1483
  }
1306
1484
  }
1307
1485
  if (unusedDependencies > 0) {
1308
1486
  const packageLocation = `${location}/package.json`;
1309
- console.log(` ${chalk18.yellow(packageLocation)}
1487
+ console.log(` ${chalk19.yellow(packageLocation)}
1310
1488
  `);
1311
1489
  }
1312
1490
  return unusedDependencies;
@@ -1331,6 +1509,7 @@ function checkPackage({
1331
1509
  location,
1332
1510
  deps = false,
1333
1511
  devDeps = false,
1512
+ exclude,
1334
1513
  peerDeps = false,
1335
1514
  verbose = false
1336
1515
  }) {
@@ -1349,23 +1528,29 @@ function checkPackage({
1349
1528
  });
1350
1529
  const packageParams = getDependenciesFromPackageJson(`${location}/package.json`);
1351
1530
  const unlistedDependencies = checkDeps ? getUnlistedDependencies({ name, location }, packageParams, sourceParams) : 0;
1352
- const unusedDependencies = checkDeps ? getUnusedDependencies({ name, location }, packageParams, sourceParams) : 0;
1531
+ const unusedDependencies = checkDeps ? getUnusedDependencies({ name, location }, packageParams, sourceParams, exclude) : 0;
1353
1532
  const unlistedDevDependencies = checkDevDeps ? getUnlistedDevDependencies({ name, location }, packageParams, sourceParams) : 0;
1354
1533
  const fileContext = { allFiles, distFiles };
1355
- const unusedDevDependencies = checkDevDeps ? getUnusedDevDependencies({ name, location }, packageParams, sourceParams, fileContext) : 0;
1356
- const unusedPeerDependencies = checkPeerDeps ? getUnusedPeerDependencies({ name, location }, packageParams, sourceParams) : 0;
1534
+ const unusedDevDependencies = checkDevDeps ? getUnusedDevDependencies({ name, location }, packageParams, sourceParams, fileContext, exclude) : 0;
1535
+ const unusedPeerDependencies = checkPeerDeps ? getUnusedPeerDependencies({ name, location }, packageParams, sourceParams, exclude) : 0;
1357
1536
  const totalErrors = unlistedDependencies + unlistedDevDependencies + unusedDependencies + unusedDevDependencies + unusedPeerDependencies;
1358
1537
  return totalErrors;
1359
1538
  }
1360
1539
 
1361
1540
  // src/actions/deplint/deplint.ts
1362
- var deplint = ({
1541
+ var deplint = async ({
1363
1542
  pkg,
1364
1543
  deps,
1365
1544
  devDeps,
1366
1545
  peerDeps,
1367
- verbose
1546
+ verbose,
1547
+ cliExclude
1368
1548
  }) => {
1549
+ const config2 = await loadConfig();
1550
+ const exclude = /* @__PURE__ */ new Set([
1551
+ ...config2.deplint?.exclude ?? [],
1552
+ ...cliExclude ?? []
1553
+ ]);
1369
1554
  let totalErrors = 0;
1370
1555
  if (pkg === void 0) {
1371
1556
  const workspaces = yarnWorkspaces();
@@ -1375,6 +1560,7 @@ var deplint = ({
1375
1560
  ...workspace,
1376
1561
  deps,
1377
1562
  devDeps,
1563
+ exclude,
1378
1564
  peerDeps,
1379
1565
  verbose
1380
1566
  });
@@ -1387,24 +1573,25 @@ var deplint = ({
1387
1573
  location,
1388
1574
  devDeps,
1389
1575
  deps,
1576
+ exclude,
1390
1577
  peerDeps,
1391
1578
  verbose
1392
1579
  });
1393
1580
  }
1394
1581
  if (totalErrors > 0) {
1395
- console.warn(`Deplint: Found ${chalk19.red(totalErrors)} dependency problems. ${chalk19.red("\u2716")}`);
1582
+ console.warn(`Deplint: Found ${chalk20.red(totalErrors)} dependency problems. ${chalk20.red("\u2716")}`);
1396
1583
  } else {
1397
- console.info(`Deplint: Found no dependency problems. ${chalk19.green("\u2714")}`);
1584
+ console.info(`Deplint: Found no dependency problems. ${chalk20.green("\u2714")}`);
1398
1585
  }
1399
1586
  return 0;
1400
1587
  };
1401
1588
 
1402
1589
  // src/actions/deploy.ts
1403
- import { readFileSync as readFileSync7 } from "fs";
1590
+ import { readFileSync as readFileSync8 } from "fs";
1404
1591
  var privatePackageExcludeList = () => {
1405
1592
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1406
1593
  workspace,
1407
- JSON.parse(readFileSync7(`${workspace.location}/package.json`, { encoding: "utf8" }))
1594
+ JSON.parse(readFileSync8(`${workspace.location}/package.json`, { encoding: "utf8" }))
1408
1595
  ]);
1409
1596
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1410
1597
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -1424,11 +1611,11 @@ var deploy = () => {
1424
1611
  };
1425
1612
 
1426
1613
  // src/actions/deploy-major.ts
1427
- import { readFileSync as readFileSync8 } from "fs";
1614
+ import { readFileSync as readFileSync9 } from "fs";
1428
1615
  var privatePackageExcludeList2 = () => {
1429
1616
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1430
1617
  workspace,
1431
- JSON.parse(readFileSync8(`${workspace.location}/package.json`, { encoding: "utf8" }))
1618
+ JSON.parse(readFileSync9(`${workspace.location}/package.json`, { encoding: "utf8" }))
1432
1619
  ]);
1433
1620
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1434
1621
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -1448,11 +1635,11 @@ var deployMajor = () => {
1448
1635
  };
1449
1636
 
1450
1637
  // src/actions/deploy-minor.ts
1451
- import { readFileSync as readFileSync9 } from "fs";
1638
+ import { readFileSync as readFileSync10 } from "fs";
1452
1639
  var privatePackageExcludeList3 = () => {
1453
1640
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1454
1641
  workspace,
1455
- JSON.parse(readFileSync9(`${workspace.location}/package.json`, { encoding: "utf8" }))
1642
+ JSON.parse(readFileSync10(`${workspace.location}/package.json`, { encoding: "utf8" }))
1456
1643
  ]);
1457
1644
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1458
1645
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -1472,11 +1659,11 @@ var deployMinor = () => {
1472
1659
  };
1473
1660
 
1474
1661
  // src/actions/deploy-next.ts
1475
- import { readFileSync as readFileSync10 } from "fs";
1662
+ import { readFileSync as readFileSync11 } from "fs";
1476
1663
  var privatePackageExcludeList4 = () => {
1477
1664
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1478
1665
  workspace,
1479
- JSON.parse(readFileSync10(`${workspace.location}/package.json`, { encoding: "utf8" }))
1666
+ JSON.parse(readFileSync11(`${workspace.location}/package.json`, { encoding: "utf8" }))
1480
1667
  ]);
1481
1668
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1482
1669
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -1496,22 +1683,22 @@ var deployNext = () => {
1496
1683
  };
1497
1684
 
1498
1685
  // src/actions/dupdeps.ts
1499
- import chalk20 from "chalk";
1686
+ import chalk21 from "chalk";
1500
1687
  var dupdeps = () => {
1501
- console.log(chalk20.green("Checking all Dependencies for Duplicates"));
1688
+ console.log(chalk21.green("Checking all Dependencies for Duplicates"));
1502
1689
  const allDependencies = parsedPackageJSON()?.dependencies;
1503
1690
  const dependencies = Object.entries(allDependencies).map(([k]) => k);
1504
1691
  return detectDuplicateDependencies(dependencies);
1505
1692
  };
1506
1693
 
1507
1694
  // src/actions/lint.ts
1508
- import chalk21 from "chalk";
1695
+ import chalk22 from "chalk";
1509
1696
  var lintPackage = ({
1510
1697
  pkg,
1511
1698
  fix: fix2,
1512
1699
  verbose
1513
1700
  }) => {
1514
- console.log(chalk21.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
1701
+ console.log(chalk22.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
1515
1702
  const start = Date.now();
1516
1703
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
1517
1704
  ["yarn", [
@@ -1521,7 +1708,7 @@ var lintPackage = ({
1521
1708
  fix2 ? "package-fix" : verbose ? "package-lint-verbose" : "package-lint"
1522
1709
  ]]
1523
1710
  ]);
1524
- console.log(chalk21.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk21.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk21.gray("seconds")}`));
1711
+ console.log(chalk22.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk22.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk22.gray("seconds")}`));
1525
1712
  return result;
1526
1713
  };
1527
1714
  var lint = ({
@@ -1541,13 +1728,13 @@ var lint = ({
1541
1728
  });
1542
1729
  };
1543
1730
  var lintAllPackages = ({ fix: fix2 = false } = {}) => {
1544
- console.log(chalk21.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
1731
+ console.log(chalk22.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
1545
1732
  const start = Date.now();
1546
1733
  const fixOptions = fix2 ? ["--fix"] : [];
1547
1734
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
1548
1735
  ["yarn", ["eslint", "--cache", "--cache-location", ".eslintcache", "--cache-strategy", "content", ...fixOptions]]
1549
1736
  ]);
1550
- console.log(chalk21.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk21.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk21.gray("seconds")}`));
1737
+ console.log(chalk22.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk22.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk22.gray("seconds")}`));
1551
1738
  return result;
1552
1739
  };
1553
1740
 
@@ -1575,7 +1762,7 @@ var filename = ".gitignore";
1575
1762
  var gitignoreGen = (pkg) => generateIgnoreFiles(filename, pkg);
1576
1763
 
1577
1764
  // src/actions/gitlint.ts
1578
- import chalk22 from "chalk";
1765
+ import chalk23 from "chalk";
1579
1766
  import ParseGitConfig from "parse-git-config";
1580
1767
  var gitlint = () => {
1581
1768
  console.log(`
@@ -1586,7 +1773,7 @@ Gitlint Start [${process.cwd()}]
1586
1773
  const errors = 0;
1587
1774
  const gitConfig = ParseGitConfig.sync();
1588
1775
  const warn = (message) => {
1589
- console.warn(chalk22.yellow(`Warning: ${message}`));
1776
+ console.warn(chalk23.yellow(`Warning: ${message}`));
1590
1777
  warnings++;
1591
1778
  };
1592
1779
  if (gitConfig.core.ignorecase) {
@@ -1606,13 +1793,13 @@ Gitlint Start [${process.cwd()}]
1606
1793
  }
1607
1794
  const resultMessages = [];
1608
1795
  if (valid > 0) {
1609
- resultMessages.push(chalk22.green(`Passed: ${valid}`));
1796
+ resultMessages.push(chalk23.green(`Passed: ${valid}`));
1610
1797
  }
1611
1798
  if (warnings > 0) {
1612
- resultMessages.push(chalk22.yellow(`Warnings: ${warnings}`));
1799
+ resultMessages.push(chalk23.yellow(`Warnings: ${warnings}`));
1613
1800
  }
1614
1801
  if (errors > 0) {
1615
- resultMessages.push(chalk22.red(` Errors: ${errors}`));
1802
+ resultMessages.push(chalk23.red(` Errors: ${errors}`));
1616
1803
  }
1617
1804
  console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
1618
1805
  `);
@@ -1621,7 +1808,7 @@ Gitlint Start [${process.cwd()}]
1621
1808
 
1622
1809
  // src/actions/gitlint-fix.ts
1623
1810
  import { execSync as execSync2 } from "child_process";
1624
- import chalk23 from "chalk";
1811
+ import chalk24 from "chalk";
1625
1812
  import ParseGitConfig2 from "parse-git-config";
1626
1813
  var gitlintFix = () => {
1627
1814
  console.log(`
@@ -1630,15 +1817,15 @@ Gitlint Fix Start [${process.cwd()}]
1630
1817
  const gitConfig = ParseGitConfig2.sync();
1631
1818
  if (gitConfig.core.ignorecase) {
1632
1819
  execSync2("git config core.ignorecase false", { stdio: "inherit" });
1633
- console.warn(chalk23.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
1820
+ console.warn(chalk24.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
1634
1821
  }
1635
1822
  if (gitConfig.core.autocrlf !== false) {
1636
1823
  execSync2("git config core.autocrlf false", { stdio: "inherit" });
1637
- console.warn(chalk23.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
1824
+ console.warn(chalk24.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
1638
1825
  }
1639
1826
  if (gitConfig.core.eol !== "lf") {
1640
1827
  execSync2("git config core.eol lf", { stdio: "inherit" });
1641
- console.warn(chalk23.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
1828
+ console.warn(chalk24.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
1642
1829
  }
1643
1830
  return 1;
1644
1831
  };
@@ -1649,7 +1836,7 @@ var knip = () => {
1649
1836
  };
1650
1837
 
1651
1838
  // src/actions/license.ts
1652
- import chalk24 from "chalk";
1839
+ import chalk25 from "chalk";
1653
1840
  import { init } from "license-checker";
1654
1841
  var license = async (pkg) => {
1655
1842
  const workspaces = yarnWorkspaces();
@@ -1674,18 +1861,18 @@ var license = async (pkg) => {
1674
1861
  "LGPL-3.0-or-later",
1675
1862
  "Python-2.0"
1676
1863
  ]);
1677
- console.log(chalk24.green("License Checker"));
1864
+ console.log(chalk25.green("License Checker"));
1678
1865
  return (await Promise.all(
1679
1866
  workspaceList.map(({ location, name }) => {
1680
1867
  return new Promise((resolve) => {
1681
1868
  init({ production: true, start: location }, (error, packages) => {
1682
1869
  if (error) {
1683
- console.error(chalk24.red(`License Checker [${name}] Error`));
1684
- console.error(chalk24.gray(error));
1870
+ console.error(chalk25.red(`License Checker [${name}] Error`));
1871
+ console.error(chalk25.gray(error));
1685
1872
  console.log("\n");
1686
1873
  resolve(1);
1687
1874
  } else {
1688
- console.log(chalk24.green(`License Checker [${name}]`));
1875
+ console.log(chalk25.green(`License Checker [${name}]`));
1689
1876
  let count = 0;
1690
1877
  for (const [name2, info] of Object.entries(packages)) {
1691
1878
  const licenses = Array.isArray(info.licenses) ? info.licenses : [info.licenses];
@@ -1701,7 +1888,7 @@ var license = async (pkg) => {
1701
1888
  }
1702
1889
  if (!orLicenseFound) {
1703
1890
  count++;
1704
- console.warn(chalk24.yellow(`${name2}: Package License not allowed [${license2}]`));
1891
+ console.warn(chalk25.yellow(`${name2}: Package License not allowed [${license2}]`));
1705
1892
  }
1706
1893
  }
1707
1894
  }
@@ -1720,13 +1907,13 @@ var filename2 = ".npmignore";
1720
1907
  var npmignoreGen = (pkg) => generateIgnoreFiles(filename2, pkg);
1721
1908
 
1722
1909
  // src/actions/package/clean-outputs.ts
1723
- import path7 from "path";
1724
- import chalk25 from "chalk";
1910
+ import path8 from "path";
1911
+ import chalk26 from "chalk";
1725
1912
  var packageCleanOutputs = () => {
1726
1913
  const pkg = process.env.INIT_CWD ?? ".";
1727
1914
  const pkgName = process.env.npm_package_name;
1728
- const folders = [path7.join(pkg, "dist"), path7.join(pkg, "build"), path7.join(pkg, "docs")];
1729
- console.log(chalk25.green(`Cleaning Outputs [${pkgName}]`));
1915
+ const folders = [path8.join(pkg, "dist"), path8.join(pkg, "build"), path8.join(pkg, "docs")];
1916
+ console.log(chalk26.green(`Cleaning Outputs [${pkgName}]`));
1730
1917
  for (let folder of folders) {
1731
1918
  deleteGlob(folder);
1732
1919
  }
@@ -1734,13 +1921,13 @@ var packageCleanOutputs = () => {
1734
1921
  };
1735
1922
 
1736
1923
  // src/actions/package/clean-typescript.ts
1737
- import path8 from "path";
1738
- import chalk26 from "chalk";
1924
+ import path9 from "path";
1925
+ import chalk27 from "chalk";
1739
1926
  var packageCleanTypescript = () => {
1740
1927
  const pkg = process.env.INIT_CWD ?? ".";
1741
1928
  const pkgName = process.env.npm_package_name;
1742
- console.log(chalk26.green(`Cleaning Typescript [${pkgName}]`));
1743
- const files = [path8.join(pkg, "*.tsbuildinfo"), path8.join(pkg, ".tsconfig.*"), path8.join(pkg, ".eslintcache")];
1929
+ console.log(chalk27.green(`Cleaning Typescript [${pkgName}]`));
1930
+ const files = [path9.join(pkg, "*.tsbuildinfo"), path9.join(pkg, ".tsconfig.*"), path9.join(pkg, ".eslintcache")];
1744
1931
  for (let file of files) {
1745
1932
  deleteGlob(file);
1746
1933
  }
@@ -1753,26 +1940,26 @@ var packageClean = async () => {
1753
1940
  };
1754
1941
 
1755
1942
  // src/actions/package/compile/compile.ts
1756
- import chalk31 from "chalk";
1943
+ import chalk32 from "chalk";
1757
1944
 
1758
1945
  // src/actions/package/compile/packageCompileTsup.ts
1759
- import chalk30 from "chalk";
1946
+ import chalk31 from "chalk";
1760
1947
  import { build as build2, defineConfig } from "tsup";
1761
1948
 
1762
1949
  // src/actions/package/compile/inputs.ts
1763
- import chalk27 from "chalk";
1950
+ import chalk28 from "chalk";
1764
1951
  import { glob as glob2 } from "glob";
1765
1952
  var getAllInputs = (srcDir, verbose = false) => {
1766
1953
  return [...glob2.sync(`${srcDir}/**/*.ts`, { posix: true }).map((file) => {
1767
1954
  const result = file.slice(Math.max(0, srcDir.length + 1));
1768
1955
  if (verbose) {
1769
- console.log(chalk27.gray(`getAllInputs: ${JSON.stringify(result, null, 2)}`));
1956
+ console.log(chalk28.gray(`getAllInputs: ${JSON.stringify(result, null, 2)}`));
1770
1957
  }
1771
1958
  return result;
1772
1959
  }), ...glob2.sync(`${srcDir}/**/*.tsx`, { posix: true }).map((file) => {
1773
1960
  const result = file.slice(Math.max(0, srcDir.length + 1));
1774
1961
  if (verbose) {
1775
- console.log(chalk27.gray(`getAllInputs: ${JSON.stringify(result, null, 2)}`));
1962
+ console.log(chalk28.gray(`getAllInputs: ${JSON.stringify(result, null, 2)}`));
1776
1963
  }
1777
1964
  return result;
1778
1965
  })];
@@ -1831,9 +2018,9 @@ function deepMergeObjects(objects) {
1831
2018
 
1832
2019
  // src/actions/package/compile/packageCompileTsc.ts
1833
2020
  import { cwd as cwd2 } from "process";
1834
- import chalk28 from "chalk";
2021
+ import chalk29 from "chalk";
1835
2022
  import { createProgramFromConfig } from "tsc-prog";
1836
- import ts2, {
2023
+ import ts3, {
1837
2024
  DiagnosticCategory,
1838
2025
  formatDiagnosticsWithColorAndContext,
1839
2026
  getPreEmitDiagnostics,
@@ -1853,12 +2040,12 @@ var getCompilerOptions = (options = {}, fileName = "tsconfig.json") => {
1853
2040
  var packageCompileTsc = (platform, entries, srcDir = "src", outDir = "dist", compilerOptionsParam, verbose = false) => {
1854
2041
  const pkg = process.env.INIT_CWD ?? cwd2();
1855
2042
  if (verbose) {
1856
- console.log(chalk28.cyan(`Validating code START: ${entries.length} files to ${outDir} from ${srcDir}`));
2043
+ console.log(chalk29.cyan(`Validating code START: ${entries.length} files to ${outDir} from ${srcDir}`));
1857
2044
  }
1858
- const configFilePath = ts2.findConfigFile(
2045
+ const configFilePath = ts3.findConfigFile(
1859
2046
  "./",
1860
2047
  // search path
1861
- ts2.sys.fileExists,
2048
+ ts3.sys.fileExists,
1862
2049
  "tsconfig.json"
1863
2050
  );
1864
2051
  if (configFilePath === void 0) {
@@ -1876,10 +2063,10 @@ var packageCompileTsc = (platform, entries, srcDir = "src", outDir = "dist", com
1876
2063
  emitDeclarationOnly: true,
1877
2064
  noEmit: false
1878
2065
  };
1879
- console.log(chalk28.cyan(`Validating Files: ${entries.length}`));
2066
+ console.log(chalk29.cyan(`Validating Files: ${entries.length}`));
1880
2067
  if (verbose) {
1881
2068
  for (const entry of entries) {
1882
- console.log(chalk28.grey(`Validating: ${entry}`));
2069
+ console.log(chalk29.grey(`Validating: ${entry}`));
1883
2070
  }
1884
2071
  }
1885
2072
  try {
@@ -1908,29 +2095,29 @@ var packageCompileTsc = (platform, entries, srcDir = "src", outDir = "dist", com
1908
2095
  if (nonEmitPatterns.some((pattern) => fileName.includes(pattern))) {
1909
2096
  return;
1910
2097
  }
1911
- ts2.sys.writeFile(fileName, text, writeByteOrderMark);
2098
+ ts3.sys.writeFile(fileName, text, writeByteOrderMark);
1912
2099
  });
1913
2100
  return diagnostics.reduce((acc, diag) => acc + (diag.category === DiagnosticCategory.Error ? 1 : 0), 0);
1914
2101
  }
1915
2102
  return 0;
1916
2103
  } finally {
1917
2104
  if (verbose) {
1918
- console.log(chalk28.cyan(`Validating code FINISH: ${entries.length} files to ${outDir} from ${srcDir}`));
2105
+ console.log(chalk29.cyan(`Validating code FINISH: ${entries.length} files to ${outDir} from ${srcDir}`));
1919
2106
  }
1920
2107
  }
1921
2108
  };
1922
2109
 
1923
2110
  // src/actions/package/compile/packageCompileTscTypes.ts
1924
- import path9 from "path";
2111
+ import path10 from "path";
1925
2112
  import { cwd as cwd3 } from "process";
1926
- import chalk29 from "chalk";
2113
+ import chalk30 from "chalk";
1927
2114
  import { rollup } from "rollup";
1928
2115
  import dts from "rollup-plugin-dts";
1929
2116
  import nodeExternals from "rollup-plugin-node-externals";
1930
2117
  var ignoredWarningCodes = /* @__PURE__ */ new Set(["EMPTY_BUNDLE", "UNRESOLVED_IMPORT"]);
1931
2118
  async function bundleDts(inputPath, outputPath, platform, options, verbose = false) {
1932
2119
  const pkg = process.env.INIT_CWD ?? cwd3();
1933
- const tsconfigPath = path9.resolve(pkg, "tsconfig.json");
2120
+ const tsconfigPath = path10.resolve(pkg, "tsconfig.json");
1934
2121
  const nodePlugIns = platform === "node" ? [nodeExternals()] : [];
1935
2122
  try {
1936
2123
  const bundle = await rollup({
@@ -1948,8 +2135,8 @@ async function bundleDts(inputPath, outputPath, platform, options, verbose = fal
1948
2135
  if (ignoredWarningCodes.has(warning.code ?? "")) {
1949
2136
  return;
1950
2137
  }
1951
- console.warn(chalk29.yellow(`[${warning.code}] ${warning.message}`));
1952
- console.warn(chalk29.gray(inputPath));
2138
+ console.warn(chalk30.yellow(`[${warning.code}] ${warning.message}`));
2139
+ console.warn(chalk30.gray(inputPath));
1953
2140
  warn(warning);
1954
2141
  }
1955
2142
  });
@@ -1959,8 +2146,8 @@ async function bundleDts(inputPath, outputPath, platform, options, verbose = fal
1959
2146
  });
1960
2147
  } catch (ex) {
1961
2148
  const error = ex;
1962
- console.warn(chalk29.red(error));
1963
- console.warn(chalk29.gray(inputPath));
2149
+ console.warn(chalk30.red(error));
2150
+ console.warn(chalk30.gray(inputPath));
1964
2151
  }
1965
2152
  if (verbose) {
1966
2153
  console.log(`Bundled declarations written to ${outputPath}`);
@@ -1968,7 +2155,7 @@ async function bundleDts(inputPath, outputPath, platform, options, verbose = fal
1968
2155
  }
1969
2156
  var packageCompileTscTypes = async (entries, outDir, platform, srcDir = "build", verbose = false) => {
1970
2157
  if (verbose) {
1971
- console.log(chalk29.cyan(`Compiling Types START [${platform}]: ${entries.length} files to ${outDir} from ${srcDir}`));
2158
+ console.log(chalk30.cyan(`Compiling Types START [${platform}]: ${entries.length} files to ${outDir} from ${srcDir}`));
1972
2159
  console.log(`Entries: ${entries.join(", ")}`);
1973
2160
  }
1974
2161
  const pkg = process.env.INIT_CWD ?? cwd3();
@@ -1992,7 +2179,7 @@ var packageCompileTscTypes = async (entries, outDir, platform, srcDir = "build",
1992
2179
  await bundleDts(`${srcRoot}/${entryTypeName}`, `${outDir}/${entryTypeName}`, platform, { compilerOptions }, verbose);
1993
2180
  }));
1994
2181
  if (verbose) {
1995
- console.log(chalk29.cyan(`Compiling Types FINISH: ${entries.length} files to ${outDir} from ${srcDir}`));
2182
+ console.log(chalk30.cyan(`Compiling Types FINISH: ${entries.length} files to ${outDir} from ${srcDir}`));
1996
2183
  }
1997
2184
  return 0;
1998
2185
  };
@@ -2004,15 +2191,15 @@ var compileFolder = async (srcDir, entries, buildDir, options, bundleTypes = fal
2004
2191
  console.log(`compileFolder [${srcDir}, ${options?.outDir}]`);
2005
2192
  }
2006
2193
  if (entries.length === 0) {
2007
- console.warn(chalk30.yellow(`No entries found in ${srcDir} to compile`));
2194
+ console.warn(chalk31.yellow(`No entries found in ${srcDir} to compile`));
2008
2195
  return 0;
2009
2196
  }
2010
2197
  if (verbose) {
2011
- console.log(chalk30.gray(`buildDir [${buildDir}]`));
2198
+ console.log(chalk31.gray(`buildDir [${buildDir}]`));
2012
2199
  }
2013
2200
  const validationResult = packageCompileTsc(options?.platform ?? "neutral", entries, srcDir, buildDir, void 0, verbose);
2014
2201
  if (validationResult !== 0) {
2015
- console.error(chalk30.red(`Compile:Validation had ${validationResult} errors`));
2202
+ console.error(chalk31.red(`Compile:Validation had ${validationResult} errors`));
2016
2203
  return validationResult;
2017
2204
  }
2018
2205
  const optionsParams = tsupOptions([{
@@ -2037,12 +2224,12 @@ var compileFolder = async (srcDir, entries, buildDir, options, bundleTypes = fal
2037
2224
  })
2038
2225
  )).flat();
2039
2226
  if (verbose) {
2040
- console.log(chalk30.cyan(`TSUP:build:start [${srcDir}]`));
2041
- console.log(chalk30.gray(`TSUP:build:options [${JSON.stringify(optionsList, null, 2)}]`));
2227
+ console.log(chalk31.cyan(`TSUP:build:start [${srcDir}]`));
2228
+ console.log(chalk31.gray(`TSUP:build:options [${JSON.stringify(optionsList, null, 2)}]`));
2042
2229
  }
2043
2230
  await Promise.all(optionsList.map((options2) => build2(options2)));
2044
2231
  if (verbose) {
2045
- console.log(chalk30.cyan(`TSUP:build:stop [${srcDir}]`));
2232
+ console.log(chalk31.cyan(`TSUP:build:stop [${srcDir}]`));
2046
2233
  }
2047
2234
  if (bundleTypes) {
2048
2235
  await packageCompileTscTypes(entries, outDir, options?.platform ?? "neutral", buildDir, verbose);
@@ -2153,14 +2340,14 @@ var packageCompileTsup = async (config2) => {
2153
2340
  // src/actions/package/compile/compile.ts
2154
2341
  var packageCompile = async (inConfig = {}) => {
2155
2342
  const pkg = process.env.INIT_CWD;
2156
- console.log(chalk31.green(`Compiling ${pkg}`));
2343
+ console.log(chalk32.green(`Compiling ${pkg}`));
2157
2344
  const config2 = await loadConfig(inConfig);
2158
2345
  return await packageCompileTsup(config2);
2159
2346
  };
2160
2347
 
2161
2348
  // src/actions/package/copy-assets.ts
2162
- import path10 from "path/posix";
2163
- import chalk32 from "chalk";
2349
+ import path11 from "path/posix";
2350
+ import chalk33 from "chalk";
2164
2351
  import cpy2 from "cpy";
2165
2352
  var copyTargetAssets2 = async (target, name, location) => {
2166
2353
  try {
@@ -2168,12 +2355,12 @@ var copyTargetAssets2 = async (target, name, location) => {
2168
2355
  ["**/*.jpg", "**/*.png", "**/*.gif", "**/*.svg", "**/*.webp", "**/*.sass", "**/*.scss", "**/*.gif", "**/*.css"],
2169
2356
  `../dist/${target}`,
2170
2357
  {
2171
- cwd: path10.join(location, "src"),
2358
+ cwd: path11.join(location, "src"),
2172
2359
  flat: false
2173
2360
  }
2174
2361
  );
2175
2362
  if (values.length > 0) {
2176
- console.log(chalk32.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
2363
+ console.log(chalk33.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
2177
2364
  }
2178
2365
  for (const value of values) {
2179
2366
  console.log(`${value.split("/").pop()} => ./dist/${target}`);
@@ -2238,9 +2425,9 @@ var packageCycle = async () => {
2238
2425
  };
2239
2426
 
2240
2427
  // src/actions/package/gen-docs.ts
2241
- import { existsSync as existsSync6 } from "fs";
2242
- import path11 from "path";
2243
- import chalk33 from "chalk";
2428
+ import { existsSync as existsSync7 } from "fs";
2429
+ import path12 from "path";
2430
+ import chalk34 from "chalk";
2244
2431
  import {
2245
2432
  Application,
2246
2433
  ArgumentsReader,
@@ -2258,7 +2445,7 @@ var ExitCodes = {
2258
2445
  };
2259
2446
  var packageGenDocs = async () => {
2260
2447
  const pkg = process.env.INIT_CWD;
2261
- if (pkg !== void 0 && !existsSync6(path11.join(pkg, "typedoc.json"))) {
2448
+ if (pkg !== void 0 && !existsSync7(path12.join(pkg, "typedoc.json"))) {
2262
2449
  return;
2263
2450
  }
2264
2451
  const app = await Application.bootstrap({
@@ -2344,16 +2531,16 @@ var runTypeDoc = async (app) => {
2344
2531
  return ExitCodes.OutputError;
2345
2532
  }
2346
2533
  }
2347
- console.log(chalk33.green(`${pkgName} - Ok`));
2534
+ console.log(chalk34.green(`${pkgName} - Ok`));
2348
2535
  return ExitCodes.Ok;
2349
2536
  };
2350
2537
 
2351
2538
  // src/actions/package/lint.ts
2352
- import { readdirSync as readdirSync3 } from "fs";
2353
- import path12 from "path";
2539
+ import { readdirSync as readdirSync4 } from "fs";
2540
+ import path13 from "path";
2354
2541
  import { cwd as cwd4 } from "process";
2355
2542
  import { pathToFileURL } from "url";
2356
- import chalk34 from "chalk";
2543
+ import chalk35 from "chalk";
2357
2544
  import { ESLint } from "eslint";
2358
2545
  import { findUp } from "find-up";
2359
2546
  import picomatch from "picomatch";
@@ -2362,14 +2549,14 @@ var dumpMessages = (lintResults) => {
2362
2549
  const severity = ["none", "warning", "error"];
2363
2550
  for (const lintResult of lintResults) {
2364
2551
  if (lintResult.messages.length > 0) {
2365
- console.log(chalk34.gray(`
2552
+ console.log(chalk35.gray(`
2366
2553
  ${lintResult.filePath}`));
2367
2554
  for (const message of lintResult.messages) {
2368
2555
  console.log(
2369
- chalk34.gray(` ${message.line}:${message.column}`),
2370
- chalk34[colors[message.severity]](` ${severity[message.severity]}`),
2371
- chalk34.white(` ${message.message}`),
2372
- chalk34.gray(` ${message.ruleId}`)
2556
+ chalk35.gray(` ${message.line}:${message.column}`),
2557
+ chalk35[colors[message.severity]](` ${severity[message.severity]}`),
2558
+ chalk35.white(` ${message.message}`),
2559
+ chalk35.gray(` ${message.ruleId}`)
2373
2560
  );
2374
2561
  }
2375
2562
  }
@@ -2386,8 +2573,8 @@ function getFiles(dir, ignoreFolders) {
2386
2573
  const currentDirectory = cwd4();
2387
2574
  const subDirectory = dir.split(currentDirectory)[1]?.split("/")[1];
2388
2575
  if (ignoreFolders.includes(subDirectory)) return [];
2389
- return readdirSync3(dir, { withFileTypes: true }).flatMap((dirent) => {
2390
- const res = path12.resolve(dir, dirent.name);
2576
+ return readdirSync4(dir, { withFileTypes: true }).flatMap((dirent) => {
2577
+ const res = path13.resolve(dir, dirent.name);
2391
2578
  const relativePath = subDirectory === void 0 ? dirent.name : `${subDirectory}/${dirent.name}`;
2392
2579
  const ignoreMatchers = ignoreFolders.map((pattern) => picomatch(pattern));
2393
2580
  if (ignoreMatchers.some((isMatch) => isMatch(relativePath))) return [];
@@ -2407,10 +2594,10 @@ var packageLint = async (fix2 = false, verbose = false, cache = true) => {
2407
2594
  cache
2408
2595
  });
2409
2596
  const files = getFiles(cwd4(), ignoreFolders);
2410
- console.log(chalk34.green(`Linting ${pkg} [files = ${files.length}]`));
2597
+ console.log(chalk35.green(`Linting ${pkg} [files = ${files.length}]`));
2411
2598
  if (verbose) {
2412
2599
  for (const file of files) {
2413
- console.log(chalk34.gray(` ${file}`));
2600
+ console.log(chalk35.gray(` ${file}`));
2414
2601
  }
2415
2602
  }
2416
2603
  const lintResults = await engine.lintFiles(files);
@@ -2421,43 +2608,43 @@ var packageLint = async (fix2 = false, verbose = false, cache = true) => {
2421
2608
  const filesCountColor = files.length < 100 ? "green" : files.length < 1e3 ? "yellow" : "red";
2422
2609
  const lintTime = Date.now() - start;
2423
2610
  const lintTimeColor = lintTime < 1e3 ? "green" : lintTime < 3e3 ? "yellow" : "red";
2424
- console.log(chalk34.white(`Linted ${chalk34[filesCountColor](files.length)} files in ${chalk34[lintTimeColor](lintTime)}ms`));
2611
+ console.log(chalk35.white(`Linted ${chalk35[filesCountColor](files.length)} files in ${chalk35[lintTimeColor](lintTime)}ms`));
2425
2612
  return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
2426
2613
  };
2427
2614
 
2428
2615
  // src/actions/package/publint.ts
2429
- import { promises as fs9 } from "fs";
2430
- import chalk35 from "chalk";
2616
+ import { promises as fs10 } from "fs";
2617
+ import chalk36 from "chalk";
2431
2618
  import sortPackageJson from "sort-package-json";
2432
2619
  var customPubLint = (pkg) => {
2433
2620
  let errorCount = 0;
2434
2621
  let warningCount = 0;
2435
2622
  if (pkg.files === void 0) {
2436
- console.warn(chalk35.yellow('Publint [custom]: "files" field is missing'));
2623
+ console.warn(chalk36.yellow('Publint [custom]: "files" field is missing'));
2437
2624
  warningCount++;
2438
2625
  }
2439
2626
  if (pkg.main !== void 0) {
2440
- console.warn(chalk35.yellow('Publint [custom]: "main" field is deprecated, use "exports" instead'));
2627
+ console.warn(chalk36.yellow('Publint [custom]: "main" field is deprecated, use "exports" instead'));
2441
2628
  warningCount++;
2442
2629
  }
2443
2630
  if (pkg.sideEffects !== false) {
2444
- console.warn(chalk35.yellow('Publint [custom]: "sideEffects" field should be set to false'));
2631
+ console.warn(chalk36.yellow('Publint [custom]: "sideEffects" field should be set to false'));
2445
2632
  warningCount++;
2446
2633
  }
2447
2634
  if (pkg.resolutions !== void 0) {
2448
- console.warn(chalk35.yellow('Publint [custom]: "resolutions" in use'));
2449
- console.warn(chalk35.gray(JSON.stringify(pkg.resolutions, null, 2)));
2635
+ console.warn(chalk36.yellow('Publint [custom]: "resolutions" in use'));
2636
+ console.warn(chalk36.gray(JSON.stringify(pkg.resolutions, null, 2)));
2450
2637
  warningCount++;
2451
2638
  }
2452
2639
  return [errorCount, warningCount];
2453
2640
  };
2454
2641
  var packagePublint = async ({ strict = true, verbose = false } = {}) => {
2455
2642
  const pkgDir = process.env.INIT_CWD;
2456
- const sortedPkg = sortPackageJson(await fs9.readFile(`${pkgDir}/package.json`, "utf8"));
2457
- await fs9.writeFile(`${pkgDir}/package.json`, sortedPkg);
2458
- const pkg = JSON.parse(await fs9.readFile(`${pkgDir}/package.json`, "utf8"));
2459
- console.log(chalk35.green(`Publint: ${pkg.name}`));
2460
- console.log(chalk35.gray(pkgDir));
2643
+ const sortedPkg = sortPackageJson(await fs10.readFile(`${pkgDir}/package.json`, "utf8"));
2644
+ await fs10.writeFile(`${pkgDir}/package.json`, sortedPkg);
2645
+ const pkg = JSON.parse(await fs10.readFile(`${pkgDir}/package.json`, "utf8"));
2646
+ console.log(chalk36.green(`Publint: ${pkg.name}`));
2647
+ console.log(chalk36.gray(pkgDir));
2461
2648
  const { publint: publint2 } = await import("publint");
2462
2649
  const { messages } = await publint2({
2463
2650
  level: "suggestion",
@@ -2468,22 +2655,22 @@ var packagePublint = async ({ strict = true, verbose = false } = {}) => {
2468
2655
  for (const message of messages) {
2469
2656
  switch (message.type) {
2470
2657
  case "error": {
2471
- console.error(chalk35.red(`[${message.code}] ${formatMessage(message, pkg)}`));
2658
+ console.error(chalk36.red(`[${message.code}] ${formatMessage(message, pkg)}`));
2472
2659
  break;
2473
2660
  }
2474
2661
  case "warning": {
2475
- console.warn(chalk35.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
2662
+ console.warn(chalk36.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
2476
2663
  break;
2477
2664
  }
2478
2665
  default: {
2479
- console.log(chalk35.white(`[${message.code}] ${formatMessage(message, pkg)}`));
2666
+ console.log(chalk36.white(`[${message.code}] ${formatMessage(message, pkg)}`));
2480
2667
  break;
2481
2668
  }
2482
2669
  }
2483
2670
  }
2484
2671
  const [errorCount, warningCount] = customPubLint(pkg);
2485
2672
  if (verbose) {
2486
- console.log(chalk35.gray(`Publint [Finish]: ${pkgDir} [${messages.length + errorCount + warningCount} messages]`));
2673
+ console.log(chalk36.gray(`Publint [Finish]: ${pkgDir} [${messages.length + errorCount + warningCount} messages]`));
2487
2674
  }
2488
2675
  return messages.filter((message) => message.type === "error").length + errorCount;
2489
2676
  };
@@ -2519,7 +2706,7 @@ var rebuild = ({ target }) => {
2519
2706
  };
2520
2707
 
2521
2708
  // src/actions/recompile.ts
2522
- import chalk36 from "chalk";
2709
+ import chalk37 from "chalk";
2523
2710
  var recompile = async ({
2524
2711
  verbose,
2525
2712
  target,
@@ -2555,7 +2742,7 @@ var recompileAll = async ({
2555
2742
  const incrementalOptions = incremental ? ["--since", "-Apt", "--topological-dev"] : ["--parallel", "-Apt", "--topological-dev"];
2556
2743
  const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
2557
2744
  if (jobs) {
2558
- console.log(chalk36.blue(`Jobs set to [${jobs}]`));
2745
+ console.log(chalk37.blue(`Jobs set to [${jobs}]`));
2559
2746
  }
2560
2747
  const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
2561
2748
  [
@@ -2586,7 +2773,7 @@ var recompileAll = async ({
2586
2773
  ]
2587
2774
  ]);
2588
2775
  console.log(
2589
- `${chalk36.gray("Recompiled in")} [${chalk36.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk36.gray("seconds")}`
2776
+ `${chalk37.gray("Recompiled in")} [${chalk37.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk37.gray("seconds")}`
2590
2777
  );
2591
2778
  return result;
2592
2779
  };
@@ -2617,13 +2804,13 @@ var reinstall = () => {
2617
2804
  };
2618
2805
 
2619
2806
  // src/actions/relint.ts
2620
- import chalk37 from "chalk";
2807
+ import chalk38 from "chalk";
2621
2808
  var relintPackage = ({
2622
2809
  pkg,
2623
2810
  fix: fix2,
2624
2811
  verbose
2625
2812
  }) => {
2626
- console.log(chalk37.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
2813
+ console.log(chalk38.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
2627
2814
  const start = Date.now();
2628
2815
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
2629
2816
  ["yarn", [
@@ -2633,7 +2820,7 @@ var relintPackage = ({
2633
2820
  fix2 ? "package-fix" : verbose ? "package-lint-verbose" : "package-lint"
2634
2821
  ]]
2635
2822
  ]);
2636
- console.log(chalk37.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk37.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk37.gray("seconds")}`));
2823
+ console.log(chalk38.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk38.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk38.gray("seconds")}`));
2637
2824
  return result;
2638
2825
  };
2639
2826
  var relint = ({
@@ -2653,13 +2840,13 @@ var relint = ({
2653
2840
  });
2654
2841
  };
2655
2842
  var relintAllPackages = ({ fix: fix2 = false } = {}) => {
2656
- console.log(chalk37.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
2843
+ console.log(chalk38.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
2657
2844
  const start = Date.now();
2658
2845
  const fixOptions = fix2 ? ["--fix"] : [];
2659
2846
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
2660
2847
  ["yarn", ["eslint", ...fixOptions]]
2661
2848
  ]);
2662
- console.log(chalk37.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk37.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk37.gray("seconds")}`));
2849
+ console.log(chalk38.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk38.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk38.gray("seconds")}`));
2663
2850
  return result;
2664
2851
  };
2665
2852
 
@@ -2677,10 +2864,10 @@ var sonar = () => {
2677
2864
  };
2678
2865
 
2679
2866
  // src/actions/statics.ts
2680
- import chalk38 from "chalk";
2867
+ import chalk39 from "chalk";
2681
2868
  var DefaultDependencies = ["axios", "@xylabs/pixel", "react", "graphql", "react-router", "@mui/material", "@mui/system"];
2682
2869
  var statics = () => {
2683
- console.log(chalk38.green("Check Required Static Dependencies"));
2870
+ console.log(chalk39.green("Check Required Static Dependencies"));
2684
2871
  const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
2685
2872
  return detectDuplicateDependencies(statics2, DefaultDependencies);
2686
2873
  };
@@ -2737,7 +2924,7 @@ var loadPackageConfig = async () => {
2737
2924
  };
2738
2925
 
2739
2926
  // src/xy/xy.ts
2740
- import chalk40 from "chalk";
2927
+ import chalk41 from "chalk";
2741
2928
 
2742
2929
  // src/xy/xyBuildCommands.ts
2743
2930
  var xyBuildCommands = (args) => {
@@ -2845,6 +3032,14 @@ var packagePositionalParam = (yargs2) => {
2845
3032
  // src/xy/xyCommonCommands.ts
2846
3033
  var xyCommonCommands = (args) => {
2847
3034
  return args.command(
3035
+ "claude-commands",
3036
+ "Claude Commands - Sync XY Labs standard Claude slash commands to .claude/commands/",
3037
+ (yargs2) => yargs2,
3038
+ (argv) => {
3039
+ if (argv.verbose) console.log("Claude Commands");
3040
+ process.exitCode = claudeCommands();
3041
+ }
3042
+ ).command(
2848
3043
  "claude-rules",
2849
3044
  "Claude Rules - Sync XY Labs standard Claude rules to .claude/rules/",
2850
3045
  (yargs2) => {
@@ -3106,7 +3301,7 @@ var xyInstallCommands = (args) => {
3106
3301
  };
3107
3302
 
3108
3303
  // src/xy/xyLintCommands.ts
3109
- import chalk39 from "chalk";
3304
+ import chalk40 from "chalk";
3110
3305
  var xyLintCommands = (args) => {
3111
3306
  return args.command(
3112
3307
  "cycle [package]",
@@ -3118,7 +3313,7 @@ var xyLintCommands = (args) => {
3118
3313
  const start = Date.now();
3119
3314
  if (argv.verbose) console.log("Cycle");
3120
3315
  process.exitCode = await cycle({ pkg: argv.package });
3121
- console.log(chalk39.blue(`Finished in ${Date.now() - start}ms`));
3316
+ console.log(chalk40.blue(`Finished in ${Date.now() - start}ms`));
3122
3317
  }
3123
3318
  ).command(
3124
3319
  "lint [package]",
@@ -3148,7 +3343,7 @@ var xyLintCommands = (args) => {
3148
3343
  cache: argv.cache,
3149
3344
  verbose: !!argv.verbose
3150
3345
  });
3151
- console.log(chalk39.blue(`Finished in ${Date.now() - start}ms`));
3346
+ console.log(chalk40.blue(`Finished in ${Date.now() - start}ms`));
3152
3347
  }
3153
3348
  ).command(
3154
3349
  "deplint [package]",
@@ -3169,19 +3364,25 @@ var xyLintCommands = (args) => {
3169
3364
  default: false,
3170
3365
  description: "Check peerDependencies",
3171
3366
  type: "boolean"
3367
+ }).option("exclude", {
3368
+ alias: "e",
3369
+ description: "Package names to exclude from unused checks (comma-separated or repeated)",
3370
+ type: "array"
3172
3371
  });
3173
3372
  },
3174
- (argv) => {
3373
+ async (argv) => {
3175
3374
  if (argv.verbose) console.log("Deplint");
3176
3375
  const start = Date.now();
3177
- process.exitCode = deplint({
3376
+ const cliExclude = argv.exclude?.flatMap((v) => String(v).split(",")).map((v) => v.trim()).filter(Boolean);
3377
+ process.exitCode = await deplint({
3378
+ cliExclude,
3178
3379
  pkg: argv.package,
3179
3380
  deps: !!argv.deps,
3180
3381
  devDeps: !!argv.devDeps,
3181
3382
  peerDeps: !!argv.peerDeps,
3182
3383
  verbose: !!argv.verbose
3183
3384
  });
3184
- console.log(chalk39.blue(`Finished in ${Date.now() - start}ms`));
3385
+ console.log(chalk40.blue(`Finished in ${Date.now() - start}ms`));
3185
3386
  }
3186
3387
  ).command(
3187
3388
  "fix [package]",
@@ -3193,7 +3394,7 @@ var xyLintCommands = (args) => {
3193
3394
  const start = Date.now();
3194
3395
  if (argv.verbose) console.log("Fix");
3195
3396
  process.exitCode = fix();
3196
- console.log(chalk39.blue(`Finished in ${Date.now() - start}ms`));
3397
+ console.log(chalk40.blue(`Finished in ${Date.now() - start}ms`));
3197
3398
  }
3198
3399
  ).command(
3199
3400
  "relint [package]",
@@ -3205,7 +3406,7 @@ var xyLintCommands = (args) => {
3205
3406
  if (argv.verbose) console.log("Relinting");
3206
3407
  const start = Date.now();
3207
3408
  process.exitCode = relint();
3208
- console.log(chalk39.blue(`Finished in ${Date.now() - start}ms`));
3409
+ console.log(chalk40.blue(`Finished in ${Date.now() - start}ms`));
3209
3410
  }
3210
3411
  ).command(
3211
3412
  "publint [package]",
@@ -3217,7 +3418,7 @@ var xyLintCommands = (args) => {
3217
3418
  if (argv.verbose) console.log("Publint");
3218
3419
  const start = Date.now();
3219
3420
  process.exitCode = await publint({ pkg: argv.package, verbose: !!argv.verbose });
3220
- console.log(chalk39.blue(`Finished in ${Date.now() - start}ms`));
3421
+ console.log(chalk40.blue(`Finished in ${Date.now() - start}ms`));
3221
3422
  }
3222
3423
  ).command(
3223
3424
  "knip",
@@ -3229,7 +3430,7 @@ var xyLintCommands = (args) => {
3229
3430
  if (argv.verbose) console.log("Knip");
3230
3431
  const start = Date.now();
3231
3432
  process.exitCode = knip();
3232
- console.log(chalk39.blue(`Knip finished in ${Date.now() - start}ms`));
3433
+ console.log(chalk40.blue(`Knip finished in ${Date.now() - start}ms`));
3233
3434
  }
3234
3435
  ).command(
3235
3436
  "sonar",
@@ -3241,7 +3442,7 @@ var xyLintCommands = (args) => {
3241
3442
  const start = Date.now();
3242
3443
  if (argv.verbose) console.log("Sonar Check");
3243
3444
  process.exitCode = sonar();
3244
- console.log(chalk39.blue(`Finished in ${Date.now() - start}ms`));
3445
+ console.log(chalk40.blue(`Finished in ${Date.now() - start}ms`));
3245
3446
  }
3246
3447
  );
3247
3448
  };
@@ -3277,8 +3478,8 @@ var xyParseOptions = () => {
3277
3478
  var xy = async () => {
3278
3479
  const options = xyParseOptions();
3279
3480
  return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
3280
- console.error(chalk40.yellow(`Command not found [${chalk40.magenta(process.argv[2])}]`));
3281
- console.log(chalk40.gray("Try 'yarn xy --help' for list of commands"));
3481
+ console.error(chalk41.yellow(`Command not found [${chalk41.magenta(process.argv[2])}]`));
3482
+ console.log(chalk41.gray("Try 'yarn xy --help' for list of commands"));
3282
3483
  }).version().help().argv;
3283
3484
  };
3284
3485
  export {
@@ -3286,10 +3487,13 @@ export {
3286
3487
  DuplicateDetector,
3287
3488
  INIT_CWD,
3288
3489
  WINDOWS_NEWLINE_REGEX,
3490
+ XYLABS_COMMANDS_PREFIX,
3289
3491
  XYLABS_RULES_PREFIX,
3290
3492
  build,
3291
3493
  bundleDts,
3292
3494
  checkResult,
3495
+ claudeCommandTemplates,
3496
+ claudeCommands,
3293
3497
  claudeMdProjectTemplate,
3294
3498
  claudeMdRuleTemplates,
3295
3499
  claudeRules,