@kiln-js/adapter-node 0.4.0 → 0.4.3
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 +46 -62
- package/package.json +28 -28
package/README.md
CHANGED
|
@@ -1,62 +1,46 @@
|
|
|
1
|
-
# @kiln-js/adapter-node
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/@kiln-js
|
|
4
|
-
[](LICENSE)
|
|
5
|
-
|
|
6
|
-
Node.js
|
|
7
|
-
|
|
8
|
-
Part of [Kiln](https://github.com/kiln-js/kiln), a file-based server-side rendering framework for React and Vite.
|
|
9
|
-
|
|
10
|
-
## Install
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
bun add -d @kiln-js/adapter-node
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Usage
|
|
17
|
-
|
|
18
|
-
```ts
|
|
19
|
-
import { adaptNode } from "@kiln-js/adapter-node";
|
|
20
|
-
|
|
21
|
-
await adaptNode({
|
|
22
|
-
root: process.cwd(),
|
|
23
|
-
clientOut: "dist/client",
|
|
24
|
-
serverOut: "dist/server",
|
|
25
|
-
clientRel: "app/client.tsx",
|
|
26
|
-
port: 3000,
|
|
27
|
-
});
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
## Requirements
|
|
49
|
-
|
|
50
|
-
Node.js at runtime (with `node:http`, `node:fs`, `node:path`, `node:zlib`, `node:url`, and `node:module` support) and a Vite client manifest at `<clientOut>/.vite/manifest.json` alongside a built `<serverOut>/server.js` exporting `createHandler`.
|
|
51
|
-
|
|
52
|
-
## Documentation
|
|
53
|
-
|
|
54
|
-
See the [Kiln repository](https://github.com/kiln-js/kiln) for the full API reference and guides.
|
|
55
|
-
|
|
56
|
-
## Development
|
|
57
|
-
|
|
58
|
-
This repository is generated from the Kiln monorepo. Make changes there, then run `scripts/publish-repo.ps1` to publish them here. Report issues in this repository, and send pull requests to the monorepo.
|
|
59
|
-
|
|
60
|
-
## License
|
|
61
|
-
|
|
62
|
-
MIT
|
|
1
|
+
# @kiln-js/adapter-node
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@kiln-js/adapter-node)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
|
|
6
|
+
Node.js production server for the Kiln framework
|
|
7
|
+
|
|
8
|
+
Part of [Kiln](https://github.com/kiln-js/kiln), a file-based server-side rendering framework for React and Vite.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
bun add -d @kiln-js/adapter-node
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { adaptNode } from "@kiln-js/adapter-node";
|
|
20
|
+
|
|
21
|
+
await adaptNode({
|
|
22
|
+
root: process.cwd(),
|
|
23
|
+
clientOut: "dist/client",
|
|
24
|
+
serverOut: "dist/server",
|
|
25
|
+
clientRel: "app/client.tsx",
|
|
26
|
+
port: 3000,
|
|
27
|
+
});
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Running the server
|
|
31
|
+
|
|
32
|
+
Start the generated server with `node dist/node/server.mjs`, or import `start(port?)` to run it programmatically.
|
|
33
|
+
Static assets are served from `clientOut` with `ETag`/`304` handling, immutable caching for hashed `assets/` files, and level-1 `gzip` compression for compressible payloads over 1 KB.
|
|
34
|
+
Port precedence is `process.env.PORT`, `server.port` in `.kiln/kiln.config.cjs`, then the `port` option (default `3000`).
|
|
35
|
+
|
|
36
|
+
## Documentation
|
|
37
|
+
|
|
38
|
+
See the [Kiln repository](https://github.com/kiln-js/kiln) for the full API reference and guides.
|
|
39
|
+
|
|
40
|
+
## Development
|
|
41
|
+
|
|
42
|
+
This repository is generated from the Kiln monorepo. Make changes there, then run `scripts/publish-repo.ps1` to publish them here. Report issues in this repository, and send pull requests to the monorepo.
|
|
43
|
+
|
|
44
|
+
## License
|
|
45
|
+
|
|
46
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@kiln-js/adapter-node",
|
|
3
|
+
"version": "0.4.3",
|
|
4
|
+
"description": "Node.js production server for the Kiln framework",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"repository": "github:kiln-js/adapter-node",
|
|
14
|
+
"homepage": "https://kiln-js.vercel.app",
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": "\u003e=18"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "node ../../scripts/build.mjs adapter-node",
|
|
23
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@types/node": "^22.0.0"
|
|
27
|
+
}
|
|
28
|
+
}
|