create-wizze-app 0.1.2 → 0.1.4

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.
Files changed (55) hide show
  1. package/README.md +18 -1
  2. package/dist/index.js +139 -47
  3. package/package.json +3 -2
  4. package/templates/expo-default-sdk55/.claude/settings.json +5 -0
  5. package/templates/expo-default-sdk55/.vscode/extensions.json +1 -0
  6. package/templates/expo-default-sdk55/.vscode/settings.json +7 -0
  7. package/templates/expo-default-sdk55/AGENTS.md +3 -0
  8. package/templates/expo-default-sdk55/CLAUDE.md +1 -0
  9. package/templates/expo-default-sdk55/README.md +56 -0
  10. package/templates/expo-default-sdk55/app.json +44 -0
  11. package/templates/expo-default-sdk55/assets/expo.icon/Assets/expo-symbol 2.svg +3 -0
  12. package/templates/expo-default-sdk55/assets/expo.icon/Assets/grid.png +0 -0
  13. package/templates/expo-default-sdk55/assets/expo.icon/icon.json +40 -0
  14. package/templates/expo-default-sdk55/assets/images/android-icon-background.png +0 -0
  15. package/templates/expo-default-sdk55/assets/images/android-icon-foreground.png +0 -0
  16. package/templates/expo-default-sdk55/assets/images/android-icon-monochrome.png +0 -0
  17. package/templates/expo-default-sdk55/assets/images/expo-badge-white.png +0 -0
  18. package/templates/expo-default-sdk55/assets/images/expo-badge.png +0 -0
  19. package/templates/expo-default-sdk55/assets/images/expo-logo.png +0 -0
  20. package/templates/expo-default-sdk55/assets/images/favicon.png +0 -0
  21. package/templates/expo-default-sdk55/assets/images/icon.png +0 -0
  22. package/templates/expo-default-sdk55/assets/images/logo-glow.png +0 -0
  23. package/templates/expo-default-sdk55/assets/images/react-logo.png +0 -0
  24. package/templates/expo-default-sdk55/assets/images/react-logo@2x.png +0 -0
  25. package/templates/expo-default-sdk55/assets/images/react-logo@3x.png +0 -0
  26. package/templates/expo-default-sdk55/assets/images/splash-icon.png +0 -0
  27. package/templates/expo-default-sdk55/assets/images/tabIcons/explore.png +0 -0
  28. package/templates/expo-default-sdk55/assets/images/tabIcons/explore@2x.png +0 -0
  29. package/templates/expo-default-sdk55/assets/images/tabIcons/explore@3x.png +0 -0
  30. package/templates/expo-default-sdk55/assets/images/tabIcons/home.png +0 -0
  31. package/templates/expo-default-sdk55/assets/images/tabIcons/home@2x.png +0 -0
  32. package/templates/expo-default-sdk55/assets/images/tabIcons/home@3x.png +0 -0
  33. package/templates/expo-default-sdk55/assets/images/tutorial-web.png +0 -0
  34. package/templates/expo-default-sdk55/package.json +45 -0
  35. package/templates/expo-default-sdk55/scripts/reset-project.js +114 -0
  36. package/templates/expo-default-sdk55/src/app/_layout.tsx +16 -0
  37. package/templates/expo-default-sdk55/src/app/explore.tsx +181 -0
  38. package/templates/expo-default-sdk55/src/app/index.tsx +98 -0
  39. package/templates/expo-default-sdk55/src/components/animated-icon.module.css +6 -0
  40. package/templates/expo-default-sdk55/src/components/animated-icon.tsx +132 -0
  41. package/templates/expo-default-sdk55/src/components/animated-icon.web.tsx +108 -0
  42. package/templates/expo-default-sdk55/src/components/app-tabs.tsx +33 -0
  43. package/templates/expo-default-sdk55/src/components/app-tabs.web.tsx +116 -0
  44. package/templates/expo-default-sdk55/src/components/external-link.tsx +25 -0
  45. package/templates/expo-default-sdk55/src/components/hint-row.tsx +35 -0
  46. package/templates/expo-default-sdk55/src/components/themed-text.tsx +73 -0
  47. package/templates/expo-default-sdk55/src/components/themed-view.tsx +16 -0
  48. package/templates/expo-default-sdk55/src/components/ui/collapsible.tsx +65 -0
  49. package/templates/expo-default-sdk55/src/components/web-badge.tsx +44 -0
  50. package/templates/expo-default-sdk55/src/constants/theme.ts +65 -0
  51. package/templates/expo-default-sdk55/src/global.css +9 -0
  52. package/templates/expo-default-sdk55/src/hooks/use-color-scheme.ts +1 -0
  53. package/templates/expo-default-sdk55/src/hooks/use-color-scheme.web.ts +21 -0
  54. package/templates/expo-default-sdk55/src/hooks/use-theme.ts +14 -0
  55. package/templates/expo-default-sdk55/tsconfig.json +20 -0
