orpc-file-based-router 0.0.14 → 0.0.15

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.
Files changed (2) hide show
  1. package/README.md +8 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -14,7 +14,9 @@ structure, similar to Next.js, express-file-routing
14
14
  > ⚠️ **IMPORTANT:** At this time, the plugin's functionality is only guaranteed
15
15
  > in nodejs runtime
16
16
 
17
- ## Get started
17
+ ## Quickstart
18
+
19
+ 0. If you're new to oRPC, read the [oRPC documentation](https://orpc.unnoq.com). Install and configure a basic oRPC server
18
20
 
19
21
  1. Install package
20
22
 
@@ -70,9 +72,11 @@ const handler = new RPCHandler(router);
70
72
  > startServer();
71
73
  > ```
72
74
 
73
- ## How to generate configuration file
75
+ ## Type-Safe Client Configuration (Optional)
76
+
77
+ If you plan to use [oRPC client](https://orpc.unnoq.com/docs/client/client-side), you can set up automatic configuration generation, which can be used for client typing.
74
78
 
75
- 1. Call `generateRouter`
79
+ 1. Add the following code to your main server file (e.g., `server.ts` or `main.ts`). This will automatically regenerate the router configuration each time your server starts:
76
80
 
77
81
  ```typescript
78
82
  import { generateRouter } from "orpc-file-based-router";
@@ -82,7 +86,7 @@ const outputFile = new URL("./router.ts", import.meta.url).pathname;
82
86
  generateRouter(routesDir, outputFile);
83
87
  ```
84
88
 
85
- 2. Generated configuration is ready to use in router client:
89
+ 2. Generated router is ready to use in client:
86
90
 
87
91
  ```typescript
88
92
  // router.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orpc-file-based-router",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "description": "File-based router plugin for oRPC - automatically generate oRPC router from your file structure",
5
5
  "author": "zeeeeby",
6
6
  "license": "MIT",