cc-cast 1.3.7 → 1.3.8
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 +3 -0
- package/package.json +4 -2
- package/src/index.ts +4 -0
package/dist/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import { join, dirname } from "path";
|
|
|
12
12
|
import { fileURLToPath } from "url";
|
|
13
13
|
import { t, setLocale, getLocale } from "./i18n/index.js";
|
|
14
14
|
import Enquirer from "enquirer";
|
|
15
|
+
import updateNotifier from "update-notifier";
|
|
15
16
|
const Select = Enquirer.Select;
|
|
16
17
|
function createSelect(options) {
|
|
17
18
|
const prompt = new Select(options);
|
|
@@ -42,6 +43,8 @@ function createSelect(options) {
|
|
|
42
43
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
43
44
|
const packageJsonPath = join(__dirname, "..", "package.json");
|
|
44
45
|
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
46
|
+
const notifier = updateNotifier({ pkg: packageJson, updateCheckInterval: 1000 * 60 * 60 * 24 });
|
|
47
|
+
notifier.notify({ isGlobal: true, defer: true });
|
|
45
48
|
const program = new Command();
|
|
46
49
|
program
|
|
47
50
|
.name("ccc")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-cast",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.8",
|
|
4
4
|
"description": "Claude Code Model Switcher - 快速切换 Claude Code 自定义模型配置",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -27,11 +27,13 @@
|
|
|
27
27
|
"better-sqlite3": "^12.8.0",
|
|
28
28
|
"chalk": "^5.6.2",
|
|
29
29
|
"commander": "^14.0.3",
|
|
30
|
-
"enquirer": "^2.4.1"
|
|
30
|
+
"enquirer": "^2.4.1",
|
|
31
|
+
"update-notifier": "^7.3.1"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
33
34
|
"@types/better-sqlite3": "^7.6.13",
|
|
34
35
|
"@types/node": "^25.5.2",
|
|
36
|
+
"@types/update-notifier": "^6.0.8",
|
|
35
37
|
"typescript": "^6.0.2"
|
|
36
38
|
}
|
|
37
39
|
}
|
package/src/index.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { join, dirname } from "path";
|
|
|
13
13
|
import { fileURLToPath } from "url";
|
|
14
14
|
import { t, setLocale, getLocale } from "./i18n/index.js";
|
|
15
15
|
import Enquirer from "enquirer";
|
|
16
|
+
import updateNotifier from "update-notifier";
|
|
16
17
|
const Select = (Enquirer as any).Select;
|
|
17
18
|
|
|
18
19
|
function createSelect(options: any) {
|
|
@@ -45,6 +46,9 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
|
45
46
|
const packageJsonPath = join(__dirname, "..", "package.json");
|
|
46
47
|
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
47
48
|
|
|
49
|
+
const notifier = updateNotifier({ pkg: packageJson, updateCheckInterval: 1000 * 60 * 60 * 24 });
|
|
50
|
+
notifier.notify({ isGlobal: true, defer: true });
|
|
51
|
+
|
|
48
52
|
const program = new Command();
|
|
49
53
|
|
|
50
54
|
program
|