Uh oh!
There was an error while loading. Please reload this page.
Add template support - #6514
Conversation
mrmckeb
commented
Mar 3, 2019
OK, so I need to work on tests for this - and make sure it all works correctly - but the idea is in place. The biggest issue I see with this implementation is that a) the template may require a different scripts version than the one the user set, and b) as the template is handled by |
Ugzuzg
commented
Mar 7, 2019
Would be awesome to have the ability to add custom scripts to the package.json. Say, my template has internationalisation, and I want to add extraction script to the project. |
This can be tested with: node ./create-react-app/packages/create-react-app test-project \
--template file:./create-react-app/packages/create-react-app-template/ \
--scripts-version file:./create-react-app/packages/react-scripts/ |
nartoland
commented
Mar 19, 2019
Ok |
After cloning your branch, and running your exact command, I get this error: Yarn v1.12.3 EDIT: I tried debugging this but I'm not really sure whats wrong or causing it, a couple observations I made are:
|
mrmckeb
commented
Mar 25, 2019
I'm working on Ubuntu (WSL actually), but it may be an issue we need to look into. That being said, the |
Ugzuzg
commented
Aug 6, 2019
Any further work on this? |
mrmckeb
commented
Aug 8, 2019
Hi @Ugzuzg, this is a 3.2 goal now - I'll be restarting work on this next week. We had some more urgent matters and wanted to think about this a little more. Perhaps you can share a little more about what you'd like to see from templates? |
Ugzuzg
commented
Aug 8, 2019
Custom scripts, as mentioned above. Also would be great to install additional dependencies. This PR achieves custom dependencies installing peerDependencies of a template, I believe? So this case is covered. Thank you! |
This is a work in progress. Do not merge.
This has become a little more complicated than I first envisioned. Right now, I'm still working through the init part of this. The plan is as follows:
react-scriptsandcreate-react-app-template-*are installed as dependencies. Either or both of those can be defined via CLI.peerDependencies, this is not used during install.react-scriptsinit, the template is copied from template package, andpeerDependenciesare installed from that package (excluding the scripts-version). That package is then removed, as it no longer has any value.peerDependenciesof the template, appropriate warnings will be shown - but the user can still continue. This, importantly, allows custom scripts versions to work with the template.The
typescriptflag is deprecated under this process.