- App.tsx: full navigation (Auth stack + Main tabs with 5 screens) - Auth: LoginScreen, RegisterScreen, ForgotPasswordScreen - HomeScreen: dashboard with IoT metrics, weather widget, alerts, quick actions, sensors - MapScreen: interactive map with layer toggles (6 layers) - MarketplaceScreen: categories (6), products (5), search - ChatScreen: AI chat with quick prompts (4), bot responses - ProfileScreen: user info, stats, menu (9 items), logout - AlertsScreen: alert list with severity, acknowledge - SensorsScreen: sensor list with type filters (6 types), search - ZonesScreen: zone cards with stats - SettingsScreen: language picker (FR/EN/ES/DE), privacy, about - Stores: iotStore (sensors, zones, alerts), notificationStore, uiStore + i18n - Hooks: useSensors, useAlerts, useNotifications, useLocation - Components: Card, Button, LoadingSpinner, ErrorBoundary, Header - Services: iotService, notificationService (with axios API client) - Utils: formatters (temp, AQI, noise, dates), validators (email, password, IBAN) - Theme: colors.ts with full design system (Blue Ocean palette) - Ditto: fixed MongoDB connection, new JWT secrets, official gateway image
68 lines
3.4 KiB
Ruby
68 lines
3.4 KiB
Ruby
def try_to_parse_react_native_package_json(node_modules_dir)
|
|
react_native_package_json_path = File.join(node_modules_dir, 'react-native/package.json')
|
|
if !File.exist?(react_native_package_json_path)
|
|
return nil
|
|
end
|
|
return JSON.parse(File.read(react_native_package_json_path))
|
|
end
|
|
|
|
def find_config()
|
|
result = {
|
|
:is_reanimated_example_app => nil,
|
|
:react_native_version => nil,
|
|
:react_native_minor_version => nil,
|
|
:is_tvos_target => nil,
|
|
:react_native_node_modules_dir => nil,
|
|
:reanimated_node_modules_dir => nil,
|
|
:react_native_common_dir => nil,
|
|
}
|
|
|
|
react_native_node_modules_dir = File.join(File.dirname(`cd "#{Pod::Config.instance.installation_root.to_s}" && node --print "require.resolve('react-native/package.json')"`), '..')
|
|
react_native_json = try_to_parse_react_native_package_json(react_native_node_modules_dir)
|
|
|
|
if react_native_json == nil
|
|
# user configuration, just in case
|
|
node_modules_dir = ENV["REACT_NATIVE_NODE_MODULES_DIR"]
|
|
react_native_json = try_to_parse_react_native_package_json(node_modules_dir)
|
|
end
|
|
|
|
if react_native_json == nil
|
|
raise '[Reanimated] Unable to recognize your `react-native` version. Please set environmental variable with `react-native` location: `export REACT_NATIVE_NODE_MODULES_DIR="<path to react-native>" && pod install`.'
|
|
end
|
|
|
|
result[:is_reanimated_example_app] = ENV["REANIMATED_EXAMPLE_APP_NAME"] != nil
|
|
result[:is_tvos_target] = react_native_json['name'] == 'react-native-tvos'
|
|
result[:react_native_version] = react_native_json['version']
|
|
result[:react_native_minor_version] = react_native_json['version'].split('.')[1].to_i
|
|
if result[:react_native_minor_version] == 0 # nightly
|
|
result[:react_native_minor_version] = 1000
|
|
end
|
|
result[:react_native_node_modules_dir] = File.expand_path(react_native_node_modules_dir)
|
|
result[:reanimated_node_modules_dir] = File.expand_path(File.join(__dir__, '..', '..'))
|
|
|
|
pods_root = Pod::Config.instance.project_pods_root
|
|
react_native_common_dir_absolute = File.join(react_native_node_modules_dir, 'react-native', 'ReactCommon')
|
|
react_native_common_dir_relative = Pathname.new(react_native_common_dir_absolute).relative_path_from(pods_root).to_s
|
|
result[:react_native_common_dir] = react_native_common_dir_relative
|
|
|
|
return result
|
|
end
|
|
|
|
def assert_latest_react_native_with_new_architecture(config, reanimated_package_json)
|
|
reanimated_version = reanimated_package_json['version']
|
|
reanimated_major_version = reanimated_version.split('.')[0].to_i
|
|
react_native_minor_version = config[:react_native_minor_version]
|
|
fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
|
|
if fabric_enabled && reanimated_major_version == 3 && react_native_minor_version < 72
|
|
# If you change the minimal React Native version remember to update Compatibility Table in docs
|
|
raise "[Reanimated] Outdated version of React Native for New Architecture. Reanimated " + reanimated_version + " supports the New Architecture on React Native 0.72.0+. See https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#outdated-version-of-react-native-for-new-architecture for more information."
|
|
end
|
|
end
|
|
|
|
def assert_minimal_react_native_version(config)
|
|
if config[:react_native_minor_version] < 66
|
|
# If you change the minimal React Native version remember to update Compatibility Table in docs
|
|
raise "[Reanimated] Unsupported React Native version. Please use 0.66 or newer."
|
|
end
|
|
end
|