refactor: move into monorepo

This commit is contained in:
Max Koon
2025-11-08 13:37:55 -05:00
parent 63670ff3b0
commit 058f2bb94f
50 changed files with 1550 additions and 1523 deletions

View File

@@ -8,7 +8,7 @@
}, },
"dependencies": { "dependencies": {
"@hono/node-server": "^1.19.5", "@hono/node-server": "^1.19.5",
"@money/shared": "link:../shared", "@money/shared": "workspace:*",
"better-auth": "^1.3.27", "better-auth": "^1.3.27",
"hono": "^4.9.12", "hono": "^4.9.12",
"plaid": "^39.0.0", "plaid": "^39.0.0",

6
apps/expo/.gitignore vendored Normal file
View File

@@ -0,0 +1,6 @@
# @generated expo-cli sync-2b81b286409207a5da26e14c78851eb30d8ccbdb
# The following patterns were generated by expo-cli
expo-env.d.ts
# @end expo-cli

View File

@@ -4,10 +4,10 @@ import 'react-native-reanimated';
import { authClient } from '@/lib/auth-client'; import { authClient } from '@/lib/auth-client';
import { ZeroProvider } from '@rocicorp/zero/react'; import { ZeroProvider } from '@rocicorp/zero/react';
import { useMemo } from 'react'; import { useMemo } from 'react';
import { authDataSchema } from '@/shared/src/auth'; import { authDataSchema } from '@money/shared/auth';
import { Platform } from 'react-native'; import { Platform } from 'react-native';
import type { ZeroOptions } from '@rocicorp/zero'; import type { ZeroOptions } from '@rocicorp/zero';
import { schema, type Schema, createMutators, type Mutators, BASE_URL } from '@/shared/src'; import { schema, type Schema, createMutators, type Mutators, BASE_URL } from '@money/shared';
import { expoSQLiteStoreProvider } from "@rocicorp/zero/react-native"; import { expoSQLiteStoreProvider } from "@rocicorp/zero/react-native";
export const unstable_settings = { export const unstable_settings = {

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 77 KiB

View File

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 384 KiB

After

Width:  |  Height:  |  Size: 384 KiB

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -1,5 +1,5 @@
import { authClient } from "@/lib/auth-client"; import { authClient } from "@/lib/auth-client";
import { queries } from "@/shared/src"; import { queries } from "@money/shared";
import { useQuery } from "@rocicorp/zero/react"; import { useQuery } from "@rocicorp/zero/react";
import { Link, usePathname, useRouter, type LinkProps } from "expo-router"; import { Link, usePathname, useRouter, type LinkProps } from "expo-router";
import { useEffect } from "react"; import { useEffect } from "react";
@@ -42,7 +42,7 @@ export default function Header() {
return ( return (
<View style={{ flexDirection: "row", justifyContent: "space-between", backgroundColor: "#efe" }}> <View style={{ flexDirection: "row", justifyContent: "space-between", backgroundColor: "#f7e2c8" }}>
<View style={{ flexDirection: "row" }}> <View style={{ flexDirection: "row" }}>
{PAGES.map(page => <Page {PAGES.map(page => <Page
key={page.name} key={page.name}

61
apps/expo/package.json Normal file
View File

@@ -0,0 +1,61 @@
{
"name": "@money/expo",
"main": "expo-router/entry",
"version": "1.0.0",
"scripts": {
"start": "expo start",
"reset-project": "node ./scripts/reset-project.js",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"build": "expo export --platform web",
"lint": "expo lint",
"db:migrate": "dotenv -- pnpm run --dir=shared db:migrate",
"db:gen": "dotenv -- pnpm run --dir=shared generate:zero"
},
"dependencies": {
"@better-auth/expo": "^1.3.27",
"@expo/vector-icons": "^15.0.2",
"@money/shared": "workspace:*",
"@react-navigation/bottom-tabs": "^7.4.0",
"@react-navigation/elements": "^2.6.3",
"@react-navigation/native": "^7.1.8",
"@rocicorp/zero": "^0.23.2025090100",
"better-auth": "^1.3.27",
"drizzle-orm": "^0.44.6",
"expo": "~54.0.13",
"expo-constants": "~18.0.9",
"expo-crypto": "~15.0.7",
"expo-font": "~14.0.9",
"expo-haptics": "~15.0.7",
"expo-image": "~3.0.9",
"expo-linking": "~8.0.8",
"expo-router": "~6.0.11",
"expo-splash-screen": "~31.0.10",
"expo-sqlite": "~16.0.8",
"expo-status-bar": "~3.0.8",
"expo-symbols": "~1.0.7",
"expo-system-ui": "~6.0.7",
"expo-web-browser": "~15.0.8",
"pg": "^8.16.3",
"react": "19.1.0",
"react-dom": "19.1.0",
"react-native": "0.81.4",
"react-native-gesture-handler": "~2.28.0",
"react-native-reanimated": "~4.1.1",
"react-native-safe-area-context": "~5.6.0",
"react-native-screens": "~4.16.0",
"react-native-web": "~0.21.0",
"react-native-worklets": "0.5.1"
},
"devDependencies": {
"@types/pg": "^8.15.5",
"@types/react": "~19.1.0",
"dotenv-cli": "^10.0.0",
"drizzle-kit": "^0.31.5",
"eslint": "^9.25.0",
"eslint-config-expo": "~10.0.0",
"typescript": "~5.9.2"
},
"private": true
}

View File

@@ -1,71 +1,17 @@
{ {
"name": "money", "name": "money",
"main": "expo-router/entry", "private": true,
"version": "1.0.0",
"scripts": { "scripts": {
"start": "expo start",
"reset-project": "node ./scripts/reset-project.js",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"build": "expo export --platform web",
"lint": "expo lint",
"db:migrate": "dotenv -- pnpm run --dir=shared db:migrate",
"db:gen": "dotenv -- pnpm run --dir=shared generate:zero",
"dev": "process-compose up -p 0" "dev": "process-compose up -p 0"
}, },
"dependencies": {
"@better-auth/expo": "^1.3.27",
"@expo/vector-icons": "^15.0.2",
"@money/shared": "link:shared",
"@react-navigation/bottom-tabs": "^7.4.0",
"@react-navigation/elements": "^2.6.3",
"@react-navigation/native": "^7.1.8",
"@rocicorp/zero": "^0.23.2025090100",
"better-auth": "^1.3.27",
"drizzle-orm": "^0.44.6",
"expo": "~54.0.13",
"expo-constants": "~18.0.9",
"expo-crypto": "~15.0.7",
"expo-font": "~14.0.9",
"expo-haptics": "~15.0.7",
"expo-image": "~3.0.9",
"expo-linking": "~8.0.8",
"expo-router": "~6.0.11",
"expo-splash-screen": "~31.0.10",
"expo-sqlite": "~16.0.8",
"expo-status-bar": "~3.0.8",
"expo-symbols": "~1.0.7",
"expo-system-ui": "~6.0.7",
"expo-web-browser": "~15.0.8",
"pg": "^8.16.3",
"react": "19.1.0",
"react-dom": "19.1.0",
"react-native": "0.81.4",
"react-native-gesture-handler": "~2.28.0",
"react-native-reanimated": "~4.1.1",
"react-native-safe-area-context": "~5.6.0",
"react-native-screens": "~4.16.0",
"react-native-web": "~0.21.0",
"react-native-worklets": "0.5.1"
},
"devDependencies": {
"@types/pg": "^8.15.5",
"@types/react": "~19.1.0",
"dotenv-cli": "^10.0.0",
"drizzle-kit": "^0.31.5",
"eslint": "^9.25.0",
"eslint-config-expo": "~10.0.0",
"typescript": "~5.9.2"
},
"private": true,
"pnpm": { "pnpm": {
"onlyBuiltDependencies": [ "onlyBuiltDependencies": [
"@rocicorp/zero-sqlite3" "@rocicorp/zero-sqlite3"
], ],
"ignoredBuiltDependencies": [ "ignoredBuiltDependencies": [
"esbuild", "esbuild",
"protobufjs" "protobufjs",
"unrs-resolver"
] ]
} }
} }

2925
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
nodeLinker: hoisted nodeLinker: hoisted
packages: packages:
- 'api' - 'apps/*'
- 'shared' - 'packages/*'

View File

@@ -29,14 +29,13 @@ processes:
command: "pnpm tsx ./scripts/set-machine-name.ts" command: "pnpm tsx ./scripts/set-machine-name.ts"
expo: expo:
command: "pnpm start" command: "pnpm --filter=@money/expo start"
depends_on: depends_on:
tailscale_machine_name: tailscale_machine_name:
condition: process_completed_successfully condition: process_completed_successfully
api: api:
command: "pnpm run dev" command: "pnpm --filter=@money/api dev"
working_dir: ./api
migrate: migrate:
command: | command: |
@@ -49,7 +48,7 @@ processes:
db: db:
condition: process_healthy condition: process_healthy
zero: zero:
command: npx zero-cache-dev -p shared/src/schema.ts command: npx zero-cache-dev -p packages/shared/src/schema.ts
depends_on: depends_on:
migrate: migrate:
condition: process_completed_successfully condition: process_completed_successfully