@semaphore-protocol/cli 4.0.0-alpha.7 → 4.0.0-beta
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.js +10 -15
- package/package.json +16 -17
- package/src/getGroupIds.ts +0 -4
- package/src/index.ts +4 -4
- package/src/spinner.ts +5 -8
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @module @semaphore-protocol/cli
|
|
5
|
-
* @version 4.0.0-
|
|
5
|
+
* @version 4.0.0-beta
|
|
6
6
|
* @file A command line tool to set up your Semaphore project and get group data.
|
|
7
7
|
* @copyright Ethereum Foundation 2024
|
|
8
8
|
* @license MIT
|
|
@@ -56,14 +56,13 @@ async function checkLatestVersion(currentVersion) {
|
|
|
56
56
|
|
|
57
57
|
class Spinner {
|
|
58
58
|
constructor(text) {
|
|
59
|
-
this.text = text;
|
|
60
|
-
}
|
|
61
|
-
start() {
|
|
62
|
-
console.info("");
|
|
63
59
|
this.ora = ora({
|
|
64
|
-
text
|
|
60
|
+
text,
|
|
65
61
|
indent: 1
|
|
66
|
-
})
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
start() {
|
|
65
|
+
this.ora.start();
|
|
67
66
|
}
|
|
68
67
|
stop() {
|
|
69
68
|
this.ora.stop();
|
|
@@ -96,10 +95,6 @@ async function getGroupIds(network) {
|
|
|
96
95
|
return null;
|
|
97
96
|
}
|
|
98
97
|
}
|
|
99
|
-
if (groupIds.length === 0) {
|
|
100
|
-
console.info(`\n ${logSymbols.info}`, "info: there are no groups in this network\n");
|
|
101
|
-
return null;
|
|
102
|
-
}
|
|
103
98
|
return groupIds;
|
|
104
99
|
}
|
|
105
100
|
|
|
@@ -233,7 +228,7 @@ program
|
|
|
233
228
|
return;
|
|
234
229
|
}
|
|
235
230
|
const groupIds = await getGroupIds(network);
|
|
236
|
-
if (groupIds ===
|
|
231
|
+
if (!groupIds || groupIds.length === 0) {
|
|
237
232
|
console.info(`\n ${logSymbols.info}`, `info: there are no groups on the '${network}' network\n`);
|
|
238
233
|
return;
|
|
239
234
|
}
|
|
@@ -258,7 +253,7 @@ program
|
|
|
258
253
|
}
|
|
259
254
|
if (!groupId) {
|
|
260
255
|
const groupIds = await getGroupIds(network);
|
|
261
|
-
if (groupIds ===
|
|
256
|
+
if (!groupIds || groupIds.length === 0) {
|
|
262
257
|
console.info(`\n ${logSymbols.info}`, `info: there are no groups on the '${network}' network\n`);
|
|
263
258
|
return;
|
|
264
259
|
}
|
|
@@ -312,7 +307,7 @@ program
|
|
|
312
307
|
}
|
|
313
308
|
if (!groupId) {
|
|
314
309
|
const groupIds = await getGroupIds(network);
|
|
315
|
-
if (groupIds ===
|
|
310
|
+
if (!groupIds || groupIds.length === 0) {
|
|
316
311
|
console.info(`\n ${logSymbols.info}`, `info: there are no groups on the '${network}' network\n`);
|
|
317
312
|
return;
|
|
318
313
|
}
|
|
@@ -364,7 +359,7 @@ program
|
|
|
364
359
|
}
|
|
365
360
|
if (!groupId) {
|
|
366
361
|
const groupIds = await getGroupIds(network);
|
|
367
|
-
if (groupIds ===
|
|
362
|
+
if (!groupIds || groupIds.length === 0) {
|
|
368
363
|
console.info(`\n ${logSymbols.info}`, `info: there are no groups on the '${network}' network\n`);
|
|
369
364
|
return;
|
|
370
365
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semaphore-protocol/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.0-
|
|
4
|
+
"version": "4.0.0-beta",
|
|
5
5
|
"description": "A command line tool to set up your Semaphore project and get group data.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
@@ -31,26 +31,25 @@
|
|
|
31
31
|
"access": "public"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@types/
|
|
35
|
-
"@types/
|
|
36
|
-
"@types/
|
|
37
|
-
"@types/
|
|
38
|
-
"@types/semver": "^7.3.13",
|
|
34
|
+
"@types/figlet": "^1.5.8",
|
|
35
|
+
"@types/inquirer": "^9.0.7",
|
|
36
|
+
"@types/pacote": "^11.1.8",
|
|
37
|
+
"@types/semver": "^7.5.8",
|
|
39
38
|
"rollup-plugin-cleanup": "^3.2.1",
|
|
40
39
|
"rollup-plugin-typescript2": "^0.36.0"
|
|
41
40
|
},
|
|
42
41
|
"dependencies": {
|
|
43
|
-
"@semaphore-protocol/data": "4.0.0-
|
|
44
|
-
"axios": "^1.
|
|
45
|
-
"boxen": "^7.
|
|
46
|
-
"chalk": "^5.
|
|
47
|
-
"commander": "^
|
|
42
|
+
"@semaphore-protocol/data": "4.0.0-beta",
|
|
43
|
+
"axios": "^1.6.7",
|
|
44
|
+
"boxen": "^7.1.1",
|
|
45
|
+
"chalk": "^5.3.0",
|
|
46
|
+
"commander": "^12.0.0",
|
|
48
47
|
"decompress": "^4.2.1",
|
|
49
|
-
"figlet": "^1.
|
|
50
|
-
"inquirer": "^9.
|
|
51
|
-
"log-symbols": "^
|
|
52
|
-
"ora": "^
|
|
53
|
-
"pacote": "^
|
|
54
|
-
"semver": "^7.
|
|
48
|
+
"figlet": "^1.7.0",
|
|
49
|
+
"inquirer": "^9.2.15",
|
|
50
|
+
"log-symbols": "^6.0.0",
|
|
51
|
+
"ora": "^8.0.1",
|
|
52
|
+
"pacote": "^17.0.6",
|
|
53
|
+
"semver": "^7.6.0"
|
|
55
54
|
}
|
|
56
55
|
}
|
package/src/getGroupIds.ts
CHANGED
|
@@ -34,9 +34,5 @@ export default async function getGroupIds(network): Promise<string[]> {
|
|
|
34
34
|
return null
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
if (groupIds.length === 0) {
|
|
38
|
-
console.info(`\n ${logSymbols.info}`, "info: there are no groups in this network\n")
|
|
39
|
-
return null
|
|
40
|
-
}
|
|
41
37
|
return groupIds
|
|
42
38
|
}
|
package/src/index.ts
CHANGED
|
@@ -132,7 +132,7 @@ program
|
|
|
132
132
|
|
|
133
133
|
const groupIds = await getGroupIds(network)
|
|
134
134
|
|
|
135
|
-
if (groupIds ===
|
|
135
|
+
if (!groupIds || groupIds.length === 0) {
|
|
136
136
|
console.info(`\n ${logSymbols.info}`, `info: there are no groups on the '${network}' network\n`)
|
|
137
137
|
return
|
|
138
138
|
}
|
|
@@ -163,7 +163,7 @@ program
|
|
|
163
163
|
if (!groupId) {
|
|
164
164
|
const groupIds = await getGroupIds(network)
|
|
165
165
|
|
|
166
|
-
if (groupIds ===
|
|
166
|
+
if (!groupIds || groupIds.length === 0) {
|
|
167
167
|
console.info(`\n ${logSymbols.info}`, `info: there are no groups on the '${network}' network\n`)
|
|
168
168
|
return
|
|
169
169
|
}
|
|
@@ -231,7 +231,7 @@ program
|
|
|
231
231
|
if (!groupId) {
|
|
232
232
|
const groupIds = await getGroupIds(network)
|
|
233
233
|
|
|
234
|
-
if (groupIds ===
|
|
234
|
+
if (!groupIds || groupIds.length === 0) {
|
|
235
235
|
console.info(`\n ${logSymbols.info}`, `info: there are no groups on the '${network}' network\n`)
|
|
236
236
|
return
|
|
237
237
|
}
|
|
@@ -297,7 +297,7 @@ program
|
|
|
297
297
|
if (!groupId) {
|
|
298
298
|
const groupIds = await getGroupIds(network)
|
|
299
299
|
|
|
300
|
-
if (groupIds ===
|
|
300
|
+
if (!groupIds || groupIds.length === 0) {
|
|
301
301
|
console.info(`\n ${logSymbols.info}`, `info: there are no groups on the '${network}' network\n`)
|
|
302
302
|
return
|
|
303
303
|
}
|
package/src/spinner.ts
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import ora, { Ora } from "ora"
|
|
2
2
|
|
|
3
3
|
export default class Spinner {
|
|
4
|
-
private text: string
|
|
5
4
|
private ora: Ora
|
|
6
5
|
|
|
7
6
|
constructor(text: string) {
|
|
8
|
-
this.
|
|
7
|
+
this.ora = ora({
|
|
8
|
+
text,
|
|
9
|
+
indent: 1
|
|
10
|
+
})
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
start() {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
this.ora = ora({
|
|
15
|
-
text: this.text,
|
|
16
|
-
indent: 1
|
|
17
|
-
}).start()
|
|
14
|
+
this.ora.start()
|
|
18
15
|
}
|
|
19
16
|
|
|
20
17
|
stop() {
|