@sorrell/cli-utilities 1.0.46 → 1.0.47
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/Distribution/Git/Git.Internal.Types.d.ts +12 -0
- package/Distribution/Git/Git.Internal.Types.d.ts.map +1 -0
- package/Distribution/Git/Git.Internal.Types.js +8 -0
- package/Distribution/Git/Git.Internal.Types.js.map +1 -0
- package/Distribution/Git/Git.Types.d.ts +12 -0
- package/Distribution/Git/Git.Types.d.ts.map +1 -0
- package/Distribution/Git/Git.Types.js +8 -0
- package/Distribution/Git/Git.Types.js.map +1 -0
- package/Distribution/Git/Git.d.ts +28 -0
- package/Distribution/Git/Git.d.ts.map +1 -0
- package/Distribution/Git/Git.js +43 -0
- package/Distribution/Git/Git.js.map +1 -0
- package/Distribution/Git/index.d.ts +9 -0
- package/Distribution/Git/index.d.ts.map +1 -0
- package/Distribution/Git/index.js +9 -0
- package/Distribution/Git/index.js.map +1 -0
- package/Distribution/index.d.ts +4 -0
- package/Distribution/index.d.ts.map +1 -1
- package/Distribution/index.js +4 -0
- package/Distribution/index.js.map +1 -1
- package/package.json +11 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Git.Internal.Types.ts
|
|
3
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
4
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
5
|
+
* @license MIT
|
|
6
|
+
*/
|
|
7
|
+
/** The data used in {@link RepoNotCleanError}. */
|
|
8
|
+
export type FRepoNotCleanErrorData = Readonly<{
|
|
9
|
+
RepositoryPath: string;
|
|
10
|
+
StatusOutput: string;
|
|
11
|
+
}>;
|
|
12
|
+
//# sourceMappingURL=Git.Internal.Types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Git.Internal.Types.d.ts","sourceRoot":"","sources":["../../Source/Git/Git.Internal.Types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,kDAAkD;AAClD,MAAM,MAAM,sBAAsB,GAC9B,QAAQ,CAAC;IACL,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;CACxB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Git.Internal.Types.js","sourceRoot":"","sources":["../../Source/Git/Git.Internal.Types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Git.Types.ts
|
|
3
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
4
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
5
|
+
* @license MIT
|
|
6
|
+
*/
|
|
7
|
+
import type { CommandExecutor, Error } from "@effect/platform";
|
|
8
|
+
import type { RepoNotCleanError } from "./Git.js";
|
|
9
|
+
import type { Effect } from "effect";
|
|
10
|
+
/** The {@link Effect.Effect | effect} returned by {@link RequireCleanGitRepository}. */
|
|
11
|
+
export type ERequireCleanRepo = Effect.Effect<void, RepoNotCleanError | Error.PlatformError, CommandExecutor.CommandExecutor>;
|
|
12
|
+
//# sourceMappingURL=Git.Types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Git.Types.d.ts","sourceRoot":"","sources":["../../Source/Git/Git.Types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE/D,OAAO,KAAK,EAAE,iBAAiB,EAA6B,MAAM,UAAU,CAAC;AAC7E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,wFAAwF;AACxF,MAAM,MAAM,iBAAiB,GACzB,MAAM,CAAC,MAAM,CACT,IAAI,EACJ,iBAAiB,GAAG,KAAK,CAAC,aAAa,EACvC,eAAe,CAAC,eAAe,CAClC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Git.Types.js","sourceRoot":"","sources":["../../Source/Git/Git.Types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Git.ts
|
|
3
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
4
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
5
|
+
* @license MIT
|
|
6
|
+
*/
|
|
7
|
+
import type { ERequireCleanRepo } from "./Git.Types.js";
|
|
8
|
+
import type { FRepoNotCleanErrorData } from "./Git.Internal.Types.js";
|
|
9
|
+
declare const RepoNotCleanError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
10
|
+
readonly _tag: "RepoNotCleanError";
|
|
11
|
+
} & Readonly<A>;
|
|
12
|
+
/** The error that is thrown when the current `git` repo must be clean, but is not. */
|
|
13
|
+
export declare class RepoNotCleanError extends RepoNotCleanError_base<FRepoNotCleanErrorData> {
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get an {@link Effect.Effect | effect} that causes the program to fail if a given `git`
|
|
17
|
+
* repo is not clean.
|
|
18
|
+
*
|
|
19
|
+
* @param RepositoryPath - The *optional* path to a directory in the repository. If no path is specified,
|
|
20
|
+
* then the current working directory is used.
|
|
21
|
+
*
|
|
22
|
+
* @returns {ERequireCleanRepo} An {@link Effect.Effect | effect} that causes the program to fail
|
|
23
|
+
* if the `git` repo at the given {@link RepositoryPath} (or CWD if no {@link RepositoryPath} is specified)
|
|
24
|
+
* is not clean.
|
|
25
|
+
*/
|
|
26
|
+
export declare function RequireCleanGitRepository(RepositoryPath?: string): ERequireCleanRepo;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=Git.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Git.d.ts","sourceRoot":"","sources":["../../Source/Git/Git.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;;;;AAEtE,sFAAsF;AACtF,qBAAa,iBAAkB,SAAQ,uBAAsC,sBAAsB,CAAC;CAAI;AAIxG;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,iBAAiB,CA0BpF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Git.ts
|
|
3
|
+
* @author Gage Sorrell <gage@sorrell.sh>
|
|
4
|
+
* @copyright (c) 2026 Gage Sorrell
|
|
5
|
+
* @license MIT
|
|
6
|
+
*/
|
|
7
|
+
import { Data, Effect } from "effect";
|
|
8
|
+
import { Command } from "@effect/platform";
|
|
9
|
+
/** The error that is thrown when the current `git` repo must be clean, but is not. */
|
|
10
|
+
export class RepoNotCleanError extends Data.TaggedError("RepoNotCleanError") {
|
|
11
|
+
}
|
|
12
|
+
;
|
|
13
|
+
/* eslint-disable jsdoc/require-example */
|
|
14
|
+
/**
|
|
15
|
+
* Get an {@link Effect.Effect | effect} that causes the program to fail if a given `git`
|
|
16
|
+
* repo is not clean.
|
|
17
|
+
*
|
|
18
|
+
* @param RepositoryPath - The *optional* path to a directory in the repository. If no path is specified,
|
|
19
|
+
* then the current working directory is used.
|
|
20
|
+
*
|
|
21
|
+
* @returns {ERequireCleanRepo} An {@link Effect.Effect | effect} that causes the program to fail
|
|
22
|
+
* if the `git` repo at the given {@link RepositoryPath} (or CWD if no {@link RepositoryPath} is specified)
|
|
23
|
+
* is not clean.
|
|
24
|
+
*/
|
|
25
|
+
export function RequireCleanGitRepository(RepositoryPath) {
|
|
26
|
+
return Effect.gen(function* () {
|
|
27
|
+
if (RepositoryPath === undefined) {
|
|
28
|
+
RepositoryPath = process.cwd();
|
|
29
|
+
}
|
|
30
|
+
const StatusCommand = Command
|
|
31
|
+
.make("git", "status", "--porcelain=v1")
|
|
32
|
+
.pipe(Command.workingDirectory(RepositoryPath));
|
|
33
|
+
const StatusOutput = yield* Command.string(StatusCommand);
|
|
34
|
+
if (StatusOutput.trim().length > 0) {
|
|
35
|
+
return yield* Effect.fail(new RepoNotCleanError({
|
|
36
|
+
RepositoryPath,
|
|
37
|
+
StatusOutput
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/* eslint-enable jsdoc/require-example */
|
|
43
|
+
//# sourceMappingURL=Git.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Git.js","sourceRoot":"","sources":["../../Source/Git/Git.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAI3C,sFAAsF;AACtF,MAAM,OAAO,iBAAkB,SAAQ,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAyB;CAAI;AAAA,CAAC;AAEzG,0CAA0C;AAE1C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,yBAAyB,CAAC,cAAuB;IAE7D,OAAO,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QAEvB,IAAI,cAAc,KAAK,SAAS,EAChC,CAAC;YACG,cAAc,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QACnC,CAAC;QAED,MAAM,aAAa,GACf,OAAO;aACF,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,gBAAgB,CAAC;aACvC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC;QAExD,MAAM,YAAY,GAAW,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAElE,IAAI,YAAY,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAClC,CAAC;YACG,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CACrB,IAAI,iBAAiB,CAAC;gBAClB,cAAc;gBACd,YAAY;aACf,CAAC,CACL,CAAC;QACN,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC;AAED,yCAAyC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../Source/Git/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../Source/Git/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
|
package/Distribution/index.d.ts
CHANGED
|
@@ -5,7 +5,11 @@
|
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
7
|
export * as Command from "./Command/index.js";
|
|
8
|
+
export * as English from "./English/index.js";
|
|
9
|
+
export * as PackageConfig from "./PackageConfig/index.js";
|
|
8
10
|
export * as Listr from "./Listr/index.js";
|
|
11
|
+
export * as Fs from "./FileSystem/index.js";
|
|
12
|
+
export * as Git from "./Git/index.js";
|
|
9
13
|
export * as PseudoTerminal from "./PseudoTerminal/index.js";
|
|
10
14
|
export * as Format from "./Format/index.js";
|
|
11
15
|
export * as Ora from "./Ora/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../Source/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,cAAc,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../Source/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,aAAa,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,cAAc,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,cAAc,0BAA0B,CAAC"}
|
package/Distribution/index.js
CHANGED
|
@@ -5,7 +5,11 @@
|
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
7
|
export * as Command from "./Command/index.js";
|
|
8
|
+
export * as English from "./English/index.js";
|
|
9
|
+
export * as PackageConfig from "./PackageConfig/index.js";
|
|
8
10
|
export * as Listr from "./Listr/index.js";
|
|
11
|
+
export * as Fs from "./FileSystem/index.js";
|
|
12
|
+
export * as Git from "./Git/index.js";
|
|
9
13
|
export * as PseudoTerminal from "./PseudoTerminal/index.js";
|
|
10
14
|
export * as Format from "./Format/index.js";
|
|
11
15
|
export * as Ora from "./Ora/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../Source/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,cAAc,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../Source/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,aAAa,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,cAAc,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,cAAc,0BAA0B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sorrell/cli-utilities",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.47",
|
|
4
4
|
"description": "Utilities developing CLI tools with TypeScript.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -8,9 +8,12 @@
|
|
|
8
8
|
"utilities",
|
|
9
9
|
"typescript",
|
|
10
10
|
"ts",
|
|
11
|
+
"sorrell",
|
|
11
12
|
"inquirer",
|
|
12
13
|
"ora",
|
|
13
|
-
"commander"
|
|
14
|
+
"commander",
|
|
15
|
+
"clack",
|
|
16
|
+
"prompts"
|
|
14
17
|
],
|
|
15
18
|
"homepage": "https://github.com/GageSorrell/SorrellWm/tree/Master/Package/CliUtilities",
|
|
16
19
|
"bugs": {
|
|
@@ -46,6 +49,12 @@
|
|
|
46
49
|
"require": "./Distribution/FileSystem/index.js",
|
|
47
50
|
"types": "./Distribution/FileSystem/index.d.ts"
|
|
48
51
|
},
|
|
52
|
+
"./git": {
|
|
53
|
+
"default": "./Distribution/Git/index.js",
|
|
54
|
+
"import": "./Distribution/Git/index.js",
|
|
55
|
+
"require": "./Distribution/Git/index.js",
|
|
56
|
+
"types": "./Distribution/Git/index.d.ts"
|
|
57
|
+
},
|
|
49
58
|
"./inquirer": {
|
|
50
59
|
"default": "./Distribution/Inquirer/index.js",
|
|
51
60
|
"import": "./Distribution/Inquirer/index.js",
|