Necmttn3w ago

Writing modules for multiple runtime ( Deno & browser ) + Monorepo setup?

Hey this Neco Founder of OSS ( So after a long thought process, I decided to settle on deno runtime for craftgen cloud runtime. now I'm trying to port my core package which works totally expected in browser to deno runtime. meanwhile keeping it still browser friendly. I'm seeking some guidance on how to structure the code.
any help would be appreciated.
Craftgen - Craft Generetive AI Workflows
The ultimate playground for prompt engineers. Craft multi-model AI workflows and set your content generation on autopilot.
GitHub - craftgen/craftgen: Integrating AI into every workflow with...
Integrating AI into every workflow with our open-source, no-code platform, powered by the actor model for dynamic, graph-based solutions. - craftgen/craftgen
4 Replies
bpev3w ago
jsr is basically made for distributing for multiple runtimes. However, monorepo structure is still kinda sus until deno 2.0 (p sure there's an issue for is somewhere, but I'd have to look). deno-std is a monorepo workspace; they keep it inline via scripts (in _tools). That might be a good place to look:
Necmttn3w ago
Thank you for the pointer i will check it out
shultz3w ago
if you need a monorepo maybe do something temporary until deno 2 which shouldn't be that far off
Necmttn3w ago
so what I'm thinking right now is; try to publish my as JSR package. and import in as an npm package. instead of transpiling I'm doing right now; perhaps this will complicate the debugging on the front end side. little bit more context; in craftgen, i built an event-driven architecture powered by state actors. The same actors can run both in the browser & backend so I have 1:1 mapping of the actor. I planning to use self hosted supabase/edge-runtime to run this events in the cloud. ^ The main reason for that hoop is. be able to run AI generated codes in a safe secure place.