dracosh 0.1.0 → 0.3.0

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.
Files changed (61) hide show
  1. package/README.md +49 -22
  2. package/assets/sounds/badge-1.wav +0 -0
  3. package/assets/sounds/badge-2.wav +0 -0
  4. package/assets/sounds/badge-3.wav +0 -0
  5. package/assets/sounds/badge-4.wav +0 -0
  6. package/locales/de.json +1046 -0
  7. package/locales/en.json +1029 -0
  8. package/locales/fr.json +1094 -0
  9. package/locales/pl.json +1117 -0
  10. package/locales/uk.json +1118 -0
  11. package/package.json +2 -2
  12. package/src/alerts.js +7 -4
  13. package/src/backup.js +96 -0
  14. package/src/cardline.js +71 -0
  15. package/src/cli.js +106 -38
  16. package/src/commands.js +15 -13
  17. package/src/demo.js +11 -0
  18. package/src/diff.js +13 -7
  19. package/src/i18n.js +68 -0
  20. package/src/judge.js +51 -12
  21. package/src/library.js +154 -0
  22. package/src/lock.js +64 -0
  23. package/src/manage.js +165 -0
  24. package/src/pause.js +22 -0
  25. package/src/progress.js +202 -93
  26. package/src/quiet.js +4 -3
  27. package/src/scheduler.js +39 -30
  28. package/src/session.js +181 -33
  29. package/src/settings.js +15 -13
  30. package/src/starter.js +47 -0
  31. package/src/store.js +58 -17
  32. package/src/tips.js +17 -25
  33. package/src/ui/AddCard.js +496 -0
  34. package/src/ui/AnswerInput.js +28 -13
  35. package/src/ui/App.js +360 -89
  36. package/src/ui/BadgeUnlock.js +51 -0
  37. package/src/ui/Badges.js +79 -20
  38. package/src/ui/Choice.js +38 -0
  39. package/src/ui/Companion.js +24 -39
  40. package/src/ui/Confetti.js +2 -2
  41. package/src/ui/Decks.js +99 -0
  42. package/src/ui/DieRoll.js +104 -0
  43. package/src/ui/Evolution.js +11 -10
  44. package/src/ui/Hatch.js +9 -7
  45. package/src/ui/Header.js +62 -19
  46. package/src/ui/Help.js +74 -0
  47. package/src/ui/Mascot.js +89 -40
  48. package/src/ui/Missed.js +15 -13
  49. package/src/ui/Preview.js +123 -29
  50. package/src/ui/Reset.js +71 -0
  51. package/src/ui/Settings.js +34 -23
  52. package/src/ui/Stats.js +28 -24
  53. package/src/ui/Summary.js +18 -10
  54. package/src/ui/TheOne.js +122 -0
  55. package/src/ui/icons.js +156 -25
  56. package/src/ui/kit.js +87 -2
  57. package/src/vacation.js +9 -3
  58. package/src/words.js +22 -14
  59. package/assets/sounds/badge.wav +0 -0
  60. package/data/tips.json +0 -1362
  61. package/src/ui/Tip.js +0 -25
package/README.md CHANGED
@@ -2,16 +2,29 @@
2
2
 
3
3
  A gamified language or definitions trainer for your terminal. It sits in a spare pane, challenges you every few minutes, and a small pixel dragon grows up as you keep your streak going.
4
4
 
5
+ ## Why Dracosh
6
+
7
+ Learning a language usually means another hour in the evening, after a full day at the computer. I spent plenty of those evenings myself, and I wanted something that fits into the working day instead.
8
+
9
+ The day is full of short waits: a build that takes a minute, tests running, an AI agent finishing a task for you. Dracosh turns those moments into practice. Instead of reaching for your phone, you answer a word or two, the dragon cheers, and you're back to work. A few minutes here and there add up, and your evenings stay yours.
10
+
11
+ It's made for people who live in a terminal or spend most of the day at a computer, and it's meant to be fun, not one more chore.
12
+
5
13
  ## Features
6
14
 
