oxc-transform 0.30.5 → 0.31.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/LICENSE +2 -1
- package/index.d.ts +21 -15
- package/package.json +9 -9
package/LICENSE
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2024-present VoidZero Inc. & Contributors
|
|
4
|
+
Copyright (c) 2023 Boshen
|
|
4
5
|
|
|
5
6
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
7
|
of this software and associated documentation files (the "Software"), to deal
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* auto-generated by NAPI-RS */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
export interface
|
|
3
|
+
export interface ArrowFunctionsOptions {
|
|
4
4
|
/**
|
|
5
5
|
* This option enables the following:
|
|
6
6
|
* * Wrap the generated function in .bind(this) and keeps uses of this inside the function as-is, instead of using a renamed this.
|
|
@@ -12,9 +12,9 @@ export interface ArrowFunctionsBindingOptions {
|
|
|
12
12
|
spec?: boolean
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export interface
|
|
15
|
+
export interface Es2015Options {
|
|
16
16
|
/** Transform arrow functions into function expressions. */
|
|
17
|
-
arrowFunction?:
|
|
17
|
+
arrowFunction?: ArrowFunctionsOptions
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
/** TypeScript Isolated Declarations for Standalone DTS Emit */
|
|
@@ -44,7 +44,7 @@ export interface IsolatedDeclarationsResult {
|
|
|
44
44
|
*
|
|
45
45
|
* @see {@link https://babeljs.io/docs/babel-plugin-transform-react-jsx#options}
|
|
46
46
|
*/
|
|
47
|
-
export interface
|
|
47
|
+
export interface JsxOptions {
|
|
48
48
|
/**
|
|
49
49
|
* Decides which runtime to use.
|
|
50
50
|
*
|
|
@@ -131,10 +131,10 @@ export interface ReactBindingOptions {
|
|
|
131
131
|
*
|
|
132
132
|
* @default false
|
|
133
133
|
*/
|
|
134
|
-
refresh?: boolean |
|
|
134
|
+
refresh?: boolean | ReactRefreshOptions
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
export interface
|
|
137
|
+
export interface ReactRefreshOptions {
|
|
138
138
|
/**
|
|
139
139
|
* Specify the identifier of the refresh registration variable.
|
|
140
140
|
*
|
|
@@ -182,17 +182,13 @@ export declare function transform(filename: string, sourceText: string, options?
|
|
|
182
182
|
*/
|
|
183
183
|
export interface TransformOptions {
|
|
184
184
|
sourceType?: 'script' | 'module' | 'unambiguous' | undefined
|
|
185
|
+
/** Treat the source text as `js`, `jsx`, `ts`, or `tsx`. */
|
|
186
|
+
lang?: 'js' | 'jsx' | 'ts' | 'tsx'
|
|
185
187
|
/**
|
|
186
188
|
* The current working directory. Used to resolve relative paths in other
|
|
187
189
|
* options.
|
|
188
190
|
*/
|
|
189
191
|
cwd?: string
|
|
190
|
-
/** Configure how TypeScript is transformed. */
|
|
191
|
-
typescript?: TypeScriptBindingOptions
|
|
192
|
-
/** Configure how TSX and JSX are transformed. */
|
|
193
|
-
react?: ReactBindingOptions
|
|
194
|
-
/** Enable ES2015 transformations. */
|
|
195
|
-
es2015?: ES2015BindingOptions
|
|
196
192
|
/**
|
|
197
193
|
* Enable source map generation.
|
|
198
194
|
*
|
|
@@ -203,6 +199,16 @@ export interface TransformOptions {
|
|
|
203
199
|
* @see {@link SourceMap}
|
|
204
200
|
*/
|
|
205
201
|
sourcemap?: boolean
|
|
202
|
+
/** Configure how TypeScript is transformed. */
|
|
203
|
+
typescript?: TypeScriptOptions
|
|
204
|
+
/** Configure how TSX and JSX are transformed. */
|
|
205
|
+
jsx?: JsxOptions
|
|
206
|
+
/** Enable ES2015 transformations. */
|
|
207
|
+
es2015?: Es2015Options
|
|
208
|
+
/** Define Plugin */
|
|
209
|
+
define?: Record<string, string>
|
|
210
|
+
/** Inject Plugin */
|
|
211
|
+
inject?: Record<string, string | [string, string]>
|
|
206
212
|
}
|
|
207
213
|
|
|
208
214
|
export interface TransformResult {
|
|
@@ -225,13 +231,13 @@ export interface TransformResult {
|
|
|
225
231
|
*
|
|
226
232
|
* If parsing failed and `declaration` is set, this will be an empty string.
|
|
227
233
|
*
|
|
228
|
-
* @see {@link
|
|
234
|
+
* @see {@link TypeScriptOptions#declaration}
|
|
229
235
|
* @see [declaration tsconfig option](https://www.typescriptlang.org/tsconfig/#declaration)
|
|
230
236
|
*/
|
|
231
237
|
declaration?: string
|
|
232
238
|
/**
|
|
233
239
|
* Declaration source map. Only generated if both
|
|
234
|
-
* {@link
|
|
240
|
+
* {@link TypeScriptOptions#declaration declaration} and
|
|
235
241
|
* {@link TransformOptions#sourcemap sourcemap} are set to `true`.
|
|
236
242
|
*/
|
|
237
243
|
declarationMap?: SourceMap
|
|
@@ -245,7 +251,7 @@ export interface TransformResult {
|
|
|
245
251
|
errors: Array<string>
|
|
246
252
|
}
|
|
247
253
|
|
|
248
|
-
export interface
|
|
254
|
+
export interface TypeScriptOptions {
|
|
249
255
|
jsxPragma?: string
|
|
250
256
|
jsxPragmaFrag?: string
|
|
251
257
|
onlyRemoveTypeImports?: boolean
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxc-transform",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.0",
|
|
4
4
|
"description": "Oxc transform Node API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"transform"
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
"index.js"
|
|
24
24
|
],
|
|
25
25
|
"optionalDependencies": {
|
|
26
|
-
"@oxc-transform/binding-win32-x64-msvc": "0.
|
|
27
|
-
"@oxc-transform/binding-win32-arm64-msvc": "0.
|
|
28
|
-
"@oxc-transform/binding-linux-x64-gnu": "0.
|
|
29
|
-
"@oxc-transform/binding-linux-arm64-gnu": "0.
|
|
30
|
-
"@oxc-transform/binding-linux-x64-musl": "0.
|
|
31
|
-
"@oxc-transform/binding-linux-arm64-musl": "0.
|
|
32
|
-
"@oxc-transform/binding-darwin-x64": "0.
|
|
33
|
-
"@oxc-transform/binding-darwin-arm64": "0.
|
|
26
|
+
"@oxc-transform/binding-win32-x64-msvc": "0.31.0",
|
|
27
|
+
"@oxc-transform/binding-win32-arm64-msvc": "0.31.0",
|
|
28
|
+
"@oxc-transform/binding-linux-x64-gnu": "0.31.0",
|
|
29
|
+
"@oxc-transform/binding-linux-arm64-gnu": "0.31.0",
|
|
30
|
+
"@oxc-transform/binding-linux-x64-musl": "0.31.0",
|
|
31
|
+
"@oxc-transform/binding-linux-arm64-musl": "0.31.0",
|
|
32
|
+
"@oxc-transform/binding-darwin-x64": "0.31.0",
|
|
33
|
+
"@oxc-transform/binding-darwin-arm64": "0.31.0"
|
|
34
34
|
}
|
|
35
35
|
}
|