@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/index.mjs
CHANGED
|
@@ -15,7 +15,11 @@ var checkResult = (name, result, level = "error", exitOnFail = false) => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
// src/lib/claudeMdTemplate.ts
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
readdirSync,
|
|
20
|
+
readFileSync,
|
|
21
|
+
statSync
|
|
22
|
+
} from "fs";
|
|
19
23
|
import { createRequire } from "module";
|
|
20
24
|
import PATH from "path";
|
|
21
25
|
var require2 = createRequire(import.meta.url);
|
|
@@ -23,6 +27,7 @@ var packageRoot = PATH.dirname(require2.resolve("@xylabs/ts-scripts-yarn3/packag
|
|
|
23
27
|
var templatesDir = PATH.resolve(packageRoot, "templates", "claude");
|
|
24
28
|
var XYLABS_RULES_PREFIX = "xylabs-";
|
|
25
29
|
var XYLABS_COMMANDS_PREFIX = "xylabs-";
|
|
30
|
+
var XYLABS_SKILLS_PREFIX = "xylabs-";
|
|
26
31
|
var claudeMdRuleTemplates = () => {
|
|
27
32
|
const rulesDir = PATH.resolve(templatesDir, "rules");
|
|
28
33
|
const files = readdirSync(rulesDir).filter((f) => f.startsWith(XYLABS_RULES_PREFIX) && f.endsWith(".md"));
|
|
@@ -41,6 +46,24 @@ var claudeCommandTemplates = () => {
|
|
|
41
46
|
}
|
|
42
47
|
return result;
|
|
43
48
|
};
|
|
49
|
+
var claudeSkillTemplates = () => {
|
|
50
|
+
const skillsDir = PATH.resolve(templatesDir, "skills");
|
|
51
|
+
const dirs = readdirSync(skillsDir).filter(
|
|
52
|
+
(f) => f.startsWith(XYLABS_SKILLS_PREFIX) && statSync(PATH.resolve(skillsDir, f)).isDirectory()
|
|
53
|
+
);
|
|
54
|
+
const result = {};
|
|
55
|
+
for (const dir of dirs) {
|
|
56
|
+
const dirPath = PATH.resolve(skillsDir, dir);
|
|
57
|
+
const files = readdirSync(dirPath, { recursive: true, encoding: "utf8" });
|
|
58
|
+
result[dir] = {};
|
|
59
|
+
for (const file of files) {
|
|
60
|
+
if (statSync(PATH.resolve(dirPath, file)).isFile()) {
|
|
61
|
+
result[dir][file] = readFileSync(PATH.resolve(dirPath, file), "utf8");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return result;
|
|
66
|
+
};
|
|
44
67
|
var claudeMdProjectTemplate = () => readFileSync(PATH.resolve(templatesDir, "CLAUDE-project.md"), "utf8");
|
|
45
68
|
|
|
46
69
|
// src/lib/createBuildConfig.ts
|
|
@@ -978,6 +1001,84 @@ async function claudeSettings() {
|
|
|
978
1001
|
return 0;
|
|
979
1002
|
}
|
|
980
1003
|
|
|
1004
|
+
// src/actions/claude-skills.ts
|
|
1005
|
+
import {
|
|
1006
|
+
existsSync as existsSync8,
|
|
1007
|
+
mkdirSync as mkdirSync4,
|
|
1008
|
+
readdirSync as readdirSync4,
|
|
1009
|
+
readFileSync as readFileSync9,
|
|
1010
|
+
rmSync,
|
|
1011
|
+
statSync as statSync2,
|
|
1012
|
+
writeFileSync as writeFileSync5
|
|
1013
|
+
} from "fs";
|
|
1014
|
+
import PATH6 from "path";
|
|
1015
|
+
import chalk14 from "chalk";
|
|
1016
|
+
var syncSkillFiles = (skillsDir) => {
|
|
1017
|
+
const templates = claudeSkillTemplates();
|
|
1018
|
+
const templateNames = new Set(Object.keys(templates));
|
|
1019
|
+
let updated = 0;
|
|
1020
|
+
let created = 0;
|
|
1021
|
+
for (const [skillName, files] of Object.entries(templates)) {
|
|
1022
|
+
const skillDir = PATH6.resolve(skillsDir, skillName);
|
|
1023
|
+
mkdirSync4(skillDir, { recursive: true });
|
|
1024
|
+
for (const [filename3, content] of Object.entries(files)) {
|
|
1025
|
+
const targetPath = PATH6.resolve(skillDir, filename3);
|
|
1026
|
+
mkdirSync4(PATH6.dirname(targetPath), { recursive: true });
|
|
1027
|
+
const existing = existsSync8(targetPath) ? readFileSync9(targetPath, "utf8") : void 0;
|
|
1028
|
+
if (existing === content) continue;
|
|
1029
|
+
writeFileSync5(targetPath, content, "utf8");
|
|
1030
|
+
if (existing) {
|
|
1031
|
+
updated++;
|
|
1032
|
+
} else {
|
|
1033
|
+
created++;
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
return {
|
|
1038
|
+
created,
|
|
1039
|
+
templateNames,
|
|
1040
|
+
updated
|
|
1041
|
+
};
|
|
1042
|
+
};
|
|
1043
|
+
var removeStaleSkills = (skillsDir, templateNames) => {
|
|
1044
|
+
const existingSkills = readdirSync4(skillsDir).filter(
|
|
1045
|
+
(f) => f.startsWith(XYLABS_SKILLS_PREFIX) && statSync2(PATH6.resolve(skillsDir, f)).isDirectory()
|
|
1046
|
+
);
|
|
1047
|
+
let removed = 0;
|
|
1048
|
+
for (const dir of existingSkills) {
|
|
1049
|
+
if (!templateNames.has(dir)) {
|
|
1050
|
+
rmSync(PATH6.resolve(skillsDir, dir), { recursive: true });
|
|
1051
|
+
removed++;
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
return removed;
|
|
1055
|
+
};
|
|
1056
|
+
var logSkillsResult = (created, updated, removed) => {
|
|
1057
|
+
if (created || updated || removed) {
|
|
1058
|
+
const parts = [
|
|
1059
|
+
created ? `${created} created` : "",
|
|
1060
|
+
updated ? `${updated} updated` : "",
|
|
1061
|
+
removed ? `${removed} removed` : ""
|
|
1062
|
+
].filter(Boolean);
|
|
1063
|
+
console.log(chalk14.green(`.claude/skills/${XYLABS_SKILLS_PREFIX}*/: ${parts.join(", ")}`));
|
|
1064
|
+
} else {
|
|
1065
|
+
console.log(chalk14.gray(`.claude/skills/${XYLABS_SKILLS_PREFIX}*/: already up to date`));
|
|
1066
|
+
}
|
|
1067
|
+
};
|
|
1068
|
+
var claudeSkills = () => {
|
|
1069
|
+
const cwd5 = INIT_CWD() ?? process.cwd();
|
|
1070
|
+
const skillsDir = PATH6.resolve(cwd5, ".claude", "skills");
|
|
1071
|
+
mkdirSync4(skillsDir, { recursive: true });
|
|
1072
|
+
const {
|
|
1073
|
+
created,
|
|
1074
|
+
templateNames,
|
|
1075
|
+
updated
|
|
1076
|
+
} = syncSkillFiles(skillsDir);
|
|
1077
|
+
const removed = removeStaleSkills(skillsDir, templateNames);
|
|
1078
|
+
logSkillsResult(created, updated, removed);
|
|
1079
|
+
return 0;
|
|
1080
|
+
};
|
|
1081
|
+
|
|
981
1082
|
// src/actions/clean.ts
|
|
982
1083
|
var clean = async ({ verbose, pkg }) => {
|
|
983
1084
|
return pkg ? await cleanPackage({ pkg, verbose }) : cleanAll({ verbose });
|
|
@@ -992,16 +1093,16 @@ var cleanAll = ({ verbose }) => {
|
|
|
992
1093
|
|
|
993
1094
|
// src/actions/clean-docs.ts
|
|
994
1095
|
import path from "path";
|
|
995
|
-
import
|
|
1096
|
+
import chalk15 from "chalk";
|
|
996
1097
|
var cleanDocs = () => {
|
|
997
1098
|
const pkgName = process.env.npm_package_name;
|
|
998
|
-
console.log(
|
|
1099
|
+
console.log(chalk15.green(`Cleaning Docs [${pkgName}]`));
|
|
999
1100
|
for (const { location } of yarnWorkspaces()) deleteGlob(path.join(location, "docs"));
|
|
1000
1101
|
return 0;
|
|
1001
1102
|
};
|
|
1002
1103
|
|
|
1003
1104
|
// src/actions/compile.ts
|
|
1004
|
-
import
|
|
1105
|
+
import chalk16 from "chalk";
|
|
1005
1106
|
var compile = ({
|
|
1006
1107
|
verbose,
|
|
1007
1108
|
target,
|
|
@@ -1042,7 +1143,7 @@ var compileAll = ({
|
|
|
1042
1143
|
const incrementalOptions = incremental ? ["--since", "-Ap", "--topological-dev"] : ["--parallel", "-Ap", "--topological-dev"];
|
|
1043
1144
|
const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
|
|
1044
1145
|
if (jobs) {
|
|
1045
|
-
console.log(
|
|
1146
|
+
console.log(chalk16.blue(`Jobs set to [${jobs}]`));
|
|
1046
1147
|
}
|
|
1047
1148
|
const result = runSteps(`Compile${incremental ? "-Incremental" : ""} [All]`, [
|
|
1048
1149
|
["yarn", [
|
|
@@ -1056,13 +1157,13 @@ var compileAll = ({
|
|
|
1056
1157
|
...targetOptions
|
|
1057
1158
|
]]
|
|
1058
1159
|
]);
|
|
1059
|
-
console.log(`${
|
|
1160
|
+
console.log(`${chalk16.gray("Compiled in")} [${chalk16.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk16.gray("seconds")}`);
|
|
1060
1161
|
return result;
|
|
1061
1162
|
};
|
|
1062
1163
|
|
|
1063
1164
|
// src/actions/copy-assets.ts
|
|
1064
1165
|
import path2 from "path/posix";
|
|
1065
|
-
import
|
|
1166
|
+
import chalk17 from "chalk";
|
|
1066
1167
|
import cpy from "cpy";
|
|
1067
1168
|
var copyPackageTargetAssets = async (target, name, location) => {
|
|
1068
1169
|
try {
|
|
@@ -1085,7 +1186,7 @@ var copyPackageTargetAssets = async (target, name, location) => {
|
|
|
1085
1186
|
};
|
|
1086
1187
|
var copyTargetAssets = async (target, pkg) => {
|
|
1087
1188
|
const workspaces = yarnWorkspaces();
|
|
1088
|
-
console.log(
|
|
1189
|
+
console.log(chalk17.green(`Copying Assets [${target.toUpperCase()}]`));
|
|
1089
1190
|
const workspaceList = workspaces.filter(({ name }) => {
|
|
1090
1191
|
return pkg === void 0 || name === pkg;
|
|
1091
1192
|
});
|
|
@@ -1169,7 +1270,7 @@ var dead = () => {
|
|
|
1169
1270
|
};
|
|
1170
1271
|
|
|
1171
1272
|
// src/actions/deplint/deplint.ts
|
|
1172
|
-
import
|
|
1273
|
+
import chalk23 from "chalk";
|
|
1173
1274
|
|
|
1174
1275
|
// src/actions/deplint/findFiles.ts
|
|
1175
1276
|
import fs2 from "fs";
|
|
@@ -1374,7 +1475,7 @@ function getExternalImportsFromFiles({
|
|
|
1374
1475
|
|
|
1375
1476
|
// src/actions/deplint/checkPackage/getUnlistedDependencies.ts
|
|
1376
1477
|
import { builtinModules } from "module";
|
|
1377
|
-
import
|
|
1478
|
+
import chalk18 from "chalk";
|
|
1378
1479
|
function isRuntimeImportListed(imp, name, dependencies, peerDependencies) {
|
|
1379
1480
|
return dependencies.includes(imp) || imp === name || peerDependencies.includes(imp) || builtinModules.includes(imp);
|
|
1380
1481
|
}
|
|
@@ -1382,7 +1483,7 @@ function isTypeImportListed(imp, name, dependencies, devDependencies, peerDepend
|
|
|
1382
1483
|
return dependencies.includes(imp) || imp === name || dependencies.includes(`@types/${imp}`) || peerDependencies.includes(imp) || peerDependencies.includes(`@types/${imp}`) || devDependencies.includes(`@types/${imp}`) || builtinModules.includes(imp);
|
|
1383
1484
|
}
|
|
1384
1485
|
function logMissing(name, imp, importPaths) {
|
|
1385
|
-
console.log(`[${
|
|
1486
|
+
console.log(`[${chalk18.blue(name)}] Missing dependency in package.json: ${chalk18.red(imp)}`);
|
|
1386
1487
|
if (importPaths[imp]) {
|
|
1387
1488
|
console.log(` ${importPaths[imp].join("\n ")}`);
|
|
1388
1489
|
}
|
|
@@ -1411,7 +1512,7 @@ function getUnlistedDependencies({ name, location }, {
|
|
|
1411
1512
|
}
|
|
1412
1513
|
if (unlistedDependencies > 0) {
|
|
1413
1514
|
const packageLocation = `${location}/package.json`;
|
|
1414
|
-
console.log(` ${
|
|
1515
|
+
console.log(` ${chalk18.yellow(packageLocation)}
|
|
1415
1516
|
`);
|
|
1416
1517
|
}
|
|
1417
1518
|
return unlistedDependencies;
|
|
@@ -1419,7 +1520,7 @@ function getUnlistedDependencies({ name, location }, {
|
|
|
1419
1520
|
|
|
1420
1521
|
// src/actions/deplint/checkPackage/getUnlistedDevDependencies.ts
|
|
1421
1522
|
import { builtinModules as builtinModules2 } from "module";
|
|
1422
|
-
import
|
|
1523
|
+
import chalk19 from "chalk";
|
|
1423
1524
|
function getUnlistedDevDependencies({ name, location }, {
|
|
1424
1525
|
devDependencies,
|
|
1425
1526
|
dependencies,
|
|
@@ -1433,7 +1534,7 @@ function getUnlistedDevDependencies({ name, location }, {
|
|
|
1433
1534
|
for (const imp of externalAllImports) {
|
|
1434
1535
|
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)) {
|
|
1435
1536
|
unlistedDevDependencies++;
|
|
1436
|
-
console.log(`[${
|
|
1537
|
+
console.log(`[${chalk19.blue(name)}] Missing devDependency in package.json: ${chalk19.red(imp)}`);
|
|
1437
1538
|
if (allImportPaths[imp]) {
|
|
1438
1539
|
console.log(` ${allImportPaths[imp].join("\n ")}`);
|
|
1439
1540
|
}
|
|
@@ -1441,14 +1542,14 @@ function getUnlistedDevDependencies({ name, location }, {
|
|
|
1441
1542
|
}
|
|
1442
1543
|
if (unlistedDevDependencies > 0) {
|
|
1443
1544
|
const packageLocation = `${location}/package.json`;
|
|
1444
|
-
console.log(` ${
|
|
1545
|
+
console.log(` ${chalk19.yellow(packageLocation)}
|
|
1445
1546
|
`);
|
|
1446
1547
|
}
|
|
1447
1548
|
return unlistedDevDependencies;
|
|
1448
1549
|
}
|
|
1449
1550
|
|
|
1450
1551
|
// src/actions/deplint/checkPackage/getUnusedDependencies.ts
|
|
1451
|
-
import
|
|
1552
|
+
import chalk20 from "chalk";
|
|
1452
1553
|
function getUnusedDependencies({ name, location }, { dependencies }, {
|
|
1453
1554
|
externalDistImports,
|
|
1454
1555
|
externalDistTypeImports,
|
|
@@ -1460,22 +1561,22 @@ function getUnusedDependencies({ name, location }, { dependencies }, {
|
|
|
1460
1561
|
if (!externalDistImports.includes(dep) && !externalDistImports.includes(dep.replace(/^@types\//, "")) && !externalDistTypeImports.includes(dep) && !externalDistTypeImports.includes(dep.replace(/^@types\//, ""))) {
|
|
1461
1562
|
unusedDependencies++;
|
|
1462
1563
|
if (externalAllImports.includes(dep)) {
|
|
1463
|
-
console.log(`[${
|
|
1564
|
+
console.log(`[${chalk20.blue(name)}] dependency should be devDependency in package.json: ${chalk20.red(dep)}`);
|
|
1464
1565
|
} else {
|
|
1465
|
-
console.log(`[${
|
|
1566
|
+
console.log(`[${chalk20.blue(name)}] Unused dependency in package.json: ${chalk20.red(dep)}`);
|
|
1466
1567
|
}
|
|
1467
1568
|
}
|
|
1468
1569
|
}
|
|
1469
1570
|
if (unusedDependencies > 0) {
|
|
1470
1571
|
const packageLocation = `${location}/package.json`;
|
|
1471
|
-
console.log(` ${
|
|
1572
|
+
console.log(` ${chalk20.yellow(packageLocation)}
|
|
1472
1573
|
`);
|
|
1473
1574
|
}
|
|
1474
1575
|
return unusedDependencies;
|
|
1475
1576
|
}
|
|
1476
1577
|
|
|
1477
1578
|
// src/actions/deplint/checkPackage/getUnusedDevDependencies.ts
|
|
1478
|
-
import
|
|
1579
|
+
import chalk21 from "chalk";
|
|
1479
1580
|
|
|
1480
1581
|
// src/actions/deplint/getCliReferencedPackagesFromFiles.ts
|
|
1481
1582
|
import fs8 from "fs";
|
|
@@ -1759,19 +1860,19 @@ function getUnusedDevDependencies({ name, location }, {
|
|
|
1759
1860
|
if (dependencies.includes(dep) || peerDependencies.includes(dep)) continue;
|
|
1760
1861
|
if (!isDevDepUsed(dep, allImports, implicitDeps, requiredPeers, scriptRefs, cliRefs)) {
|
|
1761
1862
|
unusedDevDependencies++;
|
|
1762
|
-
console.log(`[${
|
|
1863
|
+
console.log(`[${chalk21.blue(name)}] Unused devDependency in package.json: ${chalk21.red(dep)}`);
|
|
1763
1864
|
}
|
|
1764
1865
|
}
|
|
1765
1866
|
if (unusedDevDependencies > 0) {
|
|
1766
1867
|
const packageLocation = `${location}/package.json`;
|
|
1767
|
-
console.log(` ${
|
|
1868
|
+
console.log(` ${chalk21.yellow(packageLocation)}
|
|
1768
1869
|
`);
|
|
1769
1870
|
}
|
|
1770
1871
|
return unusedDevDependencies;
|
|
1771
1872
|
}
|
|
1772
1873
|
|
|
1773
1874
|
// src/actions/deplint/checkPackage/getUnusedPeerDependencies.ts
|
|
1774
|
-
import
|
|
1875
|
+
import chalk22 from "chalk";
|
|
1775
1876
|
function getUnusedPeerDependencies({ name, location }, { peerDependencies, dependencies }, { externalDistImports, externalDistTypeImports }, exclude) {
|
|
1776
1877
|
let unusedDependencies = 0;
|
|
1777
1878
|
for (const dep of peerDependencies) {
|
|
@@ -1779,15 +1880,15 @@ function getUnusedPeerDependencies({ name, location }, { peerDependencies, depen
|
|
|
1779
1880
|
if (!externalDistImports.includes(dep) && !externalDistImports.includes(dep.replace(/^@types\//, "")) && !externalDistTypeImports.includes(dep) && !externalDistTypeImports.includes(dep.replace(/^@types\//, ""))) {
|
|
1780
1881
|
unusedDependencies++;
|
|
1781
1882
|
if (dependencies.includes(dep)) {
|
|
1782
|
-
console.log(`[${
|
|
1883
|
+
console.log(`[${chalk22.blue(name)}] Unused peerDependency [already a dependency] in package.json: ${chalk22.red(dep)}`);
|
|
1783
1884
|
} else {
|
|
1784
|
-
console.log(`[${
|
|
1885
|
+
console.log(`[${chalk22.blue(name)}] Unused peerDependency in package.json: ${chalk22.red(dep)}`);
|
|
1785
1886
|
}
|
|
1786
1887
|
}
|
|
1787
1888
|
}
|
|
1788
1889
|
if (unusedDependencies > 0) {
|
|
1789
1890
|
const packageLocation = `${location}/package.json`;
|
|
1790
|
-
console.log(` ${
|
|
1891
|
+
console.log(` ${chalk22.yellow(packageLocation)}
|
|
1791
1892
|
`);
|
|
1792
1893
|
}
|
|
1793
1894
|
return unusedDependencies;
|
|
@@ -1882,19 +1983,19 @@ var deplint = async ({
|
|
|
1882
1983
|
});
|
|
1883
1984
|
}
|
|
1884
1985
|
if (totalErrors > 0) {
|
|
1885
|
-
console.warn(`Deplint: Found ${
|
|
1986
|
+
console.warn(`Deplint: Found ${chalk23.red(totalErrors)} dependency problems. ${chalk23.red("\u2716")}`);
|
|
1886
1987
|
} else {
|
|
1887
|
-
console.info(`Deplint: Found no dependency problems. ${
|
|
1988
|
+
console.info(`Deplint: Found no dependency problems. ${chalk23.green("\u2714")}`);
|
|
1888
1989
|
}
|
|
1889
1990
|
return 0;
|
|
1890
1991
|
};
|
|
1891
1992
|
|
|
1892
1993
|
// src/actions/deploy.ts
|
|
1893
|
-
import { readFileSync as
|
|
1994
|
+
import { readFileSync as readFileSync10 } from "fs";
|
|
1894
1995
|
var privatePackageExcludeList = () => {
|
|
1895
1996
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
1896
1997
|
workspace,
|
|
1897
|
-
JSON.parse(
|
|
1998
|
+
JSON.parse(readFileSync10(`${workspace.location}/package.json`, { encoding: "utf8" }))
|
|
1898
1999
|
]);
|
|
1899
2000
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
1900
2001
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
@@ -1914,11 +2015,11 @@ var deploy = () => {
|
|
|
1914
2015
|
};
|
|
1915
2016
|
|
|
1916
2017
|
// src/actions/deploy-major.ts
|
|
1917
|
-
import { readFileSync as
|
|
2018
|
+
import { readFileSync as readFileSync11 } from "fs";
|
|
1918
2019
|
var privatePackageExcludeList2 = () => {
|
|
1919
2020
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
1920
2021
|
workspace,
|
|
1921
|
-
JSON.parse(
|
|
2022
|
+
JSON.parse(readFileSync11(`${workspace.location}/package.json`, { encoding: "utf8" }))
|
|
1922
2023
|
]);
|
|
1923
2024
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
1924
2025
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
@@ -1938,11 +2039,11 @@ var deployMajor = () => {
|
|
|
1938
2039
|
};
|
|
1939
2040
|
|
|
1940
2041
|
// src/actions/deploy-minor.ts
|
|
1941
|
-
import { readFileSync as
|
|
2042
|
+
import { readFileSync as readFileSync12 } from "fs";
|
|
1942
2043
|
var privatePackageExcludeList3 = () => {
|
|
1943
2044
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
1944
2045
|
workspace,
|
|
1945
|
-
JSON.parse(
|
|
2046
|
+
JSON.parse(readFileSync12(`${workspace.location}/package.json`, { encoding: "utf8" }))
|
|
1946
2047
|
]);
|
|
1947
2048
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
1948
2049
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
@@ -1962,11 +2063,11 @@ var deployMinor = () => {
|
|
|
1962
2063
|
};
|
|
1963
2064
|
|
|
1964
2065
|
// src/actions/deploy-next.ts
|
|
1965
|
-
import { readFileSync as
|
|
2066
|
+
import { readFileSync as readFileSync13 } from "fs";
|
|
1966
2067
|
var privatePackageExcludeList4 = () => {
|
|
1967
2068
|
const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
|
|
1968
2069
|
workspace,
|
|
1969
|
-
JSON.parse(
|
|
2070
|
+
JSON.parse(readFileSync13(`${workspace.location}/package.json`, { encoding: "utf8" }))
|
|
1970
2071
|
]);
|
|
1971
2072
|
const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
|
|
1972
2073
|
const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
|
|
@@ -1986,22 +2087,22 @@ var deployNext = () => {
|
|
|
1986
2087
|
};
|
|
1987
2088
|
|
|
1988
2089
|
// src/actions/dupdeps.ts
|
|
1989
|
-
import
|
|
2090
|
+
import chalk24 from "chalk";
|
|
1990
2091
|
var dupdeps = () => {
|
|
1991
|
-
console.log(
|
|
2092
|
+
console.log(chalk24.green("Checking all Dependencies for Duplicates"));
|
|
1992
2093
|
const allDependencies = parsedPackageJSON()?.dependencies;
|
|
1993
2094
|
const dependencies = Object.entries(allDependencies).map(([k]) => k);
|
|
1994
2095
|
return detectDuplicateDependencies(dependencies);
|
|
1995
2096
|
};
|
|
1996
2097
|
|
|
1997
2098
|
// src/actions/lint.ts
|
|
1998
|
-
import
|
|
2099
|
+
import chalk25 from "chalk";
|
|
1999
2100
|
var lintPackage = ({
|
|
2000
2101
|
pkg,
|
|
2001
2102
|
fix: fix2,
|
|
2002
2103
|
verbose
|
|
2003
2104
|
}) => {
|
|
2004
|
-
console.log(
|
|
2105
|
+
console.log(chalk25.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
|
|
2005
2106
|
const start = Date.now();
|
|
2006
2107
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
|
|
2007
2108
|
["yarn", [
|
|
@@ -2011,7 +2112,7 @@ var lintPackage = ({
|
|
|
2011
2112
|
fix2 ? "package-fix" : verbose ? "package-lint-verbose" : "package-lint"
|
|
2012
2113
|
]]
|
|
2013
2114
|
]);
|
|
2014
|
-
console.log(
|
|
2115
|
+
console.log(chalk25.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk25.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk25.gray("seconds")}`));
|
|
2015
2116
|
return result;
|
|
2016
2117
|
};
|
|
2017
2118
|
var lint = ({
|
|
@@ -2031,13 +2132,13 @@ var lint = ({
|
|
|
2031
2132
|
});
|
|
2032
2133
|
};
|
|
2033
2134
|
var lintAllPackages = ({ fix: fix2 = false } = {}) => {
|
|
2034
|
-
console.log(
|
|
2135
|
+
console.log(chalk25.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
|
|
2035
2136
|
const start = Date.now();
|
|
2036
2137
|
const fixOptions = fix2 ? ["--fix"] : [];
|
|
2037
2138
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
|
|
2038
2139
|
["yarn", ["eslint", "--cache", "--cache-location", ".eslintcache", "--cache-strategy", "content", ...fixOptions]]
|
|
2039
2140
|
]);
|
|
2040
|
-
console.log(
|
|
2141
|
+
console.log(chalk25.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk25.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk25.gray("seconds")}`));
|
|
2041
2142
|
return result;
|
|
2042
2143
|
};
|
|
2043
2144
|
|
|
@@ -2065,7 +2166,7 @@ var filename = ".gitignore";
|
|
|
2065
2166
|
var gitignoreGen = (pkg) => generateIgnoreFiles(filename, pkg);
|
|
2066
2167
|
|
|
2067
2168
|
// src/actions/gitlint.ts
|
|
2068
|
-
import
|
|
2169
|
+
import chalk26 from "chalk";
|
|
2069
2170
|
import ParseGitConfig from "parse-git-config";
|
|
2070
2171
|
var gitlint = () => {
|
|
2071
2172
|
console.log(`
|
|
@@ -2076,7 +2177,7 @@ Gitlint Start [${process.cwd()}]
|
|
|
2076
2177
|
const errors = 0;
|
|
2077
2178
|
const gitConfig = ParseGitConfig.sync();
|
|
2078
2179
|
const warn = (message) => {
|
|
2079
|
-
console.warn(
|
|
2180
|
+
console.warn(chalk26.yellow(`Warning: ${message}`));
|
|
2080
2181
|
warnings++;
|
|
2081
2182
|
};
|
|
2082
2183
|
if (gitConfig.core.ignorecase) {
|
|
@@ -2096,13 +2197,13 @@ Gitlint Start [${process.cwd()}]
|
|
|
2096
2197
|
}
|
|
2097
2198
|
const resultMessages = [];
|
|
2098
2199
|
if (valid > 0) {
|
|
2099
|
-
resultMessages.push(
|
|
2200
|
+
resultMessages.push(chalk26.green(`Passed: ${valid}`));
|
|
2100
2201
|
}
|
|
2101
2202
|
if (warnings > 0) {
|
|
2102
|
-
resultMessages.push(
|
|
2203
|
+
resultMessages.push(chalk26.yellow(`Warnings: ${warnings}`));
|
|
2103
2204
|
}
|
|
2104
2205
|
if (errors > 0) {
|
|
2105
|
-
resultMessages.push(
|
|
2206
|
+
resultMessages.push(chalk26.red(` Errors: ${errors}`));
|
|
2106
2207
|
}
|
|
2107
2208
|
console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
|
|
2108
2209
|
`);
|
|
@@ -2111,7 +2212,7 @@ Gitlint Start [${process.cwd()}]
|
|
|
2111
2212
|
|
|
2112
2213
|
// src/actions/gitlint-fix.ts
|
|
2113
2214
|
import { execSync as execSync3 } from "child_process";
|
|
2114
|
-
import
|
|
2215
|
+
import chalk27 from "chalk";
|
|
2115
2216
|
import ParseGitConfig2 from "parse-git-config";
|
|
2116
2217
|
var gitlintFix = () => {
|
|
2117
2218
|
console.log(`
|
|
@@ -2120,15 +2221,15 @@ Gitlint Fix Start [${process.cwd()}]
|
|
|
2120
2221
|
const gitConfig = ParseGitConfig2.sync();
|
|
2121
2222
|
if (gitConfig.core.ignorecase) {
|
|
2122
2223
|
execSync3("git config core.ignorecase false", { stdio: "inherit" });
|
|
2123
|
-
console.warn(
|
|
2224
|
+
console.warn(chalk27.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
|
|
2124
2225
|
}
|
|
2125
2226
|
if (gitConfig.core.autocrlf !== false) {
|
|
2126
2227
|
execSync3("git config core.autocrlf false", { stdio: "inherit" });
|
|
2127
|
-
console.warn(
|
|
2228
|
+
console.warn(chalk27.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
|
|
2128
2229
|
}
|
|
2129
2230
|
if (gitConfig.core.eol !== "lf") {
|
|
2130
2231
|
execSync3("git config core.eol lf", { stdio: "inherit" });
|
|
2131
|
-
console.warn(
|
|
2232
|
+
console.warn(chalk27.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
|
|
2132
2233
|
}
|
|
2133
2234
|
return 1;
|
|
2134
2235
|
};
|
|
@@ -2139,7 +2240,7 @@ var knip = () => {
|
|
|
2139
2240
|
};
|
|
2140
2241
|
|
|
2141
2242
|
// src/actions/license.ts
|
|
2142
|
-
import
|
|
2243
|
+
import chalk28 from "chalk";
|
|
2143
2244
|
import { init } from "license-checker";
|
|
2144
2245
|
var license = async (pkg) => {
|
|
2145
2246
|
const workspaces = yarnWorkspaces();
|
|
@@ -2164,18 +2265,18 @@ var license = async (pkg) => {
|
|
|
2164
2265
|
"LGPL-3.0-or-later",
|
|
2165
2266
|
"Python-2.0"
|
|
2166
2267
|
]);
|
|
2167
|
-
console.log(
|
|
2268
|
+
console.log(chalk28.green("License Checker"));
|
|
2168
2269
|
return (await Promise.all(
|
|
2169
2270
|
workspaceList.map(({ location, name }) => {
|
|
2170
2271
|
return new Promise((resolve) => {
|
|
2171
2272
|
init({ production: true, start: location }, (error, packages) => {
|
|
2172
2273
|
if (error) {
|
|
2173
|
-
console.error(
|
|
2174
|
-
console.error(
|
|
2274
|
+
console.error(chalk28.red(`License Checker [${name}] Error`));
|
|
2275
|
+
console.error(chalk28.gray(error));
|
|
2175
2276
|
console.log("\n");
|
|
2176
2277
|
resolve(1);
|
|
2177
2278
|
} else {
|
|
2178
|
-
console.log(
|
|
2279
|
+
console.log(chalk28.green(`License Checker [${name}]`));
|
|
2179
2280
|
let count = 0;
|
|
2180
2281
|
for (const [name2, info] of Object.entries(packages)) {
|
|
2181
2282
|
const licenses = Array.isArray(info.licenses) ? info.licenses : [info.licenses];
|
|
@@ -2191,7 +2292,7 @@ var license = async (pkg) => {
|
|
|
2191
2292
|
}
|
|
2192
2293
|
if (!orLicenseFound) {
|
|
2193
2294
|
count++;
|
|
2194
|
-
console.warn(
|
|
2295
|
+
console.warn(chalk28.yellow(`${name2}: Package License not allowed [${license2}]`));
|
|
2195
2296
|
}
|
|
2196
2297
|
}
|
|
2197
2298
|
}
|
|
@@ -2211,12 +2312,12 @@ var npmignoreGen = (pkg) => generateIgnoreFiles(filename2, pkg);
|
|
|
2211
2312
|
|
|
2212
2313
|
// src/actions/package/clean-outputs.ts
|
|
2213
2314
|
import path8 from "path";
|
|
2214
|
-
import
|
|
2315
|
+
import chalk29 from "chalk";
|
|
2215
2316
|
var packageCleanOutputs = () => {
|
|
2216
2317
|
const pkg = process.env.INIT_CWD ?? ".";
|
|
2217
2318
|
const pkgName = process.env.npm_package_name;
|
|
2218
2319
|
const folders = [path8.join(pkg, "dist"), path8.join(pkg, "build"), path8.join(pkg, "docs")];
|
|
2219
|
-
console.log(
|
|
2320
|
+
console.log(chalk29.green(`Cleaning Outputs [${pkgName}]`));
|
|
2220
2321
|
for (let folder of folders) {
|
|
2221
2322
|
deleteGlob(folder);
|
|
2222
2323
|
}
|
|
@@ -2225,11 +2326,11 @@ var packageCleanOutputs = () => {
|
|
|
2225
2326
|
|
|
2226
2327
|
// src/actions/package/clean-typescript.ts
|
|
2227
2328
|
import path9 from "path";
|
|
2228
|
-
import
|
|
2329
|
+
import chalk30 from "chalk";
|
|
2229
2330
|
var packageCleanTypescript = () => {
|
|
2230
2331
|
const pkg = process.env.INIT_CWD ?? ".";
|
|
2231
2332
|
const pkgName = process.env.npm_package_name;
|
|
2232
|
-
console.log(
|
|
2333
|
+
console.log(chalk30.green(`Cleaning Typescript [${pkgName}]`));
|
|
2233
2334
|
const files = [path9.join(pkg, "*.tsbuildinfo"), path9.join(pkg, ".tsconfig.*"), path9.join(pkg, ".eslintcache")];
|
|
2234
2335
|
for (let file of files) {
|
|
2235
2336
|
deleteGlob(file);
|
|
@@ -2243,26 +2344,26 @@ var packageClean = async () => {
|
|
|
2243
2344
|
};
|
|
2244
2345
|
|
|
2245
2346
|
// src/actions/package/compile/compile.ts
|
|
2246
|
-
import
|
|
2347
|
+
import chalk35 from "chalk";
|
|
2247
2348
|
|
|
2248
2349
|
// src/actions/package/compile/packageCompileTsup.ts
|
|
2249
|
-
import
|
|
2350
|
+
import chalk34 from "chalk";
|
|
2250
2351
|
import { build as build2, defineConfig } from "tsup";
|
|
2251
2352
|
|
|
2252
2353
|
// src/actions/package/compile/inputs.ts
|
|
2253
|
-
import
|
|
2354
|
+
import chalk31 from "chalk";
|
|
2254
2355
|
import { glob as glob2 } from "glob";
|
|
2255
2356
|
var getAllInputs = (srcDir, verbose = false) => {
|
|
2256
2357
|
return [...glob2.sync(`${srcDir}/**/*.ts`, { posix: true }).map((file) => {
|
|
2257
2358
|
const result = file.slice(Math.max(0, srcDir.length + 1));
|
|
2258
2359
|
if (verbose) {
|
|
2259
|
-
console.log(
|
|
2360
|
+
console.log(chalk31.gray(`getAllInputs: ${JSON.stringify(result, null, 2)}`));
|
|
2260
2361
|
}
|
|
2261
2362
|
return result;
|
|
2262
2363
|
}), ...glob2.sync(`${srcDir}/**/*.tsx`, { posix: true }).map((file) => {
|
|
2263
2364
|
const result = file.slice(Math.max(0, srcDir.length + 1));
|
|
2264
2365
|
if (verbose) {
|
|
2265
|
-
console.log(
|
|
2366
|
+
console.log(chalk31.gray(`getAllInputs: ${JSON.stringify(result, null, 2)}`));
|
|
2266
2367
|
}
|
|
2267
2368
|
return result;
|
|
2268
2369
|
})];
|
|
@@ -2324,7 +2425,7 @@ function deepMergeObjects(objects) {
|
|
|
2324
2425
|
|
|
2325
2426
|
// src/actions/package/compile/packageCompileTsc.ts
|
|
2326
2427
|
import { cwd as cwd2 } from "process";
|
|
2327
|
-
import
|
|
2428
|
+
import chalk32 from "chalk";
|
|
2328
2429
|
import { createProgramFromConfig } from "tsc-prog";
|
|
2329
2430
|
import ts3, {
|
|
2330
2431
|
DiagnosticCategory,
|
|
@@ -2346,7 +2447,7 @@ var getCompilerOptions = (options = {}, fileName = "tsconfig.json") => {
|
|
|
2346
2447
|
var packageCompileTsc = (platform, entries, srcDir = "src", outDir = "dist", compilerOptionsParam, verbose = false) => {
|
|
2347
2448
|
const pkg = process.env.INIT_CWD ?? cwd2();
|
|
2348
2449
|
if (verbose) {
|
|
2349
|
-
console.log(
|
|
2450
|
+
console.log(chalk32.cyan(`Validating code START: ${entries.length} files to ${outDir} from ${srcDir}`));
|
|
2350
2451
|
}
|
|
2351
2452
|
const configFilePath = ts3.findConfigFile(
|
|
2352
2453
|
"./",
|
|
@@ -2369,10 +2470,10 @@ var packageCompileTsc = (platform, entries, srcDir = "src", outDir = "dist", com
|
|
|
2369
2470
|
emitDeclarationOnly: true,
|
|
2370
2471
|
noEmit: false
|
|
2371
2472
|
};
|
|
2372
|
-
console.log(
|
|
2473
|
+
console.log(chalk32.cyan(`Validating Files: ${entries.length}`));
|
|
2373
2474
|
if (verbose) {
|
|
2374
2475
|
for (const entry of entries) {
|
|
2375
|
-
console.log(
|
|
2476
|
+
console.log(chalk32.grey(`Validating: ${entry}`));
|
|
2376
2477
|
}
|
|
2377
2478
|
}
|
|
2378
2479
|
try {
|
|
@@ -2408,7 +2509,7 @@ var packageCompileTsc = (platform, entries, srcDir = "src", outDir = "dist", com
|
|
|
2408
2509
|
return 0;
|
|
2409
2510
|
} finally {
|
|
2410
2511
|
if (verbose) {
|
|
2411
|
-
console.log(
|
|
2512
|
+
console.log(chalk32.cyan(`Validating code FINISH: ${entries.length} files to ${outDir} from ${srcDir}`));
|
|
2412
2513
|
}
|
|
2413
2514
|
}
|
|
2414
2515
|
};
|
|
@@ -2416,7 +2517,7 @@ var packageCompileTsc = (platform, entries, srcDir = "src", outDir = "dist", com
|
|
|
2416
2517
|
// src/actions/package/compile/packageCompileTscTypes.ts
|
|
2417
2518
|
import path10 from "path";
|
|
2418
2519
|
import { cwd as cwd3 } from "process";
|
|
2419
|
-
import
|
|
2520
|
+
import chalk33 from "chalk";
|
|
2420
2521
|
import { rollup } from "rollup";
|
|
2421
2522
|
import dts from "rollup-plugin-dts";
|
|
2422
2523
|
import nodeExternals from "rollup-plugin-node-externals";
|
|
@@ -2441,8 +2542,8 @@ async function bundleDts(inputPath, outputPath, platform, options, verbose = fal
|
|
|
2441
2542
|
if (ignoredWarningCodes.has(warning.code ?? "")) {
|
|
2442
2543
|
return;
|
|
2443
2544
|
}
|
|
2444
|
-
console.warn(
|
|
2445
|
-
console.warn(
|
|
2545
|
+
console.warn(chalk33.yellow(`[${warning.code}] ${warning.message}`));
|
|
2546
|
+
console.warn(chalk33.gray(inputPath));
|
|
2446
2547
|
warn(warning);
|
|
2447
2548
|
}
|
|
2448
2549
|
});
|
|
@@ -2452,8 +2553,8 @@ async function bundleDts(inputPath, outputPath, platform, options, verbose = fal
|
|
|
2452
2553
|
});
|
|
2453
2554
|
} catch (ex) {
|
|
2454
2555
|
const error = ex;
|
|
2455
|
-
console.warn(
|
|
2456
|
-
console.warn(
|
|
2556
|
+
console.warn(chalk33.red(error));
|
|
2557
|
+
console.warn(chalk33.gray(inputPath));
|
|
2457
2558
|
}
|
|
2458
2559
|
if (verbose) {
|
|
2459
2560
|
console.log(`Bundled declarations written to ${outputPath}`);
|
|
@@ -2461,7 +2562,7 @@ async function bundleDts(inputPath, outputPath, platform, options, verbose = fal
|
|
|
2461
2562
|
}
|
|
2462
2563
|
var packageCompileTscTypes = async (entries, outDir, platform, srcDir = "build", verbose = false) => {
|
|
2463
2564
|
if (verbose) {
|
|
2464
|
-
console.log(
|
|
2565
|
+
console.log(chalk33.cyan(`Compiling Types START [${platform}]: ${entries.length} files to ${outDir} from ${srcDir}`));
|
|
2465
2566
|
console.log(`Entries: ${entries.join(", ")}`);
|
|
2466
2567
|
}
|
|
2467
2568
|
const pkg = process.env.INIT_CWD ?? cwd3();
|
|
@@ -2485,7 +2586,7 @@ var packageCompileTscTypes = async (entries, outDir, platform, srcDir = "build",
|
|
|
2485
2586
|
await bundleDts(`${srcRoot}/${entryTypeName}`, `${outDir}/${entryTypeName}`, platform, { compilerOptions }, verbose);
|
|
2486
2587
|
}));
|
|
2487
2588
|
if (verbose) {
|
|
2488
|
-
console.log(
|
|
2589
|
+
console.log(chalk33.cyan(`Compiling Types FINISH: ${entries.length} files to ${outDir} from ${srcDir}`));
|
|
2489
2590
|
}
|
|
2490
2591
|
return 0;
|
|
2491
2592
|
};
|
|
@@ -2497,15 +2598,15 @@ var compileFolder = async (srcDir, entries, buildDir, options, bundleTypes = fal
|
|
|
2497
2598
|
console.log(`compileFolder [${srcDir}, ${options?.outDir}]`);
|
|
2498
2599
|
}
|
|
2499
2600
|
if (entries.length === 0) {
|
|
2500
|
-
console.warn(
|
|
2601
|
+
console.warn(chalk34.yellow(`No entries found in ${srcDir} to compile`));
|
|
2501
2602
|
return 0;
|
|
2502
2603
|
}
|
|
2503
2604
|
if (verbose) {
|
|
2504
|
-
console.log(
|
|
2605
|
+
console.log(chalk34.gray(`buildDir [${buildDir}]`));
|
|
2505
2606
|
}
|
|
2506
2607
|
const validationResult = packageCompileTsc(options?.platform ?? "neutral", entries, srcDir, buildDir, void 0, verbose);
|
|
2507
2608
|
if (validationResult !== 0) {
|
|
2508
|
-
console.error(
|
|
2609
|
+
console.error(chalk34.red(`Compile:Validation had ${validationResult} errors`));
|
|
2509
2610
|
return validationResult;
|
|
2510
2611
|
}
|
|
2511
2612
|
const optionsParams = tsupOptions([{
|
|
@@ -2530,12 +2631,12 @@ var compileFolder = async (srcDir, entries, buildDir, options, bundleTypes = fal
|
|
|
2530
2631
|
})
|
|
2531
2632
|
)).flat();
|
|
2532
2633
|
if (verbose) {
|
|
2533
|
-
console.log(
|
|
2534
|
-
console.log(
|
|
2634
|
+
console.log(chalk34.cyan(`TSUP:build:start [${srcDir}]`));
|
|
2635
|
+
console.log(chalk34.gray(`TSUP:build:options [${JSON.stringify(optionsList, null, 2)}]`));
|
|
2535
2636
|
}
|
|
2536
2637
|
await Promise.all(optionsList.map((options2) => build2(options2)));
|
|
2537
2638
|
if (verbose) {
|
|
2538
|
-
console.log(
|
|
2639
|
+
console.log(chalk34.cyan(`TSUP:build:stop [${srcDir}]`));
|
|
2539
2640
|
}
|
|
2540
2641
|
if (bundleTypes) {
|
|
2541
2642
|
await packageCompileTscTypes(entries, outDir, options?.platform ?? "neutral", buildDir, verbose);
|
|
@@ -2646,14 +2747,14 @@ var packageCompileTsup = async (config2) => {
|
|
|
2646
2747
|
// src/actions/package/compile/compile.ts
|
|
2647
2748
|
var packageCompile = async (inConfig = {}) => {
|
|
2648
2749
|
const pkg = process.env.INIT_CWD;
|
|
2649
|
-
console.log(
|
|
2750
|
+
console.log(chalk35.green(`Compiling ${pkg}`));
|
|
2650
2751
|
const config2 = await loadConfig(inConfig);
|
|
2651
2752
|
return await packageCompileTsup(config2);
|
|
2652
2753
|
};
|
|
2653
2754
|
|
|
2654
2755
|
// src/actions/package/copy-assets.ts
|
|
2655
2756
|
import path11 from "path/posix";
|
|
2656
|
-
import
|
|
2757
|
+
import chalk36 from "chalk";
|
|
2657
2758
|
import cpy2 from "cpy";
|
|
2658
2759
|
var copyTargetAssets2 = async (target, name, location) => {
|
|
2659
2760
|
try {
|
|
@@ -2666,7 +2767,7 @@ var copyTargetAssets2 = async (target, name, location) => {
|
|
|
2666
2767
|
}
|
|
2667
2768
|
);
|
|
2668
2769
|
if (values.length > 0) {
|
|
2669
|
-
console.log(
|
|
2770
|
+
console.log(chalk36.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
|
|
2670
2771
|
}
|
|
2671
2772
|
for (const value of values) {
|
|
2672
2773
|
console.log(`${value.split("/").pop()} => ./dist/${target}`);
|
|
@@ -2731,9 +2832,9 @@ var packageCycle = async () => {
|
|
|
2731
2832
|
};
|
|
2732
2833
|
|
|
2733
2834
|
// src/actions/package/gen-docs.ts
|
|
2734
|
-
import { existsSync as
|
|
2835
|
+
import { existsSync as existsSync9 } from "fs";
|
|
2735
2836
|
import path12 from "path";
|
|
2736
|
-
import
|
|
2837
|
+
import chalk37 from "chalk";
|
|
2737
2838
|
import {
|
|
2738
2839
|
Application,
|
|
2739
2840
|
ArgumentsReader,
|
|
@@ -2751,7 +2852,7 @@ var ExitCodes = {
|
|
|
2751
2852
|
};
|
|
2752
2853
|
var packageGenDocs = async () => {
|
|
2753
2854
|
const pkg = process.env.INIT_CWD;
|
|
2754
|
-
if (pkg !== void 0 && !
|
|
2855
|
+
if (pkg !== void 0 && !existsSync9(path12.join(pkg, "typedoc.json"))) {
|
|
2755
2856
|
return;
|
|
2756
2857
|
}
|
|
2757
2858
|
const app = await Application.bootstrap({
|
|
@@ -2837,16 +2938,16 @@ var runTypeDoc = async (app) => {
|
|
|
2837
2938
|
return ExitCodes.OutputError;
|
|
2838
2939
|
}
|
|
2839
2940
|
}
|
|
2840
|
-
console.log(
|
|
2941
|
+
console.log(chalk37.green(`${pkgName} - Ok`));
|
|
2841
2942
|
return ExitCodes.Ok;
|
|
2842
2943
|
};
|
|
2843
2944
|
|
|
2844
2945
|
// src/actions/package/lint.ts
|
|
2845
|
-
import { readdirSync as
|
|
2946
|
+
import { readdirSync as readdirSync5 } from "fs";
|
|
2846
2947
|
import path13 from "path";
|
|
2847
2948
|
import { cwd as cwd4 } from "process";
|
|
2848
2949
|
import { pathToFileURL } from "url";
|
|
2849
|
-
import
|
|
2950
|
+
import chalk38 from "chalk";
|
|
2850
2951
|
import { ESLint } from "eslint";
|
|
2851
2952
|
import { findUp } from "find-up";
|
|
2852
2953
|
import picomatch from "picomatch";
|
|
@@ -2855,14 +2956,14 @@ var dumpMessages = (lintResults) => {
|
|
|
2855
2956
|
const severity = ["none", "warning", "error"];
|
|
2856
2957
|
for (const lintResult of lintResults) {
|
|
2857
2958
|
if (lintResult.messages.length > 0) {
|
|
2858
|
-
console.log(
|
|
2959
|
+
console.log(chalk38.gray(`
|
|
2859
2960
|
${lintResult.filePath}`));
|
|
2860
2961
|
for (const message of lintResult.messages) {
|
|
2861
2962
|
console.log(
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2963
|
+
chalk38.gray(` ${message.line}:${message.column}`),
|
|
2964
|
+
chalk38[colors[message.severity]](` ${severity[message.severity]}`),
|
|
2965
|
+
chalk38.white(` ${message.message}`),
|
|
2966
|
+
chalk38.gray(` ${message.ruleId}`)
|
|
2866
2967
|
);
|
|
2867
2968
|
}
|
|
2868
2969
|
}
|
|
@@ -2879,7 +2980,7 @@ function getFiles(dir, ignoreFolders) {
|
|
|
2879
2980
|
const currentDirectory = cwd4();
|
|
2880
2981
|
const subDirectory = dir.split(currentDirectory)[1]?.split("/")[1];
|
|
2881
2982
|
if (ignoreFolders.includes(subDirectory)) return [];
|
|
2882
|
-
return
|
|
2983
|
+
return readdirSync5(dir, { withFileTypes: true }).flatMap((dirent) => {
|
|
2883
2984
|
const res = path13.resolve(dir, dirent.name);
|
|
2884
2985
|
const relativePath = subDirectory === void 0 ? dirent.name : `${subDirectory}/${dirent.name}`;
|
|
2885
2986
|
const ignoreMatchers = ignoreFolders.map((pattern) => picomatch(pattern));
|
|
@@ -2900,10 +3001,10 @@ var packageLint = async (fix2 = false, verbose = false, cache = true) => {
|
|
|
2900
3001
|
cache
|
|
2901
3002
|
});
|
|
2902
3003
|
const files = getFiles(cwd4(), ignoreFolders);
|
|
2903
|
-
console.log(
|
|
3004
|
+
console.log(chalk38.green(`Linting ${pkg} [files = ${files.length}]`));
|
|
2904
3005
|
if (verbose) {
|
|
2905
3006
|
for (const file of files) {
|
|
2906
|
-
console.log(
|
|
3007
|
+
console.log(chalk38.gray(` ${file}`));
|
|
2907
3008
|
}
|
|
2908
3009
|
}
|
|
2909
3010
|
const lintResults = await engine.lintFiles(files);
|
|
@@ -2914,32 +3015,32 @@ var packageLint = async (fix2 = false, verbose = false, cache = true) => {
|
|
|
2914
3015
|
const filesCountColor = files.length < 100 ? "green" : files.length < 1e3 ? "yellow" : "red";
|
|
2915
3016
|
const lintTime = Date.now() - start;
|
|
2916
3017
|
const lintTimeColor = lintTime < 1e3 ? "green" : lintTime < 3e3 ? "yellow" : "red";
|
|
2917
|
-
console.log(
|
|
3018
|
+
console.log(chalk38.white(`Linted ${chalk38[filesCountColor](files.length)} files in ${chalk38[lintTimeColor](lintTime)}ms`));
|
|
2918
3019
|
return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
|
|
2919
3020
|
};
|
|
2920
3021
|
|
|
2921
3022
|
// src/actions/package/publint.ts
|
|
2922
3023
|
import { promises as fs10 } from "fs";
|
|
2923
|
-
import
|
|
3024
|
+
import chalk39 from "chalk";
|
|
2924
3025
|
import sortPackageJson from "sort-package-json";
|
|
2925
3026
|
var customPubLint = (pkg) => {
|
|
2926
3027
|
let errorCount = 0;
|
|
2927
3028
|
let warningCount = 0;
|
|
2928
3029
|
if (pkg.files === void 0) {
|
|
2929
|
-
console.warn(
|
|
3030
|
+
console.warn(chalk39.yellow('Publint [custom]: "files" field is missing'));
|
|
2930
3031
|
warningCount++;
|
|
2931
3032
|
}
|
|
2932
3033
|
if (pkg.main !== void 0) {
|
|
2933
|
-
console.warn(
|
|
3034
|
+
console.warn(chalk39.yellow('Publint [custom]: "main" field is deprecated, use "exports" instead'));
|
|
2934
3035
|
warningCount++;
|
|
2935
3036
|
}
|
|
2936
3037
|
if (pkg.sideEffects !== false) {
|
|
2937
|
-
console.warn(
|
|
3038
|
+
console.warn(chalk39.yellow('Publint [custom]: "sideEffects" field should be set to false'));
|
|
2938
3039
|
warningCount++;
|
|
2939
3040
|
}
|
|
2940
3041
|
if (pkg.resolutions !== void 0) {
|
|
2941
|
-
console.warn(
|
|
2942
|
-
console.warn(
|
|
3042
|
+
console.warn(chalk39.yellow('Publint [custom]: "resolutions" in use'));
|
|
3043
|
+
console.warn(chalk39.gray(JSON.stringify(pkg.resolutions, null, 2)));
|
|
2943
3044
|
warningCount++;
|
|
2944
3045
|
}
|
|
2945
3046
|
return [errorCount, warningCount];
|
|
@@ -2949,8 +3050,8 @@ var packagePublint = async ({ strict = true, verbose = false } = {}) => {
|
|
|
2949
3050
|
const sortedPkg = sortPackageJson(await fs10.readFile(`${pkgDir}/package.json`, "utf8"));
|
|
2950
3051
|
await fs10.writeFile(`${pkgDir}/package.json`, sortedPkg);
|
|
2951
3052
|
const pkg = JSON.parse(await fs10.readFile(`${pkgDir}/package.json`, "utf8"));
|
|
2952
|
-
console.log(
|
|
2953
|
-
console.log(
|
|
3053
|
+
console.log(chalk39.green(`Publint: ${pkg.name}`));
|
|
3054
|
+
console.log(chalk39.gray(pkgDir));
|
|
2954
3055
|
const { publint: publint2 } = await import("publint");
|
|
2955
3056
|
const { messages } = await publint2({
|
|
2956
3057
|
level: "suggestion",
|
|
@@ -2961,22 +3062,22 @@ var packagePublint = async ({ strict = true, verbose = false } = {}) => {
|
|
|
2961
3062
|
for (const message of messages) {
|
|
2962
3063
|
switch (message.type) {
|
|
2963
3064
|
case "error": {
|
|
2964
|
-
console.error(
|
|
3065
|
+
console.error(chalk39.red(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
2965
3066
|
break;
|
|
2966
3067
|
}
|
|
2967
3068
|
case "warning": {
|
|
2968
|
-
console.warn(
|
|
3069
|
+
console.warn(chalk39.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
2969
3070
|
break;
|
|
2970
3071
|
}
|
|
2971
3072
|
default: {
|
|
2972
|
-
console.log(
|
|
3073
|
+
console.log(chalk39.white(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
2973
3074
|
break;
|
|
2974
3075
|
}
|
|
2975
3076
|
}
|
|
2976
3077
|
}
|
|
2977
3078
|
const [errorCount, warningCount] = customPubLint(pkg);
|
|
2978
3079
|
if (verbose) {
|
|
2979
|
-
console.log(
|
|
3080
|
+
console.log(chalk39.gray(`Publint [Finish]: ${pkgDir} [${messages.length + errorCount + warningCount} messages]`));
|
|
2980
3081
|
}
|
|
2981
3082
|
return messages.filter((message) => message.type === "error").length + errorCount;
|
|
2982
3083
|
};
|
|
@@ -3039,7 +3140,7 @@ var rebuild = ({ target }) => {
|
|
|
3039
3140
|
};
|
|
3040
3141
|
|
|
3041
3142
|
// src/actions/recompile.ts
|
|
3042
|
-
import
|
|
3143
|
+
import chalk40 from "chalk";
|
|
3043
3144
|
var recompile = async ({
|
|
3044
3145
|
verbose,
|
|
3045
3146
|
target,
|
|
@@ -3075,7 +3176,7 @@ var recompileAll = async ({
|
|
|
3075
3176
|
const incrementalOptions = incremental ? ["--since", "-Apt", "--topological-dev"] : ["--parallel", "-Apt", "--topological-dev"];
|
|
3076
3177
|
const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
|
|
3077
3178
|
if (jobs) {
|
|
3078
|
-
console.log(
|
|
3179
|
+
console.log(chalk40.blue(`Jobs set to [${jobs}]`));
|
|
3079
3180
|
}
|
|
3080
3181
|
const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
|
|
3081
3182
|
[
|
|
@@ -3106,7 +3207,7 @@ var recompileAll = async ({
|
|
|
3106
3207
|
]
|
|
3107
3208
|
]);
|
|
3108
3209
|
console.log(
|
|
3109
|
-
`${
|
|
3210
|
+
`${chalk40.gray("Recompiled in")} [${chalk40.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk40.gray("seconds")}`
|
|
3110
3211
|
);
|
|
3111
3212
|
return result;
|
|
3112
3213
|
};
|
|
@@ -3115,7 +3216,7 @@ var recompileAll = async ({
|
|
|
3115
3216
|
import {
|
|
3116
3217
|
closeSync,
|
|
3117
3218
|
openSync,
|
|
3118
|
-
rmSync
|
|
3219
|
+
rmSync as rmSync2
|
|
3119
3220
|
} from "fs";
|
|
3120
3221
|
var reinstall = () => {
|
|
3121
3222
|
console.log("Reinstall [Clear Lock File]");
|
|
@@ -3125,7 +3226,7 @@ var reinstall = () => {
|
|
|
3125
3226
|
const result = workspaces.map(({ location, name }) => {
|
|
3126
3227
|
const dist = `${location}/node_modules`;
|
|
3127
3228
|
try {
|
|
3128
|
-
|
|
3229
|
+
rmSync2(dist, { force: true, recursive: true });
|
|
3129
3230
|
return 0;
|
|
3130
3231
|
} catch (ex) {
|
|
3131
3232
|
const error = ex;
|
|
@@ -3137,13 +3238,13 @@ var reinstall = () => {
|
|
|
3137
3238
|
};
|
|
3138
3239
|
|
|
3139
3240
|
// src/actions/relint.ts
|
|
3140
|
-
import
|
|
3241
|
+
import chalk41 from "chalk";
|
|
3141
3242
|
var relintPackage = ({
|
|
3142
3243
|
pkg,
|
|
3143
3244
|
fix: fix2,
|
|
3144
3245
|
verbose
|
|
3145
3246
|
}) => {
|
|
3146
|
-
console.log(
|
|
3247
|
+
console.log(chalk41.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
|
|
3147
3248
|
const start = Date.now();
|
|
3148
3249
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
|
|
3149
3250
|
["yarn", [
|
|
@@ -3153,7 +3254,7 @@ var relintPackage = ({
|
|
|
3153
3254
|
fix2 ? "package-fix" : verbose ? "package-lint-verbose" : "package-lint"
|
|
3154
3255
|
]]
|
|
3155
3256
|
]);
|
|
3156
|
-
console.log(
|
|
3257
|
+
console.log(chalk41.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk41.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk41.gray("seconds")}`));
|
|
3157
3258
|
return result;
|
|
3158
3259
|
};
|
|
3159
3260
|
var relint = ({
|
|
@@ -3173,13 +3274,13 @@ var relint = ({
|
|
|
3173
3274
|
});
|
|
3174
3275
|
};
|
|
3175
3276
|
var relintAllPackages = ({ fix: fix2 = false } = {}) => {
|
|
3176
|
-
console.log(
|
|
3277
|
+
console.log(chalk41.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
|
|
3177
3278
|
const start = Date.now();
|
|
3178
3279
|
const fixOptions = fix2 ? ["--fix"] : [];
|
|
3179
3280
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
|
|
3180
3281
|
["yarn", ["eslint", ...fixOptions]]
|
|
3181
3282
|
]);
|
|
3182
|
-
console.log(
|
|
3283
|
+
console.log(chalk41.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk41.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk41.gray("seconds")}`));
|
|
3183
3284
|
return result;
|
|
3184
3285
|
};
|
|
3185
3286
|
|
|
@@ -3197,10 +3298,10 @@ var sonar = () => {
|
|
|
3197
3298
|
};
|
|
3198
3299
|
|
|
3199
3300
|
// src/actions/statics.ts
|
|
3200
|
-
import
|
|
3301
|
+
import chalk42 from "chalk";
|
|
3201
3302
|
var DefaultDependencies = ["axios", "@xylabs/pixel", "react", "graphql", "react-router", "@mui/material", "@mui/system"];
|
|
3202
3303
|
var statics = () => {
|
|
3203
|
-
console.log(
|
|
3304
|
+
console.log(chalk42.green("Check Required Static Dependencies"));
|
|
3204
3305
|
const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
|
|
3205
3306
|
return detectDuplicateDependencies(statics2, DefaultDependencies);
|
|
3206
3307
|
};
|
|
@@ -3256,13 +3357,18 @@ var loadPackageConfig = async () => {
|
|
|
3256
3357
|
return JSON.parse(pkgConfig);
|
|
3257
3358
|
};
|
|
3258
3359
|
|
|
3259
|
-
// src/xy/
|
|
3360
|
+
// src/xy/param.ts
|
|
3361
|
+
var packagePositionalParam = (yargs2) => {
|
|
3362
|
+
return yargs2.positional("package", { describe: "Specific package to target", type: "string" });
|
|
3363
|
+
};
|
|
3364
|
+
|
|
3365
|
+
// src/xy/build-commands/build.ts
|
|
3260
3366
|
var buildCommand = {
|
|
3261
|
-
command: "build [package]",
|
|
3262
|
-
describe: "Build - Compile & Lint",
|
|
3263
3367
|
builder: (yargs2) => {
|
|
3264
|
-
return yargs2
|
|
3368
|
+
return packagePositionalParam(yargs2);
|
|
3265
3369
|
},
|
|
3370
|
+
command: "build [package]",
|
|
3371
|
+
describe: "Build - Compile & Lint",
|
|
3266
3372
|
handler: async (argv) => {
|
|
3267
3373
|
if (argv.verbose) {
|
|
3268
3374
|
console.log(`Building: ${argv.package ?? "all"}`);
|
|
@@ -3276,14 +3382,12 @@ var buildCommand = {
|
|
|
3276
3382
|
});
|
|
3277
3383
|
}
|
|
3278
3384
|
};
|
|
3279
|
-
|
|
3280
|
-
// src/xy/build/compileCommand.ts
|
|
3281
3385
|
var compileCommand = {
|
|
3282
|
-
command: "compile [package]",
|
|
3283
|
-
describe: "Compile with Typescript & Copy Images",
|
|
3284
3386
|
builder: (yargs2) => {
|
|
3285
|
-
return yargs2
|
|
3387
|
+
return packagePositionalParam(yargs2);
|
|
3286
3388
|
},
|
|
3389
|
+
command: "compile [package]",
|
|
3390
|
+
describe: "Compile with Typescript & Copy Images",
|
|
3287
3391
|
handler: (argv) => {
|
|
3288
3392
|
if (argv.verbose) {
|
|
3289
3393
|
console.log(`Compiling: ${argv.package ?? "all"}`);
|
|
@@ -3297,14 +3401,12 @@ var compileCommand = {
|
|
|
3297
3401
|
});
|
|
3298
3402
|
}
|
|
3299
3403
|
};
|
|
3300
|
-
|
|
3301
|
-
// src/xy/build/compileOnlyCommand.ts
|
|
3302
3404
|
var compileOnlyCommand = {
|
|
3303
|
-
command: "compile-only [package]",
|
|
3304
|
-
describe: "Compile with Typescript & Copy Images (No Publint)",
|
|
3305
3405
|
builder: (yargs2) => {
|
|
3306
|
-
return yargs2
|
|
3406
|
+
return packagePositionalParam(yargs2);
|
|
3307
3407
|
},
|
|
3408
|
+
command: "compile-only [package]",
|
|
3409
|
+
describe: "Compile with Typescript & Copy Images (No Publint)",
|
|
3308
3410
|
handler: (argv) => {
|
|
3309
3411
|
if (argv.verbose) {
|
|
3310
3412
|
console.log(`Compiling: ${argv.package ?? "all"}`);
|
|
@@ -3319,57 +3421,51 @@ var compileOnlyCommand = {
|
|
|
3319
3421
|
});
|
|
3320
3422
|
}
|
|
3321
3423
|
};
|
|
3322
|
-
|
|
3323
|
-
// src/xy/build/copyAssetsCommand.ts
|
|
3324
|
-
var copyAssetsCommand = {
|
|
3325
|
-
command: "copy-assets [package]",
|
|
3326
|
-
describe: "Copy Assets - Copy the assets from src to dist",
|
|
3424
|
+
var recompileCommand = {
|
|
3327
3425
|
builder: (yargs2) => {
|
|
3328
|
-
return yargs2
|
|
3426
|
+
return packagePositionalParam(yargs2);
|
|
3329
3427
|
},
|
|
3428
|
+
command: "recompile [package]",
|
|
3429
|
+
describe: "Re-compile with Typescript & Copy Images",
|
|
3330
3430
|
handler: async (argv) => {
|
|
3331
|
-
if (argv.verbose)
|
|
3332
|
-
|
|
3431
|
+
if (argv.verbose) {
|
|
3432
|
+
console.log(`Re-compiling: ${argv.package ?? "all"}`);
|
|
3433
|
+
}
|
|
3434
|
+
process.exitCode = await recompile({
|
|
3435
|
+
incremental: !!argv.incremental,
|
|
3436
|
+
jobs: argv.jobs,
|
|
3437
|
+
pkg: argv.package,
|
|
3438
|
+
target: argv.target,
|
|
3439
|
+
verbose: !!argv.verbose
|
|
3440
|
+
});
|
|
3333
3441
|
}
|
|
3334
3442
|
};
|
|
3335
|
-
|
|
3336
|
-
// src/xy/build/rebuildCommand.ts
|
|
3337
3443
|
var rebuildCommand = {
|
|
3338
|
-
command: "rebuild [package]",
|
|
3339
|
-
describe: "Rebuild - Clean, Compile & Lint",
|
|
3340
3444
|
builder: (yargs2) => {
|
|
3341
|
-
return yargs2
|
|
3445
|
+
return packagePositionalParam(yargs2);
|
|
3342
3446
|
},
|
|
3447
|
+
command: "rebuild [package]",
|
|
3448
|
+
describe: "Rebuild - Clean, Compile & Lint",
|
|
3343
3449
|
handler: (argv) => {
|
|
3344
3450
|
if (argv.verbose) console.log(`Rebuilding: ${argv.package ?? "all"}`);
|
|
3345
3451
|
process.exitCode = rebuild({ target: argv.target });
|
|
3346
3452
|
}
|
|
3347
3453
|
};
|
|
3348
|
-
|
|
3349
|
-
// src/xy/build/recompileCommand.ts
|
|
3350
|
-
var recompileCommand = {
|
|
3351
|
-
command: "recompile [package]",
|
|
3352
|
-
describe: "Re-compile with Typescript & Copy Images",
|
|
3454
|
+
var copyAssetsCommand = {
|
|
3353
3455
|
builder: (yargs2) => {
|
|
3354
|
-
return yargs2
|
|
3456
|
+
return packagePositionalParam(yargs2);
|
|
3355
3457
|
},
|
|
3458
|
+
command: "copy-assets [package]",
|
|
3459
|
+
describe: "Copy Assets - Copy the assets from src to dist",
|
|
3356
3460
|
handler: async (argv) => {
|
|
3357
|
-
if (argv.verbose) {
|
|
3358
|
-
|
|
3359
|
-
}
|
|
3360
|
-
process.exitCode = await recompile({
|
|
3361
|
-
incremental: !!argv.incremental,
|
|
3362
|
-
jobs: argv.jobs,
|
|
3363
|
-
pkg: argv.package,
|
|
3364
|
-
target: argv.target,
|
|
3365
|
-
verbose: !!argv.verbose
|
|
3366
|
-
});
|
|
3461
|
+
if (argv.verbose) console.log(`Copying Assets: ${argv.package ?? "all"}`);
|
|
3462
|
+
process.exitCode = await copyAssets({ target: argv.target });
|
|
3367
3463
|
}
|
|
3368
3464
|
};
|
|
3369
3465
|
|
|
3370
|
-
// src/xy/build/index.ts
|
|
3466
|
+
// src/xy/build-commands/index.ts
|
|
3371
3467
|
var xyBuildCommands = (args) => {
|
|
3372
|
-
return args.command(buildCommand).command(compileCommand).command(compileOnlyCommand).command(
|
|
3468
|
+
return args.command(buildCommand).command(compileCommand).command(compileOnlyCommand).command(rebuildCommand).command(recompileCommand).command(copyAssetsCommand);
|
|
3373
3469
|
};
|
|
3374
3470
|
|
|
3375
3471
|
// src/xy/common/claude/commandsCommand.ts
|
|
@@ -3402,6 +3498,14 @@ var initCommand = {
|
|
|
3402
3498
|
process.exitCode = commandsResult || rulesResult || settingsResult;
|
|
3403
3499
|
}
|
|
3404
3500
|
};
|
|
3501
|
+
var initClaudeSkillsCommand = {
|
|
3502
|
+
command: "init:skills",
|
|
3503
|
+
describe: "Initialize Claude skills configuration",
|
|
3504
|
+
handler: () => {
|
|
3505
|
+
const result = claudeSkills();
|
|
3506
|
+
process.exitCode = result;
|
|
3507
|
+
}
|
|
3508
|
+
};
|
|
3405
3509
|
|
|
3406
3510
|
// src/xy/common/claude/rulesCommand.ts
|
|
3407
3511
|
var rulesCommand = {
|
|
@@ -3434,7 +3538,7 @@ var settingsCommand = {
|
|
|
3434
3538
|
// src/xy/common/claude/index.ts
|
|
3435
3539
|
var claudeCommand = {
|
|
3436
3540
|
builder: (yargs2) => {
|
|
3437
|
-
return yargs2.command(commandsCommand).command(initCommand).command(rulesCommand).command(settingsCommand).demandCommand(1, "Please specify a claude subcommand");
|
|
3541
|
+
return yargs2.command(commandsCommand).command(initCommand).command(rulesCommand).command(settingsCommand).command(initClaudeSkillsCommand).demandCommand(1, "Please specify a claude subcommand");
|
|
3438
3542
|
},
|
|
3439
3543
|
command: "claude",
|
|
3440
3544
|
describe: "Claude - Claude Code configuration utilities",
|
|
@@ -3452,11 +3556,6 @@ var cleanDocsCommand = {
|
|
|
3452
3556
|
}
|
|
3453
3557
|
};
|
|
3454
3558
|
|
|
3455
|
-
// src/xy/param.ts
|
|
3456
|
-
var packagePositionalParam = (yargs2) => {
|
|
3457
|
-
return yargs2.positional("package", { describe: "Specific package to target", type: "string" });
|
|
3458
|
-
};
|
|
3459
|
-
|
|
3460
3559
|
// src/xy/common/deadCommand.ts
|
|
3461
3560
|
var deadCommand = {
|
|
3462
3561
|
builder: (yargs2) => {
|
|
@@ -3768,7 +3867,7 @@ var xyInstallCommands = (args) => {
|
|
|
3768
3867
|
};
|
|
3769
3868
|
|
|
3770
3869
|
// src/xy/lint/cycleCommand.ts
|
|
3771
|
-
import
|
|
3870
|
+
import chalk43 from "chalk";
|
|
3772
3871
|
var cycleCommand = {
|
|
3773
3872
|
command: "cycle [package]",
|
|
3774
3873
|
describe: "Cycle - Check for dependency cycles",
|
|
@@ -3779,12 +3878,12 @@ var cycleCommand = {
|
|
|
3779
3878
|
const start = Date.now();
|
|
3780
3879
|
if (argv.verbose) console.log("Cycle");
|
|
3781
3880
|
process.exitCode = await cycle({ pkg: argv.package });
|
|
3782
|
-
console.log(
|
|
3881
|
+
console.log(chalk43.blue(`Finished in ${Date.now() - start}ms`));
|
|
3783
3882
|
}
|
|
3784
3883
|
};
|
|
3785
3884
|
|
|
3786
3885
|
// src/xy/lint/deplintCommand.ts
|
|
3787
|
-
import
|
|
3886
|
+
import chalk44 from "chalk";
|
|
3788
3887
|
var deplintCommand = {
|
|
3789
3888
|
command: "deplint [package]",
|
|
3790
3889
|
describe: "Deplint - Run Deplint",
|
|
@@ -3822,12 +3921,12 @@ var deplintCommand = {
|
|
|
3822
3921
|
peerDeps: !!argv.peerDeps,
|
|
3823
3922
|
verbose: !!argv.verbose
|
|
3824
3923
|
});
|
|
3825
|
-
console.log(
|
|
3924
|
+
console.log(chalk44.blue(`Finished in ${Date.now() - start}ms`));
|
|
3826
3925
|
}
|
|
3827
3926
|
};
|
|
3828
3927
|
|
|
3829
3928
|
// src/xy/lint/fixCommand.ts
|
|
3830
|
-
import
|
|
3929
|
+
import chalk45 from "chalk";
|
|
3831
3930
|
var fixCommand = {
|
|
3832
3931
|
command: "fix [package]",
|
|
3833
3932
|
describe: "Fix - Run Eslint w/fix",
|
|
@@ -3838,12 +3937,12 @@ var fixCommand = {
|
|
|
3838
3937
|
const start = Date.now();
|
|
3839
3938
|
if (argv.verbose) console.log("Fix");
|
|
3840
3939
|
process.exitCode = fix();
|
|
3841
|
-
console.log(
|
|
3940
|
+
console.log(chalk45.blue(`Finished in ${Date.now() - start}ms`));
|
|
3842
3941
|
}
|
|
3843
3942
|
};
|
|
3844
3943
|
|
|
3845
3944
|
// src/xy/lint/knipCommand.ts
|
|
3846
|
-
import
|
|
3945
|
+
import chalk46 from "chalk";
|
|
3847
3946
|
var knipCommand = {
|
|
3848
3947
|
command: "knip",
|
|
3849
3948
|
describe: "Knip - Run Knip",
|
|
@@ -3854,12 +3953,12 @@ var knipCommand = {
|
|
|
3854
3953
|
if (argv.verbose) console.log("Knip");
|
|
3855
3954
|
const start = Date.now();
|
|
3856
3955
|
process.exitCode = knip();
|
|
3857
|
-
console.log(
|
|
3956
|
+
console.log(chalk46.blue(`Knip finished in ${Date.now() - start}ms`));
|
|
3858
3957
|
}
|
|
3859
3958
|
};
|
|
3860
3959
|
|
|
3861
3960
|
// src/xy/lint/lintCommand.ts
|
|
3862
|
-
import
|
|
3961
|
+
import chalk47 from "chalk";
|
|
3863
3962
|
var lintCommand = {
|
|
3864
3963
|
command: "lint [package]",
|
|
3865
3964
|
describe: "Lint - Run Eslint",
|
|
@@ -3888,12 +3987,12 @@ var lintCommand = {
|
|
|
3888
3987
|
cache: argv.cache,
|
|
3889
3988
|
verbose: !!argv.verbose
|
|
3890
3989
|
});
|
|
3891
|
-
console.log(
|
|
3990
|
+
console.log(chalk47.blue(`Finished in ${Date.now() - start}ms`));
|
|
3892
3991
|
}
|
|
3893
3992
|
};
|
|
3894
3993
|
|
|
3895
3994
|
// src/xy/lint/publintCommand.ts
|
|
3896
|
-
import
|
|
3995
|
+
import chalk48 from "chalk";
|
|
3897
3996
|
var publintCommand = {
|
|
3898
3997
|
command: "publint [package]",
|
|
3899
3998
|
describe: "Publint - Run Publint",
|
|
@@ -3904,12 +4003,12 @@ var publintCommand = {
|
|
|
3904
4003
|
if (argv.verbose) console.log("Publint");
|
|
3905
4004
|
const start = Date.now();
|
|
3906
4005
|
process.exitCode = await publint({ pkg: argv.package, verbose: !!argv.verbose });
|
|
3907
|
-
console.log(
|
|
4006
|
+
console.log(chalk48.blue(`Finished in ${Date.now() - start}ms`));
|
|
3908
4007
|
}
|
|
3909
4008
|
};
|
|
3910
4009
|
|
|
3911
4010
|
// src/xy/lint/relintCommand.ts
|
|
3912
|
-
import
|
|
4011
|
+
import chalk49 from "chalk";
|
|
3913
4012
|
var relintCommand = {
|
|
3914
4013
|
command: "relint [package]",
|
|
3915
4014
|
describe: "Relint - Clean & Lint",
|
|
@@ -3920,12 +4019,12 @@ var relintCommand = {
|
|
|
3920
4019
|
if (argv.verbose) console.log("Relinting");
|
|
3921
4020
|
const start = Date.now();
|
|
3922
4021
|
process.exitCode = relint();
|
|
3923
|
-
console.log(
|
|
4022
|
+
console.log(chalk49.blue(`Finished in ${Date.now() - start}ms`));
|
|
3924
4023
|
}
|
|
3925
4024
|
};
|
|
3926
4025
|
|
|
3927
4026
|
// src/xy/lint/sonarCommand.ts
|
|
3928
|
-
import
|
|
4027
|
+
import chalk50 from "chalk";
|
|
3929
4028
|
var sonarCommand = {
|
|
3930
4029
|
command: "sonar",
|
|
3931
4030
|
describe: "Sonar - Run Sonar Check",
|
|
@@ -3936,7 +4035,7 @@ var sonarCommand = {
|
|
|
3936
4035
|
const start = Date.now();
|
|
3937
4036
|
if (argv.verbose) console.log("Sonar Check");
|
|
3938
4037
|
process.exitCode = sonar();
|
|
3939
|
-
console.log(
|
|
4038
|
+
console.log(chalk50.blue(`Finished in ${Date.now() - start}ms`));
|
|
3940
4039
|
}
|
|
3941
4040
|
};
|
|
3942
4041
|
|
|
@@ -3946,7 +4045,7 @@ var xyLintCommands = (args) => {
|
|
|
3946
4045
|
};
|
|
3947
4046
|
|
|
3948
4047
|
// src/xy/xy.ts
|
|
3949
|
-
import
|
|
4048
|
+
import chalk51 from "chalk";
|
|
3950
4049
|
|
|
3951
4050
|
// src/xy/xyParseOptions.ts
|
|
3952
4051
|
import yargs from "yargs";
|
|
@@ -3979,8 +4078,8 @@ var xyParseOptions = () => {
|
|
|
3979
4078
|
var xy = async () => {
|
|
3980
4079
|
const options = xyParseOptions();
|
|
3981
4080
|
return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
|
|
3982
|
-
console.error(
|
|
3983
|
-
console.log(
|
|
4081
|
+
console.error(chalk51.yellow(`Command not found [${chalk51.magenta(process.argv[2])}]`));
|
|
4082
|
+
console.log(chalk51.gray("Try 'yarn xy --help' for list of commands"));
|
|
3984
4083
|
}).version().help().argv;
|
|
3985
4084
|
};
|
|
3986
4085
|
export {
|
|
@@ -3992,6 +4091,7 @@ export {
|
|
|
3992
4091
|
WINDOWS_NEWLINE_REGEX,
|
|
3993
4092
|
XYLABS_COMMANDS_PREFIX,
|
|
3994
4093
|
XYLABS_RULES_PREFIX,
|
|
4094
|
+
XYLABS_SKILLS_PREFIX,
|
|
3995
4095
|
applyLogoConfig,
|
|
3996
4096
|
build,
|
|
3997
4097
|
bundleDts,
|
|
@@ -4002,6 +4102,8 @@ export {
|
|
|
4002
4102
|
claudeMdRuleTemplates,
|
|
4003
4103
|
claudeRules,
|
|
4004
4104
|
claudeSettings,
|
|
4105
|
+
claudeSkillTemplates,
|
|
4106
|
+
claudeSkills,
|
|
4005
4107
|
clean,
|
|
4006
4108
|
cleanAll,
|
|
4007
4109
|
cleanDocs,
|