Skip to content

Commit 563132a

Browse files
committed
refactor: Externalize library code to react-native-expressive submodule
This setup adds more separation between the library code and the app while retaining hot-reloading of the app when changing library code.
1 parent fe4fe38 commit 563132a

35 files changed

+18
-1952
lines changed

.github/workflows/android.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@v4
19+
with:
20+
submodules: 'recursive'
1921
- name: Setup Java
2022
uses: actions/setup-java@v4
2123
with:

.github/workflows/checks.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@v4
19+
with:
20+
submodules: 'recursive'
1921
- name: Setup Node
2022
uses: actions/setup-node@v4
2123
with:

.github/workflows/ios.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
runs-on: macos-latest
1919
steps:
2020
- uses: actions/checkout@v4
21+
with:
22+
submodules: 'recursive'
2123
- name: Setup Java
2224
uses: actions/setup-java@v4
2325
with:

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "lib/react-native-expressive"]
2+
path = lib/react-native-expressive
3+
url = https://github.com/thehale/react-native-expressive

App.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
import { StyleSheet, View } from 'react-native';
22

3-
import Divider from '@components/Divider';
3+
import { Divider, useMaterialTheme } from 'react-native-expressive';
44
import HabitList from './src/ui/HabitList';
55
import ManualSync from './src/ui/ManualSync';
66
import React from 'react';
77
import { TokenManagement } from './src/ui/TokenManagement';
8-
import { useTheme } from './lib/theme/useTheme';
98
import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context';
109

1110
export default function App() {
12-
const { theme } = useTheme();
11+
const { theme } = useMaterialTheme();
1312
return (
1413
<SafeAreaProvider>
1514
<SafeAreaView style={[styles.container, { backgroundColor: theme.colors.background }]}>

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = {
77
extensions: ['.ios.js', '.android.js', '.ios.jsx', '.android.jsx', '.js', '.jsx', '.json', '.ts', '.tsx'],
88
root: ['.'],
99
alias: {
10-
'@components': './lib/components',
10+
'react-native-expressive': './lib/react-native-expressive/src',
1111
},
1212
},
1313
],

lib/README.md

Lines changed: 0 additions & 67 deletions
This file was deleted.

lib/components/Button.tsx

Lines changed: 0 additions & 187 deletions
This file was deleted.

0 commit comments

Comments
 (0)