From ad2c0c63ccabb495e5a34b53e0efbae4c8612834 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Mon, 13 Jan 2025 15:36:58 +0800 Subject: [PATCH 1/5] feat: debug page of module mutation --- package.json | 3 + packages/devtools-kit/src/_types/rpc.ts | 3 +- packages/devtools-ui-kit/src/module.ts | 2 +- .../client/components/BuildAnalyzeDetails.vue | 12 +- .../components/DebugModuleMutationRecords.vue | 50 + packages/devtools/client/composables/state.ts | 4 + packages/devtools/client/nuxt.config.ts | 2 + .../devtools/client/pages/modules/debug.vue | 31 + packages/devtools/src/server-rpc/general.ts | 26 + pnpm-lock.yaml | 2009 +++-------------- 10 files changed, 461 insertions(+), 1681 deletions(-) create mode 100644 packages/devtools/client/components/DebugModuleMutationRecords.vue create mode 100644 packages/devtools/client/pages/modules/debug.vue diff --git a/package.json b/package.json index 5b76c5b542..60be953121 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,10 @@ }, "resolutions": { "@nuxt/devtools": "workspace:*", + "@nuxt/kit": "link:../nuxt/packages/kit", + "@nuxt/schema": "link:../nuxt/packages/schema", "esbuild": "catalog:", + "nuxt": "link:../nuxt/packages/nuxt", "typescript": "catalog:", "vite": "catalog:", "vue-tsc": "catalog:" diff --git a/packages/devtools-kit/src/_types/rpc.ts b/packages/devtools-kit/src/_types/rpc.ts index d19341b182..6adbf0f7b7 100644 --- a/packages/devtools-kit/src/_types/rpc.ts +++ b/packages/devtools-kit/src/_types/rpc.ts @@ -1,5 +1,5 @@ import type { StorageMounts } from 'nitropack' -import type { Component, NuxtApp, NuxtLayout, NuxtOptions, NuxtPage } from 'nuxt/schema' +import type { Component, NuxtApp, NuxtDebugContext, NuxtLayout, NuxtOptions, NuxtPage } from 'nuxt/schema' import type { StorageValue } from 'unstorage' import type { AnalyzeBuildsInfo } from './analyze-build' import type { ModuleCustomTab } from './custom-tabs' @@ -12,6 +12,7 @@ import type { GetWizardArgs, WizardActions } from './wizard' export interface ServerFunctions { // Static RPCs (can be provide on production build in the future) getServerConfig: () => NuxtOptions + getServerDebugContext: () => NuxtDebugContext | undefined getServerRuntimeConfig: () => Record getModuleOptions: () => ModuleOptions getComponents: () => Component[] diff --git a/packages/devtools-ui-kit/src/module.ts b/packages/devtools-ui-kit/src/module.ts index 19badeef20..97ff2be261 100644 --- a/packages/devtools-ui-kit/src/module.ts +++ b/packages/devtools-ui-kit/src/module.ts @@ -16,7 +16,7 @@ export interface ModuleOptions { export default defineNuxtModule({ meta: { - name: 'devtools-ui-kit', + name: '@nuxt/devtools-ui-kit', configKey: 'devtoolsUIKit', }, defaults: { diff --git a/packages/devtools/client/components/BuildAnalyzeDetails.vue b/packages/devtools/client/components/BuildAnalyzeDetails.vue index 7e56f183ec..f1bc260511 100644 --- a/packages/devtools/client/components/BuildAnalyzeDetails.vue +++ b/packages/devtools/client/components/BuildAnalyzeDetails.vue @@ -56,10 +56,10 @@ async function clear(name: string) { @@ -67,7 +67,7 @@ async function clear(name: string) {
@@ -125,17 +125,17 @@ async function clear(name: string) {