@astrojs/compiler 0.4.0 → 0.5.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,11 @@
1
1
  # @astrojs/compiler
2
2
 
3
+ ## 0.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 901faef: Passes projectRoot to createAstro
8
+
3
9
  ## 0.4.0
4
10
 
5
11
  ### Minor 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.4.0",
4
+ "version": "0.5.0",
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 {