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.
Files changed (77) hide show
  1. package/README.md +5 -2
  2. package/package.json +1 -1
  3. package/src/generate.js +15 -2
  4. package/src/index.js +7 -1
  5. package/templates/mobile/expo/.env.example +2 -2
  6. package/templates/mobile/expo/README.md +31 -3
  7. package/templates/mobile/expo/_package.json +13 -15
  8. package/templates/mobile/expo/app.json +10 -2
  9. package/templates/mobile/expo/index.js +2 -0
  10. package/templates/mobile/expo/src/app/app-provider.tsx +7 -3
  11. package/templates/mobile/expo/src/app/config/translation.ts +7 -3
  12. package/templates/mobile/expo/src/assets/i18n/en.json +19 -3
  13. package/templates/mobile/expo/src/assets/i18n/fr.json +19 -3
  14. package/templates/mobile/expo/src/core/components/forms/date-time-picker.modal.tsx +116 -0
  15. package/templates/mobile/expo/src/core/components/forms/hf-date-time.tsx +2 -10
  16. package/templates/mobile/expo/src/core/components/forms/hf-time-picker.tsx +2 -3
  17. package/templates/mobile/expo/src/core/components/screen/screen-container/screen-container.tsx +25 -29
  18. package/templates/mobile/expo/src/core/components/ui/app-image/app-image.tsx +16 -19
  19. package/templates/mobile/expo/src/core/components/ui/app-image/app-image.type.ts +6 -6
  20. package/templates/mobile/expo/src/core/components/ui/avatar-image/avatar-image.tsx +1 -1
  21. package/templates/mobile/expo/src/core/components/ui/image-slider/image-slider.tsx +3 -3
  22. package/templates/mobile/expo/src/core/components/ui/screen/screen-gradient.tsx +1 -1
  23. package/templates/mobile/expo/src/core/components/ui/skeleton/skeleton.tsx +1 -1
  24. package/templates/mobile/expo/src/core/services/api.service.ts +3 -3
  25. package/templates/mobile/expo/src/core/services/device-id.service.ts +16 -2
  26. package/templates/mobile/expo/src/core/utils/device-locale.util.ts +10 -8
  27. package/templates/mobile/expo/src/core/utils/image-picker.util.ts +37 -58
  28. package/templates/mobile/expo/src/core/utils/query-persister.util.ts +16 -21
  29. package/templates/mobile/expo/src/modules/home/home.screen.tsx +97 -20
  30. package/templates/mobile/rn/.bundle/config +2 -0
  31. package/templates/mobile/rn/.watchmanconfig +1 -0
  32. package/templates/mobile/rn/Gemfile +17 -0
  33. package/templates/mobile/rn/README.md +34 -2
  34. package/templates/mobile/rn/_package.json +2 -0
  35. package/templates/mobile/rn/android/app/build.gradle +126 -0
  36. package/templates/mobile/rn/android/app/debug.keystore +0 -0
  37. package/templates/mobile/rn/android/app/proguard-rules.pro +10 -0
  38. package/templates/mobile/rn/android/app/src/main/AndroidManifest.xml +27 -0
  39. package/templates/mobile/rn/android/app/src/main/java/com/dumobile/MainActivity.kt +22 -0
  40. package/templates/mobile/rn/android/app/src/main/java/com/dumobile/MainApplication.kt +27 -0
  41. package/templates/mobile/rn/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
  42. package/templates/mobile/rn/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  43. package/templates/mobile/rn/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  44. package/templates/mobile/rn/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  45. package/templates/mobile/rn/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  46. package/templates/mobile/rn/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  47. package/templates/mobile/rn/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  48. package/templates/mobile/rn/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  49. package/templates/mobile/rn/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  50. package/templates/mobile/rn/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  51. package/templates/mobile/rn/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  52. package/templates/mobile/rn/android/app/src/main/res/values/strings.xml +3 -0
  53. package/templates/mobile/rn/android/app/src/main/res/values/styles.xml +9 -0
  54. package/templates/mobile/rn/android/build.gradle +21 -0
  55. package/templates/mobile/rn/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  56. package/templates/mobile/rn/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  57. package/templates/mobile/rn/android/gradle.properties +44 -0
  58. package/templates/mobile/rn/android/gradlew +248 -0
  59. package/templates/mobile/rn/android/gradlew.bat +98 -0
  60. package/templates/mobile/rn/android/settings.gradle +21 -0
  61. package/templates/mobile/rn/app.json +1 -1
  62. package/templates/mobile/rn/index.js +2 -0
  63. package/templates/mobile/rn/ios/.xcode.env +11 -0
  64. package/templates/mobile/rn/ios/DuMobile/AppDelegate.swift +48 -0
  65. package/templates/mobile/rn/ios/DuMobile/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  66. package/templates/mobile/rn/ios/DuMobile/Images.xcassets/Contents.json +6 -0
  67. package/templates/mobile/rn/ios/DuMobile/Info.plist +59 -0
  68. package/templates/mobile/rn/ios/DuMobile/LaunchScreen.storyboard +47 -0
  69. package/templates/mobile/rn/ios/DuMobile/PrivacyInfo.xcprivacy +37 -0
  70. package/templates/mobile/rn/ios/DuMobile.xcodeproj/project.pbxproj +475 -0
  71. package/templates/mobile/rn/ios/DuMobile.xcodeproj/xcshareddata/xcschemes/DuMobile.xcscheme +88 -0
  72. package/templates/mobile/rn/ios/Podfile +34 -0
  73. package/templates/mobile/rn/src/app/app-provider.tsx +19 -14
  74. package/templates/mobile/rn/src/app/config/translation.ts +3 -0
  75. package/templates/mobile/rn/src/assets/i18n/en.json +13 -3
  76. package/templates/mobile/rn/src/assets/i18n/fr.json +13 -3
  77. 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
- "greeting": "Bonjour, {{name}}",
5
- "loadError": "Échec du chargement.",
6
- "count": "{{n}} élément(s)"
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 { ActivityIndicator, StyleSheet, Text, View } from 'react-native';
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
- <View style={[styles.container, { backgroundColor: colors.bg_elevation_level_1_normal }]}>
16
- <Text style={[styles.title, { color: colors.fg_neutral_normal }]}>
17
- {t('home.greeting', { name: '{{PROJECT_NAME}}' })}
18
- </Text>
19
- {isLoading ? <ActivityIndicator color={colors.fg_primary_normal} /> : null}
20
- {isError ? (
21
- <Text style={{ color: colors.bd_danger_normal }}>{t('home.loadError')}</Text>
22
- ) : null}
23
- {data ? (
24
- <Text style={{ color: colors.fg_neutral_faded }}>{t('home.count', { n: data.length })}</Text>
25
- ) : null}
26
- </View>
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: { flex: 1, padding: 24, gap: 16 },
32
- title: { fontSize: 22, fontWeight: '600' },
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
  });