sitevision / webapp-boilerplate

Boilerplate code for a simple webapp
8 stars 9 forks source link

Simple templating with degit #12

Closed kling90 closed 4 years ago

kling90 commented 4 years ago

Just a suggestion for the readme, I've used this myself a couple of times. Instead of cloning the repo as it says in the readme you could use degit. Then you don't get a .git folder or any connections to the remote repository that you have to remove later.

You could make a new app with the needed files and templates from this repo with:
npx degit sitevision/webapp-boilerplate my-webapp.

https://github.com/Rich-Harris/degit/blob/master/README.md

For example Svelte uses this to create a new app. https://github.com/sveltejs/template/blob/master/README.md

hampusn commented 4 years ago

Couldn't they just set the repository as a template repository? That would remove the need to install another cli locally. :)

https://help.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-template-repository

kling90 commented 4 years ago

That creates a new repository doesn't it? We usually have multiple webapps in a project and not a single repository for each app. We also got a monorepo for reusable apps so we have all apps in one place and not spread out as individual repos. I often also need to get a app up and running quick to make a poc or test something, which I usually doesn't want to put up in a repo of it's own.

You could of course use both, but as I see it for slightly different scenarios.

hampusn commented 4 years ago

That feels kind of out of scope for this project. Doesn't it? It sounds like you have your workflow complete, but wouldn't it be weird to promote your own preferences in a generic boilerplate? Isn't that what forks are for?

kling90 commented 4 years ago

It's not out of scope? Just a way to set up an app without cloning or creating a new repository. It surely is even more generic than setting it up as a template repository since not everyone uses GitHub or wants a new repository. You wouldn't want to have any connections to this repository anyway when making a new app?

If you git clone, you get a .git folder that pertains to the project template, rather than your project. You can easily forget to re-init the repository.

Nothing would change in this repository except one line in the readme. You can already use degit as it is today, I just wanted to share since I found it useful since it removed the need to remove git references when making a new app.