From 2c5549feaf5a563c689bac3c3db070bea3e48494 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 1 May 2024 01:30:39 +0800 Subject: [PATCH] fix: typos --- packages/client/src/setup/unocss-runtime.ts | 1 - packages/core/src/vite-bridge/client.ts | 4 ++-- packages/devtools-kit/global.d.ts | 2 +- packages/devtools-kit/src/compat/index.ts | 2 +- packages/devtools-kit/src/core/component/state/custom.ts | 4 ++-- packages/devtools-kit/src/core/index.ts | 4 ++-- packages/devtools-kit/src/state/app-record.ts | 2 +- packages/overlay/src/composables/bridge.ts | 6 +++--- 8 files changed, 12 insertions(+), 13 deletions(-) diff --git a/packages/client/src/setup/unocss-runtime.ts b/packages/client/src/setup/unocss-runtime.ts index 7ff113d3..d4e6405a 100644 --- a/packages/client/src/setup/unocss-runtime.ts +++ b/packages/client/src/setup/unocss-runtime.ts @@ -1,4 +1,3 @@ -// @ts-expect-error missin types import presetIcons from '@unocss/preset-icons/browser' import init from '@unocss/runtime' diff --git a/packages/core/src/vite-bridge/client.ts b/packages/core/src/vite-bridge/client.ts index 76a82f78..a7a21f62 100644 --- a/packages/core/src/vite-bridge/client.ts +++ b/packages/core/src/vite-bridge/client.ts @@ -6,8 +6,8 @@ async function getViteHotContext() { if (import.meta.url?.includes('chrome-extension://')) return - const viteCLient = await getViteClient(`${location.pathname.split('/__devtools__')[0] || ''}/`.replace(/\/\//g, '/'), false) - return viteCLient?.createHotContext('/____') + const viteClient = await getViteClient(`${location.pathname.split('/__devtools__')[0] || ''}/`.replace(/\/\//g, '/'), false) + return viteClient?.createHotContext('/____') } export async function initViteClientHotContext() { diff --git a/packages/devtools-kit/global.d.ts b/packages/devtools-kit/global.d.ts index b081824b..51b6af35 100644 --- a/packages/devtools-kit/global.d.ts +++ b/packages/devtools-kit/global.d.ts @@ -5,7 +5,7 @@ declare global { var __VUE_DEVTOOLS_GLOBAL_HOOK__: DevToolsHook var __VUE_DEVTOOLS_GLOBAL_STATE__: DevToolsState var __VUE_DEVTOOLS_CONTEXT__: DevToolsContext - var __VUE_DEVTOOLS_NEXT_APP_RECROD_INFO__: { + var __VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__: { id: number appIds: Set } diff --git a/packages/devtools-kit/src/compat/index.ts b/packages/devtools-kit/src/compat/index.ts index fabbbf66..023995e6 100644 --- a/packages/devtools-kit/src/compat/index.ts +++ b/packages/devtools-kit/src/compat/index.ts @@ -5,7 +5,7 @@ export function isLegacyVueDevTools() { return +(target.__VUE_DEVTOOLS_GLOBAL_HOOK__.devtoolsVersion?.[0] ?? 0) < 7 } -export function onLegacyDevToolsPluginApiAvailabled(cb: () => void) { +export function onLegacyDevToolsPluginApiAvailable(cb: () => void) { if (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__) { cb() return diff --git a/packages/devtools-kit/src/core/component/state/custom.ts b/packages/devtools-kit/src/core/component/state/custom.ts index d869435d..de9eca86 100644 --- a/packages/devtools-kit/src/core/component/state/custom.ts +++ b/packages/devtools-kit/src/core/component/state/custom.ts @@ -79,7 +79,7 @@ export function getSetDetails(val: Set) { } } -function getCatchedGetters(store) { +function getCaughtGetters(store) { const getters = {} const origGetters = store.getters || {} @@ -131,7 +131,7 @@ export function getStoreDetails(store) { displayText: 'Store', value: { state: store.state, - getters: getCatchedGetters(store), + getters: getCaughtGetters(store), }, fields: { abstract: true, diff --git a/packages/devtools-kit/src/core/index.ts b/packages/devtools-kit/src/core/index.ts index c85af3b1..d60884a0 100644 --- a/packages/devtools-kit/src/core/index.ts +++ b/packages/devtools-kit/src/core/index.ts @@ -3,7 +3,7 @@ import { createDevToolsHook, devtoolsHooks, hook, subscribeDevToolsHook } from ' import { DevToolsHooks } from '../types' import { devtoolsAppRecords, devtoolsState, getDevToolsEnv } from '../state' import { DevToolsEvents, DevToolsPluginApi, apiHooks, collectDevToolsPlugin, setupExternalPlugin } from '../api' -import { onLegacyDevToolsPluginApiAvailabled } from '../compat' +import { onLegacyDevToolsPluginApiAvailable } from '../compat' import { createAppRecord, setActiveAppRecord } from './app-record' export function initDevTools() { @@ -35,7 +35,7 @@ export function initDevTools() { setupExternalPlugin([pluginDescriptor, setupFn], app, api) }) - onLegacyDevToolsPluginApiAvailabled(() => { + onLegacyDevToolsPluginApiAvailable(() => { const normalizedPluginBuffer = devtoolsState.pluginBuffer.filter(([item]) => item.id !== 'components') normalizedPluginBuffer.forEach(([pluginDescriptor, setupFn]) => { target.__VUE_DEVTOOLS_GLOBAL_HOOK__.emit(DevToolsHooks.SETUP_DEVTOOLS_PLUGIN, pluginDescriptor, setupFn, { target: 'legacy' }) diff --git a/packages/devtools-kit/src/state/app-record.ts b/packages/devtools-kit/src/state/app-record.ts index 77fe1392..ee20f0e4 100644 --- a/packages/devtools-kit/src/state/app-record.ts +++ b/packages/devtools-kit/src/state/app-record.ts @@ -52,7 +52,7 @@ export const devtoolsAppRecords = new Proxy(devtoolsState.ap }, }) -export const appRecordInfo = target.__VUE_DEVTOOLS_NEXT_APP_RECROD_INFO__ ??= { +export const appRecordInfo = target.__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__ ??= { id: 0, appIds: new Set(), } diff --git a/packages/overlay/src/composables/bridge.ts b/packages/overlay/src/composables/bridge.ts index 57309686..92191dc3 100644 --- a/packages/overlay/src/composables/bridge.ts +++ b/packages/overlay/src/composables/bridge.ts @@ -1,16 +1,16 @@ import type { Bridge } from '@vue/devtools-core' import { shallowRef, watchEffect } from 'vue' -type BridgeTye = InstanceType +type BridgeType = InstanceType -const bridgeRef = shallowRef(null) +const bridgeRef = shallowRef(null) export function registerBridge(bridge: InstanceType) { bridgeRef.value = bridge } export function waitBridgeReady() { - return new Promise((resolve) => { + return new Promise((resolve) => { if (bridgeRef.value) resolve(bridgeRef.value) watchEffect(() => {