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
This commit is contained in:
Eric FELIXINE
2026-06-01 18:00:35 -04:00
parent 08ca495bde
commit e30ae8ed09
35578 changed files with 3703534 additions and 43 deletions

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2018 react-native-community
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,190 @@
# @react-native-community/cli-platform-ios
This package is part of the [React Native CLI](../../README.md). It contains commands for managing iOS part of React Native app.
## Installation
```sh
yarn add @react-native-community/cli-platform-ios
```
## Commands
### `run-ios`
Usage:
```sh
npx react-native run-ios [options]
```
Builds your app and starts it on iOS simulator.
#### Options
#### `--simulator <simulator_name>`
> default: iPhone 14
Explicitly set the simulator to use. Optionally include iOS version between parenthesis at the end to match an exact version, e.g. `"iPhone 6 (10.0)"`.
Notes: If selected simulator does not exist, cli will try to run fallback simulators in following order:
- `iPhone 14`
- `iPhone 13`
- `iPhone 12`
- `iPhone 11`
Notes: `simulator_name` must be a valid iOS simulator name. If in doubt, open your AwesomeApp/ios/AwesomeApp.xcodeproj folder on XCode and unroll the dropdown menu containing the simulator list. The dropdown menu is situated on the right hand side of the play button (top left corner).
Example: this will launch your project directly onto the iPhone 14 simulator:
```sh
npx react-native run-ios --simulator "iPhone 14"
```
#### `--mode <string>`
Explicitly set the scheme configuration to use. This option is case sensitive.
Example:
```sh
npx react-native run-ios --mode "Release"
```
#### `--scheme <string>`
Explicitly set Xcode scheme to use.
#### `--target <string>`
Explicitly set Xcode target to use.
#### `--device [string]`
Explicitly set device to use by name. The value is not required if you have a single device connected.
#### `--destination <string>`
Explicitly extend destination e.g. "arch=x86_64"
#### `--udid <string>`
Explicitly set device to use by udid.
#### `--no-packager`
Do not launch packager while building.
#### `--verbose`
Do not use `xcbeautify` or `xcpretty` even if installed.
#### `--port <number>`
Runs packager on specified port.
Default: `process.env.RCT_METRO_PORT || 8081`
#### `--xcconfig <string>`
Explicitly set `xcconfig` to use in build.
#### `--buildFolder <string>`
Location for iOS build artifacts. Corresponds to Xcode's `-derivedDataPath`.
#### `--extra-params <string>`
Custom params that will be passed to `xcodebuild` command.
Example:
```sh
npx react-native run-ios --extra-params "-jobs 4"
```
#### `--binary-path <path>`
Installs passed binary instead of building a fresh one.
#### `--list-devices`
> default: false
List all available iOS devices and simulators and let you choose one to run the app.
#### `--force-pods`,
Force running `pod install` before running an app
### `build-ios`
Usage:
```sh
npx react-native build-ios [options]
```
Builds iOS app.
#### Options
#### `--mode <string>`
Explicitly set the scheme configuration to use. This option is case sensitive.
Example:
```sh
npx react-native build-ios --mode "Release"
```
#### `--scheme <string>`
Explicitly set Xcode scheme to use.
#### `--target <string>`
Explicitly set Xcode target to use.
#### `--verbose`
Do not use `xcbeautify` or `xcpretty` even if installed.
#### `--xcconfig <string>`
Explicitly pass `xcconfig` options from the command line.
#### `--buildFolder <string>`
Location for iOS build artifacts. Corresponds to Xcode's `-derivedDataPath`.
#### `--extra-params <string>`
Custom params that will be passed to `xcodebuild` command.
Example:
```sh
npx react-native build-ios --extra-params "-jobs 4"
```
#### `--force-pods`,
Force running `pod install` before building an app
### `log-ios`
Usage:
```sh
npx react-native log-ios
```
Starts iOS device syslog tail.
#### Options
#### `--interactive`
Explicitly select simulator to tail logs from. By default it will tail logs from the first booted and available simulator.

View File

