@xylabs/ts-scripts-yarn3 7.4.4 → 7.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -14,8 +14,27 @@ var checkResult = (name, result, level = "error", exitOnFail = false) => {
14
14
  }
15
15
  };
16
16
 
17
+ // src/lib/claudeMdTemplate.ts
18
+ import { readdirSync, readFileSync } from "fs";
19
+ import { createRequire } from "module";
20
+ import PATH from "path";
21
+ var require2 = createRequire(import.meta.url);
22
+ var packageRoot = PATH.dirname(require2.resolve("@xylabs/ts-scripts-yarn3/package.json"));
23
+ var templatesDir = PATH.resolve(packageRoot, "templates");
24
+ var XYLABS_RULES_PREFIX = "xylabs-";
25
+ var claudeMdRuleTemplates = () => {
26
+ const rulesDir = PATH.resolve(templatesDir, "rules");
27
+ const files = readdirSync(rulesDir).filter((f) => f.startsWith(XYLABS_RULES_PREFIX) && f.endsWith(".md"));
28
+ const result = {};
29
+ for (const file of files) {
30
+ result[file] = readFileSync(PATH.resolve(rulesDir, file), "utf8");
31
+ }
32
+ return result;
33
+ };
34
+ var claudeMdProjectTemplate = () => readFileSync(PATH.resolve(templatesDir, "CLAUDE-project.md"), "utf8");
35
+
17
36
  // src/lib/createBuildConfig.ts
18
- import { readFileSync } from "fs";
37
+ import { readFileSync as readFileSync2 } from "fs";
19
38
 
20
39
  // src/lib/defaultBuildConfig.ts
