@astrojs/compiler 0.14.3 → 0.15.0
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 +11 -0
- package/astro.wasm +0 -0
- package/node/index.d.ts +1 -0
- package/node/index.js +4 -0
- package/package.json +1 -1
- package/shared/types.d.ts +7 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @astrojs/compiler
|
|
2
2
|
|
|
3
|
+
## 0.15.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 702e848: Trailing space at the end of Astro files is now stripped from Component output.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 3a1a24b: Fix long-standing bug where a `class` attribute inside of a spread prop will cause duplicate `class` attributes
|
|
12
|
+
- 62faceb: Fixes an issue where curly braces in `<math>` elements would get parsed as expressions instead of raw text.
|
|
13
|
+
|
|
3
14
|
## 0.14.3
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/astro.wasm
CHANGED
|
Binary file
|
package/node/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ export type { PreprocessorResult, ParseOptions, TransformOptions, HoistedScript,
|
|
|
2
2
|
import type * as types from '../shared/types';
|
|
3
3
|
export declare const transform: typeof types.transform;
|
|
4
4
|
export declare const parse: typeof types.parse;
|
|
5
|
+
export declare const convertToTSX: typeof types.convertToTSX;
|
|
5
6
|
export declare const compile: (template: string) => Promise<string>;
|
package/node/index.js
CHANGED
|
@@ -7,6 +7,9 @@ export const transform = async (input, options) => {
|
|
|
7
7
|
export const parse = async (input, options) => {
|
|
8
8
|
return getService().then((service) => service.parse(input, options));
|
|
9
9
|
};
|
|
10
|
+
export const convertToTSX = async (input, options) => {
|
|
11
|
+
return getService().then((service) => service.convertToTSX(input, options));
|
|
12
|
+
};
|
|
10
13
|
export const compile = async (template) => {
|
|
11
14
|
const { default: mod } = await import(`data:text/javascript;charset=utf-8;base64,${Buffer.from(template).toString('base64')}`);
|
|
12
15
|
return mod;
|
|
@@ -49,5 +52,6 @@ const startRunningService = async () => {
|
|
|
49
52
|
}
|
|
50
53
|
}),
|
|
51
54
|
parse: (input, options) => new Promise((resolve) => resolve(_service.parse(input, options || {}))).then((result) => ({ ...result, ast: JSON.parse(result.ast) })),
|
|
55
|
+
convertToTSX: (input, options) => new Promise((resolve) => resolve(_service.convertToTSX(input, options || {}))),
|
|
52
56
|
};
|
|
53
57
|
};
|
package/package.json
CHANGED
package/shared/types.d.ts
CHANGED
|
@@ -36,11 +36,18 @@ export interface TransformResult {
|
|
|
36
36
|
code: string;
|
|
37
37
|
map: string;
|
|
38
38
|
}
|
|
39
|
+
export interface TSXResult {
|
|
40
|
+
code: string;
|
|
41
|
+
map: string;
|
|
42
|
+
}
|
|
39
43
|
export interface ParseResult {
|
|
40
44
|
ast: RootNode;
|
|
41
45
|
}
|
|
42
46
|
export declare function transform(input: string, options?: TransformOptions): Promise<TransformResult>;
|
|
43
47
|
export declare function parse(input: string, options?: ParseOptions): Promise<ParseResult>;
|
|
48
|
+
export declare function convertToTSX(input: string, options?: {
|
|
49
|
+
sourcefile?: string;
|
|
50
|
+
}): Promise<TSXResult>;
|
|
44
51
|
export declare function initialize(options: InitializeOptions): Promise<void>;
|
|
45
52
|
export interface InitializeOptions {
|
|
46
53
|
wasmURL?: string;
|