@ihsandeen/aya 1.0.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/CONTRIBUTING.md +39 -0
- package/LICENSE +21 -0
- package/README.md +141 -0
- package/dist/commands/adab.js +28 -0
- package/dist/commands/adhan.js +58 -0
- package/dist/commands/anatomy.js +29 -0
- package/dist/commands/blame.js +29 -0
- package/dist/commands/commit.js +44 -0
- package/dist/commands/diff.js +54 -0
- package/dist/commands/dua.js +34 -0
- package/dist/commands/fast.js +36 -0
- package/dist/commands/friday.js +21 -0
- package/dist/commands/hero.js +69 -0
- package/dist/commands/hijri.js +42 -0
- package/dist/commands/history.js +98 -0
- package/dist/commands/init.js +54 -0
- package/dist/commands/invest.js +26 -0
- package/dist/commands/journal.js +84 -0
- package/dist/commands/journey.js +24 -0
- package/dist/commands/lens.js +58 -0
- package/dist/commands/memorize.js +117 -0
- package/dist/commands/mirror.js +47 -0
- package/dist/commands/names.js +48 -0
- package/dist/commands/nature.js +28 -0
- package/dist/commands/nazm.js +100 -0
- package/dist/commands/parable.js +332 -0
- package/dist/commands/prayers.js +63 -0
- package/dist/commands/pull.js +28 -0
- package/dist/commands/push.js +156 -0
- package/dist/commands/qibla.js +118 -0
- package/dist/commands/repo.js +34 -0
- package/dist/commands/sabr.js +32 -0
- package/dist/commands/scene.js +54 -0
- package/dist/commands/seek.js +28 -0
- package/dist/commands/shukr.js +22 -0
- package/dist/commands/sleep.js +26 -0
- package/dist/commands/sound.js +35 -0
- package/dist/commands/status.js +109 -0
- package/dist/commands/sunnah.js +24 -0
- package/dist/commands/tafsir.js +89 -0
- package/dist/commands/tasbih.js +50 -0
- package/dist/commands/wudu.js +22 -0
- package/dist/commands/zakat.js +72 -0
- package/dist/data/commands-db.js +365 -0
- package/dist/data/events.js +105 -0
- package/dist/data/gems.js +160 -0
- package/dist/data/nak.js +616 -0
- package/dist/data/tafsir.js +157 -0
- package/dist/data/vocab.js +105 -0
- package/dist/index.js +86 -0
- package/dist/server.js +140 -0
- package/dist/utils/config.js +38 -0
- package/dist/utils/logger.js +104 -0
- package/dist/utils/printer.js +36 -0
- package/docs/index.html +1048 -0
- package/docs/repo.html +952 -0
- package/package.json +55 -0
- package/public/hero.html +285 -0
- package/public/index.html +1039 -0
- package/public/repo.html +904 -0
- package/src/commands/adab.ts +24 -0
- package/src/commands/adhan.ts +55 -0
- package/src/commands/anatomy.ts +25 -0
- package/src/commands/blame.ts +31 -0
- package/src/commands/commit.ts +42 -0
- package/src/commands/diff.ts +56 -0
- package/src/commands/dua.ts +34 -0
- package/src/commands/fast.ts +35 -0
- package/src/commands/friday.ts +17 -0
- package/src/commands/hero.ts +73 -0
- package/src/commands/hijri.ts +43 -0
- package/src/commands/history.ts +103 -0
- package/src/commands/init.ts +53 -0
- package/src/commands/invest.ts +22 -0
- package/src/commands/journal.ts +97 -0
- package/src/commands/journey.ts +20 -0
- package/src/commands/lens.ts +58 -0
- package/src/commands/memorize.ts +131 -0
- package/src/commands/mirror.ts +48 -0
- package/src/commands/names.ts +46 -0
- package/src/commands/nature.ts +24 -0
- package/src/commands/nazm.ts +102 -0
- package/src/commands/parable.ts +360 -0
- package/src/commands/prayers.ts +65 -0
- package/src/commands/pull.ts +28 -0
- package/src/commands/push.ts +171 -0
- package/src/commands/qibla.ts +127 -0
- package/src/commands/repo.ts +34 -0
- package/src/commands/sabr.ts +28 -0
- package/src/commands/scene.ts +56 -0
- package/src/commands/seek.ts +24 -0
- package/src/commands/shukr.ts +19 -0
- package/src/commands/sleep.ts +23 -0
- package/src/commands/sound.ts +34 -0
- package/src/commands/status.ts +132 -0
- package/src/commands/sunnah.ts +21 -0
- package/src/commands/tafsir.ts +86 -0
- package/src/commands/tasbih.ts +49 -0
- package/src/commands/wudu.ts +19 -0
- package/src/commands/zakat.ts +73 -0
- package/src/data/commands-db.ts +372 -0
- package/src/data/events.ts +113 -0
- package/src/data/gems.ts +163 -0
- package/src/data/nak.ts +805 -0
- package/src/data/tafsir.ts +165 -0
- package/src/data/vocab.ts +114 -0
- package/src/index.ts +94 -0
- package/src/server.ts +128 -0
- package/src/utils/config.ts +44 -0
- package/src/utils/logger.ts +122 -0
- package/src/utils/printer.ts +38 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tafsirData = void 0;
|
|
4
|
+
exports.tafsirData = [
|
|
5
|
+
{
|
|
6
|
+
surah: 'Ad-Duhaa',
|
|
7
|
+
ayah: 3,
|
|
8
|
+
steps: [
|
|
9
|
+
{
|
|
10
|
+
word: 'Maa',
|
|
11
|
+
meaning: 'Not / Negation',
|
|
12
|
+
explanation: 'The sentence starts with a strong negation. Allah is immediately shutting down the whispers of the disbelievers who said He had abandoned the Prophet (saw).'
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
word: 'wadda\'aka',
|
|
16
|
+
meaning: 'He said goodbye / He bid farewell',
|
|
17
|
+
explanation: 'From "wada\'a". This isn\'t just "left". It\'s a warm, affectionate goodbye. Like when a mother says goodbye to her child. Allah is saying "I didn\'t even say a warm goodbye to you, let alone abandon you."'
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
word: 'Rabbuka',
|
|
21
|
+
meaning: 'Your Lord / Your Master / Your Sustainer',
|
|
22
|
+
explanation: 'He didn\'t say "Allah". He said "Your Lord". The one who has been raising you, sustaining you, and caring for you from the beginning. It\'s personal. "YOUR" Lord.'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
word: 'wa maa qalaa',
|
|
26
|
+
meaning: 'And He is not displeased / He does not hate',
|
|
27
|
+
explanation: '"Qalaa" means intense displeasure or hate. Notice He didn\'t say "wa maa qalaa-ka" (He is not displeased with YOU). He left out the "you" (ka). Why? Because He loves the Prophet (saw) so much, He didn\'t even want to put the word "hate" and "you" in the same sentence. SubhanAllah.'
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
finalThought: "If you feel distant from Allah, know that He hasn't said goodbye. He is your Rabb. He is sustaining you even in your silence."
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
surah: 'Al-Fatiha',
|
|
34
|
+
ayah: 5,
|
|
35
|
+
steps: [
|
|
36
|
+
{
|
|
37
|
+
word: 'Iyyaka',
|
|
38
|
+
meaning: 'Only You',
|
|
39
|
+
explanation: 'Grammatically, "Na\'budu" (We worship) should come first. But Allah placed "Iyyaka" (Only You) at the front. This is "Taqdeem" for "Ikhtisas" (Exclusivity). Not "We worship You", but "It is ONLY You we worship".'
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
word: 'Na\'budu',
|
|
43
|
+
meaning: 'We worship / We enslave ourselves',
|
|
44
|
+
explanation: 'From "Abd" (Slave). Worship isn\'t just prayer. It is slavery. It is total submission. And notice "We". Even when you pray alone, you are part of the "We"—the Ummah.'
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
word: 'Wa Iyyaka',
|
|
48
|
+
meaning: 'And Only You',
|
|
49
|
+
explanation: 'Repetition for emphasis. We are not just monotheists in worship, but monotheists in seeking help.'
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
word: 'Nasta\'een',
|
|
53
|
+
meaning: 'We seek help / We ask for aid',
|
|
54
|
+
explanation: 'From "Isti\'anah". This isn\'t just "help me lift this box". It is asking for help in a matter you are already struggling with. You have to make the effort first, then ask for His aid to complete it.'
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
finalThought: "You can't skip to 'Nasta'een' (Help me) without first committing to 'Na'budu' (I am your slave). The help comes to the one who serves."
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
surah: 'Al-Asr',
|
|
61
|
+
ayah: 1,
|
|
62
|
+
steps: [
|
|
63
|
+
{
|
|
64
|
+
word: 'Wal-Asr',
|
|
65
|
+
meaning: 'By Time',
|
|
66
|
+
explanation: 'Allah swears by "Time" (Asr). But Asr isn\'t just time; it\'s the squeezing of time. It\'s the late afternoon when the day is slipping away. He is swearing by the very thing we are losing every second.'
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
word: 'Inna',
|
|
70
|
+
meaning: 'Indeed / Verily',
|
|
71
|
+
explanation: 'Emphasis. No doubt about it.'
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
word: 'Al-Insaan',
|
|
75
|
+
meaning: 'The Human Being',
|
|
76
|
+
explanation: 'He didn\'t say "The Disbeliever". He said "The Human". Every single one of us. We are all in the same boat.'
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
word: 'La-fee Khusr',
|
|
80
|
+
meaning: 'Is surely in loss',
|
|
81
|
+
explanation: 'We aren\'t "going" to be in loss. We are *drowning* in loss right now. Like ice melting. Every breath is a capital loss unless invested.'
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
finalThought: "You are running out of time. The only way to stop the loss is to invest your time in Iman and good deeds."
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
surah: 'Al-Ikhlas',
|
|
88
|
+
ayah: 1,
|
|
89
|
+
steps: [
|
|
90
|
+
{
|
|
91
|
+
word: 'Qul',
|
|
92
|
+
meaning: 'Say / Declare',
|
|
93
|
+
explanation: 'A direct command. Don\'t just know it, announce it. This is your identity.'
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
word: 'Huwa Allahu',
|
|
97
|
+
meaning: 'He is Allah',
|
|
98
|
+
explanation: 'The name Allah is unique. It has no plural, no gender. It is the proper name of God.'
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
word: 'Ahad',
|
|
102
|
+
meaning: 'The One / The Unique',
|
|
103
|
+
explanation: 'Not "Wahid" (one in number), but "Ahad" (Unique in every way). There is nothing comparable to Him. He is a category of One.'
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
finalThought: "Purify your concept of God. He is not like anything you can imagine."
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
surah: 'Al-Falaq',
|
|
110
|
+
ayah: 1,
|
|
111
|
+
steps: [
|
|
112
|
+
{
|
|
113
|
+
word: 'Qul',
|
|
114
|
+
meaning: 'Say',
|
|
115
|
+
explanation: 'Again, a command to seek refuge actively.'
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
word: 'A\'udhu',
|
|
119
|
+
meaning: 'I seek refuge / I take cover',
|
|
120
|
+
explanation: 'Imagine a fortress. You are running into it for safety. You are admitting you are weak and need protection.'
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
word: 'Bi Rabbil Falaq',
|
|
124
|
+
meaning: 'In the Lord of the Daybreak',
|
|
125
|
+
explanation: 'Falaq is the splitting of darkness by light. Just as He splits the night to bring the dawn, He can split your problems to bring relief.'
|
|
126
|
+
}
|
|
127
|
+
],
|
|
128
|
+
finalThought: "Darkness is temporary. The Lord of the Dawn is always ready to bring the light."
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
surah: 'An-Nas',
|
|
132
|
+
ayah: 1,
|
|
133
|
+
steps: [
|
|
134
|
+
{
|
|
135
|
+
word: 'Qul A\'udhu',
|
|
136
|
+
meaning: 'Say: I seek refuge',
|
|
137
|
+
explanation: 'We start with seeking protection again.'
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
word: 'Bi Rabbin-Nas',
|
|
141
|
+
meaning: 'In the Lord of Mankind',
|
|
142
|
+
explanation: 'He created us, sustains us, and owns us.'
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
word: 'Malikin-Nas',
|
|
146
|
+
meaning: 'The King of Mankind',
|
|
147
|
+
explanation: 'He has full authority over all people, including those who wish you harm.'
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
word: 'Ilahin-Nas',
|
|
151
|
+
meaning: 'The God of Mankind',
|
|
152
|
+
explanation: 'The only one worthy of worship and total devotion.'
|
|
153
|
+
}
|
|
154
|
+
],
|
|
155
|
+
finalThought: "He is your Lord, your King, and your God. Who can harm you when you are with Him?"
|
|
156
|
+
}
|
|
157
|
+
];
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.vocabList = void 0;
|
|
4
|
+
exports.vocabList = [
|
|
5
|
+
// Surah Al-Fatiha
|
|
6
|
+
{
|
|
7
|
+
id: 'fatiha_1',
|
|
8
|
+
ayah: '_____ iyyaka na\'budu wa iyyaka nasta\'een (1:5)',
|
|
9
|
+
missingWord: '[?]',
|
|
10
|
+
answer: 'Iyyaka',
|
|
11
|
+
meaning: 'Only You',
|
|
12
|
+
category: 'fatiha'
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: 'fatiha_2',
|
|
16
|
+
ayah: 'Ihdina al-sirat al-_____ (1:6)',
|
|
17
|
+
missingWord: '[?]',
|
|
18
|
+
answer: 'mustaqeem',
|
|
19
|
+
meaning: 'straight / upright',
|
|
20
|
+
category: 'fatiha'
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: 'fatiha_3',
|
|
24
|
+
ayah: 'Maliki yawm al-_____ (1:4)',
|
|
25
|
+
missingWord: '[?]',
|
|
26
|
+
answer: 'deen',
|
|
27
|
+
meaning: 'judgment / recompense',
|
|
28
|
+
category: 'fatiha'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: 'fatiha_4',
|
|
32
|
+
ayah: 'Al-hamdu lillahi rabbi al-_____ (1:2)',
|
|
33
|
+
missingWord: '[?]',
|
|
34
|
+
answer: 'alameen',
|
|
35
|
+
meaning: 'worlds / universe',
|
|
36
|
+
category: 'fatiha'
|
|
37
|
+
},
|
|
38
|
+
// Names of Allah
|
|
39
|
+
{
|
|
40
|
+
id: 'names_1',
|
|
41
|
+
ayah: 'Wa huwa al-Ghafoor al-_____ (85:14)',
|
|
42
|
+
missingWord: '[?]',
|
|
43
|
+
answer: 'wadood',
|
|
44
|
+
meaning: 'The Loving / Affectionate',
|
|
45
|
+
category: 'names_of_allah'
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 'names_2',
|
|
49
|
+
ayah: 'Qul huwa Allahu _____ (112:1)',
|
|
50
|
+
missingWord: '[?]',
|
|
51
|
+
answer: 'ahad',
|
|
52
|
+
meaning: 'The One / Unique',
|
|
53
|
+
category: 'names_of_allah'
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: 'names_3',
|
|
57
|
+
ayah: 'Ar-Rahman _____ (55:1)',
|
|
58
|
+
missingWord: '[?]',
|
|
59
|
+
answer: 'Ar-Raheem',
|
|
60
|
+
meaning: 'The Most Merciful',
|
|
61
|
+
category: 'names_of_allah'
|
|
62
|
+
},
|
|
63
|
+
// Common Words
|
|
64
|
+
{
|
|
65
|
+
id: 'common_1',
|
|
66
|
+
ayah: 'Inna ma\'al usri _____ (94:6)',
|
|
67
|
+
missingWord: '[?]',
|
|
68
|
+
answer: 'yusra',
|
|
69
|
+
meaning: 'relief / ease',
|
|
70
|
+
category: 'common'
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 'common_2',
|
|
74
|
+
ayah: 'Hasbuna Allah wa ni\'mal _____ (3:173)',
|
|
75
|
+
missingWord: '[?]',
|
|
76
|
+
answer: 'wakil',
|
|
77
|
+
meaning: 'disposer of affairs / trustee',
|
|
78
|
+
category: 'common'
|
|
79
|
+
},
|
|
80
|
+
// Short Surahs
|
|
81
|
+
{
|
|
82
|
+
id: 'short_1',
|
|
83
|
+
ayah: 'Wama _____ rabbuka wama qalaa (93:3)',
|
|
84
|
+
missingWord: '[?]',
|
|
85
|
+
answer: 'wadda\'aka',
|
|
86
|
+
meaning: 'said goodbye / abandoned',
|
|
87
|
+
category: 'short_surahs'
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: 'short_2',
|
|
91
|
+
ayah: 'Inna a\'tayna kal _____ (108:1)',
|
|
92
|
+
missingWord: '[?]',
|
|
93
|
+
answer: 'kawthar',
|
|
94
|
+
meaning: 'abundance / river in paradise',
|
|
95
|
+
category: 'short_surahs'
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
id: 'short_3',
|
|
99
|
+
ayah: 'Idha ja\'a nasrullahi wal _____ (110:1)',
|
|
100
|
+
missingWord: '[?]',
|
|
101
|
+
answer: 'fath',
|
|
102
|
+
meaning: 'victory / opening',
|
|
103
|
+
category: 'short_surahs'
|
|
104
|
+
}
|
|
105
|
+
];
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const figlet_1 = __importDefault(require("figlet"));
|
|
10
|
+
const init_1 = require("./commands/init");
|
|
11
|
+
const pull_1 = require("./commands/pull");
|
|
12
|
+
const status_1 = require("./commands/status");
|
|
13
|
+
const commit_1 = require("./commands/commit");
|
|
14
|
+
const blame_1 = require("./commands/blame");
|
|
15
|
+
const push_1 = require("./commands/push");
|
|
16
|
+
const journal_1 = require("./commands/journal");
|
|
17
|
+
const tafsir_1 = require("./commands/tafsir");
|
|
18
|
+
const memorize_1 = require("./commands/memorize");
|
|
19
|
+
const qibla_1 = require("./commands/qibla");
|
|
20
|
+
const adhan_1 = require("./commands/adhan");
|
|
21
|
+
const parable_1 = require("./commands/parable");
|
|
22
|
+
const history_1 = require("./commands/history");
|
|
23
|
+
const nazm_1 = require("./commands/nazm");
|
|
24
|
+
const diff_1 = require("./commands/diff");
|
|
25
|
+
const mirror_1 = require("./commands/mirror");
|
|
26
|
+
const sound_1 = require("./commands/sound");
|
|
27
|
+
const lens_1 = require("./commands/lens");
|
|
28
|
+
const scene_1 = require("./commands/scene");
|
|
29
|
+
const hero_1 = require("./commands/hero");
|
|
30
|
+
const hijri_1 = require("./commands/hijri");
|
|
31
|
+
const zakat_1 = require("./commands/zakat");
|
|
32
|
+
const tasbih_1 = require("./commands/tasbih");
|
|
33
|
+
const prayers_1 = require("./commands/prayers");
|
|
34
|
+
const names_1 = require("./commands/names");
|
|
35
|
+
const dua_1 = require("./commands/dua");
|
|
36
|
+
const fast_1 = require("./commands/fast");
|
|
37
|
+
const sunnah_1 = require("./commands/sunnah");
|
|
38
|
+
const sleep_1 = require("./commands/sleep");
|
|
39
|
+
const anatomy_1 = require("./commands/anatomy");
|
|
40
|
+
const journey_1 = require("./commands/journey");
|
|
41
|
+
const nature_1 = require("./commands/nature");
|
|
42
|
+
const wudu_1 = require("./commands/wudu");
|
|
43
|
+
const invest_1 = require("./commands/invest");
|
|
44
|
+
const sabr_1 = require("./commands/sabr");
|
|
45
|
+
const shukr_1 = require("./commands/shukr");
|
|
46
|
+
const friday_1 = require("./commands/friday");
|
|
47
|
+
const adab_1 = require("./commands/adab");
|
|
48
|
+
const seek_1 = require("./commands/seek");
|
|
49
|
+
const repo_1 = require("./commands/repo");
|
|
50
|
+
const program = new commander_1.Command();
|
|
51
|
+
// Bismillah Header
|
|
52
|
+
console.log(chalk_1.default.dim('In the name of Allah, the Most Gracious, the Most Merciful'));
|
|
53
|
+
console.log(chalk_1.default.green(figlet_1.default.textSync('aya', { horizontalLayout: 'full' })));
|
|
54
|
+
program
|
|
55
|
+
.name('aya')
|
|
56
|
+
.description('A CLI for the mindful Muslim developer')
|
|
57
|
+
.version('1.0.0')
|
|
58
|
+
.action(() => {
|
|
59
|
+
program.outputHelp();
|
|
60
|
+
});
|
|
61
|
+
// Register Commands
|
|
62
|
+
const commands = [
|
|
63
|
+
init_1.initCommand, pull_1.pullCommand, status_1.statusCommand, commit_1.commitCommand, blame_1.blameCommand,
|
|
64
|
+
push_1.pushCommand, journal_1.journalCommand, tafsir_1.tafsirCommand, memorize_1.memorizeCommand, qibla_1.qiblaCommand,
|
|
65
|
+
adhan_1.adhanCommand, parable_1.parableCommand, history_1.historyCommand, nazm_1.nazmCommand, diff_1.diffCommand,
|
|
66
|
+
mirror_1.mirrorCommand, sound_1.soundCommand, lens_1.lensCommand, scene_1.sceneCommand, hero_1.heroCommand,
|
|
67
|
+
hijri_1.hijriCommand, zakat_1.zakatCommand, tasbih_1.tasbihCommand, prayers_1.prayersCommand, names_1.namesCommand,
|
|
68
|
+
dua_1.duaCommand, fast_1.fastCommand, sunnah_1.sunnahCommand, sleep_1.sleepCommand, anatomy_1.anatomyCommand,
|
|
69
|
+
journey_1.journeyCommand, nature_1.natureCommand, wudu_1.wuduCommand, invest_1.investCommand, sabr_1.sabrCommand,
|
|
70
|
+
shukr_1.shukrCommand, friday_1.fridayCommand, adab_1.adabCommand, seek_1.seekCommand, repo_1.repoCommand
|
|
71
|
+
];
|
|
72
|
+
commands.forEach(cmd => program.addCommand(cmd));
|
|
73
|
+
// Global Error Handler
|
|
74
|
+
process.on('uncaughtException', (error) => {
|
|
75
|
+
if (error instanceof Error && error.message.includes('EPIPE')) {
|
|
76
|
+
// Ignore EPIPE errors (broken pipe) often caused by piping output
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
console.error(chalk_1.default.red('\n❌ An unexpected error occurred (Qadar Allah).'));
|
|
80
|
+
console.error(chalk_1.default.gray(error.message));
|
|
81
|
+
process.exit(1);
|
|
82
|
+
});
|
|
83
|
+
program.parse(process.argv);
|
|
84
|
+
if (!process.argv.slice(2).length) {
|
|
85
|
+
program.outputHelp();
|
|
86
|
+
}
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.startServer = void 0;
|
|
7
|
+
const http_1 = __importDefault(require("http"));
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
11
|
+
const logger_1 = require("./utils/logger");
|
|
12
|
+
const PUBLIC_DIR = path_1.default.join(__dirname, '../public');
|
|
13
|
+
const serveFile = (res, filePath, contentType = 'text/html') => {
|
|
14
|
+
fs_1.default.readFile(filePath, (err, content) => {
|
|
15
|
+
if (err) {
|
|
16
|
+
if (err.code === 'ENOENT') {
|
|
17
|
+
res.writeHead(404);
|
|
18
|
+
res.end('Not Found');
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
res.writeHead(500);
|
|
22
|
+
res.end(`Server Error: ${err.code}`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
res.writeHead(200, { 'Content-Type': contentType });
|
|
27
|
+
res.end(content, 'utf-8');
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
const readBody = (req) => {
|
|
32
|
+
return new Promise((resolve, reject) => {
|
|
33
|
+
let body = '';
|
|
34
|
+
req.on('data', chunk => { body += chunk.toString(); });
|
|
35
|
+
req.on('end', () => {
|
|
36
|
+
try {
|
|
37
|
+
resolve(body ? JSON.parse(body) : {});
|
|
38
|
+
}
|
|
39
|
+
catch (e) {
|
|
40
|
+
reject(e);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
req.on('error', (err) => reject(err));
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
const startServer = (port = 0) => {
|
|
47
|
+
return new Promise((resolve) => {
|
|
48
|
+
const server = http_1.default.createServer(async (req, res) => {
|
|
49
|
+
// Basic Router
|
|
50
|
+
if (req.url === '/' || req.url === '/index.html') {
|
|
51
|
+
serveFile(res, path_1.default.join(PUBLIC_DIR, 'index.html'));
|
|
52
|
+
}
|
|
53
|
+
else if (req.url === '/repo') {
|
|
54
|
+
serveFile(res, path_1.default.join(PUBLIC_DIR, 'repo.html'));
|
|
55
|
+
}
|
|
56
|
+
else if (req.url === '/api/commits') {
|
|
57
|
+
// API Endpoint: Serve commits log as JSON using the Logger utility
|
|
58
|
+
try {
|
|
59
|
+
const commits = logger_1.logger.getCommits();
|
|
60
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
61
|
+
res.end(JSON.stringify(commits));
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
res.writeHead(500, { 'Content-Type': 'application/json' });
|
|
65
|
+
res.end(JSON.stringify({ error: 'Failed to read logs' }));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
else if (req.url === '/api/issues') {
|
|
69
|
+
if (req.method === 'GET') {
|
|
70
|
+
const issues = logger_1.logger.getIssues();
|
|
71
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
72
|
+
res.end(JSON.stringify(issues));
|
|
73
|
+
}
|
|
74
|
+
else if (req.method === 'POST') {
|
|
75
|
+
try {
|
|
76
|
+
const body = await readBody(req);
|
|
77
|
+
if (body.title) {
|
|
78
|
+
const issue = logger_1.logger.logIssue(body.title);
|
|
79
|
+
res.writeHead(201, { 'Content-Type': 'application/json' });
|
|
80
|
+
res.end(JSON.stringify(issue));
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
res.writeHead(400, { 'Content-Type': 'application/json' });
|
|
84
|
+
res.end(JSON.stringify({ error: 'Title required' }));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
catch (e) {
|
|
88
|
+
res.writeHead(400, { 'Content-Type': 'application/json' });
|
|
89
|
+
res.end(JSON.stringify({ error: 'Invalid JSON' }));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
else if (req.url === '/api/pulls') {
|
|
94
|
+
if (req.method === 'GET') {
|
|
95
|
+
const pulls = logger_1.logger.getPulls();
|
|
96
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
97
|
+
res.end(JSON.stringify(pulls));
|
|
98
|
+
}
|
|
99
|
+
else if (req.method === 'POST') {
|
|
100
|
+
try {
|
|
101
|
+
const body = await readBody(req);
|
|
102
|
+
if (body.title) {
|
|
103
|
+
const pull = logger_1.logger.logPull(body.title);
|
|
104
|
+
res.writeHead(201, { 'Content-Type': 'application/json' });
|
|
105
|
+
res.end(JSON.stringify(pull));
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
res.writeHead(400, { 'Content-Type': 'application/json' });
|
|
109
|
+
res.end(JSON.stringify({ error: 'Title required' }));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
catch (e) {
|
|
113
|
+
res.writeHead(400, { 'Content-Type': 'application/json' });
|
|
114
|
+
res.end(JSON.stringify({ error: 'Invalid JSON' }));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
// 404 for any other route
|
|
120
|
+
res.writeHead(404);
|
|
121
|
+
res.end('Not found');
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
server.listen(port, () => {
|
|
125
|
+
const address = server.address();
|
|
126
|
+
const assignedPort = typeof address === 'string' ? 0 : address.port;
|
|
127
|
+
resolve(assignedPort);
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
exports.startServer = startServer;
|
|
132
|
+
// Only run directly if executed as a script (not imported)
|
|
133
|
+
if (require.main === module) {
|
|
134
|
+
(0, exports.startServer)().then(port => {
|
|
135
|
+
console.log(chalk_1.default.green.bold(`\n 🌙 aya Landing Page is running!`));
|
|
136
|
+
console.log(chalk_1.default.white(` Open your Book of Deeds:`));
|
|
137
|
+
console.log(chalk_1.default.cyan.bold(` http://localhost:${port}/repo`));
|
|
138
|
+
console.log(chalk_1.default.gray(`\n Press Ctrl+C to stop.`));
|
|
139
|
+
});
|
|
140
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.setConfig = exports.getConfig = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const CONFIG_DIR = path_1.default.join(process.cwd(), '.aya');
|
|
10
|
+
const CONFIG_FILE = path_1.default.join(CONFIG_DIR, 'config.json');
|
|
11
|
+
const defaultConfig = {
|
|
12
|
+
location: {
|
|
13
|
+
city: 'Mecca',
|
|
14
|
+
country: 'Saudi Arabia'
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const getConfig = () => {
|
|
18
|
+
if (!fs_1.default.existsSync(CONFIG_FILE)) {
|
|
19
|
+
return defaultConfig;
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
const data = fs_1.default.readFileSync(CONFIG_FILE, 'utf-8');
|
|
23
|
+
return JSON.parse(data);
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
return defaultConfig;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
exports.getConfig = getConfig;
|
|
30
|
+
const setConfig = (newConfig) => {
|
|
31
|
+
if (!fs_1.default.existsSync(CONFIG_DIR)) {
|
|
32
|
+
fs_1.default.mkdirSync(CONFIG_DIR, { recursive: true });
|
|
33
|
+
}
|
|
34
|
+
const currentConfig = (0, exports.getConfig)();
|
|
35
|
+
const updatedConfig = { ...currentConfig, ...newConfig };
|
|
36
|
+
fs_1.default.writeFileSync(CONFIG_FILE, JSON.stringify(updatedConfig, null, 2));
|
|
37
|
+
};
|
|
38
|
+
exports.setConfig = setConfig;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.logger = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const CONFIG_DIR = path_1.default.join(process.cwd(), '.aya');
|
|
10
|
+
const LOG_FILE = path_1.default.join(CONFIG_DIR, 'commits.log');
|
|
11
|
+
const ISSUES_FILE = path_1.default.join(CONFIG_DIR, 'issues.log');
|
|
12
|
+
const PULLS_FILE = path_1.default.join(CONFIG_DIR, 'pulls.log');
|
|
13
|
+
exports.logger = {
|
|
14
|
+
ensureInit: () => {
|
|
15
|
+
if (!fs_1.default.existsSync(CONFIG_DIR)) {
|
|
16
|
+
fs_1.default.mkdirSync(CONFIG_DIR, { recursive: true });
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
// --- Commits (Deeds) ---
|
|
20
|
+
logCommit: (message) => {
|
|
21
|
+
exports.logger.ensureInit();
|
|
22
|
+
const timestamp = new Date().toISOString();
|
|
23
|
+
// Simple format: [ISO] Message
|
|
24
|
+
const logEntry = `[${timestamp}] ${message}\n`;
|
|
25
|
+
fs_1.default.appendFileSync(LOG_FILE, logEntry);
|
|
26
|
+
return {
|
|
27
|
+
timestamp,
|
|
28
|
+
message,
|
|
29
|
+
hash: Math.random().toString(16).substring(2, 9)
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
getCommits: () => {
|
|
33
|
+
if (!fs_1.default.existsSync(LOG_FILE))
|
|
34
|
+
return [];
|
|
35
|
+
try {
|
|
36
|
+
const content = fs_1.default.readFileSync(LOG_FILE, 'utf-8');
|
|
37
|
+
const lines = content.split('\n').filter(line => line.trim());
|
|
38
|
+
return lines.map(line => {
|
|
39
|
+
// Match [timestamp] message
|
|
40
|
+
const match = line.match(/^\[(.*?)\] (.*)$/);
|
|
41
|
+
if (match) {
|
|
42
|
+
// Generate a deterministic-looking hash from timestamp
|
|
43
|
+
const hash = Math.abs(match[1].split('').reduce((a, b) => { a = ((a << 5) - a) + b.charCodeAt(0); return a & a; }, 0)).toString(16).substring(0, 7);
|
|
44
|
+
return {
|
|
45
|
+
timestamp: match[1],
|
|
46
|
+
message: match[2],
|
|
47
|
+
hash: hash
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
}).filter((c) => c !== null);
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
console.error('Error reading log file:', error);
|
|
55
|
+
return [];
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
getTotalDeeds: () => {
|
|
59
|
+
if (!fs_1.default.existsSync(LOG_FILE))
|
|
60
|
+
return 0;
|
|
61
|
+
const content = fs_1.default.readFileSync(LOG_FILE, 'utf-8');
|
|
62
|
+
return content.split('\n').filter(line => line.trim()).length;
|
|
63
|
+
},
|
|
64
|
+
// --- Issues (Istighfar/Sins) ---
|
|
65
|
+
logIssue: (title) => {
|
|
66
|
+
exports.logger.ensureInit();
|
|
67
|
+
const timestamp = new Date().toISOString();
|
|
68
|
+
const id = Math.floor(Math.random() * 1000).toString();
|
|
69
|
+
const entry = JSON.stringify({ id, title, status: 'open', timestamp }) + '\n';
|
|
70
|
+
fs_1.default.appendFileSync(ISSUES_FILE, entry);
|
|
71
|
+
return { id, title, status: 'open', timestamp };
|
|
72
|
+
},
|
|
73
|
+
getIssues: () => {
|
|
74
|
+
if (!fs_1.default.existsSync(ISSUES_FILE))
|
|
75
|
+
return [];
|
|
76
|
+
try {
|
|
77
|
+
const content = fs_1.default.readFileSync(ISSUES_FILE, 'utf-8');
|
|
78
|
+
return content.trim().split('\n').map(line => JSON.parse(line));
|
|
79
|
+
}
|
|
80
|
+
catch (e) {
|
|
81
|
+
return [];
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
// --- Pulls (Duas) ---
|
|
85
|
+
logPull: (title) => {
|
|
86
|
+
exports.logger.ensureInit();
|
|
87
|
+
const timestamp = new Date().toISOString();
|
|
88
|
+
const id = Math.floor(Math.random() * 1000).toString();
|
|
89
|
+
const entry = JSON.stringify({ id, title, status: 'open', timestamp }) + '\n';
|
|
90
|
+
fs_1.default.appendFileSync(PULLS_FILE, entry);
|
|
91
|
+
return { id, title, status: 'open', timestamp };
|
|
92
|
+
},
|
|
93
|
+
getPulls: () => {
|
|
94
|
+
if (!fs_1.default.existsSync(PULLS_FILE))
|
|
95
|
+
return [];
|
|
96
|
+
try {
|
|
97
|
+
const content = fs_1.default.readFileSync(PULLS_FILE, 'utf-8');
|
|
98
|
+
return content.trim().split('\n').map(line => JSON.parse(line));
|
|
99
|
+
}
|
|
100
|
+
catch (e) {
|
|
101
|
+
return [];
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.printCommandHeader = void 0;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const boxen_1 = __importDefault(require("boxen"));
|
|
9
|
+
const commands_db_1 = require("../data/commands-db");
|
|
10
|
+
const printCommandHeader = (commandName) => {
|
|
11
|
+
const data = commands_db_1.commandsDB[commandName];
|
|
12
|
+
if (!data)
|
|
13
|
+
return;
|
|
14
|
+
console.log((0, boxen_1.default)(chalk_1.default.bold.green(data.arabic) + ' ' + chalk_1.default.dim(`(${data.transliteration})`) + '\n' +
|
|
15
|
+
chalk_1.default.white(data.meaning), {
|
|
16
|
+
padding: 1,
|
|
17
|
+
margin: 1,
|
|
18
|
+
borderStyle: 'round',
|
|
19
|
+
borderColor: 'green',
|
|
20
|
+
title: `aya ${data.name}`,
|
|
21
|
+
titleAlignment: 'center',
|
|
22
|
+
textAlignment: 'center'
|
|
23
|
+
}));
|
|
24
|
+
console.log(chalk_1.default.bold.yellow('📖 The Story (Deep Dive):'));
|
|
25
|
+
console.log(chalk_1.default.italic.gray(data.story));
|
|
26
|
+
console.log();
|
|
27
|
+
console.log(chalk_1.default.bold.blue('🤲 Reflection (Khutbah):'));
|
|
28
|
+
console.log(chalk_1.default.white(data.reflection));
|
|
29
|
+
console.log();
|
|
30
|
+
console.log(chalk_1.default.bold.magenta('💻 Technical Analogy:'));
|
|
31
|
+
console.log(chalk_1.default.cyan(data.technical));
|
|
32
|
+
console.log();
|
|
33
|
+
console.log(chalk_1.default.dim('─'.repeat(50)));
|
|
34
|
+
console.log();
|
|
35
|
+
};
|
|
36
|
+
exports.printCommandHeader = printCommandHeader;
|