Skip to content

Commit

Permalink
feat: add runtime data
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Oct 1, 2023
1 parent 1c2750b commit 3863505
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 19 deletions.
36 changes: 18 additions & 18 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion src/errors/errors.data.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { defineLoader } from 'vitepress'
import { errorMessages } from '@vue/compiler-core'
// @ts-expect-error internal api
import { ErrorTypeStrings } from '@vue/runtime-core'

function filterEmptyMsg(data: Record<number, string>) {
return Object.fromEntries(Object.entries(data).filter(([_, msg]) => msg))
Expand All @@ -8,7 +10,8 @@ function filterEmptyMsg(data: Record<number, string>) {
export default defineLoader({
load() {
return {
compiler: filterEmptyMsg(errorMessages)
compiler: filterEmptyMsg(errorMessages),
runtime: filterEmptyMsg(ErrorTypeStrings)
}
}
})
4 changes: 4 additions & 0 deletions src/errors/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ onMounted(() => {

# Error Reference {#error-reference}

## Runtime Errors {#runtime-errors}

<ErrorsTable kind="runtime" :errors="data.runtime" :highlight="highlight" />

## Compiler Errors {#compiler-errors}

<ErrorsTable kind="compiler" :errors="data.compiler" :highlight="highlight" />

0 comments on commit 3863505

Please sign in to comment.