mirror of https://github.com/vuejs/core.git
fix(compiler-vapor): TS error
This commit is contained in:
parent
98b701c82c
commit
1af1f40247
|
@ -1,6 +1,7 @@
|
||||||
import type {
|
import type {
|
||||||
CodegenOptions as BaseCodegenOptions,
|
CodegenOptions as BaseCodegenOptions,
|
||||||
BaseCodegenResult,
|
BaseCodegenResult,
|
||||||
|
CodegenSourceMapGenerator,
|
||||||
} from '@vue/compiler-dom'
|
} from '@vue/compiler-dom'
|
||||||
import type { IREffect, RootIRNode, VaporHelper } from './ir'
|
import type { IREffect, RootIRNode, VaporHelper } from './ir'
|
||||||
import { SourceMapGenerator } from 'source-map-js'
|
import { SourceMapGenerator } from 'source-map-js'
|
||||||
|
@ -24,7 +25,7 @@ export class CodegenContext {
|
||||||
options: Required<CodegenOptions>
|
options: Required<CodegenOptions>
|
||||||
|
|
||||||
code: CodeFragment[]
|
code: CodeFragment[]
|
||||||
map?: SourceMapGenerator
|
map?: CodegenSourceMapGenerator
|
||||||
push: (...args: CodeFragment[]) => void
|
push: (...args: CodeFragment[]) => void
|
||||||
|
|
||||||
helpers = new Set<string>([])
|
helpers = new Set<string>([])
|
||||||
|
@ -93,7 +94,8 @@ export class CodegenContext {
|
||||||
} = this
|
} = this
|
||||||
if (!__BROWSER__ && sourceMap) {
|
if (!__BROWSER__ && sourceMap) {
|
||||||
// lazy require source-map implementation, only in non-browser builds
|
// lazy require source-map implementation, only in non-browser builds
|
||||||
this.map = new SourceMapGenerator()
|
this.map =
|
||||||
|
new SourceMapGenerator() as unknown as CodegenSourceMapGenerator
|
||||||
this.map.setSourceContent(filename, ir.source)
|
this.map.setSourceContent(filename, ir.source)
|
||||||
this.map._sources.add(filename)
|
this.map._sources.add(filename)
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,7 +148,6 @@ export function genCodeFragment(context: CodegenContext) {
|
||||||
generatedLine: pos.line,
|
generatedLine: pos.line,
|
||||||
generatedColumn: pos.column - 1,
|
generatedColumn: pos.column - 1,
|
||||||
source: context.options.filename,
|
source: context.options.filename,
|
||||||
// @ts-expect-error it is possible to be null
|
|
||||||
name,
|
name,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -413,7 +413,6 @@ async function isInSyncWithRemote() {
|
||||||
console.error(
|
console.error(
|
||||||
pico.red('Failed to check whether local HEAD is up-to-date with remote.'),
|
pico.red('Failed to check whether local HEAD is up-to-date with remote.'),
|
||||||
)
|
)
|
||||||
console.error(e)
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue