@danielx/civet 0.11.4 → 0.11.6

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/civet CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict"
3
3
  try { require('node:module').enableCompileCache() } catch {}
4
+ "use strict";
4
5
  var __create = Object.create;
5
6
  var __defProp = Object.defineProperty;
6
7
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -29,16 +30,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
30
  ));
30
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
32
 
32
- // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\cli.civet.jsx
33
- var cli_civet_exports = {};
34
- __export(cli_civet_exports, {
33
+ // source/cli.civet
34
+ var cli_exports = {};
35
+ __export(cli_exports, {
35
36
  cli: () => cli,
36
37
  makeOutputFilename: () => makeOutputFilename,
37
38
  parseArgs: () => parseArgs,
38
39
  repl: () => repl,
39
40
  version: () => version
40
41
  });
41
- module.exports = __toCommonJS(cli_civet_exports);
42
+ module.exports = __toCommonJS(cli_exports);
42
43
  var import_main = require("./main.js");
43
44
  var import_config = require("./config.js");
44
45
  var import_unplugin = require("./unplugin/unplugin.js");
@@ -302,7 +303,7 @@ function makeOutputFilename(filename, options) {
302
303
  ;
303
304
  return;
304
305
  })(ref1), ref1);
305
- return import_node_path.default.format(outputPath);
306
+ return import_node_path.default.normalize(import_node_path.default.format(outputPath));
306
307
  }
307
308
  async function repl(args, options) {
308
309
  const vm = await import("node:vm");
@@ -390,7 +391,7 @@ async function repl(args, options) {
390
391
  } else if (input in ["quit\n", "exit\n", "quit()\n", "exit()\n"]) {
391
392
  return process.exit(0);
392
393
  } else if (input.endsWith("\n\n")) {
393
- let showError = function(error) {
394
+ let showError2 = function(error) {
394
395
  console.error("Error while parsing Civet code:");
395
396
  if ((0, import_main.isCompileError)(error)) {
396
397
  if (error.errors != null) {
@@ -402,12 +403,13 @@ ${" ".repeat(error.column - 1)}^ ${error.header}`);
402
403
  return console.error(error);
403
404
  }
404
405
  };
406
+ var showError = showError2;
405
407
  let output;
406
408
  if (options.compile || options.ast) {
407
409
  try {
408
410
  output = await (0, import_main.compile)(input, { ...options, filename });
409
411
  } catch (error) {
410
- showError(error);
412
+ showError2(error);
411
413
  return callback(null, void 0);
412
414
  }
413
415
  return callback(null, output);
@@ -420,7 +422,7 @@ ${" ".repeat(error.column - 1)}^ ${error.header}`);
420
422
  try {
421
423
  ast = await (0, import_main.compile)(input, { ...options, parseOptions, filename, ast: true });
422
424
  } catch (error) {
423
- showError(error);
425
+ showError2(error);
424
426
  return callback(null, void 0);
425
427
  }
426
428
  let errors = [];
@@ -432,8 +434,8 @@ ${" ".repeat(error.column - 1)}^ ${error.header}`);
432
434
  }
433
435
  if (errors.length) {
434
436
  errors = [];
435
- (0, import_main.generate)(ast, { ...options, errors, sourceMap: new import_main.SourceMap(input) });
436
- showError(errors[0]);
437
+ (0, import_main.generate)(ast, { ...options, errors, sourceMap: new import_main.SourceMap(input, filename) });
438
+ showError2(errors[0]);
437
439
  return callback(null, void 0);
438
440
  }
439
441
  let result;