@xylabs/ts-scripts-yarn3 6.5.0 → 6.5.2

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 +260 -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 +21 -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 +260 -0
  16. package/dist/actions/deplint/checkPackage/index.mjs.map +1 -0
  17. package/dist/actions/deplint/deplint.mjs +320 -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} +165 -88
  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 +240 -161
  35. package/dist/actions/index.mjs.map +1 -1
  36. package/dist/actions/lint.mjs.map +1 -1
  37. package/dist/bin/xy.mjs +244 -156
  38. package/dist/bin/xy.mjs.map +1 -1
  39. package/dist/index.d.ts +5 -1
  40. package/dist/index.mjs +287 -199
  41. package/dist/index.mjs.map +1 -1
  42. package/dist/xy/index.mjs +244 -156
  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 +244 -156
  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 +217 -108
  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
- if (!dependencies.includes(imp) && !peerDependencies.includes(imp) && !devDependencies.includes(imp) && !devDependencies.includes(`@types/${imp}`)) {
824
+ if (!dependencies.includes(imp) && !peerDependencies.includes(imp) && !dependencies.includes(`@types/${imp}`) && !peerDependencies.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,123 @@ 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 }, {
845
+ devDependencies,
846
+ dependencies,
847
+ peerDependencies
848
+ }, { devImportPaths, externalDevImports }) {
849
+ let unlistedDevDependencies = 0;
850
+ for (const imp of externalDevImports) {
851
+ if (!devDependencies.includes(imp) && !dependencies.includes(imp) && !peerDependencies.includes(imp)) {
852
+ unlistedDevDependencies++;
853
+ console.log(`[${chalk14.blue(name)}] Missing devDependency in package.json: ${chalk14.red(imp)}`);
854
+ console.log(` Found in: ${devImportPaths[imp].join(", ")}`);
855
+ }
856
+ }
857
+ return unlistedDevDependencies;
858
+ }
859
+
860
+ // src/actions/deplint/checkPackage/getUnusedDependencies.ts
861
+ import chalk15 from "chalk";
862
+ function getUnusedDependencies({ name, location }, { dependencies }, {
863
+ externalProdImports,
864
+ externalProdTypeImports
865
+ }) {
866
+ let unusedDependencies = 0;
813
867
  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)}`);
868
+ if (!externalProdImports.includes(dep) && !externalProdTypeImports.includes(dep)) {
869
+ unusedDependencies++;
870
+ console.log(`[${chalk15.blue(name)}] Unused dependency in package.json: ${chalk15.red(dep)}`);
817
871
  console.log(` ${location}/package.json
818
872
  `);
819
873
  console.log("");
820
874
  }
821
- if (!externalProdImports.includes(dep)) {
875
+ }
876
+ return unusedDependencies;
877
+ }
878
+
879
+ // src/actions/deplint/checkPackage/getUnusedPeerDependencies.ts
880
+ import chalk16 from "chalk";
881
+ function getUnusedPeerDependencies({ name, location }, { peerDependencies }, { externalProdImports, externalProdTypeImports }) {
882
+ let unusedDependencies = 0;
883
+ for (const dep of peerDependencies) {
884
+ if (!externalProdImports.includes(dep) && !externalProdTypeImports.includes(dep)) {
822
885
  unusedDependencies++;
823
- console.log(`[${chalk12.blue(name)}] Unused dependency in package.json: ${chalk12.red(dep)}`);
886
+ console.log(`[${chalk16.blue(name)}] Unused peerDependency in package.json: ${chalk16.red(dep)}`);
824
887
  console.log(` ${location}/package.json
