@xylabs/ts-scripts-yarn3 6.1.16 → 6.2.0

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/index.mjs CHANGED
@@ -377,7 +377,7 @@ var mergeEntries = /* @__PURE__ */ __name((a, b) => [
377
377
  ].sort(localeCompare), "mergeEntries");
378
378
  var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
379
379
  console.log(chalk4.green(`Generate ${filename3} Files`));
380
- const cwd5 = INIT_CWD() ?? ".";
380
+ const cwd4 = INIT_CWD() ?? ".";
381
381
  const workspaces = pkg ? [
382
382
  yarnWorkspace(pkg)
383
383
  ] : yarnWorkspaces();
@@ -385,7 +385,7 @@ var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
385
385
  const writeEntries = /* @__PURE__ */ __name((location, entries) => writeLines(`${location}/${filename3}`, entries), "writeEntries");
386
386
  const results = workspaces.map(({ location, name }) => {
387
387
  try {
388
- writeEntries(location, mergeEntries(readEntries(cwd5), readEntries(location)));
388
+ writeEntries(location, mergeEntries(readEntries(cwd4), readEntries(location)));
389
389
  return 0;
390
390
  } catch (ex) {
391
391
  const error = ex;
@@ -1013,86 +1013,19 @@ var deployNext = /* @__PURE__ */ __name(() => {
1013
1013
  ]);
1014
1014
  }, "deployNext");
1015
1015
 
1016
- // src/actions/deps.ts
1017
- import chalk14 from "chalk";
1018
- var deps = /* @__PURE__ */ __name(({ pkg, incremental }) => {
1019
- pkg ? depsPackage({
1020
- pkg
1021
- }) : depsAll({
1022
- incremental
1023
- });
1024
- return 0;
1025
- }, "deps");
1026
- var depsPackage = /* @__PURE__ */ __name(({ pkg }) => {
1027
- const steps = [
1028
- [
1029
- "yarn",
1030
- [
1031
- "workspace",
1032
- pkg,
1033
- "run",
1034
- "package-deps"
1035
- ]
1036
- ]
1037
- ];
1038
- return runSteps(`Deps [${pkg}]`, [
1039
- ...steps
1040
- ]);
1041
- }, "depsPackage");
1042
- var depsAll = /* @__PURE__ */ __name(({ incremental, jobs, verbose }) => {
1043
- const start = Date.now();
1044
- const jobsOptions = jobs ? [
1045
- "-j",
1046
- `${jobs}`
1047
- ] : [];
1048
- const verboseOptions = verbose ? [
1049
- "--verbose"
1050
- ] : [
1051
- "--no-verbose"
1052
- ];
1053
- if (jobs) {
1054
- console.log(chalk14.blue(`Jobs set to [${jobs}]`));
1055
- }
1056
- const incrementalOptions = incremental ? [
1057
- "--since",
1058
- "-pA"
1059
- ] : [
1060
- "-pA"
1061
- ];
1062
- const steps = [
1063
- [
1064
- "yarn",
1065
- [
1066
- "workspaces",
1067
- "foreach",
1068
- ...jobsOptions,
1069
- ...incrementalOptions,
1070
- ...verboseOptions,
1071
- "run",
1072
- "package-deps"
1073
- ]
1074
- ]
1075
- ];
1076
- const result = runSteps(`Deps${incremental ? "-Incremental" : ""} [All]`, [
1077
- ...steps
1078
- ]);
1079
- console.log(`${chalk14.gray("Dep checked in")} [${chalk14.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk14.gray("seconds")}`);
1080
- return result;
1081
- }, "depsAll");
1082
-
1083
1016
  // src/actions/dupdeps.ts
1084
- import chalk15 from "chalk";
1017
+ import chalk14 from "chalk";
1085
1018
  var dupdeps = /* @__PURE__ */ __name(() => {
1086
- console.log(chalk15.green("Checking all Dependencies for Duplicates"));
1019
+ console.log(chalk14.green("Checking all Dependencies for Duplicates"));
1087
1020
  const allDependencies = parsedPackageJSON()?.dependencies;
1088
1021
  const dependencies = Object.entries(allDependencies).map(([k]) => k);
1089
1022
  return detectDuplicateDependencies(dependencies);
1090
1023
  }, "dupdeps");
1091
1024
 
1092
1025
  // src/actions/lint.ts
1093
- import chalk16 from "chalk";
1026
+ import chalk15 from "chalk";
1094
1027
  var lintPackage = /* @__PURE__ */ __name(({ pkg, fix: fix2 }) => {
1095
- console.log(chalk16.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
1028
+ console.log(chalk15.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
1096
1029
  const start = Date.now();
1097
1030
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
1098
1031
  [
@@ -1105,7 +1038,7 @@ var lintPackage = /* @__PURE__ */ __name(({ pkg, fix: fix2 }) => {
1105
1038
  ]
1106
1039
  ]
1107
1040
  ]);
1108
- console.log(chalk16.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk16.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk16.gray("seconds")}`));
1041
+ console.log(chalk15.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk15.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk15.gray("seconds")}`));
1109
1042
  return result;
1110
1043
  }, "lintPackage");
1111
1044
  var lint = /* @__PURE__ */ __name(({ pkg, verbose, incremental, fix: fix2 } = {}) => {
@@ -1118,35 +1051,18 @@ var lint = /* @__PURE__ */ __name(({ pkg, verbose, incremental, fix: fix2 } = {}
1118
1051
  fix: fix2
1119
1052
  });
1120
1053
  }, "lint");
