Files
Eric FELIXINE e30ae8ed09 feat(smart-app): implement complete mobile app MVP
- 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
2026-06-01 18:00:35 -04:00

110 lines
3.4 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true,
});
exports.default = loadMetroConfig;
var _metroPlatformResolver = require("./metroPlatformResolver");
var _cliTools = require("@react-native-community/cli-tools");
var _metroConfig = require("metro-config");
var _path = _interopRequireDefault(require("path"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
* @oncall react_native
*/
/**
* Get the config options to override based on RN CLI inputs.
*/
function getOverrideConfig(ctx, config) {
const outOfTreePlatforms = Object.keys(ctx.platforms).filter(
(platform) => ctx.platforms[platform].npmPackageName
);
const resolver = {
platforms: [...Object.keys(ctx.platforms), "native"],
};
if (outOfTreePlatforms.length) {
resolver.resolveRequest = (0,
_metroPlatformResolver.reactNativePlatformResolver)(
outOfTreePlatforms.reduce((result, platform) => {
result[platform] = ctx.platforms[platform].npmPackageName;
return result;
}, {}),
config.resolver?.resolveRequest
);
}
return {
resolver,
serializer: {
// We can include multiple copies of InitializeCore here because metro will
// only add ones that are already part of the bundle
getModulesRunBeforeMainModule: () => [
require.resolve(
_path.default.join(
ctx.reactNativePath,
"Libraries/Core/InitializeCore"
),
{
paths: [ctx.root],
}
),
...outOfTreePlatforms.map((platform) =>
require.resolve(
`${ctx.platforms[platform].npmPackageName}/Libraries/Core/InitializeCore`,
{
paths: [ctx.root],
}
)
),
],
},
};
}
/**
* Load Metro config.
*
* Allows the CLI to override select values in `metro.config.js` based on
* dynamic user options in `ctx`.
*/
async function loadMetroConfig(ctx, options = {}) {
const cwd = ctx.root;
const projectConfig = await (0, _metroConfig.resolveConfig)(
options.config,
cwd
);
if (projectConfig.isEmpty) {
throw new _cliTools.CLIError(`No Metro config found in ${cwd}`);
}
_cliTools.logger.debug(`Reading Metro config from ${projectConfig.filepath}`);
if (!global.__REACT_NATIVE_METRO_CONFIG_LOADED) {
for (const line of `
=================================================================================================
From React Native 0.73, your project's Metro config should extend '@react-native/metro-config'
or it will fail to build. Please copy the template at:
https://github.com/facebook/react-native/blob/main/packages/react-native/template/metro.config.js
This warning will be removed in future (https://github.com/facebook/metro/issues/1018).
=================================================================================================
`
.trim()
.split("\n")) {
_cliTools.logger.warn(line);
}
}
const config = await (0, _metroConfig.loadConfig)({
cwd,
...options,
});
const overrideConfig = getOverrideConfig(ctx, config);
return (0, _metroConfig.mergeConfig)(config, overrideConfig);
}