laporan-generator 2.6.1 → 2.6.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/.agents/skills/laporan-generator/resources/build.sh +1 -1
- package/.agents/skills/laporan-generator/resources/laporan.ps1 +1 -1
- package/bin/laporan-generator.js +16 -2
- package/build.sh +1 -1
- package/laporan +1 -1
- package/laporan.ps1 +25 -18
- package/package.json +4 -2
- package/scripts/report-stats.py +7 -0
- package/scripts/test_scripts.py +14 -0
|
@@ -85,7 +85,7 @@ if ! pandoc \
|
|
|
85
85
|
--metadata=reference-section-title="DAFTAR PUSTAKA" \
|
|
86
86
|
--top-level-division=chapter \
|
|
87
87
|
--pdf-engine=typst \
|
|
88
|
-
--
|
|
88
|
+
--no-highlight \
|
|
89
89
|
-o "$REPORT" 2>&1; then
|
|
90
90
|
echo ""
|
|
91
91
|
echo "[ERROR] BUILD GAGAL: Terjadi kesalahan saat kompilasi Pandoc/Typst."
|
|
@@ -164,7 +164,7 @@ function Cmd-Build-PDF {
|
|
|
164
164
|
$pandocArgs += "--metadata=reference-section-title=DAFTAR PUSTAKA"
|
|
165
165
|
$pandocArgs += "--top-level-division=chapter"
|
|
166
166
|
$pandocArgs += "--pdf-engine=typst"
|
|
167
|
-
$pandocArgs += "--
|
|
167
|
+
$pandocArgs += "--no-highlight"
|
|
168
168
|
$pandocArgs += @("-o", "Laporan.pdf")
|
|
169
169
|
|
|
170
170
|
& pandoc $pandocArgs
|
package/bin/laporan-generator.js
CHANGED
|
@@ -7,12 +7,25 @@ const { spawnSync } = require('child_process');
|
|
|
7
7
|
const args = process.argv.slice(2);
|
|
8
8
|
const command = args[0] || 'help';
|
|
9
9
|
|
|
10
|
+
function getPythonCommand() {
|
|
11
|
+
if (process.platform === 'win32') {
|
|
12
|
+
const testPy = spawnSync('python', ['--version'], { stdio: 'ignore' });
|
|
13
|
+
if (testPy.status === 0) return 'python';
|
|
14
|
+
const testPy3 = spawnSync('python3', ['--version'], { stdio: 'ignore' });
|
|
15
|
+
if (testPy3.status === 0) return 'python3';
|
|
16
|
+
return 'python';
|
|
17
|
+
}
|
|
18
|
+
const testPy3 = spawnSync('python3', ['--version'], { stdio: 'ignore' });
|
|
19
|
+
if (testPy3.status === 0) return 'python3';
|
|
20
|
+
return 'python';
|
|
21
|
+
}
|
|
22
|
+
|
|
10
23
|
function showHelp() {
|
|
11
24
|
console.log(`
|
|
12
25
|
========================================================
|
|
13
26
|
LAPORAN GENERATOR CLI (Multi-Host AI Engine)
|
|
14
27
|
========================================================
|
|
15
|
-
Versi: 2.6.
|
|
28
|
+
Versi: 2.6.2
|
|
16
29
|
|
|
17
30
|
Penggunaan:
|
|
18
31
|
npx laporan-generator <perintah> [opsi]
|
|
@@ -47,7 +60,8 @@ switch (command) {
|
|
|
47
60
|
case 'doctor':
|
|
48
61
|
case 'check':
|
|
49
62
|
const doctorScript = path.join(__dirname, '../scripts/report-doctor.py');
|
|
50
|
-
const
|
|
63
|
+
const pyCmd = getPythonCommand();
|
|
64
|
+
const proc = spawnSync(pyCmd, [doctorScript], { stdio: 'inherit' });
|
|
51
65
|
process.exit(proc.status || 0);
|
|
52
66
|
break;
|
|
53
67
|
case 'build':
|
package/build.sh
CHANGED
|
@@ -85,7 +85,7 @@ if ! pandoc \
|
|
|
85
85
|
--metadata=reference-section-title="DAFTAR PUSTAKA" \
|
|
86
86
|
--top-level-division=chapter \
|
|
87
87
|
--pdf-engine=typst \
|
|
88
|
-
--
|
|
88
|
+
--no-highlight \
|
|
89
89
|
-o "$REPORT" 2>&1; then
|
|
90
90
|
echo ""
|
|
91
91
|
echo "[ERROR] BUILD GAGAL: Terjadi kesalahan saat kompilasi Pandoc/Typst."
|
package/laporan
CHANGED
|
@@ -27,7 +27,7 @@ export PYTHONUTF8=1
|
|
|
27
27
|
show_banner() {
|
|
28
28
|
echo -e "${CYAN}${BOLD}"
|
|
29
29
|
echo " ========================================================"
|
|
30
|
-
echo " LAPORAN GENERATOR CLI v2.6.
|
|
30
|
+
echo " LAPORAN GENERATOR CLI v2.6.2 "
|
|
31
31
|
echo " Otomatisasi Dokumen Akademik (Typst + DOCX Engine) "
|
|
32
32
|
echo " ========================================================"
|
|
33
33
|
echo -e "${NC}"
|
package/laporan.ps1
CHANGED
|
@@ -38,7 +38,7 @@ function Get-PythonCommand {
|
|
|
38
38
|
|
|
39
39
|
function Show-Banner {
|
|
40
40
|
Write-Host " ========================================================" -ForegroundColor Cyan
|
|
41
|
-
Write-Host " LAPORAN GENERATOR CLI v2.6.
|
|
41
|
+
Write-Host " LAPORAN GENERATOR CLI v2.6.2 " -ForegroundColor Cyan
|
|
42
42
|
Write-Host " Otomatisasi Dokumen Akademik (Typst + DOCX Engine) " -ForegroundColor Cyan
|
|
43
43
|
Write-Host " ========================================================" -ForegroundColor Cyan
|
|
44
44
|
Write-Host ""
|
|
@@ -164,7 +164,7 @@ function Cmd-Build-PDF {
|
|
|
164
164
|
$pandocArgs += "--metadata=reference-section-title=DAFTAR PUSTAKA"
|
|
165
165
|
$pandocArgs += "--top-level-division=chapter"
|
|
166
166
|
$pandocArgs += "--pdf-engine=typst"
|
|
167
|
-
$pandocArgs += "--
|
|
167
|
+
$pandocArgs += "--no-highlight"
|
|
168
168
|
$pandocArgs += @("-o", "Laporan.pdf")
|
|
169
169
|
|
|
170
170
|
& pandoc $pandocArgs
|
|
@@ -334,22 +334,29 @@ preset: "$escPreset"
|
|
|
334
334
|
Write-Host "Jalankan '.\laporan.ps1 build' untuk mulai menghasilkan laporan." -ForegroundColor Cyan
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
-
function Cmd-Test {
|
|
338
|
-
Show-Banner
|
|
339
|
-
Write-Host "Menjalankan Test Suite..." -ForegroundColor Blue
|
|
340
|
-
$gitBash = "C:\Program Files\Git\bin\bash.exe"
|
|
341
|
-
$bashCmd = if (Test-Path $gitBash) { $gitBash } elseif ((Get-Command "bash" -ErrorAction SilentlyContinue) -and (Get-Command "bash").Source -notmatch "system32\\bash\.exe") { "bash" } else { "" }
|
|
342
|
-
if ($bashCmd) {
|
|
343
|
-
& $bashCmd test.sh
|
|
344
|
-
} else {
|
|
345
|
-
$pyCmd = Get-PythonCommand
|
|
346
|
-
if ($pyCmd) {
|
|
347
|
-
Write-Host "Menjalankan validasi skema preset..." -ForegroundColor Blue
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
337
|
+
function Cmd-Test {
|
|
338
|
+
Show-Banner
|
|
339
|
+
Write-Host "Menjalankan Test Suite..." -ForegroundColor Blue
|
|
340
|
+
$gitBash = "C:\Program Files\Git\bin\bash.exe"
|
|
341
|
+
$bashCmd = if (Test-Path $gitBash) { $gitBash } elseif ((Get-Command "bash" -ErrorAction SilentlyContinue) -and (Get-Command "bash").Source -notmatch "system32\\bash\.exe") { "bash" } else { "" }
|
|
342
|
+
if ($bashCmd -and (Test-Path "test.sh")) {
|
|
343
|
+
& $bashCmd test.sh
|
|
344
|
+
} else {
|
|
345
|
+
$pyCmd = Get-PythonCommand
|
|
346
|
+
if ($pyCmd) {
|
|
347
|
+
Write-Host "Menjalankan validasi skema preset..." -ForegroundColor Blue
|
|
348
|
+
if (Test-Path "scripts/validate-preset.py") {
|
|
349
|
+
& $pyCmd scripts/validate-preset.py --all
|
|
350
|
+
}
|
|
351
|
+
if (Test-Path "scripts/test_scripts.py") {
|
|
352
|
+
Write-Host ""
|
|
353
|
+
Write-Host "Menjalankan unit test skrip Python..." -ForegroundColor Blue
|
|
354
|
+
& $pyCmd scripts/test_scripts.py
|
|
355
|
+
}
|
|
356
|
+
} else {
|
|
357
|
+
Write-Host "Test suite membutuhkan bash atau python3." -ForegroundColor Yellow
|
|
358
|
+
}
|
|
359
|
+
}
|
|
353
360
|
}
|
|
354
361
|
|
|
355
362
|
function Cmd-Preset {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "laporan-generator",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.2",
|
|
4
4
|
"description": "Universal Academic Report & Thesis Generator with Multi-Host AI Agent Skills (Antigravity, Claude, Grok)",
|
|
5
5
|
"main": "bin/laporan-generator.js",
|
|
6
6
|
"bin": {
|
|
@@ -29,7 +29,9 @@
|
|
|
29
29
|
"laporan.ps1",
|
|
30
30
|
"docs/",
|
|
31
31
|
"README.md",
|
|
32
|
-
"LICENSE"
|
|
32
|
+
"LICENSE",
|
|
33
|
+
"!**/__pycache__",
|
|
34
|
+
"!**/*.pyc"
|
|
33
35
|
],
|
|
34
36
|
"scripts": {
|
|
35
37
|
"test": "./test.sh",
|
package/scripts/report-stats.py
CHANGED
|
@@ -6,6 +6,13 @@ import os
|
|
|
6
6
|
import re
|
|
7
7
|
import sys
|
|
8
8
|
|
|
9
|
+
if sys.platform == "win32":
|
|
10
|
+
try:
|
|
11
|
+
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
|
|
12
|
+
sys.stderr.reconfigure(encoding="utf-8", errors="replace")
|
|
13
|
+
except Exception:
|
|
14
|
+
pass
|
|
15
|
+
|
|
9
16
|
GREEN = "\033[0;32m"
|
|
10
17
|
BLUE = "\033[0;34m"
|
|
11
18
|
CYAN = "\033[0;36m"
|
package/scripts/test_scripts.py
CHANGED
|
@@ -123,6 +123,20 @@ class TestFinalizeDocx(unittest.TestCase):
|
|
|
123
123
|
self.assertIn('w:left="720"', res)
|
|
124
124
|
|
|
125
125
|
|
|
126
|
+
report_stats = __import__("report-stats")
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
class TestReportStats(unittest.TestCase):
|
|
130
|
+
def test_count_file_stats_structure(self):
|
|
131
|
+
sample_md = os.path.join(ROOT_DIR, "cover.md")
|
|
132
|
+
if os.path.exists(sample_md):
|
|
133
|
+
stats = report_stats.count_file_stats(sample_md)
|
|
134
|
+
self.assertIsInstance(stats, dict)
|
|
135
|
+
self.assertIsInstance(stats["words"], int)
|
|
136
|
+
self.assertIsInstance(stats["chars"], int)
|
|
137
|
+
self.assertGreaterEqual(stats["words"], 0)
|
|
138
|
+
|
|
139
|
+
|
|
126
140
|
if __name__ == "__main__":
|
|
127
141
|
unittest.main(verbosity=2)
|
|
128
142
|
|