@astrojs/compiler 0.3.9 → 0.5.2

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,29 @@
1
1
  # @astrojs/compiler
2
2
 
3
+ ## 0.5.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 8f0e3d7: Fix fragment parsing bugs when frontmatter is missing or top-level expressions are present
8
+
9
+ ## 0.5.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 1f0ba41: Fix bug when fragment parsing frontmatter is missing
14
+
15
+ ## 0.5.0
16
+
17
+ ### Minor Changes
18
+
19
+ - 901faef: Passes projectRoot to createAstro
20
+
21
+ ## 0.4.0
22
+
23
+ ### Minor Changes
24
+
25
+ - 7e1aded: Change behavior of `as: "fragment"` option to support arbitrary `head` and `body` tags
26
+
3
27
  ## 0.3.9
4
28
 
5
29
  ### Patch Changes
package/README.md CHANGED
@@ -1,5 +1,30 @@
1
- # @astrojs/compiler
1
+ # Astro Compiler
2
2
 
3
- Experimental WASM compiler for Astro.
3
+ Astro’s [Go](https://golang.org/) + WASM compiler.
4
4
 
5
- This barely works, so probably don't use this package!
5
+ ⚠️ Currently in beta!
6
+
7
+ ## Install
8
+
9
+ ```
10
+ npm install @astrojs/compiler
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ _Note: API will change before 1.0! Use at your own discretion._
16
+
17
+ ```js
18
+ import { transform } from '@astrojs/compiler';
19
+
20
+ const result = await transform(source, {
21
+ site: 'https://mysite.dev',
22
+ sourcefile: '/Users/astro/Code/project/src/pages/index.astro',
23
+ sourcemap: 'both',
24
+ internalURL: 'astro/internal',
25
+ });
26
+ ```
27
+
28
+ ## Contributing
29
+
30
+ [CONTRIBUTING.md](./CONTRIBUTING.md)
package/astro.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,12 +1,16 @@
1
1
  {
2
2
  "name": "@astrojs/compiler",
3
3
  "type": "module",
4
- "version": "0.3.9",
4
+ "version": "0.5.2",
5
5
  "scripts": {
6
6
  "build": "tsc -p ."
7
7
  },
8
8
  "main": "./node/index.js",
9
9
  "types": "./shared/types.d.ts",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/withastro/compiler.git"
13
+ },
10
14
  "exports": {
11
15
  ".": {
12
16
  "browser": "./browser/index.js",
package/shared/types.d.ts CHANGED
@@ -8,6 +8,7 @@ export interface TransformOptions {
8
8
  sourcefile?: string;
9
9
  sourcemap?: boolean | 'inline' | 'external' | 'both';
10
10
  as?: 'document' | 'fragment';
11
+ projectRoot?: string;
11
12
  preprocessStyle?: (content: string, attrs: Record<string, string>) => Promise<PreprocessorResult>;
12
13
  }
13
14
  export interface TransformResult {