@tsrx/react 0.1.20 → 0.1.21
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/package.json +2 -2
- package/src/index.js +3 -1
- package/src/transform.js +3 -0
- package/types/index.d.ts +3 -16
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "React compiler built on @tsrx/core",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Dominic Gannaway",
|
|
6
|
-
"version": "0.1.
|
|
6
|
+
"version": "0.1.21",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"publishConfig": {
|
|
9
9
|
"access": "public"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"esrap": "^2.1.0",
|
|
32
32
|
"zimmerframe": "^1.1.2",
|
|
33
|
-
"@tsrx/core": "0.0.
|
|
33
|
+
"@tsrx/core": "0.0.27"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"react": ">=18"
|
package/src/index.js
CHANGED
|
@@ -22,7 +22,7 @@ export function parse(source, filename, options) {
|
|
|
22
22
|
* @param {string} source
|
|
23
23
|
* @param {string} [filename]
|
|
24
24
|
* @param {{ collect?: boolean, loose?: boolean }} [options]
|
|
25
|
-
* @returns {{ code: string, map: any, css:
|
|
25
|
+
* @returns {{ code: string, map: any, css: string, cssHash: string | null, errors: CompileError[] }}
|
|
26
26
|
*/
|
|
27
27
|
export function compile(source, filename, options) {
|
|
28
28
|
const errors = /** @type {CompileError[]} */ ([]);
|
|
@@ -63,6 +63,8 @@ export function compile_to_volar_mappings(source, filename, options) {
|
|
|
63
63
|
const transformed = transform(ast, source, filename, {
|
|
64
64
|
collect: true,
|
|
65
65
|
loose: !!options?.loose,
|
|
66
|
+
moduleScopedHookComponents: false,
|
|
67
|
+
typeOnly: true,
|
|
66
68
|
errors,
|
|
67
69
|
comments,
|
|
68
70
|
});
|
package/src/transform.js
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -1,21 +1,8 @@
|
|
|
1
1
|
import type { Program } from 'estree';
|
|
2
|
-
import type {
|
|
2
|
+
import type { CompileFn, ParseOptions, VolarCompileFn } from '@tsrx/core/types';
|
|
3
3
|
|
|
4
4
|
export function parse(source: string, filename?: string, options?: ParseOptions): Program;
|
|
5
5
|
|
|
6
|
-
export
|
|
7
|
-
source: string,
|
|
8
|
-
filename?: string,
|
|
9
|
-
options?: { collect?: boolean; loose?: boolean },
|
|
10
|
-
): {
|
|
11
|
-
code: string;
|
|
12
|
-
map: unknown;
|
|
13
|
-
css: { code: string; hash: string } | null;
|
|
14
|
-
errors: CompileError[];
|
|
15
|
-
};
|
|
6
|
+
export const compile: CompileFn;
|
|
16
7
|
|
|
17
|
-
export
|
|
18
|
-
source: string,
|
|
19
|
-
filename?: string,
|
|
20
|
-
options?: ParseOptions,
|
|
21
|
-
): VolarMappingsResult;
|
|
8
|
+
export const compile_to_volar_mappings: VolarCompileFn;
|