825
888
  `);
826
889
  console.log("");
827
890
  }
828
891
  }
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;
892
+ return unusedDependencies;
893
+ }
894
+
895
+ // src/actions/deplint/checkPackage/checkPackage.ts
896
+ function checkPackage({
897
+ name,
898
+ location,
899
+ deps = false,
900
+ devDeps = false,
901
+ peerDeps = false
902
+ }) {
903
+ const { prodSourceFiles, devSourceFiles } = findFiles(location);
904
+ const checkDeps = deps || !(deps || devDeps || peerDeps);
905
+ const checkDevDeps = devDeps || !(deps || devDeps || peerDeps);
906
+ const checkPeerDeps = peerDeps || !(deps || devDeps || peerDeps);
907
+ const sourceParams = getExternalImportsFromFiles({ prodSourceFiles, devSourceFiles });
908
+ const packageParams = getDependenciesFromPackageJson(`${location}/package.json`);
909
+ const unlistedDependencies = checkDeps ? getUnlistedDependencies({ name, location }, packageParams, sourceParams) : 0;
910
+ const unusedDependencies = checkDeps ? getUnusedDependencies({ name, location }, packageParams, sourceParams) : 0;
911
+ const typesInDependencies = checkDeps ? getTypesInDependencies({ name, location }, packageParams, sourceParams) : 0;
912
+ const unlistedDevDependencies = checkDevDeps ? getUnlistedDevDependencies({ name, location }, packageParams, sourceParams) : 0;
913
+ const unusedPeerDependencies = checkPeerDeps ? getUnusedPeerDependencies({ name, location }, packageParams, sourceParams) : 0;
914
+ const totalErrors = unlistedDependencies + unlistedDevDependencies + unusedDependencies + typesInDependencies + unusedPeerDependencies;
850
915
  return totalErrors;
851
916
  }
852
- var deplint = ({ pkg }) => {
917
+
918
+ // src/actions/deplint/deplint.ts
919
+ var deplint = ({
920
+ pkg,
921
+ deps,
922
+ devDeps,
923
+ peerDeps
924
+ }) => {
853
925
  if (pkg) {
854
926
  const { location, name } = yarnWorkspace(pkg);
855
927
  console.log(`Running Deplint for ${name}`);
856
- check({
928
+ checkPackage({
857
929
  name,
858
930
  location,
859
- devDeps: true
931
+ devDeps,
932
+ deps,
933
+ peerDeps
860
934
  });
861
935
  } else {
862
936
  const workspaces = yarnWorkspaces();
863
937
  console.log("Deplint Started...");
864
938
  let totalErrors = 0;
865
939
  for (const workspace of workspaces) {
866
- totalErrors += check(workspace);
940
+ totalErrors += checkPackage({
941
+ ...workspace,
942
+ deps,
943
+ devDeps,
944
+ peerDeps
945
+ });
867
946
  }
868
947
  if (totalErrors > 0) {
869
- console.log(`Found ${chalk12.red(totalErrors)} unlisted imports.`);
948
+ console.log(`Deplint: Found ${chalk17.red(totalErrors)} dependency problems. ${chalk17.red("\u2716")}`);
870
949
  } else {
871
- console.log(`No unlisted imports found. ${chalk12.green("\u2714")}`);
950
+ console.log(`Deplint: Found no dependency problems. ${chalk17.green("\u2714")}`);
872
951
  }
873
952
  }
874
953
  return 0;
@@ -975,18 +1054,18 @@ var deployNext = () => {
975
1054
  };
976
1055
 
977
1056
  // src/actions/dupdeps.ts
978
- import chalk13 from "chalk";
1057
+ import chalk18 from "chalk";
979
1058
  var dupdeps = () => {
980
- console.log(chalk13.green("Checking all Dependencies for Duplicates"));
1059
+ console.log(chalk18.green("Checking all Dependencies for Duplicates"));
981
1060
  const allDependencies = parsedPackageJSON()?.dependencies;
982
1061
  const dependencies = Object.entries(allDependencies).map(([k]) => k);
983
1062
  return detectDuplicateDependencies(dependencies);
984
1063
  };
985
1064
 
986
1065
  // src/actions/lint.ts
987
- import chalk14 from "chalk";
1066
+ import chalk19 from "chalk";
988
1067
  var lintPackage = ({ pkg, fix: fix2 }) => {
989
- console.log(chalk14.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
1068
+ console.log(chalk19.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
990
1069
  const start = Date.now();
991
1070
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
992
1071
  ["yarn", [
@@ -996,7 +1075,7 @@ var lintPackage = ({ pkg, fix: fix2 }) => {
996
1075
  fix2 ? "package-fix" : "package-lint"
997
1076
  ]]
998
1077
  ]);
999
- console.log(chalk14.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk14.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk14.gray("seconds")}`));
1078
+ console.log(chalk19.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk19.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk19.gray("seconds")}`));
1000
1079
  return result;
1001
1080
  };
1002
1081
  var lint = ({
@@ -1012,13 +1091,13 @@ var lint = ({
1012
1091
  });
1013
1092
  };
1014
1093
  var lintAllPackages = ({ fix: fix2 = false } = {}) => {
1015
- console.log(chalk14.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
1094
+ console.log(chalk19.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
1016
1095
  const start = Date.now();
1017
1096
  const fixOptions = fix2 ? ["--fix"] : [];
1018
1097
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
1019
1098
  ["yarn", ["eslint", ...fixOptions]]
1020
1099
  ]);
1021
- console.log(chalk14.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk14.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk14.gray("seconds")}`));
1100
+ console.log(chalk19.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk19.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk19.gray("seconds")}`));
1022
1101
  return result;
1023
1102
  };
1024
1103
 
@@ -1046,7 +1125,7 @@ var filename = ".gitignore";
1046
1125
  var gitignoreGen = (pkg) => generateIgnoreFiles(filename, pkg);
1047
1126
 
1048
1127
  // src/actions/gitlint.ts
1049
- import chalk15 from "chalk";
1128
+ import chalk20 from "chalk";
1050
1129
  import ParseGitConfig from "parse-git-config";
1051
1130
  var gitlint = () => {
1052
1131
  console.log(`
