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

@thecodingmachine/rnb-toolbox

v1.0.1

Published

Help all @thecodingmachine/react-native-boilerplate plugins creators to build awesome custom plugins

Downloads

13

Readme

TheCodingMachine React Native boilerplate - Toolbox

React Native Boilerplate Toolbox License React Native Boilerplate Toolbox Version React Native Boilerplate Toolbox Release Date React Native Boilerplate Toolbox Download React Native Boilerplate Toolbox Top Language CI

🚧 This is a work in progress documentation. 🚧

This project is part of our React Native Boilerplate that can be used to kickstart a mobile application.

This boilerplate provides an optimized architecture for building solid cross-platform mobile applications through separation of concerns between the UI and business logic. It is fully documented so that each piece of code that lands in your application can be understood and re-used.

This toolbox allows you to build plugin modules that can be used to extend the functionality of the boilerplate.

Quick start

The best way to get started is to use the template repository. It will provide you with a working project that you can start from scratch.

Documentation

Initialization

To initialize a plugin, you have to use the RNBPlugin constructor like this:

const { RNBPlugin } = require('@thecodingmachine/rnb-toolbox');

const plugin = new RNBPlugin({
  organisation: '<package-organisation>',
  packageName: '<package-name>',
  // version: 'latest | <package-version>', // default: latest
  promptsOptions: {
    type: 'confirm',
    color: 'blue',
    text: 'Do you want to use my custom plugin ?',
    initial: false,
  },
});

PromptsOptions

| Key name | default | type | description | required | |----------------|-----------|-----------------------------|---------------------------------------------------------------------------------------------------------------|----------| | organisation | | string | the organisation name on the npm registry | true | | packageName | | string | the package name on the npm registry | true | | version | 'latest' | string | the version of the plugin (use it when you make rc/beta/alpha version) | false | | promptsOptions | | PromptsOptionsWrapperParams | the prompt that will be printed for the final user (Prompts doc) | true |

PromptsOptionsWrapperParams:

| Key name | default | type | description | |----------|---------|--------|-----------------------------------------------------------| | type | | string | Prompts type | | color | 'white' | string | Kleur colors | | text | | string | the prompt text to display | | initial | | any | the prompt default value |

Life cycle

A RNBPlugin as a defined lifecycle with two hooks:

  • onInstall
  • afterInstall

onInstall

This hook is called right after the plugin is installed. It is called with the following parameters:

afterInstall

This hook is called right after the plugin onInstall hook is finished and the plugin is removed from the boilerplate. It is called with the following parameters:

Helper functions

Generally, you will want to do some operation into life cycle hooks. For example, you will want to loop on plugin files to paste them into the boilerplate code base. Or you will want loop on the boilerplate files and rename them. To do that you can use the following helper functions:

  • loopOnPluginFiles
  • loopOnSourceFiles

loopOnPluginFiles & loopOnSourceFiles

| Helper function | default | type | description | required | |------------------|---------------------------|----------|---------------------------------------------|----------| | accumulatedPath | '/' | string | the current path during the loop | false | | onDirectoryFound | () => Promise.resolve({}) | function | function to start when a directory is found | false | | onFileFound | () => Promise.resolve({}) | function | function to start when a file is found | false | | ...args | | any | custom arguments to give in each loop | false |

Example
plugin.lifecycle.onInstall = async () => {
  await plugin.helpers.loopOnSourceFiles({
    directoryCounter: false, // will be exposed in onFileFound() and onDirectoryFound()
    onDirectoryFound: async ({
      item, accumulatedPath, directoryCounter,
    }) => {
      // do something with the directory
      return Promise.resolve({ directoryCounter: directoryCounter + 1 });
    },
  });
};

License

This project is released under the MIT License.

About us

TheCodingMachine is a web and mobile agency based in Paris and Lyon, France. We are constantly looking for new developers and team leaders and we love working with freelancers. You'll find an overview of all our open source projects on our website and on Github.