@xylabs/ts-scripts-yarn3 5.1.4 → 5.1.5

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