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