@danielx/civet 0.10.5 → 0.10.7
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 +25 -2
- package/dist/babel-plugin.js +1 -1
- package/dist/babel-plugin.mjs +1 -1
- package/dist/browser.js +236 -151
- package/dist/civet +7 -8
- package/dist/config.js +2 -2
- package/dist/config.mjs +3 -3
- package/dist/esbuild-plugin.js +2 -2
- package/dist/esm.mjs +2 -2
- package/dist/main.js +303 -198
- package/dist/main.mjs +301 -197
- package/dist/node-worker.mjs +1 -1
- package/dist/types.d.ts +89 -11
- package/dist/unplugin/astro.js +1 -1
- package/dist/unplugin/astro.mjs +1 -1
- package/dist/unplugin/esbuild.js +1 -1
- package/dist/unplugin/esbuild.mjs +1 -1
- package/dist/unplugin/farm.js +1 -1
- package/dist/unplugin/farm.mjs +1 -1
- package/dist/unplugin/rolldown.js +1 -1
- package/dist/unplugin/rolldown.mjs +1 -1
- package/dist/unplugin/rollup.js +1 -1
- package/dist/unplugin/rollup.mjs +1 -1
- package/dist/unplugin/rspack.js +1 -1
- package/dist/unplugin/rspack.mjs +1 -1
- package/dist/unplugin/unplugin.js +6 -8
- package/dist/unplugin/unplugin.mjs +7 -9
- package/dist/unplugin/vite.js +1 -1
- package/dist/unplugin/vite.mjs +1 -1
- package/dist/unplugin/webpack.js +1 -1
- package/dist/unplugin/webpack.mjs +1 -1
- package/package.json +2 -2
- package/register.js +2 -2
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
|
|
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,
|
|
@@ -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
|
|
282
|
+
content = await import_promises.default.readFile(filename);
|
|
288
283
|
}
|
|
289
284
|
yield { filename, content, stdin };
|
|
290
285
|
} catch (error) {
|
|
@@ -368,6 +363,7 @@ async function repl(args, options) {
|
|
|
368
363
|
return;
|
|
369
364
|
})(),
|
|
370
365
|
eval: async function(input, context, filename, callback) {
|
|
366
|
+
input = input.replace(/\r/g, "\n");
|
|
371
367
|
if (input === "\n") {
|
|
372
368
|
return callback(null, void 0);
|
|
373
369
|
} else if (input in ["quit\n", "exit\n", "quit()\n", "exit()\n"]) {
|
|
@@ -663,6 +659,9 @@ You can override this behavior via: --civet rewriteCivetImports=.ext
|
|
|
663
659
|
}
|
|
664
660
|
return process.exit(code ?? 1);
|
|
665
661
|
});
|
|
662
|
+
for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) {
|
|
663
|
+
process.on(signal, () => child.kill(signal));
|
|
664
|
+
}
|
|
666
665
|
} else {
|
|
667
666
|
await import("../register.js");
|
|
668
667
|
try {
|
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
|
|
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,
|
|
@@ -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
|
|
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
|
-
// unplugin-civet
|
|
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
|
|
68
|
+
const config = decode(await fs.readFile(pathname));
|
|
69
69
|
let data = {};
|
|
70
70
|
if (pathname.endsWith(".json")) {
|
|
71
71
|
let json;
|
package/dist/esbuild-plugin.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
|
|
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
|
|
@@ -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
|
|
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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// unplugin-civet
|
|
1
|
+
// unplugin-civet:C:\Users\edemaine\Projects\Civet\source\esm.civet.jsx
|
|
2
2
|
import { readFile } from "fs/promises";
|
|
3
3
|
import { dirname } from "path";
|
|
4
4
|
import { pathToFileURL, fileURLToPath } from "url";
|
|
@@ -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
|
|
27
|
+
const source = await readFile(path);
|
|
28
28
|
let loadedConfig;
|
|
29
29
|
let { config } = globalOptions;
|
|
30
30
|
if (config === void 0) {
|