Skip to content

Commit a42a14d

Browse files
committed
types(compiler-sfc): type annotation tweaks + move @babel/types to devDeps
1 parent 7915a59 commit a42a14d

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

packages/compiler-sfc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
"homepage": "https://github.com/vuejs/vue-next/tree/master/packages/compiler-sfc#readme",
3434
"dependencies": {
3535
"@babel/parser": "^7.15.0",
36-
"@babel/types": "^7.15.0",
3736
"@types/estree": "^0.0.48",
3837
"@vue/compiler-core": "3.2.12",
3938
"@vue/compiler-dom": "3.2.12",
@@ -52,6 +51,7 @@
5251
"source-map": "^0.6.1"
5352
},
5453
"devDependencies": {
54+
"@babel/types": "^7.15.0",
5555
"@types/consolidate": "^0.14.0",
5656
"@types/lru-cache": "^5.1.0",
5757
"pug": "^3.0.1",

packages/compiler-sfc/src/compileScript.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export interface SFCScriptCompileOptions {
9898
/**
9999
* Compile the template and inline the resulting render function
100100
* directly inside setup().
101-
* - Only affects <script setup>
101+
* - Only affects `<script setup>`
102102
* - This should only be used in production because it prevents the template
103103
* from being hot-reloaded separately from component state.
104104
*/

packages/compiler-sfc/src/compileStyle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export interface SFCStyleCompileOptions {
3030
postcssOptions?: any
3131
postcssPlugins?: any[]
3232
/**
33-
* @deprecated
33+
* @deprecated use `inMap` instead.
3434
*/
3535
map?: RawSourceMap
3636
}

packages/compiler-sfc/src/parse.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
import * as CompilerDOM from '@vue/compiler-dom'
1010
import { RawSourceMap, SourceMapGenerator } from 'source-map'
1111
import { TemplateCompiler } from './compileTemplate'
12-
import { Statement } from '@babel/types'
1312
import { parseCssVars } from './cssVars'
1413
import { createCache } from './cache'
1514

@@ -41,8 +40,14 @@ export interface SFCScriptBlock extends SFCBlock {
4140
type: 'script'
4241
setup?: string | boolean
4342
bindings?: BindingMetadata
44-
scriptAst?: Statement[]
45-
scriptSetupAst?: Statement[]
43+
/**
44+
* import('\@babel/types').Statement
45+
*/
46+
scriptAst?: any[]
47+
/**
48+
* import('\@babel/types').Statement
49+
*/
50+
scriptSetupAst?: any[]
4651
}
4752
export interface SFCStyleBlock extends SFCBlock {
4853
type: 'style'

0 commit comments

Comments
 (0)