practicode 0.1.1 → 0.1.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/Cargo.lock +1 -1
- package/Cargo.toml +1 -1
- package/README.md +13 -7
- package/assets/i18n/en.json +54 -0
- package/assets/i18n/es.json +54 -0
- package/assets/i18n/ja.json +54 -0
- package/assets/i18n/ko.json +54 -0
- package/assets/i18n/zh.json +54 -0
- package/docs/CONTRIBUTING.md +68 -23
- package/docs/MAINTAINING.md +67 -0
- package/package.json +1 -1
- package/src/ai.rs +95 -6
- package/src/core.rs +61 -216
- package/src/i18n.rs +45 -0
- package/src/lib.rs +2 -0
- package/src/tui.rs +429 -69
- package/src/update.rs +45 -0
package/Cargo.lock
CHANGED
package/Cargo.toml
CHANGED
package/README.md
CHANGED
|
@@ -69,15 +69,17 @@ Submissions are saved as you type under `submissions/<problem-id>/solution.<ext>
|
|
|
69
69
|
| `/list` | Browse problems with `up/down` or `j/k`, open with `Enter` |
|
|
70
70
|
| `/open 2` | Open by number, id, or slug |
|
|
71
71
|
| `/giveup` | Show the reference answer |
|
|
72
|
-
| `/
|
|
73
|
-
| `/
|
|
74
|
-
| `/
|
|
72
|
+
| `/hint` | Ask the selected AI for a concise hint |
|
|
73
|
+
| `/hint explain my bug` | Ask the selected AI about the current problem and submission |
|
|
74
|
+
| `/provider codex` | Set AI provider and show local CLI/daemon status |
|
|
75
|
+
| `/model auto` | Use the provider default model for `/hint` and AI-backed `/next` |
|
|
75
76
|
| `/note prefer hashmap practice` | Append a standing note for future problem generation |
|
|
76
77
|
| `/notes` | Show your local next-problem notes |
|
|
77
78
|
| `/lang python` | Set code language: `python`, `ts`, `java`, `rust` |
|
|
78
79
|
| `/ui en` | Set UI language: `en`, `ko`, `ja`, `zh`, `es` |
|
|
79
80
|
| `/theme dark` | Set theme: `dark` or `light` |
|
|
80
81
|
| `/source ai` | Prefer AI for next-problem generation |
|
|
82
|
+
| `/update` | Show update instructions when a newer version is available |
|
|
81
83
|
| `/exit` | Quit |
|
|
82
84
|
|
|
83
85
|
The default UI language is English. Switch it any time with `/ui ko`, `/ui ja`, `/ui zh`, or `/ui es`.
|
|
@@ -107,11 +109,11 @@ Claude Code is also supported:
|
|
|
107
109
|
/source ai
|
|
108
110
|
```
|
|
109
111
|
|
|
110
|
-
Generated
|
|
112
|
+
Generated problems and submissions stay local:
|
|
111
113
|
|
|
112
114
|
| Path | Purpose |
|
|
113
115
|
| --- | --- |
|
|
114
|
-
| `.practicode/problem_bank.json` | Local/custom/generated
|
|
116
|
+
| `.practicode/problem_bank.json` | Local/custom/generated problems |
|
|
115
117
|
| `.practicode/problem_notes.md` | Optional personal problem-generation notes |
|
|
116
118
|
| `.practicode/problem-state.json` | Current problem, history, settings |
|
|
117
119
|
| `problems/` | Generated problem markdown/index files |
|
|
@@ -121,6 +123,8 @@ Those paths are ignored by git, so your practice history stays yours.
|
|
|
121
123
|
|
|
122
124
|
## Update
|
|
123
125
|
|
|
126
|
+
The app checks for newer npm releases in the background and shows `/update` in the status line when one is available. Disable that check with `PRACTICODE_NO_UPDATE_CHECK=1`.
|
|
127
|
+
|
|
124
128
|
```bash
|
|
125
129
|
npm update -g practicode
|
|
126
130
|
cargo install --force practicode
|
|
@@ -130,9 +134,11 @@ cargo install --force practicode
|
|
|
130
134
|
|
|
131
135
|
`/run` executes your local submission as a normal process. practicode runs it from `.practicode/build/<problem-id>/run`, but this is not an OS sandbox. Only run code you trust.
|
|
132
136
|
|
|
133
|
-
##
|
|
137
|
+
## Contributing
|
|
138
|
+
|
|
139
|
+
External contributions use the fork and pull request flow in [docs/CONTRIBUTING.md](docs/CONTRIBUTING.md).
|
|
134
140
|
|
|
135
|
-
|
|
141
|
+
Maintainer-only review and release notes live in [docs/MAINTAINING.md](docs/MAINTAINING.md).
|
|
136
142
|
|
|
137
143
|
## License
|
|
138
144
|
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"problem": "Problem",
|
|
3
|
+
"output": "Output",
|
|
4
|
+
"command": "Command",
|
|
5
|
+
"commands": "Commands",
|
|
6
|
+
"difficulty": "Difficulty",
|
|
7
|
+
"topics": "Topics",
|
|
8
|
+
"input": "Input",
|
|
9
|
+
"examples": "Examples",
|
|
10
|
+
"example": "Example",
|
|
11
|
+
"answer": "Answer",
|
|
12
|
+
"source": "source",
|
|
13
|
+
"update": "update",
|
|
14
|
+
"command_placeholder": "Type /, move with up/down, Enter runs",
|
|
15
|
+
"palette_hint": "up/down select | Enter run | Esc cancel",
|
|
16
|
+
"hint_command": "Enter submit | Esc cancel",
|
|
17
|
+
"hint_list": "up/down move | Enter open | Esc close",
|
|
18
|
+
"hint_output": "Esc code | / command | ? help",
|
|
19
|
+
"hint_code": "Esc then / command",
|
|
20
|
+
"hint_idle": "/ command | ? help",
|
|
21
|
+
"help_title": "Help",
|
|
22
|
+
"daily_loop": "Daily loop",
|
|
23
|
+
"keys": "Keys",
|
|
24
|
+
"debug_prints": "Debug prints",
|
|
25
|
+
"cmd_run": "Judge the current submission",
|
|
26
|
+
"cmd_edit": "Return to the code editor",
|
|
27
|
+
"cmd_next": "Open the next problem",
|
|
28
|
+
"cmd_prev": "Open the previous problem",
|
|
29
|
+
"cmd_list": "Browse problems",
|
|
30
|
+
"cmd_open": "Open by number, id, or slug",
|
|
31
|
+
"cmd_giveup": "Show the reference answer",
|
|
32
|
+
"cmd_hint": "Ask for a hint about the current problem",
|
|
33
|
+
"cmd_ai": "Ask AI about the current problem and code",
|
|
34
|
+
"cmd_provider": "Set AI provider",
|
|
35
|
+
"cmd_model": "Set AI model",
|
|
36
|
+
"cmd_model_auto": "Use provider default model",
|
|
37
|
+
"cmd_model_available": "Use an available provider model",
|
|
38
|
+
"cmd_model_custom": "Type a model name",
|
|
39
|
+
"cmd_note": "Add a next-problem note",
|
|
40
|
+
"cmd_notes": "Show saved notes",
|
|
41
|
+
"cmd_lang": "Set code language",
|
|
42
|
+
"cmd_ui": "Set UI language",
|
|
43
|
+
"cmd_theme": "Set theme",
|
|
44
|
+
"cmd_source": "Set next-problem source",
|
|
45
|
+
"cmd_update": "Show update instructions",
|
|
46
|
+
"cmd_help": "Open help",
|
|
47
|
+
"cmd_exit": "Quit",
|
|
48
|
+
"update_available": "Update available",
|
|
49
|
+
"update_none": "practicode is up to date.",
|
|
50
|
+
"update_check_disabled": "Update check is disabled.",
|
|
51
|
+
"update_check_failed": "Could not check for updates.",
|
|
52
|
+
"generating_next": "Generating next problem",
|
|
53
|
+
"already_busy": "Already busy."
|
|
54
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"problem": "Problema",
|
|
3
|
+
"output": "Salida",
|
|
4
|
+
"command": "Comando",
|
|
5
|
+
"commands": "Comandos",
|
|
6
|
+
"difficulty": "Dificultad",
|
|
7
|
+
"topics": "Temas",
|
|
8
|
+
"input": "Entrada",
|
|
9
|
+
"examples": "Ejemplos",
|
|
10
|
+
"example": "Ejemplo",
|
|
11
|
+
"answer": "Respuesta",
|
|
12
|
+
"source": "fuente",
|
|
13
|
+
"update": "actualizacion",
|
|
14
|
+
"command_placeholder": "Escribe /, elige con arriba/abajo, Enter ejecuta",
|
|
15
|
+
"palette_hint": "arriba/abajo elegir | Enter ejecutar | Esc cancelar",
|
|
16
|
+
"hint_command": "Enter ejecutar | Esc cancelar",
|
|
17
|
+
"hint_list": "arriba/abajo mover | Enter abrir | Esc cerrar",
|
|
18
|
+
"hint_output": "Esc codigo | / comando | ? ayuda",
|
|
19
|
+
"hint_code": "Esc y luego / comando",
|
|
20
|
+
"hint_idle": "/ comando | ? ayuda",
|
|
21
|
+
"help_title": "Ayuda",
|
|
22
|
+
"daily_loop": "Flujo diario",
|
|
23
|
+
"keys": "Teclas",
|
|
24
|
+
"debug_prints": "Salida de depuracion",
|
|
25
|
+
"cmd_run": "Evalua la solucion actual",
|
|
26
|
+
"cmd_edit": "Volver al editor de codigo",
|
|
27
|
+
"cmd_next": "Abrir el siguiente problema",
|
|
28
|
+
"cmd_prev": "Abrir el problema anterior",
|
|
29
|
+
"cmd_list": "Abrir la lista de problemas",
|
|
30
|
+
"cmd_open": "Abrir por numero, id o slug",
|
|
31
|
+
"cmd_giveup": "Mostrar la respuesta de referencia",
|
|
32
|
+
"cmd_hint": "Pedir una pista para el problema actual",
|
|
33
|
+
"cmd_ai": "Preguntar a AI sobre el problema y codigo actuales",
|
|
34
|
+
"cmd_provider": "Configurar AI provider",
|
|
35
|
+
"cmd_model": "Configurar AI model",
|
|
36
|
+
"cmd_model_auto": "Usar el modelo predeterminado del provider",
|
|
37
|
+
"cmd_model_available": "Usar un modelo disponible del provider",
|
|
38
|
+
"cmd_model_custom": "Escribir un nombre de modelo",
|
|
39
|
+
"cmd_note": "Agregar nota para generar problemas",
|
|
40
|
+
"cmd_notes": "Ver notas guardadas",
|
|
41
|
+
"cmd_lang": "Configurar lenguaje de codigo",
|
|
42
|
+
"cmd_ui": "Configurar idioma de UI",
|
|
43
|
+
"cmd_theme": "Configurar tema",
|
|
44
|
+
"cmd_source": "Configurar fuente del siguiente problema",
|
|
45
|
+
"cmd_update": "Mostrar instrucciones de actualizacion",
|
|
46
|
+
"cmd_help": "Abrir ayuda",
|
|
47
|
+
"cmd_exit": "Salir",
|
|
48
|
+
"update_available": "Hay una nueva version",
|
|
49
|
+
"update_none": "practicode esta actualizado.",
|
|
50
|
+
"update_check_disabled": "La comprobacion de actualizaciones esta desactivada.",
|
|
51
|
+
"update_check_failed": "No se pudo comprobar actualizaciones.",
|
|
52
|
+
"generating_next": "Generando el siguiente problema",
|
|
53
|
+
"already_busy": "Ya hay una tarea en curso."
|
|
54
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"problem": "問題",
|
|
3
|
+
"output": "出力",
|
|
4
|
+
"command": "コマンド",
|
|
5
|
+
"commands": "コマンド",
|
|
6
|
+
"difficulty": "難易度",
|
|
7
|
+
"topics": "トピック",
|
|
8
|
+
"input": "入力",
|
|
9
|
+
"examples": "例",
|
|
10
|
+
"example": "例",
|
|
11
|
+
"answer": "解答",
|
|
12
|
+
"source": "source",
|
|
13
|
+
"update": "update",
|
|
14
|
+
"command_placeholder": "/ を入力し上下で選択、Enter で実行",
|
|
15
|
+
"palette_hint": "上下 選択 | Enter 実行 | Esc キャンセル",
|
|
16
|
+
"hint_command": "Enter 実行 | Esc キャンセル",
|
|
17
|
+
"hint_list": "上下 移動 | Enter 開く | Esc 閉じる",
|
|
18
|
+
"hint_output": "Esc コード | / コマンド | ? ヘルプ",
|
|
19
|
+
"hint_code": "Esc の後 / コマンド",
|
|
20
|
+
"hint_idle": "/ コマンド | ? ヘルプ",
|
|
21
|
+
"help_title": "ヘルプ",
|
|
22
|
+
"daily_loop": "基本フロー",
|
|
23
|
+
"keys": "キー",
|
|
24
|
+
"debug_prints": "デバッグ出力",
|
|
25
|
+
"cmd_run": "現在の提出を判定",
|
|
26
|
+
"cmd_edit": "コードエディタに戻る",
|
|
27
|
+
"cmd_next": "次の問題を開く",
|
|
28
|
+
"cmd_prev": "前の問題を開く",
|
|
29
|
+
"cmd_list": "問題一覧を開く",
|
|
30
|
+
"cmd_open": "番号、id、slug で問題を開く",
|
|
31
|
+
"cmd_giveup": "解答を見る",
|
|
32
|
+
"cmd_hint": "現在の問題のヒントを依頼",
|
|
33
|
+
"cmd_ai": "現在の問題とコードについて AI に質問",
|
|
34
|
+
"cmd_provider": "AI provider を設定",
|
|
35
|
+
"cmd_model": "AI model を設定",
|
|
36
|
+
"cmd_model_auto": "provider の既定モデルを使用",
|
|
37
|
+
"cmd_model_available": "利用可能な provider モデルを使用",
|
|
38
|
+
"cmd_model_custom": "モデル名を直接入力",
|
|
39
|
+
"cmd_note": "次の問題生成メモを追加",
|
|
40
|
+
"cmd_notes": "保存済みメモを見る",
|
|
41
|
+
"cmd_lang": "コード言語を設定",
|
|
42
|
+
"cmd_ui": "UI 言語を設定",
|
|
43
|
+
"cmd_theme": "テーマを設定",
|
|
44
|
+
"cmd_source": "次の問題の取得元を設定",
|
|
45
|
+
"cmd_update": "更新手順を表示",
|
|
46
|
+
"cmd_help": "ヘルプを開く",
|
|
47
|
+
"cmd_exit": "終了",
|
|
48
|
+
"update_available": "新しいバージョンがあります",
|
|
49
|
+
"update_none": "practicode は最新です。",
|
|
50
|
+
"update_check_disabled": "更新確認は無効です。",
|
|
51
|
+
"update_check_failed": "更新を確認できませんでした。",
|
|
52
|
+
"generating_next": "次の問題を生成中",
|
|
53
|
+
"already_busy": "すでに処理中です。"
|
|
54
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"problem": "문제",
|
|
3
|
+
"output": "출력",
|
|
4
|
+
"command": "명령",
|
|
5
|
+
"commands": "명령",
|
|
6
|
+
"difficulty": "난이도",
|
|
7
|
+
"topics": "주제",
|
|
8
|
+
"input": "입력",
|
|
9
|
+
"examples": "예시",
|
|
10
|
+
"example": "예시",
|
|
11
|
+
"answer": "정답",
|
|
12
|
+
"source": "출처",
|
|
13
|
+
"update": "업데이트",
|
|
14
|
+
"command_placeholder": "/ 입력 후 위/아래로 선택, Enter 실행",
|
|
15
|
+
"palette_hint": "위/아래 선택 | Enter 실행 | Esc 취소",
|
|
16
|
+
"hint_command": "Enter 실행 | Esc 취소",
|
|
17
|
+
"hint_list": "위/아래 이동 | Enter 열기 | Esc 닫기",
|
|
18
|
+
"hint_output": "Esc 코드 | / 명령 | ? 도움말",
|
|
19
|
+
"hint_code": "Esc 후 / 명령",
|
|
20
|
+
"hint_idle": "/ 명령 | ? 도움말",
|
|
21
|
+
"help_title": "도움말",
|
|
22
|
+
"daily_loop": "기본 흐름",
|
|
23
|
+
"keys": "키",
|
|
24
|
+
"debug_prints": "디버그 출력",
|
|
25
|
+
"cmd_run": "현재 제출을 채점",
|
|
26
|
+
"cmd_edit": "코드 편집기로 돌아가기",
|
|
27
|
+
"cmd_next": "다음 문제 열기",
|
|
28
|
+
"cmd_prev": "이전 문제 열기",
|
|
29
|
+
"cmd_list": "문제 목록 열기",
|
|
30
|
+
"cmd_open": "번호, id, slug로 문제 열기",
|
|
31
|
+
"cmd_giveup": "정답 보기",
|
|
32
|
+
"cmd_hint": "현재 문제 힌트 요청",
|
|
33
|
+
"cmd_ai": "현재 문제와 코드에 대해 AI에게 질문",
|
|
34
|
+
"cmd_provider": "AI provider 설정",
|
|
35
|
+
"cmd_model": "AI model 설정",
|
|
36
|
+
"cmd_model_auto": "provider 기본 모델 사용",
|
|
37
|
+
"cmd_model_available": "사용 가능한 provider 모델 선택",
|
|
38
|
+
"cmd_model_custom": "모델 이름 직접 입력",
|
|
39
|
+
"cmd_note": "다음 문제 생성 메모 추가",
|
|
40
|
+
"cmd_notes": "저장된 메모 보기",
|
|
41
|
+
"cmd_lang": "코드 언어 설정",
|
|
42
|
+
"cmd_ui": "UI 언어 설정",
|
|
43
|
+
"cmd_theme": "테마 설정",
|
|
44
|
+
"cmd_source": "다음 문제 출처 설정",
|
|
45
|
+
"cmd_update": "업데이트 안내 보기",
|
|
46
|
+
"cmd_help": "도움말 열기",
|
|
47
|
+
"cmd_exit": "종료",
|
|
48
|
+
"update_available": "새 버전 사용 가능",
|
|
49
|
+
"update_none": "practicode가 최신 버전입니다.",
|
|
50
|
+
"update_check_disabled": "업데이트 확인이 꺼져 있습니다.",
|
|
51
|
+
"update_check_failed": "업데이트를 확인할 수 없습니다.",
|
|
52
|
+
"generating_next": "다음 문제 생성 중",
|
|
53
|
+
"already_busy": "이미 작업 중입니다."
|
|
54
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"problem": "题目",
|
|
3
|
+
"output": "输出",
|
|
4
|
+
"command": "命令",
|
|
5
|
+
"commands": "命令",
|
|
6
|
+
"difficulty": "难度",
|
|
7
|
+
"topics": "主题",
|
|
8
|
+
"input": "输入",
|
|
9
|
+
"examples": "示例",
|
|
10
|
+
"example": "示例",
|
|
11
|
+
"answer": "答案",
|
|
12
|
+
"source": "来源",
|
|
13
|
+
"update": "更新",
|
|
14
|
+
"command_placeholder": "输入 / 后用上下键选择,Enter 执行",
|
|
15
|
+
"palette_hint": "上下 选择 | Enter 执行 | Esc 取消",
|
|
16
|
+
"hint_command": "Enter 执行 | Esc 取消",
|
|
17
|
+
"hint_list": "上下 移动 | Enter 打开 | Esc 关闭",
|
|
18
|
+
"hint_output": "Esc 代码 | / 命令 | ? 帮助",
|
|
19
|
+
"hint_code": "Esc 后输入 / 命令",
|
|
20
|
+
"hint_idle": "/ 命令 | ? 帮助",
|
|
21
|
+
"help_title": "帮助",
|
|
22
|
+
"daily_loop": "日常流程",
|
|
23
|
+
"keys": "按键",
|
|
24
|
+
"debug_prints": "调试输出",
|
|
25
|
+
"cmd_run": "评测当前提交",
|
|
26
|
+
"cmd_edit": "回到代码编辑器",
|
|
27
|
+
"cmd_next": "打开下一题",
|
|
28
|
+
"cmd_prev": "打开上一题",
|
|
29
|
+
"cmd_list": "打开题目列表",
|
|
30
|
+
"cmd_open": "按编号、id 或 slug 打开题目",
|
|
31
|
+
"cmd_giveup": "显示参考答案",
|
|
32
|
+
"cmd_hint": "请求当前题目的提示",
|
|
33
|
+
"cmd_ai": "向 AI 询问当前题目和代码",
|
|
34
|
+
"cmd_provider": "设置 AI provider",
|
|
35
|
+
"cmd_model": "设置 AI model",
|
|
36
|
+
"cmd_model_auto": "使用 provider 默认模型",
|
|
37
|
+
"cmd_model_available": "使用可用的 provider 模型",
|
|
38
|
+
"cmd_model_custom": "输入模型名称",
|
|
39
|
+
"cmd_note": "添加下次出题备注",
|
|
40
|
+
"cmd_notes": "查看保存的备注",
|
|
41
|
+
"cmd_lang": "设置代码语言",
|
|
42
|
+
"cmd_ui": "设置 UI 语言",
|
|
43
|
+
"cmd_theme": "设置主题",
|
|
44
|
+
"cmd_source": "设置下一题来源",
|
|
45
|
+
"cmd_update": "显示更新说明",
|
|
46
|
+
"cmd_help": "打开帮助",
|
|
47
|
+
"cmd_exit": "退出",
|
|
48
|
+
"update_available": "有新版本可用",
|
|
49
|
+
"update_none": "practicode 已是最新版本。",
|
|
50
|
+
"update_check_disabled": "更新检查已禁用。",
|
|
51
|
+
"update_check_failed": "无法检查更新。",
|
|
52
|
+
"generating_next": "正在生成下一题",
|
|
53
|
+
"already_busy": "已有任务正在运行。"
|
|
54
|
+
}
|
package/docs/CONTRIBUTING.md
CHANGED
|
@@ -1,14 +1,54 @@
|
|
|
1
1
|
# Contributing
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
Thanks for helping improve practicode. This guide is for contributors opening issues or pull requests.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Maintainer-only review and release steps live in [MAINTAINING.md](MAINTAINING.md).
|
|
6
|
+
|
|
7
|
+
## Before You Start
|
|
8
|
+
|
|
9
|
+
- Search existing issues and pull requests first.
|
|
10
|
+
- Small bug fixes, docs fixes, tests, and localization updates can go straight to a pull request.
|
|
11
|
+
- For larger UI, AI-generation, storage, or packaging changes, open an issue first so the scope is clear.
|
|
12
|
+
- Do not commit local practice data from `.practicode/`, `problems/`, or `submissions/`.
|
|
13
|
+
- Do not include secrets, tokens, private prompts, or generated answer keys in docs or examples.
|
|
14
|
+
|
|
15
|
+
## Fork And Pull Request Flow
|
|
16
|
+
|
|
17
|
+
1. Fork `baba9811/practicode` on GitHub.
|
|
18
|
+
2. Clone your fork and add the original repo as `upstream`.
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
git clone https://github.com/<your-user>/practicode.git
|
|
22
|
+
cd practicode
|
|
23
|
+
git remote add upstream https://github.com/baba9811/practicode.git
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
3. Create a focused branch from the latest `main`.
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
git fetch upstream
|
|
30
|
+
git checkout -b fix-short-name upstream/main
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
4. Make one focused change.
|
|
34
|
+
5. Run the smallest checks that cover your change.
|
|
35
|
+
6. Push your branch and open a pull request into `baba9811/practicode:main`.
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
git push origin fix-short-name
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
When opening the pull request, include what changed, how you checked it, and screenshots for visible TUI changes.
|
|
42
|
+
|
|
43
|
+
## Local Setup
|
|
44
|
+
|
|
45
|
+
Prerequisites:
|
|
6
46
|
|
|
7
47
|
- Rust stable with Cargo, rustfmt, and clippy.
|
|
8
48
|
- Node.js 18+ for the npm wrapper and package checks.
|
|
9
49
|
- Optional local runtimes for judging: Python, Node.js, JDK, and Rust.
|
|
10
50
|
|
|
11
|
-
|
|
51
|
+
Common commands:
|
|
12
52
|
|
|
13
53
|
```bash
|
|
14
54
|
cargo run --
|
|
@@ -23,17 +63,28 @@ Full local check:
|
|
|
23
63
|
make test
|
|
24
64
|
```
|
|
25
65
|
|
|
26
|
-
|
|
66
|
+
## Project Map
|
|
27
67
|
|
|
28
68
|
| Path | Role |
|
|
29
69
|
| --- | --- |
|
|
30
|
-
| `src/core.rs` | Problem
|
|
70
|
+
| `src/core.rs` | Problem storage, state, rendering, judging |
|
|
71
|
+
| `src/i18n.rs` | Loads UI strings from `assets/i18n/*.json` |
|
|
31
72
|
| `src/tui.rs` | Ratatui app, editor, command parser |
|
|
32
73
|
| `src/ai.rs` | Codex/Claude command integration and notes |
|
|
33
74
|
| `src/text.rs` | UTF-8 cursor math and Hangul composition |
|
|
34
75
|
| `src/process.rs` | Process execution helpers |
|
|
35
76
|
| `tests/` | Integration tests split by module |
|
|
36
77
|
|
|
78
|
+
## Change Guidelines
|
|
79
|
+
|
|
80
|
+
- Keep pull requests small and reviewable.
|
|
81
|
+
- Reuse existing helpers and patterns before adding new code.
|
|
82
|
+
- Prefer the Rust standard library. Add crates only when they remove real complexity.
|
|
83
|
+
- Put UI strings in [assets/i18n](../assets/i18n), not inline in Rust code.
|
|
84
|
+
- Keep English localization complete first; other locales can be partial because the runtime falls back per key to English.
|
|
85
|
+
- Keep the root [README](../README.md) focused on users.
|
|
86
|
+
- Use relative links for repo-local docs and assets.
|
|
87
|
+
|
|
37
88
|
## Problem Authoring
|
|
38
89
|
|
|
39
90
|
AI generation reads [problem-authoring-notes.md](problem-authoring-notes.md) every time it creates a problem.
|
|
@@ -42,34 +93,28 @@ Local generated data stays ignored by git:
|
|
|
42
93
|
|
|
43
94
|
| Path | Purpose |
|
|
44
95
|
| --- | --- |
|
|
45
|
-
| `.practicode/problem_bank.json` | Local/custom/generated
|
|
96
|
+
| `.practicode/problem_bank.json` | Local/custom/generated problems |
|
|
46
97
|
| `.practicode/problem_notes.md` | Personal problem-generation notes |
|
|
47
98
|
| `.practicode/problem-state.json` | Current problem, history, settings |
|
|
48
99
|
| `problems/` | Generated problem markdown/index files |
|
|
49
100
|
| `submissions/` | Local answer files |
|
|
50
101
|
|
|
51
|
-
##
|
|
52
|
-
|
|
53
|
-
`main` runs CI only. Releases are tag-based and publish to crates.io and npm through GitHub Actions.
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
make release VERSION=0.1.1
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
The release script checks versions, runs tests, creates the version commit and tag, and pushes `main` plus the tag. Do not print or commit tokens; GitHub Actions uses repository secrets.
|
|
60
|
-
|
|
61
|
-
## Documentation
|
|
62
|
-
|
|
63
|
-
Keep the root [README](../README.md) focused on users. Put contributor workflow, implementation notes, release notes, and design references here or in nearby `docs/` files.
|
|
102
|
+
## Pull Request Checklist
|
|
64
103
|
|
|
65
|
-
|
|
104
|
+
- The change is focused and explained.
|
|
105
|
+
- Relevant checks were run, or the PR says why they were not.
|
|
106
|
+
- Visible TUI changes include a screenshot or short terminal description.
|
|
107
|
+
- User-facing text is in `assets/i18n/*.json`.
|
|
108
|
+
- Local generated data, secrets, tokens, and answer keys are not committed.
|
|
66
109
|
|
|
67
|
-
##
|
|
110
|
+
## References
|
|
68
111
|
|
|
112
|
+
- GitHub contributing guide: https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-open-source
|
|
113
|
+
- GitHub contributing guidelines: https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/setting-guidelines-for-repository-contributors
|
|
114
|
+
- GitHub pull requests: https://docs.github.com/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests
|
|
115
|
+
- Open Source Guides community notes: https://opensource.guide/building-community/
|
|
69
116
|
- WAI-ARIA combobox keyboard interaction: https://www.w3.org/WAI/ARIA/apg/patterns/combobox/
|
|
70
117
|
- Command Line Interface Guidelines: https://clig.dev/
|
|
71
|
-
- GitHub README guidance: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-readmes
|
|
72
|
-
- GitHub relative links and images: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#relative-links
|
|
73
118
|
- Ratatui terminal UI library: https://ratatui.rs/
|
|
74
119
|
- Crossterm terminal backend/events: https://github.com/crossterm-rs/crossterm
|
|
75
120
|
- Kattis problem package format: https://www.kattis.com/problem-package-format/
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Maintaining
|
|
2
|
+
|
|
3
|
+
This guide is for maintainers with commit, tag, or publishing responsibility.
|
|
4
|
+
|
|
5
|
+
Contributor-facing workflow lives in [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
6
|
+
|
|
7
|
+
## Triage
|
|
8
|
+
|
|
9
|
+
- Keep issues actionable: expected behavior, actual behavior, reproduction steps, OS, terminal, and install method.
|
|
10
|
+
- Use small scopes. Ask broad proposals to become one issue or pull request per behavior change.
|
|
11
|
+
- Label approachable work as `good first issue` or `help wanted` when the fix is clear.
|
|
12
|
+
- Close duplicates with a link to the canonical issue.
|
|
13
|
+
|
|
14
|
+
## Pull Request Review
|
|
15
|
+
|
|
16
|
+
- Review the diff file by file.
|
|
17
|
+
- Check correctness, local-first behavior, terminal UX, docs, and tests before style.
|
|
18
|
+
- Prefer focused pull requests. Ask contributors to split unrelated changes.
|
|
19
|
+
- Require checks or a clear reason checks were not run.
|
|
20
|
+
- For visible TUI changes, ask for a screenshot or a short terminal description.
|
|
21
|
+
- Merge only after CI passes and the branch is up to date enough to avoid obvious conflicts.
|
|
22
|
+
|
|
23
|
+
## Release
|
|
24
|
+
|
|
25
|
+
`main` runs CI only. Releases are tag-based and publish to crates.io and npm through GitHub Actions.
|
|
26
|
+
|
|
27
|
+
Preflight:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
git checkout main
|
|
31
|
+
git pull --ff-only origin main
|
|
32
|
+
make test
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Release:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
make release VERSION=0.1.3
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The release script checks versions, runs tests, creates the version commit and tag, and pushes `main` plus the tag.
|
|
42
|
+
|
|
43
|
+
Verify publication:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
gh run list --limit 5
|
|
47
|
+
npm view practicode version
|
|
48
|
+
cargo search practicode --limit 1
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Do not print or commit tokens. Local `.env` and `.npmrc` are ignored; GitHub Actions uses `NPM_TOKEN` and `CRATES_TOKEN` repository secrets.
|
|
52
|
+
|
|
53
|
+
## Documentation Ownership
|
|
54
|
+
|
|
55
|
+
| File | Audience |
|
|
56
|
+
| --- | --- |
|
|
57
|
+
| [../README.md](../README.md) | Users installing and running practicode |
|
|
58
|
+
| [CONTRIBUTING.md](CONTRIBUTING.md) | External contributors opening issues or pull requests |
|
|
59
|
+
| [MAINTAINING.md](MAINTAINING.md) | Maintainers reviewing, triaging, and releasing |
|
|
60
|
+
| [problem-authoring-notes.md](problem-authoring-notes.md) | AI/local problem generation rules |
|
|
61
|
+
|
|
62
|
+
## Maintainer References
|
|
63
|
+
|
|
64
|
+
- GitHub reviewing pull requests: https://docs.github.com/articles/reviewing-proposed-changes-in-a-pull-request
|
|
65
|
+
- GitHub helping reviewers: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/getting-started/helping-others-review-your-changes
|
|
66
|
+
- GitHub healthy contributions: https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions
|
|
67
|
+
- Git contributing through forks: https://git-scm.com/book/en/v2/GitHub-Contributing-to-a-Project
|