@vivliostyle/cli 9.0.0-next.3 → 9.0.0-next.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.
Files changed (186) hide show
  1. package/dist/chunk-BIEQXUOY.js +50 -0
  2. package/dist/chunk-DMARNPN5.js +1073 -0
  3. package/dist/chunk-DMGAKSPH.js +590 -0
  4. package/dist/{core/init.js → chunk-E7QOXL6M.js} +39 -27
  5. package/dist/chunk-EX7EA34F.js +64 -0
  6. package/dist/chunk-LASMQBPP.js +85 -0
  7. package/dist/chunk-QC3BOE2G.js +74 -0
  8. package/dist/chunk-VBEHGS67.js +4990 -0
  9. package/dist/chunk-WX6JHPSL.js +16 -0
  10. package/dist/chunk-Y3ETBU5J.js +54 -0
  11. package/dist/cli.d.ts +0 -2
  12. package/dist/cli.js +17 -18
  13. package/dist/commands/build.d.ts +2 -2
  14. package/dist/commands/build.js +165 -17
  15. package/dist/commands/init.d.ts +2 -2
  16. package/dist/commands/init.js +35 -12
  17. package/dist/commands/preview.d.ts +2 -2
  18. package/dist/commands/preview.js +98 -12
  19. package/dist/config/schema.d.ts +2332 -2325
  20. package/dist/config/schema.js +50 -588
  21. package/dist/index.d.ts +116 -7
  22. package/dist/index.js +38 -42
  23. package/dist/node-modules.d.ts +21 -0
  24. package/dist/node-modules.js +9 -0
  25. package/dist/vite-adapter.d.ts +8 -2
  26. package/dist/vite-adapter.js +11 -43
  27. package/package.json +32 -13
  28. package/dist/browser.d.ts +0 -19
  29. package/dist/browser.d.ts.map +0 -1
  30. package/dist/browser.js +0 -154
  31. package/dist/browser.js.map +0 -1
  32. package/dist/cli.d.ts.map +0 -1
  33. package/dist/cli.js.map +0 -1
  34. package/dist/commands/build.d.ts.map +0 -1
  35. package/dist/commands/build.js.map +0 -1
  36. package/dist/commands/build.parser.d.ts +0 -3
  37. package/dist/commands/build.parser.d.ts.map +0 -1
  38. package/dist/commands/build.parser.js +0 -104
  39. package/dist/commands/build.parser.js.map +0 -1
  40. package/dist/commands/cli-flags.d.ts +0 -42
  41. package/dist/commands/cli-flags.d.ts.map +0 -1
  42. package/dist/commands/cli-flags.js +0 -58
  43. package/dist/commands/cli-flags.js.map +0 -1
  44. package/dist/commands/init.d.ts.map +0 -1
  45. package/dist/commands/init.js.map +0 -1
  46. package/dist/commands/init.parser.d.ts +0 -3
  47. package/dist/commands/init.parser.d.ts.map +0 -1
  48. package/dist/commands/init.parser.js +0 -17
  49. package/dist/commands/init.parser.js.map +0 -1
  50. package/dist/commands/preview.d.ts.map +0 -1
  51. package/dist/commands/preview.js.map +0 -1
  52. package/dist/commands/preview.parser.d.ts +0 -3
  53. package/dist/commands/preview.parser.d.ts.map +0 -1
  54. package/dist/commands/preview.parser.js +0 -52
  55. package/dist/commands/preview.parser.js.map +0 -1
  56. package/dist/config/load.d.ts +0 -4
  57. package/dist/config/load.d.ts.map +0 -1
  58. package/dist/config/load.js +0 -75
  59. package/dist/config/load.js.map +0 -1
  60. package/dist/config/merge.d.ts +0 -4
  61. package/dist/config/merge.d.ts.map +0 -1
  62. package/dist/config/merge.js +0 -59
  63. package/dist/config/merge.js.map +0 -1
  64. package/dist/config/resolve.d.ts +0 -205
  65. package/dist/config/resolve.d.ts.map +0 -1
  66. package/dist/config/resolve.js +0 -770
  67. package/dist/config/resolve.js.map +0 -1
  68. package/dist/config/schema.d.ts.map +0 -1
  69. package/dist/config/schema.js.map +0 -1
  70. package/dist/config/vite.d.ts +0 -6
  71. package/dist/config/vite.d.ts.map +0 -1
  72. package/dist/config/vite.js +0 -49
  73. package/dist/config/vite.js.map +0 -1
  74. package/dist/const.d.ts +0 -20
  75. package/dist/const.d.ts.map +0 -1
  76. package/dist/const.js +0 -41
  77. package/dist/const.js.map +0 -1
  78. package/dist/container.d.ts +0 -21
  79. package/dist/container.d.ts.map +0 -1
  80. package/dist/container.js +0 -175
  81. package/dist/container.js.map +0 -1
  82. package/dist/core/build.d.ts +0 -3
  83. package/dist/core/build.d.ts.map +0 -1
  84. package/dist/core/build.js +0 -168
  85. package/dist/core/build.js.map +0 -1
  86. package/dist/core/init.d.ts +0 -3
  87. package/dist/core/init.d.ts.map +0 -1
  88. package/dist/core/init.js.map +0 -1
  89. package/dist/core/preview.d.ts +0 -4
  90. package/dist/core/preview.d.ts.map +0 -1
  91. package/dist/core/preview.js +0 -114
  92. package/dist/core/preview.js.map +0 -1
  93. package/dist/index.d.ts.map +0 -1
  94. package/dist/index.js.map +0 -1
  95. package/dist/logger.d.ts +0 -30
  96. package/dist/logger.d.ts.map +0 -1
  97. package/dist/logger.js +0 -172
  98. package/dist/logger.js.map +0 -1
  99. package/dist/output/epub.d.ts +0 -10
  100. package/dist/output/epub.d.ts.map +0 -1
  101. package/dist/output/epub.js +0 -505
  102. package/dist/output/epub.js.map +0 -1
  103. package/dist/output/pdf-postprocess.d.ts +0 -30
  104. package/dist/output/pdf-postprocess.d.ts.map +0 -1
  105. package/dist/output/pdf-postprocess.js +0 -270
  106. package/dist/output/pdf-postprocess.js.map +0 -1
  107. package/dist/output/pdf.d.ts +0 -6
  108. package/dist/output/pdf.d.ts.map +0 -1
  109. package/dist/output/pdf.js +0 -200
  110. package/dist/output/pdf.js.map +0 -1
  111. package/dist/output/webbook.d.ts +0 -45
  112. package/dist/output/webbook.d.ts.map +0 -1
  113. package/dist/output/webbook.js +0 -413
  114. package/dist/output/webbook.js.map +0 -1
  115. package/dist/processor/compile.d.ts +0 -30
  116. package/dist/processor/compile.d.ts.map +0 -1
  117. package/dist/processor/compile.js +0 -348
  118. package/dist/processor/compile.js.map +0 -1
  119. package/dist/processor/html.d.ts +0 -107
  120. package/dist/processor/html.d.ts.map +0 -1
  121. package/dist/processor/html.js +0 -494
  122. package/dist/processor/html.js.map +0 -1
  123. package/dist/processor/markdown.d.ts +0 -12
  124. package/dist/processor/markdown.d.ts.map +0 -1
  125. package/dist/processor/markdown.js +0 -23
  126. package/dist/processor/markdown.js.map +0 -1
  127. package/dist/processor/theme.d.ts +0 -4
  128. package/dist/processor/theme.d.ts.map +0 -1
  129. package/dist/processor/theme.js +0 -41
  130. package/dist/processor/theme.js.map +0 -1
  131. package/dist/schema/pub-manifest.d.ts +0 -4
  132. package/dist/schema/pub-manifest.d.ts.map +0 -1
  133. package/dist/schema/pub-manifest.js +0 -41
  134. package/dist/schema/pub-manifest.js.map +0 -1
  135. package/dist/schema/publication.schema.d.ts +0 -104
  136. package/dist/schema/publication.schema.d.ts.map +0 -1
  137. package/dist/schema/publication.schema.js +0 -8
  138. package/dist/schema/publication.schema.js.map +0 -1
  139. package/dist/server.d.ts +0 -20
  140. package/dist/server.d.ts.map +0 -1
  141. package/dist/server.js +0 -126
  142. package/dist/server.js.map +0 -1
  143. package/dist/util.d.ts +0 -55
  144. package/dist/util.d.ts.map +0 -1
  145. package/dist/util.js +0 -274
  146. package/dist/util.js.map +0 -1
  147. package/dist/vite/plugin-util.d.ts +0 -6
  148. package/dist/vite/plugin-util.d.ts.map +0 -1
  149. package/dist/vite/plugin-util.js +0 -18
  150. package/dist/vite/plugin-util.js.map +0 -1
  151. package/dist/vite/vite-plugin-browser.d.ts +0 -8
  152. package/dist/vite/vite-plugin-browser.d.ts.map +0 -1
  153. package/dist/vite/vite-plugin-browser.js +0 -54
  154. package/dist/vite/vite-plugin-browser.js.map +0 -1
  155. package/dist/vite/vite-plugin-dev-server.d.ts +0 -8
  156. package/dist/vite/vite-plugin-dev-server.d.ts.map +0 -1
  157. package/dist/vite/vite-plugin-dev-server.js +0 -270
  158. package/dist/vite/vite-plugin-dev-server.js.map +0 -1
  159. package/dist/vite/vite-plugin-static-serve.d.ts +0 -8
  160. package/dist/vite/vite-plugin-static-serve.d.ts.map +0 -1
  161. package/dist/vite/vite-plugin-static-serve.js +0 -31
  162. package/dist/vite/vite-plugin-static-serve.js.map +0 -1
  163. package/dist/vite/vite-plugin-viewer.d.ts +0 -8
  164. package/dist/vite/vite-plugin-viewer.d.ts.map +0 -1
  165. package/dist/vite/vite-plugin-viewer.js +0 -52
  166. package/dist/vite/vite-plugin-viewer.js.map +0 -1
  167. package/dist/vite-adapter.d.ts.map +0 -1
  168. package/dist/vite-adapter.js.map +0 -1
  169. package/schemas/pub-manifest/README.md +0 -5
  170. package/schemas/pub-manifest/module/ItemList.schema.json +0 -32
  171. package/schemas/pub-manifest/module/bcp.schema.json +0 -7
  172. package/schemas/pub-manifest/module/context.schema.json +0 -62
  173. package/schemas/pub-manifest/module/contributor-object.schema.json +0 -42
  174. package/schemas/pub-manifest/module/contributor.schema.json +0 -26
  175. package/schemas/pub-manifest/module/date.schema.json +0 -7
  176. package/schemas/pub-manifest/module/duration.schema.json +0 -7
  177. package/schemas/pub-manifest/module/item-lists.schema.json +0 -16
  178. package/schemas/pub-manifest/module/language.schema.json +0 -16
  179. package/schemas/pub-manifest/module/link.schema.json +0 -60
  180. package/schemas/pub-manifest/module/localizable-object.schema.json +0 -15
  181. package/schemas/pub-manifest/module/localizable.schema.json +0 -26
  182. package/schemas/pub-manifest/module/resource.categorization.schema.json +0 -31
  183. package/schemas/pub-manifest/module/strings.schema.json +0 -9
  184. package/schemas/pub-manifest/module/url.schema.json +0 -7
  185. package/schemas/pub-manifest/module/urls.schema.json +0 -18
  186. package/schemas/pub-manifest/publication.schema.json +0 -123
