refactor: move codeframe to @vue/shared

This commit is contained in:
Evan You 2019-11-06 15:13:15 -05:00
parent d9c6ff372c
commit acbbe3298c
6 changed files with 5 additions and 8 deletions

View File

@ -99,7 +99,6 @@ export {
} from './errors' } from './errors'
export * from './ast' export * from './ast'
export * from './utils' export * from './utils'
export * from './codeframe'
export { registerRuntimeHelpers } from './runtimeHelpers' export { registerRuntimeHelpers } from './runtimeHelpers'
// expose transforms so higher-order compilers can import and extend them // expose transforms so higher-order compilers can import and extend them

View File

@ -23,14 +23,11 @@ import {
isObject, isObject,
NO, NO,
makeMap, makeMap,
isPromise isPromise,
generateCodeFrame
} from '@vue/shared' } from '@vue/shared'
import { SuspenseBoundary } from './components/Suspense' import { SuspenseBoundary } from './components/Suspense'
import { import { CompilerError, CompilerOptions } from '@vue/compiler-core'
CompilerError,
CompilerOptions,
generateCodeFrame
} from '@vue/compiler-dom'
export type Data = { [key: string]: unknown } export type Data = { [key: string]: unknown }

View File

@ -1,4 +1,4 @@
import { generateCodeFrame } from '../src' import { generateCodeFrame } from '../src/codeframe'
describe('compiler: codeframe', () => { describe('compiler: codeframe', () => {
const source = ` const source = `

View File

@ -3,6 +3,7 @@ import { makeMap } from './makeMap'
export { makeMap } export { makeMap }
export * from './patchFlags' export * from './patchFlags'
export { isGloballyWhitelisted } from './globalsWhitelist' export { isGloballyWhitelisted } from './globalsWhitelist'
export { generateCodeFrame } from './codeframe'
export const EMPTY_OBJ: { readonly [key: string]: any } = __DEV__ export const EMPTY_OBJ: { readonly [key: string]: any } = __DEV__
? Object.freeze({}) ? Object.freeze({})