Skip to content

Commit 28ee5fa

Browse files
committed
feat(app): chat parsing
1 parent 522ba03 commit 28ee5fa

File tree

189 files changed

+24084
-3463
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+24084
-3463
lines changed

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,14 @@ bun.lockb
7575
# google services android
7676
google-services-*.json
7777

78-
# google services IOS
78+
# # google services IOS
7979
GoogleService-*-*.plist
8080

8181
.env.local
8282

8383
# app builds
8484
*.abd
85-
*.apk
85+
*.apk
86+
87+
# Google Service Account JSON key
88+
FOAM_ANDROID_TESTFLIGHT_KEY.json

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20.10.0
1+
22

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,19 @@ You will then need to start the proxy server before you start up the app to prox
7070
Start the proxy server
7171

7272
```bash
73-
bun start:proxy
73+
bun run start:proxy
7474
```
7575

7676
Start the app
7777

7878
```bash
79-
bun start
79+
bun run ios
8080
```
8181

8282
Create a development build (if needed)
8383

8484
```bash
85-
bun run prebuild:ios
86-
bun run prebuild:android
85+
bun run prebuild
8786
```
8887

8988
## Contributing
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from '@react-native-async-storage/async-storage/jest/async-storage-mock';
File renamed without changes.

__mocks__/react-native-webview.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default 'WebView';

__mocks__/zustand.ts

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import { act } from '@testing-library/react-native';
2+
import type * as ZustandExportedTypes from 'zustand';
3+
4+
export * from 'zustand';
5+
6+
const { create: actualCreate, createStore: actualCreateStore } =
7+
jest.requireActual<typeof ZustandExportedTypes>('zustand');
8+
9+
// a variable to hold reset functions for all stores declared in the app
10+
export const storeResetFns = new Set<() => void>();
11+
12+
const createUncurried = <T>(
13+
stateCreator: ZustandExportedTypes.StateCreator<T>,
14+
) => {
15+
const store = actualCreate(stateCreator);
16+
const initialState = store.getInitialState();
17+
storeResetFns.add(() => {
18+
store.setState(initialState, true);
19+
});
20+
return store;
21+
};
22+
23+
// when creating a store, we get its initial state, create a reset function and add it in the set
24+
export const create = (<T>(
25+
stateCreator: ZustandExportedTypes.StateCreator<T>,
26+
) => {
27+
// to support curried version of create
28+
return typeof stateCreator === 'function'
29+
? createUncurried(stateCreator)
30+
: createUncurried;
31+
}) as typeof ZustandExportedTypes.create;
32+
33+
const createStoreUncurried = <T>(
34+
stateCreator: ZustandExportedTypes.StateCreator<T>,
35+
) => {
36+
const store = actualCreateStore(stateCreator);
37+
const initialState = store.getInitialState();
38+
storeResetFns.add(() => {
39+
store.setState(initialState, true);
40+
});
41+
return store;
42+
};
43+
44+
// when creating a store, we get its initial state, create a reset function and add it in the set
45+
export const createStore = (<T>(
46+
stateCreator: ZustandExportedTypes.StateCreator<T>,
47+
) => {
48+
// to support curried version of createStore
49+
return typeof stateCreator === 'function'
50+
? createStoreUncurried(stateCreator)
51+
: createStoreUncurried;
52+
}) as typeof ZustandExportedTypes.createStore;
53+
54+
// reset all stores after each test run
55+
afterEach(() => {
56+
act(() => {
57+
storeResetFns.forEach(resetFn => {
58+
resetFn();
59+
});
60+
});
61+
});

app.config.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ import type { AppIconBadgeConfig } from 'app-icon-badge/types';
44
import fs from 'fs';
55
import path from 'path';
66

7-
// @todo luke-h1:
8-
// setup prod images ✅
9-
107
interface AppVariantConfig {
118
name: string;
129
androidPackageName: string;
@@ -67,7 +64,7 @@ const googleServicesExist = fs.existsSync(
6764
);
6865

6966
const appIconBadgeConfig: AppIconBadgeConfig = {
70-
enabled: true,
67+
enabled: variant !== 'production',
7168
badges: [
7269
{
7370
text: variant,

assets/licenses.json

Lines changed: 1219 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)