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