Full Code of expo/create-react-native-app for AI

main 3a7b11ee859c cached
20 files
24.0 KB
7.2k tokens
1 requests
Download .txt
Repository: expo/create-react-native-app
Branch: main
Commit: 3a7b11ee859c
Files: 20
Total size: 24.0 KB

Directory structure:
gitextract_qvwuu3dq/

├── .all-contributorsrc
├── .eslintignore
├── .eslintrc.js
├── .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

================================================
FILE CONTENTS
================================================

================================================
FILE: .all-contributorsrc
================================================
{
  "files": [
    "README.md"
  ],
  "imageSize": 100,
  "commit": false,
  "contributors": [
    {
      "login": "EvanBacon",
      "name": "Evan Bacon",
      "avatar_url": "https://avatars1.githubusercontent.com/u/9664363?v=4",
      "profile": "https://twitter.com/baconbrix",
      "contributions": [
        "code",
        "doc",
        "design",
        "maintenance",
        "review"
      ]
    },
    {
      "login": "brentvatne",
      "name": "Brent Vatne",
      "avatar_url": "https://avatars2.githubusercontent.com/u/90494?v=4",
      "profile": "https://expo.io",
      "contributions": [
        "code",
        "doc",
        "review"
      ]
    },
    {
      "login": "hamzahalilovic",
      "name": "Hamza Halilovic",
      "avatar_url": "https://avatars0.githubusercontent.com/u/26879042?v=4",
      "profile": "http://hamzah",
      "contributions": [
        "code"
      ]
    },
    {
      "login": "byCedric",
      "name": "Cedric van Putten",
      "avatar_url": "https://avatars2.githubusercontent.com/u/1203991?v=4",
      "profile": "https://bycedric.com",
      "contributions": [
        "code"
      ]
    },
    {
      "login": "fson",
      "name": "Ville Immonen",
      "avatar_url": "https://avatars3.githubusercontent.com/u/497214?v=4",
      "profile": "https://twitter.com/VilleImmonen",
      "contributions": [
        "code",
        "review"
      ]
    },
    {
      "login": "friederbluemle",
      "name": "Frieder Bluemle",
      "avatar_url": "https://avatars0.githubusercontent.com/u/743291?v=4",
      "profile": "https://github.com/friederbluemle",
      "contributions": [
        "code"
      ]
    },
    {
      "login": "kbrandwijk",
      "name": "Kim Brandwijk",
      "avatar_url": "https://avatars.githubusercontent.com/u/852069?v=4",
      "profile": "https://github.com/kbrandwijk",
      "contributions": [
        "code"
      ]
    },
    {
      "login": "srkds",
      "name": "Nirav",
      "avatar_url": "https://avatars.githubusercontent.com/u/61644078?v=4",
      "profile": "https://github.com/srkds",
      "contributions": [
        "code"
      ]
    }
  ],
  "contributorsPerLine": 7,
  "projectName": "create-react-native-app",
  "projectOwner": "expo",
  "repoType": "github",
  "repoHost": "https://github.com",
  "skipCi": true
}


