@danielx/civet 0.6.8 → 0.6.10
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/dist/browser.js +560 -438
- package/dist/civet +17 -0
- package/dist/config.js +91 -0
- package/dist/main.js +560 -438
- package/dist/main.mjs +560 -438
- package/dist/types.d.ts +39 -0
- package/package.json +2 -1
- package/dist/babel-plugin.mjs +0 -25
- package/dist/browser.js.gzip +0 -0
package/dist/types.d.ts
CHANGED
|
@@ -1,9 +1,38 @@
|
|
|
1
1
|
declare module "@danielx/civet" {
|
|
2
2
|
export type CivetAST = unknown
|
|
3
|
+
export type ParseOptions = Partial<{
|
|
4
|
+
autoVar: boolean
|
|
5
|
+
autoLet: boolean
|
|
6
|
+
coffeeBinaryExistential: boolean
|
|
7
|
+
coffeeBooleans: boolean
|
|
8
|
+
coffeeClasses: boolean
|
|
9
|
+
coffeeComment: boolean
|
|
10
|
+
coffeeDo: boolean
|
|
11
|
+
coffeeEq: boolean
|
|
12
|
+
coffeeForLoops: boolean
|
|
13
|
+
coffeeInterpolation: boolean
|
|
14
|
+
coffeeIsnt: boolean
|
|
15
|
+
coffeeJSX: boolean
|
|
16
|
+
coffeeLineContinuation: boolean
|
|
17
|
+
coffeeNot: boolean
|
|
18
|
+
coffeeOf: boolean
|
|
19
|
+
coffeePrototype: boolean
|
|
20
|
+
defaultElement: string
|
|
21
|
+
implicitReturns: boolean
|
|
22
|
+
objectIs: boolean
|
|
23
|
+
react: boolean
|
|
24
|
+
solid: boolean
|
|
25
|
+
client: boolean
|
|
26
|
+
rewriteTsImports: boolean
|
|
27
|
+
server: boolean
|
|
28
|
+
tab: number
|
|
29
|
+
verbose: boolean
|
|
30
|
+
}>
|
|
3
31
|
export type CompileOptions = {
|
|
4
32
|
filename?: string
|
|
5
33
|
js?: boolean
|
|
6
34
|
sourceMap?: boolean
|
|
35
|
+
parseOptions?: ParseOptions
|
|
7
36
|
}
|
|
8
37
|
|
|
9
38
|
export type SourceMapping = [number] | [number, number, number, number]
|
|
@@ -62,3 +91,13 @@ declare module "@danielx/civet/esbuild-plugin" {
|
|
|
62
91
|
const plugin: ((options: Options) => Plugin) & Plugin
|
|
63
92
|
export default plugin
|
|
64
93
|
}
|
|
94
|
+
|
|
95
|
+
declare module "@danielx/civet/config" {
|
|
96
|
+
const Config: {
|
|
97
|
+
findConfig: (path: string) => Promise<string | null>
|
|
98
|
+
loadConfig: (
|
|
99
|
+
path: string
|
|
100
|
+
) => Promise<import("@danielx/civet").CompileOptions>
|
|
101
|
+
}
|
|
102
|
+
export default Config
|
|
103
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danielx/civet",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.10",
|
|
4
4
|
"description": "CoffeeScript style syntax for TypeScript",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"module": "dist/main.mjs",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"./esbuild-plugin": "./dist/esbuild-plugin.js",
|
|
14
14
|
"./bun-civet": "./dist/bun-civet.mjs",
|
|
15
15
|
"./register": "./register.js",
|
|
16
|
+
"./config": "./dist/config.js",
|
|
16
17
|
"./*": "./*",
|
|
17
18
|
"./dist/*": "./dist/*"
|
|
18
19
|
},
|
package/dist/babel-plugin.mjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { compile } from "./main.mjs"
|
|
2
|
-
|
|
3
|
-
export default function (api, civetOptions) {
|
|
4
|
-
return {
|
|
5
|
-
parserOverride(code, opts, parse) {
|
|
6
|
-
let src
|
|
7
|
-
if (opts.sourceFileName.endsWith(".civet")) {
|
|
8
|
-
const config = Object.assign({}, civetOptions, {
|
|
9
|
-
filename: opts.sourceFileName,
|
|
10
|
-
sourceMap: opts.sourceMaps ?? true,
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
if (config.sourceMap) {
|
|
14
|
-
({ code: src } = compile(code, config))
|
|
15
|
-
} else {
|
|
16
|
-
src = compile(code, config)
|
|
17
|
-
}
|
|
18
|
-
} else {
|
|
19
|
-
src = code
|
|
20
|
-
}
|
|
21
|
-
const ast = parse(src, opts)
|
|
22
|
-
return ast
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
package/dist/browser.js.gzip
DELETED
|
Binary file
|