alex-c-line 1.17.0 → 1.17.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.
- package/dist/index.cjs +10 -16
- package/dist/index.js +11 -16
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -39,8 +39,6 @@ let dotenv = require("dotenv");
|
|
|
39
39
|
dotenv = __toESM(dotenv);
|
|
40
40
|
let dotenv_stringify = require("dotenv-stringify");
|
|
41
41
|
dotenv_stringify = __toESM(dotenv_stringify);
|
|
42
|
-
let libsodium_wrappers = require("libsodium-wrappers");
|
|
43
|
-
libsodium_wrappers = __toESM(libsodium_wrappers);
|
|
44
42
|
let node_os = require("node:os");
|
|
45
43
|
node_os = __toESM(node_os);
|
|
46
44
|
let zod = require("zod");
|
|
@@ -357,15 +355,11 @@ function editEnv(program$1) {
|
|
|
357
355
|
var edit_env_default = editEnv;
|
|
358
356
|
|
|
359
357
|
//#endregion
|
|
360
|
-
//#region src/commands/encrypt.ts
|
|
361
|
-
function
|
|
362
|
-
program$1.command("encrypt").description("Encrypt a secret given the public key and the thing you want to encrypt.").argument("<
|
|
358
|
+
//#region src/commands/encrypt-with-key.ts
|
|
359
|
+
function encryptWithKey(program$1) {
|
|
360
|
+
program$1.command("encrypt-with-key").alias("encrypt").description("Encrypt a secret given the public base64 key and the thing you want to encrypt.").argument("<publicKey>", "The public base64 key to encrypt with").argument("<plaintextValue>", "The value to encrypt in plaintext").action(async (publicKey, plaintextValue) => {
|
|
363
361
|
try {
|
|
364
|
-
await
|
|
365
|
-
const base64Key = libsodium_wrappers.default.from_base64(key, libsodium_wrappers.default.base64_variants.ORIGINAL);
|
|
366
|
-
const encryptedValue = libsodium_wrappers.default.crypto_box_seal(value, base64Key);
|
|
367
|
-
const encryptedBase64Value = libsodium_wrappers.default.to_base64(encryptedValue, libsodium_wrappers.default.base64_variants.ORIGINAL);
|
|
368
|
-
console.info(encryptedBase64Value);
|
|
362
|
+
console.info(await (0, _alextheman_utility.encryptWithKey)(publicKey, plaintextValue));
|
|
369
363
|
} catch {
|
|
370
364
|
program$1.error("Encryption failed. Please double-check that the given key is a valid base 64 string.", {
|
|
371
365
|
exitCode: 1,
|
|
@@ -374,7 +368,7 @@ function encrypt(program$1) {
|
|
|
374
368
|
}
|
|
375
369
|
});
|
|
376
370
|
}
|
|
377
|
-
var
|
|
371
|
+
var encrypt_with_key_default = encryptWithKey;
|
|
378
372
|
|
|
379
373
|
//#endregion
|
|
380
374
|
//#region src/commands/get-version-type.ts
|
|
@@ -708,7 +702,7 @@ function createCommands(program$1) {
|
|
|
708
702
|
createPullRequestTemplates: create_pull_request_templates_default,
|
|
709
703
|
createReleaseNote: create_release_note_default,
|
|
710
704
|
editEnv: edit_env_default,
|
|
711
|
-
|
|
705
|
+
encryptWithKey: encrypt_with_key_default,
|
|
712
706
|
getVersionType: get_version_type_default,
|
|
713
707
|
gitPostMergeCleanup: git_post_merge_cleanup_default,
|
|
714
708
|
incrementVersion: increment_version_default,
|
|
@@ -722,7 +716,7 @@ var commands_default = createCommands;
|
|
|
722
716
|
|
|
723
717
|
//#endregion
|
|
724
718
|
//#region package.json
|
|
725
|
-
var version = "1.17.
|
|
719
|
+
var version = "1.17.2";
|
|
726
720
|
var package_default = {
|
|
727
721
|
name: "alex-c-line",
|
|
728
722
|
version,
|
|
@@ -764,13 +758,13 @@ var package_default = {
|
|
|
764
758
|
"format-prettier": "pnpm run format-prettier-typescript && pnpm run format-prettier-javascript && pnpm run format-prettier-yml",
|
|
765
759
|
"format-prettier-javascript": "prettier --write \"./**/*.js\"",
|
|
766
760
|
"format-prettier-typescript": "prettier --write --parser typescript \"./**/*.ts\"",
|
|
767
|
-
"format-prettier-yml": "prettier --write \"./**/*.yml\"",
|
|
761
|
+
"format-prettier-yml": "prettier --write \"./**/*.{yml,yaml}\"",
|
|
768
762
|
"lint": "pnpm run lint-tsc && pnpm run lint-eslint && pnpm run lint-prettier",
|
|
769
763
|
"lint-eslint": "eslint \"package.json\" \"src/**/*.ts\" \"tests/**/*.ts\"",
|
|
770
764
|
"lint-prettier": "pnpm run lint-prettier-typescript && pnpm run lint-prettier-javascript && pnpm run lint-prettier-yml",
|
|
771
765
|
"lint-prettier-javascript": "prettier --check \"./**.js\"",
|
|
772
766
|
"lint-prettier-typescript": "prettier --check --parser typescript \"./**/*.ts\"",
|
|
773
|
-
"lint-prettier-yml": "prettier --check \"./**/*.yml\"",
|
|
767
|
+
"lint-prettier-yml": "prettier --check \"./**/*.{yml,yaml}\"",
|
|
774
768
|
"lint-tsc": "tsc --noEmit",
|
|
775
769
|
"pre-commit": "pnpm run command pre-commit-2",
|
|
776
770
|
"prepare": "husky",
|
|
@@ -787,7 +781,7 @@ var package_default = {
|
|
|
787
781
|
"use-local-utility": "pnpm run prepare-local-utility"
|
|
788
782
|
},
|
|
789
783
|
dependencies: {
|
|
790
|
-
"@alextheman/utility": "^4.
|
|
784
|
+
"@alextheman/utility": "^4.5.1",
|
|
791
785
|
"commander": "^14.0.2",
|
|
792
786
|
"dotenv": "^17.2.3",
|
|
793
787
|
"dotenv-stringify": "^3.0.1",
|
package/dist/index.js
CHANGED
|
@@ -5,11 +5,10 @@ import updateNotifier from "update-notifier";
|
|
|
5
5
|
import { access, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { readFileSync } from "node:fs";
|
|
8
|
-
import { DataError, VersionNumber, kebabToCamel, normaliseIndents, parseVersionType, parseZodSchema } from "@alextheman/utility";
|
|
8
|
+
import { DataError, VersionNumber, encryptWithKey, kebabToCamel, normaliseIndents, parseVersionType, parseZodSchema } from "@alextheman/utility";
|
|
9
9
|
import { ExecaError, execa } from "execa";
|
|
10
10
|
import dotenv from "dotenv";
|
|
11
11
|
import dotenvStringify from "dotenv-stringify";
|
|
12
|
-
import sodium from "libsodium-wrappers";
|
|
13
12
|
import os from "node:os";
|
|
14
13
|
import z from "zod";
|
|
15
14
|
import { pathToFileURL } from "node:url";
|
|
@@ -323,15 +322,11 @@ function editEnv(program$1) {
|
|
|
323
322
|
var edit_env_default = editEnv;
|
|
324
323
|
|
|
325
324
|
//#endregion
|
|
326
|
-
//#region src/commands/encrypt.ts
|
|
327
|
-
function
|
|
328
|
-
program$1.command("encrypt").description("Encrypt a secret given the public key and the thing you want to encrypt.").argument("<
|
|
325
|
+
//#region src/commands/encrypt-with-key.ts
|
|
326
|
+
function encryptWithKey$1(program$1) {
|
|
327
|
+
program$1.command("encrypt-with-key").alias("encrypt").description("Encrypt a secret given the public base64 key and the thing you want to encrypt.").argument("<publicKey>", "The public base64 key to encrypt with").argument("<plaintextValue>", "The value to encrypt in plaintext").action(async (publicKey, plaintextValue) => {
|
|
329
328
|
try {
|
|
330
|
-
await
|
|
331
|
-
const base64Key = sodium.from_base64(key, sodium.base64_variants.ORIGINAL);
|
|
332
|
-
const encryptedValue = sodium.crypto_box_seal(value, base64Key);
|
|
333
|
-
const encryptedBase64Value = sodium.to_base64(encryptedValue, sodium.base64_variants.ORIGINAL);
|
|
334
|
-
console.info(encryptedBase64Value);
|
|
329
|
+
console.info(await encryptWithKey(publicKey, plaintextValue));
|
|
335
330
|
} catch {
|
|
336
331
|
program$1.error("Encryption failed. Please double-check that the given key is a valid base 64 string.", {
|
|
337
332
|
exitCode: 1,
|
|
@@ -340,7 +335,7 @@ function encrypt(program$1) {
|
|
|
340
335
|
}
|
|
341
336
|
});
|
|
342
337
|
}
|
|
343
|
-
var
|
|
338
|
+
var encrypt_with_key_default = encryptWithKey$1;
|
|
344
339
|
|
|
345
340
|
//#endregion
|
|
346
341
|
//#region src/commands/get-version-type.ts
|
|
@@ -674,7 +669,7 @@ function createCommands(program$1) {
|
|
|
674
669
|
createPullRequestTemplates: create_pull_request_templates_default,
|
|
675
670
|
createReleaseNote: create_release_note_default,
|
|
676
671
|
editEnv: edit_env_default,
|
|
677
|
-
|
|
672
|
+
encryptWithKey: encrypt_with_key_default,
|
|
678
673
|
getVersionType: get_version_type_default,
|
|
679
674
|
gitPostMergeCleanup: git_post_merge_cleanup_default,
|
|
680
675
|
incrementVersion: increment_version_default,
|
|
@@ -688,7 +683,7 @@ var commands_default = createCommands;
|
|
|
688
683
|
|
|
689
684
|
//#endregion
|
|
690
685
|
//#region package.json
|
|
691
|
-
var version = "1.17.
|
|
686
|
+
var version = "1.17.2";
|
|
692
687
|
var package_default = {
|
|
693
688
|
name: "alex-c-line",
|
|
694
689
|
version,
|
|
@@ -730,13 +725,13 @@ var package_default = {
|
|
|
730
725
|
"format-prettier": "pnpm run format-prettier-typescript && pnpm run format-prettier-javascript && pnpm run format-prettier-yml",
|
|
731
726
|
"format-prettier-javascript": "prettier --write \"./**/*.js\"",
|
|
732
727
|
"format-prettier-typescript": "prettier --write --parser typescript \"./**/*.ts\"",
|
|
733
|
-
"format-prettier-yml": "prettier --write \"./**/*.yml\"",
|
|
728
|
+
"format-prettier-yml": "prettier --write \"./**/*.{yml,yaml}\"",
|
|
734
729
|
"lint": "pnpm run lint-tsc && pnpm run lint-eslint && pnpm run lint-prettier",
|
|
735
730
|
"lint-eslint": "eslint \"package.json\" \"src/**/*.ts\" \"tests/**/*.ts\"",
|
|
736
731
|
"lint-prettier": "pnpm run lint-prettier-typescript && pnpm run lint-prettier-javascript && pnpm run lint-prettier-yml",
|
|
737
732
|
"lint-prettier-javascript": "prettier --check \"./**.js\"",
|
|
738
733
|
"lint-prettier-typescript": "prettier --check --parser typescript \"./**/*.ts\"",
|
|
739
|
-
"lint-prettier-yml": "prettier --check \"./**/*.yml\"",
|
|
734
|
+
"lint-prettier-yml": "prettier --check \"./**/*.{yml,yaml}\"",
|
|
740
735
|
"lint-tsc": "tsc --noEmit",
|
|
741
736
|
"pre-commit": "pnpm run command pre-commit-2",
|
|
742
737
|
"prepare": "husky",
|
|
@@ -753,7 +748,7 @@ var package_default = {
|
|
|
753
748
|
"use-local-utility": "pnpm run prepare-local-utility"
|
|
754
749
|
},
|
|
755
750
|
dependencies: {
|
|
756
|
-
"@alextheman/utility": "^4.
|
|
751
|
+
"@alextheman/utility": "^4.5.1",
|
|
757
752
|
"commander": "^14.0.2",
|
|
758
753
|
"dotenv": "^17.2.3",
|
|
759
754
|
"dotenv-stringify": "^3.0.1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alex-c-line",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.2",
|
|
4
4
|
"description": "Command-line tool with commands to streamline the developer workflow.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dist"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@alextheman/utility": "^4.
|
|
36
|
+
"@alextheman/utility": "^4.5.1",
|
|
37
37
|
"commander": "^14.0.2",
|
|
38
38
|
"dotenv": "^17.2.3",
|
|
39
39
|
"dotenv-stringify": "^3.0.1",
|
|
@@ -71,13 +71,13 @@
|
|
|
71
71
|
"format-prettier": "pnpm run format-prettier-typescript && pnpm run format-prettier-javascript && pnpm run format-prettier-yml",
|
|
72
72
|
"format-prettier-javascript": "prettier --write \"./**/*.js\"",
|
|
73
73
|
"format-prettier-typescript": "prettier --write --parser typescript \"./**/*.ts\"",
|
|
74
|
-
"format-prettier-yml": "prettier --write \"./**/*.yml\"",
|
|
74
|
+
"format-prettier-yml": "prettier --write \"./**/*.{yml,yaml}\"",
|
|
75
75
|
"lint": "pnpm run lint-tsc && pnpm run lint-eslint && pnpm run lint-prettier",
|
|
76
76
|
"lint-eslint": "eslint \"package.json\" \"src/**/*.ts\" \"tests/**/*.ts\"",
|
|
77
77
|
"lint-prettier": "pnpm run lint-prettier-typescript && pnpm run lint-prettier-javascript && pnpm run lint-prettier-yml",
|
|
78
78
|
"lint-prettier-javascript": "prettier --check \"./**.js\"",
|
|
79
79
|
"lint-prettier-typescript": "prettier --check --parser typescript \"./**/*.ts\"",
|
|
80
|
-
"lint-prettier-yml": "prettier --check \"./**/*.yml\"",
|
|
80
|
+
"lint-prettier-yml": "prettier --check \"./**/*.{yml,yaml}\"",
|
|
81
81
|
"lint-tsc": "tsc --noEmit",
|
|
82
82
|
"pre-commit": "pnpm run command pre-commit-2",
|
|
83
83
|
"prepare-live-eslint-plugin": "pnpm uninstall @alextheman/eslint-plugin && pnpm install --save-dev @alextheman/eslint-plugin",
|