================================================
FILE: .eslintignore
================================================
# Ignore all node_modules and vendored Ruby
node_modules
vendor
**/ts-declarations/*

# Ignore build artifacts
/build

# Generated
.expo

================================================
FILE: .eslintrc.js
================================================
module.exports = {
  root: true,
  extends: ['universe/node'],
  overrides: [
    {
      files: ['**/__tests__/*'],
    },
  ],
  globals: {
    jasmine: false,
  },
  settings: {
    react: {
      version: '16',
    },
  },
};


================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
 - OS: [e.g. iOS]
 - Browser [e.g. chrome, safari]
 - Version [e.g. 22]

**Smartphone (please complete the following information):**
 - Device: [e.g. iPhone6]
 - OS: [e.g. iOS8.1]
 - Browser [e.g. stock browser, safari]
 - Version [e.g. 22]

**Additional context**
Add any other context about the problem here.


================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
---
blank_issues_enabled: false
contact_links:
  - about: 'e.g. npx react-native start, react-native run-android, react-native init'
    name: 'CLI: react-native start'
    url: 'https://github.com/react-native-community/cli/issues/new/choose'
  - about: "e.g. import { View } from 'react-native', gradle error"
    name: 'Running react-native'
    url: 'https://github.com/facebook/react-native/issues/new/choose'
  - about: 'e.g. expo start, expo run:ios, expo init'
    name: 'CLI: expo start'
    url: 'https://github.com/expo/expo-cli/issues/new/choose'
  - about: 'e.g. Expo Go failing to connect on Windows'
    name: 'Expo Go app'
    url: 'https://github.com/expo/expo/issues/new/choose'
  - about: 'e.g. example fails to run'
    name: 'Template issues'
    url: 'https://github.com/expo/examples/issues/new/choose'


================================================
FILE: .github/workflows/size.yml
================================================
name: 'Size'

on:
  pull_request:
    types: [synchronize, opened]

jobs:
  size:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 1
      - uses: preactjs/compressed-size-action@v2
        continue-on-error: true
        with:
          repo-token: '${{ secrets.GITHUB_TOKEN }}'
          pattern: '**/build/*.js'


================================================
FILE: .github/workflows/test.yml
================================================
name: 'Test'

on:
  pull_request:
    types: [synchronize, opened]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 1
      - run: yarn
      - run: yarn build
      - run: yarn test


================================================
FILE: .gitignore
================================================
node_modules
.DS_Store
.expo
.eslintcache
.tags*
.git-crypt-key
.npm-cache
*~
*.log
.vscode
.idea/*
*.swp
*.swo
*.tsbuildinfo
.history

coverage/

build/

================================================
FILE: .prettierignore
================================================
# Ignore all node_modules

**/node_modules/**


================================================
FILE: .prettierrc
================================================
{
  "printWidth": 100,
  "tabWidth": 2,
  "singleQuote": true,
  "jsxBracketSameLine": true,
  "trailingComma": "es5"
}


================================================
FILE: CHANGELOG.md
================================================
# Changelog

## Unpublished

### 🐛 Bug fixes

- 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))

## 3.0.0 - 2020-04-16

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.

## 2.0.1 - 2018-09-21

This release merges Create React Native App with Expo CLI.

- **Expo CLI is a tool based on CRNA, made by the same team**
- **It has all the same features, plus some additional benefits**
- **Like CRNA, Expo CLI does not require an Expo user account**
- **The `create-react-native-app` command will continue to work**

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:

- **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.
- **Standalone app builds:** you can build IPA and APK packages for deploying to App Store and Play Store without using Xcode or Android Studio.
- **Publishing:** you can push updates to your deployed apps and optionally publish your app to Expo.io.
- **Tunnel:** your physical device doesn’t need to be in the same wi-fi as your computer to be able to develop using it.
- **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.

### Why are we bringing these two tools together?

- **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.
- **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.
- **Developer experience:** Expo CLI is ahead of CRNA in terms of features and developer experience, and we’re continuously improving it.
- **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.

### Upgrading from 1.14.0 to 2.0.1

All apps created with `create-react-native-app`, are compatible with Expo CLI without changes.

Upgrade `react-native-scripts` to v2.0.1 with:

```
npm install --save --save-exact react-native-scripts@2.0.1
```

or

```
yarn add --exact react-native-scripts@2.0.1
```

When you run `npm start` for the first time, Expo CLI will be installed.

**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:**

1. Replace `react-native-scripts` with `expo` in the `scripts` config in `package.json`. Example:
   ```
   "scripts": {
     "start": "expo start",
     "eject": "expo eject",
     "android": "expo start --android",
     "ios": "expo start --ios",
     "test": "jest"
   }
   ```
2. Remove `react-native-scripts` from `devDependencies`.

## 1.14.0 - 2018-04-27

Update Expo SDK 27.

## 1.12.1 - 2018-03-20

Update XDL to version 48.1.2.

## 1.12.0 2018-03-29

### 🎉 New features

- 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))
- Add support for Yarn workspaces. ([#503](https://github.com/expo/create-react-native-app/pull/503) by [@connectdotz](https://github.com/connectdotz))
- Update XDL.

## 1.11.1 - 2018-01-26

### 🎉 New features

Update XDL to version 48.0.2. ([c671c7a](https://github.com/expo/create-react-native-app/commit/c671c7aeed8a3d62098e6fd1cbe05e8e4160d22a) by [@fson](https://github.com/fson))

## 1.10.0 - 2018-01-18

### 🎉 New features

- Update to Expo SDK 25. ([4139951](https://github.com/expo/create-react-native-app/commit/4139951f7422e58e95b75e730f30aa7a7db0a542) by [@brentvatne](https://github.com/brentvatne))

## 1.9.0 - 2018-01-17

### 🎉 New features

- Update XDL to version 47.2.0. ([70f61b5](https://github.com/expo/create-react-native-app/commit/70f61b578f9441320b3917416251a746e7ed601f) by [@fson](https://github.com/fson))

## 1.8.0 - 2017-11-27

### 🎉 New features

- Update for SDK 23. ([56df72a](https://github.com/expo/create-react-native-app/commit/56df72a4b862e42bcc0f172ad10c7f5639045006) by [@brentvatne](https://github.com/brentvatne))

## 1.7.0 - 2017-11-02

_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._

### 🐛 Bug fixes

- 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))

## 1.3.1 - 2017-09-02

### 🐛 Bug fixes

- 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))

## 1.3.0 - 2017-08-28

### 🐛 Bug fixes

- 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))

## 1.2.1 - 2017-08-19

### 🐛 Bug fixes

- Update to Expo SDK 20. ([#370](https://github.com/expo/create-react-native-app/pull/370) by [@ro-savage](https://github.com/ro-savage))
- Fix syntax error in flowconfig template. ([#373](https://github.com/expo/create-react-native-app/pull/373) by [@arahansen](https://github.com/arahansen))
- 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))
- 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))

## 1.1.0 - 2017-07-28

### 🐛 Bug fixes

- Switch Babel preset on eject ([#328](https://github.com/expo/create-react-native-app/pull/328) by [@fson](https://github.com/fson))
- 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))

### 🎉 New features

- Add interactive mode with keyboard commands ([#326](https://github.com/expo/create-react-native-app/pull/326) by [@fson](https://github.com/fson))
- 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))

## 1.0.0 - 2017-07-24

### 🐛 Bug fixes

- 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))
- Fix npm 5 version validation. ([#317](https://github.com/expo/create-react-native-app/pull/317) by [@DuncanMacWeb](https://github.com/DuncanMacWeb))

### 🎉 New features

- 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))
- 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))
- 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))
- Add CHANGELOG.md ([#319](https://github.com/expo/create-react-native-app/pull/319) by [@shashkovdanil](https://github.com/shashkovdanil))
- Update [xdl](https://github.com/expo/xdl)
  - Removes the dependency on ngrok and dtrace, so there is no native compile step on install.


================================================
FILE: CONTRIBUTING.md
================================================
# Contributing to Expo CLI

## How to contribute

You can contribute to Expo development tools in various ways, including:

- [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.
- [Submitting improvements to the documentation](https://github.com/expo/expo-docs). Updates, enhancements, new guides, spelling fixes...
- Helping other people on the [forums](https://forums.expo.io).
- Looking at existing [issues](https://github.com/expo/create-react-native-app/issues) and adding more information, particularly helping to reproduce the issues.
- [Submitting a pull request](#submitting-a-pull-request) with a bug fix or an improvement.

### Branches

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.

Keeping the `master` releasable means that changes merged to it need to be:

- **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.
- **Non-breaking**: If code that is unreleasable or fails the test suite ends up in `master`, it should be reverted.
- **Tested**: Always include a test plan in pull requests. Do not merge code that doesn't pass all automated tests.

## Setting up the repository for development

1. Clone the repository.
2. Run `yarn run bootstrap`. (Installs dependencies, links and builds packages.)
3. Run `git config commit.template .github/.COMMIT_TEMPLATE` (Sets you up with our commit message template)

You can then run `yarn start` in the root folder to start watching and automatically re-building packages when there are new changes.

## Submitting a pull request

To submit a pull request:

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/`.)
2. Write the description of your pull request. Make sure to include a test plan and test your changes.
3. Make sure all tests pass on CircleCI.
4. Wait for a review and adjust the code if necessary.

## Publishing a release

To publish a new release, run this command (you must have two-factor authentication enabled for npm):

```
node ./scripts/publish.js
```

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).

### Canary release

If you wish to publish a canary version, please run:

```
yarn run publish --canary
```


================================================
FILE: LICENSE
================================================
Copyright (c) 2020-present 650 Industries, Inc. (aka Expo)
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
  contributors may be used to endorse or promote products derived from
  this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


================================================
FILE: README.md
================================================
<!-- Title -->

<p align="center">
  <a href="https://github.com/expo/examples">
    <img alt="create-react-native-app" src="./.gh-assets/banner.svg">
    <h1 align="center">⚠️ Deprecated</h1>
  </a>
</p>

<!-- Header -->

<p align="center">
  <b>It's recommended to use a framework to build apps with React Native, <a href="https://reactnative.dev/docs/environment-setup">learn more</a>.</b>
</p>

<br />

<!-- Body -->

## Deprecated

Create a new Expo project with [create-expo-app](https://github.com/expo/expo/tree/main/packages/create-expo#readme) instead:

```bash
# Usage for bun, npm, pnpm, and yarn
$ npm create expo
$ bun create expo
$ pnpm create expo
$ yarn create expo

# Output help information with all available options
$ npx create-expo --help
```

<div align="center">
  <br />
  with&nbsp;❤️&nbsp;&nbsp;<strong>Expo</strong>
  <br />
</div>


================================================
FILE: jest.config.js
================================================
/** @type {import('jest').Config} */
module.exports = {
  ...require('expo-module-scripts/jest-preset-cli'),
  preset: 'ts-jest',
  displayName: require('./package').name,
  rootDir: __dirname,
  roots: ['./src'],
};


