@blinkk/root 1.0.0-rc.8 → 1.0.0

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.
@@ -1,6 +1,6 @@
1
- import { b as RootConfig, l as Request, m as Response, N as NextFunction } from './types-9209ea89.js';
2
- export { r as SESSION_COOKIE, t as SaveSessionOptions, v as Session, s as SessionMiddlewareOptions, u as sessionMiddleware } from './types-9209ea89.js';
3
- import 'express';
1
+ import { b as RootConfig, p as Request, q as Response, N as NextFunction } from './types-403nR8i5.js';
2
+ export { v as SESSION_COOKIE, x as SaveSessionOptions, z as Session, w as SessionMiddlewareOptions, y as sessionMiddleware } from './types-403nR8i5.js';
3
+ import { RequestHandler } from 'express';
4
4
  import 'preact';
5
5
  import 'vite';
6
6
  import 'html-minifier-terser';
@@ -12,6 +12,13 @@ import 'js-beautify';
12
12
  declare function rootProjectMiddleware(options: {
13
13
  rootConfig: RootConfig;
14
14
  }): (req: Request, _: Response, next: NextFunction) => void;
15
+ /**
16
+ * Middleware that injects HTTP headers from the `server.headers` config in
17
+ * root.config.ts.
18
+ */
19
+ declare function headersMiddleware(options: {
20
+ rootConfig: RootConfig;
21
+ }): (req: Request, res: Response, next: NextFunction) => void;
15
22
  /**
16
23
  * Trailing slash middleware. Handles trailing slash redirects (preserving any
17
24
  * query params) using the `server.trailingSlash` config in root.config.ts.
@@ -29,6 +36,6 @@ declare function trailingSlashMiddleware(options: {
29
36
  */
30
37
  declare function multipartMiddleware(options?: {
31
38
  maxFileSize?: number;
32
- }): (req: Request, res: Response, next: NextFunction) => void;
39
+ }): RequestHandler;
33
40
 
34
- export { multipartMiddleware, rootProjectMiddleware, trailingSlashMiddleware };
41
+ export { headersMiddleware, multipartMiddleware, rootProjectMiddleware, trailingSlashMiddleware };
@@ -1,14 +1,16 @@
1
1
  import {
2
2
  SESSION_COOKIE,
3
3
  Session,
4
+ headersMiddleware,
4
5
  multipartMiddleware,
5
6
  rootProjectMiddleware,
6
7
  sessionMiddleware,
7
8
  trailingSlashMiddleware
8
- } from "./chunk-WNXIRMFF.js";
9
+ } from "./chunk-TZAHHHA4.js";
9
10
  export {
10
11
  SESSION_COOKIE,
11
12
  Session,
13
+ headersMiddleware,
12
14
  multipartMiddleware,
13
15
  rootProjectMiddleware,
14
16
  sessionMiddleware,
package/dist/node.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { b as RootConfig } from './types-9209ea89.js';
1
+ import { b as RootConfig } from './types-403nR8i5.js';
2
2
  import { ViteDevServer } from 'vite';
3
3
  import 'express';
4
4
  import 'preact';
@@ -9,6 +9,15 @@ interface ConfigOptions {
9
9
  command: string;
10
10
  }
11
11
  declare function loadRootConfig(rootDir: string, options: ConfigOptions): Promise<RootConfig>;
12
+ /**
13
+ * Compiles a root.config.ts file to root.config.js.
14
+ */
15
+ declare function bundleRootConfig(rootDir: string, outPath: string): Promise<void>;
16
+ /**
17
+ * Loads a pre-bundled config file from dist/root.config.js.
18
+ */
19
+ declare function loadBundledConfig(rootDir: string, options: ConfigOptions): Promise<RootConfig>;
20
+ declare function loadPackageJson(filepath: string): Promise<any>;
12
21
 
13
22
  interface CreateViteServerOptions {
14
23
  /** Override HMR settings. */
@@ -27,4 +36,4 @@ declare function createViteServer(rootConfig: RootConfig, options?: CreateViteSe
27
36
  */
28
37
  declare function viteSsrLoadModule(rootConfig: RootConfig, file: string): Promise<Record<string, any>>;
29
38
 
30
- export { ConfigOptions, CreateViteServerOptions, createViteServer, loadRootConfig, viteSsrLoadModule };
39
+ export { type ConfigOptions, type CreateViteServerOptions, bundleRootConfig, createViteServer, loadBundledConfig, loadPackageJson, loadRootConfig, viteSsrLoadModule };
package/dist/node.js CHANGED
@@ -1,11 +1,17 @@
1
1
  import {
2
+ bundleRootConfig,
2
3
  createViteServer,
4
+ loadBundledConfig,
5
+ loadPackageJson,
3
6
  loadRootConfig,
4
7
  viteSsrLoadModule
5
- } from "./chunk-J2ANSYAE.js";
8
+ } from "./chunk-KGPR2CJV.js";
6
9
  import "./chunk-QKBMWK5B.js";
7
10
  export {
11
+ bundleRootConfig,
8
12
  createViteServer,
13
+ loadBundledConfig,
14
+ loadPackageJson,
9
15
  loadRootConfig,
10
16
  viteSsrLoadModule
11
17
  };
package/dist/render.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { w as Renderer } from './types-9209ea89.js';
1
+ export { A as Renderer } from './types-403nR8i5.js';
2
2
  import 'express';
3
3
  import 'preact';
4
4
  import 'vite';