@xylabs/ts-scripts-yarn3 6.1.16 → 6.2.1

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.
@@ -307,7 +307,7 @@ var mergeEntries = /* @__PURE__ */ __name((a, b) => [
307
307
  ].sort(localeCompare), "mergeEntries");
308
308
  var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
309
309
  console.log(chalk4.green(`Generate ${filename3} Files`));
310
- const cwd5 = INIT_CWD() ?? ".";
310
+ const cwd4 = INIT_CWD() ?? ".";
311
311
  const workspaces = pkg ? [
312
312
  yarnWorkspace(pkg)
313
313
  ] : yarnWorkspaces();
@@ -315,7 +315,7 @@ var generateIgnoreFiles = /* @__PURE__ */ __name((filename3, pkg) => {
315
315
  const writeEntries = /* @__PURE__ */ __name((location, entries) => writeLines(`${location}/${filename3}`, entries), "writeEntries");
316
316
  const results = workspaces.map(({ location, name }) => {
317
317
  try {
318
- writeEntries(location, mergeEntries(readEntries(cwd5), readEntries(location)));
318
+ writeEntries(location, mergeEntries(readEntries(cwd4), readEntries(location)));
319
319
  return 0;
320
320
  } catch (ex) {
321
321
  const error = ex;
@@ -919,86 +919,19 @@ var deployNext = /* @__PURE__ */ __name(() => {
919
919
  ]);
920
920
  }, "deployNext");
921
921
 
922
- // src/actions/deps.ts
923
- import chalk13 from "chalk";
924
- var deps = /* @__PURE__ */ __name(({ pkg, incremental }) => {
925
- pkg ? depsPackage({
926
- pkg
927
- }) : depsAll({
928
- incremental
929
- });
930
- return 0;
931
- }, "deps");
932
- var depsPackage = /* @__PURE__ */ __name(({ pkg }) => {
933
- const steps = [
934
- [
935
- "yarn",
936
- [
937
- "workspace",
938
- pkg,
939
- "run",
940
- "package-deps"
941
- ]
942
- ]
943
- ];
944
- return runSteps(`Deps [${pkg}]`, [
945
- ...steps
946
- ]);
947
- }, "depsPackage");
948
- var depsAll = /* @__PURE__ */ __name(({ incremental, jobs, verbose }) => {
949
- const start = Date.now();
950
- const jobsOptions = jobs ? [
951
- "-j",
952
- `${jobs}`
953
- ] : [];
954
- const verboseOptions = verbose ? [
955
- "--verbose"
956
- ] : [
957
- "--no-verbose"
958
- ];
959
- if (jobs) {
960
- console.log(chalk13.blue(`Jobs set to [${jobs}]`));
961
- }
962
- const incrementalOptions = incremental ? [
963
- "--since",
964
- "-pA"
965
- ] : [
966
- "-pA"
967
- ];
968
- const steps = [
969
- [
970
- "yarn",
971
- [
972
- "workspaces",
973
- "foreach",
974
- ...jobsOptions,
975
- ...incrementalOptions,
976
- ...verboseOptions,
977
- "run",
978
- "package-deps"
979
- ]
980
- ]
981
- ];
982
- const result = runSteps(`Deps${incremental ? "-Incremental" : ""} [All]`, [
983
- ...steps
984
- ]);
985
- console.log(`${chalk13.gray("Dep checked in")} [${chalk13.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk13.gray("seconds")}`);
986
- return result;
987
- }, "depsAll");
988
-
989
922
  // src/actions/dupdeps.ts
990
- import chalk14 from "chalk";
923
+ import chalk13 from "chalk";
991
924
  var dupdeps = /* @__PURE__ */ __name(() => {
992
- console.log(chalk14.green("Checking all Dependencies for Duplicates"));
925
+ console.log(chalk13.green("Checking all Dependencies for Duplicates"));
993
926
  const allDependencies = parsedPackageJSON()?.dependencies;
994
927
  const dependencies = Object.entries(allDependencies).map(([k]) => k);
995
928
  return detectDuplicateDependencies(dependencies);
996
929
  }, "dupdeps");
997
930
 
998
931
  // src/actions/lint.ts
999
- import chalk15 from "chalk";
932
+ import chalk14 from "chalk";
1000
933
  var lintPackage = /* @__PURE__ */ __name(({ pkg, fix: fix2 }) => {
1001
- console.log(chalk15.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
934
+ console.log(chalk14.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
1002
935
  const start = Date.now();
1003
936
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
1004
937
  [
@@ -1011,7 +944,7 @@ var lintPackage = /* @__PURE__ */ __name(({ pkg, fix: fix2 }) => {
1011
944
  ]
1012
945
  ]
1013
946
  ]);
1014
- console.log(chalk15.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk15.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk15.gray("seconds")}`));
947
+ console.log(chalk14.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk14.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk14.gray("seconds")}`));
1015
948
  return result;
1016
949
  }, "lintPackage");
1017
950
  var lint = /* @__PURE__ */ __name(({ pkg, verbose, incremental, fix: fix2 } = {}) => {
@@ -1024,35 +957,18 @@ var lint = /* @__PURE__ */ __name(({ pkg, verbose, incremental, fix: fix2 } = {}
1024
957
  fix: fix2
1025
958
  });
1026
959
  }, "lint");
1027
- var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2, verbose = true, incremental } = {}) => {
1028
- console.log(chalk15.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
960
+ var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2 = false } = {}) => {
961
+ console.log(chalk14.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
1029
962
  const start = Date.now();
1030
- const verboseOptions = verbose ? [
1031
- "--verbose"
1032
- ] : [
1033
- "--no-verbose"
1034
- ];
1035
- const incrementalOptions = incremental ? [
1036
- "--since",
1037
- "-Ap"
1038
- ] : [
1039
- "--parallel",
1040
- "-Ap"
1041
- ];
1042
963
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
1043
964
  [
1044
965
  "yarn",
1045
966
  [
1046
- "workspaces",
1047
- "foreach",
1048
- ...verboseOptions,
1049
- ...incrementalOptions,
1050
- "run",
1051
- fix2 ? "package-fix" : "package-lint"
967
+ "eslint"
1052
968
  ]
1053
969
  ]
1054
970
  ]);
