@xylabs/ts-scripts-yarn3 6.2.1 → 6.3.1
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 +12 -1
- package/dist/actions/build.mjs.map +1 -1
- package/dist/actions/cycle.mjs +164 -21
- package/dist/actions/cycle.mjs.map +1 -1
- package/dist/actions/index.mjs +187 -85
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/package/compile/compile.mjs +0 -1
- package/dist/actions/package/compile/compile.mjs.map +1 -1
- package/dist/actions/package/compile/compileTypes.mjs +0 -1
- package/dist/actions/package/compile/compileTypes.mjs.map +1 -1
- package/dist/actions/package/compile/index.mjs +0 -1
- package/dist/actions/package/compile/index.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTsup.mjs +0 -1
- package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
- package/dist/actions/package/cycle.mjs +49 -0
- package/dist/actions/package/cycle.mjs.map +1 -0
- package/dist/actions/package/index.mjs +44 -1
- package/dist/actions/package/index.mjs.map +1 -1
- package/dist/actions/package/recompile.mjs +0 -1
- package/dist/actions/package/recompile.mjs.map +1 -1
- package/dist/bin/package/build-only.mjs +0 -1
- package/dist/bin/package/build-only.mjs.map +1 -1
- package/dist/bin/package/build.mjs +0 -1
- package/dist/bin/package/build.mjs.map +1 -1
- package/dist/bin/package/compile-only.mjs +0 -1
- package/dist/bin/package/compile-only.mjs.map +1 -1
- package/dist/bin/package/compile-tsup.mjs +0 -1
- package/dist/bin/package/compile-tsup.mjs.map +1 -1
- package/dist/bin/package/compile-types.mjs +0 -1
- package/dist/bin/package/compile-types.mjs.map +1 -1
- package/dist/bin/package/compile.mjs +0 -1
- package/dist/bin/package/compile.mjs.map +1 -1
- package/dist/bin/package/cycle.mjs +62 -0
- package/dist/bin/package/cycle.mjs.map +1 -0
- package/dist/bin/package/recompile.mjs +0 -1
- package/dist/bin/package/recompile.mjs.map +1 -1
- package/dist/bin/xy.mjs +125 -68
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +18 -2
- package/dist/index.mjs +200 -98
- package/dist/index.mjs.map +1 -1
- package/dist/xy/index.mjs +125 -68
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/xy.mjs +125 -68
- package/dist/xy/xy.mjs.map +1 -1
- package/dist/xy/xyBuildCommands.mjs +12 -1
- package/dist/xy/xyBuildCommands.mjs.map +1 -1
- package/dist/xy/xyLintCommands.mjs +88 -42
- package/dist/xy/xyLintCommands.mjs.map +1 -1
- package/package.json +16 -14
package/dist/actions/index.mjs
CHANGED
|
@@ -476,9 +476,10 @@ var build = /* @__PURE__ */ __name(async ({ incremental, jobs, target, verbose,
|
|
|
476
476
|
"yarn",
|
|
477
477
|
[
|
|
478
478
|
"xy",
|
|
479
|
-
"
|
|
479
|
+
"cycle",
|
|
480
480
|
...pkgOptions,
|
|
481
481
|
...verboseOptions,
|
|
482
|
+
...jobsOptions,
|
|
482
483
|
...incrementalOptions
|
|
483
484
|
]
|
|
484
485
|
],
|
|
@@ -503,6 +504,16 @@ var build = /* @__PURE__ */ __name(async ({ incremental, jobs, target, verbose,
|
|
|
503
504
|
...jobsOptions,
|
|
504
505
|
...incrementalOptions
|
|
505
506
|
]
|
|
507
|
+
],
|
|
508
|
+
[
|
|
509
|
+
"yarn",
|
|
510
|
+
[
|
|
511
|
+
"xy",
|
|
512
|
+
"lint",
|
|
513
|
+
...pkgOptions,
|
|
514
|
+
...verboseOptions,
|
|
515
|
+
...incrementalOptions
|
|
516
|
+
]
|
|
506
517
|
]
|
|
507
518
|
]);
|
|
508
519
|
console.log(`${chalk8.gray("Built in")} [${chalk8.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk8.gray("seconds")}`);
|
|
@@ -776,30 +787,76 @@ var copyAssets = /* @__PURE__ */ __name(async ({ target, pkg }) => {
|
|
|
776
787
|
}, "copyAssets");
|
|
777
788
|
|
|
778
789
|
// src/actions/cycle.ts
|
|
779
|
-
import
|
|
780
|
-
var cycle = /* @__PURE__ */ __name(
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
maxDepth: 10
|
|
789
|
-
}
|
|
790
|
-
]
|
|
791
|
-
}
|
|
792
|
-
}
|
|
790
|
+
import chalk13 from "chalk";
|
|
791
|
+
var cycle = /* @__PURE__ */ __name(({ verbose, pkg, incremental, jobs } = {}) => {
|
|
792
|
+
return pkg ? cyclePackage({
|
|
793
|
+
pkg,
|
|
794
|
+
verbose
|
|
795
|
+
}) : cycleAll({
|
|
796
|
+
incremental,
|
|
797
|
+
verbose,
|
|
798
|
+
jobs
|
|
793
799
|
});
|
|
794
|
-
const results = await eslint.lintFiles([
|
|
795
|
-
"src/**/*.ts*",
|
|
796
|
-
"packages/**/src/**/*.ts*"
|
|
797
|
-
]);
|
|
798
|
-
const formatter = await eslint.loadFormatter("stylish");
|
|
799
|
-
const resultText = formatter.format(results);
|
|
800
|
-
console.log(resultText);
|
|
801
|
-
return results.length;
|
|
802
800
|
}, "cycle");
|
|
801
|
+
var cyclePackage = /* @__PURE__ */ __name(({ pkg, verbose }) => {
|
|
802
|
+
const verboseOptions = verbose ? [
|
|
803
|
+
"--verbose"
|
|
804
|
+
] : [
|
|
805
|
+
"--no-verbose"
|
|
806
|
+
];
|
|
807
|
+
return runSteps(`Cycle [${pkg}]`, [
|
|
808
|
+
[
|
|
809
|
+
"yarn",
|
|
810
|
+
[
|
|
811
|
+
"workspace",
|
|
812
|
+
pkg,
|
|
813
|
+
"run",
|
|
814
|
+
"package-cycle",
|
|
815
|
+
...verboseOptions
|
|
816
|
+
]
|
|
817
|
+
]
|
|
818
|
+
]);
|
|
819
|
+
}, "cyclePackage");
|
|
820
|
+
var cycleAll = /* @__PURE__ */ __name(({ jobs, verbose, incremental }) => {
|
|
821
|
+
const start = Date.now();
|
|
822
|
+
const verboseOptions = verbose ? [
|
|
823
|
+
"--verbose"
|
|
824
|
+
] : [
|
|
825
|
+
"--no-verbose"
|
|
826
|
+
];
|
|
827
|
+
const incrementalOptions = incremental ? [
|
|
828
|
+
"--since",
|
|
829
|
+
"-Ap",
|
|
830
|
+
"--topological-dev"
|
|
831
|
+
] : [
|
|
832
|
+
"--parallel",
|
|
833
|
+
"-Ap"
|
|
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
|
|
854
|
+
]
|
|
855
|
+
]
|
|
856
|
+
]);
|
|
857
|
+
console.log(`${chalk13.gray("Cycles Checked in")} [${chalk13.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk13.gray("seconds")}`);
|
|
858
|
+
return result;
|
|
859
|
+
}, "cycleAll");
|
|
803
860
|
|
|
804
861
|
// src/actions/dead.ts
|
|
805
862
|
var dead = /* @__PURE__ */ __name(() => {
|
|
@@ -920,18 +977,18 @@ var deployNext = /* @__PURE__ */ __name(() => {
|
|
|
920
977
|
}, "deployNext");
|
|
921
978
|
|
|
922
979
|
// src/actions/dupdeps.ts
|
|
923
|
-
import
|
|
980
|
+
import chalk14 from "chalk";
|
|
924
981
|
var dupdeps = /* @__PURE__ */ __name(() => {
|
|
925
|
-
console.log(
|
|
982
|
+
console.log(chalk14.green("Checking all Dependencies for Duplicates"));
|
|
926
983
|
const allDependencies = parsedPackageJSON()?.dependencies;
|
|
927
984
|
const dependencies = Object.entries(allDependencies).map(([k]) => k);
|
|
928
985
|
return detectDuplicateDependencies(dependencies);
|
|
929
986
|
}, "dupdeps");
|
|
930
987
|
|
|
931
988
|
// src/actions/lint.ts
|
|
932
|
-
import
|
|
989
|
+
import chalk15 from "chalk";
|
|
933
990
|
var lintPackage = /* @__PURE__ */ __name(({ pkg, fix: fix2 }) => {
|
|
934
|
-
console.log(
|
|
991
|
+
console.log(chalk15.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
|
|
935
992
|
const start = Date.now();
|
|
936
993
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
|
|
937
994
|
[
|
|
@@ -944,7 +1001,7 @@ var lintPackage = /* @__PURE__ */ __name(({ pkg, fix: fix2 }) => {
|
|
|
944
1001
|
]
|
|
945
1002
|
]
|
|
946
1003
|
]);
|
|
947
|
-
console.log(
|
|
1004
|
+
console.log(chalk15.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk15.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk15.gray("seconds")}`));
|
|
948
1005
|
return result;
|
|
949
1006
|
}, "lintPackage");
|
|
950
1007
|
var lint = /* @__PURE__ */ __name(({ pkg, verbose, incremental, fix: fix2 } = {}) => {
|
|
@@ -958,7 +1015,7 @@ var lint = /* @__PURE__ */ __name(({ pkg, verbose, incremental, fix: fix2 } = {}
|
|
|
958
1015
|
});
|
|
959
1016
|
}, "lint");
|
|
960
1017
|
var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2 = false } = {}) => {
|
|
961
|
-
console.log(
|
|
1018
|
+
console.log(chalk15.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
|
|
962
1019
|
const start = Date.now();
|
|
963
1020
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
|
|
964
1021
|
[
|
|
@@ -968,7 +1025,7 @@ var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2 = false } = {}) => {
|
|
|
968
1025
|
]
|
|
969
1026
|
]
|
|
970
1027
|
]);
|
|
971
|
-
console.log(
|
|
1028
|
+
console.log(chalk15.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk15.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk15.gray("seconds")}`));
|
|
972
1029
|
return result;
|
|
973
1030
|
}, "lintAllPackages");
|
|
974
1031
|
|
|
@@ -1033,7 +1090,7 @@ var filename = ".gitignore";
|
|
|
1033
1090
|
var gitignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename, pkg), "gitignoreGen");
|
|
1034
1091
|
|
|
1035
1092
|
// src/actions/gitlint.ts
|
|
1036
|
-
import
|
|
1093
|
+
import chalk16 from "chalk";
|
|
1037
1094
|
import ParseGitConfig from "parse-git-config";
|
|
1038
1095
|
var gitlint = /* @__PURE__ */ __name(() => {
|
|
1039
1096
|
console.log(`
|
|
@@ -1044,7 +1101,7 @@ Gitlint Start [${process.cwd()}]
|
|
|
1044
1101
|
const errors = 0;
|
|
1045
1102
|
const gitConfig = ParseGitConfig.sync();
|
|
1046
1103
|
const warn = /* @__PURE__ */ __name((message) => {
|
|
1047
|
-
console.warn(
|
|
1104
|
+
console.warn(chalk16.yellow(`Warning: ${message}`));
|
|
1048
1105
|
warnings++;
|
|
1049
1106
|
}, "warn");
|
|
1050
1107
|
if (gitConfig.core.ignorecase) {
|
|
@@ -1064,13 +1121,13 @@ Gitlint Start [${process.cwd()}]
|
|
|
1064
1121
|
}
|
|
1065
1122
|
const resultMessages = [];
|
|
1066
1123
|
if (valid > 0) {
|
|
1067
|
-
resultMessages.push(
|
|
1124
|
+
resultMessages.push(chalk16.green(`Passed: ${valid}`));
|
|
1068
1125
|
}
|
|
1069
1126
|
if (warnings > 0) {
|
|
1070
|
-
resultMessages.push(
|
|
1127
|
+
resultMessages.push(chalk16.yellow(`Warnings: ${warnings}`));
|
|
1071
1128
|
}
|
|
1072
1129
|
if (errors > 0) {
|
|
1073
|
-
resultMessages.push(
|
|
1130
|
+
resultMessages.push(chalk16.red(` Errors: ${errors}`));
|
|
1074
1131
|
}
|
|
1075
1132
|
console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
|
|
1076
1133
|
`);
|
|
@@ -1079,7 +1136,7 @@ Gitlint Start [${process.cwd()}]
|
|
|
1079
1136
|
|
|
1080
1137
|
// src/actions/gitlint-fix.ts
|
|
1081
1138
|
import { execSync as execSync2 } from "node:child_process";
|
|
1082
|
-
import
|
|
1139
|
+
import chalk17 from "chalk";
|
|
1083
1140
|
import ParseGitConfig2 from "parse-git-config";
|
|
1084
1141
|
var gitlintFix = /* @__PURE__ */ __name(() => {
|
|
1085
1142
|
console.log(`
|
|
@@ -1090,19 +1147,19 @@ Gitlint Fix Start [${process.cwd()}]
|
|
|
1090
1147
|
execSync2("git config core.ignorecase false", {
|
|
1091
1148
|
stdio: "inherit"
|
|
1092
1149
|
});
|
|
1093
|
-
console.warn(
|
|
1150
|
+
console.warn(chalk17.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
|
|
1094
1151
|
}
|
|
1095
1152
|
if (gitConfig.core.autocrlf !== false) {
|
|
1096
1153
|
execSync2("git config core.autocrlf false", {
|
|
1097
1154
|
stdio: "inherit"
|
|
1098
1155
|
});
|
|
1099
|
-
console.warn(
|
|
1156
|
+
console.warn(chalk17.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
|
|
1100
1157
|
}
|
|
1101
1158
|
if (gitConfig.core.eol !== "lf") {
|
|
1102
1159
|
execSync2("git config core.eol lf", {
|
|
1103
1160
|
stdio: "inherit"
|
|
1104
1161
|
});
|
|
1105
|
-
console.warn(
|
|
1162
|
+
console.warn(chalk17.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
|
|
1106
1163
|
}
|
|
1107
1164
|
return 1;
|
|
1108
1165
|
}, "gitlintFix");
|
|
@@ -1122,7 +1179,7 @@ var knip = /* @__PURE__ */ __name(() => {
|
|
|
1122
1179
|
}, "knip");
|
|
1123
1180
|
|
|
1124
1181
|
// src/actions/license.ts
|
|
1125
|
-
import
|
|
1182
|
+
import chalk18 from "chalk";
|
|
1126
1183
|
import { init } from "license-checker";
|
|
1127
1184
|
var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
1128
1185
|
const workspaces = yarnWorkspaces();
|
|
@@ -1147,7 +1204,7 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
|
1147
1204
|
"LGPL-3.0-or-later",
|
|
1148
1205
|
"Python-2.0"
|
|
1149
1206
|
]);
|
|
1150
|
-
console.log(
|
|
1207
|
+
console.log(chalk18.green("License Checker"));
|
|
1151
1208
|
return (await Promise.all(workspaceList.map(({ location, name }) => {
|
|
1152
1209
|
return new Promise((resolve) => {
|
|
1153
1210
|
init({
|
|
@@ -1155,12 +1212,12 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
|
1155
1212
|
start: location
|
|
1156
1213
|
}, (error, packages) => {
|
|
1157
1214
|
if (error) {
|
|
1158
|
-
console.error(
|
|
1159
|
-
console.error(
|
|
1215
|
+
console.error(chalk18.red(`License Checker [${name}] Error`));
|
|
1216
|
+
console.error(chalk18.gray(error));
|
|
1160
1217
|
console.log("\n");
|
|
1161
1218
|
resolve(1);
|
|
1162
1219
|
} else {
|
|
1163
|
-
console.log(
|
|
1220
|
+
console.log(chalk18.green(`License Checker [${name}]`));
|
|
1164
1221
|
let count = 0;
|
|
1165
1222
|
for (const [name2, info] of Object.entries(packages)) {
|
|
1166
1223
|
const licenses = Array.isArray(info.licenses) ? info.licenses : [
|
|
@@ -1178,7 +1235,7 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
|
1178
1235
|
}
|
|
1179
1236
|
if (!orLicenseFound) {
|
|
1180
1237
|
count++;
|
|
1181
|
-
console.warn(
|
|
1238
|
+
console.warn(chalk18.yellow(`${name2}: Package License not allowed [${license2}]`));
|
|
1182
1239
|
}
|
|
1183
1240
|
}
|
|
1184
1241
|
}
|
|
@@ -1197,7 +1254,7 @@ var npmignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename2
|
|
|
1197
1254
|
|
|
1198
1255
|
// src/actions/package/clean-outputs.ts
|
|
1199
1256
|
import path3 from "node:path";
|
|
1200
|
-
import
|
|
1257
|
+
import chalk19 from "chalk";
|
|
1201
1258
|
var packageCleanOutputs = /* @__PURE__ */ __name(() => {
|
|
1202
1259
|
const pkg = process.env.INIT_CWD ?? ".";
|
|
1203
1260
|
const pkgName = process.env.npm_package_name;
|
|
@@ -1206,7 +1263,7 @@ var packageCleanOutputs = /* @__PURE__ */ __name(() => {
|
|
|
1206
1263
|
path3.join(pkg, "build"),
|
|
1207
1264
|
path3.join(pkg, "docs")
|
|
1208
1265
|
];
|
|
1209
|
-
console.log(
|
|
1266
|
+
console.log(chalk19.green(`Cleaning Outputs [${pkgName}]`));
|
|
1210
1267
|
for (let folder of folders) {
|
|
1211
1268
|
deleteGlob(folder);
|
|
1212
1269
|
}
|
|
@@ -1215,11 +1272,11 @@ var packageCleanOutputs = /* @__PURE__ */ __name(() => {
|
|
|
1215
1272
|
|
|
1216
1273
|
// src/actions/package/clean-typescript.ts
|
|
1217
1274
|
import path4 from "node:path";
|
|
1218
|
-
import
|
|
1275
|
+
import chalk20 from "chalk";
|
|
1219
1276
|
var packageCleanTypescript = /* @__PURE__ */ __name(() => {
|
|
1220
1277
|
const pkg = process.env.INIT_CWD ?? ".";
|
|
1221
1278
|
const pkgName = process.env.npm_package_name;
|
|
1222
|
-
console.log(
|
|
1279
|
+
console.log(chalk20.green(`Cleaning Typescript [${pkgName}]`));
|
|
1223
1280
|
const files = [
|
|
1224
1281
|
path4.join(pkg, "*.tsbuildinfo"),
|
|
1225
1282
|
path4.join(pkg, ".tsconfig.*"),
|
|
@@ -1240,19 +1297,19 @@ var packageClean = /* @__PURE__ */ __name(async () => {
|
|
|
1240
1297
|
}, "packageClean");
|
|
1241
1298
|
|
|
1242
1299
|
// src/actions/package/compile/compile.ts
|
|
1243
|
-
import
|
|
1300
|
+
import chalk24 from "chalk";
|
|
1244
1301
|
|
|
1245
1302
|
// src/actions/package/publint.ts
|
|
1246
1303
|
import { promises as fs2 } from "node:fs";
|
|
1247
|
-
import
|
|
1304
|
+
import chalk21 from "chalk";
|
|
1248
1305
|
import sortPackageJson from "sort-package-json";
|
|
1249
1306
|
var packagePublint = /* @__PURE__ */ __name(async (params) => {
|
|
1250
1307
|
const pkgDir = process.env.INIT_CWD;
|
|
1251
1308
|
const sortedPkg = sortPackageJson(await fs2.readFile(`${pkgDir}/package.json`, "utf8"));
|
|
1252
1309
|
await fs2.writeFile(`${pkgDir}/package.json`, sortedPkg);
|
|
1253
1310
|
const pkg = JSON.parse(await fs2.readFile(`${pkgDir}/package.json`, "utf8"));
|
|
1254
|
-
console.log(
|
|
1255
|
-
console.log(
|
|
1311
|
+
console.log(chalk21.green(`Publint: ${pkg.name}`));
|
|
1312
|
+
console.log(chalk21.gray(pkgDir));
|
|
1256
1313
|
const { publint: publint2 } = await import("publint");
|
|
1257
1314
|
const { messages } = await publint2({
|
|
1258
1315
|
level: "suggestion",
|
|
@@ -1267,21 +1324,21 @@ var packagePublint = /* @__PURE__ */ __name(async (params) => {
|
|
|
1267
1324
|
for (const message of validMessages) {
|
|
1268
1325
|
switch (message.type) {
|
|
1269
1326
|
case "error": {
|
|
1270
|
-
console.error(
|
|
1327
|
+
console.error(chalk21.red(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
1271
1328
|
break;
|
|
1272
1329
|
}
|
|
1273
1330
|
case "warning": {
|
|
1274
|
-
console.warn(
|
|
1331
|
+
console.warn(chalk21.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
1275
1332
|
break;
|
|
1276
1333
|
}
|
|
1277
1334
|
default: {
|
|
1278
|
-
console.log(
|
|
1335
|
+
console.log(chalk21.white(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
1279
1336
|
break;
|
|
1280
1337
|
}
|
|
1281
1338
|
}
|
|
1282
1339
|
}
|
|
1283
1340
|
if (params?.verbose) {
|
|
1284
|
-
console.log(
|
|
1341
|
+
console.log(chalk21.gray(`Publint [Finish]: ${pkgDir} [${validMessages.length}]`));
|
|
1285
1342
|
}
|
|
1286
1343
|
return validMessages.filter((message) => message.type === "error").length;
|
|
1287
1344
|
}, "packagePublint");
|
|
@@ -1325,7 +1382,7 @@ var buildEntries = /* @__PURE__ */ __name((folder, entryMode = "single", exclude
|
|
|
1325
1382
|
|
|
1326
1383
|
// src/actions/package/compile/packageCompileTscTypes.ts
|
|
1327
1384
|
import { cwd } from "node:process";
|
|
1328
|
-
import
|
|
1385
|
+
import chalk22 from "chalk";
|
|
1329
1386
|
import { createProgramFromConfig } from "tsc-prog";
|
|
1330
1387
|
import { DiagnosticCategory, formatDiagnosticsWithColorAndContext, getPreEmitDiagnostics, sys as sys2 } from "typescript";
|
|
1331
1388
|
|
|
@@ -1382,7 +1439,7 @@ var packageCompileTscTypes = /* @__PURE__ */ __name((folder = "src", config2 = {
|
|
|
1382
1439
|
".spec."
|
|
1383
1440
|
];
|
|
1384
1441
|
const files = buildEntries(folder, "all", verbose).filter((file) => validTsExt.find((ext) => file.endsWith(ext)) && !excludes.some((exclude) => file.includes(exclude)));
|
|
1385
|
-
console.log(
|
|
1442
|
+
console.log(chalk22.green(`Compiling Types ${pkg}: ${files.length}`));
|
|
1386
1443
|
if (files.length > 0) {
|
|
1387
1444
|
const program = createProgramFromConfig({
|
|
1388
1445
|
basePath: pkg ?? cwd(),
|
|
@@ -1413,7 +1470,6 @@ var packageCompileTscTypes = /* @__PURE__ */ __name((folder = "src", config2 = {
|
|
|
1413
1470
|
|
|
1414
1471
|
// src/actions/package/compile/compileTypes.ts
|
|
1415
1472
|
var packageCompileTypes = /* @__PURE__ */ __name(async (inConfig = {}) => {
|
|
1416
|
-
const pkg = process.env.INIT_CWD;
|
|
1417
1473
|
const config2 = await loadConfig(inConfig);
|
|
1418
1474
|
return packageCompileTscTypes(void 0, config2);
|
|
1419
1475
|
}, "packageCompileTypes");
|
|
@@ -1445,7 +1501,7 @@ __name(deepMergeObjects, "deepMergeObjects");
|
|
|
1445
1501
|
|
|
1446
1502
|
// src/actions/package/compile/packageCompileTsc.ts
|
|
1447
1503
|
import { cwd as cwd2 } from "node:process";
|
|
1448
|
-
import
|
|
1504
|
+
import chalk23 from "chalk";
|
|
1449
1505
|
import { createProgramFromConfig as createProgramFromConfig2 } from "tsc-prog";
|
|
1450
1506
|
import { DiagnosticCategory as DiagnosticCategory2, formatDiagnosticsWithColorAndContext as formatDiagnosticsWithColorAndContext2, getPreEmitDiagnostics as getPreEmitDiagnostics2, sys as sys3 } from "typescript";
|
|
1451
1507
|
var packageCompileTsc = /* @__PURE__ */ __name((folder = "src", config2 = {}, compilerOptionsParam) => {
|
|
@@ -1480,7 +1536,7 @@ var packageCompileTsc = /* @__PURE__ */ __name((folder = "src", config2 = {}, co
|
|
|
1480
1536
|
".d.mts"
|
|
1481
1537
|
];
|
|
1482
1538
|
const files = buildEntries(folder, "all", verbose).filter((file) => validTsExt.find((ext) => file.endsWith(ext)) && includes.find((include) => file.includes(include)));
|
|
1483
|
-
console.log(
|
|
1539
|
+
console.log(chalk23.green(`Compiling Files ${pkg}: ${files.length}`));
|
|
1484
1540
|
if (files.length > 0) {
|
|
1485
1541
|
const program = createProgramFromConfig2({
|
|
1486
1542
|
basePath: pkg ?? cwd2(),
|
|
@@ -1640,7 +1696,7 @@ var packageCompileTsup = /* @__PURE__ */ __name(async (config2) => {
|
|
|
1640
1696
|
// src/actions/package/compile/compile.ts
|
|
1641
1697
|
var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
|
|
1642
1698
|
const pkg = process.env.INIT_CWD;
|
|
1643
|
-
console.log(
|
|
1699
|
+
console.log(chalk24.green(`Compiling ${pkg}`));
|
|
1644
1700
|
const config2 = await loadConfig(inConfig);
|
|
1645
1701
|
const publint2 = config2.publint;
|
|
1646
1702
|
const tsupResults = await packageCompileTsup(config2);
|
|
@@ -1652,7 +1708,7 @@ var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}) => {
|
|
|
1652
1708
|
|
|
1653
1709
|
// src/actions/package/copy-assets.ts
|
|
1654
1710
|
import path5 from "node:path/posix";
|
|
1655
|
-
import
|
|
1711
|
+
import chalk25 from "chalk";
|
|
1656
1712
|
import cpy2 from "cpy";
|
|
1657
1713
|
var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) => {
|
|
1658
1714
|
try {
|
|
@@ -1671,7 +1727,7 @@ var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) =>
|
|
|
1671
1727
|
flat: false
|
|
1672
1728
|
});
|
|
1673
1729
|
if (values.length > 0) {
|
|
1674
|
-
console.log(
|
|
1730
|
+
console.log(chalk25.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
|
|
1675
1731
|
}
|
|
1676
1732
|
for (const value of values) {
|
|
1677
1733
|
console.log(`${value.split("/").pop()} => ./dist/${target}`);
|
|
@@ -1699,10 +1755,53 @@ var packageCopyAssets = /* @__PURE__ */ __name(async ({ target }) => {
|
|
|
1699
1755
|
}
|
|
1700
1756
|
}, "packageCopyAssets");
|
|
1701
1757
|
|
|
1758
|
+
// src/actions/package/cycle.ts
|
|
1759
|
+
import { cruise } from "dependency-cruiser";
|
|
1760
|
+
var packageCycle = /* @__PURE__ */ __name(async ({ verbose = false }) => {
|
|
1761
|
+
const pkg = process.env.INIT_CWD;
|
|
1762
|
+
const pkgName = process.env.npm_package_name;
|
|
1763
|
+
const cruiseOptions = {
|
|
1764
|
+
ruleSet: {
|
|
1765
|
+
forbidden: [
|
|
1766
|
+
{
|
|
1767
|
+
name: "no-circular",
|
|
1768
|
+
severity: "error",
|
|
1769
|
+
comment: "This dependency creates a circular reference",
|
|
1770
|
+
from: {},
|
|
1771
|
+
to: {
|
|
1772
|
+
circular: true
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1775
|
+
]
|
|
1776
|
+
},
|
|
1777
|
+
validate: true,
|
|
1778
|
+
doNotFollow: {
|
|
1779
|
+
path: "node_modules"
|
|
1780
|
+
},
|
|
1781
|
+
tsPreCompilationDeps: false,
|
|
1782
|
+
combinedDependencies: true,
|
|
1783
|
+
outputType: verbose ? "text" : "err"
|
|
1784
|
+
};
|
|
1785
|
+
const target = `${pkg}/src`;
|
|
1786
|
+
console.log(`Checking for circular dependencies in ${target}...`);
|
|
1787
|
+
const result = await cruise([
|
|
1788
|
+
target
|
|
1789
|
+
], cruiseOptions);
|
|
1790
|
+
if (result.output) {
|
|
1791
|
+
console.log(result.output);
|
|
1792
|
+
}
|
|
1793
|
+
if (result.exitCode === 0) {
|
|
1794
|
+
console.log(`${pkgName} \u2705 No dependency violations`);
|
|
1795
|
+
} else {
|
|
1796
|
+
console.error(`${pkgName} \u274C Dependency violations found`);
|
|
1797
|
+
}
|
|
1798
|
+
return result.exitCode;
|
|
1799
|
+
}, "packageCycle");
|
|
1800
|
+
|
|
1702
1801
|
// src/actions/package/gen-docs.ts
|
|
1703
1802
|
import { existsSync as existsSync4 } from "node:fs";
|
|
1704
1803
|
import path6 from "node:path";
|
|
1705
|
-
import
|
|
1804
|
+
import chalk26 from "chalk";
|
|
1706
1805
|
import { Application, ArgumentsReader, TSConfigReader, TypeDocReader } from "typedoc";
|
|
1707
1806
|
var ExitCodes = {
|
|
1708
1807
|
CompileError: 3,
|
|
@@ -1804,7 +1903,7 @@ var runTypeDoc = /* @__PURE__ */ __name(async (app) => {
|
|
|
1804
1903
|
return ExitCodes.OutputError;
|
|
1805
1904
|
}
|
|
1806
1905
|
}
|
|
1807
|
-
console.log(
|
|
1906
|
+
console.log(chalk26.green(`${pkgName} - Ok`));
|
|
1808
1907
|
return ExitCodes.Ok;
|
|
1809
1908
|
}, "runTypeDoc");
|
|
1810
1909
|
|
|
@@ -1813,8 +1912,8 @@ import { readdirSync } from "node:fs";
|
|
|
1813
1912
|
import path7 from "node:path";
|
|
1814
1913
|
import { cwd as cwd3 } from "node:process";
|
|
1815
1914
|
import { pathToFileURL } from "node:url";
|
|
1816
|
-
import
|
|
1817
|
-
import { ESLint
|
|
1915
|
+
import chalk27 from "chalk";
|
|
1916
|
+
import { ESLint } from "eslint";
|
|
1818
1917
|
import { findUp } from "find-up";
|
|
1819
1918
|
import picomatch from "picomatch";
|
|
1820
1919
|
var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
|
|
@@ -1830,10 +1929,10 @@ var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
|
|
|
1830
1929
|
];
|
|
1831
1930
|
for (const lintResult of lintResults) {
|
|
1832
1931
|
if (lintResult.messages.length > 0) {
|
|
1833
|
-
console.log(
|
|
1932
|
+
console.log(chalk27.gray(`
|
|
1834
1933
|
${lintResult.filePath}`));
|
|
1835
1934
|
for (const message of lintResult.messages) {
|
|
1836
|
-
console.log(
|
|
1935
|
+
console.log(chalk27.gray(` ${message.line}:${message.column}`), chalk27[colors[message.severity]](` ${severity[message.severity]}`), chalk27.white(` ${message.message}`), chalk27.gray(` ${message.ruleId}`));
|
|
1837
1936
|
}
|
|
1838
1937
|
}
|
|
1839
1938
|
}
|
|
@@ -1878,7 +1977,7 @@ var packageLint = /* @__PURE__ */ __name(async (fix2 = false, verbose = false, c
|
|
|
1878
1977
|
".vscode",
|
|
1879
1978
|
".github"
|
|
1880
1979
|
];
|
|
1881
|
-
const engine = new
|
|
1980
|
+
const engine = new ESLint({
|
|
1882
1981
|
baseConfig: [
|
|
1883
1982
|
...eslintConfig
|
|
1884
1983
|
],
|
|
@@ -1888,17 +1987,17 @@ var packageLint = /* @__PURE__ */ __name(async (fix2 = false, verbose = false, c
|
|
|
1888
1987
|
});
|
|
1889
1988
|
const files = getFiles(cwd3(), ignoreFolders);
|
|
1890
1989
|
if (verbose) {
|
|
1891
|
-
console.log(
|
|
1990
|
+
console.log(chalk27.green(`Linting ${pkg} [files = ${files.length}]`));
|
|
1892
1991
|
}
|
|
1893
1992
|
const lintResults = await engine.lintFiles(files);
|
|
1894
1993
|
dumpMessages(lintResults);
|
|
1895
1994
|
if (fix2) {
|
|
1896
|
-
await
|
|
1995
|
+
await ESLint.outputFixes(lintResults);
|
|
1897
1996
|
}
|
|
1898
1997
|
const filesCountColor = files.length < 100 ? "green" : files.length < 1e3 ? "yellow" : "red";
|
|
1899
1998
|
const lintTime = Date.now() - start;
|
|
1900
1999
|
const lintTimeColor = lintTime < 1e3 ? "green" : lintTime < 3e3 ? "yellow" : "red";
|
|
1901
|
-
console.log(
|
|
2000
|
+
console.log(chalk27.white(`Linted ${chalk27[filesCountColor](files.length)} files in ${chalk27[lintTimeColor](lintTime)}ms`));
|
|
1902
2001
|
return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
|
|
1903
2002
|
}, "packageLint");
|
|
1904
2003
|
|
|
@@ -1965,7 +2064,7 @@ var rebuild = /* @__PURE__ */ __name(({ target }) => {
|
|
|
1965
2064
|
}, "rebuild");
|
|
1966
2065
|
|
|
1967
2066
|
// src/actions/recompile.ts
|
|
1968
|
-
import
|
|
2067
|
+
import chalk28 from "chalk";
|
|
1969
2068
|
var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incremental }) => {
|
|
1970
2069
|
return pkg ? await recompilePackage({
|
|
1971
2070
|
pkg,
|
|
@@ -2020,7 +2119,7 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
|
|
|
2020
2119
|
`${jobs}`
|
|
2021
2120
|
] : [];
|
|
2022
2121
|
if (jobs) {
|
|
2023
|
-
console.log(
|
|
2122
|
+
console.log(chalk28.blue(`Jobs set to [${jobs}]`));
|
|
2024
2123
|
}
|
|
2025
2124
|
const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
|
|
2026
2125
|
[
|
|
@@ -2050,7 +2149,7 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
|
|
|
2050
2149
|
]
|
|
2051
2150
|
]
|
|
2052
2151
|
]);
|
|
2053
|
-
console.log(`${
|
|
2152
|
+
console.log(`${chalk28.gray("Recompiled in")} [${chalk28.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk28.gray("seconds")}`);
|
|
2054
2153
|
return result;
|
|
2055
2154
|
}, "recompileAll");
|
|
2056
2155
|
|
|
@@ -2084,9 +2183,9 @@ var reinstall = /* @__PURE__ */ __name(() => {
|
|
|
2084
2183
|
}, "reinstall");
|
|
2085
2184
|
|
|
2086
2185
|
// src/actions/relint.ts
|
|
2087
|
-
import
|
|
2186
|
+
import chalk29 from "chalk";
|
|
2088
2187
|
var relintPackage = /* @__PURE__ */ __name(({ pkg }) => {
|
|
2089
|
-
console.log(
|
|
2188
|
+
console.log(chalk29.gray(`${"Relint"} [All-Packages]`));
|
|
2090
2189
|
const start = Date.now();
|
|
2091
2190
|
const result = runSteps("Relint [All-Packages]", [
|
|
2092
2191
|
[
|
|
@@ -2099,7 +2198,7 @@ var relintPackage = /* @__PURE__ */ __name(({ pkg }) => {
|
|
|
2099
2198
|
]
|
|
2100
2199
|
]
|
|
2101
2200
|
]);
|
|
2102
|
-
console.log(
|
|
2201
|
+
console.log(chalk29.gray(`${"Relinted in"} [${chalk29.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk29.gray("seconds")}`));
|
|
2103
2202
|
return result;
|
|
2104
2203
|
}, "relintPackage");
|
|
2105
2204
|
var relint = /* @__PURE__ */ __name(({ pkg, verbose, incremental } = {}) => {
|
|
@@ -2111,7 +2210,7 @@ var relint = /* @__PURE__ */ __name(({ pkg, verbose, incremental } = {}) => {
|
|
|
2111
2210
|
});
|
|
2112
2211
|
}, "relint");
|
|
2113
2212
|
var relintAllPackages = /* @__PURE__ */ __name(({ verbose = true, incremental } = {}) => {
|
|
2114
|
-
console.log(
|
|
2213
|
+
console.log(chalk29.gray(`${"Relint"} [All-Packages]`));
|
|
2115
2214
|
const start = Date.now();
|
|
2116
2215
|
const verboseOptions = verbose ? [
|
|
2117
2216
|
"--verbose"
|
|
@@ -2138,7 +2237,7 @@ var relintAllPackages = /* @__PURE__ */ __name(({ verbose = true, incremental }
|
|
|
2138
2237
|
]
|
|
2139
2238
|
]
|
|
2140
2239
|
]);
|
|
2141
|
-
console.log(
|
|
2240
|
+
console.log(chalk29.gray(`Relinted in [${chalk29.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk29.gray("seconds")}`));
|
|
2142
2241
|
return result;
|
|
2143
2242
|
}, "relintAllPackages");
|
|
2144
2243
|
|
|
@@ -2178,7 +2277,7 @@ var sonar = /* @__PURE__ */ __name(() => {
|
|
|
2178
2277
|
}, "sonar");
|
|
2179
2278
|
|
|
2180
2279
|
// src/actions/statics.ts
|
|
2181
|
-
import
|
|
2280
|
+
import chalk30 from "chalk";
|
|
2182
2281
|
var DefaultDependencies = [
|
|
2183
2282
|
"axios",
|
|
2184
2283
|
"@xylabs/pixel",
|
|
@@ -2189,7 +2288,7 @@ var DefaultDependencies = [
|
|
|
2189
2288
|
"@mui/system"
|
|
2190
2289
|
];
|
|
2191
2290
|
var statics = /* @__PURE__ */ __name(() => {
|
|
2192
|
-
console.log(
|
|
2291
|
+
console.log(chalk30.green("Check Required Static Dependencies"));
|
|
2193
2292
|
const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
|
|
2194
2293
|
return detectDuplicateDependencies(statics2, DefaultDependencies);
|
|
2195
2294
|
}, "statics");
|
|
@@ -2309,6 +2408,8 @@ export {
|
|
|
2309
2408
|
compileTypesPackage,
|
|
2310
2409
|
copyAssets,
|
|
2311
2410
|
cycle,
|
|
2411
|
+
cycleAll,
|
|
2412
|
+
cyclePackage,
|
|
2312
2413
|
dead,
|
|
2313
2414
|
deploy,
|
|
2314
2415
|
deployMajor,
|
|
@@ -2337,6 +2438,7 @@ export {
|
|
|
2337
2438
|
packageCompileTsup,
|
|
2338
2439
|
packageCompileTypes,
|
|
2339
2440
|
packageCopyAssets,
|
|
2441
|
+
packageCycle,
|
|
2340
2442
|
packageGenDocs,
|
|
2341
2443
|
packageLint,
|
|
2342
2444
|
packagePublint,
|