saterminal 0.5.0 → 0.5.2
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 +15 -0
- package/package.json +6 -2
- package/src/cli/index.ts +0 -0
- package/src/text/wrap.ts +2 -1
- package/tsconfig.json +34 -0
package/README.md
CHANGED
|
@@ -23,6 +23,13 @@ bun install
|
|
|
23
23
|
bun run dev
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
+
Build and run the packaged application directly with Nix:
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
nix build
|
|
30
|
+
./result/bin/sat --help
|
|
31
|
+
```
|
|
32
|
+
|
|
26
33
|
The first launch asks before creating `~/.saterminal`. Choose a focus, press Enter, and start answering. Everything needed for practice is already in the package.
|
|
27
34
|
|
|
28
35
|
Practice deliberately hides difficulty, domain, and skill while a question is active. The header shows only the running timer. After submitting, the answer screen restores the complete question beside the marked choices and explanation, then reveals timing and question metadata for review.
|
|
@@ -166,4 +173,12 @@ This is the only normal workflow that needs the network. It downloads Practice S
|
|
|
166
173
|
nix develop -c bun run typecheck
|
|
167
174
|
nix develop -c bun test
|
|
168
175
|
nix develop -c bun run src/cli/index.ts --help
|
|
176
|
+
nix build
|
|
177
|
+
./result/bin/sat --version
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
When `bun.lock` changes, regenerate the committed Nix dependency expression before building:
|
|
181
|
+
|
|
182
|
+
```sh
|
|
183
|
+
nix develop -c bun run nix:deps
|
|
169
184
|
```
|
package/package.json
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "saterminal",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"sat": "src/cli/index.ts"
|
|
7
7
|
},
|
|
8
8
|
"files": [
|
|
9
9
|
"data",
|
|
10
|
-
"src"
|
|
10
|
+
"src",
|
|
11
|
+
"tsconfig.json"
|
|
11
12
|
],
|
|
12
13
|
"scripts": {
|
|
13
14
|
"dev": "bun run src/cli/index.ts",
|
|
14
15
|
"start": "bun run src/cli/index.ts",
|
|
16
|
+
"nix:deps": "bun2nix -o nix/bun.nix",
|
|
15
17
|
"update-bank": "bun run scripts/update-question-bank.ts",
|
|
16
18
|
"test": "bun test",
|
|
17
19
|
"typecheck": "tsc --noEmit"
|
|
@@ -23,6 +25,7 @@
|
|
|
23
25
|
"node-html-parser": "^9.0.0",
|
|
24
26
|
"pastel": "4.0.1",
|
|
25
27
|
"react": "19.2.0",
|
|
28
|
+
"wrap-ansi": "^9.0.2",
|
|
26
29
|
"zod": "4"
|
|
27
30
|
},
|
|
28
31
|
"devDependencies": {
|
|
@@ -30,6 +33,7 @@
|
|
|
30
33
|
"@types/he": "^1.2.3",
|
|
31
34
|
"@types/react": "19.2.0",
|
|
32
35
|
"p-limit": "^7.3.0",
|
|
36
|
+
"react-devtools-core": "7.0.1",
|
|
33
37
|
"typescript": "^7.0.2"
|
|
34
38
|
}
|
|
35
39
|
}
|
package/src/cli/index.ts
CHANGED
|
File without changes
|
package/src/text/wrap.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import wrapAnsi from "wrap-ansi";
|
|
1
2
|
import { appendSegment, stylesEqual, type TextSegment, type TextStyle } from "@/text/rich-text.ts";
|
|
2
3
|
|
|
3
4
|
export function wrapSegments(segments: TextSegment[], width: number): TextSegment[][] {
|
|
@@ -55,5 +56,5 @@ export function wrapSegments(segments: TextSegment[], width: number): TextSegmen
|
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
export function wrapText(value: string, width: number): string[] {
|
|
58
|
-
return
|
|
59
|
+
return wrapAnsi(value, Math.max(1, width), { hard: false }).split("\n").map((line) => line.trim());
|
|
59
60
|
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "Bundler",
|
|
6
|
+
"jsx": "react-jsx",
|
|
7
|
+
"strict": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"types": [
|
|
10
|
+
"bun"
|
|
11
|
+
],
|
|
12
|
+
"allowImportingTsExtensions": true,
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"paths": {
|
|
15
|
+
"@/*": [
|
|
16
|
+
"./src/*"
|
|
17
|
+
],
|
|
18
|
+
"@data/*": [
|
|
19
|
+
"./data/*"
|
|
20
|
+
],
|
|
21
|
+
"@scripts/*": [
|
|
22
|
+
"./scripts/*"
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"include": [
|
|
27
|
+
"src/**/*.ts",
|
|
28
|
+
"src/**/*.tsx",
|
|
29
|
+
"src/**/*.d.ts",
|
|
30
|
+
"test/**/*.ts",
|
|
31
|
+
"test/**/*.tsx",
|
|
32
|
+
"scripts/**/*.ts"
|
|
33
|
+
]
|
|
34
|
+
}
|