21
40
  var defaultBuildConfig = {
@@ -41,7 +60,7 @@ var defaultBuildConfig = {
41
60
  var getGeneralTypescriptConfig = (location) => {
42
61
  let generalConfig;
43
62
  try {
44
- generalConfig = readFileSync(`${location}/tsconfig.json`, { encoding: "utf8" });
63
+ generalConfig = readFileSync2(`${location}/tsconfig.json`, { encoding: "utf8" });
45
64
  } catch {
46
65
  return false;
47
66
  }
@@ -255,7 +274,7 @@ var CROSS_PLATFORM_NEWLINE = "\n";
255
274
  // src/lib/file/fileLines.ts
256
275
  import {
257
276
  existsSync,
258
- readFileSync as readFileSync2,
277
+ readFileSync as readFileSync3,
259
278
  writeFileSync
260
279
  } from "fs";
261
280
 
@@ -270,18 +289,18 @@ var union = (a, b) => /* @__PURE__ */ new Set([...new Set(a), ...new Set(b)]);
270
289
  var defaultReadFileSyncOptions = { encoding: "utf8" };
271
290
 
272
291
  // src/lib/file/fileLines.ts
273
- var readLines = (uri, options = defaultReadFileSyncOptions) => existsSync(uri) ? readFileSync2(uri, options).replace(WINDOWS_NEWLINE_REGEX, CROSS_PLATFORM_NEWLINE).split(CROSS_PLATFORM_NEWLINE) : [];
292
+ var readLines = (uri, options = defaultReadFileSyncOptions) => existsSync(uri) ? readFileSync3(uri, options).replace(WINDOWS_NEWLINE_REGEX, CROSS_PLATFORM_NEWLINE).split(CROSS_PLATFORM_NEWLINE) : [];
274
293
  var readNonEmptyLines = (uri, options = defaultReadFileSyncOptions) => readLines(uri, options).filter(notEmpty);
275
294
  var writeLines = (uri, lines, options = defaultReadFileSyncOptions) => {
276
- const existing = existsSync(uri) ? readFileSync2(uri, options) : void 0;
295
+ const existing = existsSync(uri) ? readFileSync3(uri, options) : void 0;
277
296
  const desired = lines.join(CROSS_PLATFORM_NEWLINE);
278
297
  if (existing !== desired) writeFileSync(uri, desired, options);
279
298
  };
280
299
 
281
300
  // src/lib/file/tryReadFileSync.ts
282
- import { existsSync as existsSync2, readFileSync as readFileSync3 } from "fs";
301
+ import { existsSync as existsSync2, readFileSync as readFileSync4 } from "fs";
283
302
  var tryReadFileSync = (uri, options = defaultReadFileSyncOptions) => {
284
- return existsSync2(uri) ? readFileSync3(uri, options) : void 0;
303
+ return existsSync2(uri) ? readFileSync4(uri, options) : void 0;
285
304
  };
286
305
 
287
306
  // src/lib/generateIgnoreFiles.ts
@@ -372,10 +391,10 @@ var loadConfig = async (params) => {
372
391
  };
373
392
 
374
393
  // src/lib/parsedPackageJSON.ts
375
- import { readFileSync as readFileSync4 } from "fs";
394
+ import { readFileSync as readFileSync5 } from "fs";
376
395
  var parsedPackageJSON = (path13) => {
377
396
  const pathToPackageJSON = path13 ?? process.env.npm_package_json ?? "";
378
- const packageJSON = readFileSync4(pathToPackageJSON).toString();
397
+ const packageJSON = readFileSync5(pathToPackageJSON).toString();
379
398
  return JSON.parse(packageJSON);
380
399
  };
381
400
 
@@ -503,6 +522,89 @@ var build = async ({
503
522
  return result;
504
523
  };
505
524
 
525
+ // src/actions/claude-rules.ts
526
+ import {
527
+ existsSync as existsSync5,
528
+ mkdirSync,
529
+ readdirSync as readdirSync2,
530
+ readFileSync as readFileSync6,
531
+ unlinkSync,
532
+ writeFileSync as writeFileSync2
533
+ } from "fs";
534
+ import PATH2 from "path";
535
+ import chalk10 from "chalk";
536
+ var syncRuleFiles = (rulesDir) => {
537
+ const templates = claudeMdRuleTemplates();
538
+ const templateNames = new Set(Object.keys(templates));
539
+ let updated = 0;
540
+ let created = 0;
541
+ for (const [filename3, content] of Object.entries(templates)) {
542
+ const targetPath = PATH2.resolve(rulesDir, filename3);
543
+ const existing = existsSync5(targetPath) ? readFileSync6(targetPath, "utf8") : void 0;
544
+ if (existing === content) continue;
545
+ writeFileSync2(targetPath, content, "utf8");
546
+ if (existing) {
547
+ updated++;
548
+ } else {
549
+ created++;
550
+ }
551
+ }
552
+ return {
553
+ created,
554
+ templateNames,
555
+ updated
556
+ };
557
+ };
558
+ var removeStaleRules = (rulesDir, templateNames) => {
559
+ const existingRules = readdirSync2(rulesDir).filter((f) => f.startsWith(XYLABS_RULES_PREFIX) && f.endsWith(".md"));
560
+ let removed = 0;
561
+ for (const file of existingRules) {
562
+ if (!templateNames.has(file)) {
563
+ unlinkSync(PATH2.resolve(rulesDir, file));
564
+ removed++;
565
+ }
566
+ }
567
+ return removed;
568
+ };
569
+ var logRulesResult = (created, updated, removed) => {
570
+ if (created || updated || removed) {
571
+ const parts = [
572
+ created ? `${created} created` : "",
573
+ updated ? `${updated} updated` : "",
574
+ removed ? `${removed} removed` : ""
575
+ ].filter(Boolean);
576
+ console.log(chalk10.green(`.claude/rules/${XYLABS_RULES_PREFIX}*.md: ${parts.join(", ")}`));
577
+ } else {
578
+ console.log(chalk10.gray(`.claude/rules/${XYLABS_RULES_PREFIX}*.md: already up to date`));
579
+ }
580
+ };
581
+ var ensureProjectClaudeMd = (cwd5, force) => {
582
+ const projectPath = PATH2.resolve(cwd5, "CLAUDE.md");
583
+ if (!existsSync5(projectPath) || force) {
584
+ if (force && existsSync5(projectPath)) {
585
+ console.log(chalk10.yellow("Overwriting existing CLAUDE.md"));
586
+ }
587
+ writeFileSync2(projectPath, claudeMdProjectTemplate(), "utf8");
588
+ console.log(chalk10.green("Generated CLAUDE.md"));
589
+ } else {
590
+ console.log(chalk10.gray("CLAUDE.md already exists (skipped)"));
591
+ }
592
+ };
593
+ var claudeRules = ({ force } = {}) => {
594
+ const cwd5 = INIT_CWD() ?? process.cwd();
595
+ const rulesDir = PATH2.resolve(cwd5, ".claude", "rules");
596
+ mkdirSync(rulesDir, { recursive: true });
597
+ const {
598
+ created,
599
+ templateNames,
600
+ updated
601
+ } = syncRuleFiles(rulesDir);
602
+ const removed = removeStaleRules(rulesDir, templateNames);
603
+ logRulesResult(created, updated, removed);
604
+ ensureProjectClaudeMd(cwd5, force);
605
+ return 0;
606
+ };
607
+
506
608
  // src/actions/clean.ts
507
609
  var clean = async ({ verbose, pkg }) => {
508
610
  return pkg ? await cleanPackage({ pkg, verbose }) : cleanAll({ verbose });
@@ -517,16 +619,16 @@ var cleanAll = ({ verbose }) => {
517
619
 
518
620
  // src/actions/clean-docs.ts
519
621
  import path from "path";
520
- import chalk10 from "chalk";
622
+ import chalk11 from "chalk";
521
623
  var cleanDocs = () => {
522
624
  const pkgName = process.env.npm_package_name;
523
- console.log(chalk10.green(`Cleaning Docs [${pkgName}]`));
625
+ console.log(chalk11.green(`Cleaning Docs [${pkgName}]`));
524
626
  for (const { location } of yarnWorkspaces()) deleteGlob(path.join(location, "docs"));
525
627
  return 0;
526
628
  };
527
629
 
528
630
  // src/actions/compile.ts
529
- import chalk11 from "chalk";
631
+ import chalk12 from "chalk";
530
632
  var compile = ({
531
633
  verbose,
532
634
  target,
@@ -567,7 +669,7 @@ var compileAll = ({
567
669
  const incrementalOptions = incremental ? ["--since", "-Ap", "--topological-dev"] : ["--parallel", "-Ap", "--topological-dev"];
568
670
  const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
569
671
  if (jobs) {
570
- console.log(chalk11.blue(`Jobs set to [${jobs}]`));
672
+ console.log(chalk12.blue(`Jobs set to [${jobs}]`));
571
673
  }
572
674
  const result = runSteps(`Compile${incremental ? "-Incremental" : ""} [All]`, [
573
675
  ["yarn", [
@@ -581,13 +683,13 @@ var compileAll = ({
581
683
  ...targetOptions
582
684
  ]]
583
685
  ]);
584
- console.log(`${chalk11.gray("Compiled in")} [${chalk11.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk11.gray("seconds")}`);
686
+ console.log(`${chalk12.gray("Compiled in")} [${chalk12.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk12.gray("seconds")}`);
585
687
  return result;
586
688
  };
587
689
 
588
690
  // src/actions/copy-assets.ts
589
691
  import path2 from "path/posix";
590
- import chalk12 from "chalk";
692
+ import chalk13 from "chalk";
591
693
  import cpy from "cpy";
592
694
  var copyPackageTargetAssets = async (target, name, location) => {
593
695
  try {
@@ -610,7 +712,7 @@ var copyPackageTargetAssets = async (target, name, location) => {
610
712
  };
611
713
  var copyTargetAssets = async (target, pkg) => {
612
714
  const workspaces = yarnWorkspaces();
613
- console.log(chalk12.green(`Copying Assets [${target.toUpperCase()}]`));
715
+ console.log(chalk13.green(`Copying Assets [${target.toUpperCase()}]`));
614
716
  const workspaceList = workspaces.filter(({ name }) => {
615
717
  return pkg === void 0 || name === pkg;
616
718
  });
@@ -694,7 +796,7 @@ var dead = () => {
694
796
  };
695
797
 
696
798
  // src/actions/deplint/deplint.ts
697
- import chalk18 from "chalk";
799
+ import chalk19 from "chalk";
698
800
 
699
801
  // src/actions/deplint/findFiles.ts
700
802
  import fs2 from "fs";
@@ -895,12 +997,12 @@ function getExternalImportsFromFiles({
895
997
 
896
998
  // src/actions/deplint/checkPackage/getUnlistedDependencies.ts
897
999
  import { builtinModules } from "module";
898
- import chalk13 from "chalk";
1000
+ import chalk14 from "chalk";
899
1001
  function isListedOrBuiltin(imp, name, dependencies, peerDependencies) {
900
1002
  return dependencies.includes(imp) || imp === name || dependencies.includes(`@types/${imp}`) || peerDependencies.includes(imp) || peerDependencies.includes(`@types/${imp}`) || builtinModules.includes(imp) || builtinModules.includes(`@types/${imp}`);
901
1003
  }
902
1004
  function logMissing(name, imp, importPaths) {
903
- console.log(`[${chalk13.blue(name)}] Missing dependency in package.json: ${chalk13.red(imp)}`);
1005
+ console.log(`[${chalk14.blue(name)}] Missing dependency in package.json: ${chalk14.red(imp)}`);
904
1006
  if (importPaths[imp]) {
905
1007
  console.log(` ${importPaths[imp].join("\n ")}`);
906
1008
  }
@@ -925,7 +1027,7 @@ function getUnlistedDependencies({ name, location }, { dependencies, peerDepende
925
1027
  }
926
1028
  if (unlistedDependencies > 0) {
927
1029
  const packageLocation = `${location}/package.json`;
928
- console.log(` ${chalk13.yellow(packageLocation)}
1030
+ console.log(` ${chalk14.yellow(packageLocation)}
929
1031
  `);
930
1032
  }
931
1033
  return unlistedDependencies;
@@ -933,7 +1035,7 @@ function getUnlistedDependencies({ name, location }, { dependencies, peerDepende
933
1035
 
934
1036
  // src/actions/deplint/checkPackage/getUnlistedDevDependencies.ts
935
1037
  import { builtinModules as builtinModules2 } from "module";
936
- import chalk14 from "chalk";
1038
+ import chalk15 from "chalk";
937
1039
  function getUnlistedDevDependencies({ name, location }, {
938
1040
  devDependencies,
939
1041
  dependencies,
@@ -947,7 +1049,7 @@ function getUnlistedDevDependencies({ name, location }, {
947
1049
  for (const imp of externalAllImports) {
948
1050
  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)) {
949
1051
  unlistedDevDependencies++;
950
- console.log(`[${chalk14.blue(name)}] Missing devDependency in package.json: ${chalk14.red(imp)}`);
1052
+ console.log(`[${chalk15.blue(name)}] Missing devDependency in package.json: ${chalk15.red(imp)}`);
951
1053
  if (allImportPaths[imp]) {
952
1054
  console.log(` ${allImportPaths[imp].join("\n ")}`);
953
1055
  }
@@ -955,14 +1057,14 @@ function getUnlistedDevDependencies({ name, location }, {
955
1057
  }
956
1058
  if (unlistedDevDependencies > 0) {
957
1059
  const packageLocation = `${location}/package.json`;
958
- console.log(` ${chalk14.yellow(packageLocation)}
1060
+ console.log(` ${chalk15.yellow(packageLocation)}
959
1061
  `);
960
1062
  }
961
1063
  return unlistedDevDependencies;
962
1064
  }
963
1065
 
964
1066
  // src/actions/deplint/checkPackage/getUnusedDependencies.ts
965
- import chalk15 from "chalk";
1067
+ import chalk16 from "chalk";
966
1068
  function getUnusedDependencies({ name, location }, { dependencies }, {
967
1069
  externalDistImports,
968
1070
  externalDistTypeImports,
@@ -973,22 +1075,22 @@ function getUnusedDependencies({ name, location }, { dependencies }, {
973
1075
  if (!externalDistImports.includes(dep) && !externalDistImports.includes(dep.replace(/^@types\//, "")) && !externalDistTypeImports.includes(dep) && !externalDistTypeImports.includes(dep.replace(/^@types\//, ""))) {
974
1076
  unusedDependencies++;
975
1077
  if (externalAllImports.includes(dep)) {
976
- console.log(`[${chalk15.blue(name)}] dependency should be devDependency in package.json: ${chalk15.red(dep)}`);
1078
+ console.log(`[${chalk16.blue(name)}] dependency should be devDependency in package.json: ${chalk16.red(dep)}`);
977
1079
  } else {
978
- console.log(`[${chalk15.blue(name)}] Unused dependency in package.json: ${chalk15.red(dep)}`);
1080
+ console.log(`[${chalk16.blue(name)}] Unused dependency in package.json: ${chalk16.red(dep)}`);
979
1081
  }
980
1082
  }
981
1083
  }
982
1084
  if (unusedDependencies > 0) {
983
1085
  const packageLocation = `${location}/package.json`;
984
- console.log(` ${chalk15.yellow(packageLocation)}
1086
+ console.log(` ${chalk16.yellow(packageLocation)}
985
1087
  `);
986
1088
  }
987
1089
  return unusedDependencies;
988
1090
  }
989
1091
 
990
1092
  // src/actions/deplint/checkPackage/getUnusedDevDependencies.ts
991
- import chalk16 from "chalk";
1093
+ import chalk17 from "chalk";
992
1094
 
993
1095
  // src/actions/deplint/getRequiredPeerDependencies.ts
994
1096
  import fs6 from "fs";
@@ -1171,34 +1273,34 @@ function getUnusedDevDependencies({ name, location }, {
1171
1273
  if (dependencies.includes(dep) || peerDependencies.includes(dep)) continue;
1172
1274
  if (!isDevDepUsed(dep, allImports, implicitDeps, requiredPeers, scriptRefs)) {
1173
1275
  unusedDevDependencies++;
1174
- console.log(`[${chalk16.blue(name)}] Unused devDependency in package.json: ${chalk16.red(dep)}`);
1276
+ console.log(`[${chalk17.blue(name)}] Unused devDependency in package.json: ${chalk17.red(dep)}`);
1175
1277
  }
1176
1278
  }
1177
1279
  if (unusedDevDependencies > 0) {
1178
1280
  const packageLocation = `${location}/package.json`;
1179
- console.log(` ${chalk16.yellow(packageLocation)}
1281
+ console.log(` ${chalk17.yellow(packageLocation)}
1180
1282
  `);
1181
1283
  }
1182
1284
  return unusedDevDependencies;
1183
1285
  }
1184
1286
 
1185
1287
  // src/actions/deplint/checkPackage/getUnusedPeerDependencies.ts
1186
- import chalk17 from "chalk";
1288
+ import chalk18 from "chalk";
1187
1289
  function getUnusedPeerDependencies({ name, location }, { peerDependencies, dependencies }, { externalDistImports, externalDistTypeImports }) {
1188
1290
  let unusedDependencies = 0;
1189
1291
  for (const dep of peerDependencies) {
1190
1292
  if (!externalDistImports.includes(dep) && !externalDistImports.includes(dep.replace(/^@types\//, "")) && !externalDistTypeImports.includes(dep) && !externalDistTypeImports.includes(dep.replace(/^@types\//, ""))) {
1191
1293
  unusedDependencies++;
1192
1294
  if (dependencies.includes(dep)) {
1193
- console.log(`[${chalk17.blue(name)}] Unused peerDependency [already a dependency] in package.json: ${chalk17.red(dep)}`);
1295
+ console.log(`[${chalk18.blue(name)}] Unused peerDependency [already a dependency] in package.json: ${chalk18.red(dep)}`);
1194
1296
  } else {
1195
- console.log(`[${chalk17.blue(name)}] Unused peerDependency in package.json: ${chalk17.red(dep)}`);
1297
+ console.log(`[${chalk18.blue(name)}] Unused peerDependency in package.json: ${chalk18.red(dep)}`);
1196
1298
  }
1197
1299
  }
1198
1300
  }
1199
1301
  if (unusedDependencies > 0) {
1200
1302
  const packageLocation = `${location}/package.json`;
1201
- console.log(` ${chalk17.yellow(packageLocation)}
1303
+ console.log(` ${chalk18.yellow(packageLocation)}
1202
1304
  `);
1203
1305
  }
1204
1306
  return unusedDependencies;
@@ -1284,19 +1386,19 @@ var deplint = ({
1284
1386
  });
1285
1387
  }
1286
1388
  if (totalErrors > 0) {
1287
- console.warn(`Deplint: Found ${chalk18.red(totalErrors)} dependency problems. ${chalk18.red("\u2716")}`);
1389
+ console.warn(`Deplint: Found ${chalk19.red(totalErrors)} dependency problems. ${chalk19.red("\u2716")}`);
1288
1390
  } else {
1289
- console.info(`Deplint: Found no dependency problems. ${chalk18.green("\u2714")}`);
1391
+ console.info(`Deplint: Found no dependency problems. ${chalk19.green("\u2714")}`);
1290
1392
  }
1291
1393
  return 0;
1292
1394
  };
1293
1395
 
1294
1396
  // src/actions/deploy.ts
1295
- import { readFileSync as readFileSync5 } from "fs";
1397
+ import { readFileSync as readFileSync7 } from "fs";
1296
1398
  var privatePackageExcludeList = () => {
1297
1399
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1298
1400
  workspace,
1299
- JSON.parse(readFileSync5(`${workspace.location}/package.json`, { encoding: "utf8" }))
1401
+ JSON.parse(readFileSync7(`${workspace.location}/package.json`, { encoding: "utf8" }))
1300
1402
  ]);
1301
1403
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1302
1404
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -1316,11 +1418,11 @@ var deploy = () => {
1316
1418
  };
1317
1419
 
1318
1420
  // src/actions/deploy-major.ts
1319
- import { readFileSync as readFileSync6 } from "fs";
1421
+ import { readFileSync as readFileSync8 } from "fs";
1320
1422
  var privatePackageExcludeList2 = () => {
1321
1423
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1322
1424
  workspace,
1323
- JSON.parse(readFileSync6(`${workspace.location}/package.json`, { encoding: "utf8" }))
1425
+ JSON.parse(readFileSync8(`${workspace.location}/package.json`, { encoding: "utf8" }))
1324
1426
  ]);
1325
1427
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1326
1428
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -1340,11 +1442,11 @@ var deployMajor = () => {
1340
1442
  };
1341
1443
 
1342
1444
  // src/actions/deploy-minor.ts
1343
- import { readFileSync as readFileSync7 } from "fs";
1445
+ import { readFileSync as readFileSync9 } from "fs";
1344
1446
  var privatePackageExcludeList3 = () => {
1345
1447
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1346
1448
  workspace,
1347
- JSON.parse(readFileSync7(`${workspace.location}/package.json`, { encoding: "utf8" }))
1449
+ JSON.parse(readFileSync9(`${workspace.location}/package.json`, { encoding: "utf8" }))
1348
1450
  ]);
1349
1451
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1350
1452
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -1364,11 +1466,11 @@ var deployMinor = () => {
1364
1466
  };
1365
1467
 
1366
1468
  // src/actions/deploy-next.ts
1367
- import { readFileSync as readFileSync8 } from "fs";
1469
+ import { readFileSync as readFileSync10 } from "fs";
1368
1470
  var privatePackageExcludeList4 = () => {
1369
1471
  const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1370
1472
  workspace,
1371
- JSON.parse(readFileSync8(`${workspace.location}/package.json`, { encoding: "utf8" }))
1473
+ JSON.parse(readFileSync10(`${workspace.location}/package.json`, { encoding: "utf8" }))
1372
1474
  ]);
1373
1475
  const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1374
1476
  const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
@@ -1388,22 +1490,22 @@ var deployNext = () => {
1388
1490
  };
1389
1491
 
1390
1492
  // src/actions/dupdeps.ts
1391
- import chalk19 from "chalk";
1493
+ import chalk20 from "chalk";
1392
1494
  var dupdeps = () => {
1393
- console.log(chalk19.green("Checking all Dependencies for Duplicates"));
1495
+ console.log(chalk20.green("Checking all Dependencies for Duplicates"));
1394
1496
  const allDependencies = parsedPackageJSON()?.dependencies;
1395
1497
  const dependencies = Object.entries(allDependencies).map(([k]) => k);
1396
1498
  return detectDuplicateDependencies(dependencies);
1397
1499
  };
1398
1500
 
1399
1501
  // src/actions/lint.ts
1400
- import chalk20 from "chalk";
1502
+ import chalk21 from "chalk";
1401
1503
  var lintPackage = ({
1402
1504
  pkg,
1403
1505
  fix: fix2,
1404
1506
  verbose
1405
1507
  }) => {
1406
- console.log(chalk20.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
1508
+ console.log(chalk21.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
1407
1509
  const start = Date.now();
1408
1510
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
1409
1511
  ["yarn", [
@@ -1413,7 +1515,7 @@ var lintPackage = ({
1413
1515
  fix2 ? "package-fix" : verbose ? "package-lint-verbose" : "package-lint"
1414
1516
  ]]
1415
1517
  ]);
1416
- console.log(chalk20.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk20.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk20.gray("seconds")}`));
1518
+ console.log(chalk21.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk21.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk21.gray("seconds")}`));
1417
1519
  return result;
1418
1520
  };
1419
1521
  var lint = ({
@@ -1433,13 +1535,13 @@ var lint = ({
1433
1535
  });
1434
1536
  };
1435
1537
  var lintAllPackages = ({ fix: fix2 = false } = {}) => {
1436
- console.log(chalk20.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
1538
+ console.log(chalk21.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
1437
1539
  const start = Date.now();
1438
1540
  const fixOptions = fix2 ? ["--fix"] : [];
1439
1541
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
1440
1542
  ["yarn", ["eslint", "--cache", "--cache-location", ".eslintcache", "--cache-strategy", "content", ...fixOptions]]
1441
1543
  ]);
1442
- console.log(chalk20.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk20.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk20.gray("seconds")}`));
1544
+ console.log(chalk21.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk21.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk21.gray("seconds")}`));
1443
1545
  return result;
1444
1546
  };
1445
1547
 
@@ -1467,7 +1569,7 @@ var filename = ".gitignore";
1467
1569
  var gitignoreGen = (pkg) => generateIgnoreFiles(filename, pkg);
1468
1570
 
1469
1571
  // src/actions/gitlint.ts
1470
- import chalk21 from "chalk";
1572
+ import chalk22 from "chalk";
1471
1573
  import ParseGitConfig from "parse-git-config";
1472
1574
  var gitlint = () => {
1473
1575
  console.log(`
@@ -1478,7 +1580,7 @@ Gitlint Start [${process.cwd()}]
1478
1580
  const errors = 0;
1479
1581
  const gitConfig = ParseGitConfig.sync();
1480
1582
  const warn = (message) => {
1481
- console.warn(chalk21.yellow(`Warning: ${message}`));
1583
+ console.warn(chalk22.yellow(`Warning: ${message}`));
1482
1584
  warnings++;
1483
1585
  };
1484
1586
  if (gitConfig.core.ignorecase) {
@@ -1498,13 +1600,13 @@ Gitlint Start [${process.cwd()}]
1498
1600
  }
1499
1601
  const resultMessages = [];
1500
1602
  if (valid > 0) {
1501
- resultMessages.push(chalk21.green(`Passed: ${valid}`));
1603
+ resultMessages.push(chalk22.green(`Passed: ${valid}`));
1502
1604
  }
1503
1605
  if (warnings > 0) {
1504
- resultMessages.push(chalk21.yellow(`Warnings: ${warnings}`));
1606
+ resultMessages.push(chalk22.yellow(`Warnings: ${warnings}`));
1505
1607
  }
1506
1608
  if (errors > 0) {
1507
- resultMessages.push(chalk21.red(` Errors: ${errors}`));
1609
+ resultMessages.push(chalk22.red(` Errors: ${errors}`));
1508
1610
  }
1509
1611
  console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
1510
1612
  `);
@@ -1513,7 +1615,7 @@ Gitlint Start [${process.cwd()}]
1513
1615
 
1514
1616
  // src/actions/gitlint-fix.ts
1515
1617
  import { execSync as execSync2 } from "child_process";
1516
- import chalk22 from "chalk";
1618
+ import chalk23 from "chalk";
1517
1619
  import ParseGitConfig2 from "parse-git-config";
1518
1620
  var gitlintFix = () => {
1519
1621
  console.log(`
@@ -1522,15 +1624,15 @@ Gitlint Fix Start [${process.cwd()}]
1522
1624
  const gitConfig = ParseGitConfig2.sync();
1523
1625
  if (gitConfig.core.ignorecase) {
1524
1626
  execSync2("git config core.ignorecase false", { stdio: "inherit" });
1525
- console.warn(chalk22.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
1627
+ console.warn(chalk23.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
1526
1628
  }
1527
1629
  if (gitConfig.core.autocrlf !== false) {
1528
1630
  execSync2("git config core.autocrlf false", { stdio: "inherit" });
1529
- console.warn(chalk22.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
1631
+ console.warn(chalk23.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
1530
1632
  }
1531
1633
  if (gitConfig.core.eol !== "lf") {
1532
1634
  execSync2("git config core.eol lf", { stdio: "inherit" });
1533
- console.warn(chalk22.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
1635
+ console.warn(chalk23.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
1534
1636
  }
1535
1637
  return 1;
1536
1638
  };
@@ -1541,7 +1643,7 @@ var knip = () => {
1541
1643
  };
1542
1644
 
1543
1645
  // src/actions/license.ts
1544
- import chalk23 from "chalk";
1646
+ import chalk24 from "chalk";
1545
1647
  import { init } from "license-checker";
1546
1648
  var license = async (pkg) => {
1547
1649
  const workspaces = yarnWorkspaces();
@@ -1566,18 +1668,18 @@ var license = async (pkg) => {
1566
1668
  "LGPL-3.0-or-later",
1567
1669
  "Python-2.0"
1568
1670
  ]);
1569
- console.log(chalk23.green("License Checker"));
1671
+ console.log(chalk24.green("License Checker"));
1570
1672
  return (await Promise.all(
1571
1673
  workspaceList.map(({ location, name }) => {
1572
1674
  return new Promise((resolve) => {
1573
1675
  init({ production: true, start: location }, (error, packages) => {
1574
1676
  if (error) {
1575
- console.error(chalk23.red(`License Checker [${name}] Error`));
1576
- console.error(chalk23.gray(error));
1677
+ console.error(chalk24.red(`License Checker [${name}] Error`));
1678
+ console.error(chalk24.gray(error));
1577
1679
  console.log("\n");
1578
1680
  resolve(1);
1579
1681
  } else {
1580
- console.log(chalk23.green(`License Checker [${name}]`));
1682
+ console.log(chalk24.green(`License Checker [${name}]`));
1581
1683
  let count = 0;
1582
1684
  for (const [name2, info] of Object.entries(packages)) {
1583
1685
  const licenses = Array.isArray(info.licenses) ? info.licenses : [info.licenses];
@@ -1593,7 +1695,7 @@ var license = async (pkg) => {
1593
1695
  }
1594
1696
  if (!orLicenseFound) {
1595
1697
  count++;
1596
- console.warn(chalk23.yellow(`${name2}: Package License not allowed [${license2}]`));
1698
+ console.warn(chalk24.yellow(`${name2}: Package License not allowed [${license2}]`));
1597
1699
  }
1598
1700
  }
1599
1701
  }
@@ -1613,12 +1715,12 @@ var npmignoreGen = (pkg) => generateIgnoreFiles(filename2, pkg);
1613
1715
 
1614
1716
  // src/actions/package/clean-outputs.ts
1615
1717
  import path7 from "path";
1616
- import chalk24 from "chalk";
1718
+ import chalk25 from "chalk";
1617
1719
  var packageCleanOutputs = () => {
1618
1720
  const pkg = process.env.INIT_CWD ?? ".";
1619
1721
  const pkgName = process.env.npm_package_name;
1620
1722
  const folders = [path7.join(pkg, "dist"), path7.join(pkg, "build"), path7.join(pkg, "docs")];
1621
- console.log(chalk24.green(`Cleaning Outputs [${pkgName}]`));
1723
+ console.log(chalk25.green(`Cleaning Outputs [${pkgName}]`));
1622
1724
  for (let folder of folders) {
1623
1725
  deleteGlob(folder);
1624
1726
  }
@@ -1627,11 +1729,11 @@ var packageCleanOutputs = () => {
1627
1729
 
1628
1730
  // src/actions/package/clean-typescript.ts
1629
1731
  import path8 from "path";
1630
- import chalk25 from "chalk";
1732
+ import chalk26 from "chalk";
1631
1733
  var packageCleanTypescript = () => {
1632
1734
  const pkg = process.env.INIT_CWD ?? ".";
1633
1735
  const pkgName = process.env.npm_package_name;
1634
- console.log(chalk25.green(`Cleaning Typescript [${pkgName}]`));
1736
+ console.log(chalk26.green(`Cleaning Typescript [${pkgName}]`));
1635
1737
  const files = [path8.join(pkg, "*.tsbuildinfo"), path8.join(pkg, ".tsconfig.*"), path8.join(pkg, ".eslintcache")];
1636
1738
  for (let file of files) {
1637
1739
  deleteGlob(file);
@@ -1645,26 +1747,26 @@ var packageClean = async () => {
1645
1747
  };
1646
1748
 
1647
1749
  // src/actions/package/compile/compile.ts
1648
- import chalk30 from "chalk";
1750
+ import chalk31 from "chalk";
1649
1751
 
1650
1752
  // src/actions/package/compile/packageCompileTsup.ts
1651
- import chalk29 from "chalk";
1753
+ import chalk30 from "chalk";
1652
1754
  import { build as build2, defineConfig } from "tsup";
1653
1755
 
1654
1756
  // src/actions/package/compile/inputs.ts
1655
- import chalk26 from "chalk";
1757
+ import chalk27 from "chalk";
1656
1758
  import { glob as glob2 } from "glob";
1657
1759
  var getAllInputs = (srcDir, verbose = false) => {
1658
1760
  return [...glob2.sync(`${srcDir}/**/*.ts`, { posix: true }).map((file) => {
1659
1761
  const result = file.slice(Math.max(0, srcDir.length + 1));
1660
1762
  if (verbose) {
1661
- console.log(chalk26.gray(`getAllInputs: ${JSON.stringify(result, null, 2)}`));
1763
+ console.log(chalk27.gray(`getAllInputs: ${JSON.stringify(result, null, 2)}`));
1662
1764
  }
1663
1765
  return result;
1664
1766
  }), ...glob2.sync(`${srcDir}/**/*.tsx`, { posix: true }).map((file) => {
1665
1767
  const result = file.slice(Math.max(0, srcDir.length + 1));
1666
1768
  if (verbose) {
1667
- console.log(chalk26.gray(`getAllInputs: ${JSON.stringify(result, null, 2)}`));
1769
+ console.log(chalk27.gray(`getAllInputs: ${JSON.stringify(result, null, 2)}`));
1668
1770
  }
1669
1771
  return result;
1670
1772
  })];
@@ -1723,7 +1825,7 @@ function deepMergeObjects(objects) {
1723
1825
 
1724
1826
  // src/actions/package/compile/packageCompileTsc.ts
1725
1827
  import { cwd as cwd2 } from "process";
1726
- import chalk27 from "chalk";
1828
+ import chalk28 from "chalk";
1727
1829
  import { createProgramFromConfig } from "tsc-prog";
1728
1830
  import ts2, {
1729
1831
  DiagnosticCategory,
@@ -1745,7 +1847,7 @@ var getCompilerOptions = (options = {}, fileName = "tsconfig.json") => {
1745
1847
  var packageCompileTsc = (platform, entries, srcDir = "src", outDir = "dist", compilerOptionsParam, verbose = false) => {
1746
1848
  const pkg = process.env.INIT_CWD ?? cwd2();
1747
1849
  if (verbose) {
1748
- console.log(chalk27.cyan(`Validating code START: ${entries.length} files to ${outDir} from ${srcDir}`));
1850
+ console.log(chalk28.cyan(`Validating code START: ${entries.length} files to ${outDir} from ${srcDir}`));
1749
1851
  }
1750
1852
  const configFilePath = ts2.findConfigFile(
1751
1853
  "./",
@@ -1768,10 +1870,10 @@ var packageCompileTsc = (platform, entries, srcDir = "src", outDir = "dist", com
1768
1870
  emitDeclarationOnly: true,
1769
1871
  noEmit: false
1770
1872
  };
1771
- console.log(chalk27.cyan(`Validating Files: ${entries.length}`));
1873
+ console.log(chalk28.cyan(`Validating Files: ${entries.length}`));
1772
1874
  if (verbose) {
1773
1875
  for (const entry of entries) {
1774
- console.log(chalk27.grey(`Validating: ${entry}`));
1876
+ console.log(chalk28.grey(`Validating: ${entry}`));
1775
1877
  }
1776
1878
  }
1777
1879
  try {
@@ -1801,7 +1903,7 @@ var packageCompileTsc = (platform, entries, srcDir = "src", outDir = "dist", com
1801
1903
  return 0;
1802
1904
  } finally {
1803
1905
  if (verbose) {
1804
- console.log(chalk27.cyan(`Validating code FINISH: ${entries.length} files to ${outDir} from ${srcDir}`));
1906
+ console.log(chalk28.cyan(`Validating code FINISH: ${entries.length} files to ${outDir} from ${srcDir}`));
1805
1907
  }
1806
1908
  }
1807
1909
  };
@@ -1809,7 +1911,7 @@ var packageCompileTsc = (platform, entries, srcDir = "src", outDir = "dist", com
1809
1911
  // src/actions/package/compile/packageCompileTscTypes.ts
1810
1912
  import path9 from "path";
1811
1913
  import { cwd as cwd3 } from "process";
1812
- import chalk28 from "chalk";
1914
+ import chalk29 from "chalk";
1813
1915
  import { rollup } from "rollup";
1814
1916
  import dts from "rollup-plugin-dts";
1815
1917
  import nodeExternals from "rollup-plugin-node-externals";
@@ -1834,8 +1936,8 @@ async function bundleDts(inputPath, outputPath, platform, options, verbose = fal
1834
1936
  if (ignoredWarningCodes.has(warning.code ?? "")) {
1835
1937
  return;
1836
1938
  }
1837
- console.warn(chalk28.yellow(`[${warning.code}] ${warning.message}`));
1838
- console.warn(chalk28.gray(inputPath));
1939
+ console.warn(chalk29.yellow(`[${warning.code}] ${warning.message}`));
1940
+ console.warn(chalk29.gray(inputPath));
1839
1941
  warn(warning);
1840
1942
  }
1841
1943
  });
@@ -1845,8 +1947,8 @@ async function bundleDts(inputPath, outputPath, platform, options, verbose = fal
1845
1947
  });
1846
1948
  } catch (ex) {
1847
1949
  const error = ex;
1848
- console.warn(chalk28.red(error));
1849
- console.warn(chalk28.gray(inputPath));
1950
+ console.warn(chalk29.red(error));
1951
+ console.warn(chalk29.gray(inputPath));
1850
1952
  }
1851
1953
  if (verbose) {
1852
1954
  console.log(`Bundled declarations written to ${outputPath}`);
@@ -1854,7 +1956,7 @@ async function bundleDts(inputPath, outputPath, platform, options, verbose = fal
1854
1956
  }
1855
1957
  var packageCompileTscTypes = async (entries, outDir, platform, srcDir = "build", verbose = false) => {
1856
1958
  if (verbose) {
1857
- console.log(chalk28.cyan(`Compiling Types START [${platform}]: ${entries.length} files to ${outDir} from ${srcDir}`));
1959
+ console.log(chalk29.cyan(`Compiling Types START [${platform}]: ${entries.length} files to ${outDir} from ${srcDir}`));
1858
1960
  console.log(`Entries: ${entries.join(", ")}`);
1859
1961
  }
1860
1962
  const pkg = process.env.INIT_CWD ?? cwd3();
@@ -1878,7 +1980,7 @@ var packageCompileTscTypes = async (entries, outDir, platform, srcDir = "build",
1878
1980
  await bundleDts(`${srcRoot}/${entryTypeName}`, `${outDir}/${entryTypeName}`, platform, { compilerOptions }, verbose);
1879
1981
  }));
1880
1982
  if (verbose) {
1881
- console.log(chalk28.cyan(`Compiling Types FINISH: ${entries.length} files to ${outDir} from ${srcDir}`));
1983
+ console.log(chalk29.cyan(`Compiling Types FINISH: ${entries.length} files to ${outDir} from ${srcDir}`));
1882
1984
  }
1883
1985
  return 0;
1884
1986
  };
@@ -1890,15 +1992,15 @@ var compileFolder = async (srcDir, entries, buildDir, options, bundleTypes = fal
1890
1992
  console.log(`compileFolder [${srcDir}, ${options?.outDir}]`);
1891
1993
  }
1892
1994
  if (entries.length === 0) {
1893
- console.warn(chalk29.yellow(`No entries found in ${srcDir} to compile`));
1995
+ console.warn(chalk30.yellow(`No entries found in ${srcDir} to compile`));
1894
1996
  return 0;
1895
1997
  }
1896
1998
  if (verbose) {
1897
- console.log(chalk29.gray(`buildDir [${buildDir}]`));
1999
+ console.log(chalk30.gray(`buildDir [${buildDir}]`));
1898
2000
  }
1899
2001
  const validationResult = packageCompileTsc(options?.platform ?? "neutral", entries, srcDir, buildDir, void 0, verbose);
1900
2002
  if (validationResult !== 0) {
1901
- console.error(chalk29.red(`Compile:Validation had ${validationResult} errors`));
2003
+ console.error(chalk30.red(`Compile:Validation had ${validationResult} errors`));
1902
2004
  return validationResult;
1903
2005
  }
1904
2006
  const optionsParams = tsupOptions([{
@@ -1923,12 +2025,12 @@ var compileFolder = async (srcDir, entries, buildDir, options, bundleTypes = fal
1923
2025
  })
1924
2026
  )).flat();
1925
2027
  if (verbose) {
1926
- console.log(chalk29.cyan(`TSUP:build:start [${srcDir}]`));
1927
- console.log(chalk29.gray(`TSUP:build:options [${JSON.stringify(optionsList, null, 2)}]`));
2028
+ console.log(chalk30.cyan(`TSUP:build:start [${srcDir}]`));
2029
+ console.log(chalk30.gray(`TSUP:build:options [${JSON.stringify(optionsList, null, 2)}]`));
1928
2030
  }
1929
2031
  await Promise.all(optionsList.map((options2) => build2(options2)));
1930
2032
  if (verbose) {
1931
- console.log(chalk29.cyan(`TSUP:build:stop [${srcDir}]`));
2033
+ console.log(chalk30.cyan(`TSUP:build:stop [${srcDir}]`));
1932
2034
  }
1933
2035
  if (bundleTypes) {
1934
2036
  await packageCompileTscTypes(entries, outDir, options?.platform ?? "neutral", buildDir, verbose);
@@ -2039,14 +2141,14 @@ var packageCompileTsup = async (config2) => {
2039
2141
  // src/actions/package/compile/compile.ts
2040
2142
  var packageCompile = async (inConfig = {}) => {
2041
2143
  const pkg = process.env.INIT_CWD;
2042
- console.log(chalk30.green(`Compiling ${pkg}`));
2144
+ console.log(chalk31.green(`Compiling ${pkg}`));
2043
2145
  const config2 = await loadConfig(inConfig);
2044
2146
  return await packageCompileTsup(config2);
2045
2147
  };
2046
2148
 
2047
2149
  // src/actions/package/copy-assets.ts
2048
2150
  import path10 from "path/posix";
2049
- import chalk31 from "chalk";
2151
+ import chalk32 from "chalk";
2050
2152
  import cpy2 from "cpy";
2051
2153
  var copyTargetAssets2 = async (target, name, location) => {
2052
2154
  try {
@@ -2059,7 +2161,7 @@ var copyTargetAssets2 = async (target, name, location) => {
2059
2161
  }
2060
2162
  );
2061
2163
  if (values.length > 0) {
2062
- console.log(chalk31.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
2164
+ console.log(chalk32.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
2063
2165
  }
2064
2166
  for (const value of values) {
2065
2167
  console.log(`${value.split("/").pop()} => ./dist/${target}`);
@@ -2124,9 +2226,9 @@ var packageCycle = async () => {
2124
2226
  };
2125
2227
 
2126
2228
  // src/actions/package/gen-docs.ts
2127
- import { existsSync as existsSync5 } from "fs";
2229
+ import { existsSync as existsSync6 } from "fs";
2128
2230
  import path11 from "path";
2129
- import chalk32 from "chalk";
2231
+ import chalk33 from "chalk";
2130
2232
  import {
2131
2233
  Application,
2132
2234
  ArgumentsReader,
@@ -2144,7 +2246,7 @@ var ExitCodes = {
2144
2246
  };
2145
2247
  var packageGenDocs = async () => {
2146
2248
  const pkg = process.env.INIT_CWD;
2147
- if (pkg !== void 0 && !existsSync5(path11.join(pkg, "typedoc.json"))) {
2249
+ if (pkg !== void 0 && !existsSync6(path11.join(pkg, "typedoc.json"))) {
2148
2250
  return;
2149
2251
  }
2150
2252
  const app = await Application.bootstrap({
@@ -2230,16 +2332,16 @@ var runTypeDoc = async (app) => {
2230
2332
  return ExitCodes.OutputError;
2231
2333
  }
2232
2334
  }
2233
- console.log(chalk32.green(`${pkgName} - Ok`));
2335
+ console.log(chalk33.green(`${pkgName} - Ok`));
2234
2336
  return ExitCodes.Ok;
2235
2337
  };
2236
2338
 
2237
2339
  // src/actions/package/lint.ts
2238
- import { readdirSync } from "fs";
2340
+ import { readdirSync as readdirSync3 } from "fs";
2239
2341
  import path12 from "path";
2240
2342
  import { cwd as cwd4 } from "process";
2241
2343
  import { pathToFileURL } from "url";
2242
- import chalk33 from "chalk";
2344
+ import chalk34 from "chalk";
2243
2345
  import { ESLint } from "eslint";
2244
2346
  import { findUp } from "find-up";
2245
2347
  import picomatch from "picomatch";
@@ -2248,14 +2350,14 @@ var dumpMessages = (lintResults) => {
2248
2350
  const severity = ["none", "warning", "error"];
2249
2351
  for (const lintResult of lintResults) {
2250
2352
  if (lintResult.messages.length > 0) {
2251
- console.log(chalk33.gray(`
2353
+ console.log(chalk34.gray(`
2252
2354
  ${lintResult.filePath}`));
2253
2355
  for (const message of lintResult.messages) {
2254
2356
  console.log(
2255
- chalk33.gray(` ${message.line}:${message.column}`),
2256
- chalk33[colors[message.severity]](` ${severity[message.severity]}`),
2257
- chalk33.white(` ${message.message}`),
2258
- chalk33.gray(` ${message.ruleId}`)
2357
+ chalk34.gray(` ${message.line}:${message.column}`),
2358
+ chalk34[colors[message.severity]](` ${severity[message.severity]}`),
2359
+ chalk34.white(` ${message.message}`),
2360
+ chalk34.gray(` ${message.ruleId}`)
2259
2361
  );
2260
2362
  }
2261
2363
  }
@@ -2272,7 +2374,7 @@ function getFiles(dir, ignoreFolders) {
2272
2374
  const currentDirectory = cwd4();
2273
2375
  const subDirectory = dir.split(currentDirectory)[1]?.split("/")[1];
2274
2376
  if (ignoreFolders.includes(subDirectory)) return [];
2275
- return readdirSync(dir, { withFileTypes: true }).flatMap((dirent) => {
2377
+ return readdirSync3(dir, { withFileTypes: true }).flatMap((dirent) => {
2276
2378
  const res = path12.resolve(dir, dirent.name);
2277
2379
  const relativePath = subDirectory === void 0 ? dirent.name : `${subDirectory}/${dirent.name}`;
2278
2380
  const ignoreMatchers = ignoreFolders.map((pattern) => picomatch(pattern));
@@ -2293,10 +2395,10 @@ var packageLint = async (fix2 = false, verbose = false, cache = true) => {
2293
2395
  cache
2294
2396
  });
2295
2397
  const files = getFiles(cwd4(), ignoreFolders);
2296
- console.log(chalk33.green(`Linting ${pkg} [files = ${files.length}]`));
2398
+ console.log(chalk34.green(`Linting ${pkg} [files = ${files.length}]`));
2297
2399
  if (verbose) {
2298
2400
  for (const file of files) {
2299
- console.log(chalk33.gray(` ${file}`));
2401
+ console.log(chalk34.gray(` ${file}`));
2300
2402
  }
2301
2403
  }
2302
2404
  const lintResults = await engine.lintFiles(files);
@@ -2307,32 +2409,32 @@ var packageLint = async (fix2 = false, verbose = false, cache = true) => {
2307
2409
  const filesCountColor = files.length < 100 ? "green" : files.length < 1e3 ? "yellow" : "red";
2308
2410
  const lintTime = Date.now() - start;
2309
2411
  const lintTimeColor = lintTime < 1e3 ? "green" : lintTime < 3e3 ? "yellow" : "red";
2310
- console.log(chalk33.white(`Linted ${chalk33[filesCountColor](files.length)} files in ${chalk33[lintTimeColor](lintTime)}ms`));
2412
+ console.log(chalk34.white(`Linted ${chalk34[filesCountColor](files.length)} files in ${chalk34[lintTimeColor](lintTime)}ms`));
2311
2413
  return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
2312
2414
  };
2313
2415
 
2314
2416
  // src/actions/package/publint.ts
2315
2417
  import { promises as fs9 } from "fs";
2316
- import chalk34 from "chalk";
2418
+ import chalk35 from "chalk";
2317
2419
  import sortPackageJson from "sort-package-json";
2318
2420
  var customPubLint = (pkg) => {
2319
2421
  let errorCount = 0;
2320
2422
  let warningCount = 0;
2321
2423
  if (pkg.files === void 0) {
2322
- console.warn(chalk34.yellow('Publint [custom]: "files" field is missing'));
2424
+ console.warn(chalk35.yellow('Publint [custom]: "files" field is missing'));
2323
2425
  warningCount++;
2324
2426
  }
2325
2427
  if (pkg.main !== void 0) {
2326
- console.warn(chalk34.yellow('Publint [custom]: "main" field is deprecated, use "exports" instead'));
2428
+ console.warn(chalk35.yellow('Publint [custom]: "main" field is deprecated, use "exports" instead'));
2327
2429
  warningCount++;
2328
2430
  }
2329
2431
  if (pkg.sideEffects !== false) {
2330
- console.warn(chalk34.yellow('Publint [custom]: "sideEffects" field should be set to false'));
2432
+ console.warn(chalk35.yellow('Publint [custom]: "sideEffects" field should be set to false'));
2331
2433
  warningCount++;
2332
2434
  }
2333
2435
  if (pkg.resolutions !== void 0) {
2334
- console.warn(chalk34.yellow('Publint [custom]: "resolutions" in use'));
2335
- console.warn(chalk34.gray(JSON.stringify(pkg.resolutions, null, 2)));
2436
+ console.warn(chalk35.yellow('Publint [custom]: "resolutions" in use'));
2437
+ console.warn(chalk35.gray(JSON.stringify(pkg.resolutions, null, 2)));
2336
2438
  warningCount++;
2337
2439
  }
2338
2440
  return [errorCount, warningCount];
@@ -2342,8 +2444,8 @@ var packagePublint = async ({ strict = true, verbose = false } = {}) => {
2342
2444
  const sortedPkg = sortPackageJson(await fs9.readFile(`${pkgDir}/package.json`, "utf8"));
2343
2445
  await fs9.writeFile(`${pkgDir}/package.json`, sortedPkg);
2344
2446
  const pkg = JSON.parse(await fs9.readFile(`${pkgDir}/package.json`, "utf8"));
2345
- console.log(chalk34.green(`Publint: ${pkg.name}`));
2346
- console.log(chalk34.gray(pkgDir));
2447
+ console.log(chalk35.green(`Publint: ${pkg.name}`));
2448
+ console.log(chalk35.gray(pkgDir));
2347
2449
  const { publint: publint2 } = await import("publint");
2348
2450
  const { messages } = await publint2({
2349
2451
  level: "suggestion",
@@ -2354,22 +2456,22 @@ var packagePublint = async ({ strict = true, verbose = false } = {}) => {
2354
2456
  for (const message of messages) {
2355
2457
  switch (message.type) {
2356
2458
  case "error": {
2357
- console.error(chalk34.red(`[${message.code}] ${formatMessage(message, pkg)}`));
2459
+ console.error(chalk35.red(`[${message.code}] ${formatMessage(message, pkg)}`));
2358
2460
  break;
2359
2461
  }
2360
2462
  case "warning": {
2361
- console.warn(chalk34.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
2463
+ console.warn(chalk35.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
2362
2464
  break;
2363
2465
  }
2364
2466
  default: {
2365
- console.log(chalk34.white(`[${message.code}] ${formatMessage(message, pkg)}`));
2467
+ console.log(chalk35.white(`[${message.code}] ${formatMessage(message, pkg)}`));
2366
2468
  break;
2367
2469
  }
2368
2470
  }
2369
2471
  }
2370
2472
  const [errorCount, warningCount] = customPubLint(pkg);
2371
2473
  if (verbose) {
2372
- console.log(chalk34.gray(`Publint [Finish]: ${pkgDir} [${messages.length + errorCount + warningCount} messages]`));
2474
+ console.log(chalk35.gray(`Publint [Finish]: ${pkgDir} [${messages.length + errorCount + warningCount} messages]`));
2373
2475
  }
2374
2476
  return messages.filter((message) => message.type === "error").length + errorCount;
2375
2477
  };
@@ -2405,7 +2507,7 @@ var rebuild = ({ target }) => {
2405
2507
  };
2406
2508
 
2407
2509
  // src/actions/recompile.ts
2408
- import chalk35 from "chalk";
2510
+ import chalk36 from "chalk";
2409
2511
  var recompile = async ({
2410
2512
  verbose,
2411
2513
  target,
@@ -2441,7 +2543,7 @@ var recompileAll = async ({
2441
2543
  const incrementalOptions = incremental ? ["--since", "-Apt", "--topological-dev"] : ["--parallel", "-Apt", "--topological-dev"];
2442
2544
  const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
2443
2545
  if (jobs) {
2444
- console.log(chalk35.blue(`Jobs set to [${jobs}]`));
2546
+ console.log(chalk36.blue(`Jobs set to [${jobs}]`));
2445
2547
  }
2446
2548
  const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
2447
2549
  [
@@ -2472,7 +2574,7 @@ var recompileAll = async ({
2472
2574
  ]
2473
2575
  ]);
2474
2576
  console.log(
2475
- `${chalk35.gray("Recompiled in")} [${chalk35.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk35.gray("seconds")}`
2577
+ `${chalk36.gray("Recompiled in")} [${chalk36.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk36.gray("seconds")}`
2476
2578
  );
2477
2579
  return result;
2478
2580
  };
@@ -2503,13 +2605,13 @@ var reinstall = () => {
2503
2605
  };
2504
2606
 
2505
2607
  // src/actions/relint.ts
2506
- import chalk36 from "chalk";
2608
+ import chalk37 from "chalk";
2507
2609
  var relintPackage = ({
2508
2610
  pkg,
2509
2611
  fix: fix2,
2510
2612
  verbose
2511
2613
  }) => {
2512
- console.log(chalk36.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
2614
+ console.log(chalk37.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
2513
2615
  const start = Date.now();
2514
2616
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
2515
2617
  ["yarn", [
@@ -2519,7 +2621,7 @@ var relintPackage = ({
2519
2621
  fix2 ? "package-fix" : verbose ? "package-lint-verbose" : "package-lint"
2520
2622
  ]]
2521
2623
  ]);
2522
- console.log(chalk36.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk36.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk36.gray("seconds")}`));
2624
+ console.log(chalk37.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk37.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk37.gray("seconds")}`));
2523
2625
  return result;
2524
2626
  };
2525
2627
  var relint = ({
@@ -2539,13 +2641,13 @@ var relint = ({
2539
2641
  });
2540
2642
  };
2541
2643
  var relintAllPackages = ({ fix: fix2 = false } = {}) => {
2542
- console.log(chalk36.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
2644
+ console.log(chalk37.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
2543
2645
  const start = Date.now();
2544
2646
  const fixOptions = fix2 ? ["--fix"] : [];
2545
2647
  const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
2546
2648
  ["yarn", ["eslint", ...fixOptions]]
2547
2649
  ]);
2548
- console.log(chalk36.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk36.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk36.gray("seconds")}`));
2650
+ console.log(chalk37.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk37.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk37.gray("seconds")}`));
2549
2651
  return result;
2550
2652
  };
2551
2653
 
@@ -2563,10 +2665,10 @@ var sonar = () => {
2563
2665
  };
2564
2666
 
2565
2667
  // src/actions/statics.ts
2566
- import chalk37 from "chalk";
2668
+ import chalk38 from "chalk";
2567
2669
  var DefaultDependencies = ["axios", "@xylabs/pixel", "react", "graphql", "react-router", "@mui/material", "@mui/system"];
2568
2670
  var statics = () => {
2569
- console.log(chalk37.green("Check Required Static Dependencies"));
2671
+ console.log(chalk38.green("Check Required Static Dependencies"));
2570
2672
  const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
2571
2673
  return detectDuplicateDependencies(statics2, DefaultDependencies);
2572
2674
  };
@@ -2623,7 +2725,7 @@ var loadPackageConfig = async () => {
2623
2725
  };
2624
2726
 
2625
2727
  // src/xy/xy.ts
2626
- import chalk39 from "chalk";
2728
+ import chalk40 from "chalk";
2627
2729
 
2628
2730
  // src/xy/xyBuildCommands.ts
2629
2731
  var xyBuildCommands = (args) => {
@@ -2731,6 +2833,21 @@ var packagePositionalParam = (yargs2) => {
2731
2833
  // src/xy/xyCommonCommands.ts
2732
2834
  var xyCommonCommands = (args) => {
2733
2835
  return args.command(
2836
+ "claude-rules",
2837
+ "Claude Rules - Sync XY Labs standard Claude rules to .claude/rules/",
2838
+ (yargs2) => {
2839
+ return yargs2.option("force", {
2840
+ alias: "f",
2841
+ default: false,
2842
+ description: "Overwrite existing CLAUDE.md",
2843
+ type: "boolean"
2844
+ });
2845
+ },
2846
+ (argv) => {
2847
+ if (argv.verbose) console.log("Claude Rules");
2848
+ process.exitCode = claudeRules({ force: argv.force });
2849
+ }
2850
+ ).command(
2734
2851
  "license [package]",
2735
2852
  "License - Check licenses of dependencies",
2736
2853
  (yargs2) => {
@@ -2977,7 +3094,7 @@ var xyInstallCommands = (args) => {
2977
3094
  };
2978
3095
 
2979
3096
  // src/xy/xyLintCommands.ts
2980
- import chalk38 from "chalk";
3097
+ import chalk39 from "chalk";
2981
3098
  var xyLintCommands = (args) => {
2982
3099
  return args.command(
2983
3100
  "cycle [package]",
@@ -2989,7 +3106,7 @@ var xyLintCommands = (args) => {
2989
3106
  const start = Date.now();
2990
3107
  if (argv.verbose) console.log("Cycle");
2991
3108
  process.exitCode = await cycle({ pkg: argv.package });
2992
- console.log(chalk38.blue(`Finished in ${Date.now() - start}ms`));
3109
+ console.log(chalk39.blue(`Finished in ${Date.now() - start}ms`));
2993
3110
  }
2994
3111
  ).command(
2995
3112
  "lint [package]",
@@ -3019,7 +3136,7 @@ var xyLintCommands = (args) => {
3019
3136
  cache: argv.cache,
3020
3137
  verbose: !!argv.verbose
3021
3138
  });
3022
- console.log(chalk38.blue(`Finished in ${Date.now() - start}ms`));
3139
+ console.log(chalk39.blue(`Finished in ${Date.now() - start}ms`));
3023
3140
  }
3024
3141
  ).command(
3025
3142
  "deplint [package]",
@@ -3052,7 +3169,7 @@ var xyLintCommands = (args) => {
3052
3169
  peerDeps: !!argv.peerDeps,
3053
3170
  verbose: !!argv.verbose
3054
3171
  });
3055
- console.log(chalk38.blue(`Finished in ${Date.now() - start}ms`));
3172
+ console.log(chalk39.blue(`Finished in ${Date.now() - start}ms`));
3056
3173
  }
3057
3174
  ).command(
3058
3175
  "fix [package]",
@@ -3064,7 +3181,7 @@ var xyLintCommands = (args) => {
3064
3181
  const start = Date.now();
3065
3182
  if (argv.verbose) console.log("Fix");
3066
3183
  process.exitCode = fix();
3067
- console.log(chalk38.blue(`Finished in ${Date.now() - start}ms`));
3184
+ console.log(chalk39.blue(`Finished in ${Date.now() - start}ms`));
3068
3185
  }
3069
3186
  ).command(
3070
3187
  "relint [package]",
@@ -3076,7 +3193,7 @@ var xyLintCommands = (args) => {
3076
3193
  if (argv.verbose) console.log("Relinting");
3077
3194
  const start = Date.now();
3078
3195
  process.exitCode = relint();
3079
- console.log(chalk38.blue(`Finished in ${Date.now() - start}ms`));
3196
+ console.log(chalk39.blue(`Finished in ${Date.now() - start}ms`));
3080
3197
  }
3081
3198
  ).command(
3082
3199
  "publint [package]",
@@ -3088,7 +3205,7 @@ var xyLintCommands = (args) => {
3088
3205
  if (argv.verbose) console.log("Publint");
3089
3206
  const start = Date.now();
3090
3207
  process.exitCode = await publint({ pkg: argv.package, verbose: !!argv.verbose });
3091
- console.log(chalk38.blue(`Finished in ${Date.now() - start}ms`));
3208
+ console.log(chalk39.blue(`Finished in ${Date.now() - start}ms`));
3092
3209
  }
3093
3210
  ).command(
3094
3211
  "knip",
@@ -3100,7 +3217,7 @@ var xyLintCommands = (args) => {
3100
3217
  if (argv.verbose) console.log("Knip");
3101
3218
  const start = Date.now();
3102
3219
  process.exitCode = knip();
3103
- console.log(chalk38.blue(`Knip finished in ${Date.now() - start}ms`));
3220
+ console.log(chalk39.blue(`Knip finished in ${Date.now() - start}ms`));
3104
3221
  }
3105
3222
  ).command(
3106
3223
  "sonar",
@@ -3112,7 +3229,7 @@ var xyLintCommands = (args) => {
3112
3229
  const start = Date.now();
3113
3230
  if (argv.verbose) console.log("Sonar Check");
3114
3231
  process.exitCode = sonar();
3115
- console.log(chalk38.blue(`Finished in ${Date.now() - start}ms`));
3232
+ console.log(chalk39.blue(`Finished in ${Date.now() - start}ms`));
3116
3233
  }
3117
3234
  );
3118
3235
  };
@@ -3148,8 +3265,8 @@ var xyParseOptions = () => {
3148
3265
  var xy = async () => {
3149
3266
  const options = xyParseOptions();
3150
3267
  return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
3151
- console.error(chalk39.yellow(`Command not found [${chalk39.magenta(process.argv[2])}]`));
3152
- console.log(chalk39.gray("Try 'yarn xy --help' for list of commands"));
3268
+ console.error(chalk40.yellow(`Command not found [${chalk40.magenta(process.argv[2])}]`));
3269
+ console.log(chalk40.gray("Try 'yarn xy --help' for list of commands"));
3153
3270
  }).version().help().argv;
3154
3271
  };
3155
3272
  export {
@@ -3157,9 +3274,13 @@ export {
3157
3274
  DuplicateDetector,
3158
3275
  INIT_CWD,
3159
3276
  WINDOWS_NEWLINE_REGEX,
3277
+ XYLABS_RULES_PREFIX,
3160
3278
  build,
3161
3279
  bundleDts,
3162
3280
  checkResult,
3281
+ claudeMdProjectTemplate,
3282
+ claudeMdRuleTemplates,
3283
+ claudeRules,
3163
3284
  clean,
3164
3285
  cleanAll,
3165
3286
  cleanDocs,