@vivliostyle/cli 9.0.0-next.4 → 9.0.0-next.5
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/dist/{chunk-QC3BOE2G.js → chunk-4ZNBH6IA.js} +1 -1
- package/dist/{chunk-E7QOXL6M.js → chunk-6ETFX7W2.js} +1 -1
- package/dist/{chunk-Y3ETBU5J.js → chunk-BPSQMFSC.js} +1 -1
- package/dist/{chunk-LASMQBPP.js → chunk-BT47BDZK.js} +2 -2
- package/dist/{chunk-VBEHGS67.js → chunk-SPYTZBBG.js} +1 -3
- package/dist/{chunk-DMGAKSPH.js → chunk-UQHNZL7X.js} +2 -2
- package/dist/commands/build.js +3 -3
- package/dist/commands/init.js +2 -2
- package/dist/commands/preview.js +3 -3
- package/dist/config/schema.d.ts +2115 -2115
- package/dist/index.d.ts +214 -5
- package/dist/index.js +16 -7
- package/dist/vite-adapter.js +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { ResolvedConfig, UserConfig } from 'vite';
|
|
3
|
+
import { StructuredDocument, StructuredDocumentSection, InputFormat, BrowserType, ParsedVivliostyleInlineConfig, VivliostyleInlineConfig } from './config/schema.js';
|
|
4
|
+
export { VivliostyleConfigSchema } from './config/schema.js';
|
|
4
5
|
export { createVitePlugin } from './vite-adapter.js';
|
|
5
|
-
import '@vivliostyle/vfm';
|
|
6
|
-
import 'unified';
|
|
6
|
+
import { StringifyMarkdownOptions, Metadata } from '@vivliostyle/vfm';
|
|
7
|
+
import { Processor } from 'unified';
|
|
7
8
|
import 'valibot';
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -110,8 +111,216 @@ interface PublicationLinks {
|
|
|
110
111
|
[k: string]: unknown;
|
|
111
112
|
}
|
|
112
113
|
|
|
114
|
+
type ParsedTheme = UriTheme | FileTheme | PackageTheme;
|
|
115
|
+
interface UriTheme {
|
|
116
|
+
type: 'uri';
|
|
117
|
+
name: string;
|
|
118
|
+
location: string;
|
|
119
|
+
}
|
|
120
|
+
interface FileTheme {
|
|
121
|
+
type: 'file';
|
|
122
|
+
name: string;
|
|
123
|
+
source: string;
|
|
124
|
+
location: string;
|
|
125
|
+
}
|
|
126
|
+
interface PackageTheme {
|
|
127
|
+
type: 'package';
|
|
128
|
+
name: string;
|
|
129
|
+
specifier: string;
|
|
130
|
+
location: string;
|
|
131
|
+
importPath?: string | string[];
|
|
132
|
+
}
|
|
133
|
+
type EntrySource = FileEntrySource | UriEntrySource;
|
|
134
|
+
interface FileEntrySource {
|
|
135
|
+
type: 'file';
|
|
136
|
+
pathname: string;
|
|
137
|
+
contentType: ManuscriptMediaType;
|
|
138
|
+
}
|
|
139
|
+
interface UriEntrySource {
|
|
140
|
+
type: 'uri';
|
|
141
|
+
href: string;
|
|
142
|
+
rootDir: string;
|
|
143
|
+
}
|
|
144
|
+
declare const manuscriptMediaTypes: readonly ["text/markdown", "text/html", "application/xhtml+xml"];
|
|
145
|
+
type ManuscriptMediaType = (typeof manuscriptMediaTypes)[number];
|
|
146
|
+
interface ManuscriptEntry {
|
|
147
|
+
contentType: ManuscriptMediaType;
|
|
148
|
+
title?: string;
|
|
149
|
+
themes: ParsedTheme[];
|
|
150
|
+
source: EntrySource;
|
|
151
|
+
template?: undefined;
|
|
152
|
+
target: string;
|
|
153
|
+
rel?: string | string[];
|
|
154
|
+
}
|
|
155
|
+
interface ContentsEntry {
|
|
156
|
+
rel: 'contents';
|
|
157
|
+
title?: string;
|
|
158
|
+
themes: ParsedTheme[];
|
|
159
|
+
source?: undefined;
|
|
160
|
+
template?: EntrySource;
|
|
161
|
+
target: string;
|
|
162
|
+
tocTitle: string;
|
|
163
|
+
sectionDepth: number;
|
|
164
|
+
transform: {
|
|
165
|
+
transformDocumentList: ((nodeList: StructuredDocument[]) => (propsList: {
|
|
166
|
+
children: any;
|
|
167
|
+
}[]) => any) | undefined;
|
|
168
|
+
transformSectionList: ((nodeList: StructuredDocumentSection[]) => (propsList: {
|
|
169
|
+
children: any;
|
|
170
|
+
}[]) => any) | undefined;
|
|
171
|
+
};
|
|
172
|
+
pageBreakBefore?: 'left' | 'right' | 'recto' | 'verso';
|
|
173
|
+
pageCounterReset?: number;
|
|
174
|
+
}
|
|
175
|
+
interface CoverEntry {
|
|
176
|
+
rel: 'cover';
|
|
177
|
+
title?: string;
|
|
178
|
+
themes: ParsedTheme[];
|
|
179
|
+
source?: undefined;
|
|
180
|
+
template?: EntrySource;
|
|
181
|
+
target: string;
|
|
182
|
+
coverImageSrc: string;
|
|
183
|
+
coverImageAlt: string;
|
|
184
|
+
pageBreakBefore?: 'left' | 'right' | 'recto' | 'verso';
|
|
185
|
+
}
|
|
186
|
+
type ParsedEntry = ManuscriptEntry | ContentsEntry | CoverEntry;
|
|
187
|
+
interface WebPublicationManifestConfig {
|
|
188
|
+
type: 'webpub';
|
|
189
|
+
manifestPath: string;
|
|
190
|
+
needToGenerateManifest: boolean;
|
|
191
|
+
}
|
|
192
|
+
interface EpubEntryConfig {
|
|
193
|
+
type: 'epub';
|
|
194
|
+
epubPath: string;
|
|
195
|
+
epubTmpOutputDir: string;
|
|
196
|
+
}
|
|
197
|
+
interface EpubOpfEntryConfig {
|
|
198
|
+
type: 'epub-opf';
|
|
199
|
+
epubOpfPath: string;
|
|
200
|
+
}
|
|
201
|
+
interface WebBookEntryConfig {
|
|
202
|
+
type: 'webbook';
|
|
203
|
+
webbookEntryUrl: string;
|
|
204
|
+
webbookPath: string | undefined;
|
|
205
|
+
}
|
|
206
|
+
type ViewerInputConfig = WebPublicationManifestConfig | EpubEntryConfig | EpubOpfEntryConfig | WebBookEntryConfig;
|
|
207
|
+
interface PdfOutput {
|
|
208
|
+
format: 'pdf';
|
|
209
|
+
path: string;
|
|
210
|
+
renderMode: 'local' | 'docker';
|
|
211
|
+
preflight: 'press-ready' | 'press-ready-local' | undefined;
|
|
212
|
+
preflightOption: string[];
|
|
213
|
+
}
|
|
214
|
+
interface WebPublicationOutput {
|
|
215
|
+
format: 'webpub';
|
|
216
|
+
path: string;
|
|
217
|
+
}
|
|
218
|
+
interface EpubOutput {
|
|
219
|
+
format: 'epub';
|
|
220
|
+
path: string;
|
|
221
|
+
version: '3.0';
|
|
222
|
+
}
|
|
223
|
+
type OutputConfig = PdfOutput | WebPublicationOutput | EpubOutput;
|
|
224
|
+
type PageSize = {
|
|
225
|
+
format: string;
|
|
226
|
+
} | {
|
|
227
|
+
width: string;
|
|
228
|
+
height: string;
|
|
229
|
+
};
|
|
230
|
+
type DocumentProcessorFactory = (options: StringifyMarkdownOptions, metadata: Metadata) => Processor;
|
|
231
|
+
type ResolvedTaskConfig = {
|
|
232
|
+
context: string;
|
|
233
|
+
entryContextDir: string;
|
|
234
|
+
workspaceDir: string;
|
|
235
|
+
themesDir: string;
|
|
236
|
+
entries: ParsedEntry[];
|
|
237
|
+
input: {
|
|
238
|
+
format: InputFormat;
|
|
239
|
+
entry: string;
|
|
240
|
+
};
|
|
241
|
+
viewerInput: ViewerInputConfig;
|
|
242
|
+
outputs: OutputConfig[];
|
|
243
|
+
themeIndexes: Set<ParsedTheme>;
|
|
244
|
+
copyAsset: {
|
|
245
|
+
includes: string[];
|
|
246
|
+
excludes: string[];
|
|
247
|
+
fileExtensions: string[];
|
|
248
|
+
};
|
|
249
|
+
exportAliases: {
|
|
250
|
+
source: string;
|
|
251
|
+
target: string;
|
|
252
|
+
}[];
|
|
253
|
+
temporaryFilePrefix: string;
|
|
254
|
+
size: PageSize | undefined;
|
|
255
|
+
cropMarks: boolean;
|
|
256
|
+
bleed: string | undefined;
|
|
257
|
+
cropOffset: string | undefined;
|
|
258
|
+
css: string | undefined;
|
|
259
|
+
customStyle: string | undefined;
|
|
260
|
+
customUserStyle: string | undefined;
|
|
261
|
+
singleDoc: boolean;
|
|
262
|
+
quick: boolean;
|
|
263
|
+
title: string | undefined;
|
|
264
|
+
author: string | undefined;
|
|
265
|
+
language: string | undefined;
|
|
266
|
+
readingProgression: 'ltr' | 'rtl' | undefined;
|
|
267
|
+
documentProcessorFactory: DocumentProcessorFactory;
|
|
268
|
+
vfmOptions: {
|
|
269
|
+
hardLineBreaks: boolean;
|
|
270
|
+
disableFormatHtml: boolean;
|
|
271
|
+
};
|
|
272
|
+
cover: {
|
|
273
|
+
src: string;
|
|
274
|
+
name: string;
|
|
275
|
+
} | undefined;
|
|
276
|
+
timeout: number;
|
|
277
|
+
sandbox: boolean;
|
|
278
|
+
browser: {
|
|
279
|
+
type: BrowserType;
|
|
280
|
+
executablePath: string | undefined;
|
|
281
|
+
};
|
|
282
|
+
proxy: {
|
|
283
|
+
server: string;
|
|
284
|
+
bypass: string | undefined;
|
|
285
|
+
username: string | undefined;
|
|
286
|
+
password: string | undefined;
|
|
287
|
+
} | undefined;
|
|
288
|
+
image: string;
|
|
289
|
+
viewer: string | undefined;
|
|
290
|
+
viewerParam: string | undefined;
|
|
291
|
+
logLevel: 'silent' | 'info' | 'verbose' | 'debug';
|
|
292
|
+
ignoreHttpsErrors: boolean;
|
|
293
|
+
base: string;
|
|
294
|
+
server: Required<Pick<ResolvedConfig['server'], 'host' | 'port' | 'proxy'>>;
|
|
295
|
+
static: Record<string, string[]>;
|
|
296
|
+
rootUrl: string;
|
|
297
|
+
viteConfig: UserConfig | undefined;
|
|
298
|
+
viteConfigFile: string | boolean;
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
declare function vsBrowserPlugin({ config: _config, inlineConfig, }: {
|
|
302
|
+
config: ResolvedTaskConfig;
|
|
303
|
+
inlineConfig: ParsedVivliostyleInlineConfig;
|
|
304
|
+
}): vite.Plugin;
|
|
305
|
+
|
|
306
|
+
declare function vsDevServerPlugin({ config: _config, inlineConfig, }: {
|
|
307
|
+
config: ResolvedTaskConfig;
|
|
308
|
+
inlineConfig: ParsedVivliostyleInlineConfig;
|
|
309
|
+
}): vite.Plugin;
|
|
310
|
+
|
|
311
|
+
declare function vsStaticServePlugin({ config: _config, inlineConfig, }: {
|
|
312
|
+
config: ResolvedTaskConfig;
|
|
313
|
+
inlineConfig: ParsedVivliostyleInlineConfig;
|
|
314
|
+
}): vite.Plugin;
|
|
315
|
+
|
|
316
|
+
declare function vsViewerPlugin(_?: {
|
|
317
|
+
config: ResolvedTaskConfig;
|
|
318
|
+
inlineConfig: ParsedVivliostyleInlineConfig;
|
|
319
|
+
}): vite.Plugin;
|
|
320
|
+
|
|
113
321
|
/** @hidden */
|
|
114
322
|
type PublicationManifest = PublicationManifest$1;
|
|
323
|
+
|
|
115
324
|
/**
|
|
116
325
|
* Build publication file(s) from the given configuration.
|
|
117
326
|
*
|
|
@@ -142,4 +351,4 @@ declare function init(options: VivliostyleInlineConfig): Promise<void>;
|
|
|
142
351
|
*/
|
|
143
352
|
declare function preview(options: VivliostyleInlineConfig): Promise<vite.ViteDevServer>;
|
|
144
353
|
|
|
145
|
-
export { type PublicationManifest, build, init, preview };
|
|
354
|
+
export { type PublicationManifest, StructuredDocument, StructuredDocumentSection, build, init, preview, vsBrowserPlugin, vsDevServerPlugin, vsStaticServePlugin, vsViewerPlugin };
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createVitePlugin
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BPSQMFSC.js";
|
|
4
4
|
import {
|
|
5
5
|
build
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UQHNZL7X.js";
|
|
7
7
|
import {
|
|
8
8
|
init
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-6ETFX7W2.js";
|
|
10
10
|
import {
|
|
11
11
|
preview
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import
|
|
12
|
+
} from "./chunk-BT47BDZK.js";
|
|
13
|
+
import "./chunk-4ZNBH6IA.js";
|
|
14
|
+
import {
|
|
15
|
+
vsBrowserPlugin,
|
|
16
|
+
vsDevServerPlugin,
|
|
17
|
+
vsStaticServePlugin,
|
|
18
|
+
vsViewerPlugin
|
|
19
|
+
} from "./chunk-SPYTZBBG.js";
|
|
15
20
|
import "./chunk-EX7EA34F.js";
|
|
16
21
|
import "./chunk-WX6JHPSL.js";
|
|
17
22
|
import {
|
|
@@ -37,5 +42,9 @@ export {
|
|
|
37
42
|
build2 as build,
|
|
38
43
|
createVitePlugin,
|
|
39
44
|
init2 as init,
|
|
40
|
-
preview2 as preview
|
|
45
|
+
preview2 as preview,
|
|
46
|
+
vsBrowserPlugin,
|
|
47
|
+
vsDevServerPlugin,
|
|
48
|
+
vsStaticServePlugin,
|
|
49
|
+
vsViewerPlugin
|
|
41
50
|
};
|
package/dist/vite-adapter.js
CHANGED
package/package.json
CHANGED