@xylabs/ts-scripts-yarn3 7.4.9 → 7.4.10
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/actions/claude-commands.mjs +99 -0
- package/dist/actions/claude-commands.mjs.map +1 -0
- package/dist/actions/claude-rules.mjs.map +1 -1
- package/dist/actions/index.mjs +222 -141
- package/dist/actions/index.mjs.map +1 -1
- package/dist/bin/xy.mjs +184 -96
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.mjs +244 -153
- package/dist/index.mjs.map +1 -1
- package/dist/lib/claudeMdTemplate.mjs +12 -0
- package/dist/lib/claudeMdTemplate.mjs.map +1 -1
- package/dist/lib/index.mjs +12 -0
- package/dist/lib/index.mjs.map +1 -1
- package/dist/xy/index.mjs +184 -96
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/xy.mjs +184 -96
- package/dist/xy/xy.mjs.map +1 -1
- package/dist/xy/xyCommonCommands.mjs +122 -34
- package/dist/xy/xyCommonCommands.mjs.map +1 -1
- package/package.json +2 -2
- package/templates/commands/xylabs-build.md +5 -0
- package/templates/commands/xylabs-clean.md +5 -0
- package/templates/commands/xylabs-compile.md +5 -0
- package/templates/commands/xylabs-cycle.md +5 -0
- package/templates/commands/xylabs-deplint.md +5 -0
- package/templates/commands/xylabs-deploy-major.md +7 -0
- package/templates/commands/xylabs-deploy-minor.md +7 -0
- package/templates/commands/xylabs-deploy.md +7 -0
- package/templates/commands/xylabs-fix.md +5 -0
- package/templates/commands/xylabs-knip.md +5 -0
- package/templates/commands/xylabs-lint.md +5 -0
- package/templates/commands/xylabs-publint.md +5 -0
- package/templates/commands/xylabs-rebuild.md +5 -0
- package/templates/commands/xylabs-test.md +5 -0
package/dist/xy/xy.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/xy/xy.ts
|
|
2
|
-
import
|
|
2
|
+
import chalk28 from "chalk";
|
|
3
3
|
|
|
4
4
|
// src/actions/build.ts
|
|
5
5
|
import chalk7 from "chalk";
|
|
@@ -25,6 +25,7 @@ var require2 = createRequire(import.meta.url);
|
|
|
25
25
|
var packageRoot = PATH.dirname(require2.resolve("@xylabs/ts-scripts-yarn3/package.json"));
|
|
26
26
|
var templatesDir = PATH.resolve(packageRoot, "templates");
|
|
27
27
|
var XYLABS_RULES_PREFIX = "xylabs-";
|
|
28
|
+
var XYLABS_COMMANDS_PREFIX = "xylabs-";
|
|
28
29
|
var claudeMdRuleTemplates = () => {
|
|
29
30
|
const rulesDir = PATH.resolve(templatesDir, "rules");
|
|
30
31
|
const files = readdirSync(rulesDir).filter((f) => f.startsWith(XYLABS_RULES_PREFIX) && f.endsWith(".md"));
|
|
@@ -34,6 +35,15 @@ var claudeMdRuleTemplates = () => {
|
|
|
34
35
|
}
|
|
35
36
|
return result;
|
|
36
37
|
};
|
|
38
|
+
var claudeCommandTemplates = () => {
|
|
39
|
+
const commandsDir = PATH.resolve(templatesDir, "commands");
|
|
40
|
+
const files = readdirSync(commandsDir).filter((f) => f.startsWith(XYLABS_COMMANDS_PREFIX) && f.endsWith(".md"));
|
|
41
|
+
const result = {};
|
|
42
|
+
for (const file of files) {
|
|
43
|
+
result[file] = readFileSync(PATH.resolve(commandsDir, file), "utf8");
|
|
44
|
+
}
|
|
45
|
+
return result;
|
|
46
|
+
};
|
|
37
47
|
var claudeMdProjectTemplate = () => readFileSync(PATH.resolve(templatesDir, "CLAUDE-project.md"), "utf8");
|
|
38
48
|
|
|
39
49
|
// src/lib/deleteGlob.ts
|
|
@@ -428,7 +438,7 @@ var build = async ({
|
|
|
428
438
|
return result;
|
|
429
439
|
};
|
|
430
440
|
|
|
431
|
-
// src/actions/claude-
|
|
441
|
+
// src/actions/claude-commands.ts
|
|
432
442
|
import {
|
|
433
443
|
existsSync as existsSync4,
|
|
434
444
|
mkdirSync,
|
|
@@ -439,13 +449,13 @@ import {
|
|
|
439
449
|
} from "fs";
|
|
440
450
|
import PATH2 from "path";
|
|
441
451
|
import chalk8 from "chalk";
|
|
442
|
-
var
|
|
443
|
-
const templates =
|
|
452
|
+
var syncCommandFiles = (commandsDir) => {
|
|
453
|
+
const templates = claudeCommandTemplates();
|
|
444
454
|
const templateNames = new Set(Object.keys(templates));
|
|
445
455
|
let updated = 0;
|
|
446
456
|
let created = 0;
|
|
447
457
|
for (const [filename3, content] of Object.entries(templates)) {
|
|
448
|
-
const targetPath = PATH2.resolve(
|
|
458
|
+
const targetPath = PATH2.resolve(commandsDir, filename3);
|
|
449
459
|
const existing = existsSync4(targetPath) ? readFileSync4(targetPath, "utf8") : void 0;
|
|
450
460
|
if (existing === content) continue;
|
|
451
461
|
writeFileSync2(targetPath, content, "utf8");
|
|
@@ -461,12 +471,82 @@ var syncRuleFiles = (rulesDir) => {
|
|
|
461
471
|
updated
|
|
462
472
|
};
|
|
463
473
|
};
|
|
474
|
+
var removeStaleCommands = (commandsDir, templateNames) => {
|
|
475
|
+
const existingCommands = readdirSync2(commandsDir).filter((f) => f.startsWith(XYLABS_COMMANDS_PREFIX) && f.endsWith(".md"));
|
|
476
|
+
let removed = 0;
|
|
477
|
+
for (const file of existingCommands) {
|
|
478
|
+
if (!templateNames.has(file)) {
|
|
479
|
+
unlinkSync(PATH2.resolve(commandsDir, file));
|
|
480
|
+
removed++;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
return removed;
|
|
484
|
+
};
|
|
485
|
+
var logCommandsResult = (created, updated, removed) => {
|
|
486
|
+
if (created || updated || removed) {
|
|
487
|
+
const parts = [
|
|
488
|
+
created ? `${created} created` : "",
|
|
489
|
+
updated ? `${updated} updated` : "",
|
|
490
|
+
removed ? `${removed} removed` : ""
|
|
491
|
+
].filter(Boolean);
|
|
492
|
+
console.log(chalk8.green(`.claude/commands/${XYLABS_COMMANDS_PREFIX}*.md: ${parts.join(", ")}`));
|
|
493
|
+
} else {
|
|
494
|
+
console.log(chalk8.gray(`.claude/commands/${XYLABS_COMMANDS_PREFIX}*.md: already up to date`));
|
|
495
|
+
}
|
|
496
|
+
};
|
|
497
|
+
var claudeCommands = () => {
|
|
498
|
+
const cwd = INIT_CWD() ?? process.cwd();
|
|
499
|
+
const commandsDir = PATH2.resolve(cwd, ".claude", "commands");
|
|
500
|
+
mkdirSync(commandsDir, { recursive: true });
|
|
501
|
+
const {
|
|
502
|
+
created,
|
|
503
|
+
templateNames,
|
|
504
|
+
updated
|
|
505
|
+
} = syncCommandFiles(commandsDir);
|
|
506
|
+
const removed = removeStaleCommands(commandsDir, templateNames);
|
|
507
|
+
logCommandsResult(created, updated, removed);
|
|
508
|
+
return 0;
|
|
509
|
+
};
|
|
510
|
+
|
|
511
|
+
// src/actions/claude-rules.ts
|
|
512
|
+
import {
|
|
513
|
+
existsSync as existsSync5,
|
|
514
|
+
mkdirSync as mkdirSync2,
|
|
515
|
+
readdirSync as readdirSync3,
|
|
516
|
+
readFileSync as readFileSync5,
|
|
517
|
+
unlinkSync as unlinkSync2,
|
|
518
|
+
writeFileSync as writeFileSync3
|
|
519
|
+
} from "fs";
|
|
520
|
+
import PATH3 from "path";
|
|
521
|
+
import chalk9 from "chalk";
|
|
522
|
+
var syncRuleFiles = (rulesDir) => {
|
|
523
|
+
const templates = claudeMdRuleTemplates();
|
|
524
|
+
const templateNames = new Set(Object.keys(templates));
|
|
525
|
+
let updated = 0;
|
|
526
|
+
let created = 0;
|
|
527
|
+
for (const [filename3, content] of Object.entries(templates)) {
|
|
528
|
+
const targetPath = PATH3.resolve(rulesDir, filename3);
|
|
529
|
+
const existing = existsSync5(targetPath) ? readFileSync5(targetPath, "utf8") : void 0;
|
|
530
|
+
if (existing === content) continue;
|
|
531
|
+
writeFileSync3(targetPath, content, "utf8");
|
|
532
|
+
if (existing) {
|
|
533
|
+
updated++;
|
|
534
|
+
} else {
|
|
535
|
+
created++;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
return {
|
|
539
|
+
created,
|
|
540
|
+
templateNames,
|
|
541
|
+
updated
|
|
542
|
+
};
|
|
543
|
+
};
|
|
464
544
|
var removeStaleRules = (rulesDir, templateNames) => {
|
|
465
|
-
const existingRules =
|
|
545
|
+
const existingRules = readdirSync3(rulesDir).filter((f) => f.startsWith(XYLABS_RULES_PREFIX) && f.endsWith(".md"));
|
|
466
546
|
let removed = 0;
|
|
467
547
|
for (const file of existingRules) {
|
|
468
548
|
if (!templateNames.has(file)) {
|
|
469
|
-
|
|
549
|
+
unlinkSync2(PATH3.resolve(rulesDir, file));
|
|
470
550
|
removed++;
|
|
471
551
|
}
|
|
472
552
|
}
|
|
@@ -479,27 +559,27 @@ var logRulesResult = (created, updated, removed) => {
|
|
|
479
559
|
updated ? `${updated} updated` : "",
|
|
480
560
|
removed ? `${removed} removed` : ""
|
|
481
561
|
].filter(Boolean);
|
|
482
|
-
console.log(
|
|
562
|
+
console.log(chalk9.green(`.claude/rules/${XYLABS_RULES_PREFIX}*.md: ${parts.join(", ")}`));
|
|
483
563
|
} else {
|
|
484
|
-
console.log(
|
|
564
|
+
console.log(chalk9.gray(`.claude/rules/${XYLABS_RULES_PREFIX}*.md: already up to date`));
|
|
485
565
|
}
|
|
486
566
|
};
|
|
487
567
|
var ensureProjectClaudeMd = (cwd, force) => {
|
|
488
|
-
const projectPath =
|
|
489
|
-
if (!
|
|
490
|
-
if (force &&
|
|
491
|
-
console.log(
|
|
568
|
+
const projectPath = PATH3.resolve(cwd, "CLAUDE.md");
|
|
569
|
+
if (!existsSync5(projectPath) || force) {
|
|
570
|
+
if (force && existsSync5(projectPath)) {
|
|
571
|
+
console.log(chalk9.yellow("Overwriting existing CLAUDE.md"));
|
|
492
572
|
}
|
|
493
|
-
|
|
494
|
-
console.log(
|
|
573
|
+
writeFileSync3(projectPath, claudeMdProjectTemplate(), "utf8");
|
|
574
|
+
console.log(chalk9.green("Generated CLAUDE.md"));
|
|
495
575
|
} else {
|
|
496
|
-
console.log(
|
|
576
|
+
console.log(chalk9.gray("CLAUDE.md already exists (skipped)"));
|
|
497
577
|
}
|
|
498
578
|
};
|
|
499
579
|
var claudeRules = ({ force } = {}) => {
|
|
500
580
|
const cwd = INIT_CWD() ?? process.cwd();
|
|
501
|
-
const rulesDir =
|
|
502
|
-
|
|
581
|
+
const rulesDir = PATH3.resolve(cwd, ".claude", "rules");
|
|
582
|
+
mkdirSync2(rulesDir, { recursive: true });
|
|
503
583
|
const {
|
|
504
584
|
created,
|
|
505
585
|
templateNames,
|
|
@@ -525,16 +605,16 @@ var cleanAll = ({ verbose }) => {
|
|
|
525
605
|
|
|
526
606
|
// src/actions/clean-docs.ts
|
|
527
607
|
import path from "path";
|
|
528
|
-
import
|
|
608
|
+
import chalk10 from "chalk";
|
|
529
609
|
var cleanDocs = () => {
|
|
530
610
|
const pkgName = process.env.npm_package_name;
|
|
531
|
-
console.log(
|
|
611
|
+
console.log(chalk10.green(`Cleaning Docs [${pkgName}]`));
|
|
532
612
|
for (const { location } of yarnWorkspaces()) deleteGlob(path.join(location, "docs"));
|
|
533
613
|
return 0;
|
|
534
614
|
};
|
|
535
615
|
|
|
536
616
|
// src/actions/compile.ts
|
|
537
|
-
import
|
|
617
|
+
import chalk11 from "chalk";
|
|
538
618
|
var compile = ({
|
|
539
619
|
verbose,
|
|
540
620
|
target,
|
|
@@ -575,7 +655,7 @@ var compileAll = ({
|
|
|
575
655
|
const incrementalOptions = incremental ? ["--since", "-Ap", "--topological-dev"] : ["--parallel", "-Ap", "--topological-dev"];
|
|
576
656
|
const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
|
|
577
657
|
if (jobs) {
|
|
578
|
-
console.log(
|
|
658
|
+
console.log(chalk11.blue(`Jobs set to [${jobs}]`));
|
|
579
659
|
}
|
|
580
660
|
const result = runSteps(`Compile${incremental ? "-Incremental" : ""} [All]`, [
|
|
581
661
|
["yarn", [
|
|
@@ -589,13 +669,13 @@ var compileAll = ({
|
|
|
589
669
|
...targetOptions
|
|
590
670
|
]]
|
|
591
671
|
]);
|
|
592
|
-
console.log(`${
|
|
672
|
+
console.log(`${chalk11.gray("Compiled in")} [${chalk11.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk11.gray("seconds")}`);
|
|
593
673
|
return result;
|
|
594
674
|
};
|
|
595
675
|
|
|
596
676
|
// src/actions/copy-assets.ts
|
|
597
677
|
import path2 from "path/posix";
|
|
598
|
-
import
|
|
678
|
+
import chalk12 from "chalk";
|
|
599
679
|
import cpy from "cpy";
|
|
600
680
|
var copyPackageTargetAssets = async (target, name, location) => {
|
|
601
681
|
try {
|
|
@@ -618,7 +698,7 @@ var copyPackageTargetAssets = async (target, name, location) => {
|
|
|
618
698
|
};
|
|
619
699
|
var copyTargetAssets = async (target, pkg) => {
|
|
620
700
|
const workspaces = yarnWorkspaces();
|
|
621
|
-
console.log(
|
|
701
|
+
console.log(chalk12.green(`Copying Assets [${target.toUpperCase()}]`));
|
|
622
702
|
const workspaceList = workspaces.filter(({ name }) => {
|
|
623
703
|
return pkg === void 0 || name === pkg;
|
|
624
704
|
});
|
|
@@ -702,7 +782,7 @@ var dead = () => {
|
|
|
702
782
|
};
|
|
703
783
|
|
|
704
784
|
// src/actions/deplint/deplint.ts
|
|
705
|
-
import
|
|
785
|
+
import chalk18 from "chalk";
|
|
706
786
|
|
|
707
787
|
// src/actions/deplint/findFiles.ts
|
|
708
788
|
import fs2 from "fs";
|
|
@@ -904,12 +984,12 @@ function getExternalImportsFromFiles({
|
|
|
904
984
|
|
|
905
985
|
// src/actions/deplint/checkPackage/getUnlistedDependencies.ts
|
|
906
986
|
import { builtinModules } from "module";
|
|
907
|
-
import
|
|
987
|
+
import chalk13 from "chalk";
|
|
908
988
|
function isListedOrBuiltin(imp, name, dependencies, peerDependencies) {
|
|
909
989
|
return dependencies.includes(imp) || imp === name || dependencies.includes(`@types/${imp}`) || peerDependencies.includes(imp) || peerDependencies.includes(`@types/${imp}`) || builtinModules.includes(imp) || builtinModules.includes(`@types/${imp}`);
|
|
910
990
|
}
|
|
911
991
|
function logMissing(name, imp, importPaths) {
|
|
912
|
-
console.log(`[${
|
|
992
|
+
console.log(`[${chalk13.blue(name)}] Missing dependency in package.json: ${chalk13.red(imp)}`);
|
|
913
993
|
if (importPaths[imp]) {
|
|
914
994
|
console.log(` ${importPaths[imp].join("\n ")}`);
|
|
915
995
|
}
|
|
@@ -934,7 +1014,7 @@ function getUnlistedDependencies({ name, location }, { dependencies, peerDepende
|
|
|
934
1014
|
}
|
|
935
1015
|
if (unlistedDependencies > 0) {
|
|
936
1016
|
const packageLocation = `${location}/package.json`;
|
|
937
|
-
console.log(` ${
|
|
1017
|
+
console.log(` ${chalk13.yellow(packageLocation)}
|
|
938
1018
|
`);
|
|
939
1019
|
}
|
|
940
1020
|
return unlistedDependencies;
|
|
@@ -942,7 +1022,7 @@ function getUnlistedDependencies({ name, location }, { dependencies, peerDepende
|
|
|
942
1022
|
|
|
943
1023
|
// src/actions/deplint/checkPackage/getUnlistedDevDependencies.ts
|
|
944
1024
|
import { builtinModules as builtinModules2 } from "module";
|
|
945
|
-
import
|
|
1025
|
+
import chalk14 from "chalk";
|
|
946
1026
|
function getUnlistedDevDependencies({ name, location }, {
|
|
947
1027
|
devDependencies,
|
|
948
1028
|
dependencies,
|
|
@@ -956,7 +1036,7 @@ function getUnlistedDevDependencies({ name, location }, {
|
|
|
956
1036
|
for (const imp of externalAllImports) {
|
|
957
1037
|
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)) {
|
|
958
1038
|
unlistedDevDependencies++;
|
|
959
|
-
console.log(`[${
|
|
1039
|
+
console.log(`[${chalk14.blue(name)}] Missing devDependency in package.json: ${chalk14.red(imp)}`);
|
|
960
1040
|
if (allImportPaths[imp]) {
|
|
961
1041
|
console.log(` ${allImportPaths[imp].join("\n ")}`);
|
|
962
1042
|
}
|
|
@@ -964,14 +1044,14 @@ function getUnlistedDevDependencies({ name, location }, {
|
|
|
964
1044
|
}
|
|
965
1045
|
if (unlistedDevDependencies > 0) {
|
|
966
1046
|
const packageLocation = `${location}/package.json`;
|
|
967
|
-
console.log(` ${
|
|
1047
|
+
console.log(` ${chalk14.yellow(packageLocation)}
|
|
968
1048
|
`);
|
|
969
1049
|
}
|
|
970
1050
|
return unlistedDevDependencies;
|
|
971
1051
|
}
|
|
972
1052
|
|
|
973
1053
|
// src/actions/deplint/checkPackage/getUnusedDependencies.ts
|
|
974
|
-
import
|
|
1054
|
+
import chalk15 from "chalk";
|
|
975
1055
|
function getUnusedDependencies({ name, location }, { dependencies }, {
|
|
976
1056
|
externalDistImports,
|
|
977
1057
|
externalDistTypeImports,
|
|
@@ -982,22 +1062,22 @@ function getUnusedDependencies({ name, location }, { dependencies }, {
|
|
|
982
1062
|
if (!externalDistImports.includes(dep) && !externalDistImports.includes(dep.replace(/^@types\//, "")) && !externalDistTypeImports.includes(dep) && !externalDistTypeImports.includes(dep.replace(/^@types\//, ""))) {
|
|
983
1063
|
unusedDependencies++;
|
|
984
1064
|
if (externalAllImports.includes(dep)) {
|
|
985
|
-
console.log(`[${
|
|
1065
|
+
console.log(`[${chalk15.blue(name)}] dependency should be devDependency in package.json: ${chalk15.red(dep)}`);
|
|
986
1066
|
} else {
|
|
987
|
-
console.log(`[${
|
|
1067
|
+
console.log(`[${chalk15.blue(name)}] Unused dependency in package.json: ${chalk15.red(dep)}`);
|
|
988
1068
|
}
|
|
989
1069
|
}
|
|
990
1070
|
}
|
|
991
1071
|
if (unusedDependencies > 0) {
|
|
992
1072
|
const packageLocation = `${location}/package.json`;
|
|
993
|
-
console.log(` ${
|
|
1073
|
+
console.log(` ${chalk15.yellow(packageLocation)}
|
|
994
1074
|
`);
|
|
995
1075
|
}
|
|
996
1076
|
return unusedDependencies;
|
|
997
1077
|
}
|
|
998
1078
|
|
|
999
1079
|
// src/actions/deplint/checkPackage/getUnusedDevDependencies.ts
|
|
1000
|
-
import
|
|
1080
|
+
import chalk16 from "chalk";
|
|
1001
1081
|
|
|
1002
1082
|
// src/actions/deplint/getRequiredPeerDependencies.ts
|
|
1003
1083
|
import fs6 from "fs";
|
|
@@ -1185,34 +1265,34 @@ function getUnusedDevDependencies({ name, location }, {
|
|
|
1185
1265
|
if (dependencies.includes(dep) || peerDependencies.includes(dep)) continue;
|
|
1186
1266
|
if (!isDevDepUsed(dep, allImports, implicitDeps, requiredPeers, scriptRefs)) {
|
|
1187
1267
|
unusedDevDependencies++;
|
|
1188
|
-
console.log(`[${
|
|
1268
|
+
console.log(`[${chalk16.blue(name)}] Unused devDependency in package.json: ${chalk16.red(dep)}`);
|
|
1189
1269
|
}
|
|
1190
1270
|
}
|
|
1191
1271
|
if (unusedDevDependencies > 0) {
|
|
1192
1272
|
const packageLocation = `${location}/package.json`;
|
|
1193
|
-
console.log(` ${
|
|
1273
|
+
console.log(` ${chalk16.yellow(packageLocation)}
|
|
1194
1274
|
`);
|
|
1195
1275
|
}
|
|
1196
1276
|
return unusedDevDependencies;
|
|
1197
1277
|
}
|
|
1198
1278
|
|
|
1199
1279
|
// src/actions/deplint/checkPackage/getUnusedPeerDependencies.ts
|
|
1200
|
-
import
|
|
1280
|
+
import chalk17 from "chalk";
|
|
1201
1281
|
function getUnusedPeerDependencies({ name, location }, { peerDependencies, dependencies }, { externalDistImports, externalDistTypeImports }) {
|
|
1202
1282
|
let unusedDependencies = 0;
|
|
1203
1283
|
for (const dep of peerDependencies) {
|
|
1204
1284
|
if (!externalDistImports.includes(dep) && !externalDistImports.includes(dep.replace(/^@types\//, "")) && !externalDistTypeImports.includes(dep) && !externalDistTypeImports.includes(dep.replace(/^@types\//, ""))) {
|
|
1205
1285
|
unusedDependencies++;
|
|
1206
1286
|
if (dependencies.includes(dep)) {
|
|
1207
|
-
console.log(`[${
|
|
1287
|
+
console.log(`[${chalk17.blue(name)}] Unused peerDependency [already a dependency] in package.json: ${chalk17.red(dep)}`);
|
|
1208
1288
|
} else {
|
|
1209
|
-
console.log(`[${
|
|
1289
|
+
console.log(`[${chalk17.blue(name)}] Unused peerDependency in package.json: ${chalk17.red(dep)}`);
|
|
1210
1290
|
}
|
|
1211
1291
|
}
|
|
1212
1292
|
}
|
|
1213
1293
|
if (unusedDependencies > 0) {
|
|
1214
1294
|
const packageLocation = `${location}/package.json`;
|
|
1215
|
-
console.log(` ${
|
|
1295
|
+
console.log(` ${chalk17.yellow(packageLocation)}
|
|
1216
1296
|
`);
|
|
1217
1297
|
}
|
|
1218
1298
|
return unusedDependencies;
|
|
@@ -1298,19 +1378,19 @@ var deplint = ({
|
|
|
1298
1378
|
});
|
|
1299
1379
|
}
|
|
1300
1380
|
if (totalErrors > 0) {
|
|
1301
|
-
console.warn(`Deplint: Found ${
|
|
1381
|
+
console.warn(`Deplint: Found ${chalk18.red(totalErrors)} dependency problems. ${chalk18.red("\u2716")}`);
|
|
1302
1382
|
} else {
|
|
1303
|
-
console.info(`Deplint: Found no dependency problems. ${
|
|
1383
|
+
console.info(`Deplint: Found no dependency problems. ${chalk18.green("\u2714")}`);
|
|
1304
1384
|
}
|
|
1305
1385
|
return 0;
|
|
1306
1386
|
};
|
|
1307
1387
|
|
|
1308
1388
|
// src/actions/deploy.ts
|
|
1309
|
-
import { readFileSync as
|
|
1389
|
+
import { readFileSync as readFileSync6 } from "fs";
|
|
1310
1390
|
var privatePackageExcludeList = () => {
|
|
1311
1391
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
1312
1392
|
workspace,
|
|
1313
|
-
JSON.parse(
|
|
1393
|
+
JSON.parse(readFileSync6(`${workspace.location}/package.json`, { encoding: "utf8" }))
|
|
1314
1394
|
]);
|
|
1315
1395
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
1316
1396
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
@@ -1330,11 +1410,11 @@ var deploy = () => {
|
|
|
1330
1410
|
};
|
|
1331
1411
|
|
|
1332
1412
|
// src/actions/deploy-major.ts
|
|
1333
|
-
import { readFileSync as
|
|
1413
|
+
import { readFileSync as readFileSync7 } from "fs";
|
|
1334
1414
|
var privatePackageExcludeList2 = () => {
|
|
1335
1415
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
1336
1416
|
workspace,
|
|
1337
|
-
JSON.parse(
|
|
1417
|
+
JSON.parse(readFileSync7(`${workspace.location}/package.json`, { encoding: "utf8" }))
|
|
1338
1418
|
]);
|
|
1339
1419
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
1340
1420
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
@@ -1354,11 +1434,11 @@ var deployMajor = () => {
|
|
|
1354
1434
|
};
|
|
1355
1435
|
|
|
1356
1436
|
// src/actions/deploy-minor.ts
|
|
1357
|
-
import { readFileSync as
|
|
1437
|
+
import { readFileSync as readFileSync8 } from "fs";
|
|
1358
1438
|
var privatePackageExcludeList3 = () => {
|
|
1359
1439
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
1360
1440
|
workspace,
|
|
1361
|
-
JSON.parse(
|
|
1441
|
+
JSON.parse(readFileSync8(`${workspace.location}/package.json`, { encoding: "utf8" }))
|
|
1362
1442
|
]);
|
|
1363
1443
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
1364
1444
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
@@ -1378,11 +1458,11 @@ var deployMinor = () => {
|
|
|
1378
1458
|
};
|
|
1379
1459
|
|
|
1380
1460
|
// src/actions/deploy-next.ts
|
|
1381
|
-
import { readFileSync as
|
|
1461
|
+
import { readFileSync as readFileSync9 } from "fs";
|
|
1382
1462
|
var privatePackageExcludeList4 = () => {
|
|
1383
1463
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
1384
1464
|
workspace,
|
|
1385
|
-
JSON.parse(
|
|
1465
|
+
JSON.parse(readFileSync9(`${workspace.location}/package.json`, { encoding: "utf8" }))
|
|
1386
1466
|
]);
|
|
1387
1467
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
1388
1468
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
@@ -1402,22 +1482,22 @@ var deployNext = () => {
|
|
|
1402
1482
|
};
|
|
1403
1483
|
|
|
1404
1484
|
// src/actions/dupdeps.ts
|
|
1405
|
-
import
|
|
1485
|
+
import chalk19 from "chalk";
|
|
1406
1486
|
var dupdeps = () => {
|
|
1407
|
-
console.log(
|
|
1487
|
+
console.log(chalk19.green("Checking all Dependencies for Duplicates"));
|
|
1408
1488
|
const allDependencies = parsedPackageJSON()?.dependencies;
|
|
1409
1489
|
const dependencies = Object.entries(allDependencies).map(([k]) => k);
|
|
1410
1490
|
return detectDuplicateDependencies(dependencies);
|
|
1411
1491
|
};
|
|
1412
1492
|
|
|
1413
1493
|
// src/actions/lint.ts
|
|
1414
|
-
import
|
|
1494
|
+
import chalk20 from "chalk";
|
|
1415
1495
|
var lintPackage = ({
|
|
1416
1496
|
pkg,
|
|
1417
1497
|
fix: fix2,
|
|
1418
1498
|
verbose
|
|
1419
1499
|
}) => {
|
|
1420
|
-
console.log(
|
|
1500
|
+
console.log(chalk20.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
|
|
1421
1501
|
const start = Date.now();
|
|
1422
1502
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
|
|
1423
1503
|
["yarn", [
|
|
@@ -1427,7 +1507,7 @@ var lintPackage = ({
|
|
|
1427
1507
|
fix2 ? "package-fix" : verbose ? "package-lint-verbose" : "package-lint"
|
|
1428
1508
|
]]
|
|
1429
1509
|
]);
|
|
1430
|
-
console.log(
|
|
1510
|
+
console.log(chalk20.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk20.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk20.gray("seconds")}`));
|
|
1431
1511
|
return result;
|
|
1432
1512
|
};
|
|
1433
1513
|
var lint = ({
|
|
@@ -1447,13 +1527,13 @@ var lint = ({
|
|
|
1447
1527
|
});
|
|
1448
1528
|
};
|
|
1449
1529
|
var lintAllPackages = ({ fix: fix2 = false } = {}) => {
|
|
1450
|
-
console.log(
|
|
1530
|
+
console.log(chalk20.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
|
|
1451
1531
|
const start = Date.now();
|
|
1452
1532
|
const fixOptions = fix2 ? ["--fix"] : [];
|
|
1453
1533
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
|
|
1454
1534
|
["yarn", ["eslint", "--cache", "--cache-location", ".eslintcache", "--cache-strategy", "content", ...fixOptions]]
|
|
1455
1535
|
]);
|
|
1456
|
-
console.log(
|
|
1536
|
+
console.log(chalk20.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk20.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk20.gray("seconds")}`));
|
|
1457
1537
|
return result;
|
|
1458
1538
|
};
|
|
1459
1539
|
|
|
@@ -1481,7 +1561,7 @@ var filename = ".gitignore";
|
|
|
1481
1561
|
var gitignoreGen = (pkg) => generateIgnoreFiles(filename, pkg);
|
|
1482
1562
|
|
|
1483
1563
|
// src/actions/gitlint.ts
|
|
1484
|
-
import
|
|
1564
|
+
import chalk21 from "chalk";
|
|
1485
1565
|
import ParseGitConfig from "parse-git-config";
|
|
1486
1566
|
var gitlint = () => {
|
|
1487
1567
|
console.log(`
|
|
@@ -1492,7 +1572,7 @@ Gitlint Start [${process.cwd()}]
|
|
|
1492
1572
|
const errors = 0;
|
|
1493
1573
|
const gitConfig = ParseGitConfig.sync();
|
|
1494
1574
|
const warn = (message) => {
|
|
1495
|
-
console.warn(
|
|
1575
|
+
console.warn(chalk21.yellow(`Warning: ${message}`));
|
|
1496
1576
|
warnings++;
|
|
1497
1577
|
};
|
|
1498
1578
|
if (gitConfig.core.ignorecase) {
|
|
@@ -1512,13 +1592,13 @@ Gitlint Start [${process.cwd()}]
|
|
|
1512
1592
|
}
|
|
1513
1593
|
const resultMessages = [];
|
|
1514
1594
|
if (valid > 0) {
|
|
1515
|
-
resultMessages.push(
|
|
1595
|
+
resultMessages.push(chalk21.green(`Passed: ${valid}`));
|
|
1516
1596
|
}
|
|
1517
1597
|
if (warnings > 0) {
|
|
1518
|
-
resultMessages.push(
|
|
1598
|
+
resultMessages.push(chalk21.yellow(`Warnings: ${warnings}`));
|
|
1519
1599
|
}
|
|
1520
1600
|
if (errors > 0) {
|
|
1521
|
-
resultMessages.push(
|
|
1601
|
+
resultMessages.push(chalk21.red(` Errors: ${errors}`));
|
|
1522
1602
|
}
|
|
1523
1603
|
console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
|
|
1524
1604
|
`);
|
|
@@ -1527,7 +1607,7 @@ Gitlint Start [${process.cwd()}]
|
|
|
1527
1607
|
|
|
1528
1608
|
// src/actions/gitlint-fix.ts
|
|
1529
1609
|
import { execSync as execSync2 } from "child_process";
|
|
1530
|
-
import
|
|
1610
|
+
import chalk22 from "chalk";
|
|
1531
1611
|
import ParseGitConfig2 from "parse-git-config";
|
|
1532
1612
|
var gitlintFix = () => {
|
|
1533
1613
|
console.log(`
|
|
@@ -1536,15 +1616,15 @@ Gitlint Fix Start [${process.cwd()}]
|
|
|
1536
1616
|
const gitConfig = ParseGitConfig2.sync();
|
|
1537
1617
|
if (gitConfig.core.ignorecase) {
|
|
1538
1618
|
execSync2("git config core.ignorecase false", { stdio: "inherit" });
|
|
1539
|
-
console.warn(
|
|
1619
|
+
console.warn(chalk22.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
|
|
1540
1620
|
}
|
|
1541
1621
|
if (gitConfig.core.autocrlf !== false) {
|
|
1542
1622
|
execSync2("git config core.autocrlf false", { stdio: "inherit" });
|
|
1543
|
-
console.warn(
|
|
1623
|
+
console.warn(chalk22.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
|
|
1544
1624
|
}
|
|
1545
1625
|
if (gitConfig.core.eol !== "lf") {
|
|
1546
1626
|
execSync2("git config core.eol lf", { stdio: "inherit" });
|
|
1547
|
-
console.warn(
|
|
1627
|
+
console.warn(chalk22.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
|
|
1548
1628
|
}
|
|
1549
1629
|
return 1;
|
|
1550
1630
|
};
|
|
@@ -1555,7 +1635,7 @@ var knip = () => {
|
|
|
1555
1635
|
};
|
|
1556
1636
|
|
|
1557
1637
|
// src/actions/license.ts
|
|
1558
|
-
import
|
|
1638
|
+
import chalk23 from "chalk";
|
|
1559
1639
|
import { init } from "license-checker";
|
|
1560
1640
|
var license = async (pkg) => {
|
|
1561
1641
|
const workspaces = yarnWorkspaces();
|
|
@@ -1580,18 +1660,18 @@ var license = async (pkg) => {
|
|
|
1580
1660
|
"LGPL-3.0-or-later",
|
|
1581
1661
|
"Python-2.0"
|
|
1582
1662
|
]);
|
|
1583
|
-
console.log(
|
|
1663
|
+
console.log(chalk23.green("License Checker"));
|
|
1584
1664
|
return (await Promise.all(
|
|
1585
1665
|
workspaceList.map(({ location, name }) => {
|
|
1586
1666
|
return new Promise((resolve) => {
|
|
1587
1667
|
init({ production: true, start: location }, (error, packages) => {
|
|
1588
1668
|
if (error) {
|
|
1589
|
-
console.error(
|
|
1590
|
-
console.error(
|
|
1669
|
+
console.error(chalk23.red(`License Checker [${name}] Error`));
|
|
1670
|
+
console.error(chalk23.gray(error));
|
|
1591
1671
|
console.log("\n");
|
|
1592
1672
|
resolve(1);
|
|
1593
1673
|
} else {
|
|
1594
|
-
console.log(
|
|
1674
|
+
console.log(chalk23.green(`License Checker [${name}]`));
|
|
1595
1675
|
let count = 0;
|
|
1596
1676
|
for (const [name2, info] of Object.entries(packages)) {
|
|
1597
1677
|
const licenses = Array.isArray(info.licenses) ? info.licenses : [info.licenses];
|
|
@@ -1607,7 +1687,7 @@ var license = async (pkg) => {
|
|
|
1607
1687
|
}
|
|
1608
1688
|
if (!orLicenseFound) {
|
|
1609
1689
|
count++;
|
|
1610
|
-
console.warn(
|
|
1690
|
+
console.warn(chalk23.yellow(`${name2}: Package License not allowed [${license2}]`));
|
|
1611
1691
|
}
|
|
1612
1692
|
}
|
|
1613
1693
|
}
|
|
@@ -1651,7 +1731,7 @@ var rebuild = ({ target }) => {
|
|
|
1651
1731
|
};
|
|
1652
1732
|
|
|
1653
1733
|
// src/actions/recompile.ts
|
|
1654
|
-
import
|
|
1734
|
+
import chalk24 from "chalk";
|
|
1655
1735
|
var recompile = async ({
|
|
1656
1736
|
verbose,
|
|
1657
1737
|
target,
|
|
@@ -1687,7 +1767,7 @@ var recompileAll = async ({
|
|
|
1687
1767
|
const incrementalOptions = incremental ? ["--since", "-Apt", "--topological-dev"] : ["--parallel", "-Apt", "--topological-dev"];
|
|
1688
1768
|
const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
|
|
1689
1769
|
if (jobs) {
|
|
1690
|
-
console.log(
|
|
1770
|
+
console.log(chalk24.blue(`Jobs set to [${jobs}]`));
|
|
1691
1771
|
}
|
|
1692
1772
|
const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
|
|
1693
1773
|
[
|
|
@@ -1718,7 +1798,7 @@ var recompileAll = async ({
|
|
|
1718
1798
|
]
|
|
1719
1799
|
]);
|
|
1720
1800
|
console.log(
|
|
1721
|
-
`${
|
|
1801
|
+
`${chalk24.gray("Recompiled in")} [${chalk24.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk24.gray("seconds")}`
|
|
1722
1802
|
);
|
|
1723
1803
|
return result;
|
|
1724
1804
|
};
|
|
@@ -1749,13 +1829,13 @@ var reinstall = () => {
|
|
|
1749
1829
|
};
|
|
1750
1830
|
|
|
1751
1831
|
// src/actions/relint.ts
|
|
1752
|
-
import
|
|
1832
|
+
import chalk25 from "chalk";
|
|
1753
1833
|
var relintPackage = ({
|
|
1754
1834
|
pkg,
|
|
1755
1835
|
fix: fix2,
|
|
1756
1836
|
verbose
|
|
1757
1837
|
}) => {
|
|
1758
|
-
console.log(
|
|
1838
|
+
console.log(chalk25.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
|
|
1759
1839
|
const start = Date.now();
|
|
1760
1840
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
|
|
1761
1841
|
["yarn", [
|
|
@@ -1765,7 +1845,7 @@ var relintPackage = ({
|
|
|
1765
1845
|
fix2 ? "package-fix" : verbose ? "package-lint-verbose" : "package-lint"
|
|
1766
1846
|
]]
|
|
1767
1847
|
]);
|
|
1768
|
-
console.log(
|
|
1848
|
+
console.log(chalk25.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk25.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk25.gray("seconds")}`));
|
|
1769
1849
|
return result;
|
|
1770
1850
|
};
|
|
1771
1851
|
var relint = ({
|
|
@@ -1785,13 +1865,13 @@ var relint = ({
|
|
|
1785
1865
|
});
|
|
1786
1866
|
};
|
|
1787
1867
|
var relintAllPackages = ({ fix: fix2 = false } = {}) => {
|
|
1788
|
-
console.log(
|
|
1868
|
+
console.log(chalk25.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
|
|
1789
1869
|
const start = Date.now();
|
|
1790
1870
|
const fixOptions = fix2 ? ["--fix"] : [];
|
|
1791
1871
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
|
|
1792
1872
|
["yarn", ["eslint", ...fixOptions]]
|
|
1793
1873
|
]);
|
|
1794
|
-
console.log(
|
|
1874
|
+
console.log(chalk25.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk25.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk25.gray("seconds")}`));
|
|
1795
1875
|
return result;
|
|
1796
1876
|
};
|
|
1797
1877
|
|
|
@@ -1809,10 +1889,10 @@ var sonar = () => {
|
|
|
1809
1889
|
};
|
|
1810
1890
|
|
|
1811
1891
|
// src/actions/statics.ts
|
|
1812
|
-
import
|
|
1892
|
+
import chalk26 from "chalk";
|
|
1813
1893
|
var DefaultDependencies = ["axios", "@xylabs/pixel", "react", "graphql", "react-router", "@mui/material", "@mui/system"];
|
|
1814
1894
|
var statics = () => {
|
|
1815
|
-
console.log(
|
|
1895
|
+
console.log(chalk26.green("Check Required Static Dependencies"));
|
|
1816
1896
|
const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
|
|
1817
1897
|
return detectDuplicateDependencies(statics2, DefaultDependencies);
|
|
1818
1898
|
};
|
|
@@ -1966,6 +2046,14 @@ var packagePositionalParam = (yargs2) => {
|
|
|
1966
2046
|
// src/xy/xyCommonCommands.ts
|
|
1967
2047
|
var xyCommonCommands = (args) => {
|
|
1968
2048
|
return args.command(
|
|
2049
|
+
"claude-commands",
|
|
2050
|
+
"Claude Commands - Sync XY Labs standard Claude slash commands to .claude/commands/",
|
|
2051
|
+
(yargs2) => yargs2,
|
|
2052
|
+
(argv) => {
|
|
2053
|
+
if (argv.verbose) console.log("Claude Commands");
|
|
2054
|
+
process.exitCode = claudeCommands();
|
|
2055
|
+
}
|
|
2056
|
+
).command(
|
|
1969
2057
|
"claude-rules",
|
|
1970
2058
|
"Claude Rules - Sync XY Labs standard Claude rules to .claude/rules/",
|
|
1971
2059
|
(yargs2) => {
|
|
@@ -2227,7 +2315,7 @@ var xyInstallCommands = (args) => {
|
|
|
2227
2315
|
};
|
|
2228
2316
|
|
|
2229
2317
|
// src/xy/xyLintCommands.ts
|
|
2230
|
-
import
|
|
2318
|
+
import chalk27 from "chalk";
|
|
2231
2319
|
var xyLintCommands = (args) => {
|
|
2232
2320
|
return args.command(
|
|
2233
2321
|
"cycle [package]",
|
|
@@ -2239,7 +2327,7 @@ var xyLintCommands = (args) => {
|
|
|
2239
2327
|
const start = Date.now();
|
|
2240
2328
|
if (argv.verbose) console.log("Cycle");
|
|
2241
2329
|
process.exitCode = await cycle({ pkg: argv.package });
|
|
2242
|
-
console.log(
|
|
2330
|
+
console.log(chalk27.blue(`Finished in ${Date.now() - start}ms`));
|
|
2243
2331
|
}
|
|
2244
2332
|
).command(
|
|
2245
2333
|
"lint [package]",
|
|
@@ -2269,7 +2357,7 @@ var xyLintCommands = (args) => {
|
|
|
2269
2357
|
cache: argv.cache,
|
|
2270
2358
|
verbose: !!argv.verbose
|
|
2271
2359
|
});
|
|
2272
|
-
console.log(
|
|
2360
|
+
console.log(chalk27.blue(`Finished in ${Date.now() - start}ms`));
|
|
2273
2361
|
}
|
|
2274
2362
|
).command(
|
|
2275
2363
|
"deplint [package]",
|
|
@@ -2302,7 +2390,7 @@ var xyLintCommands = (args) => {
|
|
|
2302
2390
|
peerDeps: !!argv.peerDeps,
|
|
2303
2391
|
verbose: !!argv.verbose
|
|
2304
2392
|
});
|
|
2305
|
-
console.log(
|
|
2393
|
+
console.log(chalk27.blue(`Finished in ${Date.now() - start}ms`));
|
|
2306
2394
|
}
|
|
2307
2395
|
).command(
|
|
2308
2396
|
"fix [package]",
|
|
@@ -2314,7 +2402,7 @@ var xyLintCommands = (args) => {
|
|
|
2314
2402
|
const start = Date.now();
|
|
2315
2403
|
if (argv.verbose) console.log("Fix");
|
|
2316
2404
|
process.exitCode = fix();
|
|
2317
|
-
console.log(
|
|
2405
|
+
console.log(chalk27.blue(`Finished in ${Date.now() - start}ms`));
|
|
2318
2406
|
}
|
|
2319
2407
|
).command(
|
|
2320
2408
|
"relint [package]",
|
|
@@ -2326,7 +2414,7 @@ var xyLintCommands = (args) => {
|
|
|
2326
2414
|
if (argv.verbose) console.log("Relinting");
|
|
2327
2415
|
const start = Date.now();
|
|
2328
2416
|
process.exitCode = relint();
|
|
2329
|
-
console.log(
|
|
2417
|
+
console.log(chalk27.blue(`Finished in ${Date.now() - start}ms`));
|
|
2330
2418
|
}
|
|
2331
2419
|
).command(
|
|
2332
2420
|
"publint [package]",
|
|
@@ -2338,7 +2426,7 @@ var xyLintCommands = (args) => {
|
|
|
2338
2426
|
if (argv.verbose) console.log("Publint");
|
|
2339
2427
|
const start = Date.now();
|
|
2340
2428
|
process.exitCode = await publint({ pkg: argv.package, verbose: !!argv.verbose });
|
|
2341
|
-
console.log(
|
|
2429
|
+
console.log(chalk27.blue(`Finished in ${Date.now() - start}ms`));
|
|
2342
2430
|
}
|
|
2343
2431
|
).command(
|
|
2344
2432
|
"knip",
|
|
@@ -2350,7 +2438,7 @@ var xyLintCommands = (args) => {
|
|
|
2350
2438
|
if (argv.verbose) console.log("Knip");
|
|
2351
2439
|
const start = Date.now();
|
|
2352
2440
|
process.exitCode = knip();
|
|
2353
|
-
console.log(
|
|
2441
|
+
console.log(chalk27.blue(`Knip finished in ${Date.now() - start}ms`));
|
|
2354
2442
|
}
|
|
2355
2443
|
).command(
|
|
2356
2444
|
"sonar",
|
|
@@ -2362,7 +2450,7 @@ var xyLintCommands = (args) => {
|
|
|
2362
2450
|
const start = Date.now();
|
|
2363
2451
|
if (argv.verbose) console.log("Sonar Check");
|
|
2364
2452
|
process.exitCode = sonar();
|
|
2365
|
-
console.log(
|
|
2453
|
+
console.log(chalk27.blue(`Finished in ${Date.now() - start}ms`));
|
|
2366
2454
|
}
|
|
2367
2455
|
);
|
|
2368
2456
|
};
|
|
@@ -2398,8 +2486,8 @@ var xyParseOptions = () => {
|
|
|
2398
2486
|
var xy = async () => {
|
|
2399
2487
|
const options = xyParseOptions();
|
|
2400
2488
|
return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
|
|
2401
|
-
console.error(
|
|
2402
|
-
console.log(
|
|
2489
|
+
console.error(chalk28.yellow(`Command not found [${chalk28.magenta(process.argv[2])}]`));
|
|
2490
|
+
console.log(chalk28.gray("Try 'yarn xy --help' for list of commands"));
|
|
2403
2491
|
}).version().help().argv;
|
|
2404
2492
|
};
|
|
2405
2493
|
export {
|