mirror of
https://github.com/EthanShoeDev/fressh.git
synced 2026-01-11 14:22:51 +00:00
ssh conn
This commit is contained in:
2
.prettierignore
Normal file
2
.prettierignore
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
android/
|
||||||
|
docs/
|
||||||
10
.vscode/settings.json
vendored
10
.vscode/settings.json
vendored
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
"source.fixAll": "explicit",
|
"source.fixAll": "explicit",
|
||||||
"source.organizeImports": "explicit",
|
"source.organizeImports": "explicit",
|
||||||
"source.sortMembers": "explicit"
|
"source.sortMembers": "explicit"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
28
README.md
28
README.md
@@ -1,6 +1,7 @@
|
|||||||
# Welcome to your Expo app 👋
|
# Welcome to your Expo app 👋
|
||||||
|
|
||||||
This is an [Expo](https://expo.dev) project created with [`create-expo-app`](https://www.npmjs.com/package/create-expo-app).
|
This is an [Expo](https://expo.dev) project created with
|
||||||
|
[`create-expo-app`](https://www.npmjs.com/package/create-expo-app).
|
||||||
|
|
||||||
## Get started
|
## Get started
|
||||||
|
|
||||||
@@ -21,9 +22,11 @@ In the output, you'll find options to open the app in a
|
|||||||
- [development build](https://docs.expo.dev/develop/development-builds/introduction/)
|
- [development build](https://docs.expo.dev/develop/development-builds/introduction/)
|
||||||
- [Android emulator](https://docs.expo.dev/workflow/android-studio-emulator/)
|
- [Android emulator](https://docs.expo.dev/workflow/android-studio-emulator/)
|
||||||
- [iOS simulator](https://docs.expo.dev/workflow/ios-simulator/)
|
- [iOS simulator](https://docs.expo.dev/workflow/ios-simulator/)
|
||||||
- [Expo Go](https://expo.dev/go), a limited sandbox for trying out app development with Expo
|
- [Expo Go](https://expo.dev/go), a limited sandbox for trying out app
|
||||||
|
development with Expo
|
||||||
|
|
||||||
You can start developing by editing the files inside the **app** directory. This project uses [file-based routing](https://docs.expo.dev/router/introduction).
|
You can start developing by editing the files inside the **app** directory. This
|
||||||
|
project uses [file-based routing](https://docs.expo.dev/router/introduction).
|
||||||
|
|
||||||
## Get a fresh project
|
## Get a fresh project
|
||||||
|
|
||||||
@@ -33,18 +36,25 @@ When you're ready, run:
|
|||||||
pnpm run reset-project
|
pnpm run reset-project
|
||||||
```
|
```
|
||||||
|
|
||||||
This command will move the starter code to the **app-example** directory and create a blank **app** directory where you can start developing.
|
This command will move the starter code to the **app-example** directory and
|
||||||
|
create a blank **app** directory where you can start developing.
|
||||||
|
|
||||||
## Learn more
|
## Learn more
|
||||||
|
|
||||||
To learn more about developing your project with Expo, look at the following resources:
|
To learn more about developing your project with Expo, look at the following
|
||||||
|
resources:
|
||||||
|
|
||||||
- [Expo documentation](https://docs.expo.dev/): Learn fundamentals, or go into advanced topics with our [guides](https://docs.expo.dev/guides).
|
- [Expo documentation](https://docs.expo.dev/): Learn fundamentals, or go into
|
||||||
- [Learn Expo tutorial](https://docs.expo.dev/tutorial/introduction/): Follow a step-by-step tutorial where you'll create a project that runs on Android, iOS, and the web.
|
advanced topics with our [guides](https://docs.expo.dev/guides).
|
||||||
|
- [Learn Expo tutorial](https://docs.expo.dev/tutorial/introduction/): Follow a
|
||||||
|
step-by-step tutorial where you'll create a project that runs on Android, iOS,
|
||||||
|
and the web.
|
||||||
|
|
||||||
## Join the community
|
## Join the community
|
||||||
|
|
||||||
Join our community of developers creating universal apps.
|
Join our community of developers creating universal apps.
|
||||||
|
|
||||||
- [Expo on GitHub](https://github.com/expo/expo): View our open source platform and contribute.
|
- [Expo on GitHub](https://github.com/expo/expo): View our open source platform
|
||||||
- [Discord community](https://chat.expo.dev): Chat with Expo users and ask questions.
|
and contribute.
|
||||||
|
- [Discord community](https://chat.expo.dev): Chat with Expo users and ask
|
||||||
|
questions.
|
||||||
|
|||||||
@@ -63,3 +63,6 @@ expo.useLegacyPackaging=false
|
|||||||
# Specifies whether the app is configured to use edge-to-edge via the app config or plugin
|
# Specifies whether the app is configured to use edge-to-edge via the app config or plugin
|
||||||
# WARNING: This property has been deprecated and will be removed in Expo SDK 55. Use `edgeToEdgeEnabled` or `react.edgeToEdgeEnabled` to determine whether the project is using edge-to-edge.
|
# WARNING: This property has been deprecated and will be removed in Expo SDK 55. Use `edgeToEdgeEnabled` or `react.edgeToEdgeEnabled` to determine whether the project is using edge-to-edge.
|
||||||
expo.edgeToEdgeEnabled=true
|
expo.edgeToEdgeEnabled=true
|
||||||
|
|
||||||
|
|
||||||
|
android.packagingOptions.pickFirsts=META-INF/versions/9/OSGI-INF/MANIFEST.MF
|
||||||
84
app.json
84
app.json
@@ -1,44 +1,44 @@
|
|||||||
{
|
{
|
||||||
"expo": {
|
"expo": {
|
||||||
"name": "fressh",
|
"name": "fressh",
|
||||||
"slug": "fressh",
|
"slug": "fressh",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"orientation": "portrait",
|
"orientation": "portrait",
|
||||||
"icon": "./assets/images/icon.png",
|
"icon": "./assets/images/icon.png",
|
||||||
"scheme": "fressh",
|
"scheme": "fressh",
|
||||||
"userInterfaceStyle": "automatic",
|
"userInterfaceStyle": "automatic",
|
||||||
"newArchEnabled": true,
|
"newArchEnabled": true,
|
||||||
"ios": {
|
"ios": {
|
||||||
"supportsTablet": true
|
"supportsTablet": true
|
||||||
},
|
},
|
||||||
"android": {
|
"android": {
|
||||||
"package": "dev.fressh.app",
|
"package": "dev.fressh.app",
|
||||||
"adaptiveIcon": {
|
"adaptiveIcon": {
|
||||||
"foregroundImage": "./assets/images/adaptive-icon.png",
|
"foregroundImage": "./assets/images/adaptive-icon.png",
|
||||||
"backgroundColor": "#ffffff"
|
"backgroundColor": "#ffffff"
|
||||||
},
|
},
|
||||||
"edgeToEdgeEnabled": true,
|
"edgeToEdgeEnabled": true,
|
||||||
"predictiveBackGestureEnabled": false
|
"predictiveBackGestureEnabled": false
|
||||||
},
|
},
|
||||||
"web": {
|
"web": {
|
||||||
"output": "static",
|
"output": "static",
|
||||||
"favicon": "./assets/images/favicon.png"
|
"favicon": "./assets/images/favicon.png"
|
||||||
},
|
},
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"expo-router",
|
"expo-router",
|
||||||
[
|
[
|
||||||
"expo-splash-screen",
|
"expo-splash-screen",
|
||||||
{
|
{
|
||||||
"image": "./assets/images/splash-icon.png",
|
"image": "./assets/images/splash-icon.png",
|
||||||
"imageWidth": 200,
|
"imageWidth": 200,
|
||||||
"resizeMode": "contain",
|
"resizeMode": "contain",
|
||||||
"backgroundColor": "#ffffff"
|
"backgroundColor": "#ffffff"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
"experiments": {
|
"experiments": {
|
||||||
"typedRoutes": true,
|
"typedRoutes": true,
|
||||||
"reactCompiler": true
|
"reactCompiler": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Stack } from "expo-router";
|
import { Stack } from 'expo-router'
|
||||||
|
|
||||||
export default function RootLayout() {
|
export default function RootLayout() {
|
||||||
return <Stack />;
|
return <Stack />
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,38 @@
|
|||||||
import { Text, View } from "react-native";
|
import SSHClient, { PtyType } from '@dylankenneally/react-native-ssh-sftp'
|
||||||
|
import { Button, Text, View } from 'react-native'
|
||||||
|
|
||||||
export default function Index() {
|
export default function Index() {
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
style={{
|
style={{
|
||||||
flex: 1,
|
flex: 1,
|
||||||
justifyContent: "center",
|
justifyContent: 'center',
|
||||||
alignItems: "center",
|
alignItems: 'center',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Text>Edit app/index.tsx to edit this screen.</Text>
|
<Text>Edit app/index.tsx to edit this screen.</Text>
|
||||||
</View>
|
<Button
|
||||||
);
|
title="Click me"
|
||||||
|
onPress={() => {
|
||||||
|
console.log('Connecting...')
|
||||||
|
SSHClient.connectWithPassword(
|
||||||
|
'test.rebex.net',
|
||||||
|
22,
|
||||||
|
'demo',
|
||||||
|
'password',
|
||||||
|
).then(async (client) => {
|
||||||
|
alert('Connected')
|
||||||
|
client.on('Shell', (data) => {
|
||||||
|
console.log(data)
|
||||||
|
})
|
||||||
|
await client.startShell(PtyType.XTERM)
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
client.disconnect()
|
||||||
|
}, 5_000)
|
||||||
|
})
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
3
docs/ssh_client.md
Normal file
3
docs/ssh_client.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
https://github.com/dylankenneally/react-native-ssh-sftp
|
||||||
|
https://xtermjs.org/
|
||||||
|
https://docs.expo.dev/versions/latest/sdk/webview/
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
// https://docs.expo.dev/guides/using-eslint/
|
// https://docs.expo.dev/guides/using-eslint/
|
||||||
const { defineConfig } = require('eslint/config');
|
const { defineConfig } = require('eslint/config')
|
||||||
const expoConfig = require('eslint-config-expo/flat');
|
const expoConfig = require('eslint-config-expo/flat')
|
||||||
|
|
||||||
module.exports = defineConfig([
|
module.exports = defineConfig([
|
||||||
expoConfig,
|
expoConfig,
|
||||||
{
|
{
|
||||||
ignores: ['dist/*'],
|
ignores: ['dist/*'],
|
||||||
},
|
},
|
||||||
]);
|
])
|
||||||
|
|||||||
17
package.json
17
package.json
@@ -8,9 +8,12 @@
|
|||||||
"android": "expo run:android",
|
"android": "expo run:android",
|
||||||
"ios": "expo run:ios",
|
"ios": "expo run:ios",
|
||||||
"web": "expo start --web",
|
"web": "expo start --web",
|
||||||
"lint": "expo lint"
|
"lint": "expo lint",
|
||||||
|
"format": "prettier . --write",
|
||||||
|
"typecheck": "tsc"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@dylankenneally/react-native-ssh-sftp": "^1.5.20",
|
||||||
"@expo/vector-icons": "^15.0.2",
|
"@expo/vector-icons": "^15.0.2",
|
||||||
"@react-navigation/bottom-tabs": "^7.4.0",
|
"@react-navigation/bottom-tabs": "^7.4.0",
|
||||||
"@react-navigation/elements": "^2.6.3",
|
"@react-navigation/elements": "^2.6.3",
|
||||||
@@ -30,17 +33,21 @@
|
|||||||
"react-dom": "19.1.0",
|
"react-dom": "19.1.0",
|
||||||
"react-native": "0.81.1",
|
"react-native": "0.81.1",
|
||||||
"react-native-gesture-handler": "~2.28.0",
|
"react-native-gesture-handler": "~2.28.0",
|
||||||
"react-native-worklets": "~0.4.2",
|
|
||||||
"react-native-reanimated": "~4.0.2",
|
"react-native-reanimated": "~4.0.2",
|
||||||
"react-native-safe-area-context": "~5.6.0",
|
"react-native-safe-area-context": "~5.6.0",
|
||||||
"react-native-screens": "~4.15.4",
|
"react-native-screens": "~4.15.4",
|
||||||
"react-native-web": "~0.21.0"
|
"react-native-web": "~0.21.0",
|
||||||
|
"react-native-worklets": "~0.4.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@epic-web/config": "^1.21.3",
|
||||||
"@types/react": "~19.1.0",
|
"@types/react": "~19.1.0",
|
||||||
"typescript": "~5.9.2",
|
|
||||||
"eslint": "^9.25.0",
|
"eslint": "^9.25.0",
|
||||||
"eslint-config-expo": "~10.0.0"
|
"eslint-config-expo": "~10.0.0",
|
||||||
|
"prettier": "^3.6.2",
|
||||||
|
"prettier-plugin-organize-imports": "^4.2.0",
|
||||||
|
"tsx": "^4.20.5",
|
||||||
|
"typescript": "~5.9.2"
|
||||||
},
|
},
|
||||||
"private": true
|
"private": true
|
||||||
}
|
}
|
||||||
|
|||||||
785
pnpm-lock.yaml
generated
785
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
13
prettier.config.js
Normal file
13
prettier.config.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import defaultConfig from '@epic-web/config/prettier'
|
||||||
|
// Sometimes this plugin can remove imports that are in use.
|
||||||
|
// As a workaround we will only use this in the cli. (npm run fmt)
|
||||||
|
const sortImports = process.env.SORT_IMPORTS === 'true'
|
||||||
|
|
||||||
|
/** @type {import("prettier").Options} */
|
||||||
|
export default {
|
||||||
|
...defaultConfig,
|
||||||
|
plugins: [
|
||||||
|
...(sortImports ? ['prettier-plugin-organize-imports'] : []),
|
||||||
|
...(defaultConfig.plugins || []),
|
||||||
|
],
|
||||||
|
}
|
||||||
@@ -1,17 +1,10 @@
|
|||||||
{
|
{
|
||||||
"extends": "expo/tsconfig.base",
|
"extends": "expo/tsconfig.base",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": [
|
"@/*": ["./*"]
|
||||||
"./*"
|
}
|
||||||
]
|
},
|
||||||
}
|
"include": ["**/*.ts", "**/*.tsx", ".expo/types/**/*.ts", "expo-env.d.ts"]
|
||||||
},
|
|
||||||
"include": [
|
|
||||||
"**/*.ts",
|
|
||||||
"**/*.tsx",
|
|
||||||
".expo/types/**/*.ts",
|
|
||||||
"expo-env.d.ts"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user