================================================
FILE: package.json
================================================
{
  "name": "create-react-native-app",
  "//": "crna",
  "version": "4.0.0",
  "main": "build",
  "description": "Create React Native apps with no build configuration.",
  "license": "BSD-3-Clause",
  "keywords": [
    "react-native",
    "react"
  ],
  "homepage": "https://github.com/expo/create-react-native-app",
  "repository": {
    "type": "git",
    "url": "https://github.com/expo/create-react-native-app.git"
  },
  "author": "Expo <support@expo.io>",
  "contributors": [
    "Evan Bacon <bacon@expo.io> (https://github.com/evanbacon)"
  ],
  "files": [
    "build"
  ],
  "bin": {
    "create-react-native-app": "./build/index.js"
  },
  "scripts": {
    "prepublishOnly": "yarn run clean && yarn run build",
    "lint": "expo-module lint",
    "test": "expo-module test",
    "watch": "yarn run build:dev -w",
    "build:dev": "ncc build ./src/index.ts -o build/",
    "build": "ncc build ./src/index.ts -o build/ --minify --no-cache --no-source-map-register",
    "clean": "expo-module clean"
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.{js,ts}": [
      "eslint --fix",
      "prettier --write",
      "git add"
    ]
  },
  "devDependencies": {
    "@types/node": "^20.14.2",
    "@vercel/ncc": "^0.38.1",
    "babel-jest": "^29.7.0",
    "chalk": "2.4.2",
    "eslint": "^8.57.0",
    "eslint-config-universe": "^13.0.0",
    "execa": "^4.0.1",
    "expo-module-scripts": "^3.5.2",
    "husky": "^1.1.3",
    "jest": "^29.7.0",
    "lint-staged": "^8.0.4",
    "prettier": "^3.3.1",
    "typescript": "^5.4.5"
  }
}