@@ -0,0 +1,27 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
declare const _default: {
name: string;
description: string;
func: (_: string[], ctx: import("@react-native-community/cli-types").Config, args: import("@react-native-community/cli-platform-apple/build/commands/buildCommand/buildOptions").BuildFlags) => Promise<string>;
examples: {
desc: string;
cmd: string;
}[];
options: ({
name: string;
description: string;
parse?: undefined;
} | {
name: string;
description: string;
parse: (val: string) => string[];
})[];
};
export default _default;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/buildIOS/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;AAOH,wBAWE"}

View File

@@ -0,0 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _cliPlatformApple() {
const data = require("@react-native-community/cli-platform-apple");
_cliPlatformApple = function () {
return data;
};
return data;
}
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
var _default = {
name: 'build-ios',
description: 'builds your app for iOS platform',
func: (0, _cliPlatformApple().createBuild)({
platformName: 'ios'
}),
examples: [{
desc: 'Build the app for all iOS devices in Release mode',
cmd: 'npx react-native build-ios --mode "Release"'
}],
options: (0, _cliPlatformApple().getBuildOptions)({
platformName: 'ios'
})
};
exports.default = _default;
//# sourceMappingURL=index.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["name","description","func","createBuild","platformName","examples","desc","cmd","options","getBuildOptions"],"sources":["../../../src/commands/buildIOS/index.ts"],"sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport {\n getBuildOptions,\n createBuild,\n} from '@react-native-community/cli-platform-apple';\n\nexport default {\n name: 'build-ios',\n description: 'builds your app for iOS platform',\n func: createBuild({platformName: 'ios'}),\n examples: [\n {\n desc: 'Build the app for all iOS devices in Release mode',\n cmd: 'npx react-native build-ios --mode \"Release\"',\n },\n ],\n options: getBuildOptions({platformName: 'ios'}),\n};\n"],"mappings":";;;;;;AAQA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AARA;AACA;AACA;AACA;AACA;AACA;AACA;AANA,eAae;EACbA,IAAI,EAAE,WAAW;EACjBC,WAAW,EAAE,kCAAkC;EAC/CC,IAAI,EAAE,IAAAC,+BAAW,EAAC;IAACC,YAAY,EAAE;EAAK,CAAC,CAAC;EACxCC,QAAQ,EAAE,CACR;IACEC,IAAI,EAAE,mDAAmD;IACzDC,GAAG,EAAE;EACP,CAAC,CACF;EACDC,OAAO,EAAE,IAAAC,mCAAe,EAAC;IAACL,YAAY,EAAE;EAAK,CAAC;AAChD,CAAC;AAAA"}

View File

