chore: scaffold Expo app with tooling, config, original icons and licence
- Expo SDK 57 / React Native 0.86 / TypeScript strict - ESLint (expo config), Prettier, jest-expo setup - app identifiers org.giteanative.app, deep-link scheme giteanative - original git-branch app icons generated from scratch (scripts/generate-icons.py) - MIT licence for the Gitea Native contributors (unofficial project)
This commit is contained in:
commit
26a6eba1e5
19 files changed
+15859
No files matched your search
+43
@@ -0,0 +1,43 @@
|
||||
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
|
||||
|
||||
# dependencies
|
||||
node_modules/
|
||||
|
||||
# Expo
|
||||
.expo/
|
||||
dist/
|
||||
web-build/
|
||||
expo-env.d.ts
|
||||
|
||||
# Native
|
||||
.kotlin/
|
||||
*.orig.*
|
||||
*.jks
|
||||
*.p8
|
||||
*.p12
|
||||
*.key
|
||||
*.mobileprovision
|
||||
|
||||
# Metro
|
||||
.metro-health-check*
|
||||
|
||||
# debug
|
||||
npm-debug.*
|
||||
yarn-debug.*
|
||||
yarn-error.*
|
||||
|
||||
# macOS
|
||||
.DS_Store
|
||||
*.pem
|
||||
|
||||
# local env files
|
||||
.env*.local
|
||||
|
||||
# typescript
|
||||
*.tsbuildinfo
|
||||
|
||||
example
|
||||
|
||||
# generated native folders
|
||||
/ios
|
||||
/android
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all",
|
||||
"printWidth": 100,
|
||||
"tabWidth": 2,
|
||||
"semi": true,
|
||||
"arrowParens": "always"
|
||||
}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{ "recommendations": ["expo.vscode-expo-tools"] }
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll": "explicit",
|
||||
"source.organizeImports": "explicit",
|
||||
"source.sortMembers": "explicit"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 the Gitea Native contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
---
|
||||
|
||||
Gitea Native is an independent, unofficial project. It is not affiliated with,
|
||||
endorsed by, or connected to the Gitea project, Gitea Ltd., or Codeberg e.V.
|
||||
"Gitea" and "Codeberg" are names and trademarks of their respective owners.
|
||||
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"expo": {
|
||||
"name": "Gitea Native",
|
||||
"slug": "gitea-native",
|
||||
"version": "0.1.0",
|
||||
"orientation": "portrait",
|
||||
"icon": "./assets/images/icon.png",
|
||||
"scheme": "giteanative",
|
||||
"userInterfaceStyle": "automatic",
|
||||
"description": "Unofficial, open-source mobile client for Gitea. Not affiliated with the Gitea project.",
|
||||
"owner": "gitea-native",
|
||||
"ios": {
|
||||
"icon": "./assets/images/icon.png",
|
||||
"supportsTablet": true,
|
||||
"bundleIdentifier": "org.giteanative.app",
|
||||
"infoPlist": {
|
||||
"NSFaceIDUsageDescription": "Gitea Native uses Face ID to unlock the app and protect your accounts."
|
||||
},
|
||||
"config": {
|
||||
"usesNonExemptEncryption": false
|
||||
}
|
||||
},
|
||||
"android": {
|
||||
"package": "org.giteanative.app",
|
||||
"adaptiveIcon": {
|
||||
"backgroundColor": "#609926",
|
||||
"foregroundImage": "./assets/images/android-icon-foreground.png",
|
||||
"backgroundImage": "./assets/images/android-icon-background.png",
|
||||
"monochromeImage": "./assets/images/android-icon-monochrome.png"
|
||||
},
|
||||
"predictiveBackGestureEnabled": false
|
||||
},
|
||||
"web": {
|
||||
"output": "single",
|
||||
"favicon": "./assets/images/favicon.png"
|
||||
},
|
||||
"plugins": [
|
||||
[
|
||||
"expo-splash-screen",
|
||||
{
|
||||
"backgroundColor": "#111713",
|
||||
"image": "./assets/images/splash-icon.png",
|
||||
"imageWidth": 140
|
||||
}
|
||||
],
|
||||
[
|
||||
"expo-secure-store",
|
||||
{
|
||||
"configureAndroidBackup": true,
|
||||
"faceIDPermission": "Gitea Native stores your access tokens in the device keychain and can protect them with Face ID."
|
||||
}
|
||||
],
|
||||
[
|
||||
"expo-local-authentication",
|
||||
{
|
||||
"faceIDPermission": "Gitea Native uses Face ID to unlock the app."
|
||||
}
|
||||
],
|
||||
"expo-localization"
|
||||
],
|
||||
"experiments": {
|
||||
"reactCompiler": true
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 318 B |
Binary file not shown.
|
After Width: | Height: | Size: 7.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
@@ -0,0 +1,9 @@
|
||||
const { defineConfig } = require('eslint/config');
|
||||
const expoConfig = require('eslint-config-expo/flat');
|
||||
|
||||
module.exports = defineConfig([
|
||||
expoConfig,
|
||||
{
|
||||
ignores: ['dist/*', '.expo/*', 'coverage/*', 'node_modules/*'],
|
||||
},
|
||||
]);
|
||||
@@ -0,0 +1,9 @@
|
||||
import 'react-native-gesture-handler';
|
||||
import { registerRootComponent } from 'expo';
|
||||
|
||||
import App from './src/App';
|
||||
|
||||
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
|
||||
// It also ensures the environment is set up appropriately whether the app is
|
||||
// loaded in Expo Go or in a native (dev-build / production) client.
|
||||
registerRootComponent(App);
|
||||
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Jest setup for Gitea Native.
|
||||
*
|
||||
* Native modules that cannot run in the Jest (Node) environment are mocked here.
|
||||
* Test-specific mocks (e.g. expo-secure-store) live next to the tests that need them
|
||||
* unless they are required globally.
|
||||
*/
|
||||
|
||||
// AsyncStorage: official in-memory mock provided by the package.
|
||||
jest.mock('@react-native-async-storage/async-storage', () =>
|
||||
require('@react-native-async-storage/async-storage/jest/async-storage-mock'),
|
||||
);
|
||||
|
||||
// Reanimated: official mock (worklets are not available in Jest).
|
||||
jest.mock('react-native-reanimated', () => require('react-native-reanimated/mock'));
|
||||
|
||||
// Safe area: official mock so SafeAreaView/useSafeAreaInsets work in tests.
|
||||
jest.mock('react-native-safe-area-context', () => require('react-native-safe-area-context/jest/mock'));
|
||||
|
||||
// Haptics: no native module in Jest.
|
||||
jest.mock('expo-haptics', () => ({
|
||||
selectionAsync: jest.fn(async () => undefined),
|
||||
impactAsync: jest.fn(async () => undefined),
|
||||
notificationAsync: jest.fn(async () => undefined),
|
||||
}));
|
||||
Generated
+15492
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,81 @@
|
||||
{
|
||||
"name": "gitea-native",
|
||||
"main": "index.ts",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@expo/vector-icons": "^15.0.2",
|
||||
"@react-native-async-storage/async-storage": "2.2.0",
|
||||
"@react-navigation/bottom-tabs": "^7.20.0",
|
||||
"@react-navigation/native": "^7.5.0",
|
||||
"@react-navigation/native-stack": "^7.20.0",
|
||||
"@shopify/flash-list": "2.0.2",
|
||||
"@tanstack/query-async-storage-persister": "^5.104.1",
|
||||
"@tanstack/react-query": "^5.104.1",
|
||||
"@tanstack/react-query-persist-client": "^5.104.1",
|
||||
"expo": "~57.0.27",
|
||||
"expo-constants": "~57.0.21",
|
||||
"expo-font": "~57.0.4",
|
||||
"expo-haptics": "~57.0.3",
|
||||
"expo-image": "~57.0.5",
|
||||
"expo-linking": "~57.0.12",
|
||||
"expo-local-authentication": "~57.0.3",
|
||||
"expo-localization": "~57.0.2",
|
||||
"expo-secure-store": "~57.0.4",
|
||||
"expo-splash-screen": "~57.0.9",
|
||||
"expo-status-bar": "~57.0.1",
|
||||
"expo-symbols": "~57.0.3",
|
||||
"expo-system-ui": "~57.0.4",
|
||||
"expo-web-browser": "~57.0.3",
|
||||
"i18next": "^26.4.2",
|
||||
"intl-pluralrules": "^2.0.1",
|
||||
"marked": "^18.1.0",
|
||||
"react": "19.2.3",
|
||||
"react-dom": "19.2.3",
|
||||
"react-i18next": "^17.0.16",
|
||||
"react-native": "0.86.3",
|
||||
"react-native-gesture-handler": "~2.32.0",
|
||||
"react-native-reanimated": "4.5.1",
|
||||
"react-native-safe-area-context": "~5.7.0",
|
||||
"react-native-screens": "~4.26.0",
|
||||
"react-native-svg": "15.15.4",
|
||||
"react-native-web": "~0.21.0",
|
||||
"react-native-worklets": "0.10.1",
|
||||
"zustand": "^5.0.15"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@testing-library/react-native": "^14.1.0",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/react": "~19.2.2",
|
||||
"eslint": "^9.39.5",
|
||||
"eslint-config-expo": "~57.0.2",
|
||||
"jest": "~29.7.0",
|
||||
"jest-expo": "~57.0.5",
|
||||
"prettier": "^3.9.9",
|
||||
"typescript": "~6.0.3"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "expo start",
|
||||
"android": "expo start --android",
|
||||
"ios": "expo start --ios",
|
||||
"web": "expo start --web",
|
||||
"lint": "expo lint",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"test": "jest",
|
||||
"format": "prettier --write \"src/**/*.{ts,tsx}\" \"*.{md,json,js}\"",
|
||||
"format:check": "prettier --check \"src/**/*.{ts,tsx}\" \"*.{md,json,js}\"",
|
||||
"verify": "npm run typecheck && npm run lint && npm test"
|
||||
},
|
||||
"jest": {
|
||||
"preset": "jest-expo",
|
||||
"setupFilesAfterEnv": [
|
||||
"<rootDir>/jest.setup.ts"
|
||||
],
|
||||
"moduleNameMapper": {
|
||||
"^@/(.*)$": "<rootDir>/src/$1"
|
||||
},
|
||||
"transformIgnorePatterns": [
|
||||
"node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@sentry/react-native|native-base|react-native-svg|@shopify/flash-list|marked)"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Generate Gitea Native's original app icons.
|
||||
|
||||
The mark is a simple git-branch glyph (trunk + branch + three nodes) drawn on
|
||||
the brand green. Everything here is generated from scratch — no template assets.
|
||||
"""
|
||||
|
||||
from PIL import Image, ImageDraw
|
||||
|
||||
GREEN = (96, 153, 38, 255)
|
||||
WHITE = (255, 255, 255, 255)
|
||||
TRANSPARENT = (0, 0, 0, 0)
|
||||
|
||||
OUT = "assets/images"
|
||||
|
||||
|
||||
def mark_layer(size: int, color, margin: float, width_ratio: float = 0.10) -> Image.Image:
|
||||
img = Image.new("RGBA", (size, size), TRANSPARENT)
|
||||
d = ImageDraw.Draw(img)
|
||||
m = size * margin
|
||||
box = size - 2 * m
|
||||
|
||||
def p(x, y):
|
||||
return (m + x * box, m + y * box)
|
||||
|
||||
lw = max(2, int(box * width_ratio))
|
||||
trunk_top = p(0.36, 0.18)
|
||||
trunk_bottom = p(0.36, 0.82)
|
||||
branch_top = p(0.66, 0.18)
|
||||
branch_mid = p(0.66, 0.50)
|
||||
branch_join = p(0.36, 0.62)
|
||||
|
||||
d.line([trunk_top, trunk_bottom], fill=color, width=lw)
|
||||
d.line([branch_top, branch_mid, branch_join], fill=color, width=lw, joint="curve")
|
||||
|
||||
r = box * 0.085
|
||||
for cx, cy in [(0.36, 0.18), (0.66, 0.18), (0.36, 0.82)]:
|
||||
x, y = p(cx, cy)
|
||||
d.ellipse([x - r, y - r, x + r, y + r], fill=color)
|
||||
|
||||
return img
|
||||
|
||||
|
||||
def solid(size: int, color) -> Image.Image:
|
||||
return Image.new("RGBA", (size, size), color)
|
||||
|
||||
|
||||
def save(img: Image.Image, name: str):
|
||||
img.save(f"{OUT}/{name}", "PNG")
|
||||
print("wrote", f"{OUT}/{name}", img.size)
|
||||
|
||||
|
||||
def main():
|
||||
# Full-bleed marketing / iOS / favicon icon: white glyph on green.
|
||||
icon = solid(1024, GREEN)
|
||||
icon.alpha_composite(mark_layer(1024, WHITE, margin=0.24))
|
||||
save(icon, "icon.png")
|
||||
|
||||
# Android adaptive icon layers.
|
||||
save(mark_layer(1024, WHITE, margin=0.30), "android-icon-foreground.png")
|
||||
save(solid(1024, GREEN), "android-icon-background.png")
|
||||
save(mark_layer(1024, WHITE, margin=0.30), "android-icon-monochrome.png")
|
||||
|
||||
# Splash: green glyph on the dark splash background.
|
||||
save(mark_layer(512, GREEN, margin=0.14), "splash-icon.png")
|
||||
|
||||
# Web favicon: white glyph on green.
|
||||
favicon = solid(64, GREEN)
|
||||
favicon.alpha_composite(mark_layer(64, WHITE, margin=0.24))
|
||||
save(favicon, "favicon.png")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"extends": "expo/tsconfig.base",
|
||||
"compilerOptions": {
|
||||
"strict": true,
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"./src/*"
|
||||
],
|
||||
"@/assets/*": [
|
||||
"./assets/*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"**/*.ts",
|
||||
"**/*.tsx"
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user