@vivliostyle/cli 5.0.0 → 5.0.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 CHANGED
@@ -70,36 +70,48 @@ vivliostyle build
70
70
  Options:
71
71
  -c, --config <config_file> path to vivliostyle.config.js [vivliostyle.config.js]
72
72
  -o, --output <path> specify output file name or directory [<title>.pdf]
73
- This option can be specified multiple, then each -o options can be supplied one -f option.
73
+ This option can be specified multiple, then each -o options
74
+ can be supplied one -f option.
74
75
  ex: -o output1 -f webpub -o output2.pdf -f pdf
75
76
  -f, --format <format> specify output format corresponding output target
76
- If an extension is specified on -o option, this field will be inferenced automatically.
77
+ If an extension is specified on -o option, this field will be
78
+ inferenced automatically.
77
79
  -s, --size <size> output pdf size [Letter]
78
- preset: A5, A4, A3, B5, B4, JIS-B5, JIS-B4, letter, legal, ledger
80
+ preset: A5, A4, A3, B5, B4, JIS-B5, JIS-B4, letter, legal,
81
+ ledger
79
82
  custom(comma separated): 182mm,257mm or 8.5in,11in
80
83
  --style <stylesheet> additional stylesheet URL or path
81
84
  --user-style <user_stylesheet> user stylesheet URL or path
82
85
  -d, --single-doc single HTML document input
83
- -p, --press-ready make generated PDF compatible with press ready PDF/X-1a [false]
86
+ -p, --press-ready make generated PDF compatible with press ready PDF/X-1a
87
+ [false]
84
88
  This option is equivalent with "--preflight press-ready"
85
89
  -t, --timeout <seconds> timeout limit for waiting Vivliostyle process [120]
86
90
  -T, --theme <theme> theme path or package name
87
91
  --title <title> title
88
92
  --author <author> author
89
93
  -l, --language <language> language
90
- --render-mode <mode> if docker is set, Vivliostyle try to render PDF on Docker container [local] (choices: "local", "docker")
91
- --preflight <mode> apply the process to generate PDF for printing (choices: "press-ready", "press-ready-local")
92
- --preflight-option <options...> options for preflight process (ex: gray-scale, enforce-outline)
93
- Please refer the document of press-ready for further information.
94
+ --render-mode <mode> if docker is set, Vivliostyle try to render PDF on Docker
95
+ container [local] (choices: "local", "docker")
96
+ --preflight <mode> apply the process to generate PDF for printing (choices:
97
+ "press-ready", "press-ready-local")
98
+ --preflight-option <options...> options for preflight process (ex: gray-scale,
99
+ enforce-outline)
100
+ Please refer the document of press-ready for further
101
+ information.
94
102
  https://github.com/vibranthq/press-ready
95
103
  --verbose verbose log output
96
- --no-sandbox launch chrome without sandbox. use this option when ECONNREFUSED error occurred.
97
- --executable-chromium <path> specify a path of executable Chrome (or Chromium) you installed
104
+ --no-sandbox launch chrome without sandbox. use this option when
105
+ ECONNREFUSED error occurred.
106
+ --executable-browser <path> specify a path of executable browser you installed
98
107
  --image <image> specify a docker image to render
99
- --http launch an HTTP server hosting contents instead of file protocol
108
+ --http launch an HTTP server hosting contents instead of file
109
+ protocol
100
110
  It is useful that requires CORS such as external web fonts.
