@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/actions/fix.mjs +135 -12
- package/dist/actions/fix.mjs.map +1 -1
- package/dist/actions/index.mjs +5 -4
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/lint-clean.mjs +135 -12
- package/dist/actions/lint-clean.mjs.map +1 -1
- package/dist/actions/lint.mjs +2 -2
- package/dist/actions/lint.mjs.map +1 -1
- package/dist/actions/package/index.mjs +3 -2
- package/dist/actions/package/index.mjs.map +1 -1
- package/dist/actions/package/lint.mjs +3 -2
- package/dist/actions/package/lint.mjs.map +1 -1
- package/dist/bin/package/fix.mjs +89 -0
- package/dist/bin/package/fix.mjs.map +1 -0
- package/dist/bin/package/lint.mjs +3 -2
- package/dist/bin/package/lint.mjs.map +1 -1
- package/dist/bin/xy-ts.mjs +38 -8
- package/dist/bin/xy-ts.mjs.map +1 -1
- package/dist/bin/xy.mjs +38 -8
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +5 -4
- package/dist/index.mjs.map +1 -1
- package/dist/xy/index.mjs +38 -8
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/xy.mjs +38 -8
- package/dist/xy/xy.mjs.map +1 -1
- package/dist/xy/xyLintCommands.mjs +38 -8
- package/dist/xy/xyLintCommands.mjs.map +1 -1
- package/package.json +5 -4
- package/src/actions/lint.ts +2 -2
- package/src/actions/package/lint.ts +2 -2
- package/src/bin/package/fix.ts +16 -0
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
|
-
}) :
|
|
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
|
+
fix2 ? "package-fix" : "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 () => {
|