├── .eslintrc ├── .gitignore ├── .npmignore ├── .prettierrc ├── README.md ├── cli ├── commands │ ├── addPlatform.js │ ├── init │ │ ├── handleFound.js │ │ ├── handleNotFound.js │ │ └── index.js │ └── list.js ├── console │ ├── fixedWidthCell.js │ ├── horizontalLine.js │ ├── log.js │ ├── newLine.js │ ├── packageName.js │ └── platformCommand.js ├── data │ ├── starters.js │ └── uilibraries.js ├── index.js ├── interactive │ ├── getName.js │ ├── getPlatform.js │ ├── getPlatforms.js │ └── getUILibrary.js ├── lib │ ├── addUILibrary.js │ ├── createPackageJson.js │ ├── findPlatform.js │ ├── findStarter.js │ ├── findUILibrary.js │ ├── handleFolderExists.js │ └── removePlatformFolder.js └── utils │ ├── capitalize.js │ ├── convertShorthand.js │ └── folderExists.js ├── media ├── add-platform.gif ├── folders-described.png ├── folders.png ├── init-final.gif ├── init-name.gif └── list.gif ├── package-lock.json ├── package.json ├── site ├── package-lock.json ├── package.json ├── src │ ├── App.js │ ├── Components │ │ ├── CLICard.js │ │ ├── Header.js │ │ ├── HeaderLink.js │ │ ├── MCIconButton.js │ │ └── PlatformButton.js │ ├── Pages │ │ ├── About.js │ │ ├── CLI.js │ │ ├── Home.js │ │ ├── Interactive.js │ │ └── NotFound.js │ ├── Router.js │ ├── index.html │ └── index.js ├── static │ ├── _redirects │ ├── images │ │ ├── android.svg │ │ ├── apple.svg │ │ ├── chrome.svg │ │ ├── edge.svg │ │ ├── firefox.svg │ │ ├── github.svg │ │ ├── linux.png │ │ ├── linux.svg │ │ ├── macos2.svg │ │ ├── material-bread.svg │ │ ├── safari.svg │ │ ├── ui-kitten.png │ │ └── windows.svg │ ├── js │ │ ├── OrbitControls.js │ │ └── skybox.js │ ├── skybox │ │ ├── purplenebula_bk.png │ │ ├── purplenebula_dn.png │ │ ├── purplenebula_ft.png │ │ ├── purplenebula_lf.png │ │ ├── purplenebula_rt.png │ │ └── purplenebula_up.png │ └── styles │ │ └── global.css └── webpack.config.js └── starters ├── core ├── app.json ├── babel.config.js ├── index.js ├── metro.config.js └── src │ └── App.js ├── infinity ├── android │ ├── app │ │ ├── BUCK │ │ ├── build.gradle │ │ ├── build_defs.bzl │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── awesomeproject │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── keystores │ │ ├── BUCK │ │ └── debug.keystore.properties │ └── settings.gradle ├── app.json ├── babel.config.js ├── electron │ ├── .babelrc │ ├── index.html │ ├── main.js │ ├── renderer.js │ └── webpack.config.js ├── index.js ├── ios │ ├── AwesomeProject-tvOS │ │ └── Info.plist │ ├── AwesomeProject-tvOSTests │ │ └── Info.plist │ ├── AwesomeProject.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ ├── AwesomeProject-tvOS.xcscheme │ │ │ └── AwesomeProject.xcscheme │ ├── AwesomeProject │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m │ └── AwesomeProjectTests │ │ ├── AwesomeProjectTests.m │ │ └── Info.plist ├── metro.config.js ├── package-lock.json ├── package.json ├── src │ └── App.js └── web │ ├── index.html │ ├── index.js │ └── webpack.config.js ├── packagejson ├── core.json ├── electron.json ├── macos.json ├── mobile.json ├── web.json └── windows.json ├── platforms ├── android │ ├── app │ │ ├── BUCK │ │ ├── build.gradle │ │ ├── build_defs.bzl │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── awesomeproject │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── keystores │ │ ├── BUCK │ │ └── debug.keystore.properties │ └── settings.gradle ├── electron │ ├── .babelrc │ ├── index.html │ ├── main.js │ ├── renderer.js │ └── webpack.config.js ├── ios │ ├── AwesomeProject-tvOS │ │ └── Info.plist │ ├── AwesomeProject-tvOSTests │ │ └── Info.plist │ ├── AwesomeProject.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ ├── AwesomeProject-tvOS.xcscheme │ │ │ └── AwesomeProject.xcscheme │ ├── AwesomeProject │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m │ └── AwesomeProjectTests │ │ ├── AwesomeProjectTests.m │ │ └── Info.plist ├── macos │ ├── .babelrc │ ├── MacTest-tvOS │ │ └── Info.plist │ ├── MacTest-tvOSTests │ │ └── Info.plist │ ├── MacTest.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ ├── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ └── xcuserdata │ │ │ │ ├── codypearce.xcuserdatad │ │ │ │ └── UserInterfaceState.xcuserstate │ │ │ │ └── ptmt.xcuserdatad │ │ │ │ └── UserInterfaceState.xcuserstate │ │ ├── xcshareddata │ │ │ └── xcschemes │ │ │ │ ├── MacTest-tvOS.xcscheme │ │ │ │ └── MacTest.xcscheme │ │ └── xcuserdata │ │ │ ├── codypearce.xcuserdatad │ │ │ └── xcschemes │ │ │ │ └── xcschememanagement.plist │ │ │ └── ptmt.xcuserdatad │ │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ ├── MacTest │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Images.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m │ ├── MacTestTests │ │ ├── Info.plist │ │ └── MacTestTests.m │ ├── index.js │ └── rn-cli.config.js └── web │ ├── index.html │ ├── index.js │ └── webpack.config.js └── uilibrary ├── material-bread ├── electron │ ├── renderer.js │ └── webpack.config.js ├── packagejson │ ├── core.json │ ├── electron.json │ └── web.json ├── src │ └── App.js └── web │ ├── index.js │ └── webpack.config.js └── ui-kitten ├── electron └── webpack.config.js ├── packagejson └── core.json ├── src └── App.js └── web └── webpack.config.js /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "node": true, 4 | "browser": true, 5 | "es6": true, 6 | "jest": true 7 | }, 8 | "extends": ["eslint:recommended", "plugin:prettier/recommended"], 9 | "parser": "babel-eslint", 10 | "rules": { 11 | "no-useless-constructor": 0, 12 | "import/no-extraneous-dependencies": 0, 13 | "import/named": 1, 14 | "import/no-unresolved": 1, 15 | "react/display-name": 0, 16 | "react/no-typos": 0, 17 | "no-console": 0 18 | }, 19 | "plugins": ["prettier", "import", "react"], 20 | "settings": { 21 | "import/resolver": { 22 | "node": { 23 | "extensions": [".js", ".ios.js", ".android.js", ".web.js", ".native.js"] 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | starters/**/build 4 | starters/**/Index 5 | site/dist 6 | site/gh -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | src/DS_Store 5 | *.DS_Store 6 | # Xcode 7 | # 8 | build/ 9 | *.pbxuser 10 | !default.pbxuser 11 | *.mode1v3 12 | !default.mode1v3 13 | *.mode2v3 14 | !default.mode2v3 15 | *.perspectivev3 16 | !default.perspectivev3 17 | xcuserdata 18 | *.xccheckout 19 | *.moved-aside 20 | DerivedData 21 | *.hmap 22 | *.ipa 23 | *.xcuserstate 24 | project.xcworkspace 25 | 26 | # Android/IntelliJ 27 | # 28 | build/ 29 | .idea 30 | .gradle 31 | local.properties 32 | *.iml 33 | 34 | # node.js 35 | # 36 | node_modules/ 37 | npm-debug.log 38 | yarn-error.log 39 | 40 | # BUCK 41 | buck-out/ 42 | \.buckd/ 43 | *.keystore 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://docs.fastlane.tools/best-practices/source-control/ 51 | 52 | */fastlane/report.xml 53 | */fastlane/Preview.html 54 | */fastlane/screenshots 55 | 56 | # Bundle artifact 57 | *.jsbundle 58 | node_modules/**/* 59 | npm-debug.* 60 | *.jks 61 | *.p12 62 | *.key 63 | *.mobileprovision 64 | site 65 | gh/**/* 66 | jest-test-results.json 67 | .jest-test-results.json 68 | 69 | 70 | docs/**/* 71 | 72 | __tests__ 73 | .git 74 | docker 75 | public 76 | storybook 77 | .buckconfig 78 | .eslintrc 79 | .flowconfig 80 | .gitattributes 81 | .gitignore 82 | .prettierrc 83 | .travis.yml 84 | package-lock.json 85 | yarn.lock 86 | src/**/*.test.js 87 | node_modules 88 | media/**/** 89 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all", 4 | "bracketSpacing": true, 5 | "jsxBracketSameLine": true 6 | } 7 | -------------------------------------------------------------------------------- /cli/commands/addPlatform.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs-extra'); 2 | const path = require('path'); 3 | const merge = require('merge-package-json'); 4 | const chalk = require('chalk'); 5 | 6 | module.exports = function addPlatform(value) { 7 | const platform = findPlatform(value); 8 | 9 | if (!platform) { 10 | getPlatform(); 11 | return; 12 | } 13 | 14 | let addedSoFar = []; 15 | 16 | if (platform == 'mobile') { 17 | console.log(chalk.cyan('Setting up iOS')); 18 | 19 | if (handleFolderExists('./ios/', 'ios', addedSoFar)) return; 20 | fs.copySync( 21 | path.resolve(__dirname, `../../starters/platforms/ios/.`), 22 | `./ios/`, 23 | ); 24 | addedSoFar.push('ios'); 25 | 26 | console.log(chalk.cyan('Setting up Android')); 27 | if (handleFolderExists('./android/', 'android', addedSoFar)) return; 28 | fs.copySync( 29 | path.resolve(__dirname, `../../starters/platforms/android/.`), 30 | `./android/`, 31 | ); 32 | addedSoFar.push('android'); 33 | } else if (platform == 'windows') { 34 | // No windows files 35 | } else { 36 | const lowerPlatform = platform.toLowerCase(); 37 | console.log(chalk.cyan(`Setting up ${platform}`)); 38 | if (handleFolderExists(`./${lowerPlatform}/`, lowerPlatform, addedSoFar)) 39 | return; 40 | fs.copySync( 41 | path.resolve(__dirname, `../../starters/platforms/${lowerPlatform}/.`), 42 | `${lowerPlatform}/`, 43 | ); 44 | addedSoFar.push(lowerPlatform); 45 | } 46 | 47 | newLine(1); 48 | console.log(chalk.cyan(`Merging Package.json`)); 49 | const pathToCurrent = path.resolve(`./package.json`); 50 | 51 | let currentPackageJSON; 52 | 53 | try { 54 | currentPackageJSON = fs.readFileSync(pathToCurrent); 55 | } catch (err) { 56 | // Remove Created Folders 57 | removePlatformFolder(addedSoFar); 58 | log.error( 59 | `Cannnot find your project's package.json, you must be at the root of your current RN project.`, 60 | ); 61 | 62 | newLine(1); 63 | 64 | return; 65 | } 66 | let newPackage = currentPackageJSON; 67 | const directory = '../../starters/packagejson/'; 68 | 69 | const corePath = path.resolve(__dirname, `${directory}/core.json`); 70 | const coreJSON = fs.readFileSync(corePath); 71 | newPackage = merge(newPackage, coreJSON); 72 | 73 | const pathToPlatformJSON = path.resolve( 74 | __dirname, 75 | `${directory}/${platform.toLowerCase()}.json`, 76 | ); 77 | const platformJSON = fs.readFileSync(pathToPlatformJSON); 78 | 79 | newPackage = merge(newPackage, platformJSON); 80 | fs.writeFileSync(`./package.json`, newPackage); 81 | 82 | newLine(1); 83 | 84 | packagename(); 85 | horizontalLine(1); 86 | 87 | console.log(chalk.cyan('Get started:')); 88 | console.log(chalk.cyan('1.'), chalk.blue.bold('npm i')); 89 | 90 | if (platform == 'windows') { 91 | console.log( 92 | chalk.cyan( 93 | 'Windows Final Step:', 94 | chalk.blue.bold(`react-native windows`), 95 | ), 96 | ); 97 | } 98 | 99 | newLine(1); 100 | console.log( 101 | chalk.cyan( 102 | "Finally run the command for the platform(s) you'd like to render to:", 103 | ), 104 | ); 105 | 106 | platformCommand(platform); 107 | 108 | newLine(1); 109 | horizontalLine(1); 110 | console.log( 111 | 'Please visit the documentation for more information: https://github.com/codypearce/react-native-infinity', 112 | ); 113 | horizontalLine(1); 114 | newLine(1); 115 | }; 116 | 117 | // Avoid Circular Dependency 118 | const findPlatform = require('../lib/findPlatform'); 119 | const newLine = require('../console/newLine'); 120 | const horizontalLine = require('../console/horizontalLine'); 121 | const packagename = require('../console/packageName'); 122 | const platformCommand = require('../console/platformCommand'); 123 | const getPlatform = require('../interactive/getPlatform'); 124 | const handleFolderExists = require('../lib/handleFolderExists'); 125 | const removePlatformFolder = require('../lib/removePlatformFolder'); 126 | const log = require('../console/log'); 127 | -------------------------------------------------------------------------------- /cli/commands/init/handleFound.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs-extra'); 2 | const path = require('path'); 3 | const chalk = require('chalk'); 4 | const newLine = require('../../console/newLine'); 5 | const horizontalLine = require('../../console/horizontalLine'); 6 | const packagename = require('../../console/packageName'); 7 | const platformCommand = require('../../console/platformCommand'); 8 | const createPackageJson = require('../../lib/createPackageJson'); 9 | const handleFolderExists = require('../../lib/handleFolderExists'); 10 | const addUILibrary = require('../../lib/addUILibrary'); 11 | const log = require('../../console/log'); 12 | 13 | function handleFound(starter, platforms, name, uilibrary) { 14 | if (handleFolderExists(`./${name}/`, name, [])) return; 15 | 16 | // Copy Core logic 17 | console.log(chalk.cyan('Setting up Core')); 18 | try { 19 | fs.copySync(path.resolve(__dirname, `../../../starters/core/.`), name); 20 | } catch (err) { 21 | log.error(`Core Error: ${err}`); 22 | } 23 | 24 | // Copy Platform logic 25 | const arr = platforms.split(' '); 26 | arr.forEach(platform => { 27 | const lowerPlatform = platform.toLowerCase(); 28 | if (lowerPlatform == 'mobile') { 29 | console.log(chalk.cyan('Setting up iOS')); 30 | try { 31 | fs.copySync( 32 | path.resolve(__dirname, `../../../starters/platforms/ios/.`), 33 | `${name}/ios/`, 34 | ); 35 | } catch (err) { 36 | log.error(`ios Error: ${err}`); 37 | } 38 | 39 | console.log(chalk.cyan('Setting up Android')); 40 | fs.copySync( 41 | path.resolve(__dirname, `../../../starters/platforms/android/.`), 42 | `${name}/android/`, 43 | ); 44 | } else if (lowerPlatform == 'windows') { 45 | // No windows files 46 | return; 47 | } else { 48 | console.log(chalk.cyan(`Setting up ${platform}`)); 49 | fs.copySync( 50 | path.resolve( 51 | __dirname, 52 | `../../../starters/platforms/${lowerPlatform}/.`, 53 | ), 54 | `${name}/${lowerPlatform}/`, 55 | ); 56 | } 57 | }); 58 | 59 | // Copy and Merge JSON 60 | console.log(chalk.cyan(`Merging Package.json`)); 61 | const packageJson = createPackageJson(arr); 62 | fs.writeFileSync(`${name}/package.json`, packageJson); 63 | 64 | // UI Library 65 | 66 | if (uilibrary !== 'None') { 67 | addUILibrary(uilibrary, arr, name); 68 | } 69 | 70 | newLine(1); 71 | packagename(); 72 | horizontalLine(1); 73 | console.log(chalk.cyan('Get started:')); 74 | console.log(chalk.cyan('1.'), chalk.blue.bold(`cd ${name}`)); 75 | console.log(chalk.cyan('2.'), chalk.blue.bold('npm i')); 76 | const platformArr = platforms.split(' '); 77 | 78 | if (platformArr.includes('Mobile') || platformArr.includes('Macos')) { 79 | console.log( 80 | chalk.cyan('3.'), 81 | chalk.blue.bold(`npx react-native-rename ${name}`), 82 | ); 83 | } 84 | 85 | if (uilibrary == 'm' && platformArr.find(item => item == 'Mobile')) { 86 | console.log( 87 | chalk.cyan( 88 | 'Vector Icons Extra:', 89 | chalk.blue.bold( 90 | `Follow instructions for Android and iOS: https://github.com/oblador/react-native-vector-icons`, 91 | ), 92 | ), 93 | ); 94 | } 95 | 96 | if (platformArr.find(item => item == 'Windows')) { 97 | console.log( 98 | chalk.cyan( 99 | 'Windows Final Step:', 100 | chalk.blue.bold(`react-native windows`), 101 | ), 102 | ); 103 | } 104 | 105 | newLine(1); 106 | console.log( 107 | chalk.cyan( 108 | "Finally run the command for the platform(s) you'd like to render to:", 109 | ), 110 | ); 111 | 112 | platformArr.map(item => { 113 | platformCommand(item); 114 | }); 115 | 116 | newLine(1); 117 | horizontalLine(1); 118 | console.log( 119 | 'Please visit the documentation for more information: https://github.com/codypearce/react-native-infinity', 120 | ); 121 | horizontalLine(1); 122 | newLine(1); 123 | } 124 | 125 | module.exports = handleFound; 126 | -------------------------------------------------------------------------------- /cli/commands/init/handleNotFound.js: -------------------------------------------------------------------------------- 1 | const chalk = require('chalk'); 2 | const newLine = require('../../console/newLine'); 3 | const packagename = require('../../console/packageName'); 4 | const getPlatforms = require('../../interactive/getPlatforms'); 5 | const log = require('../../console/log'); 6 | 7 | function handleNotFound(name, starter) { 8 | newLine(1); 9 | packagename(); 10 | newLine(2); 11 | log.error(`Cannnot find starter: ${chalk.blue.bold(starter)}`); 12 | newLine(1); 13 | console.log(chalk.cyan('Please select platforms below:')); 14 | getPlatforms(name); 15 | return; 16 | } 17 | 18 | module.exports = handleNotFound; 19 | -------------------------------------------------------------------------------- /cli/commands/init/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function init(name, options) { 2 | const { starter, platforms } = findStarter(options.starter); 3 | if (starter) { 4 | handleFound(starter, platforms, name, options.uilibrary); 5 | } else { 6 | handleNotFound(name, options.starter); 7 | } 8 | }; 9 | 10 | // Avoid Circular Dependency 11 | const findStarter = require('../../lib/findStarter'); 12 | const handleFound = require('./handleFound'); 13 | const handleNotFound = require('./handleNotFound'); 14 | -------------------------------------------------------------------------------- /cli/commands/list.js: -------------------------------------------------------------------------------- 1 | const starters = require('../data/starters'); 2 | const chalk = require('chalk'); 3 | const newLine = require('../console/newLine'); 4 | const horizontalLine = require('../console/horizontalLine'); 5 | const fixedWidthCell = require('../console/fixedWidthCell'); 6 | const packagename = require('../console/packageName'); 7 | 8 | function list() { 9 | newLine(1); 10 | packagename(); 11 | newLine(1); 12 | console.log('All possible Platform combos'); 13 | 14 | horizontalLine(1); 15 | newLine(1); 16 | console.log( 17 | `${chalk.blue(fixedWidthCell(14, 'Shorthand'))} ${chalk.cyan( 18 | fixedWidthCell(19, 'Platforms'), 19 | )} `, 20 | ); 21 | newLine(1); 22 | 23 | for (let i = 0; i < starters.shorthand.length; i++) { 24 | console.log( 25 | chalk.blue(fixedWidthCell(14, starters.shorthand[i])), 26 | chalk.cyan(fixedWidthCell(50, starters.longhandSeparated[i])), 27 | ); 28 | } 29 | 30 | newLine(2); 31 | 32 | console.log( 33 | 'Usage:', 34 | chalk.blue.bold('react-native-infinity init AwesomeProject -s mwe'), 35 | ); 36 | newLine(1); 37 | console.log( 38 | 'This will create a new project that is set up to render to Mobile, Web, and Electron with the name AwesomeProject', 39 | ); 40 | newLine(1); 41 | console.log( 42 | 'You can also use the interactive CLI by not passing anything in, npx react-native-infinity init', 43 | ); 44 | newLine(1); 45 | } 46 | 47 | module.exports = list; 48 | -------------------------------------------------------------------------------- /cli/console/fixedWidthCell.js: -------------------------------------------------------------------------------- 1 | function fixedWidthCell(len, str) { 2 | const difference = len - str.length; 3 | 4 | return str + Array(difference).join(' '); 5 | } 6 | 7 | module.exports = fixedWidthCell; 8 | -------------------------------------------------------------------------------- /cli/console/horizontalLine.js: -------------------------------------------------------------------------------- 1 | function horizontalLine(number) { 2 | for (let i = 0; i < number; i++) { 3 | console.log('----------------------------------------------------------'); 4 | } 5 | return; 6 | } 7 | 8 | module.exports = horizontalLine; 9 | -------------------------------------------------------------------------------- /cli/console/log.js: -------------------------------------------------------------------------------- 1 | const chalk = require('chalk'); 2 | 3 | const log = {}; 4 | 5 | log.error = function(text) { 6 | return console.log(`${chalk.red.bold('ERROR')}: ${text}`); 7 | }; 8 | 9 | module.exports = log; 10 | -------------------------------------------------------------------------------- /cli/console/newLine.js: -------------------------------------------------------------------------------- 1 | function newLine(number) { 2 | for (let i = 0; i < number; i++) { 3 | console.log(''); 4 | } 5 | return; 6 | } 7 | 8 | module.exports = newLine; 9 | -------------------------------------------------------------------------------- /cli/console/packageName.js: -------------------------------------------------------------------------------- 1 | const chalk = require('chalk'); 2 | 3 | function packageName() { 4 | const name = ['REACT', 'NATIVE', 'INFINITY']; 5 | const colors = [ 6 | '#2ecc71', 7 | '#3498db', 8 | '#8e44ad', 9 | '#f1c40f', 10 | '#e67e22', 11 | '#e74c3c', 12 | '#1abc9c', 13 | '#2980b9', 14 | '#d35400', 15 | ]; 16 | let display = ''; 17 | 18 | for (let i = 0; i < name.length; i++) { 19 | for (let j = 0; j < name[i].length; j++) { 20 | display += chalk.hex(colors[j]).bold(name[i][j]); 21 | if (j !== name[i].length - 1) { 22 | display += chalk(' '); 23 | } 24 | } 25 | if (i !== name.length - 1) { 26 | display += chalk(' '); 27 | } 28 | } 29 | console.log(display); 30 | return; 31 | } 32 | 33 | module.exports = packageName; 34 | -------------------------------------------------------------------------------- /cli/console/platformCommand.js: -------------------------------------------------------------------------------- 1 | const chalk = require('chalk'); 2 | const fixedWidthCell = require('./fixedWidthCell'); 3 | const newLine = require('./newLine'); 4 | const capitalize = require('../utils/capitalize'); 5 | 6 | function platformCommand(platform) { 7 | platform = platform.toLowerCase(); 8 | 9 | if (platform == 'mobile') { 10 | const ios = chalk.cyan(fixedWidthCell(10, 'iOS:')); 11 | const android = chalk.cyan(fixedWidthCell(10, 'Android:')); 12 | 13 | console.log(' ', ios + npmCommand('ios')); 14 | console.log(' ', android + npmCommand('android')); 15 | } else if (platform == 'electron') { 16 | const platformName = chalk.cyan( 17 | fixedWidthCell(10, capitalize(platform + ':')), 18 | ); 19 | console.log(' ', platformName + npmCommand(platform)); 20 | console.log(' ', fixedWidthCell(10, '') + npmCommand('server')); 21 | } else if (platform == 'macos') { 22 | const platformName = chalk.cyan( 23 | fixedWidthCell(10, capitalize(platform + ':')), 24 | ); 25 | 26 | console.log( 27 | ' ', 28 | platformName + 29 | ` Open ${chalk.cyan( 30 | 'macos/MacTest.xcodeproj', 31 | )} in Xcode and click ${chalk.blue.bold('Run')}`, 32 | ); 33 | 34 | console.log(' ', fixedWidthCell(10, '') + npmCommand(platform)); 35 | 36 | console.log( 37 | ' ', 38 | fixedWidthCell(10, ' ') + 39 | ' Please visit react-native-macos docs for more information https://github.com/ptmt/react-native-macos', 40 | ); 41 | newLine(1); 42 | } else if (platform == 'windows') { 43 | const platformName = chalk.cyan( 44 | fixedWidthCell(10, capitalize(platform + ':')), 45 | ); 46 | 47 | console.log(' ', platformName + npmCommand(platform)); 48 | 49 | console.log( 50 | ' ', 51 | fixedWidthCell(10, ' ') + 52 | ' Please visit react-native-windows docs for more information https://github.com/microsoft/react-native-windows', 53 | ); 54 | newLine(1); 55 | } else { 56 | const platformName = chalk.cyan( 57 | fixedWidthCell(10, capitalize(platform + ':')), 58 | ); 59 | console.log(' ', platformName + npmCommand(platform)); 60 | } 61 | } 62 | 63 | function npmCommand(command) { 64 | return chalk.blue.bold(` npm run ${command.toLowerCase()}`); 65 | } 66 | 67 | module.exports = platformCommand; 68 | -------------------------------------------------------------------------------- /cli/data/starters.js: -------------------------------------------------------------------------------- 1 | const platforms = ['mobile', 'web', 'electron', 'macos', 'windows']; 2 | const shortenedPlatforms = ['m', 'w', 'e', 'ma', 'wi']; 3 | 4 | const longhandSeparated = [ 5 | 'Mobile', 6 | 'Mobile Web', 7 | 'Mobile Electron', 8 | 'Mobile Macos', 9 | 'Mobile Windows', 10 | 'Mobile Web Electron', 11 | 'Mobile Web Macos', 12 | 'Mobile Web Windows', 13 | 'Mobile Web Electron Macos', 14 | 'Mobile Web Electron Windows', 15 | 'Mobile Web Macos Windows', 16 | 'Mobile Web Electron Macos Windows', 17 | 'Mobile Electron Macos', 18 | 'Mobile Electron Windows', 19 | 'Mobile Macos Windows', 20 | 21 | 'Web', 22 | 'Web Electron', 23 | 'Web Macos', 24 | 'Web Windows', 25 | 'Web Electron Macos', 26 | 'Web Electron Windows', 27 | 'Web Macos Windows', 28 | 'Web Electron Macos Windows', 29 | 30 | 'Electron', 31 | 'Electron Macos', 32 | 'Electron Windows', 33 | 'Electron Macos Windows', 34 | 35 | 'Macos', 36 | 'Macos Windows', 37 | 38 | 'Windows', 39 | ]; 40 | const shorthand = [ 41 | 'm', 42 | 'mw', 43 | 'me', 44 | 'mma', 45 | 'mwi', 46 | 'mwe', 47 | 'mwma', 48 | 'mwwi', 49 | 'mwema', 50 | 'mwewi', 51 | 'mwmawi', 52 | 'mwemawi', 53 | 'mema', 54 | 'mewi', 55 | 'mmawi', 56 | 57 | 'w', 58 | 'we', 59 | 'wma', 60 | 'wwi', 61 | 'wema', 62 | 'wewi', 63 | 'wmawi', 64 | 'wemaw', 65 | 66 | 'e', 67 | 'ema', 68 | 'ewi', 69 | 'emawi', 70 | 71 | 'ma', 72 | 'mawi', 73 | 74 | 'wi', 75 | ]; 76 | 77 | module.exports = { 78 | platforms, 79 | shortenedPlatforms, 80 | shorthand, 81 | longhandSeparated, 82 | }; 83 | -------------------------------------------------------------------------------- /cli/data/uilibraries.js: -------------------------------------------------------------------------------- 1 | const uilibraries = ['material-bread', 'ui-kitten']; 2 | const shortToLongUI = { 3 | m: { 4 | name: 'material-bread', 5 | platforms: ['web', 'electron'], 6 | }, 7 | k: { name: 'ui-kitten', platforms: [] }, 8 | }; 9 | 10 | module.exports = { 11 | uilibraries, 12 | shortToLongUI, 13 | }; 14 | -------------------------------------------------------------------------------- /cli/index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const program = require('commander'); 4 | const init = require('./commands/init/index'); 5 | const list = require('./commands/list'); 6 | const addPlatform = require('./commands/addPlatform'); 7 | 8 | const getName = require('./interactive/getName'); 9 | const getPlatforms = require('./interactive/getPlatforms'); 10 | const getUILibrary = require('./interactive/getUILibrary'); 11 | const getPlatform = require('./interactive/getPlatform'); 12 | 13 | program 14 | .command('init [name]') 15 | .alias('i') 16 | .description('Initializes project in a new directory with a name') 17 | .option('-s, --starter [template]', 'Choose a preset starter') 18 | .option('-ui, --uilibrary [uilibrary]', 'Choose ui library') 19 | .action(function(name, options) { 20 | if (!name) { 21 | getName(options); 22 | } else if (name && !options.starter) { 23 | getPlatforms(name); 24 | } else if (name && options.starter && !options.uilibrary) { 25 | getUILibrary(name, options); 26 | } else { 27 | init(name, options); 28 | } 29 | }); 30 | 31 | program 32 | .command('add-platform [platform]') 33 | .alias('ap') 34 | .description('Adds config for another platform') 35 | .action(function(platform) { 36 | if (!platform) { 37 | getPlatform(); 38 | } else { 39 | addPlatform(platform); 40 | } 41 | }); 42 | 43 | program 44 | .command('list') 45 | .alias('ls') 46 | .description('Lists possible starters') 47 | .action(function(options) { 48 | list(options); 49 | }); 50 | 51 | if (process.argv.length < 3) { 52 | program.help(); 53 | } 54 | 55 | program.parse(process.argv); 56 | -------------------------------------------------------------------------------- /cli/interactive/getName.js: -------------------------------------------------------------------------------- 1 | const { prompt } = require('enquirer'); 2 | const chalk = require('chalk'); 3 | const init = require('../commands/init/index'); 4 | const newLine = require('../console/newLine'); 5 | const getPlatforms = require('./getPlatforms'); 6 | const handleFolderExists = require('../lib/handleFolderExists'); 7 | 8 | module.exports = function getName(options) { 9 | prompt({ 10 | type: 'input', 11 | name: 'projectName', 12 | message: 'Name of the Project:', 13 | initial: 'AwesomeProject', 14 | }) 15 | .then(answers => { 16 | if ( 17 | handleFolderExists(`./${answers.projectName}/`, answers.projectName, []) 18 | ) 19 | return; 20 | 21 | if (answers.projectName && answers.projectName.trim().length < 1) { 22 | newLine(1); 23 | console.log(chalk.red.bold('Name cannot be blank or just spaces.')); 24 | newLine(1); 25 | getName(options); 26 | } else if (!options.starter) { 27 | getPlatforms(answers.projectName.trim()); 28 | } else { 29 | init(answers.projectName.trim(), options); 30 | } 31 | }) 32 | .catch(() => { 33 | return; 34 | }); 35 | }; 36 | -------------------------------------------------------------------------------- /cli/interactive/getPlatform.js: -------------------------------------------------------------------------------- 1 | module.exports = function getPlatform() { 2 | newLine(1); 3 | prompt([ 4 | { 5 | type: 'select', 6 | name: 'platform', 7 | message: 'What platform do you want to add? ', 8 | choices: [ 9 | { name: 'Mobile (Android, iOS)', value: 'mobile' }, 10 | { name: 'Web', value: 'web' }, 11 | { name: 'Electron (MacOS, Windows, Linux)', value: 'electron' }, 12 | { name: 'MacOS (react-native-macos)', value: 'macos' }, 13 | { name: 'Windows (react-native-windows)', value: 'windows' }, 14 | ], 15 | result(value) { 16 | return this.map(value); 17 | }, 18 | }, 19 | ]) 20 | .then(answers => { 21 | const platformArr = Object.values(answers.platform); 22 | const platformStr = platformArr.join(''); 23 | 24 | addPlatform(platformStr); 25 | }) 26 | .catch(() => { 27 | return; 28 | }); 29 | }; 30 | 31 | // Avoid Circular Dependency 32 | const { prompt } = require('enquirer'); 33 | const addPlatform = require('../commands/addPlatform'); 34 | const newLine = require('../console/newLine'); 35 | -------------------------------------------------------------------------------- /cli/interactive/getPlatforms.js: -------------------------------------------------------------------------------- 1 | module.exports = function getPlatforms(name) { 2 | newLine(1); 3 | prompt([ 4 | { 5 | type: 'multiselect', 6 | name: 'platforms', 7 | message: 8 | 'What platforms will your app support? (Spacebar to select, Enter to Continue)', 9 | choices: [ 10 | { name: 'Mobile (Android, iOS)', value: 'm' }, 11 | { name: 'Web', value: 'w' }, 12 | { name: 'Electron (MacOS, Windows, Linux)', value: 'e' }, 13 | { name: 'MacOS (react-native-macos)', value: 'ma' }, 14 | { name: 'Windows (react-native-windows)', value: 'wi' }, 15 | ], 16 | result(value) { 17 | return this.map(value); 18 | }, 19 | }, 20 | ]) 21 | .then(answers => { 22 | const platformArr = Object.values(answers.platforms); 23 | if (platformArr && platformArr.length < 1) { 24 | newLine(2); 25 | console.log( 26 | chalk.red.bold( 27 | 'You must choose at least one platform to support, click the spacebar to select a platform.', 28 | ), 29 | ); 30 | 31 | getPlatforms(name); 32 | return; 33 | } else { 34 | const platformString = platformArr.join(''); 35 | 36 | getUILibrary(name, { starter: platformString }); 37 | } 38 | }) 39 | .catch(() => { 40 | return; 41 | }); 42 | }; 43 | 44 | // Avoid Circular Dependency 45 | const { prompt } = require('enquirer'); 46 | const chalk = require('chalk'); 47 | 48 | const newLine = require('../console/newLine'); 49 | const getUILibrary = require('./getUILibrary'); 50 | -------------------------------------------------------------------------------- /cli/interactive/getUILibrary.js: -------------------------------------------------------------------------------- 1 | module.exports = function getUILibrary(name, options) { 2 | newLine(1); 3 | prompt([ 4 | { 5 | type: 'select', 6 | name: 'uilibrary', 7 | message: 'UI Library? ', 8 | choices: [ 9 | { name: 'None', value: '' }, 10 | { name: 'Material Bread', value: 'm' }, 11 | { name: 'UI Kitten', value: 'k' }, 12 | ], 13 | result(value) { 14 | return this.map(value); 15 | }, 16 | }, 17 | ]) 18 | .then(answers => { 19 | const arr = Object.values(answers.uilibrary); 20 | const str = arr.join(''); 21 | 22 | init(name, { starter: options.starter, uilibrary: str }); 23 | }) 24 | .catch(() => { 25 | return; 26 | }); 27 | }; 28 | 29 | // Avoid Circular Dependency 30 | const { prompt } = require('enquirer'); 31 | const init = require('../commands/init/index'); 32 | const newLine = require('../console/newLine'); 33 | -------------------------------------------------------------------------------- /cli/lib/addUILibrary.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs-extra'); 2 | const path = require('path'); 3 | const chalk = require('chalk'); 4 | const findUILibrary = require('./findUILibrary'); 5 | const folderExists = require('../utils/folderExists'); 6 | const merge = require('merge-package-json'); 7 | const log = require('../console/log'); 8 | 9 | module.exports = function addUILibrary(library, platforms, name) { 10 | const uilibrary = findUILibrary(library); 11 | 12 | if (!uilibrary) { 13 | log.error( 14 | `UI Library is either not valid or not supported. Not setting up, please Try again.`, 15 | ); 16 | return; 17 | } 18 | 19 | console.log(chalk.cyan(`Setting up ${uilibrary.name}`)); 20 | 21 | const directory = '../../starters/uilibrary/'; 22 | 23 | // Copy new Src 24 | const src = folderExists(`${__dirname}/${directory}${uilibrary.name}/src`); 25 | if (src) { 26 | fs.copySync( 27 | path.resolve(__dirname, `${directory}${uilibrary.name}/src/.`), 28 | `${name}/src/`, 29 | ); 30 | } 31 | 32 | // Find platform that exist both for the UI library and included in the setup 33 | const crossOverPlatforms = uilibrary.platforms.filter(x => { 34 | return platforms.find(item => item.toLowerCase() == x); 35 | }); 36 | 37 | // handle platform logic 38 | if (crossOverPlatforms && crossOverPlatforms.length > 0) { 39 | crossOverPlatforms.forEach(platform => { 40 | const lowerPlatform = platform.toLowerCase(); 41 | 42 | const src = folderExists( 43 | `${__dirname}/${directory}${uilibrary.name}/${lowerPlatform}`, 44 | ); 45 | 46 | if (src) { 47 | fs.copySync( 48 | path.resolve( 49 | __dirname, 50 | `${directory}${uilibrary.name}/${lowerPlatform}/.`, 51 | ), 52 | `${name}/${lowerPlatform}/`, 53 | ); 54 | } 55 | }); 56 | } 57 | 58 | // Copy and merge packagejsons 59 | 60 | const core = path.resolve( 61 | __dirname, 62 | `${directory}${uilibrary.name}/packagejson/core.json`, 63 | ); 64 | const dst = fs.readFileSync(core); 65 | let newPackage = dst; 66 | if (crossOverPlatforms && crossOverPlatforms.length > 0) { 67 | crossOverPlatforms.forEach(platform => { 68 | const lowerPlatform = platform.toLowerCase(); 69 | const platformJson = path.resolve( 70 | __dirname, 71 | `${directory}${uilibrary.name}/packagejson/${lowerPlatform}.json`, 72 | ); 73 | 74 | const dst2 = fs.readFileSync(platformJson); 75 | newPackage = merge(newPackage, dst2); 76 | }); 77 | } 78 | 79 | const main = fs.readFileSync(`./${name}/package.json`); 80 | 81 | newPackage = merge(main, newPackage); 82 | 83 | fs.writeFileSync(`${name}/package.json`, newPackage); 84 | }; 85 | -------------------------------------------------------------------------------- /cli/lib/createPackageJson.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs-extra'); 2 | const path = require('path'); 3 | const merge = require('merge-package-json'); 4 | 5 | module.exports = function(platforms) { 6 | const directory = '../../starters/packagejson/'; 7 | const core = path.resolve(__dirname, `${directory}/core.json`); 8 | const dst = fs.readFileSync(core); 9 | let newPackage = dst; 10 | 11 | platforms.forEach(platform => { 12 | const lowerPlatform = platform.toLowerCase(); 13 | const platformJson = path.resolve( 14 | __dirname, 15 | `${directory}/${lowerPlatform}.json`, 16 | ); 17 | 18 | const dst2 = fs.readFileSync(platformJson); 19 | newPackage = merge(newPackage, dst2); 20 | }); 21 | 22 | return newPackage; 23 | }; 24 | -------------------------------------------------------------------------------- /cli/lib/findPlatform.js: -------------------------------------------------------------------------------- 1 | const starters = require('../data/starters'); 2 | 3 | module.exports = function(starter) { 4 | const platform = starters.platforms.find( 5 | item => item == starter.toLowerCase(), 6 | ); 7 | 8 | return platform; 9 | }; 10 | -------------------------------------------------------------------------------- /cli/lib/findStarter.js: -------------------------------------------------------------------------------- 1 | const starters = require('../data/starters'); 2 | 3 | module.exports = function(starter) { 4 | const shorthandIndex = starters.shorthand.findIndex( 5 | item => item == starter.toLowerCase(), 6 | ); 7 | 8 | if (shorthandIndex > -1) { 9 | const platforms = starters.longhandSeparated[shorthandIndex]; 10 | const shorthandStarter = starters.shorthand[shorthandIndex]; 11 | return { starter: shorthandStarter, platforms }; 12 | } 13 | 14 | return false; 15 | }; 16 | -------------------------------------------------------------------------------- /cli/lib/findUILibrary.js: -------------------------------------------------------------------------------- 1 | const { uilibraries, shortToLongUI } = require('../data/uilibraries'); 2 | 3 | module.exports = function(uilibrary) { 4 | let found = uilibraries.find(library => library == uilibrary); 5 | 6 | if (!found) found = shortToLongUI[uilibrary]; 7 | 8 | return found; 9 | }; 10 | -------------------------------------------------------------------------------- /cli/lib/handleFolderExists.js: -------------------------------------------------------------------------------- 1 | const folderExists = require('../utils/folderExists'); 2 | const removePlatformFolder = require('./removePlatformFolder'); 3 | const log = require('../console/log'); 4 | 5 | function handleFolderExists(pathToFolder, name, platformsAdded) { 6 | const exists = folderExists(pathToFolder, name); 7 | if (exists) { 8 | log.error( 9 | `${name} folder already exists, not overwriting. Maybe ${name} is already set up? Reverting changes so far.`, 10 | ); 11 | const isArray = Array.isArray(platformsAdded); 12 | if (isArray && platformsAdded.length > 0) { 13 | platformsAdded.forEach(item => { 14 | removePlatformFolder(item); 15 | }); 16 | } else if (isArray && platformsAdded.length < 1) { 17 | return true; 18 | } else { 19 | removePlatformFolder(platformsAdded); 20 | } 21 | 22 | return true; 23 | } 24 | 25 | return false; 26 | } 27 | 28 | module.exports = handleFolderExists; 29 | -------------------------------------------------------------------------------- /cli/lib/removePlatformFolder.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs-extra'); 2 | const path = require('path'); 3 | const chalk = require('chalk'); 4 | 5 | function removePlatformFolder(platform) { 6 | if (platform && platform.toLowerCase() == 'mobile') { 7 | console.log(chalk.cyan('Removing iOS')); 8 | fs.removeSync(path.resolve(`./ios/`)); 9 | console.log(chalk.cyan('Removing Android')); 10 | fs.removeSync(path.resolve(`./android/`)); 11 | } else { 12 | console.log(chalk.cyan(`Removing ${platform}`)); 13 | fs.removeSync(path.resolve(`./${platform}/`)); 14 | } 15 | } 16 | 17 | module.exports = removePlatformFolder; 18 | -------------------------------------------------------------------------------- /cli/utils/capitalize.js: -------------------------------------------------------------------------------- 1 | function capitalize(s) { 2 | if (typeof s !== 'string') return ''; 3 | return s.charAt(0).toUpperCase() + s.slice(1); 4 | } 5 | 6 | module.exports = capitalize; 7 | -------------------------------------------------------------------------------- /cli/utils/convertShorthand.js: -------------------------------------------------------------------------------- 1 | const starters = require('../data/starters'); 2 | 3 | module.exports = function(starter) { 4 | const index = starters.shorthand.findIndex( 5 | item => item == starter.toLowerCase(), 6 | ); 7 | return starters.longhand[index]; 8 | }; 9 | -------------------------------------------------------------------------------- /cli/utils/folderExists.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs-extra'); 2 | const path = require('path'); 3 | 4 | function folderExists(pathToFolder) { 5 | try { 6 | const exists = fs.existsSync(path.resolve(pathToFolder)); 7 | 8 | return exists; 9 | } catch (err) { 10 | return false; 11 | } 12 | } 13 | 14 | module.exports = folderExists; 15 | -------------------------------------------------------------------------------- /media/add-platform.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codypearce/react-native-infinity/1df9720d5beb2ff6090d8b03bce28bc899aebe48/media/add-platform.gif -------------------------------------------------------------------------------- /media/folders-described.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codypearce/react-native-infinity/1df9720d5beb2ff6090d8b03bce28bc899aebe48/media/folders-described.png -------------------------------------------------------------------------------- /media/folders.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codypearce/react-native-infinity/1df9720d5beb2ff6090d8b03bce28bc899aebe48/media/folders.png -------------------------------------------------------------------------------- /media/init-final.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codypearce/react-native-infinity/1df9720d5beb2ff6090d8b03bce28bc899aebe48/media/init-final.gif -------------------------------------------------------------------------------- /media/init-name.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codypearce/react-native-infinity/1df9720d5beb2ff6090d8b03bce28bc899aebe48/media/init-name.gif -------------------------------------------------------------------------------- /media/list.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codypearce/react-native-infinity/1df9720d5beb2ff6090d8b03bce28bc899aebe48/media/list.gif -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-infinity", 3 | "version": "0.0.15", 4 | "scripts": { 5 | "lint": "./node_modules/.bin/eslint './cli/'", 6 | "test": "echo \"Error: no test specified\" && exit 1", 7 | "see-npm-package": "npm pack && tar -xvzf *.tgz && rm -rf package *.tgz" 8 | }, 9 | "bin": { 10 | "react-native-infinity": "./cli/index.js" 11 | }, 12 | "author": "codypearce", 13 | "dependencies": { 14 | "automerge": "^0.12.1", 15 | "chalk": "^2.4.2", 16 | "commander": "^2.20.0", 17 | "enquirer": "^2.3.1", 18 | "fs-extra": "^8.1.0", 19 | "js-combinatorics": "^0.5.4", 20 | "merge-package-json": "^0.1.3" 21 | }, 22 | "devDependencies": { 23 | "babel-eslint": "^10.0.3", 24 | "eslint": "^5.12.1", 25 | "eslint-config-prettier": "^3.6.0", 26 | "eslint-plugin-import": "^2.14.0", 27 | "eslint-plugin-prettier": "^3.0.1", 28 | "eslint-plugin-react": "^7.14.3", 29 | "husky": "^3.0.5", 30 | "prettier": "^1.18.2" 31 | }, 32 | "main": "./cli/index.js", 33 | "keywords": [ 34 | "react native", 35 | "react starter", 36 | "react templates", 37 | "all-platforms", 38 | "cross-platform" 39 | ], 40 | "description": "A React Native Starter For All Platforms", 41 | "homepage": "http://reactnativeinfinity.com/", 42 | "sideEffects": false, 43 | "repository": { 44 | "type": "git", 45 | "url": "https://github.com/codypearce/react-native-infinity.git" 46 | }, 47 | "license": "MIT", 48 | "bugs": { 49 | "url": "https://github.com/codypearce/react-native-infinity/issues" 50 | }, 51 | "husky": { 52 | "hooks": { 53 | "pre-commit": "npm run lint" 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /site/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-infinity-site", 3 | "version": "1.0.0", 4 | "description": "Doc site for react-native-infinity", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "webpack --mode production && cp -R ./static ./dist && mv ./dist/static/_redirects ./dist", 8 | "start": "webpack-dev-server --config ./webpack.config.js --mode development", 9 | "deploy-docs": "gh-pages -d gh", 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "author": "", 13 | "license": "ISC", 14 | "dependencies": { 15 | "@babel/core": "^7.4.3", 16 | "@babel/plugin-proposal-class-properties": "^7.5.5", 17 | "@babel/plugin-proposal-object-rest-spread": "^7.5.5", 18 | "@babel/plugin-transform-flow-strip-types": "^7.4.4", 19 | "@babel/plugin-transform-runtime": "^7.5.5", 20 | "@babel/preset-env": "^7.4.3", 21 | "@babel/preset-react": "^7.0.0", 22 | "@babel/runtime": "^7.5.5", 23 | "babel-loader": "^8.0.5", 24 | "babel-runtime": "^6.26.0", 25 | "file-loader": "^4.2.0", 26 | "html-loader": "^0.5.5", 27 | "html-webpack-plugin": "^3.2.0", 28 | "material-bread": "^0.2.0", 29 | "modal-enhanced-react-native-web": "^0.2.0", 30 | "react": "^16.9.0", 31 | "react-art": "^16.9.0", 32 | "react-dom": "^16.9.0", 33 | "react-native-extended-stylesheet": "^0.12.0", 34 | "react-native-svg": "^9.6.4", 35 | "react-native-web": "^0.11.7", 36 | "react-router-dom": "^5.0.1", 37 | "url-loader": "^2.1.0", 38 | "webpack": "^4.29.6", 39 | "webpack-cli": "^3.1.2", 40 | "webpack-dev-server": "^3.2.1" 41 | }, 42 | "devDependencies": { 43 | "gh-pages": "^2.1.1" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /site/src/App.js: -------------------------------------------------------------------------------- 1 | // component.jsx 2 | import React from 'react'; 3 | import ReactDOM from 'react-dom'; 4 | import EStyleSheet from 'react-native-extended-stylesheet'; 5 | import Router from './Router'; 6 | export default class App extends React.Component { 7 | render() { 8 | EStyleSheet.build({ 9 | // always call EStyleSheet.build() even if you don't use global variables! 10 | $textColor: '#0275d8', 11 | }); 12 | return ; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /site/src/Components/CLICard.js: -------------------------------------------------------------------------------- 1 | import React, { Fragment } from 'react'; 2 | import { Text, View, StyleSheet } from 'react-native'; 3 | import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons'; 4 | import { Card, Button } from 'material-bread'; 5 | 6 | export default class CLICard extends React.Component { 7 | state = { 8 | copySuccess: false, 9 | }; 10 | 11 | copyToClipboard = () => { 12 | const { appName, starter, uilibrary } = this.props; 13 | let library = ''; 14 | if (uilibrary.length > 0) { 15 | library = `--uilibrary ${uilibrary}`; 16 | } 17 | var textField = document.createElement('textarea'); 18 | textField.innerHTML = `npx react-native-infinity init ${appName} --starter ${starter} ${library}`; 19 | document.body.appendChild(textField); 20 | textField.select(); 21 | document.execCommand('copy'); 22 | textField.remove(); 23 | 24 | this.setState({ copySuccess: true }, () => { 25 | setTimeout(() => this.setState({ copySuccess: false }), 1000); 26 | }); 27 | }; 28 | 29 | renderContent() { 30 | const { appName, starter, pageWidth, uilibrary } = this.props; 31 | const { copySuccess } = this.state; 32 | let library = ''; 33 | if (uilibrary.length > 0) { 34 | library = `--uilibrary ${uilibrary}`; 35 | } 36 | return ( 37 | 38 | 39 | {`npx react-native-infinity init ${appName} --starter ${starter} ${library}`} 40 | 41 | 44 | 45 | ); 46 | } 47 | } 48 | 49 | const styles = StyleSheet.create({ 50 | cliCard: { 51 | padding: 12, 52 | marginTop: 10, 53 | backgroundColor: '#2196F3', 54 | position: 'relative', 55 | }, 56 | }); 57 | -------------------------------------------------------------------------------- /site/src/Pages/About.js: -------------------------------------------------------------------------------- 1 | // component.jsx 2 | import React from "react"; 3 | import { Text, View, StyleSheet } from "react-native"; 4 | import { Button } from "material-bread"; 5 | 6 | export default class App extends React.Component { 7 | render() { 8 | return ( 9 | 10 | React Native Infinity 11 |