Skip to content

Commit 8e02161

Browse files
authored
Merge pull request #1 from qdriven/main
layout updated
2 parents baec9a4 + a985623 commit 8e02161

File tree

138 files changed

+1773
-37
lines changed

Some content is hidden

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

138 files changed

+1773
-37
lines changed

innate-next-mono/apps/desktop/src/app/globals.css

Lines changed: 0 additions & 1 deletion
This file was deleted.
File renamed without changes.
File renamed without changes.

playground/apps/desktop/build.sh

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
RED='\033[0;31m'
5+
GREEN='\033[0;32m'
6+
YELLOW='\033[1;33m'
7+
BLUE='\033[0;34m'
8+
NC='\033[0m'
9+
10+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
11+
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
12+
DESKTOP_DIR="$SCRIPT_DIR"
13+
TAURI_DIR="$DESKTOP_DIR/src-tauri"
14+
DIST_DIR="$TAURI_DIR/target/release"
15+
BUNDLE_DIR="$DIST_DIR/bundle"
16+
APP_NAME="Innate Playground"
17+
APP_VERSION="0.1.0"
18+
19+
log_info() { echo -e "${BLUE}[INFO]${NC} $1"; }
20+
log_ok() { echo -e "${GREEN}[OK]${NC} $1"; }
21+
log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
22+
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
23+
24+
check_prerequisites() {
25+
log_info "Checking prerequisites..."
26+
27+
command -v node >/dev/null 2>&1 || { log_error "Node.js not found"; exit 1; }
28+
command -v pnpm >/dev/null 2>&1 || { log_error "pnpm not found"; exit 1; }
29+
command -v rustc >/dev/null 2>&1 || { log_error "Rust not found. Install from https://rustup.rs"; exit 1; }
30+
command -v cargo >/dev/null 2>&1 || { log_error "Cargo not found"; exit 1; }
31+
32+
log_ok "Node $(node -v), pnpm $(pnpm -v), rustc $(rustc --version)"
33+
}
34+
35+
install_deps() {
36+
log_info "Installing dependencies..."
37+
cd "$PROJECT_ROOT"
38+
pnpm install --frozen-lockfile 2>/dev/null || pnpm install
39+
log_ok "Dependencies installed"
40+
}
41+
42+
build_frontend() {
43+
log_info "Building Next.js static export..."
44+
cd "$DESKTOP_DIR"
45+
pnpm build
46+
log_ok "Frontend built -> $DESKTOP_DIR/out/"
47+
}
48+
49+
build_tauri() {
50+
log_info "Building Tauri desktop app..."
51+
cd "$DESKTOP_DIR"
52+
pnpm tauri build
53+
log_ok "Tauri build complete"
54+
}
55+
56+
create_dmg() {
57+
local dmg_path="$BUNDLE_DIR/dmg/${APP_NAME}_${APP_VERSION}_$(uname -m).dmg"
58+
local app_path="$BUNDLE_DIR/macos/${APP_NAME}.app"
59+
60+
if [ -f "$dmg_path" ]; then
61+
log_ok "DMG already exists: $dmg_path"
62+
return 0
63+
fi
64+
65+
if [ ! -d "$app_path" ]; then
66+
log_error ".app bundle not found at $app_path"
67+
return 1
68+
fi
69+
70+
log_info "Creating DMG..."
71+
mkdir -p "$(dirname "$dmg_path")"
72+
hdiutil create \
73+
-volname "$APP_NAME" \
74+
-srcfolder "$app_path" \
75+
-ov \
76+
-format UDZO \
77+
"$dmg_path"
78+
log_ok "DMG created: $dmg_path"
79+
}
80+
81+
print_summary() {
82+
echo ""
83+
echo "========================================="
84+
echo -e "${GREEN} Build Summary${NC}"
85+
echo "========================================="
86+
echo ""
87+
88+
local app_path="$BUNDLE_DIR/macos/${APP_NAME}.app"
89+
local binary_path="$DIST_DIR/innate-playground"
90+
local dmg_path="$BUNDLE_DIR/dmg/${APP_NAME}_${APP_VERSION}_$(uname -m).dmg"
91+
92+
if [ -d "$app_path" ]; then
93+
local app_size
94+
app_size=$(du -sh "$app_path" | cut -f1)
95+
log_ok ".app bundle: $app_path ($app_size)"
96+
fi
97+
98+
if [ -f "$binary_path" ]; then
99+
local bin_size
100+
bin_size=$(du -sh "$binary_path" | cut -f1)
101+
log_ok "Binary: $binary_path ($bin_size)"
102+
fi
103+
104+
if [ -f "$dmg_path" ]; then
105+
local dmg_size
106+
dmg_size=$(du -sh "$dmg_path" | cut -f1)
107+
log_ok "DMG: $dmg_path ($dmg_size)"
108+
fi
109+
110+
echo ""
111+
echo "Open the app:"
112+
echo " open \"$app_path\""
113+
echo ""
114+
}
115+
116+
clean() {
117+
log_info "Cleaning build artifacts..."
118+
cd "$DESKTOP_DIR"
119+
rm -rf out .next
120+
cd "$TAURI_DIR"
121+
rm -rf target
122+
log_ok "Clean complete"
123+
}
124+
125+
dev() {
126+
log_info "Starting dev server..."
127+
cd "$DESKTOP_DIR"
128+
pnpm tauri dev
129+
}
130+
131+
case "${1:-build}" in
132+
build)
133+
check_prerequisites
134+
install_deps
135+
build_frontend
136+
build_tauri
137+
create_dmg || log_warn "DMG creation failed (may need to run outside sandbox)"
138+
print_summary
139+
;;
140+
dev)
141+
dev
142+
;;
143+
clean)
144+
clean
145+
;;
146+
frontend)
147+
check_prerequisites
148+
install_deps
149+
build_frontend
150+
log_ok "Frontend only build complete -> $DESKTOP_DIR/out/"
151+
;;
152+
dmg)
153+
create_dmg
154+
;;
155+
help|--help|-h)
156+
echo "Usage: ./build.sh [command]"
157+
echo ""
158+
echo "Commands:"
159+
echo " build Full build: deps + frontend + Tauri + DMG (default)"
160+
echo " dev Start Tauri dev server with hot reload"
161+
echo " frontend Build Next.js static export only"
162+
echo " dmg Create DMG from existing .app bundle"
163+
echo " clean Remove all build artifacts"
164+
echo " help Show this help message"
165+
;;
166+
*)
167+
log_error "Unknown command: $1"
168+
echo "Run './build.sh help' for usage."
169+
exit 1
170+
;;
171+
esac
File renamed without changes.

0 commit comments

Comments
 (0)