├── .editorconfig ├── .gitignore ├── LICENSE ├── README.md ├── package.json ├── publish.sh ├── src ├── index.ts ├── libraries │ ├── copyTemplateFile.ts │ ├── createDir.ts │ ├── getRnVersion.ts │ ├── getYarnVersion.ts │ ├── installPackage.ts │ ├── replacePlaceholder.ts │ ├── runShell.ts │ └── wrapQuots.ts └── maps.ts ├── templates ├── .editorconfig ├── .eslintrc.js ├── README.md └── scripts │ ├── build │ ├── android-signature.sh │ ├── archive.sh │ ├── export-ipa.sh │ └── upload-app-store.sh │ ├── init │ ├── index.js │ ├── sdkManager.sh │ ├── setEnv.sh │ ├── versionBetween.js │ └── watchman.sh │ └── start │ ├── createEmulator.sh │ ├── index.js │ └── launchAndroid.sh ├── tsconfig.json ├── typings └── index.d.ts └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [.*] 12 | insert_final_newline = false 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .idea/ 3 | ./build/ 4 | node_modules/ 5 | *.log 6 | demo/ -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 范文华 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## What can I do 2 | ##### 1、Create project based on react-native-cli. 3 | ##### 2、Download android sdk automatically without android studio. 4 | ##### 3、Create android emulator automatically without android studio. 5 | ##### 4、Run `npm start` or `yarn start` can launch android & ios simulator automatically. 6 | ##### 5、Build android & ios app by shell script automatically. 7 | ##### 6、Upload ios app to app-store by shell script automatically. 8 | ##### 7、You don't need to care about how to install any more, just focus to write javascript code. 9 | 10 | ## Requirements 11 | 12 | - macos 13 | - Install xcode 9.4+ 14 | - Install node 8.3+ 15 | - Install JDK 8 16 | 17 | Android Studio is not required. We will use shell script to install sdk-platforms and sdk-tools. 18 | 19 | You'd better install jdk8, not jdk10. Because jdk10 may make your app crash. 20 | 21 | ## Install 22 | 23 | ```bash 24 | npm install -g react-native-init@latest 25 | ``` 26 | 27 | OR 28 | 29 | ```bash 30 | yarn global add react-native-init@latest 31 | ``` 32 | 33 | ## Create project 34 | Open terminal and type script: 35 | ```bash 36 | react-native-init YourProjectName 37 | ``` 38 | And then run your project: 39 | ```bash 40 | cd YourProjectName 41 | 42 | # For first time initialize. 43 | node scripts/init 44 | 45 | # Or yarn start 46 | npm start 47 | ``` 48 | 49 | ## Options 50 | 51 | ### npm 52 | Using npm to install package whatever. 53 | ```bash 54 | react-native-init YourProjectName --npm 55 | ``` 56 | If you don't append this parameter, we will check **yarn** at first, and then check **npm** when yarn is not installed. 57 | 58 | ## Supported version 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 |
repositoryreact-native
< 0.7.00.54.* - 0.56.*
0.58.*0.58.*
73 | 74 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-init", 3 | "version": "0.58.10", 4 | "description": "Create react native projects with native code based on react-native-cli", 5 | "main": "lib/index.js", 6 | "repository": "https://github.com/fwh1990/react-native-init", 7 | "author": "范文华 <531362022@qq.com>", 8 | "license": "MIT", 9 | "private": false, 10 | "scripts": { 11 | "demo": "rm -rf ~/.android && rm -rf demo && ts-node src/index.ts demo && cd demo && node scripts/init && node scripts/start" 12 | }, 13 | "bin": { 14 | "react-native-init": "./lib/index.js" 15 | }, 16 | "dependencies": { 17 | "colors": "^1.3.3", 18 | "fs-extra": "^7.0.1", 19 | "minimist": "^1.2.0", 20 | "mkdirp": "^0.5.1", 21 | "react-native-cli": "^2.0.1", 22 | "semver": "^5.6.0", 23 | "tslib": "^1.9.3" 24 | }, 25 | "devDependencies": { 26 | "@types/fs-extra": "^5.0.4", 27 | "@types/minimist": "^1.2.0", 28 | "@types/mkdirp": "^0.5.2", 29 | "@types/node": "^10.12.20", 30 | "@types/semver": "^5.5.0", 31 | "ts-node": "^8.0.2", 32 | "typescript": "^3.2.4" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /publish.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | registry=$(npm config get registry) 3 | 4 | npm config set registry https://registry.npmjs.org 5 | who=$(npm whoami 2> /dev/null) 6 | 7 | if [ -z $who ]; then 8 | echo "Login plz..." 9 | npm login 10 | fi 11 | echo "Who am i: $(npm whoami)" 12 | 13 | echo "Building..." 14 | rm -rf ./build/ 15 | npx tsc 16 | cp -r ./templates ./build/ 17 | cp package.json README.md LICENSE ./build/ 18 | echo "Begin publish..." 19 | npm publish ./build/ 20 | 21 | npm config set registry ${registry} 22 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | import fs from 'fs'; 4 | import path from 'path'; 5 | import minimist from 'minimist'; 6 | import colors from 'colors'; 7 | import fsExtra from 'fs-extra'; 8 | import maps from './maps'; 9 | import { runShell, runShellAndReturn } from './libraries/runShell'; 10 | import { ProjectArgs } from '../typings'; 11 | import { getRnVersion } from './libraries/getRnVersion'; 12 | import { replacePlaceholder } from './libraries/replacePlaceholder'; 13 | import { copyTemplateFile } from './libraries/copyTemplateFile'; 14 | import { createDir } from './libraries/createDir'; 15 | import { installPackage } from './libraries/installPackage'; 16 | import { getYarnVersion } from './libraries/getYarnVersion'; 17 | import { wrapQuots } from './libraries/wrapQuots'; 18 | 19 | const args = minimist(process.argv.slice(2)); 20 | 21 | if (args._.length === 0) { 22 | console.log([ 23 | '', 24 | colors.green(' Usage: react-native-init ProjectName [--npm]'), 25 | '', 26 | ].join('\n')); 27 | process.exit(1); 28 | } 29 | 30 | const projectName = args._[0]; 31 | const projectPath = path.resolve(projectName); 32 | 33 | if (fs.existsSync(projectPath)) { 34 | console.error(colors.red(`Directory ${projectName} already exists.`)); 35 | process.exit(1); 36 | } 37 | 38 | console.log(`Fetching latest react-native version between ${maps.minRnVersion} and ${maps.maxRnVersion}...`); 39 | const rnVersion = getRnVersion(); 40 | 41 | if (!rnVersion) { 42 | console.log(colors.red('Unknown react-native version.')); 43 | process.exit(1); 44 | } 45 | 46 | const bin = path.resolve(__dirname, '../node_modules/.bin/react-native'); 47 | let installCommand = `${bin} init ${projectName} --version=${rnVersion}`; 48 | 49 | if (args.npm) { 50 | installCommand += ' --npm'; 51 | } 52 | 53 | runShell(installCommand); 54 | 55 | // Change the working directory to new project 56 | process.chdir(projectPath); 57 | 58 | // Extend package.json 59 | (function () { 60 | const packageFilePath = path.resolve('package.json'); 61 | const packageData = require(packageFilePath); 62 | 63 | if (!packageData.scripts) { 64 | packageData.scripts = {}; 65 | } 66 | 67 | packageData.scripts.start = 'node scripts/start --port=8081'; 68 | packageData.license = packageData.license || 'UNLICENSED'; 69 | fs.writeFileSync(packageFilePath, JSON.stringify(packageData, null, 2)); 70 | })(); 71 | 72 | // Fix warning: To run dex in process, the Gradle daemon needs a larger heap. 73 | replacePlaceholder('android/gradle.properties', [ 74 | { 75 | pattern: /#\s*(org\.gradle\.jvmargs\s*=.+)/, 76 | value: '$1', 77 | } 78 | ]); 79 | 80 | createDir('scripts'); 81 | copyTemplateFile('.editorconfig'); 82 | copyTemplateFile('README.md'); 83 | fsExtra.copySync(path.join(__dirname, '../templates/scripts'), path.resolve('scripts')); 84 | 85 | runShellAndReturn('echo start.command >> .gitignore'); 86 | 87 | replacePlaceholder('scripts/init/index.js', [ 88 | { 89 | pattern: /:install_tool:/g, 90 | value: getYarnVersion() ? 'yarn' : 'npm', 91 | }, 92 | { 93 | pattern: /:minJdkVersion:/g, 94 | value: maps.minJdkVersion, 95 | }, 96 | { 97 | pattern: /:maxJdkVersion:/g, 98 | value: maps.maxJdkVersion, 99 | }, 100 | { 101 | pattern: /:minNodeVersion:/g, 102 | value: maps.minNodeVersion, 103 | }, 104 | { 105 | pattern: /:maxNodeVersion:/g, 106 | value: maps.maxNodeVersion, 107 | }, 108 | { 109 | pattern: /:minXcodeVersion:/g, 110 | value: maps.minXcodeVersion, 111 | }, 112 | { 113 | pattern: /:maxXcodeVersion:/g, 114 | value: maps.maxXcodeVersion, 115 | }, 116 | ]); 117 | 118 | replacePlaceholder('README.md', [ 119 | { 120 | pattern: /:install_tool:/g, 121 | value: getYarnVersion() ? 'yarn' : 'npm', 122 | }, 123 | ]); 124 | 125 | replacePlaceholder('scripts/init/sdkManager.sh', [ 126 | { 127 | pattern: /:sdk_packages:/g, 128 | value: wrapQuots(maps.androidSdkPackages), 129 | }, 130 | { 131 | pattern: /:sdk_manager_code:/g, 132 | value: maps.androidSdkManagerCode, 133 | }, 134 | ]); 135 | 136 | replacePlaceholder('scripts/start/createEmulator.sh', [ 137 | { 138 | pattern: /:rn_version:/g, 139 | value: rnVersion.split('.').join(''), 140 | }, 141 | { 142 | pattern: /:avd_package:/g, 143 | value: wrapQuots(maps.androidAvd), 144 | } 145 | ]); 146 | 147 | replacePlaceholder('scripts/build/archive.sh', [ 148 | { 149 | pattern: /:project_name:/g, 150 | value: projectName, 151 | } 152 | ]); 153 | 154 | replacePlaceholder('scripts/build/android-signature.sh', [ 155 | { 156 | pattern: /:project_name:/g, 157 | value: projectName, 158 | } 159 | ]); 160 | 161 | installPackage( 162 | [ 163 | // ajv is required by eslint 164 | // When missing ajv, you may see: 165 | // ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself. 166 | 'ajv', 167 | // 'watchman', 168 | 'eslint', 169 | '@types/react-native', 170 | '@types/react', 171 | 'compare-versions', 172 | 'colors', 173 | 'minimist', 174 | ], 175 | true, 176 | ); 177 | 178 | console.log([ 179 | '', 180 | colors.green(`New project '${projectName}' is created. Open project and read file README.md`), 181 | '', 182 | colors.green(`New Project path: ${projectPath}`), 183 | '', 184 | ].join('\n')); 185 | -------------------------------------------------------------------------------- /src/libraries/copyTemplateFile.ts: -------------------------------------------------------------------------------- 1 | import fs from 'fs'; 2 | import path from 'path'; 3 | import {createDir} from './createDir'; 4 | 5 | export const copyTemplateFile = (fileName: string) => { 6 | const parent = path.dirname(fileName); 7 | 8 | if (parent && parent !== '.' && parent !== '..') { 9 | createDir(parent); 10 | } 11 | 12 | fs.copyFileSync(path.join(__dirname, '../../templates', fileName), fileName); 13 | console.log(`Created file -> ${fileName}.`); 14 | }; 15 | -------------------------------------------------------------------------------- /src/libraries/createDir.ts: -------------------------------------------------------------------------------- 1 | import mkdirp from 'mkdirp'; 2 | 3 | export const createDir = (dirName: string) => { 4 | mkdirp.sync(dirName); 5 | console.log(`Created directory -> ${dirName}.`); 6 | }; 7 | -------------------------------------------------------------------------------- /src/libraries/getRnVersion.ts: -------------------------------------------------------------------------------- 1 | import semver from 'semver'; 2 | import colors from 'colors'; 3 | import { getYarnVersion } from './getYarnVersion'; 4 | import { runShellAndReturn } from './runShell'; 5 | import maps from '../maps'; 6 | 7 | export const getRnVersion = () => { 8 | const yarnVersion = getYarnVersion(); 9 | let rnVersions: string; 10 | 11 | if (yarnVersion) { 12 | rnVersions = runShellAndReturn('yarn info react-native versions').replace(/^[\s\S]+?(\[[\s\S]+?\])[\s\S]+?$/, '$1'); 13 | } else { 14 | rnVersions = runShellAndReturn('npm info react-native versions'); 15 | } 16 | 17 | try { 18 | return JSON.parse(rnVersions.replace(/'/g, '"')) 19 | .reverse() 20 | .find((version: string) => { 21 | return semver.gte(version, maps.minRnVersion) && semver.lte(version, maps.maxRnVersion); 22 | }); 23 | } catch (err) { 24 | console.log(colors.red(`Unable to fetch react-native version: ${err.message}`)); 25 | process.exit(1); 26 | } 27 | }; 28 | -------------------------------------------------------------------------------- /src/libraries/getYarnVersion.ts: -------------------------------------------------------------------------------- 1 | import { execSync } from 'child_process'; 2 | import semver from 'semver'; 3 | import minimist from 'minimist'; 4 | import { ProjectArgs } from '../../typings'; 5 | 6 | const { npm } = minimist(process.argv.slice(2)); 7 | 8 | const yarnVersion = npm ? null : (function () { 9 | let version; 10 | 11 | try { 12 | version = (execSync('yarn --version 2>/dev/null').toString() || '').trim(); 13 | } catch (error) { 14 | return null; 15 | } 16 | 17 | // yarn < 0.16 has a 'missing manifest' bug 18 | try { 19 | if (semver.gte(version, '0.16.0')) { 20 | return version; 21 | } else { 22 | return null; 23 | } 24 | } catch (error) { 25 | console.error('Cannot parse yarn version: ' + version); 26 | return null; 27 | } 28 | })(); 29 | 30 | export const getYarnVersion = () => { 31 | return yarnVersion; 32 | }; 33 | -------------------------------------------------------------------------------- /src/libraries/installPackage.ts: -------------------------------------------------------------------------------- 1 | import { getYarnVersion } from './getYarnVersion'; 2 | import { runShell } from './runShell'; 3 | 4 | const yarnVersion = getYarnVersion(); 5 | 6 | export const installPackage = (packageName: string | string[], isDev = false) => { 7 | let installCommand; 8 | 9 | if (typeof packageName === 'string') { 10 | packageName = [packageName]; 11 | } 12 | 13 | console.log(`Installing ${packageName.join(', ')}...`); 14 | 15 | if (yarnVersion) { 16 | installCommand = `yarn add ${packageName.join(' ')}`; 17 | 18 | if (isDev) { 19 | installCommand += ' --dev'; 20 | } 21 | } else { 22 | installCommand = `npm install ${packageName.join(' ')}`; 23 | 24 | if (isDev) { 25 | installCommand += ' --save-dev'; 26 | } 27 | } 28 | 29 | runShell(installCommand); 30 | }; 31 | -------------------------------------------------------------------------------- /src/libraries/replacePlaceholder.ts: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | 4 | export type ReplacePlaceholderMap = Array<{ 5 | pattern: RegExp; 6 | value: string | number; 7 | }>; 8 | 9 | export const replacePlaceholder = (relativePath: string, replaceMap: ReplacePlaceholderMap = []) => { 10 | const absolutePath = path.resolve(relativePath); 11 | const finalData = replaceMap.reduce( 12 | (carry, map) => carry.replace(map.pattern, map.value), 13 | fs.readFileSync(absolutePath).toString(), 14 | ); 15 | 16 | fs.writeFileSync(absolutePath, finalData); 17 | }; 18 | -------------------------------------------------------------------------------- /src/libraries/runShell.ts: -------------------------------------------------------------------------------- 1 | import { execSync } from 'child_process'; 2 | 3 | export const runShell = (shells: string | string[]) => { 4 | if (!Array.isArray(shells)) { 5 | shells = [shells]; 6 | } 7 | 8 | try { 9 | for (const shell of shells) { 10 | execSync(shell, { stdio: 'inherit' }); 11 | } 12 | } catch (err) { 13 | console.error(err.message || err); 14 | process.exit(1); 15 | } 16 | }; 17 | 18 | export const runShellAndReturn = (shell: string) => { 19 | try { 20 | return execSync(shell).toString(); 21 | } catch (err) { 22 | console.error(err.message || err); 23 | process.exit(1); 24 | return ''; 25 | } 26 | }; 27 | -------------------------------------------------------------------------------- /src/libraries/wrapQuots.ts: -------------------------------------------------------------------------------- 1 | export const wrapQuots = (args: Array) => { 2 | if (args.length) { 3 | return `"${args.join('" "')}"`; 4 | } 5 | 6 | return ''; 7 | }; 8 | -------------------------------------------------------------------------------- /src/maps.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "minRnVersion": "0.58.0", 3 | "maxRnVersion": "0.58.99", 4 | 5 | "minNodeVersion": "8.3.0", 6 | "maxNodeVersion": "*", 7 | 8 | "minXcodeVersion": "9.4.0", 9 | "maxXcodeVersion": "*", 10 | 11 | "minJdkVersion": "8.0.0", 12 | // FIXME: High version jdk grater than 9 is not compatible with sdkmanager. 13 | "maxJdkVersion": "8.99.99", 14 | 15 | "androidAvd": [ 16 | "system-images;android-28;google_apis;x86_64", 17 | ], 18 | "androidSdkPackages": [ 19 | // Intel HAXM 20 | "extras;intel;Hardware_Accelerated_Execution_Manager", 21 | // Android SDK Platform-Tools 22 | "platform-tools", 23 | // Enhance: Launch the emulator by shell script. 24 | 'emulator', 25 | // Fix warning: NDK is missing a "platforms" directory 26 | // NDK 27 | 'ndk-bundle', 28 | 29 | 30 | // Android SDK Platform 28 31 | "platforms;android-28", 32 | // Intel x86 Atom_64 System Image 33 | "system-images;android-28;google_apis;x86_64", 34 | // Android SDK Build-Tools 35 | "build-tools;28.0.3", 36 | ], 37 | // @see https://developer.android.google.cn/studio/ 38 | "androidSdkManagerCode": "4333796" 39 | }; 40 | -------------------------------------------------------------------------------- /templates/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [.*] 12 | insert_final_newline = false 13 | -------------------------------------------------------------------------------- /templates/.eslintrc.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fwh1990/react-native-init/32a159bead5bd333f64b586ceb5b03cf8b8a18ae/templates/.eslintrc.js -------------------------------------------------------------------------------- /templates/README.md: -------------------------------------------------------------------------------- 1 | ## Initialize 2 | Everyone must run this script at first. 3 | ```bash 4 | node scripts/init 5 | ``` 6 | 7 | ## Coding 8 | We have prepared everything for you. You just need run script below: 9 | ```bash 10 | :install_tool: start 11 | ``` 12 | 13 | ## Build app 14 | Before build app, you should create signature for android 15 | ```bash 16 | sh scripts/build/android-signature.sh 17 | ``` 18 | Before build app, you should create personal certificate and upload to [apple developer](https://developer.apple.com/account/ios/certificate). Or create by xcode automatically. 19 | 20 | And then you can build 21 | 22 | ```bash 23 | sh scripts/build/archive.sh 24 | ``` 25 | 26 | ## Upload to App Store 27 | You can use Xcode -> Product -> Archive, and click `Upload to App Store` when complete. 28 | 29 | Also, you can use shell script. 30 | 31 | ```bash 32 | sh scripts/build/archive.sh && sh scripts/build/upload-app-store.sh 33 | ``` 34 | 35 | In this way, you should override teamID in file `ios/exportOptions/app-store.plist`, go to [apple developer](https://developer.apple.com/account/ios/identifier/bundle) to fetch the keyword named: Prefix 36 | -------------------------------------------------------------------------------- /templates/scripts/build/android-signature.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ ! -f "android/release.keystore" ]; then 4 | keytool \ 5 | -genkey \ 6 | -v \ 7 | -keyalg RSA \ 8 | -keysize 2048 \ 9 | -validity 100000 \ 10 | -keystore "android/release.keystore" \ 11 | -storepass "_______your-password-a_______" \ 12 | -alias "com.:project_name:" \ 13 | -keypass "_______input-your-password-b_______" \ 14 | -dname "" 15 | fi 16 | -------------------------------------------------------------------------------- /templates/scripts/build/archive.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Build app for android and ios. 4 | 5 | ############################# 6 | # Make sure you have override file ios/exportOptions/*.plist 7 | ############################# 8 | 9 | # Prepare 10 | react-native link 11 | 12 | # Build for android 13 | # The apk file will be at 14 | # android/app/build/outputs/apk/app-release.apk 15 | cd android 16 | rm -rf build/ app/build/ 17 | ./gradlew assembleRelease 18 | cd - 19 | 20 | # Build for ios. 21 | # Make sure xcode is installed. 22 | cd ios 23 | mkdir -p build 24 | rm -rf build/archive.xcarchive 25 | 26 | project_name=:project_name: 27 | 28 | # Archive 29 | # The same as click Xcode -> Product -> Archive 30 | xcodebuild clean 31 | xcodebuild archive \ 32 | -project ./${project_name}.xcodeproj \ 33 | -scheme ${project_name} \ 34 | -configuration Release \ 35 | -archivePath ./build/archive.xcarchive 36 | -------------------------------------------------------------------------------- /templates/scripts/build/export-ipa.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Variable export_type can be one of [app-store, ad-hoc] 4 | export_type=$1 5 | 6 | cd ios 7 | rm -rf ./build/ipa-${export_type} 8 | 9 | # Export 10 | # The same as click Xcode -> Window -> Organizer -> Export 11 | xcodebuild -exportArchive \ 12 | -archivePath ./build/archive.xcarchive \ 13 | -exportPath ./build/ipa-${export_type} \ 14 | -exportOptionsPlist ./exportOptions/${export_type}.plist \ 15 | -allowProvisioningUpdates 16 | -------------------------------------------------------------------------------- /templates/scripts/build/upload-app-store.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Input your app_id and password. 4 | # The account must be the owner of certificates. 5 | APP_STORE_ACCOUNT=??????? 6 | APP_STORE_PASSWORD=??????? 7 | 8 | rm -rf ios/build/ipa-app-store 9 | sh shell/build/ios/export-ipa.sh app-store 10 | IPA=`ls ios/build/ipa-app-store/*.ipa 2>/dev/null` 11 | 12 | if [ -z "$IPA" ]; then 13 | echo "Ipa file is missing." 14 | exit 1 15 | fi 16 | 17 | # Template folders, sometimes will cause upload failed. 18 | rm -rf ~/.itmstransporter/ ~/.old_itmstransporter/ 19 | 20 | alias altool=/Applications/Xcode.app/Contents/Applications/Application\ Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Versions/A/Support/altool 21 | 22 | # Validate 23 | # The same as click Xcode -> Window -> Organizer -> Validate 24 | altool --validate-app --file "$IPA" --type ios --username ${APP_STORE_ACCOUNT} --password ${APP_STORE_PASSWORD} 25 | 26 | # Upload 27 | # The same as click Xcode -> Window -> Organizer -> Upload To App Store 28 | altool --upload-app --file "$IPA" --type ios --username ${APP_STORE_ACCOUNT} --password ${APP_STORE_PASSWORD} 29 | -------------------------------------------------------------------------------- /templates/scripts/init/index.js: -------------------------------------------------------------------------------- 1 | const { execSync } = require('child_process'); 2 | const colors = require('colors'); 3 | const versionBetween = require('./versionBetween'); 4 | 5 | const isMacOs = process.platform === 'darwin'; 6 | const isWindows = process.platform === 'win32'; 7 | const isLinux = ['freebsd', 'linux', 'openbsd'].some(function (item) { 8 | return item === process.platform; 9 | }); 10 | 11 | if (isLinux) { 12 | console.log(colors.red('\nLinux is not supported yet.\n')); 13 | process.exit(1); 14 | } 15 | 16 | // Check node version 17 | const nodeVersion = process.version; 18 | 19 | if (!versionBetween(nodeVersion, ':minNodeVersion:')) { 20 | console.log(colors.red(`\nThe node version should between :minNodeVersion: and :maxNodeVersion:. Current version: ${nodeVersion}\n`)); 21 | process.exit(1); 22 | } 23 | 24 | // Check jdk version 25 | try { 26 | const jdkVersionInfo = execSync('java -version 2>&1 | awk \'NR==1{print $3}\'') 27 | .toString() 28 | .replace(/"/g, ''); 29 | const matches = jdkVersionInfo.match(/^1\.(\d+)(.\d+)?.*/) || jdkVersionInfo.match(/^(\d+)(.\d+)?(.\d+)?.*/); 30 | let jdkVersion = '0'; 31 | 32 | if (matches) { 33 | jdkVersion = matches[1] + (matches[2] || '') + (matches[3] || ''); 34 | } 35 | 36 | if (!versionBetween(jdkVersion, ':minJdkVersion:', ':maxJdkVersion:')) { 37 | console.log(colors.red(`\nThe jdk version should between :minJdkVersion: and :maxJdkVersion:. Current version: ${jdkVersionInfo}\n`)); 38 | process.exit(1); 39 | } 40 | } catch (e) { 41 | console.log(colors.red(e.message || e)); 42 | console.log([ 43 | '', 44 | colors.yellow('If you didn\'t install jdk, Visit this site and download jdk: https://www.oracle.com/technetwork/java/javase/downloads/index.html'), 45 | '', 46 | ].join('\n')); 47 | process.exit(1); 48 | } 49 | 50 | if (isMacOs) { 51 | let xcodeVersion = execSync('xcodebuild -version 2>&1 | awk \'NR==1{print $2}\'').toString().replace(/\n/g, ''); 52 | xcodeVersion = Number.parseFloat(xcodeVersion); 53 | 54 | if (Number.isNaN(xcodeVersion)) { 55 | console.log(colors.red(`\nUnknown xcode version. Are you sure xcode is installed?\n`)); 56 | process.exit(1); 57 | } 58 | 59 | if (!versionBetween(String(xcodeVersion), ':minXcodeVersion:', ':maxXcodeVersion:')) { 60 | console.log(colors.red(`\nThe xcode version should between :minXcodeVersion: and :maxXcodeVersion:. Current version: ${xcodeVersion}\n`)); 61 | process.exit(1); 62 | } 63 | } 64 | 65 | try { 66 | console.log('Checking :install_tool: version...'); 67 | execSync(':install_tool: -version', { 68 | stdio: 'inherit', 69 | }); 70 | } catch (e) { 71 | console.log(colors.red(e.message || e)); 72 | process.exit(1); 73 | } 74 | 75 | // Your team should use the same tool to install packages. 76 | // That dependencies on the project creator. 77 | execSync(':install_tool: install', { 78 | stdio: 'inherit', 79 | }); 80 | 81 | if (isMacOs) { 82 | console.log('Installing watchman...'); 83 | execSync('sh scripts/init/watchman.sh', { 84 | stdio: 'inherit', 85 | }); 86 | } 87 | 88 | if (isMacOs) { 89 | execSync('sh scripts/init/setEnv.sh', { 90 | stdio: 'inherit', 91 | }); 92 | } 93 | 94 | if (isMacOs) { 95 | execSync('sh scripts/init/sdkManager.sh', { 96 | stdio: 'inherit', 97 | }); 98 | } 99 | -------------------------------------------------------------------------------- /templates/scripts/init/sdkManager.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | ######################### 6 | # Required by android 7 | ######################### 8 | 9 | # Install sdk tools 10 | # Thus Android Studio is unnecessary now. 11 | if [ ! -f "$ANDROID_HOME/tools/bin/sdkmanager" ]; then 12 | echo "\nDownloading android sdkManager...\n" 13 | mkdir -p ${ANDROID_HOME} 14 | sdk_tools_name='sdk-tools-darwin-:sdk_manager_code:.zip' 15 | rm -f ${sdk_tools_name} 16 | # TODO: set china specially env. 17 | curl -O https://dl.google.com/android/repository/${sdk_tools_name} 18 | unzip ${sdk_tools_name} -d ${ANDROID_HOME} 19 | 20 | echo "SdkManager has been installed." 21 | fi 22 | 23 | # This file may not exist. 24 | mkdir -p $HOME/.android 25 | touch $HOME/.android/repositories.cfg 26 | # Accept all licences, so the program will not ask again. 27 | yes | sdkmanager --licenses 28 | 29 | # TODO: add mirror for china. 30 | # Channel number: 0 (Stable), 1 (Beta), 2 (Dev), 3 (Canary) 31 | sdk_manager_options='--no_https --verbose --channel=0' 32 | 33 | # RN version required. 34 | for package_name in :sdk_packages: 35 | do 36 | echo "\nInstalling package \033[32m${package_name}\033[0m. Wait patiently...\n" 37 | sdkmanager "$package_name" ${sdk_manager_options} 38 | echo "\nInstalled.\n" 39 | done 40 | 41 | sdkmanager --update ${sdk_manager_options} 42 | -------------------------------------------------------------------------------- /templates/scripts/init/setEnv.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | bash_file=~/.bash_profile 4 | 5 | # Required by android 6 | touch ${bash_file} 7 | 8 | exports[0]='ANDROID_HOME=$HOME/Library/Android/sdk' 9 | exports[1]='PATH=$PATH:$ANDROID_HOME/tools' 10 | exports[2]='PATH=$PATH:$ANDROID_HOME/tools/bin' 11 | exports[3]='PATH=$PATH:$ANDROID_HOME/platform-tools' 12 | 13 | for export_sentence in ${exports[*]} 14 | do 15 | if [ -z "$(cat ${bash_file} | grep ${export_sentence})" ] 16 | then 17 | echo " 18 | # Insert by npm package: react-native-init 19 | export $export_sentence" >> ${bash_file} 20 | fi 21 | done 22 | 23 | source ${bash_file} 24 | -------------------------------------------------------------------------------- /templates/scripts/init/versionBetween.js: -------------------------------------------------------------------------------- 1 | const compareVersions = require('compare-versions'); 2 | 3 | module.exports = function (version, min, max) { 4 | if (min !== '*' && min !== undefined && compareVersions(version, min) < 0) { 5 | return false; 6 | } 7 | 8 | if (max !== '*' && max !== undefined && compareVersions(version, max) > 0) { 9 | return false; 10 | } 11 | 12 | return true; 13 | }; 14 | -------------------------------------------------------------------------------- /templates/scripts/init/watchman.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ -z "$(which brew)" ] 4 | then 5 | read -p "You didn't install brew. Press any key to install brew" 6 | /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 7 | fi 8 | 9 | # Fix error: `fsevents` unavailable (this watcher can only be used on Darwin) 10 | brew install watchman 11 | -------------------------------------------------------------------------------- /templates/scripts/start/createEmulator.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # How to list the emulators 4 | # avdmanager list avd 5 | 6 | # How to delete an emulator 7 | # avdmanager delete avd --name=THE_NAME_COPY_FROM_LIST 8 | 9 | emulator_name=react-native-init-:rn_version: 10 | 11 | avdmanager create avd \ 12 | --force \ 13 | --name ${emulator_name} \ 14 | --package :avd_package: \ 15 | --sdcard 300M \ 16 | --device "Nexus 5X" 17 | 18 | # TODO: find out how to install skins 19 | cat >> $HOME/.android/avd/${emulator_name}.avd/config.ini << EOF 20 | hw.ramSize=2048 21 | showDeviceFrame=yes 22 | hw.gpu.enabled=yes 23 | hw.gpu.mode=host 24 | hw.keyboard=yes 25 | hw.camera.front=emulated 26 | hw.camera.back=virtualscene 27 | skin.path=_no_skin 28 | EOF 29 | -------------------------------------------------------------------------------- /templates/scripts/start/index.js: -------------------------------------------------------------------------------- 1 | const minimist = require('minimist'); 2 | const { execSync } = require('child_process'); 3 | 4 | const args = minimist(process.argv.slice(2)); 5 | const port = args.port || 8081; 6 | 7 | const isMacOs = process.platform === 'darwin'; 8 | const isWindows = process.platform === 'win32'; 9 | const isLinux = ['freebsd', 'linux', 'openbsd'].some(function (item) { 10 | return item === process.platform; 11 | }); 12 | 13 | if (isLinux) { 14 | console.log(colors.red('\nLinux is not supported yet.\n')); 15 | process.exit(1); 16 | } 17 | 18 | if (isMacOs) { 19 | execSync('sh scripts/start/launchAndroid.sh', { 20 | stdio: 'inherit', 21 | }); 22 | } 23 | 24 | execSync('./node_modules/.bin/react-native link', { 25 | stdio: 'inherit', 26 | }); 27 | 28 | execSync(`./node_modules/.bin/react-native run-android --port ${port}`, { 29 | stdio: 'inherit', 30 | }); 31 | 32 | if (isMacOs) { 33 | execSync(`./node_modules/.bin/react-native run-ios --simulator 'iPhone 8' --port ${port}`, { 34 | stdio: 'inherit', 35 | }); 36 | } 37 | -------------------------------------------------------------------------------- /templates/scripts/start/launchAndroid.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | avds=($(emulator -list-avds)) 6 | avd_count=${#avds[*]} 7 | 8 | echo "\nAndroid emulator list:\n" 9 | emulator -list-avds 10 | 11 | if [ ${avd_count} == 0 ] 12 | then 13 | echo "Android emulator is not found. Creating..." 14 | sh scripts/start/createEmulator.sh 15 | avd=$(emulator -list-avds) 16 | elif [ ${avd_count} == 1 ] 17 | then 18 | avd=${avds[0]} 19 | else 20 | first_avd=${avds[0]} 21 | read -t 30 -p "Select the emulator which you want to launch: [$first_avd]" avd 22 | echo "" 23 | 24 | if [ -z "$avd" ]; then 25 | avd=${first_avd} 26 | fi 27 | fi 28 | 29 | # Do not use [ grep -v grep ] in node, it's not compatible with child_process. 30 | process_count=$(ps aux | grep "\-avd $avd" | wc -l) 31 | 32 | if [ ${process_count} == 2 ] 33 | then 34 | echo "Android emulator had been launched" 35 | exit 0 36 | fi 37 | 38 | echo "Android emulator ${avd} is launching..." 39 | cd ${ANDROID_HOME}/tools/ 40 | emulator -avd ${avd} & 41 | 42 | # It's important to wait the emulator rendering the desktop, otherwise, script `react-native run-android` make no sense. 43 | count=0 44 | # FIXME: cannot read adb public key file 45 | while [ "$(adb shell getprop sys.boot_completed 2>/dev/null)" != "1" ] 46 | do 47 | sleep 1 48 | count=$((count + 1)) 49 | echo "Waiting for boot complete, wasting ${count}/150 second..." 50 | done 51 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": ["es6", "es7"], 5 | "module": "commonjs", 6 | "outDir": "./build/lib", 7 | "rootDir": "./src/", 8 | "removeComments": true, 9 | "importHelpers": true, 10 | "downlevelIteration": true, 11 | 12 | "strict": true, 13 | "noImplicitAny": true, 14 | "strictNullChecks": true, 15 | "strictFunctionTypes": true, 16 | "strictBindCallApply": true, 17 | "strictPropertyInitialization": true, 18 | "noImplicitThis": true, 19 | "alwaysStrict": true, 20 | 21 | "noUnusedLocals": true, 22 | "noUnusedParameters": true, 23 | "noImplicitReturns": true, 24 | "noFallthroughCasesInSwitch": true, 25 | 26 | "resolveJsonModule": true, 27 | "typeRoots": ["./node_modules/@types/", "./typings/"], 28 | 29 | "moduleResolution": "node", 30 | "allowSyntheticDefaultImports": true, 31 | "esModuleInterop": true 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /typings/index.d.ts: -------------------------------------------------------------------------------- 1 | export interface ProjectArgs { 2 | npm?: boolean; 3 | } 4 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@types/fs-extra@^5.0.4": 6 | version "5.0.4" 7 | resolved "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-5.0.4.tgz#b971134d162cc0497d221adde3dbb67502225599" 8 | integrity sha512-DsknoBvD8s+RFfSGjmERJ7ZOP1HI0UZRA3FSI+Zakhrc/Gy26YQsLI+m5V5DHxroHRJqCDLKJp7Hixn8zyaF7g== 9 | dependencies: 10 | "@types/node" "*" 11 | 12 | "@types/minimist@^1.2.0": 13 | version "1.2.0" 14 | resolved "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz#69a23a3ad29caf0097f06eda59b361ee2f0639f6" 15 | integrity sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY= 16 | 17 | "@types/mkdirp@^0.5.2": 18 | version "0.5.2" 19 | resolved "https://registry.npmjs.org/@types/mkdirp/-/mkdirp-0.5.2.tgz#503aacfe5cc2703d5484326b1b27efa67a339c1f" 20 | integrity sha512-U5icWpv7YnZYGsN4/cmh3WD2onMY0aJIiTE6+51TwJCttdHvtCYmkBNOobHlXwrJRL0nkH9jH4kD+1FAdMN4Tg== 21 | dependencies: 22 | "@types/node" "*" 23 | 24 | "@types/node@*", "@types/node@^10.12.20": 25 | version "10.12.20" 26 | resolved "https://registry.npmjs.org/@types/node/-/node-10.12.20.tgz#f79f959acd3422d0889bd1ead1664bd2d17cd367" 27 | integrity sha512-9spv6SklidqxevvZyOUGjZVz4QRXGu2dNaLyXIFzFYZW0AGDykzPRIUFJXTlQXyfzAucddwTcGtJNim8zqSOPA== 28 | 29 | "@types/semver@^5.5.0": 30 | version "5.5.0" 31 | resolved "https://registry.npmjs.org/@types/semver/-/semver-5.5.0.tgz#146c2a29ee7d3bae4bf2fcb274636e264c813c45" 32 | integrity sha512-41qEJgBH/TWgo5NFSvBCJ1qkoi3Q6ONSF2avrHq1LVEZfYpdHmj0y9SuTK+u9ZhG1sYQKBL1AWXKyLWP4RaUoQ== 33 | 34 | ansi-regex@^2.0.0: 35 | version "2.1.1" 36 | resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" 37 | integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= 38 | 39 | ansi-styles@^2.2.1: 40 | version "2.2.1" 41 | resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" 42 | integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= 43 | 44 | arg@^4.1.0: 45 | version "4.1.0" 46 | resolved "https://registry.npmjs.org/arg/-/arg-4.1.0.tgz#583c518199419e0037abb74062c37f8519e575f0" 47 | integrity sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg== 48 | 49 | async@0.2.x, async@~0.2.9: 50 | version "0.2.10" 51 | resolved "https://registry.npmjs.org/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1" 52 | integrity sha1-trvgsGdLnXGXCMo43owjfLUmw9E= 53 | 54 | balanced-match@^1.0.0: 55 | version "1.0.0" 56 | resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" 57 | integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= 58 | 59 | brace-expansion@^1.1.7: 60 | version "1.1.11" 61 | resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" 62 | integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== 63 | dependencies: 64 | balanced-match "^1.0.0" 65 | concat-map "0.0.1" 66 | 67 | buffer-from@^1.0.0: 68 | version "1.1.1" 69 | resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" 70 | integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== 71 | 72 | chalk@^1.1.1: 73 | version "1.1.3" 74 | resolved "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" 75 | integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= 76 | dependencies: 77 | ansi-styles "^2.2.1" 78 | escape-string-regexp "^1.0.2" 79 | has-ansi "^2.0.0" 80 | strip-ansi "^3.0.0" 81 | supports-color "^2.0.0" 82 | 83 | colors@0.6.x: 84 | version "0.6.2" 85 | resolved "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz#2423fe6678ac0c5dae8852e5d0e5be08c997abcc" 86 | integrity sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w= 87 | 88 | colors@^1.3.3: 89 | version "1.3.3" 90 | resolved "https://registry.npmjs.org/colors/-/colors-1.3.3.tgz#39e005d546afe01e01f9c4ca8fa50f686a01205d" 91 | integrity sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg== 92 | 93 | concat-map@0.0.1: 94 | version "0.0.1" 95 | resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" 96 | integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= 97 | 98 | cycle@1.0.x: 99 | version "1.0.3" 100 | resolved "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz#21e80b2be8580f98b468f379430662b046c34ad2" 101 | integrity sha1-IegLK+hYD5i0aPN5QwZisEbDStI= 102 | 103 | deep-equal@*: 104 | version "1.0.1" 105 | resolved "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" 106 | integrity sha1-9dJgKStmDghO/0zbyfCK0yR0SLU= 107 | 108 | diff@^3.1.0: 109 | version "3.5.0" 110 | resolved "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" 111 | integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== 112 | 113 | escape-string-regexp@^1.0.2: 114 | version "1.0.5" 115 | resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" 116 | integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= 117 | 118 | eyes@0.1.x: 119 | version "0.1.8" 120 | resolved "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" 121 | integrity sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A= 122 | 123 | fs-extra@^7.0.1: 124 | version "7.0.1" 125 | resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" 126 | integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== 127 | dependencies: 128 | graceful-fs "^4.1.2" 129 | jsonfile "^4.0.0" 130 | universalify "^0.1.0" 131 | 132 | fs.realpath@^1.0.0: 133 | version "1.0.0" 134 | resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" 135 | integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= 136 | 137 | glob@^7.1.3: 138 | version "7.1.3" 139 | resolved "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" 140 | integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== 141 | dependencies: 142 | fs.realpath "^1.0.0" 143 | inflight "^1.0.4" 144 | inherits "2" 145 | minimatch "^3.0.4" 146 | once "^1.3.0" 147 | path-is-absolute "^1.0.0" 148 | 149 | graceful-fs@^4.1.2, graceful-fs@^4.1.6: 150 | version "4.1.15" 151 | resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" 152 | integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== 153 | 154 | has-ansi@^2.0.0: 155 | version "2.0.0" 156 | resolved "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" 157 | integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= 158 | dependencies: 159 | ansi-regex "^2.0.0" 160 | 161 | i@0.3.x: 162 | version "0.3.6" 163 | resolved "https://registry.npmjs.org/i/-/i-0.3.6.tgz#d96c92732076f072711b6b10fd7d4f65ad8ee23d" 164 | integrity sha1-2WyScyB28HJxG2sQ/X1PZa2O4j0= 165 | 166 | inflight@^1.0.4: 167 | version "1.0.6" 168 | resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" 169 | integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= 170 | dependencies: 171 | once "^1.3.0" 172 | wrappy "1" 173 | 174 | inherits@2: 175 | version "2.0.3" 176 | resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" 177 | integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= 178 | 179 | isstream@0.1.x: 180 | version "0.1.2" 181 | resolved "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" 182 | integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= 183 | 184 | jsonfile@^4.0.0: 185 | version "4.0.0" 186 | resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" 187 | integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= 188 | optionalDependencies: 189 | graceful-fs "^4.1.6" 190 | 191 | make-error@^1.1.1: 192 | version "1.3.5" 193 | resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz#efe4e81f6db28cadd605c70f29c831b58ef776c8" 194 | integrity sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g== 195 | 196 | minimatch@^3.0.4: 197 | version "3.0.4" 198 | resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" 199 | integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== 200 | dependencies: 201 | brace-expansion "^1.1.7" 202 | 203 | minimist@0.0.8: 204 | version "0.0.8" 205 | resolved "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" 206 | integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= 207 | 208 | minimist@^1.2.0: 209 | version "1.2.0" 210 | resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" 211 | integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= 212 | 213 | mkdirp@0.x.x, mkdirp@^0.5.1: 214 | version "0.5.1" 215 | resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" 216 | integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= 217 | dependencies: 218 | minimist "0.0.8" 219 | 220 | mute-stream@~0.0.4: 221 | version "0.0.8" 222 | resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" 223 | integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== 224 | 225 | ncp@0.4.x: 226 | version "0.4.2" 227 | resolved "https://registry.npmjs.org/ncp/-/ncp-0.4.2.tgz#abcc6cbd3ec2ed2a729ff6e7c1fa8f01784a8574" 228 | integrity sha1-q8xsvT7C7Spyn/bnwfqPAXhKhXQ= 229 | 230 | once@^1.3.0: 231 | version "1.4.0" 232 | resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" 233 | integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= 234 | dependencies: 235 | wrappy "1" 236 | 237 | path-is-absolute@^1.0.0: 238 | version "1.0.1" 239 | resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" 240 | integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= 241 | 242 | pkginfo@0.3.x: 243 | version "0.3.1" 244 | resolved "https://registry.npmjs.org/pkginfo/-/pkginfo-0.3.1.tgz#5b29f6a81f70717142e09e765bbeab97b4f81e21" 245 | integrity sha1-Wyn2qB9wcXFC4J52W76rl7T4HiE= 246 | 247 | pkginfo@0.x.x: 248 | version "0.4.1" 249 | resolved "https://registry.npmjs.org/pkginfo/-/pkginfo-0.4.1.tgz#b5418ef0439de5425fc4995042dced14fb2a84ff" 250 | integrity sha1-tUGO8EOd5UJfxJlQQtztFPsqhP8= 251 | 252 | prompt@^0.2.14: 253 | version "0.2.14" 254 | resolved "https://registry.npmjs.org/prompt/-/prompt-0.2.14.tgz#57754f64f543fd7b0845707c818ece618f05ffdc" 255 | integrity sha1-V3VPZPVD/XsIRXB8gY7OYY8F/9w= 256 | dependencies: 257 | pkginfo "0.x.x" 258 | read "1.0.x" 259 | revalidator "0.1.x" 260 | utile "0.2.x" 261 | winston "0.8.x" 262 | 263 | react-native-cli@^2.0.1: 264 | version "2.0.1" 265 | resolved "https://registry.npmjs.org/react-native-cli/-/react-native-cli-2.0.1.tgz#f2cd3c7aa1b83828cdfba630e2dfd817df766d54" 266 | integrity sha1-8s08eqG4OCjN+6Yw4t/YF992bVQ= 267 | dependencies: 268 | chalk "^1.1.1" 269 | minimist "^1.2.0" 270 | prompt "^0.2.14" 271 | semver "^5.0.3" 272 | 273 | read@1.0.x: 274 | version "1.0.7" 275 | resolved "https://registry.npmjs.org/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4" 276 | integrity sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ= 277 | dependencies: 278 | mute-stream "~0.0.4" 279 | 280 | revalidator@0.1.x: 281 | version "0.1.8" 282 | resolved "https://registry.npmjs.org/revalidator/-/revalidator-0.1.8.tgz#fece61bfa0c1b52a206bd6b18198184bdd523a3b" 283 | integrity sha1-/s5hv6DBtSoga9axgZgYS91SOjs= 284 | 285 | rimraf@2.x.x: 286 | version "2.6.3" 287 | resolved "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" 288 | integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== 289 | dependencies: 290 | glob "^7.1.3" 291 | 292 | semver@^5.0.3, semver@^5.6.0: 293 | version "5.6.0" 294 | resolved "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" 295 | integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== 296 | 297 | source-map-support@^0.5.6: 298 | version "0.5.10" 299 | resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.10.tgz#2214080bc9d51832511ee2bab96e3c2f9353120c" 300 | integrity sha512-YfQ3tQFTK/yzlGJuX8pTwa4tifQj4QS2Mj7UegOu8jAz59MqIiMGPXxQhVQiIMNzayuUSF/jEuVnfFF5JqybmQ== 301 | dependencies: 302 | buffer-from "^1.0.0" 303 | source-map "^0.6.0" 304 | 305 | source-map@^0.6.0: 306 | version "0.6.1" 307 | resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" 308 | integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== 309 | 310 | stack-trace@0.0.x: 311 | version "0.0.10" 312 | resolved "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" 313 | integrity sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA= 314 | 315 | strip-ansi@^3.0.0: 316 | version "3.0.1" 317 | resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" 318 | integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= 319 | dependencies: 320 | ansi-regex "^2.0.0" 321 | 322 | supports-color@^2.0.0: 323 | version "2.0.0" 324 | resolved "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" 325 | integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= 326 | 327 | ts-node@^8.0.2: 328 | version "8.0.2" 329 | resolved "https://registry.npmjs.org/ts-node/-/ts-node-8.0.2.tgz#9ecdf8d782a0ca4c80d1d641cbb236af4ac1b756" 330 | integrity sha512-MosTrinKmaAcWgO8tqMjMJB22h+sp3Rd1i4fdoWY4mhBDekOwIAKI/bzmRi7IcbCmjquccYg2gcF6NBkLgr0Tw== 331 | dependencies: 332 | arg "^4.1.0" 333 | diff "^3.1.0" 334 | make-error "^1.1.1" 335 | source-map-support "^0.5.6" 336 | yn "^3.0.0" 337 | 338 | tslib@^1.9.3: 339 | version "1.9.3" 340 | resolved "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" 341 | integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== 342 | 343 | typescript@^3.2.4: 344 | version "3.2.4" 345 | resolved "https://registry.npmjs.org/typescript/-/typescript-3.2.4.tgz#c585cb952912263d915b462726ce244ba510ef3d" 346 | integrity sha512-0RNDbSdEokBeEAkgNbxJ+BLwSManFy9TeXz8uW+48j/xhEXv1ePME60olyzw2XzUqUBNAYFeJadIqAgNqIACwg== 347 | 348 | universalify@^0.1.0: 349 | version "0.1.2" 350 | resolved "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" 351 | integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== 352 | 353 | utile@0.2.x: 354 | version "0.2.1" 355 | resolved "https://registry.npmjs.org/utile/-/utile-0.2.1.tgz#930c88e99098d6220834c356cbd9a770522d90d7" 356 | integrity sha1-kwyI6ZCY1iIINMNWy9mncFItkNc= 357 | dependencies: 358 | async "~0.2.9" 359 | deep-equal "*" 360 | i "0.3.x" 361 | mkdirp "0.x.x" 362 | ncp "0.4.x" 363 | rimraf "2.x.x" 364 | 365 | winston@0.8.x: 366 | version "0.8.3" 367 | resolved "https://registry.npmjs.org/winston/-/winston-0.8.3.tgz#64b6abf4cd01adcaefd5009393b1d8e8bec19db0" 368 | integrity sha1-ZLar9M0Brcrv1QCTk7HY6L7BnbA= 369 | dependencies: 370 | async "0.2.x" 371 | colors "0.6.x" 372 | cycle "1.0.x" 373 | eyes "0.1.x" 374 | isstream "0.1.x" 375 | pkginfo "0.3.x" 376 | stack-trace "0.0.x" 377 | 378 | wrappy@1: 379 | version "1.0.2" 380 | resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" 381 | integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= 382 | 383 | yn@^3.0.0: 384 | version "3.0.0" 385 | resolved "https://registry.npmjs.org/yn/-/yn-3.0.0.tgz#0073c6b56e92aed652fbdfd62431f2d6b9a7a091" 386 | integrity sha512-+Wo/p5VRfxUgBUGy2j/6KX2mj9AYJWOHuhMjMcbBFc3y54o9/4buK1ksBvuiK01C3kby8DH9lSmJdSxw+4G/2Q== 387 | --------------------------------------------------------------------------------