Open brentvatne opened 7 years ago
Do we also want to do that for the TS, cljs, and scalajs forks?
@dikaiosune - if they have their own react-native-scripts then possibly!
Can't find the others though.
A few proposals:
scripts-version
to with
, and overload it to match on certain keywords before delegating to getInstallPackage
such that reason
maps to reason-react-native-scripts
, etc. etc.:const getScriptVersion = arg => {
const normalized = String(arg).toLowerCase();
switch(normalized) {
case 'reason':
case 'reasonml':
return 'reason-react-native-scripts'
case 'typescript':
case 'ts':
return 'react-native-scripts-ts'
default: return arg
}
};
createApp(commands[0], !!argv.verbose, getScriptVersion(argv['with'])).then(() => {});
The following: yarn create react-native-app MyProject --with reason
reads pretty imo.
This could also be implemented on top of create-react-native-app
as a separate library/binary, but seems a bit overkill.
Have a separate argument --language | --kind
doing pretty much the same as 1.
Use --reason, --typescript... directly as in my PR.
create-react-native-app MyProject --scripts-version reason-react-native-scripts
is fairly verbose and difficult to remember.We could simplify this to
create-react-native-app MyProject --reason