Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Commit e7de93c

Browse files
authored
fix(templates): use expo for react-native (#392)
1 parent 1bb0e23 commit e7de93c

File tree

5 files changed

+39
-40
lines changed

5 files changed

+39
-40
lines changed

scripts/__snapshots__/e2e-templates.test.js.snap

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4259,17 +4259,6 @@ Array [
42594259
]
42604260
`;
42614261
4262-
exports[`Templates React InstantSearch Native File content: .babelrc 1`] = `
4263-
"{
4264-
\\"presets\\": [\\"babel-preset-expo\\"],
4265-
\\"env\\": {
4266-
\\"development\\": {
4267-
\\"plugins\\": [\\"transform-react-jsx-source\\"]
4268-
}
4269-
}
4270-
}"
4271-
`;
4272-
42734262
exports[`Templates React InstantSearch Native File content: .editorconfig 1`] = `
42744263
"root = true
42754264
@@ -4399,23 +4388,33 @@ yarn start
43994388
exports[`Templates React InstantSearch Native File content: app.json 1`] = `
44004389
"{
44014390
\\"expo\\": {
4402-
\\"sdkVersion\\": \\"30.0.1\\"
4391+
\\"name\\": \\"react-instantsearch-native-app\\",
4392+
\\"slug\\": \\"react-instantsearch-native-app\\",
4393+
\\"sdkVersion\\": \\"32.0.0\\"
44034394
}
44044395
}"
44054396
`;
44064397
4398+
exports[`Templates React InstantSearch Native File content: babel.config.js 1`] = `
4399+
"module.exports = function(api) {
4400+
api.cache(true);
4401+
return {
4402+
presets: ['babel-preset-expo'],
4403+
};
4404+
};"
4405+
`;
4406+
44074407
exports[`Templates React InstantSearch Native File content: package.json 1`] = `
44084408
"{
44094409
\\"name\\": \\"react-instantsearch-native-app\\",
44104410
\\"version\\": \\"1.0.0\\",
44114411
\\"private\\": true,
4412-
\\"main\\": \\"./node_modules/react-native-scripts/build/bin/crna-entry.js\\",
4412+
\\"main\\": \\"node_modules/expo/AppEntry.js\\",
44134413
\\"scripts\\": {
4414-
\\"start\\": \\"react-native-scripts start\\",
4415-
\\"android\\": \\"react-native-scripts android\\",
4416-
\\"ios\\": \\"react-native-scripts ios\\",
4417-
\\"lint\\": \\"eslint .\\",
4418-
\\"lint:fix\\": \\"npm run lint -- --fix\\"
4414+
\\"start\\": \\"expo start\\",
4415+
\\"android\\": \\"expo start --android\\",
4416+
\\"ios\\": \\"expo start --ios\\",
4417+
\\"eject\\": \\"expo eject\\"
44194418
},
44204419
\\"partialDependencies\\": {
44214420
\\"react-instantsearch-native\\": \\"5.2.0\\"
@@ -4557,7 +4556,6 @@ export default connectSearchBox(SearchBox);"
45574556
45584557
exports[`Templates React InstantSearch Native Folder structure: contains the right files 1`] = `
45594558
Array [
4560-
".babelrc",
45614559
".editorconfig",
45624560
".eslintrc.js",
45634561
".gitignore",
@@ -4566,6 +4564,7 @@ Array [
45664564
"App.js",
45674565
"README.md",
45684566
"app.json",
4567+
"babel.config.js",
45694568
"package.json",
45704569
"src/Highlight.js",
45714570
"src/InfiniteHits.js",

src/templates/React InstantSearch Native/.babelrc.template

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"expo": {
3-
"sdkVersion": "30.0.1"
3+
"name": "{{name}}",
4+
"slug": "{{name}}",
5+
"sdkVersion": "32.0.0"
46
}
57
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = function(api) {
2+
api.cache(true);
3+
return {
4+
presets: ['babel-preset-expo'],
5+
};
6+
};

src/templates/React InstantSearch Native/package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,30 @@
22
"name": "{{name}}",
33
"version": "1.0.0",
44
"private": true,
5-
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
5+
"main": "node_modules/expo/AppEntry.js",
66
"scripts": {
7-
"start": "react-native-scripts start",
8-
"android": "react-native-scripts android",
9-
"ios": "react-native-scripts ios",
10-
"lint": "eslint .",
11-
"lint:fix": "npm run lint -- --fix"
7+
"start": "expo start",
8+
"android": "expo start --android",
9+
"ios": "expo start --ios",
10+
"eject": "expo eject"
1211
},
1312
"dependencies": {
14-
"algoliasearch": "3.30.0",
15-
"expo": "30.0.1",
13+
"algoliasearch": "3.32.1",
14+
"expo": "32.0.0",
1615
"prop-types": "15.7.2",
17-
"react": "16.6.3",
16+
"react": "16.5.0",
1817
"react-instantsearch-native": "{{libraryVersion}}",
19-
"react-native": "0.55.4"
18+
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz"
2019
},
2120
"devDependencies": {
21+
"babel-preset-expo": "5.0.0",
2222
"eslint": "5.7.0",
2323
"eslint-config-algolia": "13.2.3",
2424
"eslint-config-prettier": "3.6.0",
2525
"eslint-plugin-import": "2.16.0",
2626
"eslint-plugin-prettier": "3.0.1",
2727
"eslint-plugin-react": "7.11.1",
28-
"prettier": "1.16.4",
29-
"react-native-scripts": "1.14.1"
28+
"expo-cli": "2.13.0",
29+
"prettier": "1.16.4"
3030
}
3131
}

0 commit comments

Comments
 (0)