janofidel 1.0.4 → 1.0.6
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 +14 -0
- package/bin/jano.js +27 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,6 +21,12 @@
|
|
|
21
21
|
|
|
22
22
|
### 1. Installation
|
|
23
23
|
|
|
24
|
+
## For users
|
|
25
|
+
```bash
|
|
26
|
+
npm install -g janofidel@latest
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## For developers
|
|
24
30
|
Clone the repository and link it to your global path:
|
|
25
31
|
|
|
26
32
|
```bash
|
|
@@ -52,6 +58,14 @@ jano ሰላምታ.jf
|
|
|
52
58
|
|
|
53
59
|
```
|
|
54
60
|
|
|
61
|
+
---
|
|
62
|
+
## 🛠️ CLI ትዕዛዞች (CLI Usage)
|
|
63
|
+
|command(ትዕዛዝ) | Description(መግለጫ) |
|
|
64
|
+
| --- | --- |
|
|
65
|
+
|`jano <file.jf>` | Runs the JanoFidel file |
|
|
66
|
+
|`jano -v, --version` | Show current version |
|
|
67
|
+
|`jano -h, --help` | Show the help manual |
|
|
68
|
+
|
|
55
69
|
---
|
|
56
70
|
|
|
57
71
|
## 📚 የቋንቋው መዝገበ-ቃላት (Dictionary Mapping)
|
package/bin/jano.js
CHANGED
|
@@ -1,42 +1,58 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
const { processFile } = require('../src/engine');
|
|
3
3
|
const { runCode } = require('../src/runner');
|
|
4
|
+
const dictionary = require('../src/dictionary');
|
|
4
5
|
const path = require('path');
|
|
5
6
|
const pkg = require('../package.json');
|
|
6
7
|
|
|
7
|
-
// Branding
|
|
8
|
+
// Branding
|
|
8
9
|
const RED_BG = '\x1b[41m';
|
|
9
10
|
const WHITE_TEXT = '\x1b[37m';
|
|
10
11
|
const BOLD = '\x1b[1m';
|
|
12
|
+
const YELLOW = '\x1b[33m';
|
|
13
|
+
const CYAN = '\x1b[36m';
|
|
11
14
|
const RESET = '\x1b[0m';
|
|
12
15
|
|
|
13
16
|
const logo = `${RED_BG}${WHITE_TEXT}${BOLD} ጃ ${RESET} ${RED_BG}${WHITE_TEXT}${BOLD} ፊ ${RESET} ${BOLD}ጃኖ ፊደል (Jano Fidel)${RESET} v${pkg.version}\n`;
|
|
14
17
|
|
|
15
18
|
const args = process.argv.slice(2);
|
|
16
|
-
const fileArg = args[0];
|
|
17
19
|
|
|
18
|
-
// 1. Handle
|
|
20
|
+
// --- 1. Handle Flags FIRST ---
|
|
21
|
+
|
|
19
22
|
if (args.includes('--version') || args.includes('-v')) {
|
|
20
23
|
console.log(logo);
|
|
21
24
|
process.exit(0);
|
|
22
25
|
}
|
|
23
26
|
|
|
24
|
-
|
|
27
|
+
if (args.includes('--list') || args.includes('-l')) {
|
|
28
|
+
console.log(logo);
|
|
29
|
+
console.log(`${BOLD}${CYAN}የጃኖ መዝገበ-ቃላት (Jano Dictionary)${RESET}\n`);
|
|
30
|
+
console.log(`${BOLD}${"ጃኖ (Jano)".padEnd(20)} | ${"JavaScript Equivalent"}${RESET}`);
|
|
31
|
+
console.log("━".repeat(50));
|
|
32
|
+
|
|
33
|
+
Object.entries(dictionary).forEach(([jano, js]) => {
|
|
34
|
+
const cleanJano = jano.replace(/\\b/g, '');
|
|
35
|
+
if (cleanJano.length < 30) {
|
|
36
|
+
console.log(`${cleanJano.padEnd(20)} | ${YELLOW}${js}${RESET}`);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
process.exit(0);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// --- 2. Handle File Execution SECOND ---
|
|
43
|
+
|
|
44
|
+
const fileArg = args.find(arg => !arg.startsWith('-'));
|
|
45
|
+
|
|
25
46
|
if (args.includes('--help') || args.includes('-h') || !fileArg) {
|
|
26
47
|
console.log(logo);
|
|
27
48
|
console.log(`${BOLD}አጠቃቀም (Usage):${RESET}`);
|
|
28
49
|
console.log(" jano <ፋይል_ስም.jf>");
|
|
29
|
-
|
|
30
50
|
console.log(`\n${BOLD}ትዕዛዞች (Flags):${RESET}`);
|
|
31
|
-
console.log(" -
|
|
32
|
-
console.log(" -
|
|
33
|
-
|
|
34
|
-
console.log(`\n${BOLD}ምሳሌ (Example):${RESET}`);
|
|
35
|
-
console.log(" jano ሰላም.jf");
|
|
51
|
+
console.log(" -l, --list የቃላት መዝገብ ዝርዝር");
|
|
52
|
+
console.log(" -v, --version የስሪት ቁጥሩን ያሳያል");
|
|
36
53
|
process.exit(0);
|
|
37
54
|
}
|
|
38
55
|
|
|
39
|
-
// 3. Main Execution
|
|
40
56
|
const filePath = path.resolve(process.cwd(), fileArg);
|
|
41
57
|
|
|
42
58
|
if (!filePath.endsWith('.jf')) {
|