honkit 5.1.0 → 5.1.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.
Files changed (110) hide show
  1. package/lib/api/deprecate.js +2 -2
  2. package/lib/api/encodeConfig.js +1 -1
  3. package/lib/api/encodeNavigation.js +3 -3
  4. package/lib/api/encodePage.js +2 -2
  5. package/lib/api/encodeProgress.js +1 -1
  6. package/lib/api/encodeSummary.js +1 -1
  7. package/lib/api/index.js +1 -1
  8. package/lib/browser.js +1 -1
  9. package/lib/cli/build.js +2 -2
  10. package/lib/cli/buildEbook.js +2 -2
  11. package/lib/cli/init.js +1 -1
  12. package/lib/cli/options.js +5 -5
  13. package/lib/cli/parse.js +1 -1
  14. package/lib/cli/serve.d.ts.map +1 -1
  15. package/lib/cli/serve.js +28 -19
  16. package/lib/cli/server.js +1 -1
  17. package/lib/cli/watch.js +1 -1
  18. package/lib/constants/configSchema.js +50 -50
  19. package/lib/constants/defaultFilters.js +1 -1
  20. package/lib/fs/mock.js +5 -5
  21. package/lib/fs/node.js +1 -1
  22. package/lib/honkit.js +1 -1
  23. package/lib/index.js +1 -1
  24. package/lib/json/encodeBook.js +4 -4
  25. package/lib/json/encodeFile.js +1 -1
  26. package/lib/json/encodeGlossary.js +1 -1
  27. package/lib/json/encodeGlossaryEntry.js +1 -1
  28. package/lib/json/encodeLanguages.js +2 -2
  29. package/lib/json/encodeOutput.js +1 -1
  30. package/lib/json/encodeReadme.js +1 -1
  31. package/lib/json/encodeSummary.js +1 -1
  32. package/lib/json/encodeSummaryArticle.js +1 -1
  33. package/lib/json/encodeSummaryArticleWithCache.js +1 -1
  34. package/lib/json/encodeSummaryPart.js +1 -1
  35. package/lib/json/index.js +1 -1
  36. package/lib/models/book.js +4 -4
  37. package/lib/models/config.js +3 -3
  38. package/lib/models/fs.js +2 -2
  39. package/lib/models/glossaryEntry.js +1 -1
  40. package/lib/models/hash.js +1 -1
  41. package/lib/models/ignore.js +1 -1
  42. package/lib/models/language.js +1 -1
  43. package/lib/models/languages.js +3 -3
  44. package/lib/models/output.js +2 -2
  45. package/lib/models/page.js +4 -4
  46. package/lib/models/plugin.js +3 -3
  47. package/lib/models/pluginDependency.js +6 -6
  48. package/lib/models/readme.js +2 -2
  49. package/lib/models/summary.js +4 -4
  50. package/lib/models/summaryArticle.js +2 -2
  51. package/lib/models/summaryPart.js +2 -2
  52. package/lib/models/templateBlock.js +4 -4
  53. package/lib/models/templateEngine.js +4 -4
  54. package/lib/models/templateOutput.js +2 -2
  55. package/lib/modifiers/config/index.js +1 -1
  56. package/lib/modifiers/index.js +1 -1
  57. package/lib/modifiers/summary/editArticleRef.js +1 -1
  58. package/lib/modifiers/summary/editArticleTitle.js +1 -1
  59. package/lib/modifiers/summary/index.js +1 -1
  60. package/lib/modifiers/summary/indexArticleLevels.js +1 -1
  61. package/lib/modifiers/summary/indexPartLevels.js +1 -1
  62. package/lib/output/createTemplateEngine.js +1 -1
  63. package/lib/output/ebook/getConvertOptions.js +2 -2
  64. package/lib/output/ebook/getPDFTemplate.js +3 -3
  65. package/lib/output/ebook/index.js +1 -1
  66. package/lib/output/ebook/onFinish.js +2 -2
  67. package/lib/output/ebook/options.js +1 -1
  68. package/lib/output/generateBook.js +2 -2
  69. package/lib/output/getModifiers.js +3 -3
  70. package/lib/output/index.js +1 -1
  71. package/lib/output/json/index.js +1 -1
  72. package/lib/output/json/options.js +1 -1
  73. package/lib/output/modifiers/index.js +1 -1
  74. package/lib/output/preparePlugins.js +1 -1
  75. package/lib/output/testing/createMock.js +1 -1
  76. package/lib/output/testing/generateMock.js +2 -2
  77. package/lib/output/website/copyPluginAssets.js +2 -2
  78. package/lib/output/website/createTemplateEngine.js +4 -4
  79. package/lib/output/website/index.js +1 -1
  80. package/lib/output/website/onPage.js +4 -4
  81. package/lib/output/website/options.js +1 -1
  82. package/lib/output/website/prepareResources.js +2 -2
  83. package/lib/output/website/state.js +1 -1
  84. package/lib/parse/index.js +1 -1
  85. package/lib/parse/parseConfig.js +1 -1
  86. package/lib/parse/parseIgnore.js +1 -1
  87. package/lib/parse/parsePageFromString.js +1 -1
  88. package/lib/parse/parseSummary.js +1 -1
  89. package/lib/parse/validateConfig.js +1 -1
  90. package/lib/plugins/PluginResolver.js +1 -1
  91. package/lib/plugins/index.js +1 -1
  92. package/lib/plugins/listResources.js +2 -2
  93. package/lib/plugins/loadForBook.js +1 -1
  94. package/lib/plugins/loadPlugin.js +2 -2
  95. package/lib/plugins/validateConfig.js +1 -1
  96. package/lib/templating/index.js +1 -1
  97. package/lib/templating/render.js +1 -1
  98. package/lib/templating/renderFile.js +1 -1
  99. package/lib/templating/themesLoader.js +2 -2
  100. package/lib/utils/command.js +1 -1
  101. package/lib/utils/error.js +11 -11
  102. package/lib/utils/fs.d.ts.map +1 -1
  103. package/lib/utils/fs.js +1 -0
  104. package/lib/utils/git.js +1 -1
  105. package/lib/utils/images.js +1 -1
  106. package/lib/utils/location.js +1 -1
  107. package/lib/utils/logger.js +2 -2
  108. package/lib/utils/path.js +2 -2
  109. package/lib/utils/timing.js +2 -2
  110. package/package.json +7 -7