7
- - Words come from your Anki deck (read-only, through AnkiConnect), so your Anki cards and schedule stay untouched
8
- - Asks both ways: EN → PL and PL → EN
9
- - Forgiving answer checks: case and Polish diacritics don't matter, one typo is fine on longer words, and after a miss you see letter by letter where you went wrong
10
- - Leitner boxes, so the words you know come back less and less often
11
- - Daily goal, streaks (weekends and vacations don't break them) and 32 badges
15
+ - Your cards live in Dracosh's own library, organised in decks; no other app needs to be running
16
+ - Add cards, start decks and switch between them right in the app (`/add`, `/decks`)
17
+ - One line is a card: `kot = cat; kitty // Mój kot śpi.` (`;` separates right answers, `//` adds an example). Paste a whole list and check it before it's saved
18
+ - Each deck is asked the way you pick after its first card: front → back, back → front, or both ways; change it any time in `/decks`
19
+ - Type the answer, or press Enter with nothing typed to see it and say whether you knew it (`1` or `2`): handy for whole sentences, and it counts just the same
20
+ - Cloze cards for sentences: `I {{look forward}} to it` asks one gap at a time
21
+ - Forgiving answer checks: case and punctuation don't matter, a missing Polish letter (ż, ó, ł…) still counts and shows the right spelling, one typo is fine on longer words, and after a miss you see letter by letter where you went wrong
22
+ - Leitner boxes, so the cards you know come back less and less often; a card is only asked when it's due
23
+ - Daily goal, streaks (weekends and days off don't break them) and 36 badges (one of them a secret)
12
24
  - A pixel dragon that hatches from an egg, evolves over a year of streaks, blinks, and falls asleep if you ignore it
13
25
  - 8-bit sound effects, generated from code
14
- - A short grammar tip while you wait for the next word
26
+ - Now and then, a short tip about Dracosh while you wait for the next card
27
+ - Speaks English, Polish, German, French and Ukrainian: it follows your system's language, and `/settings` switches it
15
28
 
16
29
  ## Install
17
30
 
@@ -21,42 +34,44 @@ You need Node 22 or newer.
21
34
  npm install -g dracosh
22
35
  ```
23
36
 
24
- Words are read from [Anki](https://apps.ankiweb.net/) with the [AnkiConnect](https://git.sr.ht/~foosoft/anki-connect) add-on, so Anki has to be running. If it's closed, Dracosh uses the last word list it saw.
37
+ A fresh install starts with a short "Getting started" deck, in the app's language: a tour where every card tells you what to type and shows you one more thing Dracosh can do. When you're through, `/add` starts your own deck and the tour makes room for it. Importing decks (from Anki, CSV and more) is on the way, see [What's next](#whats-next).
25
38
 
26
- Just want to look around? `dracosh --preview` shows every screen and animation on made-up data, no Anki needed.
39
+ Want a look first? `dracosh --preview` shows every screen and animation on made-up data.
27
40
 
28
41
  ## Usage
29
42
 
30
43
  ```bash
31
- dracosh --deck "My Deck" # quiz from this Anki deck (default: "English")
32
- dracosh --every 5m # a word every 5 minutes instead of 10, this run only
44
+ dracosh --deck "Polish" # quiz this deck, this run only (otherwise the one picked in /decks)
45
+ dracosh --every 5m # a card every 5 minutes instead of 10, this run only
33
46
  dracosh --no-sound
34
47
  dracosh --stats # print your progress and exit
48
+ dracosh --data # show where your cards, progress and backups are kept
35
49
  dracosh --preview
50
+ dracosh restore # list your backups; dracosh restore 2 brings one back
36
51
  ```
37
52
 
38
- Type the answer and press Enter. Press `/` for commands:
53
+ Type the answer and press Enter. Not sure, or the answer is a whole sentence? Press Enter with nothing typed: the answer shows up, then press `1` if you didn't know it or `2` if you did. Press `/` for commands:
39
54
 
40
55
  | Command | What it does |
41
56
  | --- | --- |
57
+ | `/add` | add cards to one of your decks, or start a new deck (one line per card, ↑ fixes the last one) |
58
+ | `/decks` | switch to another deck (Dracosh remembers it), start a new one, or press → to change how a deck is asked |
42
59
  | `/hint` | reveal one more letter |
43
- | `/correct` | your answer was right after all; it's accepted from now on |
44
- | `/skip` | skip this word |
45
- | `/settings` | interval, daily goal, sound, quiet hours, weekends, tips, direction |
60
+ | `/correct` | your answer was right after all; after a yes it's accepted from now on |
61
+ | `/settings` | language, rhythm (a card every few minutes, or a study session), interval, daily goal, sound, quiet hours, weekends, tips, and a reset |
46
62
  | `/stats` | streak and a calendar of your month |
47
63
  | `/badges` | all badges and how to get them |
48
- | `/companion` | every form your dragon can take |
49
- | `/missed` | words you got wrong today |
50
- | `/tip` | a random grammar tip |
51
- | `/snooze 30m` | pause questions for a while |
52
- | `/vacation 7` | days off that keep your streak safe |
64
+ | `/companion` | your dragon, its element and the forms ahead |
65
+ | `/missed` | cards you got wrong today |
66
+ | `/pause 30m` | a break: `30m`, `2h`; or days off that keep your streak: `3d`, `24.12 2.01`; `off` ends it |
67
+ | `/help` | the keys, how cards come back, the streak |
53
68
  | `/quit` | quit (you'll get a short session summary) |
54
69
 
55
- They're slash commands because "skip" and "quit" are perfectly good English answers.
70
+ They're slash commands because "pause" and "quit" are perfectly good English answers.
56
71
 
57
72
  ## Your data
58
73
 
59
- Everything stays on your machine, in `~/.dracosh`. Progress is saved after every answer, so you can quit any time. To use Dracosh on two computers, put that folder somewhere synced and point `DRACOSH_HOME` at it.
74
+ Everything stays on your machine, in `~/.dracosh`; `dracosh --data` shows what's there. Progress is saved after every answer, so you can quit any time. One quiz runs at a time: a second window on the same data is refused, so the two can't overwrite each other's progress. The first start of each day also saves a backup of your cards, progress and settings to `~/.dracosh/backups` (the last 7 are kept); `dracosh restore` brings one back, and backs up what you have first, so a restore can be undone too. To start over, `/settings` → Reset clears your progress only (badges, streak, the dragon) or everything; a backup is made first. To use Dracosh on two computers, put that folder somewhere synced and point `DRACOSH_HOME` at it.
60
75
 
61
76
  Sounds currently play on macOS only.
62
77
 
@@ -70,7 +85,19 @@ npm link # puts `dracosh` on your PATH
70
85
  npm test
71
86
  ```
72
87
 
73
- The quiz logic in `src/session.js` and `src/progress.js` does no I/O, which keeps it easy to test. The UI is built with [Ink](https://github.com/vadimdemedes/ink) and lives in `src/ui/`. Sound effects are generated by `scripts/make-sounds.js` (`npm run sounds`).
88
+ The quiz logic in `src/session.js` and `src/progress.js` does no I/O, which keeps it easy to test. The UI is built with [Ink](https://github.com/vadimdemedes/ink) and lives in `src/ui/`; every text it shows is in `locales/en.json`, read through `t("key")` from `src/i18n.js`.
89
+
90
+ The other languages live next to it in `locales/`, the tour included. `npm test` checks that each one has every English key, the same `{placeholders}` and all the plural forms its language needs. If you're a native speaker and something reads oddly, a pull request is very welcome. Sound effects are generated by `scripts/make-sounds.js` (`npm run sounds`).
91
+
92
+ ## What's next
93
+
94
+ Dracosh now keeps its own card library, with a short tour and `/add` to start your own deck. Coming next, roughly in this order:
95
+
96
+ - More languages for your decks: answer checking that forgives a missing accent in European languages and Cyrillic (other scripts are checked exactly).
97
+ - Import and export: Anki (plain-text exports and `.apkg` decks from AnkiWeb), CSV, JSON and pasted lists, and export back to Anki.
98
+ - Decks and cards in the app: browse, edit and delete with undo, plus a welcome flow for new users.
99
+ - Optional AI help for writing cards, with your own API key or a local model.
100
+ - Linux and Windows.
74
101
 
75
102
  ## License
76
103
 
Binary file
Binary file
Binary file
Binary file