File tree Expand file tree Collapse file tree 3 files changed +6
-28
lines changed Expand file tree Collapse file tree 3 files changed +6
-28
lines changed Original file line number Diff line number Diff line change 1
1
import { parse } from '@babel/parser'
2
2
import { extend , isString } from '@vue/shared'
3
3
import { generate , type VaporCodegenResult } from './generate'
4
- import { IRNodeTypes , type HackOptions , type RootNode } from './ir'
4
+ import { IRNodeTypes , type RootNode } from './ir'
5
5
import {
6
6
transform ,
7
7
type DirectiveTransform ,
@@ -84,7 +84,7 @@ export function compile(
84
84
return generate ( ir , resolvedOptions )
85
85
}
86
86
87
- export type CompilerOptions = HackOptions < TransformOptions >
87
+ export type CompilerOptions = TransformOptions
88
88
export type TransformPreset = [
89
89
NodeTransform [ ] ,
90
90
Record < string , DirectiveTransform > ,
Original file line number Diff line number Diff line change 1
- import type { DirectiveTransform , NodeTransform } from '../transform'
2
1
import type { SimpleExpressionNode } from '../utils'
3
2
4
3
import type { IRProp , IRProps , IRSlots } from './component'
5
4
import type { JSXFragment , Node , SourceLocation } from '@babel/types'
6
- import type { Prettify } from '@vue/shared'
7
5
8
6
export * from './component'
9
7
@@ -284,19 +282,6 @@ export interface IREffect {
284
282
operations : OperationNode [ ]
285
283
}
286
284
287
- type Overwrite < T , U > = Pick < T , Exclude < keyof T , keyof U > > &
288
- Pick < U , Extract < keyof U , keyof T > >
289
-
290
- export type HackOptions < T > = Prettify <
291
- Overwrite <
292
- T ,
293
- {
294
- nodeTransforms ?: NodeTransform [ ]
295
- directiveTransforms ?: Record < string , DirectiveTransform | undefined >
296
- }
297
- >
298
- >
299
-
300
285
export type InsertionStateTypes =
301
286
| IfIRNode
302
287
| ForIRNode
Original file line number Diff line number Diff line change 3
3
DynamicFlag ,
4
4
IRNodeTypes ,
5
5
type BlockIRNode ,
6
- type HackOptions ,
7
6
type IRDynamicInfo ,
8
7
type IRSlots ,
9
8
type OperationNode ,
@@ -22,7 +21,7 @@ import {
22
21
type CompilerError ,
23
22
type SimpleExpressionNode ,
24
23
} from './utils'
25
- import type { ParserPlugin } from '@babel/parser '
24
+ import type { CodegenOptions } from './generate '
26
25
import type { JSXAttribute , JSXElement , JSXFragment } from '@babel/types'
27
26
28
27
export type NodeTransform = (
@@ -55,21 +54,14 @@ export type StructuralDirectiveTransform = (
55
54
context : TransformContext ,
56
55
) => void | ( ( ) => void )
57
56
58
- export type TransformOptions = HackOptions < {
57
+ export type TransformOptions = CodegenOptions & {
59
58
source ?: string
60
- templates ?: string [ ]
61
59
/**
62
60
* Whether to compile components to createComponentWithFallback.
63
61
* @default false
64
62
*/
65
63
withFallback ?: boolean
66
64
onError ?: ( error : CompilerError ) => void
67
- /**
68
- * A list of parser plugins to enable for `@babel/parser`, which is used to
69
- * parse expressions in bindings and interpolations.
70
- * https://babeljs.io/docs/en/next/babel-parser#plugins
71
- */
72
- expressionPlugins ?: ParserPlugin [ ]
73
65
/**
74
66
* An array of node transforms to be applied to every AST node.
75
67
*/
@@ -93,9 +85,10 @@ export type TransformOptions = HackOptions<{
93
85
* @default 'index.jsx'
94
86
*/
95
87
filename ?: string
96
- } >
88
+ }
97
89
const defaultOptions : Required < TransformOptions > = {
98
90
source : '' ,
91
+ sourceMap : false ,
99
92
filename : 'index.jsx' ,
100
93
nodeTransforms : [ ] ,
101
94
directiveTransforms : { } ,
You can’t perform that action at this time.
0 commit comments