weifuwu 0.24.2 → 0.24.3

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.
@@ -0,0 +1,10 @@
1
+ import { Router } from './router.ts';
2
+ export declare function clearModuleCache(filePath?: string): void;
3
+ export declare function _setImportRoots(roots: string[]): void;
4
+ export declare function transformModule(absPath: string, root: string, mountPath?: string): Promise<{
5
+ url: string;
6
+ code: string;
7
+ }>;
8
+ export declare function moduleServer(opts: {
9
+ root: string | string[];
10
+ }): Router;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Get (or load) a server-side module. Cached in registry after first load.
3
+ * Synchronous — uses transformSync and vm.Script.
4
+ */
5
+ export declare function getServerModule(absPath: string): any;
6
+ /**
7
+ * Clear cached modules. If `absPath` given, clear only that module (for HMR).
8
+ * Otherwise clear all modules.
9
+ */
10
+ export declare function clearServerModule(absPath?: string): void;
11
+ /** Release resources. Call when shutting down. */
12
+ export declare function closeRegistry(): void;
package/dist/stream.d.ts CHANGED
@@ -20,10 +20,5 @@ export interface StreamOpts {
20
20
  export declare function readStream(stream: ReadableStream): Promise<string>;
21
21
  /**
22
22
  * Create an HTML response from a React SSR stream.
23
- *
24
- * Injects the React stream into an HTML shell, adds hydration script,
25
- * loader data script, tailwind CSS, and (in dev mode) livereload script.
26
- *
27
- * Used internally by {@link ssr}.
28
23
  */
29
24
  export declare function streamResponse(reactStream: ReadableStream, opts: StreamOpts, hydrationScript?: string): Response;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "weifuwu",
3
3
  "type": "module",
4
- "version": "0.24.2",
4
+ "version": "0.24.3",
5
5
  "description": "Web-standard HTTP framework for Node.js — (req, ctx) => Response",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -22,7 +22,7 @@
22
22
  ],
23
23
  "scripts": {
24
24
  "dev": "cd cli/template && NODE_ENV=development node --watch index.ts",
25
- "start": "cd cli/template && node index.ts",
25
+ "start": "cd cli/template && NODE_ENV=production node index.ts",
26
26
  "build": "esbuild index.ts --bundle --format=esm --platform=node --outfile=dist/index.js --packages=external --define:__WFW_BUNDLED__=true && 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",
27
27
  "prepublishOnly": "npm run build && tsc --emitDeclarationOnly --outdir dist",
28
28
  "typecheck": "tsc --noEmit",