Skip to content

Commit

Permalink
build(deps): bump vue and TS versions
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Aug 20, 2020
1 parent 60a714b commit eec3c80
Show file tree
Hide file tree
Showing 4 changed files with 871 additions and 771 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@
"@types/loader-utils": "^1.1.3",
"@types/webpack": "^4.41.0",
"@types/webpack-merge": "^4.1.5",
"@vue/compiler-sfc": "^3.0.0-beta.9",
"@vue/compiler-sfc": "^3.0.0-rc.6",
"babel-loader": "^8.0.6",
"cache-loader": "^4.1.0",
"css-loader": "^3.3.2",
"file-loader": "^5.0.2",
"jest": "^25.5.4",
"jest": "^26.4.1",
"lint-staged": "^9.5.0",
"memfs": "^3.1.2",
"mini-css-extract-plugin": "^0.8.0",
Expand All @@ -62,10 +62,10 @@
"pug-plain-loader": "^1.0.0",
"stylus": "^0.54.7",
"stylus-loader": "^3.0.2",
"ts-jest": "^25.5.1",
"typescript": "^3.7.3",
"ts-jest": "^26.2.0",
"typescript": "^4.0.2",
"url-loader": "^3.0.0",
"vue": "^3.0.0-beta.9",
"vue": "^3.0.0-rc.6",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10",
"webpack-dev-server": "^3.9.0",
Expand Down
26 changes: 14 additions & 12 deletions src/formatError.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import { generateCodeFrame, CompilerError } from '@vue/compiler-sfc'
import chalk from 'chalk'

export function formatError(err: CompilerError, source: string, file: string) {
if (err.loc) {
const loc = `:${err.loc.start.line}:${err.loc.start.column}`
const filePath = chalk.gray(`at ${file}${loc}`)
const codeframe = generateCodeFrame(
source,
err.loc.start.offset,
err.loc.end.offset
)
err.message = `\n${chalk.red(
`VueCompilerError: ${err.message}`
)}\n${filePath}\n${chalk.yellow(codeframe)}\n`
export function formatError(
err: SyntaxError | CompilerError,
source: string,
file: string
) {
const loc = (err as CompilerError).loc
if (!loc) {
return
}
const locString = `:${loc.start.line}:${loc.start.column}`
const filePath = chalk.gray(`at ${file}${locString}`)
const codeframe = generateCodeFrame(source, loc.start.offset, loc.end.offset)
err.message = `\n${chalk.red(
`VueCompilerError: ${err.message}`
)}\n${filePath}\n${chalk.yellow(codeframe)}\n`
}
Loading

0 comments on commit eec3c80

Please sign in to comment.