@xylabs/ts-scripts-yarn3 6.3.2 → 6.3.4
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/build.mjs +0 -11
- package/dist/actions/build.mjs.map +1 -1
- package/dist/actions/cycle.mjs +42 -44
- package/dist/actions/cycle.mjs.map +1 -1
- package/dist/actions/index.mjs +106 -119
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/package/cycle.mjs +4 -4
- package/dist/actions/package/cycle.mjs.map +1 -1
- package/dist/actions/package/index.mjs +4 -4
- package/dist/actions/package/index.mjs.map +1 -1
- package/dist/bin/package/cycle.mjs +4 -4
- package/dist/bin/package/cycle.mjs.map +1 -1
- package/dist/bin/xy.mjs +87 -100
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.mjs +119 -132
- package/dist/index.mjs.map +1 -1
- package/dist/xy/index.mjs +87 -100
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/xy.mjs +87 -100
- package/dist/xy/xy.mjs.map +1 -1
- package/dist/xy/xyBuildCommands.mjs +0 -11
- package/dist/xy/xyBuildCommands.mjs.map +1 -1
- package/dist/xy/xyLintCommands.mjs +62 -64
- package/dist/xy/xyLintCommands.mjs.map +1 -1
- package/package.json +8 -8
package/dist/actions/index.mjs
CHANGED
|
@@ -472,17 +472,6 @@ var build = /* @__PURE__ */ __name(async ({ incremental, jobs, target, verbose,
|
|
|
472
472
|
"tsup"
|
|
473
473
|
]
|
|
474
474
|
],
|
|
475
|
-
[
|
|
476
|
-
"yarn",
|
|
477
|
-
[
|
|
478
|
-
"xy",
|
|
479
|
-
"cycle",
|
|
480
|
-
...pkgOptions,
|
|
481
|
-
...verboseOptions,
|
|
482
|
-
...jobsOptions,
|
|
483
|
-
...incrementalOptions
|
|
484
|
-
]
|
|
485
|
-
],
|
|
486
475
|
[
|
|
487
476
|
"yarn",
|
|
488
477
|
[
|
|
@@ -787,15 +776,13 @@ var copyAssets = /* @__PURE__ */ __name(async ({ target, pkg }) => {
|
|
|
787
776
|
}, "copyAssets");
|
|
788
777
|
|
|
789
778
|
// src/actions/cycle.ts
|
|
790
|
-
import
|
|
791
|
-
var cycle = /* @__PURE__ */ __name(({ verbose, pkg
|
|
779
|
+
import { cruise } from "dependency-cruiser";
|
|
780
|
+
var cycle = /* @__PURE__ */ __name(async ({ verbose, pkg } = {}) => {
|
|
792
781
|
return pkg ? cyclePackage({
|
|
793
782
|
pkg,
|
|
794
783
|
verbose
|
|
795
|
-
}) : cycleAll({
|
|
796
|
-
|
|
797
|
-
verbose,
|
|
798
|
-
jobs
|
|
784
|
+
}) : await cycleAll({
|
|
785
|
+
verbose
|
|
799
786
|
});
|
|
800
787
|
}, "cycle");
|
|
801
788
|
var cyclePackage = /* @__PURE__ */ __name(({ pkg, verbose }) => {
|
|
@@ -817,45 +804,45 @@ var cyclePackage = /* @__PURE__ */ __name(({ pkg, verbose }) => {
|
|
|
817
804
|
]
|
|
818
805
|
]);
|
|
819
806
|
}, "cyclePackage");
|
|
820
|
-
var cycleAll = /* @__PURE__ */ __name(({
|
|
821
|
-
const
|
|
822
|
-
const
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
];
|
|
835
|
-
const jobsOptions = jobs ? [
|
|
836
|
-
"-j",
|
|
837
|
-
`${jobs}`
|
|
838
|
-
] : [];
|
|
839
|
-
if (jobs) {
|
|
840
|
-
console.log(chalk13.blue(`Jobs set to [${jobs}]`));
|
|
841
|
-
}
|
|
842
|
-
const result = runSteps(`Cycle${incremental ? "-Incremental" : ""} [All]`, [
|
|
843
|
-
[
|
|
844
|
-
"yarn",
|
|
845
|
-
[
|
|
846
|
-
"workspaces",
|
|
847
|
-
"foreach",
|
|
848
|
-
...incrementalOptions,
|
|
849
|
-
...jobsOptions,
|
|
850
|
-
...verboseOptions,
|
|
851
|
-
"run",
|
|
852
|
-
"package-cycle",
|
|
853
|
-
...verboseOptions
|
|
807
|
+
var cycleAll = /* @__PURE__ */ __name(async ({ verbose = false }) => {
|
|
808
|
+
const pkgName = process.env.npm_package_name;
|
|
809
|
+
const cruiseOptions = {
|
|
810
|
+
ruleSet: {
|
|
811
|
+
forbidden: [
|
|
812
|
+
{
|
|
813
|
+
name: "no-circular",
|
|
814
|
+
severity: "error",
|
|
815
|
+
comment: "This dependency creates a circular reference",
|
|
816
|
+
from: {},
|
|
817
|
+
to: {
|
|
818
|
+
circular: true
|
|
819
|
+
}
|
|
820
|
+
}
|
|
854
821
|
]
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
822
|
+
},
|
|
823
|
+
exclude: "node_modules|packages/.*/packages",
|
|
824
|
+
validate: true,
|
|
825
|
+
doNotFollow: {
|
|
826
|
+
path: "node_modules|packages/.*/packages"
|
|
827
|
+
},
|
|
828
|
+
tsPreCompilationDeps: false,
|
|
829
|
+
combinedDependencies: true,
|
|
830
|
+
outputType: verbose ? "text" : "err"
|
|
831
|
+
};
|
|
832
|
+
const target = "**/src";
|
|
833
|
+
console.log(`Checking for circular dependencies in ${target}...`);
|
|
834
|
+
const result = await cruise([
|
|
835
|
+
target
|
|
836
|
+
], cruiseOptions);
|
|
837
|
+
if (result.output) {
|
|
838
|
+
console.log(result.output);
|
|
839
|
+
}
|
|
840
|
+
if (result.exitCode === 0) {
|
|
841
|
+
console.log(`${pkgName} \u2705 No dependency violations`);
|
|
842
|
+
} else {
|
|
843
|
+
console.error(`${pkgName} \u274C Dependency violations found`);
|
|
844
|
+
}
|
|
845
|
+
return result.exitCode;
|
|
859
846
|
}, "cycleAll");
|
|
860
847
|
|
|
861
848
|
// src/actions/dead.ts
|
|
@@ -977,18 +964,18 @@ var deployNext = /* @__PURE__ */ __name(() => {
|
|
|
977
964
|
}, "deployNext");
|
|
978
965
|
|
|
979
966
|
// src/actions/dupdeps.ts
|
|
980
|
-
import
|
|
967
|
+
import chalk13 from "chalk";
|
|
981
968
|
var dupdeps = /* @__PURE__ */ __name(() => {
|
|
982
|
-
console.log(
|
|
969
|
+
console.log(chalk13.green("Checking all Dependencies for Duplicates"));
|
|
983
970
|
const allDependencies = parsedPackageJSON()?.dependencies;
|
|
984
971
|
const dependencies = Object.entries(allDependencies).map(([k]) => k);
|
|
985
972
|
return detectDuplicateDependencies(dependencies);
|
|
986
973
|
}, "dupdeps");
|
|
987
974
|
|
|
988
975
|
// src/actions/lint.ts
|
|
989
|
-
import
|
|
976
|
+
import chalk14 from "chalk";
|
|
990
977
|
var lintPackage = /* @__PURE__ */ __name(({ pkg, fix: fix2 }) => {
|
|
991
|
-
console.log(
|
|
978
|
+
console.log(chalk14.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
|
|
992
979
|
const start = Date.now();
|
|
993
980
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
|
|
994
981
|
[
|
|
@@ -1001,7 +988,7 @@ var lintPackage = /* @__PURE__ */ __name(({ pkg, fix: fix2 }) => {
|
|
|
1001
988
|
]
|
|
1002
989
|
]
|
|
1003
990
|
]);
|
|
1004
|
-
console.log(
|
|
991
|
+
console.log(chalk14.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk14.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk14.gray("seconds")}`));
|
|
1005
992
|
return result;
|
|
1006
993
|
}, "lintPackage");
|
|
1007
994
|
var lint = /* @__PURE__ */ __name(({ pkg, verbose, incremental, fix: fix2 } = {}) => {
|
|
@@ -1015,7 +1002,7 @@ var lint = /* @__PURE__ */ __name(({ pkg, verbose, incremental, fix: fix2 } = {}
|
|
|
1015
1002
|
});
|
|
1016
1003
|
}, "lint");
|
|
1017
1004
|
var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2 = false } = {}) => {
|
|
1018
|
-
console.log(
|
|
1005
|
+
console.log(chalk14.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
|
|
1019
1006
|
const start = Date.now();
|
|
1020
1007
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
|
|
1021
1008
|
[
|
|
@@ -1025,7 +1012,7 @@ var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2 = false } = {}) => {
|
|
|
1025
1012
|
]
|
|
1026
1013
|
]
|
|
1027
1014
|
]);
|
|
1028
|
-
console.log(
|
|
1015
|
+
console.log(chalk14.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk14.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk14.gray("seconds")}`));
|
|
1029
1016
|
return result;
|
|
1030
1017
|
}, "lintAllPackages");
|
|
1031
1018
|
|
|
@@ -1090,7 +1077,7 @@ var filename = ".gitignore";
|
|
|
1090
1077
|
var gitignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename, pkg), "gitignoreGen");
|
|
1091
1078
|
|
|
1092
1079
|
// src/actions/gitlint.ts
|
|
1093
|
-
import
|
|
1080
|
+
import chalk15 from "chalk";
|
|
1094
1081
|
import ParseGitConfig from "parse-git-config";
|
|
1095
1082
|
var gitlint = /* @__PURE__ */ __name(() => {
|
|
1096
1083
|
console.log(`
|
|
@@ -1101,7 +1088,7 @@ Gitlint Start [${process.cwd()}]
|
|
|
1101
1088
|
const errors = 0;
|
|
1102
1089
|
const gitConfig = ParseGitConfig.sync();
|
|
1103
1090
|
const warn = /* @__PURE__ */ __name((message) => {
|
|
1104
|
-
console.warn(
|
|
1091
|
+
console.warn(chalk15.yellow(`Warning: ${message}`));
|
|
1105
1092
|
warnings++;
|
|
1106
1093
|
}, "warn");
|
|
1107
1094
|
if (gitConfig.core.ignorecase) {
|
|
@@ -1121,13 +1108,13 @@ Gitlint Start [${process.cwd()}]
|
|
|
1121
1108
|
}
|
|
1122
1109
|
const resultMessages = [];
|
|
1123
1110
|
if (valid > 0) {
|
|
1124
|
-
resultMessages.push(
|
|
1111
|
+
resultMessages.push(chalk15.green(`Passed: ${valid}`));
|
|
1125
1112
|
}
|
|
1126
1113
|
if (warnings > 0) {
|
|
1127
|
-
resultMessages.push(
|
|
1114
|
+
resultMessages.push(chalk15.yellow(`Warnings: ${warnings}`));
|
|
1128
1115
|
}
|
|
1129
1116
|
if (errors > 0) {
|
|
1130
|
-
resultMessages.push(
|
|
1117
|
+
resultMessages.push(chalk15.red(` Errors: ${errors}`));
|
|
1131
1118
|
}
|
|
1132
1119
|
console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
|
|
1133
1120
|
`);
|
|
@@ -1136,7 +1123,7 @@ Gitlint Start [${process.cwd()}]
|
|
|
1136
1123
|
|
|
1137
1124
|
// src/actions/gitlint-fix.ts
|
|
1138
1125
|
import { execSync as execSync2 } from "node:child_process";
|
|
1139
|
-
import
|
|
1126
|
+
import chalk16 from "chalk";
|
|
1140
1127
|
import ParseGitConfig2 from "parse-git-config";
|
|
1141
1128
|
var gitlintFix = /* @__PURE__ */ __name(() => {
|
|
1142
1129
|
console.log(`
|
|
@@ -1147,19 +1134,19 @@ Gitlint Fix Start [${process.cwd()}]
|
|
|
1147
1134
|
execSync2("git config core.ignorecase false", {
|
|
1148
1135
|
stdio: "inherit"
|
|
1149
1136
|
});
|
|
1150
|
-
console.warn(
|
|
1137
|
+
console.warn(chalk16.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
|
|
1151
1138
|
}
|
|
1152
1139
|
if (gitConfig.core.autocrlf !== false) {
|
|
1153
1140
|
execSync2("git config core.autocrlf false", {
|
|
1154
1141
|
stdio: "inherit"
|
|
1155
1142
|
});
|
|
1156
|
-
console.warn(
|
|
1143
|
+
console.warn(chalk16.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
|
|
1157
1144
|
}
|
|
1158
1145
|
if (gitConfig.core.eol !== "lf") {
|
|
1159
1146
|
execSync2("git config core.eol lf", {
|
|
1160
1147
|
stdio: "inherit"
|
|
1161
1148
|
});
|
|
1162
|
-
console.warn(
|
|
1149
|
+
console.warn(chalk16.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
|
|
1163
1150
|
}
|
|
1164
1151
|
return 1;
|
|
1165
1152
|
}, "gitlintFix");
|
|
@@ -1179,7 +1166,7 @@ var knip = /* @__PURE__ */ __name(() => {
|
|
|
1179
1166
|
}, "knip");
|
|
1180
1167
|
|
|
1181
1168
|
// src/actions/license.ts
|
|
1182
|
-
import
|
|
1169
|
+
import chalk17 from "chalk";
|
|
1183
1170
|
import { init } from "license-checker";
|
|
1184
1171
|
var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
1185
1172
|
const workspaces = yarnWorkspaces();
|
|
@@ -1204,7 +1191,7 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
|
1204
1191
|
"LGPL-3.0-or-later",
|
|
1205
1192
|
"Python-2.0"
|
|
1206
1193
|
]);
|
|
1207
|
-
console.log(
|
|
1194
|
+
console.log(chalk17.green("License Checker"));
|
|
1208
1195
|
return (await Promise.all(workspaceList.map(({ location, name }) => {
|
|
1209
1196
|
return new Promise((resolve) => {
|
|
1210
1197
|
init({
|
|
@@ -1212,12 +1199,12 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
|
1212
1199
|
start: location
|
|
1213
1200
|
}, (error, packages) => {
|
|
1214
1201
|
if (error) {
|
|
1215
|
-
console.error(
|
|
1216
|
-
console.error(
|
|
1202
|
+
console.error(chalk17.red(`License Checker [${name}] Error`));
|
|
1203
|
+
console.error(chalk17.gray(error));
|
|
1217
1204
|
console.log("\n");
|
|
1218
1205
|
resolve(1);
|
|
1219
1206
|
} else {
|
|
1220
|
-
console.log(
|
|
1207
|
+
console.log(chalk17.green(`License Checker [${name}]`));
|
|
1221
1208
|
let count = 0;
|
|
1222
1209
|
for (const [name2, info] of Object.entries(packages)) {
|
|
1223
1210
|
const licenses = Array.isArray(info.licenses) ? info.licenses : [
|
|
@@ -1235,7 +1222,7 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
|
1235
1222
|
}
|
|
1236
1223
|
if (!orLicenseFound) {
|
|
1237
1224
|
count++;
|
|
1238
|
-
console.warn(
|
|
1225
|
+
console.warn(chalk17.yellow(`${name2}: Package License not allowed [${license2}]`));
|
|
1239
1226
|
}
|
|
1240
1227
|
}
|
|
1241
1228
|
}
|
|
@@ -1254,7 +1241,7 @@ var npmignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename2
|
|
|
1254
1241
|
|
|
1255
1242
|
// src/actions/package/clean-outputs.ts
|
|
1256
1243
|
import path3 from "node:path";
|
|
1257
|
-
import
|
|
1244
|
+
import chalk18 from "chalk";
|
|
1258
1245
|
var packageCleanOutputs = /* @__PURE__ */ __name(() => {
|
|
1259
1246
|
const pkg = process.env.INIT_CWD ?? ".";
|
|
1260
1247
|
const pkgName = process.env.npm_package_name;
|
|
@@ -1263,7 +1250,7 @@ var packageCleanOutputs = /* @__PURE__ */ __name(() => {
|
|
|
1263
1250
|
path3.join(pkg, "build"),
|
|
1264
1251
|
path3.join(pkg, "docs")
|
|
1265
1252
|
];
|
|
1266
|
-
console.log(
|
|
1253
|
+
console.log(chalk18.green(`Cleaning Outputs [${pkgName}]`));
|
|
1267
1254
|
for (let folder of folders) {
|
|
1268
1255
|
deleteGlob(folder);
|
|
1269
1256
|
}
|
|
@@ -1272,11 +1259,11 @@ var packageCleanOutputs = /* @__PURE__ */ __name(() => {
|
|
|
1272
1259
|
|
|
1273
1260
|
// src/actions/package/clean-typescript.ts
|
|
1274
1261
|
import path4 from "node:path";
|
|
1275
|
-
import
|
|
1262
|
+
import chalk19 from "chalk";
|
|
1276
1263
|
var packageCleanTypescript = /* @__PURE__ */ __name(() => {
|
|
1277
1264
|
const pkg = process.env.INIT_CWD ?? ".";
|
|
1278
1265
|
const pkgName = process.env.npm_package_name;
|
|
1279
|
-
console.log(
|
|
1266
|
+
console.log(chalk19.green(`Cleaning Typescript [${pkgName}]`));
|
|
1280
1267
|
const files = [
|
|
1281
1268
|
path4.join(pkg, "*.tsbuildinfo"),
|
|
1282
1269
|
path4.join(pkg, ".tsconfig.*"),
|
|
@@ -1297,19 +1284,19 @@ var packageClean = /* @__PURE__ */ __name(async () => {
|
|
|
1297
1284
|
}, "packageClean");
|
|
1298
1285
|
|
|
1299
1286
|
// src/actions/package/compile/compile.ts
|
|
1300
|
-
import
|
|
1287
|
+
import chalk23 from "chalk";
|
|
1301
1288
|
|
|
1302
1289
|
// src/actions/package/publint.ts
|
|
1303
1290
|
import { promises as fs2 } from "node:fs";
|
|
1304
|
-
import
|
|
1291
|
+
import chalk20 from "chalk";
|
|
1305
1292
|
import sortPackageJson from "sort-package-json";
|
|
1306
1293
|
var packagePublint = /* @__PURE__ */ __name(async (params) => {
|
|
1307
1294
|
const pkgDir = process.env.INIT_CWD;
|
|
1308
1295
|
const sortedPkg = sortPackageJson(await fs2.readFile(`${pkgDir}/package.json`, "utf8"));
|
|
1309
1296
|
await fs2.writeFile(`${pkgDir}/package.json`, sortedPkg);
|
|
1310
1297
|
const pkg = JSON.parse(await fs2.readFile(`${pkgDir}/package.json`, "utf8"));
|
|
1311
|
-
console.log(
|
|
1312
|
-
console.log(
|
|
1298
|
+
console.log(chalk20.green(`Publint: ${pkg.name}`));
|
|
1299
|
+
console.log(chalk20.gray(pkgDir));
|
|
1313
1300
|
const { publint: publint2 } = await import("publint");
|
|
1314
1301
|
const { messages } = await publint2({
|
|
1315
1302
|
level: "suggestion",
|
|
@@ -1324,21 +1311,21 @@ var packagePublint = /* @__PURE__ */ __name(async (params) => {
|
|
|
1324
1311
|
for (const message of validMessages) {
|
|
1325
1312
|
switch (message.type) {
|
|
1326
1313
|
case "error": {
|
|
1327
|
-
console.error(
|
|
1314
|
+
console.error(chalk20.red(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
1328
1315
|
break;
|
|
1329
1316
|
}
|
|
1330
1317
|
case "warning": {
|
|
1331
|
-
console.warn(
|
|
1318
|
+
console.warn(chalk20.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
1332
1319
|
break;
|
|
1333
1320
|
}
|
|
1334
1321
|
default: {
|
|
1335
|
-
console.log(
|
|
1322
|
+
console.log(chalk20.white(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
1336
1323
|
break;
|
|
1337
1324
|
}
|
|
1338
1325
|
}
|
|
1339
1326
|
}
|
|
1340
1327
|
if (params?.verbose) {
|
|
1341
|
-
console.log(
|
|
1328
|
+
console.log(chalk20.gray(`Publint [Finish]: ${pkgDir} [${validMessages.length}]`));
|
|
1342
1329
|
}
|
|
1343
1330
|
return validMessages.filter((message) => message.type === "error").length;
|
|
1344
1331
|
}, "packagePublint");
|
|
@@ -1382,7 +1369,7 @@ var buildEntries = /* @__PURE__ */ __name((folder, entryMode = "single", exclude
|
|
|
1382
1369
|
|
|
1383
1370
|
// src/actions/package/compile/packageCompileTscTypes.ts
|
|
1384
1371
|
import { cwd } from "node:process";
|
|
1385
|
-
import
|
|
1372
|
+
import chalk21 from "chalk";
|
|
1386
1373
|
import { createProgramFromConfig } from "tsc-prog";
|
|
1387
1374
|
import { DiagnosticCategory, formatDiagnosticsWithColorAndContext, getPreEmitDiagnostics, sys as sys2 } from "typescript";
|
|
1388
1375
|
|
|
@@ -1439,7 +1426,7 @@ var packageCompileTscTypes = /* @__PURE__ */ __name((folder = "src", config2 = {
|
|
|
1439
1426
|
".spec."
|
|
1440
1427
|
];
|
|
1441
1428
|
const files = buildEntries(folder, "all", verbose).filter((file) => validTsExt.find((ext) => file.endsWith(ext)) && !excludes.some((exclude) => file.includes(exclude)));
|
|
1442
|
-
console.log(
|
|
1429
|
+
console.log(chalk21.green(`Compiling Types ${pkg}: ${files.length}`));
|
|
1443
1430
|
if (files.length > 0) {
|
|
1444
1431
|
const program = createProgramFromConfig({
|
|
1445
1432
|
basePath: pkg ?? cwd(),
|
|
@@ -1501,7 +1488,7 @@ __name(deepMergeObjects, "deepMergeObjects");
|
|
|
1501
1488
|
|
|
1502
1489
|
// src/actions/package/compile/packageCompileTsc.ts
|
|
1503
1490
|
import { cwd as cwd2 } from "node:process";
|
|
1504
|
-
import
|
|
1491
|
+
import chalk22 from "chalk";
|
|
1505
1492
|
import { createProgramFromConfig as createProgramFromConfig2 } from "tsc-prog";
|
|
1506
1493
|
import { DiagnosticCategory as DiagnosticCategory2, formatDiagnosticsWithColorAndContext as formatDiagnosticsWithColorAndContext2, getPreEmitDiagnostics as getPreEmitDiagnostics2, sys as sys3 } from "typescript";
|
|
1507
1494
|
var packageCompileTsc = /* @__PURE__ */ __name((folder = "src", config2 = {}, compilerOptionsParam) => {
|
|
@@ -1536,7 +1523,7 @@ var packageCompileTsc = /* @__PURE__ */ __name((folder = "src", config2 = {}, co
|
|
|
1536
1523
|
".d.mts"
|
|
1537
1524
|
];
|
|
1538
1525
|
const files = buildEntries(folder, "all", verbose).filter((file) => validTsExt.find((ext) => file.endsWith(ext)) && includes.find((include) => file.includes(include)));
|
|
1539
|
-
console.log(
|
|
1526
|
+
console.log(chalk22.green(`Compiling Files ${pkg}: ${files.length}`));
|
|
1540
1527
|
if (files.length > 0) {
|
|
1541
1528
|
const program = createProgramFromConfig2({
|
|
1542
1529
|
basePath: pkg ?? cwd2(),
|
|
@@ -1696,7 +1683,7 @@ var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
|
|
|
1696
1683
|
// src/actions/package/compile/compile.ts
|
|
1697
1684
|
var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
|
|
1698
1685
|
const pkg = process.env.INIT_CWD;
|
|
1699
|
-
console.log(
|
|
1686
|
+
console.log(chalk23.green(`Compiling ${pkg}`));
|
|
1700
1687
|
const config2 = await loadConfig(inConfig);
|
|
1701
1688
|
const publint2 = config2.publint;
|
|
1702
1689
|
const tsupResults = await packageCompileTsup(config2);
|
|
@@ -1708,7 +1695,7 @@ var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
|
|
|
1708
1695
|
|
|
1709
1696
|
// src/actions/package/copy-assets.ts
|
|
1710
1697
|
import path5 from "node:path/posix";
|
|
1711
|
-
import
|
|
1698
|
+
import chalk24 from "chalk";
|
|
1712
1699
|
import cpy2 from "cpy";
|
|
1713
1700
|
var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) => {
|
|
1714
1701
|
try {
|
|
@@ -1727,7 +1714,7 @@ var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) =>
|
|
|
1727
1714
|
flat: false
|
|
1728
1715
|
});
|
|
1729
1716
|
if (values.length > 0) {
|
|
1730
|
-
console.log(
|
|
1717
|
+
console.log(chalk24.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
|
|
1731
1718
|
}
|
|
1732
1719
|
for (const value of values) {
|
|
1733
1720
|
console.log(`${value.split("/").pop()} => ./dist/${target}`);
|
|
@@ -1756,7 +1743,7 @@ var packageCopyAssets = /* @__PURE__ */ __name(async ({ target }) => {
|
|
|
1756
1743
|
}, "packageCopyAssets");
|
|
1757
1744
|
|
|
1758
1745
|
// src/actions/package/cycle.ts
|
|
1759
|
-
import { cruise } from "dependency-cruiser";
|
|
1746
|
+
import { cruise as cruise2 } from "dependency-cruiser";
|
|
1760
1747
|
var packageCycle = /* @__PURE__ */ __name(async ({ verbose = false }) => {
|
|
1761
1748
|
const pkg = process.env.INIT_CWD;
|
|
1762
1749
|
const pkgName = process.env.npm_package_name;
|
|
@@ -1774,18 +1761,18 @@ var packageCycle = /* @__PURE__ */ __name(async ({ verbose = false }) => {
|
|
|
1774
1761
|
}
|
|
1775
1762
|
]
|
|
1776
1763
|
},
|
|
1764
|
+
exclude: "node_modules|packages/.*/packages",
|
|
1777
1765
|
validate: true,
|
|
1778
|
-
doNotFollow:
|
|
1779
|
-
"node_modules"
|
|
1780
|
-
|
|
1781
|
-
],
|
|
1766
|
+
doNotFollow: {
|
|
1767
|
+
path: "node_modules|packages/.*/packages"
|
|
1768
|
+
},
|
|
1782
1769
|
tsPreCompilationDeps: false,
|
|
1783
1770
|
combinedDependencies: true,
|
|
1784
1771
|
outputType: verbose ? "text" : "err"
|
|
1785
1772
|
};
|
|
1786
1773
|
const target = `${pkg}/src`;
|
|
1787
1774
|
console.log(`Checking for circular dependencies in ${target}...`);
|
|
1788
|
-
const result = await
|
|
1775
|
+
const result = await cruise2([
|
|
1789
1776
|
target
|
|
1790
1777
|
], cruiseOptions);
|
|
1791
1778
|
if (result.output) {
|
|
@@ -1802,7 +1789,7 @@ var packageCycle = /* @__PURE__ */ __name(async ({ verbose = false }) => {
|
|
|
1802
1789
|
// src/actions/package/gen-docs.ts
|
|
1803
1790
|
import { existsSync as existsSync4 } from "node:fs";
|
|
1804
1791
|
import path6 from "node:path";
|
|
1805
|
-
import
|
|
1792
|
+
import chalk25 from "chalk";
|
|
1806
1793
|
import { Application, ArgumentsReader, TSConfigReader, TypeDocReader } from "typedoc";
|
|
1807
1794
|
var ExitCodes = {
|
|
1808
1795
|
CompileError: 3,
|
|
@@ -1904,7 +1891,7 @@ var runTypeDoc = /* @__PURE__ */ __name(async (app) => {
|
|
|
1904
1891
|
return ExitCodes.OutputError;
|
|
1905
1892
|
}
|
|
1906
1893
|
}
|
|
1907
|
-
console.log(
|
|
1894
|
+
console.log(chalk25.green(`${pkgName} - Ok`));
|
|
1908
1895
|
return ExitCodes.Ok;
|
|
1909
1896
|
}, "runTypeDoc");
|
|
1910
1897
|
|
|
@@ -1913,7 +1900,7 @@ import { readdirSync } from "node:fs";
|
|
|
1913
1900
|
import path7 from "node:path";
|
|
1914
1901
|
import { cwd as cwd3 } from "node:process";
|
|
1915
1902
|
import { pathToFileURL } from "node:url";
|
|
1916
|
-
import
|
|
1903
|
+
import chalk26 from "chalk";
|
|
1917
1904
|
import { ESLint } from "eslint";
|
|
1918
1905
|
import { findUp } from "find-up";
|
|
1919
1906
|
import picomatch from "picomatch";
|
|
@@ -1930,10 +1917,10 @@ var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
|
|
|
1930
1917
|
];
|
|
1931
1918
|
for (const lintResult of lintResults) {
|
|
1932
1919
|
if (lintResult.messages.length > 0) {
|
|
1933
|
-
console.log(
|
|
1920
|
+
console.log(chalk26.gray(`
|
|
1934
1921
|
${lintResult.filePath}`));
|
|
1935
1922
|
for (const message of lintResult.messages) {
|
|
1936
|
-
console.log(
|
|
1923
|
+
console.log(chalk26.gray(` ${message.line}:${message.column}`), chalk26[colors[message.severity]](` ${severity[message.severity]}`), chalk26.white(` ${message.message}`), chalk26.gray(` ${message.ruleId}`));
|
|
1937
1924
|
}
|
|
1938
1925
|
}
|
|
1939
1926
|
}
|
|
@@ -1988,7 +1975,7 @@ var packageLint = /* @__PURE__ */ __name(async (fix2 = false, verbose = false, c
|
|
|
1988
1975
|
});
|
|
1989
1976
|
const files = getFiles(cwd3(), ignoreFolders);
|
|
1990
1977
|
if (verbose) {
|
|
1991
|
-
console.log(
|
|
1978
|
+
console.log(chalk26.green(`Linting ${pkg} [files = ${files.length}]`));
|
|
1992
1979
|
}
|
|
1993
1980
|
const lintResults = await engine.lintFiles(files);
|
|
1994
1981
|
dumpMessages(lintResults);
|
|
@@ -1998,7 +1985,7 @@ var packageLint = /* @__PURE__ */ __name(async (fix2 = false, verbose = false, c
|
|
|
1998
1985
|
const filesCountColor = files.length < 100 ? "green" : files.length < 1e3 ? "yellow" : "red";
|
|
1999
1986
|
const lintTime = Date.now() - start;
|
|
2000
1987
|
const lintTimeColor = lintTime < 1e3 ? "green" : lintTime < 3e3 ? "yellow" : "red";
|
|
2001
|
-
console.log(
|
|
1988
|
+
console.log(chalk26.white(`Linted ${chalk26[filesCountColor](files.length)} files in ${chalk26[lintTimeColor](lintTime)}ms`));
|
|
2002
1989
|
return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
|
|
2003
1990
|
}, "packageLint");
|
|
2004
1991
|
|
|
@@ -2065,7 +2052,7 @@ var rebuild = /* @__PURE__ */ __name(({ target }) => {
|
|
|
2065
2052
|
}, "rebuild");
|
|
2066
2053
|
|
|
2067
2054
|
// src/actions/recompile.ts
|
|
2068
|
-
import
|
|
2055
|
+
import chalk27 from "chalk";
|
|
2069
2056
|
var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incremental }) => {
|
|
2070
2057
|
return pkg ? await recompilePackage({
|
|
2071
2058
|
pkg,
|
|
@@ -2120,7 +2107,7 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
|
|
|
2120
2107
|
`${jobs}`
|
|
2121
2108
|
] : [];
|
|
2122
2109
|
if (jobs) {
|
|
2123
|
-
console.log(
|
|
2110
|
+
console.log(chalk27.blue(`Jobs set to [${jobs}]`));
|
|
2124
2111
|
}
|
|
2125
2112
|
const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
|
|
2126
2113
|
[
|
|
@@ -2150,7 +2137,7 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
|
|
|
2150
2137
|
]
|
|
2151
2138
|
]
|
|
2152
2139
|
]);
|
|
2153
|
-
console.log(`${
|
|
2140
|
+
console.log(`${chalk27.gray("Recompiled in")} [${chalk27.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk27.gray("seconds")}`);
|
|
2154
2141
|
return result;
|
|
2155
2142
|
}, "recompileAll");
|
|
2156
2143
|
|
|
@@ -2184,9 +2171,9 @@ var reinstall = /* @__PURE__ */ __name(() => {
|
|
|
2184
2171
|
}, "reinstall");
|
|
2185
2172
|
|
|
2186
2173
|
// src/actions/relint.ts
|
|
2187
|
-
import
|
|
2174
|
+
import chalk28 from "chalk";
|
|
2188
2175
|
var relintPackage = /* @__PURE__ */ __name(({ pkg }) => {
|
|
2189
|
-
console.log(
|
|
2176
|
+
console.log(chalk28.gray(`${"Relint"} [All-Packages]`));
|
|
2190
2177
|
const start = Date.now();
|
|
2191
2178
|
const result = runSteps("Relint [All-Packages]", [
|
|
2192
2179
|
[
|
|
@@ -2199,7 +2186,7 @@ var relintPackage = /* @__PURE__ */ __name(({ pkg }) => {
|
|
|
2199
2186
|
]
|
|
2200
2187
|
]
|
|
2201
2188
|
]);
|
|
2202
|
-
console.log(
|
|
2189
|
+
console.log(chalk28.gray(`${"Relinted in"} [${chalk28.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk28.gray("seconds")}`));
|
|
2203
2190
|
return result;
|
|
2204
2191
|
}, "relintPackage");
|
|
2205
2192
|
var relint = /* @__PURE__ */ __name(({ pkg, verbose, incremental } = {}) => {
|
|
@@ -2211,7 +2198,7 @@ var relint = /* @__PURE__ */ __name(({ pkg, verbose, incremental } = {}) => {
|
|
|
2211
2198
|
});
|
|
2212
2199
|
}, "relint");
|
|
2213
2200
|
var relintAllPackages = /* @__PURE__ */ __name(({ verbose = true, incremental } = {}) => {
|
|
2214
|
-
console.log(
|
|
2201
|
+
console.log(chalk28.gray(`${"Relint"} [All-Packages]`));
|
|
2215
2202
|
const start = Date.now();
|
|
2216
2203
|
const verboseOptions = verbose ? [
|
|
2217
2204
|
"--verbose"
|
|
@@ -2238,7 +2225,7 @@ var relintAllPackages = /* @__PURE__ */ __name(({ verbose = true, incremental }
|
|
|
2238
2225
|
]
|
|
2239
2226
|
]
|
|
2240
2227
|
]);
|
|
2241
|
-
console.log(
|
|
2228
|
+
console.log(chalk28.gray(`Relinted in [${chalk28.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk28.gray("seconds")}`));
|
|
2242
2229
|
return result;
|
|
2243
2230
|
}, "relintAllPackages");
|
|
2244
2231
|
|
|
@@ -2278,7 +2265,7 @@ var sonar = /* @__PURE__ */ __name(() => {
|
|
|
2278
2265
|
}, "sonar");
|
|
2279
2266
|
|
|
2280
2267
|
// src/actions/statics.ts
|
|
2281
|
-
import
|
|
2268
|
+
import chalk29 from "chalk";
|
|
2282
2269
|
var DefaultDependencies = [
|
|
2283
2270
|
"axios",
|
|
2284
2271
|
"@xylabs/pixel",
|
|
@@ -2289,7 +2276,7 @@ var DefaultDependencies = [
|
|
|
2289
2276
|
"@mui/system"
|
|
2290
2277
|
];
|
|
2291
2278
|
var statics = /* @__PURE__ */ __name(() => {
|
|
2292
|
-
console.log(
|
|
2279
|
+
console.log(chalk29.green("Check Required Static Dependencies"));
|
|
2293
2280
|
const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
|
|
2294
2281
|
return detectDuplicateDependencies(statics2, DefaultDependencies);
|
|
2295
2282
|
}, "statics");
|