================================================
FILE: src/__tests__/index.test.js
================================================
/* eslint-env jest */
import execa from 'execa';

const cli = require.resolve('../../build/index.js');
const execute = () => execa('node', [cli]).catch((error) => error);

it('exits with error code', async () => {
  expect(await execute()).toMatchObject({ exitCode: 1 });
});

it('logs deprecation warning', async () => {
  expect(await execute()).toMatchObject({
    stderr: expect.stringContaining('This tool does not initialize new React Native projects'),
  });
});

it('logs next step', async () => {
  expect(await execute()).toMatchObject({
    stderr: expect.stringContaining(
      `It's recommended to use a framework to build apps with React Native`
    ),
  });
});

it('logs expo as alternative', async () => {
  expect(await execute()).toMatchObject({
    stderr: expect.stringContaining(`npx create-expo-app`),
  });
});

it('logs @react-native-community/cli as alternative', async () => {
  expect(await execute()).toMatchObject({
    stderr: expect.stringContaining(`npx @react-native-community/cli init`),
  });
});

it('logs more information link', async () => {
  expect(await execute()).toMatchObject({
    stderr: expect.stringContaining('https://reactnative.dev/docs/environment-setup'),
  });
});


================================================
FILE: src/index.ts
================================================
#!/usr/bin/env node
import chalk from 'chalk';

