@xylabs/ts-scripts-yarn3 7.4.24 → 7.4.26
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-settings.mjs +3 -0
- package/dist/actions/claude-settings.mjs.map +1 -1
- package/dist/actions/index.mjs +3 -2
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/package/compile/index.mjs +0 -2
- package/dist/actions/package/index.mjs +0 -2
- package/dist/bin/xy.mjs +213 -172
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +8 -5
- package/dist/index.mjs +267 -227
- package/dist/index.mjs.map +1 -1
- package/dist/lib/index.mjs +31 -0
- package/dist/lib/index.mjs.map +1 -1
- package/dist/lib/tryRunLocalScript.mjs +33 -0
- package/dist/lib/tryRunLocalScript.mjs.map +1 -0
- package/dist/xy/common/claude/index.mjs +3 -0
- package/dist/xy/common/claude/index.mjs.map +1 -1
- package/dist/xy/common/claude/initCommand.mjs +3 -0
- package/dist/xy/common/claude/initCommand.mjs.map +1 -1
- package/dist/xy/common/claude/settingsCommand.mjs +3 -0
- package/dist/xy/common/claude/settingsCommand.mjs.map +1 -1
- package/dist/xy/common/index.mjs +3 -0
- package/dist/xy/common/index.mjs.map +1 -1
- package/dist/xy/index.mjs +213 -172
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/xy.mjs +213 -172
- package/dist/xy/xy.mjs.map +1 -1
- package/dist/xy/xyParseOptions.mjs +41 -1
- package/dist/xy/xyParseOptions.mjs.map +1 -1
- package/package.json +12 -12
- package/templates/claude/skills/xylabs-e2e-setup/SKILL.md +19 -6
package/dist/xy/xy.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// src/xy/xy.ts
|
|
2
|
-
import
|
|
2
|
+
import chalk43 from "chalk";
|
|
3
3
|
|
|
4
4
|
// src/actions/build.ts
|
|
5
|
-
import
|
|
5
|
+
import chalk10 from "chalk";
|
|
6
6
|
|
|
7
7
|
// src/lib/checkResult.ts
|
|
8
8
|
import chalk from "chalk";
|
|
@@ -687,6 +687,36 @@ var runStepsAsync = async (name, steps, exitOnFail = true, messages) => {
|
|
|
687
687
|
});
|
|
688
688
|
};
|
|
689
689
|
|
|
690
|
+
// src/lib/tryRunLocalScript.ts
|
|
691
|
+
import { spawnSync as spawnSync4 } from "child_process";
|
|
692
|
+
import { readFileSync as readFileSync6 } from "fs";
|
|
693
|
+
import PATH4 from "path";
|
|
694
|
+
import chalk9 from "chalk";
|
|
695
|
+
function tryRunLocalScript(commandName) {
|
|
696
|
+
if (process.env.XY_LOCAL_SCRIPT === "1") return void 0;
|
|
697
|
+
const rootPkgPath = PATH4.resolve(process.cwd(), "package.json");
|
|
698
|
+
let rootPkg;
|
|
699
|
+
try {
|
|
700
|
+
rootPkg = JSON.parse(readFileSync6(rootPkgPath, "utf8"));
|
|
701
|
+
} catch {
|
|
702
|
+
return void 0;
|
|
703
|
+
}
|
|
704
|
+
if (!rootPkg.scripts?.[commandName]) return void 0;
|
|
705
|
+
console.log(chalk9.blue(`Delegating "${commandName}" to local script`));
|
|
706
|
+
const result = spawnSync4("yarn", ["run", commandName], {
|
|
707
|
+
cwd: process.cwd(),
|
|
708
|
+
encoding: "utf8",
|
|
709
|
+
env: {
|
|
710
|
+
FORCE_COLOR: "3",
|
|
711
|
+
...process.env,
|
|
712
|
+
XY_LOCAL_SCRIPT: "1"
|
|
713
|
+
},
|
|
714
|
+
shell: true,
|
|
715
|
+
stdio: "inherit"
|
|
716
|
+
});
|
|
717
|
+
return result.status ?? 1;
|
|
718
|
+
}
|
|
719
|
+
|
|
690
720
|
// src/actions/build.ts
|
|
691
721
|
var build = async ({
|
|
692
722
|
incremental,
|
|
@@ -702,7 +732,7 @@ var build = async ({
|
|
|
702
732
|
const targetOptions = target === void 0 ? [] : ["-t", target];
|
|
703
733
|
const jobsOptions = jobs === void 0 ? [] : ["-j", `${jobs}`];
|
|
704
734
|
if (jobs !== void 0) {
|
|
705
|
-
console.log(
|
|
735
|
+
console.log(chalk10.blue(`Jobs set to [${jobs}]`));
|
|
706
736
|
}
|
|
707
737
|
const result = await runStepsAsync(`Build${incremental ? "-Incremental" : ""} [${pkg ?? "All"}]`, [
|
|
708
738
|
["yarn", ["xy", "compile", ...pkgOptions, ...targetOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions, "--types", "tsup"]],
|
|
@@ -710,7 +740,7 @@ var build = async ({
|
|
|
710
740
|
["yarn", ["xy", "deplint", ...pkgOptions, ...verboseOptions, ...jobsOptions, ...incrementalOptions]],
|
|
711
741
|
["yarn", ["xy", "lint", ...pkgOptions, ...verboseOptions, ...incrementalOptions]]
|
|
712
742
|
]);
|
|
713
|
-
console.log(`${
|
|
743
|
+
console.log(`${chalk10.gray("Built in")} [${chalk10.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk10.gray("seconds")}`);
|
|
714
744
|
return result;
|
|
715
745
|
};
|
|
716
746
|
|
|
@@ -721,12 +751,12 @@ import {
|
|
|
721
751
|
rmSync,
|
|
722
752
|
unlinkSync
|
|
723
753
|
} from "fs";
|
|
724
|
-
import
|
|
725
|
-
import
|
|
754
|
+
import PATH5 from "path";
|
|
755
|
+
import chalk11 from "chalk";
|
|
726
756
|
function removeFile(filePath, label) {
|
|
727
757
|
if (existsSync4(filePath)) {
|
|
728
758
|
unlinkSync(filePath);
|
|
729
|
-
console.log(
|
|
759
|
+
console.log(chalk11.yellow(` Removed ${label}`));
|
|
730
760
|
return true;
|
|
731
761
|
}
|
|
732
762
|
return false;
|
|
@@ -734,26 +764,26 @@ function removeFile(filePath, label) {
|
|
|
734
764
|
function removeDir(dirPath, label) {
|
|
735
765
|
if (existsSync4(dirPath)) {
|
|
736
766
|
rmSync(dirPath, { recursive: true });
|
|
737
|
-
console.log(
|
|
767
|
+
console.log(chalk11.yellow(` Removed ${label}`));
|
|
738
768
|
return true;
|
|
739
769
|
}
|
|
740
770
|
return false;
|
|
741
771
|
}
|
|
742
772
|
function claudeClean() {
|
|
743
|
-
console.log(
|
|
773
|
+
console.log(chalk11.green("Clean Claude configuration"));
|
|
744
774
|
const cwd = INIT_CWD() ?? process.cwd();
|
|
745
775
|
let removed = 0;
|
|
746
776
|
const rootFiles = ["CLAUDE.md", "CLAUDE.local.md"];
|
|
747
777
|
for (const file of rootFiles) {
|
|
748
|
-
if (removeFile(
|
|
778
|
+
if (removeFile(PATH5.resolve(cwd, file), file)) removed++;
|
|
749
779
|
}
|
|
750
|
-
if (removeDir(
|
|
751
|
-
const packagesDir =
|
|
780
|
+
if (removeDir(PATH5.resolve(cwd, ".claude"), ".claude/")) removed++;
|
|
781
|
+
const packagesDir = PATH5.resolve(cwd, "packages");
|
|
752
782
|
if (existsSync4(packagesDir)) {
|
|
753
783
|
const findClaudeFiles = (dir, prefix) => {
|
|
754
784
|
const entries = readdirSync2(dir, { withFileTypes: true });
|
|
755
785
|
for (const entry of entries) {
|
|
756
|
-
const fullPath =
|
|
786
|
+
const fullPath = PATH5.resolve(dir, entry.name);
|
|
757
787
|
const label = `${prefix}${entry.name}`;
|
|
758
788
|
if (entry.isFile() && (entry.name === "CLAUDE.md" || entry.name === "CLAUDE.local.md")) {
|
|
759
789
|
if (removeFile(fullPath, label)) removed++;
|
|
@@ -767,9 +797,9 @@ function claudeClean() {
|
|
|
767
797
|
findClaudeFiles(packagesDir, "packages/");
|
|
768
798
|
}
|
|
769
799
|
if (removed > 0) {
|
|
770
|
-
console.log(
|
|
800
|
+
console.log(chalk11.green(` Removed ${removed} item(s)`));
|
|
771
801
|
} else {
|
|
772
|
-
console.log(
|
|
802
|
+
console.log(chalk11.gray(" Nothing to clean"));
|
|
773
803
|
}
|
|
774
804
|
return 0;
|
|
775
805
|
}
|
|
@@ -779,20 +809,20 @@ import {
|
|
|
779
809
|
existsSync as existsSync5,
|
|
780
810
|
mkdirSync,
|
|
781
811
|
readdirSync as readdirSync3,
|
|
782
|
-
readFileSync as
|
|
812
|
+
readFileSync as readFileSync7,
|
|
783
813
|
unlinkSync as unlinkSync2,
|
|
784
814
|
writeFileSync as writeFileSync2
|
|
785
815
|
} from "fs";
|
|
786
|
-
import
|
|
787
|
-
import
|
|
816
|
+
import PATH6 from "path";
|
|
817
|
+
import chalk12 from "chalk";
|
|
788
818
|
var syncCommandFiles = (commandsDir) => {
|
|
789
819
|
const templates = claudeCommandTemplates();
|
|
790
820
|
const templateNames = new Set(Object.keys(templates));
|
|
791
821
|
let updated = 0;
|
|
792
822
|
let created = 0;
|
|
793
823
|
for (const [filename2, content] of Object.entries(templates)) {
|
|
794
|
-
const targetPath =
|
|
795
|
-
const existing = existsSync5(targetPath) ?
|
|
824
|
+
const targetPath = PATH6.resolve(commandsDir, filename2);
|
|
825
|
+
const existing = existsSync5(targetPath) ? readFileSync7(targetPath, "utf8") : void 0;
|
|
796
826
|
if (existing === content) continue;
|
|
797
827
|
writeFileSync2(targetPath, content, "utf8");
|
|
798
828
|
if (existing) {
|
|
@@ -812,7 +842,7 @@ var removeStaleCommands = (commandsDir, templateNames) => {
|
|
|
812
842
|
let removed = 0;
|
|
813
843
|
for (const file of existingCommands) {
|
|
814
844
|
if (!templateNames.has(file)) {
|
|
815
|
-
unlinkSync2(
|
|
845
|
+
unlinkSync2(PATH6.resolve(commandsDir, file));
|
|
816
846
|
removed++;
|
|
817
847
|
}
|
|
818
848
|
}
|
|
@@ -821,7 +851,7 @@ var removeStaleCommands = (commandsDir, templateNames) => {
|
|
|
821
851
|
var removeLegacyCommands = (commandsDir) => {
|
|
822
852
|
const legacyFiles = readdirSync3(commandsDir).filter((f) => f.startsWith(LEGACY_COMMANDS_PREFIX) && f.endsWith(".md"));
|
|
823
853
|
for (const file of legacyFiles) {
|
|
824
|
-
unlinkSync2(
|
|
854
|
+
unlinkSync2(PATH6.resolve(commandsDir, file));
|
|
825
855
|
}
|
|
826
856
|
return legacyFiles.length;
|
|
827
857
|
};
|
|
@@ -832,14 +862,14 @@ var logCommandsResult = (created, updated, removed) => {
|
|
|
832
862
|
updated ? `${updated} updated` : "",
|
|
833
863
|
removed ? `${removed} removed` : ""
|
|
834
864
|
].filter(Boolean);
|
|
835
|
-
console.log(
|
|
865
|
+
console.log(chalk12.green(`.claude/commands/${XYLABS_COMMANDS_PREFIX}*.md: ${parts.join(", ")}`));
|
|
836
866
|
} else {
|
|
837
|
-
console.log(
|
|
867
|
+
console.log(chalk12.gray(`.claude/commands/${XYLABS_COMMANDS_PREFIX}*.md: already up to date`));
|
|
838
868
|
}
|
|
839
869
|
};
|
|
840
870
|
var claudeCommands = () => {
|
|
841
871
|
const cwd = INIT_CWD() ?? process.cwd();
|
|
842
|
-
const commandsDir =
|
|
872
|
+
const commandsDir = PATH6.resolve(cwd, ".claude", "commands");
|
|
843
873
|
mkdirSync(commandsDir, { recursive: true });
|
|
844
874
|
const legacy = removeLegacyCommands(commandsDir);
|
|
845
875
|
const {
|
|
@@ -853,25 +883,25 @@ var claudeCommands = () => {
|
|
|
853
883
|
};
|
|
854
884
|
|
|
855
885
|
// src/actions/claude-rules.ts
|
|
856
|
-
import { spawnSync as
|
|
886
|
+
import { spawnSync as spawnSync5 } from "child_process";
|
|
857
887
|
import {
|
|
858
888
|
existsSync as existsSync6,
|
|
859
889
|
mkdirSync as mkdirSync2,
|
|
860
890
|
readdirSync as readdirSync4,
|
|
861
|
-
readFileSync as
|
|
891
|
+
readFileSync as readFileSync8,
|
|
862
892
|
unlinkSync as unlinkSync3,
|
|
863
893
|
writeFileSync as writeFileSync3
|
|
864
894
|
} from "fs";
|
|
865
|
-
import
|
|
866
|
-
import
|
|
895
|
+
import PATH7 from "path";
|
|
896
|
+
import chalk13 from "chalk";
|
|
867
897
|
var syncRuleFiles = (rulesDir) => {
|
|
868
898
|
const templates = claudeMdRuleTemplates();
|
|
869
899
|
const templateNames = new Set(Object.keys(templates));
|
|
870
900
|
let updated = 0;
|
|
871
901
|
let created = 0;
|
|
872
902
|
for (const [filename2, content] of Object.entries(templates)) {
|
|
873
|
-
const targetPath =
|
|
874
|
-
const existing = existsSync6(targetPath) ?
|
|
903
|
+
const targetPath = PATH7.resolve(rulesDir, filename2);
|
|
904
|
+
const existing = existsSync6(targetPath) ? readFileSync8(targetPath, "utf8") : void 0;
|
|
875
905
|
if (existing === content) continue;
|
|
876
906
|
writeFileSync3(targetPath, content, "utf8");
|
|
877
907
|
if (existing) {
|
|
@@ -891,7 +921,7 @@ var removeStaleRules = (rulesDir, templateNames) => {
|
|
|
891
921
|
let removed = 0;
|
|
892
922
|
for (const file of existingRules) {
|
|
893
923
|
if (!templateNames.has(file)) {
|
|
894
|
-
unlinkSync3(
|
|
924
|
+
unlinkSync3(PATH7.resolve(rulesDir, file));
|
|
895
925
|
removed++;
|
|
896
926
|
}
|
|
897
927
|
}
|
|
@@ -904,44 +934,44 @@ var logRulesResult = (created, updated, removed) => {
|
|
|
904
934
|
updated ? `${updated} updated` : "",
|
|
905
935
|
removed ? `${removed} removed` : ""
|
|
906
936
|
].filter(Boolean);
|
|
907
|
-
console.log(
|
|
937
|
+
console.log(chalk13.green(`.claude/rules/${XYLABS_RULES_PREFIX}*.md: ${parts.join(", ")}`));
|
|
908
938
|
} else {
|
|
909
|
-
console.log(
|
|
939
|
+
console.log(chalk13.gray(`.claude/rules/${XYLABS_RULES_PREFIX}*.md: already up to date`));
|
|
910
940
|
}
|
|
911
941
|
};
|
|
912
942
|
var ensureProjectClaudeMd = (cwd, force) => {
|
|
913
|
-
const projectPath =
|
|
943
|
+
const projectPath = PATH7.resolve(cwd, "CLAUDE.md");
|
|
914
944
|
if (!existsSync6(projectPath) || force) {
|
|
915
945
|
if (force && existsSync6(projectPath)) {
|
|
916
|
-
console.log(
|
|
946
|
+
console.log(chalk13.yellow("Regenerating CLAUDE.md"));
|
|
917
947
|
}
|
|
918
|
-
console.log(
|
|
919
|
-
const result =
|
|
948
|
+
console.log(chalk13.green("Generating CLAUDE.md via claude /init..."));
|
|
949
|
+
const result = spawnSync5("claude", ["-p", "/init", "--allowedTools", "Read", "Write", "Glob", "Grep"], {
|
|
920
950
|
cwd,
|
|
921
951
|
shell: true,
|
|
922
952
|
stdio: "inherit"
|
|
923
953
|
});
|
|
924
954
|
if (result.status !== 0) {
|
|
925
|
-
console.error(
|
|
955
|
+
console.error(chalk13.red("claude /init failed \u2014 is Claude Code installed?"));
|
|
926
956
|
return 1;
|
|
927
957
|
}
|
|
928
958
|
} else {
|
|
929
|
-
console.log(
|
|
959
|
+
console.log(chalk13.gray("CLAUDE.md already exists (skipped, use --force to regenerate)"));
|
|
930
960
|
}
|
|
931
961
|
return 0;
|
|
932
962
|
};
|
|
933
963
|
var ensureLocalClaudeMd = (cwd) => {
|
|
934
|
-
const localPath =
|
|
964
|
+
const localPath = PATH7.resolve(cwd, "CLAUDE.local.md");
|
|
935
965
|
if (existsSync6(localPath)) {
|
|
936
|
-
console.log(
|
|
966
|
+
console.log(chalk13.gray("CLAUDE.local.md already exists (skipped)"));
|
|
937
967
|
} else {
|
|
938
968
|
writeFileSync3(localPath, claudeMdLocalTemplate(), "utf8");
|
|
939
|
-
console.log(
|
|
969
|
+
console.log(chalk13.green("Generated CLAUDE.local.md"));
|
|
940
970
|
}
|
|
941
971
|
};
|
|
942
972
|
var claudeRules = ({ force } = {}) => {
|
|
943
973
|
const cwd = INIT_CWD() ?? process.cwd();
|
|
944
|
-
const rulesDir =
|
|
974
|
+
const rulesDir = PATH7.resolve(cwd, ".claude", "rules");
|
|
945
975
|
mkdirSync2(rulesDir, { recursive: true });
|
|
946
976
|
const {
|
|
947
977
|
created,
|
|
@@ -961,9 +991,9 @@ import {
|
|
|
961
991
|
mkdirSync as mkdirSync3,
|
|
962
992
|
writeFileSync as writeFileSync4
|
|
963
993
|
} from "fs";
|
|
964
|
-
import
|
|
994
|
+
import PATH8 from "path";
|
|
965
995
|
import { createInterface as createInterface2 } from "readline";
|
|
966
|
-
import
|
|
996
|
+
import chalk14 from "chalk";
|
|
967
997
|
var DEFAULT_SETTINGS = {
|
|
968
998
|
permissions: {
|
|
969
999
|
allow: [
|
|
@@ -982,6 +1012,9 @@ var DEFAULT_SETTINGS = {
|
|
|
982
1012
|
"Bash(echo *)",
|
|
983
1013
|
"Bash(pwd)",
|
|
984
1014
|
"Bash(which *)",
|
|
1015
|
+
"Bash(grep *)",
|
|
1016
|
+
"Bash(find *)",
|
|
1017
|
+
"Bash(npm view *)",
|
|
985
1018
|
"Bash(gh *)",
|
|
986
1019
|
"Read",
|
|
987
1020
|
"Edit",
|
|
@@ -1008,21 +1041,21 @@ function askConfirmation2(question) {
|
|
|
1008
1041
|
}
|
|
1009
1042
|
async function claudeSettings() {
|
|
1010
1043
|
const cwd = INIT_CWD() ?? process.cwd();
|
|
1011
|
-
const claudeDir =
|
|
1012
|
-
const settingsPath =
|
|
1044
|
+
const claudeDir = PATH8.resolve(cwd, ".claude");
|
|
1045
|
+
const settingsPath = PATH8.resolve(claudeDir, "settings.local.json");
|
|
1013
1046
|
mkdirSync3(claudeDir, { recursive: true });
|
|
1014
1047
|
if (existsSync7(settingsPath)) {
|
|
1015
1048
|
const confirmed = await askConfirmation2(
|
|
1016
|
-
|
|
1049
|
+
chalk14.yellow(`${settingsPath} already exists. Replace it? (y/N) `)
|
|
1017
1050
|
);
|
|
1018
1051
|
if (!confirmed) {
|
|
1019
|
-
console.log(
|
|
1052
|
+
console.log(chalk14.gray("Skipped \u2014 existing settings.local.json preserved"));
|
|
1020
1053
|
return 0;
|
|
1021
1054
|
}
|
|
1022
1055
|
}
|
|
1023
1056
|
writeFileSync4(settingsPath, `${JSON.stringify(DEFAULT_SETTINGS, null, 2)}
|
|
1024
1057
|
`, "utf8");
|
|
1025
|
-
console.log(
|
|
1058
|
+
console.log(chalk14.green("Generated .claude/settings.local.json"));
|
|
1026
1059
|
return 0;
|
|
1027
1060
|
}
|
|
1028
1061
|
|
|
@@ -1031,25 +1064,25 @@ import {
|
|
|
1031
1064
|
existsSync as existsSync8,
|
|
1032
1065
|
mkdirSync as mkdirSync4,
|
|
1033
1066
|
readdirSync as readdirSync5,
|
|
1034
|
-
readFileSync as
|
|
1067
|
+
readFileSync as readFileSync9,
|
|
1035
1068
|
rmSync as rmSync2,
|
|
1036
1069
|
statSync as statSync2,
|
|
1037
1070
|
writeFileSync as writeFileSync5
|
|
1038
1071
|
} from "fs";
|
|
1039
|
-
import
|
|
1040
|
-
import
|
|
1072
|
+
import PATH9 from "path";
|
|
1073
|
+
import chalk15 from "chalk";
|
|
1041
1074
|
var syncSkillFiles = (skillsDir) => {
|
|
1042
1075
|
const templates = claudeSkillTemplates();
|
|
1043
1076
|
const templateNames = new Set(Object.keys(templates));
|
|
1044
1077
|
let updated = 0;
|
|
1045
1078
|
let created = 0;
|
|
1046
1079
|
for (const [skillName, files] of Object.entries(templates)) {
|
|
1047
|
-
const skillDir =
|
|
1080
|
+
const skillDir = PATH9.resolve(skillsDir, skillName);
|
|
1048
1081
|
mkdirSync4(skillDir, { recursive: true });
|
|
1049
1082
|
for (const [filename2, content] of Object.entries(files)) {
|
|
1050
|
-
const targetPath =
|
|
1051
|
-
mkdirSync4(
|
|
1052
|
-
const existing = existsSync8(targetPath) ?
|
|
1083
|
+
const targetPath = PATH9.resolve(skillDir, filename2);
|
|
1084
|
+
mkdirSync4(PATH9.dirname(targetPath), { recursive: true });
|
|
1085
|
+
const existing = existsSync8(targetPath) ? readFileSync9(targetPath, "utf8") : void 0;
|
|
1053
1086
|
if (existing === content) continue;
|
|
1054
1087
|
writeFileSync5(targetPath, content, "utf8");
|
|
1055
1088
|
if (existing) {
|
|
@@ -1067,12 +1100,12 @@ var syncSkillFiles = (skillsDir) => {
|
|
|
1067
1100
|
};
|
|
1068
1101
|
var removeStaleSkills = (skillsDir, templateNames) => {
|
|
1069
1102
|
const existingSkills = readdirSync5(skillsDir).filter(
|
|
1070
|
-
(f) => f.startsWith(XYLABS_SKILLS_PREFIX) && statSync2(
|
|
1103
|
+
(f) => f.startsWith(XYLABS_SKILLS_PREFIX) && statSync2(PATH9.resolve(skillsDir, f)).isDirectory()
|
|
1071
1104
|
);
|
|
1072
1105
|
let removed = 0;
|
|
1073
1106
|
for (const dir of existingSkills) {
|
|
1074
1107
|
if (!templateNames.has(dir)) {
|
|
1075
|
-
rmSync2(
|
|
1108
|
+
rmSync2(PATH9.resolve(skillsDir, dir), { recursive: true });
|
|
1076
1109
|
removed++;
|
|
1077
1110
|
}
|
|
1078
1111
|
}
|
|
@@ -1085,14 +1118,14 @@ var logSkillsResult = (created, updated, removed) => {
|
|
|
1085
1118
|
updated ? `${updated} updated` : "",
|
|
1086
1119
|
removed ? `${removed} removed` : ""
|
|
1087
1120
|
].filter(Boolean);
|
|
1088
|
-
console.log(
|
|
1121
|
+
console.log(chalk15.green(`.claude/skills/${XYLABS_SKILLS_PREFIX}*/: ${parts.join(", ")}`));
|
|
1089
1122
|
} else {
|
|
1090
|
-
console.log(
|
|
1123
|
+
console.log(chalk15.gray(`.claude/skills/${XYLABS_SKILLS_PREFIX}*/: already up to date`));
|
|
1091
1124
|
}
|
|
1092
1125
|
};
|
|
1093
1126
|
var claudeSkills = () => {
|
|
1094
1127
|
const cwd = INIT_CWD() ?? process.cwd();
|
|
1095
|
-
const skillsDir =
|
|
1128
|
+
const skillsDir = PATH9.resolve(cwd, ".claude", "skills");
|
|
1096
1129
|
mkdirSync4(skillsDir, { recursive: true });
|
|
1097
1130
|
const {
|
|
1098
1131
|
created,
|
|
@@ -1118,16 +1151,16 @@ var cleanAll = ({ verbose }) => {
|
|
|
1118
1151
|
|
|
1119
1152
|
// src/actions/clean-docs.ts
|
|
1120
1153
|
import path from "path";
|
|
1121
|
-
import
|
|
1154
|
+
import chalk16 from "chalk";
|
|
1122
1155
|
var cleanDocs = () => {
|
|
1123
1156
|
const pkgName = process.env.npm_package_name;
|
|
1124
|
-
console.log(
|
|
1157
|
+
console.log(chalk16.green(`Cleaning Docs [${pkgName}]`));
|
|
1125
1158
|
for (const { location } of yarnWorkspaces()) deleteGlob(path.join(location, "docs"));
|
|
1126
1159
|
return 0;
|
|
1127
1160
|
};
|
|
1128
1161
|
|
|
1129
1162
|
// src/actions/compile.ts
|
|
1130
|
-
import
|
|
1163
|
+
import chalk17 from "chalk";
|
|
1131
1164
|
var compile = ({
|
|
1132
1165
|
verbose,
|
|
1133
1166
|
target,
|
|
@@ -1168,7 +1201,7 @@ var compileAll = ({
|
|
|
1168
1201
|
const incrementalOptions = incremental ? ["--since", "-Ap", "--topological-dev"] : ["--parallel", "-Ap", "--topological-dev"];
|
|
1169
1202
|
const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
|
|
1170
1203
|
if (jobs) {
|
|
1171
|
-
console.log(
|
|
1204
|
+
console.log(chalk17.blue(`Jobs set to [${jobs}]`));
|
|
1172
1205
|
}
|
|
1173
1206
|
const result = runSteps(`Compile${incremental ? "-Incremental" : ""} [All]`, [
|
|
1174
1207
|
["yarn", [
|
|
@@ -1182,13 +1215,13 @@ var compileAll = ({
|
|
|
1182
1215
|
...targetOptions
|
|
1183
1216
|
]]
|
|
1184
1217
|
]);
|
|
1185
|
-
console.log(`${
|
|
1218
|
+
console.log(`${chalk17.gray("Compiled in")} [${chalk17.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk17.gray("seconds")}`);
|
|
1186
1219
|
return result;
|
|
1187
1220
|
};
|
|
1188
1221
|
|
|
1189
1222
|
// src/actions/copy-assets.ts
|
|
1190
1223
|
import path2 from "path/posix";
|
|
1191
|
-
import
|
|
1224
|
+
import chalk18 from "chalk";
|
|
1192
1225
|
import cpy from "cpy";
|
|
1193
1226
|
var copyPackageTargetAssets = async (target, name, location) => {
|
|
1194
1227
|
try {
|
|
@@ -1211,7 +1244,7 @@ var copyPackageTargetAssets = async (target, name, location) => {
|
|
|
1211
1244
|
};
|
|
1212
1245
|
var copyTargetAssets = async (target, pkg) => {
|
|
1213
1246
|
const workspaces = yarnWorkspaces();
|
|
1214
|
-
console.log(
|
|
1247
|
+
console.log(chalk18.green(`Copying Assets [${target.toUpperCase()}]`));
|
|
1215
1248
|
const workspaceList = workspaces.filter(({ name }) => {
|
|
1216
1249
|
return pkg === void 0 || name === pkg;
|
|
1217
1250
|
});
|
|
@@ -1295,7 +1328,7 @@ var dead = () => {
|
|
|
1295
1328
|
};
|
|
1296
1329
|
|
|
1297
1330
|
// src/actions/deplint/deplint.ts
|
|
1298
|
-
import
|
|
1331
|
+
import chalk24 from "chalk";
|
|
1299
1332
|
|
|
1300
1333
|
// src/actions/deplint/findFiles.ts
|
|
1301
1334
|
import fs2 from "fs";
|
|
@@ -1500,7 +1533,7 @@ function getExternalImportsFromFiles({
|
|
|
1500
1533
|
|
|
1501
1534
|
// src/actions/deplint/checkPackage/getUnlistedDependencies.ts
|
|
1502
1535
|
import { builtinModules } from "module";
|
|
1503
|
-
import
|
|
1536
|
+
import chalk19 from "chalk";
|
|
1504
1537
|
function isRuntimeImportListed(imp, name, dependencies, peerDependencies) {
|
|
1505
1538
|
return dependencies.includes(imp) || imp === name || peerDependencies.includes(imp) || builtinModules.includes(imp);
|
|
1506
1539
|
}
|
|
@@ -1508,7 +1541,7 @@ function isTypeImportListed(imp, name, dependencies, devDependencies, peerDepend
|
|
|
1508
1541
|
return dependencies.includes(imp) || imp === name || dependencies.includes(`@types/${imp}`) || peerDependencies.includes(imp) || peerDependencies.includes(`@types/${imp}`) || devDependencies.includes(`@types/${imp}`) || builtinModules.includes(imp);
|
|
1509
1542
|
}
|
|
1510
1543
|
function logMissing(name, imp, importPaths) {
|
|
1511
|
-
console.log(`[${
|
|
1544
|
+
console.log(`[${chalk19.blue(name)}] Missing dependency in package.json: ${chalk19.red(imp)}`);
|
|
1512
1545
|
if (importPaths[imp]) {
|
|
1513
1546
|
console.log(` ${importPaths[imp].join("\n ")}`);
|
|
1514
1547
|
}
|
|
@@ -1537,7 +1570,7 @@ function getUnlistedDependencies({ name, location }, {
|
|
|
1537
1570
|
}
|
|
1538
1571
|
if (unlistedDependencies > 0) {
|
|
1539
1572
|
const packageLocation = `${location}/package.json`;
|
|
1540
|
-
console.log(` ${
|
|
1573
|
+
console.log(` ${chalk19.yellow(packageLocation)}
|
|
1541
1574
|
`);
|
|
1542
1575
|
}
|
|
1543
1576
|
return unlistedDependencies;
|
|
@@ -1545,7 +1578,7 @@ function getUnlistedDependencies({ name, location }, {
|
|
|
1545
1578
|
|
|
1546
1579
|
// src/actions/deplint/checkPackage/getUnlistedDevDependencies.ts
|
|
1547
1580
|
import { builtinModules as builtinModules2 } from "module";
|
|
1548
|
-
import
|
|
1581
|
+
import chalk20 from "chalk";
|
|
1549
1582
|
function getUnlistedDevDependencies({ name, location }, {
|
|
1550
1583
|
devDependencies,
|
|
1551
1584
|
dependencies,
|
|
@@ -1559,7 +1592,7 @@ function getUnlistedDevDependencies({ name, location }, {
|
|
|
1559
1592
|
for (const imp of externalAllImports) {
|
|
1560
1593
|
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)) {
|
|
1561
1594
|
unlistedDevDependencies++;
|
|
1562
|
-
console.log(`[${
|
|
1595
|
+
console.log(`[${chalk20.blue(name)}] Missing devDependency in package.json: ${chalk20.red(imp)}`);
|
|
1563
1596
|
if (allImportPaths[imp]) {
|
|
1564
1597
|
console.log(` ${allImportPaths[imp].join("\n ")}`);
|
|
1565
1598
|
}
|
|
@@ -1567,14 +1600,14 @@ function getUnlistedDevDependencies({ name, location }, {
|
|
|
1567
1600
|
}
|
|
1568
1601
|
if (unlistedDevDependencies > 0) {
|
|
1569
1602
|
const packageLocation = `${location}/package.json`;
|
|
1570
|
-
console.log(` ${
|
|
1603
|
+
console.log(` ${chalk20.yellow(packageLocation)}
|
|
1571
1604
|
`);
|
|
1572
1605
|
}
|
|
1573
1606
|
return unlistedDevDependencies;
|
|
1574
1607
|
}
|
|
1575
1608
|
|
|
1576
1609
|
// src/actions/deplint/checkPackage/getUnusedDependencies.ts
|
|
1577
|
-
import
|
|
1610
|
+
import chalk21 from "chalk";
|
|
1578
1611
|
function getUnusedDependencies({ name, location }, { dependencies }, {
|
|
1579
1612
|
externalDistImports,
|
|
1580
1613
|
externalDistTypeImports,
|
|
@@ -1586,22 +1619,22 @@ function getUnusedDependencies({ name, location }, { dependencies }, {
|
|
|
1586
1619
|
if (!externalDistImports.includes(dep) && !externalDistImports.includes(dep.replace(/^@types\//, "")) && !externalDistTypeImports.includes(dep) && !externalDistTypeImports.includes(dep.replace(/^@types\//, ""))) {
|
|
1587
1620
|
unusedDependencies++;
|
|
1588
1621
|
if (externalAllImports.includes(dep)) {
|
|
1589
|
-
console.log(`[${
|
|
1622
|
+
console.log(`[${chalk21.blue(name)}] dependency should be devDependency in package.json: ${chalk21.red(dep)}`);
|
|
1590
1623
|
} else {
|
|
1591
|
-
console.log(`[${
|
|
1624
|
+
console.log(`[${chalk21.blue(name)}] Unused dependency in package.json: ${chalk21.red(dep)}`);
|
|
1592
1625
|
}
|
|
1593
1626
|
}
|
|
1594
1627
|
}
|
|
1595
1628
|
if (unusedDependencies > 0) {
|
|
1596
1629
|
const packageLocation = `${location}/package.json`;
|
|
1597
|
-
console.log(` ${
|
|
1630
|
+
console.log(` ${chalk21.yellow(packageLocation)}
|
|
1598
1631
|
`);
|
|
1599
1632
|
}
|
|
1600
1633
|
return unusedDependencies;
|
|
1601
1634
|
}
|
|
1602
1635
|
|
|
1603
1636
|
// src/actions/deplint/checkPackage/getUnusedDevDependencies.ts
|
|
1604
|
-
import
|
|
1637
|
+
import chalk22 from "chalk";
|
|
1605
1638
|
|
|
1606
1639
|
// src/actions/deplint/getCliReferencedPackagesFromFiles.ts
|
|
1607
1640
|
import fs8 from "fs";
|
|
@@ -1885,19 +1918,19 @@ function getUnusedDevDependencies({ name, location }, {
|
|
|
1885
1918
|
if (dependencies.includes(dep) || peerDependencies.includes(dep)) continue;
|
|
1886
1919
|
if (!isDevDepUsed(dep, allImports, implicitDeps, requiredPeers, scriptRefs, cliRefs)) {
|
|
1887
1920
|
unusedDevDependencies++;
|
|
1888
|
-
console.log(`[${
|
|
1921
|
+
console.log(`[${chalk22.blue(name)}] Unused devDependency in package.json: ${chalk22.red(dep)}`);
|
|
1889
1922
|
}
|
|
1890
1923
|
}
|
|
1891
1924
|
if (unusedDevDependencies > 0) {
|
|
1892
1925
|
const packageLocation = `${location}/package.json`;
|
|
1893
|
-
console.log(` ${
|
|
1926
|
+
console.log(` ${chalk22.yellow(packageLocation)}
|
|
1894
1927
|
`);
|
|
1895
1928
|
}
|
|
1896
1929
|
return unusedDevDependencies;
|
|
1897
1930
|
}
|
|
1898
1931
|
|
|
1899
1932
|
// src/actions/deplint/checkPackage/getUnusedPeerDependencies.ts
|
|
1900
|
-
import
|
|
1933
|
+
import chalk23 from "chalk";
|
|
1901
1934
|
function getUnusedPeerDependencies({ name, location }, { peerDependencies, dependencies }, { externalDistImports, externalDistTypeImports }, exclude) {
|
|
1902
1935
|
let unusedDependencies = 0;
|
|
1903
1936
|
for (const dep of peerDependencies) {
|
|
@@ -1905,15 +1938,15 @@ function getUnusedPeerDependencies({ name, location }, { peerDependencies, depen
|
|
|
1905
1938
|
if (!externalDistImports.includes(dep) && !externalDistImports.includes(dep.replace(/^@types\//, "")) && !externalDistTypeImports.includes(dep) && !externalDistTypeImports.includes(dep.replace(/^@types\//, ""))) {
|
|
1906
1939
|
unusedDependencies++;
|
|
1907
1940
|
if (dependencies.includes(dep)) {
|
|
1908
|
-
console.log(`[${
|
|
1941
|
+
console.log(`[${chalk23.blue(name)}] Unused peerDependency [already a dependency] in package.json: ${chalk23.red(dep)}`);
|
|
1909
1942
|
} else {
|
|
1910
|
-
console.log(`[${
|
|
1943
|
+
console.log(`[${chalk23.blue(name)}] Unused peerDependency in package.json: ${chalk23.red(dep)}`);
|
|
1911
1944
|
}
|
|
1912
1945
|
}
|
|
1913
1946
|
}
|
|
1914
1947
|
if (unusedDependencies > 0) {
|
|
1915
1948
|
const packageLocation = `${location}/package.json`;
|
|
1916
|
-
console.log(` ${
|
|
1949
|
+
console.log(` ${chalk23.yellow(packageLocation)}
|
|
1917
1950
|
`);
|
|
1918
1951
|
}
|
|
1919
1952
|
return unusedDependencies;
|
|
@@ -2008,19 +2041,19 @@ var deplint = async ({
|
|
|
2008
2041
|
});
|
|
2009
2042
|
}
|
|
2010
2043
|
if (totalErrors > 0) {
|
|
2011
|
-
console.warn(`Deplint: Found ${
|
|
2044
|
+
console.warn(`Deplint: Found ${chalk24.red(totalErrors)} dependency problems. ${chalk24.red("\u2716")}`);
|
|
2012
2045
|
} else {
|
|
2013
|
-
console.info(`Deplint: Found no dependency problems. ${
|
|
2046
|
+
console.info(`Deplint: Found no dependency problems. ${chalk24.green("\u2714")}`);
|
|
2014
2047
|
}
|
|
2015
2048
|
return 0;
|
|
2016
2049
|
};
|
|
2017
2050
|
|
|
2018
2051
|
// src/actions/deploy.ts
|
|
2019
|
-
import { readFileSync as
|
|
2052
|
+
import { readFileSync as readFileSync10 } from "fs";
|
|
2020
2053
|
var privatePackageExcludeList = () => {
|
|
2021
2054
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
2022
2055
|
workspace,
|
|
2023
|
-
JSON.parse(
|
|
2056
|
+
JSON.parse(readFileSync10(`${workspace.location}/package.json`, { encoding: "utf8" }))
|
|
2024
2057
|
]);
|
|
2025
2058
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
2026
2059
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
@@ -2040,11 +2073,11 @@ var deploy = () => {
|
|
|
2040
2073
|
};
|
|
2041
2074
|
|
|
2042
2075
|
// src/actions/deploy-major.ts
|
|
2043
|
-
import { readFileSync as
|
|
2076
|
+
import { readFileSync as readFileSync11 } from "fs";
|
|
2044
2077
|
var privatePackageExcludeList2 = () => {
|
|
2045
2078
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
2046
2079
|
workspace,
|
|
2047
|
-
JSON.parse(
|
|
2080
|
+
JSON.parse(readFileSync11(`${workspace.location}/package.json`, { encoding: "utf8" }))
|
|
2048
2081
|
]);
|
|
2049
2082
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
2050
2083
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
@@ -2064,11 +2097,11 @@ var deployMajor = () => {
|
|
|
2064
2097
|
};
|
|
2065
2098
|
|
|
2066
2099
|
// src/actions/deploy-minor.ts
|
|
2067
|
-
import { readFileSync as
|
|
2100
|
+
import { readFileSync as readFileSync12 } from "fs";
|
|
2068
2101
|
var privatePackageExcludeList3 = () => {
|
|
2069
2102
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
2070
2103
|
workspace,
|
|
2071
|
-
JSON.parse(
|
|
2104
|
+
JSON.parse(readFileSync12(`${workspace.location}/package.json`, { encoding: "utf8" }))
|
|
2072
2105
|
]);
|
|
2073
2106
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
2074
2107
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
@@ -2088,11 +2121,11 @@ var deployMinor = () => {
|
|
|
2088
2121
|
};
|
|
2089
2122
|
|
|
2090
2123
|
// src/actions/deploy-next.ts
|
|
2091
|
-
import { readFileSync as
|
|
2124
|
+
import { readFileSync as readFileSync13 } from "fs";
|
|
2092
2125
|
var privatePackageExcludeList4 = () => {
|
|
2093
2126
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
2094
2127
|
workspace,
|
|
2095
|
-
JSON.parse(
|
|
2128
|
+
JSON.parse(readFileSync13(`${workspace.location}/package.json`, { encoding: "utf8" }))
|
|
2096
2129
|
]);
|
|
2097
2130
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
2098
2131
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
@@ -2112,9 +2145,9 @@ var deployNext = () => {
|
|
|
2112
2145
|
};
|
|
2113
2146
|
|
|
2114
2147
|
// src/actions/dupdeps.ts
|
|
2115
|
-
import
|
|
2148
|
+
import chalk25 from "chalk";
|
|
2116
2149
|
var dupdeps = () => {
|
|
2117
|
-
console.log(
|
|
2150
|
+
console.log(chalk25.green("Checking all Dependencies for Duplicates"));
|
|
2118
2151
|
const pkg = parsedPackageJSON();
|
|
2119
2152
|
const allDependencies = { ...pkg?.dependencies, ...pkg?.devDependencies };
|
|
2120
2153
|
const dependencies = Object.keys(allDependencies);
|
|
@@ -2122,13 +2155,13 @@ var dupdeps = () => {
|
|
|
2122
2155
|
};
|
|
2123
2156
|
|
|
2124
2157
|
// src/actions/lint.ts
|
|
2125
|
-
import
|
|
2158
|
+
import chalk26 from "chalk";
|
|
2126
2159
|
var lintPackage = ({
|
|
2127
2160
|
pkg,
|
|
2128
2161
|
fix: fix2,
|
|
2129
2162
|
verbose
|
|
2130
2163
|
}) => {
|
|
2131
|
-
console.log(
|
|
2164
|
+
console.log(chalk26.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
|
|
2132
2165
|
const start = Date.now();
|
|
2133
2166
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
|
|
2134
2167
|
["yarn", [
|
|
@@ -2138,7 +2171,7 @@ var lintPackage = ({
|
|
|
2138
2171
|
fix2 ? "package-fix" : verbose ? "package-lint-verbose" : "package-lint"
|
|
2139
2172
|
]]
|
|
2140
2173
|
]);
|
|
2141
|
-
console.log(
|
|
2174
|
+
console.log(chalk26.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk26.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk26.gray("seconds")}`));
|
|
2142
2175
|
return result;
|
|
2143
2176
|
};
|
|
2144
2177
|
var lint = ({
|
|
@@ -2158,13 +2191,13 @@ var lint = ({
|
|
|
2158
2191
|
});
|
|
2159
2192
|
};
|
|
2160
2193
|
var lintAllPackages = ({ fix: fix2 = false } = {}) => {
|
|
2161
|
-
console.log(
|
|
2194
|
+
console.log(chalk26.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
|
|
2162
2195
|
const start = Date.now();
|
|
2163
2196
|
const fixOptions = fix2 ? ["--fix"] : [];
|
|
2164
2197
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
|
|
2165
2198
|
["yarn", ["eslint", "--cache", "--cache-location", ".eslintcache", "--cache-strategy", "content", ...fixOptions]]
|
|
2166
2199
|
]);
|
|
2167
|
-
console.log(
|
|
2200
|
+
console.log(chalk26.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk26.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk26.gray("seconds")}`));
|
|
2168
2201
|
return result;
|
|
2169
2202
|
};
|
|
2170
2203
|
|
|
@@ -2189,7 +2222,7 @@ var genDocsAll = ({ incremental }) => {
|
|
|
2189
2222
|
|
|
2190
2223
|
// src/actions/gitignore.ts
|
|
2191
2224
|
import { unlinkSync as unlinkSync4 } from "fs";
|
|
2192
|
-
import
|
|
2225
|
+
import chalk27 from "chalk";
|
|
2193
2226
|
var COMMENT_PREFIX = "#";
|
|
2194
2227
|
var isComment = (line) => line.startsWith(COMMENT_PREFIX);
|
|
2195
2228
|
var isNegation = (line) => line.startsWith("!");
|
|
@@ -2246,7 +2279,7 @@ function removePackageGitignores(cwd) {
|
|
|
2246
2279
|
const filePath = `${cwd}/${location}/.gitignore`;
|
|
2247
2280
|
try {
|
|
2248
2281
|
unlinkSync4(filePath);
|
|
2249
|
-
console.log(
|
|
2282
|
+
console.log(chalk27.yellow(` Removed ${location}/.gitignore`));
|
|
2250
2283
|
removed++;
|
|
2251
2284
|
} catch {
|
|
2252
2285
|
}
|
|
@@ -2254,7 +2287,7 @@ function removePackageGitignores(cwd) {
|
|
|
2254
2287
|
return removed;
|
|
2255
2288
|
}
|
|
2256
2289
|
function gitignore() {
|
|
2257
|
-
console.log(
|
|
2290
|
+
console.log(chalk27.green("Generate .gitignore"));
|
|
2258
2291
|
const cwd = INIT_CWD() ?? ".";
|
|
2259
2292
|
const gitignorePath = `${cwd}/.gitignore`;
|
|
2260
2293
|
try {
|
|
@@ -2262,21 +2295,21 @@ function gitignore() {
|
|
|
2262
2295
|
const existing = readNonEmptyLines(gitignorePath);
|
|
2263
2296
|
const merged = mergeWithTemplate(existing, templateContent);
|
|
2264
2297
|
writeLines(gitignorePath, merged);
|
|
2265
|
-
console.log(
|
|
2298
|
+
console.log(chalk27.green(" Root .gitignore updated"));
|
|
2266
2299
|
const removed = removePackageGitignores(cwd);
|
|
2267
2300
|
if (removed > 0) {
|
|
2268
|
-
console.log(
|
|
2301
|
+
console.log(chalk27.green(` Removed ${removed} package .gitignore file(s)`));
|
|
2269
2302
|
}
|
|
2270
2303
|
return 0;
|
|
2271
2304
|
} catch (ex) {
|
|
2272
2305
|
const error = ex;
|
|
2273
|
-
console.error(
|
|
2306
|
+
console.error(chalk27.red(`Generate .gitignore failed: ${error.message}`));
|
|
2274
2307
|
return 1;
|
|
2275
2308
|
}
|
|
2276
2309
|
}
|
|
2277
2310
|
|
|
2278
2311
|
// src/actions/gitlint.ts
|
|
2279
|
-
import
|
|
2312
|
+
import chalk28 from "chalk";
|
|
2280
2313
|
import ParseGitConfig from "parse-git-config";
|
|
2281
2314
|
var gitlint = () => {
|
|
2282
2315
|
console.log(`
|
|
@@ -2287,7 +2320,7 @@ Gitlint Start [${process.cwd()}]
|
|
|
2287
2320
|
const errors = 0;
|
|
2288
2321
|
const gitConfig = ParseGitConfig.sync();
|
|
2289
2322
|
const warn = (message) => {
|
|
2290
|
-
console.warn(
|
|
2323
|
+
console.warn(chalk28.yellow(`Warning: ${message}`));
|
|
2291
2324
|
warnings++;
|
|
2292
2325
|
};
|
|
2293
2326
|
if (gitConfig.core.ignorecase) {
|
|
@@ -2307,13 +2340,13 @@ Gitlint Start [${process.cwd()}]
|
|
|
2307
2340
|
}
|
|
2308
2341
|
const resultMessages = [];
|
|
2309
2342
|
if (valid > 0) {
|
|
2310
|
-
resultMessages.push(
|
|
2343
|
+
resultMessages.push(chalk28.green(`Passed: ${valid}`));
|
|
2311
2344
|
}
|
|
2312
2345
|
if (warnings > 0) {
|
|
2313
|
-
resultMessages.push(
|
|
2346
|
+
resultMessages.push(chalk28.yellow(`Warnings: ${warnings}`));
|
|
2314
2347
|
}
|
|
2315
2348
|
if (errors > 0) {
|
|
2316
|
-
resultMessages.push(
|
|
2349
|
+
resultMessages.push(chalk28.red(` Errors: ${errors}`));
|
|
2317
2350
|
}
|
|
2318
2351
|
console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
|
|
2319
2352
|
`);
|
|
@@ -2322,7 +2355,7 @@ Gitlint Start [${process.cwd()}]
|
|
|
2322
2355
|
|
|
2323
2356
|
// src/actions/gitlint-fix.ts
|
|
2324
2357
|
import { execSync as execSync3 } from "child_process";
|
|
2325
|
-
import
|
|
2358
|
+
import chalk29 from "chalk";
|
|
2326
2359
|
import ParseGitConfig2 from "parse-git-config";
|
|
2327
2360
|
var gitlintFix = () => {
|
|
2328
2361
|
console.log(`
|
|
@@ -2331,15 +2364,15 @@ Gitlint Fix Start [${process.cwd()}]
|
|
|
2331
2364
|
const gitConfig = ParseGitConfig2.sync();
|
|
2332
2365
|
if (gitConfig.core.ignorecase) {
|
|
2333
2366
|
execSync3("git config core.ignorecase false", { stdio: "inherit" });
|
|
2334
|
-
console.warn(
|
|
2367
|
+
console.warn(chalk29.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
|
|
2335
2368
|
}
|
|
2336
2369
|
if (gitConfig.core.autocrlf !== false) {
|
|
2337
2370
|
execSync3("git config core.autocrlf false", { stdio: "inherit" });
|
|
2338
|
-
console.warn(
|
|
2371
|
+
console.warn(chalk29.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
|
|
2339
2372
|
}
|
|
2340
2373
|
if (gitConfig.core.eol !== "lf") {
|
|
2341
2374
|
execSync3("git config core.eol lf", { stdio: "inherit" });
|
|
2342
|
-
console.warn(
|
|
2375
|
+
console.warn(chalk29.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
|
|
2343
2376
|
}
|
|
2344
2377
|
return 1;
|
|
2345
2378
|
};
|
|
@@ -2350,7 +2383,7 @@ var knip = () => {
|
|
|
2350
2383
|
};
|
|
2351
2384
|
|
|
2352
2385
|
// src/actions/license.ts
|
|
2353
|
-
import
|
|
2386
|
+
import chalk30 from "chalk";
|
|
2354
2387
|
import { init } from "license-checker";
|
|
2355
2388
|
var license = async (pkg) => {
|
|
2356
2389
|
const workspaces = yarnWorkspaces();
|
|
@@ -2375,18 +2408,18 @@ var license = async (pkg) => {
|
|
|
2375
2408
|
"LGPL-3.0-or-later",
|
|
2376
2409
|
"Python-2.0"
|
|
2377
2410
|
]);
|
|
2378
|
-
console.log(
|
|
2411
|
+
console.log(chalk30.green("License Checker"));
|
|
2379
2412
|
return (await Promise.all(
|
|
2380
2413
|
workspaceList.map(({ location, name }) => {
|
|
2381
2414
|
return new Promise((resolve) => {
|
|
2382
2415
|
init({ production: true, start: location }, (error, packages) => {
|
|
2383
2416
|
if (error) {
|
|
2384
|
-
console.error(
|
|
2385
|
-
console.error(
|
|
2417
|
+
console.error(chalk30.red(`License Checker [${name}] Error`));
|
|
2418
|
+
console.error(chalk30.gray(error));
|
|
2386
2419
|
console.log("\n");
|
|
2387
2420
|
resolve(1);
|
|
2388
2421
|
} else {
|
|
2389
|
-
console.log(
|
|
2422
|
+
console.log(chalk30.green(`License Checker [${name}]`));
|
|
2390
2423
|
let count = 0;
|
|
2391
2424
|
for (const [name2, info] of Object.entries(packages)) {
|
|
2392
2425
|
const licenses = Array.isArray(info.licenses) ? info.licenses : [info.licenses];
|
|
@@ -2402,7 +2435,7 @@ var license = async (pkg) => {
|
|
|
2402
2435
|
}
|
|
2403
2436
|
if (!orLicenseFound) {
|
|
2404
2437
|
count++;
|
|
2405
|
-
console.warn(
|
|
2438
|
+
console.warn(chalk30.yellow(`${name2}: Package License not allowed [${license2}]`));
|
|
2406
2439
|
}
|
|
2407
2440
|
}
|
|
2408
2441
|
}
|
|
@@ -2421,9 +2454,9 @@ var filename = ".npmignore";
|
|
|
2421
2454
|
var npmignoreGen = (pkg) => generateIgnoreFiles(filename, pkg);
|
|
2422
2455
|
|
|
2423
2456
|
// src/actions/package-lint.ts
|
|
2424
|
-
import { readFileSync as
|
|
2425
|
-
import
|
|
2426
|
-
import
|
|
2457
|
+
import { readFileSync as readFileSync14, writeFileSync as writeFileSync6 } from "fs";
|
|
2458
|
+
import PATH10 from "path";
|
|
2459
|
+
import chalk31 from "chalk";
|
|
2427
2460
|
import picomatch from "picomatch";
|
|
2428
2461
|
function emptyResult() {
|
|
2429
2462
|
return {
|
|
@@ -2433,11 +2466,11 @@ function emptyResult() {
|
|
|
2433
2466
|
};
|
|
2434
2467
|
}
|
|
2435
2468
|
function readRootPackageJson(cwd) {
|
|
2436
|
-
const raw =
|
|
2469
|
+
const raw = readFileSync14(PATH10.resolve(cwd, "package.json"), "utf8");
|
|
2437
2470
|
return JSON.parse(raw);
|
|
2438
2471
|
}
|
|
2439
2472
|
function writeRootPackageJson(cwd, pkg) {
|
|
2440
|
-
const path8 =
|
|
2473
|
+
const path8 = PATH10.resolve(cwd, "package.json");
|
|
2441
2474
|
writeFileSync6(path8, `${JSON.stringify(pkg, null, 2)}
|
|
2442
2475
|
`, "utf8");
|
|
2443
2476
|
}
|
|
@@ -2465,7 +2498,7 @@ function checkRootPrivate(pkg) {
|
|
|
2465
2498
|
function fixRootPrivate(cwd, pkg) {
|
|
2466
2499
|
pkg.private = true;
|
|
2467
2500
|
writeRootPackageJson(cwd, pkg);
|
|
2468
|
-
console.log(
|
|
2501
|
+
console.log(chalk31.green(' \u2714 Fixed: set "private": true in root package.json'));
|
|
2469
2502
|
}
|
|
2470
2503
|
function checkNoPublishConfigOnPrivate(pkg) {
|
|
2471
2504
|
const result = emptyResult();
|
|
@@ -2477,7 +2510,7 @@ function checkNoPublishConfigOnPrivate(pkg) {
|
|
|
2477
2510
|
function fixNoPublishConfigOnPrivate(cwd, pkg) {
|
|
2478
2511
|
delete pkg.publishConfig;
|
|
2479
2512
|
writeRootPackageJson(cwd, pkg);
|
|
2480
|
-
console.log(
|
|
2513
|
+
console.log(chalk31.green(" \u2714 Fixed: removed publishConfig from private root package.json"));
|
|
2481
2514
|
}
|
|
2482
2515
|
function checkDiscoverable(pkg, workspaces) {
|
|
2483
2516
|
const result = emptyResult();
|
|
@@ -2496,22 +2529,22 @@ function logResults(label, result, fix2) {
|
|
|
2496
2529
|
let errors = 0;
|
|
2497
2530
|
let fixed = 0;
|
|
2498
2531
|
for (const error of result.errors) {
|
|
2499
|
-
console.log(
|
|
2532
|
+
console.log(chalk31.red(` \u2717 ${error}`));
|
|
2500
2533
|
errors++;
|
|
2501
2534
|
}
|
|
2502
2535
|
for (const fixable of result.fixable) {
|
|
2503
2536
|
if (fix2) {
|
|
2504
2537
|
fixed++;
|
|
2505
2538
|
} else {
|
|
2506
|
-
console.log(
|
|
2539
|
+
console.log(chalk31.red(` \u2717 ${fixable} (fixable)`));
|
|
2507
2540
|
errors++;
|
|
2508
2541
|
}
|
|
2509
2542
|
}
|
|
2510
2543
|
for (const warning of result.warnings) {
|
|
2511
|
-
console.log(
|
|
2544
|
+
console.log(chalk31.yellow(` \u26A0 ${warning}`));
|
|
2512
2545
|
}
|
|
2513
2546
|
if (errors === 0 && fixed === 0 && result.warnings.length === 0) {
|
|
2514
|
-
console.log(
|
|
2547
|
+
console.log(chalk31.green(` \u2713 ${label}`));
|
|
2515
2548
|
}
|
|
2516
2549
|
return { errors, fixed };
|
|
2517
2550
|
}
|
|
@@ -2531,14 +2564,14 @@ function runChecks(entries, cwd, pkg, fix2) {
|
|
|
2531
2564
|
}
|
|
2532
2565
|
function logSummary(errors, fixed) {
|
|
2533
2566
|
if (fixed > 0) {
|
|
2534
|
-
console.log(
|
|
2567
|
+
console.log(chalk31.green(`
|
|
2535
2568
|
Fixed ${fixed} issue(s)`));
|
|
2536
2569
|
}
|
|
2537
2570
|
if (errors > 0) {
|
|
2538
|
-
console.log(
|
|
2571
|
+
console.log(chalk31.red(`
|
|
2539
2572
|
${errors} error(s) found`));
|
|
2540
2573
|
} else if (fixed === 0) {
|
|
2541
|
-
console.log(
|
|
2574
|
+
console.log(chalk31.green("\n All checks passed"));
|
|
2542
2575
|
}
|
|
2543
2576
|
}
|
|
2544
2577
|
function packageLintMonorepo(fix2 = false) {
|
|
@@ -2547,14 +2580,14 @@ function packageLintMonorepo(fix2 = false) {
|
|
|
2547
2580
|
try {
|
|
2548
2581
|
pkg = readRootPackageJson(cwd);
|
|
2549
2582
|
} catch {
|
|
2550
|
-
console.error(
|
|
2583
|
+
console.error(chalk31.red("Could not read package.json"));
|
|
2551
2584
|
return 1;
|
|
2552
2585
|
}
|
|
2553
2586
|
if (!isMonorepo(pkg)) {
|
|
2554
|
-
console.log(
|
|
2587
|
+
console.log(chalk31.gray("Not a monorepo \u2014 skipping package-lint checks"));
|
|
2555
2588
|
return 0;
|
|
2556
2589
|
}
|
|
2557
|
-
console.log(
|
|
2590
|
+
console.log(chalk31.green("Package Lint"));
|
|
2558
2591
|
const workspaces = yarnWorkspaces();
|
|
2559
2592
|
const checks = [
|
|
2560
2593
|
{
|
|
@@ -2628,7 +2661,7 @@ var rebuild = ({ target }) => {
|
|
|
2628
2661
|
};
|
|
2629
2662
|
|
|
2630
2663
|
// src/actions/recompile.ts
|
|
2631
|
-
import
|
|
2664
|
+
import chalk32 from "chalk";
|
|
2632
2665
|
var recompile = async ({
|
|
2633
2666
|
verbose,
|
|
2634
2667
|
target,
|
|
@@ -2664,7 +2697,7 @@ var recompileAll = async ({
|
|
|
2664
2697
|
const incrementalOptions = incremental ? ["--since", "-Apt", "--topological-dev"] : ["--parallel", "-Apt", "--topological-dev"];
|
|
2665
2698
|
const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
|
|
2666
2699
|
if (jobs) {
|
|
2667
|
-
console.log(
|
|
2700
|
+
console.log(chalk32.blue(`Jobs set to [${jobs}]`));
|
|
2668
2701
|
}
|
|
2669
2702
|
const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
|
|
2670
2703
|
[
|
|
@@ -2695,7 +2728,7 @@ var recompileAll = async ({
|
|
|
2695
2728
|
]
|
|
2696
2729
|
]);
|
|
2697
2730
|
console.log(
|
|
2698
|
-
`${
|
|
2731
|
+
`${chalk32.gray("Recompiled in")} [${chalk32.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk32.gray("seconds")}`
|
|
2699
2732
|
);
|
|
2700
2733
|
return result;
|
|
2701
2734
|
};
|
|
@@ -2726,13 +2759,13 @@ var reinstall = () => {
|
|
|
2726
2759
|
};
|
|
2727
2760
|
|
|
2728
2761
|
// src/actions/relint.ts
|
|
2729
|
-
import
|
|
2762
|
+
import chalk33 from "chalk";
|
|
2730
2763
|
var relintPackage = ({
|
|
2731
2764
|
pkg,
|
|
2732
2765
|
fix: fix2,
|
|
2733
2766
|
verbose
|
|
2734
2767
|
}) => {
|
|
2735
|
-
console.log(
|
|
2768
|
+
console.log(chalk33.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
|
|
2736
2769
|
const start = Date.now();
|
|
2737
2770
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
|
|
2738
2771
|
["yarn", [
|
|
@@ -2742,7 +2775,7 @@ var relintPackage = ({
|
|
|
2742
2775
|
fix2 ? "package-fix" : verbose ? "package-lint-verbose" : "package-lint"
|
|
2743
2776
|
]]
|
|
2744
2777
|
]);
|
|
2745
|
-
console.log(
|
|
2778
|
+
console.log(chalk33.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk33.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk33.gray("seconds")}`));
|
|
2746
2779
|
return result;
|
|
2747
2780
|
};
|
|
2748
2781
|
var relint = ({
|
|
@@ -2762,13 +2795,13 @@ var relint = ({
|
|
|
2762
2795
|
});
|
|
2763
2796
|
};
|
|
2764
2797
|
var relintAllPackages = ({ fix: fix2 = false } = {}) => {
|
|
2765
|
-
console.log(
|
|
2798
|
+
console.log(chalk33.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
|
|
2766
2799
|
const start = Date.now();
|
|
2767
2800
|
const fixOptions = fix2 ? ["--fix"] : [];
|
|
2768
2801
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
|
|
2769
2802
|
["yarn", ["eslint", ...fixOptions]]
|
|
2770
2803
|
]);
|
|
2771
|
-
console.log(
|
|
2804
|
+
console.log(chalk33.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk33.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk33.gray("seconds")}`));
|
|
2772
2805
|
return result;
|
|
2773
2806
|
};
|
|
2774
2807
|
|
|
@@ -2786,10 +2819,10 @@ var sonar = () => {
|
|
|
2786
2819
|
};
|
|
2787
2820
|
|
|
2788
2821
|
// src/actions/statics.ts
|
|
2789
|
-
import
|
|
2822
|
+
import chalk34 from "chalk";
|
|
2790
2823
|
var DefaultDependencies = ["axios", "@xylabs/pixel", "react", "graphql", "react-router", "@mui/material", "@mui/system"];
|
|
2791
2824
|
var statics = () => {
|
|
2792
|
-
console.log(
|
|
2825
|
+
console.log(chalk34.green("Check Required Static Dependencies"));
|
|
2793
2826
|
const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
|
|
2794
2827
|
return detectDuplicateDependencies(statics2, DefaultDependencies);
|
|
2795
2828
|
};
|
|
@@ -3370,7 +3403,7 @@ var xyInstallCommands = (args) => {
|
|
|
3370
3403
|
};
|
|
3371
3404
|
|
|
3372
3405
|
// src/xy/lint/cycleCommand.ts
|
|
3373
|
-
import
|
|
3406
|
+
import chalk35 from "chalk";
|
|
3374
3407
|
var cycleCommand = {
|
|
3375
3408
|
command: "cycle [package]",
|
|
3376
3409
|
describe: "Cycle - Check for dependency cycles",
|
|
@@ -3381,12 +3414,12 @@ var cycleCommand = {
|
|
|
3381
3414
|
const start = Date.now();
|
|
3382
3415
|
if (argv.verbose) console.log("Cycle");
|
|
3383
3416
|
process.exitCode = await cycle({ pkg: argv.package });
|
|
3384
|
-
console.log(
|
|
3417
|
+
console.log(chalk35.blue(`Finished in ${Date.now() - start}ms`));
|
|
3385
3418
|
}
|
|
3386
3419
|
};
|
|
3387
3420
|
|
|
3388
3421
|
// src/xy/lint/deplintCommand.ts
|
|
3389
|
-
import
|
|
3422
|
+
import chalk36 from "chalk";
|
|
3390
3423
|
var deplintCommand = {
|
|
3391
3424
|
command: "deplint [package]",
|
|
3392
3425
|
describe: "Deplint - Run Deplint",
|
|
@@ -3424,12 +3457,12 @@ var deplintCommand = {
|
|
|
3424
3457
|
peerDeps: !!argv.peerDeps,
|
|
3425
3458
|
verbose: !!argv.verbose
|
|
3426
3459
|
});
|
|
3427
|
-
console.log(
|
|
3460
|
+
console.log(chalk36.blue(`Finished in ${Date.now() - start}ms`));
|
|
3428
3461
|
}
|
|
3429
3462
|
};
|
|
3430
3463
|
|
|
3431
3464
|
// src/xy/lint/fixCommand.ts
|
|
3432
|
-
import
|
|
3465
|
+
import chalk37 from "chalk";
|
|
3433
3466
|
var fixCommand = {
|
|
3434
3467
|
command: "fix [package]",
|
|
3435
3468
|
describe: "Fix - Run Eslint w/fix",
|
|
@@ -3440,12 +3473,12 @@ var fixCommand = {
|
|
|
3440
3473
|
const start = Date.now();
|
|
3441
3474
|
if (argv.verbose) console.log("Fix");
|
|
3442
3475
|
process.exitCode = fix();
|
|
3443
|
-
console.log(
|
|
3476
|
+
console.log(chalk37.blue(`Finished in ${Date.now() - start}ms`));
|
|
3444
3477
|
}
|
|
3445
3478
|
};
|
|
3446
3479
|
|
|
3447
3480
|
// src/xy/lint/knipCommand.ts
|
|
3448
|
-
import
|
|
3481
|
+
import chalk38 from "chalk";
|
|
3449
3482
|
var knipCommand = {
|
|
3450
3483
|
command: "knip",
|
|
3451
3484
|
describe: "Knip - Run Knip",
|
|
@@ -3456,12 +3489,12 @@ var knipCommand = {
|
|
|
3456
3489
|
if (argv.verbose) console.log("Knip");
|
|
3457
3490
|
const start = Date.now();
|
|
3458
3491
|
process.exitCode = knip();
|
|
3459
|
-
console.log(
|
|
3492
|
+
console.log(chalk38.blue(`Knip finished in ${Date.now() - start}ms`));
|
|
3460
3493
|
}
|
|
3461
3494
|
};
|
|
3462
3495
|
|
|
3463
3496
|
// src/xy/lint/lintCommand.ts
|
|
3464
|
-
import
|
|
3497
|
+
import chalk39 from "chalk";
|
|
3465
3498
|
var lintCommand = {
|
|
3466
3499
|
command: "lint [package]",
|
|
3467
3500
|
describe: "Lint - Run Eslint",
|
|
@@ -3490,7 +3523,7 @@ var lintCommand = {
|
|
|
3490
3523
|
cache: argv.cache,
|
|
3491
3524
|
verbose: !!argv.verbose
|
|
3492
3525
|
});
|
|
3493
|
-
console.log(
|
|
3526
|
+
console.log(chalk39.blue(`Finished in ${Date.now() - start}ms`));
|
|
3494
3527
|
}
|
|
3495
3528
|
};
|
|
3496
3529
|
|
|
@@ -3512,7 +3545,7 @@ var packageLintCommand = {
|
|
|
3512
3545
|
};
|
|
3513
3546
|
|
|
3514
3547
|
// src/xy/lint/publintCommand.ts
|
|
3515
|
-
import
|
|
3548
|
+
import chalk40 from "chalk";
|
|
3516
3549
|
var publintCommand = {
|
|
3517
3550
|
command: "publint [package]",
|
|
3518
3551
|
describe: "Publint - Run Publint",
|
|
@@ -3523,12 +3556,12 @@ var publintCommand = {
|
|
|
3523
3556
|
if (argv.verbose) console.log("Publint");
|
|
3524
3557
|
const start = Date.now();
|
|
3525
3558
|
process.exitCode = await publint({ pkg: argv.package, verbose: !!argv.verbose });
|
|
3526
|
-
console.log(
|
|
3559
|
+
console.log(chalk40.blue(`Finished in ${Date.now() - start}ms`));
|
|
3527
3560
|
}
|
|
3528
3561
|
};
|
|
3529
3562
|
|
|
3530
3563
|
// src/xy/lint/relintCommand.ts
|
|
3531
|
-
import
|
|
3564
|
+
import chalk41 from "chalk";
|
|
3532
3565
|
var relintCommand = {
|
|
3533
3566
|
command: "relint [package]",
|
|
3534
3567
|
describe: "Relint - Clean & Lint",
|
|
@@ -3539,12 +3572,12 @@ var relintCommand = {
|
|
|
3539
3572
|
if (argv.verbose) console.log("Relinting");
|
|
3540
3573
|
const start = Date.now();
|
|
3541
3574
|
process.exitCode = relint();
|
|
3542
|
-
console.log(
|
|
3575
|
+
console.log(chalk41.blue(`Finished in ${Date.now() - start}ms`));
|
|
3543
3576
|
}
|
|
3544
3577
|
};
|
|
3545
3578
|
|
|
3546
3579
|
// src/xy/lint/sonarCommand.ts
|
|
3547
|
-
import
|
|
3580
|
+
import chalk42 from "chalk";
|
|
3548
3581
|
var sonarCommand = {
|
|
3549
3582
|
command: "sonar",
|
|
3550
3583
|
describe: "Sonar - Run Sonar Check",
|
|
@@ -3555,7 +3588,7 @@ var sonarCommand = {
|
|
|
3555
3588
|
const start = Date.now();
|
|
3556
3589
|
if (argv.verbose) console.log("Sonar Check");
|
|
3557
3590
|
process.exitCode = sonar();
|
|
3558
|
-
console.log(
|
|
3591
|
+
console.log(chalk42.blue(`Finished in ${Date.now() - start}ms`));
|
|
3559
3592
|
}
|
|
3560
3593
|
};
|
|
3561
3594
|
|
|
@@ -3568,7 +3601,15 @@ var xyLintCommands = (args) => {
|
|
|
3568
3601
|
import yargs from "yargs";
|
|
3569
3602
|
import { hideBin } from "yargs/helpers";
|
|
3570
3603
|
var xyParseOptions = () => {
|
|
3571
|
-
return yargs(hideBin(process.argv)).scriptName("yarn xy").
|
|
3604
|
+
return yargs(hideBin(process.argv)).scriptName("yarn xy").middleware((argv) => {
|
|
3605
|
+
const commandName = argv._[0];
|
|
3606
|
+
if (commandName && argv._.length <= 1) {
|
|
3607
|
+
const result = tryRunLocalScript(commandName);
|
|
3608
|
+
if (result !== void 0) {
|
|
3609
|
+
process.exit(result);
|
|
3610
|
+
}
|
|
3611
|
+
}
|
|
3612
|
+
}, true).option("jobs", {
|
|
3572
3613
|
alias: "j",
|
|
3573
3614
|
default: void 0,
|
|
3574
3615
|
description: "Max parallel jobs",
|
|
@@ -3595,8 +3636,8 @@ var xyParseOptions = () => {
|
|
|
3595
3636
|
var xy = async () => {
|
|
3596
3637
|
const options = xyParseOptions();
|
|
3597
3638
|
return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
|
|
3598
|
-
console.error(
|
|
3599
|
-
console.log(
|
|
3639
|
+
console.error(chalk43.yellow(`Command not found [${chalk43.magenta(process.argv[2])}]`));
|
|
3640
|
+
console.log(chalk43.gray("Try 'yarn xy --help' for list of commands"));
|
|
3600
3641
|
}).version().help().argv;
|
|
3601
3642
|
};
|
|
3602
3643
|
export {
|