@astrojs/compiler 1.4.0 → 1.4.1
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 +6 -0
- package/node/index.js +12 -2
- package/node/sync.cjs +14 -4
- package/node/sync.cts +14 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/node/index.js
CHANGED
|
@@ -55,9 +55,19 @@ const startRunningService = async () => {
|
|
|
55
55
|
throw err;
|
|
56
56
|
}
|
|
57
57
|
}),
|
|
58
|
-
parse: (input, options) => new Promise((resolve) => resolve(_service.parse(input, options || {})))
|
|
58
|
+
parse: (input, options) => new Promise((resolve) => resolve(_service.parse(input, options || {})))
|
|
59
|
+
.catch((error) => {
|
|
60
|
+
longLivedService = void 0;
|
|
61
|
+
throw error;
|
|
62
|
+
})
|
|
63
|
+
.then((result) => ({ ...result, ast: JSON.parse(result.ast) })),
|
|
59
64
|
convertToTSX: (input, options) => {
|
|
60
|
-
return new Promise((resolve) => resolve(_service.convertToTSX(input, options || {})))
|
|
65
|
+
return new Promise((resolve) => resolve(_service.convertToTSX(input, options || {})))
|
|
66
|
+
.catch((error) => {
|
|
67
|
+
longLivedService = void 0;
|
|
68
|
+
throw error;
|
|
69
|
+
})
|
|
70
|
+
.then((result) => {
|
|
61
71
|
return { ...result, map: JSON.parse(result.map) };
|
|
62
72
|
});
|
|
63
73
|
},
|
package/node/sync.cjs
CHANGED
|
@@ -510,12 +510,22 @@ function startRunningService() {
|
|
|
510
510
|
}
|
|
511
511
|
},
|
|
512
512
|
parse: (input, options) => {
|
|
513
|
-
|
|
514
|
-
|
|
513
|
+
try {
|
|
514
|
+
const result = _service.parse(input, options || {});
|
|
515
|
+
return { ...result, ast: JSON.parse(result.ast) };
|
|
516
|
+
} catch (err) {
|
|
517
|
+
longLivedService = void 0;
|
|
518
|
+
throw err;
|
|
519
|
+
}
|
|
515
520
|
},
|
|
516
521
|
convertToTSX: (input, options) => {
|
|
517
|
-
|
|
518
|
-
|
|
522
|
+
try {
|
|
523
|
+
const result = _service.convertToTSX(input, options || {});
|
|
524
|
+
return { ...result, map: JSON.parse(result.map) };
|
|
525
|
+
} catch (err) {
|
|
526
|
+
longLivedService = void 0;
|
|
527
|
+
throw err;
|
|
528
|
+
}
|
|
519
529
|
}
|
|
520
530
|
};
|
|
521
531
|
}
|
package/node/sync.cts
CHANGED
|
@@ -46,12 +46,22 @@ export function startRunningService(): Service {
|
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
parse: (input, options) => {
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
try {
|
|
50
|
+
const result = _service.parse(input, options || {});
|
|
51
|
+
return { ...result, ast: JSON.parse(result.ast) };
|
|
52
|
+
} catch (err) {
|
|
53
|
+
longLivedService = void 0;
|
|
54
|
+
throw err;
|
|
55
|
+
}
|
|
51
56
|
},
|
|
52
57
|
convertToTSX: (input, options) => {
|
|
53
|
-
|
|
54
|
-
|
|
58
|
+
try {
|
|
59
|
+
const result = _service.convertToTSX(input, options || {});
|
|
60
|
+
return { ...result, map: JSON.parse(result.map) };
|
|
61
|
+
} catch (err) {
|
|
62
|
+
longLivedService = void 0;
|
|
63
|
+
throw err;
|
|
64
|
+
}
|
|
55
65
|
},
|
|
56
66
|
};
|
|
57
67
|
}
|