@xylabs/ts-scripts-yarn3 5.1.0 → 5.1.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.
- package/dist/actions/index.mjs +26 -16
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/lint-clean.mjs +16 -7
- package/dist/actions/lint-clean.mjs.map +1 -1
- package/dist/actions/lint.mjs +24 -14
- package/dist/actions/lint.mjs.map +1 -1
- package/dist/actions/package/index.mjs +2 -2
- package/dist/actions/package/index.mjs.map +1 -1
- package/dist/actions/package/lint.mjs +2 -2
- package/dist/actions/package/lint.mjs.map +1 -1
- package/dist/bin/package/lint.mjs +2 -2
- package/dist/bin/package/lint.mjs.map +1 -1
- package/dist/bin/xy-ts.mjs +16 -7
- package/dist/bin/xy-ts.mjs.map +1 -1
- package/dist/bin/xy.mjs +16 -7
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.mjs +26 -16
- package/dist/index.mjs.map +1 -1
- package/dist/xy/index.mjs +16 -7
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/xy.mjs +16 -7
- package/dist/xy/xy.mjs.map +1 -1
- package/dist/xy/xyLintCommands.mjs +16 -7
- package/dist/xy/xyLintCommands.mjs.map +1 -1
- package/package.json +4 -4
- package/src/actions/lint.ts +19 -13
- package/src/actions/package/lint.ts +4 -2
package/dist/actions/index.mjs
CHANGED
|
@@ -1148,36 +1148,40 @@ var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
|
|
|
1148
1148
|
}
|
|
1149
1149
|
}
|
|
1150
1150
|
}, "dumpMessages");
|
|
1151
|
-
var lintPackage = /* @__PURE__ */ __name(async ({ pkg }) => {
|
|
1151
|
+
var lintPackage = /* @__PURE__ */ __name(async ({ pkg, fix: fix2 }) => {
|
|
1152
1152
|
const workspace = yarnWorkspaces().find((workspace2) => workspace2.name === pkg);
|
|
1153
1153
|
if (!workspace) {
|
|
1154
1154
|
console.error(chalk17.red(`Unable to locate package [${chalk17.magenta(pkg)}]`));
|
|
1155
1155
|
process.exit(1);
|
|
1156
1156
|
}
|
|
1157
1157
|
const engine = new ESLint2({
|
|
1158
|
-
cache: true
|
|
1158
|
+
cache: true,
|
|
1159
|
+
fix: fix2
|
|
1159
1160
|
});
|
|
1160
1161
|
const lintResults = await engine.lintFiles(workspace.location);
|
|
1161
1162
|
dumpMessages(lintResults);
|
|
1162
1163
|
return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
|
|
1163
1164
|
}, "lintPackage");
|
|
1164
|
-
var lintAll = /* @__PURE__ */ __name(async () => {
|
|
1165
|
-
const
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1165
|
+
var lintAll = /* @__PURE__ */ __name(async ({ fix: fix2 }) => {
|
|
1166
|
+
const workspace = yarnWorkspaces();
|
|
1167
|
+
for (const ws of workspace) {
|
|
1168
|
+
await lintPackage({
|
|
1169
|
+
pkg: ws.name,
|
|
1170
|
+
fix: fix2
|
|
1171
|
+
});
|
|
1172
|
+
}
|
|
1171
1173
|
}, "lintAll");
|
|
1172
|
-
var lint = /* @__PURE__ */ __name(async ({ pkg, verbose, incremental } = {}) => {
|
|
1174
|
+
var lint = /* @__PURE__ */ __name(async ({ pkg, verbose, incremental, fix: fix2 } = {}) => {
|
|
1173
1175
|
return pkg ? await lintPackage({
|
|
1174
|
-
pkg
|
|
1176
|
+
pkg,
|
|
1177
|
+
fix: fix2
|
|
1175
1178
|
}) : lintAllPackages({
|
|
1176
1179
|
verbose,
|
|
1177
|
-
incremental
|
|
1180
|
+
incremental,
|
|
1181
|
+
fix: fix2
|
|
1178
1182
|
});
|
|
1179
1183
|
}, "lint");
|
|
1180
|
-
var lintAllPackages = /* @__PURE__ */ __name(({ verbose = true, incremental } = {}) => {
|
|
1184
|
+
var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2, verbose = true, incremental } = {}) => {
|
|
1181
1185
|
console.log(chalk17.gray("Linting [All-Packages]"));
|
|
1182
1186
|
const start = Date.now();
|
|
1183
1187
|
const verboseOptions = verbose ? [
|
|
@@ -1185,6 +1189,11 @@ var lintAllPackages = /* @__PURE__ */ __name(({ verbose = true, incremental } =
|
|
|
1185
1189
|
] : [
|
|
1186
1190
|
"--no-verbose"
|
|
1187
1191
|
];
|
|
1192
|
+
const fixOptions = fix2 ? [
|
|
1193
|
+
"--fix"
|
|
1194
|
+
] : [
|
|
1195
|
+
""
|
|
1196
|
+
];
|
|
1188
1197
|
const incrementalOptions = incremental ? [
|
|
1189
1198
|
"--since",
|
|
1190
1199
|
"-Apt"
|
|
@@ -1201,7 +1210,8 @@ var lintAllPackages = /* @__PURE__ */ __name(({ verbose = true, incremental } =
|
|
|
1201
1210
|
...verboseOptions,
|
|
1202
1211
|
...incrementalOptions,
|
|
1203
1212
|
"run",
|
|
1204
|
-
"package-lint"
|
|
1213
|
+
"package-lint",
|
|
1214
|
+
...fixOptions
|
|
1205
1215
|
]
|
|
1206
1216
|
]
|
|
1207
1217
|
]);
|
|
@@ -2055,8 +2065,8 @@ var packageLint = /* @__PURE__ */ __name(async () => {
|
|
|
2055
2065
|
withFileTypes: true
|
|
2056
2066
|
}).flatMap((dirent) => {
|
|
2057
2067
|
const res = path7.resolve(dir, dirent.name);
|
|
2058
|
-
if (ignorePatterns2.some((pattern) =>
|
|
2059
|
-
return dirent.isDirectory() ? getFiles(res, ignorePatterns2) : res.endsWith(".ts") || res.endsWith(".tsx") ? [
|
|
2068
|
+
if (ignorePatterns2.some((pattern) => dir.includes(pattern))) return [];
|
|
2069
|
+
return dirent.isDirectory() ? getFiles(res, ignorePatterns2) : res.endsWith(".ts") || res.endsWith(".tsx") || res.endsWith(".js") || res.endsWith(".jsx") ? [
|
|
2060
2070
|
res
|
|
2061
2071
|
] : [];
|
|
2062
2072
|
});
|