lucy-cli 2.0.0-alpha.1 → 2.0.0-alpha.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.
Files changed (38) hide show
  1. package/dist/init.js +44 -18
  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/eas.json +9 -3
  14. package/files/expo/{eslint.config.js → eslint.config.mjs} +15 -19
  15. package/files/expo/hooks/useColorScheme.ts +13 -7
  16. package/files/expo/index.ts +11 -0
  17. package/files/expo/lib/data.ts +36 -33
  18. package/files/expo/lib/utils/index.ts +7 -2
  19. package/files/expo/lib/utils/polyfills.ts +1 -1
  20. package/files/expo/lib/wix/client.ts +3 -5
  21. package/files/expo/lib/wix/error.ts +3 -0
  22. package/files/expo/lib/wix/index.ts +1 -0
  23. package/files/expo/metro.config.js +57 -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 +32 -26
  27. package/package.json +3 -2
  28. package/src/init.ts +62 -21
  29. package/files/expo/.env +0 -1
  30. package/files/expo/.prettierrc.json +0 -16
  31. package/files/expo/app/(tabs)/_layout.tsx +0 -45
  32. package/files/expo/app/_layout.tsx +0 -45
  33. package/files/expo/constants/Colors.ts +0 -27
  34. package/files/expo/hooks/useColorScheme.web.ts +0 -21
  35. package/files/expo/hooks/useColorSchemeRN.ts +0 -1
  36. package/files/expo/hooks/useThemeColor.ts +0 -21
  37. /package/files/expo/{readme.md → README.md} +0 -0
  38. /package/files/expo/{types/nativewind-env.d.ts → nativewind-env.d.ts} +0 -0
