-
Notifications
You must be signed in to change notification settings - Fork 919
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client): improve devtools and export constants (close #1625)
- Loading branch information
Showing
8 changed files
with
109 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import type { InspectorNodeConfig } from './types.js' | ||
|
||
export const PLUGIN_ID = 'org.vuejs.vuepress' | ||
export const PLUGIN_LABEL = 'VuePress' | ||
|
||
export const COMPONENT_STATE_TYPE = PLUGIN_LABEL | ||
|
||
export const INSPECTOR_ID = PLUGIN_ID | ||
export const INSPECTOR_LABEL = PLUGIN_LABEL | ||
|
||
const INSPECTOR_NODE_INTERNAL = { | ||
id: 'INTERNAL', | ||
label: 'Internal', | ||
keys: ['layouts', 'routes', 'redirects'], | ||
} as const satisfies InspectorNodeConfig | ||
|
||
const INSPECTOR_NODE_SITE = { | ||
id: 'SITE', | ||
label: 'Site', | ||
keys: ['siteData', 'siteLocaleData'], | ||
} as const satisfies InspectorNodeConfig | ||
|
||
const INSPECTOR_NODE_ROUTE = { | ||
id: 'ROUTE', | ||
label: 'Route', | ||
keys: ['routePath', 'routeLocale'], | ||
} as const satisfies InspectorNodeConfig | ||
|
||
const INSPECTOR_NODE_PAGE = { | ||
id: 'PAGE', | ||
label: 'Page', | ||
keys: [ | ||
'pageData', | ||
'pageFrontmatter', | ||
'pageLang', | ||
'pageHead', | ||
'pageHeadTitle', | ||
'pageLayout', | ||
'pageComponent', | ||
], | ||
} as const satisfies InspectorNodeConfig | ||
|
||
export const INSPECTOR_NODES = { | ||
[INSPECTOR_NODE_INTERNAL.id]: INSPECTOR_NODE_INTERNAL, | ||
[INSPECTOR_NODE_SITE.id]: INSPECTOR_NODE_SITE, | ||
[INSPECTOR_NODE_ROUTE.id]: INSPECTOR_NODE_ROUTE, | ||
[INSPECTOR_NODE_PAGE.id]: INSPECTOR_NODE_PAGE, | ||
} | ||
|
||
export const INSPECTOR_STATE_SECTION_NAME = 'State' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * as DEVTOOLS from './constants.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import type { CustomInspectorNode } from '@vue/devtools-kit' | ||
import type { ClientData } from '../types/index.js' | ||
|
||
export type ClientDataKey = keyof ClientData | ||
export type ClientDataValue = ClientData[ClientDataKey] | ||
|
||
export interface InspectorNodeConfig | ||
extends Pick<CustomInspectorNode, 'id' | 'label'> { | ||
keys: ClientDataKey[] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.