@astrojs/compiler 0.25.2 → 0.26.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 +10 -0
- package/README.md +6 -0
- package/astro.wasm +0 -0
- package/node/index.js +5 -1
- package/package.json +2 -1
- package/shared/types.d.ts +9 -1
package/CHANGELOG.md
CHANGED
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) =>
|
|
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.
|
|
8
|
+
"version": "0.26.0",
|
|
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:
|
|
64
|
+
map: SourceMap;
|
|
57
65
|
}
|
|
58
66
|
export interface ParseResult {
|
|
59
67
|
ast: RootNode;
|