@nbtca/prompt 1.0.0 → 1.0.3
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/.claude/settings.local.json +25 -0
- package/CHANGELOG.md +77 -0
- package/DEVELOPMENT.md +258 -0
- package/Prompt.wiki/Home.md +27 -0
- package/README.md +161 -165
- package/TERMINAL_UX.md +184 -0
- package/dist/config/data.d.ts +1 -1
- package/dist/config/data.js +1 -1
- package/dist/core/logo.d.ts.map +1 -1
- package/dist/core/logo.js +48 -22
- package/dist/core/logo.js.map +1 -1
- package/dist/core/menu.d.ts.map +1 -1
- package/dist/core/menu.js +34 -39
- package/dist/core/menu.js.map +1 -1
- package/dist/core/ui.d.ts +0 -8
- package/dist/core/ui.d.ts.map +1 -1
- package/dist/core/ui.js +2 -20
- package/dist/core/ui.js.map +1 -1
- package/dist/core/vim-keys.d.ts +15 -0
- package/dist/core/vim-keys.d.ts.map +1 -0
- package/dist/core/vim-keys.js +59 -0
- package/dist/core/vim-keys.js.map +1 -0
- package/dist/features/docs.d.ts +1 -9
- package/dist/features/docs.d.ts.map +1 -1
- package/dist/features/docs.js +266 -46
- package/dist/features/docs.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +8 -4
- package/dist/main.js.map +1 -1
- package/package.json +7 -3
- package/src/config/data.ts +1 -1
- package/src/core/logo.ts +56 -23
- package/src/core/menu.ts +37 -41
- package/src/core/ui.ts +2 -32
- package/src/core/vim-keys.ts +70 -0
- package/src/features/docs.ts +296 -47
- package/src/main.ts +9 -4
- package/DATA_MANAGEMENT.md +0 -409
package/README.md
CHANGED
|
@@ -1,235 +1,231 @@
|
|
|
1
|
-
# NBTCA
|
|
1
|
+
# NBTCA Prompt
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Terminal-based information system for NingboTech Computer Association.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@nbtca/prompt)
|
|
6
|
+
[](LICENSE)
|
|
6
7
|
|
|
7
|
-
##
|
|
8
|
+
## Overview
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
NBTCA Prompt is a minimalist command-line interface tool designed for the Computer Association of Zhejiang University Ningbo Institute of Technology. It provides quick access to association resources, events, and documentation directly from the terminal.
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
- **渐变文字**: 支持多种颜色渐变效果
|
|
13
|
-
- **加载动画**: 自定义加载动画和进度条
|
|
14
|
-
- **系统信息显示**: 实时显示系统状态和性能
|
|
12
|
+
## Features
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
- View upcoming association events (30-day calendar)
|
|
15
|
+
- Access repair service information
|
|
16
|
+
- Browse technical documentation from terminal
|
|
17
|
+
- Quick links to official website and GitHub
|
|
18
|
+
- Minimalist design with maximum terminal compatibility
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
- **子菜单系统**: 每个分类都有详细的子菜单
|
|
20
|
-
- **确认对话框**: 重要操作前的确认提示
|
|
21
|
-
- **输入提示**: 支持文本和密码输入
|
|
20
|
+
## Installation
|
|
22
21
|
|
|
23
|
-
###
|
|
22
|
+
### Global Installation
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
|
|
24
|
+
```bash
|
|
25
|
+
npm install -g @nbtca/prompt
|
|
26
|
+
```
|
|
28
27
|
|
|
29
|
-
###
|
|
28
|
+
### Using npx (No Installation Required)
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- **服务预约**: 在线预约系统
|
|
30
|
+
```bash
|
|
31
|
+
npx @nbtca/prompt
|
|
32
|
+
```
|
|
35
33
|
|
|
36
|
-
##
|
|
34
|
+
## Usage
|
|
37
35
|
|
|
38
|
-
|
|
36
|
+
Run the program with:
|
|
39
37
|
|
|
40
38
|
```bash
|
|
41
|
-
|
|
39
|
+
nbtca
|
|
42
40
|
```
|
|
43
41
|
|
|
44
|
-
|
|
42
|
+
Navigate using arrow keys or Vim bindings (j/k/g/G).
|
|
43
|
+
|
|
44
|
+
## Development
|
|
45
|
+
|
|
46
|
+
### Prerequisites
|
|
47
|
+
|
|
48
|
+
- Node.js >= 16.0.0
|
|
49
|
+
|
|
50
|
+
### Setup
|
|
45
51
|
|
|
46
52
|
```bash
|
|
47
|
-
|
|
48
|
-
|
|
53
|
+
git clone https://github.com/nbtca/prompt.git
|
|
54
|
+
cd prompt
|
|
55
|
+
pnpm install
|
|
56
|
+
```
|
|
49
57
|
|
|
50
|
-
|
|
51
|
-
npm start
|
|
58
|
+
### Development Workflow
|
|
52
59
|
|
|
53
|
-
|
|
54
|
-
|
|
60
|
+
#### Quick Testing (Recommended)
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pnpm run dev
|
|
55
64
|
```
|
|
56
65
|
|
|
57
|
-
|
|
66
|
+
Runs TypeScript source directly without auto-restart. Exit with menu option or Ctrl+C.
|
|
58
67
|
|
|
68
|
+
#### Watch Mode (File Changes)
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pnpm run dev:watch
|
|
59
72
|
```
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
│ │ └── logo.txt # 终端图像数据
|
|
69
|
-
│ ├── gradient/ # 渐变文字效果
|
|
70
|
-
│ │ └── printGradientText.js
|
|
71
|
-
│ ├── animation/ # 动画效果
|
|
72
|
-
│ │ ├── printLolcatAnimated.js
|
|
73
|
-
│ │ └── loadingAnimation.js
|
|
74
|
-
│ ├── ui/ # 用户界面组件
|
|
75
|
-
│ │ ├── welcomeBanner.js
|
|
76
|
-
│ │ └── systemInfo.js
|
|
77
|
-
│ └── menu/ # 交互菜单
|
|
78
|
-
│ ├── showMainMenu.js
|
|
79
|
-
│ ├── handleUserAction.js
|
|
80
|
-
│ └── subMenu.js
|
|
81
|
-
├── assets/
|
|
82
|
-
│ └── Prompt_demo.gif # 演示动画
|
|
83
|
-
└── package.json
|
|
73
|
+
|
|
74
|
+
Auto-restarts on file changes. Not recommended for interactive testing.
|
|
75
|
+
|
|
76
|
+
#### Production Build
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
pnpm run build
|
|
80
|
+
pnpm start
|
|
84
81
|
```
|
|
85
82
|
|
|
86
|
-
|
|
83
|
+
### Available Commands
|
|
87
84
|
|
|
88
|
-
|
|
85
|
+
```bash
|
|
86
|
+
pnpm run dev # Run TypeScript source directly
|
|
87
|
+
pnpm run dev:watch # Run with file watching
|
|
88
|
+
pnpm run build # Compile TypeScript to JavaScript
|
|
89
|
+
pnpm start # Run compiled code
|
|
90
|
+
pnpm run clean # Remove dist directory
|
|
91
|
+
```
|
|
89
92
|
|
|
90
|
-
|
|
91
|
-
- 📰 新闻资讯
|
|
92
|
-
- 📅 活动日历
|
|
93
|
-
- 👥 团队介绍
|
|
94
|
-
- 📞 联系我们
|
|
93
|
+
## Project Structure
|
|
95
94
|
|
|
96
|
-
|
|
95
|
+
```
|
|
96
|
+
src/
|
|
97
|
+
├── config/ # Configuration constants
|
|
98
|
+
│ ├── data.ts # URLs and app info
|
|
99
|
+
│ └── theme.ts # Color themes
|
|
100
|
+
├── core/ # Core functionality
|
|
101
|
+
│ ├── logo.ts # Logo display logic
|
|
102
|
+
│ ├── menu.ts # Main menu system
|
|
103
|
+
│ ├── ui.ts # UI components
|
|
104
|
+
│ └── vim-keys.ts # Vim key bindings
|
|
105
|
+
├── features/ # Feature modules
|
|
106
|
+
│ ├── calendar.ts # Event calendar
|
|
107
|
+
│ ├── docs.ts # Documentation viewer
|
|
108
|
+
│ ├── repair.ts # Repair service
|
|
109
|
+
│ └── website.ts # Website links
|
|
110
|
+
└── main.ts # Application entry point
|
|
111
|
+
```
|
|
97
112
|
|
|
98
|
-
|
|
99
|
-
- 🔧 软件问题解决
|
|
100
|
-
- 🌐 网络配置服务
|
|
101
|
-
- 📱 移动设备支持
|
|
102
|
-
- 🛠️ 硬件升级咨询
|
|
103
|
-
- 📋 服务预约
|
|
113
|
+
## Technology Stack
|
|
104
114
|
|
|
105
|
-
###
|
|
115
|
+
### Core Dependencies
|
|
106
116
|
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
-
|
|
111
|
-
-
|
|
112
|
-
-
|
|
117
|
+
- axios - HTTP requests
|
|
118
|
+
- ical.js - ICS calendar parsing
|
|
119
|
+
- marked + marked-terminal - Markdown rendering
|
|
120
|
+
- chalk - Terminal colors
|
|
121
|
+
- inquirer - Interactive prompts
|
|
122
|
+
- open - Browser integration
|
|
113
123
|
|
|
114
|
-
###
|
|
124
|
+
### Development Dependencies
|
|
115
125
|
|
|
116
|
-
-
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
- 📱 微信公众号
|
|
120
|
-
- 🎯 项目合作
|
|
121
|
-
- 🏆 竞赛信息
|
|
126
|
+
- TypeScript 5.3+
|
|
127
|
+
- tsx - TypeScript execution
|
|
128
|
+
- @types/* - Type definitions
|
|
122
129
|
|
|
123
|
-
|
|
130
|
+
## Documentation Viewer
|
|
124
131
|
|
|
125
|
-
|
|
126
|
-
- 🌐 网络配置
|
|
127
|
-
- 📊 性能监控
|
|
128
|
-
- 🔔 通知设置
|
|
129
|
-
- 🔄 检查更新
|
|
132
|
+
The knowledge base viewer features:
|
|
130
133
|
|
|
131
|
-
|
|
134
|
+
- Direct GitHub repository access
|
|
135
|
+
- VitePress syntax cleaning
|
|
136
|
+
- Terminal Markdown rendering
|
|
137
|
+
- Browser fallback option
|
|
138
|
+
- Directory tree navigation
|
|
132
139
|
|
|
133
|
-
|
|
134
|
-
- **inquirer** - 交互式命令行界面
|
|
135
|
-
- **chalk** - 终端颜色输出
|
|
136
|
-
- **isomorphic-lolcat** - 彩虹色动画效果
|
|
137
|
-
- **open** - 打开系统默认浏览器
|
|
138
|
-
- **boxen** - 创建边框效果
|
|
140
|
+
### Supported Formats
|
|
139
141
|
|
|
140
|
-
|
|
142
|
+
- Standard Markdown
|
|
143
|
+
- VitePress frontmatter (auto-removed)
|
|
144
|
+
- VitePress containers (auto-converted)
|
|
145
|
+
- Table of contents (placeholder in terminal)
|
|
141
146
|
|
|
142
|
-
|
|
147
|
+
## Terminal Compatibility
|
|
143
148
|
|
|
144
|
-
|
|
145
|
-
await printLolcatAnimated("Hello World!", {
|
|
146
|
-
duration: 2000,
|
|
147
|
-
fps: 30,
|
|
148
|
-
effect: "rainbow",
|
|
149
|
-
});
|
|
150
|
-
```
|
|
149
|
+
Designed for maximum compatibility with:
|
|
151
150
|
|
|
152
|
-
|
|
151
|
+
- Modern terminals (iTerm2, Windows Terminal, GNOME Terminal)
|
|
152
|
+
- Legacy terminals (xterm, Terminal.app)
|
|
153
|
+
- SSH sessions
|
|
154
|
+
- Screen/tmux multiplexers
|
|
153
155
|
|
|
154
|
-
|
|
155
|
-
await printLolcatAnimated("Hello World!", {
|
|
156
|
-
effect: "wave",
|
|
157
|
-
});
|
|
158
|
-
```
|
|
156
|
+
ASCII-based UI elements ensure rendering on any terminal emulator.
|
|
159
157
|
|
|
160
|
-
|
|
158
|
+
## System Requirements
|
|
161
159
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
});
|
|
166
|
-
```
|
|
160
|
+
- Node.js: >= 16.0.0
|
|
161
|
+
- OS: Windows, macOS, Linux
|
|
162
|
+
- Terminal: ANSI escape sequence support
|
|
167
163
|
|
|
168
|
-
|
|
164
|
+
## Common Issues
|
|
169
165
|
|
|
170
|
-
|
|
171
|
-
await printLolcatAnimated("Hello World!", {
|
|
172
|
-
effect: "typewriter",
|
|
173
|
-
});
|
|
174
|
-
```
|
|
166
|
+
### Q: Auto-restart when using `pnpm run dev:watch`?
|
|
175
167
|
|
|
176
|
-
|
|
168
|
+
A: This is expected behavior. Use `pnpm run dev` for interactive testing.
|
|
177
169
|
|
|
178
|
-
|
|
179
|
-
- **操作系统**: Windows, macOS, Linux
|
|
180
|
-
- **终端**: 支持 ANSI 转义序列的终端
|
|
170
|
+
### Q: How to exit the program?
|
|
181
171
|
|
|
182
|
-
|
|
172
|
+
A: Select the Exit option from menu, or press Ctrl+C.
|
|
183
173
|
|
|
184
|
-
###
|
|
174
|
+
### Q: Changes not reflected?
|
|
185
175
|
|
|
186
|
-
|
|
187
|
-
npm install
|
|
188
|
-
```
|
|
176
|
+
A: If using `pnpm start`, rebuild with `pnpm run build` first.
|
|
189
177
|
|
|
190
|
-
|
|
178
|
+
## Contributing
|
|
191
179
|
|
|
192
|
-
|
|
193
|
-
npm run dev
|
|
194
|
-
```
|
|
180
|
+
Contributions are welcome. Please follow these guidelines:
|
|
195
181
|
|
|
196
|
-
|
|
182
|
+
1. Fork the repository
|
|
183
|
+
2. Create a feature branch
|
|
184
|
+
3. Follow existing code style
|
|
185
|
+
4. Add appropriate comments
|
|
186
|
+
5. Ensure build passes
|
|
187
|
+
6. Submit pull request
|
|
197
188
|
|
|
198
|
-
|
|
199
|
-
npm run build
|
|
200
|
-
```
|
|
189
|
+
### Code Standards
|
|
201
190
|
|
|
202
|
-
|
|
191
|
+
- Use TypeScript strict mode
|
|
192
|
+
- Add JSDoc comments for functions
|
|
193
|
+
- Use .js extension in imports (even for .ts files)
|
|
194
|
+
- Keep code simple and readable
|
|
203
195
|
|
|
204
|
-
|
|
196
|
+
## License
|
|
205
197
|
|
|
206
|
-
-
|
|
207
|
-
- 🎨 增强的渐变文字功能
|
|
208
|
-
- 📊 实时系统信息显示
|
|
209
|
-
- 🚀 分类菜单系统
|
|
210
|
-
- 🔧 丰富的技术支持服务
|
|
211
|
-
- 📚 学习资源中心
|
|
212
|
-
- 👥 社区交流功能
|
|
213
|
-
- ⚙️ 系统设置选项
|
|
198
|
+
MIT License - See LICENSE file for details
|
|
214
199
|
|
|
215
|
-
|
|
200
|
+
## Contact
|
|
216
201
|
|
|
217
|
-
-
|
|
218
|
-
-
|
|
219
|
-
-
|
|
202
|
+
- Website: https://nbtca.space
|
|
203
|
+
- Email: contact@nbtca.space
|
|
204
|
+
- GitHub: https://github.com/nbtca
|
|
205
|
+
- NPM: https://www.npmjs.com/package/@nbtca/prompt
|
|
220
206
|
|
|
221
|
-
##
|
|
207
|
+
## Changelog
|
|
222
208
|
|
|
223
|
-
|
|
209
|
+
### v1.0.1 (2025-11-27)
|
|
224
210
|
|
|
225
|
-
|
|
211
|
+
- Added terminal documentation viewer
|
|
212
|
+
- Removed emoji icons for better compatibility
|
|
213
|
+
- Improved Markdown rendering
|
|
214
|
+
- Added VitePress syntax cleaning
|
|
215
|
+
- Enhanced directory navigation
|
|
226
216
|
|
|
227
|
-
|
|
217
|
+
### v1.0.0 (2025-11-21)
|
|
228
218
|
|
|
229
|
-
|
|
219
|
+
- Complete TypeScript rewrite
|
|
220
|
+
- Minimalist UI redesign
|
|
221
|
+
- ICS calendar integration
|
|
222
|
+
- Terminal Markdown renderer
|
|
223
|
+
- Smart logo display with fallback
|
|
230
224
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
225
|
+
## Acknowledgments
|
|
226
|
+
|
|
227
|
+
Built with focus on simplicity and terminal compatibility.
|
|
234
228
|
|
|
235
229
|
---
|
|
230
|
+
|
|
231
|
+
Made by [NBTCA](https://nbtca.space)
|
package/TERMINAL_UX.md
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# Terminal UX Improvements
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
All changes align with standard Linux/Unix terminal conventions for better user experience and consistency.
|
|
6
|
+
|
|
7
|
+
## Changes Made
|
|
8
|
+
|
|
9
|
+
### 1. Standardized Navigation Symbols
|
|
10
|
+
|
|
11
|
+
**Before**:
|
|
12
|
+
```
|
|
13
|
+
[📁] emoji icons
|
|
14
|
+
[<-] inconsistent arrows
|
|
15
|
+
[ ] empty brackets
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**After**:
|
|
19
|
+
```
|
|
20
|
+
[..] - Up to parent directory (Unix convention)
|
|
21
|
+
[ <] - Back/Previous
|
|
22
|
+
[ ^] - Return to main menu
|
|
23
|
+
[ *] - Special action (open in browser)
|
|
24
|
+
[DIR] - Directory indicator
|
|
25
|
+
[MD] - Markdown file indicator
|
|
26
|
+
[ ?] - Help/About
|
|
27
|
+
[ x] - Exit
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Rationale**: ASCII-only symbols ensure maximum terminal compatibility and follow Unix conventions (e.g., `..` for parent directory).
|
|
31
|
+
|
|
32
|
+
### 2. Added Keybinding Hints
|
|
33
|
+
|
|
34
|
+
**Main Menu**:
|
|
35
|
+
```
|
|
36
|
+
Navigation: j/k or ↑/↓ | Jump: g/G | Quit: q or Ctrl+C
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Location**: Displayed above main menu for visibility
|
|
40
|
+
|
|
41
|
+
**Rationale**: Users should know available shortcuts without reading documentation.
|
|
42
|
+
|
|
43
|
+
### 3. ESC Key Support
|
|
44
|
+
|
|
45
|
+
**Implementation**: ESC key now properly passed through to menus
|
|
46
|
+
|
|
47
|
+
**Expected Behavior** (future enhancement):
|
|
48
|
+
- ESC in submenus = go back one level
|
|
49
|
+
- ESC in main menu = exit application
|
|
50
|
+
|
|
51
|
+
**Current State**: Infrastructure added, full implementation needs inquirer customization
|
|
52
|
+
|
|
53
|
+
**Rationale**: ESC is standard cancel/back key in Unix terminals.
|
|
54
|
+
|
|
55
|
+
### 4. Improved Documentation
|
|
56
|
+
|
|
57
|
+
**Added Descriptions**:
|
|
58
|
+
- Knowledge Base menu now shows purpose
|
|
59
|
+
- Comments in code clarified
|
|
60
|
+
|
|
61
|
+
**Rationale**: Self-documenting UI reduces user confusion.
|
|
62
|
+
|
|
63
|
+
## Navigation Symbol Reference
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
Symbol | Meaning | Unix Standard
|
|
67
|
+
--------|--------------------------|---------------
|
|
68
|
+
[..] | Parent directory | Yes (cd ..)
|
|
69
|
+
[DIR] | Directory entry | Common
|
|
70
|
+
[MD] | Markdown file | N/A
|
|
71
|
+
[ <] | Go back/previous | No (custom)
|
|
72
|
+
[ ^] | Go to top/main menu | No (custom)
|
|
73
|
+
[ *] | Special action | No (custom)
|
|
74
|
+
[ ?] | Help/Information | Common (man ?)
|
|
75
|
+
[ x] | Exit/Quit | No (custom)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Keybinding Reference
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
Key | Action | Standard
|
|
82
|
+
--------|----------------------|----------
|
|
83
|
+
↑/↓ | Navigate up/down | Yes
|
|
84
|
+
j/k | Navigate up/down | Vim
|
|
85
|
+
g | Jump to first | Vim
|
|
86
|
+
G | Jump to last | Vim
|
|
87
|
+
q | Quit application | Vim/less/man
|
|
88
|
+
ESC | Cancel/Go back | Yes
|
|
89
|
+
Ctrl+C | Force quit | Yes
|
|
90
|
+
Enter | Select/Confirm | Yes
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Comparison with Common Unix Tools
|
|
94
|
+
|
|
95
|
+
### less/more
|
|
96
|
+
- j/k navigation: ✓ Supported
|
|
97
|
+
- g/G jump: ✓ Supported
|
|
98
|
+
- q quit: ✓ Supported
|
|
99
|
+
- ESC: Usually not used
|
|
100
|
+
|
|
101
|
+
### man
|
|
102
|
+
- j/k navigation: ✓ Supported
|
|
103
|
+
- g/G jump: ✓ Supported
|
|
104
|
+
- q quit: ✓ Supported
|
|
105
|
+
- h for help: Not implemented (use [?] menu item)
|
|
106
|
+
|
|
107
|
+
### vim
|
|
108
|
+
- j/k navigation: ✓ Supported
|
|
109
|
+
- g/G jump: ✓ Supported
|
|
110
|
+
- q quit: ✓ Supported
|
|
111
|
+
- ESC: ✓ Infrastructure added
|
|
112
|
+
|
|
113
|
+
### fzf (fuzzy finder)
|
|
114
|
+
- j/k navigation: ✓ Supported
|
|
115
|
+
- Ctrl+C quit: ✓ Supported
|
|
116
|
+
- ESC cancel: ✓ Infrastructure added
|
|
117
|
+
|
|
118
|
+
## Implementation Details
|
|
119
|
+
|
|
120
|
+
### vim-keys.ts
|
|
121
|
+
- Maps j/k to arrow keys
|
|
122
|
+
- Maps g/G to home/end
|
|
123
|
+
- Maps q to Ctrl+C
|
|
124
|
+
- Passes ESC through for menu handling
|
|
125
|
+
|
|
126
|
+
### menu.ts
|
|
127
|
+
- Shows keybinding hints before menu
|
|
128
|
+
- Standardized symbol usage
|
|
129
|
+
- Consistent formatting
|
|
130
|
+
|
|
131
|
+
### docs.ts
|
|
132
|
+
- Uses [..] for parent directory (Unix standard)
|
|
133
|
+
- Uses [ ^] for main menu (clear intent)
|
|
134
|
+
- Uses [ <] for back navigation
|
|
135
|
+
- Added descriptive subtitle
|
|
136
|
+
|
|
137
|
+
## Terminal Compatibility
|
|
138
|
+
|
|
139
|
+
All symbols tested and work correctly on:
|
|
140
|
+
- iTerm2 (macOS)
|
|
141
|
+
- Terminal.app (macOS)
|
|
142
|
+
- GNOME Terminal (Linux)
|
|
143
|
+
- Windows Terminal
|
|
144
|
+
- PuTTY (SSH)
|
|
145
|
+
- tmux/screen multiplexers
|
|
146
|
+
|
|
147
|
+
## Future Enhancements
|
|
148
|
+
|
|
149
|
+
1. **Context-aware q key**: Currently q always exits. Consider:
|
|
150
|
+
- q in submenu = go back
|
|
151
|
+
- Q (shift) = force quit
|
|
152
|
+
|
|
153
|
+
2. **ESC back navigation**: Full implementation requires:
|
|
154
|
+
- Custom inquirer plugin or wrapper
|
|
155
|
+
- State management for menu stack
|
|
156
|
+
|
|
157
|
+
3. **Help overlay**: F1 or ? key for:
|
|
158
|
+
- Show all keybindings
|
|
159
|
+
- Context-sensitive help
|
|
160
|
+
|
|
161
|
+
4. **Breadcrumb trail**: Show current location:
|
|
162
|
+
```
|
|
163
|
+
Main > Docs > Tutorial > Getting Started
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
5. **Operation cancellation**: Allow Ctrl+C during:
|
|
167
|
+
- Network requests
|
|
168
|
+
- File loading
|
|
169
|
+
- Long operations
|
|
170
|
+
|
|
171
|
+
## Migration Notes
|
|
172
|
+
|
|
173
|
+
### Breaking Changes
|
|
174
|
+
None. All changes are additive or improve existing behavior.
|
|
175
|
+
|
|
176
|
+
### User-Facing Changes
|
|
177
|
+
- New keybinding hints displayed
|
|
178
|
+
- Updated navigation symbols (more intuitive)
|
|
179
|
+
- ESC key now recognized (infrastructure)
|
|
180
|
+
|
|
181
|
+
### Developer Notes
|
|
182
|
+
- ESC handling requires inquirer extension for full functionality
|
|
183
|
+
- Current implementation provides foundation
|
|
184
|
+
- Symbol constants could be extracted to config
|
package/dist/config/data.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare const URLS: {
|
|
|
12
12
|
};
|
|
13
13
|
export declare const APP_INFO: {
|
|
14
14
|
readonly name: "Prompt";
|
|
15
|
-
readonly version: "1.0.
|
|
15
|
+
readonly version: "1.0.2";
|
|
16
16
|
readonly description: "浙大宁波理工学院计算机协会";
|
|
17
17
|
readonly fullDescription: "NBTCA Prompt - 极简命令行工具";
|
|
18
18
|
readonly author: "m1ngsama <contact@m1ng.space>";
|
package/dist/config/data.js
CHANGED
package/dist/core/logo.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logo.d.ts","sourceRoot":"","sources":["../../src/core/logo.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"logo.d.ts","sourceRoot":"","sources":["../../src/core/logo.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAwDH;;GAEG;AACH,wBAAsB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAmC/C"}
|