@astrojs/compiler 0.3.7 → 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 +24 -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
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @astrojs/compiler
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 901faef: Passes projectRoot to createAstro
|
|
8
|
+
|
|
9
|
+
## 0.4.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 7e1aded: Change behavior of `as: "fragment"` option to support arbitrary `head` and `body` tags
|
|
14
|
+
|
|
15
|
+
## 0.3.9
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 2884a82: Bugfix: CSS comments insert semicolon
|
|
20
|
+
|
|
21
|
+
## 0.3.8
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- 2c8f5d8: Fix another component-only edge case
|
|
26
|
+
|
|
3
27
|
## 0.3.7
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
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 {
|