@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 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
@@ -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
@@ -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": "1.2.2",
8
+ "version": "1.3.1",
9
9
  "main": "./node/index.js",
10
10
  "types": "./node",
11
11
  "repository": {
package/shared/types.d.ts CHANGED
@@ -72,6 +72,7 @@ export interface TransformResult {
72
72
  scripts: HoistedScript[];
73
73
  hydratedComponents: HydratedComponent[];
74
74
  clientOnlyComponents: HydratedComponent[];
75
+ containsHead: boolean;
75
76
  }
76
77
  export interface SourceMap {
77
78
  file: string;