Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/update docs #1845

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flexn/renative-monorepo",
"version": "1.9.0-rc.0",
"version": "1.9.0-feat-update-docs",
"description": "🚀🚀🚀 Unified Development Platform. Bootstrap, Develop & Deploy `iOS`, `tvOS`, `Android`, `Android TV`, `Fire TV`, `Android Wear`, `Web`, `Tizen TV`, `Tizen Watch`, `Tizen Mobile`, `LG webOS`, `macOS/OSX`, `Windows`, `KaiOS`, `Linux` and `Chromecast` platforms",
"keywords": [
"android tv",
Expand Down Expand Up @@ -86,8 +86,8 @@
"@flexn/eslint-config": "1.0.0",
"@flexn/prettier-config": "1.0.0",
"@flexn/typescript-config": "1.0.0",
"@rnv/build-hooks-git": "1.9.0-rc.0",
"@rnv/core": "1.9.0-rc.0",
"@rnv/build-hooks-git": "1.9.0-feat-update-docs",
"@rnv/core": "1.9.0-feat-update-docs",
"@types/jest": "^29.5.12",
"@types/kill-port": "2.0.0",
"@types/lodash.get": "4.4.7",
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rnv/adapter",
"version": "1.9.0-rc.0",
"version": "1.9.0-feat-update-docs",
"description": "ReNative Adapters for babel, metro, next and other build configs",
"keywords": [],
"homepage": "https://github.com/flexn-io/renative#readme",
Expand Down
26 changes: 13 additions & 13 deletions packages/app-harness/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rnv/app-harness",
"version": "1.9.0-rc.0",
"version": "1.9.0-feat-update-docs",
"description": "ReNative Test Harness App",
"keywords": [],
"homepage": "https://github.com/flexn-io/renative#readme",
Expand Down Expand Up @@ -44,7 +44,7 @@
"@lightningjs/sdk": "5.5.1",
"@react-native-community/push-notification-ios": "1.11.0",
"@react-native-firebase/app": "20.0.0",
"@rnv/renative": "1.9.0-rc.0",
"@rnv/renative": "1.9.0-feat-update-docs",
"dotenv": "16.4.5",
"next": "14.2.21",
"raf": "3.4.1",
Expand All @@ -68,17 +68,17 @@
"devDependencies": {
"@flexn/assets-renative-outline": "0.3.5",
"@flexn/graybox": "1.0.0-feat.12",
"@rnv/cli": "1.9.0-rc.0",
"@rnv/config-templates": "1.9.0-rc.0",
"@rnv/core": "1.9.0-rc.0",
"@rnv/engine-lightning": "1.9.0-rc.0",
"@rnv/engine-rn": "1.9.0-rc.0",
"@rnv/engine-rn-electron": "1.9.0-rc.0",
"@rnv/engine-rn-next": "1.9.0-rc.0",
"@rnv/engine-rn-tvos": "1.9.0-rc.0",
"@rnv/engine-rn-web": "1.9.0-rc.0",
"@rnv/integration-starter": "1.9.0-rc.0",
"@rnv/template-starter": "1.9.0-rc.0",
"@rnv/cli": "1.9.0-feat-update-docs",
"@rnv/config-templates": "1.9.0-feat-update-docs",
"@rnv/core": "1.9.0-feat-update-docs",
"@rnv/engine-lightning": "1.9.0-feat-update-docs",
"@rnv/engine-rn": "1.9.0-feat-update-docs",
"@rnv/engine-rn-electron": "1.9.0-feat-update-docs",
"@rnv/engine-rn-next": "1.9.0-feat-update-docs",
"@rnv/engine-rn-tvos": "1.9.0-feat-update-docs",
"@rnv/engine-rn-web": "1.9.0-feat-update-docs",
"@rnv/integration-starter": "1.9.0-feat-update-docs",
"@rnv/template-starter": "1.9.0-feat-update-docs",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"@types/react-native": "0.72.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/build-hooks-git/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rnv/build-hooks-git",
"version": "1.9.0-rc.0",
"version": "1.9.0-feat-update-docs",
"description": "Build Hooks for Git",
"keywords": [],
"homepage": "https://github.com/flexn-io/renative#readme",
Expand Down Expand Up @@ -30,7 +30,7 @@
"simple-git": "3.24.0"
},
"peerDependencies": {
"@rnv/core": "^1.9.0-rc.0"
"@rnv/core": "^1.9.0-feat-update-docs"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/build-hooks-schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"zod-to-json-schema": "3.23.0"
},
"peerDependencies": {
"@rnv/core": "^1.9.0-rc.0"
"@rnv/core": "^1.9.0-feat-update-docs"
},
"publishConfig": {
"access": "public"
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rnv/cli",
"version": "1.9.0-rc.0",
"version": "1.9.0-feat-update-docs",
"description": "ReNative CLI",
"keywords": [],
"homepage": "https://github.com/flexn-io/renative#readme",
Expand Down Expand Up @@ -32,8 +32,8 @@
"watch": "tsc --watch --preserveWatchOutput"
},
"dependencies": {
"@rnv/engine-core": "1.9.0-rc.0",
"@rnv/sdk-telemetry": "1.9.0-rc.0",
"@rnv/engine-core": "1.9.0-feat-update-docs",
"@rnv/sdk-telemetry": "1.9.0-feat-update-docs",
"chalk": "4.1.0",
"commander": "12.1.0",
"inquirer": "8.2.0",
Expand All @@ -43,7 +43,7 @@
"@types/inquirer-autocomplete-prompt": "^3.0.3"
},
"peerDependencies": {
"@rnv/core": "^1.9.0-rc.0"
"@rnv/core": "^1.9.0-feat-update-docs"
},
"private": false,
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/config-templates/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rnv/config-templates",
"version": "1.9.0-rc.0",
"version": "1.9.0-feat-update-docs",
"description": "ReNative configuration templates for plugins, platforms, engines and project template endpoints",
"keywords": [],
"homepage": "https://github.com/flexn-io/renative#readme",
Expand Down
18 changes: 9 additions & 9 deletions packages/config-templates/renative.templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,35 @@
},
"engineTemplates": {
"@rnv/engine-rn": {
"version": "1.9.0-rc.0",
"version": "1.9.0-feat-update-docs",
"id": "engine-rn"
},
"@rnv/engine-rn-tvos": {
"version": "1.9.0-rc.0",
"version": "1.9.0-feat-update-docs",
"id": "engine-rn-tvos"
},
"@rnv/engine-rn-web": {
"version": "1.9.0-rc.0",
"version": "1.9.0-feat-update-docs",
"id": "engine-rn-web"
},
"@rnv/engine-rn-next": {
"version": "1.9.0-rc.0",
"version": "1.9.0-feat-update-docs",
"id": "engine-rn-next"
},
"@rnv/engine-rn-electron": {
"version": "1.9.0-rc.0",
"version": "1.9.0-feat-update-docs",
"id": "engine-rn-electron"
},
"@rnv/engine-lightning": {
"version": "1.9.0-rc.0",
"version": "1.9.0-feat-update-docs",
"id": "engine-lightning"
},
"@rnv/engine-rn-macos": {
"version": "1.9.0-rc.0",
"version": "1.9.0-feat-update-docs",
"id": "engine-rn-macos"
},
"@rnv/engine-rn-windows": {
"version": "1.9.0-rc.0",
"version": "1.9.0-feat-update-docs",
"id": "engine-rn-windows"
}
},
Expand Down Expand Up @@ -986,7 +986,7 @@
"version": "^1.8.1"
},
"@rnv/renative": {
"version": "1.9.0-rc.0"
"version": "1.9.0-feat-update-docs"
},
"@sentry/react": {
"version": "6.13.3"
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rnv/core",
"version": "1.9.0-rc.0",
"version": "1.9.0-feat-update-docs",
"description": "RNV Core SDK",
"keywords": [],
"homepage": "https://github.com/flexn-io/renative#readme",
Expand Down Expand Up @@ -52,7 +52,7 @@
"@types/envinfo": "7.8.4"
},
"peerDependencies": {
"@rnv/config-templates": "^1.9.0-rc.0"
"@rnv/config-templates": "^1.9.0-feat-update-docs"
},
"private": false,
"publishConfig": {
Expand Down
15 changes: 15 additions & 0 deletions packages/core/src/configs/appConfigs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ import { ConfigFileApp } from '../schema/types';

const IGNORE_FOLDERS = ['.git'];

/**
* Lists all application configuration folders in the specified directory or project's appConfigsDir
*
* @param ignoreHiddenConfigs - If true, excludes configurations marked as hidden in their renative.json file
* @param appConfigsDirPath - Optional custom path to look for app configs. If not provided, uses project's appConfigsDir
* @returns Array of folder names containing valid app configurations
*
* The function:
* 1. Validates project path exists
* 2. Scans the specified directory for subdirectories
* 3. Filters out ignored folders (like .git)
* 4. If ignoreHiddenConfigs is true, checks each folder's renative.json file
* and excludes those marked with hidden: true
* 5. Returns an array of valid app config folder names
*/
export const listAppConfigsFoldersSync = (ignoreHiddenConfigs: boolean, appConfigsDirPath?: string) => {
logDefault('listAppConfigsFoldersSync', `ignoreHiddenConfigs:${!!ignoreHiddenConfigs}`);
const c = getContext();
Expand Down
19 changes: 18 additions & 1 deletion packages/core/src/configs/buildConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
fsExistsSync,
formatBytes,
mkdirSync,
writeFileSync
writeFileSync,
} from '../system/fs';
import { chalk, logDefault, logWarning, logDebug } from '../logger';
import { getContext } from '../context/provider';
Expand Down Expand Up @@ -45,6 +45,23 @@ const getEnginesPluginDelta = () => {
return enginePlugins;
};

/**
* Generates a build configuration by merging multiple configuration files and plugins.
*
* This function:
* 1. Retrieves the current context and any engine plugin deltas
* 2. Defines merge paths for both public and private configurations:
* - Workspace configurations
* - Project configurations
* - App configurations
* - Local configurations
* - Private configurations
* 3. Creates corresponding merge files arrays that contain the actual configuration content
* 4. Calls _generateBuildConfig to process and save the merged configuration
*
* The configuration files are merged in a specific order, with later files
* taking precedence over earlier ones in the merge sequence.
*/
export const generateBuildConfig = () => {
logDebug('generateBuildConfig');

Expand Down
11 changes: 11 additions & 0 deletions packages/core/src/configs/configLocal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@ import { getContext } from '../context/provider';
import { logDefault } from '../logger';
import { writeFileSync } from '../system/fs';

/**
* Generates or updates the local configuration file for the project.
*
* This function manages the local configuration by either updating or resetting
* the current application configuration ID. It operates on the configLocal object
* within the project files and persists changes to the filesystem.
*
* @param resetAppId - Optional boolean flag. When true, removes the currentAppConfigId
* from the configuration. When false or undefined, sets the
* currentAppConfigId to the current runtime appId.
*/
export const generateLocalConfig = (resetAppId?: boolean) => {
logDefault('generateLocalConfig', `resetAppId:${!!resetAppId}`);
const c = getContext();
Expand Down
15 changes: 15 additions & 0 deletions packages/core/src/configs/platformAssets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ import { getConfigProp } from '../context/contextProps';
import { logDefault } from '../logger';
import { getContext } from '../context/provider';

/**
* Generates runtime configuration for platform assets by merging various config sources.
*
* This function:
* 1. Retrieves the current context
* 2. Merges multiple configuration layers in the following order:
* - Base asset config
* - Runtime build config
* - Common runtime config
* - Platform-specific runtime config
* - Runtime config from config props
* 3. If assets directory exists, sanitizes the merged config and writes it to the assets config file
*
* @returns {Promise<boolean>} Returns true when the operation completes successfully
*/
export const generatePlatformAssetsRuntimeConfig = async () => {
logDefault('generateRuntimeConfig');
const c = getContext();
Expand Down
11 changes: 11 additions & 0 deletions packages/core/src/enums/platformName.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/**
* Supported platforms:
* - Web: web, webtv, chromecast
* - Mobile: ios, android, kaios, tizenmobile
* - TV: androidtv, firetv, tvos
* - Desktop: macos, linux, windows
* - Smart TV: tizen, webos
* - Wearable: androidwear, tizenwatch
* - Gaming: xbox
*/

export const RnvPlatformName = {
web: 'web',
ios: 'ios',
Expand Down
38 changes: 38 additions & 0 deletions packages/core/src/platforms/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,25 @@ export const generatePlatformChoices = () => {
return options;
};

/**
* Cleans the platform build directory for a specific platform or all platforms.
*
* This function removes build artifacts from the project's build directory. It can either
* clean a single platform's build or all platforms' builds depending on the parameters.
*
* @param platform - The RnvPlatform to clean. This is the specific platform whose build directory will be cleaned.
* @param cleanAllPlatforms - Optional boolean flag. If true, cleans build directories for all supported platforms
* in the build config. If false or undefined, only cleans the specified platform.
*
* @returns A Promise that resolves when all cleaning tasks are complete.
*
* @example
* // Clean only iOS platform
* await cleanPlatformBuild('ios');
*
* // Clean all platforms
* await cleanPlatformBuild('ios', true);
*/
export const cleanPlatformBuild = async (platform: RnvPlatform, cleanAllPlatforms?: boolean) => {
logDebug('cleanPlatformBuild');

Expand All @@ -41,6 +60,25 @@ export const cleanPlatformBuild = async (platform: RnvPlatform, cleanAllPlatform
await Promise.all(cleanTasks);
};

/**
* Creates a platform build for the specified platform by copying the necessary template files
* to the appropriate build directory.
*
* This function sets up the build environment for a given platform by copying files from the
* platform's template directory to the application's build directory. It ensures that the
* platform is supported and that the necessary directories are defined before proceeding with
* the file operations.
*
* @param platform - The RnvPlatform for which to create the build. This specifies the target
* platform whose build environment will be prepared.
*
* @returns A Promise that resolves when the platform build creation is complete. If the platform
* is not supported or if required paths are not defined, the Promise will be rejected.
*
* @example
* // Create a platform build for iOS
* await createPlatformBuild('ios');
*/
export const createPlatformBuild = (platform: RnvPlatform) =>
new Promise<void>((resolve, reject) => {
logDefault('createPlatformBuild');
Expand Down
Loading
Loading