@xylabs/ts-scripts-yarn3 5.1.14 → 6.0.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/compile-types.mjs +176 -0
- package/dist/actions/compile-types.mjs.map +1 -0
- package/dist/actions/fix.mjs +2 -2
- package/dist/actions/fix.mjs.map +1 -1
- package/dist/actions/index.mjs +253 -139
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/lint-clean.mjs +2 -2
- package/dist/actions/lint-clean.mjs.map +1 -1
- package/dist/actions/lint.mjs +2 -2
- package/dist/actions/lint.mjs.map +1 -1
- package/dist/actions/package/compile/compile.mjs +88 -64
- package/dist/actions/package/compile/compile.mjs.map +1 -1
- package/dist/actions/package/compile/compileTypes.mjs +164 -0
- package/dist/actions/package/compile/compileTypes.mjs.map +1 -0
- package/dist/actions/package/compile/deepMerge.mjs +31 -0
- package/dist/actions/package/compile/deepMerge.mjs.map +1 -0
- package/dist/actions/package/compile/index.mjs +101 -65
- package/dist/actions/package/compile/index.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTscTypes.mjs +3 -2
- package/dist/actions/package/compile/packageCompileTscTypes.mjs.map +1 -1
- package/dist/actions/package/compile/packageCompileTsup.mjs +90 -65
- package/dist/actions/package/compile/packageCompileTsup.mjs.map +1 -1
- package/dist/actions/package/index.mjs +118 -80
- package/dist/actions/package/index.mjs.map +1 -1
- package/dist/actions/package/lint.mjs +2 -0
- package/dist/actions/package/lint.mjs.map +1 -1
- package/dist/actions/package/recompile.mjs +88 -64
- package/dist/actions/package/recompile.mjs.map +1 -1
- package/dist/bin/package/build-only.mjs +88 -64
- package/dist/bin/package/build-only.mjs.map +1 -1
- package/dist/bin/package/build.mjs +88 -64
- package/dist/bin/package/build.mjs.map +1 -1
- package/dist/bin/package/compile-only.mjs +88 -64
- package/dist/bin/package/compile-only.mjs.map +1 -1
- package/dist/bin/package/compile-tsup.mjs +88 -64
- package/dist/bin/package/compile-tsup.mjs.map +1 -1
- package/dist/bin/package/compile-types.mjs +173 -0
- package/dist/bin/package/compile-types.mjs.map +1 -0
- package/dist/bin/package/compile.mjs +88 -64
- package/dist/bin/package/compile.mjs.map +1 -1
- package/dist/bin/package/fix.mjs +2 -0
- package/dist/bin/package/fix.mjs.map +1 -1
- package/dist/bin/package/lint.mjs +2 -0
- package/dist/bin/package/lint.mjs.map +1 -1
- package/dist/bin/package/recompile.mjs +88 -64
- package/dist/bin/package/recompile.mjs.map +1 -1
- package/dist/bin/xy.mjs +132 -45
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.d.ts +21 -1
- package/dist/index.mjs +277 -149
- package/dist/index.mjs.map +1 -1
- package/dist/xy/index.mjs +132 -45
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/xy.mjs +132 -45
- package/dist/xy/xy.mjs.map +1 -1
- package/dist/xy/xyBuildCommands.mjs +92 -5
- package/dist/xy/xyBuildCommands.mjs.map +1 -1
- package/dist/xy/xyLintCommands.mjs +2 -2
- package/dist/xy/xyLintCommands.mjs.map +1 -1
- package/package.json +18 -49
- package/src/actions/compile-types.ts +67 -0
- package/src/actions/index.ts +1 -0
- package/src/actions/lint.ts +1 -1
- package/src/actions/package/compile/compileTypes.ts +13 -0
- package/src/actions/package/compile/deepMerge.ts +33 -0
- package/src/actions/package/compile/index.ts +2 -0
- package/src/actions/package/compile/packageCompileTscTypes.ts +3 -2
- package/src/actions/package/compile/packageCompileTsup.ts +39 -53
- package/src/actions/package/lint.ts +2 -0
- package/src/bin/package/compile-types.ts +16 -0
- package/src/bin/xy.ts +1 -1
- package/src/xy/xyBuildCommands.ts +19 -1
- package/dist/bin/build.mjs +0 -17
- package/dist/bin/build.mjs.map +0 -1
- package/dist/bin/clean.mjs +0 -17
- package/dist/bin/clean.mjs.map +0 -1
- package/dist/bin/compile-only.mjs +0 -17
- package/dist/bin/compile-only.mjs.map +0 -1
- package/dist/bin/compile.mjs +0 -17
- package/dist/bin/compile.mjs.map +0 -1
- package/dist/bin/cycle.mjs +0 -17
- package/dist/bin/cycle.mjs.map +0 -1
- package/dist/bin/dead.mjs +0 -17
- package/dist/bin/dead.mjs.map +0 -1
- package/dist/bin/deploy-major.mjs +0 -17
- package/dist/bin/deploy-major.mjs.map +0 -1
- package/dist/bin/deploy-minor.mjs +0 -17
- package/dist/bin/deploy-minor.mjs.map +0 -1
- package/dist/bin/deploy-next.mjs +0 -17
- package/dist/bin/deploy-next.mjs.map +0 -1
- package/dist/bin/deploy.mjs +0 -17
- package/dist/bin/deploy.mjs.map +0 -1
- package/dist/bin/deps.mjs +0 -17
- package/dist/bin/deps.mjs.map +0 -1
- package/dist/bin/fix.mjs +0 -17
- package/dist/bin/fix.mjs.map +0 -1
- package/dist/bin/gen-docs.mjs +0 -17
- package/dist/bin/gen-docs.mjs.map +0 -1
- package/dist/bin/gitlint-fix.mjs +0 -17
- package/dist/bin/gitlint-fix.mjs.map +0 -1
- package/dist/bin/gitlint.mjs +0 -17
- package/dist/bin/gitlint.mjs.map +0 -1
- package/dist/bin/license.mjs +0 -17
- package/dist/bin/license.mjs.map +0 -1
- package/dist/bin/lint-clean.mjs +0 -17
- package/dist/bin/lint-clean.mjs.map +0 -1
- package/dist/bin/lint-fast.mjs +0 -17
- package/dist/bin/lint-fast.mjs.map +0 -1
- package/dist/bin/lint-profile.mjs +0 -17
- package/dist/bin/lint-profile.mjs.map +0 -1
- package/dist/bin/lint.mjs +0 -17
- package/dist/bin/lint.mjs.map +0 -1
- package/dist/bin/publint.mjs +0 -17
- package/dist/bin/publint.mjs.map +0 -1
- package/dist/bin/rebuild.mjs +0 -17
- package/dist/bin/rebuild.mjs.map +0 -1
- package/dist/bin/recompile.mjs +0 -17
- package/dist/bin/recompile.mjs.map +0 -1
- package/dist/bin/reinstall.mjs +0 -17
- package/dist/bin/reinstall.mjs.map +0 -1
- package/dist/bin/relint.mjs +0 -17
- package/dist/bin/relint.mjs.map +0 -1
- package/dist/bin/sonar.mjs +0 -17
- package/dist/bin/sonar.mjs.map +0 -1
- package/dist/bin/test.mjs +0 -17
- package/dist/bin/test.mjs.map +0 -1
- package/dist/bin/up.mjs +0 -17
- package/dist/bin/up.mjs.map +0 -1
- package/dist/bin/updo.mjs +0 -17
- package/dist/bin/updo.mjs.map +0 -1
- package/dist/bin/upplug.mjs +0 -17
- package/dist/bin/upplug.mjs.map +0 -1
- package/dist/bin/upyarn.mjs +0 -17
- package/dist/bin/upyarn.mjs.map +0 -1
- package/dist/bin/xy-ts.mjs +0 -1930
- package/dist/bin/xy-ts.mjs.map +0 -1
- package/dist/bin/yarn3only.mjs +0 -17
- package/dist/bin/yarn3only.mjs.map +0 -1
- package/src/bin/build.ts +0 -5
- package/src/bin/clean.ts +0 -5
- package/src/bin/compile-only.ts +0 -5
- package/src/bin/compile.ts +0 -5
- package/src/bin/cycle.ts +0 -5
- package/src/bin/dead.ts +0 -5
- package/src/bin/deploy-major.ts +0 -5
- package/src/bin/deploy-minor.ts +0 -5
- package/src/bin/deploy-next.ts +0 -5
- package/src/bin/deploy.ts +0 -5
- package/src/bin/deps.ts +0 -5
- package/src/bin/fix.ts +0 -5
- package/src/bin/gen-docs.ts +0 -5
- package/src/bin/gitlint-fix.ts +0 -5
- package/src/bin/gitlint.ts +0 -5
- package/src/bin/license.ts +0 -5
- package/src/bin/lint-clean.ts +0 -5
- package/src/bin/lint-fast.ts +0 -5
- package/src/bin/lint-profile.ts +0 -5
- package/src/bin/lint.ts +0 -5
- package/src/bin/publint.ts +0 -5
- package/src/bin/rebuild.ts +0 -5
- package/src/bin/recompile.ts +0 -5
- package/src/bin/reinstall.ts +0 -5
- package/src/bin/relint.ts +0 -5
- package/src/bin/sonar.ts +0 -5
- package/src/bin/test.ts +0 -5
- package/src/bin/up.ts +0 -5
- package/src/bin/updo.ts +0 -5
- package/src/bin/upplug.ts +0 -5
- package/src/bin/upyarn.ts +0 -5
- package/src/bin/xy-ts.ts +0 -12
- package/src/bin/yarn3only.ts +0 -5
package/dist/index.mjs
CHANGED
|
@@ -727,9 +727,82 @@ var compileAll = /* @__PURE__ */ __name(({ jobs, verbose, target, incremental, t
|
|
|
727
727
|
return result;
|
|
728
728
|
}, "compileAll");
|
|
729
729
|
|
|
730
|
+
// src/actions/compile-types.ts
|
|
731
|
+
import chalk12 from "chalk";
|
|
732
|
+
var compileTypes = /* @__PURE__ */ __name(({ verbose, pkg, incremental, jobs }) => {
|
|
733
|
+
if (verbose) {
|
|
734
|
+
console.log(chalk12.gray("Compiling Types"));
|
|
735
|
+
}
|
|
736
|
+
return pkg ? compileTypesPackage({
|
|
737
|
+
pkg,
|
|
738
|
+
verbose
|
|
739
|
+
}) : compileTypesAll({
|
|
740
|
+
incremental,
|
|
741
|
+
verbose,
|
|
742
|
+
jobs
|
|
743
|
+
});
|
|
744
|
+
}, "compileTypes");
|
|
745
|
+
var compileTypesPackage = /* @__PURE__ */ __name(({ verbose, pkg }) => {
|
|
746
|
+
if (verbose) {
|
|
747
|
+
console.log(chalk12.gray("Compiling Types [Package]"));
|
|
748
|
+
}
|
|
749
|
+
return runSteps(`Compile [${pkg}]`, [
|
|
750
|
+
[
|
|
751
|
+
"yarn",
|
|
752
|
+
[
|
|
753
|
+
"workspace",
|
|
754
|
+
pkg,
|
|
755
|
+
"run",
|
|
756
|
+
"package-compile-types"
|
|
757
|
+
]
|
|
758
|
+
]
|
|
759
|
+
]);
|
|
760
|
+
}, "compileTypesPackage");
|
|
761
|
+
var compileTypesAll = /* @__PURE__ */ __name(({ jobs, verbose, incremental }) => {
|
|
762
|
+
if (verbose) {
|
|
763
|
+
console.log(chalk12.gray("Compiling Types [All]"));
|
|
764
|
+
}
|
|
765
|
+
const start = Date.now();
|
|
766
|
+
const verboseOptions = verbose ? [
|
|
767
|
+
"--verbose"
|
|
768
|
+
] : [
|
|
769
|
+
"--no-verbose"
|
|
770
|
+
];
|
|
771
|
+
const incrementalOptions = incremental ? [
|
|
772
|
+
"--since",
|
|
773
|
+
"-Ap"
|
|
774
|
+
] : [
|
|
775
|
+
"--parallel",
|
|
776
|
+
"-Ap"
|
|
777
|
+
];
|
|
778
|
+
const jobsOptions = jobs ? [
|
|
779
|
+
"-j",
|
|
780
|
+
`${jobs}`
|
|
781
|
+
] : [];
|
|
782
|
+
if (jobs) {
|
|
783
|
+
console.log(chalk12.blue(`Jobs set to [${jobs}]`));
|
|
784
|
+
}
|
|
785
|
+
const result = runSteps(`Compile Types ${incremental ? "[Incremental]" : ""} [All]`, [
|
|
786
|
+
[
|
|
787
|
+
"yarn",
|
|
788
|
+
[
|
|
789
|
+
"workspaces",
|
|
790
|
+
"foreach",
|
|
791
|
+
...incrementalOptions,
|
|
792
|
+
...jobsOptions,
|
|
793
|
+
...verboseOptions,
|
|
794
|
+
"run",
|
|
795
|
+
"package-compile-types"
|
|
796
|
+
]
|
|
797
|
+
]
|
|
798
|
+
]);
|
|
799
|
+
console.log(`${chalk12.gray("Types Compiled in")} [${chalk12.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk12.gray("seconds")}`);
|
|
800
|
+
return result;
|
|
801
|
+
}, "compileTypesAll");
|
|
802
|
+
|
|
730
803
|
// src/actions/copy-assets.ts
|
|
731
804
|
import path2 from "node:path/posix";
|
|
732
|
-
import
|
|
805
|
+
import chalk13 from "chalk";
|
|
733
806
|
import cpy from "cpy";
|
|
734
807
|
var copyPackageTargetAssets = /* @__PURE__ */ __name(async (target, name, location) => {
|
|
735
808
|
try {
|
|
@@ -758,7 +831,7 @@ var copyPackageTargetAssets = /* @__PURE__ */ __name(async (target, name, locati
|
|
|
758
831
|
}, "copyPackageTargetAssets");
|
|
759
832
|
var copyTargetAssets = /* @__PURE__ */ __name(async (target, pkg) => {
|
|
760
833
|
const workspaces = yarnWorkspaces();
|
|
761
|
-
console.log(
|
|
834
|
+
console.log(chalk13.green(`Copying Assets [${target.toUpperCase()}]`));
|
|
762
835
|
const workspaceList = workspaces.filter(({ name }) => {
|
|
763
836
|
return pkg === void 0 || name === pkg;
|
|
764
837
|
});
|
|
@@ -932,7 +1005,7 @@ var deployNext = /* @__PURE__ */ __name(() => {
|
|
|
932
1005
|
}, "deployNext");
|
|
933
1006
|
|
|
934
1007
|
// src/actions/deps.ts
|
|
935
|
-
import
|
|
1008
|
+
import chalk14 from "chalk";
|
|
936
1009
|
var deps = /* @__PURE__ */ __name(({ pkg, incremental }) => {
|
|
937
1010
|
pkg ? depsPackage({
|
|
938
1011
|
pkg
|
|
@@ -969,7 +1042,7 @@ var depsAll = /* @__PURE__ */ __name(({ incremental, jobs, verbose }) => {
|
|
|
969
1042
|
"--no-verbose"
|
|
970
1043
|
];
|
|
971
1044
|
if (jobs) {
|
|
972
|
-
console.log(
|
|
1045
|
+
console.log(chalk14.blue(`Jobs set to [${jobs}]`));
|
|
973
1046
|
}
|
|
974
1047
|
const incrementalOptions = incremental ? [
|
|
975
1048
|
"--since",
|
|
@@ -994,21 +1067,21 @@ var depsAll = /* @__PURE__ */ __name(({ incremental, jobs, verbose }) => {
|
|
|
994
1067
|
const result = runSteps(`Deps${incremental ? "-Incremental" : ""} [All]`, [
|
|
995
1068
|
...steps
|
|
996
1069
|
]);
|
|
997
|
-
console.log(`${
|
|
1070
|
+
console.log(`${chalk14.gray("Dep checked in")} [${chalk14.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk14.gray("seconds")}`);
|
|
998
1071
|
return result;
|
|
999
1072
|
}, "depsAll");
|
|
1000
1073
|
|
|
1001
1074
|
// src/actions/dupdeps.ts
|
|
1002
|
-
import
|
|
1075
|
+
import chalk15 from "chalk";
|
|
1003
1076
|
var dupdeps = /* @__PURE__ */ __name(() => {
|
|
1004
|
-
console.log(
|
|
1077
|
+
console.log(chalk15.green("Checking all Dependencies for Duplicates"));
|
|
1005
1078
|
const allDependencies = parsedPackageJSON()?.dependencies;
|
|
1006
1079
|
const dependencies = Object.entries(allDependencies).map(([k]) => k);
|
|
1007
1080
|
return detectDuplicateDependencies(dependencies);
|
|
1008
1081
|
}, "dupdeps");
|
|
1009
1082
|
|
|
1010
1083
|
// src/actions/lint.ts
|
|
1011
|
-
import
|
|
1084
|
+
import chalk16 from "chalk";
|
|
1012
1085
|
import { ESLint as ESLint2 } from "eslint";
|
|
1013
1086
|
var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
|
|
1014
1087
|
const colors = [
|
|
@@ -1023,9 +1096,9 @@ var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
|
|
|
1023
1096
|
];
|
|
1024
1097
|
for (const lintResult of lintResults) {
|
|
1025
1098
|
if (lintResult.messages.length > 0) {
|
|
1026
|
-
console.log(
|
|
1099
|
+
console.log(chalk16.gray(`${lintResult.filePath}`));
|
|
1027
1100
|
for (const message of lintResult.messages) {
|
|
1028
|
-
console.log(
|
|
1101
|
+
console.log(chalk16.gray(` ${message.line}:${message.column}`), chalk16[colors[message.severity]](` ${severity[message.severity]}`), chalk16.white(` ${message.message}`), chalk16.gray(` ${message.ruleId}`));
|
|
1029
1102
|
}
|
|
1030
1103
|
}
|
|
1031
1104
|
}
|
|
@@ -1033,7 +1106,7 @@ var dumpMessages = /* @__PURE__ */ __name((lintResults) => {
|
|
|
1033
1106
|
var lintPackage = /* @__PURE__ */ __name(async ({ pkg, fix: fix2 }) => {
|
|
1034
1107
|
const workspace = yarnWorkspaces().find((workspace2) => workspace2.name === pkg);
|
|
1035
1108
|
if (!workspace) {
|
|
1036
|
-
console.error(
|
|
1109
|
+
console.error(chalk16.red(`Unable to locate package [${chalk16.magenta(pkg)}]`));
|
|
1037
1110
|
process.exit(1);
|
|
1038
1111
|
}
|
|
1039
1112
|
const engine = new ESLint2({
|
|
@@ -1062,7 +1135,7 @@ var lint = /* @__PURE__ */ __name(async ({ pkg, verbose, incremental, fix: fix2
|
|
|
1062
1135
|
});
|
|
1063
1136
|
}, "lint");
|
|
1064
1137
|
var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2, verbose = true, incremental } = {}) => {
|
|
1065
|
-
console.log(
|
|
1138
|
+
console.log(chalk16.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
|
|
1066
1139
|
const start = Date.now();
|
|
1067
1140
|
const verboseOptions = verbose ? [
|
|
1068
1141
|
"--verbose"
|
|
@@ -1071,10 +1144,10 @@ var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2, verbose = true, incre
|
|
|
1071
1144
|
];
|
|
1072
1145
|
const incrementalOptions = incremental ? [
|
|
1073
1146
|
"--since",
|
|
1074
|
-
"-
|
|
1147
|
+
"-Ap"
|
|
1075
1148
|
] : [
|
|
1076
1149
|
"--parallel",
|
|
1077
|
-
"-
|
|
1150
|
+
"-Ap"
|
|
1078
1151
|
];
|
|
1079
1152
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
|
|
1080
1153
|
[
|
|
@@ -1089,7 +1162,7 @@ var lintAllPackages = /* @__PURE__ */ __name(({ fix: fix2, verbose = true, incre
|
|
|
1089
1162
|
]
|
|
1090
1163
|
]
|
|
1091
1164
|
]);
|
|
1092
|
-
console.log(
|
|
1165
|
+
console.log(chalk16.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk16.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk16.gray("seconds")}`));
|
|
1093
1166
|
return result;
|
|
1094
1167
|
}, "lintAllPackages");
|
|
1095
1168
|
|
|
@@ -1153,7 +1226,7 @@ var filename = ".gitignore";
|
|
|
1153
1226
|
var gitignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename, pkg), "gitignoreGen");
|
|
1154
1227
|
|
|
1155
1228
|
// src/actions/gitlint.ts
|
|
1156
|
-
import
|
|
1229
|
+
import chalk17 from "chalk";
|
|
1157
1230
|
import ParseGitConfig from "parse-git-config";
|
|
1158
1231
|
var gitlint = /* @__PURE__ */ __name(() => {
|
|
1159
1232
|
console.log(`
|
|
@@ -1164,7 +1237,7 @@ Gitlint Start [${process.cwd()}]
|
|
|
1164
1237
|
const errors = 0;
|
|
1165
1238
|
const gitConfig = ParseGitConfig.sync();
|
|
1166
1239
|
const warn = /* @__PURE__ */ __name((message) => {
|
|
1167
|
-
console.warn(
|
|
1240
|
+
console.warn(chalk17.yellow(`Warning: ${message}`));
|
|
1168
1241
|
warnings++;
|
|
1169
1242
|
}, "warn");
|
|
1170
1243
|
if (gitConfig.core.ignorecase) {
|
|
@@ -1184,13 +1257,13 @@ Gitlint Start [${process.cwd()}]
|
|
|
1184
1257
|
}
|
|
1185
1258
|
const resultMessages = [];
|
|
1186
1259
|
if (valid > 0) {
|
|
1187
|
-
resultMessages.push(
|
|
1260
|
+
resultMessages.push(chalk17.green(`Passed: ${valid}`));
|
|
1188
1261
|
}
|
|
1189
1262
|
if (warnings > 0) {
|
|
1190
|
-
resultMessages.push(
|
|
1263
|
+
resultMessages.push(chalk17.yellow(`Warnings: ${warnings}`));
|
|
1191
1264
|
}
|
|
1192
1265
|
if (errors > 0) {
|
|
1193
|
-
resultMessages.push(
|
|
1266
|
+
resultMessages.push(chalk17.red(` Errors: ${errors}`));
|
|
1194
1267
|
}
|
|
1195
1268
|
console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
|
|
1196
1269
|
`);
|
|
@@ -1199,7 +1272,7 @@ Gitlint Start [${process.cwd()}]
|
|
|
1199
1272
|
|
|
1200
1273
|
// src/actions/gitlint-fix.ts
|
|
1201
1274
|
import { execSync as execSync2 } from "node:child_process";
|
|
1202
|
-
import
|
|
1275
|
+
import chalk18 from "chalk";
|
|
1203
1276
|
import ParseGitConfig2 from "parse-git-config";
|
|
1204
1277
|
var gitlintFix = /* @__PURE__ */ __name(() => {
|
|
1205
1278
|
console.log(`
|
|
@@ -1210,25 +1283,25 @@ Gitlint Fix Start [${process.cwd()}]
|
|
|
1210
1283
|
execSync2("git config core.ignorecase false", {
|
|
1211
1284
|
stdio: "inherit"
|
|
1212
1285
|
});
|
|
1213
|
-
console.warn(
|
|
1286
|
+
console.warn(chalk18.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
|
|
1214
1287
|
}
|
|
1215
1288
|
if (gitConfig.core.autocrlf !== false) {
|
|
1216
1289
|
execSync2("git config core.autocrlf false", {
|
|
1217
1290
|
stdio: "inherit"
|
|
1218
1291
|
});
|
|
1219
|
-
console.warn(
|
|
1292
|
+
console.warn(chalk18.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
|
|
1220
1293
|
}
|
|
1221
1294
|
if (gitConfig.core.eol !== "lf") {
|
|
1222
1295
|
execSync2("git config core.eol lf", {
|
|
1223
1296
|
stdio: "inherit"
|
|
1224
1297
|
});
|
|
1225
|
-
console.warn(
|
|
1298
|
+
console.warn(chalk18.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
|
|
1226
1299
|
}
|
|
1227
1300
|
return 1;
|
|
1228
1301
|
}, "gitlintFix");
|
|
1229
1302
|
|
|
1230
1303
|
// src/actions/license.ts
|
|
1231
|
-
import
|
|
1304
|
+
import chalk19 from "chalk";
|
|
1232
1305
|
import { init } from "license-checker";
|
|
1233
1306
|
var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
1234
1307
|
const workspaces = yarnWorkspaces();
|
|
@@ -1253,7 +1326,7 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
|
1253
1326
|
"LGPL-3.0-or-later",
|
|
1254
1327
|
"Python-2.0"
|
|
1255
1328
|
]);
|
|
1256
|
-
console.log(
|
|
1329
|
+
console.log(chalk19.green("License Checker"));
|
|
1257
1330
|
return (await Promise.all(workspaceList.map(({ location, name }) => {
|
|
1258
1331
|
return new Promise((resolve) => {
|
|
1259
1332
|
init({
|
|
@@ -1261,12 +1334,12 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
|
1261
1334
|
start: location
|
|
1262
1335
|
}, (error, packages) => {
|
|
1263
1336
|
if (error) {
|
|
1264
|
-
console.error(
|
|
1265
|
-
console.error(
|
|
1337
|
+
console.error(chalk19.red(`License Checker [${name}] Error`));
|
|
1338
|
+
console.error(chalk19.gray(error));
|
|
1266
1339
|
console.log("\n");
|
|
1267
1340
|
resolve(1);
|
|
1268
1341
|
} else {
|
|
1269
|
-
console.log(
|
|
1342
|
+
console.log(chalk19.green(`License Checker [${name}]`));
|
|
1270
1343
|
let count = 0;
|
|
1271
1344
|
for (const [name2, info] of Object.entries(packages)) {
|
|
1272
1345
|
const licenses = Array.isArray(info.licenses) ? info.licenses : [
|
|
@@ -1284,7 +1357,7 @@ var license = /* @__PURE__ */ __name(async (pkg) => {
|
|
|
1284
1357
|
}
|
|
1285
1358
|
if (!orLicenseFound) {
|
|
1286
1359
|
count++;
|
|
1287
|
-
console.warn(
|
|
1360
|
+
console.warn(chalk19.yellow(`${name2}: Package License not allowed [${license2}]`));
|
|
1288
1361
|
}
|
|
1289
1362
|
}
|
|
1290
1363
|
}
|
|
@@ -1344,7 +1417,7 @@ var npmignoreGen = /* @__PURE__ */ __name((pkg) => generateIgnoreFiles(filename2
|
|
|
1344
1417
|
|
|
1345
1418
|
// src/actions/package/clean-outputs.ts
|
|
1346
1419
|
import path3 from "node:path";
|
|
1347
|
-
import
|
|
1420
|
+
import chalk20 from "chalk";
|
|
1348
1421
|
var packageCleanOutputs = /* @__PURE__ */ __name(() => {
|
|
1349
1422
|
const pkg = process.env.INIT_CWD ?? ".";
|
|
1350
1423
|
const pkgName = process.env.npm_package_name;
|
|
@@ -1353,7 +1426,7 @@ var packageCleanOutputs = /* @__PURE__ */ __name(() => {
|
|
|
1353
1426
|
path3.join(pkg, "build"),
|
|
1354
1427
|
path3.join(pkg, "docs")
|
|
1355
1428
|
];
|
|
1356
|
-
console.log(
|
|
1429
|
+
console.log(chalk20.green(`Cleaning Outputs [${pkgName}]`));
|
|
1357
1430
|
for (let folder of folders) {
|
|
1358
1431
|
deleteGlob(folder);
|
|
1359
1432
|
}
|
|
@@ -1362,11 +1435,11 @@ var packageCleanOutputs = /* @__PURE__ */ __name(() => {
|
|
|
1362
1435
|
|
|
1363
1436
|
// src/actions/package/clean-typescript.ts
|
|
1364
1437
|
import path4 from "node:path";
|
|
1365
|
-
import
|
|
1438
|
+
import chalk21 from "chalk";
|
|
1366
1439
|
var packageCleanTypescript = /* @__PURE__ */ __name(() => {
|
|
1367
1440
|
const pkg = process.env.INIT_CWD ?? ".";
|
|
1368
1441
|
const pkgName = process.env.npm_package_name;
|
|
1369
|
-
console.log(
|
|
1442
|
+
console.log(chalk21.green(`Cleaning Typescript [${pkgName}]`));
|
|
1370
1443
|
const files = [
|
|
1371
1444
|
path4.join(pkg, "*.tsbuildinfo"),
|
|
1372
1445
|
path4.join(pkg, ".tsconfig.*"),
|
|
@@ -1387,19 +1460,19 @@ var packageClean = /* @__PURE__ */ __name(async () => {
|
|
|
1387
1460
|
}, "packageClean");
|
|
1388
1461
|
|
|
1389
1462
|
// src/actions/package/compile/compile.ts
|
|
1390
|
-
import
|
|
1463
|
+
import chalk25 from "chalk";
|
|
1391
1464
|
|
|
1392
1465
|
// src/actions/package/publint.ts
|
|
1393
1466
|
import { promises as fs2 } from "node:fs";
|
|
1394
|
-
import
|
|
1467
|
+
import chalk22 from "chalk";
|
|
1395
1468
|
import sortPackageJson from "sort-package-json";
|
|
1396
1469
|
var packagePublint = /* @__PURE__ */ __name(async (params) => {
|
|
1397
1470
|
const pkgDir = process.env.INIT_CWD;
|
|
1398
1471
|
const sortedPkg = sortPackageJson(await fs2.readFile(`${pkgDir}/package.json`, "utf8"));
|
|
1399
1472
|
await fs2.writeFile(`${pkgDir}/package.json`, sortedPkg);
|
|
1400
1473
|
const pkg = JSON.parse(await fs2.readFile(`${pkgDir}/package.json`, "utf8"));
|
|
1401
|
-
console.log(
|
|
1402
|
-
console.log(
|
|
1474
|
+
console.log(chalk22.green(`Publint: ${pkg.name}`));
|
|
1475
|
+
console.log(chalk22.gray(pkgDir));
|
|
1403
1476
|
const { publint: publint2 } = await import("publint");
|
|
1404
1477
|
const { messages } = await publint2({
|
|
1405
1478
|
level: "suggestion",
|
|
@@ -1414,28 +1487,28 @@ var packagePublint = /* @__PURE__ */ __name(async (params) => {
|
|
|
1414
1487
|
for (const message of validMessages) {
|
|
1415
1488
|
switch (message.type) {
|
|
1416
1489
|
case "error": {
|
|
1417
|
-
console.error(
|
|
1490
|
+
console.error(chalk22.red(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
1418
1491
|
break;
|
|
1419
1492
|
}
|
|
1420
1493
|
case "warning": {
|
|
1421
|
-
console.warn(
|
|
1494
|
+
console.warn(chalk22.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
1422
1495
|
break;
|
|
1423
1496
|
}
|
|
1424
1497
|
default: {
|
|
1425
|
-
console.log(
|
|
1498
|
+
console.log(chalk22.white(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
1426
1499
|
break;
|
|
1427
1500
|
}
|
|
1428
1501
|
}
|
|
1429
1502
|
}
|
|
1430
1503
|
if (params?.verbose) {
|
|
1431
|
-
console.log(
|
|
1504
|
+
console.log(chalk22.gray(`Publint [Finish]: ${pkgDir} [${validMessages.length}]`));
|
|
1432
1505
|
}
|
|
1433
1506
|
return validMessages.filter((message) => message.type === "error").length;
|
|
1434
1507
|
}, "packagePublint");
|
|
1435
1508
|
|
|
1436
1509
|
// src/actions/package/compile/packageCompileTsc.ts
|
|
1437
1510
|
import { cwd } from "node:process";
|
|
1438
|
-
import
|
|
1511
|
+
import chalk23 from "chalk";
|
|
1439
1512
|
import { createProgramFromConfig } from "tsc-prog";
|
|
1440
1513
|
import { DiagnosticCategory, formatDiagnosticsWithColorAndContext, getLineAndCharacterOfPosition, getPreEmitDiagnostics } from "typescript";
|
|
1441
1514
|
|
|
@@ -1505,7 +1578,7 @@ var packageCompileTsc = /* @__PURE__ */ __name(async (noEmit, config2, compilerO
|
|
|
1505
1578
|
character: 0,
|
|
1506
1579
|
line: 0
|
|
1507
1580
|
};
|
|
1508
|
-
console.log(
|
|
1581
|
+
console.log(chalk23.cyan(`${diag.file?.fileName}:${lineAndChar.line + 1}:${lineAndChar.character + 1}`));
|
|
1509
1582
|
console.log(formatDiagnosticsWithColorAndContext([
|
|
1510
1583
|
diag
|
|
1511
1584
|
], formatHost));
|
|
@@ -1555,13 +1628,39 @@ var buildEntries = /* @__PURE__ */ __name((folder, entryMode = "single", verbose
|
|
|
1555
1628
|
return entries;
|
|
1556
1629
|
}, "buildEntries");
|
|
1557
1630
|
|
|
1631
|
+
// src/actions/package/compile/deepMerge.ts
|
|
1632
|
+
function deepMerge(target, source) {
|
|
1633
|
+
if (!source || typeof source !== "object") return target;
|
|
1634
|
+
for (const key of Object.keys(source)) {
|
|
1635
|
+
if (typeof source[key] === "object" && source[key] !== null && !Array.isArray(source[key])) {
|
|
1636
|
+
if (!target[key] || typeof target[key] !== "object") {
|
|
1637
|
+
target[key] = {};
|
|
1638
|
+
}
|
|
1639
|
+
deepMerge(target[key], source[key]);
|
|
1640
|
+
} else {
|
|
1641
|
+
target[key] = source[key];
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
return target;
|
|
1645
|
+
}
|
|
1646
|
+
__name(deepMerge, "deepMerge");
|
|
1647
|
+
function deepMergeObjects(objects) {
|
|
1648
|
+
const result = {};
|
|
1649
|
+
for (const obj of objects) {
|
|
1650
|
+
deepMerge(result, obj);
|
|
1651
|
+
}
|
|
1652
|
+
return result;
|
|
1653
|
+
}
|
|
1654
|
+
__name(deepMergeObjects, "deepMergeObjects");
|
|
1655
|
+
|
|
1558
1656
|
// src/actions/package/compile/packageCompileTscTypes.ts
|
|
1559
1657
|
import { cwd as cwd2 } from "node:process";
|
|
1560
|
-
import
|
|
1658
|
+
import chalk24 from "chalk";
|
|
1561
1659
|
import { createProgramFromConfig as createProgramFromConfig2 } from "tsc-prog";
|
|
1562
1660
|
import { DiagnosticCategory as DiagnosticCategory2 } from "typescript";
|
|
1563
|
-
var packageCompileTscTypes = /* @__PURE__ */ __name((folder = "src",
|
|
1661
|
+
var packageCompileTscTypes = /* @__PURE__ */ __name((folder = "src", config2 = {}, compilerOptionsParam) => {
|
|
1564
1662
|
const pkg = process.env.INIT_CWD ?? cwd2();
|
|
1663
|
+
const verbose = config2?.verbose ?? false;
|
|
1565
1664
|
if (verbose) {
|
|
1566
1665
|
console.log(`Compiling types with TSC [${pkg}]`);
|
|
1567
1666
|
}
|
|
@@ -1569,7 +1668,7 @@ var packageCompileTscTypes = /* @__PURE__ */ __name((folder = "src", { verbose }
|
|
|
1569
1668
|
...getCompilerOptions({
|
|
1570
1669
|
declaration: true,
|
|
1571
1670
|
emitDeclarationOnly: true,
|
|
1572
|
-
outDir: "dist",
|
|
1671
|
+
outDir: "dist/types",
|
|
1573
1672
|
removeComments: false,
|
|
1574
1673
|
skipDefaultLibCheck: true,
|
|
1575
1674
|
skipLibCheck: true,
|
|
@@ -1596,21 +1695,21 @@ var packageCompileTscTypes = /* @__PURE__ */ __name((folder = "src", { verbose }
|
|
|
1596
1695
|
for (const diag of result.diagnostics) {
|
|
1597
1696
|
switch (diag.category) {
|
|
1598
1697
|
case DiagnosticCategory2.Error: {
|
|
1599
|
-
console.error(
|
|
1600
|
-
console.error(
|
|
1601
|
-
console.error(
|
|
1698
|
+
console.error(chalk24.red(diag.messageText));
|
|
1699
|
+
console.error(chalk24.grey(pkg));
|
|
1700
|
+
console.error(chalk24.blue(diag.file?.fileName));
|
|
1602
1701
|
break;
|
|
1603
1702
|
}
|
|
1604
1703
|
case DiagnosticCategory2.Warning: {
|
|
1605
|
-
console.error(
|
|
1606
|
-
console.error(
|
|
1607
|
-
console.error(
|
|
1704
|
+
console.error(chalk24.yellow(diag.messageText));
|
|
1705
|
+
console.error(chalk24.grey(pkg));
|
|
1706
|
+
console.error(chalk24.blue(diag.file?.fileName));
|
|
1608
1707
|
break;
|
|
1609
1708
|
}
|
|
1610
1709
|
case DiagnosticCategory2.Suggestion: {
|
|
1611
|
-
console.error(
|
|
1612
|
-
console.error(
|
|
1613
|
-
console.error(
|
|
1710
|
+
console.error(chalk24.white(diag.messageText));
|
|
1711
|
+
console.error(chalk24.grey(pkg));
|
|
1712
|
+
console.error(chalk24.blue(diag.file?.fileName));
|
|
1614
1713
|
break;
|
|
1615
1714
|
}
|
|
1616
1715
|
}
|
|
@@ -1658,37 +1757,9 @@ var compileFolder = /* @__PURE__ */ __name(async (folder, entryMode = "single",
|
|
|
1658
1757
|
if (verbose) {
|
|
1659
1758
|
console.log(`TSUP:build:stop [${folder}] ${types}`);
|
|
1660
1759
|
}
|
|
1661
|
-
if (types === "tsc") {
|
|
1662
|
-
if (verbose) {
|
|
1663
|
-
console.log(`Calling packageCompileTscTypes [${folder}] ${types}`);
|
|
1664
|
-
}
|
|
1665
|
-
const errors = packageCompileTscTypes(folder, {
|
|
1666
|
-
verbose
|
|
1667
|
-
}, {
|
|
1668
|
-
outDir
|
|
1669
|
-
});
|
|
1670
|
-
if (errors) {
|
|
1671
|
-
return errors;
|
|
1672
|
-
}
|
|
1673
|
-
}
|
|
1674
1760
|
return 0;
|
|
1675
1761
|
}, "compileFolder");
|
|
1676
|
-
var
|
|
1677
|
-
console.warn("packageCompileTsup-types", types);
|
|
1678
|
-
const compile2 = config2?.compile;
|
|
1679
|
-
const verbose = config2?.verbose ?? false;
|
|
1680
|
-
if (verbose) {
|
|
1681
|
-
console.log(`Compiling with TSUP [Depth: ${compile2?.depth}]`);
|
|
1682
|
-
}
|
|
1683
|
-
const compileForNode = compile2?.node ?? {
|
|
1684
|
-
src: {}
|
|
1685
|
-
};
|
|
1686
|
-
const compileForBrowser = compile2?.browser ?? {
|
|
1687
|
-
src: {}
|
|
1688
|
-
};
|
|
1689
|
-
const compileForNeutral = compile2?.neutral ?? {
|
|
1690
|
-
src: {}
|
|
1691
|
-
};
|
|
1762
|
+
var tsupOptions = /* @__PURE__ */ __name((options = []) => {
|
|
1692
1763
|
const standardLoaders = {
|
|
1693
1764
|
".gif": "copy",
|
|
1694
1765
|
".html": "copy",
|
|
@@ -1713,52 +1784,78 @@ var packageCompileTsup = /* @__PURE__ */ __name(async (config2, types = "tsc") =
|
|
|
1713
1784
|
sourcemap: true,
|
|
1714
1785
|
target: "esnext"
|
|
1715
1786
|
};
|
|
1787
|
+
return deepMergeObjects([
|
|
1788
|
+
standardOptions,
|
|
1789
|
+
...options
|
|
1790
|
+
]);
|
|
1791
|
+
}, "tsupOptions");
|
|
1792
|
+
var packageCompileTsup = /* @__PURE__ */ __name(async (config2, types = "tsc") => {
|
|
1793
|
+
console.warn("packageCompileTsup-types", types);
|
|
1794
|
+
const compile2 = config2?.compile;
|
|
1795
|
+
const verbose = config2?.verbose ?? false;
|
|
1796
|
+
if (verbose) {
|
|
1797
|
+
console.log(`Compiling with TSUP [Depth: ${compile2?.depth}]`);
|
|
1798
|
+
}
|
|
1799
|
+
const compileForNode = compile2?.node ?? {
|
|
1800
|
+
src: {}
|
|
1801
|
+
};
|
|
1802
|
+
const compileForBrowser = compile2?.browser ?? {
|
|
1803
|
+
src: {}
|
|
1804
|
+
};
|
|
1805
|
+
const compileForNeutral = compile2?.neutral ?? {
|
|
1806
|
+
src: {}
|
|
1807
|
+
};
|
|
1808
|
+
if (types === "tsc") {
|
|
1809
|
+
if (verbose) {
|
|
1810
|
+
console.log(`Calling packageCompileTscTypes [${types}`);
|
|
1811
|
+
}
|
|
1812
|
+
const errors = packageCompileTscTypes("src", {
|
|
1813
|
+
verbose
|
|
1814
|
+
});
|
|
1815
|
+
if (errors) {
|
|
1816
|
+
return errors;
|
|
1817
|
+
}
|
|
1818
|
+
}
|
|
1716
1819
|
return (await Promise.all(Object.entries(compileForNode).map(async ([folder, options]) => {
|
|
1717
1820
|
const inEsBuildOptions = typeof compile2?.node?.esbuildOptions === "object" ? compile2?.node?.esbuildOptions : {};
|
|
1718
|
-
return folder ? await compileFolder(folder, compile2?.entryMode,
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
...typeof options === "object" ? options : {}
|
|
1728
|
-
}, types, verbose) : 0;
|
|
1821
|
+
return folder ? await compileFolder(folder, compile2?.entryMode, tsupOptions([
|
|
1822
|
+
inEsBuildOptions,
|
|
1823
|
+
compile2?.tsup?.options ?? {},
|
|
1824
|
+
typeof options === "object" ? options : {},
|
|
1825
|
+
{
|
|
1826
|
+
platform: "node",
|
|
1827
|
+
outDir: "dist/node"
|
|
1828
|
+
}
|
|
1829
|
+
]), types, verbose) : 0;
|
|
1729
1830
|
}))).reduce((prev, value) => prev + value, 0) || (await Promise.all(Object.entries(compileForBrowser).map(async ([folder, options]) => {
|
|
1730
1831
|
const inEsBuildOptions = typeof compile2?.browser?.esbuildOptions === "object" ? compile2?.browser?.esbuildOptions : {};
|
|
1731
|
-
return folder ? await compileFolder(folder, compile2?.entryMode,
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
...typeof options === "object" ? options : {}
|
|
1741
|
-
}, types, verbose) : 0;
|
|
1832
|
+
return folder ? await compileFolder(folder, compile2?.entryMode, tsupOptions([
|
|
1833
|
+
inEsBuildOptions,
|
|
1834
|
+
compile2?.tsup?.options ?? {},
|
|
1835
|
+
typeof options === "object" ? options : {},
|
|
1836
|
+
{
|
|
1837
|
+
platform: "browser",
|
|
1838
|
+
outDir: "dist/browser"
|
|
1839
|
+
}
|
|
1840
|
+
]), types, verbose) : 0;
|
|
1742
1841
|
}))).reduce((prev, value) => prev + value, 0) || (await Promise.all(Object.entries(compileForNeutral).map(async ([folder, options]) => {
|
|
1743
1842
|
const inEsBuildOptions = typeof compile2?.neutral?.esbuildOptions === "object" ? compile2?.neutral?.esbuildOptions : {};
|
|
1744
|
-
return folder ? await compileFolder(folder, compile2?.entryMode,
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
...typeof options === "object" ? options : {}
|
|
1754
|
-
}, types, verbose) : 0;
|
|
1843
|
+
return folder ? await compileFolder(folder, compile2?.entryMode, tsupOptions([
|
|
1844
|
+
inEsBuildOptions,
|
|
1845
|
+
compile2?.tsup?.options ?? {},
|
|
1846
|
+
typeof options === "object" ? options : {},
|
|
1847
|
+
{
|
|
1848
|
+
platform: "neutral",
|
|
1849
|
+
outDir: "dist/neutral"
|
|
1850
|
+
}
|
|
1851
|
+
]), types, verbose) : 0;
|
|
1755
1852
|
}))).reduce((prev, value) => prev + value, 0) || 0;
|
|
1756
1853
|
}, "packageCompileTsup");
|
|
1757
1854
|
|
|
1758
1855
|
// src/actions/package/compile/compile.ts
|
|
1759
1856
|
var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}, types) => {
|
|
1760
1857
|
const pkg = process.env.INIT_CWD;
|
|
1761
|
-
console.log(
|
|
1858
|
+
console.log(chalk25.green(`Compiling ${pkg}`));
|
|
1762
1859
|
const config2 = await loadConfig(inConfig);
|
|
1763
1860
|
const publint2 = config2.publint;
|
|
1764
1861
|
const mode = config2.compile?.mode ?? "tsup";
|
|
@@ -1776,9 +1873,18 @@ var packageCompile = /* @__PURE__ */ __name(async (inConfig = {}, types) => {
|
|
|
1776
1873
|
return result + (publint2 ? await packagePublint(config2) : 0);
|
|
1777
1874
|
}, "packageCompile");
|
|
1778
1875
|
|
|
1876
|
+
// src/actions/package/compile/compileTypes.ts
|
|
1877
|
+
import chalk26 from "chalk";
|
|
1878
|
+
var packageCompileTypes = /* @__PURE__ */ __name(async (inConfig = {}) => {
|
|
1879
|
+
const pkg = process.env.INIT_CWD;
|
|
1880
|
+
console.log(chalk26.green(`Compiling Types ${pkg}`));
|
|
1881
|
+
const config2 = await loadConfig(inConfig);
|
|
1882
|
+
return packageCompileTscTypes(void 0, config2);
|
|
1883
|
+
}, "packageCompileTypes");
|
|
1884
|
+
|
|
1779
1885
|
// src/actions/package/copy-assets.ts
|
|
1780
1886
|
import path5 from "node:path/posix";
|
|
1781
|
-
import
|
|
1887
|
+
import chalk27 from "chalk";
|
|
1782
1888
|
import cpy2 from "cpy";
|
|
1783
1889
|
var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) => {
|
|
1784
1890
|
try {
|
|
@@ -1797,7 +1903,7 @@ var copyTargetAssets2 = /* @__PURE__ */ __name(async (target, name, location) =>
|
|
|
1797
1903
|
flat: false
|
|
1798
1904
|
});
|
|
1799
1905
|
if (values.length > 0) {
|
|
1800
|
-
console.log(
|
|
1906
|
+
console.log(chalk27.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
|
|
1801
1907
|
}
|
|
1802
1908
|
for (const value of values) {
|
|
1803
1909
|
console.log(`${value.split("/").pop()} => ./dist/${target}`);
|
|
@@ -1828,7 +1934,7 @@ var packageCopyAssets = /* @__PURE__ */ __name(async ({ target }) => {
|
|
|
1828
1934
|
// src/actions/package/deps.ts
|
|
1829
1935
|
import { existsSync as existsSync5, readFileSync as readFileSync5 } from "node:fs";
|
|
1830
1936
|
import { cwd as cwd3 } from "node:process";
|
|
1831
|
-
import
|
|
1937
|
+
import chalk28 from "chalk";
|
|
1832
1938
|
import depcheck from "depcheck";
|
|
1833
1939
|
var special = depcheck.special;
|
|
1834
1940
|
var defaultIgnorePatterns = [
|
|
@@ -1854,21 +1960,21 @@ var defaultIgnoreDevPatterns = [
|
|
|
1854
1960
|
var reportUnused = /* @__PURE__ */ __name((name, unused) => {
|
|
1855
1961
|
if (unused.length > 0) {
|
|
1856
1962
|
const message = [
|
|
1857
|
-
|
|
1963
|
+
chalk28.yellow(`${unused.length} Unused ${name}`)
|
|
1858
1964
|
];
|
|
1859
|
-
for (const value of unused) message.push(
|
|
1965
|
+
for (const value of unused) message.push(chalk28.gray(` ${value}`));
|
|
1860
1966
|
console.log(message.join("\n"));
|
|
1861
1967
|
}
|
|
1862
1968
|
}, "reportUnused");
|
|
1863
1969
|
var reportMissing = /* @__PURE__ */ __name((name, missing) => {
|
|
1864
1970
|
if (Object.keys(missing).length > 0) {
|
|
1865
1971
|
const message = [
|
|
1866
|
-
|
|
1972
|
+
chalk28.yellow(`${Object.entries(missing).length} Missing ${name}`)
|
|
1867
1973
|
];
|
|
1868
1974
|
for (const [key, value] of Object.entries(missing)) {
|
|
1869
|
-
message.push(`${key}`,
|
|
1975
|
+
message.push(`${key}`, chalk28.gray(` ${value.at(0)}`));
|
|
1870
1976
|
}
|
|
1871
|
-
console.log(
|
|
1977
|
+
console.log(chalk28.yellow(message.join("\n")));
|
|
1872
1978
|
}
|
|
1873
1979
|
}, "reportMissing");
|
|
1874
1980
|
var analyzeDeps = /* @__PURE__ */ __name(async (pkg, ignoreMatches) => {
|
|
@@ -1973,10 +2079,10 @@ var packageDeps = /* @__PURE__ */ __name(async () => {
|
|
|
1973
2079
|
reportUnused("dependencies", unusedDeps);
|
|
1974
2080
|
reportUnused("devDependencies", unusedDevDeps);
|
|
1975
2081
|
if (Object.entries(invalidDirs).length > 0) {
|
|
1976
|
-
for (const [key, value] of Object.entries(invalidDirs)) console.warn(
|
|
2082
|
+
for (const [key, value] of Object.entries(invalidDirs)) console.warn(chalk28.gray(`Invalid Dir: ${key}: ${value}`));
|
|
1977
2083
|
}
|
|
1978
2084
|
if (Object.entries(invalidFiles).length > 0) {
|
|
1979
|
-
for (const [key, value] of Object.entries(invalidFiles)) console.warn(
|
|
2085
|
+
for (const [key, value] of Object.entries(invalidFiles)) console.warn(chalk28.gray(`Invalid File: ${key}: ${value}`));
|
|
1980
2086
|
}
|
|
1981
2087
|
reportMissing("dependencies", missingDepsObject);
|
|
1982
2088
|
reportMissing("devDependencies", missingDevDepsObject);
|
|
@@ -1987,7 +2093,7 @@ var packageDeps = /* @__PURE__ */ __name(async () => {
|
|
|
1987
2093
|
// src/actions/package/gen-docs.ts
|
|
1988
2094
|
import { existsSync as existsSync6 } from "node:fs";
|
|
1989
2095
|
import path6 from "node:path";
|
|
1990
|
-
import
|
|
2096
|
+
import chalk29 from "chalk";
|
|
1991
2097
|
import { Application, ArgumentsReader, TSConfigReader, TypeDocReader } from "typedoc";
|
|
1992
2098
|
var ExitCodes = {
|
|
1993
2099
|
CompileError: 3,
|
|
@@ -2089,7 +2195,7 @@ var runTypeDoc = /* @__PURE__ */ __name(async (app) => {
|
|
|
2089
2195
|
return ExitCodes.OutputError;
|
|
2090
2196
|
}
|
|
2091
2197
|
}
|
|
2092
|
-
console.log(
|
|
2198
|
+
console.log(chalk29.green(`${pkgName} - Ok`));
|
|
2093
2199
|
return ExitCodes.Ok;
|
|
2094
2200
|
}, "runTypeDoc");
|
|
2095
2201
|
|
|
@@ -2098,7 +2204,7 @@ import { readdirSync } from "node:fs";
|
|
|
2098
2204
|
import path7 from "node:path";
|
|
2099
2205
|
import { cwd as cwd4 } from "node:process";
|
|
2100
2206
|
import { pathToFileURL } from "node:url";
|
|
2101
|
-
import
|
|
2207
|
+
import chalk30 from "chalk";
|
|
2102
2208
|
import { ESLint as ESLint3 } from "eslint";
|
|
2103
2209
|
import { findUp } from "find-up";
|
|
2104
2210
|
import picomatch from "picomatch";
|
|
@@ -2115,10 +2221,10 @@ var dumpMessages2 = /* @__PURE__ */ __name((lintResults) => {
|
|
|
2115
2221
|
];
|
|
2116
2222
|
for (const lintResult of lintResults) {
|
|
2117
2223
|
if (lintResult.messages.length > 0) {
|
|
2118
|
-
console.log(
|
|
2224
|
+
console.log(chalk30.gray(`
|
|
2119
2225
|
${lintResult.filePath}`));
|
|
2120
2226
|
for (const message of lintResult.messages) {
|
|
2121
|
-
console.log(
|
|
2227
|
+
console.log(chalk30.gray(` ${message.line}:${message.column}`), chalk30[colors[message.severity]](` ${severity[message.severity]}`), chalk30.white(` ${message.message}`), chalk30.gray(` ${message.ruleId}`));
|
|
2122
2228
|
}
|
|
2123
2229
|
}
|
|
2124
2230
|
}
|
|
@@ -2149,6 +2255,7 @@ function getFiles(dir, ignoreFolders) {
|
|
|
2149
2255
|
}
|
|
2150
2256
|
__name(getFiles, "getFiles");
|
|
2151
2257
|
var packageLint = /* @__PURE__ */ __name(async (fix2 = false) => {
|
|
2258
|
+
const pkg = process.env.INIT_CWD;
|
|
2152
2259
|
const configPath = await getRootESLintConfig();
|
|
2153
2260
|
const { default: eslintConfig } = await import(configPath.href);
|
|
2154
2261
|
const ignoreFolders = [
|
|
@@ -2169,6 +2276,7 @@ var packageLint = /* @__PURE__ */ __name(async (fix2 = false) => {
|
|
|
2169
2276
|
warnIgnored: false
|
|
2170
2277
|
});
|
|
2171
2278
|
const files = getFiles(cwd4(), ignoreFolders);
|
|
2279
|
+
console.log(chalk30.green(`Linting ${pkg} [${files.length}]`));
|
|
2172
2280
|
const lintResults = await engine.lintFiles(files);
|
|
2173
2281
|
dumpMessages2(lintResults);
|
|
2174
2282
|
if (fix2) {
|
|
@@ -2240,7 +2348,7 @@ var rebuild = /* @__PURE__ */ __name(({ target }) => {
|
|
|
2240
2348
|
}, "rebuild");
|
|
2241
2349
|
|
|
2242
2350
|
// src/actions/recompile.ts
|
|
2243
|
-
import
|
|
2351
|
+
import chalk31 from "chalk";
|
|
2244
2352
|
var recompile = /* @__PURE__ */ __name(async ({ verbose, target, pkg, incremental }) => {
|
|
2245
2353
|
return pkg ? await recompilePackage({
|
|
2246
2354
|
pkg,
|
|
@@ -2301,7 +2409,7 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
|
|
|
2301
2409
|
`${jobs}`
|
|
2302
2410
|
] : [];
|
|
2303
2411
|
if (jobs) {
|
|
2304
|
-
console.log(
|
|
2412
|
+
console.log(chalk31.blue(`Jobs set to [${jobs}]`));
|
|
2305
2413
|
}
|
|
2306
2414
|
const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
|
|
2307
2415
|
[
|
|
@@ -2331,7 +2439,7 @@ var recompileAll = /* @__PURE__ */ __name(async ({ jobs, verbose, target, increm
|
|
|
2331
2439
|
]
|
|
2332
2440
|
]
|
|
2333
2441
|
]);
|
|
2334
|
-
console.log(`${
|
|
2442
|
+
console.log(`${chalk31.gray("Recompiled in")} [${chalk31.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk31.gray("seconds")}`);
|
|
2335
2443
|
return result;
|
|
2336
2444
|
}, "recompileAll");
|
|
2337
2445
|
|
|
@@ -2431,7 +2539,7 @@ var sonar = /* @__PURE__ */ __name(() => {
|
|
|
2431
2539
|
}, "sonar");
|
|
2432
2540
|
|
|
2433
2541
|
// src/actions/statics.ts
|
|
2434
|
-
import
|
|
2542
|
+
import chalk32 from "chalk";
|
|
2435
2543
|
var DefaultDependencies = [
|
|
2436
2544
|
"axios",
|
|
2437
2545
|
"@xylabs/pixel",
|
|
@@ -2442,7 +2550,7 @@ var DefaultDependencies = [
|
|
|
2442
2550
|
"@mui/system"
|
|
2443
2551
|
];
|
|
2444
2552
|
var statics = /* @__PURE__ */ __name(() => {
|
|
2445
|
-
console.log(
|
|
2553
|
+
console.log(chalk32.green("Check Required Static Dependencies"));
|
|
2446
2554
|
const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
|
|
2447
2555
|
return detectDuplicateDependencies(statics2, DefaultDependencies);
|
|
2448
2556
|
}, "statics");
|
|
@@ -2560,7 +2668,7 @@ var loadPackageConfig = /* @__PURE__ */ __name(async () => {
|
|
|
2560
2668
|
}, "loadPackageConfig");
|
|
2561
2669
|
|
|
2562
2670
|
// src/xy/xy.ts
|
|
2563
|
-
import
|
|
2671
|
+
import chalk34 from "chalk";
|
|
2564
2672
|
|
|
2565
2673
|
// src/xy/xyBuildCommands.ts
|
|
2566
2674
|
var xyBuildCommands = /* @__PURE__ */ __name((args) => {
|
|
@@ -2595,6 +2703,20 @@ var xyBuildCommands = /* @__PURE__ */ __name((args) => {
|
|
|
2595
2703
|
types: argv.types,
|
|
2596
2704
|
verbose: !!argv.verbose
|
|
2597
2705
|
});
|
|
2706
|
+
}).command("compile-types [package]", "Compile types with Typescript", (yargs2) => {
|
|
2707
|
+
return yargs2.positional("package", {
|
|
2708
|
+
describe: "Specific package to compile"
|
|
2709
|
+
});
|
|
2710
|
+
}, (argv) => {
|
|
2711
|
+
if (argv.verbose) {
|
|
2712
|
+
console.log(`Compiling: ${argv.package ?? "all"}`);
|
|
2713
|
+
}
|
|
2714
|
+
process.exitCode = compileTypes({
|
|
2715
|
+
incremental: !!argv.incremental,
|
|
2716
|
+
jobs: argv.jobs,
|
|
2717
|
+
pkg: argv.package,
|
|
2718
|
+
verbose: !!argv.verbose
|
|
2719
|
+
});
|
|
2598
2720
|
}).command("compile-only [package]", "Compile with Typescript & Copy Images (No Publint)", (yargs2) => {
|
|
2599
2721
|
return yargs2.positional("package", {
|
|
2600
2722
|
describe: "Specific package to compile"
|
|
@@ -2797,7 +2919,7 @@ var xyInstallCommands = /* @__PURE__ */ __name((args) => {
|
|
|
2797
2919
|
}, "xyInstallCommands");
|
|
2798
2920
|
|
|
2799
2921
|
// src/xy/xyLintCommands.ts
|
|
2800
|
-
import
|
|
2922
|
+
import chalk33 from "chalk";
|
|
2801
2923
|
var xyLintCommands = /* @__PURE__ */ __name((args) => {
|
|
2802
2924
|
return args.command("cycle [package]", "Cycle - Check for dependency cycles", (yargs2) => {
|
|
2803
2925
|
return packagePositionalParam(yargs2);
|
|
@@ -2805,7 +2927,7 @@ var xyLintCommands = /* @__PURE__ */ __name((args) => {
|
|
|
2805
2927
|
const start = Date.now();
|
|
2806
2928
|
if (argv.verbose) console.log("Cycle");
|
|
2807
2929
|
process.exitCode = await cycle();
|
|
2808
|
-
console.log(
|
|
2930
|
+
console.log(chalk33.blue(`Finished in ${Date.now() - start}ms`));
|
|
2809
2931
|
}).command("lint [package]", "Lint - Run Eslint", (yargs2) => {
|
|
2810
2932
|
return packagePositionalParam(yargs2);
|
|
2811
2933
|
}, async (argv) => {
|
|
@@ -2814,21 +2936,21 @@ var xyLintCommands = /* @__PURE__ */ __name((args) => {
|
|
|
2814
2936
|
process.exitCode = argv.fix ? await fix() : argv.profile ? lintProfile() : await lint({
|
|
2815
2937
|
pkg: argv.package
|
|
2816
2938
|
});
|
|
2817
|
-
console.log(
|
|
2939
|
+
console.log(chalk33.blue(`Finished in ${Date.now() - start}ms`));
|
|
2818
2940
|
}).command("fix [package]", "Fix - Run Eslint w/fix", (yargs2) => {
|
|
2819
2941
|
return packagePositionalParam(yargs2);
|
|
2820
2942
|
}, async (argv) => {
|
|
2821
2943
|
const start = Date.now();
|
|
2822
2944
|
if (argv.verbose) console.log("Fix");
|
|
2823
2945
|
process.exitCode = await fix();
|
|
2824
|
-
console.log(
|
|
2946
|
+
console.log(chalk33.blue(`Finished in ${Date.now() - start}ms`));
|
|
2825
2947
|
}).command("relint [package]", "Relint - Clean & Lint", (yargs2) => {
|
|
2826
2948
|
return packagePositionalParam(yargs2);
|
|
2827
2949
|
}, (argv) => {
|
|
2828
2950
|
if (argv.verbose) console.log("Relinting");
|
|
2829
2951
|
const start = Date.now();
|
|
2830
2952
|
process.exitCode = relint();
|
|
2831
|
-
console.log(
|
|
2953
|
+
console.log(chalk33.blue(`Finished in ${Date.now() - start}ms`));
|
|
2832
2954
|
}).command("publint [package]", "Publint - Run Publint", (yargs2) => {
|
|
2833
2955
|
return packagePositionalParam(yargs2);
|
|
2834
2956
|
}, async (argv) => {
|
|
@@ -2838,14 +2960,14 @@ var xyLintCommands = /* @__PURE__ */ __name((args) => {
|
|
|
2838
2960
|
pkg: argv.package,
|
|
2839
2961
|
verbose: !!argv.verbose
|
|
2840
2962
|
});
|
|
2841
|
-
console.log(
|
|
2963
|
+
console.log(chalk33.blue(`Finished in ${Date.now() - start}ms`));
|
|
2842
2964
|
}).command("sonar", "Sonar - Run Sonar Check", (yargs2) => {
|
|
2843
2965
|
return packagePositionalParam(yargs2);
|
|
2844
2966
|
}, (argv) => {
|
|
2845
2967
|
const start = Date.now();
|
|
2846
2968
|
if (argv.verbose) console.log("Sonar Check");
|
|
2847
2969
|
process.exitCode = sonar();
|
|
2848
|
-
console.log(
|
|
2970
|
+
console.log(chalk33.blue(`Finished in ${Date.now() - start}ms`));
|
|
2849
2971
|
});
|
|
2850
2972
|
}, "xyLintCommands");
|
|
2851
2973
|
|
|
@@ -2907,8 +3029,8 @@ var xyParseOptions = /* @__PURE__ */ __name(() => {
|
|
|
2907
3029
|
var xy = /* @__PURE__ */ __name(async () => {
|
|
2908
3030
|
const options = xyParseOptions();
|
|
2909
3031
|
return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
|
|
2910
|
-
console.error(
|
|
2911
|
-
console.log(
|
|
3032
|
+
console.error(chalk34.yellow(`Command not found [${chalk34.magenta(process.argv[2])}]`));
|
|
3033
|
+
console.log(chalk34.gray("Try 'yarn xy --help' for list of commands"));
|
|
2912
3034
|
}).version().help().argv;
|
|
2913
3035
|
}, "xy");
|
|
2914
3036
|
export {
|
|
@@ -2925,6 +3047,9 @@ export {
|
|
|
2925
3047
|
compile,
|
|
2926
3048
|
compileAll,
|
|
2927
3049
|
compilePackage,
|
|
3050
|
+
compileTypes,
|
|
3051
|
+
compileTypesAll,
|
|
3052
|
+
compileTypesPackage,
|
|
2928
3053
|
copyAssets,
|
|
2929
3054
|
createBuildConfig,
|
|
2930
3055
|
cycle,
|
|
@@ -2968,7 +3093,9 @@ export {
|
|
|
2968
3093
|
packageCleanTypescript,
|
|
2969
3094
|
packageCompile,
|
|
2970
3095
|
packageCompileTsc,
|
|
3096
|
+
packageCompileTscTypes,
|
|
2971
3097
|
packageCompileTsup,
|
|
3098
|
+
packageCompileTypes,
|
|
2972
3099
|
packageCopyAssets,
|
|
2973
3100
|
packageDeps,
|
|
2974
3101
|
packageGenDocs,
|
|
@@ -3000,6 +3127,7 @@ export {
|
|
|
3000
3127
|
statics,
|
|
3001
3128
|
test,
|
|
3002
3129
|
tryReadFileSync,
|
|
3130
|
+
tsupOptions,
|
|
3003
3131
|
union,
|
|
3004
3132
|
up,
|
|
3005
3133
|
updateYarnPlugins,
|