@clazic/kordoc 2.7.0 → 2.7.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/dist/{chunk-3FTA6V7S.js → chunk-OF2YI3AC.js} +15 -10
- package/dist/{chunk-3FTA6V7S.js.map → chunk-OF2YI3AC.js.map} +1 -1
- package/dist/{chunk-USE7IDLV.js → chunk-WMQBWE6H.js} +2 -2
- package/dist/cli.js +6 -6
- package/dist/index.cjs +14 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -9
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +2 -2
- package/dist/{utils-XYBJBWM2.js → utils-CJPB6YNH.js} +2 -2
- package/dist/{watch-CJRS6OYE.js → watch-MMYT64UO.js} +3 -3
- package/package.json +1 -1
- /package/dist/{chunk-USE7IDLV.js.map → chunk-WMQBWE6H.js.map} +0 -0
- /package/dist/{utils-XYBJBWM2.js.map → utils-CJPB6YNH.js.map} +0 -0
- /package/dist/{watch-CJRS6OYE.js.map → watch-MMYT64UO.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/utils.ts
|
|
4
|
-
var VERSION = true ? "2.
|
|
4
|
+
var VERSION = true ? "2.7.2" : "0.0.0-dev";
|
|
5
5
|
function toArrayBuffer(buf) {
|
|
6
6
|
if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) {
|
|
7
7
|
return buf.buffer;
|
|
@@ -105,4 +105,4 @@ export {
|
|
|
105
105
|
classifyError,
|
|
106
106
|
normalizeKordocError
|
|
107
107
|
};
|
|
108
|
-
//# sourceMappingURL=chunk-
|
|
108
|
+
//# sourceMappingURL=chunk-WMQBWE6H.js.map
|
package/dist/cli.js
CHANGED
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
markdownToHwpx,
|
|
6
6
|
markdownToXlsx,
|
|
7
7
|
parse
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OF2YI3AC.js";
|
|
9
9
|
import {
|
|
10
10
|
VERSION,
|
|
11
11
|
toArrayBuffer
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WMQBWE6H.js";
|
|
13
13
|
import "./chunk-MOL7MDBG.js";
|
|
14
14
|
import "./chunk-S7BHLD2V.js";
|
|
15
15
|
import "./chunk-YW5G6BCJ.js";
|
|
@@ -174,7 +174,7 @@ async function runParse(files, opts) {
|
|
|
174
174
|
saveImages(absPath);
|
|
175
175
|
}
|
|
176
176
|
} catch (err) {
|
|
177
|
-
const { sanitizeError } = await import("./utils-
|
|
177
|
+
const { sanitizeError } = await import("./utils-CJPB6YNH.js");
|
|
178
178
|
process.stderr.write(`
|
|
179
179
|
[kordoc] ERROR: ${fileName} \u2014 ${sanitizeError(err)}
|
|
180
180
|
`);
|
|
@@ -256,7 +256,7 @@ program.command("convert <input>").description("\uB9C8\uD06C\uB2E4\uC6B4 \uD30C\
|
|
|
256
256
|
`));
|
|
257
257
|
}
|
|
258
258
|
} catch (err) {
|
|
259
|
-
const { sanitizeError } = await import("./utils-
|
|
259
|
+
const { sanitizeError } = await import("./utils-CJPB6YNH.js");
|
|
260
260
|
process.stderr.write(` FAIL
|
|
261
261
|
`);
|
|
262
262
|
process.stderr.write(` \u2192 ${sanitizeError(err)}
|
|
@@ -337,7 +337,7 @@ program.command("convert-pdf <input>").description("HWP/HWPX \uD30C\uC77C\uC744
|
|
|
337
337
|
`);
|
|
338
338
|
}
|
|
339
339
|
} catch (err) {
|
|
340
|
-
const { sanitizeError } = await import("./utils-
|
|
340
|
+
const { sanitizeError } = await import("./utils-CJPB6YNH.js");
|
|
341
341
|
process.stderr.write(` FAIL
|
|
342
342
|
`);
|
|
343
343
|
process.stderr.write(` \u2192 ${sanitizeError(err)}
|
|
@@ -369,7 +369,7 @@ program.command("init-env").description("kordoc\uC6A9 .env \uD15C\uD50C\uB9BF \u
|
|
|
369
369
|
}
|
|
370
370
|
});
|
|
371
371
|
program.command("watch <dir>").description("\uB514\uB809\uD1A0\uB9AC \uAC10\uC2DC \u2014 \uC0C8 \uBB38\uC11C \uC790\uB3D9 \uBCC0\uD658").option("--webhook <url>", "\uACB0\uACFC \uC804\uC1A1 \uC6F9\uD6C5 URL").option("-d, --out-dir <dir>", "\uBCC0\uD658 \uACB0\uACFC \uCD9C\uB825 \uB514\uB809\uD1A0\uB9AC").option("-p, --pages <range>", "\uD398\uC774\uC9C0/\uC139\uC158 \uBC94\uC704").option("--format <type>", "\uCD9C\uB825 \uD615\uC2DD: markdown \uB610\uB294 json", "markdown").option("--silent", "\uC9C4\uD589 \uBA54\uC2DC\uC9C0 \uC228\uAE30\uAE30").action(async (dir, opts) => {
|
|
372
|
-
const { watchDirectory } = await import("./watch-
|
|
372
|
+
const { watchDirectory } = await import("./watch-MMYT64UO.js");
|
|
373
373
|
await watchDirectory({
|
|
374
374
|
dir,
|
|
375
375
|
outDir: opts.outDir,
|
package/dist/index.cjs
CHANGED
|
@@ -3137,7 +3137,7 @@ var import_jszip2 = __toESM(require("jszip"), 1);
|
|
|
3137
3137
|
var import_xmldom = require("@xmldom/xmldom");
|
|
3138
3138
|
|
|
3139
3139
|
// src/utils.ts
|
|
3140
|
-
var VERSION = true ? "2.
|
|
3140
|
+
var VERSION = true ? "2.7.2" : "0.0.0-dev";
|
|
3141
3141
|
function toArrayBuffer(buf) {
|
|
3142
3142
|
if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) {
|
|
3143
3143
|
return buf.buffer;
|
|
@@ -11259,19 +11259,19 @@ var CACHE_DIR = (0, import_path5.join)((0, import_os3.homedir)(), ".cache", "kor
|
|
|
11259
11259
|
var VERSION_FILE = (0, import_path5.join)(CACHE_DIR, "version");
|
|
11260
11260
|
var PACKAGES = {
|
|
11261
11261
|
darwin: {
|
|
11262
|
-
url: "https://
|
|
11262
|
+
url: "https://ftp.osuosl.org/pub/tdf/libreoffice/stable/26.2.3/mac/x86_64/LibreOffice_26.2.3_MacOS_x86-64.dmg",
|
|
11263
11263
|
binPath: "LibreOffice.app/Contents/MacOS/soffice",
|
|
11264
11264
|
sizeMb: 300
|
|
11265
11265
|
},
|
|
11266
11266
|
linux: {
|
|
11267
|
-
url: "https://
|
|
11268
|
-
binPath: "opt/
|
|
11269
|
-
sizeMb:
|
|
11267
|
+
url: "https://ftp.osuosl.org/pub/tdf/libreoffice/stable/26.2.3/deb/x86_64/LibreOffice_26.2.3_Linux_x86-64_deb.tar.gz",
|
|
11268
|
+
binPath: "opt/libreoffice26.2/program/soffice",
|
|
11269
|
+
sizeMb: 210
|
|
11270
11270
|
},
|
|
11271
11271
|
win32: {
|
|
11272
|
-
url: "https://
|
|
11272
|
+
url: "https://ftp.osuosl.org/pub/tdf/libreoffice/stable/26.2.3/win/x86_64/LibreOffice_26.2.3_Win_x86-64.msi",
|
|
11273
11273
|
binPath: "LibreOffice/program/soffice.exe",
|
|
11274
|
-
sizeMb:
|
|
11274
|
+
sizeMb: 360
|
|
11275
11275
|
}
|
|
11276
11276
|
};
|
|
11277
11277
|
async function findInPath() {
|
|
@@ -11324,6 +11324,7 @@ async function findInDefaultPaths() {
|
|
|
11324
11324
|
}
|
|
11325
11325
|
async function downloadWithProgress(url, dest, totalBytes, onProgress) {
|
|
11326
11326
|
const response = await fetch(url);
|
|
11327
|
+
if (!response.ok) throw new Error(`\uB2E4\uC6B4\uB85C\uB4DC \uC2E4\uD328: HTTP ${response.status} (${url})`);
|
|
11327
11328
|
if (!response.body) throw new Error("\uB2E4\uC6B4\uB85C\uB4DC \uC2E4\uD328: response body \uC5C6\uC74C");
|
|
11328
11329
|
const file = (0, import_fs4.createWriteStream)(dest);
|
|
11329
11330
|
const reader = response.body.getReader();
|
|
@@ -11332,13 +11333,17 @@ async function downloadWithProgress(url, dest, totalBytes, onProgress) {
|
|
|
11332
11333
|
while (true) {
|
|
11333
11334
|
const { done, value } = await reader.read();
|
|
11334
11335
|
if (done) break;
|
|
11335
|
-
file.write(value)
|
|
11336
|
+
if (!file.write(value)) {
|
|
11337
|
+
await new Promise((resolve4) => file.once("drain", resolve4));
|
|
11338
|
+
}
|
|
11336
11339
|
downloaded += value.length;
|
|
11337
11340
|
onProgress?.(downloaded, totalBytes);
|
|
11338
11341
|
}
|
|
11339
11342
|
} finally {
|
|
11340
|
-
file.end();
|
|
11341
11343
|
reader.releaseLock();
|
|
11344
|
+
await new Promise((resolve4, reject) => {
|
|
11345
|
+
file.end((err) => err ? reject(err) : resolve4());
|
|
11346
|
+
});
|
|
11342
11347
|
}
|
|
11343
11348
|
}
|
|
11344
11349
|
async function installForPlatform(pkg, onProgress) {
|