chore: scaffold Expo project with types and utils
This commit is contained in:
parent
f66034136d
commit
6c0b33f86a
5 changed files with 6474 additions and 1462 deletions
6
app.json
6
app.json
|
|
@ -20,6 +20,10 @@
|
|||
},
|
||||
"web": {
|
||||
"favicon": "./assets/favicon.png"
|
||||
}
|
||||
},
|
||||
"plugins": [
|
||||
"expo-sqlite",
|
||||
"expo-secure-store"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
4960
package-lock.json
generated
4960
package-lock.json
generated
File diff suppressed because it is too large
Load diff
18
package.json
18
package.json
|
|
@ -3,20 +3,34 @@
|
|||
"version": "1.0.0",
|
||||
"main": "index.ts",
|
||||
"dependencies": {
|
||||
"@react-navigation/native": "^7.3.4",
|
||||
"@react-navigation/native-stack": "^7.17.6",
|
||||
"expo": "~56.0.12",
|
||||
"expo-secure-store": "~56.0.4",
|
||||
"expo-sqlite": "~56.0.5",
|
||||
"expo-status-bar": "~56.0.4",
|
||||
"react": "19.2.3",
|
||||
"react-native": "0.85.3"
|
||||
"react-native": "0.85.3",
|
||||
"react-native-chart-kit": "^7.0.1",
|
||||
"react-native-safe-area-context": "~5.7.0",
|
||||
"react-native-screens": "4.25.2",
|
||||
"react-native-svg": "15.15.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^30.0.0",
|
||||
"@types/react": "~19.2.2",
|
||||
"jest-expo": "^56.0.5",
|
||||
"typescript": "~6.0.3"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "expo start",
|
||||
"android": "expo start --android",
|
||||
"ios": "expo start --ios",
|
||||
"web": "expo start --web"
|
||||
"web": "expo start --web",
|
||||
"test": "jest"
|
||||
},
|
||||
"jest": {
|
||||
"preset": "jest-expo"
|
||||
},
|
||||
"private": true
|
||||
}
|
||||
|
|
|
|||
23
src/types.ts
Normal file
23
src/types.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
export type SyncStatus = 'local' | 'synced'
|
||||
|
||||
export type Measurement = {
|
||||
id: string
|
||||
weight: number
|
||||
bmi: number
|
||||
bodyFatPercentage: number
|
||||
fatMass: number
|
||||
musclePercentage: number
|
||||
muscleMass: number
|
||||
visceralFat: number
|
||||
bmr: number
|
||||
measuredAt: string
|
||||
createdAt: string
|
||||
updatedAt: string
|
||||
syncStatus: SyncStatus
|
||||
}
|
||||
|
||||
export type WebDAVConfig = {
|
||||
url: string
|
||||
username: string
|
||||
password: string
|
||||
}
|
||||
13
src/utils/uuid.ts
Normal file
13
src/utils/uuid.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
export function generateId(): string {
|
||||
const chars = '0123456789abcdef'
|
||||
const segments = [8, 4, 4, 4, 12]
|
||||
return segments
|
||||
.map(len => {
|
||||
let s = ''
|
||||
for (let i = 0; i < len; i++) {
|
||||
s += chars[Math.floor(Math.random() * 16)]
|
||||
}
|
||||
return s
|
||||
})
|
||||
.join('-')
|
||||
}
|
||||
Loading…
Reference in a new issue