-
Notifications
You must be signed in to change notification settings - Fork 911
Improve init
command
#91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yes please! |
In the process of fixing template for upcoming 0.58 release (facebook/react-native#23128) I'am looked at the code and have some notes (copy pasted from discord chat):
It would be better to have generic and single rule to rename files, I see two potential variants:
{
"install": [
"__tests__", // copy __tests__ folder as is into project
"android",
"ios",
"*.js", // copy all .js files into project
"app.json",
["_babel.config.js", "babel.config.js"], // copy file into project and name as `babel.config.js`
["_buckconfig", ".buckconfig"],
["_flowconfig", ".flowconfig"],
["_gitattributes", ".gitattributes"],
["_gitignore", ".gitignore"],
["_watchmanconfig", ".watchmanconfig"]
],
"dependencies": { // Add dependencies to package.json after copy files
"react": "{REACT_VERSION}",
"react-native": "{REACT_NATIVE_VERSION}",
},
"devDependencies": { // Add devDependencies to package.json after copy files
"babel-core": "7.0.0-bridge.0",
"babel-jest": "23.6.0",
"jest": "23.6.0",
"metro-react-native-babel-preset": "0.51.1",
"react-test-renderer": "{REACT_VERSION}"
},
} Something like this, may be add some options and some variables to substitute such as APP_NAME, REACT_VERSION etc... |
I would like to have an opportunity to choose the language used within the generated template. Even if we keep all the modules written in obj-c and java, we might want to use swift and kotlin as a main native language in the generated app. Flutter CLI allows choosing it in a pretty nice way |
My issue with templating is the lack of a postInstall script. If you check react-native-template-typescript a For those who would argue about security and unknown scripts being launched, I can add any dependency I want to the template which can itself contain a postinstall script. |
I have spend some time today trying to give the init command a cleaner look. I can create a PR when the new improvements of the init command (#241) is merged, any interest? |
@patrickkempff this is great! I think we could make the ascii image a bit smaller (like 2-3x :D) but it looks pretty neat anyway :) Feel free to collaborate and review on @Esemesek work 🙂 |
We should look at the
react-native init
behaviour and think about improving the way it works.Here are some of the things that could be improved:
Please comment with other improvements/feedback and we will convert them into issues at some point.
The text was updated successfully, but these errors were encountered: