@xylabs/ts-scripts-yarn3 6.0.3 → 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 +93 -119
- 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/relint.mjs +61 -45
- package/dist/actions/relint.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 +28 -22
- package/dist/index.mjs +109 -133
- 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/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/bin/xy.mjs
CHANGED
|
@@ -3,7 +3,7 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4
4
|
|
|
5
5
|
// src/xy/xy.ts
|
|
6
|
-
import
|
|
6
|
+
import chalk22 from "chalk";
|
|
7
7
|
|
|
8
8
|
// src/actions/build.ts
|
|
9
9
|
import chalk7 from "chalk";
|
|
@@ -972,43 +972,31 @@ var dupdeps = /* @__PURE__ */ __name(() => {
|
|
|
972
972
|
|
|
973
973
|
// src/actions/lint.ts
|
|
974
974
|
import chalk14 from "chalk";
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
const
|
|
978
|
-
|
|
979
|
-
"
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
const severity = [
|
|
983
|
-
"none",
|
|
984
|
-
"warning",
|
|
985
|
-
"error"
|
|
975
|
+
var lintPackage = /* @__PURE__ */ __name(({ pkg, fix: fix2, verbose }) => {
|
|
976
|
+
console.log(chalk14.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
|
|
977
|
+
const start = Date.now();
|
|
978
|
+
const verboseOptions = verbose ? [
|
|
979
|
+
"--verbose"
|
|
980
|
+
] : [
|
|
981
|
+
"--no-verbose"
|
|
986
982
|
];
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
}
|
|
1002
|
-
const engine = new ESLint2({
|
|
1003
|
-
cache: true,
|
|
1004
|
-
fix: fix2
|
|
1005
|
-
});
|
|
1006
|
-
const lintResults = await engine.lintFiles(workspace.location);
|
|
1007
|
-
dumpMessages(lintResults);
|
|
1008
|
-
return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
|
|
983
|
+
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
|
|
984
|
+
[
|
|
985
|
+
"yarn",
|
|
986
|
+
[
|
|
987
|
+
"workspace",
|
|
988
|
+
pkg,
|
|
989
|
+
...verboseOptions,
|
|
990
|
+
"run",
|
|
991
|
+
fix2 ? "package-fix" : "package-lint"
|
|
992
|
+
]
|
|
993
|
+
]
|
|
994
|
+
]);
|
|
995
|
+
console.log(chalk14.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk14.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk14.gray("seconds")}`));
|
|
996
|
+
return result;
|
|
1009
997
|
}, "lintPackage");
|
|
1010
|
-
var lint = /* @__PURE__ */ __name(
|
|
1011
|
-
return pkg ?
|
|
998
|
+
var lint = /* @__PURE__ */ __name(({ pkg, verbose, incremental, fix: fix2 } = {}) => {
|
|
999
|
+
return pkg ? lintPackage({
|
|
1012
1000
|
pkg,
|
|
1013
1001
|
fix: fix2
|
|
1014
1002
|
}) : lintAllPackages({
|
|
@@ -1050,8 +1038,9 @@ var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2, verbose = true, incre
|
|
|
1050
1038
|
}, "lintAllPackages");
|
|
1051
1039
|
|
|
1052
1040
|
// src/actions/fix.ts
|
|
1053
|
-
var fix = /* @__PURE__ */ __name(
|
|
1054
|
-
return
|
|
1041
|
+
var fix = /* @__PURE__ */ __name((params) => {
|
|
1042
|
+
return lint({
|
|
1043
|
+
...params,
|
|
1055
1044
|
fix: true
|
|
1056
1045
|
});
|
|
1057
1046
|
}, "fix");
|
|
@@ -1253,25 +1242,6 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
|
1253
1242
|
}))).reduce((prev, value) => prev || value, 0);
|
|
1254
1243
|
}, "license");
|
|
1255
1244
|
|
|
1256
|
-
// src/actions/lint-profile.ts
|
|
1257
|
-
var lintProfile = /* @__PURE__ */ __name(() => {
|
|
1258
|
-
return runSteps("Lint Profile", [
|
|
1259
|
-
[
|
|
1260
|
-
"yarn",
|
|
1261
|
-
[
|
|
1262
|
-
"xy",
|
|
1263
|
-
"lint"
|
|
1264
|
-
],
|
|
1265
|
-
{
|
|
1266
|
-
env: {
|
|
1267
|
-
...process.env,
|
|
1268
|
-
TIMING: "1"
|
|
1269
|
-
}
|
|
1270
|
-
}
|
|
1271
|
-
]
|
|
1272
|
-
]);
|
|
1273
|
-
}, "lintProfile");
|
|
1274
|
-
|
|
1275
1245
|
// src/actions/npmignore-gen.ts
|
|
1276
1246
|
var filename2 = ".npmignore";
|
|
1277
1247
|
var npmignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename2, pkg), "npmignoreGen");
|
|
@@ -1459,35 +1429,69 @@ var reinstall = /* @__PURE__ */ __name(() => {
|
|
|
1459
1429
|
}, "reinstall");
|
|
1460
1430
|
|
|
1461
1431
|
// src/actions/relint.ts
|
|
1462
|
-
import
|
|
1463
|
-
var
|
|
1464
|
-
console.log("Relint -
|
|
1465
|
-
const
|
|
1466
|
-
const
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
});
|
|
1473
|
-
return 0;
|
|
1474
|
-
} catch (ex) {
|
|
1475
|
-
const error = ex;
|
|
1476
|
-
console.error(`Relint - Cleaning [.eslintcache] Failed [${name}, ${error.message}]`);
|
|
1477
|
-
return 1;
|
|
1478
|
-
}
|
|
1479
|
-
}).reduce((prev, result2) => prev || result2, 0);
|
|
1480
|
-
return result || runSteps("Relint", [
|
|
1432
|
+
import chalk19 from "chalk";
|
|
1433
|
+
var relintPackage = /* @__PURE__ */ __name(({ pkg, verbose }) => {
|
|
1434
|
+
console.log(chalk19.gray(`${"Relint"} [All-Packages]`));
|
|
1435
|
+
const start = Date.now();
|
|
1436
|
+
const verboseOptions = verbose ? [
|
|
1437
|
+
"--verbose"
|
|
1438
|
+
] : [
|
|
1439
|
+
"--no-verbose"
|
|
1440
|
+
];
|
|
1441
|
+
const result = runSteps("Relint [All-Packages]", [
|
|
1481
1442
|
[
|
|
1482
1443
|
"yarn",
|
|
1483
1444
|
[
|
|
1484
|
-
"
|
|
1485
|
-
|
|
1486
|
-
|
|
1445
|
+
"workspace",
|
|
1446
|
+
pkg,
|
|
1447
|
+
...verboseOptions,
|
|
1448
|
+
"run",
|
|
1449
|
+
"package-relint"
|
|
1487
1450
|
]
|
|
1488
1451
|
]
|
|
1489
1452
|
]);
|
|
1453
|
+
console.log(chalk19.gray(`${"Relinted in"} [${chalk19.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk19.gray("seconds")}`));
|
|
1454
|
+
return result;
|
|
1455
|
+
}, "relintPackage");
|
|
1456
|
+
var relint = /* @__PURE__ */ __name(({ pkg, verbose, incremental } = {}) => {
|
|
1457
|
+
return pkg ? relintPackage({
|
|
1458
|
+
pkg
|
|
1459
|
+
}) : relintAllPackages({
|
|
1460
|
+
verbose,
|
|
1461
|
+
incremental
|
|
1462
|
+
});
|
|
1490
1463
|
}, "relint");
|
|
1464
|
+
var relintAllPackages = /* @__PURE__ */ __name(({ verbose = true, incremental } = {}) => {
|
|
1465
|
+
console.log(chalk19.gray(`${"Relint"} [All-Packages]`));
|
|
1466
|
+
const start = Date.now();
|
|
1467
|
+
const verboseOptions = verbose ? [
|
|
1468
|
+
"--verbose"
|
|
1469
|
+
] : [
|
|
1470
|
+
"--no-verbose"
|
|
1471
|
+
];
|
|
1472
|
+
const incrementalOptions = incremental ? [
|
|
1473
|
+
"--since",
|
|
1474
|
+
"-Ap"
|
|
1475
|
+
] : [
|
|
1476
|
+
"--parallel",
|
|
1477
|
+
"-Ap"
|
|
1478
|
+
];
|
|
1479
|
+
const result = runSteps(`${"Relint"} [All-Packages]`, [
|
|
1480
|
+
[
|
|
1481
|
+
"yarn",
|
|
1482
|
+
[
|
|
1483
|
+
"workspaces",
|
|
1484
|
+
"foreach",
|
|
1485
|
+
...verboseOptions,
|
|
1486
|
+
...incrementalOptions,
|
|
1487
|
+
"run",
|
|
1488
|
+
"package-relint"
|
|
1489
|
+
]
|
|
1490
|
+
]
|
|
1491
|
+
]);
|
|
1492
|
+
console.log(chalk19.gray(`Relinted in [${chalk19.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk19.gray("seconds")}`));
|
|
1493
|
+
return result;
|
|
1494
|
+
}, "relintAllPackages");
|
|
1491
1495
|
|
|
1492
1496
|
// src/actions/retest.ts
|
|
1493
1497
|
var retest = /* @__PURE__ */ __name(() => {
|
|
@@ -1525,7 +1529,7 @@ var sonar = /* @__PURE__ */ __name(() => {
|
|
|
1525
1529
|
}, "sonar");
|
|
1526
1530
|
|
|
1527
1531
|
// src/actions/statics.ts
|
|
1528
|
-
import
|
|
1532
|
+
import chalk20 from "chalk";
|
|
1529
1533
|
var DefaultDependencies = [
|
|
1530
1534
|
"axios",
|
|
1531
1535
|
"@xylabs/pixel",
|
|
@@ -1536,7 +1540,7 @@ var DefaultDependencies = [
|
|
|
1536
1540
|
"@mui/system"
|
|
1537
1541
|
];
|
|
1538
1542
|
var statics = /* @__PURE__ */ __name(() => {
|
|
1539
|
-
console.log(
|
|
1543
|
+
console.log(chalk20.green("Check Required Static Dependencies"));
|
|
1540
1544
|
const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
|
|
1541
1545
|
return detectDuplicateDependencies(statics2, DefaultDependencies);
|
|
1542
1546
|
}, "statics");
|
|
@@ -1892,7 +1896,7 @@ var xyInstallCommands = /* @__PURE__ */ __name((args) => {
|
|
|
1892
1896
|
}, "xyInstallCommands");
|
|
1893
1897
|
|
|
1894
1898
|
// src/xy/xyLintCommands.ts
|
|
1895
|
-
import
|
|
1899
|
+
import chalk21 from "chalk";
|
|
1896
1900
|
var xyLintCommands = /* @__PURE__ */ __name((args) => {
|
|
1897
1901
|
return args.command("cycle [package]", "Cycle - Check for dependency cycles", (yargs2) => {
|
|
1898
1902
|
return packagePositionalParam(yargs2);
|
|
@@ -1900,30 +1904,32 @@ var xyLintCommands = /* @__PURE__ */ __name((args) => {
|
|
|
1900
1904
|
const start = Date.now();
|
|
1901
1905
|
if (argv.verbose) console.log("Cycle");
|
|
1902
1906
|
process.exitCode = await cycle();
|
|
1903
|
-
console.log(
|
|
1907
|
+
console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
|
|
1904
1908
|
}).command("lint [package]", "Lint - Run Eslint", (yargs2) => {
|
|
1905
1909
|
return packagePositionalParam(yargs2);
|
|
1906
|
-
},
|
|
1910
|
+
}, (argv) => {
|
|
1907
1911
|
if (argv.verbose) console.log("Lint");
|
|
1908
1912
|
const start = Date.now();
|
|
1909
|
-
process.exitCode = argv.fix ?
|
|
1913
|
+
process.exitCode = argv.fix ? fix({
|
|
1914
|
+
pkg: argv.package
|
|
1915
|
+
}) : lint({
|
|
1910
1916
|
pkg: argv.package
|
|
1911
1917
|
});
|
|
1912
|
-
console.log(
|
|
1918
|
+
console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
|
|
1913
1919
|
}).command("fix [package]", "Fix - Run Eslint w/fix", (yargs2) => {
|
|
1914
1920
|
return packagePositionalParam(yargs2);
|
|
1915
|
-
},
|
|
1921
|
+
}, (argv) => {
|
|
1916
1922
|
const start = Date.now();
|
|
1917
1923
|
if (argv.verbose) console.log("Fix");
|
|
1918
|
-
process.exitCode =
|
|
1919
|
-
console.log(
|
|
1924
|
+
process.exitCode = fix();
|
|
1925
|
+
console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
|
|
1920
1926
|
}).command("relint [package]", "Relint - Clean & Lint", (yargs2) => {
|
|
1921
1927
|
return packagePositionalParam(yargs2);
|
|
1922
1928
|
}, (argv) => {
|
|
1923
1929
|
if (argv.verbose) console.log("Relinting");
|
|
1924
1930
|
const start = Date.now();
|
|
1925
1931
|
process.exitCode = relint();
|
|
1926
|
-
console.log(
|
|
1932
|
+
console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
|
|
1927
1933
|
}).command("publint [package]", "Publint - Run Publint", (yargs2) => {
|
|
1928
1934
|
return packagePositionalParam(yargs2);
|
|
1929
1935
|
}, async (argv) => {
|
|
@@ -1933,14 +1939,14 @@ var xyLintCommands = /* @__PURE__ */ __name((args) => {
|
|
|
1933
1939
|
pkg: argv.package,
|
|
1934
1940
|
verbose: !!argv.verbose
|
|
1935
1941
|
});
|
|
1936
|
-
console.log(
|
|
1942
|
+
console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
|
|
1937
1943
|
}).command("sonar", "Sonar - Run Sonar Check", (yargs2) => {
|
|
1938
1944
|
return packagePositionalParam(yargs2);
|
|
1939
1945
|
}, (argv) => {
|
|
1940
1946
|
const start = Date.now();
|
|
1941
1947
|
if (argv.verbose) console.log("Sonar Check");
|
|
1942
1948
|
process.exitCode = sonar();
|
|
1943
|
-
console.log(
|
|
1949
|
+
console.log(chalk21.blue(`Finished in ${Date.now() - start}ms`));
|
|
1944
1950
|
});
|
|
1945
1951
|
}, "xyLintCommands");
|
|
1946
1952
|
|
|
@@ -2002,8 +2008,8 @@ var xyParseOptions = /* @__PURE__ */ __name(() => {
|
|
|
2002
2008
|
var xy = /* @__PURE__ */ __name(async () => {
|
|
2003
2009
|
const options = xyParseOptions();
|
|
2004
2010
|
return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
|
|
2005
|
-
console.error(
|
|
2006
|
-
console.log(
|
|
2011
|
+
console.error(chalk22.yellow(`Command not found [${chalk22.magenta(process.argv[2])}]`));
|
|
2012
|
+
console.log(chalk22.gray("Try 'yarn xy --help' for list of commands"));
|
|
2007
2013
|
}).version().help().argv;
|
|
2008
2014
|
}, "xy");
|
|
2009
2015
|
|