@vivliostyle/cli 5.9.0 → 6.0.0
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/browser.d.ts +1 -1
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +20 -51
- package/dist/browser.js.map +1 -1
- package/dist/build.d.ts +1 -1
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +46 -47
- package/dist/build.js.map +1 -1
- package/dist/builder.d.ts +5 -6
- package/dist/builder.d.ts.map +1 -1
- package/dist/builder.js +124 -103
- package/dist/builder.js.map +1 -1
- package/dist/cli.js +5 -10
- package/dist/cli.js.map +1 -1
- package/dist/commands/build.js +10 -16
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/build.parser.d.ts +3 -3
- package/dist/commands/build.parser.d.ts.map +1 -1
- package/dist/commands/build.parser.js +13 -21
- package/dist/commands/build.parser.js.map +1 -1
- package/dist/commands/init.js +7 -9
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/init.parser.d.ts +2 -2
- package/dist/commands/init.parser.d.ts.map +1 -1
- package/dist/commands/init.parser.js +3 -10
- package/dist/commands/init.parser.js.map +1 -1
- package/dist/commands/preview.js +8 -11
- package/dist/commands/preview.js.map +1 -1
- package/dist/commands/preview.parser.d.ts +2 -2
- package/dist/commands/preview.parser.d.ts.map +1 -1
- package/dist/commands/preview.parser.js +5 -12
- package/dist/commands/preview.parser.js.map +1 -1
- package/dist/config.d.ts +29 -18
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +285 -251
- package/dist/config.js.map +1 -1
- package/dist/const.d.ts +2 -0
- package/dist/const.d.ts.map +1 -1
- package/dist/const.js +12 -15
- package/dist/const.js.map +1 -1
- package/dist/container.js +31 -41
- package/dist/container.js.map +1 -1
- package/dist/epub.d.ts.map +1 -1
- package/dist/epub.js +10 -17
- package/dist/epub.js.map +1 -1
- package/dist/html.d.ts +3 -3
- package/dist/html.d.ts.map +1 -1
- package/dist/html.js +21 -30
- package/dist/html.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -9
- package/dist/index.js.map +1 -1
- package/dist/init.js +12 -19
- package/dist/init.js.map +1 -1
- package/dist/input.d.ts +2 -2
- package/dist/input.d.ts.map +1 -1
- package/dist/input.js +8 -16
- package/dist/input.js.map +1 -1
- package/dist/markdown.js +9 -17
- package/dist/markdown.js.map +1 -1
- package/dist/output.d.ts +1 -1
- package/dist/output.d.ts.map +1 -1
- package/dist/output.js +6 -16
- package/dist/output.js.map +1 -1
- package/dist/pdf.d.ts +3 -3
- package/dist/pdf.d.ts.map +1 -1
- package/dist/pdf.js +66 -79
- package/dist/pdf.js.map +1 -1
- package/dist/postprocess.d.ts +5 -5
- package/dist/postprocess.d.ts.map +1 -1
- package/dist/postprocess.js +54 -81
- package/dist/postprocess.js.map +1 -1
- package/dist/preview.d.ts +1 -1
- package/dist/preview.d.ts.map +1 -1
- package/dist/preview.js +53 -58
- package/dist/preview.js.map +1 -1
- package/dist/schema/pubManifest.d.ts +2 -471
- package/dist/schema/pubManifest.d.ts.map +1 -1
- package/dist/schema/pubManifest.js +41 -42
- package/dist/schema/pubManifest.js.map +1 -1
- package/dist/schema/publication.schema.d.ts +12 -12
- package/dist/schema/publication.schema.d.ts.map +1 -1
- package/dist/schema/publication.schema.js +1 -2
- package/dist/schema/publication.schema.js.map +1 -1
- package/dist/schema/vivliostyle.d.ts +1 -1
- package/dist/schema/vivliostyle.d.ts.map +1 -1
- package/dist/schema/vivliostyle.js +7 -8
- package/dist/schema/vivliostyle.js.map +1 -1
- package/dist/schema/vivliostyleConfig.schema.d.ts +22 -9
- package/dist/schema/vivliostyleConfig.schema.d.ts.map +1 -1
- package/dist/schema/vivliostyleConfig.schema.js +1 -2
- package/dist/schema/vivliostyleConfig.schema.js.map +1 -1
- package/dist/server.d.ts +7 -6
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +26 -38
- package/dist/server.js.map +1 -1
- package/dist/theme.d.ts +6 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +74 -0
- package/dist/theme.js.map +1 -0
- package/dist/util.d.ts +3 -3
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +80 -98
- package/dist/util.js.map +1 -1
- package/dist/webbook.d.ts +1 -1
- package/dist/webbook.d.ts.map +1 -1
- package/dist/webbook.js +40 -44
- package/dist/webbook.js.map +1 -1
- package/package.json +32 -16
- package/schemas/pubManifest/README.md +5 -0
- package/schemas/pubManifest/module/ItemList.schema.json +32 -0
- package/schemas/pubManifest/module/bcp.schema.json +7 -0
- package/schemas/pubManifest/module/context.schema.json +62 -0
- package/schemas/pubManifest/module/contributor-object.schema.json +42 -0
- package/schemas/pubManifest/module/contributor.schema.json +26 -0
- package/schemas/pubManifest/module/date.schema.json +7 -0
- package/schemas/pubManifest/module/duration.schema.json +7 -0
- package/schemas/pubManifest/module/item-lists.schema.json +16 -0
- package/schemas/pubManifest/module/language.schema.json +16 -0
- package/schemas/pubManifest/module/link.schema.json +60 -0
- package/schemas/pubManifest/module/localizable-object.schema.json +15 -0
- package/schemas/pubManifest/module/localizable.schema.json +26 -0
- package/schemas/pubManifest/module/resource.categorization.schema.json +31 -0
- package/schemas/pubManifest/module/strings.schema.json +9 -0
- package/schemas/pubManifest/module/url.schema.json +7 -0
- package/schemas/pubManifest/module/urls.schema.json +18 -0
- package/schemas/pubManifest/publication.schema.json +123 -0
- package/schemas/vivliostyle/vivliostyleConfig.schema.json +348 -0
- package/types/better-ajv-errors.d.ts +28 -0
- package/types/custom.d.ts +9 -0
- package/types/playwright.d.ts +49 -0
- package/dist/schema/pubManifest/module/ItemList.schema.json +0 -32
- package/dist/schema/pubManifest/module/bcp.schema.json +0 -7
- package/dist/schema/pubManifest/module/context.schema.json +0 -62
- package/dist/schema/pubManifest/module/contributor-object.schema.json +0 -42
- package/dist/schema/pubManifest/module/contributor.schema.json +0 -26
- package/dist/schema/pubManifest/module/date.schema.json +0 -7
- package/dist/schema/pubManifest/module/duration.schema.json +0 -7
- package/dist/schema/pubManifest/module/item-lists.schema.json +0 -16
- package/dist/schema/pubManifest/module/language.schema.json +0 -16
- package/dist/schema/pubManifest/module/link.schema.json +0 -60
- package/dist/schema/pubManifest/module/localizable-object.schema.json +0 -15
- package/dist/schema/pubManifest/module/localizable.schema.json +0 -26
- package/dist/schema/pubManifest/module/resource.categorization.schema.json +0 -31
- package/dist/schema/pubManifest/module/strings.schema.json +0 -9
- package/dist/schema/pubManifest/module/url.schema.json +0 -7
- package/dist/schema/pubManifest/module/urls.schema.json +0 -18
- package/dist/schema/pubManifest/publication.schema.json +0 -123
- package/dist/schema/vivliostyle/vivliostyleConfig.schema.json +0 -296
package/dist/builder.js
CHANGED
|
@@ -1,31 +1,85 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import AjvModule from 'ajv';
|
|
2
|
+
import AjvFormatsModule from 'ajv-formats';
|
|
3
|
+
import betterAjvErrors from 'better-ajv-errors';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import { globby } from 'globby';
|
|
6
|
+
import { imageSize } from 'image-size';
|
|
7
|
+
import { lookup as mime } from 'mime-types';
|
|
8
|
+
import fs from 'node:fs';
|
|
9
|
+
import shelljs from 'shelljs';
|
|
10
|
+
import path from 'upath';
|
|
11
|
+
import { TOC_TITLE } from './const.js';
|
|
12
|
+
import { generateTocHtml, isTocHtml, processManuscriptHtml } from './html.js';
|
|
13
|
+
import { processMarkdown } from './markdown.js';
|
|
14
|
+
import { publicationSchema, publicationSchemas } from './schema/pubManifest.js';
|
|
15
|
+
import { checkThemeInstallationNecessity, installThemeDependencies, } from './theme.js';
|
|
16
|
+
import { debug, DetailError, filterRelevantAjvErrors, log, pathContains, pathEquals, startLogging, useTmpDirectory, } from './util.js';
|
|
17
|
+
// FIXME: https://github.com/ajv-validator/ajv/issues/2047
|
|
18
|
+
const Ajv = AjvModule.default;
|
|
19
|
+
const addFormats = AjvFormatsModule.default;
|
|
20
|
+
function locateThemePath(theme, from) {
|
|
21
|
+
if (theme.type === 'uri') {
|
|
22
|
+
return theme.location;
|
|
23
|
+
}
|
|
24
|
+
if (theme.type === 'file') {
|
|
25
|
+
return path.relative(from, theme.location);
|
|
26
|
+
}
|
|
27
|
+
if (theme.importPath) {
|
|
28
|
+
return [theme.importPath].flat().map((locator) => {
|
|
29
|
+
const resolvedPath = path.resolve(theme.location, locator);
|
|
30
|
+
if (!pathContains(theme.location, resolvedPath) ||
|
|
31
|
+
!fs.existsSync(resolvedPath)) {
|
|
32
|
+
throw new Error(`Could not find a style path ${theme.importPath} for the theme: ${theme.name}.`);
|
|
33
|
+
}
|
|
34
|
+
return path.relative(from, resolvedPath);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
const pkgJsonPath = path.join(theme.location, 'package.json');
|
|
39
|
+
const packageJson = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf8'));
|
|
40
|
+
const maybeStyle = packageJson?.vivliostyle?.theme?.style ??
|
|
41
|
+
packageJson.style ??
|
|
42
|
+
packageJson.main;
|
|
43
|
+
if (!maybeStyle) {
|
|
44
|
+
throw new DetailError(`Could not find a style file for the theme: ${theme.name}.`, 'Please ensure this package satisfies a `vivliostyle.theme.style` propertiy.');
|
|
45
|
+
}
|
|
46
|
+
return path.relative(from, path.join(theme.location, maybeStyle));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export async function cleanupWorkspace({ entryContextDir, workspaceDir, themesDir, }) {
|
|
50
|
+
if (pathEquals(workspaceDir, entryContextDir) ||
|
|
51
|
+
pathContains(workspaceDir, entryContextDir)) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
// workspaceDir is placed on different directory; delete everything excepting theme files
|
|
55
|
+
debug('cleanup workspace files', workspaceDir);
|
|
56
|
+
let movedThemePath;
|
|
57
|
+
if (pathContains(workspaceDir, themesDir) && fs.existsSync(themesDir)) {
|
|
58
|
+
[movedThemePath] = await useTmpDirectory();
|
|
59
|
+
shelljs.cp('-rf', themesDir, movedThemePath);
|
|
60
|
+
}
|
|
61
|
+
shelljs.rm('-rf', workspaceDir);
|
|
62
|
+
if (movedThemePath) {
|
|
63
|
+
shelljs.mkdir('-p', workspaceDir);
|
|
64
|
+
shelljs.cp('-rf', path.join(movedThemePath, path.basename(themesDir)), workspaceDir);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export async function prepareThemeDirectory({ themesDir, themeIndexes, }) {
|
|
68
|
+
// install theme packages
|
|
69
|
+
if (await checkThemeInstallationNecessity({ themesDir, themeIndexes })) {
|
|
70
|
+
startLogging('Installing theme files');
|
|
71
|
+
await installThemeDependencies({ themesDir, themeIndexes });
|
|
72
|
+
}
|
|
73
|
+
// copy theme files
|
|
74
|
+
for (const theme of themeIndexes) {
|
|
75
|
+
if (theme.type === 'file' && !pathEquals(theme.source, theme.location)) {
|
|
76
|
+
shelljs.mkdir('-p', path.dirname(theme.location));
|
|
77
|
+
shelljs.cp(theme.source, theme.location);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
25
80
|
}
|
|
26
|
-
exports.cleanup = cleanup;
|
|
27
81
|
// https://www.w3.org/TR/pub-manifest/
|
|
28
|
-
function generateManifest(outputPath, entryContextDir, options) {
|
|
82
|
+
export function generateManifest(outputPath, entryContextDir, options) {
|
|
29
83
|
const entries = options.entries.map((entry) => ({
|
|
30
84
|
url: encodeURI(entry.path),
|
|
31
85
|
name: entry.title,
|
|
@@ -36,10 +90,10 @@ function generateManifest(outputPath, entryContextDir, options) {
|
|
|
36
90
|
const links = [];
|
|
37
91
|
const resources = [];
|
|
38
92
|
if (options.cover) {
|
|
39
|
-
const { width, height, type } =
|
|
93
|
+
const { width, height, type } = imageSize(path.resolve(entryContextDir, options.cover));
|
|
40
94
|
let mimeType = false;
|
|
41
95
|
if (type) {
|
|
42
|
-
mimeType =
|
|
96
|
+
mimeType = mime(type);
|
|
43
97
|
if (mimeType) {
|
|
44
98
|
links.push({
|
|
45
99
|
rel: 'cover',
|
|
@@ -51,7 +105,7 @@ function generateManifest(outputPath, entryContextDir, options) {
|
|
|
51
105
|
}
|
|
52
106
|
}
|
|
53
107
|
if (!type || !mimeType) {
|
|
54
|
-
|
|
108
|
+
log(`\n${chalk.yellow('Cover image ')}${chalk.bold.yellow(`"${options.cover}"`)}${chalk.yellow(' was set in your configuration but couldn’t detect the image metadata. Please check a valid cover file is placed.')}`);
|
|
55
109
|
}
|
|
56
110
|
}
|
|
57
111
|
const publication = {
|
|
@@ -70,107 +124,76 @@ function generateManifest(outputPath, entryContextDir, options) {
|
|
|
70
124
|
links,
|
|
71
125
|
};
|
|
72
126
|
const publicationJson = JSON.stringify(publication, null, 2);
|
|
73
|
-
|
|
74
|
-
const ajv = new
|
|
75
|
-
|
|
76
|
-
ajv.addSchema(
|
|
77
|
-
const validate = ajv.compile(
|
|
127
|
+
fs.writeFileSync(outputPath, publicationJson);
|
|
128
|
+
const ajv = new Ajv({ strict: false });
|
|
129
|
+
addFormats(ajv);
|
|
130
|
+
ajv.addSchema(publicationSchemas);
|
|
131
|
+
const validate = ajv.compile(publicationSchema);
|
|
78
132
|
const valid = validate(publication);
|
|
79
133
|
if (!valid) {
|
|
80
134
|
const message = `Validation of pubManifest failed. Please check the schema: ${outputPath}`;
|
|
81
135
|
const detailMessage = validate.errors &&
|
|
82
|
-
|
|
136
|
+
betterAjvErrors(publicationSchemas, publication, filterRelevantAjvErrors(validate.errors), {
|
|
83
137
|
json: publicationJson,
|
|
84
138
|
});
|
|
85
139
|
throw detailMessage
|
|
86
|
-
? new
|
|
140
|
+
? new DetailError(message, detailMessage)
|
|
87
141
|
: new Error(message);
|
|
88
142
|
}
|
|
89
143
|
}
|
|
90
|
-
|
|
91
|
-
async function compile({ entryContextDir, workspaceDir, manifestPath, manifestAutoGenerate, themeIndexes, entries, language, readingProgression, cover, vfmOptions, input, }, { reload = false } = {}) {
|
|
92
|
-
var _a;
|
|
93
|
-
util_1.debug('entries', entries);
|
|
94
|
-
util_1.debug('themes', themeIndexes);
|
|
95
|
-
if (!reload && !util_1.pathStartsWith(entryContextDir, workspaceDir)) {
|
|
96
|
-
// workspaceDir is placed on different directory
|
|
97
|
-
cleanup(workspaceDir);
|
|
98
|
-
}
|
|
99
|
-
const locateThemePath = (from, theme) => {
|
|
100
|
-
switch (theme === null || theme === void 0 ? void 0 : theme.type) {
|
|
101
|
-
case 'uri':
|
|
102
|
-
return theme.location;
|
|
103
|
-
case 'file':
|
|
104
|
-
return upath_1.default.relative(from, theme.destination);
|
|
105
|
-
case 'package':
|
|
106
|
-
return upath_1.default.relative(from, upath_1.default.join(theme.destination, theme.style));
|
|
107
|
-
}
|
|
108
|
-
};
|
|
144
|
+
export async function compile({ entryContextDir, workspaceDir, manifestPath, manifestAutoGenerate, entries, language, readingProgression, cover, vfmOptions, }) {
|
|
109
145
|
const generativeContentsEntry = entries.find((e) => !('source' in e) && e.rel === 'contents');
|
|
110
146
|
if (generativeContentsEntry &&
|
|
111
|
-
|
|
112
|
-
!
|
|
147
|
+
fs.existsSync(generativeContentsEntry.target) &&
|
|
148
|
+
!isTocHtml(generativeContentsEntry.target)) {
|
|
113
149
|
throw new Error(`${generativeContentsEntry.target} is set as a destination to create a ToC HTML file, but there is already a document other than the ToC file in this location. Please move this file, or set a 'toc' option in vivliostyle.config.js to specify another destination for the ToC file.`);
|
|
114
150
|
}
|
|
115
151
|
const contentEntries = entries.filter((e) => 'source' in e);
|
|
116
152
|
for (const entry of contentEntries) {
|
|
117
|
-
|
|
153
|
+
shelljs.mkdir('-p', path.dirname(entry.target));
|
|
118
154
|
// calculate style path
|
|
119
|
-
const style = locateThemePath(
|
|
155
|
+
const style = entry.themes.flatMap((theme) => locateThemePath(theme, path.dirname(entry.target)));
|
|
120
156
|
if (entry.type === 'text/markdown') {
|
|
121
157
|
// compile markdown
|
|
122
|
-
const vfile =
|
|
158
|
+
const vfile = processMarkdown(entry.source, {
|
|
123
159
|
...vfmOptions,
|
|
124
160
|
style,
|
|
125
161
|
title: entry.title,
|
|
126
|
-
language: language
|
|
162
|
+
language: language ?? undefined,
|
|
127
163
|
});
|
|
128
164
|
const compiledEntry = String(vfile);
|
|
129
|
-
|
|
165
|
+
fs.writeFileSync(entry.target, compiledEntry);
|
|
130
166
|
}
|
|
131
167
|
else if (entry.type === 'text/html' ||
|
|
132
168
|
entry.type === 'application/xhtml+xml') {
|
|
133
|
-
if (!
|
|
134
|
-
const html =
|
|
169
|
+
if (!pathEquals(entry.source, entry.target)) {
|
|
170
|
+
const html = processManuscriptHtml(entry.source, {
|
|
135
171
|
style,
|
|
136
172
|
title: entry.title,
|
|
137
173
|
contentType: entry.type,
|
|
138
174
|
language,
|
|
139
175
|
});
|
|
140
|
-
|
|
176
|
+
fs.writeFileSync(entry.target, html);
|
|
141
177
|
}
|
|
142
178
|
}
|
|
143
179
|
else {
|
|
144
|
-
if (!
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
// copy theme
|
|
150
|
-
for (const theme of themeIndexes) {
|
|
151
|
-
if (theme.type === 'file') {
|
|
152
|
-
if (!util_1.pathEquals(theme.location, theme.destination)) {
|
|
153
|
-
shelljs_1.default.mkdir('-p', upath_1.default.dirname(theme.destination));
|
|
154
|
-
shelljs_1.default.cp(theme.location, theme.destination);
|
|
180
|
+
if (!pathEquals(entry.source, entry.target)) {
|
|
181
|
+
shelljs.cp(entry.source, entry.target);
|
|
155
182
|
}
|
|
156
183
|
}
|
|
157
|
-
else if (theme.type === 'package') {
|
|
158
|
-
shelljs_1.default.mkdir('-p', theme.destination);
|
|
159
|
-
shelljs_1.default.cp('-r', upath_1.default.join(theme.location, '*'), theme.destination);
|
|
160
|
-
}
|
|
161
184
|
}
|
|
162
185
|
// generate toc
|
|
163
186
|
if (generativeContentsEntry) {
|
|
164
|
-
const style = locateThemePath(
|
|
165
|
-
const tocString =
|
|
187
|
+
const style = generativeContentsEntry.themes.flatMap((theme) => locateThemePath(theme, workspaceDir));
|
|
188
|
+
const tocString = generateTocHtml({
|
|
166
189
|
entries: contentEntries,
|
|
167
190
|
manifestPath,
|
|
168
|
-
distDir:
|
|
169
|
-
title: manifestAutoGenerate
|
|
170
|
-
tocTitle:
|
|
191
|
+
distDir: path.dirname(generativeContentsEntry.target),
|
|
192
|
+
title: manifestAutoGenerate?.title,
|
|
193
|
+
tocTitle: generativeContentsEntry.title ?? TOC_TITLE,
|
|
171
194
|
style,
|
|
172
195
|
});
|
|
173
|
-
|
|
196
|
+
fs.writeFileSync(generativeContentsEntry.target, tocString);
|
|
174
197
|
}
|
|
175
198
|
// generate manifest
|
|
176
199
|
if (manifestAutoGenerate) {
|
|
@@ -178,10 +201,10 @@ async function compile({ entryContextDir, workspaceDir, manifestPath, manifestAu
|
|
|
178
201
|
...manifestAutoGenerate,
|
|
179
202
|
language,
|
|
180
203
|
readingProgression,
|
|
181
|
-
cover: cover &&
|
|
204
|
+
cover: cover && path.relative(entryContextDir, cover),
|
|
182
205
|
entries: entries.map((entry) => ({
|
|
183
206
|
title: entry.title,
|
|
184
|
-
path:
|
|
207
|
+
path: path.relative(workspaceDir, entry.target),
|
|
185
208
|
encodingFormat: !('type' in entry) ||
|
|
186
209
|
entry.type === 'text/markdown' ||
|
|
187
210
|
entry.type === 'text/html'
|
|
@@ -193,34 +216,32 @@ async function compile({ entryContextDir, workspaceDir, manifestPath, manifestAu
|
|
|
193
216
|
});
|
|
194
217
|
}
|
|
195
218
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
if (util_1.pathEquals(entryContextDir, workspaceDir)) {
|
|
219
|
+
export async function copyAssets({ entryContextDir, workspaceDir, includeAssets, }) {
|
|
220
|
+
if (pathEquals(entryContextDir, workspaceDir)) {
|
|
199
221
|
return;
|
|
200
222
|
}
|
|
201
|
-
const relWorkspaceDir =
|
|
202
|
-
const assets = await
|
|
223
|
+
const relWorkspaceDir = path.relative(entryContextDir, workspaceDir);
|
|
224
|
+
const assets = await globby(includeAssets, {
|
|
203
225
|
cwd: entryContextDir,
|
|
204
|
-
ignore: relWorkspaceDir ? [
|
|
226
|
+
ignore: relWorkspaceDir ? [path.join(relWorkspaceDir, '**/*')] : undefined,
|
|
205
227
|
caseSensitiveMatch: false,
|
|
206
228
|
followSymbolicLinks: false,
|
|
207
229
|
gitignore: true,
|
|
208
230
|
});
|
|
209
|
-
|
|
231
|
+
debug('assets', assets);
|
|
210
232
|
for (const asset of assets) {
|
|
211
|
-
const target =
|
|
212
|
-
|
|
213
|
-
|
|
233
|
+
const target = path.join(workspaceDir, asset);
|
|
234
|
+
shelljs.mkdir('-p', path.dirname(target));
|
|
235
|
+
shelljs.cp(path.resolve(entryContextDir, asset), target);
|
|
214
236
|
}
|
|
215
237
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
238
|
+
export function checkOverwriteViolation({ entryContextDir, workspaceDir }, target, fileInformation) {
|
|
239
|
+
if (pathContains(target, entryContextDir) ||
|
|
240
|
+
pathEquals(target, entryContextDir)) {
|
|
219
241
|
throw new Error(`${target} is set as output destination of ${fileInformation}, however, this output path will overwrite the manuscript file(s). Please specify other paths.`);
|
|
220
242
|
}
|
|
221
|
-
if (
|
|
243
|
+
if (pathContains(target, workspaceDir) || pathEquals(target, workspaceDir)) {
|
|
222
244
|
throw new Error(`${target} is set as output destination of ${fileInformation}, however, this output path will overwrite the working directory of Vivliostyle. Please specify other paths.`);
|
|
223
245
|
}
|
|
224
246
|
}
|
|
225
|
-
exports.checkOverwriteViolation = checkOverwriteViolation;
|
|
226
247
|
//# sourceMappingURL=builder.js.map
|
package/dist/builder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,KAAK,CAAC;AAC5B,OAAO,gBAAgB,MAAM,aAAa,CAAC;AAC3C,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,MAAM,IAAI,IAAI,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,IAAI,MAAM,OAAO,CAAC;AAOzB,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAKhD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAEhF,OAAO,EACL,+BAA+B,EAC/B,wBAAwB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,KAAK,EACL,WAAW,EACX,uBAAuB,EACvB,GAAG,EACH,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,eAAe,GAChB,MAAM,WAAW,CAAC;AAEnB,0DAA0D;AAC1D,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC;AAC9B,MAAM,UAAU,GAAG,gBAAgB,CAAC,OAAO,CAAC;AAE5C,SAAS,eAAe,CAAC,KAAkB,EAAE,IAAY;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AuB;IAEvB,IACE,YAAY,CAAC,MAAM,EAAE,eAAe,CAAC;QACrC,UAAU,CAAC,MAAM,EAAE,eAAe,CAAC,EACnC;QACA,MAAM,IAAI,KAAK,CACb,GAAG,MAAM,oCAAoC,eAAe,gGAAgG,CAC7J,CAAC;KACH;IACD,IAAI,YAAY,CAAC,MAAM,EAAE,YAAY,CAAC,IAAI,UAAU,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE;QAC1E,MAAM,IAAI,KAAK,CACb,GAAG,MAAM,oCAAoC,eAAe,8GAA8G,CAC3K,CAAC;KACH;AACH,CAAC"}
|
package/dist/cli.js
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
const commander_1 = __importDefault(require("commander"));
|
|
8
|
-
const const_1 = require("./const");
|
|
9
|
-
const version = `cli: ${const_1.cliVersion}
|
|
10
|
-
core: ${const_1.coreVersion}`;
|
|
11
|
-
const program = new commander_1.default.Command();
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import { cliVersion, coreVersion } from './const.js';
|
|
4
|
+
const version = `cli: ${cliVersion}
|
|
5
|
+
core: ${coreVersion}`;
|
|
6
|
+
const program = new Command();
|
|
12
7
|
program
|
|
13
8
|
.name('vivliostyle')
|
|
14
9
|
.version(version, '-v, --version')
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,OAAO,GAAG,QAAQ,UAAU;QAC1B,WAAW,EAAE,CAAC;AAEtB,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAC9B,OAAO;KACJ,IAAI,CAAC,aAAa,CAAC;KACnB,OAAO,CAAC,OAAO,EAAE,eAAe,CAAC;KACjC,OAAO,CAAC,MAAM,EAAE,2BAA2B,EAAE;IAC5C,cAAc,EAAE,eAAe;CAChC,CAAC;KACD,OAAO,CAAC,OAAO,EAAE,2BAA2B,EAAE;IAC7C,cAAc,EAAE,gBAAgB;CACjC,CAAC;KACD,OAAO,CAAC,SAAS,EAAE,uBAAuB,EAAE;IAC3C,cAAc,EAAE,kBAAkB;CACnC,CAAC;KACD,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
package/dist/commands/build.js
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
var _a;
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
const process_1 = __importDefault(require("process"));
|
|
8
|
-
const build_1 = require("../build");
|
|
9
|
-
const util_1 = require("../util");
|
|
10
|
-
const build_parser_1 = require("./build.parser");
|
|
1
|
+
import process from 'node:process';
|
|
2
|
+
import { build } from '../build.js';
|
|
3
|
+
import { gracefulError } from '../util.js';
|
|
4
|
+
import { setupBuildParserProgram } from './build.parser.js';
|
|
11
5
|
try {
|
|
12
|
-
const program =
|
|
13
|
-
program.parse(
|
|
6
|
+
const program = setupBuildParserProgram();
|
|
7
|
+
program.parse(process.argv);
|
|
14
8
|
const options = program.opts();
|
|
15
|
-
|
|
16
|
-
input:
|
|
9
|
+
build({
|
|
10
|
+
input: program.args?.[0],
|
|
17
11
|
configPath: options.config,
|
|
18
12
|
targets: options.targets,
|
|
19
13
|
theme: options.theme,
|
|
@@ -42,11 +36,11 @@ try {
|
|
|
42
36
|
// browser: options.browser,
|
|
43
37
|
bypassedPdfBuilderOption: options.bypassedPdfBuilderOption,
|
|
44
38
|
executableChromium: options.executableChromium, // TODO: Remove it in the next major version up
|
|
45
|
-
}).catch(
|
|
39
|
+
}).catch(gracefulError);
|
|
46
40
|
}
|
|
47
41
|
catch (err) {
|
|
48
42
|
if (err instanceof Error) {
|
|
49
|
-
|
|
43
|
+
gracefulError(err);
|
|
50
44
|
}
|
|
51
45
|
}
|
|
52
46
|
//# sourceMappingURL=build.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,IAAI;IACF,MAAM,OAAO,GAAG,uBAAuB,EAAE,CAAC;IAC1C,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAC/B,KAAK,CAAC;QACJ,KAAK,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACxB,UAAU,EAAE,OAAO,CAAC,MAAM;QAC1B,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,OAAO;QACzC,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,eAAe,EAAE,OAAO,CAAC,eAAe;QACxC,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;QAC5C,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,4BAA4B;QAC5B,wBAAwB,EAAE,OAAO,CAAC,wBAAwB;QAC1D,kBAAkB,EAAE,OAAO,CAAC,kBAAkB,EAAE,+CAA+C;KAChG,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;CACzB;AAAC,OAAO,GAAG,EAAE;IACZ,IAAI,GAAG,YAAY,KAAK,EAAE;QACxB,aAAa,CAAC,GAAG,CAAC,CAAC;KACpB;CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { OutputFormat } from '../output';
|
|
3
|
-
export declare function setupBuildParserProgram():
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { OutputFormat } from '../output.js';
|
|
3
|
+
export declare function setupBuildParserProgram(): Command;
|
|
4
4
|
export declare function inferenceTargetsOption(parsed: {
|
|
5
5
|
output?: string;
|
|
6
6
|
format?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.parser.d.ts","sourceRoot":"","sources":["../../src/commands/build.parser.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"build.parser.d.ts","sourceRoot":"","sources":["../../src/commands/build.parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAG5C,OAAO,EAGL,YAAY,EACb,MAAM,cAAc,CAAC;AAEtB,wBAAgB,uBAAuB,IAAI,OAAO,CAiJjD;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE;IACN,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,EAAE,GACF,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,QAAQ,CAAC,EAAE,CAczC"}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.inferenceTargetsOption = exports.setupBuildParserProgram = void 0;
|
|
7
|
-
const commander_1 = __importDefault(require("commander"));
|
|
8
|
-
const config_1 = require("../config");
|
|
9
|
-
const output_1 = require("../output");
|
|
10
|
-
function setupBuildParserProgram() {
|
|
1
|
+
import { Command, Option } from 'commander';
|
|
2
|
+
import { validateTimeoutFlag } from '../config.js';
|
|
3
|
+
import { checkOutputFormat, detectOutputFormat, } from '../output.js';
|
|
4
|
+
export function setupBuildParserProgram() {
|
|
11
5
|
// Provide an order-sensitive command parser
|
|
12
6
|
// ex: "-o foo -o bar -f baz"
|
|
13
7
|
// → [{output: "foo"}, {output:"bar", format: "baz"}]
|
|
@@ -32,7 +26,7 @@ function setupBuildParserProgram() {
|
|
|
32
26
|
}
|
|
33
27
|
return [...(previous || []), value];
|
|
34
28
|
};
|
|
35
|
-
const program = new
|
|
29
|
+
const program = new Command();
|
|
36
30
|
program
|
|
37
31
|
.name('vivliostyle build')
|
|
38
32
|
.description('build and create PDF file')
|
|
@@ -55,13 +49,13 @@ custom(comma separated): 182mm,257mm or 8.5in,11in`)
|
|
|
55
49
|
.option('-d, --single-doc', 'single HTML document input')
|
|
56
50
|
.option('-p, --press-ready', `make generated PDF compatible with press ready PDF/X-1a [false]
|
|
57
51
|
This option is equivalent with "--preflight press-ready"`)
|
|
58
|
-
.option('-t, --timeout <seconds>', `timeout limit for waiting Vivliostyle process [120]`,
|
|
52
|
+
.option('-t, --timeout <seconds>', `timeout limit for waiting Vivliostyle process [120]`, validateTimeoutFlag)
|
|
59
53
|
.option('-T, --theme <theme>', 'theme path or package name')
|
|
60
54
|
.option('--title <title>', 'title')
|
|
61
55
|
.option('--author <author>', 'author')
|
|
62
56
|
.option('-l, --language <language>', 'language')
|
|
63
|
-
.addOption(new
|
|
64
|
-
.addOption(new
|
|
57
|
+
.addOption(new Option('--render-mode <mode>', 'if docker is set, Vivliostyle try to render PDF on Docker container [local]').choices(['local', 'docker']))
|
|
58
|
+
.addOption(new Option('--preflight <mode>', 'apply the process to generate PDF for printing').choices(['press-ready', 'press-ready-local']))
|
|
65
59
|
.option('--preflight-option <options...>', `options for preflight process (ex: gray-scale, enforce-outline)
|
|
66
60
|
Please refer the document of press-ready for further information.
|
|
67
61
|
https://github.com/vibranthq/press-ready`)
|
|
@@ -81,27 +75,25 @@ It is useful that using own viewer that has staging features. (ex: https://vivli
|
|
|
81
75
|
// Currently, Firefox and Webkit support preview command only!`,
|
|
82
76
|
// ).choices(['chromium', 'firefox', 'webkit']),
|
|
83
77
|
// )
|
|
84
|
-
.addOption(new
|
|
78
|
+
.addOption(new Option('--bypassed-pdf-builder-option <json>').hideHelp())
|
|
85
79
|
// TODO: Remove it in the next major version up
|
|
86
|
-
.addOption(new
|
|
80
|
+
.addOption(new Option('--executable-chromium <path>').hideHelp())
|
|
87
81
|
.action((_arg, option) => {
|
|
88
82
|
option.targets = inferenceTargetsOption(targets);
|
|
89
83
|
});
|
|
90
84
|
return program;
|
|
91
85
|
}
|
|
92
|
-
|
|
93
|
-
function inferenceTargetsOption(parsed) {
|
|
86
|
+
export function inferenceTargetsOption(parsed) {
|
|
94
87
|
return parsed.map(({ output, format }) => {
|
|
95
88
|
if (!output) {
|
|
96
89
|
// -f is an optional option but -o is required one
|
|
97
90
|
throw new Error(`Couldn't find the output option corresponding --format ${format} option. Please check the command options.`);
|
|
98
91
|
}
|
|
99
|
-
const detectedFormat = format
|
|
100
|
-
if (!
|
|
92
|
+
const detectedFormat = format ?? detectOutputFormat(output);
|
|
93
|
+
if (!checkOutputFormat(detectedFormat)) {
|
|
101
94
|
throw new Error(`Unknown format: ${format}`);
|
|
102
95
|
}
|
|
103
96
|
return { path: output, format: detectedFormat };
|
|
104
97
|
});
|
|
105
98
|
}
|
|
106
|
-
exports.inferenceTargetsOption = inferenceTargetsOption;
|
|
107
99
|
//# sourceMappingURL=build.parser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.parser.js","sourceRoot":"","sources":["../../src/commands/build.parser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build.parser.js","sourceRoot":"","sources":["../../src/commands/build.parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EACL,iBAAiB,EACjB,kBAAkB,GAEnB,MAAM,cAAc,CAAC;AAEtB,MAAM,UAAU,uBAAuB;IACrC,4CAA4C;IAC5C,6BAA6B;IAC7B,wDAAwD;IACxD,qCAAqC;IACrC,yEAAyE;IACzE,MAAM,OAAO,GAGP,EAAE,CAAC;IACT,MAAM,qBAAqB,GAAG,CAC5B,KAAa,EACb,QAAmB,EACT,EAAE;QACZ,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE;YACnE,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;SACjC;aAAM;YACL,OAAO,CAAC,OAAO,CAAC,MAA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AAE,EAAE;QAC3C,MAAM,CAAC,OAAO,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAEL,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,MAGG;IAEH,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE;QACvC,IAAI,CAAC,MAAM,EAAE;YACX,kDAAkD;YAClD,MAAM,IAAI,KAAK,CACb,0DAA0D,MAAM,4CAA4C,CAC7G,CAAC;SACH;QACD,MAAM,cAAc,GAAG,MAAM,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAC5D,IAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,EAAE;YACtC,MAAM,IAAI,KAAK,CAAC,mBAAmB,MAAM,EAAE,CAAC,CAAC;SAC9C;QACD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;IAClD,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/commands/init.js
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const util_1 = require("../util");
|
|
5
|
-
const init_parser_1 = require("./init.parser");
|
|
1
|
+
import { init } from '../init.js';
|
|
2
|
+
import { gracefulError } from '../util.js';
|
|
3
|
+
import { setupInitParserProgram } from './init.parser.js';
|
|
6
4
|
try {
|
|
7
|
-
const program =
|
|
5
|
+
const program = setupInitParserProgram();
|
|
8
6
|
program.parse(process.argv);
|
|
9
7
|
const options = program.opts();
|
|
10
|
-
|
|
8
|
+
init({
|
|
11
9
|
title: options.title,
|
|
12
10
|
author: options.author,
|
|
13
11
|
language: options.language,
|
|
14
12
|
size: options.size,
|
|
15
13
|
theme: options.theme,
|
|
16
|
-
}).catch(
|
|
14
|
+
}).catch(gracefulError);
|
|
17
15
|
}
|
|
18
16
|
catch (err) {
|
|
19
17
|
if (err instanceof Error) {
|
|
20
|
-
|
|
18
|
+
gracefulError(err);
|
|
21
19
|
}
|
|
22
20
|
}
|
|
23
21
|
//# sourceMappingURL=init.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,IAAI;IACF,MAAM,OAAO,GAAG,sBAAsB,EAAE,CAAC;IACzC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAC/B,IAAI,CAAC;QACH,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;CACzB;AAAC,OAAO,GAAG,EAAE;IACZ,IAAI,GAAG,YAAY,KAAK,EAAE;QACxB,aAAa,CAAC,GAAG,CAAC,CAAC;KACpB;CACF"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare function setupInitParserProgram():
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
export declare function setupInitParserProgram(): Command;
|
|
3
3
|
//# sourceMappingURL=init.parser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.parser.d.ts","sourceRoot":"","sources":["../../src/commands/init.parser.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"init.parser.d.ts","sourceRoot":"","sources":["../../src/commands/init.parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,wBAAgB,sBAAsB,IAAI,OAAO,CAWhD"}
|