@the-rabbit-hole => @workshop

This commit is contained in:
Chris Wanstrath 2025-06-16 22:09:12 -07:00
parent efbe9ba41a
commit b403c6d1d4
16 changed files with 41 additions and 41 deletions

View File

@ -5,14 +5,14 @@ We are making a bunch of smaller projects that occasionally rely on each other.
## Ok, I want to add a new project.
- `bun init packages/WHATEVER_YOU_WANT`
- Edit the `package.json` and change the name to `@the-rabbit-hole/WHATEVER_YOU_WANT`
- Edit the `package.json` and change the name to `@workshop/WHATEVER_YOU_WANT`
To add one of the existing packages as a dependency, edit the `package.json` and add it to the `dependencies` or `devDependencies` section. For example, if you want to add `@the-rabbit-hole/WHATEVER_YOU_WANT`, you would do:
To add one of the existing packages as a dependency, edit the `package.json` and add it to the `dependencies` or `devDependencies` section. For example, if you want to add `@workshop/WHATEVER_YOU_WANT`, you would do:
```json
{
"dependencies": {
"@the-rabbit-hole/WHATEVER_YOU_WANT": "workspace:*"
"@workshop/WHATEVER_YOU_WANT": "workspace:*"
}
}
```
@ -20,13 +20,13 @@ To add one of the existing packages as a dependency, edit the `package.json` and
Then run `bun install` and import it in your code like so:
```javascript
import { something } from "@the-rabbit-hole/WHATEVER_YOU_WANT"
import { something } from "@workshop/WHATEVER_YOU_WANT"
```
## What does corey not love about this?
- I put near-zero effort into naming things.
- I'd prefer the namespace to be shorter, `@the-rabbit-hole` is a bit long.
- I'd prefer the namespace to be shorter, `@workshop` is a bit long.
- There are lots things I don't love about nano-remix, but it works well enough for now.
- The bun tailwind plugin doesn't work with nano-remix yet, but it looks like in a future bun release it will.

View File

