Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docs): Add docs for ignite boilerplate files (#2634)
* boilerplate structure work * devtools doc * boilerplate formatting * add several missing docs with initial content * add maestro * update naming and sidebar positioning * change ordering to be alphabetical * docs cleanup * style nits
- Loading branch information
1 parent
db71c8a
commit 218a671
Showing
18 changed files
with
287 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
title: App.tsx | ||
sidebar_position: 65 | ||
--- | ||
|
||
# App.tsx | ||
|
||
`App.tsx` is the entry point for Expo / React Native itself. It is minimal on purpose - its only responsibiliy is to: | ||
|
||
- Setup the Splash Screen | ||
- Immediately load our app's root component | ||
|
||
Not to be confused with [app/app.tsx](./app/app.tsx.md), which is the main root component that gets rendered. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: android | ||
sidebar_position: 20 | ||
sidebar_position: 5 | ||
--- | ||
|
||
# `android` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
title: app.json / app.config.js | ||
sidebar_position: 60 | ||
--- | ||
|
||
# app.json / app.config.js | ||
|
||
The app.json & app.config.js files are used to configure your React Native / Expo project. | ||
|
||
Ignite has already configured several things for us: | ||
|
||
- App Icons - configured for iOS, Android, and Web. Check out [App Icon Generators](../concept/Generators/#app-icon-generator) to update your App Icon. | ||
- Splash Screen colors and images - configured for iOS, Android, and Web. Check out [Splash Screen Generators](../concept/Generators/#splash-screen-generator) to update your Splash Screen. | ||
- Expo plugins for things like localization and splash screens | ||
|
||
See [Expo's Documentation on App.json Configuration](https://docs.expo.dev/workflow/configuration/) for more details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"label": "app", | ||
"position": 5, | ||
"position": 10, | ||
"link": { | ||
"type": "doc", | ||
"id": "app" | ||
}, | ||
"collapsed": true | ||
"collapsed": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Devtools Folder | ||
|
||
## Reactotron | ||
|
||
Ignite comes with Reactotron support for debugging your app. | ||
By default, Reactotron is configured to work with web and mobile apps and is configured with a few plugins and commands we think are useful. | ||
|
||
### ReactotronConfig.ts | ||
|
||
The `reactotron-mst` plugin is included for MobX-State-Tree support. | ||
|
||
```typescript | ||
import { mst } from "reactotron-mst" | ||
const reactotron = Reactotron.configure({ | ||
... | ||
}).use( | ||
mst({ | ||
/** ignore some chatty `mobx-state-tree` actions */ | ||
filter: (event) => /postProcessSnapshot|@APPLY_SNAPSHOT/.test(event.name) === false, | ||
}), | ||
) | ||
``` | ||
|
||
There are also a few custom commands included. You can use `reactotron.onCustomCommand` to add your own own custom debugging tools to Reactotron. Here is an example: | ||
|
||
```typescript | ||
reactotron.onCustomCommand({ | ||
title: "Reset Navigation State", | ||
description: "Resets the navigation state", | ||
command: "resetNavigation", | ||
handler: () => { | ||
Reactotron.log("resetting navigation state") | ||
resetRoot({ index: 0, routes: [] }) | ||
}, | ||
}) | ||
``` | ||
|
||
For more info check out the [Reactotron Documentation](https://docs.infinite.red/reactotron/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"label": "devtools", | ||
"position": 50, | ||
"link": { | ||
"type": "doc", | ||
"id": "Devtools" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
title: assets | ||
sidebar_position: 20 | ||
--- | ||
|
||
# Assets Folder | ||
|
||
The `assets` folder is for icons, images, fonts, and other static assets used in your app. | ||
|
||
### App Icons | ||
|
||
For your App Icon, use [Ignite's App Icon Generator](../concept/Generators/#app-icon-generator) to automatically generate image assets, which get put in `assets/images`. | ||
|
||
### Splash Screen | ||
|
||
To update your Splash Screen, use [Ignite's Splash Screen Generator](../concept/Generators/#splash-screen-generator) to generate images and update `assets/images`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
title: eas.json | ||
sidebar_position: 70 | ||
--- | ||
|
||
# eas.json | ||
|
||
`eas.json` is the configuration file for [Expo Application Service (EAS)](https://docs.expo.dev/eas/). It allows you to create profiles for building and distributing your app. | ||
|
||
Ignite includes a few default build profiles for common scenarios, but you can customize or add your own profiles too! | ||
|
||
- `development` - internal debug build for testing on simulators | ||
- `development:device` - internal debug build for testing on physical devices | ||
- `preview` - internal production build for testing on simulators | ||
- `preview:device` - internal production build for testing on physical devices | ||
- `production` - default production profile intended for external distribution | ||
|
||
Note how profiles can share settings via `extends`: | ||
|
||
```json | ||
"development": { | ||
"extends": "production", | ||
"distribution": "internal", | ||
"android": { | ||
"gradleCommand": ":app:assembleDebug" | ||
}, | ||
"ios": { | ||
"buildConfiguration": "Debug", | ||
"simulator": true | ||
} | ||
}, | ||
"development:device": { | ||
"extends": "development", | ||
"distribution": "internal", | ||
"ios": { | ||
"buildConfiguration": "Debug", | ||
"simulator": false | ||
} | ||
}, | ||
"production": {} | ||
``` | ||
|
||
In this example, `development:device` inherits the settings from `development`, but changes the `ios` setting to `simulator: false`. You can use `extends` to create a set of profiles to fit your needs without duplicating configuration. | ||
|
||
View [Expo's eas.json Documentation](https://docs.expo.dev/build/eas-json/) for more info. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
title: ignite | ||
sidebar_position: 25 | ||
--- | ||
|
||
# Ignite Folder | ||
|
||
The `ignite` directory contains an initial set of generator templates to help scaffold new screens, components, models, app icons, and more. | ||
|
||
Generators are the true gem of Ignite! They can save you countless hours as you build your app - we strongly recommend you give it a try! | ||
Learn more about [Ignite Generators](../concept/Generators.md) and how to create your own [Ignite Generator Templates](../concept/Generator-Templates.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: ios | ||
sidebar_position: 20 | ||
sidebar_position: 30 | ||
--- | ||
|
||
# `ios` folder | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
title: .maestro | ||
sidebar_position: 2 | ||
--- | ||
|
||
# Maestro | ||
|
||
Ignite's demo project includes a `.maestro` directory with a few example test flows. [Maestro](https://maestro.mobile.dev/) is Ignite's default end-to-end testing solution. | ||
|
||
If you have Maestro setup, you can run your tests via | ||
|
||
```bash | ||
maestro test .maestro/MyTestFile.yaml | ||
``` | ||
|
||
This command is also setup as a npm script in `package.json`, which you can customize to your liking: | ||
|
||
```bash | ||
yarn run test:maestro | ||
``` | ||
|
||
You can learn how to run and create Maestro tests by following the [Ignite Cookbook Recipe](https://ignitecookbook.com/docs/recipes/MaestroSetup) or by visiting [Maestro's Documentation](https://maestro.mobile.dev/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
## `app/plugins` Directory in Ignite Apps | ||
|
||
The `app/plugins` directory is a dedicated space within the Ignite boilerplate for managing Expo Config Plugins. These plugins are used to customize the native configuration of your app without altering the native code directly. | ||
|
||
### Adding Custom Plugins | ||
|
||
To add a custom plugin: | ||
|
||
1. **Create a Plugin**: In `app/plugins`, define your plugin in a TypeScript file, exporting a function that modifies the ExpoConfig. | ||
2. **Integrate the Plugin**: In `app.config.ts`, import your plugin and add it to the `plugins` array. | ||
|
||
Example: | ||
|
||
```typescript | ||
// In app.config.ts | ||
plugins: [...existingPlugins, require("./plugins/yourCustomPlugin").yourCustomPlugin] | ||
``` | ||
|
||
## Key Points | ||
|
||
- Config plugins extend app configuration, automating native module integration. | ||
- Create plugins in `app/plugins` and add them to `app.config.ts`. | ||
- For complex setups, refer to mods but use them with caution. | ||
|
||
For detailed information on creating and using config plugins, refer to [Expo's Config Plugins documentation](https://docs.expo.dev/config-plugins/introduction/). |
Oops, something went wrong.