@xylabs/ts-scripts-yarn3 6.2.1 → 6.3.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.
Files changed (50) hide show
  1. package/dist/actions/build.mjs +12 -1
  2. package/dist/actions/build.mjs.map +1 -1
  3. package/dist/actions/cycle.mjs +164 -21
  4. package/dist/actions/cycle.mjs.map +1 -1
  5. package/dist/actions/index.mjs +185 -85
  6. package/dist/actions/index.mjs.map +1 -1
  7. package/dist/actions/package/compile/compile.mjs +0 -1
  8. package/dist/actions/package/compile/compile.mjs.map +1 -1
  9. package/dist/actions/package/compile/compileTypes.mjs +0 -1
  10. package/dist/actions/package/compile/compileTypes.mjs.map +1 -1
  11. package/dist/actions/package/compile/index.mjs +0 -1
  12. package/dist/actions/package/compile/index.mjs.map +1 -1
  13. package/dist/actions/package/compile/packageCompileTsup.mjs +0 -1
  14. package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
  15. package/dist/actions/package/cycle.mjs +47 -0
  16. package/dist/actions/package/cycle.mjs.map +1 -0
  17. package/dist/actions/package/index.mjs +42 -1
  18. package/dist/actions/package/index.mjs.map +1 -1
  19. package/dist/actions/package/recompile.mjs +0 -1
  20. package/dist/actions/package/recompile.mjs.map +1 -1
  21. package/dist/bin/package/build-only.mjs +0 -1
  22. package/dist/bin/package/build-only.mjs.map +1 -1
  23. package/dist/bin/package/build.mjs +0 -1
  24. package/dist/bin/package/build.mjs.map +1 -1
  25. package/dist/bin/package/compile-only.mjs +0 -1
  26. package/dist/bin/package/compile-only.mjs.map +1 -1
  27. package/dist/bin/package/compile-tsup.mjs +0 -1
  28. package/dist/bin/package/compile-tsup.mjs.map +1 -1
  29. package/dist/bin/package/compile-types.mjs +0 -1
  30. package/dist/bin/package/compile-types.mjs.map +1 -1
  31. package/dist/bin/package/compile.mjs +0 -1
  32. package/dist/bin/package/compile.mjs.map +1 -1
  33. package/dist/bin/package/cycle.mjs +60 -0
  34. package/dist/bin/package/cycle.mjs.map +1 -0
  35. package/dist/bin/package/recompile.mjs +0 -1
  36. package/dist/bin/package/recompile.mjs.map +1 -1
  37. package/dist/bin/xy.mjs +125 -68
  38. package/dist/bin/xy.mjs.map +1 -1
  39. package/dist/index.d.ts +18 -2
  40. package/dist/index.mjs +198 -98
  41. package/dist/index.mjs.map +1 -1
  42. package/dist/xy/index.mjs +125 -68
  43. package/dist/xy/index.mjs.map +1 -1
  44. package/dist/xy/xy.mjs +125 -68
  45. package/dist/xy/xy.mjs.map +1 -1
  46. package/dist/xy/xyBuildCommands.mjs +12 -1
  47. package/dist/xy/xyBuildCommands.mjs.map +1 -1
  48. package/dist/xy/xyLintCommands.mjs +88 -42
  49. package/dist/xy/xyLintCommands.mjs.map +1 -1
  50. package/package.json +16 -14
