Skip to content
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

Init with template Typescript, Jest, Git hooks, Prettier and Semantic versions #293

Closed
mauriciord opened this issue Apr 5, 2019 · 2 comments

Comments

@mauriciord
Copy link

Describe the Feature

Hi everyone,
I created a React Native template with:

  • Typescript
  • Jest
  • Git hooks
  • Commit-msg to help organize your commits messages and help your team scale your application
  • Prettier to format your code
  • Semantic versions (scripts to generate versions of your app)

It’s so simple to use it:

npx react-native init YourProjectName --template mard-rn-ts

It's better than the --typescript mentioned on React Native blog

You can see the repo here: https://github.com/mauriciord/rn-ts-boilerplate

Possible Implementations

I want put this scripts in a React Native template. When someone starts a project it would come with this scripts on package.json:

     "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest",
    "android": "react-native run-android",
    "android:apk": "cd android && ./gradlew assembleRelease",
    "android:install": "adb install android/app/build/outputs/apk/app-release.apk",
    "clear": "node node_modules/react-native/local-cli/cli.js start --reset-cache",
    "devtools": "react-devtools",
    "ios": "react-native run-ios",
    "lint": "tslint --project tsconfig.json",
    "lint:staged": "lint-staged",
    "postversion": "react-native-version",
    "bump:stable-release": "NEXT_STABLE=\"$(semver $npm_package_version -i release)\"; npm version $NEXT_STABLE",
    "bump:stable-major": "NEXT_STABLE=\"$(semver $npm_package_version -i major)\"; npm version $NEXT_STABLE",
    "bump:stable-minor": "NEXT_STABLE=\"$(semver $npm_package_version -i minor)\"; npm version $NEXT_STABLE",
    "bump:stable-patch": "NEXT_STABLE=\"$(semver $npm_package_version -i patch)\"; npm version $NEXT_STABLE",
    "bump:beta-release": "NEXT_BETA=\"$(semver $npm_package_version -i prerelease --preid beta)\"; npm version $NEXT_BETA",
    "bump:beta-major": "NEXT_BETA=\"$(semver $npm_package_version -i premajor --preid beta)\"; npm version $NEXT_BETA",
    "bump:beta-minor": "NEXT_BETA=\"$(semver $npm_package_version -i preminor --preid beta)\"; npm version $NEXT_BETA",
    "bump:beta-patch": "NEXT_BETA=\"$(semver $npm_package_version -i prepatch --preid beta)\"; npm version $NEXT_BETA"

Then, i need to open a PR to add this functionality, what do you think? We could change blog posts encouraging the use of this template.

@thymikee
Copy link
Member

thymikee commented Apr 5, 2019

Good news! It's gonna be possible with new init! See #241 for details on how to adjust your template (you're gonna need template.config.js in your project root and point to your template there, we're also gonna copy all the files you have in template, just like that)

Feel free to try it with @react-native-community/cli@next :)

@thymikee
Copy link
Member

thymikee commented Apr 5, 2019

I'll close this, because it's already addressed.

@thymikee thymikee closed this as completed Apr 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants