@xylabs/ts-scripts-yarn3 7.4.16 → 7.4.17

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 (42) hide show
  1. package/dist/actions/claude-settings.mjs +82 -0
  2. package/dist/actions/claude-settings.mjs.map +1 -0
  3. package/dist/actions/index.mjs +191 -116
  4. package/dist/actions/index.mjs.map +1 -1
  5. package/dist/actions/package/compile/buildEntries.mjs +4 -1
  6. package/dist/actions/package/compile/buildEntries.mjs.map +1 -1
  7. package/dist/actions/package/compile/compile.mjs +5 -2
  8. package/dist/actions/package/compile/compile.mjs.map +1 -1
  9. package/dist/actions/package/compile/index.mjs +5 -2
  10. package/dist/actions/package/compile/index.mjs.map +1 -1
  11. package/dist/actions/package/compile/packageCompileTsc.mjs +1 -1
  12. package/dist/actions/package/compile/packageCompileTsc.mjs.map +1 -1
  13. package/dist/actions/package/compile/packageCompileTsup.mjs +5 -2
  14. package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
  15. package/dist/actions/package/index.mjs +5 -2
  16. package/dist/actions/package/index.mjs.map +1 -1
  17. package/dist/actions/package/recompile.mjs +5 -2
  18. package/dist/actions/package/recompile.mjs.map +1 -1
  19. package/dist/bin/package/build-only.mjs +5 -2
  20. package/dist/bin/package/build-only.mjs.map +1 -1
  21. package/dist/bin/package/build.mjs +5 -2
  22. package/dist/bin/package/build.mjs.map +1 -1
  23. package/dist/bin/package/compile-only.mjs +5 -2
  24. package/dist/bin/package/compile-only.mjs.map +1 -1
  25. package/dist/bin/package/compile-tsup.mjs +5 -2
  26. package/dist/bin/package/compile-tsup.mjs.map +1 -1
  27. package/dist/bin/package/compile.mjs +5 -2
  28. package/dist/bin/package/compile.mjs.map +1 -1
  29. package/dist/bin/package/recompile.mjs +5 -2
  30. package/dist/bin/package/recompile.mjs.map +1 -1
  31. package/dist/bin/xy.mjs +150 -71
  32. package/dist/bin/xy.mjs.map +1 -1
  33. package/dist/index.d.ts +3 -1
  34. package/dist/index.mjs +211 -128
  35. package/dist/index.mjs.map +1 -1
  36. package/dist/xy/index.mjs +150 -71
  37. package/dist/xy/index.mjs.map +1 -1
  38. package/dist/xy/xy.mjs +150 -71
  39. package/dist/xy/xy.mjs.map +1 -1
  40. package/dist/xy/xyCommonCommands.mjs +96 -17
  41. package/dist/xy/xyCommonCommands.mjs.map +1 -1
  42. package/package.json +2 -2
package/dist/xy/xy.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/xy/xy.ts
2
- import chalk30 from "chalk";
2
+ import chalk31 from "chalk";
3
3
 
4
4
  // src/actions/build.ts
5
5
  import chalk9 from "chalk";
@@ -742,6 +742,77 @@ var claudeRules = ({ force } = {}) => {
742
742
  return 0;
743
743
  };
744
744
 
745
+ // src/actions/claude-settings.ts
746
+ import {
747
+ existsSync as existsSync6,
748
+ mkdirSync as mkdirSync3,
749
+ writeFileSync as writeFileSync4
750
+ } from "fs";
751
+ import PATH5 from "path";
752
+ import { createInterface } from "readline";
753
+ import chalk12 from "chalk";
754
+ var DEFAULT_SETTINGS = {
755
+ permissions: {
756
+ allow: [
757
+ "Bash(git *)",
758
+ "Bash(yarn *)",
759
+ "Bash(npx *)",
760
+ "Bash(node *)",
761
+ "Bash(ls *)",
762
+ "Bash(mkdir *)",
763
+ "Bash(cp *)",
764
+ "Bash(mv *)",
765
+ "Bash(rm *)",
766
+ "Bash(cat *)",
767
+ "Bash(head *)",
768
+ "Bash(tail *)",
769
+ "Bash(echo *)",
770
+ "Bash(pwd)",
771
+ "Bash(which *)",
772
+ "Bash(gh *)",
773
+ "Read",
774
+ "Edit",
775
+ "Write",
776
+ "Glob",
777
+ "Grep",
778
+ "Skill"
779
+ ],
780
+ deny: [
781
+ "Bash(git push --force*)",
782
+ "Bash(git reset --hard*)",
783
+ "Bash(rm -rf /*)"
784
+ ]
785
+ }
786
+ };
787
+ function askConfirmation(question) {
788
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
789
+ return new Promise((resolve) => {
790
+ rl.question(question, (answer) => {
791
+ rl.close();
792
+ resolve(answer.toLowerCase() === "y" || answer.toLowerCase() === "yes");
793
+ });
794
+ });
795
+ }
796
+ async function claudeSettings() {
797
+ const cwd = INIT_CWD() ?? process.cwd();
798
+ const claudeDir = PATH5.resolve(cwd, ".claude");
799
+ const settingsPath = PATH5.resolve(claudeDir, "settings.local.json");
800
+ mkdirSync3(claudeDir, { recursive: true });
801
+ if (existsSync6(settingsPath)) {
802
+ const confirmed = await askConfirmation(
803
+ chalk12.yellow(`${settingsPath} already exists. Replace it? (y/N) `)
804
+ );
805
+ if (!confirmed) {
806
+ console.log(chalk12.gray("Skipped \u2014 existing settings.local.json preserved"));
807
+ return 0;
808
+ }
809
+ }
810
+ writeFileSync4(settingsPath, `${JSON.stringify(DEFAULT_SETTINGS, null, 2)}
811
+ `, "utf8");
812
+ console.log(chalk12.green("Generated .claude/settings.local.json"));
813
+ return 0;
814
+ }
815
+
745
816
  // src/actions/clean.ts
