lucy-cli 2.0.0-beta.3 → 2.0.0-beta.6
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/.wix/debug.log +10 -0
- package/dist/args.js +0 -1
- package/dist/args.js.map +1 -1
- package/dist/commands/checks.d.ts +2 -2
- package/dist/commands/edit.d.ts +1 -1
- package/dist/commands/exec.d.ts +1 -1
- package/dist/commands/exec.js +15 -13
- package/dist/commands/exec.js.map +1 -1
- package/dist/commands/git.d.ts +2 -2
- package/dist/commands/home.d.ts +2 -2
- package/dist/commands/home.js +25 -2
- package/dist/commands/home.js.map +1 -1
- package/dist/commands/install.d.ts +1 -0
- package/dist/commands/install.js +29 -16
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/read.d.ts +3 -3
- package/dist/config.d.ts +1 -1
- package/dist/index.js +0 -0
- package/dist/init/blocks.d.ts +1 -1
- package/dist/init/blocks.js +2 -2
- package/dist/init/cargo.d.ts +1 -1
- package/dist/init/cargo.js +2 -2
- package/dist/init/expo.d.ts +1 -1
- package/dist/init/expo.js +2 -2
- package/dist/init/gitModules.d.ts +1 -1
- package/dist/init/index.d.ts +1 -2
- package/dist/init/index.js +7 -1
- package/dist/init/index.js.map +1 -1
- package/dist/init/monorepo.d.ts +1 -1
- package/dist/init/monorepo.js +2 -2
- package/dist/init/prepareVelo.d.ts +1 -1
- package/dist/init/tauri.d.ts +1 -1
- package/dist/init/tauri.js +2 -2
- package/dist/init/templates.d.ts +1 -1
- package/dist/init/velo.d.ts +1 -1
- package/dist/init/velo.js +3 -2
- package/dist/init/velo.js.map +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/lucy.d.ts +2 -2
- package/dist/schemas/lucy.js +1 -1
- package/dist/schemas/lucy.js.map +1 -1
- package/dist/tasks/index.d.ts +1 -1
- package/dist/wix-sdk/index.d.ts +1 -1
- package/dist/wix-sdk/init.d.ts +1 -1
- package/dist/wix-sdk/run.d.ts +1 -1
- package/dist/wix-sync/index.d.ts +1 -1
- package/dist/wix-sync/init.d.ts +1 -1
- package/files/templates/expo verse[D]/files/.nvmrc +1 -0
- package/files/templates/expo verse[D]/files/.prettierignore +23 -0
- package/files/templates/expo verse[D]/files/.prettierrc.js +16 -0
- package/files/templates/expo verse[D]/files/.stylelintrc.json +8 -0
- package/files/templates/expo verse[D]/files/.vscode/extensions.json +10 -0
- package/files/templates/expo verse[D]/files/.vscode/launch.json +54 -0
- package/files/templates/expo verse[D]/files/.vscode/settings.json +30 -0
- package/files/templates/expo verse[D]/files/.vscode/tasks.json +0 -0
- package/files/templates/expo verse[D]/files/.yarnrc +1 -0
- package/files/templates/expo verse[D]/files/.yarnrc.yml +8 -0
- package/files/templates/expo verse[D]/files/App.tsx +63 -0
- package/files/templates/expo verse[D]/files/DEBUGGING.md +126 -0
- package/files/templates/expo verse[D]/files/README.md +45 -0
- package/files/templates/expo verse[D]/files/android/app/build.gradle +177 -0
- package/files/templates/expo verse[D]/files/android/app/debug.keystore +0 -0
- package/files/templates/expo verse[D]/files/android/app/proguard-rules.pro +14 -0
- package/files/templates/expo verse[D]/files/android/app/src/debug/AndroidManifest.xml +7 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/AndroidManifest.xml +33 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/java/so/sunnysideup/daily_verse/MainActivity.kt +65 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/java/so/sunnysideup/daily_verse/MainApplication.kt +57 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/drawable/ic_launcher_background.xml +6 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/drawable-hdpi/splashscreen_logo.png +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/drawable-mdpi/splashscreen_logo.png +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/drawable-night-hdpi/splashscreen_logo.png +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/drawable-night-mdpi/splashscreen_logo.png +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/drawable-night-xhdpi/splashscreen_logo.png +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/drawable-night-xxhdpi/splashscreen_logo.png +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/drawable-night-xxxhdpi/splashscreen_logo.png +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/drawable-xhdpi/splashscreen_logo.png +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/drawable-xxhdpi/splashscreen_logo.png +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/drawable-xxxhdpi/splashscreen_logo.png +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +6 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +6 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.webp +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.webp +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.webp +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.webp +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.webp +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp +0 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/values/colors.xml +6 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/values/strings.xml +7 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/values/styles.xml +12 -0
- package/files/templates/expo verse[D]/files/android/app/src/main/res/values-night/colors.xml +3 -0
- package/files/templates/expo verse[D]/files/android/build.gradle +37 -0
- package/files/templates/expo verse[D]/files/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/files/templates/expo verse[D]/files/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/files/templates/expo verse[D]/files/android/gradle.properties +59 -0
- package/files/templates/expo verse[D]/files/android/gradlew +251 -0
- package/files/templates/expo verse[D]/files/android/gradlew.bat +94 -0
- package/files/templates/expo verse[D]/files/android/settings.gradle +39 -0
- package/files/templates/expo verse[D]/files/app.config.ts +77 -0
- package/files/templates/expo verse[D]/files/assets/data/de.csv +949 -0
- package/files/templates/expo verse[D]/files/assets/data/en.csv +949 -0
- package/files/templates/expo verse[D]/files/assets/fonts/PlayfairDisplay-Black.ttf +0 -0
- package/files/templates/expo verse[D]/files/assets/fonts/PlayfairDisplay-BlackItalic.ttf +0 -0
- package/files/templates/expo verse[D]/files/assets/fonts/PlayfairDisplay-Bold.ttf +0 -0
- package/files/templates/expo verse[D]/files/assets/fonts/PlayfairDisplay-BoldItalic.ttf +0 -0
- package/files/templates/expo verse[D]/files/assets/fonts/PlayfairDisplay-ExtraBold.ttf +0 -0
- package/files/templates/expo verse[D]/files/assets/fonts/PlayfairDisplay-ExtraBoldItalic.ttf +0 -0
- package/files/templates/expo verse[D]/files/assets/fonts/PlayfairDisplay-Italic.ttf +0 -0
- package/files/templates/expo verse[D]/files/assets/fonts/PlayfairDisplay-Medium.ttf +0 -0
- package/files/templates/expo verse[D]/files/assets/fonts/PlayfairDisplay-MediumItalic.ttf +0 -0
- package/files/templates/expo verse[D]/files/assets/fonts/PlayfairDisplay-Regular.ttf +0 -0
- package/files/templates/expo verse[D]/files/assets/fonts/PlayfairDisplay-SemiBold.ttf +0 -0
- package/files/templates/expo verse[D]/files/assets/fonts/PlayfairDisplay-SemiBoldItalic.ttf +0 -0
- package/files/templates/expo verse[D]/files/assets/fonts/SpaceMono-Regular.ttf +0 -0
- package/files/templates/expo verse[D]/files/assets/images/andorid/background.png +0 -0
- package/files/templates/expo verse[D]/files/assets/images/android-dark.png +0 -0
- package/files/templates/expo verse[D]/files/assets/images/android-light.png +0 -0
- package/files/templates/expo verse[D]/files/assets/images/background.png +0 -0
- package/files/templates/expo verse[D]/files/assets/images/ios-dark.png +0 -0
- package/files/templates/expo verse[D]/files/assets/images/ios-light.png +0 -0
- package/files/templates/expo verse[D]/files/assets/images/ios-tinted.png +0 -0
- package/files/templates/expo verse[D]/files/assets/images/splash-icon-dark.png +0 -0
- package/files/templates/expo verse[D]/files/assets/images/splash-icon-light.png +0 -0
- package/files/templates/expo verse[D]/files/babel.config.js +10 -0
- package/files/templates/expo verse[D]/files/components/.gitkeep +0 -0
- package/files/templates/expo verse[D]/files/components/MainScreen.tsx +299 -0
- package/files/templates/expo verse[D]/files/components/Share.tsx +132 -0
- package/files/templates/expo verse[D]/files/components/ui/.gitkeep +0 -0
- package/files/templates/expo verse[D]/files/components/ui/dev.tsx +48 -0
- package/files/templates/expo verse[D]/files/constants/config.ts +30 -0
- package/files/templates/expo verse[D]/files/constants/theme.ts +18 -0
- package/files/templates/expo verse[D]/files/data/de.csv +219 -0
- package/files/templates/expo verse[D]/files/data/en.csv +219 -0
- package/files/templates/expo verse[D]/files/data/version.json +4 -0
- package/files/templates/expo verse[D]/files/eas.json +47 -0
- package/files/templates/expo verse[D]/files/eslint.config.mjs +185 -0
- package/files/templates/expo verse[D]/files/global.css +47 -0
- package/files/templates/expo verse[D]/files/hooks/useColorScheme.ts +17 -0
- package/files/templates/expo verse[D]/files/index.ts +28 -0
- package/files/templates/expo verse[D]/files/lib/content.ts +31 -0
- package/files/templates/expo verse[D]/files/lib/data.ts +180 -0
- package/files/templates/expo verse[D]/files/lib/helper.ts +54 -0
- package/files/templates/expo verse[D]/files/lib/index.ts +21 -0
- package/files/templates/expo verse[D]/files/lib/state.ts +128 -0
- package/files/templates/expo verse[D]/files/lib/storage.ts +17 -0
- package/files/templates/expo verse[D]/files/lib/taskManager/index.ts +38 -0
- package/files/templates/expo verse[D]/files/lib/taskManager/loadData.ts +14 -0
- package/files/templates/expo verse[D]/files/lib/utils/index.ts +11 -0
- package/files/templates/expo verse[D]/files/lib/utils/polyfills.ts +29 -0
- package/files/templates/expo verse[D]/files/lib/utils/screenshot.ts +77 -0
- package/files/templates/expo verse[D]/files/lucy.json +8 -0
- package/files/templates/expo verse[D]/files/metro.config.js +81 -0
- package/files/templates/expo verse[D]/files/models/index.ts +28 -0
- package/files/templates/expo verse[D]/files/nativewind-env.d.ts +1 -0
- package/files/templates/expo verse[D]/files/package.json +102 -0
- package/files/templates/expo verse[D]/files/pnpm-workspace.yaml +3 -0
- package/files/templates/expo verse[D]/files/scripts/convert-verses.ts +309 -0
- package/files/templates/expo verse[D]/files/scripts/move-artifacts.ts +83 -0
- package/files/templates/expo verse[D]/files/scripts/reset-project.ts +116 -0
- package/files/templates/expo verse[D]/files/tailwind.config.js +63 -0
- package/files/templates/expo verse[D]/files/tsconfig.json +45 -0
- package/files/templates/expo verse[D]/files/types/index.ts +4 -0
- package/files/templates/expo verse[D]/files/types/reset.d.ts +1 -0
- package/files/templates/expo verse[D]/lucy.json +86 -0
- package/files/templates/expo[D]/files/app.config.ts +69 -0
- package/files/templates/expo[D]/files/assets/fonts/SpaceMono-Regular.ttf +0 -0
- package/files/templates/expo[D]/files/scripts/reset-project.ts +0 -0
- package/files/templates/velo[D]/files/.yarnrc.yml +1 -2
- package/files/templates/velo[D]/lucy.json +1 -1
- package/mitarbeiter-login.html +188 -0
- package/old/index.ts +0 -0
- package/package.json +11 -11
- package/pnpm-workspace.yaml +6 -0
- package/src/args.ts +0 -1
- package/src/commands/exec.ts +22 -18
- package/src/commands/home.ts +36 -2
- package/src/commands/install.ts +41 -21
- package/src/index.ts +0 -0
- package/src/init/blocks.ts +2 -2
- package/src/init/cargo.ts +2 -2
- package/src/init/expo.ts +2 -2
- package/src/init/index.ts +7 -1
- package/src/init/monorepo.ts +2 -2
- package/src/init/tauri.ts +2 -2
- package/src/init/velo.ts +4 -3
- package/src/schemas/index.ts +2 -0
- package/src/schemas/lucy.ts +1 -1
@@ -0,0 +1,17 @@
|
|
1
|
+
import AsyncStorage from '@react-native-async-storage/async-storage';
|
2
|
+
import { Data, Effect } from 'effect';
|
3
|
+
|
4
|
+
export class StorageError extends Data.TaggedError('StorageError')<{
|
5
|
+
reason: string;
|
6
|
+
error: unknown;
|
7
|
+
}> {}
|
8
|
+
|
9
|
+
export const clearStorage = (key: string) => {
|
10
|
+
return Effect.gen(function* () {
|
11
|
+
yield* Effect.tryPromise({
|
12
|
+
try: () => AsyncStorage.removeItem(key),
|
13
|
+
catch: (error) => {
|
14
|
+
return new StorageError({ reason: 'Failed to clear storage', error });
|
15
|
+
}
|
16
|
+
});
|
17
|
+
});};
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import { Effect } from 'effect';
|
2
|
+
import * as BackgroundTask from 'expo-background-task';
|
3
|
+
import * as TaskManager from 'expo-task-manager';
|
4
|
+
|
5
|
+
import { BACKGROUND_TASK_IDENTIFIER, MINIMUM_INTERVAL } from '../../constants/config';
|
6
|
+
import { backgroundTask } from './loadData';
|
7
|
+
|
8
|
+
export let appLoadedResolver: (() => void) | null;
|
9
|
+
export const appLoaded = new Promise<void>((resolve) => {
|
10
|
+
appLoadedResolver = resolve;
|
11
|
+
});
|
12
|
+
|
13
|
+
|
14
|
+
export const initializeBackgroundTask = async (
|
15
|
+
innerAppMountedPromise: Promise<void>
|
16
|
+
) => {
|
17
|
+
// await TaskManager.unregisterAllTasksAsync();
|
18
|
+
TaskManager.defineTask(BACKGROUND_TASK_IDENTIFIER, async () => {
|
19
|
+
try {
|
20
|
+
await Effect.runPromise(backgroundTask(innerAppMountedPromise));
|
21
|
+
} catch (error) {
|
22
|
+
// eslint-disable-next-line no-console
|
23
|
+
console.error('Error in background task:', error);
|
24
|
+
}
|
25
|
+
});
|
26
|
+
// Register the task
|
27
|
+
if (!(await TaskManager.isTaskRegisteredAsync(BACKGROUND_TASK_IDENTIFIER))) {
|
28
|
+
await BackgroundTask.registerTaskAsync(BACKGROUND_TASK_IDENTIFIER, {
|
29
|
+
minimumInterval: MINIMUM_INTERVAL,
|
30
|
+
});
|
31
|
+
if (__DEV__) {
|
32
|
+
// eslint-disable-next-line no-console
|
33
|
+
console.info(
|
34
|
+
`Background task with ID: ${BACKGROUND_TASK_IDENTIFIER} registered`
|
35
|
+
);
|
36
|
+
}
|
37
|
+
}
|
38
|
+
};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { Effect } from 'effect';
|
2
|
+
|
3
|
+
import { loadData } from '../data';
|
4
|
+
|
5
|
+
|
6
|
+
export const backgroundTask = (ready: Promise<void>) => {
|
7
|
+
return Effect.gen(function* () {
|
8
|
+
yield* Effect.promise(() => ready);
|
9
|
+
yield* Effect.log('Loading data');
|
10
|
+
|
11
|
+
yield* loadData;
|
12
|
+
|
13
|
+
});
|
14
|
+
};
|
@@ -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,77 @@
|
|
1
|
+
import * as FileSystem from 'expo-file-system';
|
2
|
+
import { isAvailableAsync as isSharingAvailable, shareAsync, type SharingOptions } from 'expo-sharing';
|
3
|
+
import { captureScreen } from 'react-native-view-shot';
|
4
|
+
|
5
|
+
// Explicitly type the external functions to satisfy strict lint rules
|
6
|
+
const safeIsSharingAvailable: () => Promise<boolean> = (isSharingAvailable as unknown as () => Promise<boolean>);
|
7
|
+
const safeShareAsync: (url: string, options?: SharingOptions) => Promise<void> = (shareAsync as unknown as (url: string, options?: SharingOptions) => Promise<void>);
|
8
|
+
const safeCaptureScreen: (options: { format: 'png' | 'jpg'; quality: number; result: 'tmpfile' | 'base64' | 'data-uri' }) => Promise<string> = (captureScreen as unknown as (options: { format: 'png' | 'jpg'; quality: number; result: 'tmpfile' | 'base64' | 'data-uri' }) => Promise<string>);
|
9
|
+
|
10
|
+
/**
|
11
|
+
* Captures the current screen and opens the native share sheet.
|
12
|
+
* @param source - The source of the screenshot.
|
13
|
+
* @returns The screenshot URI.
|
14
|
+
*/
|
15
|
+
export async function shareCurrentScreen(source: string) {
|
16
|
+
try {
|
17
|
+
const isShareAvailable = await safeIsSharingAvailable();
|
18
|
+
if (!isShareAvailable) {
|
19
|
+
// eslint-disable-next-line no-console
|
20
|
+
console.warn('Native sharing is not available on this platform.');
|
21
|
+
|
22
|
+
return;
|
23
|
+
}
|
24
|
+
|
25
|
+
const uri = await safeCaptureScreen({
|
26
|
+
format: 'png',
|
27
|
+
quality: 1,
|
28
|
+
result: 'tmpfile',
|
29
|
+
});
|
30
|
+
|
31
|
+
if (!uri) {
|
32
|
+
// eslint-disable-next-line no-console
|
33
|
+
console.error('Failed to capture screen.');
|
34
|
+
|
35
|
+
return;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Build friendly file name, copy tmp file so share sheet shows it
|
39
|
+
const now = new Date();
|
40
|
+
const pad = (n: number) => n.toString().padStart(2, '0');
|
41
|
+
// Sanitize the provided reference to a filesystem-safe, non-empty slug
|
42
|
+
const base = (source ?? '').toString().trim().replace(/\s+/g, ' ');
|
43
|
+
const slugRaw = base.length > 0 ? base : 'Verse';
|
44
|
+
let slug = slugRaw.replace(/[^a-zA-Z0-9]+/g, '-').replace(/-+/g, '-').replace(/^-|-$/g, '');
|
45
|
+
if (slug.length === 0) slug = 'Verse';
|
46
|
+
if (slug.length > 50) slug = slug.slice(0, 50);
|
47
|
+
const filename = `Daily-Verse_${slug}_${now.getFullYear()}.${pad(now.getMonth() + 1)}.${pad(now.getDate())}.png`;
|
48
|
+
const destUri = `${FileSystem.cacheDirectory ?? ''}${filename}`;
|
49
|
+
let shareUri = uri;
|
50
|
+
try {
|
51
|
+
await FileSystem.copyAsync({ from: uri, to: destUri });
|
52
|
+
const info = await FileSystem.getInfoAsync(destUri);
|
53
|
+
if (info.exists) shareUri = destUri;
|
54
|
+
} catch {
|
55
|
+
// ignore, fall back to tmp uri
|
56
|
+
}
|
57
|
+
const options: SharingOptions = {
|
58
|
+
mimeType: 'image/png',
|
59
|
+
dialogTitle: 'Share Daily Verse',
|
60
|
+
UTI: 'public.png',
|
61
|
+
};
|
62
|
+
await safeShareAsync(shareUri, options);
|
63
|
+
// Cleanup copied file best-effort
|
64
|
+
if (shareUri === destUri) {
|
65
|
+
try {
|
66
|
+
await FileSystem.deleteAsync(destUri, { idempotent: true });
|
67
|
+
} catch {
|
68
|
+
// ignore
|
69
|
+
}
|
70
|
+
}
|
71
|
+
} catch (error) {
|
72
|
+
// eslint-disable-next-line no-console
|
73
|
+
console.error('Error capturing or sharing screenshot:', error);
|
74
|
+
}
|
75
|
+
}
|
76
|
+
|
77
|
+
|
@@ -0,0 +1,81 @@
|
|
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
|
+
// Enable source maps for debugging
|
22
|
+
minifierConfig: {
|
23
|
+
keep_fnames: true,
|
24
|
+
mangle: {
|
25
|
+
keep_fnames: true,
|
26
|
+
},
|
27
|
+
},
|
28
|
+
// Ensure source maps are generated for debugging
|
29
|
+
getTransformOptions: () => ({
|
30
|
+
transform: {
|
31
|
+
experimentalImportSupport: false,
|
32
|
+
inlineRequires: false,
|
33
|
+
},
|
34
|
+
}),
|
35
|
+
};
|
36
|
+
const assetExts = config.resolver.assetExts;
|
37
|
+
if (!assetExts.includes('csv')) {
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
39
|
+
assetExts.push('csv');
|
40
|
+
}
|
41
|
+
|
42
|
+
config.resolver = {
|
43
|
+
...resolver,
|
44
|
+
};
|
45
|
+
|
46
|
+
config.resolver.unstable_enablePackageExports = false;
|
47
|
+
// config.resolver.unstable_conditionsByPlatform = ['ios', 'android']
|
48
|
+
config.resolver.resolveRequest = (context, moduleName, platform) => {
|
49
|
+
if (platform === 'web') {
|
50
|
+
// Check if the module name is in our alias map
|
51
|
+
const alias = ALIASES_WEB[moduleName];
|
52
|
+
if (alias) {
|
53
|
+
// eslint-disable-next-line no-console
|
54
|
+
console.log(`Aliasing '${moduleName}' to '${alias}'`);
|
55
|
+
// If it is, resolve to the new path
|
56
|
+
|
57
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
58
|
+
return context.resolveRequest(context, alias, platform);
|
59
|
+
}
|
60
|
+
}
|
61
|
+
// Ensure you call the default resolver for everything else.
|
62
|
+
|
63
|
+
return context.resolveRequest(context, moduleName, platform);
|
64
|
+
};
|
65
|
+
|
66
|
+
config.resolver.extraNodeModules = {
|
67
|
+
...config.resolver.extraNodeModules,
|
68
|
+
...require('node-libs-react-native'),
|
69
|
+
// 'node:buffer': require.resolve('buffer/'),
|
70
|
+
// 'node:crypto': require.resolve('react-native-crypto/'),
|
71
|
+
// 'node:util': require.resolve('util/'),
|
72
|
+
// 'node:http': require.resolve('stream-http/'),
|
73
|
+
// 'node:https': require.resolve('https-browserify/'),
|
74
|
+
// 'node:events': require.resolve('events/'),
|
75
|
+
};
|
76
|
+
|
77
|
+
return config;
|
78
|
+
})();
|
79
|
+
// console.log('Using Metro config:', JSON.stringify(config, null, 2));
|
80
|
+
module.exports = withNativeWind(config, { input: './global.css' });
|
81
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { Schema } from 'effect';
|
2
|
+
|
3
|
+
export const versionSchema = Schema.Struct({
|
4
|
+
version: Schema.String,
|
5
|
+
languages: Schema.Array(Schema.String)
|
6
|
+
});
|
7
|
+
export type Version = typeof versionSchema.Type;
|
8
|
+
|
9
|
+
export const dataStateSchema = Schema.Struct({
|
10
|
+
index: Schema.Number,
|
11
|
+
date: Schema.DateTimeUtc,
|
12
|
+
lastUpdateCheck: Schema.DateTimeUtc,
|
13
|
+
language: Schema.String,
|
14
|
+
deviceLanguage: Schema.String,
|
15
|
+
version: Schema.String,
|
16
|
+
});
|
17
|
+
export type DataState = typeof dataStateSchema.Type;
|
18
|
+
|
19
|
+
|
20
|
+
export const quoteSchema = Schema.Struct({
|
21
|
+
Verse: Schema.String,
|
22
|
+
Reference: Schema.String,
|
23
|
+
Topic: Schema.String,
|
24
|
+
});
|
25
|
+
export type Quote = typeof quoteSchema.Type;
|
26
|
+
|
27
|
+
const schema = Schema.parseJson();
|
28
|
+
const decode = Schema.decodeUnknown(schema);
|
@@ -0,0 +1 @@
|
|
1
|
+
/// <reference types="nativewind/types" />
|
@@ -0,0 +1,102 @@
|
|
1
|
+
{
|
2
|
+
"name": "daily-verse",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"main": "index.ts",
|
5
|
+
"scripts": {
|
6
|
+
"start": "expo start --port=8082",
|
7
|
+
"android": "expo run:android --port=8082",
|
8
|
+
"ios": "expo run:ios --port=8082",
|
9
|
+
"web": "expo start --web --port=8082",
|
10
|
+
"dev": "expo start --port=8082",
|
11
|
+
"reset": "tsx ./scripts/reset-project.ts",
|
12
|
+
"format": "prettier --write \"./*.json\" \"**/*.{ts,tsx,md,json,jsonc,json5}\"",
|
13
|
+
"prebuild": "expo prebuild",
|
14
|
+
"pods": "npx pod-install",
|
15
|
+
"build:dev": "eas build --local --profile development && tsx ./scripts/move-artifacts.ts",
|
16
|
+
"build:sim": "eas build --local --profile ios-simulator && tsx ./scripts/move-artifacts.ts",
|
17
|
+
"build:prev": "eas build --local --profile preview && tsx ./scripts/move-artifacts.ts",
|
18
|
+
"build:prod": "eas build --local --profile production && tsx ./scripts/move-artifacts.ts",
|
19
|
+
"build:web": "expo export --platform web",
|
20
|
+
"doctor": "expo-doctor"
|
21
|
+
},
|
22
|
+
"dependencies": {
|
23
|
+
"@effect/platform": "^0.90.3",
|
24
|
+
"@expo/metro-runtime": "~5.0.4",
|
25
|
+
"@react-native-async-storage/async-storage": "2.1.2",
|
26
|
+
"@wix/data": "^1.0.269",
|
27
|
+
"@wix/sdk": "^1.15.24",
|
28
|
+
"class-variance-authority": "^0.7.1",
|
29
|
+
"clsx": "^2.1.1",
|
30
|
+
"effect": "^3.17.1",
|
31
|
+
"events": "^3.3.0",
|
32
|
+
"expo": "~53.0.22",
|
33
|
+
"expo-application": "~6.1.5",
|
34
|
+
"expo-asset": "~11.1.7",
|
35
|
+
"expo-background-task": "~0.2.8",
|
36
|
+
"expo-crypto": "~14.1.5",
|
37
|
+
"expo-dev-client": "~5.2.4",
|
38
|
+
"expo-file-system": "~18.1.11",
|
39
|
+
"expo-font": "~13.3.2",
|
40
|
+
"expo-haptics": "~14.1.4",
|
41
|
+
"expo-localization": "~16.1.6",
|
42
|
+
"expo-sharing": "~13.1.5",
|
43
|
+
"expo-splash-screen": "~0.30.10",
|
44
|
+
"expo-standard-web-crypto": "^2.1.4",
|
45
|
+
"expo-status-bar": "~2.2.3",
|
46
|
+
"expo-system-ui": "~5.0.11",
|
47
|
+
"expo-task-manager": "~13.1.6",
|
48
|
+
"expo-updates": "~0.28.17",
|
49
|
+
"nativewind": "^4.1.23",
|
50
|
+
"node-libs-react-native": "^1.2.1",
|
51
|
+
"papaparse": "^5.5.3",
|
52
|
+
"react": "19.0.0",
|
53
|
+
"react-dom": "19.0.0",
|
54
|
+
"react-native": "0.79.5",
|
55
|
+
"react-native-reanimated": "~3.17.4",
|
56
|
+
"react-native-safe-area-context": "5.4.0",
|
57
|
+
"react-native-svg": "^15.11.2",
|
58
|
+
"react-native-view-shot": "4.0.3",
|
59
|
+
"react-native-web": "^0.20.0",
|
60
|
+
"tailwind-merge": "^3.3.1",
|
61
|
+
"tailwindcss-animate": "^1.0.7",
|
62
|
+
"util": "^0.12.5"
|
63
|
+
},
|
64
|
+
"devDependencies": {
|
65
|
+
"@babel/core": "^7.25.2",
|
66
|
+
"@next/eslint-plugin-next": "^15.4.4",
|
67
|
+
"@react-native-community/cli": "^20.0.0",
|
68
|
+
"@styled/typescript-styled-plugin": "^1.0.1",
|
69
|
+
"@stylelint/postcss-css-in-js": "^0.38.0",
|
70
|
+
"@total-typescript/ts-reset": "^0.6.1",
|
71
|
+
"@types/node": "^24.2.0",
|
72
|
+
"@types/papaparse": "^5.3.16",
|
73
|
+
"@types/react": "~19.0.10",
|
74
|
+
"@typescript-eslint/parser": "^8.38.0",
|
75
|
+
"eslint": "^9.33.0",
|
76
|
+
"eslint-config-expo": "^9.2.0",
|
77
|
+
"eslint-config-prettier": "^10.1.8",
|
78
|
+
"eslint-plugin-jsdoc": "^51.4.1",
|
79
|
+
"eslint-plugin-named-import-spacing": "^1.0.3",
|
80
|
+
"eslint-plugin-only-warn": "^1.1.0",
|
81
|
+
"eslint-plugin-react": "^7.37.5",
|
82
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
83
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
84
|
+
"expo-doctor": "^1.13.5",
|
85
|
+
"prettier-plugin-tailwindcss": "^0.5.11",
|
86
|
+
"tailwindcss": "^3.4.17",
|
87
|
+
"ts-node": "^10.9.2",
|
88
|
+
"tsx": "^4.20.3",
|
89
|
+
"typescript": "~5.8.3",
|
90
|
+
"typescript-eslint": "^8.38.0",
|
91
|
+
"typescript-eslint-language-service": "^5.0.5"
|
92
|
+
},
|
93
|
+
"private": true,
|
94
|
+
"expo": {
|
95
|
+
"doctor": {
|
96
|
+
"reactNativeDirectoryCheck": {
|
97
|
+
"listUnknownPackages": false
|
98
|
+
}
|
99
|
+
}
|
100
|
+
},
|
101
|
+
"packageManager": "pnpm@10.14.0+sha1.85759954ad817d248e2fed7f789f046a24f0327d"
|
102
|
+
}
|