Ver código fonte

fix(compiler-vapor): TS error

三咲智子 Kevin Deng 2 anos atrás
pai
commit
1af1f40247

+ 4 - 2
packages/compiler-vapor/src/generate.ts

@@ -1,6 +1,7 @@
 import type {
   CodegenOptions as BaseCodegenOptions,
   BaseCodegenResult,
+  CodegenSourceMapGenerator,
 } from '@vue/compiler-dom'
 import type { IREffect, RootIRNode, VaporHelper } from './ir'
 import { SourceMapGenerator } from 'source-map-js'
@@ -24,7 +25,7 @@ export class CodegenContext {
   options: Required<CodegenOptions>
 
   code: CodeFragment[]
-  map?: SourceMapGenerator
+  map?: CodegenSourceMapGenerator
   push: (...args: CodeFragment[]) => void
 
   helpers = new Set<string>([])
@@ -93,7 +94,8 @@ export class CodegenContext {
     } = this
     if (!__BROWSER__ && sourceMap) {
       // 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._sources.add(filename)
     }

+ 0 - 1
packages/compiler-vapor/src/generators/utils.ts

@@ -148,7 +148,6 @@ export function genCodeFragment(context: CodegenContext) {
       generatedLine: pos.line,
       generatedColumn: pos.column - 1,
       source: context.options.filename,
-      // @ts-expect-error it is possible to be null
       name,
     })
   }

+ 0 - 1
scripts/release.js

@@ -413,7 +413,6 @@ async function isInSyncWithRemote() {
     console.error(
       pico.red('Failed to check whether local HEAD is up-to-date with remote.'),
     )
-    console.error(e)
     return false
   }
 }