nuxt-convex-module 0.12.1 → 0.12.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -99,6 +99,8 @@ function setupDevtools(resolver, nuxt, info) {
99
99
  });
100
100
  });
101
101
  nuxt.hook("devtools:ready", (ctx) => {
102
+ const { baseURL, buildAssetsDir } = nuxt.options.app;
103
+ const dockClient = [".js", ".ts"].map((extension) => resolver.resolve(`./runtime/devtools/dock-client${extension}`)).find((path) => existsSync(path))?.replaceAll("\\", "/");
102
104
  ctx.docks.register({
103
105
  id: RPC_NAMESPACE,
104
106
  title: "Convex",
@@ -107,7 +109,12 @@ function setupDevtools(resolver, nuxt, info) {
107
109
  url: `${DEVTOOLS_UI_ROUTE}/?${DEVTOOLS_DOCK_PARAM}`,
108
110
  // `NUXT_DEVTOOLS_GROUP_ID`: the kit is a type-only dependency.
109
111
  groupId: "nuxt",
110
- category: "modules"
112
+ category: "modules",
113
+ // Badges the dock with the client's health before the panel is opened.
114
+ clientScript: dockClient ? {
115
+ importFrom: `${baseURL}/${buildAssetsDir}/@fs/${dockClient}`.replaceAll(/\/{2,}/g, "/"),
116
+ eager: true
117
+ } : void 0
111
118
  });
112
119
  const { rpc } = ctx.scope(RPC_NAMESPACE);
113
120
  rpc.register({ name: "getInfo", type: "query", handler: functions.getInfo });