@kya-os/create-molti 0.1.0-canary.2 → 0.1.0-canary.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.
|
@@ -17,7 +17,7 @@ export function generateWorkerIndex(projectName) {
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import { Hono } from "hono";
|
|
20
|
-
import { getSandbox,
|
|
20
|
+
import { getSandbox, type SandboxOptions } from "@cloudflare/sandbox";
|
|
21
21
|
import type { MoltbotEnv, AppEnv } from "./types";
|
|
22
22
|
import { publicRoutes } from "./routes/public";
|
|
23
23
|
import { createAccessMiddleware } from "./auth";
|
|
@@ -28,9 +28,9 @@ const app = new Hono<AppEnv>();
|
|
|
28
28
|
|
|
29
29
|
// Initialize sandbox for all requests
|
|
30
30
|
app.use("*", async (c, next) => {
|
|
31
|
-
const options =
|
|
31
|
+
const options: SandboxOptions = {
|
|
32
32
|
sleepAfter: Number(c.env.SANDBOX_SLEEP_AFTER) || 300,
|
|
33
|
-
}
|
|
33
|
+
};
|
|
34
34
|
const sandbox = getSandbox(c.env.Sandbox, "moltbot", options);
|
|
35
35
|
c.set("sandbox", sandbox);
|
|
36
36
|
await next();
|
|
@@ -85,7 +85,7 @@ function loadingPage(): string {
|
|
|
85
85
|
export default {
|
|
86
86
|
fetch: app.fetch,
|
|
87
87
|
async scheduled(_event: ScheduledEvent, env: MoltbotEnv, _ctx: ExecutionContext) {
|
|
88
|
-
const options =
|
|
88
|
+
const options: SandboxOptions = { sleepAfter: 300 };
|
|
89
89
|
const sandbox = getSandbox(env.Sandbox, "moltbot", options);
|
|
90
90
|
// Scheduled backup can be added here
|
|
91
91
|
void sandbox;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrangler.d.ts","sourceRoot":"","sources":["../../src/templates/wrangler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,UAAU,eAAe;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"wrangler.d.ts","sourceRoot":"","sources":["../../src/templates/wrangler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,UAAU,eAAe;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CA4EnE"}
|
|
@@ -37,6 +37,11 @@ export function generateWranglerJsonc(opts) {
|
|
|
37
37
|
]
|
|
38
38
|
},
|
|
39
39
|
|
|
40
|
+
// Durable Object migrations (required by wrangler)
|
|
41
|
+
"migrations": [
|
|
42
|
+
{ "tag": "v1", "new_sqlite_classes": ["Sandbox"] }
|
|
43
|
+
],
|
|
44
|
+
|
|
40
45
|
// R2 bucket for persistent storage
|
|
41
46
|
"r2_buckets": [
|
|
42
47
|
{ "binding": "MOLTBOT_BUCKET", "bucket_name": "${projectName}-data" }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrangler.js","sourceRoot":"","sources":["../../src/templates/wrangler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,MAAM,UAAU,qBAAqB,CAAC,IAAqB;IACzD,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,oBAAoB,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAEtF,MAAM,eAAe,GAAG,oBAAoB;QAC1C,CAAC,CAAC;+BACyB,oBAAoB;mDACA;QAC/C,CAAC,CAAC;;sDAEgD,CAAC;IAErD,OAAO;aACI,WAAW;;;;;;;;;;;0BAWE,YAAY
|
|
1
|
+
{"version":3,"file":"wrangler.js","sourceRoot":"","sources":["../../src/templates/wrangler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,MAAM,UAAU,qBAAqB,CAAC,IAAqB;IACzD,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,oBAAoB,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAEtF,MAAM,eAAe,GAAG,oBAAoB;QAC1C,CAAC,CAAC;+BACyB,oBAAoB;mDACA;QAC/C,CAAC,CAAC;;sDAEgD,CAAC;IAErD,OAAO;aACI,WAAW;;;;;;;;;;;0BAWE,YAAY;;;;;;;;;;;;;;;;;;;qDAmBe,WAAW;;;;;;;;;;;;;;;;;;;iCAmB/B,QAAQ;kCACP,SAAS;;EAEzC,eAAe;;;;;;;;;;;CAWhB,CAAC;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@ export function generateWorkerIndex(projectName: string): string {
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
import { Hono } from "hono";
|
|
21
|
-
import { getSandbox,
|
|
21
|
+
import { getSandbox, type SandboxOptions } from "@cloudflare/sandbox";
|
|
22
22
|
import type { MoltbotEnv, AppEnv } from "./types";
|
|
23
23
|
import { publicRoutes } from "./routes/public";
|
|
24
24
|
import { createAccessMiddleware } from "./auth";
|
|
@@ -29,9 +29,9 @@ const app = new Hono<AppEnv>();
|
|
|
29
29
|
|
|
30
30
|
// Initialize sandbox for all requests
|
|
31
31
|
app.use("*", async (c, next) => {
|
|
32
|
-
const options =
|
|
32
|
+
const options: SandboxOptions = {
|
|
33
33
|
sleepAfter: Number(c.env.SANDBOX_SLEEP_AFTER) || 300,
|
|
34
|
-
}
|
|
34
|
+
};
|
|
35
35
|
const sandbox = getSandbox(c.env.Sandbox, "moltbot", options);
|
|
36
36
|
c.set("sandbox", sandbox);
|
|
37
37
|
await next();
|
|
@@ -86,7 +86,7 @@ function loadingPage(): string {
|
|
|
86
86
|
export default {
|
|
87
87
|
fetch: app.fetch,
|
|
88
88
|
async scheduled(_event: ScheduledEvent, env: MoltbotEnv, _ctx: ExecutionContext) {
|
|
89
|
-
const options =
|
|
89
|
+
const options: SandboxOptions = { sleepAfter: 300 };
|
|
90
90
|
const sandbox = getSandbox(env.Sandbox, "moltbot", options);
|
|
91
91
|
// Scheduled backup can be added here
|
|
92
92
|
void sandbox;
|
|
@@ -50,6 +50,11 @@ export function generateWranglerJsonc(opts: WranglerOptions): string {
|
|
|
50
50
|
]
|
|
51
51
|
},
|
|
52
52
|
|
|
53
|
+
// Durable Object migrations (required by wrangler)
|
|
54
|
+
"migrations": [
|
|
55
|
+
{ "tag": "v1", "new_sqlite_classes": ["Sandbox"] }
|
|
56
|
+
],
|
|
57
|
+
|
|
53
58
|
// R2 bucket for persistent storage
|
|
54
59
|
"r2_buckets": [
|
|
55
60
|
{ "binding": "MOLTBOT_BUCKET", "bucket_name": "${projectName}-data" }
|