npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@gerlison/rn-boilerplate-ts

v1.0.0

Published

A react-native template

Downloads

1

Readme

npm (scoped) GitHub

REACT-NATIVE BOILERPLATE

A react-native template with essencial libraries, configurations and facilities for fresh projects.

Motivation

I've created this template to facilitate the creation of fresh react-native projects. Every time I need to create a project, I need to set a lot of repeatitive configuration, like setup for redux, installation of dependencies, folder structure (and how it sucks), babel module resolver and eslint. To resolve it all, I'm developing this project, with that things preconfigured.

Installing / Getting started

I'm considering that you have a fully configured react-native environment.

To create a project with this template just run the following on your terminal:

$ npx @react-native-community/cli init [project_name] --template @gerlison/rn-boilerplate-ts

Ok, let's run the project

For project runs properly, it needs an emulator or device connected.

$ yarn android

// or
$ yarn ios

Features

What's all the bells and whistles this project can perform?

  • Folder structure built to grow
    • When working on large projects, the way it was configured on the initial stage can take you to a big headache. To avoid that, I decided to develop my own folder structure based on my experience with other project structures.
    • As you can see in the tree below, I chose to have a modules folder. This folder would be responsible for the features. So let`s supose you have an authentication feature. It'd be one of the folders inside modules.
src
│
└───assets
│   └───images/
│   └───icons/
│   └───fonts/
└───modules
│   └───ModuleName
│        └───services/
│             |   api.js
│        └───store/
│             └───slices/
│             └───sagas/
│             │   index.js
│        └───components/
│        └───screens/
│        │   index.js
└───navigation
│    │   index.js
│    │   types.d.js
└───shared
│   └───core/
│   └───styles
│        │   colors.js
│        │   metrics.js
│        │   fonts.js
│   └───helpers/
│   └───services/
│        |   api.js
|        |   reactotron.js
└───store/
│    └───slices/
│    └───sagas/
│    │   index.js
  • Easy modules import with babel-module-resolver preconfigured
    • To avoid pain of having large absolute pathes on multiple imports, I've implemented the babel-module-resolver.
    • With that, you can import your files using the alias @modules/, @core/, etc.
  • Redux ready to go.
    • Redux is explained by it self.
    • Here I've implemented it following a little modified duck pattern. The difference in this template, is that each feature have it's own slices and sagas. You can see that in the tree above.
  • Theme provider integrated with styled-components, for easy theme management
    • An amazing tool that gives to your component so much more intuitivity. It has also the power of letting you manage theme colors shared in the entire app. Making it easier to use the colors without import any files.
    • You can customize it to share whatever you want. But be careful to not overload.
  • Configured Reactotron with Redux integration
    • One of the pains when working with react-native is debug API requests and redux store. To help with that, the template comes with reactotron. You just need to have it installed on your computer.
  • A set of npm scripts to make your life easier
    • android -> run for android
    • ios -> run for ios
    • start -> starts the JsBundler
    • cleanModules -> delete and reinstall all libraries
    • cleanWatchman -> clear watchman cache
    • cleanAndroidCache -> clear gradlew cache
    • clearAndroid -> run android with all cache cleaned and reinstalled libs
    • clearIos -> run ios with all cache cleaned and reinstalled libs and pods
    • test -> run jest
    • lint -> run eslint
    • linkDevice -> run reverse adb on both ports, 8081 and 9090

Built with

Author

I don't have a lot of things to tell about myself. If you're curious about who I am, why don't you checkout my Linkedin and we can have a cup of coffe?

You can also check my github profile

It will be a pleasure to exchange an idea with you :)