node-turbo 1.1.0 → 1.1.1
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 +15 -9
- package/package.json +11 -11
- package/test/unit/core/turbo-readable.test.js +0 -3
package/README.md
CHANGED
|
@@ -21,7 +21,8 @@ This documentation assumes that you are familiar with Turbo and its [handbook](h
|
|
|
21
21
|
- [Refresh action](#refresh-action)
|
|
22
22
|
- [Custom actions](#custom-actions)
|
|
23
23
|
- [Using the Node.js streams API](#using-the-nodejs-streams-api)
|
|
24
|
-
- [Turbo Frame](#turbo-frame)
|
|
24
|
+
- [Turbo Frame](#turbo-frame)
|
|
25
|
+
- [Additional attributes](#additional-attributes-1)
|
|
25
26
|
- [Request helper functions](#request-helper-functions)
|
|
26
27
|
- [isTurboStreamRequest(request)](#isturbostreamrequestrequest)
|
|
27
28
|
- [isTurboFrameRequest(request)](#isturboframerequestrequest)
|
|
@@ -54,11 +55,11 @@ node-turbo has been tested with:
|
|
|
54
55
|
|
|
55
56
|
| Name | Version(s) |
|
|
56
57
|
| :--- | :--- |
|
|
57
|
-
| [Node.js](https://nodejs.org/) | 16.6 -
|
|
58
|
+
| [Node.js](https://nodejs.org/) | 16.6 - 21.5.0 |
|
|
58
59
|
| [Hotwire Turbo](https://turbo.hotwired.dev/) | 7.3.0 - 8.0.4 |
|
|
59
|
-
| [Koa](https://koajs.com/) | 2.14.2 - 2.15.
|
|
60
|
-
| [Express](https://expressjs.com/) | 4.18.2 - 4.
|
|
61
|
-
| [ws](https://github.com/websockets/ws) | 8.15.1 - 8.
|
|
60
|
+
| [Koa](https://koajs.com/) | 2.14.2 - 2.15.3 |
|
|
61
|
+
| [Express](https://expressjs.com/) | 4.18.2 - 4.19.2 |
|
|
62
|
+
| [ws](https://github.com/websockets/ws) | 8.15.1 - 8.18.0 |
|
|
62
63
|
|
|
63
64
|
## API docs
|
|
64
65
|
See [`/docs/API.md`](./docs/API.md) for a documentation of all node-turbo classes and functions.
|
|
@@ -230,6 +231,8 @@ ts
|
|
|
230
231
|
|
|
231
232
|
See [Koa](#koa), [SSE](#sse) or [WebSocket](#websocket) for further examples.
|
|
232
233
|
|
|
234
|
+
***
|
|
235
|
+
|
|
233
236
|
#### Turbo Frame
|
|
234
237
|
```javascript
|
|
235
238
|
import { TurboFrame } from 'node-turbo';
|
|
@@ -244,9 +247,10 @@ This will render the following HTML fragment:
|
|
|
244
247
|
<turbo-frame id="my-id">
|
|
245
248
|
<p>My content</p>
|
|
246
249
|
</turbo-stream>
|
|
247
|
-
```
|
|
250
|
+
```
|
|
248
251
|
|
|
249
|
-
|
|
252
|
+
##### Additional attributes
|
|
253
|
+
You can add additional attributes by passing an object instead of the `id` string:
|
|
250
254
|
|
|
251
255
|
```javascript
|
|
252
256
|
import { TurboFrame } from 'node-turbo';
|
|
@@ -264,7 +268,9 @@ Result:
|
|
|
264
268
|
<turbo-frame id="my-id" custom="foo">
|
|
265
269
|
<p>My content</p>
|
|
266
270
|
</turbo-stream>
|
|
267
|
-
```
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
***
|
|
268
274
|
|
|
269
275
|
#### Request Helper Functions
|
|
270
276
|
|
|
@@ -710,4 +716,4 @@ app.listen(config.port);
|
|
|
710
716
|
```
|
|
711
717
|
## License
|
|
712
718
|
|
|
713
|
-
node-turbo is © 2024 Walter Krivanek
|
|
719
|
+
node-turbo is © 2024 Walter Krivanek and released under the [MIT license](https://mit-license.org).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-turbo",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "A library for Node.js to assist with the server side of 37signals' Hotwire Turbo framework. It provides classes and functions for Web servers and also convenience functions for the frameworks Koa and Express as well as for WebSocket and SSE.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"postdocs": "cp -f ./docs/internal/API.md ./docs"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"debug": "^4.3.
|
|
61
|
+
"debug": "^4.3.5",
|
|
62
62
|
"is-plain-object": "^5.0.0",
|
|
63
63
|
"negotiator": "^0.6.3"
|
|
64
64
|
},
|
|
@@ -68,23 +68,23 @@
|
|
|
68
68
|
"@enterthenamehere/esdoc-importpath-plugin": "^2.6.0-dev.1",
|
|
69
69
|
"@enterthenamehere/esdoc-standard-plugin": "^2.6.0-dev.2",
|
|
70
70
|
"@hotwired/turbo": "^8.0.4",
|
|
71
|
-
"@playwright/test": "^1.
|
|
71
|
+
"@playwright/test": "^1.45.1",
|
|
72
72
|
"@vividvisions/esdoc-api-doc-markdown-plugin": "file:../esdoc-api-doc-markdown-plugin",
|
|
73
|
-
"c8": "^
|
|
74
|
-
"chai": "^4.
|
|
73
|
+
"c8": "^10.1.2",
|
|
74
|
+
"chai": "^4.4.1",
|
|
75
75
|
"chai-eventemitter2": "^0.2.1",
|
|
76
76
|
"chai-spies": "^1.1.0",
|
|
77
77
|
"colorette": "^2.0.20",
|
|
78
78
|
"eventsource": "^2.0.2",
|
|
79
|
-
"express": "^4.
|
|
79
|
+
"express": "^4.19.2",
|
|
80
80
|
"git-repo-info": "^2.1.1",
|
|
81
|
-
"koa": "^2.15.
|
|
81
|
+
"koa": "^2.15.3",
|
|
82
82
|
"koa-route": "^4.0.1",
|
|
83
83
|
"koa-static": "^5.0.0",
|
|
84
|
-
"mocha": "^10.
|
|
85
|
-
"node-mocks-http": "^1.
|
|
84
|
+
"mocha": "^10.6.0",
|
|
85
|
+
"node-mocks-http": "^1.15.0",
|
|
86
86
|
"nunjucks": "^3.2.4",
|
|
87
|
-
"supertest": "^
|
|
88
|
-
"ws": "^8.
|
|
87
|
+
"supertest": "^7.0.0",
|
|
88
|
+
"ws": "^8.18.0"
|
|
89
89
|
}
|
|
90
90
|
}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
import chai, { expect } from 'chai';
|
|
3
3
|
import spies from 'chai-spies';
|
|
4
|
-
import eventemitter2 from 'chai-eventemitter2';
|
|
5
4
|
import { TurboStream, TurboElement, TurboStreamElement, TurboReadable } from '#core';
|
|
6
5
|
import { Readable } from 'node:stream';
|
|
7
6
|
|
|
8
|
-
chai.use(eventemitter2());
|
|
9
7
|
chai.use(spies);
|
|
10
|
-
// const sandbox = chai.spy.sandbox();
|
|
11
8
|
|
|
12
9
|
const attr = {
|
|
13
10
|
action: 'a',
|