Skip to content

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

Description

@mauriciord

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions