@adonix.org/cloud-spark 2.0.0 → 2.0.2
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 +10 -13
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -296,7 +296,8 @@ Register the built-in CORS middleware as follows:
|
|
|
296
296
|
:page_facing_up: index.ts
|
|
297
297
|
|
|
298
298
|
```ts
|
|
299
|
-
import { BasicWorker
|
|
299
|
+
import { BasicWorker } from "@adonix.org/cloud-spark";
|
|
300
|
+
import { cors } from "@adonix.org/cloud-spark/cors";
|
|
300
301
|
|
|
301
302
|
class MyWorker extends BasicWorker {
|
|
302
303
|
/**
|
|
@@ -346,7 +347,8 @@ Register the built-in cache middleware as follows:
|
|
|
346
347
|
:page_facing_up: index.ts
|
|
347
348
|
|
|
348
349
|
```ts
|
|
349
|
-
import { BasicWorker,
|
|
350
|
+
import { BasicWorker, CacheControl, JsonResponse, Time } from "@adonix.org/cloud-spark";
|
|
351
|
+
import { cache } from "@adonix.org/cloud-spark/cache";
|
|
350
352
|
|
|
351
353
|
class MyWorker extends BasicWorker {
|
|
352
354
|
/**
|
|
@@ -425,7 +427,8 @@ Register the built-in websocket middleware as follows:
|
|
|
425
427
|
:page_facing_up: index.ts
|
|
426
428
|
|
|
427
429
|
```ts
|
|
428
|
-
import { GET, PathParams, RouteWorker
|
|
430
|
+
import { GET, PathParams, RouteWorker } from "@adonix.org/cloud-spark";
|
|
431
|
+
import { websocket } from "@adonix.org/cloud-spark/websocket";
|
|
429
432
|
|
|
430
433
|
class ChatWorker extends RouteWorker {
|
|
431
434
|
/**
|
|
@@ -459,7 +462,7 @@ class ChatWorker extends RouteWorker {
|
|
|
459
462
|
|
|
460
463
|
/**
|
|
461
464
|
* The request has already been validated by the
|
|
462
|
-
* WebSocket middleware, so dispatch the WebSocket
|
|
465
|
+
* WebSocket middleware, so dispatch the WebSocket
|
|
463
466
|
* upgrade request to the Durable Object.
|
|
464
467
|
*/
|
|
465
468
|
return stub.fetch(this.request);
|
|
@@ -654,17 +657,11 @@ The following is a simple chat with hibernation example:
|
|
|
654
657
|
:page_facing_up: index.ts
|
|
655
658
|
|
|
656
659
|
```ts
|
|
660
|
+
import { GET, PathParams, RouteWorker, WebSocketUpgrade } from "@adonix.org/cloud-spark";
|
|
661
|
+
import { WebSocketSessions } from "@adonix.org/cloud-spark/sessions";
|
|
662
|
+
import { websocket } from "@adonix.org/cloud-spark/websocket";
|
|
657
663
|
import { DurableObject } from "cloudflare:workers";
|
|
658
664
|
|
|
659
|
-
import {
|
|
660
|
-
GET,
|
|
661
|
-
PathParams,
|
|
662
|
-
RouteWorker,
|
|
663
|
-
websocket,
|
|
664
|
-
WebSocketSessions,
|
|
665
|
-
WebSocketUpgrade,
|
|
666
|
-
} from "@adonix.org/cloud-spark";
|
|
667
|
-
|
|
668
665
|
/**
|
|
669
666
|
* Metadata attached to each session.
|
|
670
667
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonix.org/cloud-spark",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Ignite your Cloudflare Workers with a type-safe library for rapid development.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -13,19 +13,19 @@
|
|
|
13
13
|
},
|
|
14
14
|
"./cache": {
|
|
15
15
|
"import": "./dist/cache.js",
|
|
16
|
-
"types": "./dist/
|
|
16
|
+
"types": "./dist/index.d.ts"
|
|
17
17
|
},
|
|
18
18
|
"./cors": {
|
|
19
19
|
"import": "./dist/cors.js",
|
|
20
|
-
"types": "./dist/
|
|
20
|
+
"types": "./dist/index.d.ts"
|
|
21
21
|
},
|
|
22
22
|
"./websocket": {
|
|
23
23
|
"import": "./dist/websocket.js",
|
|
24
|
-
"types": "./dist/
|
|
24
|
+
"types": "./dist/index.d.ts"
|
|
25
25
|
},
|
|
26
26
|
"./sessions": {
|
|
27
27
|
"import": "./dist/sessions.js",
|
|
28
|
-
"types": "./dist/
|
|
28
|
+
"types": "./dist/index.d.ts"
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@eslint/js": "^9.39.1",
|
|
71
|
-
"@types/node": "^
|
|
72
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
73
|
-
"@typescript-eslint/parser": "^8.
|
|
71
|
+
"@types/node": "^25.0.0",
|
|
72
|
+
"@typescript-eslint/eslint-plugin": "^8.49.0",
|
|
73
|
+
"@typescript-eslint/parser": "^8.49.0",
|
|
74
74
|
"@vitest/coverage-v8": "^4.0.15",
|
|
75
75
|
"eslint": "^9.39.1",
|
|
76
76
|
"eslint-plugin-import": "^2.32.0",
|
|
@@ -79,9 +79,9 @@
|
|
|
79
79
|
"prettier": "^3.7.4",
|
|
80
80
|
"tsup": "^8.5.1",
|
|
81
81
|
"typescript": "^5.9.3",
|
|
82
|
-
"typescript-eslint": "^8.
|
|
82
|
+
"typescript-eslint": "^8.49.0",
|
|
83
83
|
"vitest": "^4.0.15",
|
|
84
|
-
"wrangler": "^4.
|
|
84
|
+
"wrangler": "^4.54.0"
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
87
|
"cache-control-parser": "^2.0.6",
|