try to get development build going.
This commit is contained in:
parent
013578778c
commit
97ca20ed57
2
.gitignore
vendored
2
.gitignore
vendored
@ -36,3 +36,5 @@ yarn-error.*
|
||||
*.tsbuildinfo
|
||||
|
||||
app-example
|
||||
ios
|
||||
android
|
||||
|
@ -1 +0,0 @@
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
13
app.json
13
app.json
@ -9,13 +9,16 @@
|
||||
"userInterfaceStyle": "automatic",
|
||||
"newArchEnabled": true,
|
||||
"ios": {
|
||||
"supportsTablet": true
|
||||
"supportsTablet": true,
|
||||
"requireFullScreen": true,
|
||||
"bundleIdentifier": "com.anonymous.translationterrace"
|
||||
},
|
||||
"android": {
|
||||
"adaptiveIcon": {
|
||||
"foregroundImage": "./assets/images/adaptive-icon.png",
|
||||
"backgroundColor": "#ffffff"
|
||||
}
|
||||
},
|
||||
"package": "com.anonymous.translationterrace"
|
||||
},
|
||||
"web": {
|
||||
"bundler": "metro",
|
||||
@ -24,6 +27,12 @@
|
||||
},
|
||||
"plugins": [
|
||||
"expo-router",
|
||||
[
|
||||
"expo-screen-orientation",
|
||||
{
|
||||
"initialOrientation": "LANDSCAPE"
|
||||
}
|
||||
],
|
||||
[
|
||||
"expo-splash-screen",
|
||||
{
|
||||
|
@ -28,20 +28,29 @@ export class Translator {
|
||||
}
|
||||
|
||||
async fetchLanguages() : Promise<language_matrix> {
|
||||
let data = {};
|
||||
const res = await fetch(this.baseUrl + "/languages", {
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
});
|
||||
const data = await res.json();
|
||||
return Object.fromEntries(
|
||||
Object.values(data as language_matrix_entry []).map((obj : language_matrix_entry) => {
|
||||
return [
|
||||
obj["code"],
|
||||
obj,
|
||||
]
|
||||
})
|
||||
)
|
||||
try {
|
||||
data = await res.json();
|
||||
} catch (e) {
|
||||
throw new Error(`Parsing data from ${await res.text()}: ${e}`)
|
||||
}
|
||||
try {
|
||||
return Object.fromEntries(
|
||||
Object.values(data as language_matrix_entry []).map((obj : language_matrix_entry) => {
|
||||
return [
|
||||
obj["code"],
|
||||
obj,
|
||||
]
|
||||
})
|
||||
)
|
||||
} catch(e) {
|
||||
throw new Error(`Can't extract values from data: ${JSON.stringify(data)}`)
|
||||
}
|
||||
}
|
||||
|
||||
async translate(text : string, target : string|undefined = undefined) {
|
||||
|
@ -32,7 +32,8 @@ export function LanguageSelection(props: {
|
||||
setLanguages(languages);
|
||||
setLanguagesLoaded(true);
|
||||
} catch (error) {
|
||||
console.error('Error fetching data:', error);
|
||||
error = error as Response;
|
||||
console.error('Error fetching data (%d %s): %s', (error as Response).status, (error as Response).statusText, (error as Response).body);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1,15 +1,20 @@
|
||||
// jest.config.ts
|
||||
import { resolve } from "path"
|
||||
const jestExpoPreset = require('jest-expo/jest-preset');
|
||||
|
||||
const jestConfig = {
|
||||
// preset: 'jest-expo',
|
||||
preset: 'ts-jest',
|
||||
...jestExpoPreset,
|
||||
// preset: 'ts-jest',
|
||||
transform: {
|
||||
'^.+\\.(ts|tsx)$': 'babel-jest',
|
||||
},
|
||||
moduleNameMapper: {
|
||||
'@': "<rootDir>"
|
||||
},
|
||||
transformIgnorePatterns: [
|
||||
...jestExpoPreset.transformIgnorePatterns,
|
||||
]
|
||||
}
|
||||
|
||||
export default jestConfig
|
@ -5,8 +5,8 @@
|
||||
"scripts": {
|
||||
"start": "expo start",
|
||||
"reset-project": "node ./scripts/reset-project.js",
|
||||
"android": "expo start --offline --android",
|
||||
"ios": "expo start --ios",
|
||||
"android": "expo prebuild --pnpm -p android --offline",
|
||||
"ios": "expo prebuild --pnpm -p android --offline",
|
||||
"web": "expo start --offline --web",
|
||||
"test": "jest --watchAll",
|
||||
"lint": "expo lint"
|
||||
@ -25,6 +25,7 @@
|
||||
"expo-haptics": "~14.0.1",
|
||||
"expo-linking": "~7.0.5",
|
||||
"expo-router": "~4.0.17",
|
||||
"expo-screen-orientation": "~8.0.4",
|
||||
"expo-splash-screen": "~0.29.21",
|
||||
"expo-status-bar": "~2.0.1",
|
||||
"expo-symbols": "~0.2.2",
|
||||
@ -43,7 +44,8 @@
|
||||
"react-native-sqlite-storage": "^6.0.1",
|
||||
"react-native-web": "~0.19.13",
|
||||
"react-native-webview": "13.12.5",
|
||||
"whisper.rn": "^0.3.9"
|
||||
"whisper.rn": "^0.3.9",
|
||||
"expo": "~52.0.28"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.26.7",
|
||||
|
10049
pnpm-lock.yaml
generated
10049
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -12,6 +12,5 @@
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
".expo/types/**/*.ts",
|
||||
"expo-env.d.ts"
|
||||
]
|
||||
"expo-env.d.ts"]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user