create-wizze-app 0.1.9 → 0.1.10
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 +1 -1
- package/dist/index.js +21 -26
- package/package.json +2 -2
- package/templates/wizze-native/README.md +17 -0
- package/templates/wizze-native/app.json +14 -0
- package/templates/wizze-native/package.json +22 -0
- package/templates/wizze-native/src/constants/wizze-template.ts +4 -0
- package/templates/wizze-native/src/dev.ts +4 -0
- package/templates/wizze-native/src/main.test.ts +12 -0
- package/templates/wizze-native/src/main.ts +8 -0
- package/templates/wizze-native/tsconfig.json +14 -0
- package/templates/expo-default-sdk55/.claude/settings.json +0 -5
- package/templates/expo-default-sdk55/.vscode/extensions.json +0 -1
- package/templates/expo-default-sdk55/.vscode/settings.json +0 -7
- package/templates/expo-default-sdk55/AGENTS.md +0 -4
- package/templates/expo-default-sdk55/CLAUDE.md +0 -1
- package/templates/expo-default-sdk55/README.md +0 -41
- package/templates/expo-default-sdk55/app.json +0 -44
- package/templates/expo-default-sdk55/assets/images/android-icon-background.png +0 -0
- package/templates/expo-default-sdk55/assets/images/android-icon-foreground.png +0 -0
- package/templates/expo-default-sdk55/assets/images/android-icon-monochrome.png +0 -0
- package/templates/expo-default-sdk55/assets/images/favicon.png +0 -0
- package/templates/expo-default-sdk55/assets/images/icon.png +0 -0
- package/templates/expo-default-sdk55/assets/images/logo-glow.png +0 -0
- package/templates/expo-default-sdk55/assets/images/react-logo.png +0 -0
- package/templates/expo-default-sdk55/assets/images/react-logo@2x.png +0 -0
- package/templates/expo-default-sdk55/assets/images/react-logo@3x.png +0 -0
- package/templates/expo-default-sdk55/assets/images/splash-icon.png +0 -0
- package/templates/expo-default-sdk55/assets/images/tabIcons/explore.png +0 -0
- package/templates/expo-default-sdk55/assets/images/tabIcons/explore@2x.png +0 -0
- package/templates/expo-default-sdk55/assets/images/tabIcons/explore@3x.png +0 -0
- package/templates/expo-default-sdk55/assets/images/tabIcons/home.png +0 -0
- package/templates/expo-default-sdk55/assets/images/tabIcons/home@2x.png +0 -0
- package/templates/expo-default-sdk55/assets/images/tabIcons/home@3x.png +0 -0
- package/templates/expo-default-sdk55/assets/images/tutorial-web.png +0 -0
- package/templates/expo-default-sdk55/assets/images/wizze-badge-white.png +0 -0
- package/templates/expo-default-sdk55/assets/images/wizze-badge.png +0 -0
- package/templates/expo-default-sdk55/assets/images/wizze-logo.png +0 -0
- package/templates/expo-default-sdk55/package.json +0 -47
- package/templates/expo-default-sdk55/scripts/reset-project.js +0 -114
- package/templates/expo-default-sdk55/src/app/_layout.tsx +0 -16
- package/templates/expo-default-sdk55/src/app/explore.tsx +0 -181
- package/templates/expo-default-sdk55/src/app/index.tsx +0 -98
- package/templates/expo-default-sdk55/src/components/animated-icon.module.css +0 -6
- package/templates/expo-default-sdk55/src/components/animated-icon.tsx +0 -132
- package/templates/expo-default-sdk55/src/components/animated-icon.web.tsx +0 -108
- package/templates/expo-default-sdk55/src/components/app-tabs.tsx +0 -33
- package/templates/expo-default-sdk55/src/components/app-tabs.web.tsx +0 -116
- package/templates/expo-default-sdk55/src/components/external-link.tsx +0 -25
- package/templates/expo-default-sdk55/src/components/hint-row.tsx +0 -35
- package/templates/expo-default-sdk55/src/components/themed-text.tsx +0 -73
- package/templates/expo-default-sdk55/src/components/themed-view.tsx +0 -16
- package/templates/expo-default-sdk55/src/components/ui/collapsible.tsx +0 -65
- package/templates/expo-default-sdk55/src/components/web-badge.tsx +0 -43
- package/templates/expo-default-sdk55/src/constants/theme.ts +0 -65
- package/templates/expo-default-sdk55/src/global.css +0 -9
- package/templates/expo-default-sdk55/src/hooks/use-color-scheme.ts +0 -1
- package/templates/expo-default-sdk55/src/hooks/use-color-scheme.web.ts +0 -21
- package/templates/expo-default-sdk55/src/hooks/use-theme.ts +0 -13
- package/templates/expo-default-sdk55/tsconfig.json +0 -20
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ Gerador oficial de projetos do Wizze Framework.
|
|
|
18
18
|
|
|
19
19
|
## Scripts iniciais
|
|
20
20
|
|
|
21
|
-
- `npm start` (usa `wizze start
|
|
21
|
+
- `npm start` (usa `wizze start`)
|
|
22
22
|
- `npm run android` (build cloud Android)
|
|
23
23
|
- `npm run ios` (build cloud iOS)
|
|
24
24
|
- `npm run web` (inicia sessão de desenvolvimento)
|
package/dist/index.js
CHANGED
|
@@ -107,15 +107,15 @@ async function ensureDirectoryReady(appDir) {
|
|
|
107
107
|
async function resolveBaseTemplateDir() {
|
|
108
108
|
const currentFilePath = fileURLToPath(import.meta.url);
|
|
109
109
|
const candidates = [
|
|
110
|
-
join(currentFilePath, '..', '..', 'templates', '
|
|
111
|
-
join(currentFilePath, '..', '..', '..', '..', 'packages', 'create-wizze-app', 'templates', '
|
|
110
|
+
join(currentFilePath, '..', '..', 'templates', 'wizze-native'),
|
|
111
|
+
join(currentFilePath, '..', '..', '..', '..', 'packages', 'create-wizze-app', 'templates', 'wizze-native'),
|
|
112
112
|
];
|
|
113
113
|
for (const candidate of candidates) {
|
|
114
114
|
if (await pathExists(candidate)) {
|
|
115
115
|
return candidate;
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
throw new Error('Template base do Wizze Go não encontrado no pacote create-wizze-app.');
|
|
118
|
+
throw new Error('Template base nativo do Wizze Go não encontrado no pacote create-wizze-app.');
|
|
119
119
|
}
|
|
120
120
|
async function patchProjectMetadata(input) {
|
|
121
121
|
const { appDir, slug, displayName, template, templateMeta } = input;
|
|
@@ -129,40 +129,35 @@ async function patchProjectMetadata(input) {
|
|
|
129
129
|
const scripts = packageJson.scripts && typeof packageJson.scripts === 'object'
|
|
130
130
|
? { ...packageJson.scripts }
|
|
131
131
|
: {};
|
|
132
|
-
scripts.start = 'wizze start
|
|
132
|
+
scripts.start = 'wizze start';
|
|
133
133
|
scripts.android = 'wizze build android --cloud';
|
|
134
134
|
scripts.ios = 'wizze build ios --cloud';
|
|
135
135
|
scripts.web = 'wizze start';
|
|
136
136
|
scripts.lint = 'wizze doctor';
|
|
137
137
|
packageJson.scripts = scripts;
|
|
138
|
-
const dependencies = packageJson.dependencies && typeof packageJson.dependencies === 'object'
|
|
139
|
-
? { ...packageJson.dependencies }
|
|
140
|
-
: {};
|
|
141
|
-
dependencies['expo-dev-client'] = dependencies['expo-dev-client'] || '^5.2.4';
|
|
142
|
-
packageJson.dependencies = dependencies;
|
|
143
138
|
const devDependencies = packageJson.devDependencies && typeof packageJson.devDependencies === 'object'
|
|
144
139
|
? { ...packageJson.devDependencies }
|
|
145
140
|
: {};
|
|
146
|
-
devDependencies.wizze = '^0.1.
|
|
141
|
+
devDependencies.wizze = '^0.1.10';
|
|
147
142
|
packageJson.devDependencies = devDependencies;
|
|
148
143
|
await writeFile(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}\n`, 'utf8');
|
|
149
144
|
const appJson = JSON.parse(await readFile(appJsonPath, 'utf8'));
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
145
|
+
appJson.name = displayName;
|
|
146
|
+
appJson.slug = slug;
|
|
147
|
+
appJson.scheme = slug.replace(/-/g, '');
|
|
148
|
+
appJson.platforms = ['android', 'ios', 'web'];
|
|
149
|
+
const splash = appJson.splash && typeof appJson.splash === 'object'
|
|
150
|
+
? { ...appJson.splash }
|
|
151
|
+
: {};
|
|
152
|
+
splash.backgroundColor = templateMeta.accentColor;
|
|
153
|
+
appJson.splash = splash;
|
|
154
|
+
const wizze = appJson.wizze && typeof appJson.wizze === 'object'
|
|
155
|
+
? { ...appJson.wizze }
|
|
156
|
+
: {};
|
|
157
|
+
wizze.runtime = 'native';
|
|
158
|
+
wizze.entry = 'src/dev.ts';
|
|
159
|
+
wizze.template = template;
|
|
160
|
+
appJson.wizze = wizze;
|
|
166
161
|
await writeFile(appJsonPath, `${JSON.stringify(appJson, null, 2)}\n`, 'utf8');
|
|
167
162
|
const wizzeConfigPayload = {
|
|
168
163
|
name: displayName,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-wizze-app",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "Gerador oficial de projetos do Wizze Framework.",
|
|
5
5
|
"author": "Master Dev (Taliton Silva)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
"dist",
|
|
12
12
|
"README.md",
|
|
13
|
-
"templates"
|
|
13
|
+
"templates/wizze-native"
|
|
14
14
|
],
|
|
15
15
|
"publishConfig": {
|
|
16
16
|
"access": "public"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Wizze Native App
|
|
2
|
+
|
|
3
|
+
Base oficial para iniciar um app nativo no ecossistema Wizze.
|
|
4
|
+
|
|
5
|
+
## Scripts
|
|
6
|
+
|
|
7
|
+
- `pnpm dev`: executa bootstrap local em watch.
|
|
8
|
+
- `pnpm start`: inicia sessão de desenvolvimento via Wizze runtime.
|
|
9
|
+
- `pnpm test`: roda testes locais.
|
|
10
|
+
- `pnpm build`: valida tipos do projeto.
|
|
11
|
+
|
|
12
|
+
## Estrutura
|
|
13
|
+
|
|
14
|
+
- `app.json`: metadados nativos do app e runtime Wizze.
|
|
15
|
+
- `wizze.config.ts`: configuração de projeto usada pela CLI.
|
|
16
|
+
- `src/main.ts`: bootstrap do app.
|
|
17
|
+
- `src/dev.ts`: entrada de desenvolvimento local.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Wizze Native App",
|
|
3
|
+
"slug": "wizze-native-app",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"scheme": "wizzenativeapp",
|
|
6
|
+
"platforms": ["android", "ios", "web"],
|
|
7
|
+
"splash": {
|
|
8
|
+
"backgroundColor": "#208AEF"
|
|
9
|
+
},
|
|
10
|
+
"wizze": {
|
|
11
|
+
"runtime": "native",
|
|
12
|
+
"entry": "src/dev.ts"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "wizze-native-app",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "tsx watch src/dev.ts",
|
|
8
|
+
"start": "wizze start",
|
|
9
|
+
"build": "pnpm typecheck",
|
|
10
|
+
"test": "tsx --test src/**/*.test.ts",
|
|
11
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
12
|
+
"clean": "rm -rf dist"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@wizze/wizze-sdk": "^0.1.10"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"tsx": "^4.20.6",
|
|
19
|
+
"typescript": "^5.9.3",
|
|
20
|
+
"wizze": "^0.1.10"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { strict as assert } from 'node:assert';
|
|
2
|
+
import { test } from 'node:test';
|
|
3
|
+
|
|
4
|
+
import { bootstrapApp } from './main.js';
|
|
5
|
+
|
|
6
|
+
test('bootstrapApp returns app capabilities', () => {
|
|
7
|
+
const boot = bootstrapApp();
|
|
8
|
+
|
|
9
|
+
assert.equal(boot.app, 'Wizze Native App');
|
|
10
|
+
assert.equal(boot.status, 'ready');
|
|
11
|
+
assert.ok(Array.isArray(boot.capabilities));
|
|
12
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"allowSyntheticDefaultImports": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"strict": true,
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
"outDir": "dist",
|
|
11
|
+
"rootDir": "src"
|
|
12
|
+
},
|
|
13
|
+
"include": ["src/**/*"]
|
|
14
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{ "recommendations": ["expo.vscode-expo-tools"] }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@AGENTS.md
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# Wizze Go App
|
|
2
|
-
|
|
3
|
-
Projeto base oficial para aplicativos Wizze Go com suporte a Android, iOS e Web.
|
|
4
|
-
|
|
5
|
-
## Início rápido
|
|
6
|
-
|
|
7
|
-
1. Instale as dependências
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
2. Inicie o desenvolvimento
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm start
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Fluxo recomendado
|
|
20
|
-
|
|
21
|
-
- `npm start`: inicia o modo desenvolvimento.
|
|
22
|
-
- `npm run android`: envia build Android para a fila cloud.
|
|
23
|
-
- `npm run ios`: envia build iOS para a fila cloud.
|
|
24
|
-
- `npm run web`: inicia a sessão de desenvolvimento.
|
|
25
|
-
- `npm run lint`: executa diagnóstico rápido do ambiente.
|
|
26
|
-
|
|
27
|
-
## Estrutura principal
|
|
28
|
-
|
|
29
|
-
- `src/app`: telas e layout por rotas.
|
|
30
|
-
- `src/components`: componentes reutilizáveis.
|
|
31
|
-
- `src/constants`: tema e constantes de UI.
|
|
32
|
-
- `src/hooks`: hooks utilitários.
|
|
33
|
-
- `wizze.config.ts`: configuração do projeto Wizze Go.
|
|
34
|
-
|
|
35
|
-
## Reset de base
|
|
36
|
-
|
|
37
|
-
Quando quiser limpar o starter e começar do zero:
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
npm run reset-project
|
|
41
|
-
```
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"expo": {
|
|
3
|
-
"name": "sample-universal",
|
|
4
|
-
"slug": "sample-universal",
|
|
5
|
-
"version": "1.0.0",
|
|
6
|
-
"orientation": "portrait",
|
|
7
|
-
"icon": "./assets/images/icon.png",
|
|
8
|
-
"scheme": "sampleuniversal",
|
|
9
|
-
"userInterfaceStyle": "automatic",
|
|
10
|
-
"ios": {
|
|
11
|
-
"supportsTablet": true
|
|
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
|
-
"android": {
|
|
33
|
-
"image": "./assets/images/splash-icon.png",
|
|
34
|
-
"imageWidth": 76
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
]
|
|
38
|
-
],
|
|
39
|
-
"experiments": {
|
|
40
|
-
"typedRoutes": true,
|
|
41
|
-
"reactCompiler": true
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
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
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "sample-universal",
|
|
3
|
-
"main": "expo-router/entry",
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"start": "wizze start --dev-client",
|
|
7
|
-
"reset-project": "node ./scripts/reset-project.js",
|
|
8
|
-
"android": "wizze build android --cloud",
|
|
9
|
-
"ios": "wizze build ios --cloud",
|
|
10
|
-
"web": "wizze start",
|
|
11
|
-
"lint": "wizze doctor"
|
|
12
|
-
},
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"@react-navigation/bottom-tabs": "^7.15.5",
|
|
15
|
-
"@react-navigation/elements": "^2.9.10",
|
|
16
|
-
"@react-navigation/native": "^7.1.33",
|
|
17
|
-
"expo": "~55.0.24",
|
|
18
|
-
"expo-constants": "~55.0.16",
|
|
19
|
-
"expo-dev-client": "^5.2.4",
|
|
20
|
-
"expo-device": "~55.0.17",
|
|
21
|
-
"expo-font": "~55.0.7",
|
|
22
|
-
"expo-glass-effect": "~55.0.11",
|
|
23
|
-
"expo-image": "~55.0.10",
|
|
24
|
-
"expo-linking": "~55.0.15",
|
|
25
|
-
"expo-router": "~55.0.14",
|
|
26
|
-
"expo-splash-screen": "~55.0.21",
|
|
27
|
-
"expo-status-bar": "~55.0.6",
|
|
28
|
-
"expo-symbols": "~55.0.8",
|
|
29
|
-
"expo-system-ui": "~55.0.18",
|
|
30
|
-
"expo-web-browser": "~55.0.16",
|
|
31
|
-
"react": "19.2.0",
|
|
32
|
-
"react-dom": "19.2.0",
|
|
33
|
-
"react-native": "0.83.6",
|
|
34
|
-
"react-native-gesture-handler": "~2.30.0",
|
|
35
|
-
"react-native-worklets": "0.7.4",
|
|
36
|
-
"react-native-reanimated": "4.2.1",
|
|
37
|
-
"react-native-safe-area-context": "~5.6.2",
|
|
38
|
-
"react-native-screens": "~4.23.0",
|
|
39
|
-
"react-native-web": "~0.21.0"
|
|
40
|
-
},
|
|
41
|
-
"devDependencies": {
|
|
42
|
-
"@types/react": "~19.2.2",
|
|
43
|
-
"typescript": "~5.9.2",
|
|
44
|
-
"wizze": "^0.1.9"
|
|
45
|
-
},
|
|
46
|
-
"private": true
|
|
47
|
-
}
|
|
@@ -1,114 +0,0 @@
|
|
|
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 \`npm 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
|
-
);
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { DarkTheme, DefaultTheme, ThemeProvider } from '@react-navigation/native';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { useColorScheme } from 'react-native';
|
|
4
|
-
|
|
5
|
-
import { AnimatedSplashOverlay } from '@/components/animated-icon';
|
|
6
|
-
import AppTabs from '@/components/app-tabs';
|
|
7
|
-
|
|
8
|
-
export default function TabLayout() {
|
|
9
|
-
const colorScheme = useColorScheme();
|
|
10
|
-
return (
|
|
11
|
-
<ThemeProvider value={colorScheme === 'dark' ? DarkTheme : DefaultTheme}>
|
|
12
|
-
<AnimatedSplashOverlay />
|
|
13
|
-
<AppTabs />
|
|
14
|
-
</ThemeProvider>
|
|
15
|
-
);
|
|
16
|
-
}
|