Skip to content

Commit cf48c32

Browse files
ch(#28): ch-expo-setup-added (#32) (#29)
Co-authored-by: munezeromicha <[email protected]>
1 parent cb214f1 commit cf48c32

31 files changed

+363
-279
lines changed

.circleci/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ orbs:
66
jobs:
77
build:
88
docker:
9-
- image: cimg/node:18.20.4
9+
- image: cimg/node:18.20.4
1010
steps:
1111
- checkout
1212
- restore_cache:
@@ -30,4 +30,4 @@ workflows:
3030
version: 2
3131
build-test-coverage:
3232
jobs:
33-
- build
33+
- build

.coveralls.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
COVERALLS_REPO_TOKEN: process.env.COVERALLS_REPO_TOKEN
1+
COVERALLS_REPO_TOKEN: process.env.COVERALLS_REPO_TOKEN

.eslintrc.json

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true,
5+
"node": true,
6+
"jest": true
7+
},
8+
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"],
9+
"parser": "@typescript-eslint/parser",
10+
"parserOptions": {
11+
"ecmaVersion": 12,
12+
"sourceType": "module",
13+
"ecmaFeatures": {
14+
"jsx": false
15+
}
16+
},
17+
"plugins": ["@typescript-eslint", "prettier"],
18+
"rules": {
19+
"prettier/prettier": "error",
20+
"react/react-in-jsx-scope": "off"
21+
},
22+
"ignorePatterns": ["file_without_jsx.tsx"],
23+
"overrides": [
24+
{
25+
"files": ["*.ts", "*.tsx"],
26+
"rules": {
27+
"react/react-in-jsx-scope": "off"
28+
}
29+
}
30+
],
31+
"settings": {
32+
"react": {
33+
"pragma": "React",
34+
"version": "detect"
35+
}
36+
}
37+
}

.idea/.gitignore

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/atlp-pulse-mobile.iml

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.prettierrc

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"arrowParens": "always",
3+
"bracketSpacing": true,
4+
"jsxBracketSameLine": false,
5+
"jsxSingleQuote": false,
6+
"quoteProps": "as-needed",
7+
"singleQuote": true,
8+
"semi": true,
9+
"printWidth": 100,
10+
"useTabs": false,
11+
"tabWidth": 2,
12+
"trailingComma": "es5"
13+
}

__tests__/+not-found.test.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import NotFoundScreen from "@/app/+not-found";
2-
import { render } from "@testing-library/react-native";
3-
import React from "react";
1+
import NotFoundScreen from '@/app/+not-found';
2+
import { render } from '@testing-library/react-native';
3+
import React from 'react';
44

