@blinkk/root 1.0.0-rc.9 → 1.0.1
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/LICENSE +22 -0
- package/bin/root.js +6 -32
- package/dist/{chunk-MJCIAH6K.js → chunk-7IDJ3PBT.js} +1 -1
- package/dist/{chunk-MJCIAH6K.js.map → chunk-7IDJ3PBT.js.map} +1 -1
- package/dist/chunk-IUQLRDFW.js +237 -0
- package/dist/chunk-IUQLRDFW.js.map +1 -0
- package/dist/{chunk-J2ANSYAE.js → chunk-KGPR2CJV.js} +111 -9
- package/dist/chunk-KGPR2CJV.js.map +1 -0
- package/dist/{chunk-G7ZCTWGB.js → chunk-RLFKEIOC.js} +437 -119
- package/dist/chunk-RLFKEIOC.js.map +1 -0
- package/dist/{chunk-WNXIRMFF.js → chunk-TZAHHHA4.js} +27 -7
- package/dist/chunk-TZAHHHA4.js.map +1 -0
- package/dist/cli.d.ts +18 -3
- package/dist/cli.js +8 -4
- package/dist/core.d.ts +5 -3
- package/dist/core.js +8 -3
- package/dist/core.js.map +1 -1
- package/dist/functions.d.ts +1 -1
- package/dist/functions.js +7 -7
- package/dist/functions.js.map +1 -1
- package/dist/middleware.d.ts +12 -5
- package/dist/middleware.js +3 -1
- package/dist/node.d.ts +11 -2
- package/dist/node.js +7 -1
- package/dist/render.d.ts +1 -1
- package/dist/render.js +274 -307
- package/dist/render.js.map +1 -1
- package/dist/{types-9f7a7695.d.ts → types-403nR8i5.d.ts} +91 -7
- package/package.json +38 -35
- package/dist/chunk-DFBTOMQF.js +0 -61
- package/dist/chunk-DFBTOMQF.js.map +0 -1
- package/dist/chunk-G7ZCTWGB.js.map +0 -1
- package/dist/chunk-J2ANSYAE.js.map +0 -1
- package/dist/chunk-WNXIRMFF.js.map +0 -1
package/dist/middleware.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { b as RootConfig,
|
|
2
|
-
export {
|
|
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
|
-
}):
|
|
39
|
+
}): RequestHandler;
|
|
33
40
|
|
|
34
|
-
export { multipartMiddleware, rootProjectMiddleware, trailingSlashMiddleware };
|
|
41
|
+
export { headersMiddleware, multipartMiddleware, rootProjectMiddleware, trailingSlashMiddleware };
|
package/dist/middleware.js
CHANGED
|
@@ -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-
|
|
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-
|
|
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-
|
|
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