package/dist/index.mjs CHANGED
@@ -570,9 +570,10 @@ var build = /* @__PURE__ */ __name(async ({ incremental, jobs, target, verbose,
570
570
  "yarn",
571
571
  [
572
572
  "xy",
573
- "lint",
573
+ "cycle",
574
574
  ...pkgOptions,
575
575
  ...verboseOptions,
576
+ ...jobsOptions,
576
577
  ...incrementalOptions
577
578
  ]
578
579
  ],
@@ -597,6 +598,16 @@ var build = /* @__PURE__ */ __name(async ({ incremental, jobs, target, verbose,
597
598
  ...jobsOptions,
598
599
  ...incrementalOptions
599
600
  ]
601
+ ],
602
+ [
603
+ "yarn",
604
+ [
605
+ "xy",
606
+ "lint",
607
+ ...pkgOptions,
608
+ ...verboseOptions,
609
+ ...incrementalOptions
610
+ ]
600
611
  ]
601
612
  ]);
602
613
  console.log(`${chalk9.gray("Built in")} [${chalk9.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk9.gray("seconds")}`);
@@ -870,30 +881,76 @@ var copyAssets = /* @__PURE__ */ __name(async ({ target, pkg }) => {
870
881
  }, "copyAssets");
871
882
 
872
883
  // src/actions/cycle.ts
873
- import { ESLint } from "eslint";
874
- var cycle = /* @__PURE__ */ __name(async () => {
875
- const eslint = new ESLint({
876
- fix: false,
877
- overrideConfig: {
878
- rules: {
879
- "import-x/no-cycle": [
880
- "error",
881
- {
882
- maxDepth: 10
883
- }
884
- ]
885
- }
886
- }
884
+ import chalk14 from "chalk";
885
+ var cycle = /* @__PURE__ */ __name(({ verbose, pkg, incremental, jobs } = {}) => {
886
+ return pkg ? cyclePackage({
887
+ pkg,
888
+ verbose
889
+ }) : cycleAll({
890
+ incremental,
891
+ verbose,
892
+ jobs
887
893
  });
888
- const results = await eslint.lintFiles([
889
- "src/**/*.ts*",
890
- "packages/**/src/**/*.ts*"
891
- ]);
892
- const formatter = await eslint.loadFormatter("stylish");
893
- const resultText = formatter.format(results);
894
- console.log(resultText);
895
- return results.length;
896
894
  }, "cycle");
895
+ var cyclePackage = /* @__PURE__ */ __name(({ pkg, verbose }) => {
896
+ const verboseOptions = verbose ? [
897
+ "--verbose"
898
+ ] : [
899
+ "--no-verbose"
900
+ ];
901
+ return runSteps(`Cycle [${pkg}]`, [
902
+ [
903
+ "yarn",
904
+ [
905
+ "workspace",
906
+ pkg,
907
+ "run",
908
+ "package-cycle",
909
+ ...verboseOptions
910
+ ]
911
+ ]
912
+ ]);
913
+ }, "cyclePackage");
914
+ var cycleAll = /* @__PURE__ */ __name(({ jobs, verbose, incremental }) => {
915
+ const start = Date.now();
916
+ const verboseOptions = verbose ? [
917
+ "--verbose"
918
+ ] : [
919
+ "--no-verbose"
920
+ ];
921
+ const incrementalOptions = incremental ? [
922
+ "--since",
923
+ "-Ap",
924
+ "--topological-dev"
925
+ ] : [
926
+ "--parallel",
927
+ "-Ap"
928
+ ];
929
+ const jobsOptions = jobs ? [
930
+ "-j",
931
+ `${jobs}`
932
+ ] : [];
933
+ if (jobs) {
934
+ console.log(chalk14.blue(`Jobs set to [${jobs}]`));
935
+ }
936
+ const result = runSteps(`Cycle${incremental ? "-Incremental" : ""} [All]`, [
937
+ [
938
+ "yarn",
939
+ [
940
+ "workspaces",
941
+ "foreach",
942
+ ...incrementalOptions,
943
+ ...jobsOptions,
944
+ ...verboseOptions,
945
+ "run",
946
+ "package-cycle",
947
+ ...verboseOptions
948
+ ]
949
+ ]
950
+ ]);
951
+ console.log(`${chalk14.gray("Cycles Checked in")} [${chalk14.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk14.gray("seconds")}`);
952
+ return result;
953
+ }, "cycleAll");
897
954
 
898
955
  // src/actions/dead.ts
899
956
  var dead = /* @__PURE__ */ __name(() => {
@@ -1014,18 +1071,18 @@ var deployNext = /* @__PURE__ */ __name(() => {
1014
1071
  }, "deployNext");
1015
1072
 
1016
1073
  // src/actions/dupdeps.ts
1017
- import chalk14 from "chalk";
1074
+ import chalk15 from "chalk";
1018
1075
  var dupdeps = /* @__PURE__ */ __name(() => {
1019
- console.log(chalk14.green("Checking all Dependencies for Duplicates"));
1076
+ console.log(chalk15.green("Checking all Dependencies for Duplicates"));
1020
1077
  const allDependencies = parsedPackageJSON()?.dependencies;
1021
1078
  const dependencies = Object.entries(allDependencies).map(([k]) => k);
1022
1079
  return detectDuplicateDependencies(dependencies);
1023
1080
  }, "dupdeps");
1024
1081
 
1025
1082
  // src/actions/lint.ts
1026
- import chalk15 from "chalk";
1083
+ import chalk16 from "chalk";
1027
1084
  var lintPackage = /* @__PURE__ */ __name(({ pkg, fix: fix2 }) => {
1028
- console.log(chalk15.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
1085
+ console.log(chalk16.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
1029
1086
  const start = Date.now();
1030
1087
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
1031
1088
  [
@@ -1038,7 +1095,7 @@ var lintPackage = /* @__PURE__ */ __name(({ pkg, fix: fix2 }) => {
1038
1095
  ]
1039
1096
  ]
1040
1097
  ]);
1041
- console.log(chalk15.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk15.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk15.gray("seconds")}`));
1098
+ console.log(chalk16.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk16.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk16.gray("seconds")}`));
1042
1099
  return result;
1043
1100
  }, "lintPackage");
1044
1101
  var lint = /* @__PURE__ */ __name(({ pkg, verbose, incremental, fix: fix2 } = {}) => {
@@ -1052,7 +1109,7 @@ var lint = /* @__PURE__ */ __name(({ pkg, verbose, incremental, fix: fix2 } = {}
1052
1109
  });
1053
1110
  }, "lint");
1054
1111
  var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2 = false } = {}) => {
1055
- console.log(chalk15.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
1112
+ console.log(chalk16.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
1056
1113
  const start = Date.now();
1057
1114
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
1058
1115
  [
@@ -1062,7 +1119,7 @@ var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2 = false } = {}) => {
1062
1119
  ]
1063
1120
  ]
1064
1121
  ]);
1065
- console.log(chalk15.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk15.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk15.gray("seconds")}`));
1122
+ console.log(chalk16.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk16.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk16.gray("seconds")}`));
1066
1123
  return result;
1067
1124
  }, "lintAllPackages");
1068
1125
 
@@ -1127,7 +1184,7 @@ var filename = ".gitignore";
1127
1184
  var gitignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename, pkg), "gitignoreGen");
1128
1185
 