package/README.md CHANGED
@@ -2,7 +2,24 @@
2
2
 
3
3
  Gerador oficial de projetos do Wizze Framework.
4
4
 
5
- Uso:
5
+ ## Uso
6
6
 
7
7
  - `create-wizze-app <nome>`
8
8
  - `create-wizze-app <nome> --template <blank|tabs|ecommerce|delivery|social|dashboard-mobile|marketplace|fintech|education|health|restaurant>`
9
+
10
+ ## O que Ć© gerado
11
+
12
+ - Estrutura base interna equivalente ao template oficial do Expo (SDK 55).
13
+ - Suporte universal para Android, iOS e Web.
14
+ - `src/app` com rotas por arquivo (Expo Router).
15
+ - `src/components`, `src/constants` e `src/hooks`.
16
+ - `app.json` configurado para Expo.
17
+ - `wizze.config.ts` com metadados do projeto Wizze Go.
18
+
19
+ ## Scripts iniciais
20
+
21
+ - `npm run start`
22
+ - `npm run android`
23
+ - `npm run ios`
24
+ - `npm run web`
25
+ - `npm run prebuild` (gera pastas nativas `android/` e `ios/`)
package/dist/index.js CHANGED
@@ -1,8 +1,6 @@
1
- import { copyFile, mkdir, readdir, writeFile } from 'node:fs/promises';
2
- import { fileURLToPath } from 'node:url';
1
+ import { access, copyFile, mkdir, readdir, readFile, writeFile } from 'node:fs/promises';
3
2
  import { join } from 'node:path';
