@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 +6 -0
- package/README.md +28 -3
- package/astro.wasm +0 -0
- package/package.json +5 -1
- package/shared/types.d.ts +1 -0
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Astro Compiler
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Astro’s [Go](https://golang.org/) + WASM compiler.
|
|
4
4
|
|
|
5
|
-
|
|
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
|
+
"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 {
|