1121
- var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2, verbose = true, incremental } = {}) => {
1122
- console.log(chalk16.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
1054
+ var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2 = false } = {}) => {
1055
+ console.log(chalk15.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
1123
1056
  const start = Date.now();
1124
- const verboseOptions = verbose ? [
1125
- "--verbose"
1126
- ] : [
1127
- "--no-verbose"
1128
- ];
1129
- const incrementalOptions = incremental ? [
1130
- "--since",
1131
- "-Ap"
1132
- ] : [
1133
- "--parallel",
1134
- "-Ap"
1135
- ];
1136
1057
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
1137
1058
  [
1138
1059
  "yarn",
1139
1060
  [
1140
- "workspaces",
1141
- "foreach",
1142
- ...verboseOptions,
1143
- ...incrementalOptions,
1144
- "run",
1145
- fix2 ? "package-fix" : "package-lint"
1061
+ "eslint"
1146
1062
  ]
1147
1063
  ]
1148
1064
  ]);
1149
- console.log(chalk16.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk16.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk16.gray("seconds")}`));
1065
+ console.log(chalk15.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk15.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk15.gray("seconds")}`));
1150
1066
  return result;
1151
1067
  }, "lintAllPackages");
1152
1068
 
@@ -1211,7 +1127,7 @@ var filename = ".gitignore";
1211
1127
  var gitignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename, pkg), "gitignoreGen");
1212
1128
 
1213
1129
  // src/actions/gitlint.ts
1214
- import chalk17 from "chalk";
1130
+ import chalk16 from "chalk";
1215
1131
  import ParseGitConfig from "parse-git-config";
