alex-c-line 1.14.0 → 1.15.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 +11 -5
- package/dist/index.js +11 -6
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -41,6 +41,8 @@ let dotenv_stringify = require("dotenv-stringify");
|
|
|
41
41
|
dotenv_stringify = __toESM(dotenv_stringify);
|
|
42
42
|
let node_os = require("node:os");
|
|
43
43
|
node_os = __toESM(node_os);
|
|
44
|
+
let zod = require("zod");
|
|
45
|
+
zod = __toESM(zod);
|
|
44
46
|
|
|
45
47
|
//#region src/commands/check-for-file-dependencies.ts
|
|
46
48
|
function findFileDependencies(dependencies$1) {
|
|
@@ -443,7 +445,8 @@ var increment_version_default = incrementVersion;
|
|
|
443
445
|
//#endregion
|
|
444
446
|
//#region src/commands/pre-commit.ts
|
|
445
447
|
function preCommit(program$1) {
|
|
446
|
-
program$1.command("pre-commit").description("Run the standard pre-commits used across all my repositories.").option("--no-build", "Skip the build").option("--no-tests", "Skip the tests").option("--allow-unstaged", "Run even if nothing is staged").action(async ({ build: shouldIncludeBuild, tests: shouldIncludeTests, allowUnstaged }) => {
|
|
448
|
+
program$1.command("pre-commit").description("Run the standard pre-commits used across all my repositories.").option("--no-build", "Skip the build").option("--no-tests", "Skip the tests").option("--allow-unstaged", "Run even if nothing is staged").option("--repository-manager <repositoryManager>", "The repository manager if it is a monorepo (Only Turborepo is supported as of now)").action(async ({ build: shouldIncludeBuild, tests: shouldIncludeTests, allowUnstaged, repositoryManager: rawRepositoryManager }) => {
|
|
449
|
+
const repositoryManager = rawRepositoryManager ? (0, _alextheman_utility.parseZodSchema)(zod.default.enum(["turborepo"]), rawRepositoryManager?.toLowerCase(), new _alextheman_utility.DataError(rawRepositoryManager, "INVALID_REPOSITORY_MANAGER", "The repository manager provided does not exist or is not currently supported. We currently support the following: `turborepo`.")) : void 0;
|
|
447
450
|
const { exitCode: diffExitCode } = await execaNoFail("git", [
|
|
448
451
|
"diff",
|
|
449
452
|
"--cached",
|
|
@@ -460,8 +463,10 @@ function preCommit(program$1) {
|
|
|
460
463
|
return;
|
|
461
464
|
}
|
|
462
465
|
async function runCommandAndLogToConsole(command, args) {
|
|
463
|
-
const
|
|
464
|
-
if (
|
|
466
|
+
const newArguments = [...args ?? []];
|
|
467
|
+
if (repositoryManager === "turborepo") newArguments.push("--ui=stream");
|
|
468
|
+
const result = await execaNoFail(command, newArguments, { stdio: "inherit" });
|
|
469
|
+
if (result.exitCode !== 0) program$1.error(`Command failed: ${command}${newArguments.length ? ` ${newArguments.join(" ")}` : ""}`, {
|
|
465
470
|
exitCode: result.exitCode ?? 1,
|
|
466
471
|
code: "PRE_COMMIT_FAILED"
|
|
467
472
|
});
|
|
@@ -550,7 +555,7 @@ var commands_default = createCommands;
|
|
|
550
555
|
|
|
551
556
|
//#endregion
|
|
552
557
|
//#region package.json
|
|
553
|
-
var version = "1.
|
|
558
|
+
var version = "1.15.0";
|
|
554
559
|
var package_default = {
|
|
555
560
|
name: "alex-c-line",
|
|
556
561
|
version,
|
|
@@ -604,7 +609,8 @@ var package_default = {
|
|
|
604
609
|
"dotenv": "^17.2.3",
|
|
605
610
|
"dotenv-stringify": "^3.0.1",
|
|
606
611
|
"execa": "^9.6.1",
|
|
607
|
-
"update-notifier": "^7.3.1"
|
|
612
|
+
"update-notifier": "^7.3.1",
|
|
613
|
+
"zod": "^4.3.4"
|
|
608
614
|
},
|
|
609
615
|
devDependencies: {
|
|
610
616
|
"@alextheman/eslint-plugin": "^5.4.0",
|
package/dist/index.js
CHANGED
|
@@ -4,11 +4,12 @@ import updateNotifier from "update-notifier";
|
|
|
4
4
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { readFileSync } from "node:fs";
|
|
7
|
-
import { VersionNumber, kebabToCamel, normaliseIndents, parseVersionType } from "@alextheman/utility";
|
|
7
|
+
import { DataError, VersionNumber, kebabToCamel, normaliseIndents, parseVersionType, parseZodSchema } from "@alextheman/utility";
|
|
8
8
|
import { ExecaError, execa } from "execa";
|
|
9
9
|
import dotenv from "dotenv";
|
|
10
10
|
import dotenvStringify from "dotenv-stringify";
|
|
11
11
|
import os from "node:os";
|
|
12
|
+
import z from "zod";
|
|
12
13
|
|
|
13
14
|
//#region src/commands/check-for-file-dependencies.ts
|
|
14
15
|
function findFileDependencies(dependencies$1) {
|
|
@@ -411,7 +412,8 @@ var increment_version_default = incrementVersion;
|
|
|
411
412
|
//#endregion
|
|
412
413
|
//#region src/commands/pre-commit.ts
|
|
413
414
|
function preCommit(program$1) {
|
|
414
|
-
program$1.command("pre-commit").description("Run the standard pre-commits used across all my repositories.").option("--no-build", "Skip the build").option("--no-tests", "Skip the tests").option("--allow-unstaged", "Run even if nothing is staged").action(async ({ build: shouldIncludeBuild, tests: shouldIncludeTests, allowUnstaged }) => {
|
|
415
|
+
program$1.command("pre-commit").description("Run the standard pre-commits used across all my repositories.").option("--no-build", "Skip the build").option("--no-tests", "Skip the tests").option("--allow-unstaged", "Run even if nothing is staged").option("--repository-manager <repositoryManager>", "The repository manager if it is a monorepo (Only Turborepo is supported as of now)").action(async ({ build: shouldIncludeBuild, tests: shouldIncludeTests, allowUnstaged, repositoryManager: rawRepositoryManager }) => {
|
|
416
|
+
const repositoryManager = rawRepositoryManager ? parseZodSchema(z.enum(["turborepo"]), rawRepositoryManager?.toLowerCase(), new DataError(rawRepositoryManager, "INVALID_REPOSITORY_MANAGER", "The repository manager provided does not exist or is not currently supported. We currently support the following: `turborepo`.")) : void 0;
|
|
415
417
|
const { exitCode: diffExitCode } = await execaNoFail("git", [
|
|
416
418
|
"diff",
|
|
417
419
|
"--cached",
|
|
@@ -428,8 +430,10 @@ function preCommit(program$1) {
|
|
|
428
430
|
return;
|
|
429
431
|
}
|
|
430
432
|
async function runCommandAndLogToConsole(command, args) {
|
|
431
|
-
const
|
|
432
|
-
if (
|
|
433
|
+
const newArguments = [...args ?? []];
|
|
434
|
+
if (repositoryManager === "turborepo") newArguments.push("--ui=stream");
|
|
435
|
+
const result = await execaNoFail(command, newArguments, { stdio: "inherit" });
|
|
436
|
+
if (result.exitCode !== 0) program$1.error(`Command failed: ${command}${newArguments.length ? ` ${newArguments.join(" ")}` : ""}`, {
|
|
433
437
|
exitCode: result.exitCode ?? 1,
|
|
434
438
|
code: "PRE_COMMIT_FAILED"
|
|
435
439
|
});
|
|
@@ -518,7 +522,7 @@ var commands_default = createCommands;
|
|
|
518
522
|
|
|
519
523
|
//#endregion
|
|
520
524
|
//#region package.json
|
|
521
|
-
var version = "1.
|
|
525
|
+
var version = "1.15.0";
|
|
522
526
|
var package_default = {
|
|
523
527
|
name: "alex-c-line",
|
|
524
528
|
version,
|
|
@@ -572,7 +576,8 @@ var package_default = {
|
|
|
572
576
|
"dotenv": "^17.2.3",
|
|
573
577
|
"dotenv-stringify": "^3.0.1",
|
|
574
578
|
"execa": "^9.6.1",
|
|
575
|
-
"update-notifier": "^7.3.1"
|
|
579
|
+
"update-notifier": "^7.3.1",
|
|
580
|
+
"zod": "^4.3.4"
|
|
576
581
|
},
|
|
577
582
|
devDependencies: {
|
|
578
583
|
"@alextheman/eslint-plugin": "^5.4.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alex-c-line",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.0",
|
|
4
4
|
"description": "Command-line tool with commands to streamline the developer workflow.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"dotenv": "^17.2.3",
|
|
25
25
|
"dotenv-stringify": "^3.0.1",
|
|
26
26
|
"execa": "^9.6.1",
|
|
27
|
-
"update-notifier": "^7.3.1"
|
|
27
|
+
"update-notifier": "^7.3.1",
|
|
28
|
+
"zod": "^4.3.4"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
31
|
"@alextheman/eslint-plugin": "^5.4.0",
|