This looks cool. I like that you can pick between react or vue. Any reason you went with yarn over npm?
React or Vue is currently both possible, but only with manual setup following electron-webpack docs. However, I want to provide simple CLI options so it becomes a trivial decision.
Currently, npm works just as good, but yes there are some reasons.
Relevant already: yarn supports resolutions field in package.json - allows to pin (sub-) dependencies to a specific version. That’s helpful in some situations. For example, the currently copied template has a sub sub dependency on svgo, which uses js-yaml, which according to GitHub has a security vulnerability.
Using npm, we cannot get rid of that, as we can’t expect all dependencies in the chain to immediately upgrade.
Using yarn, we pin js-yaml to the fixed version, overriding what the parent dependency wanted: https://github.com/loopmode/create-electron-app/blob/master/packages/generator-electron-app/templates/package.json#L12
In future, a --workspaces option will generate a monorepo setup out of the box, where local packages are symlinked in development using yarn workspaces.
That’s a big benefit of yarn.
Finally, yarn create automatically uses latest versions from npm, while apparently npm init doesn’t unless you manually upgrade the locally installed package first, at least as far I could see.
Comment moved into response to previous comment
Ok cool. Sounds rather complicated for a package manager.
0.2 released - all electron-webpack “add-ons”
(except of react and vue) are now available as CLI options, and as questions in interactive mode.
Next release will focus on react and vue.