Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
cedfdce
Changed few references to reactnative
bandhavya Jul 12, 2021
7b5ab5b
Refactored code and retriving data from wm_rn_config.json
bandhavya Jul 14, 2021
015b889
Merge pull request #2 from wavemaker/dev-bandhavyavakiti/updateWmrnCo…
bandhavya Jul 14, 2021
b82b659
Merge pull request #1 from wavemaker/dev-bandhavyavakiti/docChanges
bandhavya Jul 14, 2021
1b3eb7a
Updated doc
bandhavya Jul 14, 2021
66d3b71
Merge pull request #3 from wavemaker/dev-bandhavyavakiti/updateDoc
bandhavya Jul 14, 2021
65f5d42
Fixes: replaced execa with exec for build logs output. Also fixed few…
bandhavya Jul 15, 2021
098ca02
Merge pull request #4 from wavemaker/dev-bandhavyavakiti/issueFixes
bandhavya Jul 15, 2021
2eb4754
changed package type to build type
sboyina Jul 17, 2021
cb01103
Fixes: update for supporting buildType packageType for build
bandhavya Jul 19, 2021
5c564b7
Merge pull request #5 from wavemaker/dev-bandhavyavakiti/changesRelat…
bandhavya Jul 19, 2021
151b687
Fixes: apk path is invalid. check for requirements before yarn instal…
bandhavya Jul 20, 2021
472ff3c
Merge pull request #6 from wavemaker/dev-bandhavyavakiti/updateOncli
bandhavya Jul 20, 2021
cae0ff3
Removed the unneccessary code
bandhavya Jul 20, 2021
9e340f2
Merge pull request #7 from wavemaker/dev-bandhavyavakiti/removedUnuse…
bandhavya Jul 20, 2021
308a462
fixed build type error
sboyina Jul 20, 2021
ecbce9d
fixed build type error
sboyina Jul 20, 2021
a7ad82c
Support for ios build
bandhavya Jul 21, 2021
cf3287f
Merge pull request #8 from wavemaker/dev-bandhavyavakiti/iosSupport
bandhavya Jul 21, 2021
5bbee3d
Fixes: updated doc, include expo cli check in requirements
bandhavya Jul 22, 2021
08de209
Merge pull request #9 from wavemaker/dev-bandhavyavakiti/reqUpdate
bandhavya Jul 22, 2021
0cc1a1e
Localrnruntime is specified, but content is copied and replaced by ex…
bandhavya Jul 25, 2021
52f6c8b
Merge pull request #10 from wavemaker/dev-bandhavyavakiti/copyTask
bandhavya Jul 25, 2021
edcb4d9
log of expo eject failure is not captured in a file.
sboyina Jul 27, 2021
c1ccab8
unzip if a zip file is given
sboyina Jul 27, 2021
7fd77ec
unzip if a zip file is given
sboyina Jul 27, 2021
e73f1f0
added platform specific folders
sboyina Jul 27, 2021
c6ba638
disabled push notifications
sboyina Jul 27, 2021
3ffa2bd
disable metro server auto start
sboyina Jul 27, 2021
6f62a48
Fix for enableHermes, appicon is not changing on update., adding came…
bandhavya Jul 30, 2021
689866a
Merge pull request #11 from wavemaker/dev-bandhavyavakiti/newUpdate
bandhavya Jul 30, 2021
490be49
Fixes: android and ios build refactoring and updating build tools ver…
bandhavya Aug 31, 2021
b1f95c0
Merge pull request #12 from wavemaker/dev-bandhavyavakiti/updateRefac…
sboyina Aug 31, 2021
4bfa0e7
Removed code that is unneccessary after expo upgrade to 42.x
bandhavya Sep 1, 2021
ad6dff5
ios build was failing hence reverting the previous commit.
bandhavya Sep 1, 2021
93cb70e
Merge pull request #13 from wavemaker/dev-bandhavyavakiti/revertIos
bandhavya Sep 1, 2021
019063f
ios build failed
Oct 7, 2021
6bccd56
Merge branch 'main' of https://github.com/wavemaker/wm-reactnative-cli
Oct 7, 2021
ffea349
Adding hermes engine option through app.json
bandhavya Nov 24, 2021
7cc8ee2
removed commented code
bandhavya Nov 24, 2021
8a3203d
Issue: production build failing
sboyina Jan 8, 2022
4dc8db7
icon and splash are missing.
sboyina Jan 17, 2022
23b33e0
added run expo command
sboyina Jan 19, 2022
a80556b
added missing dependency
sboyina Jan 19, 2022
e447b07
added proxy option to service
sboyina Jan 30, 2022
fac0bd0
added web and clean options to expo command
sboyina Jan 30, 2022
9cd42c8
Allow CORS in proxy.
sboyina Jan 31, 2022
b011425
documentation
sboyina Jan 31, 2022
0bf9ae1
Fix: chages are not getting synced
sboyina Jan 31, 2022
0fbf30f
proxy fails with cors error
sboyina Jan 31, 2022
01b1c12
Fix: hermes preference is not set
sboyina Feb 7, 2022
a8ea673
build failing due to missing provisioning profile
sboyina Feb 7, 2022
890e997
added log messages
sboyina Feb 7, 2022
30857b5
changed the url to retrieve source
sboyina Feb 17, 2022
af6adae
enforce user authentication to perform project sync.
sboyina Mar 17, 2022
5f3075d
avoid issue with cors
sboyina Mar 17, 2022
a55a75a
avoid cross origin request issue in local development with expo.
sboyina Apr 4, 2022
87e78ea
Added proguard to true in release mode and shrinkResources is false
bandhavya May 2, 2022
74bfb48
changed port from 80 to 19009
sboyina May 13, 2022
7c1b03c
fixed service error
sboyina May 13, 2022
8d15afc
proxy service url has to be accessed with ip address to open app in e…
sboyina May 16, 2022
2a2317e
adjusted the new requirements of environment.
sboyina May 25, 2022
06dfb11
JAVA version for ios is still jdk8
bandhavya May 25, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
.vscode
ws
.DS_Store
54 changes: 36 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ A command line utility to build react native apps created using WaveMaker produc

The main goal of wm-reactnative-cli is to simplify generation of APK or IPA for WaveMaker developers. ```wm-reactnative-cli``` combines multiple react-native commands into a single command. First, one has to make sure all the required hardware and software are available and installed. Then execute the command with the appropriate values for arguments.

### Command to Install

~~~
npm install -g https://github.com/wavemaker/wm-reactnative-cli
~~~

## Android Build

Expand All @@ -16,42 +21,40 @@ The main goal of wm-reactnative-cli is to simplify generation of APK or IPA for
- Yarn
- Gradle 6 ([https://gradle.org/releases/](https://gradle.org/releases/))
- Expo cli 4.7.3 (npm install -g expo-cli@4.7.3)
- react-native 0.63.4 (npm install -g react-native-cli@0.63.4)
- react-native-cli 2.0.1, react-native 0.63.4 (npm install -g react-native-cli)
- Make sure JAVA_HOME, ANDROID_SDK and GRADLE_HOME are set in the environment variables and also in PATH.

### Command

wm-reactnative android <src_dir> [additional_arguments]
wm-reactnative build android <src_dir> [additional_arguments]


|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**Argument**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| **Description** |
|--|--|
| **src_dir** | **DEFAULT:** current working directory.<br> Path to the reactnative zip (or) path to the reactnative project folder. |
|**\-\-appId:** application id.|
| **\-\-localrnruntimepath** |**OPTIONAL:** local app-rn-runtime path |
| **src_dir** | **DEFAULT:** current working directory.<br> Path to the reactnative expo zip (or) path to the reactnative expo project folder. |
|**\-\-dest**|**OPTIONAL:** directory where the app has to be copied and built. If it is not specified then .wm-reactnative-cli folder inside the home directory, will contain the build folders |
|**\-\-auto-eject**|**OPTIONAL:** On setting this flag to true, expo eject will be invoke automatically.|
|**\-\-aKeyStore**|Absolute path of the key store. If keystore is not given then android debug key is used.|
|**\-\-aStorePassword**|Password to key store|
|**\-\-aKeyAlias**|Alias name of the key|
|**\-\-aKeyPassword**|Key Password|
|**\-\-packageType**|**DEFAULT:** development<br>development or production<br>Use ‘production’ with keystore specified.|
|**\-\-buildType**|**DEFAULT:** development<br>development or production<br>Use ‘production’ with keystore specified.|


### Example 1

~~~
wm-reactnative build android "/path/to/src" --appId="app_id"
wm-reactnative build android "/path/to/src"
~~~
### Example 2
~~~
wm-cordova build android "/path/to/src" \
wm-reactnative build android "/path/to/src" \
--dest="/path/to/dest" \
--aKeyStore="/path/to/file.keystore" \
--aStorePassword="store_password" \
--aKeyAlias="key_alias_name" \
--aKeyPassword="key" \
--packageType="production"
--buildType="production"
--auto-eject=true
~~~

Expand All @@ -62,18 +65,18 @@ wm-cordova build android "/path/to/src" \
- MAC machine
- Latest XCODE
- CocoaPods ([https://guides.cocoapods.org/using/getting-started.html#toc_3](https://guides.cocoapods.org/using/getting-started.html#toc_3))
- Node 10.x ([https://nodejs.org/en/blog/release/v10.18.0/](https://nodejs.org/en/download/))
- Node 12.x ([https://nodejs.org/en/blog/release/v12.22.0/](https://nodejs.org/en/download/))
- GIT ([https://git-scm.com/download/mac](https://git-scm.com/download/mac))
- Yarn
- Expo cli 4.7.3 (npm install -g expo-cli@4.7.3)
- react-native 0.63.4 (npm install -g react-native-cli@0.63.4)
- react-native-cli 2.0.1, react-native 0.63.4 (npm install -g react-native-cli)
- Apple developer or distribution P12 certificates
- Provisioning profile
- Install wm-reactnative-cli (npm install -g @wavemaker/wm-reactnative-cli)
- For development build, development certificate and development provisioning file are required.
- For production build, distribution certificate and distribution provisioning file are required.

**NOTE:** Before building an app, please make sure that neither iPhone nor iPad is not connected to Mac. This is open [issue](https://github.com/apache/cordova-ios/issues/420) on cordova-ios.
**NOTE:** Before building an app, please make sure that neither iPhone nor iPad is not connected to Mac.

### Command

Expand All @@ -82,31 +85,46 @@ wm-reactnative build ios <src_dir> [additional_arguments]

|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**Argument**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| **Description** |
|--|--|
| **src_dir** | **DEFAULT:** current working directory.<br> Path to the cordova zip (or) path to the cordova project folder. |
|**\-\-appId:** application id.|
| **\-\-localrnruntimepath** |**OPTIONAL:** local app-rn-runtime path |
| **src_dir** | **DEFAULT:** current working directory.<br> Path to the reactnative expo zip (or) path to the reactnative expo project folder. |
|**\-\-dest**|**OPTIONAL:** directory where the app has to be copied and built. If it is not specified then .wm-reactnative-cli folder inside the home directory, will contain the build folders |
|**\-\-auto-eject**|**OPTIONAL:** On setting this flag to true, expo eject will be invoke automatically.|
|**\-\-iCertificate**|Absolute path of P12 certificate location|
|**\-\-iCertificatePassword**|Password to unlock the certificate.|
|**\-\-iProvisioningFile**|Absolute path of provisioning file|
|**\-\-iCodeSigningIdentity**|Signing certificate name in keychain access|
|**\-\-packageType**|**DEFAULT:** development<bR>development or production <br>Use ‘production’ with an AppStore distribution certificate.|
|**\-\-buildType**|**DEFAULT:** development<bR>development or production <br>Use ‘production’ with an AppStore distribution certificate.|


### Example


~~~
wm-cordova build ios "/path/to/src" \
wm-reactnative build ios "/path/to/src" \
--iCertificate="/path/to/distribution.p12" \
--iCertificatePassword="unlock_password" \
--iProvisioningFile="/path/to/profile.mobileprovision" \
--iCodeSigningIdentity="certificate name in keychain access" \
--packageType="production"
--buildType="production"
~~~


## Run Expo locally

### Requirements
- Node 12.x
- npm 7.20.x

### Command

wm-reactnative run expo <preview_url> [additional_arguments]

|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**Argument**&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| **Description** |
|--|--|
| **preview_url** | app preview url |
|**\-\-clean**|**DEFAULT:** false <br> if true, existing project directory is removed |
|**\-\-web**|**OPTIONAL:** false <br> if true, app is automatically launched in browser |


## Additional Information

1. Destination folder path is logged at the start of the build.
Expand Down
62 changes: 52 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,22 @@
const {
ejectProject, build
} = require('./src/command');
const os = require('os');
const { LocalStorage } = require('node-localstorage');
const {
runExpo
} = require('./src/expo-launcher');
const updateNotifier = require('update-notifier');
const pkg = require('./package.json');
updateNotifier({
pkg: pkg,
updateCheckInterval : 60 * 60 * 1000
}).notify({
defer: false
});

global.rootDir = `${os.homedir()}/.wm-reactnative-cli`;
global.localStorage = new LocalStorage(`${global.rootDir}/.store`);
// src is the web react native project zip
const args = require('yargs')
.command('build', 'build the project to generate android and ios folders', yargs => {
Expand Down Expand Up @@ -33,6 +48,12 @@ const args = require('yargs')
describe: '(Android) password for key.',
type: 'string'
})
.option('p', {
alias: 'packageType',
describe: 'apk (or) bundle',
default: 'apk',
choices: ['apk', 'bundle']
})
}, args => {
args.platform = 'android';
build(args)
Expand All @@ -52,11 +73,6 @@ const args = require('yargs')
alias: 'iProvisioningFile',
describe: '(iOS) path of the provisional profile to use',
type: 'string'
})
.option('icsi', {
alias: 'iCodeSigningIdentity',
describe: 'Common Name of the Developer iOS certificate stored in the Keychain Access application',
type: 'string'
});
}, args => {
args.platform = 'ios';
Expand All @@ -73,11 +89,20 @@ const args = require('yargs')
describe: 'dest folder where the react native project will be extracted to',
type: 'string'
})
.option('p', {
alias: 'packageType',
describe: 'development (or) release',
default: 'development',
choices: ['development', 'production']
.option('bt', {
alias: 'buildType',
describe: 'development (or) debug (or) production (or) release',
default: 'debug',
coerce: (val) => {
if (val === 'development') {
return 'debug';
}
if (val === 'production') {
return 'release';
}
return val;
},
choices: ['development', 'debug', 'production', 'release']
})
.option('localrnruntimepath', {
alias: 'localrnruntimepath',
Expand All @@ -91,5 +116,22 @@ const args = require('yargs')
type: 'boolean'
})
})
.command('run expo <previewUrl>',
'launch local expo with a wavemaker project as source',
yargs => {
yargs.option('web', {
describe: 'If set to true then web will be started.',
default: false,
type: 'boolean'
});
yargs.option('clean', {
describe: 'If set to true then all existing folders are removed.',
default: false,
type: 'boolean'
});
},
(args) => {
runExpo(args.previewUrl, args.web, args.clean)
})
.help('h')
.alias('h', 'help').argv;
Loading