@@ -0,0 +1,16 @@
1
+ // src/node-modules.ts
2
+ var nodeExternalModules = [
3
+ "@napi-rs/canvas",
4
+ "command-exists",
5
+ "execa",
6
+ "press-ready",
7
+ "pdf-lib",
8
+ "playwright-core",
9
+ "playwright-core/lib/server"
10
+ ];
11
+ var importNodeModule = (name) => import(name);
12
+
13
+ export {
14
+ nodeExternalModules,
15
+ importNodeModule
16
+ };
@@ -0,0 +1,54 @@
1
+ import {
2
+ Logger,
3
+ loadVivliostyleConfig,
4
+ mergeInlineConfig,
5
+ resolveTaskConfig,
6
+ setupConfigFromFlags,
7
+ vsBrowserPlugin,
8
+ vsDevServerPlugin,
9
+ vsStaticServePlugin,
10
+ vsViewerPlugin,
11
+ warnDeprecatedConfig
12
+ } from "./chunk-VBEHGS67.js";
13
+ import {
14
+ VivliostyleInlineConfig
15
+ } from "./chunk-DMARNPN5.js";
16
+
17
+ // src/vite-adapter.ts
18
+ import * as v from "valibot";
19
+ import * as vite from "vite";
20
+ async function createVitePlugin(inlineConfig = {}) {
21
+ const parsedInlineConfig = v.parse(VivliostyleInlineConfig, inlineConfig);
22
+ Logger.setLogLevel(parsedInlineConfig.logLevel);
23
+ if (parsedInlineConfig.logger) {
24
+ Logger.setCustomLogger(parsedInlineConfig.logger);
25
+ } else {
26
+ const { info, warn, error } = vite.createLogger("info", {
27
+ prefix: "[vivliostyle]"
28
+ });
29
+ Logger.setCustomLogger({
30
+ info: (msg) => info(msg, { timestamp: true }),
31
+ warn: (msg) => warn(msg, { timestamp: true }),
32
+ error: (msg) => error(msg, { timestamp: true })
33
+ });
34
+ }
35
+ Logger.debug("inlineConfig %O", parsedInlineConfig);
36
+ const vivliostyleConfig = await loadVivliostyleConfig(parsedInlineConfig) ?? setupConfigFromFlags(parsedInlineConfig);
37
+ warnDeprecatedConfig(vivliostyleConfig);
38
+ const { tasks, inlineOptions } = mergeInlineConfig(
39
+ vivliostyleConfig,
40
+ parsedInlineConfig
41
+ );
42
+ const config = resolveTaskConfig(tasks[0], inlineOptions);
43
+ Logger.debug("config %O", config);
44
+ return [
45
+ vsDevServerPlugin({ config, inlineConfig: parsedInlineConfig }),
46
+ vsViewerPlugin({ config, inlineConfig: parsedInlineConfig }),
47
+ vsBrowserPlugin({ config, inlineConfig: parsedInlineConfig }),
48
+ vsStaticServePlugin({ config, inlineConfig: parsedInlineConfig })
49
+ ];
50
+ }
51
+
52
+ export {
53
+ createVitePlugin
54
+ };
package/dist/cli.d.ts CHANGED
@@ -1,3 +1 @@
1
1
  #!/usr/bin/env node
