otok-adapter-node 1.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/LICENSE +21 -0
- package/README.md +46 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +178 -0
- package/dist/index.js.map +1 -0
- package/package.json +52 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kamod
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# otok-adapter-node
|
|
2
|
+
|
|
3
|
+
Node.js deployment adapter for [Otok](https://github.com/kamod-ch/otok).
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { defineConfig } from "@kamod-ch/otok";
|
|
9
|
+
import node from "otok-adapter-node";
|
|
10
|
+
|
|
11
|
+
export default defineConfig({
|
|
12
|
+
adapter: node({
|
|
13
|
+
outDir: "dist",
|
|
14
|
+
port: 3000,
|
|
15
|
+
host: "0.0.0.0",
|
|
16
|
+
}),
|
|
17
|
+
});
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Features
|
|
21
|
+
|
|
22
|
+
- Standalone server build (`dist/server/server.js`)
|
|
23
|
+
- Configurable `HOST` and `PORT` at runtime
|
|
24
|
+
- Immutable cache headers for hashed assets
|
|
25
|
+
- Graceful shutdown on `SIGTERM` / `SIGINT`
|
|
26
|
+
- Full Node.js environment access (`process.env`, filesystem)
|
|
27
|
+
|
|
28
|
+
## Operations
|
|
29
|
+
|
|
30
|
+
### Docker
|
|
31
|
+
|
|
32
|
+
See `examples/adapters/node/Dockerfile`.
|
|
33
|
+
|
|
34
|
+
### systemd
|
|
35
|
+
|
|
36
|
+
```ini
|
|
37
|
+
[Service]
|
|
38
|
+
Environment=NODE_ENV=production
|
|
39
|
+
Environment=PORT=3000
|
|
40
|
+
ExecStart=/usr/bin/node dist/server/server.js
|
|
41
|
+
KillSignal=SIGTERM
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Capabilities
|
|
45
|
+
|
|
46
|
+
`node-apis`, `filesystem`, `process-env`, `graceful-shutdown`, `ssr`, `streaming`, `middleware`, `server-actions`, `islands`, `static-assets`
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface NodeAdapterOptions {
|
|
2
|
+
/** Output root directory. Defaults to `dist`. */
|
|
3
|
+
outDir?: string;
|
|
4
|
+
/** Default bind host when the generated server starts. Overridable via `HOST`. */
|
|
5
|
+
host?: string;
|
|
6
|
+
/** Default port when the generated server starts. Overridable via `PORT`. */
|
|
7
|
+
port?: number;
|
|
8
|
+
/** Project-relative server entry. When omitted, the adapter generates one at build time. */
|
|
9
|
+
serverEntry?: string;
|
|
10
|
+
/** Cache-Control header for hashed static assets. */
|
|
11
|
+
assetCacheControl?: string;
|
|
12
|
+
/**
|
|
13
|
+
* When true, the generated server wires `RedisCacheProvider` from
|
|
14
|
+
* `UPSTASH_REDIS_REST_URL` + `UPSTASH_REDIS_REST_TOKEN` (or `OTOK_REDIS_REST_*`).
|
|
15
|
+
*/
|
|
16
|
+
redisCache?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const GENERATED_SERVER_ENTRY = "src/otok.generated.server.ts";
|
|
19
|
+
declare function outputDirs(options: NodeAdapterOptions): {
|
|
20
|
+
root: string;
|
|
21
|
+
client: string;
|
|
22
|
+
server: string;
|
|
23
|
+
};
|
|
24
|
+
declare function generatedServerSource(options: NodeAdapterOptions): string;
|
|
25
|
+
declare const nodeAdapterFactory: (options?: NodeAdapterOptions | undefined) => import("@kamod-ch/otok-config").OtokAdapter<NodeAdapterOptions>;
|
|
26
|
+
/** Node.js adapter with standalone server output, static assets, and graceful shutdown. */
|
|
27
|
+
export default function node(options?: NodeAdapterOptions): import("@kamod-ch/otok-config").OtokAdapter<NodeAdapterOptions>;
|
|
28
|
+
export { node, nodeAdapterFactory, GENERATED_SERVER_ENTRY, generatedServerSource, outputDirs as nodeOutputDirs };
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,kBAAkB;IACjC,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kFAAkF;IAClF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4FAA4F;IAC5F,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qDAAqD;IACrD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAgBD,QAAA,MAAM,sBAAsB,iCAAiC,CAAC;AAE9D,iBAAS,UAAU,CAAC,OAAO,EAAE,kBAAkB;;;;EAO9C;AAED,iBAAS,qBAAqB,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,CAsElE;AAUD,QAAA,MAAM,kBAAkB,+GAiEtB,CAAC;AAEH,2FAA2F;AAC3F,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,OAAO,GAAE,kBAAuB,mEAO5D;AAED,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,UAAU,IAAI,cAAc,EAAE,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { createDualBuildVitePlugin, defineAdapter } from "@kamod-ch/otok-config";
|
|
4
|
+
const NODE_CAPABILITIES = [
|
|
5
|
+
"node-apis",
|
|
6
|
+
"filesystem",
|
|
7
|
+
"process-env",
|
|
8
|
+
"graceful-shutdown",
|
|
9
|
+
"ssr",
|
|
10
|
+
"streaming",
|
|
11
|
+
"middleware",
|
|
12
|
+
"server-actions",
|
|
13
|
+
"islands",
|
|
14
|
+
"static-assets",
|
|
15
|
+
];
|
|
16
|
+
const DEFAULT_OUT_DIR = "dist";
|
|
17
|
+
const GENERATED_SERVER_ENTRY = "src/otok.generated.server.ts";
|
|
18
|
+
function outputDirs(options) {
|
|
19
|
+
const root = options.outDir ?? DEFAULT_OUT_DIR;
|
|
20
|
+
return {
|
|
21
|
+
root,
|
|
22
|
+
client: path.posix.join(root, "client"),
|
|
23
|
+
server: path.posix.join(root, "server"),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function generatedServerSource(options) {
|
|
27
|
+
const outDirs = outputDirs(options);
|
|
28
|
+
const port = options.port ?? 3000;
|
|
29
|
+
const host = options.host ?? "0.0.0.0";
|
|
30
|
+
const cacheControl = options.assetCacheControl ?? "public, max-age=31536000, immutable";
|
|
31
|
+
const redisCache = options.redisCache === true;
|
|
32
|
+
const redisBootstrap = redisCache
|
|
33
|
+
? `
|
|
34
|
+
import { setCacheProvider, RedisCacheProvider, createRedisRestClient } from "@kamod-ch/otok/cache";
|
|
35
|
+
|
|
36
|
+
const redisUrl = process.env.UPSTASH_REDIS_REST_URL ?? process.env.OTOK_REDIS_REST_URL;
|
|
37
|
+
const redisToken = process.env.UPSTASH_REDIS_REST_TOKEN ?? process.env.OTOK_REDIS_REST_TOKEN;
|
|
38
|
+
if (redisUrl && redisToken) {
|
|
39
|
+
setCacheProvider(new RedisCacheProvider({
|
|
40
|
+
client: createRedisRestClient({ url: redisUrl, token: redisToken }),
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
`
|
|
44
|
+
: "";
|
|
45
|
+
return `import { serve } from "@hono/node-server";
|
|
46
|
+
import { createOtokAppAsync, readOtokManifest } from "@kamod-ch/otok/server";
|
|
47
|
+
import { loadOtokResolvedConfig } from "virtual:otok-config";
|
|
48
|
+
import { errorRoute, notFoundRoute, routes } from "virtual:otok-routes";
|
|
49
|
+
${redisBootstrap}
|
|
50
|
+
const { runtime, applyAppPlugins, collectPluginRoutes, transformHtml } = await loadOtokResolvedConfig();
|
|
51
|
+
const pluginRoutes = await collectPluginRoutes();
|
|
52
|
+
|
|
53
|
+
const app = await createOtokAppAsync({
|
|
54
|
+
routes: [...routes, ...(pluginRoutes as typeof routes)],
|
|
55
|
+
notFoundRoute,
|
|
56
|
+
errorRoute,
|
|
57
|
+
...runtime,
|
|
58
|
+
manifest: readOtokManifest(import.meta.url),
|
|
59
|
+
clientEntry: ${JSON.stringify("src/client.ts")},
|
|
60
|
+
devClientEntry: "/src/client.ts",
|
|
61
|
+
devStylesheets: ["/src/styles.css"],
|
|
62
|
+
staticDir: ${JSON.stringify(`./${outDirs.client}`)},
|
|
63
|
+
assetCacheControl: ${JSON.stringify(cacheControl)},
|
|
64
|
+
health: { ok: true, runtime: "node", adapter: "otok-adapter-node" },
|
|
65
|
+
transformHtml,
|
|
66
|
+
configure: (app) => applyAppPlugins(app),
|
|
67
|
+
theme: runtime.theme ?? true,
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
export default app;
|
|
71
|
+
|
|
72
|
+
if (import.meta.env.PROD) {
|
|
73
|
+
const port = Number(process.env.PORT ?? ${JSON.stringify(String(port))});
|
|
74
|
+
const hostname = process.env.HOST ?? ${JSON.stringify(host)};
|
|
75
|
+
const server = serve({ fetch: app.fetch, port, hostname }, (info) => {
|
|
76
|
+
console.info(\`Otok server listening on http://\${info.address}:\${info.port}\`);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const shutdown = (signal: NodeJS.Signals) => {
|
|
80
|
+
console.info(\`Received \${signal}; shutting down Otok server...\`);
|
|
81
|
+
server.close((error) => {
|
|
82
|
+
if (error) {
|
|
83
|
+
console.error(error);
|
|
84
|
+
process.exit(1);
|
|
85
|
+
}
|
|
86
|
+
process.exit(0);
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
process.once("SIGTERM", shutdown);
|
|
91
|
+
process.once("SIGINT", shutdown);
|
|
92
|
+
}
|
|
93
|
+
`;
|
|
94
|
+
}
|
|
95
|
+
async function writeGeneratedServer(ctx, options) {
|
|
96
|
+
if (options.serverEntry)
|
|
97
|
+
return;
|
|
98
|
+
const target = path.resolve(ctx.root, GENERATED_SERVER_ENTRY);
|
|
99
|
+
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
100
|
+
fs.writeFileSync(target, generatedServerSource(options));
|
|
101
|
+
}
|
|
102
|
+
const nodeAdapterFactory = defineAdapter({
|
|
103
|
+
name: "otok-adapter-node",
|
|
104
|
+
runtime: "node",
|
|
105
|
+
capabilities: NODE_CAPABILITIES,
|
|
106
|
+
build: {
|
|
107
|
+
clientEntry: "src/client.ts",
|
|
108
|
+
ssrEntry: GENERATED_SERVER_ENTRY,
|
|
109
|
+
ssrTarget: "node",
|
|
110
|
+
clientManifest: true,
|
|
111
|
+
},
|
|
112
|
+
outputDirs(options, _root) {
|
|
113
|
+
return outputDirs(options);
|
|
114
|
+
},
|
|
115
|
+
async serverEntry(ctx) {
|
|
116
|
+
const options = ctx.options;
|
|
117
|
+
const entry = options.serverEntry ?? GENERATED_SERVER_ENTRY;
|
|
118
|
+
return {
|
|
119
|
+
path: entry,
|
|
120
|
+
generated: !options.serverEntry,
|
|
121
|
+
};
|
|
122
|
+
},
|
|
123
|
+
assets: {
|
|
124
|
+
cacheControl: "public, max-age=31536000, immutable",
|
|
125
|
+
assetsPath: "/assets",
|
|
126
|
+
},
|
|
127
|
+
environment: {
|
|
128
|
+
processEnv: true,
|
|
129
|
+
},
|
|
130
|
+
ssr: {
|
|
131
|
+
supported: true,
|
|
132
|
+
streaming: true,
|
|
133
|
+
},
|
|
134
|
+
middleware: {
|
|
135
|
+
supported: true,
|
|
136
|
+
},
|
|
137
|
+
prerender: {
|
|
138
|
+
supported: false,
|
|
139
|
+
},
|
|
140
|
+
hooks: {
|
|
141
|
+
async buildStart(ctx) {
|
|
142
|
+
const options = ctx.adapter.options;
|
|
143
|
+
await writeGeneratedServer(ctx, options);
|
|
144
|
+
},
|
|
145
|
+
async buildEnd(ctx) {
|
|
146
|
+
if (!ctx.isSsrBuild)
|
|
147
|
+
return;
|
|
148
|
+
const options = ctx.adapter.options;
|
|
149
|
+
await writeGeneratedServer(ctx, options);
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
configureVite(ctx) {
|
|
153
|
+
const options = ctx.options;
|
|
154
|
+
const outDirs = outputDirs(options);
|
|
155
|
+
const serverEntry = options.serverEntry ?? GENERATED_SERVER_ENTRY;
|
|
156
|
+
return createDualBuildVitePlugin({
|
|
157
|
+
name: "otok-adapter-node",
|
|
158
|
+
outDirs,
|
|
159
|
+
build: {
|
|
160
|
+
clientEntry: "src/client.ts",
|
|
161
|
+
ssrEntry: serverEntry,
|
|
162
|
+
ssrTarget: "node",
|
|
163
|
+
clientManifest: true,
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
},
|
|
167
|
+
});
|
|
168
|
+
/** Node.js adapter with standalone server output, static assets, and graceful shutdown. */
|
|
169
|
+
export default function node(options = {}) {
|
|
170
|
+
const adapter = nodeAdapterFactory(options);
|
|
171
|
+
adapter.build = {
|
|
172
|
+
...adapter.build,
|
|
173
|
+
ssrEntry: options.serverEntry ?? GENERATED_SERVER_ENTRY,
|
|
174
|
+
};
|
|
175
|
+
return adapter;
|
|
176
|
+
}
|
|
177
|
+
export { node, nodeAdapterFactory, GENERATED_SERVER_ENTRY, generatedServerSource, outputDirs as nodeOutputDirs };
|
|
178
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,yBAAyB,EAAE,aAAa,EAA4B,MAAM,uBAAuB,CAAC;AAoB3G,MAAM,iBAAiB,GAAG;IACxB,WAAW;IACX,YAAY;IACZ,aAAa;IACb,mBAAmB;IACnB,KAAK;IACL,WAAW;IACX,YAAY;IACZ,gBAAgB;IAChB,SAAS;IACT,eAAe;CACP,CAAC;AAEX,MAAM,eAAe,GAAG,MAAM,CAAC;AAC/B,MAAM,sBAAsB,GAAG,8BAA8B,CAAC;AAE9D,SAAS,UAAU,CAAC,OAA2B;IAC7C,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,IAAI,eAAe,CAAC;IAC/C,OAAO;QACL,IAAI;QACJ,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,C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AAC,OAA6B,CAAC;YAC1D,MAAM,oBAAoB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAC3C,CAAC;KACF;IACD,aAAa,CAAC,GAAG;QACf,MAAM,OAAO,GAAG,GAAG,CAAC,OAA6B,CAAC;QAClD,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;QACpC,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,sBAAsB,CAAC;QAElE,OAAO,yBAAyB,CAAC;YAC/B,IAAI,EAAE,mBAAmB;YACzB,OAAO;YACP,KAAK,EAAE;gBACL,WAAW,EAAE,eAAe;gBAC5B,QAAQ,EAAE,WAAW;gBACrB,SAAS,EAAE,MAAM;gBACjB,cAAc,EAAE,IAAI;aACrB;SACF,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,2FAA2F;AAC3F,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,UAA8B,EAAE;IAC3D,MAAM,OAAO,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAC5C,OAAO,CAAC,KAAK,GAAG;QACd,GAAG,OAAO,CAAC,KAAK;QAChB,QAAQ,EAAE,OAAO,CAAC,WAAW,IAAI,sBAAsB;KACxD,CAAC;IACF,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,UAAU,IAAI,cAAc,EAAE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "otok-adapter-node",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Node.js deployment adapter for Otok with standalone server builds, static assets, and graceful shutdown.",
|
|
5
|
+
"homepage": "https://github.com/kamod-ch/otok/tree/main/packages/otok-adapter-node#readme",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/kamod-ch/otok/issues"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/kamod-ch/otok.git",
|
|
13
|
+
"directory": "packages/otok-adapter-node"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"type": "module",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"default": "./dist/index.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@kamod-ch/otok-config": "1.0.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@kamod-ch/otok": "1.0.0",
|
|
34
|
+
"@types/node": "^24.12.2",
|
|
35
|
+
"otok-adapter-contract": "1.0.0",
|
|
36
|
+
"typescript": "~6.0.2",
|
|
37
|
+
"vite": "^8.0.10",
|
|
38
|
+
"vitest": "^4.1.2"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"@kamod-ch/otok": ">=0.6.1",
|
|
42
|
+
"vite": ">=6"
|
|
43
|
+
},
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=20"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json",
|
|
49
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
50
|
+
"test": "vitest run"
|
|
51
|
+
}
|
|
52
|
+
}
|