@danielx/civet 0.9.2 → 0.9.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/dist/civet CHANGED
@@ -415,7 +415,7 @@ ${" ".repeat(error.column - 1)}^ ${error.header}`);
415
415
  }
416
416
  if (errors.length) {
417
417
  errors = [];
418
- (0, import_main.generate)(ast, { ...options, errors, sourceMap: (0, import_main.SourceMap)(input) });
418
+ (0, import_main.generate)(ast, { ...options, errors, sourceMap: new import_main.SourceMap(input) });
419
419
  showError(errors[0]);
420
420
  return callback(null, void 0);
421
421
  }
package/dist/esm.mjs CHANGED
@@ -20,11 +20,17 @@ async function load(url, context, next) {
20
20
  if (context.format === "civet") {
21
21
  const path = fileURLToPath(url);
22
22
  const source = readFileSync(path, "utf8");
23
- const { code: tsSource, sourceMap } = await compile(source, {
24
- filename: path,
25
- sourceMap: true,
26
- js: true
27
- });
23
+ let tsSource, sourceMap;
24
+ try {
25
+ ({ code: tsSource, sourceMap } = await compile(source, {
26
+ filename: path,
27
+ sourceMap: true,
28
+ js: true
29
+ }));
30
+ } catch (e) {
31
+ console.error(`Civet failed to compile ${url}:`, e);
32
+ throw e;
33
+ }
28
34
  const transpiledUrl = url + ".tsx";
29
35
  const result = await next(transpiledUrl, {
30
36
  // ts-node won't transpile unless this is module