breadboard-ai / breadboard

A library for prototyping generative AI applications.
Apache License 2.0
184 stars 25 forks source link

Automate pushing `hello-world` to Replit #640

Open dglazkov opened 8 months ago

dglazkov commented 8 months ago

Currently, to update the Breadboard Starter Project from packages/hello-world, we need to do a bit of a dance at the end of publishing the packages.

It would be amazing to automate this somehow. Replit doesn't seem to have an API for this, but it does support importing form Github. Maybe that would work?

Mearman commented 8 months ago

I have a semi-solution.

Open in

the hello world package would need to be migrated to its own repo. And then I could migrate it to a submodule and set the main repo to sync it?

dglazkov commented 8 months ago

What does it do?

Mearman commented 8 months ago

I should have put the naked link as well https://replit.com/new/github/Mearman/hello-world

It doesn't appear to be possible from a subdirectory or branch though

Mearman commented 8 months ago

silver lining. I could use that as a base for a lot of the other environment templates I want to create

dglazkov commented 8 months ago

being able to roll back also seems important.

dglazkov commented 8 months ago

so the basic idea would be to create a hello-world repository in breadboard-ai org, and then use that repository as the source of truth for replit?

Mearman commented 8 months ago

Yup. I can't see an alternative. I can set up that hello world repo to keep up to date with changes from the main repo, though.

Mearman commented 8 months ago

@dglazkov what did you want to do regarding this? I'm happy to set up the repo and syncing. but would need permission.

PaulKinlan commented 8 months ago

Could we use the run command in the .replit configuration file?

Idly musing, Could we have a npm init breadboard x on first run, and if we detect a special file/folder, run breadboard debug

Mearman commented 8 months ago

possibly, but that wouldn't stop the preview of the template and the template in the repo diverging

PaulKinlan commented 8 months ago

It solves the issue of "the dance" at the end of publishing, which I think is what's needed. i.e, we're asking devs to use the public versions of the repo.

Mearman commented 8 months ago

sorry I mean the actual contents of the template actually up on replit. as that wouldn't be updated by release, the result of the command in the .replit config could be entirely different to what was actually in the template. Using the replit/new URL will always be initialised from the head of that repo

PaulKinlan commented 8 months ago

It's pretty hard for us to set up new repos (it's a process thing).

The init @google-labs/breadboard has a dependency on hello-world so any updates once published will go to this... It's definately not as up to date as the replit/new, but it does mean that the published hello-world is tied to published breadboard lib (which I think is the correct way of working).

https://replit.com/@paulkinlan/RevolvingCruelWordprocessing < is a POC (it's certainly not the best solution because it requires a subdirectory, but it is deployable too poc-2)

Mearman commented 8 months ago

oooooh ok. I didn't expect the config would give you that much scope. I shall experiment further.

Mearman commented 8 months ago

as the create package doesn't currently support merging into an existing directory I've done this inspired by your POC. what do you think?

Open in

dglazkov commented 8 months ago

HOLY MOLY. I like it.

Mearman commented 8 months ago

Thanks to @PaulKinlan for putting me on the right track. Though using it as a fork from a replit instance would still result in different content. So I'm not 100% happy with it yet. https://github.com/ExaDev-io/breadboard-replit/blob/main/init.sh

dglazkov commented 6 months ago

Shall we land this in main repo?

Mearman commented 6 months ago

I still feel like it's missing a piece. As for it to work properly the init replit config would still have to be at the root.