alex-c-line 2.0.3 → 2.1.0
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/index.cjs +40 -63
- package/dist/index.js +40 -64
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -21,8 +21,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
21
|
enumerable: true
|
|
22
22
|
}) : target, mod));
|
|
23
23
|
//#endregion
|
|
24
|
-
let _alextheman_utility = require("@alextheman/utility");
|
|
25
24
|
let commander = require("commander");
|
|
25
|
+
let _alextheman_utility = require("@alextheman/utility");
|
|
26
26
|
let chalk = require("chalk");
|
|
27
27
|
chalk = __toESM(chalk);
|
|
28
28
|
let boxen = require("boxen");
|
|
@@ -46,6 +46,8 @@ let node_module = require("node:module");
|
|
|
46
46
|
let gray_matter = require("gray-matter");
|
|
47
47
|
gray_matter = __toESM(gray_matter);
|
|
48
48
|
let _alextheman_utility_node = require("@alextheman/utility/node");
|
|
49
|
+
let axios = require("axios");
|
|
50
|
+
axios = __toESM(axios);
|
|
49
51
|
let supports_color = require("supports-color");
|
|
50
52
|
supports_color = __toESM(supports_color);
|
|
51
53
|
let node_crypto = require("node:crypto");
|
|
@@ -1108,61 +1110,6 @@ function templateReleaseNoteCreate(program) {
|
|
|
1108
1110
|
});
|
|
1109
1111
|
}
|
|
1110
1112
|
//#endregion
|
|
1111
|
-
//#region src/cli/commands/template/releaseNote/migrate.ts
|
|
1112
|
-
function templateReleaseNoteMigrate(program) {
|
|
1113
|
-
program.command("migrate").description(_alextheman_utility.normaliseIndents`
|
|
1114
|
-
Migrate the docs/releases folder generated from \`create-release-note\` to be more compatible with v2.
|
|
1115
|
-
The release documents will now be structured as docs/releases/vX/vX.Y/vX.Y.Z.md, rather than docs/releases/<major|minor|patch>/vX.Y.Z`).option("--dry-run", "Perform a dry run of the migration without changing any files.").action(async ({ dryRun }) => {
|
|
1116
|
-
if (dryRun) {
|
|
1117
|
-
console.info("Running migration in dry-run mode. Existing files will not be altered.");
|
|
1118
|
-
console.info();
|
|
1119
|
-
}
|
|
1120
|
-
const oldReleasesPath = node_path.default.join(process.cwd(), "docs", "releases");
|
|
1121
|
-
const oldReleasesDirectory = await (0, node_fs_promises.readdir)(oldReleasesPath);
|
|
1122
|
-
const versionTypes = Object.values(_alextheman_utility.VersionType).filter((value) => {
|
|
1123
|
-
return oldReleasesDirectory.includes(value);
|
|
1124
|
-
});
|
|
1125
|
-
let filesMovedCount = 0;
|
|
1126
|
-
for (const versionType of versionTypes) {
|
|
1127
|
-
const versionPath = node_path.default.join(oldReleasesPath, versionType);
|
|
1128
|
-
const versionNumbers = (await (0, node_fs_promises.readdir)(versionPath)).filter((fileName) => {
|
|
1129
|
-
return fileName.endsWith(".md");
|
|
1130
|
-
}).map((fileName) => {
|
|
1131
|
-
const fileNameNoExtension = fileName.slice(0, -3);
|
|
1132
|
-
try {
|
|
1133
|
-
return new _alextheman_utility.VersionNumber(fileNameNoExtension);
|
|
1134
|
-
} catch {}
|
|
1135
|
-
}).filter((item) => {
|
|
1136
|
-
return item !== void 0;
|
|
1137
|
-
});
|
|
1138
|
-
for (const versionNumber of versionNumbers) {
|
|
1139
|
-
const oldFilePath = node_path.default.join(versionPath, `${versionNumber}.md`);
|
|
1140
|
-
const newFilePath = node_path.default.join(oldReleasesPath, `v${versionNumber.major}`, `v${versionNumber.major}.${versionNumber.minor}`, `${versionNumber}.md`);
|
|
1141
|
-
const relativeOldFilePath = node_path.default.relative(process.cwd(), oldFilePath);
|
|
1142
|
-
const relativeNewFilePath = node_path.default.relative(process.cwd(), newFilePath);
|
|
1143
|
-
if (dryRun) console.info(`Would move \`${relativeOldFilePath}\` to \`${relativeNewFilePath}\``);
|
|
1144
|
-
else {
|
|
1145
|
-
await (0, node_fs_promises.mkdir)(node_path.default.dirname(newFilePath), { recursive: true });
|
|
1146
|
-
await (0, node_fs_promises.rename)(oldFilePath, newFilePath);
|
|
1147
|
-
console.info(`Moved \`${relativeOldFilePath}\` to \`${relativeNewFilePath}\``);
|
|
1148
|
-
}
|
|
1149
|
-
filesMovedCount++;
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
console.info();
|
|
1153
|
-
if (!dryRun) for (const oldFolderName of versionTypes) {
|
|
1154
|
-
const oldFolderPath = node_path.default.join(oldReleasesPath, oldFolderName);
|
|
1155
|
-
const relativeOldFolderPath = node_path.default.relative(process.cwd(), oldFolderPath);
|
|
1156
|
-
if ((await (0, node_fs_promises.readdir)(oldFolderPath)).length === 0) {
|
|
1157
|
-
await (0, node_fs_promises.rmdir)(oldFolderPath);
|
|
1158
|
-
console.info(`All files from \`${relativeOldFolderPath}\` removed. Deleting \`${relativeOldFolderPath}\`.`);
|
|
1159
|
-
}
|
|
1160
|
-
}
|
|
1161
|
-
console.info();
|
|
1162
|
-
console.info(dryRun ? `Dry run complete! ${filesMovedCount} files would be moved.` : `Migration complete! ${filesMovedCount} files moved.`);
|
|
1163
|
-
});
|
|
1164
|
-
}
|
|
1165
|
-
//#endregion
|
|
1166
1113
|
//#region src/cli/commands/template/releaseNote/path.ts
|
|
1167
1114
|
function templateReleaseNotePath(program) {
|
|
1168
1115
|
program.command("path").description("Get the path to the release note for a given version.").argument("[version]", "The version number to get the release note path for (leave blank to default to the current directory's package.json version)", (rawVersion) => {
|
|
@@ -1208,7 +1155,6 @@ function templateReleaseNote(program) {
|
|
|
1208
1155
|
loadCommands(program.command("release-note").description("Manage the release notes"), {
|
|
1209
1156
|
templateReleaseNoteCheck,
|
|
1210
1157
|
templateReleaseNoteCreate,
|
|
1211
|
-
templateReleaseNoteMigrate,
|
|
1212
1158
|
templateReleaseNotePath,
|
|
1213
1159
|
templateReleaseNoteSetStatus
|
|
1214
1160
|
});
|
|
@@ -1224,14 +1170,14 @@ function template(program) {
|
|
|
1224
1170
|
//#endregion
|
|
1225
1171
|
//#region package.json
|
|
1226
1172
|
var name = "alex-c-line";
|
|
1227
|
-
var version$1 = "2.0
|
|
1173
|
+
var version$1 = "2.1.0";
|
|
1228
1174
|
var description = "Command-line tool with commands to streamline the developer workflow.";
|
|
1229
1175
|
//#endregion
|
|
1230
1176
|
//#region src/utility/updates/checkUpdate.ts
|
|
1231
1177
|
async function checkUpdate(options) {
|
|
1232
1178
|
const currentVersion = new _alextheman_utility.VersionNumber(version$1);
|
|
1233
|
-
const {
|
|
1234
|
-
const latestVersion = new _alextheman_utility.VersionNumber(
|
|
1179
|
+
const { data } = await axios.default.get("https://registry.npmjs.org/alex-c-line/latest", { timeout: 5e3 });
|
|
1180
|
+
const latestVersion = new _alextheman_utility.VersionNumber(data.version);
|
|
1235
1181
|
if (!_alextheman_utility.VersionNumber.isEqual(currentVersion, latestVersion)) {
|
|
1236
1182
|
const message = _alextheman_utility.normaliseIndents`
|
|
1237
1183
|
A new update of \`alex-c-line\` is available!
|
|
@@ -1254,7 +1200,10 @@ async function checkUpdate(options) {
|
|
|
1254
1200
|
exitCode: 2,
|
|
1255
1201
|
code: "OUTDATED_VERSION"
|
|
1256
1202
|
});
|
|
1257
|
-
} else
|
|
1203
|
+
} else {
|
|
1204
|
+
const { updateLogger = console.info } = options ?? {};
|
|
1205
|
+
updateLogger(messageWithArtwork);
|
|
1206
|
+
}
|
|
1258
1207
|
} else if (options?.logNoUpdates) console.info(`alex-c-line is up to date (${currentVersion}).`);
|
|
1259
1208
|
}
|
|
1260
1209
|
//#endregion
|
|
@@ -1465,6 +1414,25 @@ function formatError(error) {
|
|
|
1465
1414
|
throw error;
|
|
1466
1415
|
}
|
|
1467
1416
|
//#endregion
|
|
1417
|
+
//#region src/utility/updates/pendingUpdateMessage.ts
|
|
1418
|
+
let pendingUpdateMessage = null;
|
|
1419
|
+
let registered = false;
|
|
1420
|
+
function setPendingUpdateMessage(message) {
|
|
1421
|
+
pendingUpdateMessage = message;
|
|
1422
|
+
}
|
|
1423
|
+
function registerUpdateMessagePrinter() {
|
|
1424
|
+
if (registered) return;
|
|
1425
|
+
registered = true;
|
|
1426
|
+
function print() {
|
|
1427
|
+
if (pendingUpdateMessage) {
|
|
1428
|
+
console.info(`\n${pendingUpdateMessage}`);
|
|
1429
|
+
pendingUpdateMessage = null;
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
process.once("beforeExit", print);
|
|
1433
|
+
process.once("exit", print);
|
|
1434
|
+
}
|
|
1435
|
+
//#endregion
|
|
1468
1436
|
//#region src/cache/global/createAlexCLineGlobalCache.ts
|
|
1469
1437
|
async function createAlexCLineGlobalCache(cacheData) {
|
|
1470
1438
|
await (0, node_fs_promises.mkdir)(ALEX_C_LINE_GLOBAL_CACHE_DIRECTORY, { recursive: true });
|
|
@@ -1496,7 +1464,10 @@ async function runAutomatedUpdateCheck() {
|
|
|
1496
1464
|
const lastChecked = cacheData?.updateChecks?.[version$1] ? new Date(cacheData?.updateChecks?.[version$1]) : void 0;
|
|
1497
1465
|
const currentDate = /* @__PURE__ */ new Date();
|
|
1498
1466
|
if (lastChecked === void 0 || currentDate.getTime() - lastChecked.getTime() >= _alextheman_utility.ONE_DAY_IN_MILLISECONDS) {
|
|
1499
|
-
await checkUpdate({
|
|
1467
|
+
await checkUpdate({
|
|
1468
|
+
logNoUpdates: false,
|
|
1469
|
+
updateLogger: setPendingUpdateMessage
|
|
1470
|
+
});
|
|
1500
1471
|
await createAlexCLineGlobalCache({
|
|
1501
1472
|
...cacheData ?? {},
|
|
1502
1473
|
updateChecks: {
|
|
@@ -1508,12 +1479,18 @@ async function runAutomatedUpdateCheck() {
|
|
|
1508
1479
|
} catch {}
|
|
1509
1480
|
}
|
|
1510
1481
|
//#endregion
|
|
1482
|
+
//#region src/utility/updates/shouldRunAutomatedUpdateCheck.ts
|
|
1483
|
+
const shouldRunAutomatedUpdateCheck = !(process.env.NODE_ENV === "test" || (0, _alextheman_utility.parseBoolean)(process.env.RUN_END_TO_END ?? "false") || (0, _alextheman_utility.parseBoolean)(process.env.CI ?? "false"));
|
|
1484
|
+
//#endregion
|
|
1511
1485
|
//#region src/cli/index.ts
|
|
1512
1486
|
(async () => {
|
|
1513
1487
|
try {
|
|
1514
1488
|
const program = new commander.Command();
|
|
1515
1489
|
program.name(name).description(description).version(version$1);
|
|
1516
|
-
|
|
1490
|
+
registerUpdateMessagePrinter();
|
|
1491
|
+
if (shouldRunAutomatedUpdateCheck) setTimeout(() => {
|
|
1492
|
+
runAutomatedUpdateCheck();
|
|
1493
|
+
}, 0);
|
|
1517
1494
|
createCommands(program);
|
|
1518
1495
|
await program.parseAsync(process.argv);
|
|
1519
1496
|
} catch (error) {
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
|
-
import { DataError, ONE_DAY_IN_MILLISECONDS, VersionNumber, VersionType, encryptWithKey, fillArray, getStringsAndInterpolations, interpolate, isTemplateStringsArray, kebabToCamel, normaliseIndents, omitProperties, parseBoolean, parseVersionType, parseZodSchema, parseZodSchemaAsync, removeDuplicates, removeUndefinedFromObject, stringifyDotenv } from "@alextheman/utility";
|
|
4
3
|
import { Command } from "commander";
|
|
4
|
+
import { DataError, ONE_DAY_IN_MILLISECONDS, VersionNumber, encryptWithKey, fillArray, getStringsAndInterpolations, interpolate, isTemplateStringsArray, kebabToCamel, normaliseIndents, omitProperties, parseBoolean, parseVersionType, parseZodSchema, parseZodSchemaAsync, removeDuplicates, removeUndefinedFromObject, stringifyDotenv } from "@alextheman/utility";
|
|
5
5
|
import chalk from "chalk";
|
|
6
6
|
import boxen from "boxen";
|
|
7
7
|
import figlet from "figlet";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import { createCanvas } from "canvas";
|
|
10
|
-
import { access, mkdir, readFile, readdir,
|
|
10
|
+
import { access, mkdir, readFile, readdir, rm, writeFile } from "node:fs/promises";
|
|
11
11
|
import envPaths from "env-paths";
|
|
12
12
|
import { confirm, input, password, select } from "@inquirer/prompts";
|
|
13
13
|
import { parse } from "dotenv";
|
|
@@ -17,6 +17,7 @@ import { DependencyGroup, PackageManager, getDependenciesFromGroup, getExpectedT
|
|
|
17
17
|
import z from "zod";
|
|
18
18
|
import matter from "gray-matter";
|
|
19
19
|
import { parseFilePath } from "@alextheman/utility/node";
|
|
20
|
+
import axios from "axios";
|
|
20
21
|
import supportsColor from "supports-color";
|
|
21
22
|
import { randomUUID } from "node:crypto";
|
|
22
23
|
import { minVersion, prerelease } from "semver";
|
|
@@ -1078,61 +1079,6 @@ function templateReleaseNoteCreate(program) {
|
|
|
1078
1079
|
});
|
|
1079
1080
|
}
|
|
1080
1081
|
//#endregion
|
|
1081
|
-
//#region src/cli/commands/template/releaseNote/migrate.ts
|
|
1082
|
-
function templateReleaseNoteMigrate(program) {
|
|
1083
|
-
program.command("migrate").description(normaliseIndents`
|
|
1084
|
-
Migrate the docs/releases folder generated from \`create-release-note\` to be more compatible with v2.
|
|
1085
|
-
The release documents will now be structured as docs/releases/vX/vX.Y/vX.Y.Z.md, rather than docs/releases/<major|minor|patch>/vX.Y.Z`).option("--dry-run", "Perform a dry run of the migration without changing any files.").action(async ({ dryRun }) => {
|
|
1086
|
-
if (dryRun) {
|
|
1087
|
-
console.info("Running migration in dry-run mode. Existing files will not be altered.");
|
|
1088
|
-
console.info();
|
|
1089
|
-
}
|
|
1090
|
-
const oldReleasesPath = path.join(process.cwd(), "docs", "releases");
|
|
1091
|
-
const oldReleasesDirectory = await readdir(oldReleasesPath);
|
|
1092
|
-
const versionTypes = Object.values(VersionType).filter((value) => {
|
|
1093
|
-
return oldReleasesDirectory.includes(value);
|
|
1094
|
-
});
|
|
1095
|
-
let filesMovedCount = 0;
|
|
1096
|
-
for (const versionType of versionTypes) {
|
|
1097
|
-
const versionPath = path.join(oldReleasesPath, versionType);
|
|
1098
|
-
const versionNumbers = (await readdir(versionPath)).filter((fileName) => {
|
|
1099
|
-
return fileName.endsWith(".md");
|
|
1100
|
-
}).map((fileName) => {
|
|
1101
|
-
const fileNameNoExtension = fileName.slice(0, -3);
|
|
1102
|
-
try {
|
|
1103
|
-
return new VersionNumber(fileNameNoExtension);
|
|
1104
|
-
} catch {}
|
|
1105
|
-
}).filter((item) => {
|
|
1106
|
-
return item !== void 0;
|
|
1107
|
-
});
|
|
1108
|
-
for (const versionNumber of versionNumbers) {
|
|
1109
|
-
const oldFilePath = path.join(versionPath, `${versionNumber}.md`);
|
|
1110
|
-
const newFilePath = path.join(oldReleasesPath, `v${versionNumber.major}`, `v${versionNumber.major}.${versionNumber.minor}`, `${versionNumber}.md`);
|
|
1111
|
-
const relativeOldFilePath = path.relative(process.cwd(), oldFilePath);
|
|
1112
|
-
const relativeNewFilePath = path.relative(process.cwd(), newFilePath);
|
|
1113
|
-
if (dryRun) console.info(`Would move \`${relativeOldFilePath}\` to \`${relativeNewFilePath}\``);
|
|
1114
|
-
else {
|
|
1115
|
-
await mkdir(path.dirname(newFilePath), { recursive: true });
|
|
1116
|
-
await rename(oldFilePath, newFilePath);
|
|
1117
|
-
console.info(`Moved \`${relativeOldFilePath}\` to \`${relativeNewFilePath}\``);
|
|
1118
|
-
}
|
|
1119
|
-
filesMovedCount++;
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
1122
|
-
console.info();
|
|
1123
|
-
if (!dryRun) for (const oldFolderName of versionTypes) {
|
|
1124
|
-
const oldFolderPath = path.join(oldReleasesPath, oldFolderName);
|
|
1125
|
-
const relativeOldFolderPath = path.relative(process.cwd(), oldFolderPath);
|
|
1126
|
-
if ((await readdir(oldFolderPath)).length === 0) {
|
|
1127
|
-
await rmdir(oldFolderPath);
|
|
1128
|
-
console.info(`All files from \`${relativeOldFolderPath}\` removed. Deleting \`${relativeOldFolderPath}\`.`);
|
|
1129
|
-
}
|
|
1130
|
-
}
|
|
1131
|
-
console.info();
|
|
1132
|
-
console.info(dryRun ? `Dry run complete! ${filesMovedCount} files would be moved.` : `Migration complete! ${filesMovedCount} files moved.`);
|
|
1133
|
-
});
|
|
1134
|
-
}
|
|
1135
|
-
//#endregion
|
|
1136
1082
|
//#region src/cli/commands/template/releaseNote/path.ts
|
|
1137
1083
|
function templateReleaseNotePath(program) {
|
|
1138
1084
|
program.command("path").description("Get the path to the release note for a given version.").argument("[version]", "The version number to get the release note path for (leave blank to default to the current directory's package.json version)", (rawVersion) => {
|
|
@@ -1178,7 +1124,6 @@ function templateReleaseNote(program) {
|
|
|
1178
1124
|
loadCommands(program.command("release-note").description("Manage the release notes"), {
|
|
1179
1125
|
templateReleaseNoteCheck,
|
|
1180
1126
|
templateReleaseNoteCreate,
|
|
1181
|
-
templateReleaseNoteMigrate,
|
|
1182
1127
|
templateReleaseNotePath,
|
|
1183
1128
|
templateReleaseNoteSetStatus
|
|
1184
1129
|
});
|
|
@@ -1194,14 +1139,14 @@ function template(program) {
|
|
|
1194
1139
|
//#endregion
|
|
1195
1140
|
//#region package.json
|
|
1196
1141
|
var name = "alex-c-line";
|
|
1197
|
-
var version$1 = "2.0
|
|
1142
|
+
var version$1 = "2.1.0";
|
|
1198
1143
|
var description = "Command-line tool with commands to streamline the developer workflow.";
|
|
1199
1144
|
//#endregion
|
|
1200
1145
|
//#region src/utility/updates/checkUpdate.ts
|
|
1201
1146
|
async function checkUpdate(options) {
|
|
1202
1147
|
const currentVersion = new VersionNumber(version$1);
|
|
1203
|
-
const {
|
|
1204
|
-
const latestVersion = new VersionNumber(
|
|
1148
|
+
const { data } = await axios.get("https://registry.npmjs.org/alex-c-line/latest", { timeout: 5e3 });
|
|
1149
|
+
const latestVersion = new VersionNumber(data.version);
|
|
1205
1150
|
if (!VersionNumber.isEqual(currentVersion, latestVersion)) {
|
|
1206
1151
|
const message = normaliseIndents`
|
|
1207
1152
|
A new update of \`alex-c-line\` is available!
|
|
@@ -1224,7 +1169,10 @@ async function checkUpdate(options) {
|
|
|
1224
1169
|
exitCode: 2,
|
|
1225
1170
|
code: "OUTDATED_VERSION"
|
|
1226
1171
|
});
|
|
1227
|
-
} else
|
|
1172
|
+
} else {
|
|
1173
|
+
const { updateLogger = console.info } = options ?? {};
|
|
1174
|
+
updateLogger(messageWithArtwork);
|
|
1175
|
+
}
|
|
1228
1176
|
} else if (options?.logNoUpdates) console.info(`alex-c-line is up to date (${currentVersion}).`);
|
|
1229
1177
|
}
|
|
1230
1178
|
//#endregion
|
|
@@ -1435,6 +1383,25 @@ function formatError(error) {
|
|
|
1435
1383
|
throw error;
|
|
1436
1384
|
}
|
|
1437
1385
|
//#endregion
|
|
1386
|
+
//#region src/utility/updates/pendingUpdateMessage.ts
|
|
1387
|
+
let pendingUpdateMessage = null;
|
|
1388
|
+
let registered = false;
|
|
1389
|
+
function setPendingUpdateMessage(message) {
|
|
1390
|
+
pendingUpdateMessage = message;
|
|
1391
|
+
}
|
|
1392
|
+
function registerUpdateMessagePrinter() {
|
|
1393
|
+
if (registered) return;
|
|
1394
|
+
registered = true;
|
|
1395
|
+
function print() {
|
|
1396
|
+
if (pendingUpdateMessage) {
|
|
1397
|
+
console.info(`\n${pendingUpdateMessage}`);
|
|
1398
|
+
pendingUpdateMessage = null;
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
process.once("beforeExit", print);
|
|
1402
|
+
process.once("exit", print);
|
|
1403
|
+
}
|
|
1404
|
+
//#endregion
|
|
1438
1405
|
//#region src/cache/global/createAlexCLineGlobalCache.ts
|
|
1439
1406
|
async function createAlexCLineGlobalCache(cacheData) {
|
|
1440
1407
|
await mkdir(ALEX_C_LINE_GLOBAL_CACHE_DIRECTORY, { recursive: true });
|
|
@@ -1466,7 +1433,10 @@ async function runAutomatedUpdateCheck() {
|
|
|
1466
1433
|
const lastChecked = cacheData?.updateChecks?.[version$1] ? new Date(cacheData?.updateChecks?.[version$1]) : void 0;
|
|
1467
1434
|
const currentDate = /* @__PURE__ */ new Date();
|
|
1468
1435
|
if (lastChecked === void 0 || currentDate.getTime() - lastChecked.getTime() >= ONE_DAY_IN_MILLISECONDS) {
|
|
1469
|
-
await checkUpdate({
|
|
1436
|
+
await checkUpdate({
|
|
1437
|
+
logNoUpdates: false,
|
|
1438
|
+
updateLogger: setPendingUpdateMessage
|
|
1439
|
+
});
|
|
1470
1440
|
await createAlexCLineGlobalCache({
|
|
1471
1441
|
...cacheData ?? {},
|
|
1472
1442
|
updateChecks: {
|
|
@@ -1478,12 +1448,18 @@ async function runAutomatedUpdateCheck() {
|
|
|
1478
1448
|
} catch {}
|
|
1479
1449
|
}
|
|
1480
1450
|
//#endregion
|
|
1451
|
+
//#region src/utility/updates/shouldRunAutomatedUpdateCheck.ts
|
|
1452
|
+
const shouldRunAutomatedUpdateCheck = !(process.env.NODE_ENV === "test" || parseBoolean(process.env.RUN_END_TO_END ?? "false") || parseBoolean(process.env.CI ?? "false"));
|
|
1453
|
+
//#endregion
|
|
1481
1454
|
//#region src/cli/index.ts
|
|
1482
1455
|
(async () => {
|
|
1483
1456
|
try {
|
|
1484
1457
|
const program = new Command();
|
|
1485
1458
|
program.name(name).description(description).version(version$1);
|
|
1486
|
-
|
|
1459
|
+
registerUpdateMessagePrinter();
|
|
1460
|
+
if (shouldRunAutomatedUpdateCheck) setTimeout(() => {
|
|
1461
|
+
runAutomatedUpdateCheck();
|
|
1462
|
+
}, 0);
|
|
1487
1463
|
createCommands(program);
|
|
1488
1464
|
await program.parseAsync(process.argv);
|
|
1489
1465
|
} catch (error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alex-c-line",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Command-line tool with commands to streamline the developer workflow.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,8 +34,9 @@
|
|
|
34
34
|
"templates"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@alextheman/utility": "^5.6.
|
|
37
|
+
"@alextheman/utility": "^5.6.2",
|
|
38
38
|
"@inquirer/prompts": "^8.3.0",
|
|
39
|
+
"axios": "^1.13.6",
|
|
39
40
|
"boxen": "^8.0.1",
|
|
40
41
|
"canvas": "^3.2.1",
|
|
41
42
|
"chalk": "^5.6.2",
|