rixo / svench

A lightweight workbench to develop your Svelte components in isolation
svench-docs.vercel.app
207 stars 6 forks source link

provides the url when starting #46

Closed yanick closed 2 years ago

yanick commented 2 years ago

The fix is probably not exactly at the right place, but yeah, I just spend waaaay too much time wondering why svench was hanging on startup, before realizing that it was not, and was waiting for me at :4242. Duh!

vercel[bot] commented 2 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/rixodev/svench-docs/3rNVY388AtASX7dh6PAAAw74zFxF
✅ Preview: https://svench-docs-git-fork-yanick-patch-2-rixodev.vercel.app

rixo commented 2 years ago

Oh yeah, I've seen the welcome message had been removed from Vite's createServer... I have back ported it into Svench.

Can you tell me if this is working for you with the branch in this PR.

... and it would be lovely to look and see if you see any outstanding issue or if it feels release ready to you!

yanick commented 2 years ago

Looks like it's doing what it's supposed to do!

As for a look over, there are two things which could totally be "me" problems, but:

  1. looks like all the knobs disappeared?
  2. how does one add a static directory to the svench env for assets and stuff?
rixo commented 2 years ago

@yanick

  1. looks like all the knobs disappeared?

Err... Shouldn't. I can't reproduce, can you confirm?

For example, this is a fresh deploy of the very latest version of Svench, I can see the knobs: https://svench-docs-2zulfy7xm-rixodev.vercel.app/_/Usage/knobs?view=defining+and+using+a+knob&fs=0&c&o=0&p&cv=%40none&bg=%23fff

  1. how does one add a static directory to the svench env for assets and stuff?

Well... Svench should just reuse your existing config, so the same assets that are working in your app should be working in Svench with the same URLs. Theoretically.

For Vite, the default would be the public directory of your project.

Kit (as much as it is supported in Svench...) changes this default to 'static' currently. I've added some changes to the kit branch of this repo to try and detect this automatically.

Feel free to open an issue (or reach to me on Discord) if you want to discuss this more in depth.

I'm closing the PR since a similar fix has been applied in main.

yanick commented 2 years ago
  1. looks like all the knobs disappeared?

Err... Shouldn't. I can't reproduce, can you confirm?

I think I found it. Turns out you can resize the knobs section to nothing, and there is no visual clue that it's there and can be re-stretched back into view. I must have resized it a few months ago and forgot it. I was looking for any type of hot key to make the section appear/disappear, but didn't think about hovering at the very bottom of the window. :facepalm:

So, yeah, maybe a hotkey to reset the sections to the default size might help the next clueless user that will follow my footsteps. ^.^

  1. how does one add a static directory to the svench env for assets and stuff?

Well... Svench should just reuse your existing config, so the same assets that are working in your app should be working in Svench with the same URLs. Theoretically.

For Vite, the default would be the public directory of your project.

Kit (as much as it is supported in Svench...) changes this default to 'static' currently. I've added some changes to the kit branch of this repo to try and detect this automatically.

:+1: I'll try to come up with a documentation patch that covers this. It's one of those instances that when it works automatically, it's magic, but when it doesn't, it's useful to know what the system is trying to do so that one can determine what is going on.

Thanks!