diff --git a/bun.lock b/bun.lock index eea8dad..bbaf1db 100644 --- a/bun.lock +++ b/bun.lock @@ -3,15 +3,17 @@ "workspaces": { "": { "name": "the-rabbit-hole", + "devDependencies": { + "@the-rabbit-hole/http": "workspace:*", + "@the-rabbit-hole/spike": "workspace:*", + }, }, "packages/http": { - "name": "http", + "name": "@the-rabbit-hole/http", "dependencies": { - "bun-plugin-tailwind": "^0.0.15", + "@the-rabbit-hole/nano-remix": "workspace:*", + "@the-rabbit-hole/shared": "workspace:*", "hono": "^4.7.11", - "nano-remix": "workspace:*", - "shared": "workspace:*", - "tailwindcss": "^4.1.10", }, "devDependencies": { "@types/bun": "latest", @@ -21,7 +23,7 @@ }, }, "packages/nano-remix": { - "name": "nano-remix", + "name": "@the-rabbit-hole/nano-remix", "dependencies": { "hono": "^4.7.11", }, @@ -33,7 +35,7 @@ }, }, "packages/shared": { - "name": "shared", + "name": "@the-rabbit-hole/shared", "devDependencies": { "@types/bun": "latest", }, @@ -42,7 +44,7 @@ }, }, "packages/spike": { - "name": "spike", + "name": "@the-rabbit-hole/spike", "dependencies": { "discord.js": "^14.19.3", "luxon": "^3.6.1", @@ -77,6 +79,14 @@ "@sapphire/snowflake": ["@sapphire/snowflake@3.5.3", "", {}, "sha512-jjmJywLAFoWeBi1W7994zZyiNWPIiqRRNAmSERxyg93xRGzNYvGjlZ0gR6x0F4gPRi2+0O6S71kOZYyr3cxaIQ=="], + "@the-rabbit-hole/http": ["@the-rabbit-hole/http@workspace:packages/http"], + + "@the-rabbit-hole/nano-remix": ["@the-rabbit-hole/nano-remix@workspace:packages/nano-remix"], + + "@the-rabbit-hole/shared": ["@the-rabbit-hole/shared@workspace:packages/shared"], + + "@the-rabbit-hole/spike": ["@the-rabbit-hole/spike@workspace:packages/spike"], + "@types/bun": ["@types/bun@1.2.16", "", { "dependencies": { "bun-types": "1.2.16" } }, "sha512-1aCZJ/6nSiViw339RsaNhkNoEloLaPzZhxMOYEa7OzRzO41IGg5n/7I43/ZIAW/c+Q6cT12Vf7fOZOoVIzb5BQ=="], "@types/luxon": ["@types/luxon@3.6.2", "", {}, "sha512-R/BdP7OxEMc44l2Ex5lSXHoIXTB2JLNa3y2QISIbr58U/YcsffyQrYW//hZSdrfxrjRZj3GcUoxMPGdO8gSYuw=="], @@ -87,8 +97,6 @@ "@vladfrangu/async_event_emitter": ["@vladfrangu/async_event_emitter@2.4.6", "", {}, "sha512-RaI5qZo6D2CVS6sTHFKg1v5Ohq/+Bo2LZ5gzUEwZ/WkHhwtGTCB/sVLw8ijOkAUxasZ+WshN/Rzj4ywsABJ5ZA=="], - "bun-plugin-tailwind": ["bun-plugin-tailwind@0.0.15", "", { "peerDependencies": { "typescript": "^5.0.0" } }, "sha512-qtAXMNGG4R0UGGI8zWrqm2B7BdXqx48vunJXBPzfDOHPA5WkRUZdTSbE7TFwO4jLhYqSE23YMWsM9NhE6ovobw=="], - "bun-types": ["bun-types@1.2.16", "", { "dependencies": { "@types/node": "*" } }, "sha512-ciXLrHV4PXax9vHvUrkvun9VPVGOVwbbbBF/Ev1cXz12lyEZMoJpIJABOfPcN9gDJRaiKF9MVbSygLg4NXu3/A=="], "discord-api-types": ["discord-api-types@0.38.11", "", {}, "sha512-XN0qhcQpetkyb/49hcDHuoeUPsQqOkb17wbV/t48gUkoEDi4ajhsxqugGcxvcN17BBtI9FPPWEgzv6IhQmCwyw=="], @@ -99,8 +107,6 @@ "hono": ["hono@4.7.11", "", {}, "sha512-rv0JMwC0KALbbmwJDEnxvQCeJh+xbS3KEWW5PC9cMJ08Ur9xgatI0HmtgYZfOdOSOeYsp5LO2cOhdI8cLEbDEQ=="], - "http": ["http@workspace:packages/http"], - "lodash": ["lodash@4.17.21", "", {}, "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="], "lodash.snakecase": ["lodash.snakecase@4.1.1", "", {}, "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw=="], @@ -109,16 +115,8 @@ "magic-bytes.js": ["magic-bytes.js@1.12.1", "", {}, "sha512-ThQLOhN86ZkJ7qemtVRGYM+gRgR8GEXNli9H/PMvpnZsE44Xfh3wx9kGJaldg314v85m+bFW6WBMaVHJc/c3zA=="], - "nano-remix": ["nano-remix@workspace:packages/nano-remix"], - "openai": ["openai@5.3.0", "", { "peerDependencies": { "ws": "^8.18.0", "zod": "^3.23.8" }, "optionalPeers": ["ws", "zod"], "bin": { "openai": "bin/cli" } }, "sha512-VIKmoF7y4oJCDOwP/oHXGzM69+x0dpGFmN9QmYO+uPbLFOmmnwO+x1GbsgUtI+6oraxomGZ566Y421oYVu191w=="], - "shared": ["shared@workspace:packages/shared"], - - "spike": ["spike@workspace:packages/spike"], - - "tailwindcss": ["tailwindcss@4.1.10", "", {}, "sha512-P3nr6WkvKV/ONsTzj6Gb57sWPMX29EPNPopo7+FcpkQaNsrNpZ1pv8QmrYI2RqEKD7mlGqLnGovlcYnBK0IqUA=="], - "ts-mixer": ["ts-mixer@6.0.4", "", {}, "sha512-ufKpbmrugz5Aou4wcr5Wc1UUFWOLhq+Fm6qa6P0w0K5Qw2yhaUoiWszhCVuNQyNwrlGiscHOmqYoAox1PtvgjA=="], "tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], diff --git a/main.ts b/main.ts new file mode 100644 index 0000000..c3156d7 --- /dev/null +++ b/main.ts @@ -0,0 +1,6 @@ +#!/usr/bin/env bun +import { spawn } from "bun" + +const run = (cmd: string[]) => spawn(cmd, { stdout: "inherit", stderr: "inherit" }).exited + +await Promise.all([run(["bun", "http"]), run(["bun", "bot:discord"])]) diff --git a/package.json b/package.json index eba0b9b..01750b7 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,9 @@ "semi": false }, "scripts": { - "http": "bun run --filter=http dev", - "bot:cli": "bun run --filter=spike bot:cli", - "bot:discord": "bun run --filter=spike bot:discord" + "http": "bun run --filter=@the-rabbit-hole/http dev", + "bot:cli": "bun run --filter=@the-rabbit-hole/spike bot:cli", + "bot:discord": "bun run --filter=@the-rabbit-hole/spike bot:discord", + "start": "bun run main.ts" } } \ No newline at end of file diff --git a/packages/http/package.json b/packages/http/package.json index 1cae4a8..86f6dd3 100644 --- a/packages/http/package.json +++ b/packages/http/package.json @@ -1,10 +1,10 @@ { - "name": "http", - "module": "index.ts", + "name": "@the-rabbit-hole/http", + "module": "src/server.ts", "type": "module", "private": true, "scripts": { - "dev": "bun run --hot server" + "dev": "bun run --hot src/server" }, "prettier": { "printWidth": 110, @@ -12,8 +12,8 @@ }, "dependencies": { "hono": "^4.7.11", - "nano-remix": "workspace:*", - "shared": "workspace:*" + "@the-rabbit-hole/nano-remix": "workspace:*", + "@the-rabbit-hole/shared": "workspace:*" }, "devDependencies": { "@types/bun": "latest" diff --git a/packages/http/components/createReminder.tsx b/packages/http/src/components/createReminder.tsx similarity index 97% rename from packages/http/components/createReminder.tsx rename to packages/http/src/components/createReminder.tsx index d4ceabe..ac77c32 100644 --- a/packages/http/components/createReminder.tsx +++ b/packages/http/src/components/createReminder.tsx @@ -1,5 +1,5 @@ import { Form } from "nano-remix" -import { users } from "shared/reminders" +import { users } from "@the-rabbit-hole/shared/reminders" type Props = { loading: boolean diff --git a/packages/http/routes/index.tsx b/packages/http/src/routes/index.tsx similarity index 94% rename from packages/http/routes/index.tsx rename to packages/http/src/routes/index.tsx index ee7d3d9..6fffbe1 100644 --- a/packages/http/routes/index.tsx +++ b/packages/http/src/routes/index.tsx @@ -1,7 +1,7 @@ -import KV from "shared/kv" +import KV from "@the-rabbit-hole/shared/kv" import { Form, type Head, type LoaderProps, useAction } from "nano-remix" -import { addReminder, deleteReminder, type Reminder } from "shared/reminders" -import { CreateReminder } from "components/createReminder" +import { addReminder, deleteReminder, type Reminder } from "@the-rabbit-hole/shared/reminders" +import { CreateReminder } from "@/components/createReminder" export const head: Head = { title: "Reminders", diff --git a/packages/http/server.tsx b/packages/http/src/server.tsx similarity index 82% rename from packages/http/server.tsx rename to packages/http/src/server.tsx index a80b678..c43f55d 100644 --- a/packages/http/server.tsx +++ b/packages/http/src/server.tsx @@ -1,5 +1,5 @@ import { serve } from "bun" -import { nanoRemix } from "nano-remix" +import { nanoRemix } from "@the-rabbit-hole/nano-remix" import { join } from "node:path" serve({ diff --git a/packages/nano-remix/package.json b/packages/nano-remix/package.json index 1059186..4ee4a01 100644 --- a/packages/nano-remix/package.json +++ b/packages/nano-remix/package.json @@ -1,5 +1,5 @@ { - "name": "nano-remix", + "name": "@the-rabbit-hole/nano-remix", "module": "src/main.ts", "type": "module", "types": "src/main.ts", diff --git a/packages/shared/.gitignore b/packages/shared/.gitignore index a14702c..209a71b 100644 --- a/packages/shared/.gitignore +++ b/packages/shared/.gitignore @@ -32,3 +32,5 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json # Finder (MacOS) folder config .DS_Store + +data \ No newline at end of file diff --git a/packages/shared/data/kv.json b/packages/shared/data/kv.json deleted file mode 100644 index a1e9001..0000000 --- a/packages/shared/data/kv.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "reminders.10": [ - { - "id": "fa512c41-b325-4e33-b129-2402890bb4a3", - "title": "Eat a sandwich", - "dueDate": "2025-06-17T02:02:00.000-07:00", - "status": "pending", - "assignee": "chris" - }, - { - "id": "4de80817-8162-4196-ae5c-e86bc3414005", - "title": "Make a sand castle", - "dueDate": "2025-06-06T15:03:00.000-07:00", - "status": "pending", - "assignee": "corey" - } - ] -} \ No newline at end of file diff --git a/packages/shared/package.json b/packages/shared/package.json index e49ddef..79452a5 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,5 +1,5 @@ { - "name": "shared", + "name": "@the-rabbit-hole/shared", "type": "module", "exports": { "./kv": "./src/kv.ts", diff --git a/packages/spike/package.json b/packages/spike/package.json index a1b69db..f4f1f21 100644 --- a/packages/spike/package.json +++ b/packages/spike/package.json @@ -1,6 +1,6 @@ { - "name": "spike", - "module": "index.ts", + "name": "@the-rabbit-hole/spike", + "module": "src/discord/index.ts", "type": "module", "private": true, "scripts": {