@xylabs/ts-scripts-yarn3 6.5.0 → 6.5.1

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/deplint/checkPackage/checkPackage.mjs +256 -0
  2. package/dist/actions/deplint/checkPackage/checkPackage.mjs.map +1 -0
  3. package/dist/actions/deplint/checkPackage/checkPackageTypes.mjs +1 -0
  4. package/dist/actions/deplint/checkPackage/checkPackageTypes.mjs.map +1 -0
  5. package/dist/actions/deplint/checkPackage/getTypesInDependencies.mjs +19 -0
  6. package/dist/actions/deplint/checkPackage/getTypesInDependencies.mjs.map +1 -0
  7. package/dist/actions/deplint/checkPackage/getUnlistedDependencies.mjs +35 -0
  8. package/dist/actions/deplint/checkPackage/getUnlistedDependencies.mjs.map +1 -0
  9. package/dist/actions/deplint/checkPackage/getUnlistedDevDependencies.mjs +17 -0
  10. package/dist/actions/deplint/checkPackage/getUnlistedDevDependencies.mjs.map +1 -0
  11. package/dist/actions/deplint/checkPackage/getUnusedDependencies.mjs +22 -0
  12. package/dist/actions/deplint/checkPackage/getUnusedDependencies.mjs.map +1 -0
  13. package/dist/actions/deplint/checkPackage/getUnusedPeerDependencies.mjs +19 -0
  14. package/dist/actions/deplint/checkPackage/getUnusedPeerDependencies.mjs.map +1 -0
  15. package/dist/actions/deplint/checkPackage/index.mjs +256 -0
  16. package/dist/actions/deplint/checkPackage/index.mjs.map +1 -0
  17. package/dist/actions/deplint/deplint.mjs +316 -0
  18. package/dist/actions/deplint/deplint.mjs.map +1 -0
  19. package/dist/actions/deplint/findFiles.mjs +24 -0
  20. package/dist/actions/deplint/findFiles.mjs.map +1 -0
  21. package/dist/actions/deplint/findFilesByGlob.mjs +9 -0
  22. package/dist/actions/deplint/findFilesByGlob.mjs.map +1 -0
  23. package/dist/actions/deplint/getBasePackageName.mjs +12 -0
  24. package/dist/actions/deplint/getBasePackageName.mjs.map +1 -0
  25. package/dist/actions/deplint/getDependenciesFromPackageJson.mjs +20 -0
  26. package/dist/actions/deplint/getDependenciesFromPackageJson.mjs.map +1 -0
  27. package/dist/actions/deplint/getExternalImportsFromFiles.mjs +98 -0
  28. package/dist/actions/deplint/getExternalImportsFromFiles.mjs.map +1 -0
  29. package/dist/actions/deplint/getImportsFromFile.mjs +65 -0
  30. package/dist/actions/deplint/getImportsFromFile.mjs.map +1 -0
  31. package/dist/actions/{deplint.mjs → deplint/index.mjs} +160 -87
  32. package/dist/actions/deplint/index.mjs.map +1 -0
  33. package/dist/actions/fix.mjs.map +1 -1
  34. package/dist/actions/index.mjs +235 -160
  35. package/dist/actions/index.mjs.map +1 -1
  36. package/dist/actions/lint.mjs.map +1 -1
  37. package/dist/bin/xy.mjs +239 -155
  38. package/dist/bin/xy.mjs.map +1 -1
  39. package/dist/index.d.ts +5 -1
  40. package/dist/index.mjs +282 -198
  41. package/dist/index.mjs.map +1 -1
  42. package/dist/xy/index.mjs +239 -155
  43. package/dist/xy/index.mjs.map +1 -1
  44. package/dist/xy/param.mjs +1 -1
  45. package/dist/xy/param.mjs.map +1 -1
  46. package/dist/xy/xy.mjs +239 -155
  47. package/dist/xy/xy.mjs.map +1 -1
  48. package/dist/xy/xyCommonCommands.mjs +1 -1
  49. package/dist/xy/xyCommonCommands.mjs.map +1 -1
  50. package/dist/xy/xyLintCommands.mjs +212 -107
  51. package/dist/xy/xyLintCommands.mjs.map +1 -1
  52. package/dist/xy/xyParseOptions.mjs +0 -21
  53. package/dist/xy/xyParseOptions.mjs.map +1 -1
  54. package/package.json +3 -3
  55. package/dist/actions/deplint.mjs.map +0 -1
package/dist/xy/xy.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/xy/xy.ts
2
- import chalk22 from "chalk";
2
+ import chalk27 from "chalk";
3
3
 
4
4
  // src/actions/build.ts
5
5
  import chalk7 from "chalk";
