@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/node-worker.mjs
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -26,6 +26,13 @@ declare module "@danielx/civet" {
|
|
|
26
26
|
implicitReturns: boolean
|
|
27
27
|
jsxCode: boolean
|
|
28
28
|
objectIs: boolean
|
|
29
|
+
/** Array of names to treat as operators, or object mapping names to
|
|
30
|
+
* parsable operator behaviors such as "relational" or "same (+)" or
|
|
31
|
+
* "relational same (+)", or ""/undefined for default behavior.
|
|
32
|
+
* (Can also map to OperatorBehavior as defined in source/types.civet,
|
|
33
|
+
* but the details are subject to change.)
|
|
34
|
+
*/
|
|
35
|
+
operators: string[] | Record<string, string?>
|
|
29
36
|
react: boolean
|
|
30
37
|
solid: boolean
|
|
31
38
|
client: boolean
|
|
@@ -41,25 +48,92 @@ declare module "@danielx/civet" {
|
|
|
41
48
|
repl: boolean
|
|
42
49
|
}>
|
|
43
50
|
export type CompileOptions = {
|
|
51
|
+
/**
|
|
52
|
+
* If your Civet code comes from a file, provide it here. This gets used
|
|
53
|
+
* in sourcemaps and error messages.
|
|
54
|
+
*/
|
|
44
55
|
filename?: string
|
|
56
|
+
/**
|
|
57
|
+
* Whether to return a source map in addition to transpiled code.
|
|
58
|
+
* If false (the default), `compile` just returns transpiled code.
|
|
59
|
+
* If true (and `inlineMap` is false/unspecified),
|
|
60
|
+
* `compile` returns an object `{code, sourceMap}` whose `code` property
|
|
61
|
+
* is transpiled code and `sourceMap` property is a `SourceMap` object.
|
|
62
|
+
*/
|
|
45
63
|
sourceMap?: boolean
|
|
64
|
+
/**
|
|
65
|
+
* Whether to inline a source map as a final comment in the transpiled code.
|
|
66
|
+
* Default is false.
|
|
67
|
+
*/
|
|
46
68
|
inlineMap?: boolean
|
|
69
|
+
/**
|
|
70
|
+
* Whether to return an AST of the parsed code instead of transpiled code.
|
|
71
|
+
* Default is false.
|
|
72
|
+
* If true, `compile` skips the `generate` step that turns the parsed AST
|
|
73
|
+
* into a code string, and just returns the AST itself.
|
|
74
|
+
* If "raw", `compile` also skips the `prune` step, which leaves some
|
|
75
|
+
* extra properties on the AST nodes (e.g. `parent` pointers) and
|
|
76
|
+
* preserves that `children` is always an array.
|
|
77
|
+
*/
|
|
47
78
|
ast?: boolean | "raw"
|
|
79
|
+
/**
|
|
80
|
+
* Whether Civet should convert TypeScript syntax to JavaScript.
|
|
81
|
+
* This mostly triggers the removal of type annotations, but some
|
|
82
|
+
* TypeScript features such as `enum` are also supported.
|
|
83
|
+
* Default is false.
|
|
84
|
+
*/
|
|
48
85
|
js?: boolean
|
|
86
|
+
/**
|
|
87
|
+
* If set to true, turns off the compiler cache of compiled subexpressions.
|
|
88
|
+
* This should not affect the compilation output,
|
|
89
|
+
* and can make the compiler exponentially slow.
|
|
90
|
+
* It is mainly for testing whether there is a bug in the compiler cache.
|
|
91
|
+
*/
|
|
49
92
|
noCache?: boolean
|
|
93
|
+
/**
|
|
94
|
+
* If specified, also writes data about compiler cache performance
|
|
95
|
+
* into the specified filename. Useful for debugging caching performance.
|
|
96
|
+
*/
|
|
50
97
|
hits?: string
|
|
98
|
+
/**
|
|
99
|
+
* If specified, also writes data about all parse branches considered by
|
|
100
|
+
* the compiler into the specified filename.
|
|
101
|
+
* Useful for debugging why something parsed the way it did.
|
|
102
|
+
*/
|
|
51
103
|
trace?: string
|
|
104
|
+
/**
|
|
105
|
+
* Initial parse options, e.g., read from a config file.
|
|
106
|
+
* They can still be overridden in the code by "civet" pragmas.
|
|
107
|
+
*/
|
|
52
108
|
parseOptions?: ParseOptions
|
|
53
|
-
/**
|
|
109
|
+
/**
|
|
110
|
+
* By default, `compile` will throw a `ParseErrors` containing all
|
|
111
|
+
* `ParseError`s encountered during compilation.
|
|
112
|
+
* If you specify an empty array, `compile` will not throw and instead
|
|
113
|
+
* will add to the array all `ParseError`s encountered.
|
|
114
|
+
*/
|
|
54
115
|
errors?: ParseError[]
|
|
55
|
-
/**
|
|
116
|
+
/**
|
|
117
|
+
* Number of parallel threads to compile with (Node only).
|
|
118
|
+
* Default is to use the environment variable `CIVET_THREADS`, or 0.
|
|
119
|
+
* If nonzero, spawns up to that many worker threads so that multiple
|
|
120
|
+
* calls to `compile` will end up running in parallel.
|
|
121
|
+
* If `CIVET_THREADS` is set to 0, the `threads` option is ignored.
|
|
122
|
+
*/
|
|
56
123
|
threads?: number
|
|
124
|
+
/**
|
|
125
|
+
* If false (the default), runs the compiler asynchronously and returns
|
|
126
|
+
* a Promise (for the transpiled string or `{code, sourceMap}` object).
|
|
127
|
+
* If true, runs the compiler synchronously and returns the result directly.
|
|
128
|
+
* Sync mode disables some features:
|
|
129
|
+
* - parallel computation via `threads`
|
|
130
|
+
* - comptime code can't return promises
|
|
131
|
+
*/
|
|
132
|
+
sync?: boolean
|
|
57
133
|
}
|
|
58
134
|
export type GenerateOptions = Omit<CompileOptions, "sourceMap"> & {
|
|
59
135
|
sourceMap?: undefined | SourceMap
|
|
60
136
|
}
|
|
61
|
-
export type SyncCompileOptions = CompileOptions &
|
|
62
|
-
{ parseOptions?: { comptime?: false } }
|
|
63
137
|
|
|
64
138
|
export type SourceMapping = [number] | [number, number, number, number]
|
|
65
139
|
|
|
@@ -74,7 +148,7 @@ declare module "@danielx/civet" {
|
|
|
74
148
|
}
|
|
75
149
|
|
|
76
150
|
// TODO: Import ParseError class from Hera
|
|
77
|
-
export
|
|
151
|
+
export class ParseError {
|
|
78
152
|
name: "ParseError"
|
|
79
153
|
message: string // filename:line:column header\nbody
|
|
80
154
|
header: string
|
|
@@ -84,7 +158,8 @@ declare module "@danielx/civet" {
|
|
|
84
158
|
column: number | string
|
|
85
159
|
offset: number
|
|
86
160
|
}
|
|
87
|
-
export
|
|
161
|
+
export class ParseErrors {
|
|
162
|
+
constructor(errors: ParseError[])
|
|
88
163
|
name: "ParseErrors"
|
|
89
164
|
message: string
|
|
90
165
|
errors: ParseError[]
|
|
@@ -97,7 +172,7 @@ declare module "@danielx/civet" {
|
|
|
97
172
|
code: string,
|
|
98
173
|
sourceMap: SourceMap,
|
|
99
174
|
} : string
|
|
100
|
-
export function compile<const T extends CompileOptions>(source: string, options?: T):
|
|
175
|
+
export function compile<const T extends CompileOptions>(source: string | Buffer, options?: T):
|
|
101
176
|
T extends { sync: true } ? CompileOutput<T> : Promise<CompileOutput<T>>
|
|
102
177
|
/** Warning: No caching */
|
|
103
178
|
export function parse(source: string, options?: CompileOptions & {startRule?: string}): CivetAST
|
|
@@ -105,6 +180,7 @@ declare module "@danielx/civet" {
|
|
|
105
180
|
export function parseProgram<T extends CompileOptions>(source: string, options?: T):
|
|
106
181
|
T extends { comptime: true } ? Promise<CivetAST> : CivetAST
|
|
107
182
|
export function generate(ast: CivetAST, options?: GenerateOptions): string
|
|
183
|
+
export function decode(source: string | Buffer): string
|
|
108
184
|
|
|
109
185
|
export const lib: {
|
|
110
186
|
gatherRecursive(ast: CivetAST, predicate: (node: CivetAST) => boolean): CivetAST[]
|
|
@@ -117,6 +193,7 @@ declare module "@danielx/civet" {
|
|
|
117
193
|
isCompileError: typeof isCompileError
|
|
118
194
|
parse: typeof parse
|
|
119
195
|
generate: typeof generate
|
|
196
|
+
decode: typeof decode
|
|
120
197
|
SourceMap: typeof SourceMap
|
|
121
198
|
ParseError: typeof ParseError
|
|
122
199
|
ParseErrors: typeof ParseErrors
|
|
@@ -150,9 +227,10 @@ declare module "@danielx/civet/config" {
|
|
|
150
227
|
export function loadConfig(
|
|
151
228
|
path: string
|
|
152
229
|
): Promise<import("@danielx/civet").CompileOptions>
|
|
153
|
-
|
|
154
|
-
findInDir,
|
|
155
|
-
findConfig,
|
|
156
|
-
loadConfig,
|
|
230
|
+
const Config: {
|
|
231
|
+
findInDir: typeof findInDir,
|
|
232
|
+
findConfig: typeof findConfig,
|
|
233
|
+
loadConfig: typeof loadConfig,
|
|
157
234
|
}
|
|
235
|
+
export default Config
|
|
158
236
|
}
|
package/dist/unplugin/astro.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\unplugin\astro.civet.jsx
|
|
30
30
|
var astro_civet_exports = {};
|
|
31
31
|
__export(astro_civet_exports, {
|
|
32
32
|
default: () => astro_civet_default
|
package/dist/unplugin/astro.mjs
CHANGED
package/dist/unplugin/esbuild.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\unplugin\esbuild.civet.jsx
|
|
30
30
|
var esbuild_civet_exports = {};
|
|
31
31
|
__export(esbuild_civet_exports, {
|
|
32
32
|
default: () => esbuild_civet_default
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// unplugin-civet
|
|
1
|
+
// unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\esbuild.civet.jsx
|
|
2
2
|
import civetUnplugin from "./unplugin.mjs";
|
|
3
3
|
var esbuild_civet_default = civetUnplugin.esbuild;
|
|
4
4
|
export {
|
package/dist/unplugin/farm.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\unplugin\farm.civet.jsx
|
|
30
30
|
var farm_civet_exports = {};
|
|
31
31
|
__export(farm_civet_exports, {
|
|
32
32
|
default: () => farm_civet_default
|
package/dist/unplugin/farm.mjs
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\unplugin\rolldown.civet.jsx
|
|
30
30
|
var rolldown_civet_exports = {};
|
|
31
31
|
__export(rolldown_civet_exports, {
|
|
32
32
|
default: () => rolldown_civet_default
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// unplugin-civet
|
|
1
|
+
// unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\rolldown.civet.jsx
|
|
2
2
|
import civetUnplugin from "./unplugin.mjs";
|
|
3
3
|
var rolldown_civet_default = civetUnplugin.rolldown;
|
|
4
4
|
export {
|
package/dist/unplugin/rollup.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\unplugin\rollup.civet.jsx
|
|
30
30
|
var rollup_civet_exports = {};
|
|
31
31
|
__export(rollup_civet_exports, {
|
|
32
32
|
default: () => rollup_civet_default
|
package/dist/unplugin/rollup.mjs
CHANGED
package/dist/unplugin/rspack.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\unplugin\rspack.civet.jsx
|
|
30
30
|
var rspack_civet_exports = {};
|
|
31
31
|
__export(rspack_civet_exports, {
|
|
32
32
|
default: () => rspack_civet_default
|
package/dist/unplugin/rspack.mjs
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\unplugin\unplugin.civet.jsx
|
|
30
30
|
var unplugin_civet_exports = {};
|
|
31
31
|
__export(unplugin_civet_exports, {
|
|
32
32
|
default: () => unplugin_civet_default,
|
|
@@ -46,7 +46,7 @@ var import_os = __toESM(require("os"));
|
|
|
46
46
|
// source/unplugin/constants.mjs
|
|
47
47
|
var DEFAULT_EXTENSIONS = [".mjs", ".js", ".mts", ".ts", ".jsx", ".tsx", ".json"];
|
|
48
48
|
|
|
49
|
-
// unplugin-civet
|
|
49
|
+
// unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\unplugin.civet.jsx
|
|
50
50
|
var DiagnosticCategory = {};
|
|
51
51
|
DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning";
|
|
52
52
|
DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error";
|
|
@@ -265,9 +265,7 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
265
265
|
if (!filename.endsWith(".civet.tsx")) return systemReadFile(filename, encoding);
|
|
266
266
|
if (fsMap.has(filename)) return fsMap.get(filename);
|
|
267
267
|
const civetFilename = filename.slice(0, -4);
|
|
268
|
-
const rawCivetSource = fs.readFileSync(civetFilename, {
|
|
269
|
-
encoding
|
|
270
|
-
});
|
|
268
|
+
const rawCivetSource = fs.readFileSync(civetFilename, { encoding });
|
|
271
269
|
const { code: compiledTS, sourceMap } = import_civet.default.compile(rawCivetSource, {
|
|
272
270
|
...tsCompileOptions,
|
|
273
271
|
filename,
|
|
@@ -342,7 +340,7 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
342
340
|
}
|
|
343
341
|
if (options.emitDeclaration) {
|
|
344
342
|
if (meta.framework === "esbuild" && !esbuildOptions.outdir) {
|
|
345
|
-
|
|
343
|
+
throw new Error("Civet unplugin's `emitDeclaration` requires esbuild's `outdir` option to be set;");
|
|
346
344
|
}
|
|
347
345
|
for (const file of fsMap.keys()) {
|
|
348
346
|
const slashed = slash(file);
|
|
@@ -465,7 +463,7 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
465
463
|
filename: id,
|
|
466
464
|
errors: []
|
|
467
465
|
};
|
|
468
|
-
const rawCivetSource = await fs.promises.readFile(filename
|
|
466
|
+
const rawCivetSource = (0, import_civet.decode)(await fs.promises.readFile(filename));
|
|
469
467
|
const ast = await import_civet.default.compile(rawCivetSource, {
|
|
470
468
|
...civetOptions,
|
|
471
469
|
ast: true
|
|
@@ -539,7 +537,7 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
539
537
|
}
|
|
540
538
|
}
|
|
541
539
|
const jsonSourceMap = sourceMap && (typeof sourceMap === "string" ? JSON.parse(sourceMap) : sourceMap.json(
|
|
542
|
-
import_path.default.relative(rootDir, id
|
|
540
|
+
import_path.default.relative(rootDir, extractCivetFilename(id, outExt).filename),
|
|
543
541
|
import_path.default.relative(rootDir, id)
|
|
544
542
|
));
|
|
545
543
|
let transformed = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// unplugin-civet
|
|
1
|
+
// unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\unplugin.civet.jsx
|
|
2
2
|
import { createUnplugin } from "unplugin";
|
|
3
|
-
import civet, { lib, SourceMap } from "@danielx/civet";
|
|
3
|
+
import civet, { decode, lib, SourceMap } from "@danielx/civet";
|
|
4
4
|
import { findInDir, loadConfig } from "@danielx/civet/config";
|
|
5
5
|
import {
|
|
6
6
|
remapRange,
|
|
@@ -14,7 +14,7 @@ import os from "os";
|
|
|
14
14
|
// source/unplugin/constants.mjs
|
|
15
15
|
var DEFAULT_EXTENSIONS = [".mjs", ".js", ".mts", ".ts", ".jsx", ".tsx", ".json"];
|
|
16
16
|
|
|
17
|
-
// unplugin-civet
|
|
17
|
+
// unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\unplugin.civet.jsx
|
|
18
18
|
var DiagnosticCategory = {};
|
|
19
19
|
DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning";
|
|
20
20
|
DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error";
|
|
@@ -233,9 +233,7 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
233
233
|
if (!filename.endsWith(".civet.tsx")) return systemReadFile(filename, encoding);
|
|
234
234
|
if (fsMap.has(filename)) return fsMap.get(filename);
|
|
235
235
|
const civetFilename = filename.slice(0, -4);
|
|
236
|
-
const rawCivetSource = fs.readFileSync(civetFilename, {
|
|
237
|
-
encoding
|
|
238
|
-
});
|
|
236
|
+
const rawCivetSource = fs.readFileSync(civetFilename, { encoding });
|
|
239
237
|
const { code: compiledTS, sourceMap } = civet.compile(rawCivetSource, {
|
|
240
238
|
...tsCompileOptions,
|
|
241
239
|
filename,
|
|
@@ -310,7 +308,7 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
310
308
|
}
|
|
311
309
|
if (options.emitDeclaration) {
|
|
312
310
|
if (meta.framework === "esbuild" && !esbuildOptions.outdir) {
|
|
313
|
-
|
|
311
|
+
throw new Error("Civet unplugin's `emitDeclaration` requires esbuild's `outdir` option to be set;");
|
|
314
312
|
}
|
|
315
313
|
for (const file of fsMap.keys()) {
|
|
316
314
|
const slashed = slash(file);
|
|
@@ -433,7 +431,7 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
433
431
|
filename: id,
|
|
434
432
|
errors: []
|
|
435
433
|
};
|
|
436
|
-
const rawCivetSource = await fs.promises.readFile(filename
|
|
434
|
+
const rawCivetSource = decode(await fs.promises.readFile(filename));
|
|
437
435
|
const ast = await civet.compile(rawCivetSource, {
|
|
438
436
|
...civetOptions,
|
|
439
437
|
ast: true
|
|
@@ -507,7 +505,7 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
507
505
|
}
|
|
508
506
|
}
|
|
509
507
|
const jsonSourceMap = sourceMap && (typeof sourceMap === "string" ? JSON.parse(sourceMap) : sourceMap.json(
|
|
510
|
-
path.relative(rootDir, id
|
|
508
|
+
path.relative(rootDir, extractCivetFilename(id, outExt).filename),
|
|
511
509
|
path.relative(rootDir, id)
|
|
512
510
|
));
|
|
513
511
|
let transformed = {
|
package/dist/unplugin/vite.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\unplugin\vite.civet.jsx
|
|
30
30
|
var vite_civet_exports = {};
|
|
31
31
|
__export(vite_civet_exports, {
|
|
32
32
|
default: () => vite_civet_default
|
package/dist/unplugin/vite.mjs
CHANGED
package/dist/unplugin/webpack.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\unplugin\webpack.civet.jsx
|
|
30
30
|
var webpack_civet_exports = {};
|
|
31
31
|
__export(webpack_civet_exports, {
|
|
32
32
|
default: () => webpack_civet_default
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// unplugin-civet
|
|
1
|
+
// unplugin-civet:C:\Users\edemaine\Projects\Civet\source\unplugin\webpack.civet.jsx
|
|
2
2
|
import civetUnplugin from "./unplugin.mjs";
|
|
3
3
|
var webpack_civet_default = civetUnplugin.webpack;
|
|
4
4
|
export {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danielx/civet",
|
|
3
3
|
"type": "commonjs",
|
|
4
|
-
"version": "0.10.
|
|
4
|
+
"version": "0.10.7",
|
|
5
5
|
"description": "CoffeeScript style syntax for TypeScript",
|
|
6
6
|
"main": "dist/main.js",
|
|
7
7
|
"module": "dist/main.mjs",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
114
|
"@danielx/civet": "0.9.4",
|
|
115
|
-
"@danielx/hera": "^0.8.
|
|
115
|
+
"@danielx/hera": "^0.8.17",
|
|
116
116
|
"@prettier/sync": "^0.5.2",
|
|
117
117
|
"@types/assert": "^1.5.6",
|
|
118
118
|
"@types/mocha": "^10.0.8",
|
package/register.js
CHANGED
|
@@ -58,7 +58,7 @@ const { compile } = require("./");
|
|
|
58
58
|
// Old-style CJS registration
|
|
59
59
|
if (require.extensions) {
|
|
60
60
|
require.extensions[".civet"] = function (module, filename) {
|
|
61
|
-
const js = compile(fs.readFileSync(filename
|
|
61
|
+
const js = compile(fs.readFileSync(filename), {
|
|
62
62
|
filename,
|
|
63
63
|
js: true,
|
|
64
64
|
inlineMap: true,
|
|
@@ -83,7 +83,7 @@ function retrieveFile(path) {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
if (!outputCache.has(path)) {
|
|
86
|
-
outputCache.set(path, compile(fs.readFileSync(path
|
|
86
|
+
outputCache.set(path, compile(fs.readFileSync(path), {
|
|
87
87
|
filename: path,
|
|
88
88
|
js: true,
|
|
89
89
|
inlineMap: true,
|