@@ -0,0 +1,116 @@
1
+ #!/usr/bin/env ts-node
2
+ /* eslint-disable no-console */
3
+
4
+ /**
5
+ * This script is used to reset the project to a blank state.
6
+ * It deletes or moves the /app, /components, /hooks, /scripts, and /constants directories to /app-example based on user input and creates a new /app directory with an index.tsx and _layout.tsx file.
7
+ * You can remove the `reset-project` script from package.json and safely delete this file after running it.
8
+ */
9
+
10
+ import fs from 'fs';
11
+ import path from 'path';
12
+ import { createInterface } from 'readline/promises';
13
+
14
+ const root = process.cwd();
15
+ const oldDirs = ['app', 'components', 'hooks', 'constants', 'scripts'];
16
+ const exampleDir = 'app-example';
17
+ const newAppDir = 'app';
18
+ const exampleDirPath = path.join(root, exampleDir);
19
+
20
+ const indexContent = `import { Text, View } from "react-native";
21
+
22
+ export default function Index() {
23
+ return (
24
+ <View
25
+ style={{
26
+ flex: 1,
27
+ justifyContent: "center",
28
+ alignItems: "center",
29
+ }}
30
+ >
31
+ <Text>Edit app/index.tsx to edit this screen.</Text>
32
+ </View>
33
+ );
34
+ }
35
+ `;
36
+
37
+ const layoutContent = `import { Stack } from "expo-router";
38
+
39
+ export default function RootLayout() {
40
+ return <Stack />;
41
+ }
42
+ `;
43
+
44
+ const moveDirectories = async (userInput: string) => {
45
+ if (userInput === 'y') {
46
+ // Create the app-example directory
47
+ await fs.promises.mkdir(exampleDirPath, { recursive: true });
48
+ console.log(`📁 /${exampleDir} directory created.`);
49
+ }
50
+
51
+ // Move old directories to new app-example directory or delete them
52
+ for (const dir of oldDirs) {
53
+ const oldDirPath = path.join(root, dir);
54
+ if (fs.existsSync(oldDirPath)) {
55
+ if (userInput === 'y') {
56
+ const newDirPath = path.join(root, exampleDir, dir);
57
+ await fs.promises.rename(oldDirPath, newDirPath);
58
+ console.log(`➡️ /${dir} moved to /${exampleDir}/${dir}.`);
59
+ } else {
60
+ await fs.promises.rm(oldDirPath, { recursive: true, force: true });
61
+ console.log(`❌ /${dir} deleted.`);
62
+ }
63
+ } else {
64
+ console.log(`➡️ /${dir} does not exist, skipping.`);
65
+ }
66
+ }
67
+
68
+ // Create new /app directory
69
+ const newAppDirPath = path.join(root, newAppDir);
70
+ await fs.promises.mkdir(newAppDirPath, { recursive: true });
71
+ console.log('\n📁 New /app directory created.');
72
+
73
+ // Create index.tsx
74
+ const indexPath = path.join(newAppDirPath, 'index.tsx');
75
+ await fs.promises.writeFile(indexPath, indexContent);
76
+ console.log('📄 app/index.tsx created.');
77
+
78
+ // Create _layout.tsx
79
+ const layoutPath = path.join(newAppDirPath, '_layout.tsx');
80
+ await fs.promises.writeFile(layoutPath, layoutContent);
81
+ console.log('📄 app/_layout.tsx created.');
82
+
83
+ console.log('\n✅ Project reset complete. Next steps:');
84
+ console.log(
85
+ `1. Run \`npx expo start\` to start a development server.\n2. Edit app/index.tsx to edit the main screen.${
86
+ userInput === 'y'
87
+ ? `\n3. Delete the /${exampleDir} directory when you're done referencing it.`
88
+ : ''
89
+ }`
90
+ );
91
+ };
92
+
93
+ const main = async () => {
94
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
95
+ try {
96
+ const answer = await rl.question('Do you want to move existing files to /app-example instead of deleting them? (Y/n): ');
97
+ const userInput = answer.trim().toLowerCase() || 'y';
98
+ if (userInput === 'y' || userInput === 'n') {
99
+ await moveDirectories(userInput);
100
+ } else {
101
+ console.log("❌ Invalid input. Please enter 'Y' or 'N'.");
102
+ process.exit(1);
103
+ }
104
+ } catch (error) {
105
+ if (error instanceof Error) {
106
+ console.error(`❌ Error during script execution: ${error.message}`);
107
+ } else {
108
+ console.error('❌ An unexpected error occurred:', error);
109
+ }
110
+ process.exit(1);
111
+ } finally {
112
+ rl.close();
113
+ }
114
+ };
115
+
116
+ void main();
@@ -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,13 @@
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",
44
+ "expo-env.d.ts",
39
45
  ]
40
- }
46
+ }
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.1",
4
+ "version": "2.0.0-alpha.10",
5
5
  "description": "Lucy Framework for WIX Studio Editor",
6
6
  "main": ".dist/index.js",
7
7
  "scripts": {
@@ -102,5 +102,6 @@
102
102
  "i": "^0.3.7",
103
103
  "npm": "^11.0.0",
104
104
  "ts-node": "^10.9.1"
105
- }
105
+ },
106
+ "packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
106
107
  }
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*() {
@@ -205,9 +201,23 @@ const init_expo = () => {
205
201
  "nativewind",
206
202
  "react-native-reanimated@~3.17.4",
207
203
  "react-native-safe-area-context@5.4.0",
208
- "@wix/sdk",
204
+ "@wix/sdk@1.15.24",
209
205
  "@wix/data",
210
- "expo-standard-web-crypto"
206
+ "expo-standard-web-crypto",
207
+ "effect",
208
+ "node-libs-react-native",
209
+ "util",
210
+ "events",
211
+ "tailwindcss-animate",
212
+ ).pipe(
213
+ Command.stdout("inherit"), // Stream stdout to process.stdout
214
+ Command.exitCode // Get the exit code
215
+ )
216
+ const yarnVersion = Command.make(
217
+ "yarn",
218
+ "set",
219
+ "version",
220
+ "berry"
211
221
  ).pipe(
212
222
  Command.stdout("inherit"), // Stream stdout to process.stdout
213
223
  Command.exitCode // Get the exit code
@@ -235,6 +245,8 @@ const init_expo = () => {
235
245
  "typescript-eslint",
236
246
  "typescript-eslint-language-service",
237
247
  "@total-typescript/ts-reset",
248
+ "expo-doctor",
249
+ "tsx",
238
250
  ).pipe(
239
251
  Command.stdout("inherit"), // Stream stdout to process.stdout
240
252
  Command.exitCode // Get the exit code
@@ -249,6 +261,10 @@ const init_expo = () => {
249
261
  "clsx",
250
262
  "tailwind-merge",
251
263
  "expo-crypto",
264
+ "react-dom",
265
+ "react-native-web",
266
+ "@expo/metro-runtime",
267
+ "expo-system-ui"
252
268
  ).pipe(
253
269
  Command.stdout("inherit"), // Stream stdout to process.stdout
254
270
  Command.exitCode // Get the exit code
@@ -276,7 +292,7 @@ const init_expo = () => {
276
292
  if(nonGitFiles.length > 0) return yield* Effect.logError("The current directory is not empty. Please run this command in an empty directory.");
277
293
 
278
294
  if(!expoAppReady) {
279
- const initExpo = Command.make("npx", "create-expo-app@latest", projectName).pipe(
295
+ const initExpo = Command.make("npx", "create-expo-app@latest", projectName, "--template", "blank-typescript", "--no-install").pipe(
280
296
  Command.stdout("inherit"), // Stream stdout to process.stdout
281
297
  Command.exitCode // Get the exit code
282
298
  )
@@ -294,16 +310,6 @@ const init_expo = () => {
294
310
  }
295
311
  if(lucyInitialized) return yield* Effect.logError("Lucy is already initialized in this project. Please run this command in an empty directory.");
296
312
 
297
- console.log("Expo project initialized with app.json:", projectName);
298
-
299
- let res = yield* npx
300
- res = yield* yarn
301
- res = yield* yarnDev
302
-
303
- if (res !== 0) {
304
- return yield* Effect.logError("Failed to install Expo dependencies. Please check the error message above.");
305
- }
306
-
307
313
  const baseFiles = yield* fs.readDirectory(config.config.filesFolder + '/expo')
308
314
  yield* Effect.forEach(
309
315
  baseFiles,
@@ -316,10 +322,17 @@ const init_expo = () => {
316
322
  "android": "expo start --android",
317
323
  "ios": "expo start --ios",
318
324
  "web": "expo start --web",
325
+ "reset": "tsx ./scripts/reset-project.ts",
319
326
  "format": "prettier --write \"./*.json\" \"**/*.{ts,tsx,md,json,jsonc,json5}\"",
320
- "build:ios": "eas build --platform ios --local --profile preview",
321
- "build:android": "eas build --platform android --local --profile preview",
322
- "build:web": "eas build --platform web --local --profile preview",
327
+ "prebuild": "expo prebuild",
328
+ "pods": "npx pod-install",
329
+ "build:dev": "eas build --local --profile development",
330
+ "build:sim": "eas build --local --profile ios-simulator",
331
+ "build:prev": "eas build --local --profile preview",
332
+ "build:prod": "eas build --local --profile production",
333
+ "build:web": "expo export --platform web",
334
+ "doctor": "expo-doctor",
335
+ "eas-build-pre-install": "corepack enable && yarn set version 4"
323
336
  }
324
337
 
325
338
  const packageJsonPath = path.join(config.config.cwd, "package.json")
@@ -328,11 +341,39 @@ const init_expo = () => {
328
341
 
329
342
  packageJson.scripts = {
330
343
  ...packageJson.scripts,
331
- ...newScripts
344
+ ...newScripts,
345
+ };
346
+ packageJson.resolutions = {
347
+ ...packageJson.resolutions,
332
348
  };
349
+ packageJson.expo = {
350
+ doctor: {
351
+ reactNativeDirectoryCheck: {
352
+ listUnknownPackages: false,
353
+ },
354
+ }
355
+ }
356
+
333
357
  yield* fs.writeFileString(path.join(config.config.cwd, 'package.json'), JSON.stringify(packageJson, null, 2));
334
358
  yield* fs.remove(path.join(config.config.cwd, "package-lock.json"), { force: true })
335
359
 
360
+
361
+ let res = yield* yarnVersion;
362
+ if (res !== 0) {
363
+ return yield* Effect.logError("Failed to set Yarn version. Please check the error message above.");
364
+ }
365
+ res = yield* yarn
366
+ if (res !== 0) {
367
+ return yield* Effect.logError("Failed to install dependencies. Please check the error message above.");
368
+ }
369
+ res = yield* yarnDev
370
+ if (res !== 0) {
371
+ return yield* Effect.logError("Failed to install dev dependencies. Please check the error message above.");
372
+ }
373
+ res = yield* npx
374
+ if (res !== 0) {
375
+ return yield* Effect.logError("Failed to install Expo dependencies. Please check the error message above.");
376
+ }
336
377
  })
337
378
  }
338
379
 
package/files/expo/.env DELETED
@@ -1 +0,0 @@
1
- EXPO_PUBLIC_WIX_CLIENT_ID=
@@ -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
- }