746
817
  var clean = async ({ verbose, pkg }) => {
747
818
  return pkg ? await cleanPackage({ pkg, verbose }) : cleanAll({ verbose });
@@ -756,16 +827,16 @@ var cleanAll = ({ verbose }) => {
756
827
 
757
828
  // src/actions/clean-docs.ts
758
829
  import path from "path";
759
- import chalk12 from "chalk";
830
+ import chalk13 from "chalk";
760
831
  var cleanDocs = () => {
761
832
  const pkgName = process.env.npm_package_name;
762
- console.log(chalk12.green(`Cleaning Docs [${pkgName}]`));
833
+ console.log(chalk13.green(`Cleaning Docs [${pkgName}]`));
763
834
  for (const { location } of yarnWorkspaces()) deleteGlob(path.join(location, "docs"));
764
835
  return 0;
765
836
  };
766
837
 
767
838
  // src/actions/compile.ts
768
- import chalk13 from "chalk";
839
+ import chalk14 from "chalk";
769
840
  var compile = ({
770
841
  verbose,
771
842
  target,
@@ -806,7 +877,7 @@ var compileAll = ({
806
877
  const incrementalOptions = incremental ? ["--since", "-Ap", "--topological-dev"] : ["--parallel", "-Ap", "--topological-dev"];
807
878
  const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
808
879
  if (jobs) {
809
- console.log(chalk13.blue(`Jobs set to [${jobs}]`));
880
+ console.log(chalk14.blue(`Jobs set to [${jobs}]`));
810
881
  }
811
882
  const result = runSteps(`Compile${incremental ? "-Incremental" : ""} [All]`, [
812
883
  ["yarn", [
@@ -820,13 +891,13 @@ var compileAll = ({
820
891
  ...targetOptions
821
892
  ]]
822
893
  ]);
823
- console.log(`${chalk13.gray("Compiled in")} [${chalk13.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk13.gray("seconds")}`);
894
+ console.log(`${chalk14.gray("Compiled in")} [${chalk14.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk14.gray("seconds")}`);
824
895
  return result;
825
896
  };
826
897
 
827
898
  // src/actions/copy-assets.ts
828
899
  import path2 from "path/posix";
829
- import chalk14 from "chalk";
900
+ import chalk15 from "chalk";
830
901
  import cpy from "cpy";
831
902
  var copyPackageTargetAssets = async (target, name, location) => {
832
903
  try {
@@ -849,7 +920,7 @@ var copyPackageTargetAssets = async (target, name, location) => {
849
920
  };
850
921
  var copyTargetAssets = async (target, pkg) => {
851
922
  const workspaces = yarnWorkspaces();
852
- console.log(chalk14.green(`Copying Assets [${target.toUpperCase()}]`));
923
+ console.log(chalk15.green(`Copying Assets [${target.toUpperCase()}]`));
853
924
  const workspaceList = workspaces.filter(({ name }) => {
854
925
  return pkg === void 0 || name === pkg;
855
926
  });
@@ -933,7 +1004,7 @@ var dead = () => {
933
1004
  };
934
1005
 
935
1006
  // src/actions/deplint/deplint.ts
936
- import chalk20 from "chalk";
1007
+ import chalk21 from "chalk";
937
1008
 
938
1009
  // src/actions/deplint/findFiles.ts
939
1010
  import fs2 from "fs";
@@ -1135,7 +1206,7 @@ function getExternalImportsFromFiles({
1135
1206
 
1136
1207
  // src/actions/deplint/checkPackage/getUnlistedDependencies.ts
1137
1208
  import { builtinModules } from "module";
1138
- import chalk15 from "chalk";
1209
+ import chalk16 from "chalk";
1139
1210
  function isRuntimeImportListed(imp, name, dependencies, peerDependencies) {
1140
1211
  return dependencies.includes(imp) || imp === name || peerDependencies.includes(imp) || builtinModules.includes(imp);
1141
1212
  }
@@ -1143,7 +1214,7 @@ function isTypeImportListed(imp, name, dependencies, devDependencies, peerDepend
1143
1214
  return dependencies.includes(imp) || imp === name || dependencies.includes(`@types/${imp}`) || peerDependencies.includes(imp) || peerDependencies.includes(`@types/${imp}`) || devDependencies.includes(`@types/${imp}`) || builtinModules.includes(imp);
1144
1215
  }
1145
1216
  function logMissing(name, imp, importPaths) {
1146
- console.log(`[${chalk15.blue(name)}] Missing dependency in package.json: ${chalk15.red(imp)}`);
1217
+ console.log(`[${chalk16.blue(name)}] Missing dependency in package.json: ${chalk16.red(imp)}`);
1147
1218
  if (importPaths[imp]) {
1148
1219
  console.log(` ${importPaths[imp].join("\n ")}`);
1149
1220
  }
@@ -1172,7 +1243,7 @@ function getUnlistedDependencies({ name, location }, {
1172
1243
  }
1173
1244
  if (unlistedDependencies > 0) {
1174
1245
  const packageLocation = `${location}/package.json`;
1175
- console.log(` ${chalk15.yellow(packageLocation)}
1246
+ console.log(` ${chalk16.yellow(packageLocation)}
1176
1247
  `);
1177
1248
  }
1178
1249
  return unlistedDependencies;
@@ -1180,7 +1251,7 @@ function getUnlistedDependencies({ name, location }, {
1180
1251
 
1181
1252
  // src/actions/deplint/checkPackage/getUnlistedDevDependencies.ts
1182
1253
  import { builtinModules as builtinModules2 } from "module";
1183
- import chalk16 from "chalk";
1254
+ import chalk17 from "chalk";
1184
1255
  function getUnlistedDevDependencies({ name, location }, {
1185
1256
  devDependencies,
1186
1257
  dependencies,
@@ -1194,7 +1265,7 @@ function getUnlistedDevDependencies({ name, location }, {
1194
1265
  for (const imp of externalAllImports) {
1195
1266
  if (!distImports.includes(imp) && imp !== name && !dependencies.includes(imp) && !dependencies.includes(`@types/${imp}`) && !peerDependencies.includes(imp) && !peerDependencies.includes(`@types/${imp}`) && !devDependencies.includes(imp) && !devDependencies.includes(`@types/${imp}`) && !builtinModules2.includes(imp)) {
1196
1267
  unlistedDevDependencies++;
1197
- console.log(`[${chalk16.blue(name)}] Missing devDependency in package.json: ${chalk16.red(imp)}`);
1268
+ console.log(`[${chalk17.blue(name)}] Missing devDependency in package.json: ${chalk17.red(imp)}`);
1198
1269
  if (allImportPaths[imp]) {
1199
1270
  console.log(` ${allImportPaths[imp].join("\n ")}`);
1200
1271
  }
@@ -1202,14 +1273,14 @@ function getUnlistedDevDependencies({ name, location }, {
1202
1273
  }
1203
1274
  if (unlistedDevDependencies > 0) {
1204
1275
  const packageLocation = `${location}/package.json`;
1205
- console.log(` ${chalk16.yellow(packageLocation)}
1276
+ console.log(` ${chalk17.yellow(packageLocation)}
1206
1277
  `);
1207
1278
  }
1208
1279
  return unlistedDevDependencies;
1209
1280
  }
1210
1281
 
1211
1282
  // src/actions/deplint/checkPackage/getUnusedDependencies.ts
1212
- import chalk17 from "chalk";
1283
+ import chalk18 from "chalk";
1213
1284
  function getUnusedDependencies({ name, location }, { dependencies }, {
1214
1285
  externalDistImports,
1215
1286
  externalDistTypeImports,
@@ -1221,22 +1292,22 @@ function getUnusedDependencies({ name, location }, { dependencies }, {
1221
1292
  if (!externalDistImports.includes(dep) && !externalDistImports.includes(dep.replace(/^@types\//, "")) && !externalDistTypeImports.includes(dep) && !externalDistTypeImports.includes(dep.replace(/^@types\//, ""))) {
1222
1293
  unusedDependencies++;
1223
1294
  if (externalAllImports.includes(dep)) {
1224
- console.log(`[${chalk17.blue(name)}] dependency should be devDependency in package.json: ${chalk17.red(dep)}`);
1295
+ console.log(`[${chalk18.blue(name)}] dependency should be devDependency in package.json: ${chalk18.red(dep)}`);
1225
1296
  } else {
1226
- console.log(`[${chalk17.blue(name)}] Unused dependency in package.json: ${chalk17.red(dep)}`);
1297
+ console.log(`[${chalk18.blue(name)}] Unused dependency in package.json: ${chalk18.red(dep)}`);
1227
1298
  }
1228
1299
  }
1229
1300
  }
1230
1301
  if (unusedDependencies > 0) {
1231
1302
  const packageLocation = `${location}/package.json`;
1232
- console.log(` ${chalk17.yellow(packageLocation)}
1303
+ console.log(` ${chalk18.yellow(packageLocation)}
1233
1304
  `);
1234
1305
  }
1235
1306
  return unusedDependencies;
1236
1307
  }
1237
1308
 
1238
1309
  // src/actions/deplint/checkPackage/getUnusedDevDependencies.ts
1239
- import chalk18 from "chalk";
1310
+ import chalk19 from "chalk";
1240
1311
 
1241
1312
  // src/actions/deplint/getCliReferencedPackagesFromFiles.ts
1242
1313
  import fs8 from "fs";
@@ -1520,19 +1591,19 @@ function getUnusedDevDependencies({ name, location }, {
1520
1591
  if (dependencies.includes(dep) || peerDependencies.includes(dep)) continue;
1521
1592
  if (!isDevDepUsed(dep, allImports, implicitDeps, requiredPeers, scriptRefs, cliRefs)) {
1522
1593
  unusedDevDependencies++;
1523
- console.log(`[${chalk18.blue(name)}] Unused devDependency in package.json: ${chalk18.red(dep)}`);
1594
+ console.log(`[${chalk19.blue(name)}] Unused devDependency in package.json: ${chalk19.red(dep)}`);
1524
1595
  }
1525
1596
  }
1526
1597
  if (unusedDevDependencies > 0) {
1527
1598
  const packageLocation = `${location}/package.json`;
1528
- console.log(` ${chalk18.yellow(packageLocation)}
1599
+ console.log(` ${chalk19.yellow(packageLocation)}
1529
1600
  `);
1530
1601
  }
1531
1602
  return unusedDevDependencies;
1532
1603
  }
1533
1604
 
1534
1605
  // src/actions/deplint/checkPackage/getUnusedPeerDependencies.ts
1535
- import chalk19 from "chalk";
1606
+ import chalk20 from "chalk";
1536
1607
  function getUnusedPeerDependencies({ name, location }, { peerDependencies, dependencies }, { externalDistImports, externalDistTypeImports }, exclude) {
1537
1608
  let unusedDependencies = 0;
1538
1609
  for (const dep of peerDependencies) {
@@ -1540,15 +1611,15 @@ function getUnusedPeerDependencies({ name, location }, { peerDependencies, depen
1540
1611
  if (!externalDistImports.includes(dep) && !externalDistImports.includes(dep.replace(/^@types\//, "")) && !externalDistTypeImports.includes(dep) && !externalDistTypeImports.includes(dep.replace(/^@types\//, ""))) {
1541
1612
  unusedDependencies++;
1542
1613
  if (dependencies.includes(dep)) {
1543
- console.log(`[${chalk19.blue(name)}] Unused peerDependency [already a dependency] in package.json: ${chalk19.red(dep)}`);
1614
+ console.log(`[${chalk20.blue(name)}] Unused peerDependency [already a dependency] in package.json: ${chalk20.red(dep)}`);
1544
1615
  } else {
1545
- console.log(`[${chalk19.blue(name)}] Unused peerDependency in package.json: ${chalk19.red(dep)}`);
1616
+ console.log(`[${chalk20.blue(name)}] Unused peerDependency in package.json: ${chalk20.red(dep)}`);
1546
1617
  }
1547
1618
  }
1548
1619
  }
1549
1620
  if (unusedDependencies > 0) {
1550
1621
  const packageLocation = `${location}/package.json`;
1551
- console.log(` ${chalk19.yellow(packageLocation)}
1622
+ console.log(` ${chalk20.yellow(packageLocation)}
1552
1623
  `);
1553
1624
  }
1554
1625
  return unusedDependencies;
@@ -1643,9 +1714,9 @@ var deplint = async ({
1643
1714
  });
1644
1715
  }
1645
1716
  if (totalErrors > 0) {
1646
- console.warn(`Deplint: Found ${chalk20.red(totalErrors)} dependency problems. ${chalk20.red("\u2716")}`);
1717
+ console.warn(`Deplint: Found ${chalk21.red(totalErrors)} dependency problems. ${chalk21.red("\u2716")}`);
1647
1718
  } else {
1648
- console.info(`Deplint: Found no dependency problems. ${chalk20.green("\u2714")}`);
1719
+ console.info(`Deplint: Found no dependency problems. ${chalk21.green("\u2714")}`);
1649
1720
  }
1650
1721
  return 0;
1651
1722
  };
@@ -1747,22 +1818,22 @@ var deployNext = () => {
1747
1818
  };
1748
1819
 
1749
1820
  // src/actions/dupdeps.ts
1750
- import chalk21 from "chalk";
1821
+ import chalk22 from "chalk";
1751
1822
  var dupdeps = () => {
1752
- console.log(chalk21.green("Checking all Dependencies for Duplicates"));
1823
+ console.log(chalk22.green("Checking all Dependencies for Duplicates"));
1753
1824
  const allDependencies = parsedPackageJSON()?.dependencies;
1754
1825
  const dependencies = Object.entries(allDependencies).map(([k]) => k);
1755
1826
  return detectDuplicateDependencies(dependencies);
1756
1827
  };
1757
1828
 
1758
1829
  // src/actions/lint.ts
1759
- import chalk22 from "chalk";
1830
+ import chalk23 from "chalk";
1760
1831
  var lintPackage = ({
1761
1832
  pkg,
1762
1833
  fix: fix2,
1763
1834
  verbose
1764
1835
  }) => {
1765
- console.log(chalk22.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
1836
+ console.log(chalk23.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
1766
1837
  const start = Date.now();
1767
1838
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
1768
1839
  ["yarn", [
@@ -1772,7 +1843,7 @@ var lintPackage = ({
1772
1843
  fix2 ? "package-fix" : verbose ? "package-lint-verbose" : "package-lint"
1773
1844
  ]]
1774
1845
  ]);
1775
- console.log(chalk22.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk22.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk22.gray("seconds")}`));
1846
+ console.log(chalk23.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk23.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk23.gray("seconds")}`));
1776
1847
  return result;
1777
1848
  };
1778
1849
  var lint = ({
@@ -1792,13 +1863,13 @@ var lint = ({
1792
1863
  });
1793
1864
  };
1794
1865
  var lintAllPackages = ({ fix: fix2 = false } = {}) => {
1795
- console.log(chalk22.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
1866
+ console.log(chalk23.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
1796
1867
  const start = Date.now();
1797
1868
  const fixOptions = fix2 ? ["--fix"] : [];
1798
1869
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
1799
1870
  ["yarn", ["eslint", "--cache", "--cache-location", ".eslintcache", "--cache-strategy", "content", ...fixOptions]]
1800
1871
  ]);
1801
- console.log(chalk22.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk22.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk22.gray("seconds")}`));
1872
+ console.log(chalk23.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk23.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk23.gray("seconds")}`));
1802
1873
  return result;
1803
1874
  };
1804
1875
 
@@ -1826,7 +1897,7 @@ var filename = ".gitignore";
1826
1897
  var gitignoreGen = (pkg) => generateIgnoreFiles(filename, pkg);
1827
1898
 
1828
1899
  // src/actions/gitlint.ts
1829
- import chalk23 from "chalk";
1900
+ import chalk24 from "chalk";
1830
1901
  import ParseGitConfig from "parse-git-config";
1831
1902
  var gitlint = () => {
1832
1903
  console.log(`
@@ -1837,7 +1908,7 @@ Gitlint Start [${process.cwd()}]
1837
1908
  const errors = 0;
1838
1909
  const gitConfig = ParseGitConfig.sync();
1839
1910
  const warn = (message) => {
1840
- console.warn(chalk23.yellow(`Warning: ${message}`));
1911
+ console.warn(chalk24.yellow(`Warning: ${message}`));
1841
1912
  warnings++;
1842
1913
  };
1843
1914
  if (gitConfig.core.ignorecase) {
@@ -1857,13 +1928,13 @@ Gitlint Start [${process.cwd()}]
1857
1928
  }
1858
1929
  const resultMessages = [];
1859
1930
  if (valid > 0) {
1860
- resultMessages.push(chalk23.green(`Passed: ${valid}`));
1931
+ resultMessages.push(chalk24.green(`Passed: ${valid}`));
1861
1932
  }
1862
1933
  if (warnings > 0) {
1863
- resultMessages.push(chalk23.yellow(`Warnings: ${warnings}`));
1934
+ resultMessages.push(chalk24.yellow(`Warnings: ${warnings}`));
1864
1935
  }
1865
1936
  if (errors > 0) {
1866
- resultMessages.push(chalk23.red(` Errors: ${errors}`));
1937
+ resultMessages.push(chalk24.red(` Errors: ${errors}`));
1867
1938
  }
1868
1939
  console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
1869
1940
  `);
@@ -1872,7 +1943,7 @@ Gitlint Start [${process.cwd()}]
1872
1943
 
1873
1944
  // src/actions/gitlint-fix.ts
1874
1945
  import { execSync as execSync3 } from "child_process";
1875
- import chalk24 from "chalk";
1946
+ import chalk25 from "chalk";
1876
1947
  import ParseGitConfig2 from "parse-git-config";
1877
1948
  var gitlintFix = () => {
1878
1949
  console.log(`
@@ -1881,15 +1952,15 @@ Gitlint Fix Start [${process.cwd()}]
1881
1952
  const gitConfig = ParseGitConfig2.sync();
1882
1953
  if (gitConfig.core.ignorecase) {
1883
1954
  execSync3("git config core.ignorecase false", { stdio: "inherit" });
1884
- console.warn(chalk24.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
1955
+ console.warn(chalk25.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
1885
1956
  }
1886
1957
  if (gitConfig.core.autocrlf !== false) {
1887
1958
  execSync3("git config core.autocrlf false", { stdio: "inherit" });
1888
- console.warn(chalk24.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
1959
+ console.warn(chalk25.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
1889
1960
  }
1890
1961
  if (gitConfig.core.eol !== "lf") {
1891
1962
  execSync3("git config core.eol lf", { stdio: "inherit" });
1892
- console.warn(chalk24.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
1963
+ console.warn(chalk25.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
1893
1964
  }
1894
1965
  return 1;
1895
1966
  };
@@ -1900,7 +1971,7 @@ var knip = () => {
1900
1971
  };
1901
1972
 
1902
1973
  // src/actions/license.ts
1903
- import chalk25 from "chalk";
1974
+ import chalk26 from "chalk";
1904
1975
  import { init } from "license-checker";
1905
1976
  var license = async (pkg) => {
1906
1977
  const workspaces = yarnWorkspaces();
@@ -1925,18 +1996,18 @@ var license = async (pkg) => {
1925
1996
  "LGPL-3.0-or-later",
1926
1997
  "Python-2.0"
1927
1998
  ]);
1928
- console.log(chalk25.green("License Checker"));
1999
+ console.log(chalk26.green("License Checker"));
1929
2000
  return (await Promise.all(
1930
2001
  workspaceList.map(({ location, name }) => {
1931
2002
  return new Promise((resolve) => {
1932
2003
  init({ production: true, start: location }, (error, packages) => {
1933
2004
  if (error) {
1934
- console.error(chalk25.red(`License Checker [${name}] Error`));
1935
- console.error(chalk25.gray(error));
2005
+ console.error(chalk26.red(`License Checker [${name}] Error`));
2006
+ console.error(chalk26.gray(error));
1936
2007
  console.log("\n");
1937
2008
  resolve(1);
1938
2009
  } else {
1939
- console.log(chalk25.green(`License Checker [${name}]`));
2010
+ console.log(chalk26.green(`License Checker [${name}]`));
1940
2011
  let count = 0;
1941
2012
  for (const [name2, info] of Object.entries(packages)) {
1942
2013
  const licenses = Array.isArray(info.licenses) ? info.licenses : [info.licenses];
@@ -1952,7 +2023,7 @@ var license = async (pkg) => {
1952
2023
  }
1953
2024
  if (!orLicenseFound) {
1954
2025
  count++;
1955
- console.warn(chalk25.yellow(`${name2}: Package License not allowed [${license2}]`));
2026
+ console.warn(chalk26.yellow(`${name2}: Package License not allowed [${license2}]`));
1956
2027
  }
1957
2028
  }
1958
2029
  }
@@ -2011,7 +2082,7 @@ var rebuild = ({ target }) => {
2011
2082
  };
2012
2083
 
2013
2084
  // src/actions/recompile.ts
2014
- import chalk26 from "chalk";
2085
+ import chalk27 from "chalk";
2015
2086
  var recompile = async ({
2016
2087
  verbose,
2017
2088
  target,
@@ -2047,7 +2118,7 @@ var recompileAll = async ({
2047
2118
  const incrementalOptions = incremental ? ["--since", "-Apt", "--topological-dev"] : ["--parallel", "-Apt", "--topological-dev"];
2048
2119
  const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
2049
2120
  if (jobs) {
2050
- console.log(chalk26.blue(`Jobs set to [${jobs}]`));
2121
+ console.log(chalk27.blue(`Jobs set to [${jobs}]`));
2051
2122
  }
2052
2123
  const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
2053
2124
  [
@@ -2078,7 +2149,7 @@ var recompileAll = async ({
2078
2149
  ]
2079
2150
  ]);
2080
2151
  console.log(
2081
- `${chalk26.gray("Recompiled in")} [${chalk26.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk26.gray("seconds")}`
2152
+ `${chalk27.gray("Recompiled in")} [${chalk27.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk27.gray("seconds")}`
2082
2153
  );
2083
2154
  return result;
2084
2155
  };
@@ -2109,13 +2180,13 @@ var reinstall = () => {
2109
2180
  };
2110
2181
 
2111
2182
  // src/actions/relint.ts
2112
- import chalk27 from "chalk";
2183
+ import chalk28 from "chalk";
2113
2184
  var relintPackage = ({
2114
2185
  pkg,
2115
2186
  fix: fix2,
2116
2187
  verbose
2117
2188
  }) => {
2118
- console.log(chalk27.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
2189
+ console.log(chalk28.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
2119
2190
  const start = Date.now();
2120
2191
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
2121
2192
  ["yarn", [
@@ -2125,7 +2196,7 @@ var relintPackage = ({
2125
2196
  fix2 ? "package-fix" : verbose ? "package-lint-verbose" : "package-lint"
2126
2197
  ]]
2127
2198
  ]);
2128
- console.log(chalk27.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk27.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk27.gray("seconds")}`));
2199
+ console.log(chalk28.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk28.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk28.gray("seconds")}`));
2129
2200
  return result;
2130
2201
  };
2131
2202
  var relint = ({
@@ -2145,13 +2216,13 @@ var relint = ({
2145
2216
  });
2146
2217
  };
2147
2218
  var relintAllPackages = ({ fix: fix2 = false } = {}) => {
2148
- console.log(chalk27.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
2219
+ console.log(chalk28.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
2149
2220
  const start = Date.now();
2150
2221
  const fixOptions = fix2 ? ["--fix"] : [];
2151
2222
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
2152
2223
  ["yarn", ["eslint", ...fixOptions]]
2153
2224
  ]);
2154
- console.log(chalk27.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk27.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk27.gray("seconds")}`));
2225
+ console.log(chalk28.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk28.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk28.gray("seconds")}`));
2155
2226
  return result;
2156
2227
  };
2157
2228
 
@@ -2169,10 +2240,10 @@ var sonar = () => {
2169
2240
  };
2170
2241
 
2171
2242
  // src/actions/statics.ts
2172
- import chalk28 from "chalk";
2243
+ import chalk29 from "chalk";
2173
2244
  var DefaultDependencies = ["axios", "@xylabs/pixel", "react", "graphql", "react-router", "@mui/material", "@mui/system"];
2174
2245
  var statics = () => {
2175
- console.log(chalk28.green("Check Required Static Dependencies"));
2246
+ console.log(chalk29.green("Check Required Static Dependencies"));
2176
2247
  const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
2177
2248
  return detectDuplicateDependencies(statics2, DefaultDependencies);
2178
2249
  };
@@ -2333,6 +2404,14 @@ var xyCommonCommands = (args) => {
2333
2404
  if (argv.verbose) console.log("Claude Commands");
2334
2405
  process.exitCode = claudeCommands();
2335
2406
  }
2407
+ ).command(
2408
+ "claude-settings",
2409
+ "Claude Settings - Initialize .claude/settings.local.json with XY Labs defaults",
2410
+ (yargs2) => yargs2,
2411
+ async (argv) => {
2412
+ if (argv.verbose) console.log("Claude Settings");
2413
+ process.exitCode = await claudeSettings();
2414
+ }
2336
2415
  ).command(
2337
2416
  "claude-rules",
2338
2417
  "Claude Rules - Sync XY Labs standard Claude rules to .claude/rules/",
@@ -2618,7 +2697,7 @@ var xyInstallCommands = (args) => {
2618
2697
  };
2619
2698
 
2620
2699
  // src/xy/xyLintCommands.ts
2621
- import chalk29 from "chalk";
2700
+ import chalk30 from "chalk";
2622
2701
  var xyLintCommands = (args) => {
2623
2702
  return args.command(
2624
2703
  "cycle [package]",
@@ -2630,7 +2709,7 @@ var xyLintCommands = (args) => {
2630
2709
  const start = Date.now();
2631
2710
  if (argv.verbose) console.log("Cycle");
2632
2711
  process.exitCode = await cycle({ pkg: argv.package });
2633
- console.log(chalk29.blue(`Finished in ${Date.now() - start}ms`));
2712
+ console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2634
2713
  }
2635
2714
  ).command(
2636
2715
  "lint [package]",
@@ -2660,7 +2739,7 @@ var xyLintCommands = (args) => {
2660
2739
  cache: argv.cache,
2661
2740
  verbose: !!argv.verbose
2662
2741
  });
2663
- console.log(chalk29.blue(`Finished in ${Date.now() - start}ms`));
2742
+ console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2664
2743
  }
2665
2744
  ).command(
2666
2745
  "deplint [package]",
@@ -2699,7 +2778,7 @@ var xyLintCommands = (args) => {
2699
2778
  peerDeps: !!argv.peerDeps,
2700
2779
  verbose: !!argv.verbose
2701
2780
  });
2702
- console.log(chalk29.blue(`Finished in ${Date.now() - start}ms`));
2781
+ console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2703
2782
  }
2704
2783
  ).command(
2705
2784
  "fix [package]",
@@ -2711,7 +2790,7 @@ var xyLintCommands = (args) => {
2711
2790
  const start = Date.now();
2712
2791
  if (argv.verbose) console.log("Fix");
2713
2792
  process.exitCode = fix();
2714
- console.log(chalk29.blue(`Finished in ${Date.now() - start}ms`));
2793
+ console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2715
2794
  }
2716
2795
  ).command(
2717
2796
  "relint [package]",
@@ -2723,7 +2802,7 @@ var xyLintCommands = (args) => {
2723
2802
  if (argv.verbose) console.log("Relinting");
2724
2803
  const start = Date.now();
2725
2804
  process.exitCode = relint();
2726
- console.log(chalk29.blue(`Finished in ${Date.now() - start}ms`));
2805
+ console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2727
2806
  }
2728
2807
  ).command(
2729
2808
  "publint [package]",
@@ -2735,7 +2814,7 @@ var xyLintCommands = (args) => {
2735
2814
  if (argv.verbose) console.log("Publint");
2736
2815
  const start = Date.now();
2737
2816
  process.exitCode = await publint({ pkg: argv.package, verbose: !!argv.verbose });
2738
- console.log(chalk29.blue(`Finished in ${Date.now() - start}ms`));
2817
+ console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2739
2818
  }
2740
2819
  ).command(
2741
2820
  "knip",
@@ -2747,7 +2826,7 @@ var xyLintCommands = (args) => {
2747
2826
  if (argv.verbose) console.log("Knip");
2748
2827
  const start = Date.now();
2749
2828
  process.exitCode = knip();
2750
- console.log(chalk29.blue(`Knip finished in ${Date.now() - start}ms`));
2829
+ console.log(chalk30.blue(`Knip finished in ${Date.now() - start}ms`));
2751
2830
  }
2752
2831
  ).command(
2753
2832
  "sonar",
@@ -2759,7 +2838,7 @@ var xyLintCommands = (args) => {
2759
2838
  const start = Date.now();
2760
2839
  if (argv.verbose) console.log("Sonar Check");
2761
2840
  process.exitCode = sonar();
2762
- console.log(chalk29.blue(`Finished in ${Date.now() - start}ms`));
2841
+ console.log(chalk30.blue(`Finished in ${Date.now() - start}ms`));
2763
2842
  }
2764
2843
  );
2765
2844
  };
@@ -2795,8 +2874,8 @@ var xyParseOptions = () => {
2795
2874
  var xy = async () => {
2796
2875
  const options = xyParseOptions();
2797
2876
  return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
2798
- console.error(chalk30.yellow(`Command not found [${chalk30.magenta(process.argv[2])}]`));
2799
- console.log(chalk30.gray("Try 'yarn xy --help' for list of commands"));
2877
+ console.error(chalk31.yellow(`Command not found [${chalk31.magenta(process.argv[2])}]`));
2878
+ console.log(chalk31.gray("Try 'yarn xy --help' for list of commands"));
2800
2879
  }).version().help().argv;
2801
2880
  };
2802
2881
  export {