Skip to content

Commit eec3c80

Browse files
committed
build(deps): bump vue and TS versions
1 parent 60a714b commit eec3c80

File tree

4 files changed

+871
-771
lines changed

4 files changed

+871
-771
lines changed

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib"
3+
}

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@
4848
"@types/loader-utils": "^1.1.3",
4949
"@types/webpack": "^4.41.0",
5050
"@types/webpack-merge": "^4.1.5",
51-
"@vue/compiler-sfc": "^3.0.0-beta.9",
51+
"@vue/compiler-sfc": "^3.0.0-rc.6",
5252
"babel-loader": "^8.0.6",
5353
"cache-loader": "^4.1.0",
5454
"css-loader": "^3.3.2",
5555
"file-loader": "^5.0.2",
56-
"jest": "^25.5.4",
56+
"jest": "^26.4.1",
5757
"lint-staged": "^9.5.0",
5858
"memfs": "^3.1.2",
5959
"mini-css-extract-plugin": "^0.8.0",
@@ -62,10 +62,10 @@
6262
"pug-plain-loader": "^1.0.0",
6363
"stylus": "^0.54.7",
6464
"stylus-loader": "^3.0.2",
65-
"ts-jest": "^25.5.1",
66-
"typescript": "^3.7.3",
65+
"ts-jest": "^26.2.0",
66+
"typescript": "^4.0.2",
6767
"url-loader": "^3.0.0",
68-
"vue": "^3.0.0-beta.9",
68+
"vue": "^3.0.0-rc.6",
6969
"webpack": "^4.41.2",
7070
"webpack-cli": "^3.3.10",
7171
"webpack-dev-server": "^3.9.0",

src/formatError.ts

+14-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
import { generateCodeFrame, CompilerError } from '@vue/compiler-sfc'
22
import chalk from 'chalk'
33

4-
export function formatError(err: CompilerError, source: string, file: string) {
5-
if (err.loc) {
6-
const loc = `:${err.loc.start.line}:${err.loc.start.column}`
7-
const filePath = chalk.gray(`at ${file}${loc}`)
8-
const codeframe = generateCodeFrame(
9-
source,
10-
err.loc.start.offset,
11-
err.loc.end.offset
12-
)
13-
err.message = `\n${chalk.red(
14-
`VueCompilerError: ${err.message}`
15-
)}\n${filePath}\n${chalk.yellow(codeframe)}\n`
4+
export function formatError(
5+
err: SyntaxError | CompilerError,
6+
source: string,
7+
file: string
8+
) {
9+
const loc = (err as CompilerError).loc
10+
if (!loc) {
11+
return
1612
}
13+
const locString = `:${loc.start.line}:${loc.start.column}`
14+
const filePath = chalk.gray(`at ${file}${locString}`)
15+
const codeframe = generateCodeFrame(source, loc.start.offset, loc.end.offset)
16+
err.message = `\n${chalk.red(
17+
`VueCompilerError: ${err.message}`
18+
)}\n${filePath}\n${chalk.yellow(codeframe)}\n`
1719
}

0 commit comments

Comments
 (0)