@likecoin/epubcheck-ts 0.2.2 → 0.2.4
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 +8 -8
- package/bin/epubcheck.js +4 -4
- package/bin/epubcheck.ts +4 -4
- package/dist/index.cjs +1057 -101
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1057 -101
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/schemas/applications.rng +0 -429
- package/schemas/aria.rng +0 -3355
- package/schemas/block.rng +0 -488
- package/schemas/common.rng +0 -1076
- package/schemas/container.rng +0 -24
- package/schemas/core-scripting.rng +0 -950
- package/schemas/data.rng +0 -161
- package/schemas/datatypes.rng +0 -401
- package/schemas/embed.rng +0 -980
- package/schemas/epub-mathml3-inc.rng +0 -161
- package/schemas/epub-nav-30.rnc +0 -44
- package/schemas/epub-nav-30.rng +0 -19985
- package/schemas/epub-nav-30.sch +0 -87
- package/schemas/epub-prefix-attr.rng +0 -17
- package/schemas/epub-shared-inc.rng +0 -29
- package/schemas/epub-ssml-attrs.rng +0 -17
- package/schemas/epub-svg-30.rnc +0 -17
- package/schemas/epub-svg-30.rng +0 -19903
- package/schemas/epub-svg-30.sch +0 -7
- package/schemas/epub-svg-forgiving-inc.rng +0 -315
- package/schemas/epub-switch.rng +0 -121
- package/schemas/epub-trigger.rng +0 -90
- package/schemas/epub-type-attr.rng +0 -12
- package/schemas/epub-xhtml-30.rnc +0 -6
- package/schemas/epub-xhtml-30.rng +0 -19882
- package/schemas/epub-xhtml-30.sch +0 -409
- package/schemas/epub-xhtml-inc.rng +0 -151
- package/schemas/epub-xhtml-integration.rng +0 -565
- package/schemas/epub-xhtml-svg-mathml.rng +0 -17
- package/schemas/form-datatypes.rng +0 -54
- package/schemas/mathml3-common.rng +0 -336
- package/schemas/mathml3-content.rng +0 -1552
- package/schemas/mathml3-inc.rng +0 -30
- package/schemas/mathml3-presentation.rng +0 -2341
- package/schemas/mathml3-strict-content.rng +0 -205
- package/schemas/media.rng +0 -374
- package/schemas/meta.rng +0 -754
- package/schemas/microdata.rng +0 -192
- package/schemas/ncx.rng +0 -308
- package/schemas/ocf-container-30.rnc +0 -37
- package/schemas/ocf-container-30.rng +0 -568
- package/schemas/opf.rng +0 -15
- package/schemas/opf20.rng +0 -513
- package/schemas/package-30.rnc +0 -133
- package/schemas/package-30.rng +0 -1153
- package/schemas/package-30.sch +0 -444
- package/schemas/phrase.rng +0 -746
- package/schemas/rdfa.rng +0 -552
- package/schemas/revision.rng +0 -106
- package/schemas/ruby.rng +0 -141
- package/schemas/sectional.rng +0 -278
- package/schemas/structural.rng +0 -298
- package/schemas/tables.rng +0 -420
- package/schemas/web-components.rng +0 -184
- package/schemas/web-forms.rng +0 -975
- package/schemas/web-forms2.rng +0 -1236
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 (467 tests) and ~70% 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 ~70% 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 ~70% 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,16 +268,16 @@ This library is a TypeScript port of the Java-based [EPUBCheck](https://github.c
|
|
|
268
268
|
| Package Document (OPF) | 🟡 Partial | ~70% | Metadata, manifest, spine, collections, version/date validation |
|
|
269
269
|
| Content Documents | 🟡 Partial | ~70% | XHTML structure, script/MathML/SVG detection, link validation |
|
|
270
270
|
| Navigation Document | 🟡 Partial | ~40% | Nav structure, NCX validation, remote link validation |
|
|
271
|
-
| Schema Validation | 🟡 Partial | ~
|
|
271
|
+
| Schema Validation | 🟡 Partial | ~50% | RelaxNG for OPF/container; XHTML/SVG disabled (libxml2 limitation) |
|
|
272
272
|
| CSS | 🟡 Partial | ~50% | @font-face, @import, media overlay classes, position warnings |
|
|
273
273
|
| Cross-reference Validation | 🟡 Partial | ~75% | Reference tracking, fragment validation, undeclared resources |
|
|
274
|
-
| Accessibility Checks | 🟡 Partial | ~
|
|
274
|
+
| Accessibility Checks | 🟡 Partial | ~30% | Basic checks only (empty links, image alt, SVG titles) |
|
|
275
275
|
| Media Overlays | ❌ Not Started | 0% | Planned |
|
|
276
276
|
| Media Validation | ❌ Not Started | 0% | Planned |
|
|
277
277
|
|
|
278
278
|
Legend: 🟢 Complete | 🟡 Partial | 🔴 Basic | ❌ Not Started
|
|
279
279
|
|
|
280
|
-
**Overall Progress: ~
|
|
280
|
+
**Overall Progress: ~70% of Java EPUBCheck features**
|
|
281
281
|
|
|
282
282
|
See [PROJECT_STATUS.md](./PROJECT_STATUS.md) for detailed comparison.
|
|
283
283
|
|
|
@@ -357,8 +357,8 @@ Legend: ✅ Implemented
|
|
|
357
357
|
| Aspect | epubcheck-ts | EPUBCheck (Java) |
|
|
358
358
|
|--------|--------------|------------------|
|
|
359
359
|
| Runtime | Node.js / Browser | JVM |
|
|
360
|
-
| Feature Parity | ~
|
|
361
|
-
| Bundle Size | ~
|
|
360
|
+
| Feature Parity | ~70% | 100% |
|
|
361
|
+
| Bundle Size | ~450KB JS + ~1.6MB WASM | ~15MB |
|
|
362
362
|
| Installation | `npm install` | Download JAR |
|
|
363
363
|
| Integration | Native JS/TS | CLI or Java API |
|
|
364
364
|
| Performance | Comparable | Baseline |
|
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.2.
|
|
6
|
+
const VERSION = "0.2.4";
|
|
7
7
|
const { values, positionals } = parseArgs({
|
|
8
8
|
options: {
|
|
9
9
|
json: { type: "string", short: "j" },
|
|
@@ -21,7 +21,7 @@ if (values.version) {
|
|
|
21
21
|
console.log(`EPUBCheck-TS v${VERSION}`);
|
|
22
22
|
console.log("TypeScript EPUB validator for Node.js and browsers");
|
|
23
23
|
console.log();
|
|
24
|
-
console.log("Note: This is ~
|
|
24
|
+
console.log("Note: This is ~70% feature-complete compared to Java EPUBCheck.");
|
|
25
25
|
console.log("For production validation: https://github.com/w3c/epubcheck");
|
|
26
26
|
process.exit(0);
|
|
27
27
|
}
|
|
@@ -53,7 +53,7 @@ Exit Codes:
|
|
|
53
53
|
1 Validation errors found (or warnings with --fail-on-warnings)
|
|
54
54
|
2 Runtime error (file not found, invalid arguments, etc.)
|
|
55
55
|
|
|
56
|
-
Note: This tool provides ~
|
|
56
|
+
Note: This tool provides ~70% coverage of Java EPUBCheck features.
|
|
57
57
|
Missing features: Media Overlays, advanced ARIA checks, encryption/signatures.
|
|
58
58
|
For complete EPUB 3 conformance testing, use: https://github.com/w3c/epubcheck
|
|
59
59
|
|
|
@@ -153,7 +153,7 @@ async function main() {
|
|
|
153
153
|
console.log();
|
|
154
154
|
if (result.errorCount === 0 && result.fatalCount === 0) {
|
|
155
155
|
console.log(
|
|
156
|
-
"\x1B[90mNote: This validator provides ~
|
|
156
|
+
"\x1B[90mNote: This validator provides ~70% coverage of Java EPUBCheck.\x1B[0m"
|
|
157
157
|
);
|
|
158
158
|
console.log("\x1B[90mFor complete validation: https://github.com/w3c/epubcheck\x1B[0m");
|
|
159
159
|
console.log();
|
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.2.
|
|
17
|
+
const VERSION = '0.2.4';
|
|
18
18
|
|
|
19
19
|
// Parse command line arguments
|
|
20
20
|
const { values, positionals } = parseArgs({
|
|
@@ -36,7 +36,7 @@ if (values.version) {
|
|
|
36
36
|
console.log(`EPUBCheck-TS v${VERSION}`);
|
|
37
37
|
console.log('TypeScript EPUB validator for Node.js and browsers');
|
|
38
38
|
console.log();
|
|
39
|
-
console.log('Note: This is ~
|
|
39
|
+
console.log('Note: This is ~70% feature-complete compared to Java EPUBCheck.');
|
|
40
40
|
console.log('For production validation: https://github.com/w3c/epubcheck');
|
|
41
41
|
process.exit(0);
|
|
42
42
|
}
|
|
@@ -70,7 +70,7 @@ Exit Codes:
|
|
|
70
70
|
1 Validation errors found (or warnings with --fail-on-warnings)
|
|
71
71
|
2 Runtime error (file not found, invalid arguments, etc.)
|
|
72
72
|
|
|
73
|
-
Note: This tool provides ~
|
|
73
|
+
Note: This tool provides ~70% coverage of Java EPUBCheck features.
|
|
74
74
|
Missing features: Media Overlays, advanced ARIA checks, encryption/signatures.
|
|
75
75
|
For complete EPUB 3 conformance testing, use: https://github.com/w3c/epubcheck
|
|
76
76
|
|
|
@@ -204,7 +204,7 @@ async function main(): Promise<void> {
|
|
|
204
204
|
// Show limitation notice if there were no major errors
|
|
205
205
|
if (result.errorCount === 0 && result.fatalCount === 0) {
|
|
206
206
|
console.log(
|
|
207
|
-
'\x1b[90mNote: This validator provides ~
|
|
207
|
+
'\x1b[90mNote: This validator provides ~70% coverage of Java EPUBCheck.\x1b[0m',
|
|
208
208
|
);
|
|
209
209
|
console.log('\x1b[90mFor complete validation: https://github.com/w3c/epubcheck\x1b[0m');
|
|
210
210
|
console.log();
|