Skip to content

Latest commit

 

History

History
159 lines (111 loc) · 4.33 KB

commands.md

File metadata and controls

159 lines (111 loc) · 4.33 KB

Commands

Table of Contents

Generate modules data

yarn run parse

Run the command to validate, parse and export the modules source code into a JSON file.

Example output:

~/code/github.com/crowdbotics@modules (hotfix/login-screen-export) $ yarn parse
yarn run v1.22.10
$ node scripts/parse.js

Parsing modules...

✅ camera
✅ django-articles
❌ django-push-notifications => module preview image missing
❌ django-social-auth => module preview image missing
✅ payments
✅ privacy-policy
✅ react-native-app-menu
✅ react-native-articles
✅ react-native-chat
✅ react-native-login
✅ react-native-maps
✅ react-native-onboarding
❌ react-native-push-notifications => module preview image missing
❌ react-native-social-login => module preview image missing
✅ react-native-splash
✅ react-native-user-profile
✅ screen-login
✅ terms-and-conditions

Total of modules: 18
Done in 0.27s.

Get module info

yarn run info <module_type> <module_name>

Prints the module name, description and the respective data JSON.

Supported module types:

  • "django"
  • "react-native"

Create a local demo app

yarn run demo

This command runs npx react-native init with --template pointing to our own Custom React Native template.

Install a module

yarn run add [<module_name>]

Installs a list of modules into the demo app, performing the follow operations:

  1. Copies the module directory from react-native into demo/modules.
  2. Runs yarn add <module_name> in the demo directory.
  3. Runs yarn add <dependency> for every x-dependencies in the module package.json.

Remove a module

yarn run remove [<module_name>]

Removes a list of modules from the demo app, performing the follow operations:

  1. Removes the module folder from demo/modules.
  2. Runs yarn remove <module_name> in the demo directory.
  3. Runs yarn remove <dependency> for every x-dependencies in the module package.json.

Generate cookiecutter

Start by generating a new app called ProjectName to serve as input for cookiecutter replacements:

yarn run raw

Then run the cookie command to generate distribution cookiecutter.

yarn run cookie

Generates cookiecutter template by replacing according to the following translation table:

Before After Example
ProjectName {{ cookiecutter.project_slug }} MyNewApp
projectname {{ cookiecutter.project_dash_slug }} mynewapp
ProjectNameIdentifier {{ cookiecutter.project_dash_slug }} mynewapp
ProjectOwnerEmail {{ cookiecutter.owner_email }} [email protected]
ProjectSSHKeyFingerPrint {{ cookiecutter.ssh_key_fingerprint }} abc:123

Ouput will be made to dist/cookie.

Bootstrap

yarn run bootstrap

Runs demo, raw, cookie, and parse commands.

Update React Native base template

yarn run template

Updates the react-native template from upstream, from the locally resolved version (currently pinned to 0.64.2).

Lint modules

Lint modules source code with a pre-configured ESLint setup:

yarn lint

Copy an in development module from demo to root modules

This is helpful during the development of a module - you make changes to the demo directory on a specific module and when you finish you can copy the code from demo/modules/[<module_name>] and demo/backend/modules/[<module_name>] to the main modules directory modules/[<module_name>]

Run the following command:

yarn run commit-module [<module_name>]