2
- export {};
3
- //# sourceMappingURL=cli.d.ts.map
package/dist/cli.js CHANGED
@@ -1,20 +1,19 @@
1
1
  #!/usr/bin/env node
2
- import { Command } from 'commander';
3
- import { cliVersion, coreVersion } from './const.js';
4
- const version = `cli: ${cliVersion}
2
+ import {
3
+ cliVersion,
4
+ coreVersion
5
+ } from "./chunk-EX7EA34F.js";
6
+ import "./chunk-BIEQXUOY.js";
7
+
8
+ // src/cli.ts
9
+ import { Command } from "commander";
10
+ var version = `cli: ${cliVersion}
5
11
  core: ${coreVersion}`;
6
- const program = new Command();
7
- program
8
- .name('vivliostyle')
9
- .version(version, '-v, --version')
10
- .command('init', 'create vivliostyle config', {
11
- executableFile: 'commands/init',
12
- })
13
- .command('build', 'build and create PDF file', {
14
- executableFile: 'commands/build',
15
- })
16
- .command('preview', 'launch preview server', {
17
- executableFile: 'commands/preview',
18
- })
19
- .parse(process.argv);
20
- //# sourceMappingURL=cli.js.map
12
+ var program = new Command();
13
+ program.name("vivliostyle").version(version, "-v, --version").command("init", "create vivliostyle config", {
14
+ executableFile: "commands/init"
15
+ }).command("build", "build and create PDF file", {
16
+ executableFile: "commands/build"
17
+ }).command("preview", "launch preview server", {
18
+ executableFile: "commands/preview"
19
+ }).parse(process.argv);
@@ -1,2 +1,2 @@
1
- export {};
2
- //# sourceMappingURL=build.d.ts.map
1
+
2
+ export { }
@@ -1,20 +1,168 @@
1
- import process from 'node:process';
2
- import { build } from '../core/build.js';
3
- import { Logger } from '../logger.js';
4
- import { gracefulError, isInContainer } from '../util.js';
5
- import { setupBuildParserProgram } from './build.parser.js';
6
- import { parseFlagsToInlineConfig } from './cli-flags.js';
7
- try {
8
- let inlineConfig = parseFlagsToInlineConfig(process.argv, setupBuildParserProgram);
9
- if (isInContainer()) {
10
- inlineConfig = JSON.parse(process.env.VS_CLI_BUILD_PDF_OPTIONS);
11
- Logger.debug('bypassedPdfBuilderOption %O', inlineConfig);
1
+ import {
2
+ build
3
+ } from "../chunk-DMGAKSPH.js";
4
+ import "../chunk-QC3BOE2G.js";
5
+ import {
6
+ Logger,
7
+ gracefulError,
8
+ isInContainer,
9
+ parseFlagsToInlineConfig
10
+ } from "../chunk-VBEHGS67.js";
11
+ import "../chunk-EX7EA34F.js";
12
+ import "../chunk-WX6JHPSL.js";
13
+ import "../chunk-DMARNPN5.js";
14
+ import "../chunk-BIEQXUOY.js";
15
+
16
+ // src/commands/build.ts
17
+ import process from "node:process";
18
+
19
+ // src/commands/build.parser.ts
20
+ import { Command, Option } from "commander";
21
+ function setupBuildParserProgram() {
22
+ const targets = [];
23
+ const outputOptionProcessor = (value, previous) => {
24
+ if (targets.length === 0 || "path" in targets[targets.length - 1]) {
25
+ targets.push({ path: value });
26
+ } else {
27
+ targets[targets.length - 1].path = value;
12
28
  }
13
- await build(inlineConfig);
14
- }
15
- catch (err) {
16
- if (err instanceof Error) {
17
- gracefulError(err);
29
+ return [...previous || [], value];
30
+ };
31
+ const formatOptionProcessor = (value, previous) => {
32
+ if (targets.length === 0 || "format" in targets[targets.length - 1]) {
33
+ targets.push({ format: value });
34
+ } else {
35
+ targets[targets.length - 1].format = value;
36
+ }
37
+ return [...previous || [], value];
38
+ };
39
+ const program = new Command();
40
+ program.name("vivliostyle build").description("build and create PDF file").arguments("[input]").option(
41
+ "-c, --config <config_file>",
42
+ "path to vivliostyle.config.js [vivliostyle.config.js]"
43
+ ).option(
44
+ "-o, --output <path>",
45
+ `specify output file name or directory [<title>.pdf]
46
+ This option can be specified multiple, then each -o options can be supplied one -f option.
47
+ ex: -o output1 -f webpub -o output2.pdf -f pdf`,
48
+ outputOptionProcessor
49
+ ).option(
50
+ "-f, --format <format>",
51
+ `specify output format corresponding output target
52
+ If an extension is specified on -o option, this field will be inferenced automatically.`,
53
+ formatOptionProcessor
54
+ ).option(
55
+ "-s, --size <size>",
56
+ `output pdf size
57
+ preset: A5, A4, A3, B5, B4, JIS-B5, JIS-B4, letter, legal, ledger
58
+ custom(comma separated): 182mm,257mm or 8.5in,11in`
59
+ ).option("-m, --crop-marks", "print crop marks").option(
60
+ "--bleed <bleed>",
61
+ "extent of the bleed area for printing with crop marks [3mm]"
62
+ ).option(
63
+ "--crop-offset <offset>",
64
+ "distance between the edge of the trim size and the edge of the media size. [auto (13mm + bleed)]"
65
+ ).option(
66
+ "--css <CSS>",
67
+ 'custom style CSS code. (ex: ":root {--my-color: lime;}")'
68
+ ).option("--style <stylesheet>", "additional stylesheet URL or path").option("--user-style <user_stylesheet>", "user stylesheet URL or path").option("-d, --single-doc", "single HTML document input").option(
69
+ "-p, --press-ready",
70
+ `make generated PDF compatible with press ready PDF/X-1a [false]
71
+ This option is equivalent with "--preflight press-ready"`
72
+ ).option(
73
+ "-t, --timeout <seconds>",
74
+ `timeout limit for waiting Vivliostyle process [120]`,
75
+ validateTimeoutFlag
76
+ ).option("-T, --theme <theme...>", "theme path or package name").option("--title <title>", "title").option("--author <author>", "author").option("-l, --language <language>", "language").addOption(
77
+ new Option(
78
+ "--reading-progression <direction>",
79
+ "Direction of reading progression"
80
+ ).choices(["ltr", "rtl"])
81
+ ).addOption(
82
+ new Option(
83
+ "--render-mode <mode>",
84
+ "if docker is set, Vivliostyle try to render PDF on Docker container [local]"
85
+ ).choices(["local", "docker"])
86
+ ).addOption(
87
+ new Option(
88
+ "--preflight <mode>",
89
+ "apply the process to generate PDF for printing"
90
+ ).choices(["press-ready", "press-ready-local"])
91
+ ).option(
92
+ "--preflight-option <options...>",
93
+ `options for preflight process (ex: gray-scale, enforce-outline)
94
+ Please refer the document of press-ready for further information.
95
+ https://github.com/vibranthq/press-ready`
96
+ ).addOption(new Option("--sandbox", `launch chrome with sandbox`).hideHelp()).addOption(
97
+ new Option("--no-sandbox", `launch chrome without sandbox`).hideHelp()
98
+ ).option(
99
+ "--executable-browser <path>",
100
+ "specify a path of executable browser you installed"
101
+ ).option("--image <image>", "specify a docker image to render").option(
102
+ "--viewer <URL>",
103
+ `specify a URL of displaying viewer instead of vivliostyle-cli's one
104
+ It is useful that using own viewer that has staging features. (ex: https://vivliostyle.vercel.app/)`
105
+ ).option(
106
+ "--viewer-param <parameters>",
107
+ `specify viewer parameters. (ex: "allowScripts=false&pixelRatio=16")`
108
+ ).addOption(
109
+ new Option(
110
+ "--proxy-server <proxyServer>",
111
+ `HTTP/SOCK proxy server url for underlying Playwright`
112
+ )
113
+ ).addOption(
114
+ new Option(
115
+ "--proxy-bypass <proxyBypass>",
116
+ `optional comma-separated domains to bypass proxy`
117
+ )
118
+ ).addOption(
119
+ new Option(
120
+ "--proxy-user <proxyUser>",
121
+ `optional username for HTTP proxy authentication`
122
+ )
123
+ ).addOption(
124
+ new Option(
125
+ "--proxy-pass <proxyPass>",
126
+ `optional password for HTTP proxy authentication`
127
+ )
128
+ ).addOption(
129
+ new Option(
130
+ "--log-level <level>",
131
+ "specify a log level of console outputs"
132
+ ).choices(["silent", "info", "verbose", "debug"]).default("info")
133
+ ).addOption(
134
+ new Option(
135
+ "--ignore-https-errors",
136
+ `true to ignore HTTPS errors when Playwright browser opens a new page`
137
+ )
138
+ ).option("--host <host>", "IP address the server should listen on").option("--port <port>", "port the server should listen on", parseInt).option("--no-enable-static-serve", "disable static file serving").addOption(new Option("--executable-chromium <path>").hideHelp()).addOption(new Option("--verbose").hideHelp()).addOption(new Option("--http").hideHelp()).action((_arg, option) => {
139
+ let invalid = targets.find((it) => !("path" in it));
140
+ if (invalid) {
141
+ throw new Error(
142
+ `Couldn't find the output option corresponding --format ${invalid.format} option. Please check the command options.`
143
+ );
18
144
  }
145
+ option.output = targets;
146
+ });
147
+ return program;
148
+ }
149
+ function validateTimeoutFlag(val) {
150
+ return Number.isFinite(+val) && +val > 0 ? +val * 1e3 : void 0;
151
+ }
152
+
153
+ // src/commands/build.ts
154
+ try {
155
+ let inlineConfig = parseFlagsToInlineConfig(
156
+ process.argv,
157
+ setupBuildParserProgram
158
+ );
159
+ if (isInContainer()) {
160
+ inlineConfig = JSON.parse(process.env.VS_CLI_BUILD_PDF_OPTIONS);
161
+ Logger.debug("bypassedPdfBuilderOption %O", inlineConfig);
162
+ }
163
+ await build(inlineConfig);
164
+ } catch (err) {
165
+ if (err instanceof Error) {
166
+ gracefulError(err);
167
+ }
19
168
  }
