helloruntime 0.0.2 → 0.0.4
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/dist/cli/deploy.d.ts.map +1 -1
- package/dist/cli/deploy.js +8 -6
- package/dist/cli/deploy.js.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/packager.d.ts +5 -4
- package/dist/cli/packager.d.ts.map +1 -1
- package/dist/cli/packager.js +80 -34
- package/dist/cli/packager.js.map +1 -1
- package/dist/sdk/index.d.ts +1 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -0
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/runtime/nitro.d.ts +31 -0
- package/dist/sdk/runtime/nitro.d.ts.map +1 -0
- package/dist/sdk/runtime/nitro.js +58 -0
- package/dist/sdk/runtime/nitro.js.map +1 -0
- package/helloruntime.schema.json +9 -15
- package/package.json +6 -2
package/dist/cli/deploy.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/cli/deploy.ts"],"names":[],"mappings":"AAkCA,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/cli/deploy.ts"],"names":[],"mappings":"AAkCA,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAgE5E"}
|
package/dist/cli/deploy.js
CHANGED
|
@@ -2,7 +2,7 @@ import { readFile } from "node:fs/promises";
|
|
|
2
2
|
import { basename, join } from "node:path";
|
|
3
3
|
import { readConfig } from "./config.js";
|
|
4
4
|
import { helloruntimeRequest } from "./http.js";
|
|
5
|
-
import {
|
|
5
|
+
import { packageBundle, runBuild } from "./packager.js";
|
|
6
6
|
import { readProjectConfig } from "./project-config.js";
|
|
7
7
|
const TERMINAL = new Set(["active", "failed"]);
|
|
8
8
|
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
@@ -21,19 +21,21 @@ export async function deployCommand(options) {
|
|
|
21
21
|
.then((raw) => JSON.parse(raw))
|
|
22
22
|
.catch(() => ({}));
|
|
23
23
|
const appName = options.app ?? pkg.name ?? basename(cwd);
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
// Build locally (Vite/Nitro → .output), then package the bundle and reject natives.
|
|
25
|
+
await runBuild(cwd, projectConfig.build?.command);
|
|
26
|
+
process.stdout.write("Packaging bundle… ");
|
|
27
|
+
const { tarPath, bundleSha, fileCount } = await packageBundle(cwd);
|
|
28
|
+
console.log(`${fileCount} files (${bundleSha.slice(0, 12)})`);
|
|
27
29
|
process.stdout.write("Uploading… ");
|
|
28
30
|
const tarball = await readFile(tarPath);
|
|
29
|
-
const uploaded = await helloruntimeRequest(config, `/v1/artifacts?
|
|
31
|
+
const uploaded = await helloruntimeRequest(config, `/v1/artifacts?bundleSha=${encodeURIComponent(bundleSha)}`, { method: "POST", headers: { "content-type": "application/gzip" }, body: tarball });
|
|
30
32
|
console.log(`${(uploaded.artifactSizeBytes / 1024).toFixed(0)} KiB`);
|
|
31
33
|
const created = await helloruntimeRequest(config, "/v1/deployments", {
|
|
32
34
|
method: "POST",
|
|
33
35
|
body: JSON.stringify({
|
|
34
36
|
appName,
|
|
35
37
|
appSlug: appName,
|
|
36
|
-
|
|
38
|
+
bundleSha,
|
|
37
39
|
artifactKey: uploaded.artifactKey,
|
|
38
40
|
artifactSizeBytes: uploaded.artifactSizeBytes,
|
|
39
41
|
manifest: projectConfig
|
package/dist/cli/deploy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/cli/deploy.ts"],"names":[],"mappings":"AAAA,O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G,MAAM,CAAC,MAAM,CAAC;YACtB,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC1B,CAAC;QACD,IAAI,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YAChC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC3B,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;gBAC/B,MAAM,IAAI,KAAK,CAAC,kBAAkB,MAAM,CAAC,KAAK,IAAI,eAAe,EAAE,CAAC,CAAC;YACvE,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,iBAAiB,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;YAC/C,OAAO,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;YAC/B,OAAO;QACT,CAAC;QACD,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;AACH,CAAC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { destroyCommand } from "./destroy.js";
|
|
|
5
5
|
import { loginCommand } from "./login.js";
|
|
6
6
|
import { cronList, cronTrigger, jobsList, jobsTrigger } from "./triggers.js";
|
|
7
7
|
const program = new Command();
|
|
8
|
-
program.name("helloruntime").description("Deploy server-rendered JS/TS apps to Helloruntime").version("0.0.
|
|
8
|
+
program.name("helloruntime").description("Deploy server-rendered JS/TS apps to Helloruntime").version("0.0.4");
|
|
9
9
|
program
|
|
10
10
|
.command("login")
|
|
11
11
|
.description("Authenticate via the browser (device flow)")
|
package/dist/cli/packager.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function runBuild(cwd: string, command?: string): Promise<void>;
|
|
2
|
+
export interface PackagedBundle {
|
|
2
3
|
tarPath: string;
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
bundleSha: string;
|
|
5
|
+
fileCount: number;
|
|
5
6
|
}
|
|
6
|
-
export declare function
|
|
7
|
+
export declare function packageBundle(cwd: string): Promise<PackagedBundle>;
|
|
7
8
|
//# sourceMappingURL=packager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packager.d.ts","sourceRoot":"","sources":["../../src/cli/packager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"packager.d.ts","sourceRoot":"","sources":["../../src/cli/packager.ts"],"names":[],"mappings":"AA2BA,wBAAsB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkB3E;AAgBD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAKD,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CA4CxE"}
|
package/dist/cli/packager.js
CHANGED
|
@@ -1,49 +1,95 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
1
2
|
import { createHash } from "node:crypto";
|
|
2
|
-
import {
|
|
3
|
+
import { createReadStream } from "node:fs";
|
|
4
|
+
import { access, mkdir, readdir } from "node:fs/promises";
|
|
3
5
|
import { join, relative, sep } from "node:path";
|
|
6
|
+
import { Transform } from "node:stream";
|
|
7
|
+
import { pipeline } from "node:stream/promises";
|
|
4
8
|
import * as tar from "tar";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
".
|
|
14
|
-
|
|
15
|
-
".
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
const OUTPUT_DIR = ".output";
|
|
10
|
+
const ENTRY = join(OUTPUT_DIR, "server", "index.mjs");
|
|
11
|
+
// Drizzle migrations live here by convention; packaged alongside .output so the platform
|
|
12
|
+
// migrator (run as a pre-cutover Job) can apply them against the managed database.
|
|
13
|
+
const MIGRATIONS_DIR = join("db", "migrations");
|
|
14
|
+
// Detect the package manager from the lockfile so `<pm> run build` matches what the
|
|
15
|
+
// developer uses. Defaults to npm.
|
|
16
|
+
function detectPackageManager(files) {
|
|
17
|
+
if (files.has("pnpm-lock.yaml"))
|
|
18
|
+
return "pnpm";
|
|
19
|
+
if (files.has("yarn.lock"))
|
|
20
|
+
return "yarn";
|
|
21
|
+
if (files.has("bun.lockb"))
|
|
22
|
+
return "bun";
|
|
23
|
+
return "npm";
|
|
24
|
+
}
|
|
25
|
+
// Run the project's build (Vite/Nitro → .output) on the developer's machine, streaming
|
|
26
|
+
// logs straight to their terminal. `command` overrides the default `<pm> run build`.
|
|
27
|
+
export async function runBuild(cwd, command) {
|
|
28
|
+
const top = new Set(await readdir(cwd).catch(() => []));
|
|
29
|
+
const [cmd, args] = command
|
|
30
|
+
? ["sh", ["-c", command]]
|
|
31
|
+
: [detectPackageManager(top), ["run", "build"]];
|
|
32
|
+
process.stdout.write(`Building (${command ?? `${cmd} run build`})…\n`);
|
|
33
|
+
const result = spawnSync(cmd, args, { cwd, stdio: "inherit" });
|
|
34
|
+
if (result.status !== 0) {
|
|
35
|
+
throw new Error(`build failed (${cmd} exited ${result.status ?? result.signal})`);
|
|
36
|
+
}
|
|
37
|
+
await access(join(cwd, ENTRY)).catch(() => {
|
|
38
|
+
throw new Error(`no Nitro output at ${ENTRY} after build. Ensure the app builds with the ` +
|
|
39
|
+
`node-server preset (Nitro \`preset: "node-server"\`).`);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
// Recursively walk .output, collecting relative file paths and any native addons.
|
|
43
|
+
async function walkOutput(dir, base, files, native) {
|
|
20
44
|
for (const entry of await readdir(dir, { withFileTypes: true })) {
|
|
45
|
+
const full = join(dir, entry.name);
|
|
21
46
|
if (entry.isDirectory()) {
|
|
22
|
-
|
|
23
|
-
await walk(join(dir, entry.name), out);
|
|
47
|
+
await walkOutput(full, base, files, native);
|
|
24
48
|
}
|
|
25
|
-
else if (entry.isFile()
|
|
26
|
-
|
|
49
|
+
else if (entry.isFile()) {
|
|
50
|
+
const rel = relative(base, full).split(sep).join("/");
|
|
51
|
+
files.push(rel);
|
|
52
|
+
if (entry.name.endsWith(".node"))
|
|
53
|
+
native.push(rel);
|
|
27
54
|
}
|
|
28
55
|
}
|
|
29
56
|
}
|
|
30
|
-
//
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
57
|
+
// Package the built `.output/` into a gzip tarball and hash the EXACT tarball bytes
|
|
58
|
+
// (this is what the runtime loader verifies). Rejects native modules: pure-JS bundles
|
|
59
|
+
// only, so a macOS-built `.node` can never silently crash on a Linux node.
|
|
60
|
+
export async function packageBundle(cwd) {
|
|
61
|
+
const outputDir = join(cwd, OUTPUT_DIR);
|
|
62
|
+
await access(outputDir).catch(() => {
|
|
63
|
+
throw new Error(`no ${OUTPUT_DIR}/ to package — did the build run?`);
|
|
64
|
+
});
|
|
65
|
+
const files = [];
|
|
66
|
+
const native = [];
|
|
67
|
+
await walkOutput(outputDir, cwd, files, native);
|
|
68
|
+
if (native.length > 0) {
|
|
69
|
+
throw new Error(`native modules are not supported (pure-JS bundles only). Found:\n` +
|
|
70
|
+
native.map((n) => ` - ${n}`).join("\n") +
|
|
71
|
+
`\nRemove the native dependency, or request it be added to the runtime image.`);
|
|
41
72
|
}
|
|
42
|
-
|
|
73
|
+
// Package .output and, if present, ./db/migrations (Drizzle convention) so the
|
|
74
|
+
// platform can run migrations from /app/db/migrations before cutover.
|
|
75
|
+
const entries = [OUTPUT_DIR];
|
|
76
|
+
const hasMigrations = await access(join(cwd, MIGRATIONS_DIR))
|
|
77
|
+
.then(() => true)
|
|
78
|
+
.catch(() => false);
|
|
79
|
+
if (hasMigrations)
|
|
80
|
+
entries.push(MIGRATIONS_DIR);
|
|
43
81
|
const outDir = join(cwd, ".helloruntime", "artifacts");
|
|
44
82
|
await mkdir(outDir, { recursive: true });
|
|
45
|
-
const tarPath = join(outDir,
|
|
83
|
+
const tarPath = join(outDir, "bundle.tgz");
|
|
84
|
+
// The loader extracts to /app → /app/.output/server/index.mjs (+ /app/db/migrations).
|
|
46
85
|
await tar.c({ gzip: true, file: tarPath, cwd, portable: true }, entries);
|
|
47
|
-
|
|
86
|
+
const hash = createHash("sha256");
|
|
87
|
+
await pipeline(createReadStream(tarPath), new Transform({
|
|
88
|
+
transform(chunk, _enc, cb) {
|
|
89
|
+
hash.update(chunk);
|
|
90
|
+
cb();
|
|
91
|
+
}
|
|
92
|
+
}));
|
|
93
|
+
return { tarPath, bundleSha: hash.digest("hex"), fileCount: files.length };
|
|
48
94
|
}
|
|
49
95
|
//# sourceMappingURL=packager.js.map
|
package/dist/cli/packager.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packager.js","sourceRoot":"","sources":["../../src/cli/packager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"packager.js","sourceRoot":"","sources":["../../src/cli/packager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAs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;IACtF,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;IAEzE,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;IAClC,MAAM,QAAQ,CACZ,gBAAgB,CAAC,OAAO,CAAC,EACzB,IAAI,SAAS,CAAC;QACZ,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;YACvB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACnB,EAAE,EAAE,CAAC;QACP,CAAC;KACF,CAAC,CACH,CAAC;IAEF,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;AAC7E,CAAC"}
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { sendJob, type SendJobOptions, type SendJobResult } from "./send-job.js"
|
|
|
5
5
|
export { createHelloruntimeHandler, type HelloruntimeHandlerOptions } from "./runtime/handler.js";
|
|
6
6
|
export { helloruntimeExpress } from "./runtime/express.js";
|
|
7
7
|
export { helloruntimeHono } from "./runtime/hono.js";
|
|
8
|
+
export { helloruntimeNitro, type HelloruntimeNitroPlugin } from "./runtime/nitro.js";
|
|
8
9
|
export { registerHelloruntime } from "./runtime/register.js";
|
|
9
10
|
export type { JobContext, CronContext, JobHandler, CronHandler } from "@helloruntime/protocol";
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/sdk/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sdk/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAA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AE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/sdk/index.js
CHANGED
|
@@ -7,5 +7,6 @@ export { sendJob } from "./send-job.js";
|
|
|
7
7
|
export { createHelloruntimeHandler } from "./runtime/handler.js";
|
|
8
8
|
export { helloruntimeExpress } from "./runtime/express.js";
|
|
9
9
|
export { helloruntimeHono } from "./runtime/hono.js";
|
|
10
|
+
export { helloruntimeNitro } from "./runtime/nitro.js";
|
|
10
11
|
export { registerHelloruntime } from "./runtime/register.js";
|
|
11
12
|
//# sourceMappingURL=index.js.map
|
package/dist/sdk/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sdk/index.ts"],"names":[],"mappings":"AAAA,4GAA4G;AAC5G,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,SAAS,EAAsB,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAuB,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,OAAO,EAA2C,MAAM,eAAe,CAAC;AAEjF,mFAAmF;AACnF,OAAO,EAAE,yBAAyB,EAAmC,MAAM,sBAAsB,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sdk/index.ts"],"names":[],"mappings":"AAAA,4GAA4G;AAC5G,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,SAAS,EAAsB,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAuB,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,OAAO,EAA2C,MAAM,eAAe,CAAC;AAEjF,mFAAmF;AACnF,OAAO,EAAE,yBAAyB,EAAmC,MAAM,sBAAsB,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAgC,MAAM,oBAAoB,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { IncomingMessage } from "node:http";
|
|
2
|
+
import { type HelloruntimeHandlerOptions } from "./handler.js";
|
|
3
|
+
interface H3EventLike {
|
|
4
|
+
node: {
|
|
5
|
+
req: IncomingMessage;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
interface NitroAppLike {
|
|
9
|
+
h3App: {
|
|
10
|
+
use: (handler: (event: H3EventLike) => Promise<Response | undefined>) => void;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export type HelloruntimeNitroPlugin = (nitroApp: NitroAppLike) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Nitro server plugin that serves the platform's job/cron dispatch from inside a Nitro
|
|
16
|
+
* (node-server preset) app. Register it once:
|
|
17
|
+
*
|
|
18
|
+
* // server/plugins/helloruntime.ts (Nitro auto-loads server/plugins/*)
|
|
19
|
+
* export { default } from "helloruntime/nitro";
|
|
20
|
+
*
|
|
21
|
+
* It adds an early h3 middleware that intercepts `/_helloruntime/jobs|cron/*`, verifies
|
|
22
|
+
* the HMAC over the EXACT raw request bytes (read straight off the Node request stream —
|
|
23
|
+
* NOT via h3's readRawBody, which can normalize/cache the body and break the signature),
|
|
24
|
+
* runs the registered handler, and returns the response. All other requests pass through
|
|
25
|
+
* untouched. Requires a Nitro/h3 that supports returning a Web `Response` from middleware.
|
|
26
|
+
*/
|
|
27
|
+
export declare function helloruntimeNitro(options?: HelloruntimeHandlerOptions): HelloruntimeNitroPlugin;
|
|
28
|
+
/** Ready-to-use plugin with default options (re-export as a Nitro server plugin). */
|
|
29
|
+
declare const _default: HelloruntimeNitroPlugin;
|
|
30
|
+
export default _default;
|
|
31
|
+
//# sourceMappingURL=nitro.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nitro.d.ts","sourceRoot":"","sources":["../../../src/sdk/runtime/nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,EAA6B,KAAK,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAO1F,UAAU,WAAW;IACnB,IAAI,EAAE;QAAE,GAAG,EAAE,eAAe,CAAA;KAAE,CAAC;CAChC;AACD,UAAU,YAAY;IACpB,KAAK,EAAE;QAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,KAAK,IAAI,CAAA;KAAE,CAAC;CAC1F;AAED,MAAM,MAAM,uBAAuB,GAAG,CAAC,QAAQ,EAAE,YAAY,KAAK,IAAI,CAAC;AAEvE;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,0BAA+B,GAAG,uBAAuB,CAcnG;AAED,qFAAqF;;AACrF,wBAAmC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { createHelloruntimeHandler } from "./handler.js";
|
|
2
|
+
import { registerHelloruntime } from "./register.js";
|
|
3
|
+
const HELLORUNTIME_PREFIX = "/_helloruntime/";
|
|
4
|
+
/**
|
|
5
|
+
* Nitro server plugin that serves the platform's job/cron dispatch from inside a Nitro
|
|
6
|
+
* (node-server preset) app. Register it once:
|
|
7
|
+
*
|
|
8
|
+
* // server/plugins/helloruntime.ts (Nitro auto-loads server/plugins/*)
|
|
9
|
+
* export { default } from "helloruntime/nitro";
|
|
10
|
+
*
|
|
11
|
+
* It adds an early h3 middleware that intercepts `/_helloruntime/jobs|cron/*`, verifies
|
|
12
|
+
* the HMAC over the EXACT raw request bytes (read straight off the Node request stream —
|
|
13
|
+
* NOT via h3's readRawBody, which can normalize/cache the body and break the signature),
|
|
14
|
+
* runs the registered handler, and returns the response. All other requests pass through
|
|
15
|
+
* untouched. Requires a Nitro/h3 that supports returning a Web `Response` from middleware.
|
|
16
|
+
*/
|
|
17
|
+
export function helloruntimeNitro(options = {}) {
|
|
18
|
+
const handle = createHelloruntimeHandler(options);
|
|
19
|
+
return (nitroApp) => {
|
|
20
|
+
nitroApp.h3App.use(async (event) => {
|
|
21
|
+
const req = event.node.req;
|
|
22
|
+
if (!req.url?.startsWith(HELLORUNTIME_PREFIX))
|
|
23
|
+
return undefined; // not ours → pass through
|
|
24
|
+
const body = await readBody(req);
|
|
25
|
+
const response = await handle(toWebRequest(req, body));
|
|
26
|
+
return response ?? undefined;
|
|
27
|
+
});
|
|
28
|
+
// Fire self-registration after the entry module's defineJob/defineCron have run.
|
|
29
|
+
setImmediate(() => void registerHelloruntime());
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/** Ready-to-use plugin with default options (re-export as a Nitro server plugin). */
|
|
33
|
+
export default helloruntimeNitro();
|
|
34
|
+
function readBody(req) {
|
|
35
|
+
return new Promise((resolve, reject) => {
|
|
36
|
+
const chunks = [];
|
|
37
|
+
req.on("data", (c) => chunks.push(Buffer.from(c)));
|
|
38
|
+
req.on("end", () => resolve(Buffer.concat(chunks)));
|
|
39
|
+
req.on("error", reject);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function toWebRequest(req, body) {
|
|
43
|
+
const host = req.headers.host ?? "app.internal";
|
|
44
|
+
const headers = new Headers();
|
|
45
|
+
for (const [key, value] of Object.entries(req.headers)) {
|
|
46
|
+
if (Array.isArray(value))
|
|
47
|
+
for (const v of value)
|
|
48
|
+
headers.append(key, v);
|
|
49
|
+
else if (value != null)
|
|
50
|
+
headers.set(key, value);
|
|
51
|
+
}
|
|
52
|
+
return new Request(`http://${host}${req.url}`, {
|
|
53
|
+
method: req.method ?? "GET",
|
|
54
|
+
headers,
|
|
55
|
+
body: body.length ? body : undefined
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=nitro.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nitro.js","sourceRoot":"","sources":["../../../src/sdk/runtime/nitro.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAmC,MAAM,cAAc,CAAC;AAC1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAa9C;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,iBAAiB,CAAC,UAAsC,EAAE;IACxE,MAAM,MAAM,GAAG,yBAAyB,CAAC,OAAO,CAAC,CAAC;IAElD,OAAO,CAAC,QAAQ,EAAE,EAAE;QAClB,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YACjC,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;YAC3B,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,mBAAmB,CAAC;gBAAE,OAAO,SAAS,CAAC,CAAC,0BAA0B;YAC3F,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC;YACjC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;YACvD,OAAO,QAAQ,IAAI,SAAS,CAAC;QAC/B,CAAC,CAAC,CAAC;QACH,iFAAiF;QACjF,YAAY,CAAC,GAAG,EAAE,CAAC,KAAK,oBAAoB,EAAE,CAAC,CAAC;IAClD,CAAC,CAAC;AACJ,CAAC;AAED,qFAAqF;AACrF,eAAe,iBAAiB,EAAE,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AC,IAAI,CAAC,CAAC,CAAC,SAAS;KACrC,CAAC,CAAC;AACL,CAAC"}
|
package/helloruntime.schema.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://helloruntime.dev/schema/helloruntime.json",
|
|
4
4
|
"title": "Helloruntime app config",
|
|
5
|
-
"description": "Build + deploy knobs for a Helloruntime app (helloruntime.json). All fields are optional.
|
|
5
|
+
"description": "Build + deploy knobs for a Helloruntime app (helloruntime.json). All fields are optional. The CLI builds your app locally (Vite/Nitro → .output) and ships the bundle; there is no Docker build.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"additionalProperties": false,
|
|
8
8
|
"properties": {
|
|
@@ -13,22 +13,11 @@
|
|
|
13
13
|
"build": {
|
|
14
14
|
"type": "object",
|
|
15
15
|
"additionalProperties": false,
|
|
16
|
-
"description": "How the
|
|
16
|
+
"description": "How the bundle is produced locally.",
|
|
17
17
|
"properties": {
|
|
18
|
-
"
|
|
18
|
+
"command": {
|
|
19
19
|
"type": "string",
|
|
20
|
-
"description": "
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
"deploy": {
|
|
25
|
-
"type": "object",
|
|
26
|
-
"additionalProperties": false,
|
|
27
|
-
"description": "Deploy-time behavior.",
|
|
28
|
-
"properties": {
|
|
29
|
-
"release": {
|
|
30
|
-
"type": "string",
|
|
31
|
-
"description": "One-shot command run in the built image before cutover (e.g. database migrations). The deploy fails if it exits non-zero."
|
|
20
|
+
"description": "Override the build command the CLI runs (default: your package.json \"build\" script, e.g. vite/nitro build → .output)."
|
|
32
21
|
}
|
|
33
22
|
}
|
|
34
23
|
},
|
|
@@ -41,6 +30,11 @@
|
|
|
41
30
|
"type": "boolean",
|
|
42
31
|
"default": true,
|
|
43
32
|
"description": "Provision a managed Postgres and inject DATABASE_URL. Set false to opt out."
|
|
33
|
+
},
|
|
34
|
+
"migrate": {
|
|
35
|
+
"type": "boolean",
|
|
36
|
+
"default": true,
|
|
37
|
+
"description": "Run Drizzle migrations from ./db/migrations against the managed database before cutover. The deploy fails if a migration errors. Set false to opt out."
|
|
44
38
|
}
|
|
45
39
|
}
|
|
46
40
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "helloruntime",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "CLI + runtime SDK for Helloruntime — a small self-hostable PaaS for server-rendered JS/TS apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://helloruntime.com",
|
|
@@ -25,6 +25,10 @@
|
|
|
25
25
|
".": {
|
|
26
26
|
"types": "./dist/sdk/index.d.ts",
|
|
27
27
|
"default": "./dist/sdk/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./nitro": {
|
|
30
|
+
"types": "./dist/sdk/runtime/nitro.d.ts",
|
|
31
|
+
"default": "./dist/sdk/runtime/nitro.js"
|
|
28
32
|
}
|
|
29
33
|
},
|
|
30
34
|
"files": [
|
|
@@ -37,7 +41,7 @@
|
|
|
37
41
|
"pg": "^8.16.2",
|
|
38
42
|
"tar": "^7.4.3",
|
|
39
43
|
"zod": "^3.25.67",
|
|
40
|
-
"@helloruntime/protocol": "^0.0.
|
|
44
|
+
"@helloruntime/protocol": "^0.0.4"
|
|
41
45
|
},
|
|
42
46
|
"devDependencies": {
|
|
43
47
|
"@types/pg": "^8.15.4",
|