diff --git a/.github/actions/setup-bun-install/action.yml b/.github/actions/setup-bun-install/action.yml new file mode 100644 index 0000000..dab4545 --- /dev/null +++ b/.github/actions/setup-bun-install/action.yml @@ -0,0 +1,24 @@ +# 🔗 Links: +# Source file: https://github.com/launchtrack/expo-starters/blob/master/.github/actions/setup-bun-install/action.yml +# Composite actions docs: https://docs.github.com/en/actions/creating-actions/creating-a-composite-action + +# ✍️ Description: +# This is a composite action, which means it can be used in other actions. +# It is used in almost all workflows to set up the environment and install dependencies. +# Updating the package manager or Node version here will be reflected in all workflows. + +# 👀 Example usage: +# - name : 📦 Setup bun + install deps +# uses: ./.github/actions/setup-bun + +name: 'Setup Node + PNPM + Install Dependencies' +description: 'Setup Node + PNPM + Install Dependencies' +runs: + using: 'composite' + steps: + - uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + + - name: 📦 Install Project Dependencies + run: bun install --frozen-lockfile \ No newline at end of file diff --git a/.github/workflows/eas-build.yml b/.github/workflows/eas-build.yml new file mode 100644 index 0000000..e8feba4 --- /dev/null +++ b/.github/workflows/eas-build.yml @@ -0,0 +1,28 @@ +name: Publish PWA to Github Pages + +on: + workflow_dispatch: + +jobs: + Build: + name: Publish PWA to Github Pages + runs-on: ubuntu-latest + steps: + + - name: 📦 Checkout project repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: 📦 Setup Node + PNPM + install deps + uses: ./.github/actions/setup-node-pnpm-install + + - name: ⚙️ Run Prebuild + run: bun export + shell: bash + + - name: Deploy + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./dist diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..8631b58 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,28 @@ +{ + "editor.tabSize": 2, + "editor.insertSpaces": true, + "files.insertFinalNewline": true, + "files.trimTrailingWhitespace": true, + "editor.codeActionsOnSave": { + "source.fixAll": "always" + }, + "editor.defaultFormatter": "biomejs.biome", + "editor.formatOnSave": true, + "typescript.enablePromptUseWorkspaceTsdk": true, + "typescript.tsdk": "node_modules/typescript/lib", + "[typescriptreact]": { + "editor.defaultFormatter": "vscode.typescript-language-features" + }, + "[typescript]": { + "editor.defaultFormatter": "biomejs.biome" + }, + "[javascript]": { + "editor.defaultFormatter": "biomejs.biome" + }, + "css.customData": [ + ".vscode/css_custom_data.json" + ], + "files.associations": { + "*.css": "tailwindcss" + } + } diff --git a/app/index.tsx b/app/index.tsx index 6608955..e2e5dee 100644 --- a/app/index.tsx +++ b/app/index.tsx @@ -3,6 +3,7 @@ import { FlashList } from "@shopify/flash-list"; import { Stack, useRouter } from "expo-router"; import * as React from "react"; import { FlatList, View } from "react-native"; +import { ThemeToggle } from "~/components/ThemeToggle"; import { Badge } from "~/components/ui/badge"; import { Button } from "~/components/ui/button"; import { @@ -38,7 +39,7 @@ const HabitCard: React.FC = ({ habit, onDelete }) => { - + @@ -55,7 +56,7 @@ export default function Screen() { const [habits, setHabits] = React.useState([]); const ref = React.useRef(null); useScrollToTop(ref); - + const router = useRouter(); React.useEffect(() => { @@ -78,9 +79,7 @@ export default function Screen() { options={{ title: "Habits", headerRight: () => ( - + ), }} /> @@ -97,6 +96,9 @@ export default function Screen() { keyExtractor={(item) => item.id} ListFooterComponent={} /> + ); } diff --git a/bun.lockb b/bun.lockb index a6e1c5f..b391a67 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index c74f0b7..39717cc 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,8 @@ "android": "expo run:android", "ios": "expo run:ios", "web": "expo start -c --web", - "format": "biome check --no-errors-on-unmatched --apply .", - "postinstall": "npx tailwindcss -i ./global.css -o ./node_modules/.cache/nativewind/global.css" + "export": "expo export -p web", + "format": "biome check --no-errors-on-unmatched --apply ." }, "dependencies": { "@gorhom/bottom-sheet": "^4.6.1", @@ -32,7 +32,7 @@ "@radix-ui/react-tooltip": "^1.0.7", "@react-native-async-storage/async-storage": "1.21.0", "@react-navigation/native": "^6.0.2", - "@shopify/flash-list": "^1.6.4", + "@shopify/flash-list": "^1.6.3", "class-variance-authority": "^0.7.0", "clsx": "^2.1.0", "expo": "~50.0.17", @@ -43,7 +43,7 @@ "expo-status-bar": "~1.11.1", "expo-system-ui": "~2.9.4", "lucide-react-native": "^0.314.0", - "nativewind": "^4.0.1", + "nativewind": "^4.0.36", "phosphor-react-native": "^2.0.0", "react": "18.2.0", "react-dom": "18.2.0",