create-cellsweb-rpc-api 1.0.23 → 1.0.24

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 CHANGED
@@ -1,7 +1,15 @@
1
1
  # `create-cellsweb-rpc-api`
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/create-cellsweb-rpc-api.svg)](https://www.npmjs.com/package/create-cellsweb-rpc-api)
4
+ [![license](https://img.shields.io/npm/l/create-cellsweb-rpc-api.svg)](LICENSE)
5
+
3
6
  > Official CLI scaffolder for **CellsWeb RPC API** service projects.
4
7
 
8
+ > [!TIP]
9
+ > **CellsWeb RPC Ecosystem**:
10
+ > - ⚡ **Backend RPC Engine**: [`@cellsweb/rpc-core`](https://www.npmjs.com/package/@cellsweb/rpc-core) ($O(1)$ dispatching, TypeBox schemas, Busboy multipart)
11
+ > - 🌐 **Client SDK & React/RN Hooks**: [`@cellsweb/rpc-client`](https://www.npmjs.com/package/@cellsweb/rpc-client) (Universal fetch & automatic multipart form-data)
12
+
5
13
  ---
6
14
 
7
15
  ## Usage
package/bin/create.js CHANGED
@@ -179,8 +179,8 @@ async function main() {
179
179
  node: ">=20.0.0",
180
180
  },
181
181
  dependencies: {
182
- "@cellsweb/rpc-core": "^1.0.27",
183
- "create-cellsweb-rpc-api": "^1.0.23",
182
+ "@cellsweb/rpc-core": "^1.0.28",
183
+ "create-cellsweb-rpc-api": "^1.0.24",
184
184
  "@aws-sdk/client-s3": "^3.700.0",
185
185
  "@paralleldrive/cuid2": "^2.2.2",
186
186
  "@sentry/node": "^8.40.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-cellsweb-rpc-api",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -18,7 +18,6 @@ export const app = new CoreRPC({
18
18
  });
19
19
 
20
20
  export const server = Fastify({ logger: false });
21
- const rpcHandler = await app.createHandler();
22
21
 
23
22
  // ── Static Files Route (/uploads/*) ──
24
23
  server.get("/uploads/*", async (req, reply) => {
@@ -37,21 +36,8 @@ server.get("/uploads/*", async (req, reply) => {
37
36
  reply.send(result.buffer);
38
37
  });
39
38
 
40
- // ── Forward RPC, Docs, and Health via Fastify raw streams ──
41
- server.all("/rpc", async (req, reply) => {
42
- reply.hijack();
43
- await rpcHandler(req.raw, reply.raw);
44
- });
45
-
46
- server.all("/docs*", async (req, reply) => {
47
- reply.hijack();
48
- await rpcHandler(req.raw, reply.raw);
49
- });
50
-
51
- server.get("/health", async (req, reply) => {
52
- reply.hijack();
53
- await rpcHandler(req.raw, reply.raw);
54
- });
39
+ // ── Register CellsWeb RPC Plugin (Handles /rpc, /docs, and /health) ──
40
+ await server.register(app.createFastifyPlugin());
55
41
 
56
42
  // Only start HTTP listener if not running inside test environment (Vitest)
57
43
  if (process.env.NODE_ENV !== "test" && !process.env.VITEST) {