1216
1132
  var gitlint = /* @__PURE__ */ __name(() => {
1217
1133
  console.log(`
@@ -1222,7 +1138,7 @@ Gitlint Start [${process.cwd()}]
1222
1138
  const errors = 0;
1223
1139
  const gitConfig = ParseGitConfig.sync();
1224
1140
  const warn = /* @__PURE__ */ __name((message) => {
1225
- console.warn(chalk17.yellow(`Warning: ${message}`));
1141
+ console.warn(chalk16.yellow(`Warning: ${message}`));
1226
1142
  warnings++;
1227
1143
  }, "warn");
1228
1144
  if (gitConfig.core.ignorecase) {
@@ -1242,13 +1158,13 @@ Gitlint Start [${process.cwd()}]
1242
1158
  }
1243
1159
  const resultMessages = [];
1244
1160
  if (valid > 0) {
1245
- resultMessages.push(chalk17.green(`Passed: ${valid}`));
1161
+ resultMessages.push(chalk16.green(`Passed: ${valid}`));
1246
1162
  }
1247
1163
  if (warnings > 0) {
1248
- resultMessages.push(chalk17.yellow(`Warnings: ${warnings}`));
1164
+ resultMessages.push(chalk16.yellow(`Warnings: ${warnings}`));
1249
1165
  }
1250
1166
  if (errors > 0) {
1251
- resultMessages.push(chalk17.red(` Errors: ${errors}`));
1167
+ resultMessages.push(chalk16.red(` Errors: ${errors}`));
1252
1168
  }
1253
1169
  console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
1254
1170
  `);
@@ -1257,7 +1173,7 @@ Gitlint Start [${process.cwd()}]
1257
1173
 
1258
1174
  // src/actions/gitlint-fix.ts
1259
1175
  import { execSync as execSync2 } from "node:child_process";
1260
- import chalk18 from "chalk";
1176
+ import chalk17 from "chalk";
1261
1177
  import ParseGitConfig2 from "parse-git-config";
1262
1178
  var gitlintFix = /* @__PURE__ */ __name(() => {
1263
1179
  console.log(`
@@ -1268,19 +1184,19 @@ Gitlint Fix Start [${process.cwd()}]
1268
1184
  execSync2("git config core.ignorecase false", {
1269
1185
  stdio: "inherit"
1270
1186
  });
1271
- console.warn(chalk18.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
1187
+ console.warn(chalk17.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
1272
1188
  }
1273
1189
  if (gitConfig.core.autocrlf !== false) {
1274
1190
  execSync2("git config core.autocrlf false", {
1275
1191
  stdio: "inherit"
1276
1192
  });
1277
- console.warn(chalk18.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
1193
+ console.warn(chalk17.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
1278
1194
  }
1279
1195
  if (gitConfig.core.eol !== "lf") {
1280
1196
  execSync2("git config core.eol lf", {
1281
1197
  stdio: "inherit"
1282
1198
  });
1283
- console.warn(chalk18.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
1199
+ console.warn(chalk17.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
1284
1200
  }
1285
1201
  return 1;
1286
1202
  }, "gitlintFix");
@@ -1300,7 +1216,7 @@ var knip = /* @__PURE__ */ __name(() => {
1300
1216
  }, "knip");
1301
1217
 
1302
1218
  // src/actions/license.ts
1303
- import chalk19 from "chalk";
1219
+ import chalk18 from "chalk";
1304
1220
  import { init } from "license-checker";
1305
1221
  var license = /* @__PURE__ */ __name(async (pkg) => {
1306
1222
  const workspaces = yarnWorkspaces();
@@ -1325,7 +1241,7 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
1325
1241
  "LGPL-3.0-or-later",
1326
1242
  "Python-2.0"
1327
1243
  ]);
1328
- console.log(chalk19.green("License Checker"));
1244
+ console.log(chalk18.green("License Checker"));
1329
1245
  return (await Promise.all(workspaceList.map(({ location, name }) => {
1330
1246
  return new Promise((resolve) => {
1331
1247
  init({
@@ -1333,12 +1249,12 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
1333
1249
  start: location
1334
1250
  }, (error, packages) => {
1335
1251
  if (error) {
1336
- console.error(chalk19.red(`License Checker [${name}] Error`));
1337
- console.error(chalk19.gray(error));
1252
+ console.error(chalk18.red(`License Checker [${name}] Error`));
1253
+ console.error(chalk18.gray(error));
1338
1254
  console.log("\n");
1339
1255
  resolve(1);
1340
1256
  } else {
1341
- console.log(chalk19.green(`License Checker [${name}]`));
1257
+ console.log(chalk18.green(`License Checker [${name}]`));
1342
1258
  let count = 0;
1343
1259
  for (const [name2, info] of Object.entries(packages)) {
1344
1260
  const licenses = Array.isArray(info.licenses) ? info.licenses : [
@@ -1356,7 +1272,7 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
1356
1272
  }
1357
1273
  if (!orLicenseFound) {
1358
1274
  count++;
1359
- console.warn(chalk19.yellow(`${name2}: Package License not allowed [${license2}]`));
1275
+ console.warn(chalk18.yellow(`${name2}: Package License not allowed [${license2}]`));
1360
1276
  }
1361
1277
  }
1362
1278
  }
@@ -1375,7 +1291,7 @@ var npmignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename2
1375
1291
 
1376
1292
  // src/actions/package/clean-outputs.ts
1377
1293
  import path3 from "node:path";
1378
- import chalk20 from "chalk";
1294
+ import chalk19 from "chalk";
1379
1295
  var packageCleanOutputs = /* @__PURE__ */ __name(() => {
1380
1296
  const pkg = process.env.INIT_CWD ?? ".";
1381
1297
  const pkgName = process.env.npm_package_name;
@@ -1384,7 +1300,7 @@ var packageCleanOutputs = /* @__PURE__ */ __name(() => {
1384
1300
  path3.join(pkg, "build"),
1385
1301
  path3.join(pkg, "docs")
1386
1302
  ];
1387
- console.log(chalk20.green(`Cleaning Outputs [${pkgName}]`));
1303
+ console.log(chalk19.green(`Cleaning Outputs [${pkgName}]`));
1388
1304
  for (let folder of folders) {
1389
1305
  deleteGlob(folder);
1390
1306
  }
@@ -1393,11 +1309,11 @@ var packageCleanOutputs = /* @__PURE__ */ __name(() => {
1393
1309
 
1394
1310
  // src/actions/package/clean-typescript.ts
1395
1311
  import path4 from "node:path";
1396
- import chalk21 from "chalk";
1312
+ import chalk20 from "chalk";
1397
1313
  var packageCleanTypescript = /* @__PURE__ */ __name(() => {
1398
1314
  const pkg = process.env.INIT_CWD ?? ".";
1399
1315
  const pkgName = process.env.npm_package_name;
1400
- console.log(chalk21.green(`Cleaning Typescript [${pkgName}]`));
1316
+ console.log(chalk20.green(`Cleaning Typescript [${pkgName}]`));
1401
1317
  const files = [
1402
1318
  path4.join(pkg, "*.tsbuildinfo"),
1403
1319
  path4.join(pkg, ".tsconfig.*"),
@@ -1418,19 +1334,19 @@ var packageClean = /* @__PURE__ */ __name(async () => {
1418
1334
  }, "packageClean");
1419
1335
 
1420
1336
  // src/actions/package/compile/compile.ts
1421
- import chalk25 from "chalk";
1337
+ import chalk24 from "chalk";
1422
1338
 
1423
1339
  // src/actions/package/publint.ts
1424
1340
  import { promises as fs2 } from "node:fs";
1425
- import chalk22 from "chalk";
1341
+ import chalk21 from "chalk";
1426
1342
  import sortPackageJson from "sort-package-json";
1427
1343
  var packagePublint = /* @__PURE__ */ __name(async (params) => {
1428
1344
  const pkgDir = process.env.INIT_CWD;
1429
1345
  const sortedPkg = sortPackageJson(await fs2.readFile(`${pkgDir}/package.json`, "utf8"));
1430
1346
  await fs2.writeFile(`${pkgDir}/package.json`, sortedPkg);
1431
1347
  const pkg = JSON.parse(await fs2.readFile(`${pkgDir}/package.json`, "utf8"));
1432
- console.log(chalk22.green(`Publint: ${pkg.name}`));
1433
- console.log(chalk22.gray(pkgDir));
1348
+ console.log(chalk21.green(`Publint: ${pkg.name}`));
1349
+ console.log(chalk21.gray(pkgDir));
1434
1350
  const { publint: publint2 } = await import("publint");
1435
1351
  const { messages } = await publint2({
1436
1352
  level: "suggestion",
@@ -1445,21 +1361,21 @@ var packagePublint = /* @__PURE__ */ __name(async (params) => {
1445
1361
  for (const message of validMessages) {
1446
1362
  switch (message.type) {
1447
1363
  case "error": {
1448
- console.error(chalk22.red(`[${message.code}] ${formatMessage(message, pkg)}`));
1364
+ console.error(chalk21.red(`[${message.code}] ${formatMessage(message, pkg)}`));
1449
1365
  break;
1450
1366
  }
1451
1367
  case "warning": {
1452
- console.warn(chalk22.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
1368
+ console.warn(chalk21.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
1453
1369
  break;
1454
1370
  }
1455
1371
  default: {
1456
- console.log(chalk22.white(`[${message.code}] ${formatMessage(message, pkg)}`));
1372
+ console.log(chalk21.white(`[${message.code}] ${formatMessage(message, pkg)}`));
1457
1373
  break;
1458
1374
  }
1459
1375
  }
1460
1376
  }
1461
1377
  if (params?.verbose) {
1462
- console.log(chalk22.gray(`Publint [Finish]: ${pkgDir} [${validMessages.length}]`));
1378
+ console.log(chalk21.gray(`Publint [Finish]: ${pkgDir} [${validMessages.length}]`));
1463
1379
  }
1464
1380
  return validMessages.filter((message) => message.type === "error").length;
1465
1381
  }, "packagePublint");
@@ -1503,7 +1419,7 @@ var buildEntries = /* @__PURE__ */ __name((folder, entryMode = "single", exclude
1503
1419
 
1504
1420
  // src/actions/package/compile/packageCompileTscTypes.ts
1505
1421
  import { cwd } from "node:process";
1506
- import chalk23 from "chalk";
1422
+ import chalk22 from "chalk";
1507
1423
  import { createProgramFromConfig } from "tsc-prog";
1508
1424
  import { DiagnosticCategory, formatDiagnosticsWithColorAndContext, getPreEmitDiagnostics, sys as sys2 } from "typescript";
1509
1425
 
@@ -1560,7 +1476,7 @@ var packageCompileTscTypes = /* @__PURE__ */ __name((folder = "src", config2 = {
1560
1476
  ".spec."
1561
1477
  ];
1562
1478
  const files = buildEntries(folder, "all", verbose).filter((file) => validTsExt.find((ext) => file.endsWith(ext)) && !excludes.some((exclude) => file.includes(exclude)));
1563
- console.log(chalk23.green(`Compiling Types ${pkg}: ${files.length}`));
1479
+ console.log(chalk22.green(`Compiling Types ${pkg}: ${files.length}`));
1564
1480
  if (files.length > 0) {
1565
1481
  const program = createProgramFromConfig({
1566
1482
  basePath: pkg ?? cwd(),
@@ -1623,7 +1539,7 @@ __name(deepMergeObjects, "deepMergeObjects");
1623
1539
 
1624
1540
  // src/actions/package/compile/packageCompileTsc.ts
1625
1541
  import { cwd as cwd2 } from "node:process";
1626
- import chalk24 from "chalk";
1542
+ import chalk23 from "chalk";
1627
1543
  import { createProgramFromConfig as createProgramFromConfig2 } from "tsc-prog";
1628
1544
  import { DiagnosticCategory as DiagnosticCategory2, formatDiagnosticsWithColorAndContext as formatDiagnosticsWithColorAndContext2, getPreEmitDiagnostics as getPreEmitDiagnostics2, sys as sys3 } from "typescript";
1629
1545
  var packageCompileTsc = /* @__PURE__ */ __name((folder = "src", config2 = {}, compilerOptionsParam) => {
@@ -1658,7 +1574,7 @@ var packageCompileTsc = /* @__PURE__ */ __name((folder = "src", config2 = {}, co
1658
1574
  ".d.mts"
1659
1575
  ];
1660
1576
  const files = buildEntries(folder, "all", verbose).filter((file) => validTsExt.find((ext) => file.endsWith(ext)) && includes.find((include) => file.includes(include)));
1661
- console.log(chalk24.green(`Compiling Files ${pkg}: ${files.length}`));
1577
+ console.log(chalk23.green(`Compiling Files ${pkg}: ${files.length}`));
1662
1578
  if (files.length > 0) {
1663
1579
  const program = createProgramFromConfig2({
1664
1580
  basePath: pkg ?? cwd2(),
@@ -1818,7 +1734,7 @@ var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
1818
1734
  // src/actions/package/compile/compile.ts
1819
1735
  var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
1820
1736
  const pkg = process.env.INIT_CWD;
1821
- console.log(chalk25.green(`Compiling ${pkg}`));
1737
+ console.log(chalk24.green(`Compiling ${pkg}`));
1822
1738
  const config2 = await loadConfig(inConfig);
1823
1739
  const publint2 = config2.publint;
1824
1740
  const tsupResults = await packageCompileTsup(config2);
@@ -1830,7 +1746,7 @@ var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
1830
1746
 
1831
1747
  // src/actions/package/copy-assets.ts
1832
1748
  import path5 from "node:path/posix";
1833
- import chalk26 from "chalk";
1749
+ import chalk25 from "chalk";
1834
1750
  import cpy2 from "cpy";
1835
1751
  var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) => {
1836
1752
  try {
@@ -1849,7 +1765,7 @@ var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) =>
1849
1765
  flat: false
1850
1766
  });
1851
1767
  if (values.length > 0) {
1852
- console.log(chalk26.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
1768
+ console.log(chalk25.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
1853
1769
  }
1854
1770
  for (const value of values) {
1855
1771
  console.log(`${value.split("/").pop()} => ./dist/${target}`);
@@ -1877,169 +1793,10 @@ var packageCopyAssets = /* @__PURE__ */ __name(async ({ target }) => {
1877
1793
  }
1878
1794
  }, "packageCopyAssets");
1879
1795
 
1880
- // src/actions/package/deps.ts
1881
- import { existsSync as existsSync5, readFileSync as readFileSync5 } from "node:fs";
1882
- import { cwd as cwd3 } from "node:process";
1883
- import chalk27 from "chalk";
1884
- import depcheck from "depcheck";
1885
- var special = depcheck.special;
1886
- var defaultIgnorePatterns = [
1887
- "*.d.ts",
1888
- "dist",
1889
- ".*",
1890
- "node_modules"
1891
- ];
1892
- var defaultIgnoreDevDeps = [
1893
- "@xylabs/ts-scripts-yarn3",
1894
- "@xylabs/tsconfig",
1895
- "@xylabs/tsconfig-dom",
1896
- "@xylabs/tsconfig-react",
1897
- "typescript"
1898
- ];
1899
- var defaultIgnoreDevPatterns = [
1900
- "*.stories.*",
1901
- "*.spec.*",
1902
- "spec",
1903
- "stories",
1904
- "tsconfig.json"
1905
- ];
1906
- var reportUnused = /* @__PURE__ */ __name((name, unused) => {
1907
- if (unused.length > 0) {
1908
- const message = [
1909
- chalk27.yellow(`${unused.length} Unused ${name}`)
1910
- ];
1911
- for (const value of unused) message.push(chalk27.gray(` ${value}`));
1912
- console.log(message.join("\n"));
1913
- }
1914
- }, "reportUnused");
1915
- var reportMissing = /* @__PURE__ */ __name((name, missing) => {
1916
- if (Object.keys(missing).length > 0) {
1917
- const message = [
1918
- chalk27.yellow(`${Object.entries(missing).length} Missing ${name}`)
1919
- ];
1920
- for (const [key, value] of Object.entries(missing)) {
1921
- message.push(`${key}`, chalk27.gray(` ${value.at(0)}`));
1922
- }
1923
- console.log(chalk27.yellow(message.join("\n")));
1924
- }
1925
- }, "reportMissing");
1926
- var analyzeDeps = /* @__PURE__ */ __name(async (pkg, ignoreMatches) => {
1927
- const packageContent = existsSync5(`${pkg}/package.json`) ? JSON.parse(readFileSync5(`${pkg}/package.json`, {
1928
- encoding: "utf8"
1929
- })) : void 0;
1930
- const [srcUnused, allUnused] = await Promise.all([
1931
- depcheck(`${pkg}/src`, {
1932
- ignoreMatches,
1933
- ignorePatterns: [
1934
- ...defaultIgnoreDevPatterns,
1935
- ...defaultIgnorePatterns
1936
- ],
1937
- package: packageContent
1938
- }),
1939
- depcheck(`${pkg}/.`, {
1940
- ignoreMatches: [
1941
- ...ignoreMatches,
1942
- ...defaultIgnoreDevDeps
1943
- ],
1944
- ignorePatterns: [
1945
- ...defaultIgnorePatterns
1946
- ],
1947
- package: packageContent,
1948
- specials: [
1949
- special.eslint,
1950
- special.babel,
1951
- special.bin,
1952
- special.prettier,
1953
- special.jest,
1954
- special.mocha
1955
- ]
1956
- })
1957
- ]);
1958
- const unusedDeps = srcUnused.dependencies;
1959
- const unusedDevDeps = allUnused.devDependencies;
1960
- const usedDeps = srcUnused.using;
1961
- const usedDevDeps = allUnused.using;
1962
- const missing = {
1963
- ...srcUnused.missing,
1964
- ...allUnused.missing
1965
- };
1966
- const { invalidDirs, invalidFiles } = allUnused;
1967
- return {
1968
- invalidDirs,
1969
- invalidFiles,
1970
- missing,
1971
- unusedDeps,
1972
- unusedDevDeps,
1973
- usedDeps,
1974
- usedDevDeps
1975
- };
1976
- }, "analyzeDeps");
1977
- var packageDeps = /* @__PURE__ */ __name(async () => {
1978
- const pkg = process.env.INIT_CWD ?? cwd3();
1979
- const pkgName = process.env.npm_package_name;
1980
- const packageContent = existsSync5(`${pkg}/package.json`) ? JSON.parse(readFileSync5(`${pkg}/package.json`, {
1981
- encoding: "utf8"
1982
- })) : void 0;
1983
- const rawIgnore = existsSync5(`${pkg}/.depcheckrc`) ? readFileSync5(`${pkg}/.depcheckrc`, {
1984
- encoding: "utf8"
1985
- }).replace("ignores:", '"ignores":') : void 0;
1986
- let ignoreMatches = [];
1987
- try {
1988
- ignoreMatches = rawIgnore ? JSON.parse(`{${rawIgnore}}`).ignores : [];
1989
- } catch (ex) {
1990
- const error = ex;
1991
- console.log(`${pkgName} [${error.message}] Failed to parse .depcheckrc [${rawIgnore}]`);
1992
- }
1993
- const { invalidDirs, invalidFiles, unusedDeps, unusedDevDeps, usedDeps, usedDevDeps, missing } = await analyzeDeps(pkg, ignoreMatches);
1994
- const declaredDeps = Object.keys(packageContent.dependencies ?? {});
1995
- const declaredPeerDeps = Object.keys(packageContent.peerDependencies ?? {});
1996
- const declaredDevDeps = Object.keys(packageContent.devDependencies ?? {});
1997
- const missingDeps = Object.keys(usedDeps).filter((key) => !declaredDeps.includes(key) && !declaredPeerDeps.includes(key) && !key.startsWith("@types/"));
1998
- const missingDevDeps = Object.keys(usedDevDeps).filter((key) => !declaredDevDeps.includes(key) && !declaredDeps.includes(key));
1999
- const missingDepsObject = {};
2000
- for (const key of missingDeps) {
2001
- missingDepsObject[key] = missing[key] ?? [
2002
- `devDep should be dep [${key}]`
2003
- ];
2004
- }
2005
- const missingDevDepsObject = {};
2006
- for (const key of missingDevDeps) {
2007
- if (missing[key]) {
2008
- missingDevDepsObject[key] = missing[key];
2009
- }
2010
- }
2011
- const errorCounts = [
2012
- unusedDeps.length,
2013
- unusedDevDeps.length,
2014
- Object.entries(invalidDirs).length,
2015
- Object.entries(invalidFiles).length,
2016
- Object.entries(missingDepsObject).length,
2017
- Object.entries(missingDevDepsObject).length
2018
- ];
2019
- const errorCount = errorCounts.reduce((prev, count) => prev + count, 0);
2020
- if (errorCount > 0) {
2021
- console.log(`Deps [${pkgName}] = (${JSON.stringify(errorCounts)})`);
2022
- } else {
2023
- console.log(`Deps [${pkgName}] - Ok`);
2024
- }
2025
- reportUnused("dependencies", unusedDeps);
2026
- reportUnused("devDependencies", unusedDevDeps);
2027
- if (Object.entries(invalidDirs).length > 0) {
2028
- for (const [key, value] of Object.entries(invalidDirs)) console.warn(chalk27.gray(`Invalid Dir: ${key}: ${value}`));
2029
- }
2030
- if (Object.entries(invalidFiles).length > 0) {
2031
- for (const [key, value] of Object.entries(invalidFiles)) console.warn(chalk27.gray(`Invalid File: ${key}: ${value}`));
2032
- }
2033
- reportMissing("dependencies", missingDepsObject);
2034
- reportMissing("devDependencies", missingDevDepsObject);
2035
- checkResult(`Deps [${pkgName}]`, errorCount, "warn", false);
2036
- return 0;
2037
- }, "packageDeps");
2038
-
2039
1796
  // src/actions/package/gen-docs.ts
2040
- import { existsSync as existsSync6 } from "node:fs";
1797
+ import { existsSync as existsSync5 } from "node:fs";
2041
1798
  import path6 from "node:path";
2042
- import chalk28 from "chalk";
1799
+ import chalk26 from "chalk";
2043
1800
  import { Application, ArgumentsReader, TSConfigReader, TypeDocReader } from "typedoc";
2044
1801
  var ExitCodes = {
2045
1802
  CompileError: 3,
@@ -2052,7 +1809,7 @@ var ExitCodes = {
2052
1809
  };
2053
1810
  var packageGenDocs = /* @__PURE__ */ __name(async () => {
2054
1811
  const pkg = process.env.INIT_CWD;
2055
- if (pkg && !existsSync6(path6.join(pkg, "typedoc.json"))) {
1812
+ if (pkg && !existsSync5(path6.join(pkg, "typedoc.json"))) {
2056
1813
  return;
2057
1814
  }
2058
1815
  const app = await Application.bootstrap({
@@ -2141,16 +1898,16 @@ var runTypeDoc = /* @__PURE__ */ __name(async (app) => {
2141
1898
  return ExitCodes.OutputError;
2142
1899
  }
2143
1900
  }
2144
- console.log(chalk28.green(`${pkgName} - Ok`));
1901
+ console.log(chalk26.green(`${pkgName} - Ok`));
2145
1902
  return ExitCodes.Ok;
2146
1903
  }, "runTypeDoc");
2147
1904
 
2148
1905
  // src/actions/package/lint.ts
2149
1906
  import { readdirSync } from "node:fs";
2150
1907
  import path7 from "node:path";
2151
- import { cwd as cwd4 } from "node:process";
1908
+ import { cwd as cwd3 } from "node:process";
2152
1909
  import { pathToFileURL } from "node:url";
2153
- import chalk29 from "chalk";
1910
+ import chalk27 from "chalk";
2154
1911
  import { ESLint as ESLint2 } from "eslint";
2155
1912
  import { findUp } from "find-up";
2156
1913
  import picomatch from "picomatch";
@@ -2167,10 +1924,10 @@ var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
2167
1924
  ];
2168
1925
  for (const lintResult of lintResults) {
2169
1926
  if (lintResult.messages.length > 0) {
2170
- console.log(chalk29.gray(`
1927
+ console.log(chalk27.gray(`
2171
1928
  ${lintResult.filePath}`));
2172
1929
  for (const message of lintResult.messages) {
2173
- console.log(chalk29.gray(` ${message.line}:${message.column}`), chalk29[colors[message.severity]](` ${severity[message.severity]}`), chalk29.white(` ${message.message}`), chalk29.gray(` ${message.ruleId}`));
1930
+ console.log(chalk27.gray(` ${message.line}:${message.column}`), chalk27[colors[message.severity]](` ${severity[message.severity]}`), chalk27.white(` ${message.message}`), chalk27.gray(` ${message.ruleId}`));
2174
1931
  }
2175
1932
  }
2176
1933
  }
@@ -2184,7 +1941,7 @@ async function getRootESLintConfig() {
2184
1941
  }
2185
1942
  __name(getRootESLintConfig, "getRootESLintConfig");
2186
1943
  function getFiles(dir, ignoreFolders) {
2187
- const currentDirectory = cwd4();
1944
+ const currentDirectory = cwd3();
2188
1945
  const subDirectory = dir.split(currentDirectory)[1];
2189
1946
  if (ignoreFolders.includes(subDirectory)) return [];
2190
1947
  return readdirSync(dir, {
@@ -2223,9 +1980,9 @@ var packageLint = /* @__PURE__ */ __name(async (fix2 = false, verbose = false, c
2223
1980
  warnIgnored: false,
2224
1981
  cache
2225
1982
  });
2226
- const files = getFiles(cwd4(), ignoreFolders);
1983
+ const files = getFiles(cwd3(), ignoreFolders);
2227
1984
  if (verbose) {
2228
- console.log(chalk29.green(`Linting ${pkg} [files = ${files.length}]`));
1985
+ console.log(chalk27.green(`Linting ${pkg} [files = ${files.length}]`));
2229
1986
  }
2230
1987
  const lintResults = await engine.lintFiles(files);
2231
1988
  dumpMessages(lintResults);
@@ -2235,7 +1992,7 @@ var packageLint = /* @__PURE__ */ __name(async (fix2 = false, verbose = false, c
2235
1992
  const filesCountColor = files.length < 100 ? "green" : files.length < 1e3 ? "yellow" : "red";
2236
1993
  const lintTime = Date.now() - start;
2237
1994
  const lintTimeColor = lintTime < 1e3 ? "green" : lintTime < 3e3 ? "yellow" : "red";
2238
- console.log(chalk29.white(`Linted ${chalk29[filesCountColor](files.length)} files in ${chalk29[lintTimeColor](lintTime)}ms`));
1995
+ console.log(chalk27.white(`Linted ${chalk27[filesCountColor](files.length)} files in ${chalk27[lintTimeColor](lintTime)}ms`));
2239
1996
  return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
2240
1997
  }, "packageLint");
2241
1998
 
@@ -2302,7 +2059,7 @@ var rebuild = /* @__PURE__ */ __name(({ target }) => {
2302
2059
  }, "rebuild");
2303
2060
 
2304
2061
  // src/actions/recompile.ts
2305
- import chalk30 from "chalk";
2062
+ import chalk28 from "chalk";
2306
2063
  var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incremental }) => {
2307
2064
  return pkg ? await recompilePackage({
2308
2065
  pkg,
@@ -2357,7 +2114,7 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
2357
2114
  `${jobs}`
2358
2115
  ] : [];
2359
2116
  if (jobs) {
2360
- console.log(chalk30.blue(`Jobs set to [${jobs}]`));
2117
+ console.log(chalk28.blue(`Jobs set to [${jobs}]`));
2361
2118
  }
2362
2119
  const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
2363
2120
  [
@@ -2387,7 +2144,7 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
2387
2144
  ]
2388
2145
  ]
2389
2146
  ]);
2390
- console.log(`${chalk30.gray("Recompiled in")} [${chalk30.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk30.gray("seconds")}`);
2147
+ console.log(`${chalk28.gray("Recompiled in")} [${chalk28.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk28.gray("seconds")}`);
2391
2148
  return result;
2392
2149
  }, "recompileAll");
2393
2150
 
@@ -2421,9 +2178,9 @@ var reinstall = /* @__PURE__ */ __name(() => {
2421
2178
  }, "reinstall");
2422
2179
 
2423
2180
  // src/actions/relint.ts
2424
- import chalk31 from "chalk";
2181
+ import chalk29 from "chalk";
2425
2182
  var relintPackage = /* @__PURE__ */ __name(({ pkg }) => {
2426
- console.log(chalk31.gray(`${"Relint"} [All-Packages]`));
2183
+ console.log(chalk29.gray(`${"Relint"} [All-Packages]`));
2427
2184
  const start = Date.now();
2428
2185
  const result = runSteps("Relint [All-Packages]", [
2429
2186
  [
@@ -2436,7 +2193,7 @@ var relintPackage = /* @__PURE__ */ __name(({ pkg }) => {
2436
2193
  ]
2437
2194
  ]
2438
2195
  ]);
2439
- console.log(chalk31.gray(`${"Relinted in"} [${chalk31.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk31.gray("seconds")}`));
2196
+ console.log(chalk29.gray(`${"Relinted in"} [${chalk29.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk29.gray("seconds")}`));
2440
2197
  return result;
2441
2198
  }, "relintPackage");
2442
2199
  var relint = /* @__PURE__ */ __name(({ pkg, verbose, incremental } = {}) => {
@@ -2448,7 +2205,7 @@ var relint = /* @__PURE__ */ __name(({ pkg, verbose, incremental } = {}) => {
2448
2205
  });
2449
2206
  }, "relint");
2450
2207
  var relintAllPackages = /* @__PURE__ */ __name(({ verbose = true, incremental } = {}) => {
2451
- console.log(chalk31.gray(`${"Relint"} [All-Packages]`));
2208
+ console.log(chalk29.gray(`${"Relint"} [All-Packages]`));
2452
2209
  const start = Date.now();
2453
2210
  const verboseOptions = verbose ? [
2454
2211
  "--verbose"
@@ -2475,7 +2232,7 @@ var relintAllPackages = /* @__PURE__ */ __name(({ verbose = true, incremental }
2475
2232
  ]
2476
2233
  ]
2477
2234
  ]);
2478
- console.log(chalk31.gray(`Relinted in [${chalk31.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk31.gray("seconds")}`));
2235
+ console.log(chalk29.gray(`Relinted in [${chalk29.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk29.gray("seconds")}`));
2479
2236
  return result;
2480
2237
  }, "relintAllPackages");
2481
2238
 
@@ -2515,7 +2272,7 @@ var sonar = /* @__PURE__ */ __name(() => {
2515
2272
  }, "sonar");
2516
2273
 
2517
2274
  // src/actions/statics.ts
2518
- import chalk32 from "chalk";
2275
+ import chalk30 from "chalk";
2519
2276
  var DefaultDependencies = [
2520
2277
  "axios",
2521
2278
  "@xylabs/pixel",
@@ -2526,7 +2283,7 @@ var DefaultDependencies = [
2526
2283
  "@mui/system"
2527
2284
  ];
2528
2285
  var statics = /* @__PURE__ */ __name(() => {
2529
- console.log(chalk32.green("Check Required Static Dependencies"));
2286
+ console.log(chalk30.green("Check Required Static Dependencies"));
2530
2287
  const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
2531
2288
  return detectDuplicateDependencies(statics2, DefaultDependencies);
2532
2289
  }, "statics");
@@ -2644,7 +2401,7 @@ var loadPackageConfig = /* @__PURE__ */ __name(async () => {
2644
2401
  }, "loadPackageConfig");
2645
2402
 
2646
2403
  // src/xy/xy.ts
2647
- import chalk34 from "chalk";
2404
+ import chalk32 from "chalk";
2648
2405
 
2649
2406
  // src/xy/xyBuildCommands.ts
2650
2407
  var xyBuildCommands = /* @__PURE__ */ __name((args) => {
@@ -2763,15 +2520,6 @@ var xyCommonCommands = /* @__PURE__ */ __name((args) => {
2763
2520
  }, (argv) => {
2764
2521
  if (argv.verbose) console.log("Dead");
2765
2522
  process.exitCode = dead();
2766
- }).command("deps [package]", "Deps - Check for unused or missing dependencies", (yargs2) => {
2767
- return packagePositionalParam(yargs2);
2768
- }, (argv) => {
2769
- if (argv.verbose) console.log(`Checking Dependencies: ${argv.package ?? "all"}`);
2770
- process.exitCode = deps({
2771
- incremental: !!argv.incremental,
2772
- jobs: argv.jobs,
2773
- pkg: argv.package
2774
- });
2775
2523
  }).command("gen-docs [package]", "GenDocs - Generate TypeDocs", (yargs2) => {
2776
2524
  return packagePositionalParam(yargs2);
2777
2525
  }, (argv) => {
@@ -2894,7 +2642,7 @@ var xyInstallCommands = /* @__PURE__ */ __name((args) => {
2894
2642
  }, "xyInstallCommands");
2895
2643
 
2896
2644
  // src/xy/xyLintCommands.ts
2897
- import chalk33 from "chalk";
2645
+ import chalk31 from "chalk";
2898
2646
  var xyLintCommands = /* @__PURE__ */ __name((args) => {
2899
2647
  return args.command("cycle [package]", "Cycle - Check for dependency cycles", (yargs2) => {
2900
2648
  return packagePositionalParam(yargs2);
@@ -2902,7 +2650,7 @@ var xyLintCommands = /* @__PURE__ */ __name((args) => {
2902
2650
  const start = Date.now();
2903
2651
  if (argv.verbose) console.log("Cycle");
2904
2652
  process.exitCode = await cycle();
2905
- console.log(chalk33.blue(`Finished in ${Date.now() - start}ms`));
2653
+ console.log(chalk31.blue(`Finished in ${Date.now() - start}ms`));
2906
2654
  }).command("lint [package]", "Lint - Run Eslint", (yargs2) => {
2907
2655
  return packagePositionalParam(yargs2);
2908
2656
  }, (argv) => {
@@ -2913,21 +2661,21 @@ var xyLintCommands = /* @__PURE__ */ __name((args) => {
2913
2661
  }) : lint({
2914
2662
  pkg: argv.package
2915
2663
  });
2916
- console.log(chalk33.blue(`Finished in ${Date.now() - start}ms`));
2664
+ console.log(chalk31.blue(`Finished in ${Date.now() - start}ms`));
2917
2665
  }).command("fix [package]", "Fix - Run Eslint w/fix", (yargs2) => {
2918
2666
  return packagePositionalParam(yargs2);
2919
2667
  }, (argv) => {
2920
2668
  const start = Date.now();
2921
2669
  if (argv.verbose) console.log("Fix");
2922
2670
  process.exitCode = fix();
2923
- console.log(chalk33.blue(`Finished in ${Date.now() - start}ms`));
2671
+ console.log(chalk31.blue(`Finished in ${Date.now() - start}ms`));
2924
2672
  }).command("relint [package]", "Relint - Clean & Lint", (yargs2) => {
2925
2673
  return packagePositionalParam(yargs2);
2926
2674
  }, (argv) => {
2927
2675
  if (argv.verbose) console.log("Relinting");
2928
2676
  const start = Date.now();
2929
2677
  process.exitCode = relint();
2930
- console.log(chalk33.blue(`Finished in ${Date.now() - start}ms`));
2678
+ console.log(chalk31.blue(`Finished in ${Date.now() - start}ms`));
2931
2679
  }).command("publint [package]", "Publint - Run Publint", (yargs2) => {
2932
2680
  return packagePositionalParam(yargs2);
2933
2681
  }, async (argv) => {
@@ -2937,21 +2685,21 @@ var xyLintCommands = /* @__PURE__ */ __name((args) => {
2937
2685
  pkg: argv.package,
2938
2686
  verbose: !!argv.verbose
2939
2687
  });
2940
- console.log(chalk33.blue(`Finished in ${Date.now() - start}ms`));
2688
+ console.log(chalk31.blue(`Finished in ${Date.now() - start}ms`));
2941
2689
  }).command("knip", "Knip - Run Knip", (yargs2) => {
2942
2690
  return packagePositionalParam(yargs2);
2943
2691
  }, (argv) => {
2944
2692
  if (argv.verbose) console.log("Knip");
2945
2693
  const start = Date.now();
2946
2694
  process.exitCode = knip();
2947
- console.log(chalk33.blue(`Knip finished in ${Date.now() - start}ms`));
2695
+ console.log(chalk31.blue(`Knip finished in ${Date.now() - start}ms`));
2948
2696
  }).command("sonar", "Sonar - Run Sonar Check", (yargs2) => {
2949
2697
  return packagePositionalParam(yargs2);
2950
2698
  }, (argv) => {
2951
2699
  const start = Date.now();
2952
2700
  if (argv.verbose) console.log("Sonar Check");
2953
2701
  process.exitCode = sonar();
2954
- console.log(chalk33.blue(`Finished in ${Date.now() - start}ms`));
2702
+ console.log(chalk31.blue(`Finished in ${Date.now() - start}ms`));
2955
2703
  });
2956
2704
  }, "xyLintCommands");
2957
2705
 
@@ -3013,8 +2761,8 @@ var xyParseOptions = /* @__PURE__ */ __name(() => {
3013
2761
  var xy = /* @__PURE__ */ __name(async () => {
3014
2762
  const options = xyParseOptions();
3015
2763
  return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
3016
- console.error(chalk34.yellow(`Command not found [${chalk34.magenta(process.argv[2])}]`));
3017
- console.log(chalk34.gray("Try 'yarn xy --help' for list of commands"));
2764
+ console.error(chalk32.yellow(`Command not found [${chalk32.magenta(process.argv[2])}]`));
2765
+ console.log(chalk32.gray("Try 'yarn xy --help' for list of commands"));
3018
2766
  }).version().help().argv;
3019
2767
  }, "xy");
3020
2768
  export {
@@ -3045,9 +2793,6 @@ export {
3045
2793
  deployMajor,
3046
2794
  deployMinor,
3047
2795
  deployNext,
3048
- deps,
3049
- depsAll,
3050
- depsPackage,
3051
2796
  detectDuplicateDependencies,
3052
2797
  dupdeps,
3053
2798
  empty,
@@ -3079,7 +2824,6 @@ export {
3079
2824
  packageCompileTsup,
3080
2825
  packageCompileTypes,
3081
2826
  packageCopyAssets,
3082
- packageDeps,
3083
2827
  packageGenDocs,
3084
2828
  packageLint,
3085
2829
  packagePublint,