@astrojs/compiler 1.2.2 → 1.3.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 +13 -0
- package/astro.wasm +0 -0
- package/browser/index.d.ts +1 -0
- package/browser/index.js +7 -0
- package/package.json +1 -1
- package/shared/types.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @astrojs/compiler
|
|
2
2
|
|
|
3
|
+
## 1.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e0baa85: Preserve whitespace in slots
|
|
8
|
+
|
|
9
|
+
## 1.3.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 95a6610: Expose the `convertToTSX` function in the compiler browser bundle
|
|
14
|
+
- 6d168dd: Add ContainsHead flag for metadata
|
|
15
|
+
|
|
3
16
|
## 1.2.2
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/astro.wasm
CHANGED
|
Binary file
|
package/browser/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type * as types from '../shared/types';
|
|
2
2
|
export declare const transform: typeof types.transform;
|
|
3
3
|
export declare const parse: typeof types.parse;
|
|
4
|
+
export declare const convertToTSX: typeof types.convertToTSX;
|
|
4
5
|
export declare const teardown: typeof types.teardown;
|
|
5
6
|
export declare const initialize: typeof types.initialize;
|
package/browser/index.js
CHANGED
|
@@ -5,6 +5,9 @@ export const transform = (input, options) => {
|
|
|
5
5
|
export const parse = (input, options) => {
|
|
6
6
|
return ensureServiceIsRunning().parse(input, options);
|
|
7
7
|
};
|
|
8
|
+
export const convertToTSX = (input, options) => {
|
|
9
|
+
return ensureServiceIsRunning().convertToTSX(input, options);
|
|
10
|
+
};
|
|
8
11
|
let initializePromise;
|
|
9
12
|
let longLivedService;
|
|
10
13
|
export const teardown = () => {
|
|
@@ -55,6 +58,10 @@ const startRunningService = async (wasmURL) => {
|
|
|
55
58
|
const service = globalThis['@astrojs/compiler'];
|
|
56
59
|
return {
|
|
57
60
|
transform: (input, options) => new Promise((resolve) => resolve(service.transform(input, options || {}))),
|
|
61
|
+
convertToTSX: (input, options) => new Promise((resolve) => resolve(service.convertToTSX(input, options || {}))).then((result) => ({
|
|
62
|
+
...result,
|
|
63
|
+
map: JSON.parse(result.map),
|
|
64
|
+
})),
|
|
58
65
|
parse: (input, options) => new Promise((resolve) => resolve(service.parse(input, options || {}))).then((result) => ({ ...result, ast: JSON.parse(result.ast) })),
|
|
59
66
|
};
|
|
60
67
|
};
|
package/package.json
CHANGED
package/shared/types.d.ts
CHANGED