oxc-transform 0.30.4 → 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.
Files changed (3) hide show
  1. package/LICENSE +2 -1
  2. package/index.d.ts +28 -22
  3. package/package.json +9 -9
package/LICENSE CHANGED
@@ -1,6 +1,7 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023-present Boshen
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 ArrowFunctionsBindingOptions {
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 Es2015BindingOptions {
15
+ export interface Es2015Options {
16
16
  /** Transform arrow functions into function expressions. */
17
- arrowFunction?: ArrowFunctionsBindingOptions
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 ReactBindingOptions {
47
+ export interface JsxOptions {
48
48
  /**
49
49
  * Decides which runtime to use.
50
50
  *
@@ -124,11 +124,17 @@ export interface ReactBindingOptions {
124
124
  * @default false
125
125
  */
126
126
  useSpread?: boolean
127
- /** Enable react fast refresh transform */
128
- refresh?: ReactRefreshBindingOptions
127
+ /**
128
+ * Enable React Fast Refresh .
129
+ *
130
+ * Conforms to the implementation in {@link https://github.com/facebook/react/tree/main/packages/react-refresh}
131
+ *
132
+ * @default false
133
+ */
134
+ refresh?: boolean | ReactRefreshOptions
129
135
  }
130
136
 
131
- export interface ReactRefreshBindingOptions {
137
+ export interface ReactRefreshOptions {
132
138
  /**
133
139
  * Specify the identifier of the refresh registration variable.
134
140
  *
@@ -176,23 +182,13 @@ export declare function transform(filename: string, sourceText: string, options?
176
182
  */
177
183
  export interface TransformOptions {
178
184
  sourceType?: 'script' | 'module' | 'unambiguous' | undefined
185
+ /** Treat the source text as `js`, `jsx`, `ts`, or `tsx`. */
186
+ lang?: 'js' | 'jsx' | 'ts' | 'tsx'
179
187
  /**
180
188
  * The current working directory. Used to resolve relative paths in other
181
189
  * options.
182
190
  */
183
191
  cwd?: string
184
- /**
185
- * Force jsx parsing,
186
- *
187
- * @default false
188
- */
189
- jsx?: boolean
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 TypeScriptBindingOptions#declaration}
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 TypeScriptBindingOptions#declaration declaration} and
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 TypeScriptBindingOptions {
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.30.4",
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.30.4",
27
- "@oxc-transform/binding-win32-arm64-msvc": "0.30.4",
28
- "@oxc-transform/binding-linux-x64-gnu": "0.30.4",
29
- "@oxc-transform/binding-linux-arm64-gnu": "0.30.4",
30
- "@oxc-transform/binding-linux-x64-musl": "0.30.4",
31
- "@oxc-transform/binding-linux-arm64-musl": "0.30.4",
32
- "@oxc-transform/binding-darwin-x64": "0.30.4",
33
- "@oxc-transform/binding-darwin-arm64": "0.30.4"
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
  }