@xylabs/ts-scripts-yarn3 6.3.3 → 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/cycle.mjs +42 -44
- package/dist/actions/cycle.mjs.map +1 -1
- package/dist/actions/index.mjs +102 -104
- package/dist/actions/index.mjs.map +1 -1
- package/dist/bin/xy.mjs +87 -89
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.mjs +115 -117
- package/dist/index.mjs.map +1 -1
- package/dist/xy/index.mjs +87 -89
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/xy.mjs +87 -89
- package/dist/xy/xy.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
|
@@ -776,15 +776,13 @@ var copyAssets = /* @__PURE__ */ __name(async ({ target, pkg }) => {
|
|
|
776
776
|
}, "copyAssets");
|
|
777
777
|
|
|
778
778
|
// src/actions/cycle.ts
|
|
779
|
-
import
|
|
780
|
-
var cycle = /* @__PURE__ */ __name(({ verbose, pkg
|
|
779
|
+
import { cruise } from "dependency-cruiser";
|
|
780
|
+
var cycle = /* @__PURE__ */ __name(async ({ verbose, pkg } = {}) => {
|
|
781
781
|
return pkg ? cyclePackage({
|
|
782
782
|
pkg,
|
|
783
783
|
verbose
|
|
784
|
-
}) : cycleAll({
|
|
785
|
-
|
|
786
|
-
verbose,
|
|
787
|
-
jobs
|
|
784
|
+
}) : await cycleAll({
|
|
785
|
+
verbose
|
|
788
786
|
});
|
|
789
787
|
}, "cycle");
|
|
790
788
|
var cyclePackage = /* @__PURE__ */ __name(({ pkg, verbose }) => {
|
|
@@ -806,45 +804,45 @@ var cyclePackage = /* @__PURE__ */ __name(({ pkg, verbose }) => {
|
|
|
806
804
|
]
|
|
807
805
|
]);
|
|
808
806
|
}, "cyclePackage");
|
|
809
|
-
var cycleAll = /* @__PURE__ */ __name(({
|
|
810
|
-
const
|
|
811
|
-
const
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
];
|
|
824
|
-
const jobsOptions = jobs ? [
|
|
825
|
-
"-j",
|
|
826
|
-
`${jobs}`
|
|
827
|
-
] : [];
|
|
828
|
-
if (jobs) {
|
|
829
|
-
console.log(chalk13.blue(`Jobs set to [${jobs}]`));
|
|
830
|
-
}
|
|
831
|
-
const result = runSteps(`Cycle${incremental ? "-Incremental" : ""} [All]`, [
|
|
832
|
-
[
|
|
833
|
-
"yarn",
|
|
834
|
-
[
|
|
835
|
-
"workspaces",
|
|
836
|
-
"foreach",
|
|
837
|
-
...incrementalOptions,
|
|
838
|
-
...jobsOptions,
|
|
839
|
-
...verboseOptions,
|
|
840
|
-
"run",
|
|
841
|
-
"package-cycle",
|
|
842
|
-
...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
|
+
}
|
|
843
821
|
]
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
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;
|
|
848
846
|
}, "cycleAll");
|
|
849
847
|
|
|
850
848
|
// src/actions/dead.ts
|
|
@@ -966,18 +964,18 @@ var deployNext = /* @__PURE__ */ __name(() => {
|
|
|
966
964
|
}, "deployNext");
|
|
967
965
|
|
|
968
966
|
// src/actions/dupdeps.ts
|
|
969
|
-
import
|
|
967
|
+
import chalk13 from "chalk";
|
|
970
968
|
var dupdeps = /* @__PURE__ */ __name(() => {
|
|
971
|
-
console.log(
|
|
969
|
+
console.log(chalk13.green("Checking all Dependencies for Duplicates"));
|
|
972
970
|
const allDependencies = parsedPackageJSON()?.dependencies;
|
|
973
971
|
const dependencies = Object.entries(allDependencies).map(([k]) => k);
|
|
974
972
|
return detectDuplicateDependencies(dependencies);
|
|
975
973
|
}, "dupdeps");
|
|
976
974
|
|
|
977
975
|
// src/actions/lint.ts
|
|
978
|
-
import
|
|
976
|
+
import chalk14 from "chalk";
|
|
979
977
|
var lintPackage = /* @__PURE__ */ __name(({ pkg, fix: fix2 }) => {
|
|
980
|
-
console.log(
|
|
978
|
+
console.log(chalk14.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
|
|
981
979
|
const start = Date.now();
|
|
982
980
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
|
|
983
981
|
[
|
|
@@ -990,7 +988,7 @@ var lintPackage = /* @__PURE__ */ __name(({ pkg, fix: fix2 }) => {
|
|
|
990
988
|
]
|
|
991
989
|
]
|
|
992
990
|
]);
|
|
993
|
-
console.log(
|
|
991
|
+
console.log(chalk14.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk14.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk14.gray("seconds")}`));
|
|
994
992
|
return result;
|
|
995
993
|
}, "lintPackage");
|
|
996
994
|
var lint = /* @__PURE__ */ __name(({ pkg, verbose, incremental, fix: fix2 } = {}) => {
|
|
@@ -1004,7 +1002,7 @@ var lint = /* @__PURE__ */ __name(({ pkg, verbose, incremental, fix: fix2 } = {}
|
|
|
1004
1002
|
});
|
|
1005
1003
|
}, "lint");
|
|
1006
1004
|
var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2 = false } = {}) => {
|
|
1007
|
-
console.log(
|
|
1005
|
+
console.log(chalk14.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
|
|
1008
1006
|
const start = Date.now();
|
|
1009
1007
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
|
|
1010
1008
|
[
|
|
@@ -1014,7 +1012,7 @@ var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2 = false } = {}) => {
|
|
|
1014
1012
|
]
|
|
1015
1013
|
]
|
|
1016
1014
|
]);
|
|
1017
|
-
console.log(
|
|
1015
|
+
console.log(chalk14.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk14.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk14.gray("seconds")}`));
|
|
1018
1016
|
return result;
|
|
1019
1017
|
}, "lintAllPackages");
|
|
1020
1018
|
|
|
@@ -1079,7 +1077,7 @@ var filename = ".gitignore";
|
|
|
1079
1077
|
var gitignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename, pkg), "gitignoreGen");
|
|
1080
1078
|
|
|
1081
1079
|
// src/actions/gitlint.ts
|
|
1082
|
-
import
|
|
1080
|
+
import chalk15 from "chalk";
|
|
1083
1081
|
import ParseGitConfig from "parse-git-config";
|
|
1084
1082
|
var gitlint = /* @__PURE__ */ __name(() => {
|
|
1085
1083
|
console.log(`
|
|
@@ -1090,7 +1088,7 @@ Gitlint Start [${process.cwd()}]
|
|
|
1090
1088
|
const errors = 0;
|
|
1091
1089
|
const gitConfig = ParseGitConfig.sync();
|
|
1092
1090
|
const warn = /* @__PURE__ */ __name((message) => {
|
|
1093
|
-
console.warn(
|
|
1091
|
+
console.warn(chalk15.yellow(`Warning: ${message}`));
|
|
1094
1092
|
warnings++;
|
|
1095
1093
|
}, "warn");
|
|
1096
1094
|
if (gitConfig.core.ignorecase) {
|
|
@@ -1110,13 +1108,13 @@ Gitlint Start [${process.cwd()}]
|
|
|
1110
1108
|
}
|
|
1111
1109
|
const resultMessages = [];
|
|
1112
1110
|
if (valid > 0) {
|
|
1113
|
-
resultMessages.push(
|
|
1111
|
+
resultMessages.push(chalk15.green(`Passed: ${valid}`));
|
|
1114
1112
|
}
|
|
1115
1113
|
if (warnings > 0) {
|
|
1116
|
-
resultMessages.push(
|
|
1114
|
+
resultMessages.push(chalk15.yellow(`Warnings: ${warnings}`));
|
|
1117
1115
|
}
|
|
1118
1116
|
if (errors > 0) {
|
|
1119
|
-
resultMessages.push(
|
|
1117
|
+
resultMessages.push(chalk15.red(` Errors: ${errors}`));
|
|
1120
1118
|
}
|
|
1121
1119
|
console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
|
|
1122
1120
|
`);
|
|
@@ -1125,7 +1123,7 @@ Gitlint Start [${process.cwd()}]
|
|
|
1125
1123
|
|
|
1126
1124
|
// src/actions/gitlint-fix.ts
|
|
1127
1125
|
import { execSync as execSync2 } from "node:child_process";
|
|
1128
|
-
import
|
|
1126
|
+
import chalk16 from "chalk";
|
|
1129
1127
|
import ParseGitConfig2 from "parse-git-config";
|
|
1130
1128
|
var gitlintFix = /* @__PURE__ */ __name(() => {
|
|
1131
1129
|
console.log(`
|
|
@@ -1136,19 +1134,19 @@ Gitlint Fix Start [${process.cwd()}]
|
|
|
1136
1134
|
execSync2("git config core.ignorecase false", {
|
|
1137
1135
|
stdio: "inherit"
|
|
1138
1136
|
});
|
|
1139
|
-
console.warn(
|
|
1137
|
+
console.warn(chalk16.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
|
|
1140
1138
|
}
|
|
1141
1139
|
if (gitConfig.core.autocrlf !== false) {
|
|
1142
1140
|
execSync2("git config core.autocrlf false", {
|
|
1143
1141
|
stdio: "inherit"
|
|
1144
1142
|
});
|
|
1145
|
-
console.warn(
|
|
1143
|
+
console.warn(chalk16.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
|
|
1146
1144
|
}
|
|
1147
1145
|
if (gitConfig.core.eol !== "lf") {
|
|
1148
1146
|
execSync2("git config core.eol lf", {
|
|
1149
1147
|
stdio: "inherit"
|
|
1150
1148
|
});
|
|
1151
|
-
console.warn(
|
|
1149
|
+
console.warn(chalk16.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
|
|
1152
1150
|
}
|
|
1153
1151
|
return 1;
|
|
1154
1152
|
}, "gitlintFix");
|
|
@@ -1168,7 +1166,7 @@ var knip = /* @__PURE__ */ __name(() => {
|
|
|
1168
1166
|
}, "knip");
|
|
1169
1167
|
|
|
1170
1168
|
// src/actions/license.ts
|
|
1171
|
-
import
|
|
1169
|
+
import chalk17 from "chalk";
|
|
1172
1170
|
import { init } from "license-checker";
|
|
1173
1171
|
var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
1174
1172
|
const workspaces = yarnWorkspaces();
|
|
@@ -1193,7 +1191,7 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
|
1193
1191
|
"LGPL-3.0-or-later",
|
|
1194
1192
|
"Python-2.0"
|
|
1195
1193
|
]);
|
|
1196
|
-
console.log(
|
|
1194
|
+
console.log(chalk17.green("License Checker"));
|
|
1197
1195
|
return (await Promise.all(workspaceList.map(({ location, name }) => {
|
|
1198
1196
|
return new Promise((resolve) => {
|
|
1199
1197
|
init({
|
|
@@ -1201,12 +1199,12 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
|
1201
1199
|
start: location
|
|
1202
1200
|
}, (error, packages) => {
|
|
1203
1201
|
if (error) {
|
|
1204
|
-
console.error(
|
|
1205
|
-
console.error(
|
|
1202
|
+
console.error(chalk17.red(`License Checker [${name}] Error`));
|
|
1203
|
+
console.error(chalk17.gray(error));
|
|
1206
1204
|
console.log("\n");
|
|
1207
1205
|
resolve(1);
|
|
1208
1206
|
} else {
|
|
1209
|
-
console.log(
|
|
1207
|
+
console.log(chalk17.green(`License Checker [${name}]`));
|
|
1210
1208
|
let count = 0;
|
|
1211
1209
|
for (const [name2, info] of Object.entries(packages)) {
|
|
1212
1210
|
const licenses = Array.isArray(info.licenses) ? info.licenses : [
|
|
@@ -1224,7 +1222,7 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
|
1224
1222
|
}
|
|
1225
1223
|
if (!orLicenseFound) {
|
|
1226
1224
|
count++;
|
|
1227
|
-
console.warn(
|
|
1225
|
+
console.warn(chalk17.yellow(`${name2}: Package License not allowed [${license2}]`));
|
|
1228
1226
|
}
|
|
1229
1227
|
}
|
|
1230
1228
|
}
|
|
@@ -1243,7 +1241,7 @@ var npmignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename2
|
|
|
1243
1241
|
|
|
1244
1242
|
// src/actions/package/clean-outputs.ts
|
|
1245
1243
|
import path3 from "node:path";
|
|
1246
|
-
import
|
|
1244
|
+
import chalk18 from "chalk";
|
|
1247
1245
|
var packageCleanOutputs = /* @__PURE__ */ __name(() => {
|
|
1248
1246
|
const pkg = process.env.INIT_CWD ?? ".";
|
|
1249
1247
|
const pkgName = process.env.npm_package_name;
|
|
@@ -1252,7 +1250,7 @@ var packageCleanOutputs = /* @__PURE__ */ __name(() => {
|
|
|
1252
1250
|
path3.join(pkg, "build"),
|
|
1253
1251
|
path3.join(pkg, "docs")
|
|
1254
1252
|
];
|
|
1255
|
-
console.log(
|
|
1253
|
+
console.log(chalk18.green(`Cleaning Outputs [${pkgName}]`));
|
|
1256
1254
|
for (let folder of folders) {
|
|
1257
1255
|
deleteGlob(folder);
|
|
1258
1256
|
}
|
|
@@ -1261,11 +1259,11 @@ var packageCleanOutputs = /* @__PURE__ */ __name(() => {
|
|
|
1261
1259
|
|
|
1262
1260
|
// src/actions/package/clean-typescript.ts
|
|
1263
1261
|
import path4 from "node:path";
|
|
1264
|
-
import
|
|
1262
|
+
import chalk19 from "chalk";
|
|
1265
1263
|
var packageCleanTypescript = /* @__PURE__ */ __name(() => {
|
|
1266
1264
|
const pkg = process.env.INIT_CWD ?? ".";
|
|
1267
1265
|
const pkgName = process.env.npm_package_name;
|
|
1268
|
-
console.log(
|
|
1266
|
+
console.log(chalk19.green(`Cleaning Typescript [${pkgName}]`));
|
|
1269
1267
|
const files = [
|
|
1270
1268
|
path4.join(pkg, "*.tsbuildinfo"),
|
|
1271
1269
|
path4.join(pkg, ".tsconfig.*"),
|
|
@@ -1286,19 +1284,19 @@ var packageClean = /* @__PURE__ */ __name(async () => {
|
|
|
1286
1284
|
}, "packageClean");
|
|
1287
1285
|
|
|
1288
1286
|
// src/actions/package/compile/compile.ts
|
|
1289
|
-
import
|
|
1287
|
+
import chalk23 from "chalk";
|
|
1290
1288
|
|
|
1291
1289
|
// src/actions/package/publint.ts
|
|
1292
1290
|
import { promises as fs2 } from "node:fs";
|
|
1293
|
-
import
|
|
1291
|
+
import chalk20 from "chalk";
|
|
1294
1292
|
import sortPackageJson from "sort-package-json";
|
|
1295
1293
|
var packagePublint = /* @__PURE__ */ __name(async (params) => {
|
|
1296
1294
|
const pkgDir = process.env.INIT_CWD;
|
|
1297
1295
|
const sortedPkg = sortPackageJson(await fs2.readFile(`${pkgDir}/package.json`, "utf8"));
|
|
1298
1296
|
await fs2.writeFile(`${pkgDir}/package.json`, sortedPkg);
|
|
1299
1297
|
const pkg = JSON.parse(await fs2.readFile(`${pkgDir}/package.json`, "utf8"));
|
|
1300
|
-
console.log(
|
|
1301
|
-
console.log(
|
|
1298
|
+
console.log(chalk20.green(`Publint: ${pkg.name}`));
|
|
1299
|
+
console.log(chalk20.gray(pkgDir));
|
|
1302
1300
|
const { publint: publint2 } = await import("publint");
|
|
1303
1301
|
const { messages } = await publint2({
|
|
1304
1302
|
level: "suggestion",
|
|
@@ -1313,21 +1311,21 @@ var packagePublint = /* @__PURE__ */ __name(async (params) => {
|
|
|
1313
1311
|
for (const message of validMessages) {
|
|
1314
1312
|
switch (message.type) {
|
|
1315
1313
|
case "error": {
|
|
1316
|
-
console.error(
|
|
1314
|
+
console.error(chalk20.red(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
1317
1315
|
break;
|
|
1318
1316
|
}
|
|
1319
1317
|
case "warning": {
|
|
1320
|
-
console.warn(
|
|
1318
|
+
console.warn(chalk20.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
1321
1319
|
break;
|
|
1322
1320
|
}
|
|
1323
1321
|
default: {
|
|
1324
|
-
console.log(
|
|
1322
|
+
console.log(chalk20.white(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
1325
1323
|
break;
|
|
1326
1324
|
}
|
|
1327
1325
|
}
|
|
1328
1326
|
}
|
|
1329
1327
|
if (params?.verbose) {
|
|
1330
|
-
console.log(
|
|
1328
|
+
console.log(chalk20.gray(`Publint [Finish]: ${pkgDir} [${validMessages.length}]`));
|
|
1331
1329
|
}
|
|
1332
1330
|
return validMessages.filter((message) => message.type === "error").length;
|
|
1333
1331
|
}, "packagePublint");
|
|
@@ -1371,7 +1369,7 @@ var buildEntries = /* @__PURE__ */ __name((folder, entryMode = "single", exclude
|
|
|
1371
1369
|
|
|
1372
1370
|
// src/actions/package/compile/packageCompileTscTypes.ts
|
|
1373
1371
|
import { cwd } from "node:process";
|
|
1374
|
-
import
|
|
1372
|
+
import chalk21 from "chalk";
|
|
1375
1373
|
import { createProgramFromConfig } from "tsc-prog";
|
|
1376
1374
|
import { DiagnosticCategory, formatDiagnosticsWithColorAndContext, getPreEmitDiagnostics, sys as sys2 } from "typescript";
|
|
1377
1375
|
|
|
@@ -1428,7 +1426,7 @@ var packageCompileTscTypes = /* @__PURE__ */ __name((folder = "src", config2 = {
|
|
|
1428
1426
|
".spec."
|
|
1429
1427
|
];
|
|
1430
1428
|
const files = buildEntries(folder, "all", verbose).filter((file) => validTsExt.find((ext) => file.endsWith(ext)) && !excludes.some((exclude) => file.includes(exclude)));
|
|
1431
|
-
console.log(
|
|
1429
|
+
console.log(chalk21.green(`Compiling Types ${pkg}: ${files.length}`));
|
|
1432
1430
|
if (files.length > 0) {
|
|
1433
1431
|
const program = createProgramFromConfig({
|
|
1434
1432
|
basePath: pkg ?? cwd(),
|
|
@@ -1490,7 +1488,7 @@ __name(deepMergeObjects, "deepMergeObjects");
|
|
|
1490
1488
|
|
|
1491
1489
|
// src/actions/package/compile/packageCompileTsc.ts
|
|
1492
1490
|
import { cwd as cwd2 } from "node:process";
|
|
1493
|
-
import
|
|
1491
|
+
import chalk22 from "chalk";
|
|
1494
1492
|
import { createProgramFromConfig as createProgramFromConfig2 } from "tsc-prog";
|
|
1495
1493
|
import { DiagnosticCategory as DiagnosticCategory2, formatDiagnosticsWithColorAndContext as formatDiagnosticsWithColorAndContext2, getPreEmitDiagnostics as getPreEmitDiagnostics2, sys as sys3 } from "typescript";
|
|
1496
1494
|
var packageCompileTsc = /* @__PURE__ */ __name((folder = "src", config2 = {}, compilerOptionsParam) => {
|
|
@@ -1525,7 +1523,7 @@ var packageCompileTsc = /* @__PURE__ */ __name((folder = "src", config2 = {}, co
|
|
|
1525
1523
|
".d.mts"
|
|
1526
1524
|
];
|
|
1527
1525
|
const files = buildEntries(folder, "all", verbose).filter((file) => validTsExt.find((ext) => file.endsWith(ext)) && includes.find((include) => file.includes(include)));
|
|
1528
|
-
console.log(
|
|
1526
|
+
console.log(chalk22.green(`Compiling Files ${pkg}: ${files.length}`));
|
|
1529
1527
|
if (files.length > 0) {
|
|
1530
1528
|
const program = createProgramFromConfig2({
|
|
1531
1529
|
basePath: pkg ?? cwd2(),
|
|
@@ -1685,7 +1683,7 @@ var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
|
|
|
1685
1683
|
// src/actions/package/compile/compile.ts
|
|
1686
1684
|
var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
|
|
1687
1685
|
const pkg = process.env.INIT_CWD;
|
|
1688
|
-
console.log(
|
|
1686
|
+
console.log(chalk23.green(`Compiling ${pkg}`));
|
|
1689
1687
|
const config2 = await loadConfig(inConfig);
|
|
1690
1688
|
const publint2 = config2.publint;
|
|
1691
1689
|
const tsupResults = await packageCompileTsup(config2);
|
|
@@ -1697,7 +1695,7 @@ var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
|
|
|
1697
1695
|
|
|
1698
1696
|
// src/actions/package/copy-assets.ts
|
|
1699
1697
|
import path5 from "node:path/posix";
|
|
1700
|
-
import
|
|
1698
|
+
import chalk24 from "chalk";
|
|
1701
1699
|
import cpy2 from "cpy";
|
|
1702
1700
|
var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) => {
|
|
1703
1701
|
try {
|
|
@@ -1716,7 +1714,7 @@ var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) =>
|
|
|
1716
1714
|
flat: false
|
|
1717
1715
|
});
|
|
1718
1716
|
if (values.length > 0) {
|
|
1719
|
-
console.log(
|
|
1717
|
+
console.log(chalk24.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
|
|
1720
1718
|
}
|
|
1721
1719
|
for (const value of values) {
|
|
1722
1720
|
console.log(`${value.split("/").pop()} => ./dist/${target}`);
|
|
@@ -1745,7 +1743,7 @@ var packageCopyAssets = /* @__PURE__ */ __name(async ({ target }) => {
|
|
|
1745
1743
|
}, "packageCopyAssets");
|
|
1746
1744
|
|
|
1747
1745
|
// src/actions/package/cycle.ts
|
|
1748
|
-
import { cruise } from "dependency-cruiser";
|
|
1746
|
+
import { cruise as cruise2 } from "dependency-cruiser";
|
|
1749
1747
|
var packageCycle = /* @__PURE__ */ __name(async ({ verbose = false }) => {
|
|
1750
1748
|
const pkg = process.env.INIT_CWD;
|
|
1751
1749
|
const pkgName = process.env.npm_package_name;
|
|
@@ -1774,7 +1772,7 @@ var packageCycle = /* @__PURE__ */ __name(async ({ verbose = false }) => {
|
|
|
1774
1772
|
};
|
|
1775
1773
|
const target = `${pkg}/src`;
|
|
1776
1774
|
console.log(`Checking for circular dependencies in ${target}...`);
|
|
1777
|
-
const result = await
|
|
1775
|
+
const result = await cruise2([
|
|
1778
1776
|
target
|
|
1779
1777
|
], cruiseOptions);
|
|
1780
1778
|
if (result.output) {
|
|
@@ -1791,7 +1789,7 @@ var packageCycle = /* @__PURE__ */ __name(async ({ verbose = false }) => {
|
|
|
1791
1789
|
// src/actions/package/gen-docs.ts
|
|
1792
1790
|
import { existsSync as existsSync4 } from "node:fs";
|
|
1793
1791
|
import path6 from "node:path";
|
|
1794
|
-
import
|
|
1792
|
+
import chalk25 from "chalk";
|
|
1795
1793
|
import { Application, ArgumentsReader, TSConfigReader, TypeDocReader } from "typedoc";
|
|
1796
1794
|
var ExitCodes = {
|
|
1797
1795
|
CompileError: 3,
|
|
@@ -1893,7 +1891,7 @@ var runTypeDoc = /* @__PURE__ */ __name(async (app) => {
|
|
|
1893
1891
|
return ExitCodes.OutputError;
|
|
1894
1892
|
}
|
|
1895
1893
|
}
|
|
1896
|
-
console.log(
|
|
1894
|
+
console.log(chalk25.green(`${pkgName} - Ok`));
|
|
1897
1895
|
return ExitCodes.Ok;
|
|
1898
1896
|
}, "runTypeDoc");
|
|
1899
1897
|
|
|
@@ -1902,7 +1900,7 @@ import { readdirSync } from "node:fs";
|
|
|
1902
1900
|
import path7 from "node:path";
|
|
1903
1901
|
import { cwd as cwd3 } from "node:process";
|
|
1904
1902
|
import { pathToFileURL } from "node:url";
|
|
1905
|
-
import
|
|
1903
|
+
import chalk26 from "chalk";
|
|
1906
1904
|
import { ESLint } from "eslint";
|
|
1907
1905
|
import { findUp } from "find-up";
|
|
1908
1906
|
import picomatch from "picomatch";
|
|
@@ -1919,10 +1917,10 @@ var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
|
|
|
1919
1917
|
];
|
|
1920
1918
|
for (const lintResult of lintResults) {
|
|
1921
1919
|
if (lintResult.messages.length > 0) {
|
|
1922
|
-
console.log(
|
|
1920
|
+
console.log(chalk26.gray(`
|
|
1923
1921
|
${lintResult.filePath}`));
|
|
1924
1922
|
for (const message of lintResult.messages) {
|
|
1925
|
-
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}`));
|
|
1926
1924
|
}
|
|
1927
1925
|
}
|
|
1928
1926
|
}
|
|
@@ -1977,7 +1975,7 @@ var packageLint = /* @__PURE__ */ __name(async (fix2 = false, verbose = false, c
|
|
|
1977
1975
|
});
|
|
1978
1976
|
const files = getFiles(cwd3(), ignoreFolders);
|
|
1979
1977
|
if (verbose) {
|
|
1980
|
-
console.log(
|
|
1978
|
+
console.log(chalk26.green(`Linting ${pkg} [files = ${files.length}]`));
|
|
1981
1979
|
}
|
|
1982
1980
|
const lintResults = await engine.lintFiles(files);
|
|
1983
1981
|
dumpMessages(lintResults);
|
|
@@ -1987,7 +1985,7 @@ var packageLint = /* @__PURE__ */ __name(async (fix2 = false, verbose = false, c
|
|
|
1987
1985
|
const filesCountColor = files.length < 100 ? "green" : files.length < 1e3 ? "yellow" : "red";
|
|
1988
1986
|
const lintTime = Date.now() - start;
|
|
1989
1987
|
const lintTimeColor = lintTime < 1e3 ? "green" : lintTime < 3e3 ? "yellow" : "red";
|
|
1990
|
-
console.log(
|
|
1988
|
+
console.log(chalk26.white(`Linted ${chalk26[filesCountColor](files.length)} files in ${chalk26[lintTimeColor](lintTime)}ms`));
|
|
1991
1989
|
return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
|
|
1992
1990
|
}, "packageLint");
|
|
1993
1991
|
|
|
@@ -2054,7 +2052,7 @@ var rebuild = /* @__PURE__ */ __name(({ target }) => {
|
|
|
2054
2052
|
}, "rebuild");
|
|
2055
2053
|
|
|
2056
2054
|
// src/actions/recompile.ts
|
|
2057
|
-
import
|
|
2055
|
+
import chalk27 from "chalk";
|
|
2058
2056
|
var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incremental }) => {
|
|
2059
2057
|
return pkg ? await recompilePackage({
|
|
2060
2058
|
pkg,
|
|
@@ -2109,7 +2107,7 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
|
|
|
2109
2107
|
`${jobs}`
|
|
2110
2108
|
] : [];
|
|
2111
2109
|
if (jobs) {
|
|
2112
|
-
console.log(
|
|
2110
|
+
console.log(chalk27.blue(`Jobs set to [${jobs}]`));
|
|
2113
2111
|
}
|
|
2114
2112
|
const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
|
|
2115
2113
|
[
|
|
@@ -2139,7 +2137,7 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
|
|
|
2139
2137
|
]
|
|
2140
2138
|
]
|
|
2141
2139
|
]);
|
|
2142
|
-
console.log(`${
|
|
2140
|
+
console.log(`${chalk27.gray("Recompiled in")} [${chalk27.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk27.gray("seconds")}`);
|
|
2143
2141
|
return result;
|
|
2144
2142
|
}, "recompileAll");
|
|
2145
2143
|
|
|
@@ -2173,9 +2171,9 @@ var reinstall = /* @__PURE__ */ __name(() => {
|
|
|
2173
2171
|
}, "reinstall");
|
|
2174
2172
|
|
|
2175
2173
|
// src/actions/relint.ts
|
|
2176
|
-
import
|
|
2174
|
+
import chalk28 from "chalk";
|
|
2177
2175
|
var relintPackage = /* @__PURE__ */ __name(({ pkg }) => {
|
|
2178
|
-
console.log(
|
|
2176
|
+
console.log(chalk28.gray(`${"Relint"} [All-Packages]`));
|
|
2179
2177
|
const start = Date.now();
|
|
2180
2178
|
const result = runSteps("Relint [All-Packages]", [
|
|
2181
2179
|
[
|
|
@@ -2188,7 +2186,7 @@ var relintPackage = /* @__PURE__ */ __name(({ pkg }) => {
|
|
|
2188
2186
|
]
|
|
2189
2187
|
]
|
|
2190
2188
|
]);
|
|
2191
|
-
console.log(
|
|
2189
|
+
console.log(chalk28.gray(`${"Relinted in"} [${chalk28.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk28.gray("seconds")}`));
|
|
2192
2190
|
return result;
|
|
2193
2191
|
}, "relintPackage");
|
|
2194
2192
|
var relint = /* @__PURE__ */ __name(({ pkg, verbose, incremental } = {}) => {
|
|
@@ -2200,7 +2198,7 @@ var relint = /* @__PURE__ */ __name(({ pkg, verbose, incremental } = {}) => {
|
|
|
2200
2198
|
});
|
|
2201
2199
|
}, "relint");
|
|
2202
2200
|
var relintAllPackages = /* @__PURE__ */ __name(({ verbose = true, incremental } = {}) => {
|
|
2203
|
-
console.log(
|
|
2201
|
+
console.log(chalk28.gray(`${"Relint"} [All-Packages]`));
|
|
2204
2202
|
const start = Date.now();
|
|
2205
2203
|
const verboseOptions = verbose ? [
|
|
2206
2204
|
"--verbose"
|
|
@@ -2227,7 +2225,7 @@ var relintAllPackages = /* @__PURE__ */ __name(({ verbose = true, incremental }
|
|
|
2227
2225
|
]
|
|
2228
2226
|
]
|
|
2229
2227
|
]);
|
|
2230
|
-
console.log(
|
|
2228
|
+
console.log(chalk28.gray(`Relinted in [${chalk28.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk28.gray("seconds")}`));
|
|
2231
2229
|
return result;
|
|
2232
2230
|
}, "relintAllPackages");
|
|
2233
2231
|
|
|
@@ -2267,7 +2265,7 @@ var sonar = /* @__PURE__ */ __name(() => {
|
|
|
2267
2265
|
}, "sonar");
|
|
2268
2266
|
|
|
2269
2267
|
// src/actions/statics.ts
|
|
2270
|
-
import
|
|
2268
|
+
import chalk29 from "chalk";
|
|
2271
2269
|
var DefaultDependencies = [
|
|
2272
2270
|
"axios",
|
|
2273
2271
|
"@xylabs/pixel",
|
|
@@ -2278,7 +2276,7 @@ var DefaultDependencies = [
|
|
|
2278
2276
|
"@mui/system"
|
|
2279
2277
|
];
|
|
2280
2278
|
var statics = /* @__PURE__ */ __name(() => {
|
|
2281
|
-
console.log(
|
|
2279
|
+
console.log(chalk29.green("Check Required Static Dependencies"));
|
|
2282
2280
|
const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
|
|
2283
2281
|
return detectDuplicateDependencies(statics2, DefaultDependencies);
|
|
2284
2282
|
}, "statics");
|