@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/actions/fix.mjs +135 -12
- package/dist/actions/fix.mjs.map +1 -1
- package/dist/actions/index.mjs +4 -3
- 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 +1 -1
- 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 +4 -3
- 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 +1 -1
- package/src/actions/package/lint.ts +2 -2
- package/src/bin/package/fix.ts +16 -0
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
|
-
}) :
|
|
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
|
+
"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 () => {
|