@dockstat/repo-cli 1.0.1 → 1.0.3
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.
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dockstat/repo-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "A CLI helper for administering DockStat Repositories",
|
|
5
5
|
"module": "src/index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -10,21 +10,24 @@
|
|
|
10
10
|
"README.md"
|
|
11
11
|
],
|
|
12
12
|
"bin": {
|
|
13
|
-
"dockstat-repo": "./dist/
|
|
13
|
+
"dockstat-repo": "./dist/dockstat-repo-cli"
|
|
14
|
+
},
|
|
15
|
+
"exports": {
|
|
16
|
+
"./types": "./src/types.ts"
|
|
14
17
|
},
|
|
15
18
|
"scripts": {
|
|
16
|
-
"build": "bun build --target=bun --compile --outfile=dist/
|
|
17
|
-
"
|
|
19
|
+
"build": "bun build --target=bun --compile --outfile=dist/dockstat-repo-cli src/index.ts",
|
|
20
|
+
"publish": "bun run build && bun pm pack --destination ./dist && npm publish --access public ./dist/*.tgz ; rm -r ./dist"
|
|
18
21
|
},
|
|
19
22
|
"devDependencies": {
|
|
20
23
|
"@types/bun": "latest",
|
|
21
|
-
"@dockstat/typings": "
|
|
24
|
+
"@dockstat/typings": "1.1.0"
|
|
22
25
|
},
|
|
23
26
|
"peerDependencies": {
|
|
24
27
|
"typescript": "^5"
|
|
25
28
|
},
|
|
26
29
|
"dependencies": {
|
|
27
|
-
"@dockstat/utils": "
|
|
30
|
+
"@dockstat/utils": "1.0.0",
|
|
28
31
|
"@commander-js/extra-typings": "^14.0.0",
|
|
29
32
|
"commander": "^14.0.2",
|
|
30
33
|
"ajv": "^8.17.1",
|
package/src/commands/badges.ts
CHANGED
|
@@ -32,43 +32,54 @@ export const badgesCommand = new Command("badges")
|
|
|
32
32
|
|
|
33
33
|
const badges: { name: string; svg: string }[] = []
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
// Right after `const badges: { name: string; svg: string }[] = []`
|
|
36
|
+
|
|
37
|
+
type CountBadgeKey = "plugins" | "themes" | "stacks"
|
|
38
|
+
|
|
39
|
+
const countBadgeConfigs: {
|
|
40
|
+
optionKey: CountBadgeKey
|
|
41
|
+
name: string
|
|
42
|
+
label: string
|
|
43
|
+
color: string
|
|
44
|
+
icon: IconName
|
|
45
|
+
getCount: () => number
|
|
46
|
+
}[] = [
|
|
47
|
+
{
|
|
48
|
+
optionKey: "plugins",
|
|
38
49
|
name: "plugins",
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
})
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (options.themes) {
|
|
50
|
-
const count = content.themes.length
|
|
51
|
-
badges.push({
|
|
50
|
+
label: "plugins",
|
|
51
|
+
color: COLORS.blue,
|
|
52
|
+
icon: "puzzle",
|
|
53
|
+
getCount: () => content.plugins.length,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
optionKey: "themes",
|
|
52
57
|
name: "themes",
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
})
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (options.stacks) {
|
|
64
|
-
const count = content.stacks.length
|
|
65
|
-
badges.push({
|
|
58
|
+
label: "themes",
|
|
59
|
+
color: COLORS.purple,
|
|
60
|
+
icon: "palette",
|
|
61
|
+
getCount: () => content.themes.length,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
optionKey: "stacks",
|
|
66
65
|
name: "stacks",
|
|
66
|
+
label: "stacks",
|
|
67
|
+
color: COLORS.teal,
|
|
68
|
+
icon: "layers",
|
|
69
|
+
getCount: () => content.stacks.length,
|
|
70
|
+
},
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
for (const cfg of countBadgeConfigs) {
|
|
74
|
+
if (!options[cfg.optionKey]) continue
|
|
75
|
+
const count = cfg.getCount()
|
|
76
|
+
badges.push({
|
|
77
|
+
name: cfg.name,
|
|
67
78
|
svg: createBadge({
|
|
68
|
-
label:
|
|
79
|
+
label: cfg.label,
|
|
69
80
|
message: count.toString(),
|
|
70
|
-
color: count > 0 ?
|
|
71
|
-
icon:
|
|
81
|
+
color: count > 0 ? cfg.color : COLORS.lightgrey,
|
|
82
|
+
icon: cfg.icon,
|
|
72
83
|
style,
|
|
73
84
|
}),
|
|
74
85
|
})
|
package/src/commands/serve.ts
CHANGED
package/src/types.ts
CHANGED