@devframes/plugin-messages 0.9.9 → 0.9.10

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.
package/bin.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import process from 'node:process'
3
- import { createMessagesCli } from './dist/cli.mjs'
3
+ import { createMessagesCli } from './dist/node/cli.mjs'
4
4
 
5
5
  async function main() {
6
6
  const cli = createMessagesCli()
@@ -13011,7 +13011,7 @@ function Ox(e) {
13011
13011
  });
13012
13012
  }
13013
13013
  //#endregion
13014
- //#region src/constants.ts
13014
+ //#region src/node/constants.ts
13015
13015
  var kx = "devframe:messages:updated", Ax = /* @__PURE__ */ new WeakMap();
13016
13016
  function jx(e) {
13017
13017
  let t = Ax.get(e);
@@ -13043,7 +13043,7 @@ function jx(e) {
13043
13043
  }), t;
13044
13044
  }
13045
13045
  //#endregion
13046
- //#region src/client/App.vue?vue&type=script&setup=true&lang.ts
13046
+ //#region app/client/App.vue?vue&type=script&setup=true&lang.ts
13047
13047
  var Mx = { class: "h-full w-full grid grid-rows-[max-content_1fr] bg-base color-base font-sans" }, Nx = { class: "flex gap-2 items-center" }, Px = { class: "min-h-0" }, Fx = { class: "flex flex-col gap-1" }, Ix = /* @__PURE__ */ F({
13048
13048
  __name: "App",
13049
13049
  props: { rpc: {} },
@@ -13071,6 +13071,11 @@ var Mx = { class: "h-full w-full grid grid-rows-[max-content_1fr] bg-base color-
13071
13071
  async function d(e) {
13072
13072
  let n = t.rpc.callOptional;
13073
13073
  if (e.kind === "activate") {
13074
+ if (t.rpc.connectionMeta.backend === "static" && typeof BroadcastChannel < "u") {
13075
+ let t = new BroadcastChannel("devframe:docks:activate");
13076
+ t.postMessage(/* @__PURE__ */ M(e.activate)), t.close();
13077
+ return;
13078
+ }
13074
13079
  await n("hub:docks:activate", e.activate);
13075
13080
  return;
13076
13081
  }
@@ -13159,7 +13164,7 @@ var Mx = { class: "h-full w-full grid grid-rows-[max-content_1fr] bg-base color-
13159
13164
  }
13160
13165
  });
13161
13166
  //#endregion
13162
- //#region src/client/index.ts
13167
+ //#region app/client/index.ts
13163
13168
  function Lx(t) {
13164
13169
  return e(t);
13165
13170
  }
@@ -1,5 +1,5 @@
1
1
  import { CacHandle } from "devframe/adapters/cac";
2
- //#region src/cli.d.ts
2
+ //#region src/node/cli.d.ts
3
3
  /**
4
4
  * Build the standalone CLI for the messages panel; backs the package `bin`
5
5
  * (`devframe-messages`) and `pnpx @devframes/plugin-messages`. Wraps the
@@ -1,6 +1,6 @@
1
- import { t as createMessagesDevframe } from "./src-BWFxGgye.mjs";
1
+ import { t as createMessagesDevframe } from "../node-DSUZHevj.mjs";
2
2
  import { createCac } from "devframe/adapters/cac";
3
- //#region src/cli.ts
3
+ //#region src/node/cli.ts
4
4
  /**
5
5
  * Build the standalone CLI for the messages panel; backs the package `bin`
6
6
  * (`devframe-messages`) and `pnpx @devframes/plugin-messages`. Wraps the
@@ -1,4 +1,4 @@
1
- //#region src/constants.d.ts
1
+ //#region src/node/constants.d.ts
2
2
  /** Devframe id, drives the hosted mount path `/__<id>/`. */
3
3
  declare const PLUGIN_ID = "devframes_plugin_messages";
4
4
  /** Preferred standalone CLI port (901x band shared by the core-ish plugins). */
@@ -1,4 +1,4 @@
1
- //#region src/constants.ts
1
+ //#region src/node/constants.ts
2
2
  /** Devframe id, drives the hosted mount path `/__<id>/`. */
3
3
  const PLUGIN_ID = "devframes_plugin_messages";
4
4
  /** Preferred standalone CLI port (901x band shared by the core-ish plugins). */
@@ -1,15 +1,40 @@
1
- import { serverFunctions } from "../rpc/index.mjs";
2
- import { DevframeNodeContext } from "devframe";
1
+ import { DEFAULT_PORT, MESSAGES_UPDATED_EVENT, PLUGIN_ID } from "./constants.mjs";
2
+ import { DevframeDefinition } from "devframe";
3
+ import { DevframeMessageEntry, DevframeMessageEntryFrom, DevframeMessageEntryInput, DevframeMessageLevel, DevframeMessagesListDelta } from "@devframes/hub/types";
3
4
  //#region src/node/index.d.ts
5
+ /** The panel `clientScript` bundle (`dist/client`) stays in this node package. */
6
+ interface MessagesDevframeOptions {
7
+ /** Override the devframe id (and default CLI command / mount path). */
8
+ id?: string;
9
+ /** Override the display name shown in a host dock. */
10
+ name?: string;
11
+ /** Override the dock icon. */
12
+ icon?: string;
13
+ /**
14
+ * Override the mount path. Left unset, the SPA mounts at `/` standalone
15
+ * and `/__<id>/` when hosted (Vite/embedded).
16
+ */
17
+ basePath?: string;
18
+ /** Preferred standalone CLI port. */
19
+ port?: number;
20
+ /**
21
+ * Require the trust handshake on the standalone server. Enabled by
22
+ * default; `--open` embeds the current OTP in the opened URL, so the
23
+ * tab authenticates automatically without extra prompts. Hosted adapters
24
+ * manage their own auth and ignore this.
25
+ */
26
+ auth?: boolean;
27
+ }
4
28
  /**
5
- * Register the message-feed RPC functions on a devframe node context.
6
- * Called from the definition's `setup(ctx)` and reusable by host adapters
7
- * that wire their own context.
29
+ * Build a {@link DevframeDefinition} for the hub message feed panel,
30
+ * a portable view over `ctx.messages`, ported from vitejs/devtools'
31
+ * built-in Messages view. The same definition runs standalone
32
+ * (`/cli`, `/build`) and mounts into a host (`/vite`, hub);
33
+ * a hub host is what feeds it live entries.
8
34
  *
9
- * The plugin reads the feed from the hub-attached `ctx.messages` host. On a
10
- * plain (non-hub) context it warns once and keeps the RPC surface registered
11
- * as no-ops, so the panel still renders, with an empty feed.
35
+ * @experimental This plugin is experimental and may change without a major
36
+ * version bump until it stabilizes.
12
37
  */
13
- declare function setupMessages(ctx: DevframeNodeContext): void;
38
+ declare function createMessagesDevframe(options?: MessagesDevframeOptions): DevframeDefinition;
14
39
  //#endregion
15
- export { serverFunctions, setupMessages };
40
+ export { DEFAULT_PORT, type DevframeMessageEntry, type DevframeMessageEntryFrom, type DevframeMessageEntryInput, type DevframeMessageLevel, type DevframeMessagesListDelta, MESSAGES_UPDATED_EVENT, MessagesDevframeOptions, PLUGIN_ID, createMessagesDevframe, createMessagesDevframe as default };
@@ -1,3 +1,3 @@
1
- import { t as setupMessages } from "../node-CAEXablA.mjs";
2
- import { t as serverFunctions } from "../rpc-CdgIByLV.mjs";
3
- export { serverFunctions, setupMessages };
1
+ import { t as createMessagesDevframe } from "../node-DSUZHevj.mjs";
2
+ import { DEFAULT_PORT, MESSAGES_UPDATED_EVENT, PLUGIN_ID } from "./constants.mjs";
3
+ export { DEFAULT_PORT, MESSAGES_UPDATED_EVENT, PLUGIN_ID, createMessagesDevframe, createMessagesDevframe as default };
@@ -1,5 +1,5 @@
1
1
  import { RpcDefinitionsToFunctions } from "devframe/rpc";
2
- //#region src/rpc/index.d.ts
2
+ //#region src/node/rpc/index.d.ts
3
3
  /**
4
4
  * The message-feed RPC functions registered by the plugin: thin, typed
5
5
  * wrappers over the hub's `ctx.messages` host. Namespaced
@@ -0,0 +1,2 @@
1
+ import { t as serverFunctions } from "../../rpc-nftOb33P.mjs";
2
+ export { serverFunctions };
@@ -0,0 +1,15 @@
1
+ import { serverFunctions } from "./rpc/index.mjs";
2
+ import { DevframeNodeContext } from "devframe";
3
+ //#region src/node/setup.d.ts
4
+ /**
5
+ * Register the message-feed RPC functions on a devframe node context.
6
+ * Called from the definition's `setup(ctx)` and reusable by host adapters
7
+ * that wire their own context.
8
+ *
9
+ * The plugin reads the feed from the hub-attached `ctx.messages` host. On a
10
+ * plain (non-hub) context it warns once and keeps the RPC surface registered
11
+ * as no-ops, so the panel still renders, with an empty feed.
12
+ */
13
+ declare function setupMessages(ctx: DevframeNodeContext): void;
14
+ //#endregion
15
+ export { serverFunctions, setupMessages };
@@ -0,0 +1,3 @@
1
+ import { t as setupMessages } from "../setup-DAWX8esx.mjs";
2
+ import { t as serverFunctions } from "../rpc-nftOb33P.mjs";
3
+ export { serverFunctions, setupMessages };
@@ -1,13 +1,13 @@
1
- import "./constants.mjs";
2
- import { t as setupMessages } from "./node-CAEXablA.mjs";
1
+ import "./node/constants.mjs";
2
+ import { t as setupMessages } from "./setup-DAWX8esx.mjs";
3
3
  import { defineDevframe } from "devframe";
4
4
  //#region package.json
5
5
  var name = "@devframes/plugin-messages";
6
- var version = "0.9.9";
6
+ var version = "0.9.10";
7
7
  var description = "Devframe plugin for browsing, filtering, and dismissing the hub message feed.";
8
8
  var homepage = "https://github.com/devframes/devframe#readme";
9
9
  //#endregion
10
- //#region src/index.ts
10
+ //#region src/node/index.ts
11
11
  const remoteAssets = {
12
12
  package: `${name}--assets`,
13
13
  version
@@ -1,5 +1,5 @@
1
1
  import { createDefineWrapperWithContext } from "devframe/rpc";
2
- //#region src/rpc/functions/_define.ts
2
+ //#region src/node/rpc/functions/_define.ts
3
3
  /**
4
4
  * `defineRpcFunction` pre-bound to the framework-neutral
5
5
  * {@link DevframeNodeContext}, so each function's `setup(ctx)` receives the
@@ -16,7 +16,7 @@ function getMessagesHost(ctx) {
16
16
  return ctx.messages;
17
17
  }
18
18
  //#endregion
19
- //#region src/rpc/functions/add.ts
19
+ //#region src/node/rpc/functions/add.ts
20
20
  /**
21
21
  * Add a message entry from a browser client. The origin is force-stamped
22
22
  * `from: 'browser'` so client-originated entries can't impersonate the
@@ -37,7 +37,7 @@ const messagesAdd = defineMessagesRpc({
37
37
  } })
38
38
  });
39
39
  //#endregion
40
- //#region src/rpc/functions/clear.ts
40
+ //#region src/node/rpc/functions/clear.ts
41
41
  /** Clear the whole message feed. */
42
42
  const messagesClear = defineMessagesRpc({
43
43
  name: "devframes:plugin:messages:clear",
@@ -48,7 +48,7 @@ const messagesClear = defineMessagesRpc({
48
48
  } })
49
49
  });
50
50
  //#endregion
51
- //#region src/rpc/functions/list.ts
51
+ //#region src/node/rpc/functions/list.ts
52
52
  /**
53
53
  * Read the message list incrementally. Pass the `version` from the previous
54
54
  * result as `since` to receive only what changed; omit it for the initial
@@ -78,7 +78,7 @@ const messagesList = defineMessagesRpc({
78
78
  } })
79
79
  });
80
80
  //#endregion
81
- //#region src/rpc/functions/remove.ts
81
+ //#region src/node/rpc/functions/remove.ts
82
82
  /** Remove (dismiss) a single message entry by id. */
83
83
  const messagesRemove = defineMessagesRpc({
84
84
  name: "devframes:plugin:messages:remove",
@@ -89,7 +89,7 @@ const messagesRemove = defineMessagesRpc({
89
89
  } })
90
90
  });
91
91
  //#endregion
92
- //#region src/rpc/index.ts
92
+ //#region src/node/rpc/index.ts
93
93
  /**
94
94
  * The message-feed RPC functions registered by the plugin: thin, typed
95
95
  * wrappers over the hub's `ctx.messages` host. Namespaced
@@ -1,7 +1,7 @@
1
- import { PLUGIN_ID } from "./constants.mjs";
2
- import { n as getMessagesHost, t as serverFunctions } from "./rpc-CdgIByLV.mjs";
1
+ import { PLUGIN_ID } from "./node/constants.mjs";
2
+ import { n as getMessagesHost, t as serverFunctions } from "./rpc-nftOb33P.mjs";
3
3
  import { defineDiagnostics } from "devframe/utils/nostics";
4
- //#region src/diagnostics.ts
4
+ //#region src/node/diagnostics.ts
5
5
  /**
6
6
  * Structured diagnostics for `@devframes/plugin-messages`. Node-side only.
7
7
  * Codes use the plugin-private `DP_MESSAGES_` band (see the built-in
@@ -16,7 +16,7 @@ const diagnostics = defineDiagnostics({
16
16
  } }
17
17
  });
18
18
  //#endregion
19
- //#region src/node/index.ts
19
+ //#region src/node/setup.ts
20
20
  /**
21
21
  * Register the message-feed RPC functions on a devframe node context.
22
22
  * Called from the definition's `setup(ctx)` and reusable by host adapters
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@devframes/plugin-messages",
3
3
  "type": "module",
4
- "version": "0.9.9",
4
+ "version": "0.9.10",
5
5
  "description": "Devframe plugin for browsing, filtering, and dismissing the hub message feed.",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -21,15 +21,15 @@
21
21
  ],
22
22
  "sideEffects": false,
23
23
  "exports": {
24
- ".": "./dist/index.mjs",
24
+ ".": "./dist/node/index.mjs",
25
25
  "./client": "./dist/client/index.mjs",
26
- "./cli": "./dist/cli.mjs",
27
- "./constants": "./dist/constants.mjs",
28
- "./node": "./dist/node/index.mjs",
29
- "./rpc": "./dist/rpc/index.mjs",
26
+ "./cli": "./dist/node/cli.mjs",
27
+ "./constants": "./dist/node/constants.mjs",
28
+ "./node": "./dist/node/setup.mjs",
29
+ "./rpc": "./dist/node/rpc/index.mjs",
30
30
  "./package.json": "./package.json"
31
31
  },
32
- "types": "./dist/index.d.mts",
32
+ "types": "./dist/node/index.d.mts",
33
33
  "bin": {
34
34
  "devframe-messages": "./bin.mjs"
35
35
  },
@@ -38,9 +38,9 @@
38
38
  "dist"
39
39
  ],
40
40
  "peerDependencies": {
41
- "@devframes/hub": "0.9.9",
42
- "@devframes/plugin-messages--assets": "0.9.9",
43
- "devframe": "0.9.9",
41
+ "@devframes/hub": "0.9.10",
42
+ "@devframes/plugin-messages--assets": "0.9.10",
43
+ "devframe": "0.9.10",
44
44
  "vite": "^7.0.0 || ^8.0.0"
45
45
  },
46
46
  "peerDependenciesMeta": {
@@ -52,14 +52,14 @@
52
52
  }
53
53
  },
54
54
  "dependencies": {
55
- "@devframes/service-open": "0.9.9",
55
+ "@devframes/service-open": "0.9.10",
56
56
  "cac": "^7.0.0"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@antfu/design": "^0.4.0",
60
- "@devframes/hub": "0.9.9",
61
- "@devframes/plugin-messages--assets": "0.9.9",
62
- "@devframes/vite": "0.9.9",
60
+ "@devframes/hub": "0.9.10",
61
+ "@devframes/plugin-messages--assets": "0.9.10",
62
+ "@devframes/vite": "0.9.10",
63
63
  "@iconify-json/ph": "^1.2.2",
64
64
  "@storybook/addon-docs": "^10.5.10",
65
65
  "@storybook/vue3-vite": "^10.5.10",
@@ -67,7 +67,7 @@
67
67
  "@vitejs/plugin-vue": "^6.0.8",
68
68
  "@vueuse/core": "^14.4.0",
69
69
  "colorjs.io": "^0.7.1",
70
- "devframe": "0.9.9",
70
+ "devframe": "0.9.10",
71
71
  "floating-vue": "^5.2.2",
72
72
  "h3": "^2.0.1-rc.29",
73
73
  "storybook": "^10.5.10",
@@ -80,9 +80,12 @@
80
80
  "ws": "^8.21.3"
81
81
  },
82
82
  "scripts": {
83
- "build": "tsdown && vite build --config src/client/vite.config.ts && vite build --config src/spa/vite.config.ts",
84
- "dev": "vite --config src/spa/vite.config.ts",
83
+ "build": "tsdown && vite build --config app/client/vite.config.ts && vite build --config app/vite.config.ts",
84
+ "build:client": "vite build --config app/client/vite.config.ts",
85
+ "build:app": "vite build --config app/vite.config.ts",
86
+ "dev": "vite --config app/vite.config.ts --host",
85
87
  "watch": "tsdown --watch",
88
+ "play": "pnpm run build && node playgrounds/server.mjs",
86
89
  "cli:build": "node bin.mjs build --out-dir dist/static",
87
90
  "storybook": "storybook dev -p 6006",
88
91
  "build-storybook": "storybook build",
@@ -1,39 +0,0 @@
1
- import { MESSAGES_UPDATED_EVENT } from "../constants.mjs";
2
- import { DevframeRpcClient, DevframeRpcClient as DevframeRpcClient$1, DevframeRpcClientOptions } from "devframe/client";
3
- import { DevframeMessageEntry, DevframeMessageEntry as DevframeMessageEntry$1, DevframeMessageEntryFrom, DevframeMessageEntryInput, DevframeMessageLevel, DevframeMessagesListDelta } from "@devframes/hub/types";
4
- import { Reactive } from "vue";
5
- //#region src/client/state/messages.d.ts
6
- interface MessagesState {
7
- entries: DevframeMessageEntry$1[];
8
- }
9
- /**
10
- * Reactive mirror of the server-side message feed, one per RPC client.
11
- * Delta-synced: the initial call fetches the full snapshot, then every
12
- * `devframe:messages:updated` broadcast (and trust-state flip) re-fetches
13
- * incrementally using the version cursor from the previous result.
14
- */
15
- declare function useMessages(rpc: DevframeRpcClient$1): Reactive<MessagesState>;
16
- //#endregion
17
- //#region src/client/index.d.ts
18
- /**
19
- * Connect to the plugin's devframe backend. A thin, typed wrapper around
20
- * devframe's {@link connectDevframe}; the SPA derives its base from
21
- * `document.baseURI`, so no options are required in the common case.
22
- */
23
- declare function connectMessages(options?: DevframeRpcClientOptions): Promise<DevframeRpcClient>;
24
- interface MountMessagesOptions {
25
- /** Reuse an existing RPC client (e.g. the host page's) instead of connecting. */
26
- rpc?: DevframeRpcClient;
27
- }
28
- interface MessagesHandle {
29
- rpc: DevframeRpcClient;
30
- dispose: () => void;
31
- }
32
- /**
33
- * Mount the messages panel into a DOM container, the embeddable form a
34
- * hub `custom-render` dock uses. Styles are injected by the bundle; the
35
- * host page owns the `.dark` class on `<html>`.
36
- */
37
- declare function mountMessages(container: HTMLElement, options?: MountMessagesOptions): Promise<MessagesHandle>;
38
- //#endregion
39
- export { type DevframeMessageEntry, type DevframeMessageEntryFrom, type DevframeMessageEntryInput, type DevframeMessageLevel, type DevframeMessagesListDelta, type DevframeRpcClient, MESSAGES_UPDATED_EVENT, MessagesHandle, type MessagesState, MountMessagesOptions, connectMessages, mountMessages, useMessages };
package/dist/index.d.mts DELETED
@@ -1,40 +0,0 @@
1
- import { DEFAULT_PORT, MESSAGES_UPDATED_EVENT, PLUGIN_ID } from "./constants.mjs";
2
- import { DevframeMessageEntry, DevframeMessageEntryFrom, DevframeMessageEntryInput, DevframeMessageLevel, DevframeMessagesListDelta } from "@devframes/hub/types";
3
- import { DevframeDefinition } from "devframe";
4
- //#region src/index.d.ts
5
- /** The panel `clientScript` bundle (`dist/client`) stays in this node package. */
6
- interface MessagesDevframeOptions {
7
- /** Override the devframe id (and default CLI command / mount path). */
8
- id?: string;
9
- /** Override the display name shown in a host dock. */
10
- name?: string;
11
- /** Override the dock icon. */
12
- icon?: string;
13
- /**
14
- * Override the mount path. Left unset, the SPA mounts at `/` standalone
15
- * and `/__<id>/` when hosted (Vite/embedded).
16
- */
17
- basePath?: string;
18
- /** Preferred standalone CLI port. */
19
- port?: number;
20
- /**
21
- * Require the trust handshake on the standalone server. Enabled by
22
- * default; `--open` embeds the current OTP in the opened URL, so the
23
- * tab authenticates automatically without extra prompts. Hosted adapters
24
- * manage their own auth and ignore this.
25
- */
26
- auth?: boolean;
27
- }
28
- /**
29
- * Build a {@link DevframeDefinition} for the hub message feed panel,
30
- * a portable view over `ctx.messages`, ported from vitejs/devtools'
31
- * built-in Messages view. The same definition runs standalone
32
- * (`/cli`, `/build`) and mounts into a host (`/vite`, hub);
33
- * a hub host is what feeds it live entries.
34
- *
35
- * @experimental This plugin is experimental and may change without a major
36
- * version bump until it stabilizes.
37
- */
38
- declare function createMessagesDevframe(options?: MessagesDevframeOptions): DevframeDefinition;
39
- //#endregion
40
- export { DEFAULT_PORT, type DevframeMessageEntry, type DevframeMessageEntryFrom, type DevframeMessageEntryInput, type DevframeMessageLevel, type DevframeMessagesListDelta, MESSAGES_UPDATED_EVENT, MessagesDevframeOptions, PLUGIN_ID, createMessagesDevframe, createMessagesDevframe as default };
package/dist/index.mjs DELETED
@@ -1,3 +0,0 @@
1
- import { t as createMessagesDevframe } from "./src-BWFxGgye.mjs";
2
- import { DEFAULT_PORT, MESSAGES_UPDATED_EVENT, PLUGIN_ID } from "./constants.mjs";
3
- export { DEFAULT_PORT, MESSAGES_UPDATED_EVENT, PLUGIN_ID, createMessagesDevframe, createMessagesDevframe as default };
@@ -1,2 +0,0 @@
1
- import { t as serverFunctions } from "../rpc-CdgIByLV.mjs";
2
- export { serverFunctions };