create-du-app 0.1.4 → 0.1.5
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 +5 -2
- package/package.json +1 -1
- package/src/generate.js +15 -2
- package/src/index.js +7 -1
- package/templates/mobile/expo/.env.example +2 -2
- package/templates/mobile/expo/README.md +31 -3
- package/templates/mobile/expo/_package.json +13 -15
- package/templates/mobile/expo/app.json +10 -2
- package/templates/mobile/expo/index.js +2 -0
- package/templates/mobile/expo/src/app/app-provider.tsx +7 -3
- package/templates/mobile/expo/src/app/config/translation.ts +7 -3
- package/templates/mobile/expo/src/assets/i18n/en.json +19 -3
- package/templates/mobile/expo/src/assets/i18n/fr.json +19 -3
- package/templates/mobile/expo/src/core/components/forms/date-time-picker.modal.tsx +116 -0
- package/templates/mobile/expo/src/core/components/forms/hf-date-time.tsx +2 -10
- package/templates/mobile/expo/src/core/components/forms/hf-time-picker.tsx +2 -3
- package/templates/mobile/expo/src/core/components/screen/screen-container/screen-container.tsx +25 -29
- package/templates/mobile/expo/src/core/components/ui/app-image/app-image.tsx +16 -19
- package/templates/mobile/expo/src/core/components/ui/app-image/app-image.type.ts +6 -6
- package/templates/mobile/expo/src/core/components/ui/avatar-image/avatar-image.tsx +1 -1
- package/templates/mobile/expo/src/core/components/ui/image-slider/image-slider.tsx +3 -3
- package/templates/mobile/expo/src/core/components/ui/screen/screen-gradient.tsx +1 -1
- package/templates/mobile/expo/src/core/components/ui/skeleton/skeleton.tsx +1 -1
- package/templates/mobile/expo/src/core/services/api.service.ts +3 -3
- package/templates/mobile/expo/src/core/services/device-id.service.ts +16 -2
- package/templates/mobile/expo/src/core/utils/device-locale.util.ts +10 -8
- package/templates/mobile/expo/src/core/utils/image-picker.util.ts +37 -58
- package/templates/mobile/expo/src/core/utils/query-persister.util.ts +16 -21
- package/templates/mobile/expo/src/modules/home/home.screen.tsx +97 -20
- package/templates/mobile/rn/.bundle/config +2 -0
- package/templates/mobile/rn/.watchmanconfig +1 -0
- package/templates/mobile/rn/Gemfile +17 -0
- package/templates/mobile/rn/README.md +34 -2
- package/templates/mobile/rn/_package.json +2 -0
- package/templates/mobile/rn/android/app/build.gradle +126 -0
- package/templates/mobile/rn/android/app/debug.keystore +0 -0
- package/templates/mobile/rn/android/app/proguard-rules.pro +10 -0
- package/templates/mobile/rn/android/app/src/main/AndroidManifest.xml +27 -0
- package/templates/mobile/rn/android/app/src/main/java/com/dumobile/MainActivity.kt +22 -0
- package/templates/mobile/rn/android/app/src/main/java/com/dumobile/MainApplication.kt +27 -0
- package/templates/mobile/rn/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
- package/templates/mobile/rn/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/templates/mobile/rn/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/templates/mobile/rn/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/templates/mobile/rn/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/templates/mobile/rn/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/templates/mobile/rn/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/templates/mobile/rn/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/templates/mobile/rn/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/templates/mobile/rn/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/templates/mobile/rn/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/templates/mobile/rn/android/app/src/main/res/values/strings.xml +3 -0
- package/templates/mobile/rn/android/app/src/main/res/values/styles.xml +9 -0
- package/templates/mobile/rn/android/build.gradle +21 -0
- package/templates/mobile/rn/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/templates/mobile/rn/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/templates/mobile/rn/android/gradle.properties +44 -0
- package/templates/mobile/rn/android/gradlew +248 -0
- package/templates/mobile/rn/android/gradlew.bat +98 -0
- package/templates/mobile/rn/android/settings.gradle +21 -0
- package/templates/mobile/rn/app.json +1 -1
- package/templates/mobile/rn/index.js +2 -0
- package/templates/mobile/rn/ios/.xcode.env +11 -0
- package/templates/mobile/rn/ios/DuMobile/AppDelegate.swift +48 -0
- package/templates/mobile/rn/ios/DuMobile/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- package/templates/mobile/rn/ios/DuMobile/Images.xcassets/Contents.json +6 -0
- package/templates/mobile/rn/ios/DuMobile/Info.plist +59 -0
- package/templates/mobile/rn/ios/DuMobile/LaunchScreen.storyboard +47 -0
- package/templates/mobile/rn/ios/DuMobile/PrivacyInfo.xcprivacy +37 -0
- package/templates/mobile/rn/ios/DuMobile.xcodeproj/project.pbxproj +475 -0
- package/templates/mobile/rn/ios/DuMobile.xcodeproj/xcshareddata/xcschemes/DuMobile.xcscheme +88 -0
- package/templates/mobile/rn/ios/Podfile +34 -0
- package/templates/mobile/rn/src/app/app-provider.tsx +19 -14
- package/templates/mobile/rn/src/app/config/translation.ts +3 -0
- package/templates/mobile/rn/src/assets/i18n/en.json +13 -3
- package/templates/mobile/rn/src/assets/i18n/fr.json +13 -3
- package/templates/mobile/rn/src/modules/home/home.screen.tsx +53 -19
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"home": {
|
|
3
3
|
"title": "Accueil",
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
4
|
+
"subtitle": "Votre starter mobile d'entreprise — basé sur le cœur partagé du monorepo.",
|
|
5
|
+
"features": {
|
|
6
|
+
"nav": { "title": "Navigation", "desc": "React Navigation — native-stack + onglets typés." },
|
|
7
|
+
"data": { "title": "Réseau", "desc": "Client Axios + React Query, cache hors-ligne via MMKV." },
|
|
8
|
+
"i18n": { "title": "i18n", "desc": "react-i18next avec la langue de l'appareil (en / fr)." },
|
|
9
|
+
"theme": { "title": "Thème", "desc": "Contexte de thème + design tokens (sombre / clair)." },
|
|
10
|
+
"forms": { "title": "Formulaires", "desc": "react-hook-form sur les champs du design-system." },
|
|
11
|
+
"ui": { "title": "Kit UI", "desc": "Boutons, champs, modales, onglets, skeletons, etc." },
|
|
12
|
+
"state": { "title": "State", "desc": "Stores Zustand (auth, loading) + AsyncStorage." },
|
|
13
|
+
"shared": { "title": "@repo/shared", "desc": "Types, enums et contrats d'API partagés entre apps." }
|
|
14
|
+
},
|
|
15
|
+
"footer": "Modifiez src/modules/home pour l'adapter.",
|
|
16
|
+
"loadError": "Échec du chargement."
|
|
7
17
|
},
|
|
8
18
|
"profile": {
|
|
9
19
|
"title": "Profil",
|
|
@@ -1,33 +1,67 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ScrollView, StyleSheet, Text, View } from 'react-native';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
// Example feature API (React Query) — demonstrates the ApiService + @repo/shared
|
|
5
|
-
// ApiEndpoints pattern. Copy core/api/example.api.ts per feature.
|
|
6
|
-
import { useExampleList } from '@src/core/api';
|
|
7
4
|
import { useTheme } from '@src/core/theme';
|
|
8
5
|
|
|
6
|
+
// What's inside the starter — rendered as the landing screen so a fresh
|
|
7
|
+
// generate is self-documenting. Replace this with your real home feature.
|
|
8
|
+
const FEATURES = [
|
|
9
|
+
{ key: 'nav', icon: '🧭' },
|
|
10
|
+
{ key: 'data', icon: '🔌' },
|
|
11
|
+
{ key: 'i18n', icon: '🌐' },
|
|
12
|
+
{ key: 'theme', icon: '🎨' },
|
|
13
|
+
{ key: 'forms', icon: '📝' },
|
|
14
|
+
{ key: 'ui', icon: '🧩' },
|
|
15
|
+
{ key: 'state', icon: '📦' },
|
|
16
|
+
{ key: 'shared', icon: '🔗' },
|
|
17
|
+
] as const;
|
|
18
|
+
|
|
9
19
|
export function HomeScreen() {
|
|
10
20
|
const { t } = useTranslation();
|
|
11
21
|
const { colors } = useTheme();
|
|
12
|
-
const { data, isLoading, isError } = useExampleList();
|
|
13
22
|
|
|
14
23
|
return (
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
</Text>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
<ScrollView
|
|
25
|
+
style={{ backgroundColor: colors.bg_elevation_level_1_normal }}
|
|
26
|
+
contentContainerStyle={styles.container}>
|
|
27
|
+
<Text style={[styles.title, { color: colors.fg_neutral_normal }]}>{'{{PROJECT_NAME}}'}</Text>
|
|
28
|
+
<Text style={[styles.subtitle, { color: colors.fg_neutral_faded }]}>{t('home.subtitle')}</Text>
|
|
29
|
+
|
|
30
|
+
<View style={styles.list}>
|
|
31
|
+
{FEATURES.map(f => (
|
|
32
|
+
<View
|
|
33
|
+
key={f.key}
|
|
34
|
+
style={[
|
|
35
|
+
styles.card,
|
|
36
|
+
{ backgroundColor: colors.bg_elevation_level_2_normal, borderColor: colors.bd_neutral_faded },
|
|
37
|
+
]}>
|
|
38
|
+
<Text style={styles.icon}>{f.icon}</Text>
|
|
39
|
+
<View style={styles.cardText}>
|
|
40
|
+
<Text style={[styles.cardTitle, { color: colors.fg_neutral_normal }]}>
|
|
41
|
+
{t(`home.features.${f.key}.title`)}
|
|
42
|
+
</Text>
|
|
43
|
+
<Text style={[styles.cardDesc, { color: colors.fg_neutral_faded }]}>
|
|
44
|
+
{t(`home.features.${f.key}.desc`)}
|
|
45
|
+
</Text>
|
|
46
|
+
</View>
|
|
47
|
+
</View>
|
|
48
|
+
))}
|
|
49
|
+
</View>
|
|
50
|
+
|
|
51
|
+
<Text style={[styles.footer, { color: colors.fg_neutral_faded }]}>{t('home.footer')}</Text>
|
|
52
|
+
</ScrollView>
|
|
27
53
|
);
|
|
28
54
|
}
|
|
29
55
|
|
|
30
56
|
const styles = StyleSheet.create({
|
|
31
|
-
container: {
|
|
32
|
-
title: { fontSize:
|
|
57
|
+
container: { padding: 20, paddingBottom: 40, gap: 8 },
|
|
58
|
+
title: { fontSize: 28, fontWeight: '700' },
|
|
59
|
+
subtitle: { fontSize: 15, marginBottom: 16, lineHeight: 21 },
|
|
60
|
+
list: { gap: 12 },
|
|
61
|
+
card: { flexDirection: 'row', gap: 14, padding: 16, borderRadius: 16, borderWidth: 1 },
|
|
62
|
+
icon: { fontSize: 24 },
|
|
63
|
+
cardText: { flex: 1, gap: 4 },
|
|
64
|
+
cardTitle: { fontSize: 16, fontWeight: '600' },
|
|
65
|
+
cardDesc: { fontSize: 13, lineHeight: 19 },
|
|
66
|
+
footer: { fontSize: 13, marginTop: 20, textAlign: 'center', fontStyle: 'italic' },
|
|
33
67
|
});
|