20
- //# sourceMappingURL=build.js.map
@@ -1,2 +1,2 @@
1
- export {};
2
- //# sourceMappingURL=init.d.ts.map
1
+
2
+ export { }
@@ -1,14 +1,37 @@
1
- import { init } from '../core/init.js';
2
- import { gracefulError } from '../util.js';
3
- import { parseFlagsToInlineConfig } from './cli-flags.js';
4
- import { setupInitParserProgram } from './init.parser.js';
5
- try {
6
- const inlineConfig = parseFlagsToInlineConfig(process.argv, setupInitParserProgram);
7
- await init(inlineConfig);
1
+ import {
2
+ init
3
+ } from "../chunk-E7QOXL6M.js";
4
+ import {
5
+ gracefulError,
6
+ parseFlagsToInlineConfig
7
+ } from "../chunk-VBEHGS67.js";
8
+ import "../chunk-EX7EA34F.js";
9
+ import "../chunk-WX6JHPSL.js";
10
+ import "../chunk-DMARNPN5.js";
11
+ import "../chunk-BIEQXUOY.js";
12
+
13
+ // src/commands/init.parser.ts
14
+ import { Command, Option } from "commander";
15
+ function setupInitParserProgram() {
16
+ const program = new Command();
17
+ program.name("vivliostyle init").description("create vivliostyle config file").option("--title <title>", "title").option("--author <author>", "author").option("-l, --language <language>", "language").option("-s, --size <size>", "paper size").option("-T, --theme <theme>", "theme").addOption(
18
+ new Option(
19
+ "--log-level <level>",
20
+ "specify a log level of console outputs"
21
+ ).choices(["silent", "info", "verbose", "debug"]).default("info")
22
+ );
23
+ return program;
8
24
  }
9
- catch (err) {
10
- if (err instanceof Error) {
11
- gracefulError(err);
12
- }
25
+
26
+ // src/commands/init.ts
27
+ try {
28
+ const inlineConfig = parseFlagsToInlineConfig(
29
+ process.argv,
30
+ setupInitParserProgram
31
+ );
32
+ await init(inlineConfig);
33
+ } catch (err) {
34
+ if (err instanceof Error) {
35
+ gracefulError(err);
36
+ }
13
37
  }
14
- //# sourceMappingURL=init.js.map
@@ -1,2 +1,2 @@
1
- export {};
2
- //# sourceMappingURL=preview.d.ts.map
1
+
2
+ export { }
@@ -1,14 +1,100 @@
1
- import { preview } from '../core/preview.js';
2
- import { gracefulError } from '../util.js';
3
- import { parseFlagsToInlineConfig } from './cli-flags.js';
4
- import { setupPreviewParserProgram } from './preview.parser.js';
5
- try {
6
- const inlineConfig = parseFlagsToInlineConfig(process.argv, setupPreviewParserProgram);
7
- await preview(inlineConfig);
1
+ import {
2
+ preview
3
+ } from "../chunk-LASMQBPP.js";
4
+ import "../chunk-QC3BOE2G.js";
5
+ import {
6
+ gracefulError,
7
+ parseFlagsToInlineConfig
8
+ } from "../chunk-VBEHGS67.js";
9
+ import "../chunk-EX7EA34F.js";
10
+ import "../chunk-WX6JHPSL.js";
11
+ import "../chunk-DMARNPN5.js";
12
+ import "../chunk-BIEQXUOY.js";
13
+
14
+ // src/commands/preview.parser.ts
15
+ import { Command, Option } from "commander";
16
+ function setupPreviewParserProgram() {
17
+ const program = new Command();
18
+ program.name("vivliostyle preview").description("launch preview server").arguments("[input]").option("-c, --config <config_file>", "path to vivliostyle.config.js").option("-T, --theme <theme...>", "theme path or package name").option(
19
+ "-s, --size <size>",
20
+ `output pdf size
21
+ preset: A5, A4, A3, B5, B4, JIS-B5, JIS-B4, letter, legal, ledger
22
+ custom(comma separated): 182mm,257mm or 8.5in,11in`
23
+ ).option("-m, --crop-marks", "print crop marks").option(
24
+ "--bleed <bleed>",
25
+ "extent of the bleed area for printing with crop marks [3mm]"
26
+ ).option(
27
+ "--crop-offset <offset>",
28
+ "distance between the edge of the trim size and the edge of the media size. [auto (13mm + bleed)]"
29
+ ).option(
30
+ "--css <CSS>",
31
+ 'custom style CSS code. (ex: ":root {--my-color: lime;}")'
32
+ ).option("--style <stylesheet>", "additional stylesheet URL or path").option("--user-style <user_stylesheet>", "user stylesheet URL or path").option("-d, --single-doc", "single HTML document input").option("-q, --quick", "quick loading with rough page count").option("--title <title>", "title").option("--author <author>", "author").option("-l, --language <language>", "language").addOption(
33
+ new Option(
34
+ "--reading-progression <direction>",
35
+ "Direction of reading progression"
36
+ ).choices(["ltr", "rtl"])
37
+ ).addOption(new Option("--sandbox", `launch chrome with sandbox`).hideHelp()).addOption(
38
+ new Option("--no-sandbox", `launch chrome without sandbox`).hideHelp()
39
+ ).option(
40
+ "--executable-browser <path>",
41
+ "specify a path of executable browser you installed"
42
+ ).option(
43
+ "--viewer <URL>",
44
+ `specify a URL of displaying viewer instead of vivliostyle-cli's one
45
+ It is useful that using own viewer that has staging features. (ex: https://vivliostyle.vercel.app/)`
46
+ ).option(
47
+ "--viewer-param <parameters>",
48
+ `specify viewer parameters. (ex: "allowScripts=false&pixelRatio=16")`
49
+ ).addOption(
50
+ new Option(
51
+ "--browser <browser>",
52
+ `EXPERIMENTAL SUPPORT: Specify a browser type to launch Vivliostyle viewer [chromium]
53
+ Currently, Firefox and Webkit support preview command only!`
54
+ ).choices(["chromium", "firefox", "webkit"])
55
+ ).addOption(
56
+ new Option(
57
+ "--proxy-server <proxyServer>",
58
+ `HTTP/SOCK proxy server url for underlying Playwright`
59
+ )
60
+ ).addOption(
61
+ new Option(
62
+ "--proxy-bypass <proxyBypass>",
63
+ `optional comma-separated domains to bypass proxy`
64
+ )
65
+ ).addOption(
66
+ new Option(
67
+ "--proxy-user <proxyUser>",
68
+ `optional username for HTTP proxy authentication`
69
+ )
70
+ ).addOption(
71
+ new Option(
72
+ "--proxy-pass <proxyPass>",
73
+ `optional password for HTTP proxy authentication`
74
+ )
75
+ ).addOption(
76
+ new Option(
77
+ "--log-level <level>",
78
+ "specify a log level of console outputs"
79
+ ).choices(["silent", "info", "verbose", "debug"]).default("info")
80
+ ).addOption(
81
+ new Option(
82
+ "--ignore-https-errors",
83
+ `true to ignore HTTPS errors when Playwright browser opens a new page`
84
+ )
85
+ ).option("--host <host>", "IP address the server should listen on").option("--port <port>", "port the server should listen on", parseInt).option("--no-open-viewer", "do not open viewer").option("--no-enable-static-serve", "disable static file serving").option("--no-enable-viewer-start-page", "disable viewer start page").addOption(new Option("--executable-chromium <path>").hideHelp()).addOption(new Option("--verbose").hideHelp()).addOption(new Option("--http").hideHelp());
86
+ return program;
8
87
  }
9
- catch (err) {
10
- if (err instanceof Error) {
11
- gracefulError(err);
12
- }
88
+
89
+ // src/commands/preview.ts
90
+ try {
91
+ const inlineConfig = parseFlagsToInlineConfig(
92
+ process.argv,
93
+ setupPreviewParserProgram
94
+ );
95
+ await preview(inlineConfig);
96
+ } catch (err) {
97
+ if (err instanceof Error) {
98
+ gracefulError(err);
99
+ }
13
100
  }
14
- //# sourceMappingURL=preview.js.map