@danielx/civet 0.9.0 → 0.9.2
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 +11 -0
- package/dist/babel-plugin.js +6 -7
- package/dist/babel-plugin.mjs +3 -3
- package/dist/browser.js +4606 -9813
- package/dist/civet +11 -10
- package/dist/config.js +6 -7
- package/dist/config.mjs +3 -3
- package/dist/esbuild-plugin.js +6 -7
- package/dist/esm.mjs +1 -1
- package/dist/main.js +1151 -1135
- package/dist/main.mjs +1153 -1130
- package/dist/node-worker.mjs +29 -0
- package/dist/ts-diagnostic.js +5 -8
- package/dist/ts-diagnostic.mjs +2 -4
- package/dist/types.d.ts +4 -0
- package/dist/unplugin/unplugin.d.ts +2 -0
- package/dist/unplugin/unplugin.js +135 -130
- package/dist/unplugin/unplugin.mjs +135 -130
- package/package.json +6 -6
package/dist/civet
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict"
|
|
2
|
+
"use strict"
|
|
3
|
+
try { require('node:module').enableCompileCache() } catch {}
|
|
3
4
|
var __create = Object.create;
|
|
4
5
|
var __defProp = Object.defineProperty;
|
|
5
6
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -28,15 +29,15 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
29
|
));
|
|
29
30
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
31
|
|
|
31
|
-
// source
|
|
32
|
-
var
|
|
33
|
-
__export(
|
|
32
|
+
// unplugin-civet:C:\Users\edemaine\Projects\Civet\source\cli.civet.jsx
|
|
33
|
+
var cli_civet_exports = {};
|
|
34
|
+
__export(cli_civet_exports, {
|
|
34
35
|
cli: () => cli,
|
|
35
36
|
parseArgs: () => parseArgs,
|
|
36
37
|
repl: () => repl,
|
|
37
38
|
version: () => version
|
|
38
39
|
});
|
|
39
|
-
module.exports = __toCommonJS(
|
|
40
|
+
module.exports = __toCommonJS(cli_civet_exports);
|
|
40
41
|
var import_main = require("./main.js");
|
|
41
42
|
var import_config = require("./config.js");
|
|
42
43
|
var import_unplugin = require("./unplugin/unplugin.js");
|
|
@@ -187,6 +188,7 @@ async function parseArgs(args, isTTY = process.stdin.isTTY) {
|
|
|
187
188
|
endOfArgs(++i);
|
|
188
189
|
break;
|
|
189
190
|
}
|
|
191
|
+
// remaining arguments are filename and/or arguments
|
|
190
192
|
default: {
|
|
191
193
|
if (arg.startsWith("-") && arg !== "-") {
|
|
192
194
|
console.error(`Invalid command-line argument: ${arg}`);
|
|
@@ -371,7 +373,7 @@ async function repl(args, options) {
|
|
|
371
373
|
} else if (input in ["quit\n", "exit\n", "quit()\n", "exit()\n"]) {
|
|
372
374
|
return process.exit(0);
|
|
373
375
|
} else if (input.endsWith("\n\n")) {
|
|
374
|
-
let
|
|
376
|
+
let showError = function(error) {
|
|
375
377
|
console.error("Error while parsing Civet code:");
|
|
376
378
|
if ((0, import_main.isCompileError)(error)) {
|
|
377
379
|
if (error.errors != null) {
|
|
@@ -383,13 +385,12 @@ ${" ".repeat(error.column - 1)}^ ${error.header}`);
|
|
|
383
385
|
return console.error(error);
|
|
384
386
|
}
|
|
385
387
|
};
|
|
386
|
-
var showError = showError2;
|
|
387
388
|
let output;
|
|
388
389
|
if (options.compile || options.ast) {
|
|
389
390
|
try {
|
|
390
391
|
output = await (0, import_main.compile)(input, { ...options, filename });
|
|
391
392
|
} catch (error) {
|
|
392
|
-
|
|
393
|
+
showError(error);
|
|
393
394
|
return callback(null, void 0);
|
|
394
395
|
}
|
|
395
396
|
return callback(null, output);
|
|
@@ -402,7 +403,7 @@ ${" ".repeat(error.column - 1)}^ ${error.header}`);
|
|
|
402
403
|
try {
|
|
403
404
|
ast = await (0, import_main.compile)(input, { ...options, parseOptions, filename, ast: true });
|
|
404
405
|
} catch (error) {
|
|
405
|
-
|
|
406
|
+
showError(error);
|
|
406
407
|
return callback(null, void 0);
|
|
407
408
|
}
|
|
408
409
|
let errors = [];
|
|
@@ -415,7 +416,7 @@ ${" ".repeat(error.column - 1)}^ ${error.header}`);
|
|
|
415
416
|
if (errors.length) {
|
|
416
417
|
errors = [];
|
|
417
418
|
(0, import_main.generate)(ast, { ...options, errors, sourceMap: (0, import_main.SourceMap)(input) });
|
|
418
|
-
|
|
419
|
+
showError(errors[0]);
|
|
419
420
|
return callback(null, void 0);
|
|
420
421
|
}
|
|
421
422
|
let result;
|
package/dist/config.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -27,15 +26,15 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
26
|
));
|
|
28
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
28
|
|
|
30
|
-
// source
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
33
|
-
default: () =>
|
|
29
|
+
// unplugin-civet:C:\Users\edemaine\Projects\Civet\source\config.civet.jsx
|
|
30
|
+
var config_civet_exports = {};
|
|
31
|
+
__export(config_civet_exports, {
|
|
32
|
+
default: () => config_civet_default,
|
|
34
33
|
findConfig: () => findConfig,
|
|
35
34
|
findInDir: () => findInDir,
|
|
36
35
|
loadConfig: () => loadConfig
|
|
37
36
|
});
|
|
38
|
-
module.exports = __toCommonJS(
|
|
37
|
+
module.exports = __toCommonJS(config_civet_exports);
|
|
39
38
|
var import_path = __toESM(require("path"));
|
|
40
39
|
var import_promises = __toESM(require("fs/promises"));
|
|
41
40
|
var import_main = require("./main.js");
|
|
@@ -152,7 +151,7 @@ async function loadConfig(pathname) {
|
|
|
152
151
|
delete data?.parseOptions?.comptime;
|
|
153
152
|
return data;
|
|
154
153
|
}
|
|
155
|
-
var
|
|
154
|
+
var config_civet_default = {
|
|
156
155
|
findConfig,
|
|
157
156
|
findInDir,
|
|
158
157
|
loadConfig
|
package/dist/config.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// source
|
|
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";
|
|
@@ -115,13 +115,13 @@ async function loadConfig(pathname) {
|
|
|
115
115
|
delete data?.parseOptions?.comptime;
|
|
116
116
|
return data;
|
|
117
117
|
}
|
|
118
|
-
var
|
|
118
|
+
var config_civet_default = {
|
|
119
119
|
findConfig,
|
|
120
120
|
findInDir,
|
|
121
121
|
loadConfig
|
|
122
122
|
};
|
|
123
123
|
export {
|
|
124
|
-
|
|
124
|
+
config_civet_default as default,
|
|
125
125
|
findConfig,
|
|
126
126
|
findInDir,
|
|
127
127
|
loadConfig
|
package/dist/esbuild-plugin.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -27,12 +26,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
26
|
));
|
|
28
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
28
|
|
|
30
|
-
// source
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
33
|
-
default: () =>
|
|
29
|
+
// unplugin-civet:C:\Users\edemaine\Projects\Civet\source\esbuild-plugin.civet.jsx
|
|
30
|
+
var esbuild_plugin_civet_exports = {};
|
|
31
|
+
__export(esbuild_plugin_civet_exports, {
|
|
32
|
+
default: () => esbuild_plugin_civet_default
|
|
34
33
|
});
|
|
35
|
-
module.exports = __toCommonJS(
|
|
34
|
+
module.exports = __toCommonJS(esbuild_plugin_civet_exports);
|
|
36
35
|
var import_promises = require("fs/promises");
|
|
37
36
|
var import_path = __toESM(require("path"));
|
|
38
37
|
var import_main = require("./main.js");
|
|
@@ -127,5 +126,5 @@ var civet = function(options = {}) {
|
|
|
127
126
|
};
|
|
128
127
|
var defaultPlugin = civet();
|
|
129
128
|
civet.setup = defaultPlugin.setup;
|
|
130
|
-
var
|
|
129
|
+
var esbuild_plugin_civet_default = civet;
|
|
131
130
|
module.exports = module.exports.default;
|
package/dist/esm.mjs
CHANGED