@voltx/server 0.4.1 → 0.4.2

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.cjs CHANGED
@@ -385,6 +385,8 @@ function registerSSR(app, vite, options = {}) {
385
385
  const isProd = process.env.NODE_ENV === "production";
386
386
  if (!isProd) {
387
387
  clientScript = `/${entryClient}`;
388
+ const cssPaths = options.css ? Array.isArray(options.css) ? options.css : [options.css] : ["src/globals.css"];
389
+ cssLinks = cssPaths.map((p) => ` <link rel="stylesheet" href="/${p}" />`).join("\n");
388
390
  } else {
389
391
  if (!manifest) {
390
392
  const manifestPath = (0, import_node_path3.resolve)(process.cwd(), "dist/client/.vite/manifest.json");
@@ -448,7 +450,7 @@ ${cssLinks}
448
450
  }
449
451
 
450
452
  // src/index.ts
451
- var VERSION = "0.4.1";
453
+ var VERSION = "0.4.2";
452
454
  // Annotate the CommonJS export names for ESM import in node:
453
455
  0 && (module.exports = {
454
456
  Hono,
package/dist/index.d.cts CHANGED
@@ -196,6 +196,17 @@ interface SSROptions {
196
196
  * entry-server module themselves (e.g. in Vite-processed server.ts).
197
197
  */
198
198
  render?: (url: string) => Promise<ReadableStream>;
199
+ /**
200
+ * CSS file path(s) to inject in dev mode `<head>`.
201
+ * In dev, Vite serves source CSS and transforms it on the fly, but the
202
+ * SSR HTML shell has no `<link>` tag — CSS only loads after client JS
203
+ * hydrates, causing a flash of unstyled content (FOUC).
204
+ *
205
+ * Pass a string (e.g. `"src/globals.css"`) or an array of paths.
206
+ * Each path is emitted as `<link rel="stylesheet" href="/path">`.
207
+ * Defaults to `["src/globals.css"]`.
208
+ */
209
+ css?: string | string[];
199
210
  }
200
211
  /** Vite dev server shape — minimal interface to avoid hard dep on vite */
201
212
  interface ViteDevServer {
@@ -212,6 +223,6 @@ interface ViteDevServer {
212
223
  */
213
224
  declare function registerSSR(app: Hono, vite: ViteDevServer | null, options?: SSROptions): void;
214
225
 
215
- declare const VERSION = "0.4.1";
226
+ declare const VERSION = "0.4.2";
216
227
 
217
228
  export { type CorsConfig, type HttpMethod, type MiddlewareHandler, type RouteEntry, type RouteHandler, type RouteModule, type SSROptions, type ServerConfig, type ServerInfo, VERSION, type ViteDevOptions, type VoltxServer, createCorsMiddleware, createErrorHandler, createLoggerMiddleware, createServer, createViteDevConfig, filePathToUrlPath, registerSSR, registerStaticFiles, scanAndRegisterRoutes };
package/dist/index.d.ts CHANGED
@@ -196,6 +196,17 @@ interface SSROptions {
196
196
  * entry-server module themselves (e.g. in Vite-processed server.ts).
197
197
  */
198
198
  render?: (url: string) => Promise<ReadableStream>;
199
+ /**
200
+ * CSS file path(s) to inject in dev mode `<head>`.
201
+ * In dev, Vite serves source CSS and transforms it on the fly, but the
202
+ * SSR HTML shell has no `<link>` tag — CSS only loads after client JS
203
+ * hydrates, causing a flash of unstyled content (FOUC).
204
+ *
205
+ * Pass a string (e.g. `"src/globals.css"`) or an array of paths.
206
+ * Each path is emitted as `<link rel="stylesheet" href="/path">`.
207
+ * Defaults to `["src/globals.css"]`.
208
+ */
209
+ css?: string | string[];
199
210
  }
200
211
  /** Vite dev server shape — minimal interface to avoid hard dep on vite */
201
212
  interface ViteDevServer {
@@ -212,6 +223,6 @@ interface ViteDevServer {
212
223
  */
213
224
  declare function registerSSR(app: Hono, vite: ViteDevServer | null, options?: SSROptions): void;
214
225
 
215
- declare const VERSION = "0.4.1";
226
+ declare const VERSION = "0.4.2";
216
227
 
217
228
  export { type CorsConfig, type HttpMethod, type MiddlewareHandler, type RouteEntry, type RouteHandler, type RouteModule, type SSROptions, type ServerConfig, type ServerInfo, VERSION, type ViteDevOptions, type VoltxServer, createCorsMiddleware, createErrorHandler, createLoggerMiddleware, createServer, createViteDevConfig, filePathToUrlPath, registerSSR, registerStaticFiles, scanAndRegisterRoutes };
package/dist/index.js CHANGED
@@ -339,6 +339,8 @@ function registerSSR(app, vite, options = {}) {
339
339
  const isProd = process.env.NODE_ENV === "production";
340
340
  if (!isProd) {
341
341
  clientScript = `/${entryClient}`;
342
+ const cssPaths = options.css ? Array.isArray(options.css) ? options.css : [options.css] : ["src/globals.css"];
343
+ cssLinks = cssPaths.map((p) => ` <link rel="stylesheet" href="/${p}" />`).join("\n");
342
344
  } else {
343
345
  if (!manifest) {
344
346
  const manifestPath = resolve2(process.cwd(), "dist/client/.vite/manifest.json");
@@ -402,7 +404,7 @@ ${cssLinks}
402
404
  }
403
405
 
404
406
  // src/index.ts
405
- var VERSION = "0.4.1";
407
+ var VERSION = "0.4.2";
406
408
  export {
407
409
  Hono2 as Hono,
408
410
  VERSION,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voltx/server",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "VoltX Server — Hono-based HTTP server with file-based routing, SSE streaming, and static file serving",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",