alex-c-line 1.29.0 → 1.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +25 -9
- package/dist/index.js +24 -8
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -28,14 +28,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
//#endregion
|
|
29
29
|
let _alextheman_utility = require("@alextheman/utility");
|
|
30
30
|
let commander = require("commander");
|
|
31
|
+
let chalk = require("chalk");
|
|
32
|
+
chalk = __toESM(chalk);
|
|
31
33
|
let canvas = require("canvas");
|
|
32
34
|
let node_fs_promises = require("node:fs/promises");
|
|
33
35
|
let node_path = require("node:path");
|
|
34
36
|
node_path = __toESM(node_path);
|
|
35
37
|
let boxen = require("boxen");
|
|
36
38
|
boxen = __toESM(boxen);
|
|
37
|
-
let chalk = require("chalk");
|
|
38
|
-
chalk = __toESM(chalk);
|
|
39
39
|
let figlet = require("figlet");
|
|
40
40
|
figlet = __toESM(figlet);
|
|
41
41
|
let env_paths = require("env-paths");
|
|
@@ -100,12 +100,13 @@ function centerLine(text, width) {
|
|
|
100
100
|
//#endregion
|
|
101
101
|
//#region src/utility/miscellaneous/createAlexCLineArtwork.ts
|
|
102
102
|
async function createAlexCLineArtwork(options) {
|
|
103
|
-
const { includeColors = true, subtitleColor = chalk.default.green, subtitleText = "say my name and I'll assist ✓" } = options ?? {};
|
|
103
|
+
const { includeBox = true, includeColors = true, subtitleColor = chalk.default.green, subtitleText = "say my name and I'll assist ✓" } = options ?? {};
|
|
104
104
|
const title = await (0, figlet.default)("alex-c-line");
|
|
105
105
|
const subtitle = centerLine(subtitleText, Math.max(...title.split("\n").map((line) => {
|
|
106
106
|
return line.length;
|
|
107
107
|
})));
|
|
108
|
-
|
|
108
|
+
const output = includeColors ? [chalk.default.yellow(title), subtitleColor(subtitle)].join("\n") : [title, subtitle].join("\n");
|
|
109
|
+
return includeBox ? (0, boxen.default)(output, {
|
|
109
110
|
padding: {
|
|
110
111
|
top: 1,
|
|
111
112
|
bottom: 1,
|
|
@@ -114,15 +115,30 @@ async function createAlexCLineArtwork(options) {
|
|
|
114
115
|
},
|
|
115
116
|
borderStyle: "round",
|
|
116
117
|
borderColor: "cyanBright"
|
|
117
|
-
});
|
|
118
|
+
}) : output;
|
|
118
119
|
}
|
|
119
120
|
|
|
120
121
|
//#endregion
|
|
121
122
|
//#region src/commands/artwork.ts
|
|
122
123
|
function artwork(program) {
|
|
123
|
-
program.command("artwork").description("Create the artwork for alex-c-line").option("--
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
program.command("artwork").description("Create the artwork for alex-c-line").option("--subtitle-text <subtitleText>", "Customise the subtitle text").option("--subtitle-color <subtitleColor>", "Customise the subtitle color", (subtitleColor) => {
|
|
125
|
+
return {
|
|
126
|
+
green: chalk.default.green,
|
|
127
|
+
white: chalk.default.white
|
|
128
|
+
}[subtitleColor];
|
|
129
|
+
}).option("--save-png [fileName]", "Save the artwork as a PNG file, optionally specifying the path").action(async ({ savePng: fileName, subtitleText, subtitleColor }) => {
|
|
130
|
+
console.info(await createAlexCLineArtwork({
|
|
131
|
+
includeBox: true,
|
|
132
|
+
includeColors: true,
|
|
133
|
+
subtitleText,
|
|
134
|
+
subtitleColor
|
|
135
|
+
}));
|
|
136
|
+
if (fileName) await asciiToPng(await createAlexCLineArtwork({
|
|
137
|
+
includeBox: false,
|
|
138
|
+
includeColors: false,
|
|
139
|
+
subtitleText,
|
|
140
|
+
subtitleColor
|
|
141
|
+
}), {
|
|
126
142
|
fileName: typeof fileName === "string" ? fileName : void 0,
|
|
127
143
|
fontSize: 90
|
|
128
144
|
});
|
|
@@ -1295,7 +1311,7 @@ function parseZodSchemaForProgram(programError, schema, data) {
|
|
|
1295
1311
|
//#endregion
|
|
1296
1312
|
//#region package.json
|
|
1297
1313
|
var name = "alex-c-line";
|
|
1298
|
-
var version = "1.
|
|
1314
|
+
var version = "1.30.1";
|
|
1299
1315
|
var description = "Command-line tool with commands to streamline the developer workflow.";
|
|
1300
1316
|
|
|
1301
1317
|
//#endregion
|
package/dist/index.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
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
4
|
import { Command } from "commander";
|
|
5
|
+
import chalk from "chalk";
|
|
5
6
|
import { createCanvas } from "canvas";
|
|
6
7
|
import { access, mkdir, readFile, readdir, rename, rm, rmdir, writeFile } from "node:fs/promises";
|
|
7
8
|
import path from "node:path";
|
|
8
9
|
import boxen from "boxen";
|
|
9
|
-
import chalk from "chalk";
|
|
10
10
|
import figlet from "figlet";
|
|
11
11
|
import envPaths from "env-paths";
|
|
12
12
|
import { ExecaError, execa } from "execa";
|
|
@@ -62,12 +62,13 @@ function centerLine(text, width) {
|
|
|
62
62
|
//#endregion
|
|
63
63
|
//#region src/utility/miscellaneous/createAlexCLineArtwork.ts
|
|
64
64
|
async function createAlexCLineArtwork(options) {
|
|
65
|
-
const { includeColors = true, subtitleColor = chalk.green, subtitleText = "say my name and I'll assist ✓" } = options ?? {};
|
|
65
|
+
const { includeBox = true, includeColors = true, subtitleColor = chalk.green, subtitleText = "say my name and I'll assist ✓" } = options ?? {};
|
|
66
66
|
const title = await figlet("alex-c-line");
|
|
67
67
|
const subtitle = centerLine(subtitleText, Math.max(...title.split("\n").map((line) => {
|
|
68
68
|
return line.length;
|
|
69
69
|
})));
|
|
70
|
-
|
|
70
|
+
const output = includeColors ? [chalk.yellow(title), subtitleColor(subtitle)].join("\n") : [title, subtitle].join("\n");
|
|
71
|
+
return includeBox ? boxen(output, {
|
|
71
72
|
padding: {
|
|
72
73
|
top: 1,
|
|
73
74
|
bottom: 1,
|
|
@@ -76,15 +77,30 @@ async function createAlexCLineArtwork(options) {
|
|
|
76
77
|
},
|
|
77
78
|
borderStyle: "round",
|
|
78
79
|
borderColor: "cyanBright"
|
|
79
|
-
});
|
|
80
|
+
}) : output;
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
//#endregion
|
|
83
84
|
//#region src/commands/artwork.ts
|
|
84
85
|
function artwork(program) {
|
|
85
|
-
program.command("artwork").description("Create the artwork for alex-c-line").option("--
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
program.command("artwork").description("Create the artwork for alex-c-line").option("--subtitle-text <subtitleText>", "Customise the subtitle text").option("--subtitle-color <subtitleColor>", "Customise the subtitle color", (subtitleColor) => {
|
|
87
|
+
return {
|
|
88
|
+
green: chalk.green,
|
|
89
|
+
white: chalk.white
|
|
90
|
+
}[subtitleColor];
|
|
91
|
+
}).option("--save-png [fileName]", "Save the artwork as a PNG file, optionally specifying the path").action(async ({ savePng: fileName, subtitleText, subtitleColor }) => {
|
|
92
|
+
console.info(await createAlexCLineArtwork({
|
|
93
|
+
includeBox: true,
|
|
94
|
+
includeColors: true,
|
|
95
|
+
subtitleText,
|
|
96
|
+
subtitleColor
|
|
97
|
+
}));
|
|
98
|
+
if (fileName) await asciiToPng(await createAlexCLineArtwork({
|
|
99
|
+
includeBox: false,
|
|
100
|
+
includeColors: false,
|
|
101
|
+
subtitleText,
|
|
102
|
+
subtitleColor
|
|
103
|
+
}), {
|
|
88
104
|
fileName: typeof fileName === "string" ? fileName : void 0,
|
|
89
105
|
fontSize: 90
|
|
90
106
|
});
|
|
@@ -1257,7 +1273,7 @@ function parseZodSchemaForProgram(programError, schema, data) {
|
|
|
1257
1273
|
//#endregion
|
|
1258
1274
|
//#region package.json
|
|
1259
1275
|
var name = "alex-c-line";
|
|
1260
|
-
var version = "1.
|
|
1276
|
+
var version = "1.30.1";
|
|
1261
1277
|
var description = "Command-line tool with commands to streamline the developer workflow.";
|
|
1262
1278
|
|
|
1263
1279
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alex-c-line",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.30.1",
|
|
4
4
|
"description": "Command-line tool with commands to streamline the developer workflow.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
},
|
|
74
74
|
"scripts": {
|
|
75
75
|
"build": "tsdown",
|
|
76
|
-
"command": "bash -c 'pnpm run build && echo && echo \"Command output:\" && node dist/index.js
|
|
76
|
+
"command": "bash -c 'pnpm run build && echo && echo \"Command output:\" && node dist/index.js \"$@\"' --",
|
|
77
77
|
"create-local-package": "pnpm run build && rm -f alex-c-line-*.tgz && pnpm pack",
|
|
78
78
|
"create-release-note": "bash -c 'git pull origin main && pnpm run command create-release-note-2 $@' --",
|
|
79
79
|
"format": "pnpm run format-prettier && pnpm run format-eslint",
|