├── .all-contributorsrc ├── .eslintignore ├── .eslintrc.js ├── .gh-assets ├── banner.svg └── crna.gif ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── config.yml └── workflows │ ├── size.yml │ └── test.yml ├── .gitignore ├── .prettierignore ├── .prettierrc ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── jest.config.js ├── package.json ├── src ├── __tests__ │ └── index.test.js └── index.ts ├── template └── gitignore ├── tsconfig.json └── yarn.lock /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | "README.md" 4 | ], 5 | "imageSize": 100, 6 | "commit": false, 7 | "contributors": [ 8 | { 9 | "login": "EvanBacon", 10 | "name": "Evan Bacon", 11 | "avatar_url": "https://avatars1.githubusercontent.com/u/9664363?v=4", 12 | "profile": "https://twitter.com/baconbrix", 13 | "contributions": [ 14 | "code", 15 | "doc", 16 | "design", 17 | "maintenance", 18 | "review" 19 | ] 20 | }, 21 | { 22 | "login": "brentvatne", 23 | "name": "Brent Vatne", 24 | "avatar_url": "https://avatars2.githubusercontent.com/u/90494?v=4", 25 | "profile": "https://expo.io", 26 | "contributions": [ 27 | "code", 28 | "doc", 29 | "review" 30 | ] 31 | }, 32 | { 33 | "login": "hamzahalilovic", 34 | "name": "Hamza Halilovic", 35 | "avatar_url": "https://avatars0.githubusercontent.com/u/26879042?v=4", 36 | "profile": "http://hamzah", 37 | "contributions": [ 38 | "code" 39 | ] 40 | }, 41 | { 42 | "login": "byCedric", 43 | "name": "Cedric van Putten", 44 | "avatar_url": "https://avatars2.githubusercontent.com/u/1203991?v=4", 45 | "profile": "https://bycedric.com", 46 | "contributions": [ 47 | "code" 48 | ] 49 | }, 50 | { 51 | "login": "fson", 52 | "name": "Ville Immonen", 53 | "avatar_url": "https://avatars3.githubusercontent.com/u/497214?v=4", 54 | "profile": "https://twitter.com/VilleImmonen", 55 | "contributions": [ 56 | "code", 57 | "review" 58 | ] 59 | }, 60 | { 61 | "login": "friederbluemle", 62 | "name": "Frieder Bluemle", 63 | "avatar_url": "https://avatars0.githubusercontent.com/u/743291?v=4", 64 | "profile": "https://github.com/friederbluemle", 65 | "contributions": [ 66 | "code" 67 | ] 68 | }, 69 | { 70 | "login": "kbrandwijk", 71 | "name": "Kim Brandwijk", 72 | "avatar_url": "https://avatars.githubusercontent.com/u/852069?v=4", 73 | "profile": "https://github.com/kbrandwijk", 74 | "contributions": [ 75 | "code" 76 | ] 77 | }, 78 | { 79 | "login": "srkds", 80 | "name": "Nirav", 81 | "avatar_url": "https://avatars.githubusercontent.com/u/61644078?v=4", 82 | "profile": "https://github.com/srkds", 83 | "contributions": [ 84 | "code" 85 | ] 86 | } 87 | ], 88 | "contributorsPerLine": 7, 89 | "projectName": "create-react-native-app", 90 | "projectOwner": "expo", 91 | "repoType": "github", 92 | "repoHost": "https://github.com", 93 | "skipCi": true 94 | } 95 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | # Ignore all node_modules and vendored Ruby 2 | node_modules 3 | vendor 4 | **/ts-declarations/* 5 | 6 | # Ignore build artifacts 7 | /build 8 | 9 | # Generated 10 | .expo -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: ['universe/node'], 4 | overrides: [ 5 | { 6 | files: ['**/__tests__/*'], 7 | }, 8 | ], 9 | globals: { 10 | jasmine: false, 11 | }, 12 | settings: { 13 | react: { 14 | version: '16', 15 | }, 16 | }, 17 | }; 18 | -------------------------------------------------------------------------------- /.gh-assets/banner.svg: -------------------------------------------------------------------------------- 1 | 5 | 7 | 8 |
9 | 74 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 |
221 |
222 |
223 | -------------------------------------------------------------------------------- /.gh-assets/crna.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/expo/create-react-native-app/3a7b11ee859c5c38fe09be58419e97a286a22c13/.gh-assets/crna.gif -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | blank_issues_enabled: false 3 | contact_links: 4 | - about: 'e.g. npx react-native start, react-native run-android, react-native init' 5 | name: 'CLI: react-native start' 6 | url: 'https://github.com/react-native-community/cli/issues/new/choose' 7 | - about: "e.g. import { View } from 'react-native', gradle error" 8 | name: 'Running react-native' 9 | url: 'https://github.com/facebook/react-native/issues/new/choose' 10 | - about: 'e.g. expo start, expo run:ios, expo init' 11 | name: 'CLI: expo start' 12 | url: 'https://github.com/expo/expo-cli/issues/new/choose' 13 | - about: 'e.g. Expo Go failing to connect on Windows' 14 | name: 'Expo Go app' 15 | url: 'https://github.com/expo/expo/issues/new/choose' 16 | - about: 'e.g. example fails to run' 17 | name: 'Template issues' 18 | url: 'https://github.com/expo/examples/issues/new/choose' 19 | -------------------------------------------------------------------------------- /.github/workflows/size.yml: -------------------------------------------------------------------------------- 1 | name: 'Size' 2 | 3 | on: 4 | pull_request: 5 | types: [synchronize, opened] 6 | 7 | jobs: 8 | size: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v2 12 | with: 13 | fetch-depth: 1 14 | - uses: preactjs/compressed-size-action@v2 15 | continue-on-error: true 16 | with: 17 | repo-token: '${{ secrets.GITHUB_TOKEN }}' 18 | pattern: '**/build/*.js' 19 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: 'Test' 2 | 3 | on: 4 | pull_request: 5 | types: [synchronize, opened] 6 | 7 | jobs: 8 | test: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v2 12 | with: 13 | fetch-depth: 1 14 | - run: yarn 15 | - run: yarn build 16 | - run: yarn test 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | .expo 4 | .eslintcache 5 | .tags* 6 | .git-crypt-key 7 | .npm-cache 8 | *~ 9 | *.log 10 | .vscode 11 | .idea/* 12 | *.swp 13 | *.swo 14 | *.tsbuildinfo 15 | .history 16 | 17 | coverage/ 18 | 19 | build/ -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # Ignore all node_modules 2 | 3 | **/node_modules/** 4 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 100, 3 | "tabWidth": 2, 4 | "singleQuote": true, 5 | "jsxBracketSameLine": true, 6 | "trailingComma": "es5" 7 | } 8 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## Unpublished 4 | 5 | ### 🐛 Bug fixes 6 | 7 | - Skip creating a git repo when inside existing repo ([#920](https://github.com/expo/create-react-native-app/pull/920) by [@byCedric](https://github.com/byCedric)) 8 | 9 | ## 3.0.0 - 2020-04-16 10 | 11 | Create React Native App is revived as a bare-bones npx package that can be used to start an opinionated bare-workflow universal React Native project. 12 | 13 | ## 2.0.1 - 2018-09-21 14 | 15 | This release merges Create React Native App with Expo CLI. 16 | 17 | - **Expo CLI is a tool based on CRNA, made by the same team** 18 | - **It has all the same features, plus some additional benefits** 19 | - **Like CRNA, Expo CLI does not require an Expo user account** 20 | - **The `create-react-native-app` command will continue to work** 21 | 22 | The separate `react-native-scripts` package is now deprecated: new projects created with `create-react-native-app` will use Expo CLI instead of `react-native-scripts`. In addition to everything provided by CRNA, Expo CLI includes these extras: 23 | 24 | - **Web-based user interface:** in addition to the CLI, there's a GUI where you can view logs, launch the app on your devices or simulators, and publish updates. 25 | - **Standalone app builds:** you can build IPA and APK packages for deploying to App Store and Play Store without using Xcode or Android Studio. 26 | - **Publishing:** you can push updates to your deployed apps and optionally publish your app to Expo.io. 27 | - **Tunnel:** your physical device doesn’t need to be in the same wi-fi as your computer to be able to develop using it. 28 | - **Optional user accounts:** logging in allows listing all your projects in development in the Expo app without having to scan any QR codes and enables additional features like standalone builds. However, just like CRNA, Expo CLI can also be used without a user account. 29 | 30 | ### Why are we bringing these two tools together? 31 | 32 | - **Just one tool to learn:** previously developers would start with CRNA and then switch to exp or XDE for additional features like standalone builds. Expo CLI is as easy to get started with as CRNA, but also supports everything previously offered by these separate tools. 33 | - **Less confusing options:** CRNA apps have always been loaded using the Expo app and able to use the Expo APIs in addition to the core React Native APIs. Users are sometimes confused about the differences between plain React Native, CRNA and Expo apps created with tools like exp or XDE. Installing the expo-cli package will make it clearer the additional functionality is provided by Expo. 34 | - **Developer experience:** Expo CLI is ahead of CRNA in terms of features and developer experience, and we’re continuously improving it. 35 | - **Maintenance:** having these two projects as separate codebases requires more maintenance and CRNA has previously falled behind because of this. A single codebase helps us keep it up to date and fix issues as fast as possible. 36 | 37 | ### Upgrading from 1.14.0 to 2.0.1 38 | 39 | All apps created with `create-react-native-app`, are compatible with Expo CLI without changes. 40 | 41 | Upgrade `react-native-scripts` to v2.0.1 with: 42 | 43 | ``` 44 | npm install --save --save-exact react-native-scripts@2.0.1 45 | ``` 46 | 47 | or 48 | 49 | ``` 50 | yarn add --exact react-native-scripts@2.0.1 51 | ``` 52 | 53 | When you run `npm start` for the first time, Expo CLI will be installed. 54 | 55 | **Because `react-native-scripts` is now a wrapper for Expo CLI, you can also follow these steps to remove it from your project and use Expo CLI directly:** 56 | 57 | 1. Replace `react-native-scripts` with `expo` in the `scripts` config in `package.json`. Example: 58 | ``` 59 | "scripts": { 60 | "start": "expo start", 61 | "eject": "expo eject", 62 | "android": "expo start --android", 63 | "ios": "expo start --ios", 64 | "test": "jest" 65 | } 66 | ``` 67 | 2. Remove `react-native-scripts` from `devDependencies`. 68 | 69 | ## 1.14.0 - 2018-04-27 70 | 71 | Update Expo SDK 27. 72 | 73 | ## 1.12.1 - 2018-03-20 74 | 75 | Update XDL to version 48.1.2. 76 | 77 | ## 1.12.0 2018-03-29 78 | 79 | ### 🎉 New features 80 | 81 | - Add command to send the app URL to your phone via email or SMS. ([2131997](https://github.com/expo/create-react-native-app/commit/2131997b4502e87234861699577590c40c64f726) by [@brentvatne](https://github.com/brentvatne)) 82 | - Add support for Yarn workspaces. ([#503](https://github.com/expo/create-react-native-app/pull/503) by [@connectdotz](https://github.com/connectdotz)) 83 | - Update XDL. 84 | 85 | ## 1.11.1 - 2018-01-26 86 | 87 | ### 🎉 New features 88 | 89 | Update XDL to version 48.0.2. ([c671c7a](https://github.com/expo/create-react-native-app/commit/c671c7aeed8a3d62098e6fd1cbe05e8e4160d22a) by [@fson](https://github.com/fson)) 90 | 91 | ## 1.10.0 - 2018-01-18 92 | 93 | ### 🎉 New features 94 | 95 | - Update to Expo SDK 25. ([4139951](https://github.com/expo/create-react-native-app/commit/4139951f7422e58e95b75e730f30aa7a7db0a542) by [@brentvatne](https://github.com/brentvatne)) 96 | 97 | ## 1.9.0 - 2018-01-17 98 | 99 | ### 🎉 New features 100 | 101 | - Update XDL to version 47.2.0. ([70f61b5](https://github.com/expo/create-react-native-app/commit/70f61b578f9441320b3917416251a746e7ed601f) by [@fson](https://github.com/fson)) 102 | 103 | ## 1.8.0 - 2017-11-27 104 | 105 | ### 🎉 New features 106 | 107 | - Update for SDK 23. ([56df72a](https://github.com/expo/create-react-native-app/commit/56df72a4b862e42bcc0f172ad10c7f5639045006) by [@brentvatne](https://github.com/brentvatne)) 108 | 109 | ## 1.7.0 - 2017-11-02 110 | 111 | _Release notes for previous releases between 1.3.1 and 1.7.0 were not include here as they only included React Native version bumps._ 112 | 113 | ### 🐛 Bug fixes 114 | 115 | - Fix Flow config, works on new projects now as expected. ([7402574](https://github.com/expo/create-react-native-app/commit/7402574e8be1474453e568ab467abc4501c9b3e2) by [@brentvatne](https://github.com/brentvatne)) 116 | 117 | ## 1.3.1 - 2017-09-02 118 | 119 | ### 🐛 Bug fixes 120 | 121 | - Fix an issue where `stdout` is null when validating inotify watches in some rare cases that I don't understand yet. ([ed4f5f4](https://github.com/expo/create-react-native-app/commit/ed4f5f4d1e1464a782eb65ca1b7a5d26f3998c91) by [@brentvatne](https://github.com/brentvatne)) 122 | 123 | ## 1.3.0 - 2017-08-28 124 | 125 | ### 🐛 Bug fixes 126 | 127 | - Force installation of Expo fork of react-native when ejecting to ExpoKit. ([cbf3f9e](https://github.com/expo/create-react-native-app/commit/cbf3f9e373d2edde00c824d2269f26f6bf5b7cfb) by [@brentvatne](https://github.com/brentvatne)) 128 | 129 | ## 1.2.1 - 2017-08-19 130 | 131 | ### 🐛 Bug fixes 132 | 133 | - Update to Expo SDK 20. ([#370](https://github.com/expo/create-react-native-app/pull/370) by [@ro-savage](https://github.com/ro-savage)) 134 | - Fix syntax error in flowconfig template. ([#373](https://github.com/expo/create-react-native-app/pull/373) by [@arahansen](https://github.com/arahansen)) 135 | - Warn if OS file watcher config is too low and watchman is not installed. ([#358](https://github.com/expo/create-react-native-app/pull/358) by [@vs1682](https://github.com/vs1682)) 136 | - Check if watchman exists before existing due to os config. ([cd887b4](https://github.com/expo/create-react-native-app/commit/cd887b4bd0c671cf396082e2f5d043a9a99808a7) by [@brentvatne](https://github.com/brentvatne)) 137 | 138 | ## 1.1.0 - 2017-07-28 139 | 140 | ### 🐛 Bug fixes 141 | 142 | - Switch Babel preset on eject ([#328](https://github.com/expo/create-react-native-app/pull/328) by [@fson](https://github.com/fson)) 143 | - Fix yarnpkg alias usage in the init script ([#329](https://github.com/expo/create-react-native-app/pull/329) by [@fson](https://github.com/fson)) 144 | 145 | ### 🎉 New features 146 | 147 | - Add interactive mode with keyboard commands ([#326](https://github.com/expo/create-react-native-app/pull/326) by [@fson](https://github.com/fson)) 148 | - Include whether dev or production is enabled in "Running app on" message ([6559600](https://github.com/expo/create-react-native-app/commit/655960090393673ec0a6208a1afac8f6821664e5) by [@brentvatne](https://github.com/brentvatne)) 149 | 150 | ## 1.0.0 - 2017-07-24 151 | 152 | ### 🐛 Bug fixes 153 | 154 | - Fix broken link in README to test example. ([5322584](https://github.com/expo/create-react-native-app/commit/5322584644413c1ea4ac70bbf1629a71803b27d5) by [@brentvatne](https://github.com/brentvatne)) 155 | - Fix npm 5 version validation. ([#317](https://github.com/expo/create-react-native-app/pull/317) by [@DuncanMacWeb](https://github.com/DuncanMacWeb)) 156 | 157 | ### 🎉 New features 158 | 159 | - Add `--package-manager` option which allows you to specify any package manager to use when creating a project. ([#307](https://github.com/expo/create-react-native-app/pull/307) by [@metheglin](https://github.com/metheglin)) 160 | - Update to [Expo SDK 19](https://blog.expo.io/expo-sdk-v19-0-0-is-now-available-821a62b58d3d) / React Native 0.46.1. ([63d1ddb](https://github.com/expo/create-react-native-app/commit/63d1ddbc1237a64d0189b5390f34ac6ada8254c4) by [@brentvatne](https://github.com/brentvatne)) 161 | - Softens warnings for npm 5 where version > 5.0.3. ([#317](https://github.com/expo/create-react-native-app/pull/317) by [@DuncanMacWeb](https://github.com/DuncanMacWeb)) 162 | - Add CHANGELOG.md ([#319](https://github.com/expo/create-react-native-app/pull/319) by [@shashkovdanil](https://github.com/shashkovdanil)) 163 | - Update [xdl](https://github.com/expo/xdl) 164 | - Removes the dependency on ngrok and dtrace, so there is no native compile step on install. 165 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Expo CLI 2 | 3 | ## How to contribute 4 | 5 | You can contribute to Expo development tools in various ways, including: 6 | 7 | - [Reporting bugs or issues](https://github.com/expo/create-react-native-app/issues/new) on GitHub. Please make sure to include fill in all the details in the issue template to make sure the issue can be addressed as quickly as possible. 8 | - [Submitting improvements to the documentation](https://github.com/expo/expo-docs). Updates, enhancements, new guides, spelling fixes... 9 | - Helping other people on the [forums](https://forums.expo.io). 10 | - Looking at existing [issues](https://github.com/expo/create-react-native-app/issues) and adding more information, particularly helping to reproduce the issues. 11 | - [Submitting a pull request](#submitting-a-pull-request) with a bug fix or an improvement. 12 | 13 | ### Branches 14 | 15 | The `master` branch of the repository should be kept releasable at any time. This way we can continuously deploy fixes and improvements without costly managing of different branches and issues will be noticed and fixed quickly. This also ensures other contributors can check out the latest version from GitHub and work on it with minimal disruption from other features in progress. 16 | 17 | Keeping the `master` releasable means that changes merged to it need to be: 18 | 19 | - **Backwards compatible**: Expo CLI should work with _every currently supported Expo SDK version_. If the code you're adding depends on a feature only present in newer or unreleased SDK versions, it needs to check which SDK version is being used and not assume the latest version is being used. 20 | - **Non-breaking**: If code that is unreleasable or fails the test suite ends up in `master`, it should be reverted. 21 | - **Tested**: Always include a test plan in pull requests. Do not merge code that doesn't pass all automated tests. 22 | 23 | ## Setting up the repository for development 24 | 25 | 1. Clone the repository. 26 | 2. Run `yarn run bootstrap`. (Installs dependencies, links and builds packages.) 27 | 3. Run `git config commit.template .github/.COMMIT_TEMPLATE` (Sets you up with our commit message template) 28 | 29 | You can then run `yarn start` in the root folder to start watching and automatically re-building packages when there are new changes. 30 | 31 | ## Submitting a pull request 32 | 33 | To submit a pull request: 34 | 35 | 1. Fork the [repository](https://github.com/expo/create-react-native-app) and create a feature branch. (Existing contributors can create feature branches without forking. Prefix the branch name with `@your-github-username/`.) 36 | 2. Write the description of your pull request. Make sure to include a test plan and test your changes. 37 | 3. Make sure all tests pass on CircleCI. 38 | 4. Wait for a review and adjust the code if necessary. 39 | 40 | ## Publishing a release 41 | 42 | To publish a new release, run this command (you must have two-factor authentication enabled for npm): 43 | 44 | ``` 45 | node ./scripts/publish.js 46 | ``` 47 | 48 | The command will bump the versions of all packages with changes since the previous release and publish them in the correct order. For each changed package, it will ask, if the changes require a new _major_ version (breaking changes), _minor_ version (new backwards compatible functionality) or just a _patch_ version (backwards compatible bug fixes). 49 | 50 | ### Canary release 51 | 52 | If you wish to publish a canary version, please run: 53 | 54 | ``` 55 | yarn run publish --canary 56 | ``` 57 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020-present 650 Industries, Inc. (aka Expo) 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of the copyright holder nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | 5 | create-react-native-app 6 |

⚠️ Deprecated

7 | 8 |

9 | 10 | 11 | 12 |

13 | It's recommended to use a framework to build apps with React Native, learn more. 14 |

15 | 16 |
17 | 18 | 19 | 20 | ## Deprecated 21 | 22 | Create a new Expo project with [create-expo-app](https://github.com/expo/expo/tree/main/packages/create-expo#readme) instead: 23 | 24 | ```bash 25 | # Usage for bun, npm, pnpm, and yarn 26 | $ npm create expo 27 | $ bun create expo 28 | $ pnpm create expo 29 | $ yarn create expo 30 | 31 | # Output help information with all available options 32 | $ npx create-expo --help 33 | ``` 34 | 35 |
36 |
37 | with ❤️  Expo 38 |
39 |
40 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('jest').Config} */ 2 | module.exports = { 3 | ...require('expo-module-scripts/jest-preset-cli'), 4 | preset: 'ts-jest', 5 | displayName: require('./package').name, 6 | rootDir: __dirname, 7 | roots: ['./src'], 8 | }; 9 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-react-native-app", 3 | "//": "crna", 4 | "version": "4.0.0", 5 | "main": "build", 6 | "description": "Create React Native apps with no build configuration.", 7 | "license": "BSD-3-Clause", 8 | "keywords": [ 9 | "react-native", 10 | "react" 11 | ], 12 | "homepage": "https://github.com/expo/create-react-native-app", 13 | "repository": { 14 | "type": "git", 15 | "url": "https://github.com/expo/create-react-native-app.git" 16 | }, 17 | "author": "Expo ", 18 | "contributors": [ 19 | "Evan Bacon (https://github.com/evanbacon)" 20 | ], 21 | "files": [ 22 | "build" 23 | ], 24 | "bin": { 25 | "create-react-native-app": "./build/index.js" 26 | }, 27 | "scripts": { 28 | "prepublishOnly": "yarn run clean && yarn run build", 29 | "lint": "expo-module lint", 30 | "test": "expo-module test", 31 | "watch": "yarn run build:dev -w", 32 | "build:dev": "ncc build ./src/index.ts -o build/", 33 | "build": "ncc build ./src/index.ts -o build/ --minify --no-cache --no-source-map-register", 34 | "clean": "expo-module clean" 35 | }, 36 | "husky": { 37 | "hooks": { 38 | "pre-commit": "lint-staged" 39 | } 40 | }, 41 | "lint-staged": { 42 | "*.{js,ts}": [ 43 | "eslint --fix", 44 | "prettier --write", 45 | "git add" 46 | ] 47 | }, 48 | "devDependencies": { 49 | "@types/node": "^20.14.2", 50 | "@vercel/ncc": "^0.38.1", 51 | "babel-jest": "^29.7.0", 52 | "chalk": "2.4.2", 53 | "eslint": "^8.57.0", 54 | "eslint-config-universe": "^13.0.0", 55 | "execa": "^4.0.1", 56 | "expo-module-scripts": "^3.5.2", 57 | "husky": "^1.1.3", 58 | "jest": "^29.7.0", 59 | "lint-staged": "^8.0.4", 60 | "prettier": "^3.3.1", 61 | "typescript": "^5.4.5" 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/__tests__/index.test.js: -------------------------------------------------------------------------------- 1 | /* eslint-env jest */ 2 | import execa from 'execa'; 3 | 4 | const cli = require.resolve('../../build/index.js'); 5 | const execute = () => execa('node', [cli]).catch((error) => error); 6 | 7 | it('exits with error code', async () => { 8 | expect(await execute()).toMatchObject({ exitCode: 1 }); 9 | }); 10 | 11 | it('logs deprecation warning', async () => { 12 | expect(await execute()).toMatchObject({ 13 | stderr: expect.stringContaining('This tool does not initialize new React Native projects'), 14 | }); 15 | }); 16 | 17 | it('logs next step', async () => { 18 | expect(await execute()).toMatchObject({ 19 | stderr: expect.stringContaining( 20 | `It's recommended to use a framework to build apps with React Native` 21 | ), 22 | }); 23 | }); 24 | 25 | it('logs expo as alternative', async () => { 26 | expect(await execute()).toMatchObject({ 27 | stderr: expect.stringContaining(`npx create-expo-app`), 28 | }); 29 | }); 30 | 31 | it('logs @react-native-community/cli as alternative', async () => { 32 | expect(await execute()).toMatchObject({ 33 | stderr: expect.stringContaining(`npx @react-native-community/cli init`), 34 | }); 35 | }); 36 | 37 | it('logs more information link', async () => { 38 | expect(await execute()).toMatchObject({ 39 | stderr: expect.stringContaining('https://reactnative.dev/docs/environment-setup'), 40 | }); 41 | }); 42 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | import chalk from 'chalk'; 3 | 4 | console.warn(chalk` 5 | {yellow.bold ⚠️ This tool does not initialize new React Native projects.} 6 | 7 | It's recommended to use a framework to build apps with React Native, for example: 8 | 9 | Expo: 10 | {bold npx create-expo-app} 11 | 12 | React Native Community template: 13 | {bold npx @react-native-community/cli init} 14 | 15 | Learn more: {underline https://reactnative.dev/docs/environment-setup} 16 | `); 17 | 18 | process.exit(1); 19 | -------------------------------------------------------------------------------- /template/gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | *.hprof 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 artifacts 57 | *.jsbundle 58 | 59 | # CocoaPods 60 | /ios/Pods/ 61 | 62 | # Expo 63 | .expo/* 64 | web-build/ 65 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "expo-module-scripts/tsconfig.plugin.json", 3 | "include": ["src/**/*"], 4 | "compilerOptions": { 5 | "module": "Node16", 6 | "resolveJsonModule": true, 7 | "esModuleInterop": true, 8 | "rootDir": "src", 9 | "declaration": false, 10 | } 11 | } 12 | --------------------------------------------------------------------------------