oxc-transform 0.38.0 → 0.40.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/index.d.ts +74 -3
- package/index.js +2 -0
- package/package.json +9 -9
package/index.d.ts
CHANGED
|
@@ -12,11 +12,60 @@ export interface ArrowFunctionsOptions {
|
|
|
12
12
|
spec?: boolean
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
export interface CompilerAssumptions {
|
|
16
|
+
ignoreFunctionLength?: boolean
|
|
17
|
+
noDocumentAll?: boolean
|
|
18
|
+
objectRestNoSymbols?: boolean
|
|
19
|
+
pureGetters?: boolean
|
|
20
|
+
setPublicClassFields?: boolean
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface Error {
|
|
24
|
+
severity: Severity
|
|
25
|
+
message: string
|
|
26
|
+
labels: Array<ErrorLabel>
|
|
27
|
+
helpMessage?: string
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface ErrorLabel {
|
|
31
|
+
message?: string
|
|
32
|
+
start: number
|
|
33
|
+
end: number
|
|
34
|
+
}
|
|
35
|
+
|
|
15
36
|
export interface Es2015Options {
|
|
16
37
|
/** Transform arrow functions into function expressions. */
|
|
17
38
|
arrowFunction?: ArrowFunctionsOptions
|
|
18
39
|
}
|
|
19
40
|
|
|
41
|
+
export declare const enum HelperMode {
|
|
42
|
+
/**
|
|
43
|
+
* Runtime mode (default): Helper functions are imported from a runtime package.
|
|
44
|
+
*
|
|
45
|
+
* Example:
|
|
46
|
+
*
|
|
47
|
+
* ```js
|
|
48
|
+
* import helperName from "@babel/runtime/helpers/helperName";
|
|
49
|
+
* helperName(...arguments);
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
Runtime = 'Runtime',
|
|
53
|
+
/**
|
|
54
|
+
* External mode: Helper functions are accessed from a global `babelHelpers` object.
|
|
55
|
+
*
|
|
56
|
+
* Example:
|
|
57
|
+
*
|
|
58
|
+
* ```js
|
|
59
|
+
* babelHelpers.helperName(...arguments);
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
External = 'External'
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface Helpers {
|
|
66
|
+
mode?: HelperMode
|
|
67
|
+
}
|
|
68
|
+
|
|
20
69
|
/** TypeScript Isolated Declarations for Standalone DTS Emit */
|
|
21
70
|
export declare function isolatedDeclaration(filename: string, sourceText: string, options?: IsolatedDeclarationsOptions | undefined | null): IsolatedDeclarationsResult
|
|
22
71
|
|
|
@@ -36,7 +85,7 @@ export interface IsolatedDeclarationsOptions {
|
|
|
36
85
|
export interface IsolatedDeclarationsResult {
|
|
37
86
|
code: string
|
|
38
87
|
map?: SourceMap
|
|
39
|
-
errors: Array<
|
|
88
|
+
errors: Array<Error>
|
|
40
89
|
}
|
|
41
90
|
|
|
42
91
|
/**
|
|
@@ -150,6 +199,12 @@ export interface ReactRefreshOptions {
|
|
|
150
199
|
emitFullSignatures?: boolean
|
|
151
200
|
}
|
|
152
201
|
|
|
202
|
+
export declare const enum Severity {
|
|
203
|
+
Error = 'Error',
|
|
204
|
+
Warning = 'Warning',
|
|
205
|
+
Advice = 'Advice'
|
|
206
|
+
}
|
|
207
|
+
|
|
153
208
|
export interface SourceMap {
|
|
154
209
|
file?: string
|
|
155
210
|
mappings: string
|
|
@@ -199,6 +254,8 @@ export interface TransformOptions {
|
|
|
199
254
|
* @see {@link SourceMap}
|
|
200
255
|
*/
|
|
201
256
|
sourcemap?: boolean
|
|
257
|
+
/** Set assumptions in order to produce smaller output. */
|
|
258
|
+
assumptions?: CompilerAssumptions
|
|
202
259
|
/** Configure how TypeScript is transformed. */
|
|
203
260
|
typescript?: TypeScriptOptions
|
|
204
261
|
/** Configure how TSX and JSX are transformed. */
|
|
@@ -215,9 +272,11 @@ export interface TransformOptions {
|
|
|
215
272
|
*
|
|
216
273
|
* @default `esnext` (No transformation)
|
|
217
274
|
*
|
|
218
|
-
* @see [esbuild#target](
|
|
275
|
+
* @see [esbuild#target](https://esbuild.github.io/api/#target)
|
|
219
276
|
*/
|
|
220
277
|
target?: string | Array<string>
|
|
278
|
+
/** Behaviour for runtime helpers. */
|
|
279
|
+
helpers?: Helpers
|
|
221
280
|
/** Define Plugin */
|
|
222
281
|
define?: Record<string, string>
|
|
223
282
|
/** Inject Plugin */
|
|
@@ -254,6 +313,18 @@ export interface TransformResult {
|
|
|
254
313
|
* {@link TransformOptions#sourcemap sourcemap} are set to `true`.
|
|
255
314
|
*/
|
|
256
315
|
declarationMap?: SourceMap
|
|
316
|
+
/**
|
|
317
|
+
* Helpers used.
|
|
318
|
+
*
|
|
319
|
+
* @internal
|
|
320
|
+
*
|
|
321
|
+
* Example:
|
|
322
|
+
*
|
|
323
|
+
* ```text
|
|
324
|
+
* { "_objectSpread": "@babel/runtime/helpers/objectSpread2" }
|
|
325
|
+
* ```
|
|
326
|
+
*/
|
|
327
|
+
helpersUsed: Record<string, string>
|
|
257
328
|
/**
|
|
258
329
|
* Parse and transformation errors.
|
|
259
330
|
*
|
|
@@ -261,7 +332,7 @@ export interface TransformResult {
|
|
|
261
332
|
* transformed code may still be available even if there are errors in this
|
|
262
333
|
* list.
|
|
263
334
|
*/
|
|
264
|
-
errors: Array<
|
|
335
|
+
errors: Array<Error>
|
|
265
336
|
}
|
|
266
337
|
|
|
267
338
|
export interface TypeScriptOptions {
|
package/index.js
CHANGED
|
@@ -361,5 +361,7 @@ if (!nativeBinding) {
|
|
|
361
361
|
throw new Error(`Failed to load native binding`)
|
|
362
362
|
}
|
|
363
363
|
|
|
364
|
+
module.exports.HelperMode = nativeBinding.HelperMode
|
|
364
365
|
module.exports.isolatedDeclaration = nativeBinding.isolatedDeclaration
|
|
366
|
+
module.exports.Severity = nativeBinding.Severity
|
|
365
367
|
module.exports.transform = nativeBinding.transform
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxc-transform",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.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.40.0",
|
|
27
|
+
"@oxc-transform/binding-win32-arm64-msvc": "0.40.0",
|
|
28
|
+
"@oxc-transform/binding-linux-x64-gnu": "0.40.0",
|
|
29
|
+
"@oxc-transform/binding-linux-arm64-gnu": "0.40.0",
|
|
30
|
+
"@oxc-transform/binding-linux-x64-musl": "0.40.0",
|
|
31
|
+
"@oxc-transform/binding-linux-arm64-musl": "0.40.0",
|
|
32
|
+
"@oxc-transform/binding-darwin-x64": "0.40.0",
|
|
33
|
+
"@oxc-transform/binding-darwin-arm64": "0.40.0"
|
|
34
34
|
}
|
|
35
35
|
}
|