@hoardodile/workbench 0.1.5 → 0.1.7

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/dist/index.html CHANGED
@@ -41,8 +41,8 @@
41
41
  }
42
42
  })()
43
43
  </script>
44
- <script type="module" crossorigin src="/assets/index-ByEy-HUM.js"></script>
45
- <link rel="stylesheet" crossorigin href="/assets/index-C9ltfJNl.css">
44
+ <script type="module" crossorigin src="/assets/index-D_B2Nv6O.js"></script>
45
+ <link rel="stylesheet" crossorigin href="/assets/index-C2mXVuVz.css">
46
46
  </head>
47
47
  <body>
48
48
  <div id="root"></div>
package/dist/mounts.mjs CHANGED
@@ -442,6 +442,7 @@ function workbenchApiMount(providers) {
442
442
  capabilities: {
443
443
  preview: providers.preview !== undefined,
444
444
  frame: providers.frame !== undefined,
445
+ cover: providers.cover !== undefined,
445
446
  },
446
447
  })
447
448
  return true
package/dist/serve.d.mts CHANGED
@@ -16,6 +16,7 @@ export type WorkbenchHookSnapshot = {
16
16
  readonly sourceMeta: unknown
17
17
  readonly searchMeta: unknown
18
18
  readonly coverLocal: string | undefined
19
+ readonly coverKind?: string
19
20
  readonly files: readonly unknown[] | undefined
20
21
  readonly fileStats: {
21
22
  readonly count?: number
@@ -112,6 +113,7 @@ export type WorkbenchProviders = {
112
113
  path: string,
113
114
  timeMs: number,
114
115
  ) => Promise<WorkbenchRendered | undefined>
116
+ readonly cover?: (resId: string) => Promise<WorkbenchRendered | undefined>
115
117
  }
116
118
 
117
119
  /** Options for {@link serveWorkbench}. */
@@ -142,8 +144,18 @@ export type ServeWorkbenchOptions = {
142
144
  * URL reports the actual one; read `server.address()` for it.
143
145
  */
144
146
  readonly port?: number
145
- /** Bind host. Defaults to 127.0.0.1. */
147
+ /**
148
+ * Bind host. Defaults to 127.0.0.1.
149
+ */
146
150
  readonly host?: string
151
+ /**
152
+ * Called once with the actual bound URL (`http://<host>:<port>`) once
153
+ * the server is listening. When provided it replaces the default
154
+ * `[workbench] serving on ...` log line — the caller owns the startup
155
+ * message, so it can print it only after e.g. the plugin build has
156
+ * settled, instead of being buried under the watcher's output.
157
+ */
158
+ readonly onReady?: (url: string) => void
147
159
  }
148
160
 
149
161
  /**
package/dist/serve.mjs CHANGED
@@ -34,7 +34,7 @@ const MAX_PORT_ATTEMPTS = 20
34
34
  * Returns the http.Server.
35
35
  */
36
36
  export function serveWorkbench(opts) {
37
- const { pluginDir, dataDir, port = 5199, host = "127.0.0.1" } = opts
37
+ const { pluginDir, dataDir, port = 5199, host = "127.0.0.1", onReady } = opts
38
38
  if (pluginDir === undefined) {
39
39
  console.warn("[workbench] no plugin dir — pass --plugin <dist-dir>")
40
40
  }
@@ -86,7 +86,13 @@ export function serveWorkbench(opts) {
86
86
  const address = server.address()
87
87
  const bound =
88
88
  address === null || typeof address === "string" ? attempt : address.port
89
- console.log(`[workbench] serving on http://${host}:${bound}`)
89
+ const url = `http://${host}:${bound}`
90
+ // The caller may own the startup message so it can print it only
91
+ // after the plugin build settles (the CLI does, otherwise vite's
92
+ // watch-build output buries the URL). Standalone servers keep the
93
+ // plain log line.
94
+ if (onReady) onReady(url)
95
+ else console.log(`[workbench] serving on ${url}`)
90
96
  resolveStart(server)
91
97
  }
92
98
  function onError(err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hoardodile/workbench",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "license": "MIT",
5
5
  "description": "Offline dev workbench for hoardodile content plugins.",
6
6
  "keywords": [
@@ -50,11 +50,11 @@
50
50
  "vite": "^8.2.2",
51
51
  "vitest": "^4.1.11",
52
52
  "zod": "^4.4.3",
53
- "@hoardodile/sdk-types": "0.1.5",
54
- "@hoardodile/sdk-web": "0.1.5",
55
- "@hoardodile/i18n": "0.1.5",
56
- "@hoardodile/ui": "0.1.5",
57
- "@hoardodile/host-web": "0.1.5"
53
+ "@hoardodile/host-web": "0.1.7",
54
+ "@hoardodile/i18n": "0.1.7",
55
+ "@hoardodile/sdk-types": "0.1.7",
56
+ "@hoardodile/sdk-web": "0.1.7",
57
+ "@hoardodile/ui": "0.1.7"
58
58
  },
59
59
  "scripts": {
60
60
  "dev": "node scripts/dev.mjs",