@@ -0,0 +1,57 @@
declare const _default: ({
name: string;
description: string;
func: (_: string[], ctx: import("@react-native-community/cli-types").Config, args: {
interactive: boolean;
}) => Promise<void>;
options: {
name: string;
description: string;
}[];
} | {
name: string;
description: string;
func: (_: string[], ctx: import("@react-native-community/cli-types").Config, args: import("@react-native-community/cli-platform-apple/build/commands/runCommand/createRun").FlagsT) => Promise<void>;
examples: {
desc: string;
cmd: string;
}[];
options: (false | {
name: string;
description: string;
parse?: undefined;
} | {
name: string;
description: string;
parse: (val: string) => string[];
} | {
name: string;
default: string | number;
parse: NumberConstructor;
description?: undefined;
} | {
name: string;
description: string;
default: string | undefined;
parse?: undefined;
})[];
} | {
name: string;
description: string;
func: (_: string[], ctx: import("@react-native-community/cli-types").Config, args: import("@react-native-community/cli-platform-apple/build/commands/buildCommand/buildOptions").BuildFlags) => Promise<string>;
examples: {
desc: string;
cmd: string;
}[];
options: ({
name: string;
description: string;
parse?: undefined;
} | {
name: string;
description: string;
parse: (val: string) => string[];
})[];
})[];
export default _default;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,wBAA0C"}

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _logIOS = _interopRequireDefault(require("./logIOS"));
var _runIOS = _interopRequireDefault(require("./runIOS"));
var _buildIOS = _interopRequireDefault(require("./buildIOS"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = [_logIOS.default, _runIOS.default, _buildIOS.default];
exports.default = _default;
//# sourceMappingURL=index.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["logIOS","runIOS","buildIOS"],"sources":["../../src/commands/index.ts"],"sourcesContent":["import logIOS from './logIOS';\nimport runIOS from './runIOS';\nimport buildIOS from './buildIOS';\n\nexport default [logIOS, runIOS, buildIOS];\n"],"mappings":";;;;;;AAAA;AACA;AACA;AAAkC;AAAA,eAEnB,CAACA,eAAM,EAAEC,eAAM,EAAEC,iBAAQ,CAAC;AAAA"}

View File

@@ -0,0 +1,20 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
declare const _default: {
name: string;
description: string;
func: (_: string[], ctx: import("@react-native-community/cli-types").Config, args: {
interactive: boolean;
}) => Promise<void>;
options: {
name: string;
description: string;
}[];
};
export default _default;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/logIOS/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;;;;;;;;;;;AAOH,wBAKE"}

View File

@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _cliPlatformApple() {
const data = require("@react-native-community/cli-platform-apple");
_cliPlatformApple = function () {
return data;
};
return data;
}
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
var _default = {
name: 'log-ios',
description: 'starts iOS device syslog tail',
func: (0, _cliPlatformApple().createLog)({
platformName: 'ios'
}),
options: (0, _cliPlatformApple().getLogOptions)({
platformName: 'ios'
})
};
exports.default = _default;
//# sourceMappingURL=index.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["name","description","func","createLog","platformName","options","getLogOptions"],"sources":["../../../src/commands/logIOS/index.ts"],"sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport {\n createLog,\n getLogOptions,\n} from '@react-native-community/cli-platform-apple';\n\nexport default {\n name: 'log-ios',\n description: 'starts iOS device syslog tail',\n func: createLog({platformName: 'ios'}),\n options: getLogOptions({platformName: 'ios'}),\n};\n"],"mappings":";;;;;;AAQA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AARA;AACA;AACA;AACA;AACA;AACA;AACA;AANA,eAae;EACbA,IAAI,EAAE,SAAS;EACfC,WAAW,EAAE,+BAA+B;EAC5CC,IAAI,EAAE,IAAAC,6BAAS,EAAC;IAACC,YAAY,EAAE;EAAK,CAAC,CAAC;EACtCC,OAAO,EAAE,IAAAC,iCAAa,EAAC;IAACF,YAAY,EAAE;EAAK,CAAC;AAC9C,CAAC;AAAA"}

View File

@@ -0,0 +1,37 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
declare const _default: {
name: string;
description: string;
func: (_: string[], ctx: import("@react-native-community/cli-types").Config, args: import("@react-native-community/cli-platform-apple/build/commands/runCommand/createRun").FlagsT) => Promise<void>;
examples: {
desc: string;
cmd: string;
}[];
options: (false | {
name: string;
description: string;
parse?: undefined;
} | {
name: string;
description: string;
parse: (val: string) => string[];
} | {
name: string;
default: string | number;
parse: NumberConstructor;
description?: undefined;
} | {
name: string;
description: string;
default: string | undefined;
parse?: undefined;
})[];
};
export default _default;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/runIOS/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOH,wBAmBE"}

View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _cliPlatformApple() {
const data = require("@react-native-community/cli-platform-apple");
_cliPlatformApple = function () {
return data;
};
return data;
}
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
var _default = {
name: 'run-ios',
description: 'builds your app and starts it on iOS simulator',
func: (0, _cliPlatformApple().createRun)({
platformName: 'ios'
}),
examples: [{
desc: 'Run on a different simulator, e.g. iPhone SE (2nd generation)',
cmd: 'npx react-native run-ios --simulator "iPhone SE (2nd generation)"'
}, {
desc: "Run on a connected device, e.g. Max's iPhone",
cmd: 'npx react-native run-ios --device "Max\'s iPhone"'
}, {
desc: 'Run on the AppleTV simulator',
cmd: 'npx react-native run-ios --simulator "Apple TV" --scheme "helloworld-tvOS"'
}],
options: (0, _cliPlatformApple().getRunOptions)({
platformName: 'ios'
})
};
exports.default = _default;
//# sourceMappingURL=index.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["name","description","func","createRun","platformName","examples","desc","cmd","options","getRunOptions"],"sources":["../../../src/commands/runIOS/index.ts"],"sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport {\n createRun,\n getRunOptions,\n} from '@react-native-community/cli-platform-apple';\n\nexport default {\n name: 'run-ios',\n description: 'builds your app and starts it on iOS simulator',\n func: createRun({platformName: 'ios'}),\n examples: [\n {\n desc: 'Run on a different simulator, e.g. iPhone SE (2nd generation)',\n cmd: 'npx react-native run-ios --simulator \"iPhone SE (2nd generation)\"',\n },\n {\n desc: \"Run on a connected device, e.g. Max's iPhone\",\n cmd: 'npx react-native run-ios --device \"Max\\'s iPhone\"',\n },\n {\n desc: 'Run on the AppleTV simulator',\n cmd: 'npx react-native run-ios --simulator \"Apple TV\" --scheme \"helloworld-tvOS\"',\n },\n ],\n options: getRunOptions({platformName: 'ios'}),\n};\n"],"mappings":";;;;;;AAQA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AARA;AACA;AACA;AACA;AACA;AACA;AACA;AANA,eAae;EACbA,IAAI,EAAE,SAAS;EACfC,WAAW,EAAE,gDAAgD;EAC7DC,IAAI,EAAE,IAAAC,6BAAS,EAAC;IAACC,YAAY,EAAE;EAAK,CAAC,CAAC;EACtCC,QAAQ,EAAE,CACR;IACEC,IAAI,EAAE,+DAA+D;IACrEC,GAAG,EAAE;EACP,CAAC,EACD;IACED,IAAI,EAAE,8CAA8C;IACpDC,GAAG,EAAE;EACP,CAAC,EACD;IACED,IAAI,EAAE,8BAA8B;IACpCC,GAAG,EAAE;EACP,CAAC,CACF;EACDC,OAAO,EAAE,IAAAC,iCAAa,EAAC;IAACL,YAAY,EAAE;EAAK,CAAC;AAC9C,CAAC;AAAA"}

View File

@@ -0,0 +1,3 @@
export declare const dependencyConfig: (folder: string, userConfig?: import("@react-native-community/cli-types").IOSDependencyParams | null | undefined) => import("@react-native-community/cli-types").IOSDependencyConfig | null;
export declare const projectConfig: (folder: string, userConfig: import("@react-native-community/cli-types").IOSProjectParams) => import("@react-native-community/cli-types").IOSProjectConfig | null;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,6LAA6C,CAAC;AAC3E,eAAO,MAAM,aAAa,mKAA0C,CAAC"}

View File

@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.projectConfig = exports.dependencyConfig = void 0;
function _cliPlatformApple() {
const data = require("@react-native-community/cli-platform-apple");
_cliPlatformApple = function () {
return data;
};
return data;
}
const dependencyConfig = (0, _cliPlatformApple().getDependencyConfig)({
platformName: 'ios'
});
exports.dependencyConfig = dependencyConfig;
const projectConfig = (0, _cliPlatformApple().getProjectConfig)({
platformName: 'ios'
});
exports.projectConfig = projectConfig;
//# sourceMappingURL=index.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["dependencyConfig","getDependencyConfig","platformName","projectConfig","getProjectConfig"],"sources":["../../src/config/index.ts"],"sourcesContent":["import {\n getDependencyConfig,\n getProjectConfig,\n} from '@react-native-community/cli-platform-apple';\n\nexport const dependencyConfig = getDependencyConfig({platformName: 'ios'});\nexport const projectConfig = getProjectConfig({platformName: 'ios'});\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAKO,MAAMA,gBAAgB,GAAG,IAAAC,uCAAmB,EAAC;EAACC,YAAY,EAAE;AAAK,CAAC,CAAC;AAAC;AACpE,MAAMC,aAAa,GAAG,IAAAC,oCAAgB,EAAC;EAACF,YAAY,EAAE;AAAK,CAAC,CAAC;AAAC"}

View File

@@ -0,0 +1,7 @@
/**
* iOS platform files
*/
export { default as commands } from './commands';
export { findPodfilePaths, getArchitecture, installPods, } from '@react-native-community/cli-platform-apple';
export { dependencyConfig, projectConfig } from './config';
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAC,OAAO,IAAI,QAAQ,EAAC,MAAM,YAAY,CAAC;AAE/C,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,WAAW,GACZ,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAC,gBAAgB,EAAE,aAAa,EAAC,MAAM,UAAU,CAAC"}

View File

@@ -0,0 +1,53 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "commands", {
enumerable: true,
get: function () {
return _commands.default;
}
});
Object.defineProperty(exports, "dependencyConfig", {
enumerable: true,
get: function () {
return _config.dependencyConfig;
}
});
Object.defineProperty(exports, "findPodfilePaths", {
enumerable: true,
get: function () {
return _cliPlatformApple().findPodfilePaths;
}
});
Object.defineProperty(exports, "getArchitecture", {
enumerable: true,
get: function () {
return _cliPlatformApple().getArchitecture;
}
});
Object.defineProperty(exports, "installPods", {
enumerable: true,
get: function () {
return _cliPlatformApple().installPods;
}
});
Object.defineProperty(exports, "projectConfig", {
enumerable: true,
get: function () {
return _config.projectConfig;
}
});
var _commands = _interopRequireDefault(require("./commands"));
function _cliPlatformApple() {
const data = require("@react-native-community/cli-platform-apple");
_cliPlatformApple = function () {
return data;
};
return data;
}
var _config = require("./config");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
//# sourceMappingURL=index.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * iOS platform files\n */\n\nexport {default as commands} from './commands';\n\nexport {\n findPodfilePaths,\n getArchitecture,\n installPods,\n} from '@react-native-community/cli-platform-apple';\n\nexport {dependencyConfig, projectConfig} from './config';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAMA;AAAyD"}

View File

@@ -0,0 +1,158 @@
# This is a function which is used inside your Podfile.
#
# It uses `react-native config` to grab a list of dependencies, and pulls out
# all of the ones which declare themselves to be iOS/macOS dependencies (by
# virtue of having a Podspec) and automatically imports those into your current
# target.
#
# See the `IOSNativeModulesConfig` interface in `cli-types/src/ios.ts` to
# understand what the input data should look like. Be sure to update that file
# in lock-step with additional data being used here.
require 'pathname'
require 'cocoapods'
def use_native_modules!(config = nil)
if (config.is_a? String)
Pod::UI.warn("Passing custom root to use_native_modules! is deprecated.",
[
"CLI detects root of the project automatically. The \"#{config}\" argument was ignored.",
]);
config = nil;
end
# Resolving the path the RN CLI. The `@react-native-community/cli` module may not be there for certain package managers, so we fall back to resolving it through `react-native` package, that's always present in RN projects
cli_resolve_script = "try {console.log(require('@react-native-community/cli').bin);} catch (e) {console.log(require('react-native/cli').bin);}"
cli_bin = Pod::Executable.execute_command("node", ["-e", cli_resolve_script], true).strip
if (!config)
json = []
IO.popen(["node", cli_bin, "config"]) do |data|
while line = data.gets
json << line
end
end
config = JSON.parse(json.join("\n"))
end
project_root = Pathname.new(config["project"]["ios"]["sourceDir"])
packages = config["dependencies"]
found_pods = []
packages.each do |package_name, package|
next unless package_config = package["platforms"]["ios"]
podspec_path = package_config["podspecPath"]
configurations = package_config["configurations"]
# Add a warning to the queue and continue to the next dependency if the podspec_path is nil/empty
if podspec_path.nil? || podspec_path.empty?
Pod::UI.warn("use_native_modules! skipped the react-native dependency '#{package["name"]}'. No podspec file was found.",
[
"Check to see if there is an updated version that contains the necessary podspec file",
"Contact the library maintainers or send them a PR to add a podspec. The react-native-webview podspec is a good example of a package.json driven podspec. See https://github.com/react-native-community/react-native-webview/blob/master/react-native-webview.podspec",
"If necessary, you can disable autolinking for the dependency and link it manually. See https://github.com/react-native-community/cli/blob/main/docs/autolinking.md#how-can-i-disable-autolinking-for-unsupported-library"
])
end
next if podspec_path.nil? || podspec_path.empty?
spec = Pod::Specification.from_file(podspec_path)
# Skip pods that do not support the platform of the current target.
if platform = current_target_definition.platform
next unless spec.supported_on_platform?(platform.name)
else
# TODO: In a future RN version we should update the Podfile template and
# enable this assertion.
#
# raise Pod::Informative, "Cannot invoke `use_native_modules!` before defining the supported `platform`"
end
# We want to do a look up inside the current CocoaPods target
# to see if it's already included, this:
# 1. Gives you the chance to define it beforehand
# 2. Ensures CocoaPods won't explode if it's included twice
#
this_target = current_target_definition
existing_deps = current_target_definition.dependencies
# Skip dependencies that the user already activated themselves.
next if existing_deps.find do |existing_dep|
existing_dep.name.split('/').first == spec.name
end
podspec_dir_path = Pathname.new(File.dirname(podspec_path))
relative_path = podspec_dir_path.relative_path_from project_root
pod spec.name, :path => relative_path.to_path, :configurations => configurations
if package_config["scriptPhases"] && !this_target.abstract?
# Can be either an object, or an array of objects
Array(package_config["scriptPhases"]).each do |phase|
# see https://www.rubydoc.info/gems/cocoapods-core/Pod/Podfile/DSL#script_phase-instance_method
# for the full object keys
Pod::UI.puts "Adding a custom script phase for Pod #{spec.name}: #{phase["name"] || 'No name specified.'}"
# Support passing in a path relative to the root of the package
if phase["path"]
phase["script"] = File.read(File.expand_path(phase["path"], package["root"]))
phase.delete("path")
end
# Support converting the execution position into a symbol
if phase["execution_position"]
phase["execution_position"] = phase["execution_position"].to_sym
end
phase = Hash[phase.map { |k, v| [k.to_sym, v] }]
script_phase phase
end
end
found_pods.push spec
end
if found_pods.size > 0
pods = found_pods.map { |p| p.name }.sort.to_sentence
Pod::UI.puts "Auto-linking React Native #{"module".pluralize(found_pods.size)} for target `#{current_target_definition.name}`: #{pods}"
end
absolute_react_native_path = Pathname.new(config["reactNativePath"])
{ :reactNativePath => absolute_react_native_path.relative_path_from(project_root).to_s }
end
# You can run the tests for this file by running:
# $ yarn jest packages/platform-ios/src/config/__tests__/native_modules.test.ts
if $0 == __FILE__
require "json"
runInput = JSON.parse(ARGF.read)
unless runInput["captureStdout"]
Pod::Config.instance.silent = true
end
return_values = []
podfile = Pod::Podfile.new do
if runInput["podsActivatedByUser"]
runInput["podsActivatedByUser"].each do |name|
pod(name)
end
end
target 'iOS Target' do
platform :ios
return_values[0] = use_native_modules!(runInput["dependencyConfig"])
end
target 'macOS Target' do
platform :osx
return_values[1] = use_native_modules!(runInput["dependencyConfig"])
end
end
unless runInput["captureStdout"]
puts podfile.to_hash.merge({ "return_values": return_values }).to_json
end
end

View File

@@ -0,0 +1,25 @@
{
"name": "@react-native-community/cli-platform-ios",
"version": "13.6.4",
"license": "MIT",
"main": "build/index.js",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@react-native-community/cli-platform-apple": "13.6.4"
},
"files": [
"build",
"!*.d.ts",
"!*.map",
"native_modules.rb"
],
"homepage": "https://github.com/react-native-community/cli/tree/main/packages/cli-platform-ios",
"repository": {
"type": "git",
"url": "https://github.com/react-native-community/cli.git",
"directory": "packages/cli-platform-ios"
},
"gitHead": "a31b57ec24073420cef566c8bff2c6ae3e87c14f"
}