@danielx/civet 0.5.24 → 0.5.26
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/README.md +5 -1
- package/dist/browser.js +720 -601
- package/dist/civet +5 -5
- package/dist/esbuild-plugin.js +17 -0
- package/dist/main.js +703 -572
- package/dist/main.mjs +15585 -0
- package/package.json +8 -2
package/dist/civet
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
var
|
|
3
|
+
var import_main = require("./main");
|
|
4
|
+
var cli, encoding, fs, parseArgs, path, prune, readFiles, repl, version, splice = [].splice;
|
|
5
|
+
({ prune } = import_main.generate);
|
|
4
6
|
version = function() {
|
|
5
7
|
return require("../package.json").version;
|
|
6
8
|
};
|
|
@@ -40,8 +42,6 @@ You can use - to read from stdin or (prefixed by -o) write to stdout.
|
|
|
40
42
|
`);
|
|
41
43
|
process.exit(0);
|
|
42
44
|
}
|
|
43
|
-
({ parse, compile, generate } = require("./main"));
|
|
44
|
-
({ prune } = generate);
|
|
45
45
|
encoding = "utf8";
|
|
46
46
|
fs = require("fs/promises");
|
|
47
47
|
path = require("path");
|
|
@@ -174,7 +174,7 @@ repl = function(options) {
|
|
|
174
174
|
return process.exit(0);
|
|
175
175
|
} else if (input.endsWith("\n\n")) {
|
|
176
176
|
try {
|
|
177
|
-
output = compile(input, { ...options, filename });
|
|
177
|
+
output = (0, import_main.compile)(input, { ...options, filename });
|
|
178
178
|
} catch (error1) {
|
|
179
179
|
error = error1;
|
|
180
180
|
return callback(error);
|
|
@@ -221,7 +221,7 @@ cli = async function() {
|
|
|
221
221
|
continue;
|
|
222
222
|
}
|
|
223
223
|
try {
|
|
224
|
-
output = compile(content, { ...options, filename });
|
|
224
|
+
output = (0, import_main.compile)(content, { ...options, filename });
|
|
225
225
|
} catch (error1) {
|
|
226
226
|
error = error1;
|
|
227
227
|
console.error(error);
|
package/dist/esbuild-plugin.js
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
@file esbuild plugin for Civet language
|
|
3
|
+
|
|
4
|
+
@example
|
|
5
|
+
```javascript
|
|
6
|
+
import esbuild from 'esbuild'
|
|
7
|
+
import civetPlugin from '@danielx/civet/esbuild-plugin'
|
|
8
|
+
|
|
9
|
+
esbuild.build({
|
|
10
|
+
...,
|
|
11
|
+
plugins: [
|
|
12
|
+
civetPlugin
|
|
13
|
+
]
|
|
14
|
+
}).catch(() => process.exit(1))
|
|
15
|
+
```
|
|
16
|
+
*/
|
|
17
|
+
|
|
1
18
|
const { readFile } = require('fs/promises')
|
|
2
19
|
const path = require('path')
|
|
3
20
|
|