Integrating Laska with an existing app
Nick Janssen
To export apps built in Laska to your existing React Native codebase, you need to use an NPM package. Install the Laska CLI using NPM:
npm -g install laska 
From the root directory of your project, run:
laska
Tip: you can also export your project from laska straight from the editor. Once you've downloaded and extracted the archive, simply run laska from the root folder of the archive.
You will be asked for an App Id and an API Key. You can find both in the App Settings screen.
The App Settings button can be found in the bottom left corner.
Once run, your preferred export settings and credentials will be saved in a file called .laskarc. Next time, laska will run immediately without having to ask questions.
Do not commit .laskarc to Git. If you do, anyone with access to your git repository can also access your app.
Running laska from a terminal
Running your app
Depending on the codebase that you are using, you may need to do some additional steps.
When using Expo / Create React Native App
Modify App.js to look like this:
import StartComponent from './src/laska/StartComponent';

export default StartComponent;
You will also need to install additional dependencies:
yarn add react-navigation@2 moment recompose
Laska currently does not support react-navigation v3.
Now, you should be all set. Simply run npm start and connect to your app on your phone using the Expo Client.
Configuration options
.laskarc is a JSON document. Outside of the questions when initially running the command line tool, there are additional options that can be set.
startComponent
Optional. Name of a component in your project that will be exported to a file called StartComponent.js in the root of the folder you chose for exporting. This allows you to designate a component as the start or launch component in your application. If you don't specify this, the CLI will use the page which you designated as the Landing Page.
blacklist
Optional. Array of component names which will not be exported. This allows you to add additional logic to certain components (eg. Redux) and be sure they will not be overwritten next time you run laska .
whitelist
Optional. Array of component names which will only be exported. 
assetStrategy
Optional. This value determines how assets (currently only images) are handled by the CLI. Can be one of the following values: 
local
This is the default mode. Images will be saved to the local filesystem, and required() when needed.
base64
Images will be converted to base64, and not saved to your local filesystem at all. Instead, all your image tags will use base64 urls. 
remote
Images are not saved to the local filesystem. Instead, they will be downloaded from Google Cloud every time your app opens.
Example configuration
{
  "appId": "YOUR_APP_ID_GOES_HERE",
  "apiKey": "YOUR_API_KEY_GOES_HERE",
  "whiteList": ["Dashboard", "FancyButton"],
  "assetStrategy": "base64",
  "startComponent": "BetaLoginScreen"
}
Command-line arguments
-v, --version
Outputs the version number.
-h, --help
Shows a help screen with these commands.
-c, --continuous
In this mode, the CLI wil stay active and update your files as you continue working in Laska. Your changes propagate real time to your local project.
--install-dependencies
Automatically install dependencies using Yarn or NPM (Yarn will be used if NPM cannot be found).
Nick Janssen
Questions? Comments? Let us know! 😊