lucy-cli 2.0.0-alpha.2 → 2.0.0-alpha.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 (37) hide show
  1. package/dist/init.js +37 -16
  2. package/files/expo/.prettierrc.js +16 -0
  3. package/files/expo/.yarnrc.yml +1 -1
  4. package/files/expo/assets/fonts/SpaceMono-Regular.ttf +0 -0
  5. package/files/expo/assets/images/adaptive-icon.png +0 -0
  6. package/files/expo/assets/images/favicon.png +0 -0
  7. package/files/expo/assets/images/icon.png +0 -0
  8. package/files/expo/assets/images/splash-icon.png +0 -0
  9. package/files/expo/babel.config.js +7 -6
  10. package/files/expo/components/.gitkeep +0 -0
  11. package/files/expo/components/ui/.gitkeep +0 -0
  12. package/files/expo/constants/theme.ts +17 -17
  13. package/files/expo/{eslint.config.js → eslint.config.mjs} +15 -19
  14. package/files/expo/hooks/useColorScheme.ts +13 -7
  15. package/files/expo/index.ts +11 -0
  16. package/files/expo/lib/data.ts +36 -33
  17. package/files/expo/lib/utils/index.ts +7 -2
  18. package/files/expo/lib/utils/polyfills.ts +1 -1
  19. package/files/expo/lib/wix/client.ts +3 -5
  20. package/files/expo/lib/wix/error.ts +3 -0
  21. package/files/expo/lib/wix/index.ts +1 -0
  22. package/files/expo/metro.config.js +34 -0
  23. package/files/expo/patches/@wix-sdk-npm-1.15.24-1adbec98e9.patch +20 -0
  24. package/files/expo/scripts/reset-project.ts +116 -0
  25. package/files/expo/tailwind.config.js +61 -196
  26. package/files/expo/tsconfig.json +31 -26
  27. package/package.json +1 -1
  28. package/src/init.ts +52 -20
  29. package/files/expo/.prettierrc.json +0 -16
  30. package/files/expo/app/(tabs)/_layout.tsx +0 -45
  31. package/files/expo/app/_layout.tsx +0 -45
  32. package/files/expo/constants/Colors.ts +0 -27
  33. package/files/expo/hooks/useColorScheme.web.ts +0 -21
  34. package/files/expo/hooks/useColorSchemeRN.ts +0 -1
  35. package/files/expo/hooks/useThemeColor.ts +0 -21
  36. /package/files/expo/{readme.md → README.md} +0 -0
  37. /package/files/expo/{types/nativewind-env.d.ts → nativewind-env.d.ts} +0 -0
@@ -1,198 +1,63 @@
1
- import gluestackPlugin from '@gluestack-ui/nativewind-utils/tailwind-plugin';
1
+ import { hairlineWidth } from 'nativewind/theme';
2
2
 
