Skip to content

Commit

Permalink
update to expo 51, update expo51 related deps, temporary use legacy i…
Browse files Browse the repository at this point in the history
…mpl. for expo-sqlite and expo-camera
  • Loading branch information
KKA11010 committed May 27, 2024
1 parent 6aa1821 commit 6128379
Show file tree
Hide file tree
Showing 11 changed files with 3,892 additions and 3,328 deletions.
778 changes: 389 additions & 389 deletions assets/translations/th.json

Large diffs are not rendered by default.

6,356 changes: 3,457 additions & 2,899 deletions package-lock.json

Large diffs are not rendered by default.

66 changes: 34 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,47 +44,45 @@
},
"dependencies": {
"@cashu/cashu-ts": "^0.9.0",
"@react-native-community/netinfo": "11.1.0",
"@react-native-community/netinfo": "11.3.1",
"@react-navigation/core": "^6.4.16",
"@react-navigation/native": "^6.1.17",
"@react-navigation/native-stack": "^6.9.26",
"@sentry/react-native": "5.19.1",
"@shopify/flash-list": "1.6.3",
"@sentry/react-native": "~5.22.0",
"@shopify/flash-list": "1.6.4",
"bech32": "^2.0.0",
"crypto-js": "4.2.0",
"expo": "^50.0.14",
"expo-application": "~5.8.3",
"expo-barcode-scanner": "~12.9.3",
"expo-camera": "~14.1.1",
"expo-clipboard": "~5.0.1",
"expo-constants": "~15.4.5",
"expo-crypto": "~12.8.1",
"expo-device": "~5.9.3",
"expo-file-system": "~16.0.8",
"expo-image": "~1.10.6",
"expo-insights": "~0.6.1",
"expo-localization": "~14.8.3",
"expo-secure-store": "~12.8.1",
"expo-splash-screen": "~0.26.4",
"expo-sqlite": "~13.4.0",
"expo-status-bar": "~1.11.1",
"expo-application": "~5.9.1",
"expo-barcode-scanner": "~13.0.1",
"expo-camera": "~15.0.9",
"expo-clipboard": "~6.0.3",
"expo-constants": "~16.0.1",
"expo-crypto": "~13.0.2",
"expo-device": "~6.0.2",
"expo-file-system": "~17.0.1",
"expo-image": "~1.12.9",
"expo-insights": "~0.7.0",
"expo-localization": "~15.0.3",
"expo-secure-store": "~13.0.1",
"expo-splash-screen": "~0.27.4",
"expo-sqlite": "~14.0.3",
"expo-status-bar": "~1.12.1",
"expo-updates": "~0.25.14",
"i18next": "^23.10.1",
"lottie-react-native": "6.5.1",
"lottie-react-native": "6.7.0",
"nostr-tools": "^1.17.0",
"react": "^18.2.0",
"react-i18next": "^14.1.0",
"react-native": "0.73.6",
"react-native-gesture-handler": "~2.14.0",
"react-native": "0.74.1",
"react-native-gesture-handler": "~2.16.1",
"react-native-onboarding-swiper": "^1.2.0",
"react-native-popup-menu": "^0.16.1",
"react-native-qrcode-svg": "^6.3.0",
"react-native-reanimated": "~3.6.2",
"react-native-safe-area-context": "4.8.2",
"react-native-screens": "~3.29.0",
"react-native-reanimated": "~3.10.1",
"react-native-safe-area-context": "4.10.1",
"react-native-screens": "3.31.1",
"react-native-size-matters": "^0.4.2",
"react-native-svg": "14.1.0",
"text-encoding-polyfill": "^0.6.7",
"expo-updates": "~0.24.12"
"react-native-svg": "15.2.0",
"text-encoding-polyfill": "^0.6.7"
},
"devDependencies": {
"@babel/core": "^7.24.3",
Expand All @@ -96,7 +94,7 @@
"@types/crypto-js": "^4.2.2",
"@types/jest": "^29.5.12",
"@types/node": "^20.12.2",
"@types/react": "~18.2.73",
"@types/react": "~18.2.79",
"@types/react-native-onboarding-swiper": "^1.1.9",
"@types/sqlite3": "^3.1.11",
"@typescript-eslint/eslint-plugin": "^7.4.0",
Expand All @@ -116,15 +114,19 @@
"eslint-plugin-simple-import-sort": "^12.0.0",
"eslint-plugin-tsdoc": "^0.2.17",
"jest": "^29.7.0",
"jest-expo": "^50.0.4",
"jest-expo": "~51.0.2",
"metro-config": "^0.80.8",
"prettier": "^3.2.5",
"ts-jest": "^29.1.2",
"ts-jest-resolver": "^2.0.1",
"ts-node": "^10.9.2",
"typescript": "^5.4.3",
"typescript": "~5.3.3",
"websql": "^2.0.3"
},
"overrides": {
"expo": "51.0.8",
"react": "^18.3.1"
},
"homepage": ".",
"contributors": [
{
Expand Down
2 changes: 1 addition & 1 deletion src/screens/QRScan/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { decodeLnInvoice, extractStrFromURL, hasTrustedMint, isCashuToken, isNul
import { decodeUrlOrAddress, isLnurlOrAddress, isUrl } from '@util/lnurl'
import { getTokenInfo } from '@wallet/proofs'
import { BarCodeScanner, PermissionStatus } from 'expo-barcode-scanner'
import { Camera, FlashMode } from 'expo-camera'
import { Camera, FlashMode } from 'expo-camera/legacy'
import { nip19 } from 'nostr-tools'
import { useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
Expand Down
6 changes: 5 additions & 1 deletion src/storage/db/Db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
SQLStmtErrCb,
SQLTxErrCb,
WebSQLDatabase
} from 'expo-sqlite'
} from 'expo-sqlite/legacy'

function isWebSQLDatabase(v: unknown): v is WebSQLDatabase {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
Expand Down Expand Up @@ -223,11 +223,15 @@ export class Db {
db.transaction(tx => {
cmds.forEach(({ sql: sqlStmt, args, cb, errorCb }) => {
tx.executeSql<T>(sqlStmt, args, (tx, result) => {
// TODO provide types to satisfy TS
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
cb?.(tx, result)
endResult.push(result)
// l({result,sqlStmt,args})
}, (tx, error) => {
// l({error,tx})
// TODO provide types to satisfy TS
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
errorCb?.(tx, error)
return true
})
Expand Down
2 changes: 1 addition & 1 deletion src/storage/db/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { CashuMint, deriveKeysetId, getDecodedToken } from '@cashu/cashu-ts'
import { l } from '@log'
import type { IContact, IInvoice, IMint, IMintWithBalance, IPreferences, IPreferencesResp, ITx } from '@model'
import { arrToChunks, isObj } from '@util'
import * as SQLite from 'expo-sqlite'
import * as SQLite from 'expo-sqlite/legacy'

import { Db } from './Db'
import { tables } from './sql/table'
Expand Down
2 changes: 1 addition & 1 deletion src/storage/store/StoreBase.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Db } from '@db/Db'
import { l } from '@log'
import type { IKeyValuePair } from '@model'
import type { Query, SQLResultSetRowList } from 'expo-sqlite'
import type { Query, SQLResultSetRowList } from 'expo-sqlite/legacy'

import { cTo, getBlankSQLResultSetRowList, toJson } from './utils'

Expand Down
2 changes: 1 addition & 1 deletion src/storage/store/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Db } from '@db/Db'
import { l } from '@src/logger'
import * as SQLite from 'expo-sqlite'
import * as SQLite from 'expo-sqlite/legacy'


/* const _storeDbs: { [k: string]: SimpleKeyValueStore } = {} */
Expand Down
2 changes: 1 addition & 1 deletion test/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ i18n.use(initReactI18next).init({
// libraries to mock
// jest.mock('react-native', () => jest.requireActual<typeof import('react-native')>('react-native'))

jest.mock('expo-sqlite', () => ({
jest.mock('expo-sqlite/legacy', () => ({
get openDatabase() {
return (_: string) => getDatabase(':memory:')
}
Expand Down
2 changes: 1 addition & 1 deletion test/wrapper/getTestDb.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Query, SQLiteCb, WebSQLDatabase } from 'expo-sqlite'
import type { Query, SQLiteCb, WebSQLDatabase } from 'expo-sqlite/legacy'
import type { Database } from 'sqlite3'
//import { l } from '@log';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
Expand Down
2 changes: 1 addition & 1 deletion typings/SQLite.types.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* global */
declare module 'expo-sqlite' {
declare module 'expo-sqlite/legacy' {


// @docsMissing
Expand Down

0 comments on commit 6128379

Please sign in to comment.