@likecoin/epubcheck-ts 0.2.4 → 0.3.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/bin/epubcheck.js +10 -2
- package/bin/epubcheck.ts +11 -1
- package/dist/index.cjs +851 -487
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +87 -1
- package/dist/index.d.ts +87 -1
- package/dist/index.js +846 -488
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/bin/epubcheck.js
CHANGED
|
@@ -3,7 +3,7 @@ import { readFile, writeFile } from "node:fs/promises";
|
|
|
3
3
|
import { parseArgs } from "node:util";
|
|
4
4
|
import { basename } from "node:path";
|
|
5
5
|
const { EpubCheck, toJSONReport } = await import("../dist/index.js");
|
|
6
|
-
const VERSION = "0.
|
|
6
|
+
const VERSION = "0.3.0";
|
|
7
7
|
const { values, positionals } = parseArgs({
|
|
8
8
|
options: {
|
|
9
9
|
json: { type: "string", short: "j" },
|
|
@@ -12,7 +12,8 @@ const { values, positionals } = parseArgs({
|
|
|
12
12
|
usage: { type: "boolean", short: "u", default: false },
|
|
13
13
|
version: { type: "boolean", short: "v", default: false },
|
|
14
14
|
help: { type: "boolean", short: "h", default: false },
|
|
15
|
-
"fail-on-warnings": { type: "boolean", short: "w", default: false }
|
|
15
|
+
"fail-on-warnings": { type: "boolean", short: "w", default: false },
|
|
16
|
+
listChecks: { type: "boolean", short: "l", default: false }
|
|
16
17
|
},
|
|
17
18
|
allowPositionals: true,
|
|
18
19
|
strict: false
|
|
@@ -25,6 +26,12 @@ if (values.version) {
|
|
|
25
26
|
console.log("For production validation: https://github.com/w3c/epubcheck");
|
|
26
27
|
process.exit(0);
|
|
27
28
|
}
|
|
29
|
+
if (values.listChecks) {
|
|
30
|
+
const { formatMessageList } = await import("../dist/index.js");
|
|
31
|
+
const output = formatMessageList();
|
|
32
|
+
console.log(output);
|
|
33
|
+
process.exit(0);
|
|
34
|
+
}
|
|
28
35
|
if (values.help || positionals.length === 0) {
|
|
29
36
|
console.log(`EPUBCheck-TS v${VERSION} - EPUB Validator
|
|
30
37
|
|
|
@@ -39,6 +46,7 @@ Options:
|
|
|
39
46
|
-p, --profile <name> Validation profile (default|dict|edupub|idx|preview)
|
|
40
47
|
-u, --usage Include usage messages (best practices)
|
|
41
48
|
-w, --fail-on-warnings Exit with code 1 if warnings are found
|
|
49
|
+
-l, --listChecks List all message IDs and severities
|
|
42
50
|
-v, --version Show version information
|
|
43
51
|
-h, --help Show this help message
|
|
44
52
|
|
package/bin/epubcheck.ts
CHANGED
|
@@ -14,7 +14,7 @@ import { basename } from 'node:path';
|
|
|
14
14
|
// Dynamic import to support both ESM and CJS builds
|
|
15
15
|
const { EpubCheck, toJSONReport } = await import('../dist/index.js');
|
|
16
16
|
|
|
17
|
-
const VERSION = '0.
|
|
17
|
+
const VERSION = '0.3.0';
|
|
18
18
|
|
|
19
19
|
// Parse command line arguments
|
|
20
20
|
const { values, positionals } = parseArgs({
|
|
@@ -26,6 +26,7 @@ const { values, positionals } = parseArgs({
|
|
|
26
26
|
version: { type: 'boolean', short: 'v', default: false },
|
|
27
27
|
help: { type: 'boolean', short: 'h', default: false },
|
|
28
28
|
'fail-on-warnings': { type: 'boolean', short: 'w', default: false },
|
|
29
|
+
listChecks: { type: 'boolean', short: 'l', default: false },
|
|
29
30
|
},
|
|
30
31
|
allowPositionals: true,
|
|
31
32
|
strict: false,
|
|
@@ -41,6 +42,14 @@ if (values.version) {
|
|
|
41
42
|
process.exit(0);
|
|
42
43
|
}
|
|
43
44
|
|
|
45
|
+
// List checks
|
|
46
|
+
if (values.listChecks) {
|
|
47
|
+
const { formatMessageList } = await import('../dist/index.js');
|
|
48
|
+
const output = formatMessageList();
|
|
49
|
+
console.log(output);
|
|
50
|
+
process.exit(0);
|
|
51
|
+
}
|
|
52
|
+
|
|
44
53
|
// Show help
|
|
45
54
|
if (values.help || positionals.length === 0) {
|
|
46
55
|
console.log(`EPUBCheck-TS v${VERSION} - EPUB Validator
|
|
@@ -56,6 +65,7 @@ Options:
|
|
|
56
65
|
-p, --profile <name> Validation profile (default|dict|edupub|idx|preview)
|
|
57
66
|
-u, --usage Include usage messages (best practices)
|
|
58
67
|
-w, --fail-on-warnings Exit with code 1 if warnings are found
|
|
68
|
+
-l, --listChecks List all message IDs and severities
|
|
59
69
|
-v, --version Show version information
|
|
60
70
|
-h, --help Show this help message
|
|
61
71
|
|