@ -2,13 +2,13 @@
"lockfileVersion": 1,
"workspaces": {
"": {
"name": "the-rabbit-hole",
"name": "workshop",
},
"packages/http": {
"name": "@the-rabbit-hole/http",
"name": "@workshop/http",
"dependencies": {
"@the-rabbit-hole/nano-remix": "workspace:*",
"@the-rabbit-hole/shared": "workspace:*",
"@workshop/nano-remix": "workspace:*",
"@workshop/shared": "workspace:*",
"hono": "^4.7.11",
},
"devDependencies": {
@ -34,7 +34,7 @@
},
},
"packages/nano-remix": {
"name": "@the-rabbit-hole/nano-remix",
"name": "@workshop/nano-remix",
"dependencies": {
"hono": "^4.7.11",
},
@ -46,7 +46,7 @@
},
},
"packages/shared": {
"name": "@the-rabbit-hole/shared",
"name": "@workshop/shared",
"devDependencies": {
"@types/bun": "latest",
},
@ -55,7 +55,7 @@
},
},
"packages/spike": {
"name": "@the-rabbit-hole/spike",
"name": "@workshop/spike",
"dependencies": {
"discord.js": "^14.19.3",
"luxon": "^3.6.1",
@ -90,13 +90,13 @@
"@sapphire/snowflake": ["@sapphire/snowflake@3.5.3", "", {}, "sha512-jjmJywLAFoWeBi1W7994zZyiNWPIiqRRNAmSERxyg93xRGzNYvGjlZ0gR6x0F4gPRi2+0O6S71kOZYyr3cxaIQ=="],
"@the-rabbit-hole/http": ["@the-rabbit-hole/http@workspace:packages/http"],
"@workshop/http": ["@workshop/http@workspace:packages/http"],
"@the-rabbit-hole/nano-remix": ["@the-rabbit-hole/nano-remix@workspace:packages/nano-remix"],
"@workshop/nano-remix": ["@workshop/nano-remix@workspace:packages/nano-remix"],
"@the-rabbit-hole/shared": ["@the-rabbit-hole/shared@workspace:packages/shared"],
"@workshop/shared": ["@workshop/shared@workspace:packages/shared"],
"@the-rabbit-hole/spike": ["@the-rabbit-hole/spike@workspace:packages/spike"],
"@workshop/spike": ["@workshop/spike@workspace:packages/spike"],
"@types/bun": ["@types/bun@1.2.16", "", { "dependencies": { "bun-types": "1.2.16" } }, "sha512-1aCZJ/6nSiViw339RsaNhkNoEloLaPzZhxMOYEa7OzRzO41IGg5n/7I43/ZIAW/c+Q6cT12Vf7fOZOoVIzb5BQ=="],

View File

@ -1,5 +1,5 @@
{
"name": "the-rabbit-hole",
"name": "workshop",
"private": true,
"workspaces": [
"packages/*"
@ -9,9 +9,9 @@
"semi": false
},
"scripts": {
"http": "bun run --filter=@the-rabbit-hole/http start",
"bot:cli": "bun run --filter=@the-rabbit-hole/spike bot:cli",
"bot:discord": "bun run --filter=@the-rabbit-hole/spike bot:discord",
"http": "bun run --filter=@workshop/http start",
"bot:cli": "bun run --filter=@workshop/spike bot:cli",
"bot:discord": "bun run --filter=@workshop/spike bot:discord",
"start": "bun run main.ts"
}
}

View File

@ -1,5 +1,5 @@
{
"name": "@the-rabbit-hole/http",
"name": "@workshop/http",
"module": "src/server.ts",
"type": "module",
"private": true,
@ -13,8 +13,8 @@
},
"dependencies": {
"hono": "^4.7.11",
"@the-rabbit-hole/nano-remix": "workspace:*",
"@the-rabbit-hole/shared": "workspace:*"
"@workshop/nano-remix": "workspace:*",
"@workshop/shared": "workspace:*"
},
"devDependencies": {
"@types/bun": "latest"

View File

@ -1,5 +1,5 @@
import { Form } from "@the-rabbit-hole/nano-remix"
import { users } from "@the-rabbit-hole/shared/reminders"
import { Form } from "@workshop/nano-remix"
import { users } from "@workshop/shared/reminders"
type Props = {
loading: boolean

View File

@ -1,6 +1,6 @@
import KV from "@the-rabbit-hole/shared/kv"
import { Form, type Head, type LoaderProps, useAction } from "@the-rabbit-hole/nano-remix"
import { addReminder, deleteReminder, type Reminder } from "@the-rabbit-hole/shared/reminders"
import KV from "@workshop/shared/kv"
import { Form, type Head, type LoaderProps, useAction } from "@workshop/nano-remix"
import { addReminder, deleteReminder, type Reminder } from "@workshop/shared/reminders"
import { CreateReminder } from "@/components/createReminder"
export const head: Head = {

View File

@ -1,5 +1,5 @@
import { serve } from "bun"
import { nanoRemix } from "@the-rabbit-hole/nano-remix"
import { nanoRemix } from "@workshop/nano-remix"
import { join } from "node:path"
const server = serve({

View File

@ -1,5 +1,5 @@
{
"name": "@the-rabbit-hole/nano-remix",
"name": "@workshop/nano-remix",
"module": "src/main.ts",
"type": "module",
"types": "src/main.ts",

View File

@ -55,7 +55,7 @@ const buildDynamicRoute = async (distDir: string, routeName: string, filepath: s
// Only import the Component so that tree-shaking will get rid of the server-side code
const code = `
import Component from "${filepath}"
import { wrapComponentWithLoader} from "@the-rabbit-hole/nano-remix"
import { wrapComponentWithLoader} from "@workshop/nano-remix"
import { render } from 'hono/jsx/dom'
const root = document.getElementById('root')

View File

@ -1,5 +1,5 @@
{
"name": "@the-rabbit-hole/shared",
"name": "@workshop/shared",
"type": "module",
"exports": {
"./kv": "./src/kv.ts",

View File

@ -1,5 +1,5 @@
{
"name": "@the-rabbit-hole/spike",
"name": "@workshop/spike",
"module": "src/discord/index.ts",
"type": "module",
"private": true,

View File

@ -1,8 +1,8 @@
import OpenAI from "openai"
import { ensure } from "@the-rabbit-hole/shared/utils"
import KV from "@the-rabbit-hole/shared/kv"
import { ensure } from "@workshop/shared/utils"
import KV from "@workshop/shared/kv"
import { buildInstructions } from "@/instructions"
import { log } from "@the-rabbit-hole/shared/log"
import { log } from "@workshop/shared/log"
import { getToolsJSON, type CustomTool } from "@/tools"
import { zodFunction } from "openai/helpers/zod.mjs"

View File

@ -2,7 +2,7 @@ import { createInterface } from "node:readline"
import { aiErrorMessage, getAIResponse } from "@/ai"
import { buildInstructions } from "@/instructions"
import type OpenAI from "openai"
import { currentLocalTime } from "@the-rabbit-hole/shared/utils"
import { currentLocalTime } from "@workshop/shared/utils"
import { tools } from "@/tools"
// Setup readline interface

View File

@ -1,4 +1,4 @@
import { getPendingReminders, updateReminder } from "@the-rabbit-hole/shared/reminders"
import { getPendingReminders, updateReminder } from "@workshop/shared/reminders"
import { DateTime } from "luxon"
import { Client } from "discord.js"
import { buildInstructions } from "@/instructions"

View File

@ -1,7 +1,7 @@
import { aiErrorMessage, getAIResponse } from "@/ai"
import { buildInstructions } from "@/instructions"
import { tools } from "@/tools"
import { currentLocalTime } from "@the-rabbit-hole/shared/utils"
import { currentLocalTime } from "@workshop/shared/utils"
import type { Message } from "discord.js"
import type OpenAI from "openai"

View File

@ -1,5 +1,5 @@
import { addReminder, getPendingReminders, updateReminder, users } from "@the-rabbit-hole/shared/reminders"
import KV from "@the-rabbit-hole/shared/kv"
import { addReminder, getPendingReminders, updateReminder, users } from "@workshop/shared/reminders"
import KV from "@workshop/shared/kv"
import OpenAI from "openai"
import { zodFunction } from "openai/helpers/zod"
import { z } from "zod"