4
- import { access } from 'node:fs/promises';
5
- import { resolveTemplate } from './template-resolver.js';
3
+ import { fileURLToPath } from 'node:url';
6
4
  const SUPPORTED_TEMPLATES = new Set([
7
5
  'blank',
8
6
  'dashboard-mobile',
@@ -16,6 +14,63 @@ const SUPPORTED_TEMPLATES = new Set([
16
14
  'social',
17
15
  'tabs',
18
16
  ]);
17
+ const TEMPLATE_META = {
18
+ blank: {
19
+ title: 'Wizze Go Base',
20
+ subtitle: 'Estrutura universal com base oficial Expo para Android, iOS e Web.',
21
+ accentColor: '#208AEF',
22
+ },
23
+ 'dashboard-mobile': {
24
+ title: 'Dashboard Mobile',
25
+ subtitle: 'Base para operação mobile com foco em métricas e release contínuo.',
26
+ accentColor: '#0369A1',
27
+ },
28
+ delivery: {
29
+ title: 'Delivery App',
30
+ subtitle: 'Base para pedidos, entregas e operação logística.',
31
+ accentColor: '#B45309',
32
+ },
33
+ ecommerce: {
34
+ title: 'E-commerce App',
35
+ subtitle: 'Base para catƔlogo, carrinho e fluxo de checkout.',
36
+ accentColor: '#0F766E',
37
+ },
38
+ education: {
39
+ title: 'Education App',
40
+ subtitle: 'Base para trilhas de ensino, aulas e progresso.',
41
+ accentColor: '#4338CA',
42
+ },
43
+ fintech: {
44
+ title: 'Fintech App',
45
+ subtitle: 'Base para contas, transações e visão financeira.',
46
+ accentColor: '#0F766E',
47
+ },
48
+ health: {
49
+ title: 'Health App',
50
+ subtitle: 'Base para agenda, acompanhamento e histórico clínico.',
51
+ accentColor: '#0E7490',
52
+ },
53
+ marketplace: {
54
+ title: 'Marketplace App',
55
+ subtitle: 'Base para múltiplos vendedores e gestão de pedidos.',
56
+ accentColor: '#7E22CE',
57
+ },
58
+ restaurant: {
59
+ title: 'Restaurant App',
60
+ subtitle: 'Base para operação de balcão, salão e cozinha.',
61
+ accentColor: '#B91C1C',
62
+ },
63
+ social: {
64
+ title: 'Social App',
65
+ subtitle: 'Base para feed, interaƧƵes e perfis.',
66
+ accentColor: '#DB2777',
67
+ },
68
+ tabs: {
69
+ title: 'Tabs App',
70
+ subtitle: 'Base de navegação por abas para evolução rÔpida.',
71
+ accentColor: '#2563EB',
72
+ },
73
+ };
19
74
  export async function createWizzeApp(input) {
20
75
  const rawName = input.name.trim();
21
76
  if (!rawName) {
@@ -24,7 +79,7 @@ export async function createWizzeApp(input) {
24
79
  if (rawName.includes('/') || rawName.includes('\\') || rawName === '.' || rawName === '..') {
25
80
  throw new Error('Nome de aplicativo invĆ”lido. NĆ£o use separadores de diretório.');
26
81
  }
27
- const template = resolveTemplate(input.template).trim();
82
+ const template = (input.template ?? 'blank').trim();
28
83
  if (!SUPPORTED_TEMPLATES.has(template)) {
29
84
  throw new Error(`Template invĆ”lido: ${template}`);
30
85
  }
@@ -33,31 +88,91 @@ export async function createWizzeApp(input) {
33
88
  throw new Error('Nome de aplicativo invĆ”lido após normalização.');
34
89
  }
35
90
  const appDir = join(process.cwd(), slug);
91
+ await ensureDirectoryReady(appDir);
92
+ const baseTemplateDir = await resolveBaseTemplateDir();
93
+ await copyDirectory(baseTemplateDir, appDir);
94
+ const displayName = toTitleCase(slug);
95
+ const templateMeta = TEMPLATE_META[template] ?? TEMPLATE_META.blank;
96
+ await patchProjectMetadata({ appDir, slug, displayName, template, templateMeta });
97
+ }
98
+ async function ensureDirectoryReady(appDir) {
99
+ if (await pathExists(appDir)) {
100
+ const files = await readdir(appDir);
101
+ if (files.length > 0) {
102
+ throw new Error('A pasta do aplicativo jÔ existe e não estÔ vazia. Escolha outro nome.');
103
+ }
104
+ }
36
105
  await mkdir(appDir, { recursive: true });
37
- const templateDir = await resolveTemplateDir(template);
38
- if (templateDir) {
39
- await copyDirectory(templateDir, appDir);
106
+ }
107
+ async function resolveBaseTemplateDir() {
108
+ const currentFilePath = fileURLToPath(import.meta.url);
109
+ const candidates = [
110
+ join(currentFilePath, '..', '..', 'templates', 'expo-default-sdk55'),
111
+ join(currentFilePath, '..', '..', '..', '..', 'packages', 'create-wizze-app', 'templates', 'expo-default-sdk55'),
112
+ ];
113
+ for (const candidate of candidates) {
114
+ if (await pathExists(candidate)) {
115
+ return candidate;
116
+ }
40
117
  }
41
- else {
42
- await mkdir(join(appDir, 'src'), { recursive: true });
118
+ throw new Error('Template base do Expo não encontrado no pacote create-wizze-app.');
119
+ }
120
+ async function patchProjectMetadata(input) {
121
+ const { appDir, slug, displayName, template, templateMeta } = input;
122
+ const packageJsonPath = join(appDir, 'package.json');
123
+ const appJsonPath = join(appDir, 'app.json');
124
+ const readmePath = join(appDir, 'README.md');
125
+ const wizzeConfigPath = join(appDir, 'wizze.config.ts');
126
+ const templateInfoPath = join(appDir, 'src', 'constants', 'wizze-template.ts');
127
+ const packageJson = JSON.parse(await readFile(packageJsonPath, 'utf8'));
128
+ packageJson.name = slug;
129
+ await writeFile(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}\n`, 'utf8');
130
+ const appJson = JSON.parse(await readFile(appJsonPath, 'utf8'));
131
+ if (!appJson.expo || typeof appJson.expo !== 'object') {
132
+ throw new Error('app.json invƔlido no template base.');
133
+ }
134
+ const expoConfig = appJson.expo;
135
+ expoConfig.name = displayName;
136
+ expoConfig.slug = slug;
137
+ expoConfig.scheme = slug.replace(/-/g, '');
138
+ const plugins = expoConfig.plugins;
139
+ if (Array.isArray(plugins)) {
140
+ for (const plugin of plugins) {
141
+ if (Array.isArray(plugin) && plugin[0] === 'expo-splash-screen' && typeof plugin[1] === 'object' && plugin[1]) {
142
+ const config = plugin[1];
143
+ config.backgroundColor = templateMeta.accentColor;
144
+ }
145
+ }
43
146
  }
44
- const configPayload = {
45
- name: toTitleCase(slug),
147
+ await writeFile(appJsonPath, `${JSON.stringify(appJson, null, 2)}\n`, 'utf8');
148
+ const wizzeConfigPayload = {
149
+ name: displayName,
46
150
  slug,
47
151
  version: '1.0.0',
48
- template
152
+ template,
153
+ platforms: ['android', 'ios', 'web'],
49
154
  };
50
- await writeFile(join(appDir, 'wizze.config.ts'), `export default ${JSON.stringify(configPayload, null, 2)};\n`, 'utf8');
51
- const packagePayload = {
52
- name: slug,
53
- private: true,
54
- version: '0.0.1',
55
- scripts: {
56
- dev: 'echo "Projeto Wizze criado. Configure o runtime para desenvolvimento."'
57
- }
58
- };
59
- await writeFile(join(appDir, 'package.json'), `${JSON.stringify(packagePayload, null, 2)}\n`, 'utf8');
60
- await ensureTemplateAppSource(appDir, template);
155
+ await writeFile(wizzeConfigPath, `export default ${JSON.stringify(wizzeConfigPayload, null, 2)};\n`, 'utf8');
156
+ const readmeAppendix = [
157
+ '',
158
+ '## Wizze Go',
159
+ '',
160
+ `Este projeto foi inicializado com o template \`${template}\` do Wizze Go.`,
161
+ '',
162
+ '- Estrutura base: padrão oficial do Expo (SDK 55).',
163
+ '- Plataformas: Android, iOS e Web.',
164
+ '- Configuração Wizze: `wizze.config.ts`.',
165
+ '',
166
+ ].join('\n');
167
+ await writeFile(readmePath, `${(await readFile(readmePath, 'utf8')).trimEnd()}\n${readmeAppendix}`, 'utf8');
168
+ const templateInfo = [
169
+ `export const wizzeTemplate = ${JSON.stringify(template, null, 2)};`,
170
+ `export const wizzeTemplateTitle = ${JSON.stringify(templateMeta.title, null, 2)};`,
171
+ `export const wizzeTemplateSubtitle = ${JSON.stringify(templateMeta.subtitle, null, 2)};`,
172
+ `export const wizzeTemplateAccent = ${JSON.stringify(templateMeta.accentColor, null, 2)};`,
173
+ '',
174
+ ].join('\n');
175
+ await writeFile(templateInfoPath, templateInfo, 'utf8');
61
176
  }
62
177
  function toSlug(value) {
63
178
  return value
@@ -74,29 +189,6 @@ function toTitleCase(value) {
74
189
  .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
75
190
  .join(' ');
76
191
  }
77
- function buildAppTemplateSource(template) {
78
- return [
79
- 'export function App() {',
80
- ` return 'Wizze template: ${template}';`,
81
- '}',
82
- ''
83
- ].join('\n');
84
- }
85
- async function ensureTemplateAppSource(appDir, template) {
86
- const tsPath = join(appDir, 'src', 'App.ts');
87
- const tsxPath = join(appDir, 'src', 'App.tsx');
88
- if (!(await pathExists(tsPath)) && !(await pathExists(tsxPath))) {
89
- await writeFile(tsPath, buildAppTemplateSource(template), 'utf8');
90
- }
91
- }
92
- async function resolveTemplateDir(template) {
93
- const currentFilePath = fileURLToPath(import.meta.url);
94
- const rootTemplates = join(currentFilePath, '..', '..', '..', '..', 'templates', template);
95
- if (await pathExists(rootTemplates)) {
96
- return rootTemplates;
97
- }
98
- return null;
99
- }
100
192
  async function copyDirectory(sourceDir, targetDir) {
101
193
  const entries = await readdir(sourceDir, { withFileTypes: true });
102
194
  for (const entry of entries) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-wizze-app",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Gerador oficial de projetos do Wizze Framework.",
5
5
  "author": "Master Dev (Taliton Silva)",
6
6
  "license": "MIT",
@@ -9,7 +9,8 @@
9
9
  "types": "dist/index.d.ts",
10
10
  "files": [
11
11
  "dist",
12
- "README.md"
12
+ "README.md",
13
+ "templates"
13
14
  ],
14
15
  "publishConfig": {
15
16
  "access": "public"
@@ -0,0 +1,5 @@
1
+ {
2
+ "enabledPlugins": {
3
+ "expo@claude-plugins-official": true
4
+ }
5
+ }
@@ -0,0 +1 @@
1
+ { "recommendations": ["expo.vscode-expo-tools"] }
@@ -0,0 +1,7 @@
1
+ {
2
+ "editor.codeActionsOnSave": {
3
+ "source.fixAll": "explicit",
4
+ "source.organizeImports": "explicit",
5
+ "source.sortMembers": "explicit"
6
+ }
7
+ }
@@ -0,0 +1,3 @@
1
+ # Expo HAS CHANGED
2
+
3
+ Read the exact versioned docs at https://docs.expo.dev/versions/v55.0.0/ before writing any code.
@@ -0,0 +1 @@
1
+ @AGENTS.md
@@ -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,44 @@
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
+ "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
+ "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
+ }
@@ -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>
@@ -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
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "sample-universal",
3
+ "main": "expo-router/entry",
4
+ "version": "1.0.0",
5
+ "scripts": {
6
+ "start": "expo start",
7
+ "reset-project": "node ./scripts/reset-project.js",
8
+ "android": "expo start --android",
9
+ "ios": "expo start --ios",
10
+ "web": "expo start --web",
11
+ "lint": "expo lint"
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-device": "~55.0.17",
20
+ "expo-font": "~55.0.7",
21
+ "expo-glass-effect": "~55.0.11",
22
+ "expo-image": "~55.0.10",
23
+ "expo-linking": "~55.0.15",
24
+ "expo-router": "~55.0.14",
25
+ "expo-splash-screen": "~55.0.21",
26
+ "expo-status-bar": "~55.0.6",
27
+ "expo-symbols": "~55.0.8",
28
+ "expo-system-ui": "~55.0.18",
29
+ "expo-web-browser": "~55.0.16",
30
+ "react": "19.2.0",
31
+ "react-dom": "19.2.0",
32
+ "react-native": "0.83.6",
33
+ "react-native-gesture-handler": "~2.30.0",
34
+ "react-native-worklets": "0.7.4",
35
+ "react-native-reanimated": "4.2.1",
36
+ "react-native-safe-area-context": "~5.6.2",
37
+ "react-native-screens": "~4.23.0",
38
+ "react-native-web": "~0.21.0"
39
+ },
40
+ "devDependencies": {
41
+ "@types/react": "~19.2.2",
42
+ "typescript": "~5.9.2"
43
+ },
44
+ "private": true
45
+ }
@@ -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
+ );