@repokit/core 2.1.0 → 3.0.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/Cargo.lock +111 -5
- package/Cargo.toml +2 -1
- package/dist/RepoKitConfig.d.mts +2 -2
- package/dist/RepoKitConfig.mjs +3 -3
- package/dist/RepoKitTheme.d.mts +26 -26
- package/dist/RepoKitTheme.mjs +24 -24
- package/dist/index.d.mts +3 -4
- package/dist/index.mjs +1 -2
- package/dist/types.d.mts +16 -7
- package/externals/RepoKitConfig.ts +3 -3
- package/externals/RepoKitTheme.ts +26 -34
- package/externals/index.ts +0 -1
- package/externals/types.ts +20 -6
- package/installation/install.sh +9 -3
- package/internals/argv/argv.rs +133 -0
- package/internals/argv/mod.rs +1 -0
- package/internals/internal_commands/help.rs +6 -6
- package/internals/internal_commands/internal_registry.rs +5 -4
- package/internals/internal_commands/list_owners.rs +10 -10
- package/internals/internal_commands/list_themes.rs +113 -0
- package/internals/internal_commands/mod.rs +1 -0
- package/internals/internal_filesystem/internal_filesystem.rs +122 -1
- package/internals/logger/logger.rs +18 -3
- package/internals/main.rs +1 -0
- package/internals/repokit/interfaces.rs +2 -2
- package/internals/repokit/repokit.rs +4 -4
- package/internals/themes/built_in_themes/mod.rs +3 -0
- package/internals/themes/built_in_themes/money.rs +41 -0
- package/internals/themes/built_in_themes/seeing_red.rs +41 -0
- package/internals/themes/built_in_themes/the_blues.rs +41 -0
- package/internals/themes/mod.rs +3 -0
- package/internals/themes/theme.rs +48 -70
- package/internals/themes/theme_colors.rs +36 -0
- package/internals/themes/theme_inputs.rs +34 -0
- package/internals/themes/theme_registry.rs +80 -7
- package/package.json +2 -1
- package/dist/Themes.d.mts +0 -8
- package/dist/Themes.mjs +0 -31
- package/externals/Themes.ts +0 -31
package/Cargo.lock
CHANGED
|
@@ -27,6 +27,12 @@ dependencies = [
|
|
|
27
27
|
"serde",
|
|
28
28
|
]
|
|
29
29
|
|
|
30
|
+
[[package]]
|
|
31
|
+
name = "cfg-if"
|
|
32
|
+
version = "1.0.4"
|
|
33
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
34
|
+
checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
|
|
35
|
+
|
|
30
36
|
[[package]]
|
|
31
37
|
name = "colored"
|
|
32
38
|
version = "3.1.1"
|
|
@@ -61,6 +67,38 @@ version = "0.8.21"
|
|
|
61
67
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
62
68
|
checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
|
|
63
69
|
|
|
70
|
+
[[package]]
|
|
71
|
+
name = "dirs"
|
|
72
|
+
version = "6.0.0"
|
|
73
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
74
|
+
checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e"
|
|
75
|
+
dependencies = [
|
|
76
|
+
"dirs-sys",
|
|
77
|
+
]
|
|
78
|
+
|
|
79
|
+
[[package]]
|
|
80
|
+
name = "dirs-sys"
|
|
81
|
+
version = "0.5.0"
|
|
82
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
83
|
+
checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab"
|
|
84
|
+
dependencies = [
|
|
85
|
+
"libc",
|
|
86
|
+
"option-ext",
|
|
87
|
+
"redox_users",
|
|
88
|
+
"windows-sys",
|
|
89
|
+
]
|
|
90
|
+
|
|
91
|
+
[[package]]
|
|
92
|
+
name = "getrandom"
|
|
93
|
+
version = "0.2.17"
|
|
94
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
95
|
+
checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0"
|
|
96
|
+
dependencies = [
|
|
97
|
+
"cfg-if",
|
|
98
|
+
"libc",
|
|
99
|
+
"wasi",
|
|
100
|
+
]
|
|
101
|
+
|
|
64
102
|
[[package]]
|
|
65
103
|
name = "globset"
|
|
66
104
|
version = "0.4.18"
|
|
@@ -96,6 +134,21 @@ version = "1.0.17"
|
|
|
96
134
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
97
135
|
checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2"
|
|
98
136
|
|
|
137
|
+
[[package]]
|
|
138
|
+
name = "libc"
|
|
139
|
+
version = "0.2.183"
|
|
140
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
141
|
+
checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d"
|
|
142
|
+
|
|
143
|
+
[[package]]
|
|
144
|
+
name = "libredox"
|
|
145
|
+
version = "0.1.15"
|
|
146
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
147
|
+
checksum = "7ddbf48fd451246b1f8c2610bd3b4ac0cc6e149d89832867093ab69a17194f08"
|
|
148
|
+
dependencies = [
|
|
149
|
+
"libc",
|
|
150
|
+
]
|
|
151
|
+
|
|
99
152
|
[[package]]
|
|
100
153
|
name = "log"
|
|
101
154
|
version = "0.4.29"
|
|
@@ -114,6 +167,12 @@ version = "0.2.1"
|
|
|
114
167
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
115
168
|
checksum = "f5438dd2b2ff4c6df6e1ce22d825ed2fa93ee2922235cc45186991717f0a892d"
|
|
116
169
|
|
|
170
|
+
[[package]]
|
|
171
|
+
name = "option-ext"
|
|
172
|
+
version = "0.2.0"
|
|
173
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
174
|
+
checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
|
|
175
|
+
|
|
117
176
|
[[package]]
|
|
118
177
|
name = "pin-project-lite"
|
|
119
178
|
version = "0.2.16"
|
|
@@ -131,13 +190,24 @@ dependencies = [
|
|
|
131
190
|
|
|
132
191
|
[[package]]
|
|
133
192
|
name = "quote"
|
|
134
|
-
version = "1.0.
|
|
193
|
+
version = "1.0.45"
|
|
135
194
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
136
|
-
checksum = "
|
|
195
|
+
checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
|
|
137
196
|
dependencies = [
|
|
138
197
|
"proc-macro2",
|
|
139
198
|
]
|
|
140
199
|
|
|
200
|
+
[[package]]
|
|
201
|
+
name = "redox_users"
|
|
202
|
+
version = "0.5.2"
|
|
203
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
204
|
+
checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac"
|
|
205
|
+
dependencies = [
|
|
206
|
+
"getrandom",
|
|
207
|
+
"libredox",
|
|
208
|
+
"thiserror",
|
|
209
|
+
]
|
|
210
|
+
|
|
141
211
|
[[package]]
|
|
142
212
|
name = "regex"
|
|
143
213
|
version = "1.12.3"
|
|
@@ -169,7 +239,7 @@ checksum = "a96887878f22d7bad8a3b6dc5b7440e0ada9a245242924394987b21cf2210a4c"
|
|
|
169
239
|
|
|
170
240
|
[[package]]
|
|
171
241
|
name = "repokit"
|
|
172
|
-
version = "
|
|
242
|
+
version = "3.0.0"
|
|
173
243
|
dependencies = [
|
|
174
244
|
"alphanumeric-sort",
|
|
175
245
|
"colored",
|
|
@@ -178,6 +248,7 @@ dependencies = [
|
|
|
178
248
|
"regex",
|
|
179
249
|
"serde",
|
|
180
250
|
"serde_json",
|
|
251
|
+
"shellexpand",
|
|
181
252
|
"tokio",
|
|
182
253
|
]
|
|
183
254
|
|
|
@@ -233,17 +304,46 @@ dependencies = [
|
|
|
233
304
|
"zmij",
|
|
234
305
|
]
|
|
235
306
|
|
|
307
|
+
[[package]]
|
|
308
|
+
name = "shellexpand"
|
|
309
|
+
version = "3.1.2"
|
|
310
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
311
|
+
checksum = "32824fab5e16e6c4d86dc1ba84489390419a39f97699852b66480bb87d297ed8"
|
|
312
|
+
dependencies = [
|
|
313
|
+
"dirs",
|
|
314
|
+
]
|
|
315
|
+
|
|
236
316
|
[[package]]
|
|
237
317
|
name = "syn"
|
|
238
|
-
version = "2.0.
|
|
318
|
+
version = "2.0.117"
|
|
239
319
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
240
|
-
checksum = "
|
|
320
|
+
checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99"
|
|
241
321
|
dependencies = [
|
|
242
322
|
"proc-macro2",
|
|
243
323
|
"quote",
|
|
244
324
|
"unicode-ident",
|
|
245
325
|
]
|
|
246
326
|
|
|
327
|
+
[[package]]
|
|
328
|
+
name = "thiserror"
|
|
329
|
+
version = "2.0.18"
|
|
330
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
331
|
+
checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4"
|
|
332
|
+
dependencies = [
|
|
333
|
+
"thiserror-impl",
|
|
334
|
+
]
|
|
335
|
+
|
|
336
|
+
[[package]]
|
|
337
|
+
name = "thiserror-impl"
|
|
338
|
+
version = "2.0.18"
|
|
339
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
340
|
+
checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
|
|
341
|
+
dependencies = [
|
|
342
|
+
"proc-macro2",
|
|
343
|
+
"quote",
|
|
344
|
+
"syn",
|
|
345
|
+
]
|
|
346
|
+
|
|
247
347
|
[[package]]
|
|
248
348
|
name = "tokio"
|
|
249
349
|
version = "1.50.0"
|
|
@@ -269,6 +369,12 @@ dependencies = [
|
|
|
269
369
|
"winapi-util",
|
|
270
370
|
]
|
|
271
371
|
|
|
372
|
+
[[package]]
|
|
373
|
+
name = "wasi"
|
|
374
|
+
version = "0.11.1+wasi-snapshot-preview1"
|
|
375
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
376
|
+
checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
|
|
377
|
+
|
|
272
378
|
[[package]]
|
|
273
379
|
name = "winapi-util"
|
|
274
380
|
version = "0.1.11"
|
package/Cargo.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "repokit"
|
|
3
|
-
version = "
|
|
3
|
+
version = "3.0.0"
|
|
4
4
|
edition = "2024"
|
|
5
5
|
|
|
6
6
|
[[bin]]
|
|
@@ -16,3 +16,4 @@ alphanumeric-sort = "1.5.5"
|
|
|
16
16
|
tokio = "1.50.0"
|
|
17
17
|
ignore = "0.4.25"
|
|
18
18
|
regex = { version = "1.12.3", features = ["std", "unicode"] }
|
|
19
|
+
shellexpand = "3.1.2"
|
package/dist/RepoKitConfig.d.mts
CHANGED
|
@@ -5,12 +5,12 @@ import { RepoKitCommand } from "./RepoKitCommand.mjs";
|
|
|
5
5
|
//#region externals/RepoKitConfig.d.ts
|
|
6
6
|
declare class RepoKitConfig {
|
|
7
7
|
project: string;
|
|
8
|
-
|
|
8
|
+
themes: RepoKitTheme[];
|
|
9
9
|
thirdParty: RepoKitCommand[];
|
|
10
10
|
commands: Record<string, ICommand>;
|
|
11
11
|
constructor({
|
|
12
|
-
theme,
|
|
13
12
|
project,
|
|
13
|
+
themes,
|
|
14
14
|
commands,
|
|
15
15
|
thirdParty
|
|
16
16
|
}: IRepoKitConfig);
|
package/dist/RepoKitConfig.mjs
CHANGED
|
@@ -2,11 +2,11 @@ import { RepoKitCommand } from "./RepoKitCommand.mjs";
|
|
|
2
2
|
//#region externals/RepoKitConfig.ts
|
|
3
3
|
var RepoKitConfig = class {
|
|
4
4
|
project;
|
|
5
|
-
|
|
5
|
+
themes;
|
|
6
6
|
thirdParty;
|
|
7
7
|
commands;
|
|
8
|
-
constructor({
|
|
9
|
-
this.
|
|
8
|
+
constructor({ project, themes = [], commands = {}, thirdParty = [] }) {
|
|
9
|
+
this.themes = themes;
|
|
10
10
|
this.project = project;
|
|
11
11
|
this.commands = commands;
|
|
12
12
|
this.thirdParty = thirdParty.map((command) => new RepoKitCommand(command));
|
package/dist/RepoKitTheme.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IRepoKitTheme, RepoKitThemeColors } from "./types.mjs";
|
|
2
2
|
|
|
3
3
|
//#region externals/RepoKitTheme.d.ts
|
|
4
4
|
/**
|
|
@@ -13,35 +13,35 @@ import { RGBString } from "./types.mjs";
|
|
|
13
13
|
*
|
|
14
14
|
* export const RepoKit = new RepoKitConfig({
|
|
15
15
|
* project: "Repokit",
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
16
|
+
* themes: [
|
|
17
|
+
* new RepoKitTheme({
|
|
18
|
+
* name: "my-theme",
|
|
19
|
+
* colors: {
|
|
20
|
+
* prefixColor: "rgb(220, 36, 91)",
|
|
21
|
+
* commandColor: "rgb(220, 36, 36)",
|
|
22
|
+
* subcommandColor: "rgb(220, 131, 36)",
|
|
23
|
+
* argColor: "rgb(220, 205, 36)",
|
|
24
|
+
* descriptionColor: "rgb(95, 28, 71)",
|
|
25
|
+
* errorPrefixColor: "rgb(220, 36, 39)",
|
|
26
|
+
* hightlightColor: "rgb(8, 98, 255)",
|
|
27
|
+
* }
|
|
28
|
+
* }),
|
|
29
|
+
* ]
|
|
25
30
|
* });
|
|
26
31
|
* ```
|
|
32
|
+
*
|
|
33
|
+
* To enable your theme you can run
|
|
34
|
+
* ```bash
|
|
35
|
+
* repokit themes --set my-theme
|
|
36
|
+
* ```
|
|
27
37
|
*/
|
|
28
|
-
declare class RepoKitTheme {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
subcommandColor?: RGBString;
|
|
32
|
-
argColor?: RGBString;
|
|
33
|
-
descriptionColor?: RGBString;
|
|
34
|
-
errorPrefixColor?: RGBString;
|
|
35
|
-
highlightColor?: RGBString;
|
|
38
|
+
declare class RepoKitTheme implements IRepoKitTheme {
|
|
39
|
+
readonly name: string;
|
|
40
|
+
readonly colors: RepoKitThemeColors;
|
|
36
41
|
constructor({
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
argColor,
|
|
41
|
-
descriptionColor,
|
|
42
|
-
errorPrefixColor,
|
|
43
|
-
highlightColor
|
|
44
|
-
}: RepoKitTheme);
|
|
42
|
+
name,
|
|
43
|
+
colors
|
|
44
|
+
}: IRepoKitTheme);
|
|
45
45
|
}
|
|
46
46
|
//#endregion
|
|
47
47
|
export { RepoKitTheme };
|
package/dist/RepoKitTheme.mjs
CHANGED
|
@@ -11,34 +11,34 @@
|
|
|
11
11
|
*
|
|
12
12
|
* export const RepoKit = new RepoKitConfig({
|
|
13
13
|
* project: "Repokit",
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
14
|
+
* themes: [
|
|
15
|
+
* new RepoKitTheme({
|
|
16
|
+
* name: "my-theme",
|
|
17
|
+
* colors: {
|
|
18
|
+
* prefixColor: "rgb(220, 36, 91)",
|
|
19
|
+
* commandColor: "rgb(220, 36, 36)",
|
|
20
|
+
* subcommandColor: "rgb(220, 131, 36)",
|
|
21
|
+
* argColor: "rgb(220, 205, 36)",
|
|
22
|
+
* descriptionColor: "rgb(95, 28, 71)",
|
|
23
|
+
* errorPrefixColor: "rgb(220, 36, 39)",
|
|
24
|
+
* hightlightColor: "rgb(8, 98, 255)",
|
|
25
|
+
* }
|
|
26
|
+
* }),
|
|
27
|
+
* ]
|
|
23
28
|
* });
|
|
24
29
|
* ```
|
|
30
|
+
*
|
|
31
|
+
* To enable your theme you can run
|
|
32
|
+
* ```bash
|
|
33
|
+
* repokit themes --set my-theme
|
|
34
|
+
* ```
|
|
25
35
|
*/
|
|
26
36
|
var RepoKitTheme = class {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
errorPrefixColor;
|
|
33
|
-
highlightColor;
|
|
34
|
-
constructor({ prefixColor, commandColor, subcommandColor, argColor, descriptionColor, errorPrefixColor, highlightColor }) {
|
|
35
|
-
this.prefixColor = prefixColor;
|
|
36
|
-
this.commandColor = commandColor;
|
|
37
|
-
this.subcommandColor = subcommandColor;
|
|
38
|
-
this.argColor = argColor;
|
|
39
|
-
this.descriptionColor = descriptionColor;
|
|
40
|
-
this.errorPrefixColor = errorPrefixColor;
|
|
41
|
-
this.highlightColor = highlightColor;
|
|
37
|
+
name;
|
|
38
|
+
colors;
|
|
39
|
+
constructor({ name, colors }) {
|
|
40
|
+
this.name = name;
|
|
41
|
+
this.colors = colors;
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
//#endregion
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { RepoKitTheme } from "./RepoKitTheme.mjs";
|
|
2
|
-
import { AsyncTask, ICommand, ILocatedCommand, IRepoKitCommand, IRepoKitConfig, RGBString } from "./types.mjs";
|
|
3
|
-
import { RepoKitCommand } from "./RepoKitCommand.mjs";
|
|
4
2
|
import { RepoKitConfig } from "./RepoKitConfig.mjs";
|
|
5
|
-
import {
|
|
6
|
-
|
|
3
|
+
import { AsyncTask, ICommand, ILocatedCommand, IRepoKitCommand, IRepoKitConfig, IRepoKitTheme, RGBString, RepoKitThemeColors } from "./types.mjs";
|
|
4
|
+
import { RepoKitCommand } from "./RepoKitCommand.mjs";
|
|
5
|
+
export { AsyncTask, ICommand, ILocatedCommand, IRepoKitCommand, IRepoKitConfig, IRepoKitTheme, RGBString, RepoKitCommand, RepoKitConfig, RepoKitTheme, RepoKitThemeColors };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { RepoKitCommand } from "./RepoKitCommand.mjs";
|
|
2
2
|
import { RepoKitConfig } from "./RepoKitConfig.mjs";
|
|
3
3
|
import { RepoKitTheme } from "./RepoKitTheme.mjs";
|
|
4
|
-
|
|
5
|
-
export { Green, RepoKitCommand, RepoKitConfig, RepoKitTheme, SeeingRed, TheBlues };
|
|
4
|
+
export { RepoKitCommand, RepoKitConfig, RepoKitTheme };
|
package/dist/types.d.mts
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { RepoKitCommand } from "./RepoKitCommand.mjs";
|
|
1
|
+
import { RepoKitConfig } from "./RepoKitConfig.mjs";
|
|
3
2
|
|
|
4
3
|
//#region externals/types.d.ts
|
|
5
|
-
interface IRepoKitConfig {
|
|
4
|
+
interface IRepoKitConfig extends Omit<Partial<RepoKitConfig>, "project"> {
|
|
6
5
|
project: string;
|
|
7
|
-
thirdParty?: RepoKitCommand[];
|
|
8
|
-
commands?: Record<string, ICommand>;
|
|
9
|
-
theme?: RepoKitTheme;
|
|
10
6
|
}
|
|
11
7
|
interface IRepoKitCommand {
|
|
12
8
|
name: string;
|
|
@@ -25,5 +21,18 @@ interface ILocatedCommand extends IRepoKitCommand {
|
|
|
25
21
|
type AsyncTask<T> = () => Promise<T>;
|
|
26
22
|
type OptionalSpace = " " | "";
|
|
27
23
|
type RGBString = `rgb(${number},${OptionalSpace}${number},${OptionalSpace}${number})`;
|
|
24
|
+
interface RepoKitThemeColors {
|
|
25
|
+
prefixColor?: RGBString;
|
|
26
|
+
commandColor?: RGBString;
|
|
27
|
+
subcommandColor?: RGBString;
|
|
28
|
+
argColor?: RGBString;
|
|
29
|
+
descriptionColor?: RGBString;
|
|
30
|
+
errorPrefixColor?: RGBString;
|
|
31
|
+
highlightColor?: RGBString;
|
|
32
|
+
}
|
|
33
|
+
interface IRepoKitTheme {
|
|
34
|
+
name: string;
|
|
35
|
+
colors: RepoKitThemeColors;
|
|
36
|
+
}
|
|
28
37
|
//#endregion
|
|
29
|
-
export { AsyncTask, ICommand, ILocatedCommand, IRepoKitCommand, IRepoKitConfig, RGBString };
|
|
38
|
+
export { AsyncTask, ICommand, ILocatedCommand, IRepoKitCommand, IRepoKitConfig, IRepoKitTheme, RGBString, RepoKitThemeColors };
|
|
@@ -5,16 +5,16 @@ import type { ICommand, IRepoKitConfig } from "./types";
|
|
|
5
5
|
|
|
6
6
|
export class RepoKitConfig {
|
|
7
7
|
project: string;
|
|
8
|
-
|
|
8
|
+
themes: RepoKitTheme[];
|
|
9
9
|
thirdParty: RepoKitCommand[];
|
|
10
10
|
commands: Record<string, ICommand>;
|
|
11
11
|
constructor({
|
|
12
|
-
theme,
|
|
13
12
|
project,
|
|
13
|
+
themes = [],
|
|
14
14
|
commands = {},
|
|
15
15
|
thirdParty = [],
|
|
16
16
|
}: IRepoKitConfig) {
|
|
17
|
-
this.
|
|
17
|
+
this.themes = themes;
|
|
18
18
|
this.project = project;
|
|
19
19
|
this.commands = commands;
|
|
20
20
|
this.thirdParty = thirdParty.map(command => new RepoKitCommand(command));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IRepoKitTheme, RepoKitThemeColors } from "./types";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Repokit Theme
|
|
@@ -12,41 +12,33 @@ import type { RGBString } from "./types";
|
|
|
12
12
|
*
|
|
13
13
|
* export const RepoKit = new RepoKitConfig({
|
|
14
14
|
* project: "Repokit",
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
15
|
+
* themes: [
|
|
16
|
+
* new RepoKitTheme({
|
|
17
|
+
* name: "my-theme",
|
|
18
|
+
* colors: {
|
|
19
|
+
* prefixColor: "rgb(220, 36, 91)",
|
|
20
|
+
* commandColor: "rgb(220, 36, 36)",
|
|
21
|
+
* subcommandColor: "rgb(220, 131, 36)",
|
|
22
|
+
* argColor: "rgb(220, 205, 36)",
|
|
23
|
+
* descriptionColor: "rgb(95, 28, 71)",
|
|
24
|
+
* errorPrefixColor: "rgb(220, 36, 39)",
|
|
25
|
+
* hightlightColor: "rgb(8, 98, 255)",
|
|
26
|
+
* }
|
|
27
|
+
* }),
|
|
28
|
+
* ]
|
|
24
29
|
* });
|
|
25
30
|
* ```
|
|
31
|
+
*
|
|
32
|
+
* To enable your theme you can run
|
|
33
|
+
* ```bash
|
|
34
|
+
* repokit themes --set my-theme
|
|
35
|
+
* ```
|
|
26
36
|
*/
|
|
27
|
-
export class RepoKitTheme {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
errorPrefixColor?: RGBString;
|
|
34
|
-
highlightColor?: RGBString;
|
|
35
|
-
constructor({
|
|
36
|
-
prefixColor,
|
|
37
|
-
commandColor,
|
|
38
|
-
subcommandColor,
|
|
39
|
-
argColor,
|
|
40
|
-
descriptionColor,
|
|
41
|
-
errorPrefixColor,
|
|
42
|
-
highlightColor,
|
|
43
|
-
}: RepoKitTheme) {
|
|
44
|
-
this.prefixColor = prefixColor;
|
|
45
|
-
this.commandColor = commandColor;
|
|
46
|
-
this.subcommandColor = subcommandColor;
|
|
47
|
-
this.argColor = argColor;
|
|
48
|
-
this.descriptionColor = descriptionColor;
|
|
49
|
-
this.errorPrefixColor = errorPrefixColor;
|
|
50
|
-
this.highlightColor = highlightColor;
|
|
37
|
+
export class RepoKitTheme implements IRepoKitTheme {
|
|
38
|
+
public readonly name: string;
|
|
39
|
+
public readonly colors: RepoKitThemeColors;
|
|
40
|
+
constructor({ name, colors }: IRepoKitTheme) {
|
|
41
|
+
this.name = name;
|
|
42
|
+
this.colors = colors;
|
|
51
43
|
}
|
|
52
44
|
}
|
package/externals/index.ts
CHANGED
package/externals/types.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { RepoKitTheme } from "./RepoKitTheme";
|
|
1
|
+
import type { RepoKitConfig } from "./RepoKitConfig";
|
|
3
2
|
|
|
4
|
-
export interface IRepoKitConfig
|
|
3
|
+
export interface IRepoKitConfig extends Omit<
|
|
4
|
+
Partial<RepoKitConfig>,
|
|
5
|
+
"project"
|
|
6
|
+
> {
|
|
5
7
|
project: string;
|
|
6
|
-
thirdParty?: RepoKitCommand[];
|
|
7
|
-
commands?: Record<string, ICommand>;
|
|
8
|
-
theme?: RepoKitTheme;
|
|
9
8
|
}
|
|
10
9
|
|
|
11
10
|
export interface IRepoKitCommand {
|
|
@@ -31,3 +30,18 @@ type OptionalSpace = " " | "";
|
|
|
31
30
|
|
|
32
31
|
export type RGBString =
|
|
33
32
|
`rgb(${number},${OptionalSpace}${number},${OptionalSpace}${number})`;
|
|
33
|
+
|
|
34
|
+
export interface RepoKitThemeColors {
|
|
35
|
+
prefixColor?: RGBString;
|
|
36
|
+
commandColor?: RGBString;
|
|
37
|
+
subcommandColor?: RGBString;
|
|
38
|
+
argColor?: RGBString;
|
|
39
|
+
descriptionColor?: RGBString;
|
|
40
|
+
errorPrefixColor?: RGBString;
|
|
41
|
+
highlightColor?: RGBString;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface IRepoKitTheme {
|
|
45
|
+
name: string;
|
|
46
|
+
colors: RepoKitThemeColors;
|
|
47
|
+
}
|
package/installation/install.sh
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
CURRENT_VERSION="
|
|
1
|
+
CURRENT_VERSION="3.0.0"
|
|
2
2
|
CWD=$(pwd)
|
|
3
3
|
|
|
4
4
|
REPLACEMENT="/node_modules"
|
|
@@ -36,8 +36,14 @@ if [ -f .repokit ]; then
|
|
|
36
36
|
fi
|
|
37
37
|
fi
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
DOT_FILE=".repokit"
|
|
40
|
+
TEMP_FILE=".repokit_tmp";
|
|
41
|
+
|
|
42
|
+
touch "$DOT_FILE"
|
|
43
|
+
|
|
44
|
+
printf "$CURRENT_VERSION\n" > "$TEMP_FILE"
|
|
45
|
+
tail +2 "$DOT_FILE" >> "$TEMP_FILE"
|
|
46
|
+
mv "$TEMP_FILE" "$DOT_FILE"
|
|
41
47
|
|
|
42
48
|
|
|
43
49
|
cd $CWD
|