@danielx/civet 0.10.2 → 0.10.3

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/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ This changelog is generated automatically by [`build/changelog.civet`](build/cha
4
4
  For each version of Civet, it lists and links to all incorporated PRs,
5
5
  as well as a full diff and commit list.
6
6
 
7
+ ## 0.10.3 (2025-04-28, [diff](https://github.com/DanielXMoore/Civet/compare/v0.10.2...v0.10.3), [commits](https://github.com/DanielXMoore/Civet/commits/v0.10.3))
8
+ * Explicit changelog build script shell [[#1727](https://github.com/DanielXMoore/Civet/pull/1727)]
9
+ * ESM loader supports civetconfig by default, and overriding configuration [[#1734](https://github.com/DanielXMoore/Civet/pull/1734)]
10
+ * BREAKING CHANGE: If you don't use civetconfig files and want to be robust against their existence in ancestor directories, or want to maximize performance, use `@danielx/civet/register-noconfig` instead of `@danielx/civet/register`
11
+ * BREAKING CHANGE: In unplugin settings, `config: undefined` no longer disables searching for config files. Use `config: false` or `config: null` instead.
12
+
7
13
  ## 0.10.2 (2025-04-13, [diff](https://github.com/DanielXMoore/Civet/compare/v0.10.1...v0.10.2), [commits](https://github.com/DanielXMoore/Civet/commits/v0.10.2))
8
14
  * Fix unplugin source map directories [[#1726](https://github.com/DanielXMoore/Civet/pull/1726)]
9
15
 
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // unplugin-civet:/home/daniel/apps/Civet/source/babel-plugin.civet.jsx
19
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\babel-plugin.civet.jsx
20
20
  var babel_plugin_civet_exports = {};
21
21
  __export(babel_plugin_civet_exports, {
22
22
  default: () => babel_plugin_civet_default
@@ -1,4 +1,4 @@
1
- // unplugin-civet:/home/daniel/apps/Civet/source/babel-plugin.civet.jsx
1
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\babel-plugin.civet.jsx
2
2
  import { compile } from "./main.mjs";
3
3
  function babel_plugin_civet_default(api, civetOptions) {
4
4
  return {
package/dist/browser.js CHANGED
@@ -400,7 +400,7 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
400
400
  }
401
401
  });
402
402
 
403
- // unplugin-civet:/home/daniel/apps/Civet/source/browser.civet.jsx
403
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\browser.civet.jsx
404
404
  var browser_civet_exports = {};
405
405
  __export(browser_civet_exports, {
406
406
  ParseError: () => import_lib2.ParseError,
@@ -422,7 +422,7 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
422
422
  // source/parser.hera
423
423
  var import_lib2 = __toESM(require_machine());
424
424
 
425
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/lib.civet.jsx
425
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\lib.civet.jsx
426
426
  var lib_civet_exports = {};
427
427
  __export(lib_civet_exports, {
428
428
  addPostfixStatement: () => addPostfixStatement,
@@ -502,7 +502,7 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
502
502
  wrapTypeInPromise: () => wrapTypeInPromise
503
503
  });
504
504
 
505
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/util.civet.jsx
505
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\util.civet.jsx
506
506
  function len(arr, length) {
507
507
  return arr.length === length;
508
508
  }
@@ -1236,7 +1236,7 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
1236
1236
  return result;
1237
1237
  }
1238
1238
 
1239
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/traversal.civet.jsx
1239
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\traversal.civet.jsx
1240
1240
  function gatherRecursiveWithinFunction(node, predicate) {
1241
1241
  return gatherRecursive(node, predicate, isFunction);
1242
1242
  }
@@ -1310,7 +1310,7 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
1310
1310
  return predicate(node) && nodes.push(node), nodes;
1311
1311
  }
1312
1312
 
1313
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/ref.civet.jsx
1313
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\ref.civet.jsx
1314
1314
  var range = (start, end) => {
1315
1315
  let length = end - start;
1316
1316
  if (length <= 0) return [];
@@ -1386,7 +1386,7 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
1386
1386
  }
1387
1387
  }
1388
1388
 
1389
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/binding.civet.jsx
1389
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\binding.civet.jsx
1390
1390
  function adjustAtBindings(statements, asThis = !1) {
1391
1391
  for (let ref1 = gatherRecursiveAll(statements, ($1) => $1.type === "AtBindingProperty"), i1 = 0, len3 = ref1.length; i1 < len3; i1++) {
1392
1392
  let binding = ref1[i1], { ref } = binding;
@@ -1584,12 +1584,12 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
1584
1584
  return pattern;
1585
1585
  }
1586
1586
 
1587
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/comptime.civet.jsx
1587
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\comptime.civet.jsx
1588
1588
  init_browser_shim();
1589
1589
  init_browser_shim();
1590
1590
  init_browser_shim();
1591
1591
 
1592
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/helper.civet.jsx
1592
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\helper.civet.jsx
1593
1593
  var preludeVar = "var ";
1594
1594
  function ts(children) {
1595
1595
  return {
@@ -1925,7 +1925,7 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
1925
1925
  }
1926
1926
  }
1927
1927
 
1928
- // unplugin-civet:/home/daniel/apps/Civet/source/generate.civet.jsx
1928
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\generate.civet.jsx
1929
1929
  function stringify(node) {
1930
1930
  try {
1931
1931
  return JSON.stringify(removeParentPointers(node));
@@ -1993,7 +1993,7 @@ ${body}`), super(message), this.header = header, this.body = body, this.filename
1993
1993
  }
1994
1994
  }
1995
1995
 
1996
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/comptime.civet.jsx
1996
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\comptime.civet.jsx
1997
1997
  function expressionizeComptime(statement) {
1998
1998
  let { expressions } = statement.block, expression = wrapIIFE(expressions, hasAwait(expressions));
1999
1999
  return makeNode({
@@ -2227,7 +2227,7 @@ ${js}`
2227
2227
  return recurse(value);
2228
2228
  }
2229
2229
 
2230
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/function.civet.jsx
2230
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\function.civet.jsx
2231
2231
  var concatAssign = (lhs, rhs) => (rhs?.[Symbol.isConcatSpreadable] ?? Array.isArray(rhs) ? lhs.push.apply(lhs, rhs) : lhs.push(rhs), lhs);
2232
2232
  function getTypeArguments(args) {
2233
2233
  for (; typeof args == "object" && args != null && "args" in args; )
@@ -3256,7 +3256,7 @@ ${js}`
3256
3256
  ).length > 1 && (fn.ampersandBlock = !1), fn;
3257
3257
  }
3258
3258
 
3259
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/block.civet.jsx
3259
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\block.civet.jsx
3260
3260
  function blockWithPrefix(prefixStatements, block) {
3261
3261
  if (prefixStatements && prefixStatements.length) {
3262
3262
  let expressions = [...prefixStatements, ...block.expressions];
@@ -3406,7 +3406,7 @@ ${js}`
3406
3406
  };
3407
3407
  }
3408
3408
 
3409
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/op.civet.jsx
3409
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\op.civet.jsx
3410
3410
  var precedenceOrder = [
3411
3411
  ["||", "??"],
3412
3412
  ["^^"],
@@ -3600,7 +3600,7 @@ ${js}`
3600
3600
  }
3601
3601
  }
3602
3602
 
3603
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/pattern-matching.civet.jsx
3603
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\pattern-matching.civet.jsx
3604
3604
  function processPatternTest(lhs, patterns) {
3605
3605
  let { ref, refAssignmentComma } = maybeRefAssignment(lhs, "m"), conditionExpression = flatJoin(patterns.map(($1) => getPatternConditions($1, ref)).map(($2) => flatJoin($2, " && ")), " || ");
3606
3606
  return makeLeftHandSideExpression(makeNode({
@@ -4004,7 +4004,7 @@ ${js}`
4004
4004
  }
4005
4005
  }
4006
4006
 
4007
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/declaration.civet.jsx
4007
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\declaration.civet.jsx
4008
4008
  function len2(arr, length) {
4009
4009
  return arr.length === length;
4010
4010
  }
@@ -4413,7 +4413,7 @@ ${js}`
4413
4413
  return [extendsToken, insertTrimmingSpace(ws, " "), wrapped];
4414
4414
  }
4415
4415
 
4416
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/unary.civet.jsx
4416
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\unary.civet.jsx
4417
4417
  function processUnaryExpression(pre, exp, post) {
4418
4418
  if (!(pre.length || post))
4419
4419
  return exp;
@@ -4524,7 +4524,7 @@ ${js}`
4524
4524
  return processUnaryExpression(pre, args, post);
4525
4525
  }
4526
4526
 
4527
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/pipe.civet.jsx
4527
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\pipe.civet.jsx
4528
4528
  function constructInvocation(fn, arg) {
4529
4529
  let expr = fn.expr;
4530
4530
  for (; expr.type === "ParenthesizedExpression"; )
@@ -4685,7 +4685,7 @@ ${js}`
4685
4685
  }
4686
4686
  }
4687
4687
 
4688
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/for.civet.jsx
4688
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\for.civet.jsx
4689
4689
  function processRangeExpression(start, ws1, range2, end) {
4690
4690
  ws1 = [ws1, range2.children[0]];
4691
4691
  let ws2 = range2.children[1], comma = { $loc: range2.$loc, token: "," }, ref;
@@ -5008,7 +5008,7 @@ ${js}`
5008
5008
  };
5009
5009
  }
5010
5010
 
5011
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/auto-dec.civet.jsx
5011
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\auto-dec.civet.jsx
5012
5012
  var concatAssign2 = (lhs, rhs) => (rhs?.[Symbol.isConcatSpreadable] ?? Array.isArray(rhs) ? lhs.push.apply(lhs, rhs) : lhs.push(rhs), lhs);
5013
5013
  function findDecs(statements) {
5014
5014
  let declarationNames = gatherNodes(statements, ($) => $.type === "Declaration").flatMap((d) => d.names), globals = getConfig().globals || [];
@@ -5090,7 +5090,7 @@ ${js}`
5090
5090
  scopes.pop();
5091
5091
  }
5092
5092
 
5093
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/string.civet.jsx
5093
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\string.civet.jsx
5094
5094
  function getIndentLevel(str, tab) {
5095
5095
  if (tab != null && tab != 1) {
5096
5096
  let tabs = str.match(/\t/g), numTabs = tabs ? tabs.length : 0;
@@ -5200,7 +5200,7 @@ ${js}`
5200
5200
  return JSON.stringify(str);
5201
5201
  }
5202
5202
 
5203
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/lib.civet.jsx
5203
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\lib.civet.jsx
5204
5204
  var xor = (a, b) => a ? !b && a : b;
5205
5205
  function addPostfixStatement(statement, ws, post) {
5206
5206
  let expressions = [
@@ -16102,7 +16102,7 @@ ${js}`
16102
16102
  "unscopables"
16103
16103
  ];
16104
16104
 
16105
- // unplugin-civet:/home/daniel/apps/Civet/source/sourcemap.civet.jsx
16105
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\sourcemap.civet.jsx
16106
16106
  var sourcemap_civet_exports = {};
16107
16107
  __export(sourcemap_civet_exports, {
16108
16108
  SourceMap: () => SourceMap,
@@ -16271,7 +16271,7 @@ ${js}`
16271
16271
  return [lastMapping[2], lastMapping[3]];
16272
16272
  };
16273
16273
 
16274
- // unplugin-civet:/home/daniel/apps/Civet/source/state-cache.civet.jsx
16274
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\state-cache.civet.jsx
16275
16275
  var StateCache = class {
16276
16276
  cache = /* @__PURE__ */ new Map();
16277
16277
  get(key) {
@@ -16294,7 +16294,7 @@ ${js}`
16294
16294
  }
16295
16295
  };
16296
16296
 
16297
- // unplugin-civet:/home/daniel/apps/Civet/source/main.civet.jsx
16297
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\main.civet.jsx
16298
16298
  var { SourceMap: SourceMap2 } = sourcemap_civet_exports;
16299
16299
  var ParseErrors = class extends Error {
16300
16300
  name = "ParseErrors";
@@ -16444,7 +16444,7 @@ ${counts}`;
16444
16444
  return err instanceof import_lib2.ParseError || err instanceof ParseErrors;
16445
16445
  };
16446
16446
 
16447
- // unplugin-civet:/home/daniel/apps/Civet/source/browser.civet.jsx
16447
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\browser.civet.jsx
16448
16448
  async function runScripts(type = "text/civet") {
16449
16449
  let scripts = window.document.querySelectorAll(`script[type=${JSON.stringify(type)}]`);
16450
16450
  for (let i1 = 0, len3 = scripts.length; i1 < len3; i1++) {
package/dist/civet CHANGED
@@ -29,7 +29,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
29
  ));
30
30
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
31
 
32
- // unplugin-civet:/home/daniel/apps/Civet/source/cli.civet.jsx
32
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\cli.civet.jsx
33
33
  var cli_civet_exports = {};
34
34
  __export(cli_civet_exports, {
35
35
  cli: () => cli,
@@ -503,8 +503,8 @@ You can override this behavior via: --civet rewriteCivetImports=.ext
503
503
  `);
504
504
  process.exit(0);
505
505
  }
506
- if (options.config !== false) {
507
- options.config ??= await (0, import_config.findConfig)(process.cwd());
506
+ if (options.config === void 0) {
507
+ options.config = await (0, import_config.findConfig)(process.cwd());
508
508
  }
509
509
  if (options.config) {
510
510
  const parsed = await (0, import_config.loadConfig)(options.config);
package/dist/config.js CHANGED
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  ));
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
28
 
29
- // unplugin-civet:/home/daniel/apps/Civet/source/config.civet.jsx
29
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\config.civet.jsx
30
30
  var config_civet_exports = {};
31
31
  __export(config_civet_exports, {
32
32
  default: () => config_civet_default,
package/dist/config.mjs CHANGED
@@ -1,4 +1,4 @@
1
- // unplugin-civet:/home/daniel/apps/Civet/source/config.civet.jsx
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
4
  import { compile } from "./main.mjs";
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  ));
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
28
 
29
- // unplugin-civet:/home/daniel/apps/Civet/source/esbuild-plugin.civet.jsx
29
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\esbuild-plugin.civet.jsx
30
30
  var esbuild_plugin_civet_exports = {};
31
31
  __export(esbuild_plugin_civet_exports, {
32
32
  default: () => esbuild_plugin_civet_default
package/dist/esm.mjs CHANGED
@@ -1,10 +1,15 @@
1
- // unplugin-civet:/home/daniel/apps/Civet/source/esm.civet.jsx
2
- import { readFileSync } from "fs";
1
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\esm.civet.jsx
2
+ import { readFile } from "fs/promises";
3
+ import { dirname } from "path";
3
4
  import { pathToFileURL, fileURLToPath } from "url";
4
- import Civet from "./main.mjs";
5
- var { compile, SourceMap } = Civet;
5
+ import { compile, SourceMap } from "./main.mjs";
6
+ import { findConfig, loadConfig } from "./config.mjs";
6
7
  var baseURL = pathToFileURL(process.cwd() + "/").href;
7
8
  var extensionsRegex = /\.civet$/;
9
+ var globalOptions = {};
10
+ function initialize(options = {}) {
11
+ return globalOptions = options;
12
+ }
8
13
  function resolve(specifier, context, next) {
9
14
  const { parentURL = baseURL } = context;
10
15
  if (extensionsRegex.test(specifier)) {
@@ -19,14 +24,29 @@ function resolve(specifier, context, next) {
19
24
  async function load(url, context, next) {
20
25
  if (context.format === "civet") {
21
26
  const path = fileURLToPath(url);
22
- const source = readFileSync(path, "utf8");
27
+ const source = await readFile(path, "utf8");
28
+ let loadedConfig;
29
+ let { config } = globalOptions;
30
+ if (config === void 0) {
31
+ config = await findConfig(dirname(path));
32
+ }
33
+ if (config) {
34
+ loadedConfig = await loadConfig(config);
35
+ }
36
+ const options = {
37
+ filename: path,
38
+ sourceMap: true,
39
+ js: true
40
+ };
41
+ if (globalOptions.parseOptions) {
42
+ options.parseOptions = globalOptions.parseOptions;
43
+ }
44
+ if (loadedConfig?.parseOptions) {
45
+ options.parseOptions = { ...options.parseOptions, ...loadedConfig.parseOptions };
46
+ }
23
47
  let tsSource, sourceMap;
24
48
  try {
25
- ({ code: tsSource, sourceMap } = await compile(source, {
26
- filename: path,
27
- sourceMap: true,
28
- js: true
29
- }));
49
+ ({ code: tsSource, sourceMap } = await compile(source, options));
30
50
  } catch (e) {
31
51
  console.error(`Civet failed to compile ${url}:`, e);
32
52
  throw e;
@@ -46,6 +66,7 @@ async function load(url, context, next) {
46
66
  return next(url, context);
47
67
  }
48
68
  export {
69
+ initialize,
49
70
  load,
50
71
  resolve
51
72
  };
package/dist/main.js CHANGED
@@ -483,7 +483,7 @@ ${body}`;
483
483
  }
484
484
  });
485
485
 
486
- // unplugin-civet:/home/daniel/apps/Civet/source/main.civet.jsx
486
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\main.civet.jsx
487
487
  var main_civet_exports = {};
488
488
  __export(main_civet_exports, {
489
489
  ParseError: () => import_lib2.ParseError,
@@ -504,7 +504,7 @@ module.exports = __toCommonJS(main_civet_exports);
504
504
  // source/parser.hera
505
505
  var import_lib2 = __toESM(require_machine());
506
506
 
507
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/lib.civet.jsx
507
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\lib.civet.jsx
508
508
  var lib_civet_exports = {};
509
509
  __export(lib_civet_exports, {
510
510
  addPostfixStatement: () => addPostfixStatement,
@@ -584,7 +584,7 @@ __export(lib_civet_exports, {
584
584
  wrapTypeInPromise: () => wrapTypeInPromise
585
585
  });
586
586
 
587
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/util.civet.jsx
587
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\util.civet.jsx
588
588
  function len(arr, length) {
589
589
  return arr.length === length;
590
590
  }
@@ -1583,7 +1583,7 @@ function flatJoin(array, separator) {
1583
1583
  return result;
1584
1584
  }
1585
1585
 
1586
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/traversal.civet.jsx
1586
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\traversal.civet.jsx
1587
1587
  function gatherRecursiveWithinFunction(node, predicate) {
1588
1588
  return gatherRecursive(node, predicate, isFunction);
1589
1589
  }
@@ -1692,7 +1692,7 @@ function gatherRecursiveAll(node, predicate) {
1692
1692
  return nodes;
1693
1693
  }
1694
1694
 
1695
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/ref.civet.jsx
1695
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\ref.civet.jsx
1696
1696
  var range = (start, end) => {
1697
1697
  const length = end - start;
1698
1698
  if (length <= 0) return [];
@@ -1787,7 +1787,7 @@ function populateRefs(statements) {
1787
1787
  }
1788
1788
  }
1789
1789
 
1790
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/binding.civet.jsx
1790
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\binding.civet.jsx
1791
1791
  function adjustAtBindings(statements, asThis = false) {
1792
1792
  for (let ref1 = gatherRecursiveAll(statements, ($1) => $1.type === "AtBindingProperty"), i1 = 0, len3 = ref1.length; i1 < len3; i1++) {
1793
1793
  const binding = ref1[i1];
@@ -2054,12 +2054,12 @@ function gatherBindingPatternTypeSuffix(pattern) {
2054
2054
  return pattern;
2055
2055
  }
2056
2056
 
2057
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/comptime.civet.jsx
2057
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\comptime.civet.jsx
2058
2058
  var import_node_path = require("node:path");
2059
2059
  var import_node_module = require("node:module");
2060
2060
  var import_node_vm = __toESM(require("node:vm"));
2061
2061
 
2062
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/helper.civet.jsx
2062
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\helper.civet.jsx
2063
2063
  var preludeVar = "var ";
2064
2064
  function ts(children) {
2065
2065
  return {
@@ -2376,7 +2376,7 @@ function extractPreludeFor(node) {
2376
2376
  }
2377
2377
  }
2378
2378
 
2379
- // unplugin-civet:/home/daniel/apps/Civet/source/generate.civet.jsx
2379
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\generate.civet.jsx
2380
2380
  function stringify(node) {
2381
2381
  try {
2382
2382
  return JSON.stringify(removeParentPointers(node));
@@ -2486,7 +2486,7 @@ function prune(node) {
2486
2486
  return node;
2487
2487
  }
2488
2488
 
2489
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/comptime.civet.jsx
2489
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\comptime.civet.jsx
2490
2490
  function expressionizeComptime(statement) {
2491
2491
  const { expressions } = statement.block;
2492
2492
  const expression = wrapIIFE(expressions, hasAwait(expressions));
@@ -2807,7 +2807,7 @@ function serialize(value, context) {
2807
2807
  return recurse(value);
2808
2808
  }
2809
2809
 
2810
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/function.civet.jsx
2810
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\function.civet.jsx
2811
2811
  var concatAssign = (lhs, rhs) => (rhs?.[Symbol.isConcatSpreadable] ?? Array.isArray(rhs) ? lhs.push.apply(lhs, rhs) : lhs.push(rhs), lhs);
2812
2812
  function getTypeArguments(args) {
2813
2813
  while (typeof args === "object" && args != null && "args" in args) {
@@ -4240,7 +4240,7 @@ function makeAmpersandFunction(rhs) {
4240
4240
  return fn;
4241
4241
  }
4242
4242
 
4243
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/block.civet.jsx
4243
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\block.civet.jsx
4244
4244
  function blockWithPrefix(prefixStatements, block) {
4245
4245
  if (prefixStatements && prefixStatements.length) {
4246
4246
  const expressions = [...prefixStatements, ...block.expressions];
@@ -4461,7 +4461,7 @@ function blockContainingStatement(exp) {
4461
4461
  };
4462
4462
  }
4463
4463
 
4464
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/op.civet.jsx
4464
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\op.civet.jsx
4465
4465
  var precedenceOrder = [
4466
4466
  ["||", "??"],
4467
4467
  ["^^"],
@@ -4797,7 +4797,7 @@ function expandChainedComparisons([first, binops]) {
4797
4797
  }
4798
4798
  }
4799
4799
 
4800
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/pattern-matching.civet.jsx
4800
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\pattern-matching.civet.jsx
4801
4801
  function processPatternTest(lhs, patterns) {
4802
4802
  const { ref, refAssignmentComma } = maybeRefAssignment(lhs, "m");
4803
4803
  const conditionExpression = flatJoin(patterns.map(($1) => getPatternConditions($1, ref)).map(($2) => flatJoin($2, " && ")), " || ");
@@ -5316,7 +5316,7 @@ function aliasBinding(p, ref) {
5316
5316
  }
5317
5317
  }
5318
5318
 
5319
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/declaration.civet.jsx
5319
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\declaration.civet.jsx
5320
5320
  function len2(arr, length) {
5321
5321
  return arr.length === length;
5322
5322
  }
@@ -5870,7 +5870,7 @@ function convertWithClause(withClause, extendsClause) {
5870
5870
  return [extendsToken, insertTrimmingSpace(ws, " "), wrapped];
5871
5871
  }
5872
5872
 
5873
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/unary.civet.jsx
5873
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\unary.civet.jsx
5874
5874
  function processUnaryExpression(pre, exp, post) {
5875
5875
  if (!(pre.length || post)) {
5876
5876
  return exp;
@@ -6032,7 +6032,7 @@ function processUnaryNestedExpression(pre, args, post) {
6032
6032
  return processUnaryExpression(pre, args, post);
6033
6033
  }
6034
6034
 
6035
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/pipe.civet.jsx
6035
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\pipe.civet.jsx
6036
6036
  function constructInvocation(fn, arg) {
6037
6037
  let expr = fn.expr;
6038
6038
  while (expr.type === "ParenthesizedExpression") {
@@ -6255,7 +6255,7 @@ function processPipelineExpressions(statements) {
6255
6255
  }
6256
6256
  }
6257
6257
 
6258
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/for.civet.jsx
6258
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\for.civet.jsx
6259
6259
  function processRangeExpression(start, ws1, range2, end) {
6260
6260
  ws1 = [ws1, range2.children[0]];
6261
6261
  const ws2 = range2.children[1];
@@ -6700,7 +6700,7 @@ function processForInOf($0) {
6700
6700
  };
6701
6701
  }
6702
6702
 
6703
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/auto-dec.civet.jsx
6703
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\auto-dec.civet.jsx
6704
6704
  var concatAssign2 = (lhs, rhs) => (rhs?.[Symbol.isConcatSpreadable] ?? Array.isArray(rhs) ? lhs.push.apply(lhs, rhs) : lhs.push(rhs), lhs);
6705
6705
  function findDecs(statements) {
6706
6706
  const declarations = gatherNodes(statements, ($) => $.type === "Declaration");
@@ -6846,7 +6846,7 @@ function createVarDecs(block, scopes, pushVar) {
6846
6846
  scopes.pop();
6847
6847
  }
6848
6848
 
6849
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/string.civet.jsx
6849
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\string.civet.jsx
6850
6850
  function getIndentLevel(str, tab) {
6851
6851
  if (tab != null && tab != 1) {
6852
6852
  const tabs = str.match(/\t/g);
@@ -7014,7 +7014,7 @@ function quoteString(str) {
7014
7014
  return JSON.stringify(str);
7015
7015
  }
7016
7016
 
7017
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/lib.civet.jsx
7017
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\lib.civet.jsx
7018
7018
  var xor = (a, b) => a ? !b && a : b;
7019
7019
  function addPostfixStatement(statement, ws, post) {
7020
7020
  const expressions = [
@@ -21168,7 +21168,7 @@ var wellKnownSymbols = [
21168
21168
  "unscopables"
21169
21169
  ];
21170
21170
 
21171
- // unplugin-civet:/home/daniel/apps/Civet/source/sourcemap.civet.jsx
21171
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\sourcemap.civet.jsx
21172
21172
  var sourcemap_civet_exports = {};
21173
21173
  __export(sourcemap_civet_exports, {
21174
21174
  SourceMap: () => SourceMap,
@@ -21482,7 +21482,7 @@ var remapPosition = function(position, sourcemapLines) {
21482
21482
  }
21483
21483
  };
21484
21484
 
21485
- // unplugin-civet:/home/daniel/apps/Civet/source/state-cache.civet.jsx
21485
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\state-cache.civet.jsx
21486
21486
  var StateCache = class {
21487
21487
  cache = /* @__PURE__ */ new Map();
21488
21488
  get(key) {
@@ -21522,7 +21522,7 @@ var StateCache = class {
21522
21522
  }
21523
21523
  };
21524
21524
 
21525
- // unplugin-civet:/home/daniel/apps/Civet/source/worker-pool.civet.jsx
21525
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\worker-pool.civet.jsx
21526
21526
  var WorkerPool = class {
21527
21527
  idle;
21528
21528
  spawned;
@@ -21618,7 +21618,7 @@ var WorkerPool = class {
21618
21618
  }
21619
21619
  };
21620
21620
 
21621
- // unplugin-civet:/home/daniel/apps/Civet/source/main.civet.jsx
21621
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\main.civet.jsx
21622
21622
  var { SourceMap: SourceMap2 } = sourcemap_civet_exports;
21623
21623
  var ParseErrors = class extends Error {
21624
21624
  name = "ParseErrors";
package/dist/main.mjs CHANGED
@@ -485,7 +485,7 @@ ${body}`;
485
485
  // source/parser.hera
486
486
  var import_lib2 = __toESM(require_machine());
487
487
 
488
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/lib.civet.jsx
488
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\lib.civet.jsx
489
489
  var lib_civet_exports = {};
490
490
  __export(lib_civet_exports, {
491
491
  addPostfixStatement: () => addPostfixStatement,
@@ -565,7 +565,7 @@ __export(lib_civet_exports, {
565
565
  wrapTypeInPromise: () => wrapTypeInPromise
566
566
  });
567
567
 
568
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/util.civet.jsx
568
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\util.civet.jsx
569
569
  function len(arr, length) {
570
570
  return arr.length === length;
571
571
  }
@@ -1564,7 +1564,7 @@ function flatJoin(array, separator) {
1564
1564
  return result;
1565
1565
  }
1566
1566
 
1567
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/traversal.civet.jsx
1567
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\traversal.civet.jsx
1568
1568
  function gatherRecursiveWithinFunction(node, predicate) {
1569
1569
  return gatherRecursive(node, predicate, isFunction);
1570
1570
  }
@@ -1673,7 +1673,7 @@ function gatherRecursiveAll(node, predicate) {
1673
1673
  return nodes;
1674
1674
  }
1675
1675
 
1676
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/ref.civet.jsx
1676
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\ref.civet.jsx
1677
1677
  var range = (start, end) => {
1678
1678
  const length = end - start;
1679
1679
  if (length <= 0) return [];
@@ -1768,7 +1768,7 @@ function populateRefs(statements) {
1768
1768
  }
1769
1769
  }
1770
1770
 
1771
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/binding.civet.jsx
1771
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\binding.civet.jsx
1772
1772
  function adjustAtBindings(statements, asThis = false) {
1773
1773
  for (let ref1 = gatherRecursiveAll(statements, ($1) => $1.type === "AtBindingProperty"), i1 = 0, len3 = ref1.length; i1 < len3; i1++) {
1774
1774
  const binding = ref1[i1];
@@ -2035,12 +2035,12 @@ function gatherBindingPatternTypeSuffix(pattern) {
2035
2035
  return pattern;
2036
2036
  }
2037
2037
 
2038
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/comptime.civet.jsx
2038
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\comptime.civet.jsx
2039
2039
  import { resolve, dirname } from "node:path";
2040
2040
  import { createRequire } from "node:module";
2041
2041
  import vm from "node:vm";
2042
2042
 
2043
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/helper.civet.jsx
2043
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\helper.civet.jsx
2044
2044
  var preludeVar = "var ";
2045
2045
  function ts(children) {
2046
2046
  return {
@@ -2357,7 +2357,7 @@ function extractPreludeFor(node) {
2357
2357
  }
2358
2358
  }
2359
2359
 
2360
- // unplugin-civet:/home/daniel/apps/Civet/source/generate.civet.jsx
2360
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\generate.civet.jsx
2361
2361
  function stringify(node) {
2362
2362
  try {
2363
2363
  return JSON.stringify(removeParentPointers(node));
@@ -2467,7 +2467,7 @@ function prune(node) {
2467
2467
  return node;
2468
2468
  }
2469
2469
 
2470
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/comptime.civet.jsx
2470
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\comptime.civet.jsx
2471
2471
  function expressionizeComptime(statement) {
2472
2472
  const { expressions } = statement.block;
2473
2473
  const expression = wrapIIFE(expressions, hasAwait(expressions));
@@ -2788,7 +2788,7 @@ function serialize(value, context) {
2788
2788
  return recurse(value);
2789
2789
  }
2790
2790
 
2791
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/function.civet.jsx
2791
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\function.civet.jsx
2792
2792
  var concatAssign = (lhs, rhs) => (rhs?.[Symbol.isConcatSpreadable] ?? Array.isArray(rhs) ? lhs.push.apply(lhs, rhs) : lhs.push(rhs), lhs);
2793
2793
  function getTypeArguments(args) {
2794
2794
  while (typeof args === "object" && args != null && "args" in args) {
@@ -4221,7 +4221,7 @@ function makeAmpersandFunction(rhs) {
4221
4221
  return fn;
4222
4222
  }
4223
4223
 
4224
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/block.civet.jsx
4224
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\block.civet.jsx
4225
4225
  function blockWithPrefix(prefixStatements, block) {
4226
4226
  if (prefixStatements && prefixStatements.length) {
4227
4227
  const expressions = [...prefixStatements, ...block.expressions];
@@ -4442,7 +4442,7 @@ function blockContainingStatement(exp) {
4442
4442
  };
4443
4443
  }
4444
4444
 
4445
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/op.civet.jsx
4445
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\op.civet.jsx
4446
4446
  var precedenceOrder = [
4447
4447
  ["||", "??"],
4448
4448
  ["^^"],
@@ -4778,7 +4778,7 @@ function expandChainedComparisons([first, binops]) {
4778
4778
  }
4779
4779
  }
4780
4780
 
4781
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/pattern-matching.civet.jsx
4781
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\pattern-matching.civet.jsx
4782
4782
  function processPatternTest(lhs, patterns) {
4783
4783
  const { ref, refAssignmentComma } = maybeRefAssignment(lhs, "m");
4784
4784
  const conditionExpression = flatJoin(patterns.map(($1) => getPatternConditions($1, ref)).map(($2) => flatJoin($2, " && ")), " || ");
@@ -5297,7 +5297,7 @@ function aliasBinding(p, ref) {
5297
5297
  }
5298
5298
  }
5299
5299
 
5300
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/declaration.civet.jsx
5300
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\declaration.civet.jsx
5301
5301
  function len2(arr, length) {
5302
5302
  return arr.length === length;
5303
5303
  }
@@ -5851,7 +5851,7 @@ function convertWithClause(withClause, extendsClause) {
5851
5851
  return [extendsToken, insertTrimmingSpace(ws, " "), wrapped];
5852
5852
  }
5853
5853
 
5854
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/unary.civet.jsx
5854
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\unary.civet.jsx
5855
5855
  function processUnaryExpression(pre, exp, post) {
5856
5856
  if (!(pre.length || post)) {
5857
5857
  return exp;
@@ -6013,7 +6013,7 @@ function processUnaryNestedExpression(pre, args, post) {
6013
6013
  return processUnaryExpression(pre, args, post);
6014
6014
  }
6015
6015
 
6016
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/pipe.civet.jsx
6016
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\pipe.civet.jsx
6017
6017
  function constructInvocation(fn, arg) {
6018
6018
  let expr = fn.expr;
6019
6019
  while (expr.type === "ParenthesizedExpression") {
@@ -6236,7 +6236,7 @@ function processPipelineExpressions(statements) {
6236
6236
  }
6237
6237
  }
6238
6238
 
6239
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/for.civet.jsx
6239
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\for.civet.jsx
6240
6240
  function processRangeExpression(start, ws1, range2, end) {
6241
6241
  ws1 = [ws1, range2.children[0]];
6242
6242
  const ws2 = range2.children[1];
@@ -6681,7 +6681,7 @@ function processForInOf($0) {
6681
6681
  };
6682
6682
  }
6683
6683
 
6684
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/auto-dec.civet.jsx
6684
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\auto-dec.civet.jsx
6685
6685
  var concatAssign2 = (lhs, rhs) => (rhs?.[Symbol.isConcatSpreadable] ?? Array.isArray(rhs) ? lhs.push.apply(lhs, rhs) : lhs.push(rhs), lhs);
6686
6686
  function findDecs(statements) {
6687
6687
  const declarations = gatherNodes(statements, ($) => $.type === "Declaration");
@@ -6827,7 +6827,7 @@ function createVarDecs(block, scopes, pushVar) {
6827
6827
  scopes.pop();
6828
6828
  }
6829
6829
 
6830
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/string.civet.jsx
6830
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\string.civet.jsx
6831
6831
  function getIndentLevel(str, tab) {
6832
6832
  if (tab != null && tab != 1) {
6833
6833
  const tabs = str.match(/\t/g);
@@ -6995,7 +6995,7 @@ function quoteString(str) {
6995
6995
  return JSON.stringify(str);
6996
6996
  }
6997
6997
 
6998
- // unplugin-civet:/home/daniel/apps/Civet/source/parser/lib.civet.jsx
6998
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\lib.civet.jsx
6999
6999
  var xor = (a, b) => a ? !b && a : b;
7000
7000
  function addPostfixStatement(statement, ws, post) {
7001
7001
  const expressions = [
@@ -21149,7 +21149,7 @@ var wellKnownSymbols = [
21149
21149
  "unscopables"
21150
21150
  ];
21151
21151
 
21152
- // unplugin-civet:/home/daniel/apps/Civet/source/sourcemap.civet.jsx
21152
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\sourcemap.civet.jsx
21153
21153
  var sourcemap_civet_exports = {};
21154
21154
  __export(sourcemap_civet_exports, {
21155
21155
  SourceMap: () => SourceMap,
@@ -21463,7 +21463,7 @@ var remapPosition = function(position, sourcemapLines) {
21463
21463
  }
21464
21464
  };
21465
21465
 
21466
- // unplugin-civet:/home/daniel/apps/Civet/source/state-cache.civet.jsx
21466
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\state-cache.civet.jsx
21467
21467
  var StateCache = class {
21468
21468
  cache = /* @__PURE__ */ new Map();
21469
21469
  get(key) {
@@ -21503,7 +21503,7 @@ var StateCache = class {
21503
21503
  }
21504
21504
  };
21505
21505
 
21506
- // unplugin-civet:/home/daniel/apps/Civet/source/worker-pool.civet.jsx
21506
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\worker-pool.civet.jsx
21507
21507
  var WorkerPool = class {
21508
21508
  idle;
21509
21509
  spawned;
@@ -21605,7 +21605,7 @@ var WorkerPool = class {
21605
21605
  }
21606
21606
  };
21607
21607
 
21608
- // unplugin-civet:/home/daniel/apps/Civet/source/main.civet.jsx
21608
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\main.civet.jsx
21609
21609
  var { SourceMap: SourceMap2 } = sourcemap_civet_exports;
21610
21610
  var ParseErrors = class extends Error {
21611
21611
  name = "ParseErrors";
@@ -1,4 +1,4 @@
1
- // unplugin-civet:/home/daniel/apps/Civet/source/node-worker.civet.jsx
1
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\node-worker.civet.jsx
2
2
  import { parentPort } from "node:worker_threads";
3
3
  import module from "node:module";
4
4
  try {
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  ));
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
28
 
29
- // unplugin-civet:/home/daniel/apps/Civet/source/unplugin/astro.civet.jsx
29
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\astro.civet.jsx
30
30
  var astro_civet_exports = {};
31
31
  __export(astro_civet_exports, {
32
32
  default: () => astro_civet_default
@@ -1,4 +1,4 @@
1
- // unplugin-civet:/home/daniel/apps/Civet/source/unplugin/astro.civet.jsx
1
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\astro.civet.jsx
2
2
  import civetUnplugin, {} from "./unplugin.mjs";
3
3
  var astro_civet_default = function(opts = {}) {
4
4
  return {
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  ));
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
28
 
29
- // unplugin-civet:/home/daniel/apps/Civet/source/unplugin/esbuild.civet.jsx
29
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\esbuild.civet.jsx
30
30
  var esbuild_civet_exports = {};
31
31
  __export(esbuild_civet_exports, {
32
32
  default: () => esbuild_civet_default
@@ -1,4 +1,4 @@
1
- // unplugin-civet:/home/daniel/apps/Civet/source/unplugin/esbuild.civet.jsx
1
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\esbuild.civet.jsx
2
2
  import civetUnplugin from "./unplugin.mjs";
3
3
  var esbuild_civet_default = civetUnplugin.esbuild;
4
4
  export {
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  ));
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
28
 
29
- // unplugin-civet:/home/daniel/apps/Civet/source/unplugin/farm.civet.jsx
29
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\farm.civet.jsx
30
30
  var farm_civet_exports = {};
31
31
  __export(farm_civet_exports, {
32
32
  default: () => farm_civet_default
@@ -1,4 +1,4 @@
1
- // unplugin-civet:/home/daniel/apps/Civet/source/unplugin/farm.civet.jsx
1
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\farm.civet.jsx
2
2
  import civetUnplugin from "./unplugin.mjs";
3
3
  var farm_civet_default = civetUnplugin.farm;
4
4
  export {
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  ));
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
28
 
29
- // unplugin-civet:/home/daniel/apps/Civet/source/unplugin/rolldown.civet.jsx
29
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\rolldown.civet.jsx
30
30
  var rolldown_civet_exports = {};
31
31
  __export(rolldown_civet_exports, {
32
32
  default: () => rolldown_civet_default
@@ -1,4 +1,4 @@
1
- // unplugin-civet:/home/daniel/apps/Civet/source/unplugin/rolldown.civet.jsx
1
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\rolldown.civet.jsx
2
2
  import civetUnplugin from "./unplugin.mjs";
3
3
  var rolldown_civet_default = civetUnplugin.rolldown;
4
4
  export {
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  ));
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
28
 
29
- // unplugin-civet:/home/daniel/apps/Civet/source/unplugin/rollup.civet.jsx
29
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\rollup.civet.jsx
30
30
  var rollup_civet_exports = {};
31
31
  __export(rollup_civet_exports, {
32
32
  default: () => rollup_civet_default
@@ -1,4 +1,4 @@
1
- // unplugin-civet:/home/daniel/apps/Civet/source/unplugin/rollup.civet.jsx
1
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\rollup.civet.jsx
2
2
  import civetUnplugin from "./unplugin.mjs";
3
3
  var rollup_civet_default = civetUnplugin.rollup;
4
4
  export {
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  ));
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
28
 
29
- // unplugin-civet:/home/daniel/apps/Civet/source/unplugin/rspack.civet.jsx
29
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\rspack.civet.jsx
30
30
  var rspack_civet_exports = {};
31
31
  __export(rspack_civet_exports, {
32
32
  default: () => rspack_civet_default
@@ -1,4 +1,4 @@
1
- // unplugin-civet:/home/daniel/apps/Civet/source/unplugin/rspack.civet.jsx
1
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\rspack.civet.jsx
2
2
  import civetUnplugin from "./unplugin.mjs";
3
3
  var rspack_civet_default = civetUnplugin.rspack;
4
4
  export {
@@ -16,8 +16,8 @@ export type PluginOptions = {
16
16
  threads?: number;
17
17
  /** Cache compilation results based on file mtime (useful for serve or watch mode) */
18
18
  cache?: boolean;
19
- /** config filename, or null to not look for default config file */
20
- config?: (string | undefined) | null;
19
+ /** config filename, or false/null to not look for default config file */
20
+ config?: string | false | null;
21
21
  parseOptions?: ParseOptions;
22
22
  };
23
23
  export declare function slash(p: string): string;
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  ));
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
28
 
29
- // unplugin-civet:/home/daniel/apps/Civet/source/unplugin/unplugin.civet.jsx
29
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\unplugin.civet.jsx
30
30
  var unplugin_civet_exports = {};
31
31
  __export(unplugin_civet_exports, {
32
32
  default: () => unplugin_civet_default,
@@ -46,7 +46,7 @@ var import_os = __toESM(require("os"));
46
46
  // source/unplugin/constants.mjs
47
47
  var DEFAULT_EXTENSIONS = [".mjs", ".js", ".mts", ".ts", ".jsx", ".tsx", ".json"];
48
48
 
49
- // unplugin-civet:/home/daniel/apps/Civet/source/unplugin/unplugin.civet.jsx
49
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\unplugin.civet.jsx
50
50
  var DiagnosticCategory = {};
51
51
  DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning";
52
52
  DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error";
@@ -145,7 +145,10 @@ var rawPlugin = (options = {}, meta) => {
145
145
  name: "unplugin-civet",
146
146
  enforce: "pre",
147
147
  async buildStart() {
148
- const civetConfigPath = "config" in options ? options.config : await (0, import_config.findInDir)(process.cwd());
148
+ let civetConfigPath = options.config;
149
+ if (civetConfigPath === void 0) {
150
+ civetConfigPath = await (0, import_config.findInDir)(process.cwd());
151
+ }
149
152
  if (civetConfigPath) {
150
153
  compileOptions = await (0, import_config.loadConfig)(civetConfigPath);
151
154
  }
@@ -1,4 +1,4 @@
1
- // unplugin-civet:/home/daniel/apps/Civet/source/unplugin/unplugin.civet.jsx
1
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\unplugin.civet.jsx
2
2
  import { createUnplugin } from "unplugin";
3
3
  import civet, { lib, SourceMap } from "@danielx/civet";
4
4
  import { findInDir, loadConfig } from "@danielx/civet/config";
@@ -14,7 +14,7 @@ import os from "os";
14
14
  // source/unplugin/constants.mjs
15
15
  var DEFAULT_EXTENSIONS = [".mjs", ".js", ".mts", ".ts", ".jsx", ".tsx", ".json"];
16
16
 
17
- // unplugin-civet:/home/daniel/apps/Civet/source/unplugin/unplugin.civet.jsx
17
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\unplugin.civet.jsx
18
18
  var DiagnosticCategory = {};
19
19
  DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning";
20
20
  DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error";
@@ -113,7 +113,10 @@ var rawPlugin = (options = {}, meta) => {
113
113
  name: "unplugin-civet",
114
114
  enforce: "pre",
115
115
  async buildStart() {
116
- const civetConfigPath = "config" in options ? options.config : await findInDir(process.cwd());
116
+ let civetConfigPath = options.config;
117
+ if (civetConfigPath === void 0) {
118
+ civetConfigPath = await findInDir(process.cwd());
119
+ }
117
120
  if (civetConfigPath) {
118
121
  compileOptions = await loadConfig(civetConfigPath);
119
122
  }
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  ));
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
28
 
29
- // unplugin-civet:/home/daniel/apps/Civet/source/unplugin/vite.civet.jsx
29
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\vite.civet.jsx
30
30
  var vite_civet_exports = {};
31
31
  __export(vite_civet_exports, {
32
32
  default: () => vite_civet_default
@@ -1,4 +1,4 @@
1
- // unplugin-civet:/home/daniel/apps/Civet/source/unplugin/vite.civet.jsx
1
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\vite.civet.jsx
2
2
  import civetUnplugin from "./unplugin.mjs";
3
3
  var vite_civet_default = civetUnplugin.vite;
4
4
  export {
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  ));
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
28
 
29
- // unplugin-civet:/home/daniel/apps/Civet/source/unplugin/webpack.civet.jsx
29
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\webpack.civet.jsx
30
30
  var webpack_civet_exports = {};
31
31
  __export(webpack_civet_exports, {
32
32
  default: () => webpack_civet_default
@@ -1,4 +1,4 @@
1
- // unplugin-civet:/home/daniel/apps/Civet/source/unplugin/webpack.civet.jsx
1
+ // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\webpack.civet.jsx
2
2
  import civetUnplugin from "./unplugin.mjs";
3
3
  var webpack_civet_default = civetUnplugin.webpack;
4
4
  export {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@danielx/civet",
3
3
  "type": "commonjs",
4
- "version": "0.10.2",
4
+ "version": "0.10.3",
5
5
  "description": "CoffeeScript style syntax for TypeScript",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/main.mjs",
@@ -23,6 +23,7 @@
23
23
  "./esm": "./dist/esm.mjs",
24
24
  "./esbuild-plugin": "./dist/esbuild-plugin.js",
25
25
  "./register": "./register.js",
26
+ "./register-noconfig": "./register-noconfig.js",
26
27
  "./config": {
27
28
  "types": "./dist/config.d.ts",
28
29
  "require": "./dist/config.js",
@@ -107,7 +108,7 @@
107
108
  "dependencies": {
108
109
  "@cspotcode/source-map-support": "^0.8.1",
109
110
  "@typescript/vfs": "^1.6.0",
110
- "unplugin": "^2.2.1"
111
+ "unplugin": "^2.3.2"
111
112
  },
112
113
  "devDependencies": {
113
114
  "@danielx/civet": "0.9.4",
package/register.js CHANGED
@@ -9,6 +9,14 @@ for both ESM `import`s and CJS `require`s.
9
9
  node --import @danielx/civet/register source.civet
10
10
  ```
11
11
 
12
+ If you don't want the loader to search for/use accompanying civetconfig files,
13
+ you can use the `-noconfig` version (where `NOCONFIG` comments are removed):
14
+
15
+ @example
16
+ ```bash
17
+ node --import @danielx/civet/register-noconfig source.civet
18
+ ```
19
+
12
20
  On older Node, `require`ing this file will register the `.civet` extension
13
21
  for CJS `require`s.
14
22
 
@@ -16,13 +24,30 @@ for CJS `require`s.
16
24
  ```bash
17
25
  node -r @danielx/civet/register source.civet
18
26
  ```
27
+
28
+ If you want to configure the loader, you can make your own
29
+ `register.mjs` along these lines:
30
+
31
+ @example
32
+ ```javascript
33
+ import { register } from 'node:module';
34
+ register('@danielx/civet/esm', import.meta.url, {data: {
35
+ //config: 'path/config.json',
36
+ parseOptions: {
37
+ // Add your parse options here
38
+ },
39
+ }});
40
+ ```
41
+
19
42
  */
20
43
 
21
44
  try {
22
45
  const { register } = require('node:module');
23
46
  const { pathToFileURL } = require('node:url');
24
47
 
25
- register('./dist/esm.mjs', pathToFileURL(__filename));
48
+ register('./dist/esm.mjs', pathToFileURL(__filename)
49
+ //NOCONFIG//, {data: {config: null}}
50
+ );
26
51
  } catch (e) {
27
52
  // older Node lacking module register
28
53
  }
@@ -38,6 +63,7 @@ if (require.extensions) {
38
63
  js: true,
39
64
  inlineMap: true,
40
65
  sync: true,
66
+ //NOCONFIG//config: null,
41
67
  });
42
68
  module._compile(js, filename);
43
69
  };