rv-bible-cli 0.1.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.
- package/README.md +159 -0
- package/dist/db.d.ts +63 -0
- package/dist/db.js +153 -0
- package/dist/format.d.ts +13 -0
- package/dist/format.js +258 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +561 -0
- package/dist/parser.d.ts +20 -0
- package/dist/parser.js +320 -0
- package/dist/state.d.ts +6 -0
- package/dist/state.js +30 -0
- package/dist/ui/Pager.d.ts +5 -0
- package/dist/ui/Pager.js +999 -0
- package/dist/ui/nav.d.ts +6 -0
- package/dist/ui/nav.js +37 -0
- package/package.json +60 -0
- package/rv.db +0 -0
package/dist/ui/nav.d.ts
ADDED
package/dist/ui/nav.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { getBookInfo, getAllBooks } from '../db.js';
|
|
2
|
+
let bookOrder = null;
|
|
3
|
+
function getBookOrder() {
|
|
4
|
+
if (!bookOrder) {
|
|
5
|
+
bookOrder = getAllBooks().map(b => b.abbr);
|
|
6
|
+
}
|
|
7
|
+
return bookOrder;
|
|
8
|
+
}
|
|
9
|
+
export function getNextChapter(book, chapter) {
|
|
10
|
+
const info = getBookInfo(book);
|
|
11
|
+
if (!info)
|
|
12
|
+
return null;
|
|
13
|
+
if (chapter < info.chapter_count) {
|
|
14
|
+
return { book, chapter: chapter + 1 };
|
|
15
|
+
}
|
|
16
|
+
// Cross-book: next book, chapter 1
|
|
17
|
+
const order = getBookOrder();
|
|
18
|
+
const idx = order.indexOf(book);
|
|
19
|
+
if (idx < 0 || idx >= order.length - 1)
|
|
20
|
+
return null; // end of Bible
|
|
21
|
+
return { book: order[idx + 1], chapter: 1 };
|
|
22
|
+
}
|
|
23
|
+
export function getPrevChapter(book, chapter) {
|
|
24
|
+
if (chapter > 1) {
|
|
25
|
+
return { book, chapter: chapter - 1 };
|
|
26
|
+
}
|
|
27
|
+
// Cross-book: previous book, last chapter
|
|
28
|
+
const order = getBookOrder();
|
|
29
|
+
const idx = order.indexOf(book);
|
|
30
|
+
if (idx <= 0)
|
|
31
|
+
return null; // start of Bible
|
|
32
|
+
const prevBook = order[idx - 1];
|
|
33
|
+
const prevInfo = getBookInfo(prevBook);
|
|
34
|
+
if (!prevInfo)
|
|
35
|
+
return null;
|
|
36
|
+
return { book: prevBook, chapter: prevInfo.chapter_count };
|
|
37
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rv-bible-cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Fast, offline terminal Bible reader for the Recovery Version. Footnotes, cross-references, concordance search, interactive pager.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"rv": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist/",
|
|
12
|
+
"rv.db",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc",
|
|
17
|
+
"watch": "tsc --watch",
|
|
18
|
+
"dev": "tsx src/index.ts",
|
|
19
|
+
"test": "node --test --import tsx/esm src/**/*.test.ts",
|
|
20
|
+
"prepublishOnly": "npm run build && npm run test"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"bible",
|
|
24
|
+
"recovery-version",
|
|
25
|
+
"cli",
|
|
26
|
+
"terminal",
|
|
27
|
+
"scripture",
|
|
28
|
+
"footnotes",
|
|
29
|
+
"concordance",
|
|
30
|
+
"bible-study",
|
|
31
|
+
"offline",
|
|
32
|
+
"pager"
|
|
33
|
+
],
|
|
34
|
+
"author": "Michael Liu",
|
|
35
|
+
"license": "ISC",
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "private"
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=18.0.0"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"chalk": "^5.6.2",
|
|
45
|
+
"clipboardy": "^5.3.1",
|
|
46
|
+
"commander": "^14.0.3",
|
|
47
|
+
"ink": "^6.8.0",
|
|
48
|
+
"react": "^19.2.4",
|
|
49
|
+
"sql.js": "^1.14.1",
|
|
50
|
+
"toml": "^3.0.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@types/node": "^25.3.5",
|
|
54
|
+
"@types/react": "^19.2.14",
|
|
55
|
+
"@types/sql.js": "^1.4.11",
|
|
56
|
+
"ts-node": "^10.9.2",
|
|
57
|
+
"tsx": "^4.21.0",
|
|
58
|
+
"typescript": "^5.9.3"
|
|
59
|
+
}
|
|
60
|
+
}
|
package/rv.db
ADDED
|
Binary file
|