1055
- console.log(chalk15.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk15.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk15.gray("seconds")}`));
971
+ console.log(chalk14.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk14.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk14.gray("seconds")}`));
1056
972
  return result;
1057
973
  }, "lintAllPackages");
1058
974
 
@@ -1117,7 +1033,7 @@ var filename = ".gitignore";
1117
1033
  var gitignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename, pkg), "gitignoreGen");
1118
1034
 
1119
1035
  // src/actions/gitlint.ts
1120
- import chalk16 from "chalk";
1036
+ import chalk15 from "chalk";
1121
1037
  import ParseGitConfig from "parse-git-config";
1122
1038
  var gitlint = /* @__PURE__ */ __name(() => {
1123
1039
  console.log(`
@@ -1128,7 +1044,7 @@ Gitlint Start [${process.cwd()}]
1128
1044
  const errors = 0;
1129
1045
  const gitConfig = ParseGitConfig.sync();
1130
1046
  const warn = /* @__PURE__ */ __name((message) => {
1131
- console.warn(chalk16.yellow(`Warning: ${message}`));
1047
+ console.warn(chalk15.yellow(`Warning: ${message}`));
1132
1048
  warnings++;
1133
1049
  }, "warn");
1134
1050
  if (gitConfig.core.ignorecase) {
@@ -1148,13 +1064,13 @@ Gitlint Start [${process.cwd()}]
1148
1064
  }
1149
1065
  const resultMessages = [];
1150
1066
  if (valid > 0) {
1151
- resultMessages.push(chalk16.green(`Passed: ${valid}`));
1067
+ resultMessages.push(chalk15.green(`Passed: ${valid}`));
1152
1068
  }
1153
1069
  if (warnings > 0) {
1154
- resultMessages.push(chalk16.yellow(`Warnings: ${warnings}`));
1070
+ resultMessages.push(chalk15.yellow(`Warnings: ${warnings}`));
1155
1071
  }
1156
1072
  if (errors > 0) {
1157
- resultMessages.push(chalk16.red(` Errors: ${errors}`));
1073
+ resultMessages.push(chalk15.red(` Errors: ${errors}`));
1158
1074
  }
1159
1075
  console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
1160
1076
  `);
@@ -1163,7 +1079,7 @@ Gitlint Start [${process.cwd()}]
1163
1079
 
1164
1080
  // src/actions/gitlint-fix.ts
1165
1081
  import { execSync as execSync2 } from "node:child_process";
1166
- import chalk17 from "chalk";
1082
+ import chalk16 from "chalk";
1167
1083
  import ParseGitConfig2 from "parse-git-config";
1168
1084
  var gitlintFix = /* @__PURE__ */ __name(() => {
1169
1085
  console.log(`
@@ -1174,19 +1090,19 @@ Gitlint Fix Start [${process.cwd()}]
1174
1090
  execSync2("git config core.ignorecase false", {
1175
1091
  stdio: "inherit"
1176
1092
  });
1177
- console.warn(chalk17.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
1093
+ console.warn(chalk16.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
1178
1094
  }
1179
1095
  if (gitConfig.core.autocrlf !== false) {
1180
1096
  execSync2("git config core.autocrlf false", {
1181
1097
  stdio: "inherit"
1182
1098
  });
1183
- console.warn(chalk17.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
1099
+ console.warn(chalk16.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
1184
1100
  }
1185
1101
  if (gitConfig.core.eol !== "lf") {
1186
1102
  execSync2("git config core.eol lf", {
1187
1103
  stdio: "inherit"
1188
1104
  });
1189
- console.warn(chalk17.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
1105
+ console.warn(chalk16.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
1190
1106
  }
1191
1107
  return 1;
1192
1108
  }, "gitlintFix");
@@ -1206,7 +1122,7 @@ var knip = /* @__PURE__ */ __name(() => {
1206
1122
  }, "knip");
1207
1123
 
1208
1124
  // src/actions/license.ts
1209
- import chalk18 from "chalk";
1125
+ import chalk17 from "chalk";
1210
1126
  import { init } from "license-checker";
1211
1127
  var license = /* @__PURE__ */ __name(async (pkg) => {
1212
1128
  const workspaces = yarnWorkspaces();
@@ -1231,7 +1147,7 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
1231
1147
  "LGPL-3.0-or-later",
1232
1148
  "Python-2.0"
1233
1149
  ]);
1234
- console.log(chalk18.green("License Checker"));
1150
+ console.log(chalk17.green("License Checker"));
1235
1151
  return (await Promise.all(workspaceList.map(({ location, name }) => {
1236
1152
  return new Promise((resolve) => {
1237
1153
  init({
@@ -1239,12 +1155,12 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
1239
1155
  start: location
1240
1156
  }, (error, packages) => {
1241
1157
  if (error) {
1242
- console.error(chalk18.red(`License Checker [${name}] Error`));
1243
- console.error(chalk18.gray(error));
1158
+ console.error(chalk17.red(`License Checker [${name}] Error`));
1159
+ console.error(chalk17.gray(error));
1244
1160
  console.log("\n");
1245
1161
  resolve(1);
1246
1162
  } else {
1247
- console.log(chalk18.green(`License Checker [${name}]`));
1163
+ console.log(chalk17.green(`License Checker [${name}]`));
1248
1164
  let count = 0;
1249
1165
  for (const [name2, info] of Object.entries(packages)) {
1250
1166
  const licenses = Array.isArray(info.licenses) ? info.licenses : [
@@ -1262,7 +1178,7 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
1262
1178
  }
1263
1179
  if (!orLicenseFound) {
1264
1180
  count++;
1265
- console.warn(chalk18.yellow(`${name2}: Package License not allowed [${license2}]`));
1181
+ console.warn(chalk17.yellow(`${name2}: Package License not allowed [${license2}]`));
1266
1182
  }
1267
1183
  }
1268
1184
  }
@@ -1281,7 +1197,7 @@ var npmignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename2
1281
1197
 
1282
1198
  // src/actions/package/clean-outputs.ts
1283
1199
  import path3 from "node:path";
1284
- import chalk19 from "chalk";
1200
+ import chalk18 from "chalk";
1285
1201
  var packageCleanOutputs = /* @__PURE__ */ __name(() => {
1286
1202
  const pkg = process.env.INIT_CWD ?? ".";
1287
1203
  const pkgName = process.env.npm_package_name;
@@ -1290,7 +1206,7 @@ var packageCleanOutputs = /* @__PURE__ */ __name(() => {
1290
1206
  path3.join(pkg, "build"),
1291
1207
  path3.join(pkg, "docs")
1292
1208
  ];
1293
- console.log(chalk19.green(`Cleaning Outputs [${pkgName}]`));
1209
+ console.log(chalk18.green(`Cleaning Outputs [${pkgName}]`));
1294
1210
  for (let folder of folders) {
1295
1211
  deleteGlob(folder);
1296
1212
  }
@@ -1299,11 +1215,11 @@ var packageCleanOutputs = /* @__PURE__ */ __name(() => {
1299
1215
 
1300
1216
  // src/actions/package/clean-typescript.ts
1301
1217
  import path4 from "node:path";
1302
- import chalk20 from "chalk";
1218
+ import chalk19 from "chalk";
1303
1219
  var packageCleanTypescript = /* @__PURE__ */ __name(() => {
1304
1220
  const pkg = process.env.INIT_CWD ?? ".";
1305
1221
  const pkgName = process.env.npm_package_name;
1306
- console.log(chalk20.green(`Cleaning Typescript [${pkgName}]`));
1222
+ console.log(chalk19.green(`Cleaning Typescript [${pkgName}]`));
1307
1223
  const files = [
1308
1224
  path4.join(pkg, "*.tsbuildinfo"),
1309
1225
  path4.join(pkg, ".tsconfig.*"),
@@ -1324,19 +1240,19 @@ var packageClean = /* @__PURE__ */ __name(async () => {
1324
1240
  }, "packageClean");
1325
1241
 
1326
1242
  // src/actions/package/compile/compile.ts
1327
- import chalk24 from "chalk";
1243
+ import chalk23 from "chalk";
1328
1244
 
1329
1245
  // src/actions/package/publint.ts
1330
1246
  import { promises as fs2 } from "node:fs";
1331
- import chalk21 from "chalk";
1247
+ import chalk20 from "chalk";
1332
1248
  import sortPackageJson from "sort-package-json";
1333
1249
  var packagePublint = /* @__PURE__ */ __name(async (params) => {
1334
1250
  const pkgDir = process.env.INIT_CWD;
1335
1251
  const sortedPkg = sortPackageJson(await fs2.readFile(`${pkgDir}/package.json`, "utf8"));
1336
1252
  await fs2.writeFile(`${pkgDir}/package.json`, sortedPkg);
1337
1253
  const pkg = JSON.parse(await fs2.readFile(`${pkgDir}/package.json`, "utf8"));
1338
- console.log(chalk21.green(`Publint: ${pkg.name}`));
1339
- console.log(chalk21.gray(pkgDir));
1254
+ console.log(chalk20.green(`Publint: ${pkg.name}`));
1255
+ console.log(chalk20.gray(pkgDir));
1340
1256
  const { publint: publint2 } = await import("publint");
1341
1257
  const { messages } = await publint2({
1342
1258
  level: "suggestion",
@@ -1351,21 +1267,21 @@ var packagePublint = /* @__PURE__ */ __name(async (params) => {
1351
1267
  for (const message of validMessages) {
1352
1268
  switch (message.type) {
1353
1269
  case "error": {
1354
- console.error(chalk21.red(`[${message.code}] ${formatMessage(message, pkg)}`));
1270
+ console.error(chalk20.red(`[${message.code}] ${formatMessage(message, pkg)}`));
1355
1271
  break;
1356
1272
  }
1357
1273
  case "warning": {
1358
- console.warn(chalk21.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
1274
+ console.warn(chalk20.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
1359
1275
  break;
1360
1276
  }
1361
1277
  default: {
1362
- console.log(chalk21.white(`[${message.code}] ${formatMessage(message, pkg)}`));
1278
+ console.log(chalk20.white(`[${message.code}] ${formatMessage(message, pkg)}`));
1363
1279
  break;
1364
1280
  }
1365
1281
  }
1366
1282
  }
1367
1283
  if (params?.verbose) {
1368
- console.log(chalk21.gray(`Publint [Finish]: ${pkgDir} [${validMessages.length}]`));
1284
+ console.log(chalk20.gray(`Publint [Finish]: ${pkgDir} [${validMessages.length}]`));
1369
1285
  }
1370
1286
  return validMessages.filter((message) => message.type === "error").length;
1371
1287
  }, "packagePublint");
@@ -1409,7 +1325,7 @@ var buildEntries = /* @__PURE__ */ __name((folder, entryMode = "single", exclude
1409
1325
 
1410
1326
  // src/actions/package/compile/packageCompileTscTypes.ts
1411
1327
  import { cwd } from "node:process";
1412
- import chalk22 from "chalk";
1328
+ import chalk21 from "chalk";
1413
1329
  import { createProgramFromConfig } from "tsc-prog";
1414
1330
  import { DiagnosticCategory, formatDiagnosticsWithColorAndContext, getPreEmitDiagnostics, sys as sys2 } from "typescript";
1415
1331
 
@@ -1466,7 +1382,7 @@ var packageCompileTscTypes = /* @__PURE__ */ __name((folder = "src", config2 = {
1466
1382
  ".spec."
1467
1383
  ];
1468
1384
  const files = buildEntries(folder, "all", verbose).filter((file) => validTsExt.find((ext) => file.endsWith(ext)) && !excludes.some((exclude) => file.includes(exclude)));
1469
- console.log(chalk22.green(`Compiling Types ${pkg}: ${files.length}`));
1385
+ console.log(chalk21.green(`Compiling Types ${pkg}: ${files.length}`));
1470
1386
  if (files.length > 0) {
1471
1387
  const program = createProgramFromConfig({
1472
1388
  basePath: pkg ?? cwd(),
@@ -1529,7 +1445,7 @@ __name(deepMergeObjects, "deepMergeObjects");
1529
1445
 
1530
1446
  // src/actions/package/compile/packageCompileTsc.ts
1531
1447
  import { cwd as cwd2 } from "node:process";
1532
- import chalk23 from "chalk";
1448
+ import chalk22 from "chalk";
1533
1449
  import { createProgramFromConfig as createProgramFromConfig2 } from "tsc-prog";
1534
1450
  import { DiagnosticCategory as DiagnosticCategory2, formatDiagnosticsWithColorAndContext as formatDiagnosticsWithColorAndContext2, getPreEmitDiagnostics as getPreEmitDiagnostics2, sys as sys3 } from "typescript";
1535
1451
  var packageCompileTsc = /* @__PURE__ */ __name((folder = "src", config2 = {}, compilerOptionsParam) => {
@@ -1564,7 +1480,7 @@ var packageCompileTsc = /* @__PURE__ */ __name((folder = "src", config2 = {}, co
1564
1480
  ".d.mts"
1565
1481
  ];
1566
1482
  const files = buildEntries(folder, "all", verbose).filter((file) => validTsExt.find((ext) => file.endsWith(ext)) && includes.find((include) => file.includes(include)));
1567
- console.log(chalk23.green(`Compiling Files ${pkg}: ${files.length}`));
1483
+ console.log(chalk22.green(`Compiling Files ${pkg}: ${files.length}`));
1568
1484
  if (files.length > 0) {
1569
1485
  const program = createProgramFromConfig2({
1570
1486
  basePath: pkg ?? cwd2(),
@@ -1724,7 +1640,7 @@ var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
1724
1640
  // src/actions/package/compile/compile.ts
1725
1641
  var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
1726
1642
  const pkg = process.env.INIT_CWD;
1727
- console.log(chalk24.green(`Compiling ${pkg}`));
1643
+ console.log(chalk23.green(`Compiling ${pkg}`));
1728
1644
  const config2 = await loadConfig(inConfig);
1729
1645
  const publint2 = config2.publint;
1730
1646
  const tsupResults = await packageCompileTsup(config2);
@@ -1736,7 +1652,7 @@ var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
1736
1652
 
1737
1653
  // src/actions/package/copy-assets.ts
1738
1654
  import path5 from "node:path/posix";
1739
- import chalk25 from "chalk";
1655
+ import chalk24 from "chalk";
1740
1656
  import cpy2 from "cpy";
1741
1657
  var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) => {
1742
1658
  try {
@@ -1755,7 +1671,7 @@ var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) =>
1755
1671
  flat: false
1756
1672
  });
1757
1673
  if (values.length > 0) {
1758
- console.log(chalk25.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
1674
+ console.log(chalk24.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
1759
1675
  }
1760
1676
  for (const value of values) {
1761
1677
  console.log(`${value.split("/").pop()} => ./dist/${target}`);
@@ -1783,169 +1699,10 @@ var packageCopyAssets = /* @__PURE__ */ __name(async ({ target }) => {
1783
1699
  }
1784
1700
  }, "packageCopyAssets");
1785
1701
 
1786
- // src/actions/package/deps.ts
1787
- import { existsSync as existsSync4, readFileSync as readFileSync3 } from "node:fs";
1788
- import { cwd as cwd3 } from "node:process";
1789
- import chalk26 from "chalk";
1790
- import depcheck from "depcheck";
1791
- var special = depcheck.special;
1792
- var defaultIgnorePatterns = [
1793
- "*.d.ts",
1794
- "dist",
1795
- ".*",
1796
- "node_modules"
1797
- ];
1798
- var defaultIgnoreDevDeps = [
1799
- "@xylabs/ts-scripts-yarn3",
1800
- "@xylabs/tsconfig",
1801
- "@xylabs/tsconfig-dom",
1802
- "@xylabs/tsconfig-react",
1803
- "typescript"
1804
- ];
1805
- var defaultIgnoreDevPatterns = [
1806
- "*.stories.*",
1807
- "*.spec.*",
1808
- "spec",
1809
- "stories",
1810
- "tsconfig.json"
1811
- ];
1812
- var reportUnused = /* @__PURE__ */ __name((name, unused) => {
1813
- if (unused.length > 0) {
1814
- const message = [
1815
- chalk26.yellow(`${unused.length} Unused ${name}`)
1816
- ];
1817
- for (const value of unused) message.push(chalk26.gray(` ${value}`));
1818
- console.log(message.join("\n"));
1819
- }
1820
- }, "reportUnused");
1821
- var reportMissing = /* @__PURE__ */ __name((name, missing) => {
1822
- if (Object.keys(missing).length > 0) {
1823
- const message = [
1824
- chalk26.yellow(`${Object.entries(missing).length} Missing ${name}`)
1825
- ];
1826
- for (const [key, value] of Object.entries(missing)) {
1827
- message.push(`${key}`, chalk26.gray(` ${value.at(0)}`));
1828
- }
1829
- console.log(chalk26.yellow(message.join("\n")));
1830
- }
1831
- }, "reportMissing");
1832
- var analyzeDeps = /* @__PURE__ */ __name(async (pkg, ignoreMatches) => {
1833
- const packageContent = existsSync4(`${pkg}/package.json`) ? JSON.parse(readFileSync3(`${pkg}/package.json`, {
1834
- encoding: "utf8"
1835
- })) : void 0;
1836
- const [srcUnused, allUnused] = await Promise.all([
1837
- depcheck(`${pkg}/src`, {
1838
- ignoreMatches,
1839
- ignorePatterns: [
1840
- ...defaultIgnoreDevPatterns,
1841
- ...defaultIgnorePatterns
1842
- ],
1843
- package: packageContent
1844
- }),
1845
- depcheck(`${pkg}/.`, {
1846
- ignoreMatches: [
1847
- ...ignoreMatches,
1848
- ...defaultIgnoreDevDeps
1849
- ],
1850
- ignorePatterns: [
1851
- ...defaultIgnorePatterns
1852
- ],
1853
- package: packageContent,
1854
- specials: [
1855
- special.eslint,
1856
- special.babel,
1857
- special.bin,
1858
- special.prettier,
1859
- special.jest,
1860
- special.mocha
1861
- ]
1862
- })
1863
- ]);
1864
- const unusedDeps = srcUnused.dependencies;
1865
- const unusedDevDeps = allUnused.devDependencies;
1866
- const usedDeps = srcUnused.using;
1867
- const usedDevDeps = allUnused.using;
1868
- const missing = {
1869
- ...srcUnused.missing,
1870
- ...allUnused.missing
1871
- };
1872
- const { invalidDirs, invalidFiles } = allUnused;
1873
- return {
1874
- invalidDirs,
1875
- invalidFiles,
1876
- missing,
1877
- unusedDeps,
1878
- unusedDevDeps,
1879
- usedDeps,
1880
- usedDevDeps
1881
- };
1882
- }, "analyzeDeps");
1883
- var packageDeps = /* @__PURE__ */ __name(async () => {
1884
- const pkg = process.env.INIT_CWD ?? cwd3();
1885
- const pkgName = process.env.npm_package_name;
1886
- const packageContent = existsSync4(`${pkg}/package.json`) ? JSON.parse(readFileSync3(`${pkg}/package.json`, {
1887
- encoding: "utf8"
1888
- })) : void 0;
1889
- const rawIgnore = existsSync4(`${pkg}/.depcheckrc`) ? readFileSync3(`${pkg}/.depcheckrc`, {
1890
- encoding: "utf8"
1891
- }).replace("ignores:", '"ignores":') : void 0;
1892
- let ignoreMatches = [];
1893
- try {
1894
- ignoreMatches = rawIgnore ? JSON.parse(`{${rawIgnore}}`).ignores : [];
1895
- } catch (ex) {
1896
- const error = ex;
1897
- console.log(`${pkgName} [${error.message}] Failed to parse .depcheckrc [${rawIgnore}]`);
1898
- }
1899
- const { invalidDirs, invalidFiles, unusedDeps, unusedDevDeps, usedDeps, usedDevDeps, missing } = await analyzeDeps(pkg, ignoreMatches);
1900
- const declaredDeps = Object.keys(packageContent.dependencies ?? {});
1901
- const declaredPeerDeps = Object.keys(packageContent.peerDependencies ?? {});
1902
- const declaredDevDeps = Object.keys(packageContent.devDependencies ?? {});
1903
- const missingDeps = Object.keys(usedDeps).filter((key) => !declaredDeps.includes(key) && !declaredPeerDeps.includes(key) && !key.startsWith("@types/"));
1904
- const missingDevDeps = Object.keys(usedDevDeps).filter((key) => !declaredDevDeps.includes(key) && !declaredDeps.includes(key));
1905
- const missingDepsObject = {};
1906
- for (const key of missingDeps) {
1907
- missingDepsObject[key] = missing[key] ?? [
1908
- `devDep should be dep [${key}]`
1909
- ];
1910
- }
1911
- const missingDevDepsObject = {};
1912
- for (const key of missingDevDeps) {
1913
- if (missing[key]) {
1914
- missingDevDepsObject[key] = missing[key];
1915
- }
1916
- }
1917
- const errorCounts = [
1918
- unusedDeps.length,
1919
- unusedDevDeps.length,
1920
- Object.entries(invalidDirs).length,
1921
- Object.entries(invalidFiles).length,
1922
- Object.entries(missingDepsObject).length,
1923
- Object.entries(missingDevDepsObject).length
1924
- ];
1925
- const errorCount = errorCounts.reduce((prev, count) => prev + count, 0);
1926
- if (errorCount > 0) {
1927
- console.log(`Deps [${pkgName}] = (${JSON.stringify(errorCounts)})`);
1928
- } else {
1929
- console.log(`Deps [${pkgName}] - Ok`);
1930
- }
1931
- reportUnused("dependencies", unusedDeps);
1932
- reportUnused("devDependencies", unusedDevDeps);
1933
- if (Object.entries(invalidDirs).length > 0) {
1934
- for (const [key, value] of Object.entries(invalidDirs)) console.warn(chalk26.gray(`Invalid Dir: ${key}: ${value}`));
1935
- }
1936
- if (Object.entries(invalidFiles).length > 0) {
1937
- for (const [key, value] of Object.entries(invalidFiles)) console.warn(chalk26.gray(`Invalid File: ${key}: ${value}`));
1938
- }
1939
- reportMissing("dependencies", missingDepsObject);
1940
- reportMissing("devDependencies", missingDevDepsObject);
1941
- checkResult(`Deps [${pkgName}]`, errorCount, "warn", false);
1942
- return 0;
1943
- }, "packageDeps");
1944
-
1945
1702
  // src/actions/package/gen-docs.ts
1946
- import { existsSync as existsSync5 } from "node:fs";
1703
+ import { existsSync as existsSync4 } from "node:fs";
1947
1704
  import path6 from "node:path";
1948
- import chalk27 from "chalk";
1705
+ import chalk25 from "chalk";
1949
1706
  import { Application, ArgumentsReader, TSConfigReader, TypeDocReader } from "typedoc";
1950
1707
  var ExitCodes = {
1951
1708
  CompileError: 3,
@@ -1958,7 +1715,7 @@ var ExitCodes = {
1958
1715
  };
1959
1716
  var packageGenDocs = /* @__PURE__ */ __name(async () => {
1960
1717
  const pkg = process.env.INIT_CWD;
1961
- if (pkg && !existsSync5(path6.join(pkg, "typedoc.json"))) {
1718
+ if (pkg && !existsSync4(path6.join(pkg, "typedoc.json"))) {
1962
1719
  return;
1963
1720
  }
1964
1721
  const app = await Application.bootstrap({
@@ -2047,16 +1804,16 @@ var runTypeDoc = /* @__PURE__ */ __name(async (app) => {
2047
1804
  return ExitCodes.OutputError;
2048
1805
  }
2049
1806
  }
2050
- console.log(chalk27.green(`${pkgName} - Ok`));
1807
+ console.log(chalk25.green(`${pkgName} - Ok`));
2051
1808
  return ExitCodes.Ok;
2052
1809
  }, "runTypeDoc");
2053
1810
 
2054
1811
  // src/actions/package/lint.ts
2055
1812
  import { readdirSync } from "node:fs";
2056
1813
  import path7 from "node:path";
2057
- import { cwd as cwd4 } from "node:process";
1814
+ import { cwd as cwd3 } from "node:process";
2058
1815
  import { pathToFileURL } from "node:url";
2059
- import chalk28 from "chalk";
1816
+ import chalk26 from "chalk";
2060
1817
  import { ESLint as ESLint2 } from "eslint";
2061
1818
  import { findUp } from "find-up";
2062
1819
  import picomatch from "picomatch";
@@ -2073,10 +1830,10 @@ var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
2073
1830
  ];
2074
1831
  for (const lintResult of lintResults) {
2075
1832
  if (lintResult.messages.length > 0) {
2076
- console.log(chalk28.gray(`
1833
+ console.log(chalk26.gray(`
2077
1834
  ${lintResult.filePath}`));
2078
1835
  for (const message of lintResult.messages) {
2079
- console.log(chalk28.gray(` ${message.line}:${message.column}`), chalk28[colors[message.severity]](` ${severity[message.severity]}`), chalk28.white(` ${message.message}`), chalk28.gray(` ${message.ruleId}`));
1836
+ console.log(chalk26.gray(` ${message.line}:${message.column}`), chalk26[colors[message.severity]](` ${severity[message.severity]}`), chalk26.white(` ${message.message}`), chalk26.gray(` ${message.ruleId}`));
2080
1837
  }
2081
1838
  }
2082
1839
  }
@@ -2090,7 +1847,7 @@ async function getRootESLintConfig() {
2090
1847
  }
2091
1848
  __name(getRootESLintConfig, "getRootESLintConfig");
2092
1849
  function getFiles(dir, ignoreFolders) {
2093
- const currentDirectory = cwd4();
1850
+ const currentDirectory = cwd3();
2094
1851
  const subDirectory = dir.split(currentDirectory)[1];
2095
1852
  if (ignoreFolders.includes(subDirectory)) return [];
2096
1853
  return readdirSync(dir, {
@@ -2129,9 +1886,9 @@ var packageLint = /* @__PURE__ */ __name(async (fix2 = false, verbose = false, c
2129
1886
  warnIgnored: false,
2130
1887
  cache
2131
1888
  });
2132
- const files = getFiles(cwd4(), ignoreFolders);
1889
+ const files = getFiles(cwd3(), ignoreFolders);
2133
1890
  if (verbose) {
2134
- console.log(chalk28.green(`Linting ${pkg} [files = ${files.length}]`));
1891
+ console.log(chalk26.green(`Linting ${pkg} [files = ${files.length}]`));
2135
1892
  }
2136
1893
  const lintResults = await engine.lintFiles(files);
2137
1894
  dumpMessages(lintResults);
@@ -2141,7 +1898,7 @@ var packageLint = /* @__PURE__ */ __name(async (fix2 = false, verbose = false, c
2141
1898
  const filesCountColor = files.length < 100 ? "green" : files.length < 1e3 ? "yellow" : "red";
2142
1899
  const lintTime = Date.now() - start;
2143
1900
  const lintTimeColor = lintTime < 1e3 ? "green" : lintTime < 3e3 ? "yellow" : "red";
2144
- console.log(chalk28.white(`Linted ${chalk28[filesCountColor](files.length)} files in ${chalk28[lintTimeColor](lintTime)}ms`));
1901
+ console.log(chalk26.white(`Linted ${chalk26[filesCountColor](files.length)} files in ${chalk26[lintTimeColor](lintTime)}ms`));
2145
1902
  return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
2146
1903
  }, "packageLint");
2147
1904
 
@@ -2208,7 +1965,7 @@ var rebuild = /* @__PURE__ */ __name(({ target }) => {
2208
1965
  }, "rebuild");
2209
1966
 
2210
1967
  // src/actions/recompile.ts
2211
- import chalk29 from "chalk";
1968
+ import chalk27 from "chalk";
2212
1969
  var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incremental }) => {
2213
1970
  return pkg ? await recompilePackage({
2214
1971
  pkg,
@@ -2263,7 +2020,7 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
2263
2020
  `${jobs}`
2264
2021
  ] : [];
2265
2022
  if (jobs) {
2266
- console.log(chalk29.blue(`Jobs set to [${jobs}]`));
2023
+ console.log(chalk27.blue(`Jobs set to [${jobs}]`));
2267
2024
  }
2268
2025
  const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
2269
2026
  [
@@ -2293,7 +2050,7 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
2293
2050
  ]
2294
2051
  ]
2295
2052
  ]);
2296
- console.log(`${chalk29.gray("Recompiled in")} [${chalk29.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk29.gray("seconds")}`);
2053
+ console.log(`${chalk27.gray("Recompiled in")} [${chalk27.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk27.gray("seconds")}`);
2297
2054
  return result;
2298
2055
  }, "recompileAll");
2299
2056
 
@@ -2327,9 +2084,9 @@ var reinstall = /* @__PURE__ */ __name(() => {
2327
2084
  }, "reinstall");
2328
2085
 
2329
2086
  // src/actions/relint.ts
2330
- import chalk30 from "chalk";
2087
+ import chalk28 from "chalk";
2331
2088
  var relintPackage = /* @__PURE__ */ __name(({ pkg }) => {
2332
- console.log(chalk30.gray(`${"Relint"} [All-Packages]`));
2089
+ console.log(chalk28.gray(`${"Relint"} [All-Packages]`));
2333
2090
  const start = Date.now();
2334
2091
  const result = runSteps("Relint [All-Packages]", [
2335
2092
  [
@@ -2342,7 +2099,7 @@ var relintPackage = /* @__PURE__ */ __name(({ pkg }) => {
2342
2099
  ]
2343
2100
  ]
2344
2101
  ]);
2345
- console.log(chalk30.gray(`${"Relinted in"} [${chalk30.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk30.gray("seconds")}`));
2102
+ console.log(chalk28.gray(`${"Relinted in"} [${chalk28.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk28.gray("seconds")}`));
2346
2103
  return result;
2347
2104
  }, "relintPackage");
2348
2105
  var relint = /* @__PURE__ */ __name(({ pkg, verbose, incremental } = {}) => {
@@ -2354,7 +2111,7 @@ var relint = /* @__PURE__ */ __name(({ pkg, verbose, incremental } = {}) => {
2354
2111
  });
2355
2112
  }, "relint");
2356
2113
  var relintAllPackages = /* @__PURE__ */ __name(({ verbose = true, incremental } = {}) => {
2357
- console.log(chalk30.gray(`${"Relint"} [All-Packages]`));
2114
+ console.log(chalk28.gray(`${"Relint"} [All-Packages]`));
2358
2115
  const start = Date.now();
2359
2116
  const verboseOptions = verbose ? [
2360
2117
  "--verbose"
@@ -2381,7 +2138,7 @@ var relintAllPackages = /* @__PURE__ */ __name(({ verbose = true, incremental }
2381
2138
  ]
2382
2139
  ]
2383
2140
  ]);
2384
- console.log(chalk30.gray(`Relinted in [${chalk30.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk30.gray("seconds")}`));
2141
+ console.log(chalk28.gray(`Relinted in [${chalk28.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk28.gray("seconds")}`));
2385
2142
  return result;
2386
2143
  }, "relintAllPackages");
2387
2144
 
@@ -2421,7 +2178,7 @@ var sonar = /* @__PURE__ */ __name(() => {
2421
2178
  }, "sonar");
2422
2179
 
2423
2180
  // src/actions/statics.ts
2424
- import chalk31 from "chalk";
2181
+ import chalk29 from "chalk";
2425
2182
  var DefaultDependencies = [
2426
2183
  "axios",
2427
2184
  "@xylabs/pixel",
@@ -2432,7 +2189,7 @@ var DefaultDependencies = [
2432
2189
  "@mui/system"
2433
2190
  ];
2434
2191
  var statics = /* @__PURE__ */ __name(() => {
2435
- console.log(chalk31.green("Check Required Static Dependencies"));
2192
+ console.log(chalk29.green("Check Required Static Dependencies"));
2436
2193
  const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
2437
2194
  return detectDuplicateDependencies(statics2, DefaultDependencies);
2438
2195
  }, "statics");
@@ -2557,9 +2314,6 @@ export {
2557
2314
  deployMajor,
2558
2315
  deployMinor,
2559
2316
  deployNext,
2560
- deps,
2561
- depsAll,
2562
- depsPackage,
2563
2317
  dupdeps,
2564
2318
  fix,
2565
2319
  genDocs,
@@ -2583,7 +2337,6 @@ export {
2583
2337
  packageCompileTsup,
2584
2338
  packageCompileTypes,
2585
2339
  packageCopyAssets,
2586
- packageDeps,
2587
2340
  packageGenDocs,
2588
2341
  packageLint,
2589
2342
  packagePublint,