-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
78 changed files
with
166 additions
and
141 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 |
---|---|---|
|
@@ -11,4 +11,7 @@ export default antfu( | |
'vue/no-v-text-v-html-on-component': 'off', | ||
}, | ||
}, | ||
{ | ||
ignores: ['**/foo/**'], | ||
}, | ||
) |
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
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
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -1,36 +1,58 @@ | ||
import type { NuxtDevToolsOptions } from '../../types' | ||
import { toRefs, watchDebounced } from '@vueuse/core' | ||
|
||
// Assets | ||
const assetsOptions = ref(await rpc.getOptions('assets')) | ||
const assets = toRefs(assetsOptions) | ||
|
||
watchDebounced(assetsOptions, async (options) => { | ||
rpc.updateOptions('assets', options) | ||
}, { deep: true, flush: 'post', debounce: 500, maxWait: 1000 }) | ||
|
||
// Server Routes | ||
const serverRouteOptions = ref(await rpc.getOptions('serverRoutes')) | ||
const serverRoutes = toRefs(serverRouteOptions) | ||
|
||
watchDebounced(serverRouteOptions, async (options) => { | ||
rpc.updateOptions('serverRoutes', options) | ||
}, { deep: true, flush: 'post', debounce: 500, maxWait: 1000 }) | ||
|
||
// Server Tasks | ||
const serverTasksOptions = ref(await rpc.getOptions('serverTasks')) | ||
const serverTasks = toRefs(serverTasksOptions) | ||
|
||
watchDebounced(serverTasksOptions, async (options) => { | ||
rpc.updateOptions('serverTasks', options) | ||
}, { deep: true, flush: 'post', debounce: 500, maxWait: 1000 }) | ||
|
||
// Options List | ||
const list = { | ||
serverRoutes, | ||
serverTasks, | ||
assets, | ||
import { ref } from 'vue' | ||
import { defaultTabOptions } from '../../src/constant' | ||
import { rpc } from './rpc' | ||
|
||
let instance: ReturnType<typeof init> | null = null | ||
|
||
function init() { | ||
// Assets | ||
const assetsOptions = ref<NuxtDevToolsOptions['assets']>(defaultTabOptions.assets) | ||
rpc.getOptions('assets').then((options) => { | ||
assetsOptions.value = options | ||
}) | ||
const assets = toRefs(assetsOptions) | ||
|
||
watchDebounced(assetsOptions, async (options) => { | ||
rpc.updateOptions('assets', options) | ||
}, { deep: true, flush: 'post', debounce: 500, maxWait: 1000 }) | ||
|
||
// Server Routes | ||
const serverRouteOptions = ref<NuxtDevToolsOptions['serverRoutes']>(defaultTabOptions.serverRoutes) | ||
rpc.getOptions('serverRoutes').then((options) => { | ||
serverRouteOptions.value = options | ||
}) | ||
const serverRoutes = toRefs(serverRouteOptions) | ||
|
||
watchDebounced(serverRouteOptions, async (options) => { | ||
rpc.updateOptions('serverRoutes', options) | ||
}, { deep: true, flush: 'post', debounce: 500, maxWait: 1000 }) | ||
|
||
// Server Tasks | ||
const serverTasksOptions = ref<NuxtDevToolsOptions['serverTasks']>(defaultTabOptions.serverTasks) | ||
rpc.getOptions('serverTasks').then((options) => { | ||
serverTasksOptions.value = options | ||
}) | ||
const serverTasks = toRefs(serverTasksOptions) | ||
|
||
watchDebounced(serverTasksOptions, async (options) => { | ||
rpc.updateOptions('serverTasks', options) | ||
}, { deep: true, flush: 'post', debounce: 500, maxWait: 1000 }) | ||
|
||
// Options List | ||
const list = { | ||
serverRoutes, | ||
serverTasks, | ||
assets, | ||
} | ||
|
||
return list | ||
} | ||
|
||
export function useDevToolsOptions<T extends keyof typeof list>(tab: T) { | ||
return list[tab] | ||
export function useDevToolsOptions<T extends keyof ReturnType<typeof init>>(tab: T) { | ||
if (!instance) { | ||
instance = init() | ||
} | ||
return instance[tab] | ||
} |
Oops, something went wrong.