@vivliostyle/cli 8.0.1 → 8.1.1
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 +90 -88
- package/dist/build.d.ts +1 -5
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +80 -26
- package/dist/build.js.map +1 -1
- package/dist/commands/build.js +2 -0
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/build.parser.d.ts +1 -1
- package/dist/commands/build.parser.d.ts.map +1 -1
- package/dist/commands/build.parser.js +7 -3
- package/dist/commands/build.parser.js.map +1 -1
- package/dist/commands/init.js +1 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/init.parser.d.ts.map +1 -1
- package/dist/commands/init.parser.js +5 -2
- package/dist/commands/init.parser.js.map +1 -1
- package/dist/commands/preview.js +2 -0
- package/dist/commands/preview.js.map +1 -1
- package/dist/commands/preview.parser.d.ts.map +1 -1
- package/dist/commands/preview.parser.js +6 -2
- package/dist/commands/preview.parser.js.map +1 -1
- package/dist/const.d.ts +7 -2
- package/dist/const.d.ts.map +1 -1
- package/dist/const.js +26 -5
- package/dist/const.js.map +1 -1
- package/dist/container.js +5 -6
- package/dist/container.js.map +1 -1
- package/dist/init.d.ts +1 -0
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +4 -3
- package/dist/init.js.map +1 -1
- package/dist/{config.d.ts → input/config.d.ts} +13 -13
- package/dist/input/config.d.ts.map +1 -0
- package/dist/{config.js → input/config.js} +95 -110
- package/dist/input/config.js.map +1 -0
- package/dist/{input.d.ts → input/input-types.d.ts} +1 -1
- package/dist/input/input-types.d.ts.map +1 -0
- package/dist/{input.js → input/input-types.js} +3 -3
- package/dist/input/input-types.js.map +1 -0
- package/dist/output/epub.d.ts +10 -0
- package/dist/output/epub.d.ts.map +1 -0
- package/dist/output/epub.js +542 -0
- package/dist/output/epub.js.map +1 -0
- package/dist/{output.d.ts → output/output-types.d.ts} +8 -3
- package/dist/output/output-types.d.ts.map +1 -0
- package/dist/{output.js → output/output-types.js} +7 -4
- package/dist/output/output-types.js.map +1 -0
- package/dist/{postprocess.d.ts → output/pdf-postprocess.d.ts} +4 -4
- package/dist/output/pdf-postprocess.d.ts.map +1 -0
- package/dist/{postprocess.js → output/pdf-postprocess.js} +7 -8
- package/dist/output/pdf-postprocess.js.map +1 -0
- package/dist/{pdf.d.ts → output/pdf.d.ts} +3 -3
- package/dist/output/pdf.d.ts.map +1 -0
- package/dist/{pdf.js → output/pdf.js} +12 -13
- package/dist/output/pdf.js.map +1 -0
- package/dist/output/webbook.d.ts +21 -0
- package/dist/output/webbook.d.ts.map +1 -0
- package/dist/output/webbook.js +251 -0
- package/dist/output/webbook.js.map +1 -0
- package/dist/preview.d.ts +1 -1
- package/dist/preview.d.ts.map +1 -1
- package/dist/preview.js +7 -6
- package/dist/preview.js.map +1 -1
- package/dist/{builder.d.ts → processor/compile.d.ts} +9 -6
- package/dist/processor/compile.d.ts.map +1 -0
- package/dist/{builder.js → processor/compile.js} +54 -61
- package/dist/processor/compile.js.map +1 -0
- package/dist/processor/html.d.ts +52 -0
- package/dist/processor/html.d.ts.map +1 -0
- package/dist/processor/html.js +256 -0
- package/dist/processor/html.js.map +1 -0
- package/dist/processor/markdown.d.ts.map +1 -0
- package/dist/processor/markdown.js.map +1 -0
- package/dist/{theme.d.ts → processor/theme.d.ts} +1 -1
- package/dist/processor/theme.d.ts.map +1 -0
- package/dist/{theme.js → processor/theme.js} +6 -8
- package/dist/processor/theme.js.map +1 -0
- package/dist/schema/pubManifest.d.ts.map +1 -1
- package/dist/schema/pubManifest.js +19 -21
- package/dist/schema/pubManifest.js.map +1 -1
- package/dist/schema/vivliostyle.d.ts.map +1 -1
- package/dist/schema/vivliostyle.js +3 -5
- package/dist/schema/vivliostyle.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +18 -16
- package/dist/server.js.map +1 -1
- package/dist/util.d.ts +14 -0
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +111 -17
- package/dist/util.js.map +1 -1
- package/package.json +31 -15
- package/types/custom.d.ts +4 -0
- package/types/jsdom.d.ts +14 -0
- package/vendors/README.md +10 -0
- package/vendors/build.js +27 -0
- package/vendors/index.d.ts +4 -0
- package/vendors/index.js +2029 -0
- package/vendors/index.src.js +9 -0
- package/dist/builder.d.ts.map +0 -1
- package/dist/builder.js.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/epub.d.ts +0 -6
- package/dist/epub.d.ts.map +0 -1
- package/dist/epub.js +0 -18
- package/dist/epub.js.map +0 -1
- package/dist/html.d.ts +0 -17
- package/dist/html.d.ts.map +0 -1
- package/dist/html.js +0 -60
- package/dist/html.js.map +0 -1
- package/dist/input.d.ts.map +0 -1
- package/dist/input.js.map +0 -1
- package/dist/markdown.d.ts.map +0 -1
- package/dist/markdown.js.map +0 -1
- package/dist/output.d.ts.map +0 -1
- package/dist/output.js.map +0 -1
- package/dist/pdf.d.ts.map +0 -1
- package/dist/pdf.js.map +0 -1
- package/dist/postprocess.d.ts.map +0 -1
- package/dist/postprocess.js.map +0 -1
- package/dist/theme.d.ts.map +0 -1
- package/dist/theme.js.map +0 -1
- package/dist/webbook.d.ts +0 -7
- package/dist/webbook.d.ts.map +0 -1
- package/dist/webbook.js +0 -99
- package/dist/webbook.js.map +0 -1
- /package/dist/{markdown.d.ts → processor/markdown.d.ts} +0 -0
- /package/dist/{markdown.js → processor/markdown.js} +0 -0
package/package.json
CHANGED
|
@@ -1,30 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vivliostyle/cli",
|
|
3
3
|
"description": "Save the pdf file via headless browser and Vivliostyle.",
|
|
4
|
-
"version": "8.
|
|
4
|
+
"version": "8.1.1",
|
|
5
5
|
"author": "spring_raining <harusamex.com@gmail.com>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"build": "yarn clean && run-
|
|
8
|
+
"build": "yarn clean && run-s build:*",
|
|
9
|
+
"build:vendors": "node vendors/build.js",
|
|
9
10
|
"build:cli": "tsc && shx chmod +x dist/cli.js",
|
|
10
11
|
"generate:schema": "run-p generate:schema:*",
|
|
11
12
|
"generate:schema:pubManifest": "json2ts -i schemas/pubManifest/publication.schema.json -o src/schema/publication.schema.ts --cwd schemas/pubManifest",
|
|
12
13
|
"generate:schema:vivliostyleConfig": "json2ts -i schemas/vivliostyle/vivliostyleConfig.schema.json -o src/schema/vivliostyleConfig.schema.ts --cwd schemas/vivliostyle",
|
|
13
14
|
"clean": "shx rm -rf dist tmp",
|
|
14
15
|
"dev": "run-p dev:*",
|
|
16
|
+
"dev:vendors": "node vendors/build.js -w",
|
|
15
17
|
"dev:cli": "tsc -w --preserveWatchOutput",
|
|
16
18
|
"example": "yarn --cwd example build",
|
|
17
|
-
"pretest": "
|
|
19
|
+
"pretest": "playwright-core install chromium",
|
|
18
20
|
"release": "release-it",
|
|
19
21
|
"release:pre": "release-it --preRelease --npm.tag=next",
|
|
20
|
-
"test": "
|
|
22
|
+
"test": "vitest run --coverage"
|
|
21
23
|
},
|
|
22
24
|
"dependencies": {
|
|
25
|
+
"@napi-rs/canvas": "0.1.41",
|
|
23
26
|
"@npmcli/arborist": "^6.1.3",
|
|
27
|
+
"@vivliostyle/jsdom": "22.1.0-vivliostyle-cli.1",
|
|
24
28
|
"@vivliostyle/vfm": "2.1.0",
|
|
25
|
-
"@vivliostyle/viewer": "2.25.
|
|
29
|
+
"@vivliostyle/viewer": "2.25.3",
|
|
26
30
|
"ajv": "^8.11.2",
|
|
27
31
|
"ajv-formats": "^2.1.1",
|
|
32
|
+
"archiver": "^5.3.1",
|
|
33
|
+
"bcp-47-match": "^2.0.3",
|
|
28
34
|
"better-ajv-errors": "^1.2.0",
|
|
29
35
|
"chalk": "^4.1.2",
|
|
30
36
|
"cheerio": "^1.0.0-rc.10",
|
|
@@ -36,6 +42,7 @@
|
|
|
36
42
|
"execa": "^5.1.1",
|
|
37
43
|
"fast-glob": "3.2.12",
|
|
38
44
|
"fast-xml-parser": "^4.2.4",
|
|
45
|
+
"github-slugger": "^1.4.0",
|
|
39
46
|
"globby": "13.1.2",
|
|
40
47
|
"hast-util-to-html": "^7.1.3",
|
|
41
48
|
"hastscript": "^6.0.0",
|
|
@@ -52,20 +59,23 @@
|
|
|
52
59
|
"prettier": "^2.3.2",
|
|
53
60
|
"resolve-pkg": "^2.0.0",
|
|
54
61
|
"serve-handler": "^6.1.3",
|
|
55
|
-
"shelljs": "^0.8.5",
|
|
56
62
|
"slash": "4.0.0",
|
|
57
63
|
"terminal-link": "^2.1.1",
|
|
58
64
|
"tmp": "^0.2.1",
|
|
59
|
-
"upath": "^2.0.1",
|
|
60
65
|
"uuid": "^8.3.2",
|
|
61
|
-
"vfile": "^4.2.1"
|
|
66
|
+
"vfile": "^4.2.1",
|
|
67
|
+
"w3c-xmlserializer": "^4.0.0",
|
|
68
|
+
"whatwg-mimetype": "^3.0.0"
|
|
62
69
|
},
|
|
63
70
|
"devDependencies": {
|
|
71
|
+
"@hyrious/esbuild-plugin-commonjs": "^0.2.2",
|
|
64
72
|
"@release-it/conventional-changelog": "^5.1.1",
|
|
73
|
+
"@types/archiver": "^5.3.2",
|
|
65
74
|
"@types/command-exists": "1.2.0",
|
|
66
75
|
"@types/debug": "^4.1.7",
|
|
67
|
-
"@types/
|
|
68
|
-
"@types/
|
|
76
|
+
"@types/fs-extra": "^11.0.1",
|
|
77
|
+
"@types/github-slugger": "^1.3.0",
|
|
78
|
+
"@types/jsdom": "^21.1.1",
|
|
69
79
|
"@types/mime-types": "^2.1.1",
|
|
70
80
|
"@types/node": "^16.7.2",
|
|
71
81
|
"@types/npm-package-arg": "^6.1.1",
|
|
@@ -73,20 +83,25 @@
|
|
|
73
83
|
"@types/serve-handler": "^6.1.1",
|
|
74
84
|
"@types/tmp": "^0.2.1",
|
|
75
85
|
"@types/uuid": "^8.3.1",
|
|
86
|
+
"@types/w3c-xmlserializer": "^2.0.2",
|
|
87
|
+
"@types/whatwg-mimetype": "^3.0.0",
|
|
88
|
+
"@vitest/coverage-v8": "^0.33.0",
|
|
89
|
+
"esbuild": "^0.18.11",
|
|
76
90
|
"file-type": "^16.5.3",
|
|
91
|
+
"fs-extra": "^11.1.1",
|
|
77
92
|
"husky": "^4.3.8",
|
|
78
|
-
"jest": "^29.3.1",
|
|
79
|
-
"jsdom": "^17.0.0",
|
|
80
93
|
"json-schema-to-typescript": "^10.1.4",
|
|
81
94
|
"lint-staged": "^11.1.2",
|
|
95
|
+
"memfs": "^4.2.0",
|
|
82
96
|
"nodemon": "^2.0.12",
|
|
83
97
|
"npm-run-all": "^4.1.5",
|
|
84
98
|
"prettier-plugin-organize-imports": "^2.3.3",
|
|
85
99
|
"pretty-quick": "^3.1.1",
|
|
86
100
|
"release-it": "^15.6.0",
|
|
87
101
|
"shx": "^0.3.3",
|
|
88
|
-
"
|
|
89
|
-
"
|
|
102
|
+
"typescript": "^4.9.3",
|
|
103
|
+
"upath": "^2.0.1",
|
|
104
|
+
"vitest": "^0.33.0"
|
|
90
105
|
},
|
|
91
106
|
"main": "dist/index.js",
|
|
92
107
|
"module": "dist/index.js",
|
|
@@ -107,7 +122,8 @@
|
|
|
107
122
|
"files": [
|
|
108
123
|
"dist",
|
|
109
124
|
"schemas",
|
|
110
|
-
"types"
|
|
125
|
+
"types",
|
|
126
|
+
"vendors"
|
|
111
127
|
],
|
|
112
128
|
"husky": {
|
|
113
129
|
"hooks": {
|
package/types/custom.d.ts
CHANGED
|
@@ -7,3 +7,7 @@ declare type XOR<T extends any[], U extends any[] = []> = T extends []
|
|
|
7
7
|
? never
|
|
8
8
|
: (T[0] & Without<Union<[...U, ...Tail<T>]>>) | XOR<Tail<T>, [T[0], ...U]>;
|
|
9
9
|
declare type Resolved<T> = T extends Promise<infer U> ? U : never;
|
|
10
|
+
|
|
11
|
+
interface ImportMeta {
|
|
12
|
+
env?: Record<string, unknown>;
|
|
13
|
+
}
|
package/types/jsdom.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare module '@vivliostyle/jsdom' {
|
|
2
|
+
export * from 'jsdom';
|
|
3
|
+
|
|
4
|
+
export interface AbortablePromise<T> extends Promise<T> {
|
|
5
|
+
abort(): void;
|
|
6
|
+
response?: import('http').IncomingMessage;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export class ResourceLoader {
|
|
10
|
+
_readFile(filePath: string): AbortablePromise<Buffer>;
|
|
11
|
+
fetch(url: string, options?: FetchOptions): AbortablePromise<Buffer> | null;
|
|
12
|
+
constructor(obj?: ResourceLoaderConstructorOptions);
|
|
13
|
+
}
|
|
14
|
+
}
|
package/vendors/build.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { commonjs } from '@hyrious/esbuild-plugin-commonjs';
|
|
2
|
+
import chokidar from 'chokidar';
|
|
3
|
+
import { context } from 'esbuild';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
|
|
7
|
+
const dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
|
|
9
|
+
const ctx = await context({
|
|
10
|
+
entryPoints: [path.join(dirname, 'index.src.js')],
|
|
11
|
+
bundle: true,
|
|
12
|
+
format: 'esm',
|
|
13
|
+
outfile: path.join(dirname, 'index.js'),
|
|
14
|
+
platform: 'node',
|
|
15
|
+
plugins: [commonjs()],
|
|
16
|
+
}).catch(() => process.exit(1));
|
|
17
|
+
await ctx.rebuild();
|
|
18
|
+
|
|
19
|
+
if (process.argv.slice(2).includes('-w')) {
|
|
20
|
+
chokidar.watch(path.join(dirname, '**')).on('all', async () => {
|
|
21
|
+
await ctx.rebuild().catch(() => {
|
|
22
|
+
/* NOOP */
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
} else {
|
|
26
|
+
await ctx.dispose();
|
|
27
|
+
}
|