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

@andreciornavei/rn-essentials

v1.20.14

Published

A React Native library containing all essential providers and components

Downloads

73

Readme

rn-essentials

Overview

Motivations:

Fast project setup:

Install the Expo SDK 42:

expo init my-app --template expo-template-blank-typescript@~42.0.1

As you can see on this little piece of code, everithing is embedded in just one provider, the EssentialProviders, that will inject everything you need to setup your project as faster as prossible.

You can see all the providers embbeded later on this documentation.

import React from 'react';
import { EssentialProviders } from '@andreciornavei/rn-essentials';
import { Home } from './src/pages/Home';
import { _Button } from './src/pages/_Button';

export default function App() {
  return (
    <EssentialProviders
      dbName="db-rn-essentials-example"
      apiBaseURL="http://localhost:1337"
      initialRouteName="/home"
      routes={[
        { name: "/home", component: Home },
        { name: "/component_button", component: _Button }
      ]}
    />
  );
}

Using Plopfile

This library implements some code generator for component boilerplates, so if you want to use it to make your own components following my guidelines for components, then follow these steps:

1 - Add plop to your project

$ yarn add -D plop

3 - Create the following plopfile.js at the root of your project

module.exports = function (plop) {
    // or in es6/es2015
    plop.setHelper('upperCase', (txt) => txt.toUpperCase());
  
    plop.setGenerator('component', {
      description: 'Boilerplate component',
      prompts: [
        {
          type: 'input',
          name: 'name',
          message: 'Please use UpperCamelCase\n Component name:',
        },
        {
          type: 'input',
          name: 'path',
          message: 'Provide the path where the component will be placed;\nDo not use slashes at the beginning or end of the path;\n Component path:',
        },
      ],
      actions: [
        {
          type: 'add',
          path: './{{path}}/{{name}}/context.ts',
          templateFile: './node_modules/@andreciornavei/rn-essentials/templates/component.context.hbs',
        },
        {
          type: 'add',
          path: './{{path}}/{{name}}/controller.tsx',
          templateFile: './node_modules/@andreciornavei/rn-essentials/templates/component.controller.hbs',
        },
        {
          type: 'add',
          path: './{{path}}/{{name}}/index.tsx',
          templateFile: './node_modules/@andreciornavei/rn-essentials/templates/component.index.hbs',
        },
        {
          type: 'add',
          path: './{{path}}/{{name}}/styles.ts',
          templateFile: './node_modules/@andreciornavei/rn-essentials/templates/component.styles.hbs',
        },
        {
          type: 'add',
          path: './{{path}}/{{name}}/types.ts',
          templateFile: './node_modules/@andreciornavei/rn-essentials/templates/component.types.hbs',
        },
        {
          type: 'add',
          path: './{{path}}/{{name}}/view.tsx',
          templateFile: './node_modules/@andreciornavei/rn-essentials/templates/component.view.hbs',
        },
      ],
    });
  };  

3 - Add plop command to your package.json scripts

{
  ...
  "scripts": {
    ...
    "generate-component": "plop",
    ...
  }
  ...
}

4 - Run the command

$ yarn generate-component

Utility functions

formatDate

All functions you can see on this README.md file.

formatNumber

All functions you can see on this README.md file.

formatText

All functions you can see on this README.md file.

normalizeStyleSize

All functions you can see on this README.md file.

resolveErrors

All functions you can see on this README.md file.

resolveFilterHttp

All functions you can see on this README.md file.

resolveLodash

All functions you can see on this README.md file.

resolveParam

All functions you can see on this README.md file.

resolvePermissions

All functions you can see on this README.md file.


Providers

ApiProvider

All api_provider properties you can see on this README.md file.

DatabaseProvider

All database_provider properties you can see on this README.md file.

NotificationProvider

All notification_provider properties you can see on this README.md file.

RefreshProvider

All refresh_provider properties you can see on this README.md file.

RouteProvider

All route_provider properties you can see on this README.md file.

SheetProvider

All sheet_provider properties you can see on this README.md file.

SocketProvider

All socket_provider properties you can see on this README.md file.

StorageProvider

All storage_provider properties you can see on this README.md file.

ThemeProvider

All theme_provider properties you can see on this README.md file.


Background Tasks

LocationTask

All location_task properties you can see on this README.md file.

NotificationTask

All notification_task properties you can see on this README.md file.

FetchTask

All fetch_task properties you can see on this README.md file.


Components

All components is fully customizable in 3 leves:

  • The default custom style implemented by this library, where you can find the style structure on ./src/styles/default_theme.ts inside the components.[component_name];
  • Your custom style that will override the file mentioned above following the same properties. It will style the button to your entire application;
  • The inline button component style, this will style only a specific button instance, followin the same properties mentioned above;

Accordion

All accordion properties you can see on this README.md file.

Action

All action properties you can see on this README.md file.

Button

All button properties you can see on this README.md file.

Divider

All divier properties you can see on this README.md file.

Empty

All empty properties you can see on this README.md file.

Icon

All icon properties you can see on this README.md file.

InputError

All input_error properties you can see on this README.md file.

InputRadio

All input_radio properties you can see on this README.md file.

InputSheet

All input_sheet properties you can see on this README.md file.

InputText

All input_text properties you can see on this README.md file.

ListFetcher

All list_fetcher properties you can see on this README.md file.

MorphList

All morph_list properties you can see on this README.md file.

Paragraph

All paragraph properties you can see on this README.md file.

Ripple

All ripple properties you can see on this README.md file.

Scaffold

All scaffold properties you can see on this README.md file.

Space

All space properties you can see on this README.md file.

TabNav

All tab_nav properties you can see on this README.md file.

TabPanel

All tab_panel properties you can see on this README.md file.


🎉   Congradulations, You're done.

I hope this plugin helps you in your react native projects and save a lot of time and code.


📜   License

This project is under the MIT license. See the LICENSE for details.


💻   Developed by André Ciornavei - Get in touch!