101
- --viewer <URL> specify a URL of displaying viewer instead of vivliostyle-cli's one
102
- It is useful that using own viewer that has staging features. (ex: https://vivliostyle.vercel.app/)
111
+ --viewer <URL> specify a URL of displaying viewer instead of
112
+ vivliostyle-cli's one
113
+ It is useful that using own viewer that has staging features.
114
+ (ex: https://vivliostyle.vercel.app/)
103
115
  -h, --help display help for command
104
116
  ```
105
117
 
@@ -118,7 +130,8 @@ Options:
118
130
  -c, --config <config_file> path to vivliostyle.config.js
119
131
  -T, --theme <theme> theme path or package name
120
132
  -s, --size <size> output pdf size [Letter]
121
- preset: A5, A4, A3, B5, B4, JIS-B5, JIS-B4, letter, legal, ledger
133
+ preset: A5, A4, A3, B5, B4, JIS-B5, JIS-B4, letter, legal,
134
+ ledger
122
135
  custom(comma separated): 182mm,257mm or 8.5in,11in
123
136
  --style <stylesheet> additional stylesheet URL or path
124
137
  --user-style <user_stylesheet> user stylesheet URL or path
@@ -128,12 +141,20 @@ Options:
128
141
  --author <author> author
129
142
  -l, --language <language> language
130
143
  --verbose verbose log output
131
- --no-sandbox launch chrome without sandbox (use this option to avoid ECONNREFUSED error)
132
- --executable-chromium <path> specify a path of executable Chrome(Chromium) you installed
133
- --http launch an HTTP server hosting contents instead of file protocol
144
+ --no-sandbox launch chrome without sandbox (use this option to avoid
145
+ ECONNREFUSED error)
146
+ --executable-browser <path> specify a path of executable browser you installed
147
+ --http launch an HTTP server hosting contents instead of file
148
+ protocol
134
149
  It is useful that requires CORS such as external web fonts.
135
- --viewer <URL> specify a URL of displaying viewer instead of vivliostyle-cli's one
136
- It is useful that using own viewer that has staging features. (ex: https://vivliostyle.vercel.app/)
150
+ --viewer <URL> specify a URL of displaying viewer instead of
151
+ vivliostyle-cli's one
152
+ It is useful that using own viewer that has staging features.
153
+ (ex: https://vivliostyle.vercel.app/)
154
+ --browser <browser> EXPERIMENTAL SUPPORT: Specify a browser type to launch
155
+ Vivliostyle viewer [chromium]
156
+ Currently, Firefox and Webkit support preview command only!
157
+ (choices: "chromium", "firefox", "webkit")
137
158
  -h, --help display help for command
138
159
  ```
139
160
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vivliostyle/cli",
3
3
  "description": "Save the pdf file via headless browser and Vivliostyle.",
4
- "version": "5.0.0",
4
+ "version": "5.0.1",
5
5
  "author": "spring_raining <harusamex.com@gmail.com>",
6
6
  "scripts": {
7
7
  "postinstall": "patch-package",
@@ -91,7 +91,8 @@
91
91
  "vs": "dist/cli.js"
92
92
  },
93
93
  "files": [
94
- "dist"
94
+ "dist",
95
+ "patches"
95
96
  ],
96
97
  "husky": {
97
98
  "hooks": {
@@ -0,0 +1,52 @@
1
+ diff --git a/node_modules/playwright-core/lib/client/connection.js b/node_modules/playwright-core/lib/client/connection.js
2
+ index 84ecda7..fe9e413 100644
3
+ --- a/node_modules/playwright-core/lib/client/connection.js
4
+ +++ b/node_modules/playwright-core/lib/client/connection.js
5
+ @@ -229,7 +229,7 @@ class Connection extends _events.EventEmitter {
6
+ if (Array.isArray(payload)) return payload.map(p => this._replaceGuidsWithChannels(p));
7
+ if (payload.guid && this._objects.has(payload.guid)) return this._objects.get(payload.guid)._channel;
8
+
9
+ - if (typeof payload === 'object') {
10
+ + if (typeof payload === 'object' && !(payload instanceof Buffer)) {
11
+ const result = {};
12
+
13
+ for (const key of Object.keys(payload)) result[key] = this._replaceGuidsWithChannels(payload[key]);
14
+ diff --git a/node_modules/playwright-core/lib/client/page.js b/node_modules/playwright-core/lib/client/page.js
15
+ index 07a6546..bc4c7be 100644
16
+ --- a/node_modules/playwright-core/lib/client/page.js
17
+ +++ b/node_modules/playwright-core/lib/client/page.js
18
+ @@ -811,7 +811,7 @@ class Page extends _channelOwner.ChannelOwner {
19
+
20
+ const result = await this._channel.pdf(transportOptions);
21
+
22
+ - const buffer = _buffer.Buffer.from(result.pdf, 'base64');
23
+ + const buffer = result.pdf;
24
+
25
+ if (options.path) {
26
+ await _fs.default.promises.mkdir(_path.default.dirname(options.path), {
27
+ diff --git a/node_modules/playwright-core/lib/server/dispatchers/dispatcher.js b/node_modules/playwright-core/lib/server/dispatchers/dispatcher.js
28
+ index 8ddf347..1378056 100644
29
+ --- a/node_modules/playwright-core/lib/server/dispatchers/dispatcher.js
30
+ +++ b/node_modules/playwright-core/lib/server/dispatchers/dispatcher.js
31
+ @@ -377,7 +377,7 @@ class DispatcherConnection {
32
+ };
33
+ if (Array.isArray(payload)) return payload.map(p => this._replaceDispatchersWithGuids(p));
34
+
35
+ - if (typeof payload === 'object') {
36
+ + if (typeof payload === 'object' && !(payload instanceof Buffer)) {
37
+ const result = {};
38
+
39
+ for (const key of Object.keys(payload)) result[key] = this._replaceDispatchersWithGuids(payload[key]);
40
+ diff --git a/node_modules/playwright-core/lib/server/dispatchers/pageDispatcher.js b/node_modules/playwright-core/lib/server/dispatchers/pageDispatcher.js
41
+ index a71fab2..ddede77 100644
42
+ --- a/node_modules/playwright-core/lib/server/dispatchers/pageDispatcher.js
43
+ +++ b/node_modules/playwright-core/lib/server/dispatchers/pageDispatcher.js
44
+ @@ -309,7 +309,7 @@ class PageDispatcher extends _dispatcher.Dispatcher {
45
+ if (!this._page.pdf) throw new Error('PDF generation is only supported for Headless Chromium');
46
+ const buffer = await this._page.pdf(params);
47
+ return {
48
+ - pdf: buffer.toString('base64')
49
+ + pdf: buffer,
50
+ };
51
+ }
52
+