lucy-cli 1.2.4 → 2.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- 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 -52
- package/dist/index.js +25 -282
- package/dist/init.d.ts +4 -8
- package/dist/init.js +245 -160
- 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/.env +1 -0
- package/files/expo/.nvmrc +1 -0
- package/files/expo/.prettierignore +23 -0
- package/files/expo/.prettierrc.json +16 -0
- package/files/expo/.yarnrc +1 -0
- package/files/expo/.yarnrc.yml +3 -0
- package/files/expo/app/(tabs)/_layout.tsx +45 -0
- package/files/expo/app/_layout.tsx +45 -0
- package/files/expo/babel.config.js +9 -0
- package/files/expo/constants/Colors.ts +27 -0
- package/files/expo/constants/theme.ts +18 -0
- package/files/expo/eas.json +26 -0
- package/files/expo/eslint.config.js +185 -0
- package/files/expo/global.css +47 -0
- package/files/expo/hooks/useColorScheme.ts +11 -0
- package/files/expo/hooks/useColorScheme.web.ts +21 -0
- package/files/expo/hooks/useColorSchemeRN.ts +1 -0
- package/files/expo/hooks/useThemeColor.ts +21 -0
- package/files/expo/lib/data.ts +45 -0
- package/files/expo/lib/utils/index.ts +6 -0
- package/files/expo/lib/utils/polyfills.ts +29 -0
- package/files/expo/lib/wix/client.ts +14 -0
- package/files/expo/lib/wix/index.ts +1 -0
- package/files/expo/lucy.json +8 -0
- package/files/expo/readme.md +45 -0
- package/files/expo/tailwind.config.js +198 -0
- package/files/expo/tsconfig.json +40 -0
- package/files/expo/types/nativewind-env.d.ts +1 -0
- package/files/expo/types/reset.d.ts +1 -0
- package/files/velo/typescript/styles/global.scss +0 -0
- package/package.json +14 -11
- 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 -362
- package/src/init.ts +345 -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/Gulpfile.ts → src copy/Gulpfile.ts } +3 -1
- package/{src/gulp/backend.ts → src copy/gulp/backend.ts } +3 -12
- package/{src/gulp/checks.ts → src copy/gulp/checks.ts } +2 -6
- package/{src/gulp/copy.ts → src copy/gulp/copy.ts } +1 -6
- package/src copy/gulp/helpers.ts +26 -0
- package/{src/gulp/public.ts → src copy/gulp/public.ts } +1 -6
- package/{src/gulp/styles.ts → src copy/gulp/styles.ts } +2 -7
- package/{src/gulp/templates.ts → src copy/gulp/templates.ts } +1 -6
- 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 -33
- package/dist/Gulpfile.js +0 -114
- 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 -101
- package/dist/gulp/checks.d.ts +0 -3
- package/dist/gulp/checks.js +0 -209
- 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 -38
- package/dist/gulp/docs.d.ts +0 -2
- package/dist/gulp/docs.js +0 -27
- package/dist/gulp/helpers.d.ts +0 -1
- package/dist/gulp/helpers.js +0 -7
- 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 -54
- package/dist/gulp/styles.d.ts +0 -2
- package/dist/gulp/styles.js +0 -44
- package/dist/gulp/templates.d.ts +0 -2
- package/dist/gulp/templates.js +0 -37
- 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/src/gulp/helpers.ts +0 -9
- /package/{files/.gitmodules → dist/schemas/types.d.ts} +0 -0
- /package/files/{typescript/__mocks__/.gitkeep → 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/pages → velo/typescript/__mocks__}/.gitkeep +0 -0
- /package/files/{typescript → velo/typescript}/backend/data.ts +0 -0
- /package/files/{typescript → 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/public → velo/typescript/pages}/.gitkeep +0 -0
- /package/files/{typescript/styles → velo/typescript/public}/.gitkeep +0 -0
- /package/files/{typescript → velo/typescript}/public/scss/app.scss +0 -0
- /package/files/{typescript/styles/global.scss → velo/typescript/styles/.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}/gulp/clean.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/types.ts +0 -0
- /package/{src → src copy}/gulp/watchers.ts +0 -0
- /package/{src → src copy}/sync.ts +0 -0
@@ -0,0 +1,45 @@
|
|
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
|
+
}
|
@@ -0,0 +1,45 @@
|
|
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;
|
@@ -0,0 +1,27 @@
|
|
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
|
+
|
@@ -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,26 @@
|
|
1
|
+
{
|
2
|
+
"cli": {
|
3
|
+
"appVersionSource": "remote"
|
4
|
+
},
|
5
|
+
"build": {
|
6
|
+
"development": {
|
7
|
+
"developmentClient": true,
|
8
|
+
"distribution": "internal"
|
9
|
+
},
|
10
|
+
"ios-simulator": {
|
11
|
+
"extends": "development",
|
12
|
+
"ios": {
|
13
|
+
"simulator": true
|
14
|
+
}
|
15
|
+
},
|
16
|
+
"preview": {
|
17
|
+
"distribution": "internal"
|
18
|
+
},
|
19
|
+
"production": {
|
20
|
+
"autoIncrement": true
|
21
|
+
}
|
22
|
+
},
|
23
|
+
"submit": {
|
24
|
+
"production": {}
|
25
|
+
}
|
26
|
+
}
|
@@ -0,0 +1,185 @@
|
|
1
|
+
// https://docs.expo.dev/guides/using-eslint/
|
2
|
+
const { defineConfig } = require('eslint/config');
|
3
|
+
const expoConfig = require('eslint-config-expo/flat');
|
4
|
+
|
5
|
+
import eslint from '@eslint/js';
|
6
|
+
// @ts-ignore
|
7
|
+
import importPlugin from 'eslint-plugin-import';
|
8
|
+
import jsdoc from 'eslint-plugin-jsdoc';
|
9
|
+
import namedImportSpacing from 'eslint-plugin-named-import-spacing';
|
10
|
+
import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
11
|
+
import globals from 'globals';
|
12
|
+
import tseslint from 'typescript-eslint';
|
13
|
+
|
14
|
+
export default tseslint.config(
|
15
|
+
eslint.configs.recommended,
|
16
|
+
tseslint.configs.recommendedTypeChecked,
|
17
|
+
jsdoc.configs['flat/recommended-typescript'],
|
18
|
+
expoConfig,
|
19
|
+
{
|
20
|
+
ignores: ['dist/*'],
|
21
|
+
},
|
22
|
+
{
|
23
|
+
plugins: {
|
24
|
+
'@typescript-eslint': tseslint.plugin,
|
25
|
+
'simple-import-sort': simpleImportSort,
|
26
|
+
import: importPlugin,
|
27
|
+
'named-import-spacing': namedImportSpacing,
|
28
|
+
jsdoc,
|
29
|
+
},
|
30
|
+
settings: {
|
31
|
+
'import/resolver': {
|
32
|
+
typescript: {
|
33
|
+
project: [
|
34
|
+
'typescript/tsconfig.json',
|
35
|
+
'lib/tsconfig.json'
|
36
|
+
],
|
37
|
+
}
|
38
|
+
}
|
39
|
+
},
|
40
|
+
languageOptions: {
|
41
|
+
parser: tseslint.parser,
|
42
|
+
parserOptions: {
|
43
|
+
projectService: true,
|
44
|
+
},
|
45
|
+
ecmaVersion: 2020,
|
46
|
+
sourceType: 'module',
|
47
|
+
globals: {
|
48
|
+
$w: 'readonly',
|
49
|
+
...globals.browser,
|
50
|
+
...globals.node,
|
51
|
+
// ...globals.es6,
|
52
|
+
},
|
53
|
+
},
|
54
|
+
rules: {
|
55
|
+
'no-console': ['error'],
|
56
|
+
'no-restricted-imports': [
|
57
|
+
'error',
|
58
|
+
{
|
59
|
+
'patterns': ['*/**/backend/*', '*/**/public/*']
|
60
|
+
}
|
61
|
+
],
|
62
|
+
'no-restricted-syntax': [
|
63
|
+
'warn',
|
64
|
+
{
|
65
|
+
selector: 'StaticBlock',
|
66
|
+
message: 'Static blocks are not allowed in classes.',
|
67
|
+
},
|
68
|
+
{
|
69
|
+
selector: "MemberExpression[object.name='globalThis'][property.name='console']",
|
70
|
+
message: 'Using globalThis.console is not allowed.'
|
71
|
+
},
|
72
|
+
{
|
73
|
+
selector: "CallExpression[callee.property.name='runPromise'][callee.object.name='runtime']",
|
74
|
+
message: 'Usage of runtime.runPromise() is discouraged.',
|
75
|
+
},
|
76
|
+
{
|
77
|
+
selector: "CallExpression[callee.property.name='runFork'][callee.object.name='runtime']",
|
78
|
+
message: 'Usage of runtime.runFork() is discouraged.',
|
79
|
+
}
|
80
|
+
],
|
81
|
+
'@typescript-eslint/no-unsafe-argument': 'error',
|
82
|
+
'@typescript-eslint/no-unsafe-assignment': 'off',
|
83
|
+
'@typescript-eslint/no-unsafe-call': 'error',
|
84
|
+
'@typescript-eslint/no-unsafe-member-access': 'off',
|
85
|
+
'@typescript-eslint/no-unsafe-return': 'error',
|
86
|
+
quotes: [2, 'single', { avoidEscape: true, allowTemplateLiterals: true }],
|
87
|
+
curly: ['error', 'multi-line'],
|
88
|
+
'simple-import-sort/imports': 'error',
|
89
|
+
'simple-import-sort/exports': 'error',
|
90
|
+
indent: ['error', 'tab'],
|
91
|
+
'no-tabs': 0,
|
92
|
+
'semi-style': ['error', 'last'],
|
93
|
+
semi: [2, 'always'],
|
94
|
+
'object-curly-spacing': ['error', 'always'],
|
95
|
+
'space-in-parens': ['error', 'never'],
|
96
|
+
'newline-before-return': 'error',
|
97
|
+
'space-before-blocks': ['error', { functions: 'always', keywords: 'always', classes: 'always' }],
|
98
|
+
'comma-spacing': ['error', { before: false, after: true }],
|
99
|
+
'no-multi-spaces': 'error',
|
100
|
+
'import/newline-after-import': ['error', { count: 1 }],
|
101
|
+
'named-import-spacing/named-import-spacing': 2,
|
102
|
+
'no-unused-vars': 'warn',
|
103
|
+
'import/no-unresolved': [0],
|
104
|
+
'no-forbidden-relative-imports': [0],
|
105
|
+
'@typescript-eslint/triple-slash-reference': 'off',
|
106
|
+
'@typescript-eslint/member-ordering': [
|
107
|
+
'error',
|
108
|
+
{
|
109
|
+
classes: [
|
110
|
+
'constructor',
|
111
|
+
'private-instance-field',
|
112
|
+
'protected-instance-field',
|
113
|
+
'public-instance-field',
|
114
|
+
'public-instance-method',
|
115
|
+
'private-instance-method',
|
116
|
+
],
|
117
|
+
},
|
118
|
+
],
|
119
|
+
'@typescript-eslint/naming-convention': [
|
120
|
+
'error',
|
121
|
+
{
|
122
|
+
selector: ['variable', 'function'],
|
123
|
+
format: ['camelCase'],
|
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
|
+
selector: 'function',
|
180
|
+
format: ['UPPER_CASE'],
|
181
|
+
},
|
182
|
+
],
|
183
|
+
},
|
184
|
+
},
|
185
|
+
);
|
@@ -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,11 @@
|
|
1
|
+
import { useColorScheme as useNativewindColorScheme } from 'nativewind';
|
2
|
+
|
3
|
+
export function useColorScheme() {
|
4
|
+
const { colorScheme, setColorScheme, toggleColorScheme } = useNativewindColorScheme();
|
5
|
+
return {
|
6
|
+
colorScheme: colorScheme ?? 'dark',
|
7
|
+
isDarkColorScheme: colorScheme === 'dark',
|
8
|
+
setColorScheme,
|
9
|
+
toggleColorScheme,
|
10
|
+
};
|
11
|
+
}
|
@@ -0,0 +1,21 @@
|
|
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
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { useColorScheme } from 'react-native';
|
@@ -0,0 +1,21 @@
|
|
1
|
+
/**
|
2
|
+
* Learn more about light and dark modes:
|
3
|
+
* https://docs.expo.dev/guides/color-schemes/
|
4
|
+
*/
|
5
|
+
|
6
|
+
import { Colors } from '@/constants/Colors';
|
7
|
+
import { useColorScheme } from './useColorSchemeRN';
|
8
|
+
|
9
|
+
export function useThemeColor(
|
10
|
+
props: { light?: string; dark?: string },
|
11
|
+
colorName: keyof typeof Colors.light & keyof typeof Colors.dark
|
12
|
+
) {
|
13
|
+
const theme = useColorScheme() ?? 'light';
|
14
|
+
const colorFromProps = props[theme];
|
15
|
+
|
16
|
+
if (colorFromProps) {
|
17
|
+
return colorFromProps;
|
18
|
+
} else {
|
19
|
+
return Colors[theme][colorName];
|
20
|
+
}
|
21
|
+
}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import { Effect, Schedule, Schema } from 'effect';
|
2
|
+
import { client, ClientError } from './wixClient';
|
3
|
+
|
4
|
+
const dataSchema = Schema.Struct({
|
5
|
+
source: Schema.String,
|
6
|
+
content: Schema.String,
|
7
|
+
_id: Schema.String,
|
8
|
+
_owner: Schema.String,
|
9
|
+
_createdDate: Schema.Any,
|
10
|
+
_updatedDate: Schema.Any,
|
11
|
+
});
|
12
|
+
|
13
|
+
const COLLECTION_NAME = "dailySpiritQuotes";
|
14
|
+
|
15
|
+
export const getQuote = () => Effect.gen(function* () {
|
16
|
+
const count = yield* Effect.retry(Effect.tryPromise({
|
17
|
+
try: () => client.items.query(COLLECTION_NAME).count(),
|
18
|
+
catch: (error) => {
|
19
|
+
console.error('Error fetching quotes:', error);
|
20
|
+
Effect.fail(new ClientError());
|
21
|
+
}
|
22
|
+
}), Schedule.fromDelays(50, 100, 200, 400, 800));
|
23
|
+
|
24
|
+
if (count === 0) {
|
25
|
+
return yield* Effect.fail(new Error("No quotes found in the collection."));
|
26
|
+
}
|
27
|
+
|
28
|
+
const randomIndex = Math.floor(Math.random() * count);
|
29
|
+
|
30
|
+
const data = yield* Effect.retry(Effect.tryPromise({
|
31
|
+
try: () => client.items.query(COLLECTION_NAME).skip(randomIndex).limit(1).find(),
|
32
|
+
catch: (error) => {
|
33
|
+
console.error('Error fetching quotes:', error);
|
34
|
+
Effect.fail(new ClientError());
|
35
|
+
}
|
36
|
+
}), Schedule.fromDelays(50, 100, 200, 400, 800));
|
37
|
+
|
38
|
+
yield* Effect.logDebug(`Fetched ${JSON.stringify(data, null, 2)}`);
|
39
|
+
|
40
|
+
const quote = yield* Schema.decodeUnknown(dataSchema)(data.items[0]);
|
41
|
+
return { source: quote.source, content: quote.content }
|
42
|
+
}).pipe(Effect.catchAll((error) => {
|
43
|
+
console.error('Failed to fetch quote:', error);
|
44
|
+
return Effect.succeed({ source: 'The Lord', content: 'The ways of the Lord are inscrutable.'});
|
45
|
+
}))
|
@@ -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,14 @@
|
|
1
|
+
import { items } from '@wix/data';
|
2
|
+
import { createClient, OAuthStrategy } from '@wix/sdk';
|
3
|
+
import { Data } from 'effect';
|
4
|
+
|
5
|
+
const clientId = process.env.EXPO_PUBLIC_WIX_CLIENT_ID || "";
|
6
|
+
|
7
|
+
//To access the Wix APIs, create a client with the createClient() function imported from the @wix/sdk package.
|
8
|
+
export const client = createClient({
|
9
|
+
modules: { items },
|
10
|
+
auth: OAuthStrategy({ clientId: clientId }),
|
11
|
+
});
|
12
|
+
export class ClientError extends Data.TaggedError('ErrorParserError') {}
|
13
|
+
|
14
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
export { client } from './client';
|
@@ -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.
|