From 808e493b01a439859df700c2e75d7b7df0dd3789 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Thu, 19 Sep 2024 16:04:15 +0200 Subject: [PATCH] chore: reorder imports --- docs/content/2.module/0.guide.md | 4 +- docs/tailwind.config.ts | 2 +- eslint.config.mjs | 3 + local.ts | 2 +- packages/devtools-kit/src/index.ts | 4 +- .../devtools-kit/src/runtime/host-client.ts | 2 +- .../devtools-kit/src/runtime/iframe-client.ts | 2 +- .../src/components/NCodeBlock.vue | 2 +- .../src/components/NNotification.vue | 4 +- packages/devtools-ui-kit/src/unocss.ts | 6 +- .../client/components/AssetDetails.vue | 2 +- .../client/components/AssetFontPreview.vue | 2 +- .../client/components/BuildAnalyzeDetails.vue | 2 +- .../devtools/client/components/CodeDiff.vue | 2 +- .../client/components/ComponentDetails.vue | 2 +- .../client/components/ComponentName.vue | 2 +- .../client/components/ComponentsGraph.vue | 2 +- .../client/components/ComponentsList.vue | 2 +- .../client/components/CronCollection.vue | 2 +- .../client/components/DataSchemaDrawer.vue | 2 +- .../client/components/ModuleInstallList.vue | 2 +- .../components/OpenGraphMissingTabs.vue | 4 +- .../client/components/ServerRouteDetails.vue | 4 +- .../client/components/ServerTaskDetails.vue | 4 +- .../client/components/SideNavItem.vue | 2 +- .../client/components/TerminalView.vue | 2 +- .../client/components/TimelineTable.vue | 2 +- packages/devtools/client/composables/npm.ts | 2 +- packages/devtools/client/composables/rpc.ts | 2 +- .../client/composables/state-commands.ts | 2 +- .../devtools/client/composables/state-tabs.ts | 2 +- packages/devtools/client/composables/state.ts | 2 +- .../client/composables/storage-options.ts | 86 ++++++++++++------- .../devtools/client/composables/storage.ts | 2 +- packages/devtools/client/composables/utils.ts | 2 +- packages/devtools/client/modules/markdown.ts | 2 +- .../client/pages/modules/analyze-build.vue | 2 +- .../devtools/client/pages/modules/assets.vue | 2 +- .../devtools/client/pages/modules/imports.vue | 2 +- .../client/pages/modules/server-routes.vue | 2 +- .../client/pages/modules/server-tasks.vue | 2 +- packages/devtools/src/constant.ts | 2 +- .../src/integrations/analyze-build.ts | 4 +- .../devtools/src/integrations/timeline.ts | 4 +- .../devtools/src/integrations/vite-inspect.ts | 4 +- packages/devtools/src/integrations/vscode.ts | 2 +- .../devtools/src/integrations/vue-devtools.ts | 2 +- .../src/integrations/vue-inspector.ts | 4 +- packages/devtools/src/module-main.ts | 8 +- packages/devtools/src/module.ts | 2 +- packages/devtools/src/npm/index.ts | 2 +- .../src/runtime/function-metrics-helpers.ts | 2 +- packages/devtools/src/runtime/nitro/inline.ts | 4 +- .../src/runtime/plugins/devtools.client.ts | 4 +- .../src/runtime/plugins/devtools.server.ts | 2 +- .../src/runtime/plugins/view/FrameBox.vue | 2 +- .../src/runtime/plugins/view/Main.vue | 2 +- .../src/runtime/plugins/view/client.ts | 10 +-- .../src/runtime/plugins/view/state.ts | 2 +- .../src/runtime/plugins/view/utils.ts | 2 +- packages/devtools/src/runtime/settings.ts | 4 +- .../devtools/src/runtime/use-nuxt-devtools.ts | 2 +- .../devtools/src/server-rpc/analyze-build.ts | 4 +- packages/devtools/src/server-rpc/assets.ts | 2 +- packages/devtools/src/server-rpc/general.ts | 10 +-- packages/devtools/src/server-rpc/index.ts | 12 +-- packages/devtools/src/server-rpc/npm.ts | 4 +- packages/devtools/src/server-rpc/options.ts | 2 +- .../devtools/src/server-rpc/server-routes.ts | 2 +- .../devtools/src/server-rpc/server-tasks.ts | 2 +- packages/devtools/src/server-rpc/telemetry.ts | 2 +- packages/devtools/src/server-rpc/timeline.ts | 2 +- packages/devtools/src/server-rpc/wizard.ts | 2 +- packages/devtools/src/utils/fs.ts | 2 +- packages/devtools/src/wizard/enable-pages.ts | 2 +- .../module-starter/client/pages/index.vue | 2 +- playgrounds/module-starter/src/devtools.ts | 2 +- playgrounds/module-starter/src/module.ts | 2 +- 78 files changed, 166 insertions(+), 141 deletions(-) diff --git a/docs/content/2.module/0.guide.md b/docs/content/2.module/0.guide.md index f2d28b66c..4c588734a 100644 --- a/docs/content/2.module/0.guide.md +++ b/docs/content/2.module/0.guide.md @@ -128,9 +128,9 @@ export interface ClientFunctions { And then in your module code: ```ts +import type { ClientFunctions, ServerFunctions } from './rpc-types' import { extendServerRpc, onDevToolsInitialized } from '@nuxt/devtools-kit' import { defineNuxtModule } from '@nuxt/kit' -import type { ClientFunctions, ServerFunctions } from './rpc-types' const RPC_NAMESPACE = 'my-module-rpc' @@ -156,8 +156,8 @@ export default defineNuxtModule({ And on the embedded iframe client side, you can do: ```ts -import { onDevtoolsClientConnected } from '@nuxt/devtools-kit/iframe-client' import type { ClientFunctions, ServerFunctions } from './rpc-types' +import { onDevtoolsClientConnected } from '@nuxt/devtools-kit/iframe-client' const RPC_NAMESPACE = 'my-module-rpc' diff --git a/docs/tailwind.config.ts b/docs/tailwind.config.ts index b88541569..cfd458a3d 100644 --- a/docs/tailwind.config.ts +++ b/docs/tailwind.config.ts @@ -1,5 +1,5 @@ -import defaultTheme from 'tailwindcss/defaultTheme' import type { Config } from 'tailwindcss' +import defaultTheme from 'tailwindcss/defaultTheme' export default >{ theme: { diff --git a/eslint.config.mjs b/eslint.config.mjs index 09f35014b..e8b9f54d9 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -11,4 +11,7 @@ export default antfu( 'vue/no-v-text-v-html-on-component': 'off', }, }, + { + ignores: ['**/foo/**'], + }, ) diff --git a/local.ts b/local.ts index 2d5aaf902..f4432a9aa 100644 --- a/local.ts +++ b/local.ts @@ -1,3 +1,4 @@ +import type { ModuleOptions } from './packages/devtools/src/types' /** * Local development module entry * @@ -25,7 +26,6 @@ import { defaultOptions } from './packages/devtools/src/constant' import { packageDir } from './packages/devtools/src/dirs' import { enableModule } from './packages/devtools/src/module-main' import { startSubprocess } from './packages/devtools-kit/src/index' -import type { ModuleOptions } from './packages/devtools/src/types' export type { ModuleOptions } diff --git a/packages/devtools-kit/src/index.ts b/packages/devtools-kit/src/index.ts index efa8b0c3e..7a688c15c 100644 --- a/packages/devtools-kit/src/index.ts +++ b/packages/devtools-kit/src/index.ts @@ -1,7 +1,7 @@ -import { useNuxt } from '@nuxt/kit' -import { execa } from 'execa' import type { BirpcGroup } from 'birpc' import type { ModuleCustomTab, NuxtDevtoolsInfo, NuxtDevtoolsServerContext, SubprocessOptions, TerminalState } from './types' +import { useNuxt } from '@nuxt/kit' +import { execa } from 'execa' /** * Hooks to extend a custom tab in devtools. diff --git a/packages/devtools-kit/src/runtime/host-client.ts b/packages/devtools-kit/src/runtime/host-client.ts index 58db526ce..2b6581d4c 100644 --- a/packages/devtools-kit/src/runtime/host-client.ts +++ b/packages/devtools-kit/src/runtime/host-client.ts @@ -1,6 +1,6 @@ -import { shallowRef } from 'vue' import type { NuxtDevtoolsHostClient } from '@nuxt/devtools-kit/types' import type { Ref } from 'vue' +import { shallowRef } from 'vue' let clientRef: Ref | undefined const fns = [] as ((client: NuxtDevtoolsHostClient) => void)[] diff --git a/packages/devtools-kit/src/runtime/iframe-client.ts b/packages/devtools-kit/src/runtime/iframe-client.ts index 7866f4818..f1092c158 100644 --- a/packages/devtools-kit/src/runtime/iframe-client.ts +++ b/packages/devtools-kit/src/runtime/iframe-client.ts @@ -1,6 +1,6 @@ -import { shallowRef, triggerRef } from 'vue' import type { NuxtDevtoolsIframeClient } from '@nuxt/devtools-kit/types' import type { Ref } from 'vue' +import { shallowRef, triggerRef } from 'vue' let clientRef: Ref | undefined const hasSetup = false diff --git a/packages/devtools-ui-kit/src/components/NCodeBlock.vue b/packages/devtools-ui-kit/src/components/NCodeBlock.vue index 46a1c120b..ce27f7efb 100644 --- a/packages/devtools-ui-kit/src/components/NCodeBlock.vue +++ b/packages/devtools-ui-kit/src/components/NCodeBlock.vue @@ -1,7 +1,7 @@ `) diff --git a/packages/devtools/src/runtime/plugins/devtools.client.ts b/packages/devtools/src/runtime/plugins/devtools.client.ts index 5dca02013..9e1c9f841 100644 --- a/packages/devtools/src/runtime/plugins/devtools.client.ts +++ b/packages/devtools/src/runtime/plugins/devtools.client.ts @@ -1,7 +1,7 @@ -import { shallowReactive, watchEffect } from 'vue' - import type { TimelineServerState } from '@nuxt/devtools/types' + import type { Router } from 'vue-router' +import { shallowReactive, watchEffect } from 'vue' import { setupHooksDebug } from '../shared/hooks' // eslint-disable-next-line ts/ban-ts-comment diff --git a/packages/devtools/src/runtime/plugins/devtools.server.ts b/packages/devtools/src/runtime/plugins/devtools.server.ts index 70abb32b4..82e19216c 100644 --- a/packages/devtools/src/runtime/plugins/devtools.server.ts +++ b/packages/devtools/src/runtime/plugins/devtools.server.ts @@ -1,5 +1,5 @@ -import { defineNuxtPlugin, useState } from '#imports' import type { TimelineServerState } from '@nuxt/devtools/types' +import { defineNuxtPlugin, useState } from '#imports' export default defineNuxtPlugin(() => { // record ssr start time diff --git a/packages/devtools/src/runtime/plugins/view/FrameBox.vue b/packages/devtools/src/runtime/plugins/view/FrameBox.vue index 4934b46d7..120816189 100644 --- a/packages/devtools/src/runtime/plugins/view/FrameBox.vue +++ b/packages/devtools/src/runtime/plugins/view/FrameBox.vue @@ -1,6 +1,6 @@