@@ -1057,7 +1136,7 @@ Gitlint Start [${process.cwd()}]
1057
1136
  const errors = 0;
1058
1137
  const gitConfig = ParseGitConfig.sync();
1059
1138
  const warn = (message) => {
1060
- console.warn(chalk15.yellow(`Warning: ${message}`));
1139
+ console.warn(chalk20.yellow(`Warning: ${message}`));
1061
1140
  warnings++;
1062
1141
  };
1063
1142
  if (gitConfig.core.ignorecase) {
@@ -1077,13 +1156,13 @@ Gitlint Start [${process.cwd()}]
1077
1156
  }
1078
1157
  const resultMessages = [];
1079
1158
  if (valid > 0) {
1080
- resultMessages.push(chalk15.green(`Passed: ${valid}`));
1159
+ resultMessages.push(chalk20.green(`Passed: ${valid}`));
1081
1160
  }
1082
1161
  if (warnings > 0) {
1083
- resultMessages.push(chalk15.yellow(`Warnings: ${warnings}`));
1162
+ resultMessages.push(chalk20.yellow(`Warnings: ${warnings}`));
1084
1163
  }
1085
1164
  if (errors > 0) {
1086
- resultMessages.push(chalk15.red(` Errors: ${errors}`));
1165
+ resultMessages.push(chalk20.red(` Errors: ${errors}`));
1087
1166
  }
1088
1167
  console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
1089
1168
  `);
@@ -1092,7 +1171,7 @@ Gitlint Start [${process.cwd()}]
1092
1171
 
1093
1172
  // src/actions/gitlint-fix.ts
1094
1173
  import { execSync as execSync2 } from "node:child_process";
1095
- import chalk16 from "chalk";
1174
+ import chalk21 from "chalk";
1096
1175
  import ParseGitConfig2 from "parse-git-config";
1097
1176
  var gitlintFix = () => {
1098
1177
  console.log(`
@@ -1101,15 +1180,15 @@ Gitlint Fix Start [${process.cwd()}]
1101
1180
  const gitConfig = ParseGitConfig2.sync();
