@danielx/civet 0.10.6 → 0.11.0

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
@@ -133,12 +133,7 @@ async function parseArgs(args, isTTY = process.stdin.isTTY) {
133
133
  options.parseOptions ??= {},
134
134
  (0, import_main.parse)(`civet ${args[++i]}`, {
135
135
  startRule: "CivetPrologueContent",
136
- filename: "--civet argument",
137
- events: {
138
- // remove cache in case we've compiled Civet before
139
- enter: void 0,
140
- exit: void 0
141
- }
136
+ filename: "--civet argument"
142
137
  }).config
143
138
  );
144
139
  break;
@@ -284,7 +279,7 @@ async function* readFiles(filenames, evalString) {
284
279
  })()).join("");
285
280
  }
286
281
  } else {
287
- content = await import_promises.default.readFile(filename, { encoding });
282
+ content = await import_promises.default.readFile(filename);
288
283
  }
289
284
  yield { filename, content, stdin };
290
285
  } catch (error) {
@@ -664,6 +659,9 @@ You can override this behavior via: --civet rewriteCivetImports=.ext
664
659
  }
665
660
  return process.exit(code ?? 1);
666
661
  });
662
+ for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) {
663
+ process.on(signal, () => child.kill(signal));
664
+ }
667
665
  } else {
668
666
  await import("../register.js");
669
667
  try {
package/dist/config.js CHANGED
@@ -101,7 +101,7 @@ async function findConfig(startDir) {
101
101
  return;
102
102
  }
103
103
  async function loadConfig(pathname) {
104
- const config = await import_promises.default.readFile(pathname, "utf8");
104
+ const config = (0, import_main.decode)(await import_promises.default.readFile(pathname));
105
105
  let data = {};
106
106
  if (pathname.endsWith(".json")) {
107
107
  let json;
package/dist/config.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\config.civet.jsx
2
2
  import path from "path";
3
3
  import fs from "fs/promises";
4
- import { compile } from "./main.mjs";
4
+ import { decode, compile } from "./main.mjs";
5
5
  var configNames = [
6
6
  "\u{1F408}",
7
7
  "civetconfig",
@@ -65,7 +65,7 @@ async function findConfig(startDir) {
65
65
  return;
66
66
  }
67
67
  async function loadConfig(pathname) {
68
- const config = await fs.readFile(pathname, "utf8");
68
+ const config = decode(await fs.readFile(pathname));
69
69
  let data = {};
70
70
  if (pathname.endsWith(".json")) {
71
71
  let json;
@@ -87,7 +87,7 @@ var civet = function(options = {}) {
87
87
  });
88
88
  return build.onLoad({ filter }, async function(args) {
89
89
  try {
90
- const source = await (0, import_promises.readFile)(args.path, "utf8");
90
+ const source = await (0, import_promises.readFile)(args.path);
91
91
  const filename = import_path.default.relative(process.cwd(), args.path);
92
92
  const compiled = await (0, import_main.compile)(source, {
93
93
  filename,
package/dist/esm.mjs CHANGED
@@ -24,7 +24,7 @@ function resolve(specifier, context, next) {
24
24
  async function load(url, context, next) {
25
25
  if (context.format === "civet") {
26
26
  const path = fileURLToPath(url);
27
- const source = await readFile(path, "utf8");
27
+ const source = await readFile(path);
28
28
  let loadedConfig;
29
29
  let { config } = globalOptions;
30
30
  if (config === void 0) {