@likecoin/epubcheck-ts 0.3.6 → 0.3.7
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 +7 -7
- package/bin/epubcheck.js +4 -4
- package/bin/epubcheck.ts +4 -4
- package/dist/index.cjs +1721 -325
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +1721 -325
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,13 +6,13 @@ A TypeScript port of [EPUBCheck](https://github.com/w3c/epubcheck) - the officia
|
|
|
6
6
|
[](https://www.npmjs.com/package/@likecoin/epubcheck-ts)
|
|
7
7
|
[](./LICENSE)
|
|
8
8
|
|
|
9
|
-
> **Note**: This library is primarily developed for internal use at [3ook.com](https://3ook.com/about) and is built with AI-assisted development. While it has comprehensive test coverage (
|
|
9
|
+
> **Note**: This library is primarily developed for internal use at [3ook.com](https://3ook.com/about) and is built with AI-assisted development. While it has comprehensive test coverage (892 passing / 945 total tests) and ~88% feature parity with Java EPUBCheck, it may not be suitable for mission-critical production workloads. For production environments requiring full EPUB validation, consider using the official [Java EPUBCheck](https://github.com/w3c/epubcheck). Contributions and feedback are welcome!
|
|
10
10
|
|
|
11
11
|
## Features
|
|
12
12
|
|
|
13
13
|
- **CLI and programmatic API**: Use as a command-line tool or integrate into your application
|
|
14
14
|
- **Cross-platform**: Works in Node.js (18+) and modern browsers
|
|
15
|
-
- **Partial EPUB validation**: Currently ~
|
|
15
|
+
- **Partial EPUB validation**: Currently ~88% of EPUBCheck feature parity
|
|
16
16
|
- **Zero native dependencies**: Pure JavaScript/WebAssembly, no compilation required
|
|
17
17
|
- **TypeScript first**: Full type definitions included
|
|
18
18
|
- **Tree-shakable**: ESM with proper exports for optimal bundling
|
|
@@ -70,7 +70,7 @@ epubcheck-ts book.epub --quiet --fail-on-warnings
|
|
|
70
70
|
epubcheck-ts dictionary.epub --profile dict
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
**Note:** This CLI provides ~
|
|
73
|
+
**Note:** This CLI provides ~88% coverage of Java EPUBCheck features. For complete EPUB 3 conformance testing, use the [official Java EPUBCheck](https://github.com/w3c/epubcheck).
|
|
74
74
|
|
|
75
75
|
### ES Modules (recommended)
|
|
76
76
|
|
|
@@ -268,18 +268,18 @@ This library is a TypeScript port of the Java-based [EPUBCheck](https://github.c
|
|
|
268
268
|
|-----------|--------|--------------|-------|
|
|
269
269
|
| OCF Container | 🟡 Partial | ~90% | ZIP structure, mimetype, container.xml, encryption.xml obfuscation |
|
|
270
270
|
| Package Document (OPF) | 🟢 Complete | ~90% | Metadata, manifest, spine, collections, Schematron-equivalent checks |
|
|
271
|
-
| Content Documents | 🟡 Partial | ~
|
|
271
|
+
| Content Documents | 🟡 Partial | ~85% | XHTML structure, CSS url(), @import, SVG, entities, title, SSML, XML version |
|
|
272
272
|
| Navigation Document | 🟢 Complete | ~85% | Nav content model, landmarks, labels, reading order, hidden |
|
|
273
273
|
| Schema Validation | 🟡 Partial | ~50% | RelaxNG for OPF/container; XHTML/SVG disabled (libxml2 limitation) |
|
|
274
274
|
| CSS | 🟡 Partial | ~70% | @font-face, @import, url() extraction, position, forbidden properties |
|
|
275
|
-
| Cross-reference Validation |
|
|
275
|
+
| Cross-reference Validation | 🟢 Complete | ~90% | Reference tracking, fragments, fallbacks, remote resources |
|
|
276
276
|
| Accessibility Checks | 🟡 Partial | ~30% | Basic checks only (empty links, image alt, SVG titles) |
|
|
277
277
|
| Media Overlays | ❌ Not Started | 0% | Planned |
|
|
278
278
|
| Media Validation | ❌ Not Started | 0% | Planned |
|
|
279
279
|
|
|
280
280
|
Legend: 🟢 Complete | 🟡 Partial | 🔴 Basic | ❌ Not Started
|
|
281
281
|
|
|
282
|
-
**Overall Progress: ~
|
|
282
|
+
**Overall Progress: ~88% of Java EPUBCheck features**
|
|
283
283
|
|
|
284
284
|
See [PROJECT_STATUS.md](./PROJECT_STATUS.md) for detailed comparison.
|
|
285
285
|
|
|
@@ -364,7 +364,7 @@ Legend: ✅ Implemented
|
|
|
364
364
|
| Aspect | epubcheck-ts | EPUBCheck (Java) |
|
|
365
365
|
|--------|--------------|------------------|
|
|
366
366
|
| Runtime | Node.js / Browser | JVM |
|
|
367
|
-
| Feature Parity | ~
|
|
367
|
+
| Feature Parity | ~88% | 100% |
|
|
368
368
|
| Bundle Size | ~450KB JS + ~1.6MB WASM | ~15MB |
|
|
369
369
|
| Installation | `npm install` | Download JAR |
|
|
370
370
|
| Integration | Native JS/TS | CLI or Java API |
|
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.3.
|
|
6
|
+
const VERSION = "0.3.7";
|
|
7
7
|
const { values, positionals } = parseArgs({
|
|
8
8
|
options: {
|
|
9
9
|
json: { type: "string", short: "j" },
|
|
@@ -22,7 +22,7 @@ if (values.version) {
|
|
|
22
22
|
console.log(`EPUBCheck-TS v${VERSION}`);
|
|
23
23
|
console.log("TypeScript EPUB validator for Node.js and browsers");
|
|
24
24
|
console.log();
|
|
25
|
-
console.log("Note: This is ~
|
|
25
|
+
console.log("Note: This is ~88% feature-complete compared to Java EPUBCheck.");
|
|
26
26
|
console.log("For production validation: https://github.com/w3c/epubcheck");
|
|
27
27
|
process.exit(0);
|
|
28
28
|
}
|
|
@@ -61,7 +61,7 @@ Exit Codes:
|
|
|
61
61
|
1 Validation errors found (or warnings with --fail-on-warnings)
|
|
62
62
|
2 Runtime error (file not found, invalid arguments, etc.)
|
|
63
63
|
|
|
64
|
-
Note: This tool provides ~
|
|
64
|
+
Note: This tool provides ~88% coverage of Java EPUBCheck features.
|
|
65
65
|
Missing features: Media Overlays, advanced ARIA checks, encryption/signatures.
|
|
66
66
|
For complete EPUB 3 conformance testing, use: https://github.com/w3c/epubcheck
|
|
67
67
|
|
|
@@ -159,7 +159,7 @@ async function main() {
|
|
|
159
159
|
console.log();
|
|
160
160
|
if (result.errorCount === 0 && result.fatalCount === 0) {
|
|
161
161
|
console.log(
|
|
162
|
-
"\x1B[90mNote: This validator provides ~
|
|
162
|
+
"\x1B[90mNote: This validator provides ~88% coverage of Java EPUBCheck.\x1B[0m"
|
|
163
163
|
);
|
|
164
164
|
console.log("\x1B[90mFor complete validation: https://github.com/w3c/epubcheck\x1B[0m");
|
|
165
165
|
console.log();
|
package/bin/epubcheck.ts
CHANGED
|
@@ -15,7 +15,7 @@ import type { EpubCheckOptions, EPUBProfile, ValidationMessage } from '../src/ty
|
|
|
15
15
|
// Dynamic import to support both ESM and CJS builds
|
|
16
16
|
const { EpubCheck, toJSONReport } = await import('../dist/index.js');
|
|
17
17
|
|
|
18
|
-
const VERSION = '0.3.
|
|
18
|
+
const VERSION = '0.3.7';
|
|
19
19
|
|
|
20
20
|
// Parse command line arguments
|
|
21
21
|
const { values, positionals } = parseArgs({
|
|
@@ -38,7 +38,7 @@ if (values.version) {
|
|
|
38
38
|
console.log(`EPUBCheck-TS v${VERSION}`);
|
|
39
39
|
console.log('TypeScript EPUB validator for Node.js and browsers');
|
|
40
40
|
console.log();
|
|
41
|
-
console.log('Note: This is ~
|
|
41
|
+
console.log('Note: This is ~88% feature-complete compared to Java EPUBCheck.');
|
|
42
42
|
console.log('For production validation: https://github.com/w3c/epubcheck');
|
|
43
43
|
process.exit(0);
|
|
44
44
|
}
|
|
@@ -81,7 +81,7 @@ Exit Codes:
|
|
|
81
81
|
1 Validation errors found (or warnings with --fail-on-warnings)
|
|
82
82
|
2 Runtime error (file not found, invalid arguments, etc.)
|
|
83
83
|
|
|
84
|
-
Note: This tool provides ~
|
|
84
|
+
Note: This tool provides ~88% coverage of Java EPUBCheck features.
|
|
85
85
|
Missing features: Media Overlays, advanced ARIA checks, encryption/signatures.
|
|
86
86
|
For complete EPUB 3 conformance testing, use: https://github.com/w3c/epubcheck
|
|
87
87
|
|
|
@@ -210,7 +210,7 @@ async function main(): Promise<void> {
|
|
|
210
210
|
// Show limitation notice if there were no major errors
|
|
211
211
|
if (result.errorCount === 0 && result.fatalCount === 0) {
|
|
212
212
|
console.log(
|
|
213
|
-
'\x1b[90mNote: This validator provides ~
|
|
213
|
+
'\x1b[90mNote: This validator provides ~88% coverage of Java EPUBCheck.\x1b[0m',
|
|
214
214
|
);
|
|
215
215
|
console.log('\x1b[90mFor complete validation: https://github.com/w3c/epubcheck\x1b[0m');
|
|
216
216
|
console.log();
|