5-
describe("<NotFoundScreen />", () => {
6-
test("Screen renders correctly on NotFoundScreen", () => {
5+
describe('<NotFoundScreen />', () => {
6+
test('Screen renders correctly on NotFoundScreen', () => {
77
const { getByText } = render(<NotFoundScreen />);
88

99
getByText("This screen doesn't exist.");
10-
getByText("Go to home screen!");
10+
getByText('Go to home screen!');
1111
});
12-
});
12+
});

__tests__/components/Themed.test.tsx

+17-19
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,41 @@
1-
import { Text, View } from "@/components/Themed";
2-
import { render } from "@testing-library/react-native";
3-
import React from "react";
1+
import { Text, View } from '@/components/Themed';
2+
import { render } from '@testing-library/react-native';
3+
import React from 'react';
44

5-
describe("Themed components", () => {
6-
test("should render Text component", () => {
5+
describe('Themed components', () => {
6+
test('should render Text component', () => {
77
const { getByText } = render(<Text>Text component</Text>);
88

9-
getByText("Text component");
9+
getByText('Text component');
1010
});
1111

12-
test("should render Text component in light mode", () => {
13-
const { getByText } = render(
14-
<Text lightColor="black">Text component</Text>
15-
);
12+
test('should render Text component in light mode', () => {
13+
const { getByText } = render(<Text lightColor="black">Text component</Text>);
1614

17-
getByText("Text component");
15+
getByText('Text component');
1816
});
1917

20-
test("should render Text component in dark mode", () => {
18+
test('should render Text component in dark mode', () => {
2119
const { getByText } = render(<Text darkColor="white">Text component</Text>);
2220

23-
getByText("Text component");
21+
getByText('Text component');
2422
});
2523

26-
test("should render View component", () => {
24+
test('should render View component', () => {
2725
const { getByTestId } = render(<View testID="view" />);
2826

29-
getByTestId("view");
27+
getByTestId('view');
3028
});
3129

32-
test("should render View component in light mode", () => {
30+
test('should render View component in light mode', () => {
3331
const { getByTestId } = render(<View testID="view" lightColor="white" />);
3432

35-
getByTestId("view");
33+
getByTestId('view');
3634
});
3735

38-
test("should render View component in dark mode", () => {
36+
test('should render View component in dark mode', () => {
3937
const { getByTestId } = render(<View testID="view" darkColor="black" />);
4038

41-
getByTestId("view");
39+
getByTestId('view');
4240
});
4341
});

__tests__/components/buttons.test.tsx

+30-44
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,47 @@
1-
import Button from "@/components/buttons";
2-
import { render } from "@testing-library/react-native";
3-
import React from "react";
1+
import Button from '@/components/buttons';
2+
import { render } from '@testing-library/react-native';
3+
import React from 'react';
44

5-
describe("<Button />", () => {
6-
test("Default Button renders correctly", () => {
7-
const { getByText } = render(
8-
<Button state="Default" onPress={() => {}} title="Hello" />
9-
);
5+
describe('<Button />', () => {
6+
test('Default Button renders correctly', () => {
7+
const { getByText } = render(<Button state="Default" onPress={() => {}} title="Hello" />);
108

11-
getByText("Hello");
9+
getByText('Hello');
1210
});
1311

14-
test("Hover Button renders correctly", () => {
15-
const { getByText } = render(
16-
<Button state="Hover" onPress={() => {}} title="Hello" />
17-
);
12+
test('Hover Button renders correctly', () => {
13+
const { getByText } = render(<Button state="Hover" onPress={() => {}} title="Hello" />);
1814

19-
getByText("Hello");
15+
getByText('Hello');
2016
});
2117

22-
test("Pressed Button renders correctly", () => {
23-
const { getByText } = render(
24-
<Button state="Pressed" onPress={() => {}} title="Hello" />
25-
);
18+
test('Pressed Button renders correctly', () => {
19+
const { getByText } = render(<Button state="Pressed" onPress={() => {}} title="Hello" />);
2620

27-
getByText("Hello");
21+
getByText('Hello');
2822
});
2923

30-
test("Disabled Button renders correctly", () => {
31-
const { getByText } = render(
32-
<Button state="Disabled" onPress={() => {}} title="Hello" />
33-
);
24+
test('Disabled Button renders correctly', () => {
25+
const { getByText } = render(<Button state="Disabled" onPress={() => {}} title="Hello" />);
3426

35-
getByText("Hello");
27+
getByText('Hello');
3628
});
3729

38-
test("Outlined Button renders correctly", () => {
39-
const { getByText } = render(
40-
<Button state="Outlined" onPress={() => {}} title="Hello" />
41-
);
30+
test('Outlined Button renders correctly', () => {
31+
const { getByText } = render(<Button state="Outlined" onPress={() => {}} title="Hello" />);
4232

43-
getByText("Hello");
33+
getByText('Hello');
4434
});
4535

46-
test("Small Button renders correctly", () => {
47-
const { getByText } = render(
48-
<Button size="sm" onPress={() => {}} title="Hello" />
49-
);
50-
51-
getByText("Hello");
52-
});
53-
54-
test("Large Button renders correctly", () => {
55-
const { getByText } = render(
56-
<Button size="lg" onPress={() => {}} title="Hello" />
57-
);
58-
59-
getByText("Hello");
60-
});
36+
test('Small Button renders correctly', () => {
37+
const { getByText } = render(<Button size="sm" onPress={() => {}} title="Hello" />);
38+
39+
getByText('Hello');
40+
});
41+
42+
test('Large Button renders correctly', () => {
43+
const { getByText } = render(<Button size="lg" onPress={() => {}} title="Hello" />);
44+
45+
getByText('Hello');
46+
});
6147
});

app.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/// <reference types="nativewind/types" />
1+
/// <reference types="nativewind/types" />

app.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727
"output": "static",
2828
"favicon": "./assets/images/favicon.png"
2929
},
30-
"plugins": [
31-
"expo-router"
32-
],
30+
"plugins": ["expo-router"],
3331
"experiments": {
3432
"typedRoutes": true
3533
},

app/+not-found.tsx

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Link } from "expo-router";
2-
import { StyleSheet } from "react-native";
1+
import { Link } from 'expo-router';
2+
import { StyleSheet } from 'react-native';
33

4-
import { Text, View } from "@/components/Themed";
5-
import React from "react";
4+
import { Text, View } from '@/components/Themed';
5+
import React from 'react';
66

77
export default function NotFoundScreen() {
88
return (
@@ -21,20 +21,20 @@ export default function NotFoundScreen() {
2121
const styles = StyleSheet.create({
2222
container: {
2323
flex: 1,
24-
alignItems: "center",
25-
justifyContent: "center",
24+
alignItems: 'center',
25+
justifyContent: 'center',
2626
padding: 20,
2727
},
2828
title: {
2929
fontSize: 20,
30-
fontWeight: "bold",
30+
fontWeight: 'bold',
3131
},
3232
link: {
3333
marginTop: 15,
3434
paddingVertical: 15,
3535
},
3636
linkText: {
3737
fontSize: 14,
38-
color: "#2e78b7",
38+
color: '#2e78b7',
3939
},
40-
});
40+
});

app/_layout.tsx

+8-4
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@ import { Stack } from 'expo-router';
55
import * as SplashScreen from 'expo-splash-screen';
66
import { useEffect } from 'react';
77
import 'react-native-reanimated';
8-
import '@/global.css'
8+
import '@/global.css';
99
import { useColorScheme } from '@/components/useColorScheme';
10-
import { Inter_400Regular, Inter_500Medium, Inter_600SemiBold, Inter_700Bold } from '@expo-google-fonts/inter';
10+
import {
11+
Inter_400Regular,
12+
Inter_500Medium,
13+
Inter_600SemiBold,
14+
Inter_700Bold,
15+
} from '@expo-google-fonts/inter';
1116
import React from 'react';
1217

1318
export {
@@ -55,8 +60,7 @@ function RootLayoutNav() {
5560

5661
return (
5762
<ThemeProvider value={colorScheme === 'dark' ? DarkTheme : DefaultTheme}>
58-
<Stack>
59-
</Stack>
63+
<Stack></Stack>
6064
</ThemeProvider>
6165
);
6266
}

babel.config.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
module.exports = function (api) {
22
api.cache(true);
33
return {
4-
presets: [
5-
["babel-preset-expo", { jsxImportSource: "nativewind" }],
6-
"nativewind/babel",
7-
],
4+
presets: [['babel-preset-expo', { jsxImportSource: 'nativewind' }], 'nativewind/babel'],
85
};
9-
};
6+
};

0 commit comments

Comments
 (0)