Skip to content

Commit a878a28

Browse files
Christiaan LandmanChristiaan Landman
authored andcommitted
chore: updated eas config code
1 parent adead82 commit a878a28

File tree

5 files changed

+12
-15
lines changed

5 files changed

+12
-15
lines changed

app.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

demos/react-native-supabase-todolist/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ bucket_definitions:
3838
## Configure The App
3939
Replace the necessary credentials in the [.env](./.env) file.
4040
41+
Take note that you will need an Expo account if you want to use EAS for your builds, the Expo project ID should then also be configured in the environment file.
42+
4143
## Run the App
4244
4345
Install the dependencies, including the React Native SDK:
@@ -58,10 +60,6 @@ Run on Android
5860
pnpm android
5961
```
6062

61-
## EAS Setup
62-
To use EAS for builds you need to ensure that your [eas.json](./eas.json) file is configured.
63-
This may lead to some duplication of variables between `.env` files and `eas.json` build profiles but makes it easier to see what variables will be applied across all environments. Read more on this [here](https://docs.expo.dev/build-reference/variables/#can-eas-build-use-env-files).
64-
6563

6664
## Here are some helpful links:
6765

demos/react-native-supabase-todolist/app.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
import { type ExpoConfig } from "expo/config";
22

3+
import { config as dotenvConfig} from 'dotenv'
4+
import { resolve } from 'path'
5+
6+
// EAS doesn't load values from `.env` by default when considering the `app.config.ts` file
7+
dotenvConfig({
8+
path: resolve(__dirname, '.env') || resolve(__dirname, '.env.local')
9+
})
10+
311
const projectId = process.env.EXPO_PUBLIC_EAS_PROJECT_ID;
412

513
const config: ExpoConfig = {

demos/react-native-supabase-todolist/eas.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,7 @@
1414
"distribution": "internal"
1515
},
1616
"production": {
17-
"channel": "production",
18-
"env": {
19-
"EXPO_PUBLIC_SUPABASE_URL": "https://foo.supabase.co",
20-
"EXPO_PUBLIC_SUPABASE_ANON_KEY": "foo",
21-
"EXPO_PUBLIC_POWERSYNC_URL": "https://foo.powersync.journeyapps.com",
22-
"EXPO_PUBLIC_EAS_PROJECT_ID": "foo"
23-
}
17+
"channel": "production"
2418
}
2519
}
2620
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const AppConfig = {
22
supabaseUrl: process.env.EXPO_PUBLIC_SUPABASE_URL,
33
supabaseAnonKey: process.env.EXPO_PUBLIC_SUPABASE_ANON_KEY,
4-
supabaseBucket: process.env.EXPO_PUBLIC_SUPABASE_BUCKET,
4+
supabaseBucket: process.env.EXPO_PUBLIC_SUPABASE_BUCKET || '',
55
powersyncUrl: process.env.EXPO_PUBLIC_POWERSYNC_URL
66
};

0 commit comments

Comments
 (0)