@@ -71,7 +71,7 @@ function deprecateField(book, key, instance, property, value, msg) {
71
71
  get: getter,
72
72
  set: setter,
73
73
  enumerable: true,
74
- configurable: true,
74
+ configurable: true
75
75
  });
76
76
  }
77
77
  /**
@@ -109,5 +109,5 @@ exports.default = {
109
109
  renamedMethod: deprecateRenamedMethod,
110
110
  field: deprecateField,
111
111
  enable: enableDeprecation,
112
- disable: disableDeprecation,
112
+ disable: disableDeprecation
113
113
  };
@@ -16,7 +16,7 @@ function encodeConfig(output, config) {
16
16
  },
17
17
  set: function (key, value) {
18
18
  return object_path_1.default.set(result.values, key, value);
19
- },
19
+ }
20
20
  };
21
21
  deprecate_1.default.field(output, "config.options", result, "options", result.values, '"config.options" property is deprecated, use "config.get(key)" instead');
22
22
  deprecate_1.default.field(output, "config.options.generator", result.values, "generator", output.getGenerator(), '"options.generator" property is deprecated, use "output.name" instead');
@@ -15,7 +15,7 @@ function encodeArticle(pages, article) {
15
15
  title: article.getTitle(),
16
16
  level: article.getLevel(),
17
17
  exists: articlePath && pages.has(articlePath),
18
- external: article.isExternal(),
18
+ external: article.isExternal()
19
19
  };
20
20
  }
21
21
  /**
@@ -44,8 +44,8 @@ function encodeNavigation(output) {
44
44
  introduction: i === 0,
45
45
  prev: prev ? encodeArticle(pages, prev) : undefined,
46
46
  next: next ? encodeArticle(pages, next) : undefined,
47
- level: article.getLevel(),
48
- },
47
+ level: article.getLevel()
48
+ }
49
49
  ];
50
50
  })
51
51
  .filter((e) => {
@@ -25,8 +25,8 @@ function encodePage(output, page) {
25
25
  deprecate_1.default.field(output, "page.sections", result, "sections", [
26
26
  {
27
27
  content: result.content,
28
- type: "normal",
29
- },
28
+ type: "normal"
29
+ }
30
30
  ], '"sections" property is deprecated, use page.content instead');
31
31
  return result;
32
32
  }
@@ -47,7 +47,7 @@ function encodeProgress(output, page) {
47
47
  // List of chapter with progress
48
48
  chapters: chapters,
49
49
  // Current chapter
50
- current: currentChapter,
50
+ current: currentChapter
51
51
  };
52
52
  }
53
53
  exports.default = encodeProgress;
@@ -43,7 +43,7 @@ function encodeSummary(output, summary) {
43
43
  getArticleByPath: function (level) {
44
44
  const article = summary.getByPath(level);
45
45
  return article ? (0, encodeSummaryArticle_1.default)(article) : undefined;
46
- },
46
+ }
47
47
  };
48
48
  return result;
49
49
  }
package/lib/api/index.js CHANGED
@@ -11,5 +11,5 @@ exports.default = {
11
11
  encodePage: encodePage_1.default,
12
12
  decodePage: decodePage_1.default,
13
13
  encodeGlobal: encodeGlobal_1.default,
14
- decodeGlobal: decodeGlobal_1.decodeGlobal,
14
+ decodeGlobal: decodeGlobal_1.decodeGlobal
15
15
  };
package/lib/browser.js CHANGED
@@ -37,5 +37,5 @@ exports.default = {
37
37
  IGNORE_FILES: ignoreFiles_1.default,
38
38
  DEFAULT_PLUGINS: defaultPlugins_1.default,
39
39
  EXTENSIONS_MARKDOWN: extsMarkdown_1.default,
40
- EXTENSIONS_ASCIIDOC: extsAsciidoc_1.default,
40
+ EXTENSIONS_ASCIIDOC: extsAsciidoc_1.default
41
41
  };
package/lib/cli/build.js CHANGED
@@ -25,12 +25,12 @@ exports.default = {
25
25
  return parse_1.default.parseBook(book)
26
26
  .then((resultBook) => {
27
27
  return output_1.default.generate(Generator, resultBook, {
28
- root: outputFolder,
28
+ root: outputFolder
29
29
  });
30
30
  })
31
31
  .fin(() => {
32
32
  if (kwargs.timing)
33
33
  timing_1.default.dump(book.getLogger());
34
34
  });
35
- },
35
+ }
36
36
  };
@@ -33,7 +33,7 @@ function default_1(format) {
33
33
  .then((resultBook) => {
34
34
  return output_1.default.generate(Generator, resultBook, {
35
35
  root: outputFolder,
36
- format: format,
36
+ format: format
37
37
  });
38
38
  })
39
39
  // Extract ebook file
@@ -57,7 +57,7 @@ function default_1(format) {
57
57
  logger.debug("cleaning up... ");
58
58
  return logger.debug.promise(fs_1.default.rmDir(outputFolder));
59
59
  }));
60
- },
60
+ }
61
61
  };
62
62
  }
63
63
  exports.default = default_1;
package/lib/cli/init.js CHANGED
@@ -13,5 +13,5 @@ exports.default = {
13
13
  exec: function (args, kwargs) {
14
14
  const bookRoot = path_1.default.resolve(process.cwd(), args[0] || "./");
15
15
  return (0, init_1.default)(bookRoot);
16
- },
16
+ }
17
17
  };
@@ -12,27 +12,27 @@ const logOptions = {
12
12
  return s.toLowerCase();
13
13
  })
14
14
  .toJS(),
15
- defaults: "info",
15
+ defaults: "info"
16
16
  };
17
17
  const formatOption = {
18
18
  name: "format",
19
19
  description: "Format to build to",
20
20
  values: ["website", "json", "ebook"],
21
- defaults: "website",
21
+ defaults: "website"
22
22
  };
23
23
  const timingOption = {
24
24
  name: "timing",
25
25
  description: "Print timing debug information",
26
- defaults: false,
26
+ defaults: false
27
27
  };
28
28
  const reloadOption = {
29
29
  name: "reload",
30
30
  description: "Prune cache. Remove file cache",
31
- defaults: false,
31
+ defaults: false
32
32
  };
33
33
  exports.default = {
34
34
  log: logOptions,
35
35
  format: formatOption,
36
36
  timing: timingOption,
37
- reload: reloadOption,
37
+ reload: reloadOption
38
38
  };
package/lib/cli/parse.js CHANGED
@@ -63,5 +63,5 @@ exports.default = {
63
63
  printBook(resultBook);
64
64
  }
65
65
  });
66
- },
66
+ }
67
67
  };
@@ -1 +1 @@
1
- {"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/cli/serve.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAmIA,wBA6DE"}
1
+ {"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/cli/serve.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA4IA,wBA6DE"}
package/lib/cli/serve.js CHANGED
@@ -16,6 +16,7 @@ const getOutputFolder_1 = __importDefault(require("./getOutputFolder"));
16
16
  const server_1 = __importDefault(require("./server"));
17
17
  const watch_1 = __importDefault(require("./watch"));
18
18
  const page_cache_1 = require("../output/page-cache");
19
+ const fs_1 = __importDefault(require("fs"));
19
20
  let server, lrServer, lrPath;
20
21
  function waitForCtrlC() {
21
22
  const d = promise_1.default.defer();
@@ -34,7 +35,8 @@ function startServer(args, kwargs) {
34
35
  const hasLiveReloading = kwargs["live"];
35
36
  const reload = kwargs["reload"];
36
37
  const Generator = output_1.default.getGenerator(kwargs.format);
37
- console.log("Starting server ...");
38
+ const logger = book.getLogger();
39
+ logger.info.ok("Starting server ...");
38
40
  let lastOutput = null;
39
41
  return promise_1.default.all([
40
42
  server.start(outputFolder, port),
@@ -43,11 +45,11 @@ function startServer(args, kwargs) {
43
45
  outputFolder,
44
46
  hasLiveReloading,
45
47
  Generator,
46
- reload,
48
+ reload
47
49
  }).then((output) => {
48
50
  lastOutput = output;
49
51
  return output;
50
- }),
52
+ })
51
53
  ])
52
54
  .then(() => {
53
55
  console.log(`Serving book on http://localhost:${port}`);
@@ -65,36 +67,43 @@ function startServer(args, kwargs) {
65
67
  console.error(error);
66
68
  return;
67
69
  }
70
+ // If the file does not exist in file system, show a warning and skip
71
+ // Probably, the file has been deleted
72
+ if (!fs_1.default.existsSync(filepath)) {
73
+ logger.warn.ok(`${filepath} does not exist in file system.`);
74
+ return;
75
+ }
68
76
  // set livereload path
69
77
  lrPath = filepath;
70
78
  // TODO: use parse extension
71
79
  // Incremental update for pages
72
80
  if (lastOutput && filepath.endsWith(".md")) {
73
- console.log("Reload after change in file", filepath);
81
+ logger.warn.ok("Rebuild " + filepath);
74
82
  const changedOutput = lastOutput.reloadPage(lastOutput.book.getContentRoot(), filepath).merge({
75
- incrementalChangeFileSet: immutable_1.default.Set([filepath]),
83
+ incrementalChangeFileSet: immutable_1.default.Set([filepath])
76
84
  });
77
85
  return incrementalBuild({
78
86
  output: changedOutput,
79
- Generator,
87
+ Generator
80
88
  }).then(() => {
81
89
  if (lrPath && hasLiveReloading) {
82
90
  // trigger livereload
83
91
  lrServer.changed({
84
92
  body: {
85
- files: [lrPath],
86
- },
93
+ files: [lrPath]
94
+ }
87
95
  });
88
96
  }
89
97
  });
90
98
  }
91
- console.log("Rebuild after change in file", filepath);
99
+ // Asciidoc files are not supported for incremental build
100
+ logger.info.ok("Rebuild " + filepath);
92
101
  return generateBook({
93
102
  book,
94
103
  outputFolder,
95
104
  hasLiveReloading,
96
105
  Generator,
97
- reload,
106
+ reload
98
107
  }).then((output) => {
99
108
  lastOutput = output;
100
109
  });
@@ -116,7 +125,7 @@ function generateBook({ book, outputFolder, hasLiveReloading, Generator, reload
116
125
  resultBook = resultBook.set("config", config);
117
126
  }
118
127
  return output_1.default.generate(Generator, resultBook, {
119
- root: outputFolder,
128
+ root: outputFolder
120
129
  });
121
130
  });
122
131
  }
@@ -130,36 +139,36 @@ exports.default = {
130
139
  {
131
140
  name: "port",
132
141
  description: "Port for server to listen on",
133
- defaults: 4000,
142
+ defaults: 4000
134
143
  },
135
144
  {
136
145
  name: "lrport",
137
146
  description: "Port for livereload server to listen on",
138
- defaults: 35729,
147
+ defaults: 35729
139
148
  },
140
149
  {
141
150
  name: "watch",
142
151
  description: "Enable file watcher and live reloading",
143
- defaults: true,
152
+ defaults: true
144
153
  },
145
154
  {
146
155
  name: "live",
147
156
  description: "Enable live reloading",
148
- defaults: true,
157
+ defaults: true
149
158
  },
150
159
  {
151
160
  name: "open",
152
161
  description: "Enable opening book in browser",
153
- defaults: false,
162
+ defaults: false
154
163
  },
155
164
  {
156
165
  name: "browser",
157
166
  description: "Specify browser for opening book",
158
- defaults: "",
167
+ defaults: ""
159
168
  },
160
169
  options_1.default.log,
161
170
  options_1.default.format,
162
- options_1.default.reload,
171
+ options_1.default.reload
163
172
  ],
164
173
  exec: function (args, kwargs) {
165
174
  server = new server_1.default();
@@ -180,5 +189,5 @@ exports.default = {
180
189
  .then(() => {
181
190
  return startServer(args, kwargs);
182
191
  });
183
- },
192
+ }
184
193
  };
package/lib/cli/server.js CHANGED
@@ -79,7 +79,7 @@ class Server extends events_1.default.EventEmitter {
79
79
  res.setHeader("X-Current-Location", req.url);
80
80
  // Send file
81
81
  (0, send_1.default)(req, url_1.default.parse(req.url).pathname, {
82
- root: dir,
82
+ root: dir
83
83
  })
84
84
  .on("error", error)
85
85
  .on("directory", redirect)
package/lib/cli/watch.js CHANGED
@@ -25,7 +25,7 @@ function watch(dir, callback) {
25
25
  // prevent infinity loop
26
26
  // https://github.com/honkit/honkit/issues/269
27
27
  ignored: ["_book/**", "node_modules/**"],
28
- ignoreInitial: true,
28
+ ignoreInitial: true
29
29
  });
30
30
  watcher.on("all", (e, filepath) => {
31
31
  callback(null, path_1.default.resolve(dir, filepath));
@@ -9,74 +9,74 @@ exports.default = {
9
9
  properties: {
10
10
  root: {
11
11
  type: "string",
12
- title: "Path fro the root folder containing the book's content",
12
+ title: "Path fro the root folder containing the book's content"
13
13
  },
14
14
  title: {
15
15
  type: "string",
16
- title: "Title of the book, default is extracted from README",
16
+ title: "Title of the book, default is extracted from README"
17
17
  },
18
18
  author: {
19
19
  type: "string",
20
- title: "Name of the author",
20
+ title: "Name of the author"
21
21
  },
22
22
  authorSort: {
23
23
  type: "string",
24
- title: "String to be used to sort the author(s)",
24
+ title: "String to be used to sort the author(s)"
25
25
  },
26
26
  producer: {
27
27
  type: "string",
28
- title: "Name of the producer",
28
+ title: "Name of the producer"
29
29
  },
30
30
  publisher: {
31
31
  type: "string",
32
- title: "Name of the publisher",
32
+ title: "Name of the publisher"
33
33
  },
34
34
  pubdate: {
35
35
  type: "string",
36
- title: "Publication date of the book",
36
+ title: "Publication date of the book"
37
37
  },
38
38
  series: {
39
39
  type: "string",
40
- title: "Series this book belongs to",
40
+ title: "Series this book belongs to"
41
41
  },
42
42
  seriesIndex: {
43
43
  type: "string",
44
- title: "Index of the book in this series",
44
+ title: "Index of the book in this series"
45
45
  },
46
46
  isbn: {
47
47
  type: "string",
48
- title: "ISBN for published book",
48
+ title: "ISBN for published book"
49
49
  },
50
50
  language: {
51
51
  type: "string",
52
- title: "Language of the book",
52
+ title: "Language of the book"
53
53
  },
54
54
  gitbook: {
55
55
  type: "string",
56
56
  default: "*",
57
- title: "GitBook/HonKit version to match",
57
+ title: "GitBook/HonKit version to match"
58
58
  },
59
59
  direction: {
60
60
  type: "string",
61
61
  enum: ["ltr", "rtl"],
62
- title: "Direction of texts, default is detected in the pages",
62
+ title: "Direction of texts, default is detected in the pages"
63
63
  },
64
64
  theme: {
65
65
  type: "string",
66
66
  default: "default",
67
- title: "Name of the theme plugin to use",
67
+ title: "Name of the theme plugin to use"
68
68
  },
69
69
  variables: {
70
70
  type: "object",
71
- title: "Templating context variables",
71
+ title: "Templating context variables"
72
72
  },
73
73
  plugins: {
74
74
  oneOf: [{ $ref: "#/definitions/pluginsArray" }, { $ref: "#/definitions/pluginsString" }],
75
- default: [],
75
+ default: []
76
76
  },
77
77
  pluginsConfig: {
78
78
  type: "object",
79
- title: "Configuration for plugins",
79
+ title: "Configuration for plugins"
80
80
  },
81
81
  structure: {
82
82
  type: "object",
@@ -85,28 +85,28 @@ exports.default = {
85
85
  default: "LANGS.md",
86
86
  type: "string",
87
87
  title: "File to use as languages index",
88
- pattern: FILENAME_REGEX,
88
+ pattern: FILENAME_REGEX
89
89
  },
90
90
  readme: {
91
91
  default: "README.md",
92
92
  type: "string",
93
93
  title: "File to use as preface",
94
- pattern: FILENAME_REGEX,
94
+ pattern: FILENAME_REGEX
95
95
  },
96
96
  glossary: {
97
97
  default: "GLOSSARY.md",
98
98
  type: "string",
99
99
  title: "File to use as glossary index",
100
- pattern: FILENAME_REGEX,
100
+ pattern: FILENAME_REGEX
101
101
  },
102
102
  summary: {
103
103
  default: "SUMMARY.md",
104
104
  type: "string",
105
105
  title: "File to use as table of contents",
106
- pattern: FILENAME_REGEX,
107
- },
106
+ pattern: FILENAME_REGEX
107
+ }
108
108
  },
109
- additionalProperties: false,
109
+ additionalProperties: false
110
110
  },
111
111
  pdf: {
112
112
  type: "object",
@@ -115,19 +115,19 @@ exports.default = {
115
115
  pageNumbers: {
116
116
  type: "boolean",
117
117
  default: true,
118
- title: "Add page numbers to the bottom of every page",
118
+ title: "Add page numbers to the bottom of every page"
119
119
  },
120
120
  fontSize: {
121
121
  type: "integer",
122
122
  minimum: 8,
123
123
  maximum: 30,
124
124
  default: 12,
125
- title: "Font size for the PDF output",
125
+ title: "Font size for the PDF output"
126
126
  },
127
127
  fontFamily: {
128
128
  type: "string",
129
129
  default: "Arial",
130
- title: "Font family for the PDF output",
130
+ title: "Font family for the PDF output"
131
131
  },
132
132
  paperSize: {
133
133
  type: "string",
@@ -147,21 +147,21 @@ exports.default = {
147
147
  "b5",
148
148
  "b6",
149
149
  "legal",
150
- "letter",
150
+ "letter"
151
151
  ],
152
152
  default: "a4",
153
- title: "Paper size for the PDF",
153
+ title: "Paper size for the PDF"
154
154
  },
155
155
  chapterMark: {
156
156
  type: "string",
157
157
  enum: ["pagebreak", "rule", "both", "none"],
158
158
  default: "pagebreak",
159
- title: "How to mark detected chapters",
159
+ title: "How to mark detected chapters"
160
160
  },
161
161
  pageBreaksBefore: {
162
162
  type: "string",
163
163
  default: "/",
164
- title: 'An XPath expression. Page breaks are inserted before the specified elements. To disable use the expression: "/"',
164
+ title: 'An XPath expression. Page breaks are inserted before the specified elements. To disable use the expression: "/"'
165
165
  },
166
166
  margin: {
167
167
  type: "object",
@@ -171,65 +171,65 @@ exports.default = {
171
171
  title: "Right Margin",
172
172
  minimum: 0,
173
173
  maximum: 100,
174
- default: 62,
174
+ default: 62
175
175
  },
176
176
  left: {
177
177
  type: "integer",
178
178
  title: "Left Margin",
179
179
  minimum: 0,
180
180
  maximum: 100,
181
- default: 62,
181
+ default: 62
182
182
  },
183
183
  top: {
184
184
  type: "integer",
185
185
  title: "Top Margin",
186
186
  minimum: 0,
187
187
  maximum: 100,
188
- default: 56,
188
+ default: 56
189
189
  },
190
190
  bottom: {
191
191
  type: "integer",
192
192
  title: "Bottom Margin",
193
193
  minimum: 0,
194
194
  maximum: 100,
195
- default: 56,
196
- },
197
- },
195
+ default: 56
196
+ }
197
+ }
198
198
  },
199
199
  embedFonts: {
200
200
  type: "boolean",
201
201
  default: false,
202
- title: "Embed all fonts into the PDF",
203
- },
204
- },
205
- },
202
+ title: "Embed all fonts into the PDF"
203
+ }
204
+ }
205
+ }
206
206
  },
207
207
  required: [],
208
208
  definitions: {
209
209
  pluginsArray: {
210
210
  type: "array",
211
211
  items: {
212
- oneOf: [{ $ref: "#/definitions/pluginObject" }, { $ref: "#/definitions/pluginString" }],
213
- },
212
+ oneOf: [{ $ref: "#/definitions/pluginObject" }, { $ref: "#/definitions/pluginString" }]
213
+ }
214
214
  },
215
215
  pluginsString: {
216
- type: "string",
216
+ type: "string"
217
217
  },
218
218
  pluginString: {
219
- type: "string",
219
+ type: "string"
220
220
  },
221
221
  pluginObject: {
222
222
  type: "object",
223
223
  properties: {
224
224
  name: {
225
- type: "string",
225
+ type: "string"
226
226
  },
227
227
  version: {
228
- type: "string",
229
- },
228
+ type: "string"
229
+ }
230
230
  },
231
231
  additionalProperties: false,
232
- required: ["name"],
233
- },
234
- },
232
+ required: ["name"]
233
+ }
234
+ }
235
235
  };
@@ -14,5 +14,5 @@ exports.default = immutable_1.default.Map({
14
14
  // Relative Time
15
15
  dateFromNow: function (time) {
16
16
  return (0, moment_1.default)(time).fromNow();
17
- },
17
+ }
18
18
  });
package/lib/fs/mock.js CHANGED
@@ -45,7 +45,7 @@ function createMockFS(files) {
45
45
  const file = getFile(filePath);
46
46
  if (!is_1.default.string(file)) {
47
47
  throw error_1.default.FileNotFoundError({
48
- filename: filePath,
48
+ filename: filePath
49
49
  });
50
50
  }
51
51
  return buffer_1.Buffer.from(file, "utf8");
@@ -54,18 +54,18 @@ function createMockFS(files) {
54
54
  const file = getFile(filePath);
55
55
  if (!file) {
56
56
  throw error_1.default.FileNotFoundError({
57
- filename: filePath,
57
+ filename: filePath
58
58
  });
59
59
  }
60
60
  return {
61
- mtime: mtime,
61
+ mtime: mtime
62
62
  };
63
63
  }
64
64
  function fsReadDir(filePath) {
65
65
  const dir = getFile(filePath);
66
66
  if (!dir || is_1.default.string(dir)) {
67
67
  throw error_1.default.FileNotFoundError({
68
- filename: filePath,
68
+ filename: filePath
69
69
  });
70
70
  }
71
71
  return dir
@@ -82,7 +82,7 @@ function createMockFS(files) {
82
82
  fsExists: fsExists,
83
83
  fsReadFile: fsReadFile,
84
84
  fsStatFile: fsStatFile,
85
- fsReadDir: fsReadDir,
85
+ fsReadDir: fsReadDir
86
86
  });
87
87
  }
88
88
  exports.default = createMockFS;
package/lib/fs/node.js CHANGED
@@ -38,7 +38,7 @@ function createNodeFS(root) {
38
38
  fsStatFile: fs_1.default.stat,
39
39
  fsReadDir: fsReadDir,
40
40
  fsLoadObject: fsLoadObject,
41
- fsReadAsStream: fs_1.default.readStream,
41
+ fsReadAsStream: fs_1.default.readStream
42
42
  });
43
43
  }
44
44
  exports.default = createNodeFS;