Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Commit

Permalink
fix(expo): Update references when using Expo -- fixes #370 (#371 by @…
Browse files Browse the repository at this point in the history
  • Loading branch information
nonameolsson committed Sep 24, 2020
1 parent d08a27b commit 353daf5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
13 changes: 12 additions & 1 deletion boilerplate/README.md → boilerplate/README.md.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ ignite-project
│   ├── setup.ts
│   ├── storyshots.test.ts
├── README.md
<% if (!props.useExpo) { -%>
├── android
│   ├── app
│   ├── build.gradle
Expand All @@ -52,16 +53,23 @@ ignite-project
│   ├── gradlew.bat
│   ├── keystores
│   └── settings.gradle
<% } -%>
├── ignite
│   ├── ignite.json
│   └── plugins
<% if (props.useExpo) { -%>
├── App.js
<% } else { -%>
├── index.js
<% } -%>
<% if (!props.useExpo) { -%>
├── ios
│   ├── IgniteProject
│   ├── IgniteProject-tvOS
│   ├── IgniteProject-tvOSTests
│   ├── IgniteProject.xcodeproj
│   └── IgniteProjectTests
<% } -%>
├── .env
└── package.json

Expand Down Expand Up @@ -129,8 +137,11 @@ This directory will hold your Jest configs and mocks, as well as your [storyshot
From the command line in your generated app's root directory, enter `yarn run storybook`
This starts up the storybook server.

<% if (props.useExpo) { -%>
In `App.js`, change `SHOW_STORYBOOK` to `true` and reload the app.
<% } else { -%>
In `index.js`, change `SHOW_STORYBOOK` to `true` and reload the app.

<% } -%>
For Visual Studio Code users, there is a handy extension that makes it easy to load Storybook use cases into a running emulator via tapping on items in the editor sidebar. Install the `React Native Storybook` extension by `Orta`, hit `cmd + shift + P` and select "Reconnect Storybook to VSCode". Expand the STORYBOOK section in the sidebar to see all use cases for components that have `.story.tsx` files in their directories.

## Previous Boilerplates
Expand Down
4 changes: 4 additions & 0 deletions boilerplate/package.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
"hack:types-react-navigation": "rimraf node_modules/@types/react-navigation/node_modules/@types",
"hack:types-react-native": "rimraf node_modules/@types/react-native/node_modules/@types",
"hack:types-react-test-renderer": "rimraf node_modules/@types/react-test-renderer/node_modules/@types",
<% if (props.useExpo) { -%>
"lint": "eslint App.js app storybook test --fix --ext .js,.ts,.tsx",
<% } else { -%>
"lint": "eslint index.js app storybook test --fix --ext .js,.ts,.tsx",
<% } -%>
"patch": "patch-package",
<%# We'll add to postinstall later in boilerplate, but it needs to be simple to start with. -%>
"postinstall": "solidarity",
Expand Down
4 changes: 4 additions & 0 deletions boilerplate/tsconfig.json → boilerplate/tsconfig.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@
"skipLibCheck": true
},
"exclude": ["node_modules"],
<% if (props.useExpo) { -%>
"include": ["App.js", "app", "test", "storybook"]
<% } else { -%>
"include": ["index.js", "app", "test", "storybook"]
<% } -%>
}
4 changes: 2 additions & 2 deletions src/boilerplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,14 @@ And here: https://guides.cocoapods.org/using/getting-started.html

const templates = [
{ template: "index.js.ejs", target: useExpo ? "App.js" : "index.js" },
{ template: "README.md", target: "README.md" },
{ template: "README.md.ejs", target: "README.md" },
{ template: ".gitignore.ejs", target: ".gitignore" },
{ template: ".env.example", target: ".env" },
{ template: ".prettierignore", target: ".prettierignore" },
{ template: ".solidarity", target: ".solidarity" },
{ template: "babel.config.js", target: "babel.config.js" },
{ template: "react-native.config.js", target: "react-native.config.js" },
{ template: "tsconfig.json", target: "tsconfig.json" },
{ template: "tsconfig.json.ejs", target: "tsconfig.json" },
{ template: "app/app.tsx.ejs", target: "app/app.tsx" },
{ template: "app/i18n/i18n.ts.ejs", target: "app/i18n/i18n.ts" },
{
Expand Down

0 comments on commit 353daf5

Please sign in to comment.