@xylabs/ts-scripts-yarn3 7.4.19 → 7.4.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/claude-commands.mjs +5 -1
- package/dist/actions/claude-commands.mjs.map +1 -1
- package/dist/actions/claude-rules.mjs +5 -1
- package/dist/actions/claude-rules.mjs.map +1 -1
- package/dist/actions/claude-skills.mjs +120 -0
- package/dist/actions/claude-skills.mjs.map +1 -0
- package/dist/actions/index.mjs +229 -127
- package/dist/actions/index.mjs.map +1 -1
- package/dist/bin/xy.mjs +239 -140
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.mjs +299 -197
- package/dist/index.mjs.map +1 -1
- package/dist/lib/claudeMdTemplate.mjs +27 -2
- package/dist/lib/claudeMdTemplate.mjs.map +1 -1
- package/dist/lib/index.mjs +26 -1
- package/dist/lib/index.mjs.map +1 -1
- package/dist/xy/build-commands/build.mjs +502 -0
- package/dist/xy/build-commands/build.mjs.map +1 -0
- package/dist/xy/{build → build-commands}/index.mjs +40 -45
- package/dist/xy/build-commands/index.mjs.map +1 -0
- package/dist/xy/common/claude/commandsCommand.mjs +5 -1
- package/dist/xy/common/claude/commandsCommand.mjs.map +1 -1
- package/dist/xy/common/claude/index.mjs +111 -2
- package/dist/xy/common/claude/index.mjs.map +1 -1
- package/dist/xy/common/claude/initCommand.mjs +111 -1
- package/dist/xy/common/claude/initCommand.mjs.map +1 -1
- package/dist/xy/common/claude/rulesCommand.mjs +5 -1
- package/dist/xy/common/claude/rulesCommand.mjs.map +1 -1
- package/dist/xy/common/claude/skillsCommand.mjs +129 -0
- package/dist/xy/common/claude/skillsCommand.mjs.map +1 -0
- package/dist/xy/common/index.mjs +128 -19
- package/dist/xy/common/index.mjs.map +1 -1
- package/dist/xy/index.mjs +239 -140
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/xy.mjs +239 -140
- package/dist/xy/xy.mjs.map +1 -1
- package/package.json +2 -2
- package/templates/claude/skills/xylabs-e2e-setup/SKILL.md +197 -0
- package/dist/xy/build/buildCommand.mjs +0 -161
- package/dist/xy/build/buildCommand.mjs.map +0 -1
- package/dist/xy/build/compileCommand.mjs +0 -174
- package/dist/xy/build/compileCommand.mjs.map +0 -1
- package/dist/xy/build/compileOnlyCommand.mjs +0 -175
- package/dist/xy/build/compileOnlyCommand.mjs.map +0 -1
- package/dist/xy/build/copyAssetsCommand.mjs +0 -84
- package/dist/xy/build/copyAssetsCommand.mjs.map +0 -1
- package/dist/xy/build/index.mjs.map +0 -1
- package/dist/xy/build/rebuildCommand.mjs +0 -114
- package/dist/xy/build/rebuildCommand.mjs.map +0 -1
- package/dist/xy/build/recompileCommand.mjs +0 -204
- package/dist/xy/build/recompileCommand.mjs.map +0 -1
package/dist/xy/xy.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/xy/xy.ts
|
|
2
|
-
import
|
|
2
|
+
import chalk39 from "chalk";
|
|
3
3
|
|
|
4
4
|
// src/actions/build.ts
|
|
5
5
|
import chalk9 from "chalk";
|
|
@@ -18,7 +18,11 @@ var checkResult = (name, result, level = "error", exitOnFail = false) => {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
// src/lib/claudeMdTemplate.ts
|
|
21
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
readdirSync,
|
|
23
|
+
readFileSync,
|
|
24
|
+
statSync
|
|
25
|
+
} from "fs";
|
|
22
26
|
import { createRequire } from "module";
|
|
23
27
|
import PATH from "path";
|
|
24
28
|
var require2 = createRequire(import.meta.url);
|
|
@@ -26,6 +30,7 @@ var packageRoot = PATH.dirname(require2.resolve("@xylabs/ts-scripts-yarn3/packag
|
|
|
26
30
|
var templatesDir = PATH.resolve(packageRoot, "templates", "claude");
|
|
27
31
|
var XYLABS_RULES_PREFIX = "xylabs-";
|
|
28
32
|
var XYLABS_COMMANDS_PREFIX = "xylabs-";
|
|
33
|
+
var XYLABS_SKILLS_PREFIX = "xylabs-";
|
|
29
34
|
var claudeMdRuleTemplates = () => {
|
|
30
35
|
const rulesDir = PATH.resolve(templatesDir, "rules");
|
|
31
36
|
const files = readdirSync(rulesDir).filter((f) => f.startsWith(XYLABS_RULES_PREFIX) && f.endsWith(".md"));
|
|
@@ -44,6 +49,24 @@ var claudeCommandTemplates = () => {
|
|
|
44
49
|
}
|
|
45
50
|
return result;
|
|
46
51
|
};
|
|
52
|
+
var claudeSkillTemplates = () => {
|
|
53
|
+
const skillsDir = PATH.resolve(templatesDir, "skills");
|
|
54
|
+
const dirs = readdirSync(skillsDir).filter(
|
|
55
|
+
(f) => f.startsWith(XYLABS_SKILLS_PREFIX) && statSync(PATH.resolve(skillsDir, f)).isDirectory()
|
|
56
|
+
);
|
|
57
|
+
const result = {};
|
|
58
|
+
for (const dir of dirs) {
|
|
59
|
+
const dirPath = PATH.resolve(skillsDir, dir);
|
|
60
|
+
const files = readdirSync(dirPath, { recursive: true, encoding: "utf8" });
|
|
61
|
+
result[dir] = {};
|
|
62
|
+
for (const file of files) {
|
|
63
|
+
if (statSync(PATH.resolve(dirPath, file)).isFile()) {
|
|
64
|
+
result[dir][file] = readFileSync(PATH.resolve(dirPath, file), "utf8");
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return result;
|
|
69
|
+
};
|
|
47
70
|
var claudeMdProjectTemplate = () => readFileSync(PATH.resolve(templatesDir, "CLAUDE-project.md"), "utf8");
|
|
48
71
|
|
|
49
72
|
// src/lib/deleteGlob.ts
|
|
@@ -905,6 +928,84 @@ async function claudeSettings() {
|
|
|
905
928
|
return 0;
|
|
906
929
|
}
|
|
907
930
|
|
|
931
|
+
// src/actions/claude-skills.ts
|
|
932
|
+
import {
|
|
933
|
+
existsSync as existsSync7,
|
|
934
|
+
mkdirSync as mkdirSync4,
|
|
935
|
+
readdirSync as readdirSync4,
|
|
936
|
+
readFileSync as readFileSync7,
|
|
937
|
+
rmSync,
|
|
938
|
+
statSync as statSync2,
|
|
939
|
+
writeFileSync as writeFileSync5
|
|
940
|
+
} from "fs";
|
|
941
|
+
import PATH6 from "path";
|
|
942
|
+
import chalk13 from "chalk";
|
|
943
|
+
var syncSkillFiles = (skillsDir) => {
|
|
944
|
+
const templates = claudeSkillTemplates();
|
|
945
|
+
const templateNames = new Set(Object.keys(templates));
|
|
946
|
+
let updated = 0;
|
|
947
|
+
let created = 0;
|
|
948
|
+
for (const [skillName, files] of Object.entries(templates)) {
|
|
949
|
+
const skillDir = PATH6.resolve(skillsDir, skillName);
|
|
950
|
+
mkdirSync4(skillDir, { recursive: true });
|
|
951
|
+
for (const [filename3, content] of Object.entries(files)) {
|
|
952
|
+
const targetPath = PATH6.resolve(skillDir, filename3);
|
|
953
|
+
mkdirSync4(PATH6.dirname(targetPath), { recursive: true });
|
|
954
|
+
const existing = existsSync7(targetPath) ? readFileSync7(targetPath, "utf8") : void 0;
|
|
955
|
+
if (existing === content) continue;
|
|
956
|
+
writeFileSync5(targetPath, content, "utf8");
|
|
957
|
+
if (existing) {
|
|
958
|
+
updated++;
|
|
959
|
+
} else {
|
|
960
|
+
created++;
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
return {
|
|
965
|
+
created,
|
|
966
|
+
templateNames,
|
|
967
|
+
updated
|
|
968
|
+
};
|
|
969
|
+
};
|
|
970
|
+
var removeStaleSkills = (skillsDir, templateNames) => {
|
|
971
|
+
const existingSkills = readdirSync4(skillsDir).filter(
|
|
972
|
+
(f) => f.startsWith(XYLABS_SKILLS_PREFIX) && statSync2(PATH6.resolve(skillsDir, f)).isDirectory()
|
|
973
|
+
);
|
|
974
|
+
let removed = 0;
|
|
975
|
+
for (const dir of existingSkills) {
|
|
976
|
+
if (!templateNames.has(dir)) {
|
|
977
|
+
rmSync(PATH6.resolve(skillsDir, dir), { recursive: true });
|
|
978
|
+
removed++;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
return removed;
|
|
982
|
+
};
|
|
983
|
+
var logSkillsResult = (created, updated, removed) => {
|
|
984
|
+
if (created || updated || removed) {
|
|
985
|
+
const parts = [
|
|
986
|
+
created ? `${created} created` : "",
|
|
987
|
+
updated ? `${updated} updated` : "",
|
|
988
|
+
removed ? `${removed} removed` : ""
|
|
989
|
+
].filter(Boolean);
|
|
990
|
+
console.log(chalk13.green(`.claude/skills/${XYLABS_SKILLS_PREFIX}*/: ${parts.join(", ")}`));
|
|
991
|
+
} else {
|
|
992
|
+
console.log(chalk13.gray(`.claude/skills/${XYLABS_SKILLS_PREFIX}*/: already up to date`));
|
|
993
|
+
}
|
|
994
|
+
};
|
|
995
|
+
var claudeSkills = () => {
|
|
996
|
+
const cwd = INIT_CWD() ?? process.cwd();
|
|
997
|
+
const skillsDir = PATH6.resolve(cwd, ".claude", "skills");
|
|
998
|
+
mkdirSync4(skillsDir, { recursive: true });
|
|
999
|
+
const {
|
|
1000
|
+
created,
|
|
1001
|
+
templateNames,
|
|
1002
|
+
updated
|
|
1003
|
+
} = syncSkillFiles(skillsDir);
|
|
1004
|
+
const removed = removeStaleSkills(skillsDir, templateNames);
|
|
1005
|
+
logSkillsResult(created, updated, removed);
|
|
1006
|
+
return 0;
|
|
1007
|
+
};
|
|
1008
|
+
|
|
908
1009
|
// src/actions/clean.ts
|
|
909
1010
|
var clean = async ({ verbose, pkg }) => {
|
|
910
1011
|
return pkg ? await cleanPackage({ pkg, verbose }) : cleanAll({ verbose });
|
|
@@ -919,16 +1020,16 @@ var cleanAll = ({ verbose }) => {
|
|
|
919
1020
|
|
|
920
1021
|
// src/actions/clean-docs.ts
|
|
921
1022
|
import path from "path";
|
|
922
|
-
import
|
|
1023
|
+
import chalk14 from "chalk";
|
|
923
1024
|
var cleanDocs = () => {
|
|
924
1025
|
const pkgName = process.env.npm_package_name;
|
|
925
|
-
console.log(
|
|
1026
|
+
console.log(chalk14.green(`Cleaning Docs [${pkgName}]`));
|
|
926
1027
|
for (const { location } of yarnWorkspaces()) deleteGlob(path.join(location, "docs"));
|
|
927
1028
|
return 0;
|
|
928
1029
|
};
|
|
929
1030
|
|
|
930
1031
|
// src/actions/compile.ts
|
|
931
|
-
import
|
|
1032
|
+
import chalk15 from "chalk";
|
|
932
1033
|
var compile = ({
|
|
933
1034
|
verbose,
|
|
934
1035
|
target,
|
|
@@ -969,7 +1070,7 @@ var compileAll = ({
|
|
|
969
1070
|
const incrementalOptions = incremental ? ["--since", "-Ap", "--topological-dev"] : ["--parallel", "-Ap", "--topological-dev"];
|
|
970
1071
|
const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
|
|
971
1072
|
if (jobs) {
|
|
972
|
-
console.log(
|
|
1073
|
+
console.log(chalk15.blue(`Jobs set to [${jobs}]`));
|
|
973
1074
|
}
|
|
974
1075
|
const result = runSteps(`Compile${incremental ? "-Incremental" : ""} [All]`, [
|
|
975
1076
|
["yarn", [
|
|
@@ -983,13 +1084,13 @@ var compileAll = ({
|
|
|
983
1084
|
...targetOptions
|
|
984
1085
|
]]
|
|
985
1086
|
]);
|
|
986
|
-
console.log(`${
|
|
1087
|
+
console.log(`${chalk15.gray("Compiled in")} [${chalk15.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk15.gray("seconds")}`);
|
|
987
1088
|
return result;
|
|
988
1089
|
};
|
|
989
1090
|
|
|
990
1091
|
// src/actions/copy-assets.ts
|
|
991
1092
|
import path2 from "path/posix";
|
|
992
|
-
import
|
|
1093
|
+
import chalk16 from "chalk";
|
|
993
1094
|
import cpy from "cpy";
|
|
994
1095
|
var copyPackageTargetAssets = async (target, name, location) => {
|
|
995
1096
|
try {
|
|
@@ -1012,7 +1113,7 @@ var copyPackageTargetAssets = async (target, name, location) => {
|
|
|
1012
1113
|
};
|
|
1013
1114
|
var copyTargetAssets = async (target, pkg) => {
|
|
1014
1115
|
const workspaces = yarnWorkspaces();
|
|
1015
|
-
console.log(
|
|
1116
|
+
console.log(chalk16.green(`Copying Assets [${target.toUpperCase()}]`));
|
|
1016
1117
|
const workspaceList = workspaces.filter(({ name }) => {
|
|
1017
1118
|
return pkg === void 0 || name === pkg;
|
|
1018
1119
|
});
|
|
@@ -1096,7 +1197,7 @@ var dead = () => {
|
|
|
1096
1197
|
};
|
|
1097
1198
|
|
|
1098
1199
|
// src/actions/deplint/deplint.ts
|
|
1099
|
-
import
|
|
1200
|
+
import chalk22 from "chalk";
|
|
1100
1201
|
|
|
1101
1202
|
// src/actions/deplint/findFiles.ts
|
|
1102
1203
|
import fs2 from "fs";
|
|
@@ -1301,7 +1402,7 @@ function getExternalImportsFromFiles({
|
|
|
1301
1402
|
|
|
1302
1403
|
// src/actions/deplint/checkPackage/getUnlistedDependencies.ts
|
|
1303
1404
|
import { builtinModules } from "module";
|
|
1304
|
-
import
|
|
1405
|
+
import chalk17 from "chalk";
|
|
1305
1406
|
function isRuntimeImportListed(imp, name, dependencies, peerDependencies) {
|
|
1306
1407
|
return dependencies.includes(imp) || imp === name || peerDependencies.includes(imp) || builtinModules.includes(imp);
|
|
1307
1408
|
}
|
|
@@ -1309,7 +1410,7 @@ function isTypeImportListed(imp, name, dependencies, devDependencies, peerDepend
|
|
|
1309
1410
|
return dependencies.includes(imp) || imp === name || dependencies.includes(`@types/${imp}`) || peerDependencies.includes(imp) || peerDependencies.includes(`@types/${imp}`) || devDependencies.includes(`@types/${imp}`) || builtinModules.includes(imp);
|
|
1310
1411
|
}
|
|
1311
1412
|
function logMissing(name, imp, importPaths) {
|
|
1312
|
-
console.log(`[${
|
|
1413
|
+
console.log(`[${chalk17.blue(name)}] Missing dependency in package.json: ${chalk17.red(imp)}`);
|
|
1313
1414
|
if (importPaths[imp]) {
|
|
1314
1415
|
console.log(` ${importPaths[imp].join("\n ")}`);
|
|
1315
1416
|
}
|
|
@@ -1338,7 +1439,7 @@ function getUnlistedDependencies({ name, location }, {
|
|
|
1338
1439
|
}
|
|
1339
1440
|
if (unlistedDependencies > 0) {
|
|
1340
1441
|
const packageLocation = `${location}/package.json`;
|
|
1341
|
-
console.log(` ${
|
|
1442
|
+
console.log(` ${chalk17.yellow(packageLocation)}
|
|
1342
1443
|
`);
|
|
1343
1444
|
}
|
|
1344
1445
|
return unlistedDependencies;
|
|
@@ -1346,7 +1447,7 @@ function getUnlistedDependencies({ name, location }, {
|
|
|
1346
1447
|
|
|
1347
1448
|
// src/actions/deplint/checkPackage/getUnlistedDevDependencies.ts
|
|
1348
1449
|
import { builtinModules as builtinModules2 } from "module";
|
|
1349
|
-
import
|
|
1450
|
+
import chalk18 from "chalk";
|
|
1350
1451
|
function getUnlistedDevDependencies({ name, location }, {
|
|
1351
1452
|
devDependencies,
|
|
1352
1453
|
dependencies,
|
|
@@ -1360,7 +1461,7 @@ function getUnlistedDevDependencies({ name, location }, {
|
|
|
1360
1461
|
for (const imp of externalAllImports) {
|
|
1361
1462
|
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)) {
|
|
1362
1463
|
unlistedDevDependencies++;
|
|
1363
|
-
console.log(`[${
|
|
1464
|
+
console.log(`[${chalk18.blue(name)}] Missing devDependency in package.json: ${chalk18.red(imp)}`);
|
|
1364
1465
|
if (allImportPaths[imp]) {
|
|
1365
1466
|
console.log(` ${allImportPaths[imp].join("\n ")}`);
|
|
1366
1467
|
}
|
|
@@ -1368,14 +1469,14 @@ function getUnlistedDevDependencies({ name, location }, {
|
|
|
1368
1469
|
}
|
|
1369
1470
|
if (unlistedDevDependencies > 0) {
|
|
1370
1471
|
const packageLocation = `${location}/package.json`;
|
|
1371
|
-
console.log(` ${
|
|
1472
|
+
console.log(` ${chalk18.yellow(packageLocation)}
|
|
1372
1473
|
`);
|
|
1373
1474
|
}
|
|
1374
1475
|
return unlistedDevDependencies;
|
|
1375
1476
|
}
|
|
1376
1477
|
|
|
1377
1478
|
// src/actions/deplint/checkPackage/getUnusedDependencies.ts
|
|
1378
|
-
import
|
|
1479
|
+
import chalk19 from "chalk";
|
|
1379
1480
|
function getUnusedDependencies({ name, location }, { dependencies }, {
|
|
1380
1481
|
externalDistImports,
|
|
1381
1482
|
externalDistTypeImports,
|
|
@@ -1387,22 +1488,22 @@ function getUnusedDependencies({ name, location }, { dependencies }, {
|
|
|
1387
1488
|
if (!externalDistImports.includes(dep) && !externalDistImports.includes(dep.replace(/^@types\//, "")) && !externalDistTypeImports.includes(dep) && !externalDistTypeImports.includes(dep.replace(/^@types\//, ""))) {
|
|
1388
1489
|
unusedDependencies++;
|
|
1389
1490
|
if (externalAllImports.includes(dep)) {
|
|
1390
|
-
console.log(`[${
|
|
1491
|
+
console.log(`[${chalk19.blue(name)}] dependency should be devDependency in package.json: ${chalk19.red(dep)}`);
|
|
1391
1492
|
} else {
|
|
1392
|
-
console.log(`[${
|
|
1493
|
+
console.log(`[${chalk19.blue(name)}] Unused dependency in package.json: ${chalk19.red(dep)}`);
|
|
1393
1494
|
}
|
|
1394
1495
|
}
|
|
1395
1496
|
}
|
|
1396
1497
|
if (unusedDependencies > 0) {
|
|
1397
1498
|
const packageLocation = `${location}/package.json`;
|
|
1398
|
-
console.log(` ${
|
|
1499
|
+
console.log(` ${chalk19.yellow(packageLocation)}
|
|
1399
1500
|
`);
|
|
1400
1501
|
}
|
|
1401
1502
|
return unusedDependencies;
|
|
1402
1503
|
}
|
|
1403
1504
|
|
|
1404
1505
|
// src/actions/deplint/checkPackage/getUnusedDevDependencies.ts
|
|
1405
|
-
import
|
|
1506
|
+
import chalk20 from "chalk";
|
|
1406
1507
|
|
|
1407
1508
|
// src/actions/deplint/getCliReferencedPackagesFromFiles.ts
|
|
1408
1509
|
import fs8 from "fs";
|
|
@@ -1686,19 +1787,19 @@ function getUnusedDevDependencies({ name, location }, {
|
|
|
1686
1787
|
if (dependencies.includes(dep) || peerDependencies.includes(dep)) continue;
|
|
1687
1788
|
if (!isDevDepUsed(dep, allImports, implicitDeps, requiredPeers, scriptRefs, cliRefs)) {
|
|
1688
1789
|
unusedDevDependencies++;
|
|
1689
|
-
console.log(`[${
|
|
1790
|
+
console.log(`[${chalk20.blue(name)}] Unused devDependency in package.json: ${chalk20.red(dep)}`);
|
|
1690
1791
|
}
|
|
1691
1792
|
}
|
|
1692
1793
|
if (unusedDevDependencies > 0) {
|
|
1693
1794
|
const packageLocation = `${location}/package.json`;
|
|
1694
|
-
console.log(` ${
|
|
1795
|
+
console.log(` ${chalk20.yellow(packageLocation)}
|
|
1695
1796
|
`);
|
|
1696
1797
|
}
|
|
1697
1798
|
return unusedDevDependencies;
|
|
1698
1799
|
}
|
|
1699
1800
|
|
|
1700
1801
|
// src/actions/deplint/checkPackage/getUnusedPeerDependencies.ts
|
|
1701
|
-
import
|
|
1802
|
+
import chalk21 from "chalk";
|
|
1702
1803
|
function getUnusedPeerDependencies({ name, location }, { peerDependencies, dependencies }, { externalDistImports, externalDistTypeImports }, exclude) {
|
|
1703
1804
|
let unusedDependencies = 0;
|
|
1704
1805
|
for (const dep of peerDependencies) {
|
|
@@ -1706,15 +1807,15 @@ function getUnusedPeerDependencies({ name, location }, { peerDependencies, depen
|
|
|
1706
1807
|
if (!externalDistImports.includes(dep) && !externalDistImports.includes(dep.replace(/^@types\//, "")) && !externalDistTypeImports.includes(dep) && !externalDistTypeImports.includes(dep.replace(/^@types\//, ""))) {
|
|
1707
1808
|
unusedDependencies++;
|
|
1708
1809
|
if (dependencies.includes(dep)) {
|
|
1709
|
-
console.log(`[${
|
|
1810
|
+
console.log(`[${chalk21.blue(name)}] Unused peerDependency [already a dependency] in package.json: ${chalk21.red(dep)}`);
|
|
1710
1811
|
} else {
|
|
1711
|
-
console.log(`[${
|
|
1812
|
+
console.log(`[${chalk21.blue(name)}] Unused peerDependency in package.json: ${chalk21.red(dep)}`);
|
|
1712
1813
|
}
|
|
1713
1814
|
}
|
|
1714
1815
|
}
|
|
1715
1816
|
if (unusedDependencies > 0) {
|
|
1716
1817
|
const packageLocation = `${location}/package.json`;
|
|
1717
|
-
console.log(` ${
|
|
1818
|
+
console.log(` ${chalk21.yellow(packageLocation)}
|
|
1718
1819
|
`);
|
|
1719
1820
|
}
|
|
1720
1821
|
return unusedDependencies;
|
|
@@ -1809,19 +1910,19 @@ var deplint = async ({
|
|
|
1809
1910
|
});
|
|
1810
1911
|
}
|
|
1811
1912
|
if (totalErrors > 0) {
|
|
1812
|
-
console.warn(`Deplint: Found ${
|
|
1913
|
+
console.warn(`Deplint: Found ${chalk22.red(totalErrors)} dependency problems. ${chalk22.red("\u2716")}`);
|
|
1813
1914
|
} else {
|
|
1814
|
-
console.info(`Deplint: Found no dependency problems. ${
|
|
1915
|
+
console.info(`Deplint: Found no dependency problems. ${chalk22.green("\u2714")}`);
|
|
1815
1916
|
}
|
|
1816
1917
|
return 0;
|
|
1817
1918
|
};
|
|
1818
1919
|
|
|
1819
1920
|
// src/actions/deploy.ts
|
|
1820
|
-
import { readFileSync as
|
|
1921
|
+
import { readFileSync as readFileSync8 } from "fs";
|
|
1821
1922
|
var privatePackageExcludeList = () => {
|
|
1822
1923
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
1823
1924
|
workspace,
|
|
1824
|
-
JSON.parse(
|
|
1925
|
+
JSON.parse(readFileSync8(`${workspace.location}/package.json`, { encoding: "utf8" }))
|
|
1825
1926
|
]);
|
|
1826
1927
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
1827
1928
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
@@ -1841,11 +1942,11 @@ var deploy = () => {
|
|
|
1841
1942
|
};
|
|
1842
1943
|
|
|
1843
1944
|
// src/actions/deploy-major.ts
|
|
1844
|
-
import { readFileSync as
|
|
1945
|
+
import { readFileSync as readFileSync9 } from "fs";
|
|
1845
1946
|
var privatePackageExcludeList2 = () => {
|
|
1846
1947
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
1847
1948
|
workspace,
|
|
1848
|
-
JSON.parse(
|
|
1949
|
+
JSON.parse(readFileSync9(`${workspace.location}/package.json`, { encoding: "utf8" }))
|
|
1849
1950
|
]);
|
|
1850
1951
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
1851
1952
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
@@ -1865,11 +1966,11 @@ var deployMajor = () => {
|
|
|
1865
1966
|
};
|
|
1866
1967
|
|
|
1867
1968
|
// src/actions/deploy-minor.ts
|
|
1868
|
-
import { readFileSync as
|
|
1969
|
+
import { readFileSync as readFileSync10 } from "fs";
|
|
1869
1970
|
var privatePackageExcludeList3 = () => {
|
|
1870
1971
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
1871
1972
|
workspace,
|
|
1872
|
-
JSON.parse(
|
|
1973
|
+
JSON.parse(readFileSync10(`${workspace.location}/package.json`, { encoding: "utf8" }))
|
|
1873
1974
|
]);
|
|
1874
1975
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
1875
1976
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
@@ -1889,11 +1990,11 @@ var deployMinor = () => {
|
|
|
1889
1990
|
};
|
|
1890
1991
|
|
|
1891
1992
|
// src/actions/deploy-next.ts
|
|
1892
|
-
import { readFileSync as
|
|
1993
|
+
import { readFileSync as readFileSync11 } from "fs";
|
|
1893
1994
|
var privatePackageExcludeList4 = () => {
|
|
1894
1995
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
1895
1996
|
workspace,
|
|
1896
|
-
JSON.parse(
|
|
1997
|
+
JSON.parse(readFileSync11(`${workspace.location}/package.json`, { encoding: "utf8" }))
|
|
1897
1998
|
]);
|
|
1898
1999
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
1899
2000
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
@@ -1913,22 +2014,22 @@ var deployNext = () => {
|
|
|
1913
2014
|
};
|
|
1914
2015
|
|
|
1915
2016
|
// src/actions/dupdeps.ts
|
|
1916
|
-
import
|
|
2017
|
+
import chalk23 from "chalk";
|
|
1917
2018
|
var dupdeps = () => {
|
|
1918
|
-
console.log(
|
|
2019
|
+
console.log(chalk23.green("Checking all Dependencies for Duplicates"));
|
|
1919
2020
|
const allDependencies = parsedPackageJSON()?.dependencies;
|
|
1920
2021
|
const dependencies = Object.entries(allDependencies).map(([k]) => k);
|
|
1921
2022
|
return detectDuplicateDependencies(dependencies);
|
|
1922
2023
|
};
|
|
1923
2024
|
|
|
1924
2025
|
// src/actions/lint.ts
|
|
1925
|
-
import
|
|
2026
|
+
import chalk24 from "chalk";
|
|
1926
2027
|
var lintPackage = ({
|
|
1927
2028
|
pkg,
|
|
1928
2029
|
fix: fix2,
|
|
1929
2030
|
verbose
|
|
1930
2031
|
}) => {
|
|
1931
|
-
console.log(
|
|
2032
|
+
console.log(chalk24.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
|
|
1932
2033
|
const start = Date.now();
|
|
1933
2034
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
|
|
1934
2035
|
["yarn", [
|
|
@@ -1938,7 +2039,7 @@ var lintPackage = ({
|
|
|
1938
2039
|
fix2 ? "package-fix" : verbose ? "package-lint-verbose" : "package-lint"
|
|
1939
2040
|
]]
|
|
1940
2041
|
]);
|
|
1941
|
-
console.log(
|
|
2042
|
+
console.log(chalk24.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk24.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk24.gray("seconds")}`));
|
|
1942
2043
|
return result;
|
|
1943
2044
|
};
|
|
1944
2045
|
var lint = ({
|
|
@@ -1958,13 +2059,13 @@ var lint = ({
|
|
|
1958
2059
|
});
|
|
1959
2060
|
};
|
|
1960
2061
|
var lintAllPackages = ({ fix: fix2 = false } = {}) => {
|
|
1961
|
-
console.log(
|
|
2062
|
+
console.log(chalk24.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
|
|
1962
2063
|
const start = Date.now();
|
|
1963
2064
|
const fixOptions = fix2 ? ["--fix"] : [];
|
|
1964
2065
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
|
|
1965
2066
|
["yarn", ["eslint", "--cache", "--cache-location", ".eslintcache", "--cache-strategy", "content", ...fixOptions]]
|
|
1966
2067
|
]);
|
|
1967
|
-
console.log(
|
|
2068
|
+
console.log(chalk24.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk24.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk24.gray("seconds")}`));
|
|
1968
2069
|
return result;
|
|
1969
2070
|
};
|
|
1970
2071
|
|
|
@@ -1992,7 +2093,7 @@ var filename = ".gitignore";
|
|
|
1992
2093
|
var gitignoreGen = (pkg) => generateIgnoreFiles(filename, pkg);
|
|
1993
2094
|
|
|
1994
2095
|
// src/actions/gitlint.ts
|
|
1995
|
-
import
|
|
2096
|
+
import chalk25 from "chalk";
|
|
1996
2097
|
import ParseGitConfig from "parse-git-config";
|
|
1997
2098
|
var gitlint = () => {
|
|
1998
2099
|
console.log(`
|
|
@@ -2003,7 +2104,7 @@ Gitlint Start [${process.cwd()}]
|
|
|
2003
2104
|
const errors = 0;
|
|
2004
2105
|
const gitConfig = ParseGitConfig.sync();
|
|
2005
2106
|
const warn = (message) => {
|
|
2006
|
-
console.warn(
|
|
2107
|
+
console.warn(chalk25.yellow(`Warning: ${message}`));
|
|
2007
2108
|
warnings++;
|
|
2008
2109
|
};
|
|
2009
2110
|
if (gitConfig.core.ignorecase) {
|
|
@@ -2023,13 +2124,13 @@ Gitlint Start [${process.cwd()}]
|
|
|
2023
2124
|
}
|
|
2024
2125
|
const resultMessages = [];
|
|
2025
2126
|
if (valid > 0) {
|
|
2026
|
-
resultMessages.push(
|
|
2127
|
+
resultMessages.push(chalk25.green(`Passed: ${valid}`));
|
|
2027
2128
|
}
|
|
2028
2129
|
if (warnings > 0) {
|
|
2029
|
-
resultMessages.push(
|
|
2130
|
+
resultMessages.push(chalk25.yellow(`Warnings: ${warnings}`));
|
|
2030
2131
|
}
|
|
2031
2132
|
if (errors > 0) {
|
|
2032
|
-
resultMessages.push(
|
|
2133
|
+
resultMessages.push(chalk25.red(` Errors: ${errors}`));
|
|
2033
2134
|
}
|
|
2034
2135
|
console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
|
|
2035
2136
|
`);
|
|
@@ -2038,7 +2139,7 @@ Gitlint Start [${process.cwd()}]
|
|
|
2038
2139
|
|
|
2039
2140
|
// src/actions/gitlint-fix.ts
|
|
2040
2141
|
import { execSync as execSync3 } from "child_process";
|
|
2041
|
-
import
|
|
2142
|
+
import chalk26 from "chalk";
|
|
2042
2143
|
import ParseGitConfig2 from "parse-git-config";
|
|
2043
2144
|
var gitlintFix = () => {
|
|
2044
2145
|
console.log(`
|
|
@@ -2047,15 +2148,15 @@ Gitlint Fix Start [${process.cwd()}]
|
|
|
2047
2148
|
const gitConfig = ParseGitConfig2.sync();
|
|
2048
2149
|
if (gitConfig.core.ignorecase) {
|
|
2049
2150
|
execSync3("git config core.ignorecase false", { stdio: "inherit" });
|
|
2050
|
-
console.warn(
|
|
2151
|
+
console.warn(chalk26.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
|
|
2051
2152
|
}
|
|
2052
2153
|
if (gitConfig.core.autocrlf !== false) {
|
|
2053
2154
|
execSync3("git config core.autocrlf false", { stdio: "inherit" });
|
|
2054
|
-
console.warn(
|
|
2155
|
+
console.warn(chalk26.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
|
|
2055
2156
|
}
|
|
2056
2157
|
if (gitConfig.core.eol !== "lf") {
|
|
2057
2158
|
execSync3("git config core.eol lf", { stdio: "inherit" });
|
|
2058
|
-
console.warn(
|
|
2159
|
+
console.warn(chalk26.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
|
|
2059
2160
|
}
|
|
2060
2161
|
return 1;
|
|
2061
2162
|
};
|
|
@@ -2066,7 +2167,7 @@ var knip = () => {
|
|
|
2066
2167
|
};
|
|
2067
2168
|
|
|
2068
2169
|
// src/actions/license.ts
|
|
2069
|
-
import
|
|
2170
|
+
import chalk27 from "chalk";
|
|
2070
2171
|
import { init } from "license-checker";
|
|
2071
2172
|
var license = async (pkg) => {
|
|
2072
2173
|
const workspaces = yarnWorkspaces();
|
|
@@ -2091,18 +2192,18 @@ var license = async (pkg) => {
|
|
|
2091
2192
|
"LGPL-3.0-or-later",
|
|
2092
2193
|
"Python-2.0"
|
|
2093
2194
|
]);
|
|
2094
|
-
console.log(
|
|
2195
|
+
console.log(chalk27.green("License Checker"));
|
|
2095
2196
|
return (await Promise.all(
|
|
2096
2197
|
workspaceList.map(({ location, name }) => {
|
|
2097
2198
|
return new Promise((resolve) => {
|
|
2098
2199
|
init({ production: true, start: location }, (error, packages) => {
|
|
2099
2200
|
if (error) {
|
|
2100
|
-
console.error(
|
|
2101
|
-
console.error(
|
|
2201
|
+
console.error(chalk27.red(`License Checker [${name}] Error`));
|
|
2202
|
+
console.error(chalk27.gray(error));
|
|
2102
2203
|
console.log("\n");
|
|
2103
2204
|
resolve(1);
|
|
2104
2205
|
} else {
|
|
2105
|
-
console.log(
|
|
2206
|
+
console.log(chalk27.green(`License Checker [${name}]`));
|
|
2106
2207
|
let count = 0;
|
|
2107
2208
|
for (const [name2, info] of Object.entries(packages)) {
|
|
2108
2209
|
const licenses = Array.isArray(info.licenses) ? info.licenses : [info.licenses];
|
|
@@ -2118,7 +2219,7 @@ var license = async (pkg) => {
|
|
|
2118
2219
|
}
|
|
2119
2220
|
if (!orLicenseFound) {
|
|
2120
2221
|
count++;
|
|
2121
|
-
console.warn(
|
|
2222
|
+
console.warn(chalk27.yellow(`${name2}: Package License not allowed [${license2}]`));
|
|
2122
2223
|
}
|
|
2123
2224
|
}
|
|
2124
2225
|
}
|
|
@@ -2189,7 +2290,7 @@ var rebuild = ({ target }) => {
|
|
|
2189
2290
|
};
|
|
2190
2291
|
|
|
2191
2292
|
// src/actions/recompile.ts
|
|
2192
|
-
import
|
|
2293
|
+
import chalk28 from "chalk";
|
|
2193
2294
|
var recompile = async ({
|
|
2194
2295
|
verbose,
|
|
2195
2296
|
target,
|
|
@@ -2225,7 +2326,7 @@ var recompileAll = async ({
|
|
|
2225
2326
|
const incrementalOptions = incremental ? ["--since", "-Apt", "--topological-dev"] : ["--parallel", "-Apt", "--topological-dev"];
|
|
2226
2327
|
const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
|
|
2227
2328
|
if (jobs) {
|
|
2228
|
-
console.log(
|
|
2329
|
+
console.log(chalk28.blue(`Jobs set to [${jobs}]`));
|
|
2229
2330
|
}
|
|
2230
2331
|
const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
|
|
2231
2332
|
[
|
|
@@ -2256,7 +2357,7 @@ var recompileAll = async ({
|
|
|
2256
2357
|
]
|
|
2257
2358
|
]);
|
|
2258
2359
|
console.log(
|
|
2259
|
-
`${
|
|
2360
|
+
`${chalk28.gray("Recompiled in")} [${chalk28.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk28.gray("seconds")}`
|
|
2260
2361
|
);
|
|
2261
2362
|
return result;
|
|
2262
2363
|
};
|
|
@@ -2265,7 +2366,7 @@ var recompileAll = async ({
|
|
|
2265
2366
|
import {
|
|
2266
2367
|
closeSync,
|
|
2267
2368
|
openSync,
|
|
2268
|
-
rmSync
|
|
2369
|
+
rmSync as rmSync2
|
|
2269
2370
|
} from "fs";
|
|
2270
2371
|
var reinstall = () => {
|
|
2271
2372
|
console.log("Reinstall [Clear Lock File]");
|
|
@@ -2275,7 +2376,7 @@ var reinstall = () => {
|
|
|
2275
2376
|
const result = workspaces.map(({ location, name }) => {
|
|
2276
2377
|
const dist = `${location}/node_modules`;
|
|
2277
2378
|
try {
|
|
2278
|
-
|
|
2379
|
+
rmSync2(dist, { force: true, recursive: true });
|
|
2279
2380
|
return 0;
|
|
2280
2381
|
} catch (ex) {
|
|
2281
2382
|
const error = ex;
|
|
@@ -2287,13 +2388,13 @@ var reinstall = () => {
|
|
|
2287
2388
|
};
|
|
2288
2389
|
|
|
2289
2390
|
// src/actions/relint.ts
|
|
2290
|
-
import
|
|
2391
|
+
import chalk29 from "chalk";
|
|
2291
2392
|
var relintPackage = ({
|
|
2292
2393
|
pkg,
|
|
2293
2394
|
fix: fix2,
|
|
2294
2395
|
verbose
|
|
2295
2396
|
}) => {
|
|
2296
|
-
console.log(
|
|
2397
|
+
console.log(chalk29.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
|
|
2297
2398
|
const start = Date.now();
|
|
2298
2399
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
|
|
2299
2400
|
["yarn", [
|
|
@@ -2303,7 +2404,7 @@ var relintPackage = ({
|
|
|
2303
2404
|
fix2 ? "package-fix" : verbose ? "package-lint-verbose" : "package-lint"
|
|
2304
2405
|
]]
|
|
2305
2406
|
]);
|
|
2306
|
-
console.log(
|
|
2407
|
+
console.log(chalk29.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk29.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk29.gray("seconds")}`));
|
|
2307
2408
|
return result;
|
|
2308
2409
|
};
|
|
2309
2410
|
var relint = ({
|
|
@@ -2323,13 +2424,13 @@ var relint = ({
|
|
|
2323
2424
|
});
|
|
2324
2425
|
};
|
|
2325
2426
|
var relintAllPackages = ({ fix: fix2 = false } = {}) => {
|
|
2326
|
-
console.log(
|
|
2427
|
+
console.log(chalk29.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
|
|
2327
2428
|
const start = Date.now();
|
|
2328
2429
|
const fixOptions = fix2 ? ["--fix"] : [];
|
|
2329
2430
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
|
|
2330
2431
|
["yarn", ["eslint", ...fixOptions]]
|
|
2331
2432
|
]);
|
|
2332
|
-
console.log(
|
|
2433
|
+
console.log(chalk29.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk29.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk29.gray("seconds")}`));
|
|
2333
2434
|
return result;
|
|
2334
2435
|
};
|
|
2335
2436
|
|
|
@@ -2347,10 +2448,10 @@ var sonar = () => {
|
|
|
2347
2448
|
};
|
|
2348
2449
|
|
|
2349
2450
|
// src/actions/statics.ts
|
|
2350
|
-
import
|
|
2451
|
+
import chalk30 from "chalk";
|
|
2351
2452
|
var DefaultDependencies = ["axios", "@xylabs/pixel", "react", "graphql", "react-router", "@mui/material", "@mui/system"];
|
|
2352
2453
|
var statics = () => {
|
|
2353
|
-
console.log(
|
|
2454
|
+
console.log(chalk30.green("Check Required Static Dependencies"));
|
|
2354
2455
|
const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
|
|
2355
2456
|
return detectDuplicateDependencies(statics2, DefaultDependencies);
|
|
2356
2457
|
};
|
|
@@ -2398,13 +2499,18 @@ var yarn3Only = () => {
|
|
|
2398
2499
|
return 0;
|
|
2399
2500
|
};
|
|
2400
2501
|
|
|
2401
|
-
// src/xy/
|
|
2502
|
+
// src/xy/param.ts
|
|
2503
|
+
var packagePositionalParam = (yargs2) => {
|
|
2504
|
+
return yargs2.positional("package", { describe: "Specific package to target", type: "string" });
|
|
2505
|
+
};
|
|
2506
|
+
|
|
2507
|
+
// src/xy/build-commands/build.ts
|
|
2402
2508
|
var buildCommand = {
|
|
2403
|
-
command: "build [package]",
|
|
2404
|
-
describe: "Build - Compile & Lint",
|
|
2405
2509
|
builder: (yargs2) => {
|
|
2406
|
-
return yargs2
|
|
2510
|
+
return packagePositionalParam(yargs2);
|
|
2407
2511
|
},
|
|
2512
|
+
command: "build [package]",
|
|
2513
|
+
describe: "Build - Compile & Lint",
|
|
2408
2514
|
handler: async (argv) => {
|
|
2409
2515
|
if (argv.verbose) {
|
|
2410
2516
|
console.log(`Building: ${argv.package ?? "all"}`);
|
|
@@ -2418,14 +2524,12 @@ var buildCommand = {
|
|
|
2418
2524
|
});
|
|
2419
2525
|
}
|
|
2420
2526
|
};
|
|
2421
|
-
|
|
2422
|
-
// src/xy/build/compileCommand.ts
|
|
2423
2527
|
var compileCommand = {
|
|
2424
|
-
command: "compile [package]",
|
|
2425
|
-
describe: "Compile with Typescript & Copy Images",
|
|
2426
2528
|
builder: (yargs2) => {
|
|
2427
|
-
return yargs2
|
|
2529
|
+
return packagePositionalParam(yargs2);
|
|
2428
2530
|
},
|
|
2531
|
+
command: "compile [package]",
|
|
2532
|
+
describe: "Compile with Typescript & Copy Images",
|
|
2429
2533
|
handler: (argv) => {
|
|
2430
2534
|
if (argv.verbose) {
|
|
2431
2535
|
console.log(`Compiling: ${argv.package ?? "all"}`);
|
|
@@ -2439,14 +2543,12 @@ var compileCommand = {
|
|
|
2439
2543
|
});
|
|
2440
2544
|
}
|
|
2441
2545
|
};
|
|
2442
|
-
|
|
2443
|
-
// src/xy/build/compileOnlyCommand.ts
|
|
2444
2546
|
var compileOnlyCommand = {
|
|
2445
|
-
command: "compile-only [package]",
|
|
2446
|
-
describe: "Compile with Typescript & Copy Images (No Publint)",
|
|
2447
2547
|
builder: (yargs2) => {
|
|
2448
|
-
return yargs2
|
|
2548
|
+
return packagePositionalParam(yargs2);
|
|
2449
2549
|
},
|
|
2550
|
+
command: "compile-only [package]",
|
|
2551
|
+
describe: "Compile with Typescript & Copy Images (No Publint)",
|
|
2450
2552
|
handler: (argv) => {
|
|
2451
2553
|
if (argv.verbose) {
|
|
2452
2554
|
console.log(`Compiling: ${argv.package ?? "all"}`);
|
|
@@ -2461,57 +2563,51 @@ var compileOnlyCommand = {
|
|
|
2461
2563
|
});
|
|
2462
2564
|
}
|
|
2463
2565
|
};
|
|
2464
|
-
|
|
2465
|
-
// src/xy/build/copyAssetsCommand.ts
|
|
2466
|
-
var copyAssetsCommand = {
|
|
2467
|
-
command: "copy-assets [package]",
|
|
2468
|
-
describe: "Copy Assets - Copy the assets from src to dist",
|
|
2566
|
+
var recompileCommand = {
|
|
2469
2567
|
builder: (yargs2) => {
|
|
2470
|
-
return yargs2
|
|
2568
|
+
return packagePositionalParam(yargs2);
|
|
2471
2569
|
},
|
|
2570
|
+
command: "recompile [package]",
|
|
2571
|
+
describe: "Re-compile with Typescript & Copy Images",
|
|
2472
2572
|
handler: async (argv) => {
|
|
2473
|
-
if (argv.verbose)
|
|
2474
|
-
|
|
2573
|
+
if (argv.verbose) {
|
|
2574
|
+
console.log(`Re-compiling: ${argv.package ?? "all"}`);
|
|
2575
|
+
}
|
|
2576
|
+
process.exitCode = await recompile({
|
|
2577
|
+
incremental: !!argv.incremental,
|
|
2578
|
+
jobs: argv.jobs,
|
|
2579
|
+
pkg: argv.package,
|
|
2580
|
+
target: argv.target,
|
|
2581
|
+
verbose: !!argv.verbose
|
|
2582
|
+
});
|
|
2475
2583
|
}
|
|
2476
2584
|
};
|
|
2477
|
-
|
|
2478
|
-
// src/xy/build/rebuildCommand.ts
|
|
2479
2585
|
var rebuildCommand = {
|
|
2480
|
-
command: "rebuild [package]",
|
|
2481
|
-
describe: "Rebuild - Clean, Compile & Lint",
|
|
2482
2586
|
builder: (yargs2) => {
|
|
2483
|
-
return yargs2
|
|
2587
|
+
return packagePositionalParam(yargs2);
|
|
2484
2588
|
},
|
|
2589
|
+
command: "rebuild [package]",
|
|
2590
|
+
describe: "Rebuild - Clean, Compile & Lint",
|
|
2485
2591
|
handler: (argv) => {
|
|
2486
2592
|
if (argv.verbose) console.log(`Rebuilding: ${argv.package ?? "all"}`);
|
|
2487
2593
|
process.exitCode = rebuild({ target: argv.target });
|
|
2488
2594
|
}
|
|
2489
2595
|
};
|
|
2490
|
-
|
|
2491
|
-
// src/xy/build/recompileCommand.ts
|
|
2492
|
-
var recompileCommand = {
|
|
2493
|
-
command: "recompile [package]",
|
|
2494
|
-
describe: "Re-compile with Typescript & Copy Images",
|
|
2596
|
+
var copyAssetsCommand = {
|
|
2495
2597
|
builder: (yargs2) => {
|
|
2496
|
-
return yargs2
|
|
2598
|
+
return packagePositionalParam(yargs2);
|
|
2497
2599
|
},
|
|
2600
|
+
command: "copy-assets [package]",
|
|
2601
|
+
describe: "Copy Assets - Copy the assets from src to dist",
|
|
2498
2602
|
handler: async (argv) => {
|
|
2499
|
-
if (argv.verbose) {
|
|
2500
|
-
|
|
2501
|
-
}
|
|
2502
|
-
process.exitCode = await recompile({
|
|
2503
|
-
incremental: !!argv.incremental,
|
|
2504
|
-
jobs: argv.jobs,
|
|
2505
|
-
pkg: argv.package,
|
|
2506
|
-
target: argv.target,
|
|
2507
|
-
verbose: !!argv.verbose
|
|
2508
|
-
});
|
|
2603
|
+
if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? "all"}`);
|
|
2604
|
+
process.exitCode = await copyAssets({ target: argv.target });
|
|
2509
2605
|
}
|
|
2510
2606
|
};
|
|
2511
2607
|
|
|
2512
|
-
// src/xy/build/index.ts
|
|
2608
|
+
// src/xy/build-commands/index.ts
|
|
2513
2609
|
var xyBuildCommands = (args) => {
|
|
2514
|
-
return args.command(buildCommand).command(compileCommand).command(compileOnlyCommand).command(
|
|
2610
|
+
return args.command(buildCommand).command(compileCommand).command(compileOnlyCommand).command(rebuildCommand).command(recompileCommand).command(copyAssetsCommand);
|
|
2515
2611
|
};
|
|
2516
2612
|
|
|
2517
2613
|
// src/xy/common/claude/commandsCommand.ts
|
|
@@ -2544,6 +2640,14 @@ var initCommand = {
|
|
|
2544
2640
|
process.exitCode = commandsResult || rulesResult || settingsResult;
|
|
2545
2641
|
}
|
|
2546
2642
|
};
|
|
2643
|
+
var initClaudeSkillsCommand = {
|
|
2644
|
+
command: "init:skills",
|
|
2645
|
+
describe: "Initialize Claude skills configuration",
|
|
2646
|
+
handler: () => {
|
|
2647
|
+
const result = claudeSkills();
|
|
2648
|
+
process.exitCode = result;
|
|
2649
|
+
}
|
|
2650
|
+
};
|
|
2547
2651
|
|
|
2548
2652
|
// src/xy/common/claude/rulesCommand.ts
|
|
2549
2653
|
var rulesCommand = {
|
|
@@ -2576,7 +2680,7 @@ var settingsCommand = {
|
|
|
2576
2680
|
// src/xy/common/claude/index.ts
|
|
2577
2681
|
var claudeCommand = {
|
|
2578
2682
|
builder: (yargs2) => {
|
|
2579
|
-
return yargs2.command(commandsCommand).command(initCommand).command(rulesCommand).command(settingsCommand).demandCommand(1, "Please specify a claude subcommand");
|
|
2683
|
+
return yargs2.command(commandsCommand).command(initCommand).command(rulesCommand).command(settingsCommand).command(initClaudeSkillsCommand).demandCommand(1, "Please specify a claude subcommand");
|
|
2580
2684
|
},
|
|
2581
2685
|
command: "claude",
|
|
2582
2686
|
describe: "Claude - Claude Code configuration utilities",
|
|
@@ -2594,11 +2698,6 @@ var cleanDocsCommand = {
|
|
|
2594
2698
|
}
|
|
2595
2699
|
};
|
|
2596
2700
|
|
|
2597
|
-
// src/xy/param.ts
|
|
2598
|
-
var packagePositionalParam = (yargs2) => {
|
|
2599
|
-
return yargs2.positional("package", { describe: "Specific package to target", type: "string" });
|
|
2600
|
-
};
|
|
2601
|
-
|
|
2602
2701
|
// src/xy/common/deadCommand.ts
|
|
2603
2702
|
var deadCommand = {
|
|
2604
2703
|
builder: (yargs2) => {
|
|
@@ -2910,7 +3009,7 @@ var xyInstallCommands = (args) => {
|
|
|
2910
3009
|
};
|
|
2911
3010
|
|
|
2912
3011
|
// src/xy/lint/cycleCommand.ts
|
|
2913
|
-
import
|
|
3012
|
+
import chalk31 from "chalk";
|
|
2914
3013
|
var cycleCommand = {
|
|
2915
3014
|
command: "cycle [package]",
|
|
2916
3015
|
describe: "Cycle - Check for dependency cycles",
|
|
@@ -2921,12 +3020,12 @@ var cycleCommand = {
|
|
|
2921
3020
|
const start = Date.now();
|
|
2922
3021
|
if (argv.verbose) console.log("Cycle");
|
|
2923
3022
|
process.exitCode = await cycle({ pkg: argv.package });
|
|
2924
|
-
console.log(
|
|
3023
|
+
console.log(chalk31.blue(`Finished in ${Date.now() - start}ms`));
|
|
2925
3024
|
}
|
|
2926
3025
|
};
|
|
2927
3026
|
|
|
2928
3027
|
// src/xy/lint/deplintCommand.ts
|
|
2929
|
-
import
|
|
3028
|
+
import chalk32 from "chalk";
|
|
2930
3029
|
var deplintCommand = {
|
|
2931
3030
|
command: "deplint [package]",
|
|
2932
3031
|
describe: "Deplint - Run Deplint",
|
|
@@ -2964,12 +3063,12 @@ var deplintCommand = {
|
|
|
2964
3063
|
peerDeps: !!argv.peerDeps,
|
|
2965
3064
|
verbose: !!argv.verbose
|
|
2966
3065
|
});
|
|
2967
|
-
console.log(
|
|
3066
|
+
console.log(chalk32.blue(`Finished in ${Date.now() - start}ms`));
|
|
2968
3067
|
}
|
|
2969
3068
|
};
|
|
2970
3069
|
|
|
2971
3070
|
// src/xy/lint/fixCommand.ts
|
|
2972
|
-
import
|
|
3071
|
+
import chalk33 from "chalk";
|
|
2973
3072
|
var fixCommand = {
|
|
2974
3073
|
command: "fix [package]",
|
|
2975
3074
|
describe: "Fix - Run Eslint w/fix",
|
|
@@ -2980,12 +3079,12 @@ var fixCommand = {
|
|
|
2980
3079
|
const start = Date.now();
|
|
2981
3080
|
if (argv.verbose) console.log("Fix");
|
|
2982
3081
|
process.exitCode = fix();
|
|
2983
|
-
console.log(
|
|
3082
|
+
console.log(chalk33.blue(`Finished in ${Date.now() - start}ms`));
|
|
2984
3083
|
}
|
|
2985
3084
|
};
|
|
2986
3085
|
|
|
2987
3086
|
// src/xy/lint/knipCommand.ts
|
|
2988
|
-
import
|
|
3087
|
+
import chalk34 from "chalk";
|
|
2989
3088
|
var knipCommand = {
|
|
2990
3089
|
command: "knip",
|
|
2991
3090
|
describe: "Knip - Run Knip",
|
|
@@ -2996,12 +3095,12 @@ var knipCommand = {
|
|
|
2996
3095
|
if (argv.verbose) console.log("Knip");
|
|
2997
3096
|
const start = Date.now();
|
|
2998
3097
|
process.exitCode = knip();
|
|
2999
|
-
console.log(
|
|
3098
|
+
console.log(chalk34.blue(`Knip finished in ${Date.now() - start}ms`));
|
|
3000
3099
|
}
|
|
3001
3100
|
};
|
|
3002
3101
|
|
|
3003
3102
|
// src/xy/lint/lintCommand.ts
|
|
3004
|
-
import
|
|
3103
|
+
import chalk35 from "chalk";
|
|
3005
3104
|
var lintCommand = {
|
|
3006
3105
|
command: "lint [package]",
|
|
3007
3106
|
describe: "Lint - Run Eslint",
|
|
@@ -3030,12 +3129,12 @@ var lintCommand = {
|
|
|
3030
3129
|
cache: argv.cache,
|
|
3031
3130
|
verbose: !!argv.verbose
|
|
3032
3131
|
});
|
|
3033
|
-
console.log(
|
|
3132
|
+
console.log(chalk35.blue(`Finished in ${Date.now() - start}ms`));
|
|
3034
3133
|
}
|
|
3035
3134
|
};
|
|
3036
3135
|
|
|
3037
3136
|
// src/xy/lint/publintCommand.ts
|
|
3038
|
-
import
|
|
3137
|
+
import chalk36 from "chalk";
|
|
3039
3138
|
var publintCommand = {
|
|
3040
3139
|
command: "publint [package]",
|
|
3041
3140
|
describe: "Publint - Run Publint",
|
|
@@ -3046,12 +3145,12 @@ var publintCommand = {
|
|
|
3046
3145
|
if (argv.verbose) console.log("Publint");
|
|
3047
3146
|
const start = Date.now();
|
|
3048
3147
|
process.exitCode = await publint({ pkg: argv.package, verbose: !!argv.verbose });
|
|
3049
|
-
console.log(
|
|
3148
|
+
console.log(chalk36.blue(`Finished in ${Date.now() - start}ms`));
|
|
3050
3149
|
}
|
|
3051
3150
|
};
|
|
3052
3151
|
|
|
3053
3152
|
// src/xy/lint/relintCommand.ts
|
|
3054
|
-
import
|
|
3153
|
+
import chalk37 from "chalk";
|
|
3055
3154
|
var relintCommand = {
|
|
3056
3155
|
command: "relint [package]",
|
|
3057
3156
|
describe: "Relint - Clean & Lint",
|
|
@@ -3062,12 +3161,12 @@ var relintCommand = {
|
|
|
3062
3161
|
if (argv.verbose) console.log("Relinting");
|
|
3063
3162
|
const start = Date.now();
|
|
3064
3163
|
process.exitCode = relint();
|
|
3065
|
-
console.log(
|
|
3164
|
+
console.log(chalk37.blue(`Finished in ${Date.now() - start}ms`));
|
|
3066
3165
|
}
|
|
3067
3166
|
};
|
|
3068
3167
|
|
|
3069
3168
|
// src/xy/lint/sonarCommand.ts
|
|
3070
|
-
import
|
|
3169
|
+
import chalk38 from "chalk";
|
|
3071
3170
|
var sonarCommand = {
|
|
3072
3171
|
command: "sonar",
|
|
3073
3172
|
describe: "Sonar - Run Sonar Check",
|
|
@@ -3078,7 +3177,7 @@ var sonarCommand = {
|
|
|
3078
3177
|
const start = Date.now();
|
|
3079
3178
|
if (argv.verbose) console.log("Sonar Check");
|
|
3080
3179
|
process.exitCode = sonar();
|
|
3081
|
-
console.log(
|
|
3180
|
+
console.log(chalk38.blue(`Finished in ${Date.now() - start}ms`));
|
|
3082
3181
|
}
|
|
3083
3182
|
};
|
|
3084
3183
|
|
|
@@ -3118,8 +3217,8 @@ var xyParseOptions = () => {
|
|
|
3118
3217
|
var xy = async () => {
|
|
3119
3218
|
const options = xyParseOptions();
|
|
3120
3219
|
return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
|
|
3121
|
-
console.error(
|
|
3122
|
-
console.log(
|
|
3220
|
+
console.error(chalk39.yellow(`Command not found [${chalk39.magenta(process.argv[2])}]`));
|
|
3221
|
+
console.log(chalk39.gray("Try 'yarn xy --help' for list of commands"));
|
|
3123
3222
|
}).version().help().argv;
|
|
3124
3223
|
};
|
|
3125
3224
|
export {
|