@vivliostyle/cli 9.9.0 → 10.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 +74 -30
- package/dist/{chunk-WELNNHOB.js → chunk-CKAJY2BE.js} +415 -384
- package/dist/chunk-CKAJY2BE.js.map +1 -0
- package/dist/{chunk-UYKCTF6F.js → chunk-CKXFRCPH.js} +445 -228
- package/dist/chunk-CKXFRCPH.js.map +1 -0
- package/dist/{chunk-3O3N2V7D.js → chunk-IOFOZNLZ.js} +6 -7
- package/dist/chunk-IOFOZNLZ.js.map +1 -0
- package/dist/{chunk-OZ4XTSAH.js → chunk-LVS2NLYC.js} +2 -2
- package/dist/chunk-LVS2NLYC.js.map +1 -0
- package/dist/{chunk-6UU7DEUR.js → chunk-RJO22WHX.js} +32 -33
- package/dist/chunk-RJO22WHX.js.map +1 -0
- package/dist/chunk-RKU7H2GS.js +1076 -0
- package/dist/chunk-RKU7H2GS.js.map +1 -0
- package/dist/{chunk-QWX5MAON.js → chunk-SPTG2DFV.js} +16 -17
- package/dist/chunk-SPTG2DFV.js.map +1 -0
- package/dist/{chunk-G3GROLBN.js → chunk-T2VWLU2I.js} +397 -88
- package/dist/chunk-T2VWLU2I.js.map +1 -0
- package/dist/chunk-ZEBXHUJX.js +334 -0
- package/dist/chunk-ZEBXHUJX.js.map +1 -0
- package/dist/{chunk-FXUEYQRY.js → chunk-ZIK6DINS.js} +3 -3
- package/dist/chunk-ZIK6DINS.js.map +1 -0
- package/dist/cli.js +7 -8
- package/dist/cli.js.map +1 -1
- package/dist/commands/build.js +29 -17
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/create.d.ts +2 -0
- package/dist/commands/create.js +64 -0
- package/dist/commands/create.js.map +1 -0
- package/dist/commands/init.js +23 -14
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/preview.js +26 -20
- package/dist/commands/preview.js.map +1 -1
- package/dist/config/schema.d.ts +8370 -4567
- package/dist/config/schema.js +16 -4
- package/dist/index.d.ts +46 -7
- package/dist/index.js +24 -16
- package/dist/index.js.map +1 -1
- package/dist/node-modules.d.ts +5 -5
- package/dist/node-modules.js +1 -1
- package/dist/vite-adapter.d.ts +1 -0
- package/dist/vite-adapter.js +6 -6
- package/package.json +37 -26
- package/dist/chunk-3O3N2V7D.js.map +0 -1
- package/dist/chunk-4IIM6RSG.js +0 -71
- package/dist/chunk-4IIM6RSG.js.map +0 -1
- package/dist/chunk-6KEOMYDZ.js +0 -89
- package/dist/chunk-6KEOMYDZ.js.map +0 -1
- package/dist/chunk-6UU7DEUR.js.map +0 -1
- package/dist/chunk-FXUEYQRY.js.map +0 -1
- package/dist/chunk-G3GROLBN.js.map +0 -1
- package/dist/chunk-OZ4XTSAH.js.map +0 -1
- package/dist/chunk-QWX5MAON.js.map +0 -1
- package/dist/chunk-UYKCTF6F.js.map +0 -1
- package/dist/chunk-WELNNHOB.js.map +0 -1
- package/types/playwright.d.ts +0 -49
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CONTAINER_URL,
|
|
3
3
|
cliVersion
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZEBXHUJX.js";
|
|
5
5
|
|
|
6
6
|
// src/config/schema.ts
|
|
7
7
|
import { satisfies as semverSatisfies } from "semver";
|
|
@@ -234,9 +234,9 @@ var VfmReplaceRule = v.looseObject({
|
|
|
234
234
|
)
|
|
235
235
|
});
|
|
236
236
|
var BrowserType = v.union([
|
|
237
|
+
v.literal("chrome"),
|
|
237
238
|
v.literal("chromium"),
|
|
238
|
-
v.literal("firefox")
|
|
239
|
-
v.literal("webkit")
|
|
239
|
+
v.literal("firefox")
|
|
240
240
|
]);
|
|
241
241
|
var ReadingProgression = v.union([v.literal("ltr"), v.literal("rtl")]);
|
|
242
242
|
var LogLevel = v.union([
|
|
@@ -255,6 +255,14 @@ var validateAssetExtensionSettings = (propName) => v.check(
|
|
|
255
255
|
(input) => input.every((pattern) => !notAllowedExtensionRe.test(pattern)),
|
|
256
256
|
`Invalid pattern was found in copyAsset.${propName} option`
|
|
257
257
|
);
|
|
258
|
+
var validateBrowserTagFormat = v.check((input) => {
|
|
259
|
+
const [type] = input.split("@");
|
|
260
|
+
return v.is(BrowserType, type);
|
|
261
|
+
}, "Unknown browser type");
|
|
262
|
+
var parseBrowserTagFormat = v.transform((input) => {
|
|
263
|
+
const [type, tag] = input.split("@");
|
|
264
|
+
return { type: v.parse(BrowserType, type), tag };
|
|
265
|
+
});
|
|
258
266
|
var CopyAssetConfig = v.pipe(
|
|
259
267
|
v.partial(
|
|
260
268
|
v.object({
|
|
@@ -676,10 +684,11 @@ var BuildTask = v.pipe(
|
|
|
676
684
|
`)
|
|
677
685
|
),
|
|
678
686
|
browser: v.pipe(
|
|
679
|
-
|
|
687
|
+
ValidString,
|
|
688
|
+
validateBrowserTagFormat,
|
|
689
|
+
parseBrowserTagFormat,
|
|
680
690
|
v.description($`
|
|
681
|
-
|
|
682
|
-
Currently, Firefox and Webkit support only the preview command.
|
|
691
|
+
Specify a browser type and version to launch the Vivliostyle viewer.
|
|
683
692
|
`)
|
|
684
693
|
),
|
|
685
694
|
base: v.pipe(
|
|
@@ -767,316 +776,367 @@ var VivliostyleConfigSchema = v.pipe(
|
|
|
767
776
|
),
|
|
768
777
|
v.title("VivliostyleConfigSchema")
|
|
769
778
|
);
|
|
770
|
-
var
|
|
771
|
-
v.
|
|
772
|
-
v.
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
v.description($`
|
|
779
|
+
var VivliostyleInlineConfigWithoutChecks = v.partial(
|
|
780
|
+
v.object({
|
|
781
|
+
cwd: v.pipe(
|
|
782
|
+
ValidString,
|
|
783
|
+
v.description($`
|
|
776
784
|
Set a working directory.
|
|
777
785
|
`)
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
786
|
+
),
|
|
787
|
+
config: v.pipe(
|
|
788
|
+
ValidString,
|
|
789
|
+
v.description($`
|
|
782
790
|
Path to vivliostyle.config.js.
|
|
783
791
|
`)
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
792
|
+
),
|
|
793
|
+
configData: v.pipe(
|
|
794
|
+
v.custom(() => true),
|
|
795
|
+
v.metadata({
|
|
796
|
+
typeString: "VivliostyleConfigSchema"
|
|
797
|
+
}),
|
|
798
|
+
v.description($`
|
|
791
799
|
Vivliostyle config object.
|
|
792
800
|
`)
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
801
|
+
),
|
|
802
|
+
input: v.pipe(
|
|
803
|
+
ValidString,
|
|
804
|
+
v.transform((input) => {
|
|
805
|
+
const ext = upath.extname(input).toLowerCase();
|
|
806
|
+
if (/^(https?|data):/.test(input)) {
|
|
807
|
+
return { format: "webbook", entry: input };
|
|
808
|
+
} else if (ext === ".md" || ext === ".markdown") {
|
|
809
|
+
return { format: "markdown", entry: input };
|
|
810
|
+
} else if (ext === ".json" || ext === ".jsonld") {
|
|
811
|
+
return { format: "pub-manifest", entry: input };
|
|
812
|
+
} else if (ext === ".epub") {
|
|
813
|
+
return { format: "epub", entry: input };
|
|
814
|
+
} else if (ext === ".opf") {
|
|
815
|
+
return { format: "epub-opf", entry: input };
|
|
816
|
+
} else if ([".html", ".htm", ".xhtml", ".xht"].includes(ext)) {
|
|
817
|
+
return { format: "webbook", entry: input };
|
|
818
|
+
}
|
|
819
|
+
throw new Error(`Cannot detect an input format: ${input}`);
|
|
820
|
+
}),
|
|
821
|
+
v.description($`
|
|
814
822
|
Input file of document.
|
|
815
823
|
`)
|
|
824
|
+
),
|
|
825
|
+
output: v.pipe(
|
|
826
|
+
v.union([
|
|
827
|
+
v.array(v.union([OutputConfig, ValidString])),
|
|
828
|
+
OutputConfig,
|
|
829
|
+
ValidString
|
|
830
|
+
]),
|
|
831
|
+
v.transform(
|
|
832
|
+
(input) => [input].flat().map((item) => {
|
|
833
|
+
const obj = typeof item === "string" ? { path: item } : item;
|
|
834
|
+
const ext = upath.extname(obj.path).toLowerCase();
|
|
835
|
+
return {
|
|
836
|
+
...obj,
|
|
837
|
+
format: obj.format || (ext === ".pdf" ? "pdf" : ext === ".epub" ? "epub" : "webpub")
|
|
838
|
+
};
|
|
839
|
+
})
|
|
816
840
|
),
|
|
817
|
-
|
|
818
|
-
v.union([
|
|
819
|
-
v.array(v.union([OutputConfig, ValidString])),
|
|
820
|
-
OutputConfig,
|
|
821
|
-
ValidString
|
|
822
|
-
]),
|
|
823
|
-
v.transform(
|
|
824
|
-
(input) => [input].flat().map((item) => {
|
|
825
|
-
const obj = typeof item === "string" ? { path: item } : item;
|
|
826
|
-
const ext = upath.extname(obj.path).toLowerCase();
|
|
827
|
-
return {
|
|
828
|
-
...obj,
|
|
829
|
-
format: obj.format || (ext === ".pdf" ? "pdf" : ext === ".epub" ? "epub" : "webpub")
|
|
830
|
-
};
|
|
831
|
-
})
|
|
832
|
-
),
|
|
833
|
-
v.description($`
|
|
841
|
+
v.description($`
|
|
834
842
|
Output file name or directory.
|
|
835
843
|
`)
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
844
|
+
),
|
|
845
|
+
theme: v.pipe(
|
|
846
|
+
ThemeSpecifier,
|
|
847
|
+
v.description($`
|
|
840
848
|
Theme path or package name.
|
|
841
849
|
`)
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
850
|
+
),
|
|
851
|
+
size: v.pipe(
|
|
852
|
+
ValidString,
|
|
853
|
+
v.description($`
|
|
846
854
|
Output pdf size.
|
|
847
855
|
preset: A5, A4, A3, B5, B4, JIS-B5, JIS-B4, letter, legal, ledger
|
|
848
856
|
custom(comma separated): 182mm,257mm or 8.5in,11in
|
|
849
857
|
`)
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
858
|
+
),
|
|
859
|
+
cropMarks: v.pipe(
|
|
860
|
+
v.boolean(),
|
|
861
|
+
v.description($`
|
|
854
862
|
Print crop marks.
|
|
855
863
|
`)
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
864
|
+
),
|
|
865
|
+
bleed: v.pipe(
|
|
866
|
+
ValidString,
|
|
867
|
+
v.description($`
|
|
860
868
|
Extent of the bleed area for printing with crop marks. [3mm]
|
|
861
869
|
`)
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
870
|
+
),
|
|
871
|
+
cropOffset: v.pipe(
|
|
872
|
+
ValidString,
|
|
873
|
+
v.description($`
|
|
866
874
|
Distance between the edge of the trim size and the edge of the media size. [auto (13mm + bleed)]
|
|
867
875
|
`)
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
876
|
+
),
|
|
877
|
+
css: v.pipe(
|
|
878
|
+
ValidString,
|
|
879
|
+
v.description($`
|
|
872
880
|
Custom style CSS code. (ex: ":root {--my-color: lime;}")
|
|
873
881
|
`)
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
882
|
+
),
|
|
883
|
+
style: v.pipe(
|
|
884
|
+
ValidString,
|
|
885
|
+
v.description($`
|
|
878
886
|
Additional stylesheet URL or path.
|
|
879
887
|
`)
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
888
|
+
),
|
|
889
|
+
userStyle: v.pipe(
|
|
890
|
+
ValidString,
|
|
891
|
+
v.description($`
|
|
884
892
|
User stylesheet URL or path.
|
|
885
893
|
`)
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
894
|
+
),
|
|
895
|
+
singleDoc: v.pipe(
|
|
896
|
+
v.boolean(),
|
|
897
|
+
v.description($`
|
|
890
898
|
Single HTML document input.
|
|
891
899
|
`)
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
900
|
+
),
|
|
901
|
+
quick: v.pipe(
|
|
902
|
+
v.boolean(),
|
|
903
|
+
v.description($`
|
|
896
904
|
Quick loading with rough page count.
|
|
897
905
|
`)
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
906
|
+
),
|
|
907
|
+
pressReady: v.pipe(
|
|
908
|
+
v.boolean(),
|
|
909
|
+
v.description($`
|
|
902
910
|
Make generated PDF compatible with press ready PDF/X-1a.
|
|
903
911
|
This option is equivalent with "preflight": "press-ready"
|
|
904
912
|
`)
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
913
|
+
),
|
|
914
|
+
title: v.pipe(ValidString, v.description($`Title`)),
|
|
915
|
+
author: v.pipe(ValidString, v.description($`Author`)),
|
|
916
|
+
language: v.pipe(ValidString, v.description($`Language`)),
|
|
917
|
+
readingProgression: v.pipe(
|
|
918
|
+
ReadingProgression,
|
|
919
|
+
v.description($`
|
|
912
920
|
Direction of reading progression.
|
|
913
921
|
`)
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
922
|
+
),
|
|
923
|
+
timeout: v.pipe(
|
|
924
|
+
v.number(),
|
|
925
|
+
v.minValue(0),
|
|
926
|
+
v.description($`
|
|
919
927
|
Timeout limit for waiting Vivliostyle process (ms).
|
|
920
928
|
`)
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
929
|
+
),
|
|
930
|
+
renderMode: v.pipe(
|
|
931
|
+
RenderMode,
|
|
932
|
+
v.description($`
|
|
925
933
|
If docker is set, Vivliostyle try to render PDF on Docker container. [local]
|
|
926
934
|
`)
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
935
|
+
),
|
|
936
|
+
preflight: v.pipe(
|
|
937
|
+
v.union([v.literal("press-ready"), v.literal("press-ready-local")]),
|
|
938
|
+
v.description($`
|
|
931
939
|
Apply the process to generate PDF for printing.
|
|
932
940
|
`)
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
941
|
+
),
|
|
942
|
+
preflightOption: v.pipe(
|
|
943
|
+
v.union([v.array(ValidString), ValidString]),
|
|
944
|
+
v.transform((input) => [input].flat()),
|
|
945
|
+
v.description($`
|
|
938
946
|
Options for preflight process (ex: gray-scale, enforce-outline).
|
|
939
947
|
Please refer the document of press-ready for further information.
|
|
940
948
|
`)
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
executableBrowser: v.pipe(
|
|
947
|
-
ValidString,
|
|
948
|
-
v.description($`
|
|
949
|
+
),
|
|
950
|
+
sandbox: v.pipe(v.boolean(), v.description($`Launch chrome with sandbox.`)),
|
|
951
|
+
executableBrowser: v.pipe(
|
|
952
|
+
ValidString,
|
|
953
|
+
v.description($`
|
|
949
954
|
Specify a path of executable browser you installed.
|
|
950
955
|
`)
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
956
|
+
),
|
|
957
|
+
image: v.pipe(
|
|
958
|
+
ValidString,
|
|
959
|
+
v.description($`
|
|
955
960
|
Specify a docker image to render.
|
|
956
961
|
`)
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
962
|
+
),
|
|
963
|
+
viewer: v.pipe(
|
|
964
|
+
ValidString,
|
|
965
|
+
v.description($`
|
|
961
966
|
Specify a URL of displaying viewer instead of vivliostyle-cli's one.
|
|
962
967
|
It is useful that using own viewer that has staging features. (ex: https://vivliostyle.vercel.app/)
|
|
963
968
|
`)
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
969
|
+
),
|
|
970
|
+
viewerParam: v.pipe(
|
|
971
|
+
ValidString,
|
|
972
|
+
v.description($`
|
|
968
973
|
Specify viewer parameters. (ex: "allowScripts=false&pixelRatio=16")
|
|
969
974
|
`)
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
+
),
|
|
976
|
+
browser: v.pipe(
|
|
977
|
+
ValidString,
|
|
978
|
+
validateBrowserTagFormat,
|
|
979
|
+
parseBrowserTagFormat,
|
|
980
|
+
v.description($`
|
|
981
|
+
Specify a browser type and version to launch the Vivliostyle viewer. [chrome]
|
|
975
982
|
`)
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
983
|
+
),
|
|
984
|
+
proxyServer: v.pipe(
|
|
985
|
+
ValidString,
|
|
986
|
+
v.description($`
|
|
980
987
|
HTTP/SOCK proxy server url for underlying Playwright.
|
|
981
988
|
`)
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
989
|
+
),
|
|
990
|
+
proxyBypass: v.pipe(
|
|
991
|
+
ValidString,
|
|
992
|
+
v.description($`
|
|
986
993
|
Optional comma-separated domains to bypass proxy.
|
|
987
994
|
`)
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
995
|
+
),
|
|
996
|
+
proxyUser: v.pipe(
|
|
997
|
+
ValidString,
|
|
998
|
+
v.description($`
|
|
992
999
|
Optional username for HTTP proxy authentication.
|
|
993
1000
|
`)
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
1001
|
+
),
|
|
1002
|
+
proxyPass: v.pipe(
|
|
1003
|
+
ValidString,
|
|
1004
|
+
v.description($`
|
|
998
1005
|
Optional password for HTTP proxy authentication.
|
|
999
1006
|
`)
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1007
|
+
),
|
|
1008
|
+
logLevel: v.pipe(
|
|
1009
|
+
LogLevel,
|
|
1010
|
+
v.description($`
|
|
1004
1011
|
Specify a log level of console outputs.
|
|
1005
1012
|
`)
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1013
|
+
),
|
|
1014
|
+
ignoreHttpsErrors: v.pipe(
|
|
1015
|
+
v.boolean(),
|
|
1016
|
+
v.description($`
|
|
1010
1017
|
true to ignore HTTPS errors when Playwright browser opens a new page.
|
|
1011
1018
|
`)
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1019
|
+
),
|
|
1020
|
+
openViewer: v.pipe(
|
|
1021
|
+
v.boolean(),
|
|
1022
|
+
v.description($`
|
|
1016
1023
|
Open a browser to display the document preview.
|
|
1017
1024
|
`)
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1025
|
+
),
|
|
1026
|
+
enableStaticServe: v.pipe(
|
|
1027
|
+
v.boolean(),
|
|
1028
|
+
v.description($`
|
|
1022
1029
|
Enable static file serving as configured in the Vivliostyle config file.
|
|
1023
1030
|
`)
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1031
|
+
),
|
|
1032
|
+
enableViewerStartPage: v.pipe(
|
|
1033
|
+
v.boolean(),
|
|
1034
|
+
v.description($`
|
|
1028
1035
|
Open a start page of the viewer when the input file is not specified.
|
|
1029
1036
|
`)
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
+
),
|
|
1038
|
+
vite: v.pipe(
|
|
1039
|
+
v.custom(() => true),
|
|
1040
|
+
v.metadata({
|
|
1041
|
+
typeString: 'import("vite").UserConfig'
|
|
1042
|
+
}),
|
|
1043
|
+
v.description($`
|
|
1037
1044
|
Configuration options for the Vite server.
|
|
1038
1045
|
`)
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1046
|
+
),
|
|
1047
|
+
viteConfigFile: v.pipe(
|
|
1048
|
+
v.union([ValidString, v.boolean()]),
|
|
1049
|
+
v.description($`
|
|
1043
1050
|
Path to the Vite config file.
|
|
1044
1051
|
If a falsy value is provided, Vivliostyle CLI ignores the existing Vite config file.
|
|
1045
1052
|
`)
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1053
|
+
),
|
|
1054
|
+
host: v.pipe(
|
|
1055
|
+
v.union([v.boolean(), ValidString]),
|
|
1056
|
+
v.description($`
|
|
1050
1057
|
IP address the server should listen on.
|
|
1051
1058
|
Set to \`true\` to listen on all addresses.
|
|
1052
1059
|
(default: \`true\` if a PDF build with Docker render mode is required, otherwise \`false\`)
|
|
1053
1060
|
`)
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1061
|
+
),
|
|
1062
|
+
port: v.pipe(
|
|
1063
|
+
v.number(),
|
|
1064
|
+
v.minValue(0),
|
|
1065
|
+
v.maxValue(65535),
|
|
1066
|
+
v.description($`
|
|
1060
1067
|
Port the server should listen on. (default: \`13000\`)
|
|
1061
1068
|
`)
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
+
),
|
|
1070
|
+
logger: v.pipe(
|
|
1071
|
+
v.custom(() => true),
|
|
1072
|
+
v.metadata({
|
|
1073
|
+
typeString: "LoggerInterface"
|
|
1074
|
+
}),
|
|
1075
|
+
v.description($`
|
|
1069
1076
|
Custom logger interface.
|
|
1070
1077
|
`)
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1078
|
+
),
|
|
1079
|
+
disableServerStartup: v.pipe(
|
|
1080
|
+
v.boolean(),
|
|
1081
|
+
v.description($`
|
|
1075
1082
|
Disable the startup of the preview server during the build process.
|
|
1076
1083
|
`)
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1084
|
+
),
|
|
1085
|
+
projectPath: v.pipe(
|
|
1086
|
+
ValidString,
|
|
1087
|
+
v.description($`
|
|
1088
|
+
Path of the Vivliostyle project to create.
|
|
1089
|
+
`)
|
|
1090
|
+
),
|
|
1091
|
+
template: v.pipe(
|
|
1092
|
+
ValidString,
|
|
1093
|
+
v.description($`
|
|
1094
|
+
Template source in format of \`[provider]:repo[/subpath][#ref]\`.
|
|
1095
|
+
`)
|
|
1096
|
+
),
|
|
1097
|
+
createConfigFileOnly: v.pipe(
|
|
1098
|
+
v.boolean(),
|
|
1099
|
+
v.description($`
|
|
1100
|
+
Create a Vivliostyle config file without generating project template files.
|
|
1101
|
+
`)
|
|
1102
|
+
),
|
|
1103
|
+
stdin: v.pipe(
|
|
1104
|
+
v.custom(() => true),
|
|
1105
|
+
v.metadata({
|
|
1106
|
+
typeString: 'import("node:stream").Readable'
|
|
1107
|
+
}),
|
|
1108
|
+
v.description($`
|
|
1109
|
+
Readable stream for stdin input.
|
|
1110
|
+
`)
|
|
1111
|
+
),
|
|
1112
|
+
stdout: v.pipe(
|
|
1113
|
+
v.custom(() => true),
|
|
1114
|
+
v.metadata({
|
|
1115
|
+
typeString: 'import("node:stream").Writable'
|
|
1116
|
+
}),
|
|
1117
|
+
v.description($`
|
|
1118
|
+
Writable stream for stdout output.
|
|
1119
|
+
`)
|
|
1120
|
+
),
|
|
1121
|
+
stderr: v.pipe(
|
|
1122
|
+
v.custom(() => true),
|
|
1123
|
+
v.metadata({
|
|
1124
|
+
typeString: 'import("node:stream").Writable'
|
|
1125
|
+
}),
|
|
1126
|
+
v.description($`
|
|
1127
|
+
Writable stream for stderr output.
|
|
1128
|
+
`)
|
|
1129
|
+
),
|
|
1130
|
+
signal: v.pipe(
|
|
1131
|
+
v.custom(() => true),
|
|
1132
|
+
v.description($`
|
|
1133
|
+
AbortSignal to cancel the operation.
|
|
1134
|
+
`)
|
|
1135
|
+
)
|
|
1136
|
+
})
|
|
1137
|
+
);
|
|
1138
|
+
var VivliostyleInlineConfig = v.pipe(
|
|
1139
|
+
VivliostyleInlineConfigWithoutChecks,
|
|
1080
1140
|
v.check(
|
|
1081
1141
|
(options) => !options.input || !options.output || !["epub", "epub-opf"].includes(options.input.format) || options.output.every((o) => o.format !== "webpub"),
|
|
1082
1142
|
"Exporting webpub format from EPUB or OPF file is not supported."
|
|
@@ -1087,6 +1147,157 @@ var VivliostyleInlineConfig = v.pipe(
|
|
|
1087
1147
|
),
|
|
1088
1148
|
v.title("VivliostyleInlineConfig")
|
|
1089
1149
|
);
|
|
1150
|
+
var VivliostyleThemeMetadata = v.pipe(
|
|
1151
|
+
v.object({
|
|
1152
|
+
name: v.pipe(
|
|
1153
|
+
v.optional(ValidString),
|
|
1154
|
+
v.description($`
|
|
1155
|
+
Name of the theme.
|
|
1156
|
+
`)
|
|
1157
|
+
),
|
|
1158
|
+
author: v.pipe(
|
|
1159
|
+
v.optional(ValidString),
|
|
1160
|
+
v.description($`
|
|
1161
|
+
Author of the theme.
|
|
1162
|
+
`)
|
|
1163
|
+
),
|
|
1164
|
+
style: v.pipe(
|
|
1165
|
+
v.optional(ValidString),
|
|
1166
|
+
v.description($`
|
|
1167
|
+
This property specifies the main CSS file in the theme.
|
|
1168
|
+
`)
|
|
1169
|
+
),
|
|
1170
|
+
category: v.pipe(
|
|
1171
|
+
v.optional(ValidString),
|
|
1172
|
+
v.description($`
|
|
1173
|
+
This property provides a hint to users about the primary use of your theme when they use it for the first time.
|
|
1174
|
+
Choose the category that best fits your theme from the following list:
|
|
1175
|
+
- \`"novel"\`
|
|
1176
|
+
- \`"magazine"\`
|
|
1177
|
+
- \`"journal"\`
|
|
1178
|
+
- \`"report"\`
|
|
1179
|
+
- \`"misc"\`
|
|
1180
|
+
`)
|
|
1181
|
+
),
|
|
1182
|
+
topics: v.pipe(
|
|
1183
|
+
v.optional(v.array(ValidString)),
|
|
1184
|
+
v.description($`
|
|
1185
|
+
If you want more specific descriptions of the theme's use than the category property,
|
|
1186
|
+
you can list and describe them here.
|
|
1187
|
+
`)
|
|
1188
|
+
)
|
|
1189
|
+
}),
|
|
1190
|
+
v.title("VivliostyleThemeMetadata")
|
|
1191
|
+
);
|
|
1192
|
+
var basePromptOptions = {
|
|
1193
|
+
name: ValidString,
|
|
1194
|
+
required: v.optional(v.boolean())
|
|
1195
|
+
};
|
|
1196
|
+
var TextPrompt = v.object({
|
|
1197
|
+
...basePromptOptions,
|
|
1198
|
+
type: v.literal("text"),
|
|
1199
|
+
message: ValidString,
|
|
1200
|
+
placeholder: v.optional(ValidString),
|
|
1201
|
+
defaultValue: v.optional(ValidString),
|
|
1202
|
+
initialValue: v.optional(ValidString)
|
|
1203
|
+
});
|
|
1204
|
+
var SelectPromptOption = v.union([
|
|
1205
|
+
ValidString,
|
|
1206
|
+
v.object({
|
|
1207
|
+
value: v.union([
|
|
1208
|
+
v.string(),
|
|
1209
|
+
// Allow empty string
|
|
1210
|
+
v.number(),
|
|
1211
|
+
v.boolean()
|
|
1212
|
+
]),
|
|
1213
|
+
label: v.optional(ValidString),
|
|
1214
|
+
hint: v.optional(ValidString)
|
|
1215
|
+
})
|
|
1216
|
+
]);
|
|
1217
|
+
var SelectPrompt = v.object({
|
|
1218
|
+
...basePromptOptions,
|
|
1219
|
+
type: v.literal("select"),
|
|
1220
|
+
message: ValidString,
|
|
1221
|
+
options: v.array(SelectPromptOption),
|
|
1222
|
+
initialValue: v.optional(v.string())
|
|
1223
|
+
});
|
|
1224
|
+
var MultiSelectPrompt = v.object({
|
|
1225
|
+
...basePromptOptions,
|
|
1226
|
+
type: v.literal("multiSelect"),
|
|
1227
|
+
message: ValidString,
|
|
1228
|
+
options: v.array(SelectPromptOption),
|
|
1229
|
+
initialValues: v.optional(v.array(v.string())),
|
|
1230
|
+
cursorAt: v.optional(v.string())
|
|
1231
|
+
});
|
|
1232
|
+
var AutocompletePrompt = v.object({
|
|
1233
|
+
...basePromptOptions,
|
|
1234
|
+
type: v.literal("autocomplete"),
|
|
1235
|
+
message: ValidString,
|
|
1236
|
+
options: v.array(SelectPromptOption),
|
|
1237
|
+
placeholder: v.optional(ValidString),
|
|
1238
|
+
initialValue: v.optional(v.string()),
|
|
1239
|
+
initialUserInput: v.optional(ValidString)
|
|
1240
|
+
});
|
|
1241
|
+
var AutocompleteMultiSelectOptions = v.object({
|
|
1242
|
+
...basePromptOptions,
|
|
1243
|
+
type: v.literal("autocompleteMultiSelect"),
|
|
1244
|
+
message: ValidString,
|
|
1245
|
+
options: v.array(SelectPromptOption),
|
|
1246
|
+
placeholder: v.optional(ValidString),
|
|
1247
|
+
initialValues: v.optional(v.array(v.string()))
|
|
1248
|
+
});
|
|
1249
|
+
var PromptOption = v.variant("type", [
|
|
1250
|
+
TextPrompt,
|
|
1251
|
+
SelectPrompt,
|
|
1252
|
+
MultiSelectPrompt,
|
|
1253
|
+
AutocompletePrompt,
|
|
1254
|
+
AutocompleteMultiSelectOptions
|
|
1255
|
+
]);
|
|
1256
|
+
var VivliostyleTemplateMetadata = v.pipe(
|
|
1257
|
+
v.record(
|
|
1258
|
+
ValidString,
|
|
1259
|
+
v.object({
|
|
1260
|
+
name: v.pipe(
|
|
1261
|
+
v.optional(ValidString),
|
|
1262
|
+
v.description($`
|
|
1263
|
+
Name of the template.
|
|
1264
|
+
`)
|
|
1265
|
+
),
|
|
1266
|
+
description: v.pipe(
|
|
1267
|
+
v.optional(ValidString),
|
|
1268
|
+
v.description($`
|
|
1269
|
+
Description of the template.
|
|
1270
|
+
`)
|
|
1271
|
+
),
|
|
1272
|
+
source: v.pipe(
|
|
1273
|
+
ValidString,
|
|
1274
|
+
v.description($`
|
|
1275
|
+
Template source in the format of \`[provider]:repo[/subpath][#ref]\` or as a local directory to copy from.
|
|
1276
|
+
See the [giget](https://github.com/unjs/giget) documentation for more details of the source format.
|
|
1277
|
+
`)
|
|
1278
|
+
),
|
|
1279
|
+
prompt: v.pipe(
|
|
1280
|
+
v.optional(v.array(PromptOption)),
|
|
1281
|
+
v.description($`
|
|
1282
|
+
Extra prompt options for the template.
|
|
1283
|
+
This is used to prompt users for additional information when applying the template.
|
|
1284
|
+
See the [@clack/prompts](https://github.com/bombshell-dev/clack) documentation for more details on the prompt options.
|
|
1285
|
+
Available prompt types: \`text\`, \`select\`, \`multiSelect\`, \`autocomplete\`, \`autocompleteMultiSelect\`.
|
|
1286
|
+
`)
|
|
1287
|
+
)
|
|
1288
|
+
})
|
|
1289
|
+
),
|
|
1290
|
+
v.title("VivliostyleTemplateMetadata")
|
|
1291
|
+
);
|
|
1292
|
+
var VivliostylePackageMetadata = v.pipe(
|
|
1293
|
+
v.partial(
|
|
1294
|
+
v.object({
|
|
1295
|
+
theme: VivliostyleThemeMetadata,
|
|
1296
|
+
template: VivliostyleTemplateMetadata
|
|
1297
|
+
})
|
|
1298
|
+
),
|
|
1299
|
+
v.title("VivliostylePackageMetadata")
|
|
1300
|
+
);
|
|
1090
1301
|
|
|
1091
1302
|
export {
|
|
1092
1303
|
StructuredDocument,
|
|
@@ -1113,6 +1324,12 @@ export {
|
|
|
1113
1324
|
ServerConfig,
|
|
1114
1325
|
BuildTask,
|
|
1115
1326
|
VivliostyleConfigSchema,
|
|
1116
|
-
|
|
1327
|
+
VivliostyleInlineConfigWithoutChecks,
|
|
1328
|
+
VivliostyleInlineConfig,
|
|
1329
|
+
VivliostyleThemeMetadata,
|
|
1330
|
+
SelectPromptOption,
|
|
1331
|
+
PromptOption,
|
|
1332
|
+
VivliostyleTemplateMetadata,
|
|
1333
|
+
VivliostylePackageMetadata
|
|
1117
1334
|
};
|
|
1118
|
-
//# sourceMappingURL=chunk-
|
|
1335
|
+
//# sourceMappingURL=chunk-CKXFRCPH.js.map
|