@danielx/civet 0.7.4 → 0.7.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/astro.js CHANGED
@@ -166,9 +166,9 @@ var rawPlugin = (options = {}, meta) => {
166
166
  const compiledTS = import_civet.default.compile(rawCivetSource, {
167
167
  filename,
168
168
  js: false,
169
- parseOptions: {
170
- comptime: Boolean(options.comptime)
171
- }
169
+ comptime: Boolean(options.comptime),
170
+ sync: true
171
+ // TS readFile API seems to need to be synchronous
172
172
  });
173
173
  fsMap.set(filename, compiledTS);
174
174
  return compiledTS;
@@ -321,12 +321,12 @@ var rawPlugin = (options = {}, meta) => {
321
321
  }
322
322
  };
323
323
  if (options.ts === "civet" && !transformTS) {
324
- compiled = import_civet.default.compile(rawCivetSource, {
324
+ compiled = await import_civet.default.compile(rawCivetSource, {
325
325
  ...civetOptions,
326
326
  js: true
327
327
  });
328
328
  } else {
329
- const compiledTS = import_civet.default.compile(rawCivetSource, {
329
+ const compiledTS = await import_civet.default.compile(rawCivetSource, {
330
330
  ...civetOptions,
331
331
  js: false
332
332
  });
@@ -372,7 +372,7 @@ var rawPlugin = (options = {}, meta) => {
372
372
  }
373
373
  case "civet":
374
374
  default: {
375
- compiled = import_civet.default.compile(rawCivetSource, {
375
+ compiled = await import_civet.default.compile(rawCivetSource, {
376
376
  ...civetOptions,
377
377
  js: true
378
378
  });
@@ -20,10 +20,12 @@ export default function (api, civetOptions) {
20
20
  parserOverride(code, opts, parse) {
21
21
  let src
22
22
  if (opts.sourceFileName.endsWith(".civet")) {
23
- const config = Object.assign({}, civetOptions, {
23
+ const config = {
24
+ ...civetOptions,
24
25
  filename: opts.sourceFileName,
25
26
  sourceMap: false,
26
- })
27
+ sync: true, // parserOverride API is synchronous
28
+ }
27
29
 
28
30
  config.inlineMap ??= true
29
31
  config.js = true