1129
1186
  // src/actions/gitlint.ts
1130
- import chalk16 from "chalk";
1187
+ import chalk17 from "chalk";
1131
1188
  import ParseGitConfig from "parse-git-config";
1132
1189
  var gitlint = /* @__PURE__ */ __name(() => {
1133
1190
  console.log(`
@@ -1138,7 +1195,7 @@ Gitlint Start [${process.cwd()}]
1138
1195
  const errors = 0;
1139
1196
  const gitConfig = ParseGitConfig.sync();
1140
1197
  const warn = /* @__PURE__ */ __name((message) => {
1141
- console.warn(chalk16.yellow(`Warning: ${message}`));
1198
+ console.warn(chalk17.yellow(`Warning: ${message}`));
1142
1199
  warnings++;
1143
1200
  }, "warn");
1144
1201
  if (gitConfig.core.ignorecase) {
@@ -1158,13 +1215,13 @@ Gitlint Start [${process.cwd()}]
1158
1215
  }
1159
1216
  const resultMessages = [];
1160
1217
  if (valid > 0) {
1161
- resultMessages.push(chalk16.green(`Passed: ${valid}`));
1218
+ resultMessages.push(chalk17.green(`Passed: ${valid}`));
1162
1219
  }
1163
1220
  if (warnings > 0) {
1164
- resultMessages.push(chalk16.yellow(`Warnings: ${warnings}`));
1221
+ resultMessages.push(chalk17.yellow(`Warnings: ${warnings}`));
1165
1222
  }
1166
1223
  if (errors > 0) {
1167
- resultMessages.push(chalk16.red(` Errors: ${errors}`));
1224
+ resultMessages.push(chalk17.red(` Errors: ${errors}`));
1168
1225
  }
1169
1226
  console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
1170
1227
  `);
@@ -1173,7 +1230,7 @@ Gitlint Start [${process.cwd()}]
1173
1230
 
1174
1231
  // src/actions/gitlint-fix.ts
1175
1232
  import { execSync as execSync2 } from "node:child_process";
1176
- import chalk17 from "chalk";
1233
+ import chalk18 from "chalk";
1177
1234
  import ParseGitConfig2 from "parse-git-config";
1178
1235
  var gitlintFix = /* @__PURE__ */ __name(() => {
1179
1236
  console.log(`
@@ -1184,19 +1241,19 @@ Gitlint Fix Start [${process.cwd()}]
1184
1241
  execSync2("git config core.ignorecase false", {
1185
1242
  stdio: "inherit"
1186
1243
  });
1187
- console.warn(chalk17.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
1244
+ console.warn(chalk18.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
1188
1245
  }
1189
1246
  if (gitConfig.core.autocrlf !== false) {
1190
1247
  execSync2("git config core.autocrlf false", {
1191
1248
  stdio: "inherit"
1192
1249
  });
1193
- console.warn(chalk17.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
1250
+ console.warn(chalk18.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
1194
1251
  }
1195
1252
  if (gitConfig.core.eol !== "lf") {
1196
1253
  execSync2("git config core.eol lf", {
1197
1254
  stdio: "inherit"
1198
1255
  });
1199
- console.warn(chalk17.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
1256
+ console.warn(chalk18.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
1200
1257
  }
1201
1258
  return 1;
1202
1259
  }, "gitlintFix");
@@ -1216,7 +1273,7 @@ var knip = /* @__PURE__ */ __name(() => {
1216
1273
  }, "knip");
1217
1274
 
1218
1275
  // src/actions/license.ts
1219
- import chalk18 from "chalk";
1276
+ import chalk19 from "chalk";
1220
1277
  import { init } from "license-checker";
1221
1278
  var license = /* @__PURE__ */ __name(async (pkg) => {
1222
1279
  const workspaces = yarnWorkspaces();
@@ -1241,7 +1298,7 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
1241
1298
  "LGPL-3.0-or-later",
1242
1299
  "Python-2.0"
1243
1300
  ]);
1244
- console.log(chalk18.green("License Checker"));
1301
+ console.log(chalk19.green("License Checker"));
1245
1302
  return (await Promise.all(workspaceList.map(({ location, name }) => {
1246
1303
  return new Promise((resolve) => {
1247
1304
  init({
@@ -1249,12 +1306,12 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
1249
1306
  start: location
1250
1307
  }, (error, packages) => {
1251
1308
  if (error) {
1252
- console.error(chalk18.red(`License Checker [${name}] Error`));
1253
- console.error(chalk18.gray(error));
1309
+ console.error(chalk19.red(`License Checker [${name}] Error`));
1310
+ console.error(chalk19.gray(error));
1254
1311
  console.log("\n");
1255
1312
  resolve(1);
1256
1313
  } else {
1257
- console.log(chalk18.green(`License Checker [${name}]`));
1314
+ console.log(chalk19.green(`License Checker [${name}]`));
1258
1315
  let count = 0;
1259
1316
  for (const [name2, info] of Object.entries(packages)) {
1260
1317
  const licenses = Array.isArray(info.licenses) ? info.licenses : [
@@ -1272,7 +1329,7 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
1272
1329
  }
1273
1330
  if (!orLicenseFound) {
1274
1331
  count++;
1275
- console.warn(chalk18.yellow(`${name2}: Package License not allowed [${license2}]`));
1332
+ console.warn(chalk19.yellow(`${name2}: Package License not allowed [${license2}]`));
1276
1333
  }
1277
1334
  }
1278
1335
  }
@@ -1291,7 +1348,7 @@ var npmignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename2
1291
1348
 
1292
1349
  // src/actions/package/clean-outputs.ts
1293
1350
  import path3 from "node:path";
1294
- import chalk19 from "chalk";
1351
+ import chalk20 from "chalk";
1295
1352
  var packageCleanOutputs = /* @__PURE__ */ __name(() => {
1296
1353
  const pkg = process.env.INIT_CWD ?? ".";
1297
1354
  const pkgName = process.env.npm_package_name;
@@ -1300,7 +1357,7 @@ var packageCleanOutputs = /* @__PURE__ */ __name(() => {
1300
1357
  path3.join(pkg, "build"),
1301
1358
  path3.join(pkg, "docs")
1302
1359
  ];
1303
- console.log(chalk19.green(`Cleaning Outputs [${pkgName}]`));
1360
+ console.log(chalk20.green(`Cleaning Outputs [${pkgName}]`));
1304
1361
  for (let folder of folders) {
1305
1362
  deleteGlob(folder);
1306
1363
  }
@@ -1309,11 +1366,11 @@ var packageCleanOutputs = /* @__PURE__ */ __name(() => {
1309
1366
 
1310
1367
  // src/actions/package/clean-typescript.ts
1311
1368
  import path4 from "node:path";
1312
- import chalk20 from "chalk";
1369
+ import chalk21 from "chalk";
1313
1370
  var packageCleanTypescript = /* @__PURE__ */ __name(() => {
1314
1371
  const pkg = process.env.INIT_CWD ?? ".";
1315
1372
  const pkgName = process.env.npm_package_name;
1316
- console.log(chalk20.green(`Cleaning Typescript [${pkgName}]`));
1373
+ console.log(chalk21.green(`Cleaning Typescript [${pkgName}]`));
1317
1374
  const files = [
1318
1375
  path4.join(pkg, "*.tsbuildinfo"),
1319
1376
  path4.join(pkg, ".tsconfig.*"),
@@ -1334,19 +1391,19 @@ var packageClean = /* @__PURE__ */ __name(async () => {
1334
1391
  }, "packageClean");
1335
1392
 
1336
1393
  // src/actions/package/compile/compile.ts
1337
- import chalk24 from "chalk";
1394
+ import chalk25 from "chalk";
1338
1395
 
1339
1396
  // src/actions/package/publint.ts
1340
1397
  import { promises as fs2 } from "node:fs";
1341
- import chalk21 from "chalk";
1398
+ import chalk22 from "chalk";
1342
1399
  import sortPackageJson from "sort-package-json";
1343
1400
  var packagePublint = /* @__PURE__ */ __name(async (params) => {
1344
1401
  const pkgDir = process.env.INIT_CWD;
1345
1402
  const sortedPkg = sortPackageJson(await fs2.readFile(`${pkgDir}/package.json`, "utf8"));
1346
1403
  await fs2.writeFile(`${pkgDir}/package.json`, sortedPkg);
1347
1404
  const pkg = JSON.parse(await fs2.readFile(`${pkgDir}/package.json`, "utf8"));
1348
- console.log(chalk21.green(`Publint: ${pkg.name}`));
1349
- console.log(chalk21.gray(pkgDir));
1405
+ console.log(chalk22.green(`Publint: ${pkg.name}`));
1406
+ console.log(chalk22.gray(pkgDir));
1350
1407
  const { publint: publint2 } = await import("publint");
1351
1408
  const { messages } = await publint2({
1352
1409
  level: "suggestion",
@@ -1361,21 +1418,21 @@ var packagePublint = /* @__PURE__ */ __name(async (params) => {
1361
1418
  for (const message of validMessages) {
1362
1419
  switch (message.type) {
1363
1420
  case "error": {
1364
- console.error(chalk21.red(`[${message.code}] ${formatMessage(message, pkg)}`));
1421
+ console.error(chalk22.red(`[${message.code}] ${formatMessage(message, pkg)}`));
1365
1422
  break;
1366
1423
  }
1367
1424
  case "warning": {
1368
- console.warn(chalk21.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
1425
+ console.warn(chalk22.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
1369
1426
  break;
1370
1427
  }
1371
1428
  default: {
1372
- console.log(chalk21.white(`[${message.code}] ${formatMessage(message, pkg)}`));
1429
+ console.log(chalk22.white(`[${message.code}] ${formatMessage(message, pkg)}`));
1373
1430
  break;
1374
1431
  }
1375
1432
  }
1376
1433
  }
1377
1434
  if (params?.verbose) {
1378
- console.log(chalk21.gray(`Publint [Finish]: ${pkgDir} [${validMessages.length}]`));
1435
+ console.log(chalk22.gray(`Publint [Finish]: ${pkgDir} [${validMessages.length}]`));
1379
1436
  }
1380
1437
  return validMessages.filter((message) => message.type === "error").length;
1381
1438
  }, "packagePublint");
@@ -1419,7 +1476,7 @@ var buildEntries = /* @__PURE__ */ __name((folder, entryMode = "single", exclude
1419
1476
 
1420
1477
  // src/actions/package/compile/packageCompileTscTypes.ts
1421
1478
  import { cwd } from "node:process";
1422
- import chalk22 from "chalk";
1479
+ import chalk23 from "chalk";
1423
1480
  import { createProgramFromConfig } from "tsc-prog";
1424
1481
  import { DiagnosticCategory, formatDiagnosticsWithColorAndContext, getPreEmitDiagnostics, sys as sys2 } from "typescript";
1425
1482
 
@@ -1476,7 +1533,7 @@ var packageCompileTscTypes = /* @__PURE__ */ __name((folder = "src", config2 = {
1476
1533
  ".spec."
1477
1534
  ];
1478
1535
  const files = buildEntries(folder, "all", verbose).filter((file) => validTsExt.find((ext) => file.endsWith(ext)) && !excludes.some((exclude) => file.includes(exclude)));
1479
- console.log(chalk22.green(`Compiling Types ${pkg}: ${files.length}`));
1536
+ console.log(chalk23.green(`Compiling Types ${pkg}: ${files.length}`));
1480
1537
  if (files.length > 0) {
1481
1538
  const program = createProgramFromConfig({
1482
1539
  basePath: pkg ?? cwd(),
@@ -1507,7 +1564,6 @@ var packageCompileTscTypes = /* @__PURE__ */ __name((folder = "src", config2 = {
1507
1564
 
1508
1565
  // src/actions/package/compile/compileTypes.ts
1509
1566
  var packageCompileTypes = /* @__PURE__ */ __name(async (inConfig = {}) => {
1510
- const pkg = process.env.INIT_CWD;
1511
1567
  const config2 = await loadConfig(inConfig);
1512
1568
  return packageCompileTscTypes(void 0, config2);
1513
1569
  }, "packageCompileTypes");
@@ -1539,7 +1595,7 @@ __name(deepMergeObjects, "deepMergeObjects");
1539
1595
 
1540
1596
  // src/actions/package/compile/packageCompileTsc.ts
1541
1597
  import { cwd as cwd2 } from "node:process";
1542
- import chalk23 from "chalk";
1598
+ import chalk24 from "chalk";
1543
1599
  import { createProgramFromConfig as createProgramFromConfig2 } from "tsc-prog";
1544
1600
  import { DiagnosticCategory as DiagnosticCategory2, formatDiagnosticsWithColorAndContext as formatDiagnosticsWithColorAndContext2, getPreEmitDiagnostics as getPreEmitDiagnostics2, sys as sys3 } from "typescript";
1545
1601
  var packageCompileTsc = /* @__PURE__ */ __name((folder = "src", config2 = {}, compilerOptionsParam) => {
@@ -1574,7 +1630,7 @@ var packageCompileTsc = /* @__PURE__ */ __name((folder = "src", config2 = {}, co
1574
1630
  ".d.mts"
1575
1631
  ];
1576
1632
  const files = buildEntries(folder, "all", verbose).filter((file) => validTsExt.find((ext) => file.endsWith(ext)) && includes.find((include) => file.includes(include)));
1577
- console.log(chalk23.green(`Compiling Files ${pkg}: ${files.length}`));
1633
+ console.log(chalk24.green(`Compiling Files ${pkg}: ${files.length}`));
1578
1634
  if (files.length > 0) {
1579
1635
  const program = createProgramFromConfig2({
1580
1636
  basePath: pkg ?? cwd2(),
@@ -1734,7 +1790,7 @@ var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
1734
1790
  // src/actions/package/compile/compile.ts
1735
1791
  var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
1736
1792
  const pkg = process.env.INIT_CWD;
1737
- console.log(chalk24.green(`Compiling ${pkg}`));
1793
+ console.log(chalk25.green(`Compiling ${pkg}`));
1738
1794
  const config2 = await loadConfig(inConfig);
1739
1795
  const publint2 = config2.publint;
1740
1796
  const tsupResults = await packageCompileTsup(config2);
@@ -1746,7 +1802,7 @@ var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
1746
1802
 
1747
1803
  // src/actions/package/copy-assets.ts
1748
1804
  import path5 from "node:path/posix";
1749
- import chalk25 from "chalk";
1805
+ import chalk26 from "chalk";
1750
1806
  import cpy2 from "cpy";
1751
1807
  var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) => {
1752
1808
  try {
@@ -1765,7 +1821,7 @@ var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) =>
1765
1821
  flat: false
1766
1822
  });
1767
1823
  if (values.length > 0) {
1768
- console.log(chalk25.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
1824
+ console.log(chalk26.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
1769
1825
  }
1770
1826
  for (const value of values) {
1771
1827
  console.log(`${value.split("/").pop()} => ./dist/${target}`);
@@ -1793,10 +1849,51 @@ var packageCopyAssets = /* @__PURE__ */ __name(async ({ target }) => {
1793
1849
  }
1794
1850
  }, "packageCopyAssets");
1795
1851
 
1852
+ // src/actions/package/cycle.ts
1853
+ import { cruise } from "dependency-cruiser";
1854
+ var packageCycle = /* @__PURE__ */ __name(async ({ verbose = false }) => {
1855
+ const pkg = process.env.INIT_CWD;
1856
+ const pkgName = process.env.npm_package_name;
1857
+ const cruiseOptions = {
1858
+ ruleSet: {
1859
+ forbidden: [
1860
+ {
1861
+ name: "no-cycles",
1862
+ severity: "error",
1863
+ comment: "This dependency creates a circular reference",
1864
+ from: {},
1865
+ to: {
1866
+ circular: true
1867
+ }
1868
+ }
1869
+ ]
1870
+ },
1871
+ doNotFollow: {
1872
+ path: "node_modules"
1873
+ },
1874
+ tsPreCompilationDeps: false,
1875
+ combinedDependencies: true,
1876
+ outputType: verbose ? "text" : "err"
1877
+ };
1878
+ const target = `${pkg}/src`;
1879
+ const result = await cruise([
1880
+ target
1881
+ ], cruiseOptions);
1882
+ if (result.output) {
1883
+ console.log(result.output);
1884
+ }
1885
+ if (result.exitCode === 0) {
1886
+ console.log(`${pkgName} \u2705 No dependency violations`);
1887
+ } else {
1888
+ console.error(`${pkgName} \u274C Dependency violations found`);
1889
+ }
1890
+ return result.exitCode;
1891
+ }, "packageCycle");
1892
+
1796
1893
  // src/actions/package/gen-docs.ts
1797
1894
  import { existsSync as existsSync5 } from "node:fs";
1798
1895
  import path6 from "node:path";
1799
- import chalk26 from "chalk";
1896
+ import chalk27 from "chalk";
1800
1897
  import { Application, ArgumentsReader, TSConfigReader, TypeDocReader } from "typedoc";
1801
1898
  var ExitCodes = {
1802
1899
  CompileError: 3,
@@ -1898,7 +1995,7 @@ var runTypeDoc = /* @__PURE__ */ __name(async (app) => {
1898
1995
  return ExitCodes.OutputError;
1899
1996
  }
1900
1997
  }
1901
- console.log(chalk26.green(`${pkgName} - Ok`));
1998
+ console.log(chalk27.green(`${pkgName} - Ok`));
1902
1999
  return ExitCodes.Ok;
1903
2000
  }, "runTypeDoc");
1904
2001
 
@@ -1907,8 +2004,8 @@ import { readdirSync } from "node:fs";
1907
2004
  import path7 from "node:path";
1908
2005
  import { cwd as cwd3 } from "node:process";
1909
2006
  import { pathToFileURL } from "node:url";
1910
- import chalk27 from "chalk";
1911
- import { ESLint as ESLint2 } from "eslint";
2007
+ import chalk28 from "chalk";
2008
+ import { ESLint } from "eslint";
1912
2009
  import { findUp } from "find-up";
1913
2010
  import picomatch from "picomatch";
1914
2011
  var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
@@ -1924,10 +2021,10 @@ var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
1924
2021
  ];
1925
2022
  for (const lintResult of lintResults) {
1926
2023
  if (lintResult.messages.length > 0) {
1927
- console.log(chalk27.gray(`
2024
+ console.log(chalk28.gray(`
1928
2025
  ${lintResult.filePath}`));
1929
2026
  for (const message of lintResult.messages) {
1930
- console.log(chalk27.gray(` ${message.line}:${message.column}`), chalk27[colors[message.severity]](` ${severity[message.severity]}`), chalk27.white(` ${message.message}`), chalk27.gray(` ${message.ruleId}`));
2027
+ console.log(chalk28.gray(` ${message.line}:${message.column}`), chalk28[colors[message.severity]](` ${severity[message.severity]}`), chalk28.white(` ${message.message}`), chalk28.gray(` ${message.ruleId}`));
1931
2028
  }
1932
2029
  }
1933
2030
  }
@@ -1972,7 +2069,7 @@ var packageLint = /* @__PURE__ */ __name(async (fix2 = false, verbose = false, c
1972
2069
  ".vscode",
1973
2070
  ".github"
1974
2071
  ];
1975
- const engine = new ESLint2({
2072
+ const engine = new ESLint({
1976
2073
  baseConfig: [
1977
2074
  ...eslintConfig
1978
2075
  ],
@@ -1982,17 +2079,17 @@ var packageLint = /* @__PURE__ */ __name(async (fix2 = false, verbose = false, c
1982
2079
  });
1983
2080
  const files = getFiles(cwd3(), ignoreFolders);
1984
2081
  if (verbose) {
1985
- console.log(chalk27.green(`Linting ${pkg} [files = ${files.length}]`));
2082
+ console.log(chalk28.green(`Linting ${pkg} [files = ${files.length}]`));
1986
2083
  }
1987
2084
  const lintResults = await engine.lintFiles(files);
1988
2085
  dumpMessages(lintResults);
1989
2086
  if (fix2) {
1990
- await ESLint2.outputFixes(lintResults);
2087
+ await ESLint.outputFixes(lintResults);
1991
2088
  }
1992
2089
  const filesCountColor = files.length < 100 ? "green" : files.length < 1e3 ? "yellow" : "red";
1993
2090
  const lintTime = Date.now() - start;
1994
2091
  const lintTimeColor = lintTime < 1e3 ? "green" : lintTime < 3e3 ? "yellow" : "red";
1995
- console.log(chalk27.white(`Linted ${chalk27[filesCountColor](files.length)} files in ${chalk27[lintTimeColor](lintTime)}ms`));
2092
+ console.log(chalk28.white(`Linted ${chalk28[filesCountColor](files.length)} files in ${chalk28[lintTimeColor](lintTime)}ms`));
1996
2093
  return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
1997
2094
  }, "packageLint");
1998
2095
 
@@ -2059,7 +2156,7 @@ var rebuild = /* @__PURE__ */ __name(({ target }) => {
2059
2156
  }, "rebuild");
2060
2157
 
2061
2158
  // src/actions/recompile.ts
2062
- import chalk28 from "chalk";
2159
+ import chalk29 from "chalk";
2063
2160
  var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incremental }) => {
2064
2161
  return pkg ? await recompilePackage({
2065
2162
  pkg,
@@ -2114,7 +2211,7 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
2114
2211
  `${jobs}`
2115
2212
  ] : [];
2116
2213
  if (jobs) {
2117
- console.log(chalk28.blue(`Jobs set to [${jobs}]`));
2214
+ console.log(chalk29.blue(`Jobs set to [${jobs}]`));
2118
2215
  }
2119
2216
  const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
2120
2217
  [
@@ -2144,7 +2241,7 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
2144
2241
  ]
2145
2242
  ]
2146
2243
  ]);
2147
- console.log(`${chalk28.gray("Recompiled in")} [${chalk28.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk28.gray("seconds")}`);
2244
+ console.log(`${chalk29.gray("Recompiled in")} [${chalk29.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk29.gray("seconds")}`);
2148
2245
  return result;
2149
2246
  }, "recompileAll");
2150
2247
 
@@ -2178,9 +2275,9 @@ var reinstall = /* @__PURE__ */ __name(() => {
2178
2275
  }, "reinstall");
2179
2276
 
2180
2277
  // src/actions/relint.ts
2181
- import chalk29 from "chalk";
2278
+ import chalk30 from "chalk";
2182
2279
  var relintPackage = /* @__PURE__ */ __name(({ pkg }) => {
2183
- console.log(chalk29.gray(`${"Relint"} [All-Packages]`));
2280
+ console.log(chalk30.gray(`${"Relint"} [All-Packages]`));
2184
2281
  const start = Date.now();
2185
2282
  const result = runSteps("Relint [All-Packages]", [
2186
2283
  [
@@ -2193,7 +2290,7 @@ var relintPackage = /* @__PURE__ */ __name(({ pkg }) => {
2193
2290
  ]
2194
2291
  ]
2195
2292
  ]);
2196
- console.log(chalk29.gray(`${"Relinted in"} [${chalk29.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk29.gray("seconds")}`));
2293
+ console.log(chalk30.gray(`${"Relinted in"} [${chalk30.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk30.gray("seconds")}`));
2197
2294
  return result;
2198
2295
  }, "relintPackage");
2199
2296
  var relint = /* @__PURE__ */ __name(({ pkg, verbose, incremental } = {}) => {
@@ -2205,7 +2302,7 @@ var relint = /* @__PURE__ */ __name(({ pkg, verbose, incremental } = {}) => {
2205
2302
  });
2206
2303
  }, "relint");
2207
2304
  var relintAllPackages = /* @__PURE__ */ __name(({ verbose = true, incremental } = {}) => {
2208
- console.log(chalk29.gray(`${"Relint"} [All-Packages]`));
2305
+ console.log(chalk30.gray(`${"Relint"} [All-Packages]`));
2209
2306
  const start = Date.now();
2210
2307
  const verboseOptions = verbose ? [
2211
2308
  "--verbose"
@@ -2232,7 +2329,7 @@ var relintAllPackages = /* @__PURE__ */ __name(({ verbose = true, incremental }
2232
2329
  ]
2233
2330
  ]
2234
2331
  ]);
2235
- console.log(chalk29.gray(`Relinted in [${chalk29.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk29.gray("seconds")}`));
2332
+ console.log(chalk30.gray(`Relinted in [${chalk30.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk30.gray("seconds")}`));
2236
2333
  return result;
2237
2334
  }, "relintAllPackages");
2238
2335
 
@@ -2272,7 +2369,7 @@ var sonar = /* @__PURE__ */ __name(() => {
2272
2369
  }, "sonar");
2273
2370
 
2274
2371
  // src/actions/statics.ts
2275
- import chalk30 from "chalk";
2372
+ import chalk31 from "chalk";
2276
2373
  var DefaultDependencies = [
2277
2374
  "axios",
2278
2375
  "@xylabs/pixel",
@@ -2283,7 +2380,7 @@ var DefaultDependencies = [
2283
2380
  "@mui/system"
2284
2381
  ];
2285
2382
  var statics = /* @__PURE__ */ __name(() => {
2286
- console.log(chalk30.green("Check Required Static Dependencies"));
2383
+ console.log(chalk31.green("Check Required Static Dependencies"));
2287
2384
  const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
2288
2385
  return detectDuplicateDependencies(statics2, DefaultDependencies);
2289
2386
  }, "statics");
@@ -2401,7 +2498,7 @@ var loadPackageConfig = /* @__PURE__ */ __name(async () => {
2401
2498
  }, "loadPackageConfig");
2402
2499
 
2403
2500
  // src/xy/xy.ts
2404
- import chalk32 from "chalk";
2501
+ import chalk33 from "chalk";
2405
2502
 
2406
2503
  // src/xy/xyBuildCommands.ts
2407
2504
  var xyBuildCommands = /* @__PURE__ */ __name((args) => {
@@ -2642,15 +2739,15 @@ var xyInstallCommands = /* @__PURE__ */ __name((args) => {
2642
2739
  }, "xyInstallCommands");
2643
2740
 
2644
2741
  // src/xy/xyLintCommands.ts
2645
- import chalk31 from "chalk";
2742
+ import chalk32 from "chalk";
2646
2743
  var xyLintCommands = /* @__PURE__ */ __name((args) => {
2647
2744
  return args.command("cycle [package]", "Cycle - Check for dependency cycles", (yargs2) => {
2648
2745
  return packagePositionalParam(yargs2);
2649
- }, async (argv) => {
2746
+ }, (argv) => {
2650
2747
  const start = Date.now();
2651
2748
  if (argv.verbose) console.log("Cycle");
2652
- process.exitCode = await cycle();
2653
- console.log(chalk31.blue(`Finished in ${Date.now() - start}ms`));
2749
+ process.exitCode = cycle();
2750
+ console.log(chalk32.blue(`Finished in ${Date.now() - start}ms`));
2654
2751
  }).command("lint [package]", "Lint - Run Eslint", (yargs2) => {
2655
2752
  return packagePositionalParam(yargs2);
2656
2753
  }, (argv) => {
@@ -2661,21 +2758,21 @@ var xyLintCommands = /* @__PURE__ */ __name((args) => {
2661
2758
  }) : lint({
2662
2759
  pkg: argv.package
2663
2760
  });
2664
- console.log(chalk31.blue(`Finished in ${Date.now() - start}ms`));
2761
+ console.log(chalk32.blue(`Finished in ${Date.now() - start}ms`));
2665
2762
  }).command("fix [package]", "Fix - Run Eslint w/fix", (yargs2) => {
2666
2763
  return packagePositionalParam(yargs2);
2667
2764
  }, (argv) => {
2668
2765
  const start = Date.now();
2669
2766
  if (argv.verbose) console.log("Fix");
2670
2767
  process.exitCode = fix();
2671
- console.log(chalk31.blue(`Finished in ${Date.now() - start}ms`));
2768
+ console.log(chalk32.blue(`Finished in ${Date.now() - start}ms`));
2672
2769
  }).command("relint [package]", "Relint - Clean & Lint", (yargs2) => {
2673
2770
  return packagePositionalParam(yargs2);
2674
2771
  }, (argv) => {
2675
2772
  if (argv.verbose) console.log("Relinting");
2676
2773
  const start = Date.now();
2677
2774
  process.exitCode = relint();
2678
- console.log(chalk31.blue(`Finished in ${Date.now() - start}ms`));
2775
+ console.log(chalk32.blue(`Finished in ${Date.now() - start}ms`));
2679
2776
  }).command("publint [package]", "Publint - Run Publint", (yargs2) => {
2680
2777
  return packagePositionalParam(yargs2);
2681
2778
  }, async (argv) => {
@@ -2685,21 +2782,21 @@ var xyLintCommands = /* @__PURE__ */ __name((args) => {
2685
2782
  pkg: argv.package,
2686
2783
  verbose: !!argv.verbose
2687
2784
  });
2688
- console.log(chalk31.blue(`Finished in ${Date.now() - start}ms`));
2785
+ console.log(chalk32.blue(`Finished in ${Date.now() - start}ms`));
2689
2786
  }).command("knip", "Knip - Run Knip", (yargs2) => {
2690
2787
  return packagePositionalParam(yargs2);
2691
2788
  }, (argv) => {
2692
2789
  if (argv.verbose) console.log("Knip");
2693
2790
  const start = Date.now();
2694
2791
  process.exitCode = knip();
2695
- console.log(chalk31.blue(`Knip finished in ${Date.now() - start}ms`));
2792
+ console.log(chalk32.blue(`Knip finished in ${Date.now() - start}ms`));
2696
2793
  }).command("sonar", "Sonar - Run Sonar Check", (yargs2) => {
2697
2794
  return packagePositionalParam(yargs2);
2698
2795
  }, (argv) => {
2699
2796
  const start = Date.now();
2700
2797
  if (argv.verbose) console.log("Sonar Check");
2701
2798
  process.exitCode = sonar();
2702
- console.log(chalk31.blue(`Finished in ${Date.now() - start}ms`));
2799
+ console.log(chalk32.blue(`Finished in ${Date.now() - start}ms`));
2703
2800
  });
2704
2801
  }, "xyLintCommands");
2705
2802
 
@@ -2761,8 +2858,8 @@ var xyParseOptions = /* @__PURE__ */ __name(() => {
2761
2858
  var xy = /* @__PURE__ */ __name(async () => {
2762
2859
  const options = xyParseOptions();
2763
2860
  return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
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"));
2861
+ console.error(chalk33.yellow(`Command not found [${chalk33.magenta(process.argv[2])}]`));
2862
+ console.log(chalk33.gray("Try 'yarn xy --help' for list of commands"));
2766
2863
  }).version().help().argv;
2767
2864
  }, "xy");
2768
2865
  export {
@@ -2785,6 +2882,8 @@ export {
2785
2882
  copyAssets,
2786
2883
  createBuildConfig,
2787
2884
  cycle,
2885
+ cycleAll,
2886
+ cyclePackage,
2788
2887
  dead,
2789
2888
  defaultBuildConfig,
2790
2889
  defaultReadFileSyncOptions,
@@ -2824,6 +2923,7 @@ export {
2824
2923
  packageCompileTsup,
2825
2924
  packageCompileTypes,
2826
2925
  packageCopyAssets,
2926
+ packageCycle,
2827
2927
  packageGenDocs,
2828
2928
  packageLint,
2829
2929
  packagePublint,