lucy-cli 1.2.5 → 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.
- package/dist/args.d.ts +7 -0
- package/dist/args.js +23 -0
- package/dist/commands.d.ts +3 -0
- package/dist/commands.js +18 -0
- package/dist/config.d.ts +20 -0
- package/dist/config.js +39 -0
- package/dist/error.d.ts +17 -0
- package/dist/error.js +5 -0
- package/dist/helpers.d.ts +1 -32
- package/dist/helpers.js +6 -261
- package/dist/index.d.ts +2 -59
- package/dist/index.js +25 -282
- package/dist/init.d.ts +4 -8
- package/dist/init.js +269 -158
- package/dist/params.d.ts +7 -0
- package/dist/params.js +23 -0
- package/dist/policy.d.ts +3 -0
- package/dist/policy.js +5 -0
- package/dist/prepare.d.ts +0 -8
- package/dist/prepare.js +20 -19
- package/dist/runtime.d.ts +5 -0
- package/dist/runtime.js +11 -0
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.js +2 -0
- package/dist/schemas/types.js +1 -0
- package/dist/states.d.ts +10 -0
- package/dist/states.js +7 -0
- package/files/expo/.nvmrc +1 -0
- package/files/expo/.prettierignore +23 -0
- package/files/expo/.prettierrc.js +16 -0
- package/files/expo/.yarnrc +1 -0
- package/files/expo/.yarnrc.yml +3 -0
- package/files/expo/README.md +45 -0
- package/files/expo/assets/fonts/SpaceMono-Regular.ttf +0 -0
- package/files/expo/assets/images/adaptive-icon.png +0 -0
- package/files/expo/assets/images/favicon.png +0 -0
- package/files/expo/assets/images/icon.png +0 -0
- package/files/expo/assets/images/splash-icon.png +0 -0
- package/files/expo/babel.config.js +10 -0
- package/files/expo/constants/theme.ts +18 -0
- package/files/expo/eas.json +32 -0
- package/files/expo/eslint.config.mjs +181 -0
- package/files/expo/global.css +47 -0
- package/files/expo/hooks/useColorScheme.ts +17 -0
- package/files/expo/index.ts +11 -0
- package/files/expo/lib/data.ts +48 -0
- package/files/expo/lib/utils/index.ts +11 -0
- package/files/expo/lib/utils/polyfills.ts +29 -0
- package/files/expo/lib/wix/client.ts +12 -0
- package/files/expo/lib/wix/error.ts +3 -0
- package/files/expo/lib/wix/index.ts +2 -0
- package/files/expo/lucy.json +8 -0
- package/files/expo/metro.config.js +57 -0
- package/files/expo/nativewind-env.d.ts +1 -0
- package/files/expo/scripts/reset-project.ts +116 -0
- package/files/expo/tailwind.config.js +63 -0
- package/files/expo/tsconfig.json +46 -0
- package/files/expo/types/reset.d.ts +1 -0
- package/files/velo/typescript/public/scss/app.scss +0 -0
- package/files/velo/typescript/styles/.gitkeep +0 -0
- package/files/velo/typescript/styles/global.scss +0 -0
- package/package.json +16 -12
- package/src/args.ts +36 -0
- package/src/commands.ts +21 -0
- package/src/config.ts +61 -0
- package/src/error.ts +4 -0
- package/src/helpers.ts +7 -305
- package/src/index.ts +29 -369
- package/src/init.ts +386 -177
- package/src/policy.ts +6 -0
- package/src/prepare.ts +19 -19
- package/src/runtime.ts +20 -0
- package/src/schemas/index.ts +3 -0
- package/src/schemas/types.ts +0 -0
- package/src/states.ts +15 -0
- package/src copy/helpers.ts +307 -0
- package/src copy/index.ts +379 -0
- package/src copy/init.ts +183 -0
- package/src copy/models.ts +35 -0
- package/src copy/prepare.ts +24 -0
- package/src copy/schemas/index.ts +0 -0
- package/src copy/schemas/types.ts +0 -0
- package/src copy/settings.json +67 -0
- package/src copy/types.d.ts +8 -0
- package/dist/Gulpfile.d.ts +0 -34
- package/dist/Gulpfile.js +0 -115
- package/dist/cli.d.ts +0 -2
- package/dist/cli.js +0 -44
- package/dist/dev.d.ts +0 -2
- package/dist/dev.js +0 -14
- package/dist/gulp/backend copy.d.ts +0 -4
- package/dist/gulp/backend copy.js +0 -50
- package/dist/gulp/backend.d.ts +0 -3
- package/dist/gulp/backend.js +0 -91
- package/dist/gulp/checks.d.ts +0 -3
- package/dist/gulp/checks.js +0 -204
- package/dist/gulp/clean copy.d.ts +0 -2
- package/dist/gulp/clean copy.js +0 -19
- package/dist/gulp/clean.d.ts +0 -3
- package/dist/gulp/clean.js +0 -28
- package/dist/gulp/copy.d.ts +0 -2
- package/dist/gulp/copy.js +0 -33
- package/dist/gulp/docs.d.ts +0 -2
- package/dist/gulp/docs.js +0 -27
- package/dist/gulp/helpers.d.ts +0 -2
- package/dist/gulp/helpers.js +0 -24
- package/dist/gulp/pages copy.d.ts +0 -3
- package/dist/gulp/pages copy.js +0 -22
- package/dist/gulp/pages.d.ts +0 -2
- package/dist/gulp/pages.js +0 -36
- package/dist/gulp/pipeline.d.ts +0 -1
- package/dist/gulp/pipeline.js +0 -28
- package/dist/gulp/public.d.ts +0 -2
- package/dist/gulp/public.js +0 -49
- package/dist/gulp/styles.d.ts +0 -2
- package/dist/gulp/styles.js +0 -39
- package/dist/gulp/templates.d.ts +0 -2
- package/dist/gulp/templates.js +0 -32
- package/dist/gulp/test.d.ts +0 -2
- package/dist/gulp/test.js +0 -26
- package/dist/gulp/types.d.ts +0 -4
- package/dist/gulp/types.js +0 -288
- package/dist/gulp/watchers.d.ts +0 -9
- package/dist/gulp/watchers.js +0 -58
- package/dist/init copy.d.ts +0 -8
- package/dist/init copy.js +0 -167
- package/dist/install.d.ts +0 -2
- package/dist/install.js +0 -53
- package/dist/settings.json +0 -67
- package/dist/start_gulp.d.ts +0 -2
- package/dist/start_gulp.js +0 -14
- package/dist/sync.d.ts +0 -2
- package/dist/sync.js +0 -87
- /package/{files/.gitmodules → dist/schemas/types.d.ts} +0 -0
- /package/files/{typescript/__mocks__ → expo/components}/.gitkeep +0 -0
- /package/files/{typescript/pages → expo/components/ui}/.gitkeep +0 -0
- /package/files/{typescript/backend/data.ts → velo/.gitmodules} +0 -0
- /package/files/{.madgerc → velo/.madgerc} +0 -0
- /package/files/{.nvmrc → velo/.nvmrc} +0 -0
- /package/files/{.stylelintrc.js → velo/.stylelintrc.js} +0 -0
- /package/files/{.yarnrc.yml → velo/.yarnrc.yml} +0 -0
- /package/files/{currents.config.js → velo/currents.config.js} +0 -0
- /package/files/{cypress → velo/cypress}/e2e/base/base.cy.ts +0 -0
- /package/files/{cypress → velo/cypress}/fixtures/example.json +0 -0
- /package/files/{cypress → velo/cypress}/support/commands.ts +0 -0
- /package/files/{cypress → velo/cypress}/support/e2e.ts +0 -0
- /package/files/{cypress → velo/cypress}/tsconfig.json +0 -0
- /package/files/{cypress.config.mjs → velo/cypress.config.mjs} +0 -0
- /package/files/{eslint.config.mjs → velo/eslint.config.mjs} +0 -0
- /package/files/{local.tsconfig.json → velo/local.tsconfig.json} +0 -0
- /package/files/{typedoc.json → velo/typedoc.json} +0 -0
- /package/files/{typescript/public → velo/typescript/__mocks__}/.gitkeep +0 -0
- /package/files/{typescript/backend/events.ts → velo/typescript/backend/data.ts} +0 -0
- /package/files/{typescript/public/scss/app.scss → velo/typescript/backend/events.ts} +0 -0
- /package/files/{typescript → velo/typescript}/backend/http-functions.ts +0 -0
- /package/files/{typescript → velo/typescript}/backend/lib/http-functions/sync.ts +0 -0
- /package/files/{typescript → velo/typescript}/backend/permissions.json +0 -0
- /package/files/{typescript/styles → velo/typescript/pages}/.gitkeep +0 -0
- /package/files/{typescript/styles/global.scss → velo/typescript/public/.gitkeep} +0 -0
- /package/files/{typescript → velo/typescript}/tsconfig.json +0 -0
- /package/files/{vitest.config.ts → velo/vitest.config.ts} +0 -0
- /package/{src → src copy}/Gulpfile.ts +0 -0
- /package/{src → src copy}/gulp/backend.ts +0 -0
- /package/{src → src copy}/gulp/checks.ts +0 -0
- /package/{src → src copy}/gulp/clean.ts +0 -0
- /package/{src → src copy}/gulp/copy.ts +0 -0
- /package/{src → src copy}/gulp/helpers.ts +0 -0
- /package/{src → src copy}/gulp/pages.ts +0 -0
- /package/{src → src copy}/gulp/pipeline.ts +0 -0
- /package/{src → src copy}/gulp/public.ts +0 -0
- /package/{src → src copy}/gulp/styles.ts +0 -0
- /package/{src → src copy}/gulp/templates.ts +0 -0
- /package/{src → src copy}/gulp/types.ts +0 -0
- /package/{src → src copy}/gulp/watchers.ts +0 -0
- /package/{src → src copy}/sync.ts +0 -0
@@ -0,0 +1,16 @@
|
|
1
|
+
module.exports = {
|
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
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
node-options=--max-old-space-size=16384
|
@@ -0,0 +1,45 @@
|
|
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
|
+
yarn 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
|
+
This command will move the starter code to the **app-example** directory and create a blank **app** directory where you can start developing.
|
29
|
+
|
30
|
+
## Learn more
|
31
|
+
|
32
|
+
To learn more about developing your project with Expo, look at the following resources:
|
33
|
+
|
34
|
+
- [React Reusable Components](https://www.reactnativereusables.com/getting-started/introduction/)
|
35
|
+
- [NativeWind Documentation](https://www.nativewind.dev/docs)
|
36
|
+
- [Expo Documentation](https://docs.expo.dev/)
|
37
|
+
- [Expo documentation](https://docs.expo.dev/): Learn fundamentals, or go into advanced topics with our [guides](https://docs.expo.dev/guides).
|
38
|
+
- [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.
|
39
|
+
|
40
|
+
## Join the community
|
41
|
+
|
42
|
+
Join our community of developers creating universal apps.
|
43
|
+
|
44
|
+
- [Expo on GitHub](https://github.com/expo/expo): View our open source platform and contribute.
|
45
|
+
- [Discord community](https://chat.expo.dev): Chat with Expo users and ask questions.
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,18 @@
|
|
1
|
+
export const NAV_THEME = {
|
2
|
+
light: {
|
3
|
+
background: 'hsl(0 0% 100%)', // background
|
4
|
+
border: 'hsl(240 5.9% 90%)', // border
|
5
|
+
card: 'hsl(0 0% 100%)', // card
|
6
|
+
notification: 'hsl(0 84.2% 60.2%)', // destructive
|
7
|
+
primary: 'hsl(240 5.9% 10%)', // primary
|
8
|
+
text: 'hsl(240 10% 3.9%)', // foreground
|
9
|
+
},
|
10
|
+
dark: {
|
11
|
+
background: 'hsl(240 10% 3.9%)', // background
|
12
|
+
border: 'hsl(240 3.7% 15.9%)', // border
|
13
|
+
card: 'hsl(240 10% 3.9%)', // card
|
14
|
+
notification: 'hsl(0 72% 51%)', // destructive
|
15
|
+
primary: 'hsl(0 0% 98%)', // primary
|
16
|
+
text: 'hsl(0 0% 98%)', // foreground
|
17
|
+
},
|
18
|
+
};
|
@@ -0,0 +1,32 @@
|
|
1
|
+
{
|
2
|
+
"cli": {
|
3
|
+
"appVersionSource": "remote"
|
4
|
+
},
|
5
|
+
"build": {
|
6
|
+
"development": {
|
7
|
+
"developmentClient": true,
|
8
|
+
"distribution": "internal",
|
9
|
+
"environment": "development",
|
10
|
+
"env": {}
|
11
|
+
},
|
12
|
+
"ios-simulator": {
|
13
|
+
"extends": "development",
|
14
|
+
"ios": {
|
15
|
+
"simulator": true
|
16
|
+
}
|
17
|
+
},
|
18
|
+
"preview": {
|
19
|
+
"distribution": "internal",
|
20
|
+
"environment": "preview",
|
21
|
+
"env": {}
|
22
|
+
},
|
23
|
+
"production": {
|
24
|
+
"autoIncrement": true,
|
25
|
+
"environment": "production",
|
26
|
+
"env": {}
|
27
|
+
}
|
28
|
+
},
|
29
|
+
"submit": {
|
30
|
+
"production": {}
|
31
|
+
}
|
32
|
+
}
|
@@ -0,0 +1,181 @@
|
|
1
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
2
|
+
// https://docs.expo.dev/guides/using-eslint/
|
3
|
+
import eslint from '@eslint/js';
|
4
|
+
import expoConfig from 'eslint-config-expo/flat.js';
|
5
|
+
// @ts-ignore
|
6
|
+
import jsdoc from 'eslint-plugin-jsdoc';
|
7
|
+
import namedImportSpacing from 'eslint-plugin-named-import-spacing';
|
8
|
+
import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
9
|
+
import globals from 'globals';
|
10
|
+
import tseslint from 'typescript-eslint';
|
11
|
+
|
12
|
+
export default tseslint.config(
|
13
|
+
eslint.configs.recommended,
|
14
|
+
// eslint-disable-next-line import/no-named-as-default-member
|
15
|
+
tseslint.configs.recommendedTypeChecked,
|
16
|
+
jsdoc.configs['flat/recommended-typescript'],
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
18
|
+
expoConfig,
|
19
|
+
{
|
20
|
+
ignores: ['dist/*'],
|
21
|
+
},
|
22
|
+
{
|
23
|
+
plugins: {
|
24
|
+
'simple-import-sort': simpleImportSort,
|
25
|
+
'named-import-spacing': namedImportSpacing,
|
26
|
+
},
|
27
|
+
settings: {
|
28
|
+
'import/resolver': {
|
29
|
+
typescript: {
|
30
|
+
project: './tsconfig.json',
|
31
|
+
}
|
32
|
+
}
|
33
|
+
},
|
34
|
+
languageOptions: {
|
35
|
+
// eslint-disable-next-line import/no-named-as-default-member
|
36
|
+
parser: tseslint.parser,
|
37
|
+
parserOptions: {
|
38
|
+
projectService: true,
|
39
|
+
},
|
40
|
+
ecmaVersion: 2020,
|
41
|
+
sourceType: 'module',
|
42
|
+
globals: {
|
43
|
+
$w: 'readonly',
|
44
|
+
...globals.browser,
|
45
|
+
...globals.node,
|
46
|
+
// ...globals.es6,
|
47
|
+
},
|
48
|
+
},
|
49
|
+
rules: {
|
50
|
+
'no-console': ['error'],
|
51
|
+
'no-restricted-imports': [
|
52
|
+
'error',
|
53
|
+
{
|
54
|
+
'patterns': ['*/**/backend/*', '*/**/public/*']
|
55
|
+
}
|
56
|
+
],
|
57
|
+
'no-restricted-syntax': [
|
58
|
+
'warn',
|
59
|
+
{
|
60
|
+
selector: 'StaticBlock',
|
61
|
+
message: 'Static blocks are not allowed in classes.',
|
62
|
+
},
|
63
|
+
{
|
64
|
+
selector: "MemberExpression[object.name='globalThis'][property.name='console']",
|
65
|
+
message: 'Using globalThis.console is not allowed.'
|
66
|
+
},
|
67
|
+
{
|
68
|
+
selector: "CallExpression[callee.property.name='runPromise'][callee.object.name='runtime']",
|
69
|
+
message: 'Usage of runtime.runPromise() is discouraged.',
|
70
|
+
},
|
71
|
+
{
|
72
|
+
selector: "CallExpression[callee.property.name='runFork'][callee.object.name='runtime']",
|
73
|
+
message: 'Usage of runtime.runFork() is discouraged.',
|
74
|
+
}
|
75
|
+
],
|
76
|
+
'@typescript-eslint/no-unsafe-argument': 'error',
|
77
|
+
'@typescript-eslint/no-unsafe-assignment': 'off',
|
78
|
+
'@typescript-eslint/no-unsafe-call': 'error',
|
79
|
+
'@typescript-eslint/no-unsafe-member-access': 'off',
|
80
|
+
'@typescript-eslint/no-unsafe-return': 'error',
|
81
|
+
quotes: [2, 'single', { avoidEscape: true, allowTemplateLiterals: true }],
|
82
|
+
curly: ['error', 'multi-line'],
|
83
|
+
'simple-import-sort/imports': 'error',
|
84
|
+
'simple-import-sort/exports': 'error',
|
85
|
+
indent: ['error', 'tab'],
|
86
|
+
'no-tabs': 0,
|
87
|
+
'semi-style': ['error', 'last'],
|
88
|
+
semi: [2, 'always'],
|
89
|
+
'object-curly-spacing': ['error', 'always'],
|
90
|
+
'space-in-parens': ['error', 'never'],
|
91
|
+
'newline-before-return': 'error',
|
92
|
+
'space-before-blocks': ['error', { functions: 'always', keywords: 'always', classes: 'always' }],
|
93
|
+
'comma-spacing': ['error', { before: false, after: true }],
|
94
|
+
'no-multi-spaces': 'error',
|
95
|
+
'import/newline-after-import': ['error', { count: 1 }],
|
96
|
+
'named-import-spacing/named-import-spacing': 2,
|
97
|
+
'@typescript-eslint/no-unused-vars': 'warn',
|
98
|
+
'import/no-unresolved': [0],
|
99
|
+
'no-forbidden-relative-imports': [0],
|
100
|
+
'@typescript-eslint/triple-slash-reference': 'off',
|
101
|
+
'@typescript-eslint/member-ordering': [
|
102
|
+
'error',
|
103
|
+
{
|
104
|
+
classes: [
|
105
|
+
'constructor',
|
106
|
+
'private-instance-field',
|
107
|
+
'protected-instance-field',
|
108
|
+
'public-instance-field',
|
109
|
+
'public-instance-method',
|
110
|
+
'private-instance-method',
|
111
|
+
],
|
112
|
+
},
|
113
|
+
],
|
114
|
+
'@typescript-eslint/naming-convention': [
|
115
|
+
'error',
|
116
|
+
{
|
117
|
+
selector: ['variable'],
|
118
|
+
format: ['camelCase', 'UPPER_CASE'],
|
119
|
+
leadingUnderscore: 'allow',
|
120
|
+
},
|
121
|
+
{
|
122
|
+
selector: ['function'],
|
123
|
+
format: ['camelCase', 'PascalCase'],
|
124
|
+
leadingUnderscore: 'allow',
|
125
|
+
},
|
126
|
+
{
|
127
|
+
selector: ['objectLiteralMethod',],
|
128
|
+
format: ['camelCase', 'PascalCase'],
|
129
|
+
leadingUnderscore: 'allow',
|
130
|
+
},
|
131
|
+
{
|
132
|
+
selector: ['import',],
|
133
|
+
format: ['camelCase', 'PascalCase'],
|
134
|
+
leadingUnderscore: 'allow',
|
135
|
+
},
|
136
|
+
{
|
137
|
+
selector: ['objectLiteralProperty'],
|
138
|
+
format: null,
|
139
|
+
leadingUnderscore: 'allow',
|
140
|
+
},
|
141
|
+
{
|
142
|
+
selector: 'memberLike',
|
143
|
+
modifiers: ['private'],
|
144
|
+
format: ['camelCase'],
|
145
|
+
leadingUnderscore: 'require',
|
146
|
+
},
|
147
|
+
{
|
148
|
+
selector: 'memberLike',
|
149
|
+
modifiers: ['protected'],
|
150
|
+
format: ['camelCase'],
|
151
|
+
leadingUnderscore: 'require',
|
152
|
+
},
|
153
|
+
{
|
154
|
+
selector: 'memberLike',
|
155
|
+
modifiers: ['public'],
|
156
|
+
format: ['camelCase'],
|
157
|
+
leadingUnderscore: 'forbid',
|
158
|
+
},
|
159
|
+
{
|
160
|
+
selector: ['parameterProperty', 'parameter'],
|
161
|
+
format: ['camelCase'],
|
162
|
+
leadingUnderscore: 'forbid',
|
163
|
+
},
|
164
|
+
{
|
165
|
+
selector: 'default',
|
166
|
+
format: ['UPPER_CASE'],
|
167
|
+
leadingUnderscore: 'forbid',
|
168
|
+
trailingUnderscore: 'forbid',
|
169
|
+
custom: {
|
170
|
+
regex: '^[A-Z_]+$',
|
171
|
+
match: true,
|
172
|
+
},
|
173
|
+
},
|
174
|
+
{
|
175
|
+
selector: 'typeLike',
|
176
|
+
format: ['PascalCase'],
|
177
|
+
},
|
178
|
+
],
|
179
|
+
},
|
180
|
+
},
|
181
|
+
);
|
@@ -0,0 +1,47 @@
|
|
1
|
+
@tailwind base;
|
2
|
+
@tailwind components;
|
3
|
+
@tailwind utilities;
|
4
|
+
@layer base {
|
5
|
+
:root {
|
6
|
+
--background: 0 0% 100%;
|
7
|
+
--foreground: 240 10% 3.9%;
|
8
|
+
--card: 0 0% 100%;
|
9
|
+
--card-foreground: 240 10% 3.9%;
|
10
|
+
--popover: 0 0% 100%;
|
11
|
+
--popover-foreground: 240 10% 3.9%;
|
12
|
+
--primary: 240 5.9% 10%;
|
13
|
+
--primary-foreground: 0 0% 98%;
|
14
|
+
--secondary: 240 4.8% 95.9%;
|
15
|
+
--secondary-foreground: 240 5.9% 10%;
|
16
|
+
--muted: 240 4.8% 95.9%;
|
17
|
+
--muted-foreground: 240 3.8% 46.1%;
|
18
|
+
--accent: 240 4.8% 95.9%;
|
19
|
+
--accent-foreground: 240 5.9% 10%;
|
20
|
+
--destructive: 0 84.2% 60.2%;
|
21
|
+
--destructive-foreground: 0 0% 98%;
|
22
|
+
--border: 240 5.9% 90%;
|
23
|
+
--input: 240 5.9% 90%;
|
24
|
+
--ring: 240 5.9% 10%;
|
25
|
+
}
|
26
|
+
.dark:root {
|
27
|
+
--background: 240 10% 3.9%;
|
28
|
+
--foreground: 0 0% 98%;
|
29
|
+
--card: 240 10% 3.9%;
|
30
|
+
--card-foreground: 0 0% 98%;
|
31
|
+
--popover: 240 10% 3.9%;
|
32
|
+
--popover-foreground: 0 0% 98%;
|
33
|
+
--primary: 0 0% 98%;
|
34
|
+
--primary-foreground: 240 5.9% 10%;
|
35
|
+
--secondary: 240 3.7% 15.9%;
|
36
|
+
--secondary-foreground: 0 0% 98%;
|
37
|
+
--muted: 240 3.7% 15.9%;
|
38
|
+
--muted-foreground: 240 5% 64.9%;
|
39
|
+
--accent: 240 3.7% 15.9%;
|
40
|
+
--accent-foreground: 0 0% 98%;
|
41
|
+
--destructive: 0 72% 51%;
|
42
|
+
--destructive-foreground: 0 0% 98%;
|
43
|
+
--border: 240 3.7% 15.9%;
|
44
|
+
--input: 240 3.7% 15.9%;
|
45
|
+
--ring: 240 4.9% 83.9%;
|
46
|
+
}
|
47
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { useColorScheme as useNativewindColorScheme } from 'nativewind';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Custom hook to get the current color scheme and provide methods to change it.
|
5
|
+
* This hook uses the nativewind's useColorScheme to access the color scheme.
|
6
|
+
* @returns An object containing the current color scheme, a method to set the color scheme,
|
7
|
+
*/
|
8
|
+
export function useColorScheme() {
|
9
|
+
const { colorScheme, setColorScheme, toggleColorScheme } = useNativewindColorScheme();
|
10
|
+
|
11
|
+
return {
|
12
|
+
colorScheme: colorScheme ?? 'dark',
|
13
|
+
isDarkColorScheme: colorScheme === 'dark',
|
14
|
+
setColorScheme,
|
15
|
+
toggleColorScheme,
|
16
|
+
};
|
17
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import '@/global.css';
|
2
|
+
import '@/lib/utils/polyfills';
|
3
|
+
|
4
|
+
import { registerRootComponent } from 'expo';
|
5
|
+
|
6
|
+
import App from './App';
|
7
|
+
|
8
|
+
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
|
9
|
+
// It also ensures that whether you load the app in Expo Go or in a native build,
|
10
|
+
// the environment is set up appropriately
|
11
|
+
registerRootComponent(App);
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { Effect, Schedule, Schema } from 'effect';
|
2
|
+
|
3
|
+
import { client, ClientError } from './wix';
|
4
|
+
|
5
|
+
const dataSchema = Schema.Struct({
|
6
|
+
source: Schema.String,
|
7
|
+
content: Schema.String,
|
8
|
+
_id: Schema.String,
|
9
|
+
_owner: Schema.String,
|
10
|
+
_createdDate: Schema.Any,
|
11
|
+
_updatedDate: Schema.Any,
|
12
|
+
});
|
13
|
+
|
14
|
+
const COLLECTION_NAME = 'dailySpiritQuotes';
|
15
|
+
|
16
|
+
export const getQuote = () => Effect.gen(function* () {
|
17
|
+
const count = yield* Effect.retry(Effect.tryPromise({
|
18
|
+
try: () => client.items.query(COLLECTION_NAME).count(),
|
19
|
+
catch: (error) => {
|
20
|
+
console.error('Error fetching quotes:', error);
|
21
|
+
Effect.fail(new ClientError());
|
22
|
+
}
|
23
|
+
}), Schedule.fromDelays(50, 100, 200, 400, 800));
|
24
|
+
|
25
|
+
if (count === 0) {
|
26
|
+
return yield* Effect.fail(new Error('No quotes found in the collection.'));
|
27
|
+
}
|
28
|
+
|
29
|
+
const randomIndex = Math.floor(Math.random() * count);
|
30
|
+
|
31
|
+
const data = yield* Effect.retry(Effect.tryPromise({
|
32
|
+
try: () => client.items.query(COLLECTION_NAME).skip(randomIndex).limit(1).find(),
|
33
|
+
catch: (error) => {
|
34
|
+
console.error('Error fetching quotes:', error);
|
35
|
+
Effect.fail(new ClientError());
|
36
|
+
}
|
37
|
+
}), Schedule.fromDelays(50, 100, 200, 400, 800));
|
38
|
+
|
39
|
+
yield* Effect.logDebug(`Fetched ${JSON.stringify(data, null, 2)}`);
|
40
|
+
|
41
|
+
const quote = yield* Schema.decodeUnknown(dataSchema)(data.items[0]);
|
42
|
+
|
43
|
+
return { source: quote.source, content: quote.content };
|
44
|
+
}).pipe(Effect.catchAll((error) => {
|
45
|
+
console.error('Failed to fetch quote:', error);
|
46
|
+
|
47
|
+
return Effect.succeed({ source: 'The Lord', content: 'The ways of the Lord are inscrutable.' });
|
48
|
+
}));
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { type ClassValue, clsx } from 'clsx';
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Combines class names and merges Tailwind CSS classes.
|
6
|
+
* @param inputs - The class names to combine.
|
7
|
+
* @returns A string of combined class names.
|
8
|
+
*/
|
9
|
+
export function cn(...inputs: ClassValue[]) {
|
10
|
+
return twMerge(clsx(inputs));
|
11
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
|
2
|
+
import { polyfillWebCrypto } from 'expo-standard-web-crypto';
|
3
|
+
// import { Platform } from 'react-native';
|
4
|
+
// // import polyfill from 'react-native-polyfill-globals';
|
5
|
+
// import { TextDecoder, TextEncoder } from "text-encoding";
|
6
|
+
// // require('node-libs-react-native/globals');
|
7
|
+
// if (typeof TextEncoder === "undefined") {
|
8
|
+
// Object.defineProperty(window, "TextEncoder", {
|
9
|
+
// configurable: true,
|
10
|
+
// enumerable: true,
|
11
|
+
// get: () => TextEncoder,
|
12
|
+
// });
|
13
|
+
// }
|
14
|
+
|
15
|
+
// if (typeof TextDecoder === "undefined") {
|
16
|
+
// Object.defineProperty(window, "TextDecoder", {
|
17
|
+
// configurable: true,
|
18
|
+
// enumerable: true,
|
19
|
+
// get: () => TextDecoder,
|
20
|
+
// });
|
21
|
+
// }
|
22
|
+
// if (Platform.OS !== "web") {
|
23
|
+
// // require("react-native-polyfill-globals");
|
24
|
+
// // @ts-ignore
|
25
|
+
// (Symbol).asyncIterator = Symbol.asyncIterator || Symbol.for("Symbol.asyncIterator");
|
26
|
+
// // polyfill();
|
27
|
+
// }
|
28
|
+
|
29
|
+
polyfillWebCrypto();
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { items } from '@wix/data';
|
2
|
+
import { createClient, OAuthStrategy } from '@wix/sdk';
|
3
|
+
|
4
|
+
const clientId = process.env.EXPO_PUBLIC_WIX_CLIENT_ID || '';
|
5
|
+
|
6
|
+
//To access the Wix APIs, create a client with the createClient() function imported from the @wix/sdk package.
|
7
|
+
export const client = createClient({
|
8
|
+
modules: { items },
|
9
|
+
auth: OAuthStrategy({ clientId: clientId }),
|
10
|
+
});
|
11
|
+
|
12
|
+
|
@@ -0,0 +1,57 @@
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-require-imports */
|
2
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
3
|
+
// @ts-nocheck
|
4
|
+
const { getDefaultConfig } = require('expo/metro-config');
|
5
|
+
const { withNativeWind } = require('nativewind/metro');
|
6
|
+
const path = require('path');
|
7
|
+
|
8
|
+
const ALIASES_WEB = {
|
9
|
+
'@wix/sdk': path.resolve(__dirname, './node_modules/@wix/sdk/cjs/build/index.js'),
|
10
|
+
// Example: redirect imports of 'some-native-library' to a web-compatible mock
|
11
|
+
// 'some-native-library': path.resolve(__dirname, 'src/mocks/some-native-library.web.js'),
|
12
|
+
|
13
|
+
// You can add your @wix/sdk aliases here if needed
|
14
|
+
// '@wix/sdk-something': path.resolve(__dirname, 'src/wix/sdk-something-web.js'),
|
15
|
+
};
|
16
|
+
const config = (() => {
|
17
|
+
let config = getDefaultConfig(__dirname);
|
18
|
+
const { transformer, resolver } = config;
|
19
|
+
config.transformer = {
|
20
|
+
...transformer,
|
21
|
+
};
|
22
|
+
config.resolver = {
|
23
|
+
...resolver,
|
24
|
+
};
|
25
|
+
|
26
|
+
config.resolver.unstable_enablePackageExports = false;
|
27
|
+
// config.resolver.unstable_conditionsByPlatform = ['ios', 'android']
|
28
|
+
config.resolver.resolveRequest = (context, moduleName, platform) => {
|
29
|
+
if (platform === 'web') {
|
30
|
+
// Check if the module name is in our alias map
|
31
|
+
const alias = ALIASES_WEB[moduleName];
|
32
|
+
if (alias) {
|
33
|
+
console.log(`Aliasing '${moduleName}' to '${alias}'`);
|
34
|
+
// If it is, resolve to the new path
|
35
|
+
return context.resolveRequest(context, alias, platform);
|
36
|
+
}
|
37
|
+
}
|
38
|
+
// Ensure you call the default resolver for everything else.
|
39
|
+
return context.resolveRequest(context, moduleName, platform);
|
40
|
+
};
|
41
|
+
|
42
|
+
config.resolver.extraNodeModules = {
|
43
|
+
...config.resolver.extraNodeModules,
|
44
|
+
...require('node-libs-react-native'),
|
45
|
+
// 'node:buffer': require.resolve('buffer/'),
|
46
|
+
// 'node:crypto': require.resolve('react-native-crypto/'),
|
47
|
+
// 'node:util': require.resolve('util/'),
|
48
|
+
// 'node:http': require.resolve('stream-http/'),
|
49
|
+
// 'node:https': require.resolve('https-browserify/'),
|
50
|
+
// 'node:events': require.resolve('events/'),
|
51
|
+
};
|
52
|
+
|
53
|
+
return config;
|
54
|
+
})();
|
55
|
+
// console.log('Using Metro config:', JSON.stringify(config, null, 2));
|
56
|
+
module.exports = withNativeWind(config, { input: './global.css' });
|
57
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
/// <reference types="nativewind/types" />
|