byterover-cli 2.1.0 → 2.1.1
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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Hook } from '@oclif/core';
|
|
2
|
+
import { execSync } from 'node:child_process';
|
|
2
3
|
/**
|
|
3
4
|
* Check interval for update notifications (1 hour)
|
|
4
5
|
*/
|
|
@@ -28,10 +29,17 @@ export type UpdateNotifierDeps = {
|
|
|
28
29
|
stdio: 'inherit';
|
|
29
30
|
}) => void;
|
|
30
31
|
exitFn: (code: number) => never;
|
|
32
|
+
isNpmGlobalInstalled: boolean;
|
|
31
33
|
isTTY: boolean;
|
|
32
34
|
log: (message: string) => void;
|
|
33
35
|
notifier: NarrowedUpdateNotifier;
|
|
34
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* Check whether byterover-cli is installed as a npm global package.
|
|
39
|
+
* @param execSyncFn
|
|
40
|
+
* @returns false for other installation methods.
|
|
41
|
+
*/
|
|
42
|
+
export declare const isNpmGlobalInstall: (execSyncFn: typeof execSync) => boolean;
|
|
35
43
|
/**
|
|
36
44
|
* Core update notification logic, extracted for testability
|
|
37
45
|
*/
|
|
@@ -5,12 +5,26 @@ import updateNotifier from 'update-notifier';
|
|
|
5
5
|
* Check interval for update notifications (1 hour)
|
|
6
6
|
*/
|
|
7
7
|
export const UPDATE_CHECK_INTERVAL_MS = 1000 * 60 * 60;
|
|
8
|
+
/**
|
|
9
|
+
* Check whether byterover-cli is installed as a npm global package.
|
|
10
|
+
* @param execSyncFn
|
|
11
|
+
* @returns false for other installation methods.
|
|
12
|
+
*/
|
|
13
|
+
export const isNpmGlobalInstall = (execSyncFn) => {
|
|
14
|
+
try {
|
|
15
|
+
execSyncFn('npm list -g byterover-cli --depth=0', { stdio: 'ignore' });
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
8
22
|
/**
|
|
9
23
|
* Core update notification logic, extracted for testability
|
|
10
24
|
*/
|
|
11
25
|
export async function handleUpdateNotification(deps) {
|
|
12
|
-
const { confirmPrompt, execSyncFn, exitFn, isTTY, log, notifier } = deps;
|
|
13
|
-
if (!notifier.update || !isTTY) {
|
|
26
|
+
const { confirmPrompt, execSyncFn, exitFn, isNpmGlobalInstalled, isTTY, log, notifier } = deps;
|
|
27
|
+
if (!isNpmGlobalInstalled || !notifier.update || !isTTY) {
|
|
14
28
|
return;
|
|
15
29
|
}
|
|
16
30
|
const { current, latest } = notifier.update;
|
|
@@ -40,10 +54,12 @@ export async function handleUpdateNotification(deps) {
|
|
|
40
54
|
const hook = async function () {
|
|
41
55
|
const pkgInfo = { name: this.config.name, version: this.config.version };
|
|
42
56
|
const notifier = updateNotifier({ pkg: pkgInfo, updateCheckInterval: UPDATE_CHECK_INTERVAL_MS });
|
|
57
|
+
const isNpmGlobalInstalled = isNpmGlobalInstall(execSync);
|
|
43
58
|
await handleUpdateNotification({
|
|
44
59
|
confirmPrompt: confirm,
|
|
45
60
|
execSyncFn: execSync,
|
|
46
61
|
exitFn: process.exit,
|
|
62
|
+
isNpmGlobalInstalled,
|
|
47
63
|
isTTY: process.stdout.isTTY ?? false,
|
|
48
64
|
log: this.log.bind(this),
|
|
49
65
|
notifier,
|
package/oclif.manifest.json
CHANGED
|
@@ -997,104 +997,6 @@
|
|
|
997
997
|
"switch.js"
|
|
998
998
|
]
|
|
999
999
|
},
|
|
1000
|
-
"space:list": {
|
|
1001
|
-
"aliases": [],
|
|
1002
|
-
"args": {},
|
|
1003
|
-
"description": "List all teams and spaces",
|
|
1004
|
-
"examples": [
|
|
1005
|
-
"<%= config.bin %> space list",
|
|
1006
|
-
"<%= config.bin %> space list --format json"
|
|
1007
|
-
],
|
|
1008
|
-
"flags": {
|
|
1009
|
-
"format": {
|
|
1010
|
-
"char": "f",
|
|
1011
|
-
"description": "Output format",
|
|
1012
|
-
"name": "format",
|
|
1013
|
-
"default": "text",
|
|
1014
|
-
"hasDynamicHelp": false,
|
|
1015
|
-
"multiple": false,
|
|
1016
|
-
"options": [
|
|
1017
|
-
"text",
|
|
1018
|
-
"json"
|
|
1019
|
-
],
|
|
1020
|
-
"type": "option"
|
|
1021
|
-
}
|
|
1022
|
-
},
|
|
1023
|
-
"hasDynamicHelp": false,
|
|
1024
|
-
"hiddenAliases": [],
|
|
1025
|
-
"id": "space:list",
|
|
1026
|
-
"pluginAlias": "byterover-cli",
|
|
1027
|
-
"pluginName": "byterover-cli",
|
|
1028
|
-
"pluginType": "core",
|
|
1029
|
-
"strict": true,
|
|
1030
|
-
"enableJsonFlag": false,
|
|
1031
|
-
"isESM": true,
|
|
1032
|
-
"relativePath": [
|
|
1033
|
-
"dist",
|
|
1034
|
-
"oclif",
|
|
1035
|
-
"commands",
|
|
1036
|
-
"space",
|
|
1037
|
-
"list.js"
|
|
1038
|
-
]
|
|
1039
|
-
},
|
|
1040
|
-
"space:switch": {
|
|
1041
|
-
"aliases": [],
|
|
1042
|
-
"args": {},
|
|
1043
|
-
"description": "Switch to a different space",
|
|
1044
|
-
"examples": [
|
|
1045
|
-
"<%= config.bin %> space switch --team acme --name my-space",
|
|
1046
|
-
"<%= config.bin %> space switch --team acme --name my-space --format json"
|
|
1047
|
-
],
|
|
1048
|
-
"flags": {
|
|
1049
|
-
"format": {
|
|
1050
|
-
"char": "f",
|
|
1051
|
-
"description": "Output format",
|
|
1052
|
-
"name": "format",
|
|
1053
|
-
"default": "text",
|
|
1054
|
-
"hasDynamicHelp": false,
|
|
1055
|
-
"multiple": false,
|
|
1056
|
-
"options": [
|
|
1057
|
-
"text",
|
|
1058
|
-
"json"
|
|
1059
|
-
],
|
|
1060
|
-
"type": "option"
|
|
1061
|
-
},
|
|
1062
|
-
"name": {
|
|
1063
|
-
"char": "n",
|
|
1064
|
-
"description": "Name of the space to switch to",
|
|
1065
|
-
"name": "name",
|
|
1066
|
-
"required": true,
|
|
1067
|
-
"hasDynamicHelp": false,
|
|
1068
|
-
"multiple": false,
|
|
1069
|
-
"type": "option"
|
|
1070
|
-
},
|
|
1071
|
-
"team": {
|
|
1072
|
-
"char": "t",
|
|
1073
|
-
"description": "Team name",
|
|
1074
|
-
"name": "team",
|
|
1075
|
-
"required": true,
|
|
1076
|
-
"hasDynamicHelp": false,
|
|
1077
|
-
"multiple": false,
|
|
1078
|
-
"type": "option"
|
|
1079
|
-
}
|
|
1080
|
-
},
|
|
1081
|
-
"hasDynamicHelp": false,
|
|
1082
|
-
"hiddenAliases": [],
|
|
1083
|
-
"id": "space:switch",
|
|
1084
|
-
"pluginAlias": "byterover-cli",
|
|
1085
|
-
"pluginName": "byterover-cli",
|
|
1086
|
-
"pluginType": "core",
|
|
1087
|
-
"strict": true,
|
|
1088
|
-
"enableJsonFlag": false,
|
|
1089
|
-
"isESM": true,
|
|
1090
|
-
"relativePath": [
|
|
1091
|
-
"dist",
|
|
1092
|
-
"oclif",
|
|
1093
|
-
"commands",
|
|
1094
|
-
"space",
|
|
1095
|
-
"switch.js"
|
|
1096
|
-
]
|
|
1097
|
-
},
|
|
1098
1000
|
"providers:connect": {
|
|
1099
1001
|
"aliases": [],
|
|
1100
1002
|
"args": {
|
|
@@ -1532,7 +1434,105 @@
|
|
|
1532
1434
|
"registry",
|
|
1533
1435
|
"remove.js"
|
|
1534
1436
|
]
|
|
1437
|
+
},
|
|
1438
|
+
"space:list": {
|
|
1439
|
+
"aliases": [],
|
|
1440
|
+
"args": {},
|
|
1441
|
+
"description": "List all teams and spaces",
|
|
1442
|
+
"examples": [
|
|
1443
|
+
"<%= config.bin %> space list",
|
|
1444
|
+
"<%= config.bin %> space list --format json"
|
|
1445
|
+
],
|
|
1446
|
+
"flags": {
|
|
1447
|
+
"format": {
|
|
1448
|
+
"char": "f",
|
|
1449
|
+
"description": "Output format",
|
|
1450
|
+
"name": "format",
|
|
1451
|
+
"default": "text",
|
|
1452
|
+
"hasDynamicHelp": false,
|
|
1453
|
+
"multiple": false,
|
|
1454
|
+
"options": [
|
|
1455
|
+
"text",
|
|
1456
|
+
"json"
|
|
1457
|
+
],
|
|
1458
|
+
"type": "option"
|
|
1459
|
+
}
|
|
1460
|
+
},
|
|
1461
|
+
"hasDynamicHelp": false,
|
|
1462
|
+
"hiddenAliases": [],
|
|
1463
|
+
"id": "space:list",
|
|
1464
|
+
"pluginAlias": "byterover-cli",
|
|
1465
|
+
"pluginName": "byterover-cli",
|
|
1466
|
+
"pluginType": "core",
|
|
1467
|
+
"strict": true,
|
|
1468
|
+
"enableJsonFlag": false,
|
|
1469
|
+
"isESM": true,
|
|
1470
|
+
"relativePath": [
|
|
1471
|
+
"dist",
|
|
1472
|
+
"oclif",
|
|
1473
|
+
"commands",
|
|
1474
|
+
"space",
|
|
1475
|
+
"list.js"
|
|
1476
|
+
]
|
|
1477
|
+
},
|
|
1478
|
+
"space:switch": {
|
|
1479
|
+
"aliases": [],
|
|
1480
|
+
"args": {},
|
|
1481
|
+
"description": "Switch to a different space",
|
|
1482
|
+
"examples": [
|
|
1483
|
+
"<%= config.bin %> space switch --team acme --name my-space",
|
|
1484
|
+
"<%= config.bin %> space switch --team acme --name my-space --format json"
|
|
1485
|
+
],
|
|
1486
|
+
"flags": {
|
|
1487
|
+
"format": {
|
|
1488
|
+
"char": "f",
|
|
1489
|
+
"description": "Output format",
|
|
1490
|
+
"name": "format",
|
|
1491
|
+
"default": "text",
|
|
1492
|
+
"hasDynamicHelp": false,
|
|
1493
|
+
"multiple": false,
|
|
1494
|
+
"options": [
|
|
1495
|
+
"text",
|
|
1496
|
+
"json"
|
|
1497
|
+
],
|
|
1498
|
+
"type": "option"
|
|
1499
|
+
},
|
|
1500
|
+
"name": {
|
|
1501
|
+
"char": "n",
|
|
1502
|
+
"description": "Name of the space to switch to",
|
|
1503
|
+
"name": "name",
|
|
1504
|
+
"required": true,
|
|
1505
|
+
"hasDynamicHelp": false,
|
|
1506
|
+
"multiple": false,
|
|
1507
|
+
"type": "option"
|
|
1508
|
+
},
|
|
1509
|
+
"team": {
|
|
1510
|
+
"char": "t",
|
|
1511
|
+
"description": "Team name",
|
|
1512
|
+
"name": "team",
|
|
1513
|
+
"required": true,
|
|
1514
|
+
"hasDynamicHelp": false,
|
|
1515
|
+
"multiple": false,
|
|
1516
|
+
"type": "option"
|
|
1517
|
+
}
|
|
1518
|
+
},
|
|
1519
|
+
"hasDynamicHelp": false,
|
|
1520
|
+
"hiddenAliases": [],
|
|
1521
|
+
"id": "space:switch",
|
|
1522
|
+
"pluginAlias": "byterover-cli",
|
|
1523
|
+
"pluginName": "byterover-cli",
|
|
1524
|
+
"pluginType": "core",
|
|
1525
|
+
"strict": true,
|
|
1526
|
+
"enableJsonFlag": false,
|
|
1527
|
+
"isESM": true,
|
|
1528
|
+
"relativePath": [
|
|
1529
|
+
"dist",
|
|
1530
|
+
"oclif",
|
|
1531
|
+
"commands",
|
|
1532
|
+
"space",
|
|
1533
|
+
"switch.js"
|
|
1534
|
+
]
|
|
1535
1535
|
}
|
|
1536
1536
|
},
|
|
1537
|
-
"version": "2.1.
|
|
1537
|
+
"version": "2.1.1"
|
|
1538
1538
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "byterover-cli",
|
|
3
3
|
"description": "ByteRover's CLI",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.1",
|
|
5
5
|
"author": "ByteRover",
|
|
6
6
|
"bin": {
|
|
7
7
|
"brv": "./bin/run.js"
|
|
@@ -154,6 +154,9 @@
|
|
|
154
154
|
"s3": {
|
|
155
155
|
"host": "https://storage.googleapis.com/brv-releases"
|
|
156
156
|
},
|
|
157
|
+
"autoupdate": {
|
|
158
|
+
"debounce": 1
|
|
159
|
+
},
|
|
157
160
|
"node": {
|
|
158
161
|
"version": "24.13.1"
|
|
159
162
|
}
|