Skip to content

Commit

Permalink
chore: env configs
Browse files Browse the repository at this point in the history
  • Loading branch information
hyochan committed Jul 26, 2023
1 parent a4efeca commit a68620d
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ web-build/
.yarn/*
!.yarn/releases

.env
.env*
.jest
3 changes: 3 additions & 0 deletions app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import AsyncStorage from '@react-native-async-storage/async-storage';
import {Button, SwitchToggle, useDooboo} from 'dooboo-ui';
import {Stack, useRouter} from 'expo-router';

import {ROOT_URL} from '../config';
import {t} from '../src/STRINGS';
import {AsyncStorageKey} from '../src/utils/constants';

Expand All @@ -26,6 +27,8 @@ export default function Index(): JSX.Element {
const {themeType, changeThemeType} = useDooboo();
const {push} = useRouter();

console.log('ROOT_URL', ROOT_URL);

Check warning on line 30 in app/index.tsx

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement

return (
<Container>
<Stack.Screen
Expand Down
2 changes: 1 addition & 1 deletion config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ const extra = Constants?.expoConfig?.extra;

export const GRAPHQL_URL = extra?.GRAPHQL_URL;
export const ROOT_URL = extra?.ROOT_URL;
export const SUBSCRIPTION_URL = extra?.SUBSCRIPTION_URL;

export const SUBSCRIPTION_URL = extra?.SUBSCRIPTION_URL;
export const googleClientIdIOS = extra?.googleClientIdIOS;
export const googleClientIdAndroid = extra?.googleClientIdAndroid;
export const googleClientIdWeb = extra?.googleClientIdWeb;
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"main": "index",
"scripts": {
"start": "expo start",
"start:prod": "dotenv -e .env.prod -- expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
Expand Down
2 changes: 1 addition & 1 deletion src/apis/sample.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ROOT_URL} from './urls';
import {ROOT_URL} from '../../config';

export const sample = async (
body: Record<string, unknown>,
Expand Down
1 change: 0 additions & 1 deletion src/apis/urls.ts

This file was deleted.

2 changes: 1 addition & 1 deletion test/src/apis/sample.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {FetchMock} from 'jest-fetch-mock';

import {ROOT_URL} from '../../../config';
import {sample} from '../../../src/apis/sample';
import {ROOT_URL} from '../../../src/apis/urls';

const fetchMock = fetch as FetchMock;

Expand Down

0 comments on commit a68620d

Please sign in to comment.