lovdacn 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -106
- package/dist/index.d.ts +1 -0
- package/dist/index.js +224 -0
- package/package.json +41 -63
- package/templates/nativewind/.vscode/extensions.json +1 -0
- package/templates/nativewind/.vscode/settings.json +7 -0
- package/templates/nativewind/AGENTS.md +3 -0
- package/templates/nativewind/CLAUDE.md +1 -0
- package/{LICENSE → templates/nativewind/LICENSE} +21 -21
- package/templates/nativewind/README.md +56 -0
- package/templates/nativewind/app.json +43 -0
- package/templates/nativewind/assets/expo.icon/Assets/expo-symbol 2.svg +3 -0
- package/templates/nativewind/assets/expo.icon/Assets/grid.png +0 -0
- package/templates/nativewind/assets/expo.icon/icon.json +40 -0
- package/templates/nativewind/assets/images/android-icon-background.png +0 -0
- package/templates/nativewind/assets/images/android-icon-foreground.png +0 -0
- package/templates/nativewind/assets/images/android-icon-monochrome.png +0 -0
- package/templates/nativewind/assets/images/expo-badge-white.png +0 -0
- package/templates/nativewind/assets/images/expo-badge.png +0 -0
- package/templates/nativewind/assets/images/expo-logo.png +0 -0
- package/templates/nativewind/assets/images/favicon.png +0 -0
- package/templates/nativewind/assets/images/icon.png +0 -0
- package/templates/nativewind/assets/images/logo-glow.png +0 -0
- package/templates/nativewind/assets/images/react-logo.png +0 -0
- package/templates/nativewind/assets/images/react-logo@2x.png +0 -0
- package/templates/nativewind/assets/images/react-logo@3x.png +0 -0
- package/templates/nativewind/assets/images/splash-icon.png +0 -0
- package/templates/nativewind/assets/images/tabIcons/explore.png +0 -0
- package/templates/nativewind/assets/images/tabIcons/explore@2x.png +0 -0
- package/templates/nativewind/assets/images/tabIcons/explore@3x.png +0 -0
- package/templates/nativewind/assets/images/tabIcons/home.png +0 -0
- package/templates/nativewind/assets/images/tabIcons/home@2x.png +0 -0
- package/templates/nativewind/assets/images/tabIcons/home@3x.png +0 -0
- package/templates/nativewind/assets/images/tutorial-web.png +0 -0
- package/templates/nativewind/babel.config.js +9 -0
- package/templates/nativewind/expo-env.d.ts +3 -0
- package/templates/nativewind/lvcn.json +16 -0
- package/templates/nativewind/metro.config.js +6 -0
- package/templates/nativewind/nativewind-env.d.ts +3 -0
- package/templates/nativewind/package.json +55 -0
- package/templates/nativewind/postcss.config.js +6 -0
- package/templates/nativewind/scripts/reset-project.js +114 -0
- package/templates/nativewind/src/app/_layout.tsx +25 -0
- package/templates/nativewind/src/app/explore.tsx +180 -0
- package/templates/nativewind/src/app/index.tsx +12 -0
- package/templates/nativewind/src/components/animated-icon.module.css +6 -0
- package/templates/nativewind/src/components/animated-icon.tsx +148 -0
- package/templates/nativewind/src/components/animated-icon.web.tsx +108 -0
- package/templates/nativewind/src/components/app-tabs.tsx +32 -0
- package/templates/nativewind/src/components/app-tabs.web.tsx +115 -0
- package/templates/nativewind/src/components/external-link.tsx +25 -0
- package/templates/nativewind/src/components/hint-row.tsx +35 -0
- package/templates/nativewind/src/components/themed-text.tsx +73 -0
- package/templates/nativewind/src/components/themed-view.tsx +16 -0
- package/templates/nativewind/src/components/ui/button.tsx +106 -0
- package/templates/nativewind/src/components/ui/collapsible.tsx +65 -0
- package/templates/nativewind/src/components/ui/text.tsx +89 -0
- package/templates/nativewind/src/components/web-badge.tsx +43 -0
- package/templates/nativewind/src/constants/theme.ts +65 -0
- package/templates/nativewind/src/global.css +13 -0
- package/templates/nativewind/src/hooks/use-color-scheme.ts +1 -0
- package/templates/nativewind/src/hooks/use-color-scheme.web.ts +21 -0
- package/templates/nativewind/src/hooks/use-theme.ts +14 -0
- package/templates/nativewind/tailwind.config.js +86 -0
- package/templates/nativewind/tsconfig.json +21 -0
- package/templates/uniwind/.claude/settings.json +5 -0
- package/templates/uniwind/.vscode/extensions.json +1 -0
- package/templates/uniwind/.vscode/settings.json +7 -0
- package/templates/uniwind/AGENTS.md +3 -0
- package/templates/uniwind/CLAUDE.md +1 -0
- package/templates/uniwind/LICENSE +21 -0
- package/templates/uniwind/README.md +56 -0
- package/templates/uniwind/app.json +42 -0
- package/templates/uniwind/assets/expo.icon/Assets/expo-symbol 2.svg +3 -0
- package/templates/uniwind/assets/expo.icon/Assets/grid.png +0 -0
- package/templates/uniwind/assets/expo.icon/icon.json +40 -0
- package/templates/uniwind/assets/images/android-icon-background.png +0 -0
- package/templates/uniwind/assets/images/android-icon-foreground.png +0 -0
- package/templates/uniwind/assets/images/android-icon-monochrome.png +0 -0
- package/templates/uniwind/assets/images/expo-badge-white.png +0 -0
- package/templates/uniwind/assets/images/expo-badge.png +0 -0
- package/templates/uniwind/assets/images/expo-logo.png +0 -0
- package/templates/uniwind/assets/images/favicon.png +0 -0
- package/templates/uniwind/assets/images/icon.png +0 -0
- package/templates/uniwind/assets/images/logo-glow.png +0 -0
- package/templates/uniwind/assets/images/react-logo.png +0 -0
- package/templates/uniwind/assets/images/react-logo@2x.png +0 -0
- package/templates/uniwind/assets/images/react-logo@3x.png +0 -0
- package/templates/uniwind/assets/images/splash-icon.png +0 -0
- package/templates/uniwind/assets/images/tabIcons/explore.png +0 -0
- package/templates/uniwind/assets/images/tabIcons/explore@2x.png +0 -0
- package/templates/uniwind/assets/images/tabIcons/explore@3x.png +0 -0
- package/templates/uniwind/assets/images/tabIcons/home.png +0 -0
- package/templates/uniwind/assets/images/tabIcons/home@2x.png +0 -0
- package/templates/uniwind/assets/images/tabIcons/home@3x.png +0 -0
- package/templates/uniwind/assets/images/tutorial-web.png +0 -0
- package/templates/uniwind/expo-env.d.ts +3 -0
- package/templates/uniwind/lvcn.json +16 -0
- package/templates/uniwind/metro.config.js +14 -0
- package/templates/uniwind/package.json +46 -0
- package/templates/uniwind/scripts/reset-project.js +114 -0
- package/templates/uniwind/src/app/_layout.tsx +23 -0
- package/templates/uniwind/src/app/explore.tsx +180 -0
- package/templates/uniwind/src/app/index.tsx +98 -0
- package/templates/uniwind/src/components/animated-icon.module.css +6 -0
- package/templates/uniwind/src/components/animated-icon.tsx +148 -0
- package/templates/uniwind/src/components/animated-icon.web.tsx +108 -0
- package/templates/uniwind/src/components/app-tabs.tsx +32 -0
- package/templates/uniwind/src/components/app-tabs.web.tsx +115 -0
- package/templates/uniwind/src/components/external-link.tsx +25 -0
- package/templates/uniwind/src/components/hint-row.tsx +35 -0
- package/templates/uniwind/src/components/themed-text.tsx +73 -0
- package/templates/uniwind/src/components/themed-view.tsx +16 -0
- package/templates/uniwind/src/components/ui/collapsible.tsx +65 -0
- package/templates/uniwind/src/components/web-badge.tsx +43 -0
- package/templates/uniwind/src/constants/theme.ts +65 -0
- package/templates/uniwind/src/global.css +12 -0
- package/templates/uniwind/src/hooks/use-color-scheme.ts +1 -0
- package/templates/uniwind/src/hooks/use-color-scheme.web.ts +21 -0
- package/templates/uniwind/src/hooks/use-theme.ts +14 -0
- package/templates/uniwind/src/uniwind-types.d.ts +10 -0
- package/templates/uniwind/tsconfig.json +20 -0
- package/.changeset/config.json +0 -17
- package/.github/actions/setup/action.yml +0 -21
- package/.github/workflows/check.yml +0 -54
- package/.github/workflows/release.yml +0 -0
- package/.github/workflows/snapshot.yml +0 -24
- package/.prettierrc +0 -8
- package/.vscode/extensions.json +0 -6
- package/.vscode/settings.json +0 -46
- package/eslint.config.mjs +0 -118
- package/patches/@changesets__get-github-info@0.6.0.patch +0 -48
- package/scripts/copy-package-json.ts +0 -35
- package/src/bin.ts +0 -18
- package/src/cli.ts +0 -66
- package/src/contexts/cli-options.ts +0 -29
- package/src/project-manifest.ts +0 -370
- package/src/services/commands/add.ts +0 -128
- package/src/services/commands/doctor.ts +0 -287
- package/src/services/commands/init.ts +0 -94
- package/src/services/git.ts +0 -39
- package/src/services/package-manager.ts +0 -48
- package/src/services/project-config.ts +0 -295
- package/src/services/required-files-checker.ts +0 -375
- package/src/services/spinner.ts +0 -15
- package/src/services/template.ts +0 -223
- package/src/utils/retry-with.ts +0 -9
- package/src/utils/run-command.ts +0 -10
- package/test/Dummy.test.ts +0 -7
- package/tsconfig.base.json +0 -53
- package/tsconfig.json +0 -14
- package/tsconfig.scripts.json +0 -17
- package/tsconfig.src.json +0 -10
- package/tsconfig.test.json +0 -10
- package/tsup.config.ts +0 -9
- package/vitest.config.ts +0 -12
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Welcome to your Expo app 👋
|
|
2
|
+
|
|
3
|
+
This is an [Expo](https://expo.dev) project created with [`create-expo-app`](https://www.npmjs.com/package/create-expo-app).
|
|
4
|
+
|
|
5
|
+
## Get started
|
|
6
|
+
|
|
7
|
+
1. Install dependencies
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
2. Start the app
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx expo start
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
In the output, you'll find options to open the app in a
|
|
20
|
+
|
|
21
|
+
- [development build](https://docs.expo.dev/develop/development-builds/introduction/)
|
|
22
|
+
- [Android emulator](https://docs.expo.dev/workflow/android-studio-emulator/)
|
|
23
|
+
- [iOS simulator](https://docs.expo.dev/workflow/ios-simulator/)
|
|
24
|
+
- [Expo Go](https://expo.dev/go), a limited sandbox for trying out app development with Expo
|
|
25
|
+
|
|
26
|
+
You can start developing by editing the files inside the **app** directory. This project uses [file-based routing](https://docs.expo.dev/router/introduction).
|
|
27
|
+
|
|
28
|
+
## Get a fresh project
|
|
29
|
+
|
|
30
|
+
When you're ready, run:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm run reset-project
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
This command will move the starter code to the **app-example** directory and create a blank **app** directory where you can start developing.
|
|
37
|
+
|
|
38
|
+
### Other setup steps
|
|
39
|
+
|
|
40
|
+
- To set up ESLint for linting, run `npx expo lint`, or follow our guide on ["Using ESLint and Prettier"](https://docs.expo.dev/guides/using-eslint/)
|
|
41
|
+
- If you'd like to set up unit testing, follow our guide on ["Unit Testing with Jest"](https://docs.expo.dev/develop/unit-testing/)
|
|
42
|
+
- Learn more about the TypeScript setup in this template in our guide on ["Using TypeScript"](https://docs.expo.dev/guides/typescript/)
|
|
43
|
+
|
|
44
|
+
## Learn more
|
|
45
|
+
|
|
46
|
+
To learn more about developing your project with Expo, look at the following resources:
|
|
47
|
+
|
|
48
|
+
- [Expo documentation](https://docs.expo.dev/): Learn fundamentals, or go into advanced topics with our [guides](https://docs.expo.dev/guides).
|
|
49
|
+
- [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.
|
|
50
|
+
|
|
51
|
+
## Join the community
|
|
52
|
+
|
|
53
|
+
Join our community of developers creating universal apps.
|
|
54
|
+
|
|
55
|
+
- [Expo on GitHub](https://github.com/expo/expo): View our open source platform and contribute.
|
|
56
|
+
- [Discord community](https://chat.expo.dev): Chat with Expo users and ask questions.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"expo": {
|
|
3
|
+
"name": "uniwind",
|
|
4
|
+
"slug": "uniwind",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"orientation": "portrait",
|
|
7
|
+
"icon": "./assets/images/icon.png",
|
|
8
|
+
"scheme": "uniwind",
|
|
9
|
+
"userInterfaceStyle": "automatic",
|
|
10
|
+
"ios": {
|
|
11
|
+
"icon": "./assets/expo.icon"
|
|
12
|
+
},
|
|
13
|
+
"android": {
|
|
14
|
+
"adaptiveIcon": {
|
|
15
|
+
"backgroundColor": "#E6F4FE",
|
|
16
|
+
"foregroundImage": "./assets/images/android-icon-foreground.png",
|
|
17
|
+
"backgroundImage": "./assets/images/android-icon-background.png",
|
|
18
|
+
"monochromeImage": "./assets/images/android-icon-monochrome.png"
|
|
19
|
+
},
|
|
20
|
+
"predictiveBackGestureEnabled": false
|
|
21
|
+
},
|
|
22
|
+
"web": {
|
|
23
|
+
"output": "static",
|
|
24
|
+
"favicon": "./assets/images/favicon.png"
|
|
25
|
+
},
|
|
26
|
+
"plugins": [
|
|
27
|
+
"expo-router",
|
|
28
|
+
[
|
|
29
|
+
"expo-splash-screen",
|
|
30
|
+
{
|
|
31
|
+
"backgroundColor": "#208AEF",
|
|
32
|
+
"image": "./assets/images/splash-icon.png",
|
|
33
|
+
"imageWidth": 76
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
],
|
|
37
|
+
"experiments": {
|
|
38
|
+
"typedRoutes": true,
|
|
39
|
+
"reactCompiler": true
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="652" height="606" viewBox="0 0 652 606" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M353.554 0H298.446C273.006 0 249.684 14.6347 237.962 37.9539L4.37994 502.646C-1.04325 513.435 -1.45067 526.178 3.2716 537.313L22.6123 582.918C34.6475 611.297 72.5404 614.156 88.4414 587.885L309.863 222.063C313.34 216.317 319.439 212.826 326 212.826C332.561 212.826 338.659 216.317 342.137 222.063L563.559 587.885C579.46 614.156 617.352 611.297 629.388 582.918L648.728 537.313C653.451 526.178 653.043 513.435 647.62 502.646L414.038 37.9539C402.316 14.6347 378.994 0 353.554 0Z" fill="white"/>
|
|
3
|
+
</svg>
|
|
Binary file
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"fill" : {
|
|
3
|
+
"automatic-gradient" : "extended-srgb:0.00000,0.47843,1.00000,1.00000"
|
|
4
|
+
},
|
|
5
|
+
"groups" : [
|
|
6
|
+
{
|
|
7
|
+
"layers" : [
|
|
8
|
+
{
|
|
9
|
+
"image-name" : "expo-symbol 2.svg",
|
|
10
|
+
"name" : "expo-symbol 2",
|
|
11
|
+
"position" : {
|
|
12
|
+
"scale" : 1,
|
|
13
|
+
"translation-in-points" : [
|
|
14
|
+
1.1008400065293245e-05,
|
|
15
|
+
-16.046875
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"image-name" : "grid.png",
|
|
21
|
+
"name" : "grid"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"shadow" : {
|
|
25
|
+
"kind" : "neutral",
|
|
26
|
+
"opacity" : 0.5
|
|
27
|
+
},
|
|
28
|
+
"translucency" : {
|
|
29
|
+
"enabled" : true,
|
|
30
|
+
"value" : 0.5
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"supported-platforms" : {
|
|
35
|
+
"circles" : [
|
|
36
|
+
"watchOS"
|
|
37
|
+
],
|
|
38
|
+
"squares" : "shared"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://lovdacn.vercel.app/schema.json",
|
|
3
|
+
"style": "new-york",
|
|
4
|
+
"styleEngine": "uniwind",
|
|
5
|
+
"tsx": true,
|
|
6
|
+
"tailwind": {
|
|
7
|
+
"config": "tailwind.config.js",
|
|
8
|
+
"css": "src/global.css"
|
|
9
|
+
},
|
|
10
|
+
"aliases": {
|
|
11
|
+
"components": "@/components",
|
|
12
|
+
"utils": "@/lib/utils",
|
|
13
|
+
"ui": "@/components/ui"
|
|
14
|
+
},
|
|
15
|
+
"components": []
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const { getDefaultConfig } = require('expo/metro-config');
|
|
2
|
+
const { withUniwindConfig } = require('uniwind/metro');
|
|
3
|
+
|
|
4
|
+
const config = getDefaultConfig(__dirname);
|
|
5
|
+
|
|
6
|
+
// your metro modifications
|
|
7
|
+
|
|
8
|
+
module.exports = withUniwindConfig(config, {
|
|
9
|
+
// relative path to your global.css file (from previous step)
|
|
10
|
+
cssEntryFile: './src/global.css',
|
|
11
|
+
// (optional) path where we gonna auto-generate typings
|
|
12
|
+
// defaults to project's root
|
|
13
|
+
dtsFile: './src/uniwind-types.d.ts'
|
|
14
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "uniwind",
|
|
3
|
+
"main": "expo-router/entry",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"@expo/ui": "~57.0.3",
|
|
7
|
+
"@rn-primitives/portal": "^1.5.2",
|
|
8
|
+
"expo": "~57.0.2",
|
|
9
|
+
"expo-constants": "~57.0.3",
|
|
10
|
+
"expo-device": "~57.0.0",
|
|
11
|
+
"expo-font": "~57.0.0",
|
|
12
|
+
"expo-glass-effect": "~57.0.0",
|
|
13
|
+
"expo-image": "~57.0.0",
|
|
14
|
+
"expo-linking": "~57.0.1",
|
|
15
|
+
"expo-router": "~57.0.3",
|
|
16
|
+
"expo-splash-screen": "~57.0.2",
|
|
17
|
+
"expo-status-bar": "~57.0.0",
|
|
18
|
+
"expo-symbols": "~57.0.0",
|
|
19
|
+
"expo-system-ui": "~57.0.0",
|
|
20
|
+
"expo-web-browser": "~57.0.0",
|
|
21
|
+
"react": "19.2.3",
|
|
22
|
+
"react-dom": "19.2.3",
|
|
23
|
+
"react-native": "0.86.0",
|
|
24
|
+
"react-native-gesture-handler": "~2.32.0",
|
|
25
|
+
"react-native-reanimated": "4.5.0",
|
|
26
|
+
"react-native-safe-area-context": "~5.7.0",
|
|
27
|
+
"react-native-screens": "4.25.2",
|
|
28
|
+
"react-native-web": "~0.21.0",
|
|
29
|
+
"react-native-worklets": "0.10.0",
|
|
30
|
+
"tailwindcss": "^4.3.2",
|
|
31
|
+
"uniwind": "^1.10.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/react": "~19.2.2",
|
|
35
|
+
"typescript": "~6.0.3"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"start": "expo start",
|
|
39
|
+
"reset-project": "node ./scripts/reset-project.js",
|
|
40
|
+
"android": "expo start --android",
|
|
41
|
+
"ios": "expo start --ios",
|
|
42
|
+
"web": "expo start --web",
|
|
43
|
+
"lint": "expo lint"
|
|
44
|
+
},
|
|
45
|
+
"private": true
|
|
46
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This script is used to reset the project to a blank state.
|
|
5
|
+
* It deletes or moves the /src and /scripts directories to /example based on user input and creates a new /src/app directory with an index.tsx and _layout.tsx file.
|
|
6
|
+
* You can remove the `reset-project` script from package.json and safely delete this file after running it.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const fs = require("fs");
|
|
10
|
+
const path = require("path");
|
|
11
|
+
const readline = require("readline");
|
|
12
|
+
|
|
13
|
+
const root = process.cwd();
|
|
14
|
+
const oldDirs = ["src", "scripts"];
|
|
15
|
+
const exampleDir = "example";
|
|
16
|
+
const newAppDir = "src/app";
|
|
17
|
+
const exampleDirPath = path.join(root, exampleDir);
|
|
18
|
+
|
|
19
|
+
const indexContent = `import { Text, View, StyleSheet } from "react-native";
|
|
20
|
+
|
|
21
|
+
export default function Index() {
|
|
22
|
+
return (
|
|
23
|
+
<View style={styles.container}>
|
|
24
|
+
<Text>Edit src/app/index.tsx to edit this screen.</Text>
|
|
25
|
+
</View>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const styles = StyleSheet.create({
|
|
30
|
+
container: {
|
|
31
|
+
flex: 1,
|
|
32
|
+
alignItems: "center",
|
|
33
|
+
justifyContent: "center",
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
`;
|
|
37
|
+
|
|
38
|
+
const layoutContent = `import { Stack } from "expo-router";
|
|
39
|
+
|
|
40
|
+
export default function RootLayout() {
|
|
41
|
+
return <Stack />;
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
const rl = readline.createInterface({
|
|
46
|
+
input: process.stdin,
|
|
47
|
+
output: process.stdout,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const moveDirectories = async (userInput) => {
|
|
51
|
+
try {
|
|
52
|
+
if (userInput === "y") {
|
|
53
|
+
// Create the app-example directory
|
|
54
|
+
await fs.promises.mkdir(exampleDirPath, { recursive: true });
|
|
55
|
+
console.log(`📁 /${exampleDir} directory created.`);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Move old directories to new app-example directory or delete them
|
|
59
|
+
for (const dir of oldDirs) {
|
|
60
|
+
const oldDirPath = path.join(root, dir);
|
|
61
|
+
if (fs.existsSync(oldDirPath)) {
|
|
62
|
+
if (userInput === "y") {
|
|
63
|
+
const newDirPath = path.join(root, exampleDir, dir);
|
|
64
|
+
await fs.promises.rename(oldDirPath, newDirPath);
|
|
65
|
+
console.log(`➡️ /${dir} moved to /${exampleDir}/${dir}.`);
|
|
66
|
+
} else {
|
|
67
|
+
await fs.promises.rm(oldDirPath, { recursive: true, force: true });
|
|
68
|
+
console.log(`❌ /${dir} deleted.`);
|
|
69
|
+
}
|
|
70
|
+
} else {
|
|
71
|
+
console.log(`➡️ /${dir} does not exist, skipping.`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Create new /src/app directory
|
|
76
|
+
const newAppDirPath = path.join(root, newAppDir);
|
|
77
|
+
await fs.promises.mkdir(newAppDirPath, { recursive: true });
|
|
78
|
+
console.log("\n📁 New /src/app directory created.");
|
|
79
|
+
|
|
80
|
+
// Create index.tsx
|
|
81
|
+
const indexPath = path.join(newAppDirPath, "index.tsx");
|
|
82
|
+
await fs.promises.writeFile(indexPath, indexContent);
|
|
83
|
+
console.log("📄 src/app/index.tsx created.");
|
|
84
|
+
|
|
85
|
+
// Create _layout.tsx
|
|
86
|
+
const layoutPath = path.join(newAppDirPath, "_layout.tsx");
|
|
87
|
+
await fs.promises.writeFile(layoutPath, layoutContent);
|
|
88
|
+
console.log("📄 src/app/_layout.tsx created.");
|
|
89
|
+
|
|
90
|
+
console.log("\n✅ Project reset complete. Next steps:");
|
|
91
|
+
console.log(
|
|
92
|
+
`1. Run \`npx expo start\` to start a development server.\n2. Edit src/app/index.tsx to edit the main screen.\n3. Put all your application code in /src, only screens and layout files should be in /src/app.${
|
|
93
|
+
userInput === "y"
|
|
94
|
+
? `\n4. Delete the /${exampleDir} directory when you're done referencing it.`
|
|
95
|
+
: ""
|
|
96
|
+
}`
|
|
97
|
+
);
|
|
98
|
+
} catch (error) {
|
|
99
|
+
console.error(`❌ Error during script execution: ${error.message}`);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
rl.question(
|
|
104
|
+
"Do you want to move existing files to /example instead of deleting them? (Y/n): ",
|
|
105
|
+
(answer) => {
|
|
106
|
+
const userInput = answer.trim().toLowerCase() || "y";
|
|
107
|
+
if (userInput === "y" || userInput === "n") {
|
|
108
|
+
moveDirectories(userInput).finally(() => rl.close());
|
|
109
|
+
} else {
|
|
110
|
+
console.log("❌ Invalid input. Please enter 'Y' or 'N'.");
|
|
111
|
+
rl.close();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DarkTheme, DefaultTheme, ThemeProvider } from 'expo-router';
|
|
2
|
+
import { PortalHost } from '@rn-primitives/portal';
|
|
3
|
+
import * as SplashScreen from 'expo-splash-screen';
|
|
4
|
+
import { useColorScheme } from 'react-native';
|
|
5
|
+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
6
|
+
|
|
7
|
+
import { AnimatedSplashOverlay } from '@/components/animated-icon';
|
|
8
|
+
import AppTabs from '@/components/app-tabs';
|
|
9
|
+
|
|
10
|
+
SplashScreen.preventAutoHideAsync();
|
|
11
|
+
|
|
12
|
+
export default function TabLayout() {
|
|
13
|
+
const colorScheme = useColorScheme();
|
|
14
|
+
return (
|
|
15
|
+
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
16
|
+
<ThemeProvider value={colorScheme === 'dark' ? DarkTheme : DefaultTheme}>
|
|
17
|
+
<AnimatedSplashOverlay />
|
|
18
|
+
<AppTabs />
|
|
19
|
+
<PortalHost />
|
|
20
|
+
</ThemeProvider>
|
|
21
|
+
</GestureHandlerRootView>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { Image } from 'expo-image';
|
|
2
|
+
import { SymbolView } from 'expo-symbols';
|
|
3
|
+
import { Platform, Pressable, ScrollView, StyleSheet } from 'react-native';
|
|
4
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
5
|
+
|
|
6
|
+
import { ExternalLink } from '@/components/external-link';
|
|
7
|
+
import { ThemedText } from '@/components/themed-text';
|
|
8
|
+
import { ThemedView } from '@/components/themed-view';
|
|
9
|
+
import { Collapsible } from '@/components/ui/collapsible';
|
|
10
|
+
import { WebBadge } from '@/components/web-badge';
|
|
11
|
+
import { BottomTabInset, MaxContentWidth, Spacing } from '@/constants/theme';
|
|
12
|
+
import { useTheme } from '@/hooks/use-theme';
|
|
13
|
+
|
|
14
|
+
export default function TabTwoScreen() {
|
|
15
|
+
const safeAreaInsets = useSafeAreaInsets();
|
|
16
|
+
const insets = {
|
|
17
|
+
...safeAreaInsets,
|
|
18
|
+
bottom: safeAreaInsets.bottom + BottomTabInset + Spacing.three,
|
|
19
|
+
};
|
|
20
|
+
const theme = useTheme();
|
|
21
|
+
|
|
22
|
+
const contentPlatformStyle = Platform.select({
|
|
23
|
+
android: {
|
|
24
|
+
paddingTop: insets.top,
|
|
25
|
+
paddingLeft: insets.left,
|
|
26
|
+
paddingRight: insets.right,
|
|
27
|
+
paddingBottom: insets.bottom,
|
|
28
|
+
},
|
|
29
|
+
web: {
|
|
30
|
+
paddingTop: Spacing.six,
|
|
31
|
+
paddingBottom: Spacing.four,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<ScrollView
|
|
37
|
+
style={[styles.scrollView, { backgroundColor: theme.background }]}
|
|
38
|
+
contentInset={insets}
|
|
39
|
+
contentContainerStyle={[styles.contentContainer, contentPlatformStyle]}>
|
|
40
|
+
<ThemedView style={styles.container}>
|
|
41
|
+
<ThemedView style={styles.titleContainer}>
|
|
42
|
+
<ThemedText type="subtitle">Explore</ThemedText>
|
|
43
|
+
<ThemedText style={styles.centerText} themeColor="textSecondary">
|
|
44
|
+
This starter app includes example{'\n'}code to help you get started.
|
|
45
|
+
</ThemedText>
|
|
46
|
+
|
|
47
|
+
<ExternalLink href="https://docs.expo.dev" asChild>
|
|
48
|
+
<Pressable style={({ pressed }) => pressed && styles.pressed}>
|
|
49
|
+
<ThemedView type="backgroundElement" style={styles.linkButton}>
|
|
50
|
+
<ThemedText type="link">Expo documentation</ThemedText>
|
|
51
|
+
<SymbolView
|
|
52
|
+
tintColor={theme.text}
|
|
53
|
+
name={{ ios: 'arrow.up.right.square', android: 'link', web: 'link' }}
|
|
54
|
+
size={12}
|
|
55
|
+
/>
|
|
56
|
+
</ThemedView>
|
|
57
|
+
</Pressable>
|
|
58
|
+
</ExternalLink>
|
|
59
|
+
</ThemedView>
|
|
60
|
+
|
|
61
|
+
<ThemedView style={styles.sectionsWrapper}>
|
|
62
|
+
<Collapsible title="File-based routing">
|
|
63
|
+
<ThemedText type="small">
|
|
64
|
+
This app has two screens: <ThemedText type="code">src/app/index.tsx</ThemedText> and{' '}
|
|
65
|
+
<ThemedText type="code">src/app/explore.tsx</ThemedText>
|
|
66
|
+
</ThemedText>
|
|
67
|
+
<ThemedText type="small">
|
|
68
|
+
The layout file in <ThemedText type="code">src/app/_layout.tsx</ThemedText> sets up
|
|
69
|
+
the tab navigator.
|
|
70
|
+
</ThemedText>
|
|
71
|
+
<ExternalLink href="https://docs.expo.dev/router/introduction">
|
|
72
|
+
<ThemedText type="linkPrimary">Learn more</ThemedText>
|
|
73
|
+
</ExternalLink>
|
|
74
|
+
</Collapsible>
|
|
75
|
+
|
|
76
|
+
<Collapsible title="Android, iOS, and web support">
|
|
77
|
+
<ThemedView type="backgroundElement" style={styles.collapsibleContent}>
|
|
78
|
+
<ThemedText type="small">
|
|
79
|
+
You can open this project on Android, iOS, and the web. To open the web version,
|
|
80
|
+
press <ThemedText type="smallBold">w</ThemedText> in the terminal running this
|
|
81
|
+
project.
|
|
82
|
+
</ThemedText>
|
|
83
|
+
<Image
|
|
84
|
+
source={require('@/assets/images/tutorial-web.png')}
|
|
85
|
+
style={styles.imageTutorial}
|
|
86
|
+
/>
|
|
87
|
+
</ThemedView>
|
|
88
|
+
</Collapsible>
|
|
89
|
+
|
|
90
|
+
<Collapsible title="Images">
|
|
91
|
+
<ThemedText type="small">
|
|
92
|
+
For static images, you can use the <ThemedText type="code">@2x</ThemedText> and{' '}
|
|
93
|
+
<ThemedText type="code">@3x</ThemedText> suffixes to provide files for different
|
|
94
|
+
screen densities.
|
|
95
|
+
</ThemedText>
|
|
96
|
+
<Image source={require('@/assets/images/react-logo.png')} style={styles.imageReact} />
|
|
97
|
+
<ExternalLink href="https://reactnative.dev/docs/images">
|
|
98
|
+
<ThemedText type="linkPrimary">Learn more</ThemedText>
|
|
99
|
+
</ExternalLink>
|
|
100
|
+
</Collapsible>
|
|
101
|
+
|
|
102
|
+
<Collapsible title="Light and dark mode components">
|
|
103
|
+
<ThemedText type="small">
|
|
104
|
+
This template has light and dark mode support. The{' '}
|
|
105
|
+
<ThemedText type="code">useColorScheme()</ThemedText> hook lets you inspect what the
|
|
106
|
+
user's current color scheme is, and so you can adjust UI colors accordingly.
|
|
107
|
+
</ThemedText>
|
|
108
|
+
<ExternalLink href="https://docs.expo.dev/develop/user-interface/color-themes/">
|
|
109
|
+
<ThemedText type="linkPrimary">Learn more</ThemedText>
|
|
110
|
+
</ExternalLink>
|
|
111
|
+
</Collapsible>
|
|
112
|
+
|
|
113
|
+
<Collapsible title="Animations">
|
|
114
|
+
<ThemedText type="small">
|
|
115
|
+
This template includes an example of an animated component. The{' '}
|
|
116
|
+
<ThemedText type="code">src/components/ui/collapsible.tsx</ThemedText> component uses
|
|
117
|
+
the powerful <ThemedText type="code">react-native-reanimated</ThemedText> library to
|
|
118
|
+
animate opening this hint.
|
|
119
|
+
</ThemedText>
|
|
120
|
+
</Collapsible>
|
|
121
|
+
</ThemedView>
|
|
122
|
+
{Platform.OS === 'web' && <WebBadge />}
|
|
123
|
+
</ThemedView>
|
|
124
|
+
</ScrollView>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const styles = StyleSheet.create({
|
|
129
|
+
scrollView: {
|
|
130
|
+
flex: 1,
|
|
131
|
+
},
|
|
132
|
+
contentContainer: {
|
|
133
|
+
flexDirection: 'row',
|
|
134
|
+
justifyContent: 'center',
|
|
135
|
+
},
|
|
136
|
+
container: {
|
|
137
|
+
maxWidth: MaxContentWidth,
|
|
138
|
+
flexGrow: 1,
|
|
139
|
+
},
|
|
140
|
+
titleContainer: {
|
|
141
|
+
gap: Spacing.three,
|
|
142
|
+
alignItems: 'center',
|
|
143
|
+
paddingHorizontal: Spacing.four,
|
|
144
|
+
paddingVertical: Spacing.six,
|
|
145
|
+
},
|
|
146
|
+
centerText: {
|
|
147
|
+
textAlign: 'center',
|
|
148
|
+
},
|
|
149
|
+
pressed: {
|
|
150
|
+
opacity: 0.7,
|
|
151
|
+
},
|
|
152
|
+
linkButton: {
|
|
153
|
+
flexDirection: 'row',
|
|
154
|
+
paddingHorizontal: Spacing.four,
|
|
155
|
+
paddingVertical: Spacing.two,
|
|
156
|
+
borderRadius: Spacing.five,
|
|
157
|
+
justifyContent: 'center',
|
|
158
|
+
gap: Spacing.one,
|
|
159
|
+
alignItems: 'center',
|
|
160
|
+
},
|
|
161
|
+
sectionsWrapper: {
|
|
162
|
+
gap: Spacing.five,
|
|
163
|
+
paddingHorizontal: Spacing.four,
|
|
164
|
+
paddingTop: Spacing.three,
|
|
165
|
+
},
|
|
166
|
+
collapsibleContent: {
|
|
167
|
+
alignItems: 'center',
|
|
168
|
+
},
|
|
169
|
+
imageTutorial: {
|
|
170
|
+
width: '100%',
|
|
171
|
+
aspectRatio: 296 / 171,
|
|
172
|
+
borderRadius: Spacing.three,
|
|
173
|
+
marginTop: Spacing.two,
|
|
174
|
+
},
|
|
175
|
+
imageReact: {
|
|
176
|
+
width: 100,
|
|
177
|
+
height: 100,
|
|
178
|
+
alignSelf: 'center',
|
|
179
|
+
},
|
|
180
|
+
});
|