Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run CLI with stricli with bun --watch, it exits process #44

Open
nikitavoloboev opened this issue Dec 25, 2024 · 7 comments · May be fixed by #43
Open

Can't run CLI with stricli with bun --watch, it exits process #44

nikitavoloboev opened this issue Dec 25, 2024 · 7 comments · May be fixed by #43

Comments

@nikitavoloboev
Copy link

If I run a program like this with bun --watch:

image

It will rerun it on each save.

However if I try do the same with bun stricli example here:

https://github.com/bloomberg/stricli/tree/main/examples/bun

Like so:

image

It will not stay in the --watch process.

How can I make this work. I need it for faster dev cycle. I assume you maybe send some OS code to exit process at the end? Perhaps there is a way to disable this in dev or something.

Thank you.

@nikitavoloboev
Copy link
Author

I commented this out in core of the library:

CleanShot 2024-12-25 at 23 46 43@2x

However I am unsure how to make it work now to test out.

In root of stricli I ran:

image

Then in my project: https://github.com/nikitavoloboev/stricli-test/tree/main/cli

I did this:

image

But nothing changed in package.json, I am confused why:

image

@molisani
Copy link
Member

We are going to be removing that call to process.exit in this PR #43, so that should account for the change you had to make in #44 (comment).

@molisani molisani linked a pull request Dec 26, 2024 that will close this issue
@nikitavoloboev
Copy link
Author

That's great to hear.

Can you help me link this project so I use a local version of stricli? I want to build some CLIs with this library but require this to exist. Amongst other things I want to try add to the library.

bun link seems to fail. Perhaps I am doing it in wrong place or something.

@molisani
Copy link
Member

Ah, so I think you'll need to run bun link from /packages/core and not the repo root as you only want to link that single package. You'll know it's worked when it mentions @stricli/core instead of stricli (there is no package named stricli, that's just the placeholder for the monorepo).

@nikitavoloboev
Copy link
Author

I tried doing this:

image

Then did this:

https://github.com/nikitavoloboev/stricli-test/blob/main/cli/package.json#L14

And when I run it from the linked package nothing is changed:

CleanShot 2024-12-26 at 21 52 38@2x

@nikitavoloboev
Copy link
Author

And when I rm -rf node_modules and then do bun i I get this:

image

That's with the linked core package.

@nikitavoloboev
Copy link
Author

This one:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants