Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expo #306

Closed
wants to merge 9 commits into from
Closed

Expo #306

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .example.env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ SENTRY_PROJECT=
SENTRY_DSN=
SENTRY_AUTH_TOKEN=

EXPO_TOKEN=
EXPO_NO_TELEMETRY=1

NODE_ENV=development
NODE_ENV_SHORT=dev

APP_VARIANT=dev

DEBUG=dev
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,7 @@ web-build/
.env

# Diagnostic reports (https://nodejs.org/api/report.html)
report/
report/

# Detox
artifacts/
2 changes: 0 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@

require('ts-node/register')

module.exports = require(`${__dirname}/config/babel.config.ts`)

37 changes: 13 additions & 24 deletions config/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,17 @@ const config: ExpoConfig = {
'expo-localization',
['expo-barcode-scanner', { cameraPermission }],
['expo-camera', { cameraPermission }],
'sentry-expo',
'expo-updates'
'expo-secure-store',
[
'@sentry/react-native/expo',
{
organization: process?.env?.SENTRY_ORG, // || 'sentry org slug, or use the `SENTRY_ORG` environment variable',
project: process?.env?.SENTRY_PROJECT, // || 'sentry project name, or use the `SENTRY_PROJECT` environment variable',
dsn: process?.env?.SENTRY_DSN, // || 'sentry dsn, or use the `SENTRY_DSN` environment variable',
authToken: process?.env?.SENTRY_AUTH_TOKEN, // || 'sentry auth token, or use the `SENTRY_AUTH_TOKEN` environment variable',
}
],
'@config-plugins/detox'
],
ios: {
supportsTablet: false,
Expand All @@ -96,9 +105,6 @@ const config: ExpoConfig = {
},
package: `xyz.elliptica.enuts${!IS_PROD ? `.${_appVariant}` : ''}`
},
web: {
favicon: './assets/favicon.png'
},
extra: {
eas: { projectId: 'edb75ccd-71ac-4934-9147-baf1c7f2b068' },
DEBUG: process?.env?.DEBUG,
Expand All @@ -107,25 +113,8 @@ const config: ExpoConfig = {
NODE_ENV_SHORT: _nodeEnvShort,
SENTRY_DSN: process?.env?.SENTRY_DSN,
SENTRY_ORG: process?.env?.SENTRY_ORG,
SENTRY_PROJECT: process?.env?.SENTRY_PROJECT
},
hooks: {
postPublish: [
{
file: 'sentry-expo/upload-sourcemaps',
config: {
organization: process?.env?.SENTRY_ORG,
project: process?.env?.SENTRY_PROJECT
}
}
]
},
updates: {
enabled: false,
url: 'https://u.expo.dev/edb75ccd-71ac-4934-9147-baf1c7f2b068'
},
runtimeVersion: {
policy: 'sdkVersion'
SENTRY_PROJECT: process?.env?.SENTRY_PROJECT,
SENTRY_AUTH_TOKEN: process?.env?.SENTRY_AUTH_TOKEN
}
}

Expand Down
10 changes: 6 additions & 4 deletions config/metro.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
// Learn more https://docs.expo.io/guides/customizing-metro
// https://docs.expo.dev/guides/using-sentry/#update-metro-configuration

import { getDefaultConfig } from '@expo/metro-config'
// This replaces `const { getDefaultConfig } = require('expo/metro-config');`
import { getSentryExpoConfig } from '@sentry/react-native/metro'
import { readdirSync } from 'fs'
// import { mergeConfig } from 'metro-config'
import { join, resolve } from 'path'


const root = resolve(join(__dirname, '..', ''))
const assertDir = resolve(join(root, 'assets'))

export const config = getDefaultConfig(root)
// This replaces const config = getDefaultConfig(root)
export const config = getSentryExpoConfig(root)

const assetExts = [...new Set([
...config?.resolver?.assetExts ?? [],
Expand All @@ -19,4 +22,3 @@ const assetExts = [...new Set([
])]
if (config.resolver?.assetExts) { config.resolver.assetExts = assetExts }

// config mergeConfig(config, { resolver: { ...config.resolver, assetExts } })
57 changes: 57 additions & 0 deletions detox.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/** @type {Detox.DetoxConfig} */
module.exports = {
logger: {
level: process.env.CI ? 'debug' : undefined
},
testRunner: {
// $0: 'jest',
args: {
$0: 'jest',
config: 'test/e2e/jest.config.js',
_: ['e2e']
}
},
artifacts: {
plugins: {
log: process.env.CI ? 'failing' : undefined,
screenshot: 'failing'
}
},
apps: {
'ios.release': {
type: 'ios.app',
build:
'xcodebuild -workspace ios/eastestsexample.xcworkspace -scheme eastestsexample -configuration Release -sdk iphonesimulator -arch x86_64 -derivedDataPath ios/build',
binaryPath: 'ios/build/Build/Products/Release-iphonesimulator/eastestsexample.app'
},
'android.release': {
type: 'android.apk',
build: 'cd android && gradlew clean :app:assembleRelease :app:assembleAndroidTest -DtestBuildType=release && cd ..',
binaryPath: 'android/app/build/outputs/apk/release/app-release.apk'
},
},
devices: {
simulator: {
type: 'ios.simulator',
device: {
type: 'iPhone 14'
}
},
emulator: {
type: 'android.emulator',
device: {
avdName: 'Pixel_7_Pro_API_34'
}
}
},
configurations: {
'ios.release': {
device: 'simulator',
app: 'ios.release'
},
'android.emu.release': {
device: 'emulator',
app: 'android.release'
}
}
}
Loading
Loading