Here are some quick npm commands to get started:
npm install
: Install Node dependenciesnpm start
: Start expo.npm test
: Run the test suit and watch for changes.npm build
: Build a production optimized bundle of the app.npm lint-fix
: Run the ESLinter.
Name of Value | Description of Data |
---|---|
assetMapRegion |
Region location numbers of asset map |
organization |
Name of the surveying users surveyingOrganization |
residentData |
All SurveyData parse model data stored based on the users surveyingOrganization |
offlineIDForms |
All SurveyData forms collected when user is offline |
offlineSupForms |
All Supplementary/Custom forms collected when user is offline |
offlineHouseholds |
All Household parse model created when user is offline |
pinnedForms |
All local pinned form data that the user choses when the long press on a custom form |
Select and MultiSelect PaperInputPicker fieldTypes have the option to have a text associated with a given select option.
For example if you wanted the user to have the option to add text when a user selects "Other", you would format your config for the field like this:
{ "label": "Some text.", "formikKey": "KEY", "value": [''], "fieldType": "select", "options": [ { "label": "Some text, "value": "some_val" }, { "label": "Other", "value": "OTHER", "text": true, "textKey": "__KEY__OTHER" } ] }
Important notes: "text": true
- This adds the text input field to the Other select option "textKey": "KEYOTHER"
- __: The double underscore at the beginning of the key is required. No other keys in the config use this and CANNOT use the double underscore or there will be errors
- KEY: this portion of the textKey needs to be an exact match to the formikKey of the field
- __: Second double underscore is also required. Without the first double underscore it will not matter.
- OTHER: This portion of the key is a direct match to the value of the select option. This is required to append the text input value to the original value in the array
- none of these values need to be capitalized
This project dynamically creates the required app.json
in order to avoid commit secret keys in the project. The related commands are:
npm run prepublish
: Generates anapp.generated.json
that we use for the rest of the deployment process. It runs a script inscripts/dynamic-env
that does a deep merge of ourapp.secrets.json
file with all our application keys andapp.json
to createapp.generated.json
. This will have to be run before publishing to the store
For releases and bumping versions of app.json
, we have:
npm run release-patch
: Does a patch bump i.e.1.0.0
to1.0.1
npm run release-minor
: Does a minor bump i.e.1.0.0
to1.1.0
npm run release-major
: Does a major bump i.e.1.0.0
to2.0.0
NOTE it is REQUIRED to do some sort of bump in order for the app to be upload to its respective stores. Google Play and Itunes Connect disallows applications with the same bundleIdentifier or packageNumber in the store.
Lastly for actual deployment, we have:
npm run publish-staging
: Runsnpm run prepublish
which generates ourapp.generated.json
and publishes a staging application to Expnpm run publish-prod
: Runsnpm run prepublish
which generates ourapp.generated.json
and publishes a production application to Exponpm run upload
: Uploads the lates staging or production application (uploaded in Expo) to both Google Play and iTunes Connect
We use jest for both unit tests and for integration/cross-stack tests.
npm run test unit
runs unit tests
npm run test int
runs integration tests