@tsrx/react 0.2.28 → 0.2.29
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 +7 -3
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.2.
|
|
6
|
+
"version": "0.2.29",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"publishConfig": {
|
|
9
9
|
"access": "public"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"esrap": "^2.2.8",
|
|
39
39
|
"zimmerframe": "^1.1.2",
|
|
40
|
-
"@tsrx/core": "0.1.
|
|
40
|
+
"@tsrx/core": "0.1.29"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"react": ">=18"
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** @import * as AST from 'estree' */
|
|
2
2
|
/** @import { CompileError, ParseOptions } from '@tsrx/core/types' */
|
|
3
|
+
/** @import { NonEmptyString } from '@tsrx/core/types/helpers' */
|
|
3
4
|
|
|
4
5
|
import { createVolarMappingsResult, dedupeMappings, parseModule } from '@tsrx/core';
|
|
5
6
|
import { transform } from './transform.js';
|
|
@@ -8,8 +9,9 @@ export { isRefProp } from './ref.js';
|
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Parse tsrx-react source code to an ESTree AST.
|
|
12
|
+
* @template {string} T
|
|
11
13
|
* @param {string} source
|
|
12
|
-
* @param {
|
|
14
|
+
* @param {NonEmptyString<T>} filename
|
|
13
15
|
* @param {ParseOptions} [options]
|
|
14
16
|
* @returns {AST.Program}
|
|
15
17
|
*/
|
|
@@ -21,8 +23,9 @@ export function parse(source, filename, options) {
|
|
|
21
23
|
* Compile tsrx-react source code to a TSX/JSX module suitable for use with
|
|
22
24
|
* React's automatic jsx runtime (consumed by a downstream JSX transform).
|
|
23
25
|
*
|
|
26
|
+
* @template {string} T
|
|
24
27
|
* @param {string} source
|
|
25
|
-
* @param {
|
|
28
|
+
* @param {NonEmptyString<T>} filename
|
|
26
29
|
* @param {{ collect?: boolean, loose?: boolean }} [options]
|
|
27
30
|
* @returns {{ code: string, map: any, css: string, cssHash: string | null, errors: CompileError[] }}
|
|
28
31
|
*/
|
|
@@ -47,8 +50,9 @@ export function compile(source, filename, options) {
|
|
|
47
50
|
/**
|
|
48
51
|
* Compile tsrx-react source to virtual TSX plus Volar mappings for editor tooling.
|
|
49
52
|
*
|
|
53
|
+
* @template {string} T
|
|
50
54
|
* @param {string} source
|
|
51
|
-
* @param {
|
|
55
|
+
* @param {NonEmptyString<T>} filename
|
|
52
56
|
* @param {ParseOptions} [options]
|
|
53
57
|
* @returns {import('@tsrx/core/types').VolarMappingsResult}
|
|
54
58
|
*/
|