@danielx/civet 0.2.14 → 0.2.15
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 +3 -1
- package/dist/browser.js.map +2 -2
- package/dist/civet +3 -3
- package/dist/cli.js.map +2 -2
- package/dist/main.js +3 -1
- package/package.json +1 -1
- package/register.mjs +7 -6
package/dist/main.js
CHANGED
|
@@ -938,7 +938,9 @@ var require_parser = __commonJS({
|
|
|
938
938
|
}
|
|
939
939
|
}
|
|
940
940
|
var UnaryPostfix$0 = $EXPECT($L3, fail, 'UnaryPostfix "?"');
|
|
941
|
-
var UnaryPostfix$1 = $S(__, $EXPECT($L4, fail, 'UnaryPostfix "as"'), NonIdContinue, Type)
|
|
941
|
+
var UnaryPostfix$1 = $T($S(__, $EXPECT($L4, fail, 'UnaryPostfix "as"'), NonIdContinue, Type), function(value) {
|
|
942
|
+
return { "ts": true, "children": value };
|
|
943
|
+
});
|
|
942
944
|
function UnaryPostfix(state) {
|
|
943
945
|
if (state.tokenize) {
|
|
944
946
|
return $TOKEN("UnaryPostfix", state, UnaryPostfix$0(state) || UnaryPostfix$1(state));
|
package/package.json
CHANGED
package/register.mjs
CHANGED
|
@@ -7,23 +7,24 @@ const baseURL = pathToFileURL(process.cwd() + '/').href;
|
|
|
7
7
|
|
|
8
8
|
const extensionsRegex = /\.civet$/;
|
|
9
9
|
|
|
10
|
-
export async function resolve(specifier, context,
|
|
10
|
+
export async function resolve(specifier, context, next) {
|
|
11
11
|
const { parentURL = baseURL } = context;
|
|
12
12
|
|
|
13
13
|
if (extensionsRegex.test(specifier)) {
|
|
14
14
|
return {
|
|
15
|
-
|
|
15
|
+
shortCircuit: true,
|
|
16
|
+
format: "module",
|
|
16
17
|
url: new URL(specifier, parentURL).href,
|
|
17
18
|
};
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
// Let Node.js handle all other specifiers.
|
|
21
|
-
return
|
|
22
|
+
return next(specifier, context);
|
|
22
23
|
}
|
|
23
24
|
|
|
24
|
-
export async function load(url, context,
|
|
25
|
+
export async function load(url, context, next) {
|
|
25
26
|
if (extensionsRegex.test(url)) {
|
|
26
|
-
const { source: rawSource } = await
|
|
27
|
+
const { source: rawSource } = await next(url, { format: "module" });
|
|
27
28
|
|
|
28
29
|
return {
|
|
29
30
|
format: "module",
|
|
@@ -32,7 +33,7 @@ export async function load(url, context, defaultLoad) {
|
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
// Let Node.js handle all other URLs.
|
|
35
|
-
return
|
|
36
|
+
return next(url, context);
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
// Also transform CommonJS files.
|