3
- /** @type {import('tailwindcss').Config} */
4
- module.exports = {
5
- darkMode: "media",
6
- content: ["app/**/*.{tsx,jsx,ts,js}", "components/**/*.{tsx,jsx,ts,js}"],
7
- presets: [require('nativewind/preset')],
8
- safelist: [
9
- {
10
- pattern:
11
- /(bg|border|text|stroke|fill)-(primary|secondary|tertiary|error|success|warning|info|typography|outline|background|indicator)-(0|50|100|200|300|400|500|600|700|800|900|950|white|gray|black|error|warning|muted|success|info|light|dark|primary)/,
12
- },
13
- ],
14
- theme: {
15
- extend: {
16
- colors: {
17
- primary: {
18
- 0: 'rgb(var(--color-primary-0)/<alpha-value>)',
19
- 50: 'rgb(var(--color-primary-50)/<alpha-value>)',
20
- 100: 'rgb(var(--color-primary-100)/<alpha-value>)',
21
- 200: 'rgb(var(--color-primary-200)/<alpha-value>)',
22
- 300: 'rgb(var(--color-primary-300)/<alpha-value>)',
23
- 400: 'rgb(var(--color-primary-400)/<alpha-value>)',
24
- 500: 'rgb(var(--color-primary-500)/<alpha-value>)',
25
- 600: 'rgb(var(--color-primary-600)/<alpha-value>)',
26
- 700: 'rgb(var(--color-primary-700)/<alpha-value>)',
27
- 800: 'rgb(var(--color-primary-800)/<alpha-value>)',
28
- 900: 'rgb(var(--color-primary-900)/<alpha-value>)',
29
- 950: 'rgb(var(--color-primary-950)/<alpha-value>)',
30
- },
31
- secondary: {
32
- 0: 'rgb(var(--color-secondary-0)/<alpha-value>)',
33
- 50: 'rgb(var(--color-secondary-50)/<alpha-value>)',
34
- 100: 'rgb(var(--color-secondary-100)/<alpha-value>)',
35
- 200: 'rgb(var(--color-secondary-200)/<alpha-value>)',
36
- 300: 'rgb(var(--color-secondary-300)/<alpha-value>)',
37
- 400: 'rgb(var(--color-secondary-400)/<alpha-value>)',
38
- 500: 'rgb(var(--color-secondary-500)/<alpha-value>)',
39
- 600: 'rgb(var(--color-secondary-600)/<alpha-value>)',
40
- 700: 'rgb(var(--color-secondary-700)/<alpha-value>)',
41
- 800: 'rgb(var(--color-secondary-800)/<alpha-value>)',
42
- 900: 'rgb(var(--color-secondary-900)/<alpha-value>)',
43
- 950: 'rgb(var(--color-secondary-950)/<alpha-value>)',
44
- },
45
- tertiary: {
46
- 50: 'rgb(var(--color-tertiary-50)/<alpha-value>)',
47
- 100: 'rgb(var(--color-tertiary-100)/<alpha-value>)',
48
- 200: 'rgb(var(--color-tertiary-200)/<alpha-value>)',
49
- 300: 'rgb(var(--color-tertiary-300)/<alpha-value>)',
50
- 400: 'rgb(var(--color-tertiary-400)/<alpha-value>)',
51
- 500: 'rgb(var(--color-tertiary-500)/<alpha-value>)',
52
- 600: 'rgb(var(--color-tertiary-600)/<alpha-value>)',
53
- 700: 'rgb(var(--color-tertiary-700)/<alpha-value>)',
54
- 800: 'rgb(var(--color-tertiary-800)/<alpha-value>)',
55
- 900: 'rgb(var(--color-tertiary-900)/<alpha-value>)',
56
- 950: 'rgb(var(--color-tertiary-950)/<alpha-value>)',
57
- },
58
- error: {
59
- 0: 'rgb(var(--color-error-0)/<alpha-value>)',
60
- 50: 'rgb(var(--color-error-50)/<alpha-value>)',
61
- 100: 'rgb(var(--color-error-100)/<alpha-value>)',
62
- 200: 'rgb(var(--color-error-200)/<alpha-value>)',
63
- 300: 'rgb(var(--color-error-300)/<alpha-value>)',
64
- 400: 'rgb(var(--color-error-400)/<alpha-value>)',
65
- 500: 'rgb(var(--color-error-500)/<alpha-value>)',
66
- 600: 'rgb(var(--color-error-600)/<alpha-value>)',
67
- 700: 'rgb(var(--color-error-700)/<alpha-value>)',
68
- 800: 'rgb(var(--color-error-800)/<alpha-value>)',
69
- 900: 'rgb(var(--color-error-900)/<alpha-value>)',
70
- 950: 'rgb(var(--color-error-950)/<alpha-value>)',
71
- },
72
- success: {
73
- 0: 'rgb(var(--color-success-0)/<alpha-value>)',
74
- 50: 'rgb(var(--color-success-50)/<alpha-value>)',
75
- 100: 'rgb(var(--color-success-100)/<alpha-value>)',
76
- 200: 'rgb(var(--color-success-200)/<alpha-value>)',
77
- 300: 'rgb(var(--color-success-300)/<alpha-value>)',
78
- 400: 'rgb(var(--color-success-400)/<alpha-value>)',
79
- 500: 'rgb(var(--color-success-500)/<alpha-value>)',
80
- 600: 'rgb(var(--color-success-600)/<alpha-value>)',
81
- 700: 'rgb(var(--color-success-700)/<alpha-value>)',
82
- 800: 'rgb(var(--color-success-800)/<alpha-value>)',
83
- 900: 'rgb(var(--color-success-900)/<alpha-value>)',
84
- 950: 'rgb(var(--color-success-950)/<alpha-value>)',
85
- },
86
- warning: {
87
- 0: 'rgb(var(--color-warning-0)/<alpha-value>)',
88
- 50: 'rgb(var(--color-warning-50)/<alpha-value>)',
89
- 100: 'rgb(var(--color-warning-100)/<alpha-value>)',
90
- 200: 'rgb(var(--color-warning-200)/<alpha-value>)',
91
- 300: 'rgb(var(--color-warning-300)/<alpha-value>)',
92
- 400: 'rgb(var(--color-warning-400)/<alpha-value>)',
93
- 500: 'rgb(var(--color-warning-500)/<alpha-value>)',
94
- 600: 'rgb(var(--color-warning-600)/<alpha-value>)',
95
- 700: 'rgb(var(--color-warning-700)/<alpha-value>)',
96
- 800: 'rgb(var(--color-warning-800)/<alpha-value>)',
97
- 900: 'rgb(var(--color-warning-900)/<alpha-value>)',
98
- 950: 'rgb(var(--color-warning-950)/<alpha-value>)',
99
- },
100
- info: {
101
- 0: 'rgb(var(--color-info-0)/<alpha-value>)',
102
- 50: 'rgb(var(--color-info-50)/<alpha-value>)',
103
- 100: 'rgb(var(--color-info-100)/<alpha-value>)',
104
- 200: 'rgb(var(--color-info-200)/<alpha-value>)',
105
- 300: 'rgb(var(--color-info-300)/<alpha-value>)',
106
- 400: 'rgb(var(--color-info-400)/<alpha-value>)',
107
- 500: 'rgb(var(--color-info-500)/<alpha-value>)',
108
- 600: 'rgb(var(--color-info-600)/<alpha-value>)',
109
- 700: 'rgb(var(--color-info-700)/<alpha-value>)',
110
- 800: 'rgb(var(--color-info-800)/<alpha-value>)',
111
- 900: 'rgb(var(--color-info-900)/<alpha-value>)',
112
- 950: 'rgb(var(--color-info-950)/<alpha-value>)',
113
- },
114
- typography: {
115
- 0: 'rgb(var(--color-typography-0)/<alpha-value>)',
116
- 50: 'rgb(var(--color-typography-50)/<alpha-value>)',
117
- 100: 'rgb(var(--color-typography-100)/<alpha-value>)',
118
- 200: 'rgb(var(--color-typography-200)/<alpha-value>)',
119
- 300: 'rgb(var(--color-typography-300)/<alpha-value>)',
120
- 400: 'rgb(var(--color-typography-400)/<alpha-value>)',
121
- 500: 'rgb(var(--color-typography-500)/<alpha-value>)',
122
- 600: 'rgb(var(--color-typography-600)/<alpha-value>)',
123
- 700: 'rgb(var(--color-typography-700)/<alpha-value>)',
124
- 800: 'rgb(var(--color-typography-800)/<alpha-value>)',
125
- 900: 'rgb(var(--color-typography-900)/<alpha-value>)',
126
- 950: 'rgb(var(--color-typography-950)/<alpha-value>)',
127
- white: '#FFFFFF',
128
- gray: '#D4D4D4',
129
- black: '#181718',
130
- },
131
- outline: {
132
- 0: 'rgb(var(--color-outline-0)/<alpha-value>)',
133
- 50: 'rgb(var(--color-outline-50)/<alpha-value>)',
134
- 100: 'rgb(var(--color-outline-100)/<alpha-value>)',
135
- 200: 'rgb(var(--color-outline-200)/<alpha-value>)',
136
- 300: 'rgb(var(--color-outline-300)/<alpha-value>)',
137
- 400: 'rgb(var(--color-outline-400)/<alpha-value>)',
138
- 500: 'rgb(var(--color-outline-500)/<alpha-value>)',
139
- 600: 'rgb(var(--color-outline-600)/<alpha-value>)',
140
- 700: 'rgb(var(--color-outline-700)/<alpha-value>)',
141
- 800: 'rgb(var(--color-outline-800)/<alpha-value>)',
142
- 900: 'rgb(var(--color-outline-900)/<alpha-value>)',
143
- 950: 'rgb(var(--color-outline-950)/<alpha-value>)',
144
- },
145
- background: {
146
- 0: 'rgb(var(--color-background-0)/<alpha-value>)',
147
- 50: 'rgb(var(--color-background-50)/<alpha-value>)',
148
- 100: 'rgb(var(--color-background-100)/<alpha-value>)',
149
- 200: 'rgb(var(--color-background-200)/<alpha-value>)',
150
- 300: 'rgb(var(--color-background-300)/<alpha-value>)',
151
- 400: 'rgb(var(--color-background-400)/<alpha-value>)',
152
- 500: 'rgb(var(--color-background-500)/<alpha-value>)',
153
- 600: 'rgb(var(--color-background-600)/<alpha-value>)',
154
- 700: 'rgb(var(--color-background-700)/<alpha-value>)',
155
- 800: 'rgb(var(--color-background-800)/<alpha-value>)',
156
- 900: 'rgb(var(--color-background-900)/<alpha-value>)',
157
- 950: 'rgb(var(--color-background-950)/<alpha-value>)',
158
- error: 'rgb(var(--color-background-error)/<alpha-value>)',
159
- warning: 'rgb(var(--color-background-warning)/<alpha-value>)',
160
- muted: 'rgb(var(--color-background-muted)/<alpha-value>)',
161
- success: 'rgb(var(--color-background-success)/<alpha-value>)',
162
- info: 'rgb(var(--color-background-info)/<alpha-value>)',
163
- light: '#FBFBFB',
164
- dark: '#181719',
165
- },
166
- indicator: {
167
- primary: 'rgb(var(--color-indicator-primary)/<alpha-value>)',
168
- info: 'rgb(var(--color-indicator-info)/<alpha-value>)',
169
- error: 'rgb(var(--color-indicator-error)/<alpha-value>)',
170
- },
171
- },
172
- fontFamily: {
173
- heading: undefined,
174
- body: undefined,
175
- mono: undefined,
176
- roboto: ['Roboto', 'sans-serif'],
177
- },
178
- fontWeight: {
179
- extrablack: '950',
180
- },
181
- fontSize: {
182
- '2xs': '10px',
183
- },
184
- boxShadow: {
185
- 'hard-1': '-2px 2px 8px 0px rgba(38, 38, 38, 0.20)',
186
- 'hard-2': '0px 3px 10px 0px rgba(38, 38, 38, 0.20)',
187
- 'hard-3': '2px 2px 8px 0px rgba(38, 38, 38, 0.20)',
188
- 'hard-4': '0px -3px 10px 0px rgba(38, 38, 38, 0.20)',
189
- 'hard-5': '0px 2px 10px 0px rgba(38, 38, 38, 0.10)',
190
- 'soft-1': '0px 0px 10px rgba(38, 38, 38, 0.1)',
191
- 'soft-2': '0px 0px 20px rgba(38, 38, 38, 0.2)',
192
- 'soft-3': '0px 0px 30px rgba(38, 38, 38, 0.1)',
193
- 'soft-4': '0px 0px 40px rgba(38, 38, 38, 0.1)',
194
- },
195
- },
196
- },
197
- plugins: [gluestackPlugin],
3
+ export const darkMode = 'class';
4
+ export const content = ['./app/**/*.{ts,tsx}', './components/**/*.{ts,tsx}'];
5
+ export const presets = [require('nativewind/preset')];
6
+
7
+ export const theme = {
8
+ extend: {
9
+ colors: {
10
+ border: 'hsl(var(--border))',
11
+ input: 'hsl(var(--input))',
12
+ ring: 'hsl(var(--ring))',
13
+ background: 'hsl(var(--background))',
14
+ foreground: 'hsl(var(--foreground))',
15
+ primary: {
16
+ DEFAULT: 'hsl(var(--primary))',
17
+ foreground: 'hsl(var(--primary-foreground))',
18
+ },
19
+ secondary: {
20
+ DEFAULT: 'hsl(var(--secondary))',
21
+ foreground: 'hsl(var(--secondary-foreground))',
22
+ },
23
+ destructive: {
24
+ DEFAULT: 'hsl(var(--destructive))',
25
+ foreground: 'hsl(var(--destructive-foreground))',
26
+ },
27
+ muted: {
28
+ DEFAULT: 'hsl(var(--muted))',
29
+ foreground: 'hsl(var(--muted-foreground))',
30
+ },
31
+ accent: {
32
+ DEFAULT: 'hsl(var(--accent))',
33
+ foreground: 'hsl(var(--accent-foreground))',
34
+ },
35
+ popover: {
36
+ DEFAULT: 'hsl(var(--popover))',
37
+ foreground: 'hsl(var(--popover-foreground))',
38
+ },
39
+ card: {
40
+ DEFAULT: 'hsl(var(--card))',
41
+ foreground: 'hsl(var(--card-foreground))',
42
+ },
43
+ },
44
+ borderWidth: {
45
+ hairline: hairlineWidth(),
46
+ },
47
+ keyframes: {
48
+ 'accordion-down': {
49
+ from: { height: '0' },
50
+ to: { height: 'var(--radix-accordion-content-height)' },
51
+ },
52
+ 'accordion-up': {
53
+ from: { height: 'var(--radix-accordion-content-height)' },
54
+ to: { height: '0' },
55
+ },
56
+ },
57
+ animation: {
58
+ 'accordion-down': 'accordion-down 0.2s ease-out',
59
+ 'accordion-up': 'accordion-up 0.2s ease-out',
60
+ },
61
+ },
198
62
  };
63
+ export const plugins = [require('tailwindcss-animate')];
@@ -1,30 +1,29 @@
1
1
  {
2
2
  "extends": "expo/tsconfig.base",
3
3
  "compilerOptions": {
4
- "strict": true,
5
- "allowSyntheticDefaultImports": true,
6
- "skipLibCheck": true,
7
- "forceConsistentCasingInFileNames": true,
8
- "alwaysStrict": false,
9
- "noImplicitAny": true,
10
- "noImplicitReturns": true,
11
- "noImplicitThis": true,
12
- "strictNullChecks": true,
13
- "exactOptionalPropertyTypes": true,
14
- "strictBindCallApply": true,
15
- "strictFunctionTypes": true,
16
- "strictPropertyInitialization": true,
17
-
18
- // --- Advanced ---
19
- "preserveConstEnums": true,
20
- "plugins": [
21
- {
22
- "name": "@styled/typescript-styled-plugin"
23
- },
24
- {
25
- "name": "typescript-eslint-language-service"
26
- },
27
- ],
4
+ "strict": true,
5
+ "allowSyntheticDefaultImports": true,
6
+ "skipLibCheck": true,
7
+ "forceConsistentCasingInFileNames": true,
8
+ "alwaysStrict": false,
9
+ "noImplicitAny": true,
10
+ "noImplicitReturns": true,
11
+ "noImplicitThis": true,
12
+ "strictNullChecks": true,
13
+ "exactOptionalPropertyTypes": true,
14
+ "strictBindCallApply": true,
15
+ "strictFunctionTypes": true,
16
+ "strictPropertyInitialization": true,
17
+ // --- Advanced ---
18
+ "preserveConstEnums": true,
19
+ "plugins": [
20
+ {
21
+ "name": "@styled/typescript-styled-plugin"
22
+ },
23
+ {
24
+ "name": "typescript-eslint-language-service"
25
+ }
26
+ ],
28
27
  "paths": {
29
28
  "@/*": [
30
29
  "./*"
@@ -35,6 +34,12 @@
35
34
  "**/*.ts",
36
35
  "**/*.tsx",
37
36
  ".expo/types/**/*.ts",
38
- "expo-env.d.ts"
37
+ "expo-env.d.ts",
38
+ "nativewind-env.d.ts",
39
+ "metro.config.js",
40
+ "eslint.config.mjs",
41
+ "tailwind.config.js",
42
+ "babel.config.js",
43
+ ".prettierrc.js",
39
44
  ]
40
- }
45
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "lucy-cli",
4
- "version": "2.0.0-alpha.2",
4
+ "version": "2.0.0-alpha.4",
5
5
  "description": "Lucy Framework for WIX Studio Editor",
6
6
  "main": ".dist/index.js",
7
7
  "scripts": {
package/src/init.ts CHANGED
@@ -187,10 +187,6 @@ import { JsonSchema } from "./schemas/index.js";
187
187
  // console.log(blue.underline(`🐕 => Updated file ${orange(filePath)}`));
188
188
  // }
189
189
  // }
190
- const yarn = Command.make("yarn").pipe(
191
- Command.stdout("inherit"), // Stream stdout to process.stdout
192
- Command.exitCode // Get the exit code
193
- )
194
190
 
195
191
  const init_expo = () => {
196
192
  return Effect.gen(function*() {
@@ -199,16 +195,23 @@ const init_expo = () => {
199
195
  const fs = yield* FileSystem.FileSystem;
200
196
  const path = yield* Path.Path;
201
197
 
198
+ const resolutions = {
199
+ "@wix/sdk@1.15.24": "patch:@wix/sdk@npm:1.15.24#./patches/@wix-sdk-npm-1.15.24-1adbec98e9.patch",
200
+ }
202
201
  const yarn = Command.make(
203
202
  "yarn",
204
203
  "add",
205
204
  "nativewind",
206
205
  "react-native-reanimated@~3.17.4",
207
206
  "react-native-safe-area-context@5.4.0",
208
- "@wix/sdk",
207
+ "@wix/sdk@1.15.24",
209
208
  "@wix/data",
210
209
  "expo-standard-web-crypto",
211
- "effect"
210
+ "effect",
211
+ "node-libs-react-native",
212
+ "util",
213
+ "events",
214
+ "tailwindcss-animate",
212
215
  ).pipe(
213
216
  Command.stdout("inherit"), // Stream stdout to process.stdout
214
217
  Command.exitCode // Get the exit code
@@ -236,6 +239,8 @@ const init_expo = () => {
236
239
  "typescript-eslint",
237
240
  "typescript-eslint-language-service",
238
241
  "@total-typescript/ts-reset",
242
+ "expo-doctor",
243
+ "tsx",
239
244
  ).pipe(
240
245
  Command.stdout("inherit"), // Stream stdout to process.stdout
241
246
  Command.exitCode // Get the exit code
@@ -250,6 +255,10 @@ const init_expo = () => {
250
255
  "clsx",
251
256
  "tailwind-merge",
252
257
  "expo-crypto",
258
+ "react-dom",
259
+ "react-native-web",
260
+ "@expo/metro-runtime",
261
+ "expo-system-ui"
253
262
  ).pipe(
254
263
  Command.stdout("inherit"), // Stream stdout to process.stdout
255
264
  Command.exitCode // Get the exit code
@@ -277,7 +286,7 @@ const init_expo = () => {
277
286
  if(nonGitFiles.length > 0) return yield* Effect.logError("The current directory is not empty. Please run this command in an empty directory.");
278
287
 
279
288
  if(!expoAppReady) {
280
- const initExpo = Command.make("npx", "create-expo-app@latest", projectName).pipe(
289
+ const initExpo = Command.make("npx", "create-expo-app@latest", projectName, "--template", "blank-typescript", "--no-install").pipe(
281
290
  Command.stdout("inherit"), // Stream stdout to process.stdout
282
291
  Command.exitCode // Get the exit code
283
292
  )
@@ -295,32 +304,38 @@ const init_expo = () => {
295
304
  }
296
305
  if(lucyInitialized) return yield* Effect.logError("Lucy is already initialized in this project. Please run this command in an empty directory.");
297
306
 
298
- console.log("Expo project initialized with app.json:", projectName);
307
+ const baseFiles = yield* fs.readDirectory(config.config.filesFolder + '/expo')
308
+ yield* Effect.forEach(
309
+ baseFiles,
310
+ (file) => fs.copy(path.join(config.config.filesFolder, 'expo', file), path.join(config.config.cwd, file), { overwrite: true })
311
+ )
299
312
 
300
- let res = yield* npx
301
- res = yield* yarn
313
+ let res = yield* yarn
302
314
  res = yield* yarnDev
315
+ console.log("🐕 " + 'npx');
316
+ res = yield* npx
303
317
 
304
318
  if (res !== 0) {
305
319
  return yield* Effect.logError("Failed to install Expo dependencies. Please check the error message above.");
306
320
  }
307
321
 
308
- const baseFiles = yield* fs.readDirectory(config.config.filesFolder + '/expo')
309
- yield* Effect.forEach(
310
- baseFiles,
311
- (file) => fs.copy(path.join(config.config.filesFolder, 'expo', file), path.join(config.config.cwd, file), { overwrite: true })
312
- )
313
-
314
322
  const newScripts = {
315
323
  "dev": "expo start",
316
324
  "start": "expo start",
317
325
  "android": "expo start --android",
318
326
  "ios": "expo start --ios",
319
327
  "web": "expo start --web",
328
+ "reset": "tsx ./scripts/reset-project.ts",
320
329
  "format": "prettier --write \"./*.json\" \"**/*.{ts,tsx,md,json,jsonc,json5}\"",
321
- "build:ios": "eas build --platform ios --local --profile preview",
322
- "build:android": "eas build --platform android --local --profile preview",
323
- "build:web": "eas build --platform web --local --profile preview",
330
+ "prebuild": "expo prebuild",
331
+ "pods": "npx pod-install",
332
+ "build:dev": "eas build --local --profile development",
333
+ "build:sim": "eas build --local --profile ios-simulator",
334
+ "build:prev": "eas build --local --profile preview",
335
+ "build:prod": "eas build --local --profile production",
336
+ "build:web": "expo export --platform web",
337
+ "doctor": "expo-doctor",
338
+ "eas-build-pre-install": "corepack enable && yarn set version 4"
324
339
  }
325
340
 
326
341
  const packageJsonPath = path.join(config.config.cwd, "package.json")
@@ -329,11 +344,28 @@ const init_expo = () => {
329
344
 
330
345
  packageJson.scripts = {
331
346
  ...packageJson.scripts,
332
- ...newScripts
347
+ ...newScripts,
333
348
  };
349
+ packageJson.resolutions = {
350
+ ...packageJson.resolutions,
351
+ ...resolutions,
352
+ };
353
+ packageJson.expo = {
354
+ doctor: {
355
+ reactNativeDirectoryCheck: {
356
+ listUnknownPackages: false,
357
+ },
358
+ }
359
+ }
360
+
334
361
  yield* fs.writeFileString(path.join(config.config.cwd, 'package.json'), JSON.stringify(packageJson, null, 2));
335
362
  yield* fs.remove(path.join(config.config.cwd, "package-lock.json"), { force: true })
336
363
 
364
+ yield* Command.make("yarn").pipe(
365
+ Command.stdout("inherit"), // Stream stdout to process.stdout
366
+ Command.exitCode // Get the exit code
367
+ )
368
+
337
369
  })
338
370
  }
339
371
 
@@ -1,16 +0,0 @@
1
- {
2
- "printWidth": 80,
3
- "tabWidth": 4,
4
- "useTabs": true,
5
- "singleQuote": true,
6
- "trailingComma": "all",
7
- "plugins": ["prettier-plugin-tailwindcss"],
8
- "overrides": [
9
- {
10
- "files": ["**/*.{json,jsonc,json5}", "*.{json,jsonc,json5}"],
11
- "options": {
12
- "useTabs": true
13
- }
14
- }
15
- ]
16
- }
@@ -1,45 +0,0 @@
1
- import { Tabs } from 'expo-router';
2
- import React from 'react';
3
- import { Platform } from 'react-native';
4
-
5
- import { HapticTab } from '@/components/HapticTab';
6
- import { IconSymbol } from '@/components/ui/IconSymbol';
7
- import TabBarBackground from '@/components/ui/TabBarBackground.ios';
8
- import { Colors } from '@/constants/Colors';
9
- import { useColorScheme } from '@/hooks/useColorSchemeRN';
10
-
11
- export default function TabLayout() {
12
- const colorScheme = useColorScheme();
13
-
14
- return (
15
- <Tabs
16
- screenOptions={{
17
- tabBarActiveTintColor: Colors[colorScheme ?? 'light'].tint,
18
- headerShown: false,
19
- tabBarButton: HapticTab,
20
- tabBarBackground: TabBarBackground,
21
- tabBarStyle: Platform.select({
22
- ios: {
23
- // Use a transparent background on iOS to show the blur effect
24
- position: 'absolute',
25
- },
26
- default: {},
27
- }),
28
- }}>
29
- <Tabs.Screen
30
- name="index"
31
- options={{
32
- title: 'Home',
33
- tabBarIcon: ({ color }) => <IconSymbol size={28} name="house.fill" color={color} />,
34
- }}
35
- />
36
- <Tabs.Screen
37
- name="explore"
38
- options={{
39
- title: 'Explore',
40
- tabBarIcon: ({ color }) => <IconSymbol size={28} name="paperplane.fill" color={color} />,
41
- }}
42
- />
43
- </Tabs>
44
- );
45
- }
@@ -1,45 +0,0 @@
1
- import '@/global.css';
2
- import "@/lib/utils/polyfills";
3
-
4
- import { NAV_THEME } from '@/constants/theme';
5
- import { useColorScheme } from '@/hooks/useColorScheme';
6
- import { DarkTheme, DefaultTheme, Theme, ThemeProvider } from '@react-navigation/native';
7
- import { Stack } from 'expo-router';
8
- import { StatusBar } from 'expo-status-bar';
9
- import * as React from 'react';
10
- import { Platform } from 'react-native';
11
- const LIGHT_THEME: Theme = {
12
- ...DefaultTheme,
13
- colors: NAV_THEME.light,
14
- };
15
- const DARK_THEME: Theme = {
16
- ...DarkTheme,
17
- colors: NAV_THEME.dark,
18
- };
19
- export { ErrorBoundary } from 'expo-router';
20
- export default function RootLayout() {
21
- const hasMounted = React.useRef(false);
22
- const { colorScheme, isDarkColorScheme } = useColorScheme();
23
- const [isColorSchemeLoaded, setIsColorSchemeLoaded] = React.useState(false);
24
- useIsomorphicLayoutEffect(() => {
25
- if (hasMounted.current) {
26
- return;
27
- }
28
- if (Platform.OS === 'web') {
29
- // Adds the background color to the html element to prevent white background on overscroll.
30
- document.documentElement.classList.add('bg-background');
31
- }
32
- setIsColorSchemeLoaded(true);
33
- hasMounted.current = true;
34
- }, []);
35
- if (!isColorSchemeLoaded) {
36
- return null;
37
- }
38
- return (
39
- <ThemeProvider value={isDarkColorScheme ? DARK_THEME : LIGHT_THEME}>
40
- <StatusBar style={isDarkColorScheme ? 'light' : 'dark'} />
41
- <Stack />
42
- </ThemeProvider>
43
- );
44
- }
45
- const useIsomorphicLayoutEffect = Platform.OS === 'web' && typeof window === 'undefined' ? React.useEffect : React.useLayoutEffect;
@@ -1,27 +0,0 @@
1
- /**
2
- * Below are the colors that are used in the app. The colors are defined in the light and dark mode.
3
- * There are many other ways to style your app. For example, [Nativewind](https://www.nativewind.dev/), [Tamagui](https://tamagui.dev/), [unistyles](https://reactnativeunistyles.vercel.app), etc.
4
- */
5
-
6
- const tintColorLight = '#0a7ea4';
7
- const tintColorDark = '#fff';
8
-
9
- export const Colors = {
10
- light: {
11
- text: '#11181C',
12
- background: '#fff',
13
- tint: tintColorLight,
14
- icon: '#687076',
15
- tabIconDefault: '#687076',
16
- tabIconSelected: tintColorLight,
17
- },
18
- dark: {
19
- text: '#ECEDEE',
20
- background: '#151718',
21
- tint: tintColorDark,
22
- icon: '#9BA1A6',
23
- tabIconDefault: '#9BA1A6',
24
- tabIconSelected: tintColorDark,
25
- },
26
- };
27
-
@@ -1,21 +0,0 @@
1
- import { useEffect, useState } from 'react';
2
- import { useColorScheme as useRNColorScheme } from 'react-native';
3
-
4
- /**
5
- * To support static rendering, this value needs to be re-calculated on the client side for web
6
- */
7
- export function useColorScheme() {
8
- const [hasHydrated, setHasHydrated] = useState(false);
9
-
10
- useEffect(() => {
11
- setHasHydrated(true);
12
- }, []);
13
-
14
- const colorScheme = useRNColorScheme();
15
-
16
- if (hasHydrated) {
17
- return colorScheme;
18
- }
19
-
20
- return 'light';
21
- }
@@ -1 +0,0 @@
1
- export { useColorScheme } from 'react-native';