@xylabs/ts-scripts-yarn3 6.5.2 → 6.5.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/deplint/checkPackage/checkPackage.mjs +37 -40
- package/dist/actions/deplint/checkPackage/checkPackage.mjs.map +1 -1
- package/dist/actions/deplint/checkPackage/getUnlistedDependencies.mjs +1 -5
- package/dist/actions/deplint/checkPackage/getUnlistedDependencies.mjs.map +1 -1
- package/dist/actions/deplint/checkPackage/index.mjs +37 -40
- package/dist/actions/deplint/checkPackage/index.mjs.map +1 -1
- package/dist/actions/deplint/deplint.mjs +40 -43
- package/dist/actions/deplint/deplint.mjs.map +1 -1
- package/dist/actions/deplint/findFiles.mjs +6 -2
- package/dist/actions/deplint/findFiles.mjs.map +1 -1
- package/dist/actions/deplint/getExternalImportsFromFiles.mjs +10 -5
- package/dist/actions/deplint/getExternalImportsFromFiles.mjs.map +1 -1
- package/dist/actions/deplint/getImportsFromFile.mjs +1 -1
- package/dist/actions/deplint/getImportsFromFile.mjs.map +1 -1
- package/dist/actions/deplint/index.mjs +40 -43
- package/dist/actions/deplint/index.mjs.map +1 -1
- package/dist/actions/index.mjs +101 -104
- package/dist/actions/index.mjs.map +1 -1
- package/dist/bin/xy.mjs +84 -87
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/index.mjs +113 -116
- package/dist/index.mjs.map +1 -1
- package/dist/xy/index.mjs +84 -87
- package/dist/xy/index.mjs.map +1 -1
- package/dist/xy/xy.mjs +84 -87
- package/dist/xy/xy.mjs.map +1 -1
- package/dist/xy/xyLintCommands.mjs +59 -62
- package/dist/xy/xyLintCommands.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -748,7 +748,7 @@ var dead = () => {
|
|
|
748
748
|
};
|
|
749
749
|
|
|
750
750
|
// src/actions/deplint/deplint.ts
|
|
751
|
-
import
|
|
751
|
+
import chalk18 from "chalk";
|
|
752
752
|
|
|
753
753
|
// src/actions/deplint/findFilesByGlob.ts
|
|
754
754
|
import { globSync } from "glob";
|
|
@@ -758,16 +758,20 @@ function findFilesByGlob(cwd4, pattern) {
|
|
|
758
758
|
|
|
759
759
|
// src/actions/deplint/findFiles.ts
|
|
760
760
|
function findFiles(path10) {
|
|
761
|
-
const allSourceInclude = ["./src/**/*.{ts,tsx}"
|
|
761
|
+
const allSourceInclude = ["./src/**/*.{ts,tsx}"];
|
|
762
|
+
const allDistInclude = ["./dist/**/*.d.ts"];
|
|
762
763
|
const prodExcludeEndswith = [".spec.ts", ".stories.tsx"];
|
|
763
764
|
const prodExcludeIncludes = ["/spec/", "/stories/", "/scripts/"];
|
|
764
765
|
const allSourceFiles = allSourceInclude.flatMap((pattern) => findFilesByGlob(path10, pattern));
|
|
766
|
+
const allDistFiles = allDistInclude.flatMap((pattern) => findFilesByGlob(path10, pattern));
|
|
765
767
|
const prodSourceFiles = allSourceFiles.filter((file) => !prodExcludeEndswith.some((ext) => file.endsWith(ext)) && !prodExcludeIncludes.some((excl) => file.includes(excl)));
|
|
768
|
+
const prodDistFiles = allDistFiles.filter((file) => !prodExcludeEndswith.some((ext) => file.endsWith(ext)) && !prodExcludeIncludes.some((excl) => file.includes(excl)));
|
|
766
769
|
const devSourceFiles = allSourceFiles.filter((file) => !prodSourceFiles.includes(file));
|
|
767
770
|
return {
|
|
768
771
|
allSourceFiles,
|
|
769
772
|
prodSourceFiles,
|
|
770
|
-
devSourceFiles
|
|
773
|
+
devSourceFiles,
|
|
774
|
+
prodDistFiles
|
|
771
775
|
};
|
|
772
776
|
}
|
|
773
777
|
|
|
@@ -820,7 +824,7 @@ function getImportsFromFile(filePath, importPaths, typeImportPaths) {
|
|
|
820
824
|
const isTypeImport = ts.isImportDeclaration(node) ? node.importClause?.isTypeOnly ?? false : false;
|
|
821
825
|
if (moduleSpecifier) {
|
|
822
826
|
const trimmed = moduleSpecifier.split("'").at(1) ?? moduleSpecifier;
|
|
823
|
-
if (isTypeImport
|
|
827
|
+
if (isTypeImport || isDeclarationFile) {
|
|
824
828
|
typeImports.push(trimmed);
|
|
825
829
|
} else {
|
|
826
830
|
imports.push(trimmed);
|
|
@@ -855,19 +859,24 @@ var internalImportPrefixes = [".", "#", "node:"];
|
|
|
855
859
|
var removeInternalImports = (imports) => {
|
|
856
860
|
return imports.filter((imp) => !internalImportPrefixes.some((prefix) => imp.startsWith(prefix)));
|
|
857
861
|
};
|
|
858
|
-
function getExternalImportsFromFiles({
|
|
862
|
+
function getExternalImportsFromFiles({
|
|
863
|
+
prodSourceFiles,
|
|
864
|
+
devSourceFiles,
|
|
865
|
+
prodDistFiles
|
|
866
|
+
}) {
|
|
859
867
|
const prodImportPaths = {};
|
|
860
868
|
const prodTypeImportPaths = {};
|
|
861
869
|
const prodImportPairs = prodSourceFiles.map((path10) => getImportsFromFile(path10, prodImportPaths, prodTypeImportPaths));
|
|
870
|
+
const prodDistImportPairs = prodDistFiles.map((path10) => getImportsFromFile(path10, prodImportPaths, prodTypeImportPaths));
|
|
862
871
|
const prodImports = prodImportPairs.flatMap((pair) => pair[0]);
|
|
863
|
-
const
|
|
872
|
+
const prodDistImports = prodDistImportPairs.flatMap((pair) => pair[1]);
|
|
864
873
|
const devImportPaths = {};
|
|
865
874
|
const devTypeImportPaths = {};
|
|
866
875
|
const devImportPairs = devSourceFiles.map((path10) => getImportsFromFile(path10, devImportPaths, devTypeImportPaths));
|
|
867
876
|
const devImports = devImportPairs.flatMap((pair) => pair[0]);
|
|
868
877
|
const devTypeImports = devImportPairs.flatMap((pair) => pair[1]);
|
|
869
878
|
const externalProdImports = removeInternalImports(prodImports);
|
|
870
|
-
const externalProdTypeImports = removeInternalImports(
|
|
879
|
+
const externalProdTypeImports = removeInternalImports(prodDistImports);
|
|
871
880
|
const externalDevImports = removeInternalImports(devImports);
|
|
872
881
|
return {
|
|
873
882
|
prodImports,
|
|
@@ -877,35 +886,15 @@ function getExternalImportsFromFiles({ prodSourceFiles, devSourceFiles }) {
|
|
|
877
886
|
devImportPaths,
|
|
878
887
|
externalProdImports,
|
|
879
888
|
externalDevImports,
|
|
880
|
-
|
|
889
|
+
prodDistImports,
|
|
881
890
|
devTypeImports,
|
|
882
891
|
externalProdTypeImports
|
|
883
892
|
};
|
|
884
893
|
}
|
|
885
894
|
|
|
886
|
-
// src/actions/deplint/checkPackage/getTypesInDependencies.ts
|
|
887
|
-
import chalk14 from "chalk";
|
|
888
|
-
function getTypesInDependencies({ name, location }, { dependencies }, {}) {
|
|
889
|
-
let typesInDependencies = 0;
|
|
890
|
-
for (const dep of dependencies) {
|
|
891
|
-
if (dep.startsWith("@types/")) {
|
|
892
|
-
typesInDependencies++;
|
|
893
|
-
console.log(`[${chalk14.blue(name)}] @types in dependencies in package.json: ${chalk14.red(dep)}`);
|
|
894
|
-
console.log(` ${location}/package.json
|
|
895
|
-
`);
|
|
896
|
-
console.log("");
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
return typesInDependencies;
|
|
900
|
-
}
|
|
901
|
-
|
|
902
895
|
// src/actions/deplint/checkPackage/getUnlistedDependencies.ts
|
|
903
|
-
import
|
|
904
|
-
function getUnlistedDependencies({ name }, {
|
|
905
|
-
dependencies,
|
|
906
|
-
devDependencies,
|
|
907
|
-
peerDependencies
|
|
908
|
-
}, {
|
|
896
|
+
import chalk14 from "chalk";
|
|
897
|
+
function getUnlistedDependencies({ name }, { dependencies, peerDependencies }, {
|
|
909
898
|
externalProdTypeImports,
|
|
910
899
|
prodTypeImportPaths,
|
|
911
900
|
externalProdImports,
|
|
@@ -915,7 +904,7 @@ function getUnlistedDependencies({ name }, {
|
|
|
915
904
|
for (const imp of externalProdTypeImports) {
|
|
916
905
|
if (!dependencies.includes(imp) && !peerDependencies.includes(imp) && !dependencies.includes(`@types/${imp}`) && !peerDependencies.includes(`@types/${imp}`)) {
|
|
917
906
|
unlistedDependencies++;
|
|
918
|
-
console.log(`[${
|
|
907
|
+
console.log(`[${chalk14.blue(name)}] Missing dependency in package.json: ${chalk14.red(imp)}`);
|
|
919
908
|
console.log(` ${prodTypeImportPaths[imp].join("\n")}`);
|
|
920
909
|
console.log("");
|
|
921
910
|
}
|
|
@@ -923,7 +912,7 @@ function getUnlistedDependencies({ name }, {
|
|
|
923
912
|
for (const imp of externalProdImports) {
|
|
924
913
|
if (!dependencies.includes(imp) && !peerDependencies.includes(imp)) {
|
|
925
914
|
unlistedDependencies++;
|
|
926
|
-
console.log(`[${
|
|
915
|
+
console.log(`[${chalk14.blue(name)}] Missing dependency in package.json: ${chalk14.red(imp)}`);
|
|
927
916
|
console.log(` ${prodImportPaths[imp].join("\n")}`);
|
|
928
917
|
console.log("");
|
|
929
918
|
}
|
|
@@ -932,7 +921,7 @@ function getUnlistedDependencies({ name }, {
|
|
|
932
921
|
}
|
|
933
922
|
|
|
934
923
|
// src/actions/deplint/checkPackage/getUnlistedDevDependencies.ts
|
|
935
|
-
import
|
|
924
|
+
import chalk15 from "chalk";
|
|
936
925
|
function getUnlistedDevDependencies({ name }, {
|
|
937
926
|
devDependencies,
|
|
938
927
|
dependencies,
|
|
@@ -942,7 +931,7 @@ function getUnlistedDevDependencies({ name }, {
|
|
|
942
931
|
for (const imp of externalDevImports) {
|
|
943
932
|
if (!devDependencies.includes(imp) && !dependencies.includes(imp) && !peerDependencies.includes(imp)) {
|
|
944
933
|
unlistedDevDependencies++;
|
|
945
|
-
console.log(`[${
|
|
934
|
+
console.log(`[${chalk15.blue(name)}] Missing devDependency in package.json: ${chalk15.red(imp)}`);
|
|
946
935
|
console.log(` Found in: ${devImportPaths[imp].join(", ")}`);
|
|
947
936
|
}
|
|
948
937
|
}
|
|
@@ -950,7 +939,7 @@ function getUnlistedDevDependencies({ name }, {
|
|
|
950
939
|
}
|
|
951
940
|
|
|
952
941
|
// src/actions/deplint/checkPackage/getUnusedDependencies.ts
|
|
953
|
-
import
|
|
942
|
+
import chalk16 from "chalk";
|
|
954
943
|
function getUnusedDependencies({ name, location }, { dependencies }, {
|
|
955
944
|
externalProdImports,
|
|
956
945
|
externalProdTypeImports
|
|
@@ -959,7 +948,7 @@ function getUnusedDependencies({ name, location }, { dependencies }, {
|
|
|
959
948
|
for (const dep of dependencies) {
|
|
960
949
|
if (!externalProdImports.includes(dep) && !externalProdTypeImports.includes(dep)) {
|
|
961
950
|
unusedDependencies++;
|
|
962
|
-
console.log(`[${
|
|
951
|
+
console.log(`[${chalk16.blue(name)}] Unused dependency in package.json: ${chalk16.red(dep)}`);
|
|
963
952
|
console.log(` ${location}/package.json
|
|
964
953
|
`);
|
|
965
954
|
console.log("");
|
|
@@ -969,13 +958,13 @@ function getUnusedDependencies({ name, location }, { dependencies }, {
|
|
|
969
958
|
}
|
|
970
959
|
|
|
971
960
|
// src/actions/deplint/checkPackage/getUnusedPeerDependencies.ts
|
|
972
|
-
import
|
|
961
|
+
import chalk17 from "chalk";
|
|
973
962
|
function getUnusedPeerDependencies({ name, location }, { peerDependencies }, { externalProdImports, externalProdTypeImports }) {
|
|
974
963
|
let unusedDependencies = 0;
|
|
975
964
|
for (const dep of peerDependencies) {
|
|
976
965
|
if (!externalProdImports.includes(dep) && !externalProdTypeImports.includes(dep)) {
|
|
977
966
|
unusedDependencies++;
|
|
978
|
-
console.log(`[${
|
|
967
|
+
console.log(`[${chalk17.blue(name)}] Unused peerDependency in package.json: ${chalk17.red(dep)}`);
|
|
979
968
|
console.log(` ${location}/package.json
|
|
980
969
|
`);
|
|
981
970
|
console.log("");
|
|
@@ -992,15 +981,23 @@ function checkPackage({
|
|
|
992
981
|
devDeps = false,
|
|
993
982
|
peerDeps = false
|
|
994
983
|
}) {
|
|
995
|
-
const {
|
|
984
|
+
const {
|
|
985
|
+
prodSourceFiles,
|
|
986
|
+
devSourceFiles,
|
|
987
|
+
prodDistFiles
|
|
988
|
+
} = findFiles(location);
|
|
996
989
|
const checkDeps = deps || !(deps || devDeps || peerDeps);
|
|
997
990
|
const checkDevDeps = devDeps || !(deps || devDeps || peerDeps);
|
|
998
991
|
const checkPeerDeps = peerDeps || !(deps || devDeps || peerDeps);
|
|
999
|
-
const sourceParams = getExternalImportsFromFiles({
|
|
992
|
+
const sourceParams = getExternalImportsFromFiles({
|
|
993
|
+
prodSourceFiles,
|
|
994
|
+
devSourceFiles,
|
|
995
|
+
prodDistFiles
|
|
996
|
+
});
|
|
1000
997
|
const packageParams = getDependenciesFromPackageJson(`${location}/package.json`);
|
|
1001
998
|
const unlistedDependencies = checkDeps ? getUnlistedDependencies({ name, location }, packageParams, sourceParams) : 0;
|
|
1002
999
|
const unusedDependencies = checkDeps ? getUnusedDependencies({ name, location }, packageParams, sourceParams) : 0;
|
|
1003
|
-
const typesInDependencies =
|
|
1000
|
+
const typesInDependencies = 0;
|
|
1004
1001
|
const unlistedDevDependencies = checkDevDeps ? getUnlistedDevDependencies({ name, location }, packageParams, sourceParams) : 0;
|
|
1005
1002
|
const unusedPeerDependencies = checkPeerDeps ? getUnusedPeerDependencies({ name, location }, packageParams, sourceParams) : 0;
|
|
1006
1003
|
const totalErrors = unlistedDependencies + unlistedDevDependencies + unusedDependencies + typesInDependencies + unusedPeerDependencies;
|
|
@@ -1037,9 +1034,9 @@ var deplint = ({
|
|
|
1037
1034
|
});
|
|
1038
1035
|
}
|
|
1039
1036
|
if (totalErrors > 0) {
|
|
1040
|
-
console.log(`Deplint: Found ${
|
|
1037
|
+
console.log(`Deplint: Found ${chalk18.red(totalErrors)} dependency problems. ${chalk18.red("\u2716")}`);
|
|
1041
1038
|
} else {
|
|
1042
|
-
console.log(`Deplint: Found no dependency problems. ${
|
|
1039
|
+
console.log(`Deplint: Found no dependency problems. ${chalk18.green("\u2714")}`);
|
|
1043
1040
|
}
|
|
1044
1041
|
}
|
|
1045
1042
|
return 0;
|
|
@@ -1146,18 +1143,18 @@ var deployNext = () => {
|
|
|
1146
1143
|
};
|
|
1147
1144
|
|
|
1148
1145
|
// src/actions/dupdeps.ts
|
|
1149
|
-
import
|
|
1146
|
+
import chalk19 from "chalk";
|
|
1150
1147
|
var dupdeps = () => {
|
|
1151
|
-
console.log(
|
|
1148
|
+
console.log(chalk19.green("Checking all Dependencies for Duplicates"));
|
|
1152
1149
|
const allDependencies = parsedPackageJSON()?.dependencies;
|
|
1153
1150
|
const dependencies = Object.entries(allDependencies).map(([k]) => k);
|
|
1154
1151
|
return detectDuplicateDependencies(dependencies);
|
|
1155
1152
|
};
|
|
1156
1153
|
|
|
1157
1154
|
// src/actions/lint.ts
|
|
1158
|
-
import
|
|
1155
|
+
import chalk20 from "chalk";
|
|
1159
1156
|
var lintPackage = ({ pkg, fix: fix2 }) => {
|
|
1160
|
-
console.log(
|
|
1157
|
+
console.log(chalk20.gray(`${fix2 ? "Fix" : "Lint"} [${pkg}]`));
|
|
1161
1158
|
const start = Date.now();
|
|
1162
1159
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [${pkg}]`, [
|
|
1163
1160
|
["yarn", [
|
|
@@ -1167,7 +1164,7 @@ var lintPackage = ({ pkg, fix: fix2 }) => {
|
|
|
1167
1164
|
fix2 ? "package-fix" : "package-lint"
|
|
1168
1165
|
]]
|
|
1169
1166
|
]);
|
|
1170
|
-
console.log(
|
|
1167
|
+
console.log(chalk20.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk20.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk20.gray("seconds")}`));
|
|
1171
1168
|
return result;
|
|
1172
1169
|
};
|
|
1173
1170
|
var lint = ({
|
|
@@ -1183,13 +1180,13 @@ var lint = ({
|
|
|
1183
1180
|
});
|
|
1184
1181
|
};
|
|
1185
1182
|
var lintAllPackages = ({ fix: fix2 = false } = {}) => {
|
|
1186
|
-
console.log(
|
|
1183
|
+
console.log(chalk20.gray(`${fix2 ? "Fix" : "Lint"} [All-Packages]`));
|
|
1187
1184
|
const start = Date.now();
|
|
1188
1185
|
const fixOptions = fix2 ? ["--fix"] : [];
|
|
1189
1186
|
const result = runSteps(`${fix2 ? "Fix" : "Lint"} [All-Packages]`, [
|
|
1190
1187
|
["yarn", ["eslint", ...fixOptions]]
|
|
1191
1188
|
]);
|
|
1192
|
-
console.log(
|
|
1189
|
+
console.log(chalk20.gray(`${fix2 ? "Fixed in" : "Linted in"} [${chalk20.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk20.gray("seconds")}`));
|
|
1193
1190
|
return result;
|
|
1194
1191
|
};
|
|
1195
1192
|
|
|
@@ -1217,7 +1214,7 @@ var filename = ".gitignore";
|
|
|
1217
1214
|
var gitignoreGen = (pkg) => generateIgnoreFiles(filename, pkg);
|
|
1218
1215
|
|
|
1219
1216
|
// src/actions/gitlint.ts
|
|
1220
|
-
import
|
|
1217
|
+
import chalk21 from "chalk";
|
|
1221
1218
|
import ParseGitConfig from "parse-git-config";
|
|
1222
1219
|
var gitlint = () => {
|
|
1223
1220
|
console.log(`
|
|
@@ -1228,7 +1225,7 @@ Gitlint Start [${process.cwd()}]
|
|
|
1228
1225
|
const errors = 0;
|
|
1229
1226
|
const gitConfig = ParseGitConfig.sync();
|
|
1230
1227
|
const warn = (message) => {
|
|
1231
|
-
console.warn(
|
|
1228
|
+
console.warn(chalk21.yellow(`Warning: ${message}`));
|
|
1232
1229
|
warnings++;
|
|
1233
1230
|
};
|
|
1234
1231
|
if (gitConfig.core.ignorecase) {
|
|
@@ -1248,13 +1245,13 @@ Gitlint Start [${process.cwd()}]
|
|
|
1248
1245
|
}
|
|
1249
1246
|
const resultMessages = [];
|
|
1250
1247
|
if (valid > 0) {
|
|
1251
|
-
resultMessages.push(
|
|
1248
|
+
resultMessages.push(chalk21.green(`Passed: ${valid}`));
|
|
1252
1249
|
}
|
|
1253
1250
|
if (warnings > 0) {
|
|
1254
|
-
resultMessages.push(
|
|
1251
|
+
resultMessages.push(chalk21.yellow(`Warnings: ${warnings}`));
|
|
1255
1252
|
}
|
|
1256
1253
|
if (errors > 0) {
|
|
1257
|
-
resultMessages.push(
|
|
1254
|
+
resultMessages.push(chalk21.red(` Errors: ${errors}`));
|
|
1258
1255
|
}
|
|
1259
1256
|
console.warn(`Gitlint Finish [ ${resultMessages.join(" | ")} ]
|
|
1260
1257
|
`);
|
|
@@ -1263,7 +1260,7 @@ Gitlint Start [${process.cwd()}]
|
|
|
1263
1260
|
|
|
1264
1261
|
// src/actions/gitlint-fix.ts
|
|
1265
1262
|
import { execSync as execSync2 } from "node:child_process";
|
|
1266
|
-
import
|
|
1263
|
+
import chalk22 from "chalk";
|
|
1267
1264
|
import ParseGitConfig2 from "parse-git-config";
|
|
1268
1265
|
var gitlintFix = () => {
|
|
1269
1266
|
console.log(`
|
|
@@ -1272,15 +1269,15 @@ Gitlint Fix Start [${process.cwd()}]
|
|
|
1272
1269
|
const gitConfig = ParseGitConfig2.sync();
|
|
1273
1270
|
if (gitConfig.core.ignorecase) {
|
|
1274
1271
|
execSync2("git config core.ignorecase false", { stdio: "inherit" });
|
|
1275
|
-
console.warn(
|
|
1272
|
+
console.warn(chalk22.yellow("\nGitlint Fix: Updated core.ignorecase to be false\n"));
|
|
1276
1273
|
}
|
|
1277
1274
|
if (gitConfig.core.autocrlf !== false) {
|
|
1278
1275
|
execSync2("git config core.autocrlf false", { stdio: "inherit" });
|
|
1279
|
-
console.warn(
|
|
1276
|
+
console.warn(chalk22.yellow("\nGitlint Fix: Updated core.autocrlf to be false\n"));
|
|
1280
1277
|
}
|
|
1281
1278
|
if (gitConfig.core.eol !== "lf") {
|
|
1282
1279
|
execSync2("git config core.eol lf", { stdio: "inherit" });
|
|
1283
|
-
console.warn(
|
|
1280
|
+
console.warn(chalk22.yellow('\nGitlint Fix: Updated core.eol to be "lf"\n'));
|
|
1284
1281
|
}
|
|
1285
1282
|
return 1;
|
|
1286
1283
|
};
|
|
@@ -1291,7 +1288,7 @@ var knip = () => {
|
|
|
1291
1288
|
};
|
|
1292
1289
|
|
|
1293
1290
|
// src/actions/license.ts
|
|
1294
|
-
import
|
|
1291
|
+
import chalk23 from "chalk";
|
|
1295
1292
|
import { init } from "license-checker";
|
|
1296
1293
|
var license = async (pkg) => {
|
|
1297
1294
|
const workspaces = yarnWorkspaces();
|
|
@@ -1316,18 +1313,18 @@ var license = async (pkg) => {
|
|
|
1316
1313
|
"LGPL-3.0-or-later",
|
|
1317
1314
|
"Python-2.0"
|
|
1318
1315
|
]);
|
|
1319
|
-
console.log(
|
|
1316
|
+
console.log(chalk23.green("License Checker"));
|
|
1320
1317
|
return (await Promise.all(
|
|
1321
1318
|
workspaceList.map(({ location, name }) => {
|
|
1322
1319
|
return new Promise((resolve) => {
|
|
1323
1320
|
init({ production: true, start: location }, (error, packages) => {
|
|
1324
1321
|
if (error) {
|
|
1325
|
-
console.error(
|
|
1326
|
-
console.error(
|
|
1322
|
+
console.error(chalk23.red(`License Checker [${name}] Error`));
|
|
1323
|
+
console.error(chalk23.gray(error));
|
|
1327
1324
|
console.log("\n");
|
|
1328
1325
|
resolve(1);
|
|
1329
1326
|
} else {
|
|
1330
|
-
console.log(
|
|
1327
|
+
console.log(chalk23.green(`License Checker [${name}]`));
|
|
1331
1328
|
let count = 0;
|
|
1332
1329
|
for (const [name2, info] of Object.entries(packages)) {
|
|
1333
1330
|
const licenses = Array.isArray(info.licenses) ? info.licenses : [info.licenses];
|
|
@@ -1343,7 +1340,7 @@ var license = async (pkg) => {
|
|
|
1343
1340
|
}
|
|
1344
1341
|
if (!orLicenseFound) {
|
|
1345
1342
|
count++;
|
|
1346
|
-
console.warn(
|
|
1343
|
+
console.warn(chalk23.yellow(`${name2}: Package License not allowed [${license2}]`));
|
|
1347
1344
|
}
|
|
1348
1345
|
}
|
|
1349
1346
|
}
|
|
@@ -1363,12 +1360,12 @@ var npmignoreGen = (pkg) => generateIgnoreFiles(filename2, pkg);
|
|
|
1363
1360
|
|
|
1364
1361
|
// src/actions/package/clean-outputs.ts
|
|
1365
1362
|
import path5 from "node:path";
|
|
1366
|
-
import
|
|
1363
|
+
import chalk24 from "chalk";
|
|
1367
1364
|
var packageCleanOutputs = () => {
|
|
1368
1365
|
const pkg = process.env.INIT_CWD ?? ".";
|
|
1369
1366
|
const pkgName = process.env.npm_package_name;
|
|
1370
1367
|
const folders = [path5.join(pkg, "dist"), path5.join(pkg, "build"), path5.join(pkg, "docs")];
|
|
1371
|
-
console.log(
|
|
1368
|
+
console.log(chalk24.green(`Cleaning Outputs [${pkgName}]`));
|
|
1372
1369
|
for (let folder of folders) {
|
|
1373
1370
|
deleteGlob(folder);
|
|
1374
1371
|
}
|
|
@@ -1377,11 +1374,11 @@ var packageCleanOutputs = () => {
|
|
|
1377
1374
|
|
|
1378
1375
|
// src/actions/package/clean-typescript.ts
|
|
1379
1376
|
import path6 from "node:path";
|
|
1380
|
-
import
|
|
1377
|
+
import chalk25 from "chalk";
|
|
1381
1378
|
var packageCleanTypescript = () => {
|
|
1382
1379
|
const pkg = process.env.INIT_CWD ?? ".";
|
|
1383
1380
|
const pkgName = process.env.npm_package_name;
|
|
1384
|
-
console.log(
|
|
1381
|
+
console.log(chalk25.green(`Cleaning Typescript [${pkgName}]`));
|
|
1385
1382
|
const files = [path6.join(pkg, "*.tsbuildinfo"), path6.join(pkg, ".tsconfig.*"), path6.join(pkg, ".eslintcache")];
|
|
1386
1383
|
for (let file of files) {
|
|
1387
1384
|
deleteGlob(file);
|
|
@@ -1395,19 +1392,19 @@ var packageClean = async () => {
|
|
|
1395
1392
|
};
|
|
1396
1393
|
|
|
1397
1394
|
// src/actions/package/compile/compile.ts
|
|
1398
|
-
import
|
|
1395
|
+
import chalk29 from "chalk";
|
|
1399
1396
|
|
|
1400
1397
|
// src/actions/package/publint.ts
|
|
1401
1398
|
import { promises as fs4 } from "node:fs";
|
|
1402
|
-
import
|
|
1399
|
+
import chalk26 from "chalk";
|
|
1403
1400
|
import sortPackageJson from "sort-package-json";
|
|
1404
1401
|
var packagePublint = async (params) => {
|
|
1405
1402
|
const pkgDir = process.env.INIT_CWD;
|
|
1406
1403
|
const sortedPkg = sortPackageJson(await fs4.readFile(`${pkgDir}/package.json`, "utf8"));
|
|
1407
1404
|
await fs4.writeFile(`${pkgDir}/package.json`, sortedPkg);
|
|
1408
1405
|
const pkg = JSON.parse(await fs4.readFile(`${pkgDir}/package.json`, "utf8"));
|
|
1409
|
-
console.log(
|
|
1410
|
-
console.log(
|
|
1406
|
+
console.log(chalk26.green(`Publint: ${pkg.name}`));
|
|
1407
|
+
console.log(chalk26.gray(pkgDir));
|
|
1411
1408
|
const { publint: publint2 } = await import("publint");
|
|
1412
1409
|
const { messages } = await publint2({
|
|
1413
1410
|
level: "suggestion",
|
|
@@ -1422,21 +1419,21 @@ var packagePublint = async (params) => {
|
|
|
1422
1419
|
for (const message of validMessages) {
|
|
1423
1420
|
switch (message.type) {
|
|
1424
1421
|
case "error": {
|
|
1425
|
-
console.error(
|
|
1422
|
+
console.error(chalk26.red(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
1426
1423
|
break;
|
|
1427
1424
|
}
|
|
1428
1425
|
case "warning": {
|
|
1429
|
-
console.warn(
|
|
1426
|
+
console.warn(chalk26.yellow(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
1430
1427
|
break;
|
|
1431
1428
|
}
|
|
1432
1429
|
default: {
|
|
1433
|
-
console.log(
|
|
1430
|
+
console.log(chalk26.white(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
1434
1431
|
break;
|
|
1435
1432
|
}
|
|
1436
1433
|
}
|
|
1437
1434
|
}
|
|
1438
1435
|
if (params?.verbose) {
|
|
1439
|
-
console.log(
|
|
1436
|
+
console.log(chalk26.gray(`Publint [Finish]: ${pkgDir} [${validMessages.length}]`));
|
|
1440
1437
|
}
|
|
1441
1438
|
return validMessages.filter((message) => message.type === "error").length;
|
|
1442
1439
|
};
|
|
@@ -1473,7 +1470,7 @@ var buildEntries = (folder, entryMode = "single", excludeSpecAndStories = true,
|
|
|
1473
1470
|
|
|
1474
1471
|
// src/actions/package/compile/packageCompileTscTypes.ts
|
|
1475
1472
|
import { cwd } from "node:process";
|
|
1476
|
-
import
|
|
1473
|
+
import chalk27 from "chalk";
|
|
1477
1474
|
import { createProgramFromConfig } from "tsc-prog";
|
|
1478
1475
|
import {
|
|
1479
1476
|
DiagnosticCategory,
|
|
@@ -1528,7 +1525,7 @@ var packageCompileTscTypes = (folder = "src", config2 = {}, compilerOptionsParam
|
|
|
1528
1525
|
const validTsExt = [".ts", ".tsx", ".d.ts", ".cts", ".d.cts", ".mts", ".d.mts"];
|
|
1529
1526
|
const excludes = [".stories.", ".spec."];
|
|
1530
1527
|
const files = buildEntries(folder, "all", verbose).filter((file) => validTsExt.find((ext) => file.endsWith(ext)) && !excludes.some((exclude) => file.includes(exclude)));
|
|
1531
|
-
console.log(
|
|
1528
|
+
console.log(chalk27.green(`Compiling Types ${pkg}: ${files.length}`));
|
|
1532
1529
|
if (files.length > 0) {
|
|
1533
1530
|
const program = createProgramFromConfig({
|
|
1534
1531
|
basePath: pkg ?? cwd(),
|
|
@@ -1585,7 +1582,7 @@ function deepMergeObjects(objects) {
|
|
|
1585
1582
|
|
|
1586
1583
|
// src/actions/package/compile/packageCompileTsc.ts
|
|
1587
1584
|
import { cwd as cwd2 } from "node:process";
|
|
1588
|
-
import
|
|
1585
|
+
import chalk28 from "chalk";
|
|
1589
1586
|
import { createProgramFromConfig as createProgramFromConfig2 } from "tsc-prog";
|
|
1590
1587
|
import {
|
|
1591
1588
|
DiagnosticCategory as DiagnosticCategory2,
|
|
@@ -1611,7 +1608,7 @@ var packageCompileTsc = (folder = "src", config2 = {}, compilerOptionsParam) =>
|
|
|
1611
1608
|
const validTsExt = [".ts", ".tsx", ".d.ts", ".cts", ".d.cts", ".mts", ".d.mts"];
|
|
1612
1609
|
const includes = [".stories.", ".spec.", ".d.ts", ".d.cts", ".d.mts"];
|
|
1613
1610
|
const files = buildEntries(folder, "all", verbose).filter((file) => validTsExt.find((ext) => file.endsWith(ext)) && includes.find((include) => file.includes(include)));
|
|
1614
|
-
console.log(
|
|
1611
|
+
console.log(chalk28.green(`Compiling Files ${pkg}: ${files.length}`));
|
|
1615
1612
|
if (files.length > 0) {
|
|
1616
1613
|
const program = createProgramFromConfig2({
|
|
1617
1614
|
basePath: pkg ?? cwd2(),
|
|
@@ -1762,7 +1759,7 @@ var packageCompileTsup = async (config2) => {
|
|
|
1762
1759
|
// src/actions/package/compile/compile.ts
|
|
1763
1760
|
var packageCompile = async (inConfig = {}) => {
|
|
1764
1761
|
const pkg = process.env.INIT_CWD;
|
|
1765
|
-
console.log(
|
|
1762
|
+
console.log(chalk29.green(`Compiling ${pkg}`));
|
|
1766
1763
|
const config2 = await loadConfig(inConfig);
|
|
1767
1764
|
const publint2 = config2.publint;
|
|
1768
1765
|
const tsupResults = await packageCompileTsup(config2);
|
|
@@ -1774,7 +1771,7 @@ var packageCompile = async (inConfig = {}) => {
|
|
|
1774
1771
|
|
|
1775
1772
|
// src/actions/package/copy-assets.ts
|
|
1776
1773
|
import path7 from "node:path/posix";
|
|
1777
|
-
import
|
|
1774
|
+
import chalk30 from "chalk";
|
|
1778
1775
|
import cpy2 from "cpy";
|
|
1779
1776
|
var copyTargetAssets2 = async (target, name, location) => {
|
|
1780
1777
|
try {
|
|
@@ -1787,7 +1784,7 @@ var copyTargetAssets2 = async (target, name, location) => {
|
|
|
1787
1784
|
}
|
|
1788
1785
|
);
|
|
1789
1786
|
if (values.length > 0) {
|
|
1790
|
-
console.log(
|
|
1787
|
+
console.log(chalk30.green(`Copying Assets [${target.toUpperCase()}] - ${name} - ${location}`));
|
|
1791
1788
|
}
|
|
1792
1789
|
for (const value of values) {
|
|
1793
1790
|
console.log(`${value.split("/").pop()} => ./dist/${target}`);
|
|
@@ -1856,7 +1853,7 @@ var packageCycle = async ({ verbose = false }) => {
|
|
|
1856
1853
|
// src/actions/package/gen-docs.ts
|
|
1857
1854
|
import { existsSync as existsSync5 } from "node:fs";
|
|
1858
1855
|
import path8 from "node:path";
|
|
1859
|
-
import
|
|
1856
|
+
import chalk31 from "chalk";
|
|
1860
1857
|
import {
|
|
1861
1858
|
Application,
|
|
1862
1859
|
ArgumentsReader,
|
|
@@ -1960,7 +1957,7 @@ var runTypeDoc = async (app) => {
|
|
|
1960
1957
|
return ExitCodes.OutputError;
|
|
1961
1958
|
}
|
|
1962
1959
|
}
|
|
1963
|
-
console.log(
|
|
1960
|
+
console.log(chalk31.green(`${pkgName} - Ok`));
|
|
1964
1961
|
return ExitCodes.Ok;
|
|
1965
1962
|
};
|
|
1966
1963
|
|
|
@@ -1969,7 +1966,7 @@ import { readdirSync } from "node:fs";
|
|
|
1969
1966
|
import path9 from "node:path";
|
|
1970
1967
|
import { cwd as cwd3 } from "node:process";
|
|
1971
1968
|
import { pathToFileURL } from "node:url";
|
|
1972
|
-
import
|
|
1969
|
+
import chalk32 from "chalk";
|
|
1973
1970
|
import { ESLint } from "eslint";
|
|
1974
1971
|
import { findUp } from "find-up";
|
|
1975
1972
|
import picomatch from "picomatch";
|
|
@@ -1978,14 +1975,14 @@ var dumpMessages = (lintResults) => {
|
|
|
1978
1975
|
const severity = ["none", "warning", "error"];
|
|
1979
1976
|
for (const lintResult of lintResults) {
|
|
1980
1977
|
if (lintResult.messages.length > 0) {
|
|
1981
|
-
console.log(
|
|
1978
|
+
console.log(chalk32.gray(`
|
|
1982
1979
|
${lintResult.filePath}`));
|
|
1983
1980
|
for (const message of lintResult.messages) {
|
|
1984
1981
|
console.log(
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1982
|
+
chalk32.gray(` ${message.line}:${message.column}`),
|
|
1983
|
+
chalk32[colors[message.severity]](` ${severity[message.severity]}`),
|
|
1984
|
+
chalk32.white(` ${message.message}`),
|
|
1985
|
+
chalk32.gray(` ${message.ruleId}`)
|
|
1989
1986
|
);
|
|
1990
1987
|
}
|
|
1991
1988
|
}
|
|
@@ -2024,7 +2021,7 @@ var packageLint = async (fix2 = false, verbose = false, cache = true) => {
|
|
|
2024
2021
|
});
|
|
2025
2022
|
const files = getFiles(cwd3(), ignoreFolders);
|
|
2026
2023
|
if (verbose) {
|
|
2027
|
-
console.log(
|
|
2024
|
+
console.log(chalk32.green(`Linting ${pkg} [files = ${files.length}]`));
|
|
2028
2025
|
}
|
|
2029
2026
|
const lintResults = await engine.lintFiles(files);
|
|
2030
2027
|
dumpMessages(lintResults);
|
|
@@ -2034,7 +2031,7 @@ var packageLint = async (fix2 = false, verbose = false, cache = true) => {
|
|
|
2034
2031
|
const filesCountColor = files.length < 100 ? "green" : files.length < 1e3 ? "yellow" : "red";
|
|
2035
2032
|
const lintTime = Date.now() - start;
|
|
2036
2033
|
const lintTimeColor = lintTime < 1e3 ? "green" : lintTime < 3e3 ? "yellow" : "red";
|
|
2037
|
-
console.log(
|
|
2034
|
+
console.log(chalk32.white(`Linted ${chalk32[filesCountColor](files.length)} files in ${chalk32[lintTimeColor](lintTime)}ms`));
|
|
2038
2035
|
return lintResults.reduce((prev, lintResult) => prev + lintResult.errorCount, 0);
|
|
2039
2036
|
};
|
|
2040
2037
|
|
|
@@ -2064,7 +2061,7 @@ var rebuild = ({ target }) => {
|
|
|
2064
2061
|
};
|
|
2065
2062
|
|
|
2066
2063
|
// src/actions/recompile.ts
|
|
2067
|
-
import
|
|
2064
|
+
import chalk33 from "chalk";
|
|
2068
2065
|
var recompile = async ({
|
|
2069
2066
|
verbose,
|
|
2070
2067
|
target,
|
|
@@ -2100,7 +2097,7 @@ var recompileAll = async ({
|
|
|
2100
2097
|
const incrementalOptions = incremental ? ["--since", "-Apt", "--topological-dev"] : ["--parallel", "-Apt", "--topological-dev"];
|
|
2101
2098
|
const jobsOptions = jobs ? ["-j", `${jobs}`] : [];
|
|
2102
2099
|
if (jobs) {
|
|
2103
|
-
console.log(
|
|
2100
|
+
console.log(chalk33.blue(`Jobs set to [${jobs}]`));
|
|
2104
2101
|
}
|
|
2105
2102
|
const result = await runStepsAsync(`Recompile${incremental ? "-Incremental" : ""} [All]`, [
|
|
2106
2103
|
[
|
|
@@ -2131,7 +2128,7 @@ var recompileAll = async ({
|
|
|
2131
2128
|
]
|
|
2132
2129
|
]);
|
|
2133
2130
|
console.log(
|
|
2134
|
-
`${
|
|
2131
|
+
`${chalk33.gray("Recompiled in")} [${chalk33.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk33.gray("seconds")}`
|
|
2135
2132
|
);
|
|
2136
2133
|
return result;
|
|
2137
2134
|
};
|
|
@@ -2162,9 +2159,9 @@ var reinstall = () => {
|
|
|
2162
2159
|
};
|
|
2163
2160
|
|
|
2164
2161
|
// src/actions/relint.ts
|
|
2165
|
-
import
|
|
2162
|
+
import chalk34 from "chalk";
|
|
2166
2163
|
var relintPackage = ({ pkg }) => {
|
|
2167
|
-
console.log(
|
|
2164
|
+
console.log(chalk34.gray(`${"Relint"} [All-Packages]`));
|
|
2168
2165
|
const start = Date.now();
|
|
2169
2166
|
const result = runSteps("Relint [All-Packages]", [
|
|
2170
2167
|
["yarn", [
|
|
@@ -2174,7 +2171,7 @@ var relintPackage = ({ pkg }) => {
|
|
|
2174
2171
|
"package-relint"
|
|
2175
2172
|
]]
|
|
2176
2173
|
]);
|
|
2177
|
-
console.log(
|
|
2174
|
+
console.log(chalk34.gray(`${"Relinted in"} [${chalk34.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk34.gray("seconds")}`));
|
|
2178
2175
|
return result;
|
|
2179
2176
|
};
|
|
2180
2177
|
var relint = ({
|
|
@@ -2185,7 +2182,7 @@ var relint = ({
|
|
|
2185
2182
|
return pkg ? relintPackage({ pkg }) : relintAllPackages({ verbose, incremental });
|
|
2186
2183
|
};
|
|
2187
2184
|
var relintAllPackages = ({ verbose = true, incremental } = {}) => {
|
|
2188
|
-
console.log(
|
|
2185
|
+
console.log(chalk34.gray(`${"Relint"} [All-Packages]`));
|
|
2189
2186
|
const start = Date.now();
|
|
2190
2187
|
const verboseOptions = verbose ? ["--verbose"] : ["--no-verbose"];
|
|
2191
2188
|
const incrementalOptions = incremental ? ["--since", "-Ap"] : ["--parallel", "-Ap"];
|
|
@@ -2199,7 +2196,7 @@ var relintAllPackages = ({ verbose = true, incremental } = {}) => {
|
|
|
2199
2196
|
"package-relint"
|
|
2200
2197
|
]]
|
|
2201
2198
|
]);
|
|
2202
|
-
console.log(
|
|
2199
|
+
console.log(chalk34.gray(`Relinted in [${chalk34.magenta(((Date.now() - start) / 1e3).toFixed(2))}] ${chalk34.gray("seconds")}`));
|
|
2203
2200
|
return result;
|
|
2204
2201
|
};
|
|
2205
2202
|
|
|
@@ -2217,10 +2214,10 @@ var sonar = () => {
|
|
|
2217
2214
|
};
|
|
2218
2215
|
|
|
2219
2216
|
// src/actions/statics.ts
|
|
2220
|
-
import
|
|
2217
|
+
import chalk35 from "chalk";
|
|
2221
2218
|
var DefaultDependencies = ["axios", "@xylabs/pixel", "react", "graphql", "react-router", "@mui/material", "@mui/system"];
|
|
2222
2219
|
var statics = () => {
|
|
2223
|
-
console.log(
|
|
2220
|
+
console.log(chalk35.green("Check Required Static Dependencies"));
|
|
2224
2221
|
const statics2 = parsedPackageJSON()?.xy?.deps?.statics;
|
|
2225
2222
|
return detectDuplicateDependencies(statics2, DefaultDependencies);
|
|
2226
2223
|
};
|
|
@@ -2277,7 +2274,7 @@ var loadPackageConfig = async () => {
|
|
|
2277
2274
|
};
|
|
2278
2275
|
|
|
2279
2276
|
// src/xy/xy.ts
|
|
2280
|
-
import
|
|
2277
|
+
import chalk37 from "chalk";
|
|
2281
2278
|
|
|
2282
2279
|
// src/xy/xyBuildCommands.ts
|
|
2283
2280
|
var xyBuildCommands = (args) => {
|
|
@@ -2638,7 +2635,7 @@ var xyInstallCommands = (args) => {
|
|
|
2638
2635
|
};
|
|
2639
2636
|
|
|
2640
2637
|
// src/xy/xyLintCommands.ts
|
|
2641
|
-
import
|
|
2638
|
+
import chalk36 from "chalk";
|
|
2642
2639
|
var xyLintCommands = (args) => {
|
|
2643
2640
|
return args.command(
|
|
2644
2641
|
"cycle [package]",
|
|
@@ -2650,7 +2647,7 @@ var xyLintCommands = (args) => {
|
|
|
2650
2647
|
const start = Date.now();
|
|
2651
2648
|
if (argv.verbose) console.log("Cycle");
|
|
2652
2649
|
process.exitCode = await cycle({ pkg: argv.package });
|
|
2653
|
-
console.log(
|
|
2650
|
+
console.log(chalk36.blue(`Finished in ${Date.now() - start}ms`));
|
|
2654
2651
|
}
|
|
2655
2652
|
).command(
|
|
2656
2653
|
"lint [package]",
|
|
@@ -2672,7 +2669,7 @@ var xyLintCommands = (args) => {
|
|
|
2672
2669
|
if (argv.verbose) console.log("Lint");
|
|
2673
2670
|
const start = Date.now();
|
|
2674
2671
|
process.exitCode = argv.fix ? fix({ pkg: argv.package, cache: argv.cache }) : lint({ pkg: argv.package, cache: argv.cache });
|
|
2675
|
-
console.log(
|
|
2672
|
+
console.log(chalk36.blue(`Finished in ${Date.now() - start}ms`));
|
|
2676
2673
|
}
|
|
2677
2674
|
).command(
|
|
2678
2675
|
"deplint [package]",
|
|
@@ -2704,7 +2701,7 @@ var xyLintCommands = (args) => {
|
|
|
2704
2701
|
devDeps: !!argv.devDeps,
|
|
2705
2702
|
peerDeps: !!argv.peerDeps
|
|
2706
2703
|
});
|
|
2707
|
-
console.log(
|
|
2704
|
+
console.log(chalk36.blue(`Finished in ${Date.now() - start}ms`));
|
|
2708
2705
|
}
|
|
2709
2706
|
).command(
|
|
2710
2707
|
"fix [package]",
|
|
@@ -2716,7 +2713,7 @@ var xyLintCommands = (args) => {
|
|
|
2716
2713
|
const start = Date.now();
|
|
2717
2714
|
if (argv.verbose) console.log("Fix");
|
|
2718
2715
|
process.exitCode = fix();
|
|
2719
|
-
console.log(
|
|
2716
|
+
console.log(chalk36.blue(`Finished in ${Date.now() - start}ms`));
|
|
2720
2717
|
}
|
|
2721
2718
|
).command(
|
|
2722
2719
|
"relint [package]",
|
|
@@ -2728,7 +2725,7 @@ var xyLintCommands = (args) => {
|
|
|
2728
2725
|
if (argv.verbose) console.log("Relinting");
|
|
2729
2726
|
const start = Date.now();
|
|
2730
2727
|
process.exitCode = relint();
|
|
2731
|
-
console.log(
|
|
2728
|
+
console.log(chalk36.blue(`Finished in ${Date.now() - start}ms`));
|
|
2732
2729
|
}
|
|
2733
2730
|
).command(
|
|
2734
2731
|
"publint [package]",
|
|
@@ -2740,7 +2737,7 @@ var xyLintCommands = (args) => {
|
|
|
2740
2737
|
if (argv.verbose) console.log("Publint");
|
|
2741
2738
|
const start = Date.now();
|
|
2742
2739
|
process.exitCode = await publint({ pkg: argv.package, verbose: !!argv.verbose });
|
|
2743
|
-
console.log(
|
|
2740
|
+
console.log(chalk36.blue(`Finished in ${Date.now() - start}ms`));
|
|
2744
2741
|
}
|
|
2745
2742
|
).command(
|
|
2746
2743
|
"knip",
|
|
@@ -2752,7 +2749,7 @@ var xyLintCommands = (args) => {
|
|
|
2752
2749
|
if (argv.verbose) console.log("Knip");
|
|
2753
2750
|
const start = Date.now();
|
|
2754
2751
|
process.exitCode = knip();
|
|
2755
|
-
console.log(
|
|
2752
|
+
console.log(chalk36.blue(`Knip finished in ${Date.now() - start}ms`));
|
|
2756
2753
|
}
|
|
2757
2754
|
).command(
|
|
2758
2755
|
"sonar",
|
|
@@ -2764,7 +2761,7 @@ var xyLintCommands = (args) => {
|
|
|
2764
2761
|
const start = Date.now();
|
|
2765
2762
|
if (argv.verbose) console.log("Sonar Check");
|
|
2766
2763
|
process.exitCode = sonar();
|
|
2767
|
-
console.log(
|
|
2764
|
+
console.log(chalk36.blue(`Finished in ${Date.now() - start}ms`));
|
|
2768
2765
|
}
|
|
2769
2766
|
);
|
|
2770
2767
|
};
|
|
@@ -2800,8 +2797,8 @@ var xyParseOptions = () => {
|
|
|
2800
2797
|
var xy = async () => {
|
|
2801
2798
|
const options = xyParseOptions();
|
|
2802
2799
|
return await xyBuildCommands(xyCommonCommands(xyInstallCommands(xyDeployCommands(xyLintCommands(options))))).demandCommand(1).command("*", "", () => {
|
|
2803
|
-
console.error(
|
|
2804
|
-
console.log(
|
|
2800
|
+
console.error(chalk37.yellow(`Command not found [${chalk37.magenta(process.argv[2])}]`));
|
|
2801
|
+
console.log(chalk37.gray("Try 'yarn xy --help' for list of commands"));
|
|
2805
2802
|
}).version().help().argv;
|
|
2806
2803
|
};
|
|
2807
2804
|
export {
|