@xylabs/ts-scripts-yarn3 5.1.4 → 5.1.6

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.
package/dist/bin/xy.mjs CHANGED
@@ -934,23 +934,53 @@ var lintPackage = /* @__PURE__ */ __name(async ({ pkg, fix: fix2 }) => {
934
934
  dumpMessages(lintResults);
935
935
  return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
936
936
  }, "lintPackage");
937
- var lintAll = /* @__PURE__ */ __name(async ({ fix: fix2 }) => {
938
- const workspace = yarnWorkspaces();
939
- return (await Promise.all(workspace.map((ws) => lintPackage({
940
- pkg: ws.name,
941
- fix: fix2
942
- })))).reduce((prev, curr) => prev + curr, 0);
943
- }, "lintAll");
944
937
  var lint = /* @__PURE__ */ __name(async ({ pkg, verbose, incremental, fix: fix2 } = {}) => {
945
938
  return pkg ? await lintPackage({
946
939
  pkg,
947
940
  fix: fix2
948
- }) : lintAll({
941
+ }) : lintAllPackages({
949
942
  verbose,
950
943
  incremental,
951
944
  fix: fix2
952
945
  });
953
946
  }, "lint");
947
+ var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2, verbose = true, incremental } = {}) => {
948
+ console.log(chalk13.gray("Linting [All-Packages]"));
949
+ const start = Date.now();
950
+ const verboseOptions = verbose ? [
951
+ "--verbose"
952
+ ] : [
953
+ "--no-verbose"
954
+ ];
955
+ const fixOptions = fix2 ? [
956
+ "--fix"
957
+ ] : [
958
+ ""
959
+ ];
960
+ const incrementalOptions = incremental ? [
961
+ "--since",
962
+ "-Apt"
963
+ ] : [
964
+ "--parallel",
965
+ "-Apt"
966
+ ];
967
+ const result = runSteps("Lint [All-Packages]", [
968
+ [
969
+ "yarn",
970
+ [
971
+ "workspaces",
972
+ "foreach",
973
+ ...verboseOptions,
974
+ ...incrementalOptions,
975
+ "run",
976
+ fix2 ? "package-fix" : "package-lint",
977
+ ...fixOptions
978
+ ]
979
+ ]
980
+ ]);
981
+ console.log(`${chalk13.gray("Linted in")} [${chalk13.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk13.gray("seconds")}`);
982
+ return result;
983
+ }, "lintAllPackages");
954
984
 
955
985
  // src/actions/fix.ts
956
986
  var fix = /* @__PURE__ */ __name(async () => {