@likecoin/epubcheck-ts 0.3.4 → 0.3.5
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 +11 -11
- package/bin/epubcheck.js +1 -1
- package/bin/epubcheck.ts +1 -1
- package/dist/index.cjs +373 -74
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +373 -74
- 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 (618 tests) and ~75% 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 ~75% 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 ~75% 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
|
|
|
@@ -266,20 +266,20 @@ This library is a TypeScript port of the Java-based [EPUBCheck](https://github.c
|
|
|
266
266
|
|
|
267
267
|
| Component | Status | Completeness | Notes |
|
|
268
268
|
|-----------|--------|--------------|-------|
|
|
269
|
-
| OCF Container | 🟡 Partial | ~
|
|
270
|
-
| Package Document (OPF) |
|
|
271
|
-
| Content Documents | 🟡 Partial | ~
|
|
272
|
-
| Navigation Document |
|
|
269
|
+
| OCF Container | 🟡 Partial | ~90% | ZIP structure, mimetype, container.xml, encryption.xml obfuscation |
|
|
270
|
+
| Package Document (OPF) | 🟢 Complete | ~90% | Metadata, manifest, spine, collections, Schematron-equivalent checks |
|
|
271
|
+
| Content Documents | 🟡 Partial | ~80% | XHTML structure, CSS url(), @import, SVG, script detection |
|
|
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
|
-
| CSS | 🟡 Partial | ~
|
|
275
|
-
| Cross-reference Validation | 🟡 Partial | ~
|
|
274
|
+
| CSS | 🟡 Partial | ~70% | @font-face, @import, url() extraction, position, forbidden properties |
|
|
275
|
+
| Cross-reference Validation | 🟡 Partial | ~80% | 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: ~75% 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 | ~75% | 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.5";
|
|
7
7
|
const { values, positionals } = parseArgs({
|
|
8
8
|
options: {
|
|
9
9
|
json: { type: "string", short: "j" },
|
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.5';
|
|
19
19
|
|
|
20
20
|
// Parse command line arguments
|
|
21
21
|
const { values, positionals } = parseArgs({
|