console.warn(chalk`
{yellow.bold ⚠️ This tool does not initialize new React Native projects.}

It's recommended to use a framework to build apps with React Native, for example:

  Expo:
    {bold npx create-expo-app}
  
  React Native Community template:
    {bold npx @react-native-community/cli init}
  
Learn more: {underline https://reactnative.dev/docs/environment-setup}
`);

process.exit(1);


================================================
FILE: template/gitignore
================================================
# OSX
#
.DS_Store

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace

# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml
*.hprof

# node.js
#
node_modules/
npm-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
*.keystore

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/

*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots

# Bundle artifacts
*.jsbundle

# CocoaPods
/ios/Pods/

# Expo
.expo/*
web-build/


================================================
FILE: tsconfig.json
================================================
{
  "extends": "expo-module-scripts/tsconfig.plugin.json",
  "include": ["src/**/*"],
  "compilerOptions": {
    "module": "Node16",
    "resolveJsonModule": true,
    "esModuleInterop": true,
    "rootDir": "src",
    "declaration": false,
  }
}
Download .txt
gitextract_qvwuu3dq/

├── .all-contributorsrc
├── .eslintignore
├── .eslintrc.js
├── .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
Condensed preview — 20 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (27K chars).
[
  {
    "path": ".all-contributorsrc",
    "chars": 2324,
    "preview": "{\n  \"files\": [\n    \"README.md\"\n  ],\n  \"imageSize\": 100,\n  \"commit\": false,\n  \"contributors\": [\n    {\n      \"login\": \"Eva"
  },
  {
    "path": ".eslintignore",
    "chars": 136,
    "preview": "# Ignore all node_modules and vendored Ruby\nnode_modules\nvendor\n**/ts-declarations/*\n\n# Ignore build artifacts\n/build\n\n#"
  },
  {
    "path": ".eslintrc.js",
    "chars": 230,
    "preview": "module.exports = {\n  root: true,\n  extends: ['universe/node'],\n  overrides: [\n    {\n      files: ['**/__tests__/*'],\n   "
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "chars": 834,
    "preview": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Describe the b"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "chars": 826,
    "preview": "---\nblank_issues_enabled: false\ncontact_links:\n  - about: 'e.g. npx react-native start, react-native run-android, react-"
  },
  {
    "path": ".github/workflows/size.yml",
    "chars": 375,
    "preview": "name: 'Size'\n\non:\n  pull_request:\n    types: [synchronize, opened]\n\njobs:\n  size:\n    runs-on: ubuntu-latest\n    steps:\n"
  },
  {
    "path": ".github/workflows/test.yml",
    "chars": 258,
    "preview": "name: 'Test'\n\non:\n  pull_request:\n    types: [synchronize, opened]\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n"
  },
  {
    "path": ".gitignore",
    "chars": 153,
    "preview": "node_modules\n.DS_Store\n.expo\n.eslintcache\n.tags*\n.git-crypt-key\n.npm-cache\n*~\n*.log\n.vscode\n.idea/*\n*.swp\n*.swo\n*.tsbuil"
  },
  {
    "path": ".prettierignore",
    "chars": 46,
    "preview": "# Ignore all node_modules\n\n**/node_modules/**\n"
  },
  {
    "path": ".prettierrc",
    "chars": 120,
    "preview": "{\n  \"printWidth\": 100,\n  \"tabWidth\": 2,\n  \"singleQuote\": true,\n  \"jsxBracketSameLine\": true,\n  \"trailingComma\": \"es5\"\n}\n"
  },
  {
    "path": "CHANGELOG.md",
    "chars": 8968,
    "preview": "# Changelog\n\n## Unpublished\n\n### 🐛 Bug fixes\n\n- Skip creating a git repo when inside existing repo ([#920](https://githu"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 3325,
    "preview": "# Contributing to Expo CLI\n\n## How to contribute\n\nYou can contribute to Expo development tools in various ways, includin"
  },
  {
    "path": "LICENSE",
    "chars": 1516,
    "preview": "Copyright (c) 2020-present 650 Industries, Inc. (aka Expo)\nAll rights reserved.\n\nRedistribution and use in source and bi"
  },
  {
    "path": "README.md",
    "chars": 861,
    "preview": "<!-- Title -->\n\n<p align=\"center\">\n  <a href=\"https://github.com/expo/examples\">\n    <img alt=\"create-react-native-app\" "
  },
  {
    "path": "jest.config.js",
    "chars": 217,
    "preview": "/** @type {import('jest').Config} */\nmodule.exports = {\n  ...require('expo-module-scripts/jest-preset-cli'),\n  preset: '"
  },
  {
    "path": "package.json",
    "chars": 1592,
    "preview": "{\n  \"name\": \"create-react-native-app\",\n  \"//\": \"crna\",\n  \"version\": \"4.0.0\",\n  \"main\": \"build\",\n  \"description\": \"Create"
  },
  {
    "path": "src/__tests__/index.test.js",
    "chars": 1221,
    "preview": "/* eslint-env jest */\nimport execa from 'execa';\n\nconst cli = require.resolve('../../build/index.js');\nconst execute = ("
  },
  {
    "path": "src/index.ts",
    "chars": 447,
    "preview": "#!/usr/bin/env node\nimport chalk from 'chalk';\n\nconsole.warn(chalk`\n{yellow.bold ⚠️ This tool does not initialize new Re"
  },
  {
    "path": "template/gitignore",
    "chars": 853,
    "preview": "# OSX\n#\n.DS_Store\n\n# Xcode\n#\nbuild/\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.p"
  },
  {
    "path": "tsconfig.json",
    "chars": 247,
    "preview": "{\n  \"extends\": \"expo-module-scripts/tsconfig.plugin.json\",\n  \"include\": [\"src/**/*\"],\n  \"compilerOptions\": {\n    \"module"
  }
]

About this extraction

This page contains the full source code of the expo/create-react-native-app GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 20 files (24.0 KB), approximately 7.2k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!