alex-c-line 1.33.0 → 1.33.2
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.
|
@@ -65,12 +65,14 @@ declare let scripts: {
|
|
|
65
65
|
format: string;
|
|
66
66
|
"format-eslint": string;
|
|
67
67
|
"format-prettier": string;
|
|
68
|
+
"format-prettier-html": string;
|
|
68
69
|
"format-prettier-javascript": string;
|
|
69
70
|
"format-prettier-typescript": string;
|
|
70
71
|
"format-prettier-yml": string;
|
|
71
72
|
lint: string;
|
|
72
73
|
"lint-eslint": string;
|
|
73
74
|
"lint-prettier": string;
|
|
75
|
+
"lint-prettier-html": string;
|
|
74
76
|
"lint-prettier-javascript": string;
|
|
75
77
|
"lint-prettier-typescript": string;
|
|
76
78
|
"lint-prettier-yml": string;
|
|
@@ -65,12 +65,14 @@ declare let scripts: {
|
|
|
65
65
|
format: string;
|
|
66
66
|
"format-eslint": string;
|
|
67
67
|
"format-prettier": string;
|
|
68
|
+
"format-prettier-html": string;
|
|
68
69
|
"format-prettier-javascript": string;
|
|
69
70
|
"format-prettier-typescript": string;
|
|
70
71
|
"format-prettier-yml": string;
|
|
71
72
|
lint: string;
|
|
72
73
|
"lint-eslint": string;
|
|
73
74
|
"lint-prettier": string;
|
|
75
|
+
"lint-prettier-html": string;
|
|
74
76
|
"lint-prettier-javascript": string;
|
|
75
77
|
"lint-prettier-typescript": string;
|
|
76
78
|
"lint-prettier-yml": string;
|
package/dist/index.cjs
CHANGED
|
@@ -50,9 +50,9 @@ zod = __toESM(zod);
|
|
|
50
50
|
let _inquirer_prompts = require("@inquirer/prompts");
|
|
51
51
|
let node_os = require("node:os");
|
|
52
52
|
node_os = __toESM(node_os);
|
|
53
|
+
let node_url = require("node:url");
|
|
53
54
|
let _alextheman_utility_internal = require("@alextheman/utility/internal");
|
|
54
55
|
let node_module = require("node:module");
|
|
55
|
-
let node_url = require("node:url");
|
|
56
56
|
let gray_matter = require("gray-matter");
|
|
57
57
|
gray_matter = __toESM(gray_matter);
|
|
58
58
|
let _alextheman_utility_node = require("@alextheman/utility/node");
|
|
@@ -736,16 +736,44 @@ function gitPostMergeCleanup(program) {
|
|
|
736
736
|
});
|
|
737
737
|
}
|
|
738
738
|
|
|
739
|
+
//#endregion
|
|
740
|
+
//#region src/utility/fileSystem/findPackageRoot.ts
|
|
741
|
+
async function findPackageRoot(startDirectory, packageName) {
|
|
742
|
+
let directory = startDirectory;
|
|
743
|
+
while (true) {
|
|
744
|
+
const packagePath = node_path.default.join(directory, "package.json");
|
|
745
|
+
try {
|
|
746
|
+
if (JSON.parse(await (0, node_fs_promises.readFile)(packagePath, "utf-8"))?.name === packageName) return directory;
|
|
747
|
+
} catch {}
|
|
748
|
+
const parent = node_path.default.dirname(directory);
|
|
749
|
+
if (parent === directory) break;
|
|
750
|
+
directory = parent;
|
|
751
|
+
}
|
|
752
|
+
throw new _alextheman_utility.DataError({ packageName }, "PACKAGE_ROOT_NOT_FOUND", `Could not find package root for ${packageName}`);
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
//#endregion
|
|
756
|
+
//#region src/utility/constants/alexCLinePackageRoot.ts
|
|
757
|
+
const __filename$4 = (0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href);
|
|
758
|
+
const alexCLinePackageRoot = findPackageRoot(node_path.default.dirname(__filename$4), "alex-c-line");
|
|
759
|
+
|
|
739
760
|
//#endregion
|
|
740
761
|
//#region src/cli/commands/internal/outdated-dependencies.ts
|
|
741
762
|
function outdatedDependencies(program) {
|
|
742
763
|
program.command("outdated-dependencies").action(async () => {
|
|
743
|
-
const { exitCode, stdout, stderr } = await (0, execa.execa)({ reject: false })`pnpm outdated`;
|
|
764
|
+
const { exitCode, stdout, stderr } = await (0, execa.execa)({ reject: false })`pnpm outdated --json`;
|
|
744
765
|
if (![0, 1].includes(exitCode)) program.error(stderr ?? stdout, {
|
|
745
766
|
exitCode,
|
|
746
767
|
code: "PNPM_OUDATED_ERROR"
|
|
747
768
|
});
|
|
748
|
-
|
|
769
|
+
const outdatedDependencies = JSON.parse(stdout.trim());
|
|
770
|
+
if (Object.keys(outdatedDependencies).length === 0) console.info("NO_OUTDATED_DEPENDENCIES_FOUND");
|
|
771
|
+
const outdatedTemplatesPath = node_path.default.join(await alexCLinePackageRoot, "templates", "outdated");
|
|
772
|
+
const tableTemplate = await (0, node_fs_promises.readFile)(node_path.default.join(outdatedTemplatesPath, "table.html"), "utf-8");
|
|
773
|
+
const tableRowTemplate = await (0, node_fs_promises.readFile)(node_path.default.join(outdatedTemplatesPath, "tableRow.html"), "utf-8");
|
|
774
|
+
console.info(tableTemplate.replace("{{tableRows}}", Object.entries(outdatedDependencies).map(([packageName, metadata]) => {
|
|
775
|
+
return tableRowTemplate.replace("{{packageName}}", packageName).replace("{{currentVersion}}", metadata.current).replace("{{latestVersion}}", metadata.latest);
|
|
776
|
+
}).join("\n")));
|
|
749
777
|
});
|
|
750
778
|
}
|
|
751
779
|
|
|
@@ -979,22 +1007,6 @@ function parseAlexCLinePrivateConfig(data) {
|
|
|
979
1007
|
return (0, _alextheman_utility.parseZodSchema)(alexCLinePrivateConfigSchema, data);
|
|
980
1008
|
}
|
|
981
1009
|
|
|
982
|
-
//#endregion
|
|
983
|
-
//#region src/utility/fileSystem/findPackageRoot.ts
|
|
984
|
-
async function findPackageRoot(startDirectory, packageName) {
|
|
985
|
-
let directory = startDirectory;
|
|
986
|
-
while (true) {
|
|
987
|
-
const packagePath = node_path.default.join(directory, "package.json");
|
|
988
|
-
try {
|
|
989
|
-
if (JSON.parse(await (0, node_fs_promises.readFile)(packagePath, "utf-8"))?.name === packageName) return directory;
|
|
990
|
-
} catch {}
|
|
991
|
-
const parent = node_path.default.dirname(directory);
|
|
992
|
-
if (parent === directory) break;
|
|
993
|
-
directory = parent;
|
|
994
|
-
}
|
|
995
|
-
throw new _alextheman_utility.DataError({ packageName }, "PACKAGE_ROOT_NOT_FOUND", `Could not find package root for ${packageName}`);
|
|
996
|
-
}
|
|
997
|
-
|
|
998
1010
|
//#endregion
|
|
999
1011
|
//#region src/utility/markdownTemplates/pullRequest/getPullRequestTemplatesFromMarkdown.ts
|
|
1000
1012
|
const __filename$3 = (0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href);
|
|
@@ -1342,7 +1354,7 @@ function parseZodSchemaForProgram(programError, schema, data) {
|
|
|
1342
1354
|
//#endregion
|
|
1343
1355
|
//#region package.json
|
|
1344
1356
|
var name = "alex-c-line";
|
|
1345
|
-
var version = "1.33.
|
|
1357
|
+
var version = "1.33.2";
|
|
1346
1358
|
var description = "Command-line tool with commands to streamline the developer workflow.";
|
|
1347
1359
|
|
|
1348
1360
|
//#endregion
|
package/dist/index.js
CHANGED
|
@@ -15,8 +15,8 @@ import dotenvStringify from "dotenv-stringify";
|
|
|
15
15
|
import z from "zod";
|
|
16
16
|
import { confirm, input, password, select } from "@inquirer/prompts";
|
|
17
17
|
import os from "node:os";
|
|
18
|
-
import { PackageManager, getDependenciesFromGroup, getExpectedTgzName, getPackageJsonContents, packageJsonNotFoundError } from "@alextheman/utility/internal";
|
|
19
18
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
19
|
+
import { PackageManager, getDependenciesFromGroup, getExpectedTgzName, getPackageJsonContents, packageJsonNotFoundError } from "@alextheman/utility/internal";
|
|
20
20
|
import matter from "gray-matter";
|
|
21
21
|
import { parseFilePath } from "@alextheman/utility/node";
|
|
22
22
|
import supportsColor from "supports-color";
|
|
@@ -698,16 +698,44 @@ function gitPostMergeCleanup(program) {
|
|
|
698
698
|
});
|
|
699
699
|
}
|
|
700
700
|
|
|
701
|
+
//#endregion
|
|
702
|
+
//#region src/utility/fileSystem/findPackageRoot.ts
|
|
703
|
+
async function findPackageRoot(startDirectory, packageName) {
|
|
704
|
+
let directory = startDirectory;
|
|
705
|
+
while (true) {
|
|
706
|
+
const packagePath = path.join(directory, "package.json");
|
|
707
|
+
try {
|
|
708
|
+
if (JSON.parse(await readFile(packagePath, "utf-8"))?.name === packageName) return directory;
|
|
709
|
+
} catch {}
|
|
710
|
+
const parent = path.dirname(directory);
|
|
711
|
+
if (parent === directory) break;
|
|
712
|
+
directory = parent;
|
|
713
|
+
}
|
|
714
|
+
throw new DataError({ packageName }, "PACKAGE_ROOT_NOT_FOUND", `Could not find package root for ${packageName}`);
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
//#endregion
|
|
718
|
+
//#region src/utility/constants/alexCLinePackageRoot.ts
|
|
719
|
+
const __filename$3 = fileURLToPath(import.meta.url);
|
|
720
|
+
const alexCLinePackageRoot = findPackageRoot(path.dirname(__filename$3), "alex-c-line");
|
|
721
|
+
|
|
701
722
|
//#endregion
|
|
702
723
|
//#region src/cli/commands/internal/outdated-dependencies.ts
|
|
703
724
|
function outdatedDependencies(program) {
|
|
704
725
|
program.command("outdated-dependencies").action(async () => {
|
|
705
|
-
const { exitCode, stdout, stderr } = await execa({ reject: false })`pnpm outdated`;
|
|
726
|
+
const { exitCode, stdout, stderr } = await execa({ reject: false })`pnpm outdated --json`;
|
|
706
727
|
if (![0, 1].includes(exitCode)) program.error(stderr ?? stdout, {
|
|
707
728
|
exitCode,
|
|
708
729
|
code: "PNPM_OUDATED_ERROR"
|
|
709
730
|
});
|
|
710
|
-
|
|
731
|
+
const outdatedDependencies = JSON.parse(stdout.trim());
|
|
732
|
+
if (Object.keys(outdatedDependencies).length === 0) console.info("NO_OUTDATED_DEPENDENCIES_FOUND");
|
|
733
|
+
const outdatedTemplatesPath = path.join(await alexCLinePackageRoot, "templates", "outdated");
|
|
734
|
+
const tableTemplate = await readFile(path.join(outdatedTemplatesPath, "table.html"), "utf-8");
|
|
735
|
+
const tableRowTemplate = await readFile(path.join(outdatedTemplatesPath, "tableRow.html"), "utf-8");
|
|
736
|
+
console.info(tableTemplate.replace("{{tableRows}}", Object.entries(outdatedDependencies).map(([packageName, metadata]) => {
|
|
737
|
+
return tableRowTemplate.replace("{{packageName}}", packageName).replace("{{currentVersion}}", metadata.current).replace("{{latestVersion}}", metadata.latest);
|
|
738
|
+
}).join("\n")));
|
|
711
739
|
});
|
|
712
740
|
}
|
|
713
741
|
|
|
@@ -941,22 +969,6 @@ function parseAlexCLinePrivateConfig(data) {
|
|
|
941
969
|
return parseZodSchema(alexCLinePrivateConfigSchema, data);
|
|
942
970
|
}
|
|
943
971
|
|
|
944
|
-
//#endregion
|
|
945
|
-
//#region src/utility/fileSystem/findPackageRoot.ts
|
|
946
|
-
async function findPackageRoot(startDirectory, packageName) {
|
|
947
|
-
let directory = startDirectory;
|
|
948
|
-
while (true) {
|
|
949
|
-
const packagePath = path.join(directory, "package.json");
|
|
950
|
-
try {
|
|
951
|
-
if (JSON.parse(await readFile(packagePath, "utf-8"))?.name === packageName) return directory;
|
|
952
|
-
} catch {}
|
|
953
|
-
const parent = path.dirname(directory);
|
|
954
|
-
if (parent === directory) break;
|
|
955
|
-
directory = parent;
|
|
956
|
-
}
|
|
957
|
-
throw new DataError({ packageName }, "PACKAGE_ROOT_NOT_FOUND", `Could not find package root for ${packageName}`);
|
|
958
|
-
}
|
|
959
|
-
|
|
960
972
|
//#endregion
|
|
961
973
|
//#region src/utility/markdownTemplates/pullRequest/getPullRequestTemplatesFromMarkdown.ts
|
|
962
974
|
const __filename$2 = fileURLToPath(import.meta.url);
|
|
@@ -1304,7 +1316,7 @@ function parseZodSchemaForProgram(programError, schema, data) {
|
|
|
1304
1316
|
//#endregion
|
|
1305
1317
|
//#region package.json
|
|
1306
1318
|
var name = "alex-c-line";
|
|
1307
|
-
var version = "1.33.
|
|
1319
|
+
var version = "1.33.2";
|
|
1308
1320
|
var description = "Command-line tool with commands to streamline the developer workflow.";
|
|
1309
1321
|
|
|
1310
1322
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alex-c-line",
|
|
3
|
-
"version": "1.33.
|
|
3
|
+
"version": "1.33.2",
|
|
4
4
|
"description": "Command-line tool with commands to streamline the developer workflow.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -81,13 +81,15 @@
|
|
|
81
81
|
"create-release-note": "bash -c 'git pull origin main && pnpm run command create-release-note-2 $@' --",
|
|
82
82
|
"format": "pnpm run format-prettier && pnpm run format-eslint",
|
|
83
83
|
"format-eslint": "eslint --fix --suppress-all \"package.json\" \"src/**/*.ts\" \"tests/**/*.ts\" && rm -f eslint-suppressions.json",
|
|
84
|
-
"format-prettier": "pnpm run format-prettier-typescript && pnpm run format-prettier-javascript && pnpm run format-prettier-yml",
|
|
84
|
+
"format-prettier": "pnpm run format-prettier-typescript && pnpm run format-prettier-javascript && pnpm run format-prettier-yml && pnpm run format-prettier-html",
|
|
85
|
+
"format-prettier-html": "prettier --write \"**/*.html\"",
|
|
85
86
|
"format-prettier-javascript": "prettier --write \"./**/*.js\"",
|
|
86
87
|
"format-prettier-typescript": "prettier --write --parser typescript \"./**/*.ts\"",
|
|
87
88
|
"format-prettier-yml": "prettier --write \"./**/*.{yml,yaml}\"",
|
|
88
89
|
"lint": "pnpm run lint-tsc && pnpm run lint-eslint && pnpm run lint-prettier",
|
|
89
90
|
"lint-eslint": "eslint \"package.json\" \"src/**/*.ts\" \"tests/**/*.ts\"",
|
|
90
|
-
"lint-prettier": "pnpm run lint-prettier-typescript && pnpm run lint-prettier-javascript && pnpm run lint-prettier-yml",
|
|
91
|
+
"lint-prettier": "pnpm run lint-prettier-typescript && pnpm run lint-prettier-javascript && pnpm run lint-prettier-yml && pnpm run lint-prettier-html",
|
|
92
|
+
"lint-prettier-html": "prettier --check \"**/*.html\"",
|
|
91
93
|
"lint-prettier-javascript": "prettier --check \"./**.js\"",
|
|
92
94
|
"lint-prettier-typescript": "prettier --check --parser typescript \"./**/*.ts\"",
|
|
93
95
|
"lint-prettier-yml": "prettier --check \"./**/*.{yml,yaml}\"",
|