orpc-file-based-router 0.0.4 → 0.0.6

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 +15 -9
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  A plugin for [oRPC](https://orpc.unnoq.com) that automatically creates an oRPC router configuration based on your file structure.
4
4
 
5
+ > ⚠️ **IMPORTANT:** Works only at nodejs runtime
6
+
5
7
  ## Installation
6
8
 
7
9
  ```bash
@@ -13,6 +15,7 @@ yarn add orpc-file-based-router
13
15
  ## Usage
14
16
 
15
17
  ```typescript
18
+ import { RPCHandler } from '@orpc/server/node'
16
19
  import { generateRouter } from 'orpc-file-based-router'
17
20
 
18
21
  const routesDir = new URL('./routes', import.meta.url).pathname
@@ -27,20 +30,20 @@ const handler = new RPCHandler(router)
27
30
  ```
28
31
  src/routes
29
32
  ├── auth
30
- │ ├── me.ts (exports: me)
31
- │ ├── signin.ts (exports: signin)
32
- │ └── signup.ts (exports: signup)
33
+ │ ├── me.ts
34
+ │ ├── signin.ts
35
+ │ └── signup.ts
33
36
 
34
37
  ├── planets
35
38
  │ ├── {id}
36
- │ │ ├── find.ts (exports: findPlanet)
37
- │ │ └── update.ts (exports: updatePlanet)
39
+ │ │ ├── find.ts
40
+ │ │ └── update.ts
38
41
  │ │
39
- │ ├── create.ts (exports: createPlanet)
40
- │ ├── index.ts (exports: indexRoute)
41
- │ └── list.ts (exports: listPlanets)
42
+ │ ├── create.ts
43
+ │ ├── index.ts
44
+ │ └── list.ts
42
45
 
43
- └── sse.ts (exports: sse)
46
+ └── sse.ts
44
47
  ```
45
48
 
46
49
  ### Generated result
@@ -73,3 +76,6 @@ export const router = {
73
76
  }
74
77
  ```
75
78
 
79
+ ## License
80
+
81
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orpc-file-based-router",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
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",