1102
1181
  if (gitConfig.core.ignorecase) {
1103
1182
  execSync2("git config core.ignorecase false", { stdio: "inherit" });
1104
- console.warn(chalk16.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
1183
+ console.warn(chalk21.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
1105
1184
  }
1106
1185
  if (gitConfig.core.autocrlf !== false) {
1107
1186
  execSync2("git config core.autocrlf false", { stdio: "inherit" });
1108
- console.warn(chalk16.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
1187
+ console.warn(chalk21.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
1109
1188
  }
1110
1189
  if (gitConfig.core.eol !== "lf") {
1111
1190
  execSync2("git config core.eol lf", { stdio: "inherit" });
1112
- console.warn(chalk16.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
1191
+ console.warn(chalk21.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
1113
1192
  }
1114
1193
  return 1;
1115
1194
  };
@@ -1120,7 +1199,7 @@ var knip = () => {
1120
1199
  };
1121
1200
 
1122
1201
  // src/actions/license.ts
1123
- import chalk17 from "chalk";
1202
+ import chalk22 from "chalk";
1124
1203
  import { init } from "license-checker";
1125
1204
  var license = async (pkg) => {
1126
1205
  const workspaces = yarnWorkspaces();
@@ -1145,18 +1224,18 @@ var license = async (pkg) => {
1145
1224
  "LGPL-3.0-or-later",
1146
1225
  "Python-2.0"
1147
1226
  ]);
1148
- console.log(chalk17.green("License Checker"));
1227
+ console.log(chalk22.green("License Checker"));
1149
1228
  return (await Promise.all(
1150
1229
  workspaceList.map(({ location, name }) => {
1151
1230
  return new Promise((resolve) => {
1152
1231
  init({ production: true, start: location }, (error, packages) => {
1153
1232
  if (error) {
1154
- console.error(chalk17.red(`License Checker [${name}] Error`));
1155
- console.error(chalk17.gray(error));
1233
+ console.error(chalk22.red(`License Checker [${name}] Error`));
1234
+ console.error(chalk22.gray(error));
1156
1235
  console.log("\n");
1157
1236
  resolve(1);
1158
1237
  } else {
1159
- console.log(chalk17.green(`License Checker [${name}]`));
1238
+ console.log(chalk22.green(`License Checker [${name}]`));
1160
1239
  let count = 0;
1161
1240
  for (const [name2, info] of Object.entries(packages)) {
1162
1241
  const licenses = Array.isArray(info.licenses) ? info.licenses : [info.licenses];
@@ -1172,7 +1251,7 @@ var license = async (pkg) => {
1172
1251
  }
1173
1252
  if (!orLicenseFound) {
1174
1253
  count++;
1175
- console.warn(chalk17.yellow(`${name2}: Package License not allowed [${license2}]`));
1254
+ console.warn(chalk22.yellow(`${name2}: Package License not allowed [${license2}]`));
1176
1255
  }
1177
1256
  }
1178
1257
  }
@@ -1211,7 +1290,7 @@ var rebuild = ({ target }) => {
1211
1290
  };
1212
1291
 
1213
1292
  // src/actions/recompile.ts
1214
- import chalk18 from "chalk";
1293
+ import chalk23 from "chalk";
1215
1294
  var recompile = async ({
1216
1295
  verbose,
1217
1296
  target,
@@ -1247,7 +1326,7 @@ var recompileAll = async ({
1247
1326
  const incrementalOptions = incremental ? ["--since", "-Apt", "--topological-dev"] : ["--parallel", "-Apt", "--topological-dev"];
1248
1327
  const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
1249
1328
  if (jobs) {
1250
- console.log(chalk18.blue(`Jobs set to [${jobs}]`));
1329
+ console.log(chalk23.blue(`Jobs set to [${jobs}]`));
1251
1330
  }
1252
1331
  const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
1253
1332
  [
@@ -1278,7 +1357,7 @@ var recompileAll = async ({
1278
1357
  ]
1279
1358
  ]);
1280
1359
  console.log(
1281
- `${chalk18.gray("Recompiled in")} [${chalk18.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk18.gray("seconds")}`
1360
+ `${chalk23.gray("Recompiled in")} [${chalk23.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk23.gray("seconds")}`
1282
1361
  );
1283
1362
  return result;
1284
1363
  };
@@ -1309,9 +1388,9 @@ var reinstall = () => {
1309
1388
  };
1310
1389
 
1311
1390
  // src/actions/relint.ts
1312
- import chalk19 from "chalk";
1391
+ import chalk24 from "chalk";
1313
1392
  var relintPackage = ({ pkg }) => {
1314
- console.log(chalk19.gray(`${"Relint"} [All-Packages]`));
1393
+ console.log(chalk24.gray(`${"Relint"} [All-Packages]`));
1315
1394
  const start = Date.now();
1316
1395
  const result = runSteps("Relint [All-Packages]", [
1317
1396
  ["yarn", [
@@ -1321,7 +1400,7 @@ var relintPackage = ({ pkg }) => {
1321
1400
  "package-relint"
1322
1401
  ]]
1323
1402
  ]);
1324
- console.log(chalk19.gray(`${"Relinted in"} [${chalk19.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk19.gray("seconds")}`));
1403
+ console.log(chalk24.gray(`${"Relinted in"} [${chalk24.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk24.gray("seconds")}`));
1325
1404
  return result;
1326
1405
  };
1327
1406
  var relint = ({
@@ -1332,7 +1411,7 @@ var relint = ({
1332
1411
  return pkg ? relintPackage({ pkg }) : relintAllPackages({ verbose, incremental });
1333
1412
  };
1334
1413
  var relintAllPackages = ({ verbose = true, incremental } = {}) => {
1335
- console.log(chalk19.gray(`${"Relint"} [All-Packages]`));
1414
+ console.log(chalk24.gray(`${"Relint"} [All-Packages]`));
1336
1415
  const start = Date.now();
1337
1416
  const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
1338
1417
  const incrementalOptions = incremental ? ["--since", "-Ap"] : ["--parallel", "-Ap"];
@@ -1346,7 +1425,7 @@ var relintAllPackages = ({ verbose = true, incremental } = {}) => {
1346
1425
  "package-relint"
1347
1426
  ]]
1348
1427
  ]);
1349
- console.log(chalk19.gray(`Relinted in [${chalk19.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk19.gray("seconds")}`));
1428
+ console.log(chalk24.gray(`Relinted in [${chalk24.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk24.gray("seconds")}`));
1350
1429
  return result;
1351
1430
  };
1352
1431
 
@@ -1364,10 +1443,10 @@ var sonar = () => {
1364
1443
  };
1365
1444
 
1366
1445
  // src/actions/statics.ts
1367
- import chalk20 from "chalk";
1446
+ import chalk25 from "chalk";
1368
1447
  var DefaultDependencies = ["axios", "@xylabs/pixel", "react", "graphql", "react-router", "@mui/material", "@mui/system"];
1369
1448
  var statics = () => {
1370
- console.log(chalk20.green("Check Required Static Dependencies"));
1449
+ console.log(chalk25.green("Check Required Static Dependencies"));
1371
1450
  const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
1372
1451
  return detectDuplicateDependencies(statics2, DefaultDependencies);
1373
1452
  };
@@ -1532,7 +1611,7 @@ var xyBuildCommands = (args) => {
1532
1611
 
1533
1612
  // src/xy/param.ts
1534
1613
  var packagePositionalParam = (yargs2) => {
1535
- return yargs2.positional("package", { describe: "Specific package to target" });
1614
+ return yargs2.positional("package", { describe: "Specific package to target", type: "string" });
1536
1615
  };
1537
1616
 
1538
1617
  // src/xy/xyCommonCommands.ts
@@ -1774,7 +1853,7 @@ var xyInstallCommands = (args) => {
1774
1853
  };
1775
1854
 
1776
1855
  // src/xy/xyLintCommands.ts
1777
- import chalk21 from "chalk";
1856
+ import chalk26 from "chalk";
1778
1857
  var xyLintCommands = (args) => {
1779
1858
  return args.command(
1780
1859
  "cycle [package]",
@@ -1786,31 +1865,61 @@ var xyLintCommands = (args) => {
1786
1865
  const start = Date.now();
1787
1866
  if (argv.verbose) console.log("Cycle");
1788
1867
  process.exitCode = await cycle({ pkg: argv.package });
1789
- console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
1868
+ console.log(chalk26.blue(`Finished in ${Date.now() - start}ms`));
1790
1869
  }
1791
1870
  ).command(
1792
1871
  "lint [package]",
1793
1872
  "Lint - Run Eslint",
1794
1873
  (yargs2) => {
1795
- return packagePositionalParam(yargs2);
1874
+ return packagePositionalParam(yargs2).option("fix", {
1875
+ alias: "f",
1876
+ default: false,
1877
+ description: "Fix fixable issues",
1878
+ type: "boolean"
1879
+ }).option("cache", {
1880
+ alias: "c",
1881
+ default: false,
1882
+ description: "Use caching for performance",
1883
+ type: "boolean"
1884
+ });
1796
1885
  },
1797
1886
  (argv) => {
1798
1887
  if (argv.verbose) console.log("Lint");
1799
1888
  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`));
1889
+ process.exitCode = argv.fix ? fix({ pkg: argv.package, cache: argv.cache }) : lint({ pkg: argv.package, cache: argv.cache });
1890
+ console.log(chalk26.blue(`Finished in ${Date.now() - start}ms`));
1802
1891
  }
1803
1892
  ).command(
1804
1893
  "deplint [package]",
1805
1894
  "Deplint - Run Deplint",
1806
1895
  (yargs2) => {
1807
- return packagePositionalParam(yargs2);
1896
+ return packagePositionalParam(yargs2).option("deps", {
1897
+ alias: "d",
1898
+ default: false,
1899
+ description: "Check dependencies",
1900
+ type: "boolean"
1901
+ }).option("devDeps", {
1902
+ alias: "v",
1903
+ default: false,
1904
+ description: "Check devDependencies",
1905
+ type: "boolean"
1906
+ }).option("peerDeps", {
1907
+ alias: "p",
1908
+ default: false,
1909
+ description: "Check peerDependencies",
1910
+ type: "boolean"
1911
+ });
1808
1912
  },
1809
1913
  (argv) => {
1810
1914
  if (argv.verbose) console.log("Deplint");
1811
1915
  const start = Date.now();
1812
- process.exitCode = deplint({ pkg: argv.package });
1813
- console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
1916
+ process.exitCode = deplint({
1917
+ pkg: argv.package,
1918
+ deps: !!argv.deps,
1919
+ devDeps: !!argv.devDeps,
1920
+ peerDeps: !!argv.peerDeps
1921
+ });
1922
+ console.log(chalk26.blue(`Finished in ${Date.now() - start}ms`));
1814
1923
  }
1815
1924
  ).command(
1816
1925
  "fix [package]",
@@ -1822,7 +1931,7 @@ var xyLintCommands = (args) => {
1822
1931
  const start = Date.now();
1823
1932
  if (argv.verbose) console.log("Fix");
1824
1933
  process.exitCode = fix();
1825
- console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
1934
+ console.log(chalk26.blue(`Finished in ${Date.now() - start}ms`));
1826
1935
  }
1827
1936
  ).command(
1828
1937
  "relint [package]",
@@ -1834,7 +1943,7 @@ var xyLintCommands = (args) => {
1834
1943
  if (argv.verbose) console.log("Relinting");
1835
1944
  const start = Date.now();
1836
1945
  process.exitCode = relint();
1837
- console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
1946
+ console.log(chalk26.blue(`Finished in ${Date.now() - start}ms`));
1838
1947
  }
1839
1948
  ).command(
1840
1949
  "publint [package]",
@@ -1846,7 +1955,7 @@ var xyLintCommands = (args) => {
1846
1955
  if (argv.verbose) console.log("Publint");
1847
1956
  const start = Date.now();
1848
1957
  process.exitCode = await publint({ pkg: argv.package, verbose: !!argv.verbose });
1849
- console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
1958
+ console.log(chalk26.blue(`Finished in ${Date.now() - start}ms`));
1850
1959
  }
1851
1960
  ).command(
1852
1961
  "knip",
@@ -1858,7 +1967,7 @@ var xyLintCommands = (args) => {
1858
1967
  if (argv.verbose) console.log("Knip");
1859
1968
  const start = Date.now();
1860
1969
  process.exitCode = knip();
1861
- console.log(chalk21.blue(`Knip finished in ${Date.now() - start}ms`));
1970
+ console.log(chalk26.blue(`Knip finished in ${Date.now() - start}ms`));
1862
1971
  }
1863
1972
  ).command(
1864
1973
  "sonar",
@@ -1870,7 +1979,7 @@ var xyLintCommands = (args) => {
1870
1979
  const start = Date.now();
1871
1980
  if (argv.verbose) console.log("Sonar Check");
1872
1981
  process.exitCode = sonar();
1873
- console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
1982
+ console.log(chalk26.blue(`Finished in ${Date.now() - start}ms`));
1874
1983
  }
1875
1984
  );
1876
1985
  };
@@ -1889,37 +1998,16 @@ var xyParseOptions = () => {
1889
1998
  default: false,
1890
1999
  description: "Run with verbose logging",
1891
2000
  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
2001
  }).option("incremental", {
1899
2002
  alias: "i",
1900
2003
  default: false,
1901
2004
  description: "Attempt to perform the action only on changed packages",
1902
2005
  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
2006
  }).option("profile", {
1914
2007
  alias: "p",
1915
2008
  default: false,
1916
2009
  description: "Profile action",
1917
2010
  type: "boolean"
1918
- }).option("types", {
1919
- default: "tsc",
1920
- choices: ["tsc", "tsup"],
1921
- description: "Tool to generate Typescript types",
1922
- type: "string"
1923
2011
  });
1924
2012
  };
1925
2013
 
@@ -1927,8 +2015,8 @@ var xyParseOptions = () => {
1927
2015
  var xy = async () => {
1928
2016
  const options = xyParseOptions();
1929
2017
  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"));
2018
+ console.error(chalk27.yellow(`Command not found [${chalk27.magenta(process.argv[2])}]`));
2019
+ console.log(chalk27.gray("Try 'yarn xy --help' for list of commands"));
1932
2020
  }).version().help().argv;
1933
2021
  };
1934
2022
  export {