@mermaid-js/mermaid-cli 9.1.3 → 9.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.bundle.js CHANGED
@@ -22,7 +22,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
22
22
  process.title = "mmdc";
23
23
 
24
24
  const error = message => {
25
- console.log(_chalk.default.red(`\n${message}\n`));
25
+ console.error(_chalk.default.red(`\n${message}\n`));
26
26
  process.exit(1);
27
27
  };
28
28
 
@@ -100,11 +100,11 @@ let {
100
100
  } = options; // check input file
101
101
 
102
102
  if (!(input || inputPipedFromStdin())) {
103
- console.log(_chalk.default.red(`\nPlease specify input file: -i <input>\n`));
103
+ console.error(_chalk.default.red(`\nPlease specify input file: -i <input>\n`)); // Log to stderr, and return with error exitCode
104
104
 
105
- _commander.default.help();
106
-
107
- process.exit(1);
105
+ _commander.default.help({
106
+ error: true
107
+ });
108
108
  }
109
109
 
110
110
  if (input && !_fs.default.existsSync(input)) {
@@ -198,7 +198,7 @@ const parseMMD = /*#__PURE__*/function () {
198
198
  }
199
199
 
200
200
  try {
201
- window.mermaid.init(undefined, container);
201
+ window.mermaid.initThrowsErrors(undefined, container);
202
202
  return {
203
203
  status: 'success'
204
204
  };
@@ -229,9 +229,9 @@ const parseMMD = /*#__PURE__*/function () {
229
229
 
230
230
  return container.innerHTML;
231
231
  }, backgroundColor);
232
- const svg_xml = convertToValidXML(svg);
232
+ const svgXML = convertToValidXML(svg);
233
233
 
234
- _fs.default.writeFileSync(output, svg_xml);
234
+ _fs.default.writeFileSync(output, svgXML);
235
235
  } else if (output.endsWith('png')) {
236
236
  const clip = yield page.$eval('svg', svg => {
237
237
  const react = svg.getBoundingClientRect();