@@ -297,8 +297,8 @@ var generateIgnoreFiles = (filename3, pkg) => {
297
297
 
298
298
  // src/lib/parsedPackageJSON.ts
299
299
  import { readFileSync as readFileSync2 } from "node:fs";
300
- var parsedPackageJSON = (path4) => {
301
- const pathToPackageJSON = path4 ?? process.env.npm_package_json ?? "";
300
+ var parsedPackageJSON = (path5) => {
301
+ const pathToPackageJSON = path5 ?? process.env.npm_package_json ?? "";
302
302
  const packageJSON = readFileSync2(pathToPackageJSON).toString();
303
303
  return JSON.parse(packageJSON);
304
304
  };
@@ -655,12 +655,33 @@ var dead = () => {
655
655
  return runSteps("Dead", [["yarn", ["ts-prune", "-p", "tsconfig.json"]]]);
656
656
  };
657
657
 
658
- // src/actions/deplint.ts
658
+ // src/actions/deplint/deplint.ts
659
+ import chalk17 from "chalk";
660
+
661
+ // src/actions/deplint/findFilesByGlob.ts
662
+ import { globSync } from "glob";
663
+ function findFilesByGlob(cwd, pattern) {
664
+ return globSync(pattern, { cwd, absolute: true });
665
+ }
666
+
667
+ // src/actions/deplint/findFiles.ts
668
+ function findFiles(path5) {
669
+ const allSourceInclude = ["./src/**/*.{ts,tsx}", "./dist/**/*.d.ts"];
670
+ const prodExcludeEndswith = [".spec.ts", ".stories.tsx"];
671
+ const prodExcludeIncludes = ["/spec/", "/stories/", "/scripts/"];
672
+ const allSourceFiles = allSourceInclude.flatMap((pattern) => findFilesByGlob(path5, pattern));
673
+ const prodSourceFiles = allSourceFiles.filter((file) => !prodExcludeEndswith.some((ext) => file.endsWith(ext)) && !prodExcludeIncludes.some((excl) => file.includes(excl)));
674
+ const devSourceFiles = allSourceFiles.filter((file) => !prodSourceFiles.includes(file));
675
+ return {
676
+ allSourceFiles,
677
+ prodSourceFiles,
678
+ devSourceFiles
679
+ };
680
+ }
681
+
682
+ // src/actions/deplint/getDependenciesFromPackageJson.ts
659
683
  import fs2 from "node:fs";
660
684
  import path3 from "node:path";
661
- import chalk12 from "chalk";
662
- import { globSync } from "glob";
663
- import ts from "typescript";
664
685
  function getDependenciesFromPackageJson(packageJsonPath) {
665
686
  const packageJsonFullPath = path3.resolve(packageJsonPath);
666
687
  const rawContent = fs2.readFileSync(packageJsonFullPath, "utf8");
@@ -674,6 +695,13 @@ function getDependenciesFromPackageJson(packageJsonPath) {
674
695
  peerDependencies
675
696
  };
676
697
  }
698
+
699
+ // src/actions/deplint/getImportsFromFile.ts
700
+ import fs3 from "node:fs";
701
+ import path4 from "node:path";
702
+ import ts from "typescript";
703
+
704
+ // src/actions/deplint/getBasePackageName.ts
677
705
  function getBasePackageName(importName) {
678
706
  if (importName.startsWith("@")) {
679
707
  const parts = importName.split("/");
@@ -681,10 +709,12 @@ function getBasePackageName(importName) {
681
709
  }
682
710
  return importName.split("/")[0];
683
711
  }
712
+
713
+ // src/actions/deplint/getImportsFromFile.ts
684
714
  function getImportsFromFile(filePath, importPaths, typeImportPaths) {
685
- const sourceCode = fs2.readFileSync(filePath, "utf8");
715
+ const sourceCode = fs3.readFileSync(filePath, "utf8");
686
716
  const sourceFile = ts.createSourceFile(
687
- path3.basename(filePath),
717
+ path4.basename(filePath),
688
718
  sourceCode,
689
719
  ts.ScriptTarget.Latest,
690
720
  true
@@ -727,36 +757,26 @@ function getImportsFromFile(filePath, importPaths, typeImportPaths) {
727
757
  }
728
758
  return [cleanedImports, cleanedTypeImports];
729
759
  }
730
- function findFilesByGlob(cwd, pattern) {
731
- return globSync(pattern, { cwd, absolute: true });
732
- }
733
- function findFiles(path4) {
734
- const allSourceInclude = ["./src/**/*.{ts,tsx}", "./dist/**/*.d.ts"];
735
- const prodExcludeEndswith = [".spec.ts", ".stories.tsx"];
736
- const prodExcludeIncludes = ["/spec/", "/stories/", "/scripts/"];
737
- const allSourceFiles = allSourceInclude.flatMap((pattern) => findFilesByGlob(path4, pattern));
738
- const prodSourceFiles = allSourceFiles.filter((file) => !prodExcludeEndswith.some((ext) => file.endsWith(ext)) && !prodExcludeIncludes.some((excl) => file.includes(excl)));
739
- const devSourceFiles = allSourceFiles.filter((file) => !prodSourceFiles.includes(file));
740
- return {
741
- allSourceFiles,
742
- prodSourceFiles,
743
- devSourceFiles
744
- };
745
- }
760
+
761
+ // src/actions/deplint/getExternalImportsFromFiles.ts
762
+ var internalImportPrefixes = [".", "#", "node:"];
763
+ var removeInternalImports = (imports) => {
764
+ return imports.filter((imp) => !internalImportPrefixes.some((prefix) => imp.startsWith(prefix)));
765
+ };
746
766
  function getExternalImportsFromFiles({ prodSourceFiles, devSourceFiles }) {
747
767
  const prodImportPaths = {};
748
768
  const prodTypeImportPaths = {};
749
- const prodImportPairs = prodSourceFiles.map((path4) => getImportsFromFile(path4, prodImportPaths, prodTypeImportPaths));
769
+ const prodImportPairs = prodSourceFiles.map((path5) => getImportsFromFile(path5, prodImportPaths, prodTypeImportPaths));
750
770
  const prodImports = prodImportPairs.flatMap((pair) => pair[0]);
751
771
  const prodTypeImports = prodImportPairs.flatMap((pair) => pair[1]);
752
772
  const devImportPaths = {};
753
773
  const devTypeImportPaths = {};
754
- const devImportPairs = devSourceFiles.map((path4) => getImportsFromFile(path4, devImportPaths, devTypeImportPaths));
774
+ const devImportPairs = devSourceFiles.map((path5) => getImportsFromFile(path5, devImportPaths, devTypeImportPaths));
755
775
  const devImports = devImportPairs.flatMap((pair) => pair[0]);
756
776
  const devTypeImports = devImportPairs.flatMap((pair) => pair[1]);
757
- const externalProdImports = prodImports.filter((imp) => !imp.startsWith(".") && !imp.startsWith("#") && !imp.startsWith("node:"));
758
- const externalProdTypeImports = prodTypeImports.filter((imp) => !imp.startsWith(".") && !imp.startsWith("#") && !imp.startsWith("node:"));
759
- const externalDevImports = devImports.filter((imp) => !imp.startsWith(".") && !imp.startsWith("#") && !imp.startsWith("node:"));
777
+ const externalProdImports = removeInternalImports(prodImports);
778
+ const externalProdTypeImports = removeInternalImports(prodTypeImports);
779
+ const externalDevImports = removeInternalImports(devImports);
760
780
  return {
761
781
  prodImports,
762
782
  devImports,
@@ -770,34 +790,40 @@ function getExternalImportsFromFiles({ prodSourceFiles, devSourceFiles }) {
770
790
  externalProdTypeImports
771
791
  };
772
792
  }
773
- function check({
774
- name,
775
- location,
776
- devDeps = false,
777
- peerDeps = false
793
+
794
+ // src/actions/deplint/checkPackage/getTypesInDependencies.ts
795
+ import chalk12 from "chalk";
796
+ function getTypesInDependencies({ name, location }, { dependencies }, {}) {
797
+ let typesInDependencies = 0;
798
+ for (const dep of dependencies) {
799
+ if (dep.startsWith("@types/")) {
800
+ typesInDependencies++;
801
+ console.log(`[${chalk12.blue(name)}] @types in dependencies in package.json: ${chalk12.red(dep)}`);
802
+ console.log(` ${location}/package.json
803
+ `);
804
+ console.log("");
805
+ }
806
+ }
807
+ return typesInDependencies;
808
+ }
809
+
810
+ // src/actions/deplint/checkPackage/getUnlistedDependencies.ts
811
+ import chalk13 from "chalk";
812
+ function getUnlistedDependencies({ name }, {
813
+ dependencies,
814
+ devDependencies,
815
+ peerDependencies
816
+ }, {
817
+ externalProdTypeImports,
818
+ prodTypeImportPaths,
819
+ externalProdImports,
820
+ prodImportPaths
778
821
  }) {
779
- const { prodSourceFiles, devSourceFiles } = findFiles(location);
780
- const {
781
- prodTypeImportPaths,
782
- prodImportPaths,
783
- externalProdTypeImports,
784
- devImportPaths,
785
- externalProdImports,
786
- externalDevImports
787
- } = getExternalImportsFromFiles({ prodSourceFiles, devSourceFiles });
788
- const {
789
- dependencies,
790
- devDependencies,
791
- peerDependencies
792
- } = getDependenciesFromPackageJson(`${location}/package.json`);
793
822
  let unlistedDependencies = 0;
794
- let unlistedDevDependencies = 0;
795
- let unusedDependencies = 0;
796
- let typesInDependencies = 0;
797
823
  for (const imp of externalProdTypeImports) {
798
824
  if (!dependencies.includes(imp) && !peerDependencies.includes(imp) && !devDependencies.includes(imp) && !devDependencies.includes(`@types/${imp}`)) {
799
825
  unlistedDependencies++;
800
- console.log(`[${chalk12.blue(name)}] Missing dependency in package.json: ${chalk12.red(imp)}`);
826
+ console.log(`[${chalk13.blue(name)}] Missing dependency in package.json: ${chalk13.red(imp)}`);
801
827
  console.log(` ${prodTypeImportPaths[imp].join("\n")}`);
802
828
  console.log("");
803
829
  }
@@ -805,70 +831,119 @@ function check({
805
831
  for (const imp of externalProdImports) {
806
832
  if (!dependencies.includes(imp) && !peerDependencies.includes(imp)) {
807
833
  unlistedDependencies++;
808
- console.log(`[${chalk12.blue(name)}] Missing dependency in package.json: ${chalk12.red(imp)}`);
834
+ console.log(`[${chalk13.blue(name)}] Missing dependency in package.json: ${chalk13.red(imp)}`);
809
835
  console.log(` ${prodImportPaths[imp].join("\n")}`);
810
836
  console.log("");
811
837
  }
812
838
  }
839
+ return unlistedDependencies;
840
+ }
841
+
842
+ // src/actions/deplint/checkPackage/getUnlistedDevDependencies.ts
843
+ import chalk14 from "chalk";
844
+ function getUnlistedDevDependencies({ name }, { devDependencies }, { devImportPaths, externalDevImports }) {
845
+ let unlistedDevDependencies = 0;
846
+ for (const imp of externalDevImports) {
847
+ if (!devDependencies.includes(imp)) {
848
+ unlistedDevDependencies++;
849
+ console.log(`[${chalk14.blue(name)}] Missing devDependency in package.json: ${chalk14.red(imp)}`);
850
+ console.log(` Found in: ${devImportPaths[imp].join(", ")}`);
851
+ }
852
+ }
853
+ return unlistedDevDependencies;
854
+ }
855
+
856
+ // src/actions/deplint/checkPackage/getUnusedDependencies.ts
857
+ import chalk15 from "chalk";
858
+ function getUnusedDependencies({ name, location }, { dependencies }, {
859
+ externalProdImports,
860
+ externalProdTypeImports
861
+ }) {
862
+ let unusedDependencies = 0;
813
863
  for (const dep of dependencies) {
814
- if (dep.startsWith("@types/")) {
815
- typesInDependencies++;
816
- console.log(`[${chalk12.blue(name)}] @types in dependencies in package.json: ${chalk12.red(dep)}`);
864
+ if (!externalProdImports.includes(dep) && !externalProdTypeImports.includes(dep)) {
865
+ unusedDependencies++;
866
+ console.log(`[${chalk15.blue(name)}] Unused dependency in package.json: ${chalk15.red(dep)}`);
817
867
  console.log(` ${location}/package.json
818
868
  `);
819
869
  console.log("");
820
870
  }
821
- if (!externalProdImports.includes(dep)) {
871
+ }
872
+ return unusedDependencies;
873
+ }
874
+
875
+ // src/actions/deplint/checkPackage/getUnusedPeerDependencies.ts
876
+ import chalk16 from "chalk";
877
+ function getUnusedPeerDependencies({ name, location }, { peerDependencies }, { externalProdImports, externalProdTypeImports }) {
878
+ let unusedDependencies = 0;
879
+ for (const dep of peerDependencies) {
880
+ if (!externalProdImports.includes(dep) && !externalProdTypeImports.includes(dep)) {
822
881
  unusedDependencies++;
823
- console.log(`[${chalk12.blue(name)}] Unused dependency in package.json: ${chalk12.red(dep)}`);
882
+ console.log(`[${chalk16.blue(name)}] Unused peerDependency in package.json: ${chalk16.red(dep)}`);
824
883
  console.log(` ${location}/package.json
825
884
  `);
826
885
  console.log("");
827
886
  }
828
887
  }
829
- if (peerDeps) {
830
- for (const dep of peerDependencies) {
831
- if (!externalProdImports.includes(dep)) {
832
- unusedDependencies++;
833
- console.log(`[${chalk12.blue(name)}] Unused peerDependency in package.json: ${chalk12.red(dep)}`);
834
- console.log(` ${location}/package.json
835
- `);
836
- console.log("");
837
- }
838
- }
839
- }
840
- if (devDeps) {
841
- for (const imp of externalDevImports) {
842
- if (!devDependencies.includes(imp)) {
843
- unlistedDevDependencies++;
844
- console.log(`[${chalk12.blue(name)}] Missing devDependency in package.json: ${chalk12.red(imp)}`);
845
- console.log(` Found in: ${devImportPaths[imp].join(", ")}`);
846
- }
847
- }
848
- }
849
- const totalErrors = unlistedDependencies + unlistedDevDependencies + unusedDependencies + typesInDependencies;
888
+ return unusedDependencies;
889
+ }
890
+
891
+ // src/actions/deplint/checkPackage/checkPackage.ts
892
+ function checkPackage({
893
+ name,
894
+ location,
895
+ deps = false,
896
+ devDeps = false,
897
+ peerDeps = false
898
+ }) {
899
+ const { prodSourceFiles, devSourceFiles } = findFiles(location);
900
+ const checkDeps = deps || !(deps || devDeps || peerDeps);
901
+ const checkDevDeps = devDeps || !(deps || devDeps || peerDeps);
902
+ const checkPeerDeps = peerDeps || !(deps || devDeps || peerDeps);
903
+ const sourceParams = getExternalImportsFromFiles({ prodSourceFiles, devSourceFiles });
904
+ const packageParams = getDependenciesFromPackageJson(`${location}/package.json`);
905
+ const unlistedDependencies = checkDeps ? getUnlistedDependencies({ name, location }, packageParams, sourceParams) : 0;
906
+ const unusedDependencies = checkDeps ? getUnusedDependencies({ name, location }, packageParams, sourceParams) : 0;
907
+ const typesInDependencies = checkDeps ? getTypesInDependencies({ name, location }, packageParams, sourceParams) : 0;
908
+ const unlistedDevDependencies = checkDevDeps ? getUnlistedDevDependencies({ name, location }, packageParams, sourceParams) : 0;
909
+ const unusedPeerDependencies = checkPeerDeps ? getUnusedPeerDependencies({ name, location }, packageParams, sourceParams) : 0;
910
+ const totalErrors = unlistedDependencies + unlistedDevDependencies + unusedDependencies + typesInDependencies + unusedPeerDependencies;
850
911
  return totalErrors;
851
912
  }
852
- var deplint = ({ pkg }) => {
913
+
914
+ // src/actions/deplint/deplint.ts
915
+ var deplint = ({
916
+ pkg,
917
+ deps,
918
+ devDeps,
919
+ peerDeps
920
+ }) => {
853
921
  if (pkg) {
854
922
  const { location, name } = yarnWorkspace(pkg);
855
923
  console.log(`Running Deplint for ${name}`);
856
- check({
924
+ checkPackage({
857
925
  name,
858
926
  location,
859
- devDeps: true
927
+ devDeps,
928
+ deps,
929
+ peerDeps
860
930
  });
861
931
  } else {
862
932
  const workspaces = yarnWorkspaces();
863
933
  console.log("Deplint Started...");
864
934
  let totalErrors = 0;
865
935
  for (const workspace of workspaces) {
866
- totalErrors += check(workspace);
936
+ totalErrors += checkPackage({
937
+ ...workspace,
938
+ deps,
939
+ devDeps,
940
+ peerDeps
941
+ });
867
942
  }
868
943
  if (totalErrors > 0) {
869
- console.log(`Found ${chalk12.red(totalErrors)} unlisted imports.`);
944
+ console.log(`Deplint: Found ${chalk17.red(totalErrors)} dependency problems. ${chalk17.red("\u2716")}`);
870
945
  } else {
871
- console.log(`No unlisted imports found. ${chalk12.green("\u2714")}`);
946
+ console.log(`Deplint: Found no dependency problems. ${chalk17.green("\u2714")}`);
872
947
  }
873
948
  }
874
949
  return 0;
@@ -975,18 +1050,18 @@ var deployNext = () => {
975
1050
  };
976
1051
 
977
1052
  // src/actions/dupdeps.ts
978
- import chalk13 from "chalk";
1053
+ import chalk18 from "chalk";
979
1054
  var dupdeps = () => {
980
- console.log(chalk13.green("Checking all Dependencies for Duplicates"));
1055
+ console.log(chalk18.green("Checking all Dependencies for Duplicates"));
981
1056
  const allDependencies = parsedPackageJSON()?.dependencies;
982
1057
  const dependencies = Object.entries(allDependencies).map(([k]) => k);
983
1058
  return detectDuplicateDependencies(dependencies);
984
1059
  };
985
1060
 
986
1061
  // src/actions/lint.ts
987
- import chalk14 from "chalk";
1062
+ import chalk19 from "chalk";
988
1063
  var lintPackage = ({ pkg, fix: fix2 }) => {
989
- console.log(chalk14.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
1064
+ console.log(chalk19.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
990
1065
  const start = Date.now();
991
1066
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
992
1067
  ["yarn", [
@@ -996,7 +1071,7 @@ var lintPackage = ({ pkg, fix: fix2 }) => {
996
1071
  fix2 ? "package-fix" : "package-lint"
997
1072
  ]]
998
1073
  ]);
999
- console.log(chalk14.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk14.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk14.gray("seconds")}`));
1074
+ console.log(chalk19.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk19.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk19.gray("seconds")}`));
1000
1075
  return result;
1001
1076
  };
1002
1077
  var lint = ({
@@ -1012,13 +1087,13 @@ var lint = ({
1012
1087
  });
1013
1088
  };
1014
1089
  var lintAllPackages = ({ fix: fix2 = false } = {}) => {
1015
- console.log(chalk14.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
1090
+ console.log(chalk19.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
1016
1091
  const start = Date.now();
1017
1092
  const fixOptions = fix2 ? ["--fix"] : [];
1018
1093
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
1019
1094
  ["yarn", ["eslint", ...fixOptions]]
1020
1095
  ]);
1021
- console.log(chalk14.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk14.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk14.gray("seconds")}`));
1096
+ console.log(chalk19.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk19.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk19.gray("seconds")}`));
1022
1097
  return result;
1023
1098
  };
1024
1099
 
@@ -1046,7 +1121,7 @@ var filename = ".gitignore";
1046
1121
  var gitignoreGen = (pkg) => generateIgnoreFiles(filename, pkg);
1047
1122
 
1048
1123
  // src/actions/gitlint.ts
1049
- import chalk15 from "chalk";
1124
+ import chalk20 from "chalk";
1050
1125
  import ParseGitConfig from "parse-git-config";
1051
1126
  var gitlint = () => {
1052
1127
  console.log(`
@@ -1057,7 +1132,7 @@ Gitlint Start [${process.cwd()}]
1057
1132
  const errors = 0;
1058
1133
  const gitConfig = ParseGitConfig.sync();
1059
1134
  const warn = (message) => {
1060
- console.warn(chalk15.yellow(`Warning: ${message}`));
1135
+ console.warn(chalk20.yellow(`Warning: ${message}`));
1061
1136
  warnings++;
1062
1137
  };
1063
1138
  if (gitConfig.core.ignorecase) {
@@ -1077,13 +1152,13 @@ Gitlint Start [${process.cwd()}]
1077
1152
  }
1078
1153
  const resultMessages = [];
1079
1154
  if (valid > 0) {
1080
- resultMessages.push(chalk15.green(`Passed: ${valid}`));
1155
+ resultMessages.push(chalk20.green(`Passed: ${valid}`));
1081
1156
  }
1082
1157
  if (warnings > 0) {
1083
- resultMessages.push(chalk15.yellow(`Warnings: ${warnings}`));
1158
+ resultMessages.push(chalk20.yellow(`Warnings: ${warnings}`));
1084
1159
  }
1085
1160
  if (errors > 0) {
1086
- resultMessages.push(chalk15.red(` Errors: ${errors}`));
1161
+ resultMessages.push(chalk20.red(` Errors: ${errors}`));
1087
1162
  }
1088
1163
  console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
1089
1164
  `);
@@ -1092,7 +1167,7 @@ Gitlint Start [${process.cwd()}]
1092
1167
 
1093
1168
  // src/actions/gitlint-fix.ts
1094
1169
  import { execSync as execSync2 } from "node:child_process";
1095
- import chalk16 from "chalk";
1170
+ import chalk21 from "chalk";
1096
1171
  import ParseGitConfig2 from "parse-git-config";
1097
1172
  var gitlintFix = () => {
1098
1173
  console.log(`
@@ -1101,15 +1176,15 @@ Gitlint Fix Start [${process.cwd()}]
1101
1176
  const gitConfig = ParseGitConfig2.sync();
1102
1177
  if (gitConfig.core.ignorecase) {
1103
1178
  execSync2("git config core.ignorecase false", { stdio: "inherit" });
1104
- console.warn(chalk16.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
1179
+ console.warn(chalk21.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
1105
1180
  }
1106
1181
  if (gitConfig.core.autocrlf !== false) {
1107
1182
  execSync2("git config core.autocrlf false", { stdio: "inherit" });
1108
- console.warn(chalk16.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
1183
+ console.warn(chalk21.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
1109
1184
  }
1110
1185
  if (gitConfig.core.eol !== "lf") {
1111
1186
  execSync2("git config core.eol lf", { stdio: "inherit" });
1112
- console.warn(chalk16.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
1187
+ console.warn(chalk21.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
1113
1188
  }
1114
1189
  return 1;
1115
1190
  };
@@ -1120,7 +1195,7 @@ var knip = () => {
1120
1195
  };
1121
1196
 
1122
1197
  // src/actions/license.ts
1123
- import chalk17 from "chalk";
1198
+ import chalk22 from "chalk";
1124
1199
  import { init } from "license-checker";
1125
1200
  var license = async (pkg) => {
1126
1201
  const workspaces = yarnWorkspaces();
@@ -1145,18 +1220,18 @@ var license = async (pkg) => {
1145
1220
  "LGPL-3.0-or-later",
1146
1221
  "Python-2.0"
1147
1222
  ]);
1148
- console.log(chalk17.green("License Checker"));
1223
+ console.log(chalk22.green("License Checker"));
1149
1224
  return (await Promise.all(
1150
1225
  workspaceList.map(({ location, name }) => {
1151
1226
  return new Promise((resolve) => {
1152
1227
  init({ production: true, start: location }, (error, packages) => {
1153
1228
  if (error) {
1154
- console.error(chalk17.red(`License Checker [${name}] Error`));
1155
- console.error(chalk17.gray(error));
1229
+ console.error(chalk22.red(`License Checker [${name}] Error`));
1230
+ console.error(chalk22.gray(error));
1156
1231
  console.log("\n");
1157
1232
  resolve(1);
1158
1233
  } else {
1159
- console.log(chalk17.green(`License Checker [${name}]`));
1234
+ console.log(chalk22.green(`License Checker [${name}]`));
1160
1235
  let count = 0;
1161
1236
  for (const [name2, info] of Object.entries(packages)) {
1162
1237
  const licenses = Array.isArray(info.licenses) ? info.licenses : [info.licenses];
@@ -1172,7 +1247,7 @@ var license = async (pkg) => {
1172
1247
  }
1173
1248
  if (!orLicenseFound) {
1174
1249
  count++;
1175
- console.warn(chalk17.yellow(`${name2}: Package License not allowed [${license2}]`));
1250
+ console.warn(chalk22.yellow(`${name2}: Package License not allowed [${license2}]`));
1176
1251
  }
1177
1252
  }
1178
1253
  }
@@ -1211,7 +1286,7 @@ var rebuild = ({ target }) => {
1211
1286
  };
1212
1287
 
1213
1288
  // src/actions/recompile.ts
1214
- import chalk18 from "chalk";
1289
+ import chalk23 from "chalk";
1215
1290
  var recompile = async ({
1216
1291
  verbose,
1217
1292
  target,
@@ -1247,7 +1322,7 @@ var recompileAll = async ({
1247
1322
  const incrementalOptions = incremental ? ["--since", "-Apt", "--topological-dev"] : ["--parallel", "-Apt", "--topological-dev"];
1248
1323
  const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
1249
1324
  if (jobs) {
1250
- console.log(chalk18.blue(`Jobs set to [${jobs}]`));
1325
+ console.log(chalk23.blue(`Jobs set to [${jobs}]`));
1251
1326
  }
1252
1327
  const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
1253
1328
  [
@@ -1278,7 +1353,7 @@ var recompileAll = async ({
1278
1353
  ]
1279
1354
  ]);
1280
1355
  console.log(
1281
- `${chalk18.gray("Recompiled in")} [${chalk18.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk18.gray("seconds")}`
1356
+ `${chalk23.gray("Recompiled in")} [${chalk23.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk23.gray("seconds")}`
1282
1357
  );
1283
1358
  return result;
1284
1359
  };
@@ -1309,9 +1384,9 @@ var reinstall = () => {
1309
1384
  };
1310
1385
 
1311
1386
  // src/actions/relint.ts
1312
- import chalk19 from "chalk";
1387
+ import chalk24 from "chalk";
1313
1388
  var relintPackage = ({ pkg }) => {
1314
- console.log(chalk19.gray(`${"Relint"} [All-Packages]`));
1389
+ console.log(chalk24.gray(`${"Relint"} [All-Packages]`));
1315
1390
  const start = Date.now();
1316
1391
  const result = runSteps("Relint [All-Packages]", [
1317
1392
  ["yarn", [
@@ -1321,7 +1396,7 @@ var relintPackage = ({ pkg }) => {
1321
1396
  "package-relint"
1322
1397
  ]]
1323
1398
  ]);
1324
- console.log(chalk19.gray(`${"Relinted in"} [${chalk19.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk19.gray("seconds")}`));
1399
+ console.log(chalk24.gray(`${"Relinted in"} [${chalk24.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk24.gray("seconds")}`));
1325
1400
  return result;
1326
1401
  };
1327
1402
  var relint = ({
@@ -1332,7 +1407,7 @@ var relint = ({
1332
1407
  return pkg ? relintPackage({ pkg }) : relintAllPackages({ verbose, incremental });
1333
1408
  };
1334
1409
  var relintAllPackages = ({ verbose = true, incremental } = {}) => {
1335
- console.log(chalk19.gray(`${"Relint"} [All-Packages]`));
1410
+ console.log(chalk24.gray(`${"Relint"} [All-Packages]`));
1336
1411
  const start = Date.now();
1337
1412
  const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
1338
1413
  const incrementalOptions = incremental ? ["--since", "-Ap"] : ["--parallel", "-Ap"];
@@ -1346,7 +1421,7 @@ var relintAllPackages = ({ verbose = true, incremental } = {}) => {
1346
1421
  "package-relint"
1347
1422
  ]]
1348
1423
  ]);
1349
- console.log(chalk19.gray(`Relinted in [${chalk19.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk19.gray("seconds")}`));
1424
+ console.log(chalk24.gray(`Relinted in [${chalk24.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk24.gray("seconds")}`));
1350
1425
  return result;
1351
1426
  };
1352
1427
 
@@ -1364,10 +1439,10 @@ var sonar = () => {
1364
1439
  };
1365
1440
 
1366
1441
  // src/actions/statics.ts
1367
- import chalk20 from "chalk";
1442
+ import chalk25 from "chalk";
1368
1443
  var DefaultDependencies = ["axios", "@xylabs/pixel", "react", "graphql", "react-router", "@mui/material", "@mui/system"];
1369
1444
  var statics = () => {
1370
- console.log(chalk20.green("Check Required Static Dependencies"));
1445
+ console.log(chalk25.green("Check Required Static Dependencies"));
1371
1446
  const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
1372
1447
  return detectDuplicateDependencies(statics2, DefaultDependencies);
1373
1448
  };
@@ -1532,7 +1607,7 @@ var xyBuildCommands = (args) => {
1532
1607
 
1533
1608
  // src/xy/param.ts
1534
1609
  var packagePositionalParam = (yargs2) => {
1535
- return yargs2.positional("package", { describe: "Specific package to target" });
1610
+ return yargs2.positional("package", { describe: "Specific package to target", type: "string" });
1536
1611
  };
1537
1612
 
1538
1613
  // src/xy/xyCommonCommands.ts
@@ -1774,7 +1849,7 @@ var xyInstallCommands = (args) => {
1774
1849
  };
1775
1850
 
1776
1851
  // src/xy/xyLintCommands.ts
1777
- import chalk21 from "chalk";
1852
+ import chalk26 from "chalk";
1778
1853
  var xyLintCommands = (args) => {
1779
1854
  return args.command(
1780
1855
  "cycle [package]",
@@ -1786,31 +1861,61 @@ var xyLintCommands = (args) => {
1786
1861
  const start = Date.now();
1787
1862
  if (argv.verbose) console.log("Cycle");
1788
1863
  process.exitCode = await cycle({ pkg: argv.package });
1789
- console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
1864
+ console.log(chalk26.blue(`Finished in ${Date.now() - start}ms`));
1790
1865
  }
1791
1866
  ).command(
1792
1867
  "lint [package]",
1793
1868
  "Lint - Run Eslint",
1794
1869
  (yargs2) => {
1795
- return packagePositionalParam(yargs2);
1870
+ return packagePositionalParam(yargs2).option("fix", {
1871
+ alias: "f",
1872
+ default: false,
1873
+ description: "Fix fixable issues",
1874
+ type: "boolean"
1875
+ }).option("cache", {
1876
+ alias: "c",
1877
+ default: false,
1878
+ description: "Use caching for performance",
1879
+ type: "boolean"
1880
+ });
1796
1881
  },
1797
1882
  (argv) => {
1798
1883
  if (argv.verbose) console.log("Lint");
1799
1884
  const start = Date.now();
1800
- process.exitCode = argv.fix ? fix({ pkg: argv.package }) : lint({ pkg: argv.package });
1801
- console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
1885
+ process.exitCode = argv.fix ? fix({ pkg: argv.package, cache: argv.cache }) : lint({ pkg: argv.package, cache: argv.cache });
1886
+ console.log(chalk26.blue(`Finished in ${Date.now() - start}ms`));
1802
1887
  }
1803
1888
  ).command(
1804
1889
  "deplint [package]",
1805
1890
  "Deplint - Run Deplint",
1806
1891
  (yargs2) => {
1807
- return packagePositionalParam(yargs2);
1892
+ return packagePositionalParam(yargs2).option("deps", {
1893
+ alias: "d",
1894
+ default: false,
1895
+ description: "Check dependencies",
1896
+ type: "boolean"
1897
+ }).option("devDeps", {
1898
+ alias: "v",
1899
+ default: false,
1900
+ description: "Check devDependencies",
1901
+ type: "boolean"
1902
+ }).option("peerDeps", {
1903
+ alias: "p",
1904
+ default: false,
1905
+ description: "Check peerDependencies",
1906
+ type: "boolean"
1907
+ });
1808
1908
  },
1809
1909
  (argv) => {
1810
1910
  if (argv.verbose) console.log("Deplint");
1811
1911
  const start = Date.now();
1812
- process.exitCode = deplint({ pkg: argv.package });
1813
- console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
1912
+ process.exitCode = deplint({
1913
+ pkg: argv.package,
1914
+ deps: !!argv.deps,
1915
+ devDeps: !!argv.devDeps,
1916
+ peerDeps: !!argv.peerDeps
1917
+ });
1918
+ console.log(chalk26.blue(`Finished in ${Date.now() - start}ms`));
1814
1919
  }
1815
1920
  ).command(
1816
1921
  "fix [package]",
@@ -1822,7 +1927,7 @@ var xyLintCommands = (args) => {
1822
1927
  const start = Date.now();
1823
1928
  if (argv.verbose) console.log("Fix");
1824
1929
  process.exitCode = fix();
1825
- console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
1930
+ console.log(chalk26.blue(`Finished in ${Date.now() - start}ms`));
1826
1931
  }
1827
1932
  ).command(
1828
1933
  "relint [package]",
@@ -1834,7 +1939,7 @@ var xyLintCommands = (args) => {
1834
1939
  if (argv.verbose) console.log("Relinting");
1835
1940
  const start = Date.now();
1836
1941
  process.exitCode = relint();
1837
- console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
1942
+ console.log(chalk26.blue(`Finished in ${Date.now() - start}ms`));
1838
1943
  }
1839
1944
  ).command(
1840
1945
  "publint [package]",
@@ -1846,7 +1951,7 @@ var xyLintCommands = (args) => {
1846
1951
  if (argv.verbose) console.log("Publint");
1847
1952
  const start = Date.now();
1848
1953
  process.exitCode = await publint({ pkg: argv.package, verbose: !!argv.verbose });
1849
- console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
1954
+ console.log(chalk26.blue(`Finished in ${Date.now() - start}ms`));
1850
1955
  }
1851
1956
  ).command(
1852
1957
  "knip",
@@ -1858,7 +1963,7 @@ var xyLintCommands = (args) => {
1858
1963
  if (argv.verbose) console.log("Knip");
1859
1964
  const start = Date.now();
1860
1965
  process.exitCode = knip();
1861
- console.log(chalk21.blue(`Knip finished in ${Date.now() - start}ms`));
1966
+ console.log(chalk26.blue(`Knip finished in ${Date.now() - start}ms`));
1862
1967
  }
1863
1968
  ).command(
1864
1969
  "sonar",
@@ -1870,7 +1975,7 @@ var xyLintCommands = (args) => {
1870
1975
  const start = Date.now();
1871
1976
  if (argv.verbose) console.log("Sonar Check");
1872
1977
  process.exitCode = sonar();
1873
- console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
1978
+ console.log(chalk26.blue(`Finished in ${Date.now() - start}ms`));
1874
1979
  }
1875
1980
  );
1876
1981
  };
@@ -1889,37 +1994,16 @@ var xyParseOptions = () => {
1889
1994
  default: false,
1890
1995
  description: "Run with verbose logging",
1891
1996
  type: "boolean"
1892
- }).option("target", {
1893
- alias: "t",
1894
- default: "esm",
1895
- choices: ["esm", "cjs"],
1896
- description: "Limit output to specific target",
1897
- type: "string"
1898
1997
  }).option("incremental", {
1899
1998
  alias: "i",
1900
1999
  default: false,
1901
2000
  description: "Attempt to perform the action only on changed packages",
1902
2001
  type: "boolean"
1903
- }).option("fix", {
1904
- alias: "f",
1905
- default: false,
1906
- description: "Try to fix errors",
1907
- type: "boolean"
1908
- }).option("cache", {
1909
- alias: "c",
1910
- default: false,
1911
- description: "Use caching for performance",
1912
- type: "boolean"
1913
2002
  }).option("profile", {
1914
2003
  alias: "p",
1915
2004
  default: false,
1916
2005
  description: "Profile action",
1917
2006
  type: "boolean"
1918
- }).option("types", {
1919
- default: "tsc",
1920
- choices: ["tsc", "tsup"],
1921
- description: "Tool to generate Typescript types",
1922
- type: "string"
1923
2007
  });
1924
2008
  };
1925
2009
 
@@ -1927,8 +2011,8 @@ var xyParseOptions = () => {
1927
2011
  var xy = async () => {
1928
2012
  const options = xyParseOptions();
1929
2013
  return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
1930
- console.error(chalk22.yellow(`Command not found [${chalk22.magenta(process.argv[2])}]`));
1931
- console.log(chalk22.gray("Try 'yarn xy --help' for list of commands"));
2014
+ console.error(chalk27.yellow(`Command not found [${chalk27.magenta(process.argv[2])}]`));
2015
+ console.log(chalk27.gray("Try 'yarn xy --help' for list of commands"));
1932
2016
  }).version().help().argv;
1933
2017
  };
1934
2018
  export {