vimd 0.2.2 → 0.2.4
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/README.md +21 -0
- package/dist/cli/commands/reset.d.ts +6 -0
- package/dist/cli/commands/reset.d.ts.map +1 -0
- package/dist/cli/commands/reset.js +41 -0
- package/dist/cli/index.js +7 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -68,6 +68,8 @@
|
|
|
68
68
|
npm install -g vimd
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
+
**現在の安定版: v0.2.4**
|
|
72
|
+
|
|
71
73
|
v0.2.0 からは **pandoc なしで利用可能** になりました。
|
|
72
74
|
高品質な出力が必要な場合のみ pandoc をインストールしてください。
|
|
73
75
|
|
|
@@ -99,6 +101,20 @@ vimd config
|
|
|
99
101
|
|
|
100
102
|
---
|
|
101
103
|
|
|
104
|
+
## バージョン情報
|
|
105
|
+
|
|
106
|
+
**安定版: v0.2.4**(最新版と同一)
|
|
107
|
+
|
|
108
|
+
安定版は十分なテストを経てリリースされたバージョンです。
|
|
109
|
+
最新版と安定版が異なる場合は、両方を記載します。
|
|
110
|
+
|
|
111
|
+
安定版のインストール:
|
|
112
|
+
```bash
|
|
113
|
+
npm install -g vimd@latest
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
102
118
|
## コマンド
|
|
103
119
|
|
|
104
120
|
| コマンド | 説明 |
|
|
@@ -108,6 +124,7 @@ vimd config
|
|
|
108
124
|
| `vimd theme` | テーマを対話的に変更 |
|
|
109
125
|
| `vimd config` | 設定を対話的に編集 |
|
|
110
126
|
| `vimd kill` | 実行中のセッションを終了 |
|
|
127
|
+
| `vimd reset` | 設定をデフォルトにリセット |
|
|
111
128
|
|
|
112
129
|
### オプション
|
|
113
130
|
|
|
@@ -126,6 +143,10 @@ vimd build draft.md --theme dark # テーマ指定
|
|
|
126
143
|
# kill コマンド
|
|
127
144
|
vimd kill # 全セッションを終了
|
|
128
145
|
vimd kill --port 38080 # 特定ポートのセッションを終了
|
|
146
|
+
|
|
147
|
+
# reset コマンド
|
|
148
|
+
vimd reset # 設定をリセット(確認あり)
|
|
149
|
+
vimd reset --yes # 確認なしでリセット
|
|
129
150
|
```
|
|
130
151
|
|
|
131
152
|
---
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reset.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/reset.ts"],"names":[],"mappings":"AAOA,UAAU,YAAY;IACpB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAsCvE"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// src/cli/commands/reset.ts
|
|
2
|
+
import inquirer from 'inquirer';
|
|
3
|
+
import fs from 'fs-extra';
|
|
4
|
+
import { Logger } from '../../utils/logger.js';
|
|
5
|
+
import { PathResolver } from '../../utils/path-resolver.js';
|
|
6
|
+
import { DEFAULT_CONFIG } from '../../config/defaults.js';
|
|
7
|
+
export async function resetCommand(options) {
|
|
8
|
+
try {
|
|
9
|
+
const configPath = PathResolver.getConfigPath();
|
|
10
|
+
// Check if config file exists
|
|
11
|
+
if (!(await fs.pathExists(configPath))) {
|
|
12
|
+
Logger.info('No configuration file found. Already using default settings.');
|
|
13
|
+
Logger.info(` Default port: ${DEFAULT_CONFIG.port}`);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
// Confirm deletion unless --yes is specified
|
|
17
|
+
if (!options.yes) {
|
|
18
|
+
const { confirmed } = await inquirer.prompt([
|
|
19
|
+
{
|
|
20
|
+
type: 'confirm',
|
|
21
|
+
name: 'confirmed',
|
|
22
|
+
message: 'Are you sure you want to reset the configuration?',
|
|
23
|
+
default: false,
|
|
24
|
+
},
|
|
25
|
+
]);
|
|
26
|
+
if (!confirmed) {
|
|
27
|
+
Logger.info('Configuration reset cancelled');
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
// Delete the config file
|
|
32
|
+
await fs.remove(configPath);
|
|
33
|
+
Logger.success('Configuration reset. Default settings will be used on next run.');
|
|
34
|
+
Logger.info(` Default port: ${DEFAULT_CONFIG.port}`);
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
38
|
+
Logger.error(`Failed to reset configuration: ${errorMessage}`);
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
}
|
package/dist/cli/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { buildCommand } from './commands/build.js';
|
|
|
6
6
|
import { themeCommand } from './commands/theme.js';
|
|
7
7
|
import { configCommand } from './commands/config.js';
|
|
8
8
|
import { killCommand } from './commands/kill.js';
|
|
9
|
+
import { resetCommand } from './commands/reset.js';
|
|
9
10
|
const require = createRequire(import.meta.url);
|
|
10
11
|
const packageJson = require('../../package.json');
|
|
11
12
|
const program = new Command();
|
|
@@ -48,4 +49,10 @@ program
|
|
|
48
49
|
.option('--all', 'Kill all sessions (default)')
|
|
49
50
|
.option('--port <port>', 'Kill session on specific port')
|
|
50
51
|
.action(killCommand);
|
|
52
|
+
// vimd reset
|
|
53
|
+
program
|
|
54
|
+
.command('reset')
|
|
55
|
+
.description('Reset configuration to defaults')
|
|
56
|
+
.option('-y, --yes', 'Skip confirmation prompt')
|
|
57
|
+
.action(resetCommand);
|
|
51
58
|
program.parse(process.argv);
|