@danielx/civet 0.11.5 → 0.11.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/CHANGELOG.md +17 -0
- package/README.md +2 -7
- package/dist/babel-plugin.js +7 -6
- package/dist/babel-plugin.mjs +3 -3
- package/dist/browser.js +568 -423
- package/dist/civet +12 -10
- package/dist/config.js +7313 -7
- package/dist/config.mjs +7338 -4
- package/dist/esbuild-plugin.js +7 -6
- package/dist/esm.mjs +10 -16
- package/dist/main.js +1455 -741
- package/dist/main.mjs +1451 -738
- package/dist/node-worker.mjs +1 -2
- package/dist/ts-diagnostic.js +4 -3
- package/dist/types.d.ts +9 -2
- package/dist/unplugin/astro.js +8 -7
- package/dist/unplugin/astro.mjs +5 -3
- package/dist/unplugin/esbuild.js +7 -6
- package/dist/unplugin/esbuild.mjs +3 -1
- package/dist/unplugin/farm.d.ts +3 -1
- package/dist/unplugin/farm.js +7 -6
- package/dist/unplugin/farm.mjs +4 -2
- package/dist/unplugin/rolldown.d.ts +1 -1
- package/dist/unplugin/rolldown.js +7 -6
- package/dist/unplugin/rolldown.mjs +3 -1
- package/dist/unplugin/rollup.d.ts +1 -1
- package/dist/unplugin/rollup.js +7 -6
- package/dist/unplugin/rollup.mjs +3 -1
- package/dist/unplugin/rspack.js +7 -6
- package/dist/unplugin/rspack.mjs +3 -1
- package/dist/unplugin/unplugin.js +48 -33
- package/dist/unplugin/unplugin.mjs +31 -19
- package/dist/unplugin/vite.d.ts +1 -1
- package/dist/unplugin/vite.js +7 -6
- package/dist/unplugin/vite.mjs +3 -1
- package/dist/unplugin/webpack.d.ts +1 -1
- package/dist/unplugin/webpack.js +7 -6
- package/dist/unplugin/webpack.mjs +3 -1
- package/package.json +30 -15
package/dist/civet
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict"
|
|
3
3
|
try { require('node:module').enableCompileCache() } catch {}
|
|
4
|
+
"use strict";
|
|
4
5
|
var __create = Object.create;
|
|
5
6
|
var __defProp = Object.defineProperty;
|
|
6
7
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -29,16 +30,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
30
|
));
|
|
30
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
32
|
|
|
32
|
-
//
|
|
33
|
-
var
|
|
34
|
-
__export(
|
|
33
|
+
// source/cli.civet
|
|
34
|
+
var cli_exports = {};
|
|
35
|
+
__export(cli_exports, {
|
|
35
36
|
cli: () => cli,
|
|
36
37
|
makeOutputFilename: () => makeOutputFilename,
|
|
37
38
|
parseArgs: () => parseArgs,
|
|
38
39
|
repl: () => repl,
|
|
39
40
|
version: () => version
|
|
40
41
|
});
|
|
41
|
-
module.exports = __toCommonJS(
|
|
42
|
+
module.exports = __toCommonJS(cli_exports);
|
|
42
43
|
var import_main = require("./main.js");
|
|
43
44
|
var import_config = require("./config.js");
|
|
44
45
|
var import_unplugin = require("./unplugin/unplugin.js");
|
|
@@ -302,7 +303,7 @@ function makeOutputFilename(filename, options) {
|
|
|
302
303
|
;
|
|
303
304
|
return;
|
|
304
305
|
})(ref1), ref1);
|
|
305
|
-
return import_node_path.default.format(outputPath);
|
|
306
|
+
return import_node_path.default.normalize(import_node_path.default.format(outputPath));
|
|
306
307
|
}
|
|
307
308
|
async function repl(args, options) {
|
|
308
309
|
const vm = await import("node:vm");
|
|
@@ -390,7 +391,7 @@ async function repl(args, options) {
|
|
|
390
391
|
} else if (input in ["quit\n", "exit\n", "quit()\n", "exit()\n"]) {
|
|
391
392
|
return process.exit(0);
|
|
392
393
|
} else if (input.endsWith("\n\n")) {
|
|
393
|
-
let
|
|
394
|
+
let showError2 = function(error) {
|
|
394
395
|
console.error("Error while parsing Civet code:");
|
|
395
396
|
if ((0, import_main.isCompileError)(error)) {
|
|
396
397
|
if (error.errors != null) {
|
|
@@ -402,12 +403,13 @@ ${" ".repeat(error.column - 1)}^ ${error.header}`);
|
|
|
402
403
|
return console.error(error);
|
|
403
404
|
}
|
|
404
405
|
};
|
|
406
|
+
var showError = showError2;
|
|
405
407
|
let output;
|
|
406
408
|
if (options.compile || options.ast) {
|
|
407
409
|
try {
|
|
408
410
|
output = await (0, import_main.compile)(input, { ...options, filename });
|
|
409
411
|
} catch (error) {
|
|
410
|
-
|
|
412
|
+
showError2(error);
|
|
411
413
|
return callback(null, void 0);
|
|
412
414
|
}
|
|
413
415
|
return callback(null, output);
|
|
@@ -420,7 +422,7 @@ ${" ".repeat(error.column - 1)}^ ${error.header}`);
|
|
|
420
422
|
try {
|
|
421
423
|
ast = await (0, import_main.compile)(input, { ...options, parseOptions, filename, ast: true });
|
|
422
424
|
} catch (error) {
|
|
423
|
-
|
|
425
|
+
showError2(error);
|
|
424
426
|
return callback(null, void 0);
|
|
425
427
|
}
|
|
426
428
|
let errors = [];
|
|
@@ -432,8 +434,8 @@ ${" ".repeat(error.column - 1)}^ ${error.header}`);
|
|
|
432
434
|
}
|
|
433
435
|
if (errors.length) {
|
|
434
436
|
errors = [];
|
|
435
|
-
(0, import_main.generate)(ast, { ...options, errors, sourceMap: new import_main.SourceMap(input) });
|
|
436
|
-
|
|
437
|
+
(0, import_main.generate)(ast, { ...options, errors, sourceMap: new import_main.SourceMap(input, filename) });
|
|
438
|
+
showError2(errors[0]);
|
|
437
439
|
return callback(null, void 0);
|
|
438
440
|
}
|
|
439
441
|
let result;
|