u
This commit is contained in:
1 parent
a9d16f2b85
commit
ecacca7036
22 files changed
+2
-9620
No files matched your search
@@ -1 +0,0 @@
|
||||
my-app
|
||||
@@ -1,41 +0,0 @@
|
||||
# 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
|
||||
|
||||
# generated native folders
|
||||
/ios
|
||||
/android
|
||||
-51
@@ -1,51 +0,0 @@
|
||||
{
|
||||
// Disable the default formatter, use eslint instead
|
||||
"prettier.enable": false,
|
||||
"editor.formatOnSave": false,
|
||||
|
||||
// Auto fix
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": "explicit",
|
||||
"source.organizeImports": "never"
|
||||
},
|
||||
|
||||
// Silent the stylistic rules in you IDE, but still auto fix them
|
||||
"eslint.rules.customizations": [
|
||||
{ "rule": "style/*", "severity": "off", "fixable": true },
|
||||
{ "rule": "format/*", "severity": "off", "fixable": true },
|
||||
{ "rule": "*-indent", "severity": "off", "fixable": true },
|
||||
{ "rule": "*-spacing", "severity": "off", "fixable": true },
|
||||
{ "rule": "*-spaces", "severity": "off", "fixable": true },
|
||||
{ "rule": "*-order", "severity": "off", "fixable": true },
|
||||
{ "rule": "*-dangle", "severity": "off", "fixable": true },
|
||||
{ "rule": "*-newline", "severity": "off", "fixable": true },
|
||||
{ "rule": "*quotes", "severity": "off", "fixable": true },
|
||||
{ "rule": "*semi", "severity": "off", "fixable": true }
|
||||
],
|
||||
|
||||
// Enable eslint for all supported languages
|
||||
"eslint.validate": [
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"vue",
|
||||
"html",
|
||||
"markdown",
|
||||
"json",
|
||||
"json5",
|
||||
"jsonc",
|
||||
"yaml",
|
||||
"toml",
|
||||
"xml",
|
||||
"gql",
|
||||
"graphql",
|
||||
"astro",
|
||||
"svelte",
|
||||
"css",
|
||||
"less",
|
||||
"scss",
|
||||
"pcss",
|
||||
"postcss"
|
||||
]
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
{
|
||||
"expo": {
|
||||
"name": "base-app",
|
||||
"slug": "base-app",
|
||||
"scheme":"oneao",
|
||||
"version": "1.0.0",
|
||||
"orientation": "portrait",
|
||||
"icon": "./assets/icon.png",
|
||||
"userInterfaceStyle": "light",
|
||||
"newArchEnabled": true,
|
||||
"splash": {
|
||||
"image": "./assets/splash-icon.png",
|
||||
"resizeMode": "contain",
|
||||
"backgroundColor": "#ffffff"
|
||||
},
|
||||
"ios": {
|
||||
"supportsTablet": true
|
||||
},
|
||||
"android": {
|
||||
"adaptiveIcon": {
|
||||
"foregroundImage": "./assets/adaptive-icon.png",
|
||||
"backgroundColor": "#ffffff"
|
||||
},
|
||||
"edgeToEdgeEnabled": true,
|
||||
"predictiveBackGestureEnabled": false,
|
||||
"package": "com.anonymous.baseapp"
|
||||
},
|
||||
"web": {
|
||||
"favicon": "./assets/favicon.png"
|
||||
},
|
||||
"plugins": [
|
||||
"./plugins/withAndroidSignature.js",
|
||||
"expo-router"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
import FontAwesome from '@expo/vector-icons/FontAwesome'
|
||||
import { Tabs } from 'expo-router'
|
||||
|
||||
export default function TabLayout() {
|
||||
return (
|
||||
<Tabs screenOptions={{ tabBarActiveTintColor: 'blue', tabBarShowLabel: false }}>
|
||||
<Tabs.Screen
|
||||
name="index"
|
||||
options={{
|
||||
headerShown: false,
|
||||
tabBarIcon: ({ color }) => <FontAwesome size={28} name="home" color={color} />,
|
||||
}}
|
||||
/>
|
||||
<Tabs.Screen
|
||||
name="settings"
|
||||
options={{
|
||||
headerShown: false,
|
||||
tabBarIcon: ({ color }) => <FontAwesome size={28} name="cog" color={color} />,
|
||||
}}
|
||||
/>
|
||||
</Tabs>
|
||||
)
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
import { StyleSheet, Text, View } from 'react-native'
|
||||
|
||||
export default function Tab() {
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Text>Tab [Home]</Text>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
},
|
||||
})
|
||||
@@ -1,17 +0,0 @@
|
||||
import { StyleSheet, Text, View } from 'react-native'
|
||||
|
||||
export default function Tab() {
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Text>Tab [Settings]</Text>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
},
|
||||
})
|
||||
@@ -1,17 +0,0 @@
|
||||
import { Stack } from 'expo-router'
|
||||
|
||||
export default function Layout() {
|
||||
return (
|
||||
<Stack
|
||||
screenOptions={{
|
||||
headerTitleAlign: 'center',
|
||||
animation: 'simple_push',
|
||||
}}
|
||||
>
|
||||
<Stack.Screen
|
||||
name="(tabs)"
|
||||
options={{ headerShown: false }}
|
||||
/>
|
||||
</Stack>
|
||||
)
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 17 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 22 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 17 KiB |
Binary file not shown.
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"android": {
|
||||
"keystore": {
|
||||
"keystorePath": "credentials/android-release.keystore",
|
||||
"keystorePassword": "123456",
|
||||
"keyAlias": "my-key-alias",
|
||||
"keyPassword": "123456"
|
||||
}
|
||||
},
|
||||
"ios": {
|
||||
"provisioningProfilePath": "ios/certs/profile.mobileprovision",
|
||||
"distributionCertificate": {
|
||||
"path": "ios/certs/dist-cert.p12",
|
||||
"password": "password"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
import antfu from '@antfu/eslint-config'
|
||||
|
||||
export default antfu({
|
||||
stylistic: {
|
||||
indent: 2, // 缩进为 2 个空格(可选 4 或 'tab')
|
||||
quotes: 'single', // 使用单引号(可选 'double')
|
||||
},
|
||||
rules: {
|
||||
'unused-imports/no-unused-imports': 'warn',
|
||||
'unused-imports/no-unused-vars': 'warn',
|
||||
'@typescript-eslint/no-use-before-define': 'off', // 关闭 TS 的“定义前使用”警告
|
||||
'no-console': 'off', // 关闭 console 报错
|
||||
},
|
||||
})
|
||||
@@ -1,34 +0,0 @@
|
||||
{
|
||||
"name": "base-app",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"main": "expo-router/entry",
|
||||
"scripts": {
|
||||
"start": "expo start",
|
||||
"android": "expo run:android",
|
||||
"ios": "expo run:ios",
|
||||
"web": "expo start --web"
|
||||
},
|
||||
"dependencies": {
|
||||
"@expo/vector-icons": "^15.0.3",
|
||||
"expo": "~54.0.18",
|
||||
"expo-blur": "~15.0.7",
|
||||
"expo-constants": "~18.0.10",
|
||||
"expo-linking": "~8.0.8",
|
||||
"expo-router": "~6.0.13",
|
||||
"expo-status-bar": "~3.0.8",
|
||||
"lottie-react-native": "^7.3.4",
|
||||
"react": "19.1.0",
|
||||
"react-native": "0.81.5",
|
||||
"react-native-reanimated": "^4.1.3",
|
||||
"react-native-safe-area-context": "~5.6.0",
|
||||
"react-native-screens": "~4.16.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^6.0.0",
|
||||
"@babel/core": "^7.28.4",
|
||||
"@types/react": "~19.1.0",
|
||||
"eslint": "^9.37.0",
|
||||
"typescript": "~5.9.2"
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
// plugins/withAndroidSignature.js
|
||||
|
||||
const { withAppBuildGradle } = require("@expo/config-plugins");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
module.exports = function withAndroidSignature(config) {
|
||||
return withAppBuildGradle(config, config => {
|
||||
if (config.modResults.language === "groovy") {
|
||||
config.modResults.contents = setAndroidSignature(config.modResults.contents);
|
||||
} else {
|
||||
throw new Error("如果不是 groovy,则无法在 app/build.gradle 中设置 signingConfigs");
|
||||
}
|
||||
return config;
|
||||
});
|
||||
};
|
||||
|
||||
function setAndroidSignature(appBuildGradle) {
|
||||
if (!fs.existsSync(path.resolve(__dirname, "../credentials/credentials.json"))) {
|
||||
console.warn("警告:没有设置正式版本的 Android Keystore 文件,因为 credentials.json 不存在。");
|
||||
return appBuildGradle;
|
||||
}
|
||||
const info = JSON.parse(fs.readFileSync(path.resolve(__dirname, "../credentials/credentials.json"), { encoding: "utf8" }));
|
||||
|
||||
// 使用正则表达式插入签名信息
|
||||
let output = appBuildGradle.replace(
|
||||
/(signingConfigs\s*\{)/,
|
||||
`$1
|
||||
release {
|
||||
storeFile file(${JSON.stringify(path.resolve(__dirname, "../credentials/android-release.keystore"))})
|
||||
storePassword ${JSON.stringify(info.android.keystore.keystorePassword)}
|
||||
keyAlias ${JSON.stringify(info.android.keystore.keyAlias)}
|
||||
keyPassword ${JSON.stringify(info.android.keystore.keyPassword)}
|
||||
}`,
|
||||
);
|
||||
|
||||
// 使用正则表达式替换 signingConfig
|
||||
output = output.replace(
|
||||
/(release\s*\{)[^}]*?signingConfig\s+signingConfigs\.debug/s,
|
||||
`$1
|
||||
signingConfig signingConfigs.release
|
||||
`,
|
||||
);
|
||||
|
||||
return output;
|
||||
}
|
||||
Generated
-9239
File diff suppressed because it is too large.
Load diff
@@ -1,24 +0,0 @@
|
||||
import { useCallback, useState } from 'react'
|
||||
|
||||
export function useCounter(initialValue: number = 0) {
|
||||
const [count, setCount] = useState(initialValue)
|
||||
|
||||
const increment = useCallback(() => {
|
||||
setCount(prev => prev + 1)
|
||||
}, [])
|
||||
|
||||
const decrement = useCallback(() => {
|
||||
setCount(prev => prev - 1)
|
||||
}, [])
|
||||
|
||||
const reset = useCallback(() => {
|
||||
setCount(initialValue)
|
||||
}, [initialValue])
|
||||
|
||||
return {
|
||||
count,
|
||||
increment,
|
||||
decrement,
|
||||
reset,
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
@import 'tailwindcss/theme.css' layer(theme);
|
||||
@import 'tailwindcss/preflight.css' layer(base);
|
||||
@import 'tailwindcss/utilities.css';
|
||||
|
||||
@import 'nativewind/theme';
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"extends": "expo/tsconfig.base",
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"@/*": ["src/*"]
|
||||
},
|
||||
"strict": true
|
||||
},
|
||||
"include": ["./**/*.ts", "./**/*.tsx"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
@@ -125,13 +125,13 @@ export default antfu({
|
||||
1. 安装[Nativewind](https://www.nativewind.dev/v5/getting-started/installation#1-install-nativewind)
|
||||
|
||||
```bash
|
||||
pnpm install nativewind@preview react-native-css react-native-reanimated react-native-safe-area-context
|
||||
npx expo install nativewind@preview react-native-css react-native-reanimated react-native-safe-area-context
|
||||
```
|
||||
|
||||
2. 安装**Tailwind CSS**
|
||||
|
||||
```bash
|
||||
pnpm install --save-dev tailwindcss @tailwindcss/postcss postcss
|
||||
npx expo --save-dev tailwindcss @tailwindcss/postcss postcss
|
||||
```
|
||||
|
||||
3. 新建 `postcss.config.mjs` 文件:
|
||||
@@ -759,27 +759,3 @@ app-universal-release.apk
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
HY20241003
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user