@astrojs/compiler 0.25.2 → 0.26.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,26 @@
1
1
  # @astrojs/compiler
2
2
 
3
+ ## 0.26.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 920898c: Handle edge case with `noscript` tags
8
+ - 8ee78a6: handle slots that contains the head element
9
+ - 244e43e: Do not hoist import inside object
10
+ - b8cd954: Fix edge case with line comments and export hoisting
11
+ - 52ebfb7: Fix parse/tsx output to gracefully handle invalid HTML (style outside of body, etc)
12
+ - 884efc6: Fix edge case with multi-line export hoisting
13
+
14
+ ## 0.26.0
15
+
16
+ ### Minor Changes
17
+
18
+ - 0be58ab: Improve sourcemap support for TSX output
19
+
20
+ ### Patch Changes
21
+
22
+ - e065e29: Prevent head injection from removing script siblings
23
+
3
24
  ## 0.25.2
4
25
 
5
26
  ### Patch Changes
package/README.md CHANGED
@@ -56,6 +56,12 @@ walk(result.ast, (node) => {
56
56
  });
57
57
  ```
58
58
 
59
+ ## Develop
60
+
61
+ ### VSCode / CodeSpaces
62
+
63
+ A `devcontianer` configuration is available for use with VSCode's [Remote Development extension pack](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) and GitHub CodeSpaces.
64
+
59
65
  ## Contributing
60
66
 
61
67
  [CONTRIBUTING.md](./CONTRIBUTING.md)
package/astro.wasm CHANGED
Binary file
package/node/index.js CHANGED
@@ -52,6 +52,10 @@ const startRunningService = async () => {
52
52
  }
53
53
  }),
54
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 || {}))),
55
+ convertToTSX: (input, options) => {
56
+ return new Promise((resolve) => resolve(_service.convertToTSX(input, options || {}))).then((result) => {
57
+ return { ...result, map: JSON.parse(result.map) };
58
+ });
59
+ },
56
60
  };
57
61
  };
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.25.2",
8
+ "version": "0.26.1",
9
9
  "main": "./node/index.js",
10
10
  "types": "./node",
11
11
  "repository": {
@@ -27,6 +27,7 @@
27
27
  "./types": "./types.d.ts"
28
28
  },
29
29
  "devDependencies": {
30
+ "@jridgewell/trace-mapping": "^0.3.14",
30
31
  "@types/node": "^16.4.12",
31
32
  "@types/sass": "^1.43.1",
32
33
  "typescript": "^4.4.3"
package/shared/types.d.ts CHANGED
@@ -51,9 +51,17 @@ export interface TransformResult {
51
51
  scope: string;
52
52
  styleError: string[];
53
53
  }
54
+ export interface SourceMap {
55
+ file: string;
56
+ mappings: string;
57
+ names: string[];
58
+ sources: string[];
59
+ sourcesContent: string[];
60
+ version: number;
61
+ }
54
62
  export interface TSXResult {
55
63
  code: string;
56
- map: string;
64
+ map: SourceMap;
57
65
  }
58
66
  export interface ParseResult {
59
67
  ast: RootNode;