calendit 1.0.0 → 1.0.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.
- package/dist/commands/config.js +12 -0
- package/dist/core/config.d.ts +1 -0
- package/dist/core/config.js +6 -0
- package/package.json +3 -3
package/dist/commands/config.js
CHANGED
|
@@ -66,6 +66,18 @@ export function registerConfigCommands(program, deps) {
|
|
|
66
66
|
: "none"}`);
|
|
67
67
|
logger.info(" Config file : ~/.config/calendit/config.json (or CALENDIT_CONFIG_DIR override)");
|
|
68
68
|
});
|
|
69
|
+
configCmd
|
|
70
|
+
.command("delete-context <name>")
|
|
71
|
+
.description("Delete a named context")
|
|
72
|
+
.action(async (name) => {
|
|
73
|
+
await loadConfigIfExists(deps.config);
|
|
74
|
+
const deleted = deps.config.deleteContext(name);
|
|
75
|
+
if (!deleted) {
|
|
76
|
+
throw new ValidationError(`Context '${name}' が見つかりません。`, `登録済みのコンテキストを確認するには \`calendit config check\` を実行してください。`);
|
|
77
|
+
}
|
|
78
|
+
await deps.config.save();
|
|
79
|
+
logger.info(`Context '${name}' deleted.`);
|
|
80
|
+
});
|
|
69
81
|
configCmd
|
|
70
82
|
.command("set-context <name>")
|
|
71
83
|
.description("Set a named context (e.g. work, hobby)")
|
package/dist/core/config.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export declare class ConfigManager {
|
|
|
6
6
|
save(): Promise<void>;
|
|
7
7
|
getContext(name: string): ContextConfig | undefined;
|
|
8
8
|
setContext(name: string, context: ContextConfig): void;
|
|
9
|
+
deleteContext(name: string): boolean;
|
|
9
10
|
getAllContexts(): Record<string, ContextConfig>;
|
|
10
11
|
getGoogleCreds(): GoogleCredentials | undefined;
|
|
11
12
|
setGoogleCreds(id: string, secret: string): void;
|
package/dist/core/config.js
CHANGED
|
@@ -57,6 +57,12 @@ export class ConfigManager {
|
|
|
57
57
|
setContext(name, context) {
|
|
58
58
|
this.config.contexts[name] = context;
|
|
59
59
|
}
|
|
60
|
+
deleteContext(name) {
|
|
61
|
+
if (!(name in this.config.contexts))
|
|
62
|
+
return false;
|
|
63
|
+
delete this.config.contexts[name];
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
60
66
|
getAllContexts() {
|
|
61
67
|
return this.config.contexts;
|
|
62
68
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "calendit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Terminal-based calendar management tool for Google Calendar and Outlook via CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|
|
8
|
-
"calendit": "
|
|
8
|
+
"calendit": "bin/cli.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"dev": "node --loader ts-node/esm src/index.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"repository": {
|
|
29
29
|
"type": "git",
|
|
30
|
-
"url": "https://github.com/chromatribe/calendit.git"
|
|
30
|
+
"url": "git+https://github.com/chromatribe/calendit.git"
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/chromatribe/calendit#readme",
|
|
33
33
|
"bugs": {
|