@xylabs/ts-scripts-yarn3 6.0.2 → 6.0.4
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 +28 -59
- package/dist/actions/fix.mjs.map +1 -1
- package/dist/actions/index.mjs +96 -121
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/lint.mjs +25 -65
- 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/actions/relint.mjs +61 -45
- package/dist/actions/relint.mjs.map +1 -1
- package/dist/bin/package/fix.mjs +3 -2
- package/dist/bin/package/fix.mjs.map +1 -1
- package/dist/bin/package/lint.mjs +3 -2
- package/dist/bin/package/lint.mjs.map +1 -1
- package/dist/bin/package/relint.mjs +106 -0
- package/dist/bin/package/relint.mjs.map +1 -0
- package/dist/bin/xy.mjs +100 -94
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +29 -23
- package/dist/index.mjs +112 -135
- package/dist/index.mjs.map +1 -1
- package/dist/xy/index.mjs +100 -94
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/xy.mjs +100 -94
- package/dist/xy/xy.mjs.map +1 -1
- package/dist/xy/xyLintCommands.mjs +97 -111
- package/dist/xy/xyLintCommands.mjs.map +1 -1
- package/package.json +5 -4
- package/src/actions/fix.ts +3 -2
- package/src/actions/index.ts +0 -2
- package/src/actions/lint.ts +19 -42
- package/src/actions/package/lint.ts +2 -2
- package/src/actions/relint.ts +73 -18
- package/src/bin/package/relint.ts +16 -0
- package/src/xy/xyLintCommands.ts +6 -8
- package/dist/actions/lint-clean.mjs +0 -222
- package/dist/actions/lint-clean.mjs.map +0 -1
- package/dist/actions/lint-profile.mjs +0 -118
- package/dist/actions/lint-profile.mjs.map +0 -1
- package/src/actions/lint-clean.ts +0 -24
- package/src/actions/lint-profile.ts +0 -5
package/dist/index.d.ts
CHANGED
|
@@ -96,7 +96,21 @@ declare const depsAll: ({ incremental, jobs, verbose, }: DepsParams) => number;
|
|
|
96
96
|
|
|
97
97
|
declare const dupdeps: () => number;
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
interface LintParams {
|
|
100
|
+
fix?: boolean;
|
|
101
|
+
incremental?: boolean;
|
|
102
|
+
pkg?: string;
|
|
103
|
+
verbose?: boolean;
|
|
104
|
+
}
|
|
105
|
+
interface LintPackageParams {
|
|
106
|
+
pkg: string;
|
|
107
|
+
verbose?: boolean;
|
|
108
|
+
}
|
|
109
|
+
declare const lintPackage: ({ pkg, fix, verbose, }: LintParams & Required<Pick<LintParams, "pkg">>) => number;
|
|
110
|
+
declare const lint: ({ pkg, verbose, incremental, fix, }?: LintParams) => number;
|
|
111
|
+
declare const lintAllPackages: ({ fix, verbose, incremental, }?: LintParams) => number;
|
|
112
|
+
|
|
113
|
+
declare const fix: (params?: LintParams) => number;
|
|
100
114
|
|
|
101
115
|
interface GenDocsParams {
|
|
102
116
|
incremental?: boolean;
|
|
@@ -117,25 +131,6 @@ declare const gitlintFix: () => number;
|
|
|
117
131
|
|
|
118
132
|
declare const license: (pkg?: string) => Promise<number>;
|
|
119
133
|
|
|
120
|
-
interface LintParams {
|
|
121
|
-
fix?: boolean;
|
|
122
|
-
incremental?: boolean;
|
|
123
|
-
pkg?: string;
|
|
124
|
-
verbose?: boolean;
|
|
125
|
-
}
|
|
126
|
-
interface LintPackageParams {
|
|
127
|
-
pkg: string;
|
|
128
|
-
verbose?: boolean;
|
|
129
|
-
}
|
|
130
|
-
declare const lintPackage: ({ pkg, fix }: LintParams) => Promise<number>;
|
|
131
|
-
declare const lintAll: ({ fix }: LintParams) => Promise<number>;
|
|
132
|
-
declare const lint: ({ pkg, verbose, incremental, fix, }?: LintParams) => Promise<number>;
|
|
133
|
-
declare const lintAllPackages: ({ fix, verbose, incremental, }?: LintParams) => number;
|
|
134
|
-
|
|
135
|
-
declare const lintClean: () => Promise<number>;
|
|
136
|
-
|
|
137
|
-
declare const lintProfile: () => number;
|
|
138
|
-
|
|
139
134
|
declare const npmignoreGen: (pkg?: string) => 1 | 0;
|
|
140
135
|
|
|
141
136
|
declare const packageClean: () => Promise<number>;
|
|
@@ -207,7 +202,7 @@ declare const packageDeps: () => Promise<number>;
|
|
|
207
202
|
|
|
208
203
|
declare const packageGenDocs: () => Promise<number | undefined>;
|
|
209
204
|
|
|
210
|
-
declare const packageLint: (fix?: boolean, verbose?: boolean) => Promise<number>;
|
|
205
|
+
declare const packageLint: (fix?: boolean, verbose?: boolean, cache?: boolean) => Promise<number>;
|
|
211
206
|
|
|
212
207
|
interface PackagePublintParams {
|
|
213
208
|
verbose?: boolean;
|
|
@@ -252,7 +247,18 @@ declare const recompileAll: ({ jobs, verbose, target, incremental, }: RecompileP
|
|
|
252
247
|
|
|
253
248
|
declare const reinstall: () => number;
|
|
254
249
|
|
|
255
|
-
|
|
250
|
+
interface RelintParams {
|
|
251
|
+
incremental?: boolean;
|
|
252
|
+
pkg?: string;
|
|
253
|
+
verbose?: boolean;
|
|
254
|
+
}
|
|
255
|
+
interface RelintPackageParams {
|
|
256
|
+
pkg: string;
|
|
257
|
+
verbose?: boolean;
|
|
258
|
+
}
|
|
259
|
+
declare const relintPackage: ({ pkg, verbose }: RelintParams & Required<Pick<RelintParams, "pkg">>) => number;
|
|
260
|
+
declare const relint: ({ pkg, verbose, incremental, }?: RelintParams) => number;
|
|
261
|
+
declare const relintAllPackages: ({ verbose, incremental }?: RelintParams) => number;
|
|
256
262
|
|
|
257
263
|
declare const retest: () => number;
|
|
258
264
|
|
|
@@ -385,4 +391,4 @@ declare const xyLintCommands: (args: Argv) => Argv<{}>;
|
|
|
385
391
|
|
|
386
392
|
declare const xyParseOptions: () => Argv;
|
|
387
393
|
|
|
388
|
-
export { type BuildParams, CROSS_PLATFORM_NEWLINE, type CleanPackageParams, type CleanParams, type CompileConfig, type CompileMode, type CompileParams, type CompileTypesParams, type CopyAssetsParams, type DepsPackageParams, type DepsParams, DuplicateDetector, type DynamicShareConfig, type EntryMode, type GenDocsPackageParams, type GenDocsParams, INIT_CWD, type LintPackageParams, type LintParams, type LiveShareConfig, type PackageCompileTscConfig, type PackageCompileTsupConfig, type PackageCopyAssetsParams, type PackageJsonEx, type PackagePublintParams, type PathConfig, type PublintPackageParams, type PublintParams, type ReadFileSyncOptions, type RebuildParams, type RecompilePackageParams, type RecompileParams, type ScriptStep, WINDOWS_NEWLINE_REGEX, type Workspace, type XyConfig, type XyConfigBase, type XyTscConfig, type XyTsupConfig, build, checkResult, clean, cleanAll, cleanDocs, cleanPackage, compile, compileAll, compilePackage, compileTypes, compileTypesAll, compileTypesPackage, copyAssets, createBuildConfig, cycle, dead, defaultBuildConfig, defaultReadFileSyncOptions, deleteGlob, deploy, deployMajor, deployMinor, deployNext, deps, depsAll, depsPackage, detectDuplicateDependencies, dupdeps, empty, fix, genDocs, genDocsAll, genDocsPackage, generateIgnoreFiles, gitignoreGen, gitlint, gitlintFix, isYarnVersionOrGreater, license, lint,
|
|
394
|
+
export { type BuildParams, CROSS_PLATFORM_NEWLINE, type CleanPackageParams, type CleanParams, type CompileConfig, type CompileMode, type CompileParams, type CompileTypesParams, type CopyAssetsParams, type DepsPackageParams, type DepsParams, DuplicateDetector, type DynamicShareConfig, type EntryMode, type GenDocsPackageParams, type GenDocsParams, INIT_CWD, type LintPackageParams, type LintParams, type LiveShareConfig, type PackageCompileTscConfig, type PackageCompileTsupConfig, type PackageCopyAssetsParams, type PackageJsonEx, type PackagePublintParams, type PathConfig, type PublintPackageParams, type PublintParams, type ReadFileSyncOptions, type RebuildParams, type RecompilePackageParams, type RecompileParams, type RelintPackageParams, type RelintParams, type ScriptStep, WINDOWS_NEWLINE_REGEX, type Workspace, type XyConfig, type XyConfigBase, type XyTscConfig, type XyTsupConfig, build, checkResult, clean, cleanAll, cleanDocs, cleanPackage, compile, compileAll, compilePackage, compileTypes, compileTypesAll, compileTypesPackage, copyAssets, createBuildConfig, cycle, dead, defaultBuildConfig, defaultReadFileSyncOptions, deleteGlob, deploy, deployMajor, deployMinor, deployNext, deps, depsAll, depsPackage, detectDuplicateDependencies, dupdeps, empty, fix, genDocs, genDocsAll, genDocsPackage, generateIgnoreFiles, gitignoreGen, gitlint, gitlintFix, isYarnVersionOrGreater, license, lint, lintAllPackages, lintPackage, loadConfig, loadPackageConfig, multiLineToJSONArray, notEmpty, npmignoreGen, packageClean, packageCleanOutputs, packageCleanTypescript, packageCompile, packageCompileTsc, packageCompileTscTypes, packageCompileTsup, packageCompileTypes, packageCopyAssets, packageDeps, packageGenDocs, packageLint, packagePublint, packageRecompile, parsedPackageJSON, processEx, publint, publintAll, publintPackage, readLines, readNonEmptyLines, rebuild, recompile, recompileAll, recompilePackage, reinstall, relint, relintAllPackages, relintPackage, retest, runStepAsync, runSteps, runStepsAsync, runXy, runXyWithWarning, safeExit, safeExitAsync, sonar, statics, test, tryReadFileSync, tsupOptions, union, up, updateYarnPlugins, updateYarnVersion, updo, withErrnoException, withError, writeLines, xy, xyBuildCommands, xyCommonCommands, xyDeployCommands, xyInstallCommands, xyLintCommands, xyParseOptions, yarn3Only, yarnWorkspace, yarnWorkspaces };
|
package/dist/index.mjs
CHANGED
|
@@ -1082,50 +1082,31 @@ var dupdeps = /* @__PURE__ */ __name(() => {
|
|
|
1082
1082
|
|
|
1083
1083
|
// src/actions/lint.ts
|
|
1084
1084
|
import chalk16 from "chalk";
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
const
|
|
1088
|
-
|
|
1089
|
-
"
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
const severity = [
|
|
1093
|
-
"none",
|
|
1094
|
-
"warning",
|
|
1095
|
-
"error"
|
|
1085
|
+
var lintPackage = /* @__PURE__ */ __name(({ pkg, fix: fix2, verbose }) => {
|
|
1086
|
+
console.log(chalk16.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
|
|
1087
|
+
const start = Date.now();
|
|
1088
|
+
const verboseOptions = verbose ? [
|
|
1089
|
+
"--verbose"
|
|
1090
|
+
] : [
|
|
1091
|
+
"--no-verbose"
|
|
1096
1092
|
];
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
}
|
|
1112
|
-
const engine = new ESLint2({
|
|
1113
|
-
cache: true,
|
|
1114
|
-
fix: fix2
|
|
1115
|
-
});
|
|
1116
|
-
const lintResults = await engine.lintFiles(workspace.location);
|
|
1117
|
-
dumpMessages(lintResults);
|
|
1118
|
-
return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
|
|
1093
|
+
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
|
|
1094
|
+
[
|
|
1095
|
+
"yarn",
|
|
1096
|
+
[
|
|
1097
|
+
"workspace",
|
|
1098
|
+
pkg,
|
|
1099
|
+
...verboseOptions,
|
|
1100
|
+
"run",
|
|
1101
|
+
fix2 ? "package-fix" : "package-lint"
|
|
1102
|
+
]
|
|
1103
|
+
]
|
|
1104
|
+
]);
|
|
1105
|
+
console.log(chalk16.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk16.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk16.gray("seconds")}`));
|
|
1106
|
+
return result;
|
|
1119
1107
|
}, "lintPackage");
|
|
1120
|
-
var
|
|
1121
|
-
|
|
1122
|
-
return (await Promise.all(workspace.map((ws) => lintPackage({
|
|
1123
|
-
pkg: ws.name,
|
|
1124
|
-
fix: fix2
|
|
1125
|
-
})))).reduce((prev, curr) => prev + curr, 0);
|
|
1126
|
-
}, "lintAll");
|
|
1127
|
-
var lint = /* @__PURE__ */ __name(async ({ pkg, verbose, incremental, fix: fix2 } = {}) => {
|
|
1128
|
-
return pkg ? await lintPackage({
|
|
1108
|
+
var lint = /* @__PURE__ */ __name(({ pkg, verbose, incremental, fix: fix2 } = {}) => {
|
|
1109
|
+
return pkg ? lintPackage({
|
|
1129
1110
|
pkg,
|
|
1130
1111
|
fix: fix2
|
|
1131
1112
|
}) : lintAllPackages({
|
|
@@ -1167,8 +1148,9 @@ var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2, verbose = true, incre
|
|
|
1167
1148
|
}, "lintAllPackages");
|
|
1168
1149
|
|
|
1169
1150
|
// src/actions/fix.ts
|
|
1170
|
-
var fix = /* @__PURE__ */ __name(
|
|
1171
|
-
return
|
|
1151
|
+
var fix = /* @__PURE__ */ __name((params) => {
|
|
1152
|
+
return lint({
|
|
1153
|
+
...params,
|
|
1172
1154
|
fix: true
|
|
1173
1155
|
});
|
|
1174
1156
|
}, "fix");
|
|
@@ -1370,47 +1352,6 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
|
1370
1352
|
}))).reduce((prev, value) => prev || value, 0);
|
|
1371
1353
|
}, "license");
|
|
1372
1354
|
|
|
1373
|
-
// src/actions/lint-clean.ts
|
|
1374
|
-
import { rmSync } from "node:fs";
|
|
1375
|
-
var lintClean = /* @__PURE__ */ __name(async () => {
|
|
1376
|
-
console.log("Lint Clean [.eslintcache]");
|
|
1377
|
-
const workspaces = yarnWorkspaces();
|
|
1378
|
-
const result = workspaces.map(({ location, name }) => {
|
|
1379
|
-
const dist = `${location}/.eslintcache`;
|
|
1380
|
-
try {
|
|
1381
|
-
rmSync(dist, {
|
|
1382
|
-
force: true,
|
|
1383
|
-
recursive: true
|
|
1384
|
-
});
|
|
1385
|
-
return 0;
|
|
1386
|
-
} catch (ex) {
|
|
1387
|
-
const error = ex;
|
|
1388
|
-
console.error(`Lint Clean [.eslintcache] Failed [${name}, ${error.message}]`);
|
|
1389
|
-
return 1;
|
|
1390
|
-
}
|
|
1391
|
-
}).reduce((prev, result2) => prev || result2, 0);
|
|
1392
|
-
return result || await lint();
|
|
1393
|
-
}, "lintClean");
|
|
1394
|
-
|
|
1395
|
-
// src/actions/lint-profile.ts
|
|
1396
|
-
var lintProfile = /* @__PURE__ */ __name(() => {
|
|
1397
|
-
return runSteps("Lint Profile", [
|
|
1398
|
-
[
|
|
1399
|
-
"yarn",
|
|
1400
|
-
[
|
|
1401
|
-
"xy",
|
|
1402
|
-
"lint"
|
|
1403
|
-
],
|
|
1404
|
-
{
|
|
1405
|
-
env: {
|
|
1406
|
-
...process.env,
|
|
1407
|
-
TIMING: "1"
|
|
1408
|
-
}
|
|
1409
|
-
}
|
|
1410
|
-
]
|
|
1411
|
-
]);
|
|
1412
|
-
}, "lintProfile");
|
|
1413
|
-
|
|
1414
1355
|
// src/actions/npmignore-gen.ts
|
|
1415
1356
|
var filename2 = ".npmignore";
|
|
1416
1357
|
var npmignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename2, pkg), "npmignoreGen");
|
|
@@ -2205,10 +2146,10 @@ import path7 from "node:path";
|
|
|
2205
2146
|
import { cwd as cwd4 } from "node:process";
|
|
2206
2147
|
import { pathToFileURL } from "node:url";
|
|
2207
2148
|
import chalk30 from "chalk";
|
|
2208
|
-
import { ESLint as
|
|
2149
|
+
import { ESLint as ESLint2 } from "eslint";
|
|
2209
2150
|
import { findUp } from "find-up";
|
|
2210
2151
|
import picomatch from "picomatch";
|
|
2211
|
-
var
|
|
2152
|
+
var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
|
|
2212
2153
|
const colors = [
|
|
2213
2154
|
"white",
|
|
2214
2155
|
"yellow",
|
|
@@ -2254,7 +2195,7 @@ function getFiles(dir, ignoreFolders) {
|
|
|
2254
2195
|
});
|
|
2255
2196
|
}
|
|
2256
2197
|
__name(getFiles, "getFiles");
|
|
2257
|
-
var packageLint = /* @__PURE__ */ __name(async (fix2 = false, verbose = false) => {
|
|
2198
|
+
var packageLint = /* @__PURE__ */ __name(async (fix2 = false, verbose = false, cache = true) => {
|
|
2258
2199
|
const pkg = process.env.INIT_CWD;
|
|
2259
2200
|
const configPath = await getRootESLintConfig();
|
|
2260
2201
|
const { default: eslintConfig } = await import(configPath.href);
|
|
@@ -2268,21 +2209,22 @@ var packageLint = /* @__PURE__ */ __name(async (fix2 = false, verbose = false) =
|
|
|
2268
2209
|
".vscode",
|
|
2269
2210
|
".github"
|
|
2270
2211
|
];
|
|
2271
|
-
const engine = new
|
|
2212
|
+
const engine = new ESLint2({
|
|
2272
2213
|
baseConfig: [
|
|
2273
2214
|
...eslintConfig
|
|
2274
2215
|
],
|
|
2275
2216
|
fix: fix2,
|
|
2276
|
-
warnIgnored: false
|
|
2217
|
+
warnIgnored: false,
|
|
2218
|
+
cache
|
|
2277
2219
|
});
|
|
2278
2220
|
const files = getFiles(cwd4(), ignoreFolders);
|
|
2279
2221
|
if (verbose) {
|
|
2280
2222
|
console.log(chalk30.green(`Linting ${pkg} [files = ${files.length}]`));
|
|
2281
2223
|
}
|
|
2282
2224
|
const lintResults = await engine.lintFiles(files);
|
|
2283
|
-
|
|
2225
|
+
dumpMessages(lintResults);
|
|
2284
2226
|
if (fix2) {
|
|
2285
|
-
await
|
|
2227
|
+
await ESLint2.outputFixes(lintResults);
|
|
2286
2228
|
}
|
|
2287
2229
|
return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
|
|
2288
2230
|
}, "packageLint");
|
|
@@ -2446,7 +2388,7 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
|
|
|
2446
2388
|
}, "recompileAll");
|
|
2447
2389
|
|
|
2448
2390
|
// src/actions/reinstall.ts
|
|
2449
|
-
import { closeSync, openSync, rmSync
|
|
2391
|
+
import { closeSync, openSync, rmSync } from "node:fs";
|
|
2450
2392
|
var reinstall = /* @__PURE__ */ __name(() => {
|
|
2451
2393
|
console.log("Reinstall [Clear Lock File]");
|
|
2452
2394
|
closeSync(openSync("./yarn.lock", "w"));
|
|
@@ -2455,7 +2397,7 @@ var reinstall = /* @__PURE__ */ __name(() => {
|
|
|
2455
2397
|
const result = workspaces.map(({ location, name }) => {
|
|
2456
2398
|
const dist = `${location}/node_modules`;
|
|
2457
2399
|
try {
|
|
2458
|
-
|
|
2400
|
+
rmSync(dist, {
|
|
2459
2401
|
force: true,
|
|
2460
2402
|
recursive: true
|
|
2461
2403
|
});
|
|
@@ -2475,35 +2417,69 @@ var reinstall = /* @__PURE__ */ __name(() => {
|
|
|
2475
2417
|
}, "reinstall");
|
|
2476
2418
|
|
|
2477
2419
|
// src/actions/relint.ts
|
|
2478
|
-
import
|
|
2479
|
-
var
|
|
2480
|
-
console.log("Relint -
|
|
2481
|
-
const
|
|
2482
|
-
const
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
});
|
|
2489
|
-
return 0;
|
|
2490
|
-
} catch (ex) {
|
|
2491
|
-
const error = ex;
|
|
2492
|
-
console.error(`Relint - Cleaning [.eslintcache] Failed [${name}, ${error.message}]`);
|
|
2493
|
-
return 1;
|
|
2494
|
-
}
|
|
2495
|
-
}).reduce((prev, result2) => prev || result2, 0);
|
|
2496
|
-
return result || runSteps("Relint", [
|
|
2420
|
+
import chalk32 from "chalk";
|
|
2421
|
+
var relintPackage = /* @__PURE__ */ __name(({ pkg, verbose }) => {
|
|
2422
|
+
console.log(chalk32.gray(`${"Relint"} [All-Packages]`));
|
|
2423
|
+
const start = Date.now();
|
|
2424
|
+
const verboseOptions = verbose ? [
|
|
2425
|
+
"--verbose"
|
|
2426
|
+
] : [
|
|
2427
|
+
"--no-verbose"
|
|
2428
|
+
];
|
|
2429
|
+
const result = runSteps("Relint [All-Packages]", [
|
|
2497
2430
|
[
|
|
2498
2431
|
"yarn",
|
|
2499
2432
|
[
|
|
2500
|
-
"
|
|
2501
|
-
|
|
2502
|
-
|
|
2433
|
+
"workspace",
|
|
2434
|
+
pkg,
|
|
2435
|
+
...verboseOptions,
|
|
2436
|
+
"run",
|
|
2437
|
+
"package-relint"
|
|
2503
2438
|
]
|
|
2504
2439
|
]
|
|
2505
2440
|
]);
|
|
2441
|
+
console.log(chalk32.gray(`${"Relinted in"} [${chalk32.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk32.gray("seconds")}`));
|
|
2442
|
+
return result;
|
|
2443
|
+
}, "relintPackage");
|
|
2444
|
+
var relint = /* @__PURE__ */ __name(({ pkg, verbose, incremental } = {}) => {
|
|
2445
|
+
return pkg ? relintPackage({
|
|
2446
|
+
pkg
|
|
2447
|
+
}) : relintAllPackages({
|
|
2448
|
+
verbose,
|
|
2449
|
+
incremental
|
|
2450
|
+
});
|
|
2506
2451
|
}, "relint");
|
|
2452
|
+
var relintAllPackages = /* @__PURE__ */ __name(({ verbose = true, incremental } = {}) => {
|
|
2453
|
+
console.log(chalk32.gray(`${"Relint"} [All-Packages]`));
|
|
2454
|
+
const start = Date.now();
|
|
2455
|
+
const verboseOptions = verbose ? [
|
|
2456
|
+
"--verbose"
|
|
2457
|
+
] : [
|
|
2458
|
+
"--no-verbose"
|
|
2459
|
+
];
|
|
2460
|
+
const incrementalOptions = incremental ? [
|
|
2461
|
+
"--since",
|
|
2462
|
+
"-Ap"
|
|
2463
|
+
] : [
|
|
2464
|
+
"--parallel",
|
|
2465
|
+
"-Ap"
|
|
2466
|
+
];
|
|
2467
|
+
const result = runSteps(`${"Relint"} [All-Packages]`, [
|
|
2468
|
+
[
|
|
2469
|
+
"yarn",
|
|
2470
|
+
[
|
|
2471
|
+
"workspaces",
|
|
2472
|
+
"foreach",
|
|
2473
|
+
...verboseOptions,
|
|
2474
|
+
...incrementalOptions,
|
|
2475
|
+
"run",
|
|
2476
|
+
"package-relint"
|
|
2477
|
+
]
|
|
2478
|
+
]
|
|
2479
|
+
]);
|
|
2480
|
+
console.log(chalk32.gray(`Relinted in [${chalk32.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk32.gray("seconds")}`));
|
|
2481
|
+
return result;
|
|
2482
|
+
}, "relintAllPackages");
|
|
2507
2483
|
|
|
2508
2484
|
// src/actions/retest.ts
|
|
2509
2485
|
var retest = /* @__PURE__ */ __name(() => {
|
|
@@ -2541,7 +2517,7 @@ var sonar = /* @__PURE__ */ __name(() => {
|
|
|
2541
2517
|
}, "sonar");
|
|
2542
2518
|
|
|
2543
2519
|
// src/actions/statics.ts
|
|
2544
|
-
import
|
|
2520
|
+
import chalk33 from "chalk";
|
|
2545
2521
|
var DefaultDependencies = [
|
|
2546
2522
|
"axios",
|
|
2547
2523
|
"@xylabs/pixel",
|
|
@@ -2552,7 +2528,7 @@ var DefaultDependencies = [
|
|
|
2552
2528
|
"@mui/system"
|
|
2553
2529
|
];
|
|
2554
2530
|
var statics = /* @__PURE__ */ __name(() => {
|
|
2555
|
-
console.log(
|
|
2531
|
+
console.log(chalk33.green("Check Required Static Dependencies"));
|
|
2556
2532
|
const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
|
|
2557
2533
|
return detectDuplicateDependencies(statics2, DefaultDependencies);
|
|
2558
2534
|
}, "statics");
|
|
@@ -2670,7 +2646,7 @@ var loadPackageConfig = /* @__PURE__ */ __name(async () => {
|
|
|
2670
2646
|
}, "loadPackageConfig");
|
|
2671
2647
|
|
|
2672
2648
|
// src/xy/xy.ts
|
|
2673
|
-
import
|
|
2649
|
+
import chalk35 from "chalk";
|
|
2674
2650
|
|
|
2675
2651
|
// src/xy/xyBuildCommands.ts
|
|
2676
2652
|
var xyBuildCommands = /* @__PURE__ */ __name((args) => {
|
|
@@ -2921,7 +2897,7 @@ var xyInstallCommands = /* @__PURE__ */ __name((args) => {
|
|
|
2921
2897
|
}, "xyInstallCommands");
|
|
2922
2898
|
|
|
2923
2899
|
// src/xy/xyLintCommands.ts
|
|
2924
|
-
import
|
|
2900
|
+
import chalk34 from "chalk";
|
|
2925
2901
|
var xyLintCommands = /* @__PURE__ */ __name((args) => {
|
|
2926
2902
|
return args.command("cycle [package]", "Cycle - Check for dependency cycles", (yargs2) => {
|
|
2927
2903
|
return packagePositionalParam(yargs2);
|
|
@@ -2929,30 +2905,32 @@ var xyLintCommands = /* @__PURE__ */ __name((args) => {
|
|
|
2929
2905
|
const start = Date.now();
|
|
2930
2906
|
if (argv.verbose) console.log("Cycle");
|
|
2931
2907
|
process.exitCode = await cycle();
|
|
2932
|
-
console.log(
|
|
2908
|
+
console.log(chalk34.blue(`Finished in ${Date.now() - start}ms`));
|
|
2933
2909
|
}).command("lint [package]", "Lint - Run Eslint", (yargs2) => {
|
|
2934
2910
|
return packagePositionalParam(yargs2);
|
|
2935
|
-
},
|
|
2911
|
+
}, (argv) => {
|
|
2936
2912
|
if (argv.verbose) console.log("Lint");
|
|
2937
2913
|
const start = Date.now();
|
|
2938
|
-
process.exitCode = argv.fix ?
|
|
2914
|
+
process.exitCode = argv.fix ? fix({
|
|
2915
|
+
pkg: argv.package
|
|
2916
|
+
}) : lint({
|
|
2939
2917
|
pkg: argv.package
|
|
2940
2918
|
});
|
|
2941
|
-
console.log(
|
|
2919
|
+
console.log(chalk34.blue(`Finished in ${Date.now() - start}ms`));
|
|
2942
2920
|
}).command("fix [package]", "Fix - Run Eslint w/fix", (yargs2) => {
|
|
2943
2921
|
return packagePositionalParam(yargs2);
|
|
2944
|
-
},
|
|
2922
|
+
}, (argv) => {
|
|
2945
2923
|
const start = Date.now();
|
|
2946
2924
|
if (argv.verbose) console.log("Fix");
|
|
2947
|
-
process.exitCode =
|
|
2948
|
-
console.log(
|
|
2925
|
+
process.exitCode = fix();
|
|
2926
|
+
console.log(chalk34.blue(`Finished in ${Date.now() - start}ms`));
|
|
2949
2927
|
}).command("relint [package]", "Relint - Clean & Lint", (yargs2) => {
|
|
2950
2928
|
return packagePositionalParam(yargs2);
|
|
2951
2929
|
}, (argv) => {
|
|
2952
2930
|
if (argv.verbose) console.log("Relinting");
|
|
2953
2931
|
const start = Date.now();
|
|
2954
2932
|
process.exitCode = relint();
|
|
2955
|
-
console.log(
|
|
2933
|
+
console.log(chalk34.blue(`Finished in ${Date.now() - start}ms`));
|
|
2956
2934
|
}).command("publint [package]", "Publint - Run Publint", (yargs2) => {
|
|
2957
2935
|
return packagePositionalParam(yargs2);
|
|
2958
2936
|
}, async (argv) => {
|
|
@@ -2962,14 +2940,14 @@ var xyLintCommands = /* @__PURE__ */ __name((args) => {
|
|
|
2962
2940
|
pkg: argv.package,
|
|
2963
2941
|
verbose: !!argv.verbose
|
|
2964
2942
|
});
|
|
2965
|
-
console.log(
|
|
2943
|
+
console.log(chalk34.blue(`Finished in ${Date.now() - start}ms`));
|
|
2966
2944
|
}).command("sonar", "Sonar - Run Sonar Check", (yargs2) => {
|
|
2967
2945
|
return packagePositionalParam(yargs2);
|
|
2968
2946
|
}, (argv) => {
|
|
2969
2947
|
const start = Date.now();
|
|
2970
2948
|
if (argv.verbose) console.log("Sonar Check");
|
|
2971
2949
|
process.exitCode = sonar();
|
|
2972
|
-
console.log(
|
|
2950
|
+
console.log(chalk34.blue(`Finished in ${Date.now() - start}ms`));
|
|
2973
2951
|
});
|
|
2974
2952
|
}, "xyLintCommands");
|
|
2975
2953
|
|
|
@@ -3031,8 +3009,8 @@ var xyParseOptions = /* @__PURE__ */ __name(() => {
|
|
|
3031
3009
|
var xy = /* @__PURE__ */ __name(async () => {
|
|
3032
3010
|
const options = xyParseOptions();
|
|
3033
3011
|
return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
|
|
3034
|
-
console.error(
|
|
3035
|
-
console.log(
|
|
3012
|
+
console.error(chalk35.yellow(`Command not found [${chalk35.magenta(process.argv[2])}]`));
|
|
3013
|
+
console.log(chalk35.gray("Try 'yarn xy --help' for list of commands"));
|
|
3036
3014
|
}).version().help().argv;
|
|
3037
3015
|
}, "xy");
|
|
3038
3016
|
export {
|
|
@@ -3080,11 +3058,8 @@ export {
|
|
|
3080
3058
|
isYarnVersionOrGreater,
|
|
3081
3059
|
license,
|
|
3082
3060
|
lint,
|
|
3083
|
-
lintAll,
|
|
3084
3061
|
lintAllPackages,
|
|
3085
|
-
lintClean,
|
|
3086
3062
|
lintPackage,
|
|
3087
|
-
lintProfile,
|
|
3088
3063
|
loadConfig,
|
|
3089
3064
|
loadPackageConfig,
|
|
3090
3065
|
multiLineToJSONArray,
|
|
@@ -3117,6 +3092,8 @@ export {
|
|
|
3117
3092
|
recompilePackage,
|
|
3118
3093
|
reinstall,
|
|
3119
3094
|
relint,
|
|
3095
|
+
relintAllPackages,
|
|
3096
|
+
relintPackage,
|
|
3120
3097
|
retest,
|
|
3121
3098
|
runStepAsync,
|
|
3122
3099
|
runSteps,
|