alex-c-line 1.32.0 → 1.33.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.
@@ -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");
@@ -628,35 +628,35 @@ async function parseDotenvFile(envFilePath) {
628
628
  //#endregion
629
629
  //#region src/cli/commands/edit-env-file/index.ts
630
630
  function editEnvFile(program) {
631
- program.command("edit-env-file").description("Edit properties in a .env file").option("--interactive", "Enable interactive mode", true).option("--file <filePath>", "The path to the .env file you want to edit, relative to the working directory this command is run", ".env").action(async ({ interactive, file }) => {
631
+ program.command("edit-env-file").description("Edit properties in a .env file").option("--interactive", "Enable interactive mode", true).option("--file <filePath>", "The path to the .env file you want to edit, relative to the working directory this command is run", ".env").action(async ({ file, interactive }) => {
632
632
  if (interactive) {
633
633
  let exitInteractiveMode = false;
634
634
  while (!exitInteractiveMode) {
635
635
  const envFileContents = await parseDotenvFile(file);
636
636
  const variableToEdit = await (0, _inquirer_prompts.select)({
637
- message: _alextheman_utility.normaliseIndents`
638
- Please select the environment variable you wish to edit
639
- Currently editing file: ${file}
640
- `,
641
637
  choices: [
642
638
  ...Object.keys(envFileContents).map((key) => {
643
639
  return {
640
+ description: envFileContents[key] === "" ? "<empty>" : "<redacted for safety>",
644
641
  name: key,
645
- value: key,
646
- description: envFileContents[key] === "" ? "<empty>" : "<redacted for safety>"
642
+ value: key
647
643
  };
648
644
  }),
649
645
  {
646
+ description: `Add a new environment variable to .env.`,
650
647
  name: `${chalk.default.green("+")} Add new environment variable`,
651
- value: "Add new",
652
- description: `Add a new environment variable to .env.`
648
+ value: "Add new"
653
649
  },
654
650
  {
651
+ description: "Exit the .env file interactive editor.",
655
652
  name: `${chalk.default.dim("⏎")} Exit editor`,
656
- value: "Exit editor",
657
- description: "Exit the .env file interactive editor."
653
+ value: "Exit editor"
658
654
  }
659
- ]
655
+ ],
656
+ message: _alextheman_utility.normaliseIndents`
657
+ Please select the environment variable you wish to edit
658
+ Currently editing file: ${file}
659
+ `
660
660
  });
661
661
  switch (variableToEdit) {
662
662
  case "Add new":
@@ -736,6 +736,58 @@ 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
+
760
+ //#endregion
761
+ //#region src/cli/commands/internal/outdated-dependencies.ts
762
+ function outdatedDependencies(program) {
763
+ program.command("outdated-dependencies").action(async () => {
764
+ const { exitCode, stdout, stderr } = await (0, execa.execa)({ reject: false })`pnpm outdated --json`;
765
+ if (![0, 1].includes(exitCode)) program.error(stderr ?? stdout, {
766
+ exitCode,
767
+ code: "PNPM_OUDATED_ERROR"
768
+ });
769
+ const outdatedDependencies = JSON.parse(stdout.trim());
770
+ const outdatedTemplatesPath = node_path.default.join(await alexCLinePackageRoot, "templates", "outdated");
771
+ const tableTemplate = await (0, node_fs_promises.readFile)(node_path.default.join(outdatedTemplatesPath, "table.html"), "utf-8");
772
+ const tableRowTemplate = await (0, node_fs_promises.readFile)(node_path.default.join(outdatedTemplatesPath, "tableRow.html"), "utf-8");
773
+ console.info(tableTemplate.replace("{{tableRows}}", Object.entries(outdatedDependencies).map(([packageName, metadata]) => {
774
+ return tableRowTemplate.replace("{{packageName}}", packageName).replace("{{currentVersion}}", metadata.current).replace("{{latestVersion}}", metadata.latest);
775
+ }).join("\n")));
776
+ });
777
+ }
778
+
779
+ //#endregion
780
+ //#region src/utility/miscellaneous/loadCommands.ts
781
+ function loadCommands(program, commandMap) {
782
+ for (const loader of Object.values(commandMap)) loader(program);
783
+ }
784
+
785
+ //#endregion
786
+ //#region src/cli/commands/internal/index.ts
787
+ function internal(program) {
788
+ loadCommands(program.command("internal").description("Commands meant more for internal use by me and is not recommended for production usage."), { outdatedDependencies });
789
+ }
790
+
739
791
  //#endregion
740
792
  //#region src/cli/commands/pre-commit/createStepRunner.ts
741
793
  const runCommandAndLogToConsole = (0, execa.execa)({
@@ -954,22 +1006,6 @@ function parseAlexCLinePrivateConfig(data) {
954
1006
  return (0, _alextheman_utility.parseZodSchema)(alexCLinePrivateConfigSchema, data);
955
1007
  }
956
1008
 
957
- //#endregion
958
- //#region src/utility/fileSystem/findPackageRoot.ts
959
- async function findPackageRoot(startDirectory, packageName) {
960
- let directory = startDirectory;
961
- while (true) {
962
- const packagePath = node_path.default.join(directory, "package.json");
963
- try {
964
- if (JSON.parse(await (0, node_fs_promises.readFile)(packagePath, "utf-8"))?.name === packageName) return directory;
965
- } catch {}
966
- const parent = node_path.default.dirname(directory);
967
- if (parent === directory) break;
968
- directory = parent;
969
- }
970
- throw new _alextheman_utility.DataError({ packageName }, "PACKAGE_ROOT_NOT_FOUND", `Could not find package root for ${packageName}`);
971
- }
972
-
973
1009
  //#endregion
974
1010
  //#region src/utility/markdownTemplates/pullRequest/getPullRequestTemplatesFromMarkdown.ts
975
1011
  const __filename$3 = (0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href);
@@ -1317,7 +1353,7 @@ function parseZodSchemaForProgram(programError, schema, data) {
1317
1353
  //#endregion
1318
1354
  //#region package.json
1319
1355
  var name = "alex-c-line";
1320
- var version = "1.32.0";
1356
+ var version = "1.33.1";
1321
1357
  var description = "Command-line tool with commands to streamline the developer workflow.";
1322
1358
 
1323
1359
  //#endregion
@@ -1562,12 +1598,6 @@ function generateUUID(program) {
1562
1598
  });
1563
1599
  }
1564
1600
 
1565
- //#endregion
1566
- //#region src/utility/miscellaneous/loadCommands.ts
1567
- function loadCommands(program, commandMap) {
1568
- for (const loader of Object.values(commandMap)) loader(program);
1569
- }
1570
-
1571
1601
  //#endregion
1572
1602
  //#region src/cli/commands/uuid/index.ts
1573
1603
  function uuid(program) {
@@ -1686,7 +1716,9 @@ function createCommands(program) {
1686
1716
  getVersionType,
1687
1717
  gitPostMergeCleanup,
1688
1718
  incrementVersion,
1719
+ internal,
1689
1720
  migrateReleaseNotes,
1721
+ packageJson,
1690
1722
  preCommit,
1691
1723
  preCommit2,
1692
1724
  sayHello,
@@ -1694,8 +1726,7 @@ function createCommands(program) {
1694
1726
  setReleaseStatus2,
1695
1727
  update,
1696
1728
  useLocalPackage,
1697
- uuid,
1698
- packageJson
1729
+ uuid
1699
1730
  });
1700
1731
  }
1701
1732
 
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";
@@ -590,35 +590,35 @@ async function parseDotenvFile(envFilePath) {
590
590
  //#endregion
591
591
  //#region src/cli/commands/edit-env-file/index.ts
592
592
  function editEnvFile(program) {
593
- program.command("edit-env-file").description("Edit properties in a .env file").option("--interactive", "Enable interactive mode", true).option("--file <filePath>", "The path to the .env file you want to edit, relative to the working directory this command is run", ".env").action(async ({ interactive, file }) => {
593
+ program.command("edit-env-file").description("Edit properties in a .env file").option("--interactive", "Enable interactive mode", true).option("--file <filePath>", "The path to the .env file you want to edit, relative to the working directory this command is run", ".env").action(async ({ file, interactive }) => {
594
594
  if (interactive) {
595
595
  let exitInteractiveMode = false;
596
596
  while (!exitInteractiveMode) {
597
597
  const envFileContents = await parseDotenvFile(file);
598
598
  const variableToEdit = await select({
599
- message: normaliseIndents`
600
- Please select the environment variable you wish to edit
601
- Currently editing file: ${file}
602
- `,
603
599
  choices: [
604
600
  ...Object.keys(envFileContents).map((key) => {
605
601
  return {
602
+ description: envFileContents[key] === "" ? "<empty>" : "<redacted for safety>",
606
603
  name: key,
607
- value: key,
608
- description: envFileContents[key] === "" ? "<empty>" : "<redacted for safety>"
604
+ value: key
609
605
  };
610
606
  }),
611
607
  {
608
+ description: `Add a new environment variable to .env.`,
612
609
  name: `${chalk.green("+")} Add new environment variable`,
613
- value: "Add new",
614
- description: `Add a new environment variable to .env.`
610
+ value: "Add new"
615
611
  },
616
612
  {
613
+ description: "Exit the .env file interactive editor.",
617
614
  name: `${chalk.dim("⏎")} Exit editor`,
618
- value: "Exit editor",
619
- description: "Exit the .env file interactive editor."
615
+ value: "Exit editor"
620
616
  }
621
- ]
617
+ ],
618
+ message: normaliseIndents`
619
+ Please select the environment variable you wish to edit
620
+ Currently editing file: ${file}
621
+ `
622
622
  });
623
623
  switch (variableToEdit) {
624
624
  case "Add new":
@@ -698,6 +698,58 @@ 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
+
722
+ //#endregion
723
+ //#region src/cli/commands/internal/outdated-dependencies.ts
724
+ function outdatedDependencies(program) {
725
+ program.command("outdated-dependencies").action(async () => {
726
+ const { exitCode, stdout, stderr } = await execa({ reject: false })`pnpm outdated --json`;
727
+ if (![0, 1].includes(exitCode)) program.error(stderr ?? stdout, {
728
+ exitCode,
729
+ code: "PNPM_OUDATED_ERROR"
730
+ });
731
+ const outdatedDependencies = JSON.parse(stdout.trim());
732
+ const outdatedTemplatesPath = path.join(await alexCLinePackageRoot, "templates", "outdated");
733
+ const tableTemplate = await readFile(path.join(outdatedTemplatesPath, "table.html"), "utf-8");
734
+ const tableRowTemplate = await readFile(path.join(outdatedTemplatesPath, "tableRow.html"), "utf-8");
735
+ console.info(tableTemplate.replace("{{tableRows}}", Object.entries(outdatedDependencies).map(([packageName, metadata]) => {
736
+ return tableRowTemplate.replace("{{packageName}}", packageName).replace("{{currentVersion}}", metadata.current).replace("{{latestVersion}}", metadata.latest);
737
+ }).join("\n")));
738
+ });
739
+ }
740
+
741
+ //#endregion
742
+ //#region src/utility/miscellaneous/loadCommands.ts
743
+ function loadCommands(program, commandMap) {
744
+ for (const loader of Object.values(commandMap)) loader(program);
745
+ }
746
+
747
+ //#endregion
748
+ //#region src/cli/commands/internal/index.ts
749
+ function internal(program) {
750
+ loadCommands(program.command("internal").description("Commands meant more for internal use by me and is not recommended for production usage."), { outdatedDependencies });
751
+ }
752
+
701
753
  //#endregion
702
754
  //#region src/cli/commands/pre-commit/createStepRunner.ts
703
755
  const runCommandAndLogToConsole = execa({
@@ -916,22 +968,6 @@ function parseAlexCLinePrivateConfig(data) {
916
968
  return parseZodSchema(alexCLinePrivateConfigSchema, data);
917
969
  }
918
970
 
919
- //#endregion
920
- //#region src/utility/fileSystem/findPackageRoot.ts
921
- async function findPackageRoot(startDirectory, packageName) {
922
- let directory = startDirectory;
923
- while (true) {
924
- const packagePath = path.join(directory, "package.json");
925
- try {
926
- if (JSON.parse(await readFile(packagePath, "utf-8"))?.name === packageName) return directory;
927
- } catch {}
928
- const parent = path.dirname(directory);
929
- if (parent === directory) break;
930
- directory = parent;
931
- }
932
- throw new DataError({ packageName }, "PACKAGE_ROOT_NOT_FOUND", `Could not find package root for ${packageName}`);
933
- }
934
-
935
971
  //#endregion
936
972
  //#region src/utility/markdownTemplates/pullRequest/getPullRequestTemplatesFromMarkdown.ts
937
973
  const __filename$2 = fileURLToPath(import.meta.url);
@@ -1279,7 +1315,7 @@ function parseZodSchemaForProgram(programError, schema, data) {
1279
1315
  //#endregion
1280
1316
  //#region package.json
1281
1317
  var name = "alex-c-line";
1282
- var version = "1.32.0";
1318
+ var version = "1.33.1";
1283
1319
  var description = "Command-line tool with commands to streamline the developer workflow.";
1284
1320
 
1285
1321
  //#endregion
@@ -1524,12 +1560,6 @@ function generateUUID(program) {
1524
1560
  });
1525
1561
  }
1526
1562
 
1527
- //#endregion
1528
- //#region src/utility/miscellaneous/loadCommands.ts
1529
- function loadCommands(program, commandMap) {
1530
- for (const loader of Object.values(commandMap)) loader(program);
1531
- }
1532
-
1533
1563
  //#endregion
1534
1564
  //#region src/cli/commands/uuid/index.ts
1535
1565
  function uuid(program) {
@@ -1648,7 +1678,9 @@ function createCommands(program) {
1648
1678
  getVersionType,
1649
1679
  gitPostMergeCleanup,
1650
1680
  incrementVersion,
1681
+ internal,
1651
1682
  migrateReleaseNotes,
1683
+ packageJson,
1652
1684
  preCommit,
1653
1685
  preCommit2,
1654
1686
  sayHello,
@@ -1656,8 +1688,7 @@ function createCommands(program) {
1656
1688
  setReleaseStatus2,
1657
1689
  update,
1658
1690
  useLocalPackage,
1659
- uuid,
1660
- packageJson
1691
+ uuid
1661
1692
  });
1662
1693
  }
1663
1694
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alex-c-line",
3
- "version": "1.32.0",
3
+ "version": "1.33.1",
4
4
  "description": "Command-line tool with commands to streamline the developer workflow.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -52,7 +52,7 @@
52
52
  "zod": "^4.3.6"
53
53
  },
54
54
  "devDependencies": {
55
- "@alextheman/eslint-plugin": "^5.9.0",
55
+ "@alextheman/eslint-plugin": "^5.9.1",
56
56
  "@commander-js/extra-typings": "^14.0.0",
57
57
  "@types/eslint": "^9.6.1",
58
58
  "@types/node": "^25.3.2",
@@ -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}\"",
@@ -0,0 +1,12 @@
1
+ <table>
2
+ <thead>
3
+ <tr>
4
+ <th scope="col">Name</th>
5
+ <th scope="col">Current Version</th>
6
+ <th scope="col">Latest Version</th>
7
+ </tr>
8
+ </thead>
9
+ <tbody>
10
+ {{tableRows}}
11
+ </tbody>
12
+ </table>
@@ -0,0 +1,5 @@
1
+ <tr>
2
+ <th scope="row">{{packageName}}</th>
3
+ <td>{{currentVersion}}</td>
4
+ <td>{{latestVersion}}</td>
5
+ </tr>