weifuwu 0.18.0 → 0.18.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/README.md +232 -122
- package/cli.ts +7 -6
- package/dist/agent/types.d.ts +2 -2
- package/dist/ai.d.ts +1 -3
- package/dist/analytics.d.ts +1 -2
- package/dist/cli.js +7 -6
- package/dist/graphql.d.ts +1 -3
- package/dist/iii/types.d.ts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +766 -1244
- package/dist/logdb/types.d.ts +1 -2
- package/dist/messager/types.d.ts +2 -2
- package/dist/opencode/types.d.ts +1 -2
- package/dist/router.d.ts +1 -0
- package/dist/ssr/compile.d.ts +2 -0
- package/dist/ssr/error-boundary.d.ts +2 -0
- package/dist/ssr/index.d.ts +7 -0
- package/dist/ssr/index.js +936 -0
- package/dist/ssr/layout.d.ts +2 -0
- package/dist/ssr/live.d.ts +6 -0
- package/dist/ssr/not-found.d.ts +2 -0
- package/dist/ssr/ssr.d.ts +3 -0
- package/dist/ssr/stream.d.ts +14 -0
- package/dist/ssr/tailwind.d.ts +2 -0
- package/dist/tenant/types.d.ts +2 -2
- package/dist/types.d.ts +5 -0
- package/dist/user/types.d.ts +1 -2
- package/package.json +4 -3
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Context } from '../types.ts';
|
|
2
|
+
export interface StreamOpts {
|
|
3
|
+
ctx: Context;
|
|
4
|
+
base: string;
|
|
5
|
+
compiledTailwindCss?: string;
|
|
6
|
+
isDev: boolean;
|
|
7
|
+
status?: number;
|
|
8
|
+
bundle?: {
|
|
9
|
+
url: string;
|
|
10
|
+
} | null;
|
|
11
|
+
loaderData?: Record<string, unknown>;
|
|
12
|
+
}
|
|
13
|
+
export declare function readStream(stream: ReadableStream): Promise<string>;
|
|
14
|
+
export declare function streamResponse(reactStream: ReadableStream, opts: StreamOpts): Response;
|
package/dist/tenant/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Context } from '../types.ts';
|
|
2
|
+
import type { Router } from '../router.ts';
|
|
2
3
|
import type { PostgresClient } from '../postgres/types.ts';
|
|
3
4
|
declare module '../types.ts' {
|
|
4
5
|
interface Context {
|
|
@@ -39,10 +40,9 @@ export interface TenantOptions {
|
|
|
39
40
|
pg: PostgresClient;
|
|
40
41
|
usersTable: string;
|
|
41
42
|
}
|
|
42
|
-
export interface TenantModule {
|
|
43
|
+
export interface TenantModule extends Router {
|
|
43
44
|
migrate: () => Promise<void>;
|
|
44
45
|
middleware: () => (req: Request, ctx: Context, next: any) => Promise<Response>;
|
|
45
|
-
router: () => any;
|
|
46
46
|
graphql: () => any;
|
|
47
47
|
close: () => Promise<void>;
|
|
48
48
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -8,6 +8,11 @@ export interface Context {
|
|
|
8
8
|
setPref?: (name: string, value: string) => Response;
|
|
9
9
|
prefs?: Record<string, string>;
|
|
10
10
|
env?: Record<string, string>;
|
|
11
|
+
layoutStack?: {
|
|
12
|
+
path: string;
|
|
13
|
+
component: any;
|
|
14
|
+
}[];
|
|
15
|
+
[key: string]: unknown;
|
|
11
16
|
}
|
|
12
17
|
export type Handler = (req: Request, ctx: Context) => Response | Promise<Response>;
|
|
13
18
|
export type Middleware = (req: Request, ctx: Context, next: Handler) => Response | Promise<Response>;
|
package/dist/user/types.d.ts
CHANGED
|
@@ -31,8 +31,7 @@ export interface UserOptions {
|
|
|
31
31
|
expiresIn?: string | number;
|
|
32
32
|
oauth2?: OAuth2ServerOptions;
|
|
33
33
|
}
|
|
34
|
-
export interface UserModule {
|
|
35
|
-
router: () => Router;
|
|
34
|
+
export interface UserModule extends Router {
|
|
36
35
|
middleware: () => Middleware;
|
|
37
36
|
migrate: () => Promise<void>;
|
|
38
37
|
register: (data: {
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weifuwu",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.2",
|
|
4
4
|
"description": "Web-standard HTTP framework for Node.js — (req, ctx) => Response",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./dist/index.js",
|
|
9
|
-
"./react": "./dist/react.js"
|
|
9
|
+
"./react": "./dist/react.js",
|
|
10
|
+
"./ssr": "./dist/ssr/index.js"
|
|
10
11
|
},
|
|
11
12
|
"bin": {
|
|
12
13
|
"weifuwu": "dist/cli.js"
|
|
@@ -18,7 +19,7 @@
|
|
|
18
19
|
"LICENSE"
|
|
19
20
|
],
|
|
20
21
|
"scripts": {
|
|
21
|
-
"build": "esbuild index.ts --bundle --format=esm --platform=node --outfile=dist/index.js --packages=external && esbuild cli.ts --bundle --format=esm --platform=node --outfile=dist/cli.js --packages=external && esbuild react.ts --bundle --format=esm --outfile=dist/react.js --external:react --external:react-dom",
|
|
22
|
+
"build": "esbuild index.ts --bundle --format=esm --platform=node --outfile=dist/index.js --packages=external && esbuild cli.ts --bundle --format=esm --platform=node --outfile=dist/cli.js --packages=external && esbuild react.ts --bundle --format=esm --outfile=dist/react.js --external:react --external:react-dom && esbuild ssr/index.ts --bundle --format=esm --platform=node --outfile=dist/ssr/index.js --packages=external",
|
|
22
23
|
"prepublishOnly": "npm run build && tsc --emitDeclarationOnly --outdir dist",
|
|
23
24
|
"test": "node --test 'test/**/*.test.ts'"
|
|
24
25
|
},
|