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