Skip to content

Commit 8ffb1b0

Browse files
authored
Merge pull request #802 from plebbit/development
Development
2 parents dd611b3 + f65635b commit 8ffb1b0

Some content is hidden

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

67 files changed

+1019
-744
lines changed

.github/workflows/test.yml

Lines changed: 285 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,285 @@
1+
name: Test Builds
2+
3+
on:
4+
push:
5+
branches: [ development, master ]
6+
pull_request:
7+
branches: [ development, master ]
8+
9+
jobs:
10+
test-linux:
11+
name: Test Linux (Ubuntu)
12+
runs-on: ubuntu-22.04
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Setup Node.js v22
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: 22
22+
cache: 'yarn'
23+
24+
- name: Install dependencies
25+
run: yarn install --frozen-lockfile --ignore-engines
26+
27+
- name: Download IPFS
28+
run: node electron/download-ipfs && chmod +x bin/linux/ipfs
29+
30+
- name: Build React App
31+
run: yarn build
32+
env:
33+
CI: ''
34+
35+
- name: Build Electron App (Linux)
36+
run: yarn electron:build:linux
37+
38+
- name: Smoke Test
39+
run: |
40+
echo "Testing AppImage startup..."
41+
APPIMAGE=$(find dist -name "*.AppImage" | head -n 1)
42+
echo "Found AppImage: $APPIMAGE"
43+
chmod +x "$APPIMAGE"
44+
# Use --appimage-extract-and-run to avoid FUSE requirement in CI
45+
# Run with timeout and expect it to start (will be killed after timeout)
46+
timeout 10s "$APPIMAGE" --appimage-extract-and-run --no-sandbox &
47+
APP_PID=$!
48+
sleep 5
49+
# Check if process is still running (means it started successfully)
50+
if kill -0 $APP_PID 2>/dev/null; then
51+
echo "✓ App started successfully"
52+
kill $APP_PID 2>/dev/null || true
53+
exit 0
54+
else
55+
echo "✗ App failed to start"
56+
exit 1
57+
fi
58+
59+
test-mac-intel:
60+
name: Test Mac (Intel)
61+
runs-on: macos-15-intel
62+
steps:
63+
- uses: actions/checkout@v4
64+
with:
65+
fetch-depth: 0
66+
67+
- name: Setup Node.js v22
68+
uses: actions/setup-node@v4
69+
with:
70+
node-version: 22
71+
cache: 'yarn'
72+
73+
- name: Install setuptools for native modules
74+
run: |
75+
# Use pip with --break-system-packages for CI environment
76+
pip3 install --break-system-packages setuptools || pip3 install --user setuptools || true
77+
78+
- name: Install dependencies
79+
run: yarn install --frozen-lockfile --ignore-engines
80+
81+
- name: Download IPFS
82+
run: node electron/download-ipfs && chmod +x bin/mac/ipfs
83+
84+
- name: Build React App
85+
run: yarn build
86+
env:
87+
CI: ''
88+
89+
- name: Build Electron App
90+
run: yarn electron:build:mac
91+
92+
- name: Smoke Test
93+
run: |
94+
if [ -d "dist/mac/5chan.app" ]; then
95+
echo "Testing dist/mac/5chan.app..."
96+
# Run the app in background - it will start IPFS which takes time
97+
# We just verify it launches without crashing
98+
./dist/mac/5chan.app/Contents/MacOS/5chan &
99+
APP_PID=$!
100+
sleep 10
101+
# Check if process is still running (means it started successfully)
102+
if kill -0 $APP_PID 2>/dev/null; then
103+
echo "✓ App started successfully"
104+
kill $APP_PID 2>/dev/null || true
105+
# Also kill any child processes (IPFS)
106+
pkill -P $APP_PID 2>/dev/null || true
107+
pkill -f ipfs 2>/dev/null || true
108+
exit 0
109+
else
110+
echo "✗ App failed to start or crashed"
111+
exit 1
112+
fi
113+
else
114+
echo "Could not find dist/mac/5chan.app to test"
115+
ls -R dist
116+
exit 1
117+
fi
118+
119+
test-mac-arm:
120+
name: Test Mac (Apple Silicon)
121+
runs-on: macOS-14
122+
steps:
123+
- uses: actions/checkout@v4
124+
with:
125+
fetch-depth: 0
126+
127+
- name: Setup Node.js v22
128+
uses: actions/setup-node@v4
129+
with:
130+
node-version: 22
131+
cache: 'yarn'
132+
133+
- name: Install setuptools for native modules
134+
run: |
135+
# Use pip with --break-system-packages for CI environment
136+
pip3 install --break-system-packages setuptools || pip3 install --user setuptools || true
137+
138+
- name: Install dependencies
139+
run: yarn install --frozen-lockfile --ignore-engines
140+
141+
- name: Download IPFS
142+
run: node electron/download-ipfs && chmod +x bin/mac/ipfs
143+
144+
- name: Build React App
145+
run: yarn build
146+
env:
147+
CI: ''
148+
149+
- name: Build Electron App
150+
# On M1 runner, this should produce arm64 build
151+
run: yarn electron:build:mac
152+
153+
- name: Smoke Test
154+
run: |
155+
if [ -d "dist/mac-arm64/5chan.app" ]; then
156+
APP_PATH="dist/mac-arm64/5chan.app"
157+
elif [ -d "dist/mac/5chan.app" ]; then
158+
APP_PATH="dist/mac/5chan.app"
159+
else
160+
echo "Could not find 5chan.app to test"
161+
ls -R dist
162+
exit 1
163+
fi
164+
165+
echo "Testing $APP_PATH..."
166+
# Run the app in background - it will start IPFS which takes time
167+
# We just verify it launches without crashing
168+
"./$APP_PATH/Contents/MacOS/5chan" &
169+
APP_PID=$!
170+
sleep 10
171+
# Check if process is still running (means it started successfully)
172+
if kill -0 $APP_PID 2>/dev/null; then
173+
echo "✓ App started successfully"
174+
kill $APP_PID 2>/dev/null || true
175+
# Also kill any child processes (IPFS)
176+
pkill -P $APP_PID 2>/dev/null || true
177+
pkill -f ipfs 2>/dev/null || true
178+
exit 0
179+
else
180+
echo "✗ App failed to start or crashed"
181+
exit 1
182+
fi
183+
184+
test-windows:
185+
name: Test Windows
186+
runs-on: windows-2022
187+
steps:
188+
- uses: actions/checkout@v4
189+
with:
190+
fetch-depth: 0
191+
192+
- name: Setup Node.js v22
193+
uses: actions/setup-node@v4
194+
with:
195+
node-version: 22
196+
cache: 'yarn'
197+
198+
- name: Install dependencies
199+
run: yarn install --frozen-lockfile --ignore-engines --network-timeout 100000 --network-concurrency 1
200+
201+
- name: Download IPFS
202+
run: node electron/download-ipfs
203+
204+
- name: Build React App
205+
run: yarn build
206+
env:
207+
CI: ''
208+
209+
- name: Build Electron App
210+
run: yarn electron:build:windows
211+
212+
- name: Smoke Test
213+
shell: bash
214+
run: |
215+
# Try to find the unpacked executable first as it's easiest to run
216+
if [ -d "dist/win-unpacked" ]; then
217+
echo "Testing unpacked exe..."
218+
# Run with timeout - app starts IPFS so won't exit on its own
219+
timeout 15s ./dist/win-unpacked/5chan.exe &
220+
APP_PID=$!
221+
sleep 8
222+
# Check if process started successfully
223+
if kill -0 $APP_PID 2>/dev/null; then
224+
echo "✓ App started successfully"
225+
taskkill //F //PID $APP_PID 2>/dev/null || true
226+
# Kill any IPFS processes
227+
taskkill //F //IM ipfs.exe 2>/dev/null || true
228+
exit 0
229+
else
230+
echo "✗ App failed to start"
231+
exit 1
232+
fi
233+
else
234+
echo "No unpacked directory found"
235+
ls -R dist
236+
exit 1
237+
fi
238+
239+
test-android:
240+
name: Test Android
241+
runs-on: ubuntu-22.04
242+
steps:
243+
- uses: actions/checkout@v4
244+
with:
245+
fetch-depth: 0
246+
247+
- name: Setup Node.js v22
248+
uses: actions/setup-node@v4
249+
with:
250+
node-version: 22
251+
cache: 'yarn'
252+
253+
- name: Setup Java 17
254+
uses: actions/setup-java@v4
255+
with:
256+
distribution: 'temurin'
257+
java-version: '17'
258+
259+
- name: Install dependencies
260+
run: yarn install --frozen-lockfile --ignore-engines
261+
262+
- name: Build React App
263+
run: yarn build
264+
env:
265+
CI: ''
266+
267+
- name: Sync Capacitor
268+
run: npx cap sync android
269+
270+
- name: Build Android APK
271+
run: |
272+
cd android
273+
chmod +x gradlew
274+
./gradlew assembleDebug
275+
276+
- name: Verify APK exists
277+
run: |
278+
APK=$(find android/app/build/outputs/apk -name "*.apk" | head -n 1)
279+
if [ -n "$APK" ]; then
280+
echo "✓ APK built successfully: $APK"
281+
ls -lh "$APK"
282+
else
283+
echo "✗ No APK found"
284+
exit 1
285+
fi

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ To have your board appear in a directory on the 5chan homepage:
100100
- **Web client and electron client**: `yarn electron:start`
101101
- **Web client and electron client** (don't delete data): `yarn electron:start:no-delete-data`
102102

103+
### Challenge Types
104+
105+
Subplebbits can require challengers to solve one or more prompts before a publication is accepted. 5chan already supported text and image prompts, and now also handles `url/iframe` challenges so Mintpass communities can run their iframe flow directly inside the modal. The modal first shows a hostname confirmation (showing only the host for mintpass.org, full URL otherwise), then opens the HTTPS iframe with the current theme, replaces `{userAddress}` tokens with the signed-in address, and submits automatically when the user finishes.
106+
103107
### Build
104108

105109
The Linux/Windows/macOS/Android build scripts are in [.github/workflows/release.yml](https://github.com/plebbit/5chan/blob/master/.github/workflows/release.yml)

capacitor.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { CapacitorConfig } from '@capacitor/cli';
33
const config: CapacitorConfig = {
44
appId: 'fivechan.android',
55
appName: '5chan',
6-
webDir: 'build',
6+
webDir: 'dist',
77
plugins: {
88
CapacitorHttp: {
99
enabled: true,

package.json

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"cross-env": "7.0.3",
2525
"electron-context-menu": "3.3.0",
2626
"electron-is-dev": "2.0.0",
27+
"env-paths": "3.0.0",
2728
"fs-extra": "11.3.0",
2829
"http-proxy": "1.18.1",
2930
"i18next": "23.5.1",
@@ -46,7 +47,7 @@
4647
"remark-supersub": "1.0.0",
4748
"tcp-port-used": "1.0.2",
4849
"typescript": "5.1.6",
49-
"uuid": "^13.0.0",
50+
"uuid": "13.0.0",
5051
"zustand": "4.4.3"
5152
},
5253
"scripts": {
@@ -96,13 +97,13 @@
9697
"@capacitor/cli": "7.2.0",
9798
"@capacitor/core": "7.2.0",
9899
"@electron/rebuild": "4.0.0",
99-
"@react-scan/vite-plugin-react-scan": "^0.1.8",
100+
"@react-scan/vite-plugin-react-scan": "0.1.8",
100101
"@types/memoizee": "0.4.9",
101102
"@typescript-eslint/eslint-plugin": "8.29.0",
102103
"@typescript-eslint/parser": "8.29.0",
103104
"@vitejs/plugin-react": "4.3.4",
104105
"assert": "2.1.0",
105-
"babel-plugin-react-compiler": "19.0.0-beta-40c6c23-20250301",
106+
"babel-plugin-react-compiler": "1.0.0",
106107
"buffer": "6.0.3",
107108
"concurrently": "8.0.1",
108109
"conventional-changelog-cli": "4.1.0",
@@ -116,25 +117,21 @@
116117
"eslint": "8.56.0",
117118
"eslint-config-react-app": "7.0.1",
118119
"eslint-plugin-react": "7.37.4",
119-
"eslint-plugin-react-compiler": "19.0.0-beta-40c6c23-20250301",
120+
"eslint-plugin-react-compiler": "19.1.0-rc.2",
120121
"eslint-plugin-react-hooks": "5.2.0",
121122
"husky": "4.3.8",
122123
"isomorphic-fetch": "3.0.0",
123124
"lint-staged": "12.3.8",
124-
"react-grab": "^0.0.18",
125-
"react-scan": "^0.4.3",
125+
"progress": "2.0.3",
126+
"react-grab": "0.0.18",
127+
"react-scan": "0.4.3",
126128
"stream-browserify": "3.0.0",
127129
"vite": "6.2.1",
128130
"vite-plugin-eslint": "1.8.1",
129131
"vite-plugin-node-polyfills": "0.23.0",
130132
"vite-plugin-pwa": "0.21.1",
131133
"wait-on": "7.0.1"
132134
},
133-
"resolutions": {
134-
"@bonfida/spl-name-service": "3.0.0",
135-
"@libp2p/utils": "7.0.7",
136-
"@noble/hashes": "1.8.0"
137-
},
138135
"main": "electron/main.js",
139136
"build": {
140137
"appId": "5chan.desktop",

0 commit comments

Comments
 (0)