create-cellsweb-rpc-api 1.0.31 → 2.0.0
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 +16 -15
- package/bin/create.js +1 -1
- package/package.json +1 -1
- package/template/README.md +4 -1
- package/templates/servers/server.bun.ts +2 -2
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
</a>
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
|
+
> **CellsWeb RPC 2.0.0 documentation.** Commands target v2. Before public availability, use the inspected candidate tarballs for installation tests; no public installation is implied by these examples.
|
|
8
|
+
|
|
7
9
|
# create-cellsweb-rpc-api
|
|
8
10
|
|
|
9
11
|
[](https://www.npmjs.com/package/create-cellsweb-rpc-api)
|
|
@@ -15,8 +17,7 @@ JSON/multipart handling, environment configuration and a project-local CLI.
|
|
|
15
17
|
Choose native Node, Bun, Express, Fastify, Hono, Elysia or Ultimate Express while
|
|
16
18
|
keeping function and middleware modules independent of the HTTP adapter.
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
1.0.30. Requires **Node>=24.0.0**, with Node 24 LTS the primary toolchain; Bun 1.3.11
|
|
20
|
+
Version **2.0.0** generates applications requiring core^2.0.0. Requires **Node>=24.0.0**, with Node 24 LTS the primary toolchain; Bun 1.3.11
|
|
20
21
|
is tested separately. This package generates the project. The installed
|
|
21
22
|
`@cellsweb/rpc-core` supplies the project's runtime and `crpc` executable.
|
|
22
23
|
|
|
@@ -55,7 +56,7 @@ The correct npm initializer name is **cellsweb-rpc-api**, not
|
|
|
55
56
|
create-create-cellsweb-rpc-api. For an exact generator version:
|
|
56
57
|
|
|
57
58
|
```sh
|
|
58
|
-
npx create-cellsweb-rpc-api@
|
|
59
|
+
npx create-cellsweb-rpc-api@2.0.0 my-api --framework=node --yes --pm=npm
|
|
59
60
|
```
|
|
60
61
|
|
|
61
62
|
Once running (port4000 by default), invoke the generated hello function:
|
|
@@ -87,7 +88,7 @@ pnpm create cellsweb-rpc-api@latest my-api
|
|
|
87
88
|
For automation, provide the target directory first and explicit flags:
|
|
88
89
|
|
|
89
90
|
```sh
|
|
90
|
-
npx create-cellsweb-rpc-api@
|
|
91
|
+
npx create-cellsweb-rpc-api@2.0.0 generated-api \
|
|
91
92
|
--framework=fastify --name=example-api --pm=npm --yes --skip-install
|
|
92
93
|
cd generated-api
|
|
93
94
|
npm install
|
|
@@ -121,13 +122,13 @@ The CLI's framework aliases are conveniences; prefer the canonical names below.
|
|
|
121
122
|
| `bun` | Native Bun.serve | Bun |
|
|
122
123
|
|
|
123
124
|
```sh
|
|
124
|
-
npx create-cellsweb-rpc-api@
|
|
125
|
-
npx create-cellsweb-rpc-api@
|
|
126
|
-
npx create-cellsweb-rpc-api@
|
|
127
|
-
npx create-cellsweb-rpc-api@
|
|
128
|
-
npx create-cellsweb-rpc-api@
|
|
129
|
-
npx create-cellsweb-rpc-api@
|
|
130
|
-
npx create-cellsweb-rpc-api@
|
|
125
|
+
npx create-cellsweb-rpc-api@2.0.0 node-api --framework=node --yes --skip-install
|
|
126
|
+
npx create-cellsweb-rpc-api@2.0.0 express-api --framework=express --yes --skip-install
|
|
127
|
+
npx create-cellsweb-rpc-api@2.0.0 fastify-api --framework=fastify --yes --skip-install
|
|
128
|
+
npx create-cellsweb-rpc-api@2.0.0 ultimate-api --framework=ultimate-express --yes --skip-install
|
|
129
|
+
npx create-cellsweb-rpc-api@2.0.0 hono-api --framework=hono --yes --skip-install
|
|
130
|
+
npx create-cellsweb-rpc-api@2.0.0 elysia-api --framework=elysia --yes --skip-install
|
|
131
|
+
npx create-cellsweb-rpc-api@2.0.0 bun-api --framework=bun --yes --skip-install
|
|
131
132
|
```
|
|
132
133
|
|
|
133
134
|
For a Bun application, install/run using Bun after generation:
|
|
@@ -164,10 +165,10 @@ my-api/
|
|
|
164
165
|
test/ # test context and lifecycle helpers
|
|
165
166
|
```
|
|
166
167
|
|
|
167
|
-
Inspect generated files as application-owned code.
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
168
|
+
Inspect generated files as application-owned code. This v2 initializer requests
|
|
169
|
+
**core^2.0.0**. Before publication, select the inspected candidate tarball explicitly;
|
|
170
|
+
after publication this range resolves compatible v2 releases from public npm.
|
|
171
|
+
Generated servers do not depend on rpc-client; your frontend does.
|
|
171
172
|
|
|
172
173
|
## Functions and middleware
|
|
173
174
|
|
package/bin/create.js
CHANGED
|
@@ -220,7 +220,7 @@ async function main() {
|
|
|
220
220
|
node: ">=24.0.0",
|
|
221
221
|
},
|
|
222
222
|
dependencies: {
|
|
223
|
-
"@cellsweb/rpc-core": "^
|
|
223
|
+
"@cellsweb/rpc-core": "^2.0.0",
|
|
224
224
|
"@aws-sdk/client-s3": "^3.700.0",
|
|
225
225
|
"@paralleldrive/cuid2": "^2.2.2",
|
|
226
226
|
"@sentry/node": "^8.40.0",
|
package/package.json
CHANGED
package/template/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
> **CellsWeb RPC 2.0.0 documentation.** Commands target v2. Before public availability, use the inspected candidate tarballs for installation tests; no public installation is implied by these examples.
|
|
2
|
+
|
|
1
3
|
# Generated CellsWeb RPC application
|
|
2
4
|
|
|
3
5
|
Node 24 LTS is primary (engines >=24.0.0). Bun/Elysia templates run under Bun,
|
|
@@ -10,7 +12,8 @@ npm run build
|
|
|
10
12
|
npm start
|
|
11
13
|
```
|
|
12
14
|
|
|
13
|
-
The generated core requirement is ^
|
|
15
|
+
The generated core requirement is ^2.0.0 and resolves from public npm after v2 publication.
|
|
16
|
+
Before publication, explicitly select the candidate core tarball.
|
|
14
17
|
Use ordinary package installation; no local SDK checkout or override is required.
|
|
15
18
|
|
|
16
19
|
Use npm run dev for Node development. For Bun select Bun execution, for example
|
|
@@ -16,7 +16,7 @@ export const app = new CoreRPC({
|
|
|
16
16
|
docs: env.NODE_ENV !== "production" || env.API_DOCS_ENABLED === true,
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
-
export const fetchHandler = async (req: Request): Promise<Response> => {
|
|
19
|
+
export const fetchHandler = async (req: Request, server?: { requestIP(request: Request): { address: string } | null }): Promise<Response> => {
|
|
20
20
|
const url = new URL(req.url);
|
|
21
21
|
|
|
22
22
|
// ── Static Files Route (/uploads/*) ──
|
|
@@ -46,7 +46,7 @@ export const fetchHandler = async (req: Request): Promise<Response> => {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
// ── Dispatch to CellsWeb RPC (Handles /rpc, /docs, /health, OPTIONS) ──
|
|
49
|
-
return await app.fetch(req);
|
|
49
|
+
return await app.fetch(req, server);
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
// Bun default export supports `bun run src/server.ts`
|