jaredpalmer / tsdx

Zero-config CLI for TypeScript package development
https://tsdx.io
MIT License
11.27k stars 507 forks source link

Add example playground for non-react projects #178

Open luisrudge opened 5 years ago

luisrudge commented 5 years ago

Current Behavior

When creating a non-react project, all you get is watching a build from a file, but you can't actually do anything with it. If you're developing a browser library, for example, you can't target this watched file from an html file.

Desired Behavior

I think it makes sense to create an example project that consumes the library (maybe differentiate between a node and a browser lib?) so we can test the library in the browser. My library, for example, opens popups, does redirects etc, so I need to test in a real browser.

Suggested Solution

Create the example project with parcel/etc for non-react projects.

Who does this impact? Who is this for?

Devs creating browser libraries

Describe alternatives you've considered

None, really. What I'm doing right now is building the project every time and using the generated files from a static html file. Sucks because there's no watching / auto reloading.

swyxio commented 5 years ago

no objections altho jared may not want to take on maintenance burden. may be better to develop this as a wholly separate example project and we can link to it

luisrudge commented 5 years ago

I think exposing the watched file in an endpoint would be a good first start. It doesn't add the burden of maintaining a whole example folder and also enables me to reference the script from somewhere else. Althought not ideal, at least it would allow me to actually develop the library in development mode.

jaredpalmer commented 5 years ago

Can we just document how to use like serve On the dist directory?

MentalGear commented 3 years ago

Can we just document how to use like serve On the dist directory?

Yes please. Trying to develop a vanilla js UDM browser plugin as well without it!