@astrojs/compiler 0.14.3 → 0.15.2-pre.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 CHANGED
@@ -1,5 +1,22 @@
1
1
  # @astrojs/compiler
2
2
 
3
+ ## 0.15.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 26cbcdb: Prevent side-effectual CSS imports from becoming module metadata
8
+
9
+ ## 0.15.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 702e848: Trailing space at the end of Astro files is now stripped from Component output.
14
+
15
+ ### Patch Changes
16
+
17
+ - 3a1a24b: Fix long-standing bug where a `class` attribute inside of a spread prop will cause duplicate `class` attributes
18
+ - 62faceb: Fixes an issue where curly braces in `<math>` elements would get parsed as expressions instead of raw text.
19
+
3
20
  ## 0.14.3
4
21
 
5
22
  ### 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
@@ -5,7 +5,7 @@
5
5
  "type": "module",
6
6
  "bugs": "https://github.com/withastro/compiler/issues",
7
7
  "homepage": "https://astro.build",
8
- "version": "0.14.3",
8
+ "version": "0.15.2-pre.0",
9
9
  "scripts": {
10
10
  "build": "tsc -p ."
11
11
  },
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;