diff --git a/buildHooks/src/prePublish.ts b/buildHooks/src/prePublish.ts index 9029e7158..7820c7b59 100644 --- a/buildHooks/src/prePublish.ts +++ b/buildHooks/src/prePublish.ts @@ -172,12 +172,12 @@ export const prePublish = async (c: RnvContext) => { pkgFile = readObjectSync(_pkgPath); pkgName = pkgFile?.name; } - const _rnvPath = path.join(dirPath, 'renative.json'); + const _rnvPath = path.join(dirPath, RnvFileName.renative); if (fsExistsSync(_rnvPath)) { rnvPath = _rnvPath; rnvFile = readObjectSync(rnvPath); } - const _rnvTempPath = path.join(dirPath, 'renative.template.json'); + const _rnvTempPath = path.join(dirPath, RnvFileName.renativeTemplate); if (fsExistsSync(_rnvTempPath)) { rnvTempPath = _rnvTempPath; rnvTempFile = readObjectSync(rnvTempPath); diff --git a/packages/app-harness/appConfigs/harness/rnv.json b/packages/app-harness/appConfigs/harness/rnv.json index 08ae56298..b05abf547 100644 --- a/packages/app-harness/appConfigs/harness/rnv.json +++ b/packages/app-harness/appConfigs/harness/rnv.json @@ -1,8 +1,123 @@ { - "$schema": "../../.rnv/schema/renative-1.0.schema.json", "app": { "extendsTemplate": "@rnv/template-starter/appConfigs/base/rnv.json", "id": "harness" }, - "project": {} + "project": { + "common": { + "id": "renative.harness", + "title": "Harness", + "description": "Test Harness for ReNative", + "runtime": { + "welcomeMessage": "Hello ReNative Harness!" + }, + "buildSchemes": { + "debug": { + "id": "renative.harness.debug", + "title": "Debug Harness" + }, + "test": { + "id": "renative.harness.test", + "title": "Test Harness" + } + }, + "fontSources": ["{{resolvePackage(react-native-vector-icons)}}/Fonts"], + "excludedPlugins": ["@react-native-firebase/app"] + }, + "platforms": { + "ios": { + "entitlements": { + "aps-environment": "development" + }, + "buildSchemes": { + "debug-static-pods": { + "runScheme": "Debug", + "bundleAssets": false, + "teamID": "9VVQTZS9NN", + "templateXcode": { + "Podfile": { + "sources": ["https://github.com/CocoaPods/Specs.git"], + "header": [ + "plugin 'cocoapods-user-defined-build-types'", + "enable_user_defined_build_types!" + ] + } + }, + "excludedPlugins": [] + }, + "release": { + "id": "com.renative.harness.ios", + "provisionProfileSpecifier": "renative harness adhoc ios", + "provisioningStyle": "Manual", + "codeSignIdentity": "Apple Distribution", + "exportOptions": { + "method": "ad-hoc", + "uploadBitcode": true, + "compileBitcode": false, + "uploadSymbols": true, + "signingStyle": "manual", + "provisioningProfiles": { + "com.renative.harness.ios": "renative harness adhoc ios" + } + } + } + } + }, + "tvos": { + "buildSchemes": { + "debug": { + "teamID": "9VVQTZS9NN" + }, + "release": { + "id": "com.renative.harness.tvos", + "provisionProfileSpecifier": "renative harness adhoc tvos", + "provisioningStyle": "Manual", + "codeSignIdentity": "Apple Distribution", + "exportOptions": { + "method": "ad-hoc", + "uploadBitcode": true, + "compileBitcode": false, + "uploadSymbols": true, + "signingStyle": "manual", + "provisioningProfiles": { + "com.renative.harness.tvos": "renative harness adhoc tvos" + } + } + } + } + }, + "android": { + "reactNativeEngine": "hermes", + "buildSchemes": { + "debug-jsc": { + "signingConfig": "Debug", + "bundleAssets": false, + "reactNativeEngine": "jsc" + } + } + }, + "tizen": { + "package": "NkVRhWHJSX", + "id": "NkVRhWHJSX.RNVanillaTV" + }, + "tizenwatch": { + "package": "cHIP2fIRQZ", + "id": "cHIP2fIRQZ.RNVanillaWatch" + }, + "tizenmobile": { + "package": "PauodvCU2r", + "id": "PauodvCU2r.RNVanillaMobile" + }, + "web": { + "buildSchemes": { + "debug-engine-rn-web": { + "bundleAssets": false, + "environment": "development", + "engine": "engine-rn-web" + } + } + } + } + }, + "$schema": "../../../../.rnv/schema/renative-1.0.schema.json" } diff --git a/packages/app-harness/appConfigs/unicorn/rnv.json b/packages/app-harness/appConfigs/unicorn/rnv.json new file mode 100644 index 000000000..0c5d3f281 --- /dev/null +++ b/packages/app-harness/appConfigs/unicorn/rnv.json @@ -0,0 +1,4 @@ +{ + "$schema": "../../.rnv/schema/renative-1.0.schema.json", + "app": { "extendsTemplate": "@rnv/template-starter/appConfigs/base/rnv.json", "id": "unicorn" } +} diff --git a/packages/app-harness/rnv.json b/packages/app-harness/rnv.json new file mode 100644 index 000000000..afe8cb418 --- /dev/null +++ b/packages/app-harness/rnv.json @@ -0,0 +1,293 @@ +{ + "project": { + "extendsTemplate": "@rnv/template-starter/rnv.json", + "projectName": "@rnv/app-harness", + "crypto": { + "path": "./secrets/privateConfigs.enc" + }, + "isMonorepo": true, + "integrations": { + "@rnv/integration-starter": {} + }, + "defaults": { + "portOffset": 10 + }, + "platforms": { + "ios": { + "templateXcode": { + "AppDelegate_h": { + "appDelegateMethods": ["@property (nonatomic, strong) UIView *appSwitcherView;"] + }, + "AppDelegate_mm": { + "appDelegateMethods": { + "custom": [ + "- (UIImage *)createScreenshotOfCurrentContext {", + " CGSize screenSize = self.window.screen.bounds.size;", + " UIGraphicsBeginImageContext(screenSize);", + " CGContextRef currentContext = UIGraphicsGetCurrentContext();", + " if (!currentContext) {", + " return nil;", + " }", + " [self.window.layer renderInContext:currentContext];", + " UIImage *image = UIGraphicsGetImageFromCurrentImageContext();", + " UIGraphicsEndImageContext();", + " return image;", + "}" + ] + } + } + }, + "privacyManifests": { + "NSPrivacyAccessedAPITypes": [ + { + "NSPrivacyAccessedAPIType": "NSPrivacyAccessedAPICategoryActiveKeyboards", + "NSPrivacyAccessedAPITypeReasons": ["CA92.1"] + }, + { + "NSPrivacyAccessedAPIType": "NSPrivacyAccessedAPICategorySystemBootTime", + "NSPrivacyAccessedAPITypeReasons": ["CA92.1", "E174.1"] + } + ] + } + }, + "tvos": { + "templateXcode": { + "AppDelegate_h": { + "appDelegateMethods": ["@property (nonatomic, strong) UIView *appSwitcherView;"] + }, + "AppDelegate_mm": { + "appDelegateMethods": { + "custom": [ + "- (UIImage *)createScreenshotOfCurrentContext {", + " CGSize screenSize = self.window.screen.bounds.size;", + " UIGraphicsBeginImageContext(screenSize);", + " CGContextRef currentContext = UIGraphicsGetCurrentContext();", + " if (!currentContext) {", + " return nil;", + " }", + " [self.window.layer renderInContext:currentContext];", + " UIImage *image = UIGraphicsGetImageFromCurrentImageContext();", + " UIGraphicsEndImageContext();", + " return image;", + "}" + ] + } + } + }, + "privacyManifests": { + "NSPrivacyAccessedAPITypes": [ + { + "NSPrivacyAccessedAPIType": "NSPrivacyAccessedAPICategoryActiveKeyboards", + "NSPrivacyAccessedAPITypeReasons": ["CA92.1"] + }, + { + "NSPrivacyAccessedAPIType": "NSPrivacyAccessedAPICategorySystemBootTime", + "NSPrivacyAccessedAPITypeReasons": ["CA92.1", "E174.1"] + } + ] + } + }, + "android": { + "templateAndroid": { + "build_gradle": { + "buildscript": { + "custom": [], + "dependencies": ["def customVar2 = '2'"], + "repositories": ["def customVar1 = '1'"], + "ext": ["playServicesLocationVersion = \"21.0.1\""] + }, + "injectAfterAll": ["allprojects {", " repositories {", " }", "}"] + }, + "styles_xml": { + "tag": "resources", + "children": [ + { + "tag": "style", + "name": "AppTheme", + "children": [ + { + "tag": "item", + "name": "android:windowIsTranslucent", + "value": "true" + } + ] + } + ] + } + } + } + }, + "plugins": { + "react-native-safe-area-context": "source:rnv", + "react-native-splash-screen": { + "ios": { + "templateXcode": { + "project_pbxproj": { + "resourceFiles": ["RNVApp/launch-image.png"] + } + } + } + }, + "rn-fetch-blob": "source:rnv", + "react-native-carplay": "source:rnv", + "@react-native-community/push-notification-ios": "source:rnv", + "TestNativeModule": { + "android": { + "templateAndroid": { + "MainApplication_kt": { + "packages": ["MyAppPackage"] + } + }, + "forceLinking": true + } + }, + "@react-native-firebase/app": { + "disablePluginTemplateOverrides": true, + "version": "20.0.0", + "ios": { + "podNames": [ + "pod 'Firebase', :build_type => :static_framework", + "pod 'FirebaseCoreInternal', :build_type => :static_framework", + "pod 'FirebaseCore', :build_type => :static_framework", + "pod 'GoogleUtilities', :build_type => :static_framework", + "pod 'FirebaseStorage', :build_type => :static_framework", + "pod 'FirebaseAppCheckInterop', :build_type => :static_framework", + "pod 'FirebaseAuthInterop', :build_type => :static_framework" + ], + "templateXcode": { + "Podfile": { + "header": ["$RNFirebaseAsStaticFramework = true"] + } + } + } + }, + "react-native-photo-editor": { + "android": { + "templateAndroid": { + "AndroidManifest_xml": { + "tag": "manifest", + "children": [ + { + "tag": "uses-permission ", + "android:name": "android.permission.WRITE_EXTERNAL_STORAGE", + "children": [] + }, + { + "tag": "application", + "android:name": ".MainApplication", + "children": [ + { + "tag": "activity", + "android:name": "com.ahmedadeltito.photoeditor.PhotoEditorActivity", + "children": [] + } + ] + } + ] + } + }, + "package": "ui.photoeditor.RNPhotoEditorPackage" + }, + "androidtv": { + "package": "ui.photoeditor.RNPhotoEditorPackage" + }, + "firetv": { + "package": "ui.photoeditor.RNPhotoEditorPackage" + }, + "ios": { + "podName": "iOSPhotoEditor", + "git": "https://github.com/prscX/photo-editor", + "commit": "4924e9ec984d25d03644e58aa148282642171de9", + "buildType": "dynamic", + "templateXcode": { + "Podfile": { + "header": [ + "plugin 'cocoapods-user-defined-build-types'", + "enable_user_defined_build_types!" + ] + }, + "project_pbxproj": { + "resourceFiles": [ + "Resources/arrow1.png", + "Resources/arrow2.png", + "Resources/arrow3.png", + "Resources/arrow4.png", + "Resources/arrow5.png" + ], + "sourceFiles": ["RNPhotoEditor/RNPhotoEditor.m"], + "headerFiles": ["RNPhotoEditor/RNPhotoEditor.h"] + } + } + }, + "tvos": { + "disabled": true + }, + "pluginDependencies": null, + "version": "github:AppGyver/react-native-photo-editor#v0.1.2" + }, + "react-native-permissions": { + "ios": { + "templateXcode": { + "Podfile": { + "header": ["node_require('react-native-permissions/scripts/setup.rb')"], + "injectLines": ["setup_permissions([{{props.PERMISSIONS}}])"] + } + } + }, + "android": { + "templateAndroid": { + "AndroidManifest_xml": { + "tag": "manifest", + "children": [ + { + "tag": "uses-permission ", + "android:name": "android.permission.WRITE_CONTACTS", + "children": [] + } + ] + } + } + }, + "props": { + "PERMISSIONS": "'Calendars', 'Contacts'" + }, + "tvos": { + "disabled": true + } + }, + "react-native": { + "android": { + "implementation": "// TEST" + } + }, + "react-native-google-cast": { + "androidwear": { + "disabled": true + }, + "tvos": { + "disabled": true + } + } + }, + "permissions": { + "ios": { + "NSCalendarsUsageDescription": { + "desc": "Calendars usage description" + }, + "NSContactsUsageDescription": { + "desc": "Contacts usage description" + }, + "NSLocalNetworkUsageDescription": { + "desc": "${PRODUCT_NAME} uses the local network to discover Cast-enabled devices on your WiFi network." + }, + "NSPhotoLibraryAddUsageDescription": { + "desc": "Application needs permission to write photos..." + }, + "NSPhotoLibraryUsageDescription": { + "desc": "iOS 10 needs permission to write photos..." + } + } + } + }, + "$schema": ".rnv/schema/renative-1.0.schema.json" +} diff --git a/packages/build-hooks-schema/src/schema.ts b/packages/build-hooks-schema/src/schema.ts index f41e79d93..ff0928945 100644 --- a/packages/build-hooks-schema/src/schema.ts +++ b/packages/build-hooks-schema/src/schema.ts @@ -6,29 +6,29 @@ import fs from 'fs'; export const generateSchema = async () => { const { - zodConfigFilePlugin, - zodConfigFilePrivate, - zodConfigFileProject, - zodConfigFileTemplate, - zodConfigFileTemplates, - zodConfigFileWorkspace, - zodConfigFileIntegration, - zodConfigFileApp, - zodConfigFileLocal, - zodConfigFileEngine, + // zodConfigFilePlugin, + // zodConfigFilePrivate, + // zodConfigFileProject, + // zodConfigFileTemplate, + // zodConfigFileTemplates, + // zodConfigFileWorkspace, + // zodConfigFileIntegration, + // zodConfigFileApp, + // zodConfigFileLocal, + // zodConfigFileEngine, zodConfigFileRoot, } = ZodFileSchema; // LEGACY - _generateSchemaFile({ schema: zodConfigFileProject, schemaId: 'rnv.project' }); - _generateSchemaFile({ schema: zodConfigFileApp, schemaId: 'rnv.app' }); - _generateSchemaFile({ schema: zodConfigFileLocal, schemaId: 'rnv.local' }); - _generateSchemaFile({ schema: zodConfigFileEngine, schemaId: 'rnv.engine' }); - _generateSchemaFile({ schema: zodConfigFileWorkspace, schemaId: 'rnv.workspace' }); - _generateSchemaFile({ schema: zodConfigFileTemplate, schemaId: 'rnv.template' }); - _generateSchemaFile({ schema: zodConfigFilePrivate, schemaId: 'rnv.private' }); - _generateSchemaFile({ schema: zodConfigFilePlugin, schemaId: 'rnv.plugin' }); - _generateSchemaFile({ schema: zodConfigFileTemplates, schemaId: 'rnv.templates' }); - _generateSchemaFile({ schema: zodConfigFileIntegration, schemaId: 'rnv.integration' }); + // _generateSchemaFile({ schema: zodConfigFileProject, schemaId: 'rnv.project' }); + // _generateSchemaFile({ schema: zodConfigFileApp, schemaId: 'rnv.app' }); + // _generateSchemaFile({ schema: zodConfigFileLocal, schemaId: 'rnv.local' }); + // _generateSchemaFile({ schema: zodConfigFileEngine, schemaId: 'rnv.engine' }); + // _generateSchemaFile({ schema: zodConfigFileWorkspace, schemaId: 'rnv.workspace' }); + // _generateSchemaFile({ schema: zodConfigFileTemplate, schemaId: 'rnv.template' }); + // _generateSchemaFile({ schema: zodConfigFilePrivate, schemaId: 'rnv.private' }); + // _generateSchemaFile({ schema: zodConfigFilePlugin, schemaId: 'rnv.plugin' }); + // _generateSchemaFile({ schema: zodConfigFileTemplates, schemaId: 'rnv.templates' }); + // _generateSchemaFile({ schema: zodConfigFileIntegration, schemaId: 'rnv.integration' }); // CURRENT const definitions: Record = {}; Object.values(ZodSharedSchema).forEach((val) => { diff --git a/packages/config-templates/package.json b/packages/config-templates/package.json index 4716f3fe4..a91c20910 100644 --- a/packages/config-templates/package.json +++ b/packages/config-templates/package.json @@ -12,7 +12,7 @@ "files": [ "LICENSE", "pluginTemplates", - "renative.templates.json" + "rnv.json" ], "repository": { "type": "git", diff --git a/packages/config-templates/renative.templates.json b/packages/config-templates/renative.templates.json index e59465534..452939371 100644 --- a/packages/config-templates/renative.templates.json +++ b/packages/config-templates/renative.templates.json @@ -10,35 +10,35 @@ }, "engineTemplates": { "@rnv/engine-rn": { - "version": "1.4.0-rc.0", + "version": "1.5.0-rc.0", "id": "engine-rn" }, "@rnv/engine-rn-tvos": { - "version": "1.4.0-rc.0", + "version": "1.5.0-rc.0", "id": "engine-rn-tvos" }, "@rnv/engine-rn-web": { - "version": "1.4.0-rc.0", + "version": "1.5.0-rc.0", "id": "engine-rn-web" }, "@rnv/engine-rn-next": { - "version": "1.4.0-rc.0", + "version": "1.5.0-rc.0", "id": "engine-rn-next" }, "@rnv/engine-rn-electron": { - "version": "1.4.0-rc.0", + "version": "1.5.0-rc.0", "id": "engine-rn-electron" }, "@rnv/engine-lightning": { - "version": "1.4.0-rc.0", + "version": "1.5.0-rc.0", "id": "engine-lightning" }, "@rnv/engine-rn-macos": { - "version": "1.4.0-rc.0", + "version": "1.5.0-rc.0", "id": "engine-rn-macos" }, "@rnv/engine-rn-windows": { - "version": "1.4.0-rc.0", + "version": "1.5.0-rc.0", "id": "engine-rn-windows" } }, @@ -145,10 +145,7 @@ "androidtv": { "templateAndroid": { "MainActivity_kt": { - "imports": [ - "io.flexn.create.TvRemoteHandlerModule", - "android.view.KeyEvent" - ], + "imports": ["io.flexn.create.TvRemoteHandlerModule", "android.view.KeyEvent"], "methods": [ "override fun dispatchKeyEvent(ev: KeyEvent?): Boolean {", "TvRemoteHandlerModule.getInstance().handleKeyEvent(ev)", @@ -161,10 +158,7 @@ "firetv": { "templateAndroid": { "MainActivity_kt": { - "imports": [ - "io.flexn.create.TvRemoteHandlerModule", - "android.view.KeyEvent" - ], + "imports": ["io.flexn.create.TvRemoteHandlerModule", "android.view.KeyEvent"], "methods": [ "override fun dispatchKeyEvent(ev: KeyEvent?): Boolean {", "TvRemoteHandlerModule.getInstance().handleKeyEvent(ev)", @@ -186,9 +180,7 @@ "webpackConfig": { "modulePaths": true, "moduleAliases": true, - "nextTranspileModules": [ - "@flexn/recyclerlistview" - ] + "nextTranspileModules": ["@flexn/recyclerlistview"] } }, "@flexn/sdk": { @@ -231,9 +223,7 @@ "webpackConfig": { "modulePaths": true, "moduleAliases": true, - "nextTranspileModules": [ - "@flexn/shopify-flash-list" - ] + "nextTranspileModules": ["@flexn/shopify-flash-list"] }, "version": "1.4.9" }, @@ -459,10 +449,7 @@ "@react-native-community/cli": { "disableNpm": true, "version": "^12.3.6", - "supportedPlatforms": [ - "tvos", - "ios" - ] + "supportedPlatforms": ["tvos", "ios"] }, "@react-native-community/cli-platform-android": { "version": "^12.3.6" @@ -471,10 +458,7 @@ "version": "12.3.6", "disablePluginTemplateOverrides": false, "disableNpm": true, - "supportedPlatforms": [ - "tvos", - "ios" - ], + "supportedPlatforms": ["tvos", "ios"], "nodeModuleOverrides": { "^12.3.6": { "fileOverrides": { @@ -582,25 +566,19 @@ } }, "@react-native-community/push-notification-ios": { - "supportedPlatforms": [ - "ios" - ], + "supportedPlatforms": ["ios"], "ios": { "podName": "RNCPushNotificationIOS", "templateXcode": { "AppDelegate_h": { - "appDelegateExtensions": [ - "UNUserNotificationCenterDelegate" - ], + "appDelegateExtensions": ["UNUserNotificationCenterDelegate"], "appDelegateImports": [ "", "" ] }, "AppDelegate_mm": { - "appDelegateImports": [ - "" - ], + "appDelegateImports": [""], "appDelegateMethods": { "application": { "didRegisterForRemoteNotificationsWithDeviceToken": [ @@ -668,9 +646,7 @@ "projectName": "@react-native-firebase_analytics" }, "ios": { - "appDelegateImports": [ - "Firebase" - ], + "appDelegateImports": ["Firebase"], "appDelegateMethods": { "application": { "didFinishLaunchingWithOptions": [ @@ -685,9 +661,7 @@ "isStatic": true, "podName": "RNFBAnalytics", "project_pbxproj": { - "resourceFiles": [ - "RNVApp/GoogleService-Info.plist" - ] + "resourceFiles": ["RNVApp/GoogleService-Info.plist"] } }, "pluginDependencies": { @@ -714,15 +688,11 @@ ] }, "app_build_gradle": { - "apply": [ - "plugin: 'com.google.gms.google-services'" - ] + "apply": ["plugin: 'com.google.gms.google-services'"] }, "build_gradle": { "buildscript": { - "dependencies": [ - "classpath 'com.google.gms:google-services:4.3.14'" - ] + "dependencies": ["classpath 'com.google.gms:google-services:4.3.14'"] } }, "package": "io.invertase.firebase.app.ReactNativeFirebaseAppPackage", @@ -730,15 +700,11 @@ }, "androidtv": { "app_build_gradle": { - "apply": [ - "plugin: 'com.google.gms.google-services'" - ] + "apply": ["plugin: 'com.google.gms.google-services'"] }, "build_gradle": { "buildscript": { - "dependencies": [ - "classpath 'com.google.gms:google-services:4.2.0'" - ] + "dependencies": ["classpath 'com.google.gms:google-services:4.2.0'"] } }, "package": "io.invertase.firebase.app.ReactNativeFirebaseAppPackage", @@ -746,37 +712,27 @@ }, "firetv": { "app_build_gradle": { - "apply": [ - "plugin: 'com.google.gms.google-services'" - ] + "apply": ["plugin: 'com.google.gms.google-services'"] }, "build_gradle": { "buildscript": { - "dependencies": [ - "classpath 'com.google.gms:google-services:4.2.0'" - ] + "dependencies": ["classpath 'com.google.gms:google-services:4.2.0'"] } }, "package": "io.invertase.firebase.app.ReactNativeFirebaseAppPackage", "projectName": "@react-native-firebase_app" }, "ios": { - "appDelegateImports": [ - "Firebase" - ], + "appDelegateImports": ["Firebase"], "appDelegateMethods": { "application": { - "didFinishLaunchingWithOptions": [ - "FirebaseApp.configure()" - ] + "didFinishLaunchingWithOptions": ["FirebaseApp.configure()"] } }, "isStatic": true, "podName": "RNFBApp", "project_pbxproj": { - "resourceFiles": [ - "RNVApp/GoogleService-Info.plist" - ] + "resourceFiles": ["RNVApp/GoogleService-Info.plist"] } }, "version": "20.0.0" @@ -787,9 +743,7 @@ "projectName": "@react-native-firebase_auth" }, "ios": { - "appDelegateImports": [ - "Firebase" - ], + "appDelegateImports": ["Firebase"], "appDelegateMethods": { "application": { "didFinishLaunchingWithOptions": [ @@ -804,9 +758,7 @@ "isStatic": true, "podName": "RNFBAuth", "project_pbxproj": { - "resourceFiles": [ - "RNVApp/GoogleService-Info.plist" - ] + "resourceFiles": ["RNVApp/GoogleService-Info.plist"] } }, "pluginDependencies": { @@ -818,9 +770,7 @@ "android": { "templateAndroid": { "app_build_gradle": { - "apply": [ - "plugin: 'io.fabric'" - ] + "apply": ["plugin: 'io.fabric'"] }, "BuildGradle": { "buildscript": { @@ -829,9 +779,7 @@ } } }, - "implementations": [ - "'com.google.android.material:material:1.2.1'" - ] + "implementations": ["'com.google.android.material:material:1.2.1'"] }, "package": "io.invertase.firebase.crashlytics.ReactNativeFirebaseCrashlyticsPackage", "projectName": "@react-native-firebase_crashlytics" @@ -842,9 +790,7 @@ "ios": { "templateXcode": { "AppDelegate_h": { - "appDelegateImports": [ - "Firebase" - ] + "appDelegateImports": ["Firebase"] }, "appDelegateMethods": { "application": { @@ -864,9 +810,7 @@ "shellScript": "\"${PODS_ROOT}/Fabric/run\"" } ], - "resourceFiles": [ - "RNVApp/GoogleService-Info.plist" - ] + "resourceFiles": ["RNVApp/GoogleService-Info.plist"] } }, "isStatic": true, @@ -905,13 +849,9 @@ "ios": { "templateXcode": { "project_pbxproj": { - "resourceFiles": [ - "RNVApp/GoogleService-Info.plist" - ] + "resourceFiles": ["RNVApp/GoogleService-Info.plist"] }, - "appDelegateImports": [ - "Firebase" - ], + "appDelegateImports": ["Firebase"], "appDelegateMethods": { "application": { "didFinishLaunchingWithOptions": [ @@ -1039,7 +979,7 @@ "version": "^1.8.1" }, "@rnv/renative": { - "version": "1.4.0-rc.0" + "version": "1.5.0-rc.0" }, "@sentry/react": { "version": "6.13.3" @@ -1048,9 +988,7 @@ "android": { "templateAndroid": { "app_build_gradle": { - "apply": [ - "from: \"{{PLUGIN_ROOT}}/sentry.gradle\"" - ] + "apply": ["from: \"{{PLUGIN_ROOT}}/sentry.gradle\""] } }, "implementation": "implementation project(':@sentry_react-native')", @@ -1138,9 +1076,7 @@ }, "deprecated": "crashlytics plugin is deprecated use Crashlytics (uppercase) in combination with Firebase", "ios": { - "appDelegateImports": [ - "Crashlytics" - ], + "appDelegateImports": ["Crashlytics"], "podName": "Crashlytics", "version": "3.13.4" }, @@ -1207,19 +1143,13 @@ "android": { "templateAndroid": { "app_build_gradle": { - "apply": [ - "plugin: 'io.fabric'" - ] + "apply": ["plugin: 'io.fabric'"] }, "build_gradle": { "buildscript": { - "dependencies": [ - "classpath 'io.fabric.tools:gradle:1.25.4'" - ] + "dependencies": ["classpath 'io.fabric.tools:gradle:1.25.4'"] }, - "repositories": [ - "maven { url 'https://maven.fabric.io/public' }" - ] + "repositories": ["maven { url 'https://maven.fabric.io/public' }"] }, "BuildGradle": { "allprojects": { @@ -1237,9 +1167,7 @@ } }, "MainActivity_kt": { - "imports": [ - "io.fabric.sdk.android.Fabric" - ] + "imports": ["io.fabric.sdk.android.Fabric"] } }, "implementation": "implementation('com.crashlytics.sdk.android:crashlytics:2.8.0@aar') {\n transitive = true\n }" @@ -1252,14 +1180,10 @@ "extendPlatform": "android" }, "ios": { - "appDelegateImports": [ - "Fabric" - ], + "appDelegateImports": ["Fabric"], "appDelegateMethods": { "application": { - "didFinishLaunchingWithOptions": [ - "Fabric.with([Crashlytics.self])" - ] + "didFinishLaunchingWithOptions": ["Fabric.with([Crashlytics.self])"] } }, "Info_plist": { @@ -1282,19 +1206,13 @@ "android": { "templateAndroid": { "app_build_gradle": { - "apply": [ - "plugin: 'io.fabric'" - ] + "apply": ["plugin: 'io.fabric'"] }, "build_gradle": { "buildscript": { - "dependencies": [ - "classpath 'io.fabric.tools:gradle:1.25.4'" - ] + "dependencies": ["classpath 'io.fabric.tools:gradle:1.25.4'"] }, - "repositories": [ - "maven { url 'https://maven.fabric.io/public' }" - ] + "repositories": ["maven { url 'https://maven.fabric.io/public' }"] }, "BuildGradle": { "allprojects": { @@ -1312,9 +1230,7 @@ } }, "MainActivity_kt": { - "imports": [ - "io.fabric.sdk.android.Fabric" - ] + "imports": ["io.fabric.sdk.android.Fabric"] } }, "implementation": "implementation('com.crashlytics.sdk.android:crashlytics:2.8.0@aar') {\n transitive = true\n }" @@ -1339,9 +1255,7 @@ "firebase-core": { "deprecated": "firebase-core plugin is deprecated use Firebase/ instead", "ios": { - "appDelegateImports": [ - "Firebase" - ], + "appDelegateImports": ["Firebase"], "appDelegateMethods": { "application": { "didFinishLaunchingWithOptions": [ @@ -1377,20 +1291,14 @@ }, "Firebase/Analytics": { "ios": { - "appDelegateImports": [ - "Firebase" - ], - "podNames": [ - "Firebase/Analytics', '~> 6.3.0" - ] + "appDelegateImports": ["Firebase"], + "podNames": ["Firebase/Analytics', '~> 6.3.0"] }, "disableNpm": true }, "Firebase/Core": { "ios": { - "appDelegateImports": [ - "Firebase" - ], + "appDelegateImports": ["Firebase"], "appDelegateMethods": { "application": { "didFinishLaunchingWithOptions": [ @@ -1411,33 +1319,23 @@ ] } }, - "podNames": [ - "Firebase/Core', '~> 6.3.0" - ] + "podNames": ["Firebase/Core', '~> 6.3.0"] }, "disableNpm": true }, "Firebase/Messaging": { "ios": { - "appDelegateImports": [ - "Firebase" - ], - "podNames": [ - "Firebase/Messaging', '~> 6.3.0" - ] + "appDelegateImports": ["Firebase"], + "podNames": ["Firebase/Messaging', '~> 6.3.0"] }, "disableNpm": true }, "google-maps": { "ios": { - "appDelegateImports": [ - "GoogleMaps" - ], + "appDelegateImports": ["GoogleMaps"], "appDelegateMethods": { "application": { - "didFinishLaunchingWithOptions": [ - "GMSServices.provideAPIKey(\"{{props.API_KEY}}\")" - ] + "didFinishLaunchingWithOptions": ["GMSServices.provideAPIKey(\"{{props.API_KEY}}\")"] } }, "podName": "GoogleMaps", @@ -1454,13 +1352,9 @@ "implementation": "implementation('com.google.android.gms:play-services-tagmanager:18.0.1')" }, "ios": { - "podNames": [ - "GoogleTagManager', '~> 7.4.1" - ], + "podNames": ["GoogleTagManager', '~> 7.4.1"], "project_pbxproj": { - "resourceFiles": [ - "RNVApp/container" - ] + "resourceFiles": ["RNVApp/container"] } }, "disableNpm": true @@ -1532,18 +1426,14 @@ }, "next": { "version": "14.2.10", - "supportedPlatforms": [ - "web" - ] + "supportedPlatforms": ["web"] }, "next-seo": "4.28.1", "RCTLinkingIOS": { "ios": { "appDelegateMethods": { "application": { - "open": [ - "RCTLinkingManager.application(app, open: url, options: options)" - ] + "open": ["RCTLinkingManager.application(app, open: url, options: options)"] } } }, @@ -1557,23 +1447,17 @@ "didFailToRegisterForRemoteNotificationsWithError": [ "RCTPushNotificationManager.didFailToRegisterForRemoteNotificationsWithError(error)" ], - "didReceive": [ - "RCTPushNotificationManager.didReceive(notification)" - ], + "didReceive": ["RCTPushNotificationManager.didReceive(notification)"], "didReceiveRemoteNotification": [ "RCTPushNotificationManager.didReceiveRemoteNotification(userInfo, fetchCompletionHandler: completionHandler)" ], - "didRegister": [ - "RCTPushNotificationManager.didRegister(notificationSettings)" - ], + "didRegister": ["RCTPushNotificationManager.didRegister(notificationSettings)"], "didRegisterForRemoteNotificationsWithDeviceToken": [ "RCTPushNotificationManager.didRegisterForRemoteNotifications(withDeviceToken: deviceToken)" ] }, "userNotificationCenter": { - "willPresent": [ - "completionHandler([.alert, .badge, .sound])" - ] + "willPresent": ["completionHandler([.alert, .badge, .sound])"] } } }, @@ -1642,16 +1526,12 @@ "CFBundleURLTypes": [ { "CFBundleURLName": "{{props.URL_NAME}}", - "CFBundleURLSchemes": [ - "{{props.URL_SCHEME}}" - ] + "CFBundleURLSchemes": ["{{props.URL_SCHEME}}"] } ] }, "Podfile": { - "sources": [ - "https://github.com/CocoaPods/Specs.git" - ] + "sources": ["https://github.com/CocoaPods/Specs.git"] } }, "macos": { @@ -1659,9 +1539,7 @@ "CFBundleURLTypes": [ { "CFBundleURLName": "{{props.URL_NAME}}", - "CFBundleURLSchemes": [ - "{{props.URL_SCHEME}}" - ] + "CFBundleURLSchemes": ["{{props.URL_SCHEME}}"] } ] } @@ -1701,9 +1579,7 @@ "react-native-animatable": { "version": "1.3.3", "webpackConfig": { - "nextTranspileModules": [ - "react-native-animatable" - ] + "nextTranspileModules": ["react-native-animatable"] } }, "react-native-audio": { @@ -1767,9 +1643,7 @@ { "CFBundleTypeRole": "None", "CFBundleURLName": "auth0", - "CFBundleURLSchemes": [ - "$(PRODUCT_BUNDLE_IDENTIFIER)" - ] + "CFBundleURLSchemes": ["$(PRODUCT_BUNDLE_IDENTIFIER)"] } ] }, @@ -1851,9 +1725,7 @@ "react-native-camera": { "android": { "app_build_gradle": { - "defaultConfig": [ - "missingDimensionStrategy 'react-native-camera', 'general'" - ] + "defaultConfig": ["missingDimensionStrategy 'react-native-camera', 'general'"] }, "package": "org.reactnative.camera.RNCameraPackage" }, @@ -1862,9 +1734,7 @@ }, "firetv": { "app_build_gradle": { - "defaultConfig": [ - "missingDimensionStrategy 'react-native-camera', 'general'" - ] + "defaultConfig": ["missingDimensionStrategy 'react-native-camera', 'general'"] }, "package": "org.reactnative.camera.RNCameraPackage" }, @@ -1880,32 +1750,21 @@ } }, "react-native-carplay": { - "supportedPlatforms": [ - "ios" - ], + "supportedPlatforms": ["ios"], "ios": { "templateXcode": { "AppDelegate_h": { - "appDelegateImports": [ - "CarPlay/CarPlay.h" - ], - "appDelegateExtensions": [ - "UIApplicationDelegate", - "CPApplicationDelegate" - ] + "appDelegateImports": ["CarPlay/CarPlay.h"], + "appDelegateExtensions": ["UIApplicationDelegate", "CPApplicationDelegate"] }, "AppDelegate_mm": { - "appDelegateImports": [ - "RNCarPlay.h" - ], + "appDelegateImports": ["RNCarPlay.h"], "appDelegateMethods": { "application": { "didConnectCarInterfaceController": [ "[RNCarPlay connectWithInterfaceController:interfaceController window:window]" ], - "didDisconnectCarInterfaceController": [ - "[RNCarPlay disconnect]" - ] + "didDisconnectCarInterfaceController": ["[RNCarPlay disconnect]"] } } } @@ -2150,12 +2009,8 @@ } ] }, - "implementations": [ - "'com.facebook.android:facebook-android-sdk:[4,5)'" - ], - "imports": [ - "com.facebook.CallbackManager" - ], + "implementations": ["'com.facebook.android:facebook-android-sdk:[4,5)'"], + "imports": ["com.facebook.CallbackManager"], "MainActivity_kt": { "createMethods": [], "imports": [], @@ -2187,36 +2042,25 @@ "extendPlatform": "android" }, "ios": { - "appDelegateImports": [ - "FBSDKCoreKit" - ], + "appDelegateImports": ["FBSDKCoreKit"], "appDelegateMethods": { "application": { "didFinishLaunchingWithOptions": [ "ApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)" ], - "open": [ - "ApplicationDelegate.shared.application(app, open: url, options: options)" - ] + "open": ["ApplicationDelegate.shared.application(app, open: url, options: options)"] } }, "Info_plist": { "CFBundleURLTypes": [ { "CFBundleTypeRole": "Editor", - "CFBundleURLSchemes": [ - "fb{{props.APP_ID}}" - ] + "CFBundleURLSchemes": ["fb{{props.APP_ID}}"] } ], "FacebookAppID": "{{props.APP_ID}}", "FacebookDisplayName": "{{props.APP_NAME}}", - "LSApplicationQueriesSchemes": [ - "fbapi", - "fb-messenger-share-api", - "fbauth2", - "fbshareextension" - ] + "LSApplicationQueriesSchemes": ["fbapi", "fb-messenger-share-api", "fbauth2", "fbshareextension"] }, "podName": "react-native-fbsdk" }, @@ -2371,15 +2215,11 @@ ] }, "app_build_gradle": { - "apply": [ - "plugin: 'com.google.gms.google-services'" - ] + "apply": ["plugin: 'com.google.gms.google-services'"] }, "build_gradle": { "buildscript": { - "dependencies": [ - "classpath 'com.google.gms:google-services:4.2.0'" - ] + "dependencies": ["classpath 'com.google.gms:google-services:4.2.0'"] } }, "implementations": [ @@ -2400,9 +2240,7 @@ }, "ios": { "templateXcode": { - "appDelegateImports": [ - "Firebase" - ], + "appDelegateImports": ["Firebase"], "appDelegateMethods": { "application": { "didFinishLaunchingWithOptions": [ @@ -2423,17 +2261,13 @@ ] }, "project_pbxproj": { - "resourceFiles": [ - "RNVApp/GoogleService-Info.plist" - ] + "resourceFiles": ["RNVApp/GoogleService-Info.plist"] }, "Info_plist": { "CFBundleURLTypes": [ { "CFBundleURLName": "{{props.URL_NAME}}", - "CFBundleURLSchemes": [ - "{{props.URL_SCHEME}}" - ] + "CFBundleURLSchemes": ["{{props.URL_SCHEME}}"] } ] } @@ -2574,9 +2408,7 @@ ] }, "app_build_gradle": { - "implementations": [ - "'com.google.android.gms:play-services-cast-framework:21.0.0'" - ] + "implementations": ["'com.google.android.gms:play-services-cast-framework:21.0.0'"] }, "MainActivity_kt": { "createMethods": [ @@ -2586,23 +2418,17 @@ "// cast framework not supported", " }" ], - "imports": [ - "com.google.android.gms.cast.framework.CastContext" - ] + "imports": ["com.google.android.gms.cast.framework.CastContext"] }, "MainApplication_kt": { - "packages": [ - "com.reactnative.googlecast.GoogleCastPackage" - ] + "packages": ["com.reactnative.googlecast.GoogleCastPackage"] } } }, "ios": { "templateXcode": { "AppDelegate_mm": { - "appDelegateImports": [ - "GoogleCast/GoogleCast.h" - ], + "appDelegateImports": ["GoogleCast/GoogleCast.h"], "appDelegateMethods": { "application": { "didFinishLaunchingWithOptions": [ @@ -2617,10 +2443,7 @@ } }, "Info_plist": { - "NSBonjourServices": [ - "_googlecast._tcp", - "_CC1AD845._googlecast._tcp" - ], + "NSBonjourServices": ["_googlecast._tcp", "_CC1AD845._googlecast._tcp"], "NSLocalNetworkUsageDescription": "${PRODUCT_NAME} uses the local network to discover Cast-enabled devices on your WiFi network." } }, @@ -2637,9 +2460,7 @@ }, "react-native-home-indicator": { "ios": { - "appDelegateImports": [ - "react_native_home_indicator" - ], + "appDelegateImports": ["react_native_home_indicator"], "appDelegateMethods": { "application": { "didFinishLaunchingWithOptions": [ @@ -2658,9 +2479,7 @@ "android": { "templateAndroid": { "app_build_gradle": { - "defaultConfig": [ - "missingDimensionStrategy 'store', 'play'" - ] + "defaultConfig": ["missingDimensionStrategy 'store', 'play'"] } }, "package": "com.dooboolab.RNIap.RNIapPackage" @@ -2701,9 +2520,7 @@ "ios": { "templateXcode": { "Podfile": { - "sources": [ - "https://github.com/TimOliver/TOCropViewController.git" - ] + "sources": ["https://github.com/TimOliver/TOCropViewController.git"] } }, "podName": "RNImageCropPicker" @@ -2711,9 +2528,7 @@ "macos": { "templateXcode": { "Podfile": { - "sources": [ - "https://github.com/TimOliver/TOCropViewController.git" - ] + "sources": ["https://github.com/TimOliver/TOCropViewController.git"] } }, "podName": "RNImageCropPicker" @@ -2846,10 +2661,7 @@ "moduleAliases": { "react-native-linear-gradient": "react-native-web-linear-gradient" }, - "modulePaths": [ - "react-native-web-linear-gradient", - "react-native-linear-gradient" - ] + "modulePaths": ["react-native-web-linear-gradient", "react-native-linear-gradient"] } }, "react-native-local-mongodb": { @@ -2989,9 +2801,7 @@ "android": { "templateAndroid": { "MainActivity_kt": { - "imports": [ - "android.content.res.Configuration" - ], + "imports": ["android.content.res.Configuration"], "methods": [ "override fun onConfigurationChanged(newConfig:Configuration) {", " super.onConfigurationChanged(newConfig)", @@ -3006,14 +2816,10 @@ }, "ios": { "templateXcode": { - "appDelegateImports": [ - "react_native_orientation_locker" - ], + "appDelegateImports": ["react_native_orientation_locker"], "appDelegateMethods": { "application": { - "supportedInterfaceOrientationsFor": [ - "Orientation.getOrientation();" - ] + "supportedInterfaceOrientationsFor": ["Orientation.getOrientation();"] } } }, @@ -3239,10 +3045,7 @@ "react-native-root-toast": { "version": "3.6.0", "webpackConfig": { - "nextTranspileModules": [ - "react-native-root-siblings", - "static-container" - ] + "nextTranspileModules": ["react-native-root-siblings", "static-container"] } }, "react-native-safe-area-context": { @@ -3399,22 +3202,12 @@ "version": "0.11.2" }, "react-native-splash-screen": { - "supportedPlatforms": [ - "android", - "androidtv", - "firetv", - "ios", - "androidwear" - ], + "supportedPlatforms": ["android", "androidtv", "firetv", "ios", "androidwear"], "android": { "templateAndroid": { "MainActivity_kt": { - "createMethods": [ - "SplashScreen.show(this)" - ], - "imports": [ - "org.devio.rn.splashscreen.SplashScreen" - ] + "createMethods": ["SplashScreen.show(this)"], + "imports": ["org.devio.rn.splashscreen.SplashScreen"] } }, "package": "org.devio.rn.splashscreen.SplashScreenReactPackage" @@ -3422,12 +3215,8 @@ "androidwear": { "templateAndroid": { "MainActivity_kt": { - "createMethods": [ - "SplashScreen.show(this)" - ], - "imports": [ - "org.devio.rn.splashscreen.SplashScreen" - ] + "createMethods": ["SplashScreen.show(this)"], + "imports": ["org.devio.rn.splashscreen.SplashScreen"] } }, "package": "org.devio.rn.splashscreen.SplashScreenReactPackage" @@ -3435,12 +3224,8 @@ "androidtv": { "templateAndroid": { "MainActivity_kt": { - "createMethods": [ - "SplashScreen.show(this)" - ], - "imports": [ - "org.devio.rn.splashscreen.SplashScreen" - ] + "createMethods": ["SplashScreen.show(this)"], + "imports": ["org.devio.rn.splashscreen.SplashScreen"] } }, "package": "org.devio.rn.splashscreen.SplashScreenReactPackage" @@ -3448,12 +3233,8 @@ "firetv": { "templateAndroid": { "MainActivity_kt": { - "createMethods": [ - "SplashScreen.show(this)" - ], - "imports": [ - "org.devio.rn.splashscreen.SplashScreen" - ] + "createMethods": ["SplashScreen.show(this)"], + "imports": ["org.devio.rn.splashscreen.SplashScreen"] } }, "package": "org.devio.rn.splashscreen.SplashScreenReactPackage" @@ -3461,14 +3242,10 @@ "ios": { "templateXcode": { "AppDelegate_mm": { - "appDelegateImports": [ - "RNSplashScreen.h" - ], + "appDelegateImports": ["RNSplashScreen.h"], "appDelegateMethods": { "application": { - "didFinishLaunchingWithOptions": [ - "[RNSplashScreen show]" - ] + "didFinishLaunchingWithOptions": ["[RNSplashScreen show]"] } } } @@ -3571,11 +3348,7 @@ }, "react-native-tvos": { "version": "0.73.6-0", - "supportedPlatforms": [ - "tvos", - "firetv", - "androidtv" - ] + "supportedPlatforms": ["tvos", "firetv", "androidtv"] }, "react-native-tvos-controller": { "ios": { @@ -3857,9 +3630,7 @@ "webpackConfig": { "moduleAliases": true, "modulePaths": true, - "nextTranspileModules": [ - "recyclerlistview" - ] + "nextTranspileModules": ["recyclerlistview"] } }, "renative": { @@ -3893,9 +3664,7 @@ "rnv-platform-info": { "version": "1.0.16", "webpackConfig": { - "nextTranspileModules": [ - "rnv-platform-info" - ] + "nextTranspileModules": ["rnv-platform-info"] } }, "Sentry": { @@ -3927,9 +3696,7 @@ "afterEvaluate": [ "com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true" ], - "implementations": [ - "'com.google.android.gms:play-services-wallet:16.0.0'" - ], + "implementations": ["'com.google.android.gms:play-services-wallet:16.0.0'"], "package": "com.gettipsi.stripe.StripeReactPackage" }, "ios": { diff --git a/packages/config-templates/rnv.json b/packages/config-templates/rnv.json new file mode 100644 index 000000000..68e5672fd --- /dev/null +++ b/packages/config-templates/rnv.json @@ -0,0 +1,3717 @@ +{ + "$schema": "../../.rnv/schema/renative-1.0.schema.json", + "templates": { + "projectTemplates": { + "@rnv/template-starter": { + "description": "Multiplatform 'hello world' template" + }, + "@flexn/create-template-starter": { + "description": "Advanced multiplatform template using flexn Create SDK" + } + }, + "engineTemplates": { + "@rnv/engine-rn": { + "version": "1.4.0-rc.0", + "id": "engine-rn" + }, + "@rnv/engine-rn-tvos": { + "version": "1.4.0-rc.0", + "id": "engine-rn-tvos" + }, + "@rnv/engine-rn-web": { + "version": "1.4.0-rc.0", + "id": "engine-rn-web" + }, + "@rnv/engine-rn-next": { + "version": "1.4.0-rc.0", + "id": "engine-rn-next" + }, + "@rnv/engine-rn-electron": { + "version": "1.4.0-rc.0", + "id": "engine-rn-electron" + }, + "@rnv/engine-lightning": { + "version": "1.4.0-rc.0", + "id": "engine-lightning" + }, + "@rnv/engine-rn-macos": { + "version": "1.4.0-rc.0", + "id": "engine-rn-macos" + }, + "@rnv/engine-rn-windows": { + "version": "1.4.0-rc.0", + "id": "engine-rn-windows" + } + }, + "integrationTemplates": { + "@rnv/integration-vercel": { + "version": "0.2.0-alpha.0" + }, + "@rnv/integration-docker": { + "version": "0.1.0-alpha.0" + } + }, + "platformTemplates": { + "ios": { + "engine": "engine-rn" + }, + "android": { + "engine": "engine-rn" + }, + "androidwear": { + "engine": "engine-rn" + }, + "androidtv": { + "engine": "engine-rn-tvos" + }, + "firetv": { + "engine": "engine-rn-tvos" + }, + "tvos": { + "engine": "engine-rn-tvos" + }, + "macos": { + "engine": "engine-rn-electron" + }, + "windows": { + "engine": "engine-rn-electron" + }, + "linux": { + "engine": "engine-rn-electron" + }, + "xbox": { + "engine": "engine-rn-windows" + }, + "tizen": { + "engine": "engine-rn-web" + }, + "tizenmobile": { + "engine": "engine-rn-web" + }, + "tizenwatch": { + "engine": "engine-rn-web" + }, + "webos": { + "engine": "engine-rn-web" + }, + "chromecast": { + "engine": "engine-rn-web" + }, + "kaios": { + "engine": "engine-rn-web" + }, + "web": { + "engine": "engine-rn-next" + }, + "webtv": { + "engine": "engine-rn-web" + } + }, + "pluginTemplates": { + "react-dev-utils": { + "disableNpm": true, + "nodeModuleOverrides": { + "^12.0.0": { + "fileOverrides": { + "clearConsole.js": { + "input_line_xxx": "output_line_xxxx" + } + } + } + } + }, + "@bam.tech/react-native-image-resizer": { + "version": "3.0.7", + "ios": { + "podName": "react-native-image-resizer" + }, + "tvos": { + "podName": "react-native-image-resizer" + }, + "macos": { + "podName": "react-native-image-resizer" + }, + "android": { + "package": "com.reactnativeimageresizer.ImageResizerPackage" + }, + "androidtv": { + "package": "com.reactnativeimageresizer.ImageResizerPackage" + }, + "firetv": { + "package": "com.reactnativeimageresizer.ImageResizerPackage" + } + }, + "@flexn/create": { + "version": "1.3.0-feat-rnv-update.8", + "androidtv": { + "templateAndroid": { + "MainActivity_kt": { + "imports": ["io.flexn.create.TvRemoteHandlerModule", "android.view.KeyEvent"], + "methods": [ + "override fun dispatchKeyEvent(ev: KeyEvent?): Boolean {", + "TvRemoteHandlerModule.getInstance().handleKeyEvent(ev)", + "return super.dispatchKeyEvent(ev)", + "}" + ] + } + } + }, + "firetv": { + "templateAndroid": { + "MainActivity_kt": { + "imports": ["io.flexn.create.TvRemoteHandlerModule", "android.view.KeyEvent"], + "methods": [ + "override fun dispatchKeyEvent(ev: KeyEvent?): Boolean {", + "TvRemoteHandlerModule.getInstance().handleKeyEvent(ev)", + "return super.dispatchKeyEvent(ev)", + "}" + ] + } + } + }, + "webpackConfig": { + "modulePaths": true + }, + "tvos": { + "podName": "FlexnCreate" + } + }, + "@flexn/recyclerlistview": { + "version": "4.2.7", + "webpackConfig": { + "modulePaths": true, + "moduleAliases": true, + "nextTranspileModules": ["@flexn/recyclerlistview"] + } + }, + "@flexn/sdk": { + "androidtv": { + "package": "io.flexn.sdk.FlexnSdkPackage", + "projectName": "flexn-io-sdk" + }, + "firetv": { + "package": "io.flexn.sdk.FlexnSdkPackage", + "projectName": "flexn-io-sdk" + }, + "tvos": { + "podName": "FlexnSDK" + }, + "version": "0.20.0-alpha.25", + "webpackConfig": { + "moduleAliases": true, + "modulePaths": true + } + }, + "@flexn/shopify-flash-list": { + "android": { + "package": "com.shopify.reactnative.flash_list.ReactNativeFlashListPackage" + }, + "androidtv": { + "package": "com.shopify.reactnative.flash_list.ReactNativeFlashListPackage" + }, + "firetv": { + "package": "com.shopify.reactnative.flash_list.ReactNativeFlashListPackage" + }, + "ios": { + "podName": "RNFlashList" + }, + "tvos": { + "podName": "RNFlashList" + }, + "macos": { + "podName": "RNFlashList" + }, + "webpackConfig": { + "modulePaths": true, + "moduleAliases": true, + "nextTranspileModules": ["@flexn/shopify-flash-list"] + }, + "version": "1.4.9" + }, + "@flexn/typescript": { + "version": "0.2.4" + }, + "@lightningjs/cli": { + "version": "2.13.0" + }, + "@lightningjs/sdk": { + "version": "5.5.1" + }, + "@lightningjs/core": { + "version": "2.12.1" + }, + "@lightningjs/ui": { + "version": "1.3.19" + }, + "@lightningjs/ui-components": { + "version": "2.20.7" + }, + "@mapbox/react-native-mapbox-gl": { + "android": { + "implementation": " implementation (project(':mapbox-react-native-mapbox-gl')) {\n implementation ('com.squareup.okhttp3:okhttp:3.6.0') {\n force = true\n }\n }", + "package": "com.mapbox.rctmgl.RCTMGLPackage", + "path": "{{PLUGIN_ROOT}}/android/rctmgl", + "projectName": "mapbox-react-native-mapbox-gl" + }, + "androidtv": { + "implementation": " implementation (project(':mapbox-react-native-mapbox-gl')) {\n implementation ('com.squareup.okhttp3:okhttp:3.6.0') {\n force = true\n }\n }", + "package": "com.mapbox.rctmgl.RCTMGLPackage", + "path": "{{PLUGIN_ROOT}}/android/rctmgl", + "projectName": "mapbox-react-native-mapbox-gl" + }, + "firetv": { + "implementation": " implementation (project(':mapbox-react-native-mapbox-gl')) {\n implementation ('com.squareup.okhttp3:okhttp:3.6.0') {\n force = true\n }\n }", + "package": "com.mapbox.rctmgl.RCTMGLPackage", + "path": "{{PLUGIN_ROOT}}/android/rctmgl", + "projectName": "mapbox-react-native-mapbox-gl" + }, + "ios": { + "podName": "react-native-mapbox-gl" + }, + "tvos": { + "podName": "react-native-mapbox-gl" + }, + "version": "github:nitaliano/react-native-mapbox-gl" + }, + "@miblanchard/react-native-slider": { + "version": "2.6.0", + "webpackConfig": { + "moduleAliases": true, + "modulePaths": true + } + }, + "@monterosa/react-native-parallax-scroll": { + "version": "1.8.0", + "webpackConfig": { + "moduleAliases": { + "@monterosa/react-native-parallax-scroll": { + "projectPath": "{{PLUGIN_ROOT}}" + } + }, + "modulePaths": true + } + }, + "@noriginmedia/react-spatial-navigation": { + "version": "2.12.9" + }, + "@notifee/react-native": { + "android": { + "BuildGradle": { + "allprojects": { + "repositories": { + " maven { url \"{{resolvePackage(@notifee/react-native)}}/android/libs\" }": true + } + } + }, + "package": "io.invertase.notifee.NotifeePackage", + "path": "{{PLUGIN_ROOT}}/android", + "projectName": "@notifee-react-native" + }, + "ios": { + "path": "{{PLUGIN_ROOT}}", + "podName": "RNNotifee" + }, + "version": "5.3.0" + }, + "@reach/router": "1.3.4", + "@react-native-async-storage/async-storage": { + "android": { + "package": "com.reactnativecommunity.asyncstorage.AsyncStoragePackage", + "projectName": "react-native-community-async-storage" + }, + "androidtv": { + "package": "com.reactnativecommunity.asyncstorage.AsyncStoragePackage", + "projectName": "react-native-community-async-storage" + }, + "firetv": { + "package": "com.reactnativecommunity.asyncstorage.AsyncStoragePackage", + "projectName": "react-native-community-async-storage" + }, + "ios": { + "podName": "RNCAsyncStorage" + }, + "macos": { + "podName": "RNCAsyncStorage" + }, + "tvos": { + "podName": "RNCAsyncStorage" + }, + "version": "1.17.10", + "webpackConfig": { + "modulePaths": true + } + }, + "@react-native-camera-roll/camera-roll": { + "android": { + "package": "com.reactnativecommunity.cameraroll.CameraRollPackage" + }, + "ios": { + "podName": "react-native-cameraroll" + }, + "version": "7.3.0" + }, + "@react-native-clipboard/clipboard": { + "version": "1.12.1", + "ios": { + "podName": "RNCClipboard" + }, + "macos": { + "podName": "RNCClipboard" + }, + "android": { + "package": "com.reactnativecommunity.clipboard.ClipboardPackage", + "path": "{{PLUGIN_ROOT}}/android" + } + }, + "@react-native-community/async-storage": { + "android": { + "package": "com.reactnativecommunity.asyncstorage.AsyncStoragePackage", + "projectName": "react-native-community-async-storage" + }, + "androidtv": { + "package": "com.reactnativecommunity.asyncstorage.AsyncStoragePackage", + "projectName": "react-native-community-async-storage" + }, + "firetv": { + "package": "com.reactnativecommunity.asyncstorage.AsyncStoragePackage", + "projectName": "react-native-community-async-storage" + }, + "ios": { + "podName": "RNCAsyncStorage" + }, + "macos": { + "podName": "RNCAsyncStorage" + }, + "tvos": { + "podName": "RNCAsyncStorage" + }, + "version": "1.12.1", + "webpackConfig": { + "modulePaths": true + } + }, + "@react-native-community/blur": { + "android": { + "package": "com.cmcewen.blurview.BlurViewPackage", + "path": "{{PLUGIN_ROOT}}/android", + "projectName": "react-native-community-blur" + }, + "androidtv": { + "package": "com.cmcewen.blurview.BlurViewPackage", + "path": "{{PLUGIN_ROOT}}/android", + "projectName": "react-native-community-blur" + }, + "firetv": { + "package": "com.cmcewen.blurview.BlurViewPackage", + "path": "{{PLUGIN_ROOT}}/android", + "projectName": "react-native-community-blur" + }, + "ios": { + "path": "{{PLUGIN_ROOT}}", + "podName": "react-native-blur" + }, + "tvos": { + "path": "{{PLUGIN_ROOT}}", + "podName": "react-native-blur" + }, + "version": "4.3.0", + "web": null + }, + "@react-native-community/cameraroll": { + "android": { + "package": "com.reactnativecommunity.cameraroll.CameraRollPackage" + }, + "ios": { + "podName": "react-native-cameraroll" + }, + "version": "1.2.1" + }, + "@react-native-community/checkbox": { + "android": { + "package": "com.reactnativecommunity.checkbox.ReactCheckBoxPackage" + }, + "androidtv": { + "package": "com.reactnativecommunity.checkbox.ReactCheckBoxPackage" + }, + "firetv": { + "package": "com.reactnativecommunity.checkbox.ReactCheckBoxPackage" + }, + "ios": { + "podName": "RNCCheckbox" + }, + "macos": { + "podName": "RNCCheckbox" + }, + "tvos": { + "podName": "RNCCheckbox" + }, + "version": "0.5.9" + }, + "@react-native-community/cli": { + "disableNpm": true, + "version": "^12.3.6", + "supportedPlatforms": ["tvos", "ios"] + }, + "@react-native-community/cli-platform-android": { + "version": "^12.3.6" + }, + "@react-native-community/cli-platform-ios": { + "version": "12.3.6", + "disablePluginTemplateOverrides": false, + "disableNpm": true, + "supportedPlatforms": ["tvos", "ios"], + "nodeModuleOverrides": { + "^12.3.6": { + "fileOverrides": { + "build/tools/listIOSDevices.js": { + "rawOutput.filter(device => !device.platform.includes('macos')).sort(device => device.simulator ? 1 : -1).map(device => {": "rawOutput.sort(device => device.simulator ? 1 : -1).map(device => { // <= PATCHED BY RENATIVE" + }, + "build/commands/runIOS/index.js": { + "_cliTools().logger.error(`Could not find a device named: \"${_chalk().default.bold(String(deviceName))}\". ${printFoundDevices(devices)}`);": "_cliTools().logger.error(`Could not find a device: \"${_chalk().default.bold(String(deviceName))}\". ${printFoundDevices(devices)}`);\n throw 'Could not find device'; // <= PATCHED BY RENATIVE" + } + }, + "overridesFolderName": "overrides@12.3.6" + } + } + }, + "@react-native-community/clipboard": { + "android": { + "package": "com.reactnativecommunity.clipboard.ClipboardPackage" + }, + "ios": { + "podName": "RNCClipboard" + }, + "macos": { + "podName": "RNCClipboard" + }, + "version": "1.5.1" + }, + "@react-native-community/datetimepicker": { + "version": "7.5.0", + "ios": { + "podName": "RNDateTimePicker" + }, + "macos": { + "podName": "RNDateTimePicker" + }, + "android": { + "package": "com.reactcommunity.rndatetimepicker.RNDateTimePickerPackage" + } + }, + "@react-native-community/geolocation": { + "android": { + "package": "com.reactnativecommunity.geolocation.GeolocationPackage", + "path": "{{PLUGIN_ROOT}}/android" + }, + "ios": { + "path": "{{PLUGIN_ROOT}}", + "podName": "react-native-geolocation" + }, + "version": "2.0.2" + }, + "@react-native-community/masked-view": { + "android": { + "package": "org.reactnative.maskedview.RNCMaskedViewPackage", + "path": "{{PLUGIN_ROOT}}/android", + "projectName": "react-native-community-masked-view" + }, + "androidtv": { + "package": "org.reactnative.maskedview.RNCMaskedViewPackage", + "path": "{{PLUGIN_ROOT}}/android", + "projectName": "react-native-community-masked-view" + }, + "firetv": { + "package": "org.reactnative.maskedview.RNCMaskedViewPackage", + "path": "{{PLUGIN_ROOT}}/android", + "projectName": "react-native-community-masked-view" + }, + "ios": { + "path": "{{PLUGIN_ROOT}}", + "podName": "RNCMaskedView" + }, + "tvos": { + "path": "{{PLUGIN_ROOT}}", + "podName": "RNCMaskedView" + }, + "version": "0.1.6" + }, + "@react-native-community/netinfo": { + "android": { + "package": "com.reactnativecommunity.netinfo.NetInfoPackage", + "projectName": "react-native-community-netinfo" + }, + "androidtv": { + "package": "com.reactnativecommunity.netinfo.NetInfoPackage" + }, + "androidwear": { + "package": "com.reactnativecommunity.netinfo.NetInfoPackage" + }, + "firetv": { + "package": "com.reactnativecommunity.netinfo.NetInfoPackage" + }, + "ios": { + "path": "{{PLUGIN_ROOT}}", + "podName": "react-native-netinfo" + }, + "tvos": { + "podName": "react-native-netinfo" + }, + "version": "11.3.2", + "webpackConfig": { + "moduleAliases": { + "@react-native-community/netinfo": { + "projectPath": "{{PLUGIN_ROOT}}/web" + } + }, + "modulePaths": true + } + }, + "@react-native-community/push-notification-ios": { + "supportedPlatforms": ["ios"], + "ios": { + "podName": "RNCPushNotificationIOS", + "templateXcode": { + "AppDelegate_h": { + "appDelegateExtensions": ["UNUserNotificationCenterDelegate"], + "appDelegateImports": [ + "", + "" + ] + }, + "AppDelegate_mm": { + "appDelegateImports": [""], + "appDelegateMethods": { + "application": { + "didRegisterForRemoteNotificationsWithDeviceToken": [ + "[RNCPushNotificationIOS didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]" + ], + "didReceiveRemoteNotification": [ + "[RNCPushNotificationIOS didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler]" + ], + "didFailToRegisterForRemoteNotificationsWithError": [ + "[RNCPushNotificationIOS didFailToRegisterForRemoteNotificationsWithError:error]" + ], + "didFinishLaunchingWithOptions": [ + "UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]", + "center.delegate = self" + ] + }, + "userNotificationCenter": { + "willPresent": [ + "completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge)" + ], + "didReceiveNotificationResponse": [ + "[RNCPushNotificationIOS didReceiveNotificationResponse:response]" + ] + } + } + } + } + }, + "version": "1.11.0" + }, + "@react-native-community/slider": { + "android": { + "package": "com.reactnativecommunity.slider.ReactSliderPackage" + }, + "ios": { + "podName": "react-native-slider" + }, + "macos": { + "podName": "react-native-slider" + }, + "version": "4.5.2" + }, + "@react-native-community/viewpager": { + "android": { + "package": "com.reactnativecommunity.viewpager.RNCViewPagerPackage", + "path": "{{PLUGIN_ROOT}}/android" + }, + "ios": { + "path": "{{PLUGIN_ROOT}}", + "podName": "react-native-viewpager" + }, + "version": "5.0.11" + }, + "@react-native-firebase/analytics": { + "android": { + "package": "io.invertase.firebase.analytics.ReactNativeFirebaseAnalyticsPackage", + "projectName": "@react-native-firebase_analytics" + }, + "androidtv": { + "package": "io.invertase.firebase.analytics.ReactNativeFirebaseAnalyticsPackage", + "projectName": "@react-native-firebase_analytics" + }, + "firetv": { + "package": "io.invertase.firebase.analytics.ReactNativeFirebaseAnalyticsPackage", + "projectName": "@react-native-firebase_analytics" + }, + "ios": { + "appDelegateImports": ["Firebase"], + "appDelegateMethods": { + "application": { + "didFinishLaunchingWithOptions": [ + { + "order": -1, + "value": "FirebaseApp.configure()", + "weight": 1 + } + ] + } + }, + "isStatic": true, + "podName": "RNFBAnalytics", + "project_pbxproj": { + "resourceFiles": ["RNVApp/GoogleService-Info.plist"] + } + }, + "pluginDependencies": { + "@react-native-firebase/app": "source:rnv" + }, + "version": "20.0.0" + }, + "@react-native-firebase/app": { + "android": { + "templateAndroid": {}, + "AndroidManifest_xml": { + "children": [ + { + "android:name": ".MainApplication", + "children": [ + { + "android:name": "com.google.firebase.messaging.default_notification_icon", + "android:resource": "@mipmap/ic_launcher", + "tag": "meta-data" + } + ], + "tag": "application" + } + ] + }, + "app_build_gradle": { + "apply": ["plugin: 'com.google.gms.google-services'"] + }, + "build_gradle": { + "buildscript": { + "dependencies": ["classpath 'com.google.gms:google-services:4.3.14'"] + } + }, + "package": "io.invertase.firebase.app.ReactNativeFirebaseAppPackage", + "projectName": "@react-native-firebase_app" + }, + "androidtv": { + "app_build_gradle": { + "apply": ["plugin: 'com.google.gms.google-services'"] + }, + "build_gradle": { + "buildscript": { + "dependencies": ["classpath 'com.google.gms:google-services:4.2.0'"] + } + }, + "package": "io.invertase.firebase.app.ReactNativeFirebaseAppPackage", + "projectName": "@react-native-firebase_app" + }, + "firetv": { + "app_build_gradle": { + "apply": ["plugin: 'com.google.gms.google-services'"] + }, + "build_gradle": { + "buildscript": { + "dependencies": ["classpath 'com.google.gms:google-services:4.2.0'"] + } + }, + "package": "io.invertase.firebase.app.ReactNativeFirebaseAppPackage", + "projectName": "@react-native-firebase_app" + }, + "ios": { + "appDelegateImports": ["Firebase"], + "appDelegateMethods": { + "application": { + "didFinishLaunchingWithOptions": ["FirebaseApp.configure()"] + } + }, + "isStatic": true, + "podName": "RNFBApp", + "project_pbxproj": { + "resourceFiles": ["RNVApp/GoogleService-Info.plist"] + } + }, + "version": "20.0.0" + }, + "@react-native-firebase/auth": { + "android": { + "package": "io.invertase.firebase.auth.ReactNativeFirebaseAuthPackage", + "projectName": "@react-native-firebase_auth" + }, + "ios": { + "appDelegateImports": ["Firebase"], + "appDelegateMethods": { + "application": { + "didFinishLaunchingWithOptions": [ + { + "order": -1, + "value": "FirebaseApp.configure()", + "weight": 1 + } + ] + } + }, + "isStatic": true, + "podName": "RNFBAuth", + "project_pbxproj": { + "resourceFiles": ["RNVApp/GoogleService-Info.plist"] + } + }, + "pluginDependencies": { + "@react-native-firebase/app": "source:rnv" + }, + "version": "20.0.0" + }, + "@react-native-firebase/crashlytics": { + "android": { + "templateAndroid": { + "app_build_gradle": { + "apply": ["plugin: 'io.fabric'"] + }, + "BuildGradle": { + "buildscript": { + "dependencies": { + "classpath 'com.google.firebase:firebase-crashlytics-gradle:3.0.0'": true + } + } + }, + "implementations": ["'com.google.android.material:material:1.2.1'"] + }, + "package": "io.invertase.firebase.crashlytics.ReactNativeFirebaseCrashlyticsPackage", + "projectName": "@react-native-firebase_crashlytics" + }, + "androidtv": { + "extendPlatform": "android" + }, + "ios": { + "templateXcode": { + "AppDelegate_h": { + "appDelegateImports": ["Firebase"] + }, + "appDelegateMethods": { + "application": { + "didFinishLaunchingWithOptions": [ + { + "order": -1, + "value": "FirebaseApp.configure()", + "weight": 1 + } + ] + } + }, + "project_pbxproj": { + "buildPhases": [ + { + "shellPath": "/bin/sh", + "shellScript": "\"${PODS_ROOT}/Fabric/run\"" + } + ], + "resourceFiles": ["RNVApp/GoogleService-Info.plist"] + } + }, + "isStatic": true, + "podName": "RNFBCrashlytics" + }, + "pluginDependencies": { + "@react-native-firebase/analytics": "source:rnv" + }, + "version": "20.0.0" + }, + "@react-native-firebase/messaging": { + "android": { + "package": "io.invertase.firebase.messaging.ReactNativeFirebaseMessagingPackage", + "projectName": "@react-native-firebase_messaging" + }, + "androidtv": { + "extendPlatform": "android" + }, + "firetv": { + "extendPlatform": "android" + }, + "ios": { + "isStatic": true, + "podName": "RNFBMessaging" + }, + "pluginDependencies": { + "@react-native-firebase/app": "source:rnv" + }, + "version": "20.0.0" + }, + "@react-native-firebase/storage": { + "android": { + "package": "io.invertase.firebase.storage.ReactNativeFirebaseStoragePackage", + "projectName": "@react-native-firebase_storage" + }, + "ios": { + "templateXcode": { + "project_pbxproj": { + "resourceFiles": ["RNVApp/GoogleService-Info.plist"] + }, + "appDelegateImports": ["Firebase"], + "appDelegateMethods": { + "application": { + "didFinishLaunchingWithOptions": [ + { + "order": -1, + "value": "FirebaseApp.configure()", + "weight": 1 + } + ] + } + } + }, + "isStatic": true, + "podName": "RNFBStorage" + }, + "pluginDependencies": { + "@react-native-firebase/app": "source:rnv" + }, + "version": "20.0.0" + }, + "@react-native-masked-view/masked-view": { + "android": { + "package": "org.reactnative.maskedview.RNCMaskedViewPackage", + "projectName": "react-native-masked-view-masked-view" + }, + "androidtv": { + "extendPlatform": "android" + }, + "firetv": { + "extendPlatform": "android" + }, + "ios": { + "podName": "RNCMaskedView" + }, + "tvos": { + "podName": "RNCMaskedView" + }, + "version": "0.2.9" + }, + "@react-native-picker/picker": { + "android": { + "package": "com.reactnativecommunity.picker.RNCPickerPackage" + }, + "androidtv": { + "extendPlatform": "android" + }, + "firetv": { + "extendPlatform": "android" + }, + "ios": { + "podName": "RNCPicker" + }, + "macos": { + "podName": "RNCPicker" + }, + "tvos": { + "podName": "RNCPicker" + }, + "version": "2.7.6" + }, + "@react-native-windows/cli": { + "version": "0.67.1" + }, + "@react-navigation/bottom-tabs": { + "version": "6.5.19", + "webpackConfig": { + "modulePaths": true + } + }, + "@react-navigation/core": { + "version": "6.4.15", + "webpackConfig": { + "modulePaths": true + } + }, + "@react-navigation/drawer": { + "version": "6.6.14", + "webpackConfig": { + "modulePaths": true + } + }, + "@react-navigation/material-bottom-tabs": { + "version": "6.2.27", + "webpackConfig": { + "modulePaths": true + } + }, + "@react-navigation/material-top-tabs": { + "version": "6.6.12", + "webpackConfig": { + "modulePaths": true + } + }, + "@react-navigation/native": { + "version": "6.1.16", + "webpackConfig": { + "modulePaths": true + } + }, + "@react-navigation/native-stack": { + "version": "6.9.25", + "webpackConfig": { + "modulePaths": true + } + }, + "@react-navigation/routers": { + "version": "6.1.9", + "webpackConfig": { + "modulePaths": true + } + }, + "@react-navigation/stack": { + "version": "6.3.28", + "webpackConfig": { + "modulePaths": true + } + }, + "@react-navigation/elements": { + "version": "^1.3.29", + "webpackConfig": { + "modulePaths": true + } + }, + "@reduxjs/toolkit": { + "version": "^1.8.1" + }, + "@rnv/renative": { + "version": "1.4.0-rc.0" + }, + "@sentry/react": { + "version": "6.13.3" + }, + "@sentry/react-native": { + "android": { + "templateAndroid": { + "app_build_gradle": { + "apply": ["from: \"{{PLUGIN_ROOT}}/sentry.gradle\""] + } + }, + "implementation": "implementation project(':@sentry_react-native')", + "package": "io.sentry.react.RNSentryPackage", + "path": "{{PLUGIN_ROOT}}/android", + "projectName": "@sentry_react-native" + }, + "androidtv": { + "extendPlatform": "android" + }, + "firetv": { + "extendPlatform": "android" + }, + "ios": { + "podName": "RNSentry", + "project_pbxproj": { + "buildPhases": [ + { + "shellPath": "/bin/sh", + "shellScript": "export NODE_BINARY=node\nexport SENTRY_PROPERTIES=../sentry.properties" + } + ] + } + }, + "macos": { + "podName": "RNSentry" + }, + "version": "3.1.1" + }, + "@sentry/tracing": { + "version": "6.13.3" + }, + "@shopify/flash-list": { + "android": { + "package": "com.shopify.reactnative.flash_list.ReactNativeFlashListPackage" + }, + "androidtv": { + "package": "com.shopify.reactnative.flash_list.ReactNativeFlashListPackage" + }, + "firetv": { + "package": "com.shopify.reactnative.flash_list.ReactNativeFlashListPackage" + }, + "ios": { + "podName": "RNFlashList" + }, + "tvos": { + "podName": "RNFlashList" + }, + "macos": { + "podName": "RNFlashList" + }, + "webpackConfig": { + "modulePaths": true, + "moduleAliases": true + }, + "version": "1.4.1" + }, + "amazon-cognito-identity-js": { + "android": { + "package": "com.amazonaws.RNAWSCognitoPackage" + }, + "ios": { + "podName": "RNAWSCognito" + }, + "version": "5.2.11" + }, + "aws-amplify": "4.3.13", + "axios": "1.7.4", + "crashlytics": { + "android": { + "templateAndroid": { + "MainActivity_kt": { + "createMethods": [ + "val core = CrashlyticsCore.Builder().listener {}.build()", + "val crashlyticsKit = Crashlytics.Builder().core(core).build()", + "Fabric.with(this, crashlyticsKit)" + ], + "imports": [ + "com.crashlytics.android.Crashlytics", + "com.crashlytics.android.core.CrashlyticsCore" + ] + } + }, + "skipImplementation": true + }, + "deprecated": "crashlytics plugin is deprecated use Crashlytics (uppercase) in combination with Firebase", + "ios": { + "appDelegateImports": ["Crashlytics"], + "podName": "Crashlytics", + "version": "3.13.4" + }, + "disableNpm": true + }, + "Crashlytics": { + "android": { + "templateAndroid": { + "MainActivity_kt": { + "createMethods": [ + "val core = CrashlyticsCore.Builder().listener {}.build()", + "val crashlyticsKit = Crashlytics.Builder().core(core).build()", + "Fabric.with(this, crashlyticsKit)" + ], + "imports": [ + "com.crashlytics.android.Crashlytics", + "com.crashlytics.android.core.CrashlyticsCore" + ] + } + }, + "skipImplementation": true + }, + "androidtv": { + "extendPlatform": "android" + }, + "firetv": { + "extendPlatform": "android" + }, + "ios": { + "podName": "Crashlytics", + "version": "3.13.4", + "templateXcode": { + "project_pbxproj": { + "buildPhases": [ + { + "shellPath": "/bin/sh", + "shellScript": "\"${PODS_ROOT}/Fabric/upload-symbols\" -gsp \"${PROJECT_DIR}/RNVApp/GoogleService-Info.plist\" -p ios \"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}\"" + } + ] + } + } + }, + "disableNpm": true + }, + "deepmerge": "4.2.2", + "detox": { + "android": { + "defaultConfig": [ + "testBuildType System.getProperty('testBuildType', 'debug')", + "testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'" + ] + }, + "BuildGradle": { + "allprojects": { + "repositories": { + " maven { url \"{{resolvePackage(detox)}}/Detox-android\" }": true + } + } + }, + "implementation": "androidTestImplementation('com.wix:detox:+') { transitive = true }\nandroidTestImplementation 'junit:junit:4.12'", + "version": "19.5.3" + }, + "fabric": { + "android": { + "templateAndroid": { + "app_build_gradle": { + "apply": ["plugin: 'io.fabric'"] + }, + "build_gradle": { + "buildscript": { + "dependencies": ["classpath 'io.fabric.tools:gradle:1.25.4'"] + }, + "repositories": ["maven { url 'https://maven.fabric.io/public' }"] + }, + "BuildGradle": { + "allprojects": { + "repositories": { + "maven { url 'https://maven.fabric.io/public' }": true + } + }, + "buildscript": { + "dependencies": { + "classpath 'io.fabric.tools:gradle:1.25.4'": true + }, + "repositories": { + "maven { url 'https://maven.fabric.io/public' }": true + } + } + }, + "MainActivity_kt": { + "imports": ["io.fabric.sdk.android.Fabric"] + } + }, + "implementation": "implementation('com.crashlytics.sdk.android:crashlytics:2.8.0@aar') {\n transitive = true\n }" + }, + "androidtv": { + "extendPlatform": "android" + }, + "deprecated": "fabric plugin is deprecated use Fabric (uppercase) in combination with Firebase", + "firetv": { + "extendPlatform": "android" + }, + "ios": { + "appDelegateImports": ["Fabric"], + "appDelegateMethods": { + "application": { + "didFinishLaunchingWithOptions": ["Fabric.with([Crashlytics.self])"] + } + }, + "Info_plist": { + "Fabric": { + "APIKey": "", + "Kits": [ + { + "KitInfo": {}, + "KitName": "Crashlytics" + } + ] + } + }, + "podName": "Fabric", + "version": "1.10.2" + }, + "disableNpm": true + }, + "Fabric": { + "android": { + "templateAndroid": { + "app_build_gradle": { + "apply": ["plugin: 'io.fabric'"] + }, + "build_gradle": { + "buildscript": { + "dependencies": ["classpath 'io.fabric.tools:gradle:1.25.4'"] + }, + "repositories": ["maven { url 'https://maven.fabric.io/public' }"] + }, + "BuildGradle": { + "allprojects": { + "repositories": { + "maven { url 'https://maven.fabric.io/public' }": true + } + }, + "buildscript": { + "dependencies": { + "classpath 'io.fabric.tools:gradle:1.25.4'": true + }, + "repositories": { + "maven { url 'https://maven.fabric.io/public' }": true + } + } + }, + "MainActivity_kt": { + "imports": ["io.fabric.sdk.android.Fabric"] + } + }, + "implementation": "implementation('com.crashlytics.sdk.android:crashlytics:2.8.0@aar') {\n transitive = true\n }" + }, + "androidtv": { + "extendPlatform": "android" + }, + "ios": { + "podName": "Fabric", + "version": "1.10.2", + "project_pbxproj": { + "buildPhases": [ + { + "shellPath": "/bin/sh", + "shellScript": "\"${PODS_ROOT}/Fabric/run\"" + } + ] + } + }, + "disableNpm": true + }, + "firebase-core": { + "deprecated": "firebase-core plugin is deprecated use Firebase/ instead", + "ios": { + "appDelegateImports": ["Firebase"], + "appDelegateMethods": { + "application": { + "didFinishLaunchingWithOptions": [ + "FirebaseApp.configure()", + "if #available(iOS 10.0, *) {", + " // For iOS 10 display notification (sent via APNS)", + " UNUserNotificationCenter.current().delegate = self", + " let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]", + " UNUserNotificationCenter.current().requestAuthorization(", + " options: authOptions,", + " completionHandler: {_, _ in })", + "} else {", + " let settings: UIUserNotificationSettings =", + " UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)", + " application.registerUserNotificationSettings(settings)", + "}", + "application.registerForRemoteNotifications()" + ] + } + }, + "podNames": [ + "Firebase/Core', '~> 6.3.0", + "Firebase/Analytics', '~> 6.3.0", + "Firebase/Auth', '~> 6.3.0", + "Firebase/Database', '~> 6.3.0", + "Firebase/DynamicLinks', '~> 6.3.0", + "Firebase/Messaging', '~> 6.3.0", + "Firebase/RemoteConfig', '~> 6.3.0", + "Firebase/Storage', '~> 6.3.0" + ] + }, + "disableNpm": true + }, + "Firebase/Analytics": { + "ios": { + "appDelegateImports": ["Firebase"], + "podNames": ["Firebase/Analytics', '~> 6.3.0"] + }, + "disableNpm": true + }, + "Firebase/Core": { + "ios": { + "appDelegateImports": ["Firebase"], + "appDelegateMethods": { + "application": { + "didFinishLaunchingWithOptions": [ + "FirebaseApp.configure()", + "if #available(iOS 10.0, *) {", + " // For iOS 10 display notification (sent via APNS)", + " UNUserNotificationCenter.current().delegate = self", + " let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]", + " UNUserNotificationCenter.current().requestAuthorization(", + " options: authOptions,", + " completionHandler: {_, _ in })", + "} else {", + " let settings: UIUserNotificationSettings =", + " UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)", + " application.registerUserNotificationSettings(settings)", + "}", + "application.registerForRemoteNotifications()" + ] + } + }, + "podNames": ["Firebase/Core', '~> 6.3.0"] + }, + "disableNpm": true + }, + "Firebase/Messaging": { + "ios": { + "appDelegateImports": ["Firebase"], + "podNames": ["Firebase/Messaging', '~> 6.3.0"] + }, + "disableNpm": true + }, + "google-maps": { + "ios": { + "appDelegateImports": ["GoogleMaps"], + "appDelegateMethods": { + "application": { + "didFinishLaunchingWithOptions": ["GMSServices.provideAPIKey(\"{{props.API_KEY}}\")"] + } + }, + "podName": "GoogleMaps", + "version": "6.1.1" + }, + "MAPS_API_KEY": "define_your_own_api_key", + "disableNpm": true, + "props": { + "API_KEY": "" + } + }, + "GoogleTagManager": { + "android": { + "implementation": "implementation('com.google.android.gms:play-services-tagmanager:18.0.1')" + }, + "ios": { + "podNames": ["GoogleTagManager', '~> 7.4.1"], + "project_pbxproj": { + "resourceFiles": ["RNVApp/container"] + } + }, + "disableNpm": true + }, + "hash-source": "1.0.5", + "ios-photo-editor": { + "deprecated": "ios-photo-editor is DEPRECATED. use iOSPhotoEditor instead", + "ios": { + "commit": "fa8894c992dedb431d696eb43ac4cc4ba847b4b8", + "git": "https://github.com/prscX/photo-editor", + "modular_headers": true, + "podName": "iOSPhotoEditor" + }, + "disableNpm": true + }, + "iOSPhotoEditor": { + "ios": { + "commit": "4924e9ec984d25d03644e58aa148282642171de9", + "git": "https://github.com/prscX/photo-editor", + "modular_headers": true, + "podName": "iOSPhotoEditor" + }, + "disableNpm": true + }, + "loader-utils": { + "version": "3.2.1" + }, + "lottie-react-native": { + "android": { + "package": "com.airbnb.android.react.lottie.LottiePackage", + "path": "{{PLUGIN_ROOT}}/src/android" + }, + "androidtv": { + "package": "com.airbnb.android.react.lottie.LottiePackage", + "path": "{{PLUGIN_ROOT}}/src/android" + }, + "firetv": { + "package": "com.airbnb.android.react.lottie.LottiePackage", + "path": "{{PLUGIN_ROOT}}/src/android" + }, + "ios": { + "podName": "lottie-react-native" + }, + "macos": { + "podName": "lottie-react-native" + }, + "npm": { + "lottie-ios": "3.4.1" + }, + "tvos": { + "podName": "lottie-react-native" + }, + "version": "5.1.5" + }, + "metro": { + "disableNpm": true + }, + "native-base": { + "pluginDependencies": { + "react-native-vector-icons": "source:rnv" + }, + "version": "2.12.1" + }, + "native-base-shoutem-theme": { + "version": "0.2.3", + "webpackConfig": { + "modulePaths": true + } + }, + "next": { + "version": "14.2.10", + "supportedPlatforms": ["web"] + }, + "next-seo": "4.28.1", + "RCTLinkingIOS": { + "ios": { + "appDelegateMethods": { + "application": { + "open": ["RCTLinkingManager.application(app, open: url, options: options)"] + } + } + }, + "disableNpm": true + }, + "RCTPushNotification": { + "deprecated": "RCTPushNotification is DEPRECATED. use @react-native-community/push-notification-ios instead", + "ios": { + "appDelegateMethods": { + "application": { + "didFailToRegisterForRemoteNotificationsWithError": [ + "RCTPushNotificationManager.didFailToRegisterForRemoteNotificationsWithError(error)" + ], + "didReceive": ["RCTPushNotificationManager.didReceive(notification)"], + "didReceiveRemoteNotification": [ + "RCTPushNotificationManager.didReceiveRemoteNotification(userInfo, fetchCompletionHandler: completionHandler)" + ], + "didRegister": ["RCTPushNotificationManager.didRegister(notificationSettings)"], + "didRegisterForRemoteNotificationsWithDeviceToken": [ + "RCTPushNotificationManager.didRegisterForRemoteNotifications(withDeviceToken: deviceToken)" + ] + }, + "userNotificationCenter": { + "willPresent": ["completionHandler([.alert, .badge, .sound])"] + } + } + }, + "disableNpm": true + }, + "react": { + "version": "18.3.1" + }, + "react-art": { + "version": "18.3.1" + }, + "react-dom": { + "version": "18.3.1" + }, + "react-hot-loader": { + "version": "4.3.12" + }, + "react-native": { + "android": { + "templateAndroid": { + "AndroidManifest_xml": { + "children": [ + { + "android:name": ".MainApplication", + "children": [ + { + "android:name": "uriScheme", + "android:value": "{{props.URL_SCHEME}}", + "tag": "meta-data" + }, + { + "android:name": ".MainActivity", + "children": [ + { + "children": [ + { + "android:scheme": "{{props.URL_SCHEME}}", + "tag": "data" + } + ], + "tag": "intent-filter" + } + ], + "tag": "activity" + } + ], + "tag": "application" + } + ] + } + }, + "implementation": "implementation ('com.facebook.react:react-native:+') {\n exclude group: 'com.android.support' \n exclude group: 'javax.inject' \n }", + "path": "react-native" + }, + "androidtv": { + "extendPlatform": "android" + }, + "androidwear": { + "extendPlatform": "android" + }, + "firetv": { + "extendPlatform": "android" + }, + "ios": { + "Info_plist": { + "CFBundleURLTypes": [ + { + "CFBundleURLName": "{{props.URL_NAME}}", + "CFBundleURLSchemes": ["{{props.URL_SCHEME}}"] + } + ] + }, + "Podfile": { + "sources": ["https://github.com/CocoaPods/Specs.git"] + } + }, + "macos": { + "Info_plist": { + "CFBundleURLTypes": [ + { + "CFBundleURLName": "{{props.URL_NAME}}", + "CFBundleURLSchemes": ["{{props.URL_SCHEME}}"] + } + ] + } + }, + "props": { + "URL_NAME": "", + "URL_SCHEME": "" + }, + "version": "0.73.4" + }, + "react-native-actionsheet": { + "version": "2.4.2" + }, + "react-native-activity-view": { + "ios": { + "podName": "react-native-activity-view" + }, + "version": "0.2.11", + "webpackConfig": { + "moduleAliases": true, + "modulePaths": true + } + }, + "react-native-airplay-ios": { + "ios": { + "path": "{{PLUGIN_ROOT}}/ios", + "podName": "RNAirplay" + }, + "version": "github:CHaNGeTe/react-native-airplay-ios#feature/cocoapods-support" + }, + "react-native-android-open-settings": { + "android": { + "package": "com.levelasquez.androidopensettings.AndroidOpenSettingsPackage" + }, + "version": "1.3.0" + }, + "react-native-animatable": { + "version": "1.3.3", + "webpackConfig": { + "nextTranspileModules": ["react-native-animatable"] + } + }, + "react-native-audio": { + "android": { + "package": "com.rnim.rn.audio.ReactNativeAudioPackage" + }, + "androidtv": { + "package": "com.rnim.rn.audio.ReactNativeAudioPackage" + }, + "firetv": { + "package": "com.rnim.rn.audio.ReactNativeAudioPackage" + }, + "ios": { + "podName": "RNAudio" + }, + "macos": { + "podName": "RNAudio" + }, + "tvos": { + "podName": "RNAudio" + }, + "version": "4.3.0" + }, + "react-native-auth0": { + "android": { + "templateAndroid": {}, + "AndroidManifest_xml": { + "children": [ + { + "android:name": ".MainApplication", + "children": [ + { + "android:name": ".MainActivity", + "children": [ + { + "children": [ + { + "android:host": "{{props.DOMAIN}}", + "android:pathPrefix": "/android/${applicationId}/callback", + "android:scheme": "${applicationId}", + "tag": "data" + } + ], + "tag": "intent-filter" + } + ], + "tag": "activity" + } + ], + "tag": "application" + } + ] + }, + "package": "com.auth0.react.A0Auth0Package", + "path": "{{PLUGIN_ROOT}}/android" + }, + "ios": { + "path": "{{PLUGIN_ROOT}}/ios", + "Info_plist": { + "CFBundleURLTypes": [ + { + "CFBundleTypeRole": "None", + "CFBundleURLName": "auth0", + "CFBundleURLSchemes": ["$(PRODUCT_BUNDLE_IDENTIFIER)"] + } + ] + }, + "podName": "A0Auth0" + }, + "pluginDependencies": { + "RCTLinkingIOS": "source:rnv" + }, + "props": { + "DOMAIN": "" + }, + "version": "2.1.0" + }, + "react-native-autocomplete-input": { + "version": "5.4.0", + "webpackConfig": { + "moduleAliases": true, + "modulePaths": true + } + }, + "react-native-biometrics": { + "android": { + "package": "com.rnbiometrics.ReactNativeBiometricsPackage", + "projectName": "react-native-biometrics" + }, + "ios": { + "podName": "react-native-biometrics" + }, + "version": "3.0.1" + }, + "react-native-ble-manager": { + "android": { + "package": "it.innove.BleManagerPackage" + }, + "androidtv": { + "package": "it.innove.BleManagerPackage" + }, + "androidwear": { + "package": "it.innove.BleManagerPackage" + }, + "firetv": { + "package": "it.innove.BleManagerPackage" + }, + "ios": { + "package": "it.innove.BleManagerPackage" + }, + "version": "7.4.2" + }, + "react-native-blob-util": { + "android": { + "package": "com.ReactNativeBlobUtil.ReactNativeBlobUtilPackage" + }, + "androidtv": { + "package": "com.ReactNativeBlobUtil.ReactNativeBlobUtilPackage" + }, + "ios": { + "podName": "react-native-blob-util" + }, + "macos": { + "podName": "react-native-blob-util" + }, + "version": "0.17.3" + }, + "react-native-cached-image": { + "version": "1.4.3" + }, + "react-native-call-log": { + "android": { + "package": "com.wscodelabs.callLogs.CallLogPackage" + }, + "androidtv": { + "package": "com.wscodelabs.callLogs.CallLogPackage" + }, + "firetv": { + "package": "com.wscodelabs.callLogs.CallLogPackage" + }, + "version": "2.1.2" + }, + "react-native-camera": { + "android": { + "app_build_gradle": { + "defaultConfig": ["missingDimensionStrategy 'react-native-camera', 'general'"] + }, + "package": "org.reactnative.camera.RNCameraPackage" + }, + "androidtv": { + "extendPlatform": "android" + }, + "firetv": { + "app_build_gradle": { + "defaultConfig": ["missingDimensionStrategy 'react-native-camera', 'general'"] + }, + "package": "org.reactnative.camera.RNCameraPackage" + }, + "ios": { + "podName": "react-native-camera" + }, + "macos": { + "podName": "react-native-camera" + }, + "version": "4.2.1", + "webpackConfig": { + "modulePaths": true + } + }, + "react-native-carplay": { + "supportedPlatforms": ["ios"], + "ios": { + "templateXcode": { + "AppDelegate_h": { + "appDelegateImports": ["CarPlay/CarPlay.h"], + "appDelegateExtensions": ["UIApplicationDelegate", "CPApplicationDelegate"] + }, + "AppDelegate_mm": { + "appDelegateImports": ["RNCarPlay.h"], + "appDelegateMethods": { + "application": { + "didConnectCarInterfaceController": [ + "[RNCarPlay connectWithInterfaceController:interfaceController window:window]" + ], + "didDisconnectCarInterfaceController": ["[RNCarPlay disconnect]"] + } + } + } + }, + "podName": "react-native-carplay" + }, + "version": "2.3.0" + }, + "react-native-circular-progress": { + "version": "1.3.0", + "webpackConfig": { + "modulePaths": true + } + }, + "react-native-community-geolocation": { + "android": { + "package": "com.agontuk.RNFusedLocation.RNFusedLocationPackage", + "path": "{{PLUGIN_ROOT}}/android" + }, + "ios": { + "podName": "react-native-geolocation-service" + }, + "macos": { + "podName": "react-native-geolocation-service" + }, + "version": "npm:react-native-geolocation-service@5.3.1", + "web": {} + }, + "react-native-contacts": { + "android": { + "package": "com.rt2zz.reactnativecontacts.ReactNativeContacts" + }, + "androidtv": { + "package": "com.rt2zz.reactnativecontacts.ReactNativeContacts" + }, + "firetv": { + "package": "com.rt2zz.reactnativecontacts.ReactNativeContacts" + }, + "ios": { + "podName": "react-native-contacts" + }, + "macos": { + "podName": "react-native-contacts" + }, + "version": "7.0.5" + }, + "react-native-datepicker": { + "ios": { + "appDelegateMethods": { + "application": { + "didFinishLaunchingWithOptions": [ + "if #available(iOS 14, *) { let picker = UIDatePicker.appearance(); picker.preferredDatePickerStyle = .wheels}" + ] + } + } + }, + "version": "1.7.2" + }, + "react-native-device-info": { + "android": { + "package": "com.learnium.RNDeviceInfo.RNDeviceInfo" + }, + "androidtv": { + "package": "com.learnium.RNDeviceInfo.RNDeviceInfo" + }, + "androidwear": { + "package": "com.learnium.RNDeviceInfo.RNDeviceInfo" + }, + "firetv": { + "package": "com.learnium.RNDeviceInfo.RNDeviceInfo" + }, + "ios": { + "podName": "RNDeviceInfo" + }, + "macos": { + "podName": "RNDeviceInfo" + }, + "tvos": { + "podName": "RNDeviceInfo" + }, + "version": "10.14.0", + "webpackConfig": { + "moduleAliases": true, + "modulePaths": true + } + }, + "react-native-dialog": { + "version": "5.6.0", + "webpackConfig": { + "modulePaths": true + } + }, + "react-native-document-picker": { + "android": { + "package": "com.reactnativedocumentpicker.DocumentPickerPackage" + }, + "androidtv": { + "package": "com.reactnativedocumentpicker.DocumentPickerPackage" + }, + "firetv": { + "package": "com.reactnativedocumentpicker.DocumentPickerPackage" + }, + "ios": { + "podName": "react-native-document-picker" + }, + "macos": { + "podName": "react-native-document-picker" + }, + "version": "8.2.0" + }, + "react-native-dominant-color": { + "android": { + "package": "cl.hasaezs.rndominantcolor.RNDominantColorPackage", + "path": "{{PLUGIN_ROOT}}/android" + }, + "androidtv": { + "package": "cl.hasaezs.rndominantcolor.RNDominantColorPackage", + "path": "{{PLUGIN_ROOT}}/android" + }, + "firetv": { + "package": "cl.hasaezs.rndominantcolor.RNDominantColorPackage", + "path": "{{PLUGIN_ROOT}}/android" + }, + "version": "1.0.0" + }, + "react-native-draggable-flatlist": { + "version": "1.1.7", + "webpackConfig": { + "modulePaths": true + } + }, + "react-native-drawer": { + "version": "0.14.4", + "webpackConfig": { + "modulePaths": true + } + }, + "react-native-dynamic-fonts": { + "android": { + "package": "org.th317erd.react.DynamicFontsPackage" + }, + "ios": { + "podName": "DynamicFonts" + }, + "macos": { + "podName": "DynamicFonts" + }, + "version": "0.3.2" + }, + "react-native-easy-grid": { + "version": "0.2.1", + "webpackConfig": { + "moduleAliases": true, + "modulePaths": true + } + }, + "react-native-exception-handler": { + "android": { + "package": "com.masteratul.exceptionhandler.ReactNativeExceptionHandlerPackage", + "SKIP:mainApplication": { + "createMethods": [ + "ReactNativeExceptionHandlerModule.setNativeExceptionHandler(object : NativeExceptionHandlerIfc {", + "override fun handleNativeException(thread: Thread?, throwable: Throwable?, originalHandler: Thread.UncaughtExceptionHandler?) {}})" + ], + "imports": [ + "com.masteratul.exceptionhandler.NativeExceptionHandlerIfc", + "com.masteratul.exceptionhandler.ReactNativeExceptionHandlerModule" + ] + } + }, + "androidtv": { + "package": "com.masteratul.exceptionhandler.ReactNativeExceptionHandlerPackage" + }, + "firetv": { + "package": "com.masteratul.exceptionhandler.ReactNativeExceptionHandlerPackage" + }, + "ios": { + "path": "{{PLUGIN_ROOT}}/ios", + "podName": "ReactNativeExceptionHandler" + }, + "version": "2.10.0" + }, + "react-native-extended-stylesheet": { + "version": "0.12.0" + }, + "react-native-extract-color": { + "ios": { + "path": "{{PLUGIN_ROOT}}/ios", + "podName": "RNExtractColor" + }, + "tvos": { + "path": "{{PLUGIN_ROOT}}/ios", + "podName": "RNExtractColor" + }, + "version": "github:kasinskas/react-native-extract-color" + }, + "react-native-fabric": { + "ios": { + "podName": "ReactNativeFabric" + }, + "tvos": { + "podName": "ReactNativeFabric" + }, + "version": "" + }, + "react-native-fast-image": { + "android": { + "package": "com.dylanvann.fastimage.FastImageViewPackage" + }, + "androidtv": { + "package": "com.dylanvann.fastimage.FastImageViewPackage" + }, + "firetv": { + "package": "com.dylanvann.fastimage.FastImageViewPackage" + }, + "ios": { + "podName": "react-native-fast-image" + }, + "tvos": { + "podName": "react-native-fast-image" + }, + "version": "7.0.2", + "webpackConfig": { + "modulePaths": true + } + }, + "react-native-fbsdk": { + "android": { + "templateAndroid": { + "AndroidManifest_xml": { + "children": [ + { + "android:name": ".MainApplication", + "children": [ + { + "android:name": "com.facebook.sdk.ApplicationId", + "android:value": "@string/facebook_app_id", + "tag": "meta-data" + } + ], + "tag": "application" + } + ] + }, + "implementations": ["'com.facebook.android:facebook-android-sdk:[4,5)'"], + "imports": ["com.facebook.CallbackManager"], + "MainActivity_kt": { + "createMethods": [], + "imports": [], + "resultMethods": [ + "MainApplication.getCallbackManager().onActivityResult(requestCode, resultCode, data)" + ] + }, + "mainApplication": { + "methods": [ + " companion object {\n @JvmStatic \n private val mCallbackManager = CallbackManager.Factory.create() \n fun getCallbackManager(): CallbackManager = mCallbackManager \n}" + ] + }, + "ResourceStrings": { + "children": [ + { + "child_value": "{{props.APP_ID}}", + "name": "facebook_app_id", + "tag": "string" + } + ] + } + }, + "package": "com.facebook.reactnative.androidsdk.FBSDKPackage" + }, + "androidtv": { + "extendPlatform": "android" + }, + "firetv": { + "extendPlatform": "android" + }, + "ios": { + "appDelegateImports": ["FBSDKCoreKit"], + "appDelegateMethods": { + "application": { + "didFinishLaunchingWithOptions": [ + "ApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)" + ], + "open": ["ApplicationDelegate.shared.application(app, open: url, options: options)"] + } + }, + "Info_plist": { + "CFBundleURLTypes": [ + { + "CFBundleTypeRole": "Editor", + "CFBundleURLSchemes": ["fb{{props.APP_ID}}"] + } + ], + "FacebookAppID": "{{props.APP_ID}}", + "FacebookDisplayName": "{{props.APP_NAME}}", + "LSApplicationQueriesSchemes": [ + "fbapi", + "fb-messenger-share-api", + "fbauth2", + "fbshareextension" + ] + }, + "podName": "react-native-fbsdk" + }, + "props": { + "APP_ID": "", + "APP_NAME": "", + "QUERIES_SCHEMES": null, + "URL_SCHEMES": null + }, + "version": "1.0.4" + }, + "react-native-fetch-blob": { + "android": { + "package": "com.RNFetchBlob.RNFetchBlobPackage" + }, + "androidtv": { + "package": "com.RNFetchBlob.RNFetchBlobPackage" + }, + "deprecated": "react-native-fetch-blob plugin is DEPRECATED. use rn-fetch-blob instead", + "firetv": { + "package": "com.RNFetchBlob.RNFetchBlobPackage" + }, + "ios": { + "podName": "react-native-fetch-blob" + }, + "macos": { + "podName": "react-native-fetch-blob" + }, + "tvos": { + "podName": "react-native-fetch-blob" + }, + "version": "0.10.8" + }, + "react-native-fingerprint-scanner": { + "android": { + "package": "com.hieuvp.fingerprint.ReactNativeFingerprintScannerPackage", + "projectName": "react-native-fingerprint-scanner" + }, + "ios": { + "podName": "react-native-fingerprint-scanner" + }, + "version": "6.0.0" + }, + "react-native-firebase": { + "android": { + "templateAndroid": { + "AndroidManifest_xml": { + "children": [ + { + "android:name": ".MainApplication", + "children": [ + { + "android:name": "com.google.firebase.messaging.default_notification_icon", + "android:resource": "@mipmap/ic_launcher", + "tag": "meta-data" + }, + { + "android:name": "uriScheme", + "android:value": "{{props.URL_SCHEME}}", + "tag": "meta-data" + }, + { + "android:name": ".MainActivity", + "children": [ + { + "children": [ + { + "android:scheme": "{{props.URL_SCHEME}}", + "tag": "data" + } + ], + "tag": "intent-filter" + } + ], + "tag": "activity" + }, + { + "android:name": "io.invertase.firebase.messaging.RNFirebaseMessagingService", + "children": [ + { + "children": [ + { + "android:name": "com.google.firebase.MESSAGING_EVENT", + "tag": "action" + } + ], + "tag": "intent-filter" + } + ], + "tag": "service" + }, + { + "android:name": "io.invertase.firebase.messaging.RNFirebaseBackgroundMessagingService", + "tag": "service" + }, + { + "android:exported": true, + "android:name": "io.invertase.firebase.notifications.RNFirebaseBackgroundNotificationActionReceiver", + "children": [ + { + "children": [ + { + "android:name": "io.invertase.firebase.notifications.BackgroundAction", + "tag": "action" + } + ], + "tag": "intent-filter" + } + ], + "tag": "receiver" + }, + { + "android:name": "io.invertase.firebase.notifications.RNFirebaseBackgroundNotificationActionsService", + "tag": "service" + }, + { + "android:name": "io.invertase.firebase.notifications.RNFirebaseNotificationReceiver", + "tag": "receiver" + }, + { + "android:enabled": true, + "android:exported": true, + "android:name": "io.invertase.firebase.notifications.RNFirebaseNotificationsRebootReceiver", + "children": [ + { + "children": [ + { + "android:name": "android.intent.action.BOOT_COMPLETED", + "tag": "action" + }, + { + "android:name": "android.intent.action.QUICKBOOT_POWERON", + "tag": "action" + }, + { + "android:name": "com.htc.intent.action.QUICKBOOT_POWERON", + "tag": "action" + }, + { + "android:name": "android.intent.category.DEFAULT", + "tag": "category" + } + ], + "tag": "intent-filter" + } + ], + "tag": "receiver" + } + ], + "tag": "application" + } + ] + }, + "app_build_gradle": { + "apply": ["plugin: 'com.google.gms.google-services'"] + }, + "build_gradle": { + "buildscript": { + "dependencies": ["classpath 'com.google.gms:google-services:4.2.0'"] + } + }, + "implementations": [ + "'com.google.firebase:firebase-core:16.0.4'", + "'com.google.firebase:firebase-messaging:18.0.0'" + ], + "MainApplication_kt": { + "packages": [ + "io.invertase.firebase.RNFirebasePackage", + "io.invertase.firebase.notifications.RNFirebaseNotificationsPackage", + "io.invertase.firebase.messaging.RNFirebaseMessagingPackage" + ] + } + } + }, + "androidtv": { + "extendPlatform": "android" + }, + "ios": { + "templateXcode": { + "appDelegateImports": ["Firebase"], + "appDelegateMethods": { + "application": { + "didFinishLaunchingWithOptions": [ + { + "order": -1, + "value": "FirebaseApp.configure()", + "weight": 1 + } + ] + } + }, + "Podfile": { + "post_install": [ + " rnfirebase = installer.pods_project.targets.find { |target| target.name == 'RNFirebase' }", + " rnfirebase.build_configurations.each do |config|", + " config.build_settings['HEADER_SEARCH_PATHS'] = '$(inherited) ${PODS_ROOT}/Headers/Public/**'", + " end" + ] + }, + "project_pbxproj": { + "resourceFiles": ["RNVApp/GoogleService-Info.plist"] + }, + "Info_plist": { + "CFBundleURLTypes": [ + { + "CFBundleURLName": "{{props.URL_NAME}}", + "CFBundleURLSchemes": ["{{props.URL_SCHEME}}"] + } + ] + } + }, + "path": "{{PLUGIN_ROOT}}/ios", + "podName": "RNFirebase" + }, + "props": { + "URL_NAME": "", + "URL_SCHEME": "" + }, + "version": "5.6.0" + }, + "react-native-fs": { + "android": { + "package": "com.rnfs.RNFSPackage" + }, + "androidtv": { + "package": "com.rnfs.RNFSPackage" + }, + "firetv": { + "package": "com.rnfs.RNFSPackage" + }, + "ios": { + "podName": "RNFS" + }, + "macos": { + "podName": "RNFS" + }, + "tvos": { + "podName": "RNFS" + }, + "version": "2.20.0" + }, + "react-native-geolocation-service": { + "android": { + "package": "com.agontuk.RNFusedLocation.RNFusedLocationPackage", + "path": "{{PLUGIN_ROOT}}/android" + }, + "ios": { + "podName": "react-native-geolocation-service" + }, + "macos": { + "podName": "react-native-geolocation-service" + }, + "version": "5.3.1", + "web": {} + }, + "dotenv": { + "version": "16.4.5" + }, + "react-native-gesture-handler": { + "version": "2.16.2", + "android": { + "package": "com.swmansion.gesturehandler.RNGestureHandlerPackage", + "path": "{{PLUGIN_ROOT}}/android", + "mainActivity": null + }, + "androidtv": { + "package": "com.swmansion.gesturehandler.RNGestureHandlerPackage", + "path": "{{PLUGIN_ROOT}}/android" + }, + "androidwear": { + "package": "com.swmansion.gesturehandler.RNGestureHandlerPackage", + "path": "{{PLUGIN_ROOT}}/android" + }, + "firetv": { + "package": "com.swmansion.gesturehandler.RNGestureHandlerPackage", + "path": "{{PLUGIN_ROOT}}/android" + }, + "ios": { + "podName": "RNGestureHandler" + }, + "macos": { + "podName": "RNGestureHandler" + }, + "tvos": { + "podName": "RNGestureHandler" + }, + "webpackConfig": { + "moduleAliases": true, + "modulePaths": true + } + }, + "react-native-get-random-values": { + "android": { + "package": "org.linusu.RNGetRandomValuesPackage" + }, + "androidtv": { + "package": "org.linusu.RNGetRandomValuesPackage" + }, + "ios": { + "podName": "react-native-get-random-values" + }, + "macos": { + "podName": "react-native-get-random-values" + }, + "version": "1.11.0" + }, + "react-native-get-real-path": { + "android": { + "package": "com.rngrp.RNGRPPackage" + }, + "androidtv": { + "package": "com.rngrp.RNGRPPackage" + }, + "firetv": { + "package": "com.rngrp.RNGRPPackage" + }, + "version": "1.0.0" + }, + "react-native-google-cast": { + "android": { + "templateAndroid": { + "AndroidManifest_xml": { + "tag": "application", + "children": [ + { + "android:name": ".MainApplication", + "children": [ + { + "android:name": "com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME", + "android:value": "com.reactnative.googlecast.GoogleCastOptionsProvider", + "tag": "meta-data" + }, + { + "android:name": "com.reactnative.googlecast.RECEIVER_APPLICATION_ID", + "android:value": "{{props.APPLICATION_ID}}", + "tag": "meta-data" + }, + { + "android:name": "com.reactnative.googlecast.RNGCExpandedControllerActivity", + "tag": "activity" + } + ], + "tag": "application" + } + ] + }, + "app_build_gradle": { + "implementations": ["'com.google.android.gms:play-services-cast-framework:21.0.0'"] + }, + "MainActivity_kt": { + "createMethods": [ + " try { ", + "CastContext.getSharedInstance(this)", + "} catch (e: Exception) {", + "// cast framework not supported", + " }" + ], + "imports": ["com.google.android.gms.cast.framework.CastContext"] + }, + "MainApplication_kt": { + "packages": ["com.reactnative.googlecast.GoogleCastPackage"] + } + } + }, + "ios": { + "templateXcode": { + "AppDelegate_mm": { + "appDelegateImports": ["GoogleCast/GoogleCast.h"], + "appDelegateMethods": { + "application": { + "didFinishLaunchingWithOptions": [ + "NSString *receiverAppID = kGCKDefaultMediaReceiverApplicationID; // or @\"ABCD1234\"", + "GCKDiscoveryCriteria *criteria = [[GCKDiscoveryCriteria alloc] initWithApplicationID:receiverAppID]", + "GCKCastOptions* options = [[GCKCastOptions alloc] initWithDiscoveryCriteria:criteria]", + "options.disableDiscoveryAutostart = {{props.DISABLE_DISCOVERY_AUTOSTART}}", + "options.startDiscoveryAfterFirstTapOnCastButton = {{props.START_DISCOVERY_AFTER_FIRST_TAP_ON_CAST_BUTTON}}", + "[GCKCastContext setSharedInstanceWithOptions:options]" + ] + } + } + }, + "Info_plist": { + "NSBonjourServices": ["_googlecast._tcp", "_CC1AD845._googlecast._tcp"], + "NSLocalNetworkUsageDescription": "${PRODUCT_NAME} uses the local network to discover Cast-enabled devices on your WiFi network." + } + }, + "isStatic": true, + "path": "{{PLUGIN_ROOT}}", + "podName": "react-native-google-cast/NoBluetoothArm" + }, + "props": { + "APPLICATION_ID": "01234", + "DISABLE_DISCOVERY_AUTOSTART": "false", + "START_DISCOVERY_AFTER_FIRST_TAP_ON_CAST_BUTTON": "false" + }, + + "version": "4.8.0" + }, + "react-native-home-indicator": { + "ios": { + "appDelegateImports": ["react_native_home_indicator"], + "appDelegateMethods": { + "application": { + "didFinishLaunchingWithOptions": [ + "vc.view = nil", + "let vc2 = HomeIndicatorViewController()", + "vc2.view = v", + "self.window?.rootViewController = vc2" + ] + } + }, + "podName": "react-native-home-indicator" + }, + "version": "0.2.6" + }, + "react-native-iap": { + "android": { + "templateAndroid": { + "app_build_gradle": { + "defaultConfig": ["missingDimensionStrategy 'store', 'play'"] + } + }, + "package": "com.dooboolab.RNIap.RNIapPackage" + }, + "ios": { + "podName": "RNIap" + }, + "version": "12.4.4" + }, + "react-native-idle-timer": { + "android": { + "package": "com.marcshilling.idletimer.IdleTimerPackage" + }, + "androidtv": { + "package": "com.marcshilling.idletimer.IdleTimerPackage" + }, + "firetv": { + "package": "com.marcshilling.idletimer.IdleTimerPackage" + }, + "ios": { + "podName": "react-native-idle-timer" + }, + "version": "2.1.5" + }, + "react-native-image-cache-manager": { + "version": "1.0.1" + }, + "react-native-image-crop-picker": { + "android": { + "package": "com.reactnative.ivpusic.imagepicker.PickerPackage" + }, + "androidtv": { + "package": "com.reactnative.ivpusic.imagepicker.PickerPackage" + }, + "firetv": { + "package": "com.reactnative.ivpusic.imagepicker.PickerPackage" + }, + "ios": { + "templateXcode": { + "Podfile": { + "sources": ["https://github.com/TimOliver/TOCropViewController.git"] + } + }, + "podName": "RNImageCropPicker" + }, + "macos": { + "templateXcode": { + "Podfile": { + "sources": ["https://github.com/TimOliver/TOCropViewController.git"] + } + }, + "podName": "RNImageCropPicker" + }, + "pluginDependencies": { + "react-native-image-crop-picker-no-npm": "source:rnv" + }, + "version": "0.41.1" + }, + "react-native-image-crop-picker-no-npm": { + "ios": { + "podName": "TOCropViewController', :git => 'https://github.com/TimOliver/TOCropViewController.git', :tag => '2.6.1" + }, + "macos": { + "podName": "TOCropViewController', :git => 'https://github.com/TimOliver/TOCropViewController.git', :tag => '2.6.1" + }, + "disableNpm": true + }, + "react-native-image-picker": { + "android": { + "templateAndroid": { + "build_gradle": { + "subprojects": "if (project.name.contains('react-native-image-picker') || project.name.contains('react-native-fetch-blob') || project.name.contains('react-native-linear-gradient') || project.name.contains('react-native-prompt-android')) {\n buildscript {\n repositories {\n jcenter()\n google()\n maven {\n url 'https://dl.bintray.com/android/android-tools/' }\n }\n }\n }" + } + }, + "package": "com.imagepicker.ImagePickerPackage" + }, + "androidtv": { + "package": "com.imagepicker.ImagePickerPackage" + }, + "firetv": { + "package": "com.imagepicker.ImagePickerPackage" + }, + "ios": { + "podName": "react-native-image-picker" + }, + "macos": { + "podName": "react-native-image-picker" + }, + "version": "7.1.2" + }, + "react-native-image-resizer": { + "android": { + "package": "fr.bamlab.rnimageresizer.ImageResizerPackage" + }, + "androidtv": { + "package": "fr.bamlab.rnimageresizer.ImageResizerPackage" + }, + "firetv": { + "package": "fr.bamlab.rnimageresizer.ImageResizerPackage" + }, + "ios": { + "podName": "react-native-image-resizer" + }, + "tvos": { + "podName": "react-native-image-resizer" + }, + "version": "1.0.0" + }, + "react-native-keep-awake": { + "android": { + "package": "com.corbt.keepawake.KCKeepAwakePackage" + }, + "androidtv": { + "package": "com.corbt.keepawake.KCKeepAwakePackage" + }, + "firetv": { + "package": "com.corbt.keepawake.KCKeepAwakePackage" + }, + "ios": { + "podName": "react-native-keep-awake" + }, + "version": "4.0.0", + "webpackConfig": { + "modulePaths": true + } + }, + "react-native-keyboard-aware-scroll-view": { + "version": "0.9.5", + "webpackConfig": { + "modulePaths": true + } + }, + "react-native-keyboard-spacer": { + "version": "0.4.1" + }, + "react-native-languages": { + "android": { + "package": "com.reactcommunity.rnlanguages.RNLanguagesPackage" + }, + "androidtv": { + "package": "com.reactcommunity.rnlanguages.RNLanguagesPackage" + }, + "deprecated": "react-native-languages has been DEPRECATED. use react-native-localize instead", + "firetv": { + "package": "com.reactcommunity.rnlanguages.RNLanguagesPackage" + }, + "ios": { + "podName": "RNLanguages" + }, + "version": "3.0.2" + }, + "react-native-linear-gradient": { + "android": { + "package": "com.BV.LinearGradient.LinearGradientPackage" + }, + "androidtv": { + "package": "com.BV.LinearGradient.LinearGradientPackage" + }, + "androidwear": { + "package": "com.BV.LinearGradient.LinearGradientPackage" + }, + "firetv": { + "package": "com.BV.LinearGradient.LinearGradientPackage" + }, + "ios": { + "podName": "BVLinearGradient" + }, + "macos": { + "podName": "BVLinearGradient" + }, + "npm": { + "react-native-web-linear-gradient": "1.1.2" + }, + "tvos": { + "podName": "BVLinearGradient" + }, + "version": "2.8.3", + "webpackConfig": { + "moduleAliases": { + "react-native-linear-gradient": "react-native-web-linear-gradient" + }, + "modulePaths": ["react-native-web-linear-gradient", "react-native-linear-gradient"] + } + }, + "react-native-local-mongodb": { + "version": "2.2.4" + }, + "react-native-localize": { + "android": { + "package": "com.reactcommunity.rnlocalize.RNLocalizePackage" + }, + "androidtv": { + "package": "com.reactcommunity.rnlocalize.RNLocalizePackage" + }, + "firetv": { + "package": "com.reactcommunity.rnlocalize.RNLocalizePackage" + }, + "ios": { + "podName": "RNLocalize" + }, + "tvos": { + "podName": "RNLocalize" + }, + "version": "1.4.0" + }, + "react-native-lottie": { + "version": "3.2.1" + }, + "react-native-macos": { + "version": "0.66.33" + }, + "react-native-maps": { + "android": { + "templateAndroid": { + "app_build_gradle": { + "implementations": [ + "(project(':react-native-maps')){\n exclude group: 'com.google.android.gms' }", + "'com.google.android.gms:play-services-base:18.0.1'", + "'com.google.android.gms:play-services-location:19.0.1'", + "'com.google.android.gms:play-services-maps:18.0.2'" + ] + }, + "AndroidManifest_xml": { + "tag": "application", + "children": [ + { + "android:name": ".MainApplication", + "children": [ + { + "android:name": "com.google.android.geo.API_KEY", + "android:value": "@string/google_maps_api_key", + "tag": "meta-data" + } + ], + "tag": "application" + } + ] + }, + "strings_xml": { + "tag": "resources", + "children": [ + { + "tag": "string", + "name": "google_maps_api_key", + "value": "{{props.GOOGLE_MAPS_API_KEY}}" + } + ] + } + }, + "path": "{{PLUGIN_ROOT}}/android" + }, + "androidtv": { + "extendPlatform": "android" + }, + "ios": { + "podName": "react-native-maps" + }, + "macos": { + "podName": "react-native-maps" + }, + "version": "1.15.4" + }, + "react-native-markdown-renderer": { + "version": "3.2.8", + "webpackConfig": { + "moduleAliases": true, + "modulePaths": true + } + }, + "react-native-material-dialog": { + "version": "0.7.6" + }, + "react-native-material-dropdown": { + "version": "0.11.1" + }, + "react-native-media-query": { + "version": "2.0.0", + "webpackConfig": { + "modulePaths": true + } + }, + "react-native-modal": { + "version": "13.0.1", + "webpackConfig": { + "modulePaths": true + } + }, + "react-native-navigation-bar-color": { + "android": { + "package": "com.thebylito.navigationbarcolor.NavigationBarColorPackage" + }, + "androidtv": { + "package": "com.thebylito.navigationbarcolor.NavigationBarColorPackage" + }, + "firetv": { + "package": "com.thebylito.navigationbarcolor.NavigationBarColorPackage" + }, + "version": "1.0.0" + }, + "react-native-nfc-manager": { + "android": { + "package": "community.revteltech.nfc.NfcManagerPackage" + }, + "androidtv": { + "package": "community.revteltech.nfc.NfcManagerPackage" + }, + "firetv": { + "package": "community.revteltech.nfc.NfcManagerPackage" + }, + "ios": { + "podName": "react-native-nfc-manager" + }, + "version": "1.2.2" + }, + "react-native-onfido-sdk": { + "version": "0.0.7" + }, + "react-native-orientation-locker": { + "android": { + "templateAndroid": { + "MainActivity_kt": { + "imports": ["android.content.res.Configuration"], + "methods": [ + "override fun onConfigurationChanged(newConfig:Configuration) {", + " super.onConfigurationChanged(newConfig)", + " val intent = Intent(\"onConfigurationChanged\")", + " intent.putExtra(\"newConfig\", newConfig)", + " this.sendBroadcast(intent)", + "}" + ] + } + }, + "package": "org.wonday.orientation.OrientationPackage" + }, + "ios": { + "templateXcode": { + "appDelegateImports": ["react_native_orientation_locker"], + "appDelegateMethods": { + "application": { + "supportedInterfaceOrientationsFor": ["Orientation.getOrientation();"] + } + } + }, + "podName": "react-native-orientation-locker" + }, + "version": "1.7.0" + }, + "react-native-paper": { + "version": "4.12.8" + }, + "react-native-parallax-view": { + "android": { + "package": "com.reactlibrary.ParallaxViewPackage" + }, + "androidtv": { + "package": "com.reactlibrary.ParallaxViewPackage" + }, + "firetv": { + "package": "com.reactlibrary.ParallaxViewPackage" + }, + "ios": { + "podName": "react-native-parallax-view" + }, + "tvos": { + "podName": "react-native-parallax-view" + }, + "version": "github:reactseals/react-native-parallax-view#master" + }, + "react-native-pdf": { + "android": { + "package": "org.wonday.pdf.RCTPdfView" + }, + "androidtv": { + "package": "org.wonday.pdf.RCTPdfView" + }, + "firetv": { + "package": "org.wonday.pdf.RCTPdfView" + }, + "ios": { + "podName": "react-native-pdf" + }, + "macos": { + "podName": "react-native-pdf" + }, + "version": "6.6.2" + }, + "react-native-pdf-view": { + "version": "0.3.2" + }, + "react-native-peerjs": { + "ios": {}, + "version": "1.0.4" + }, + "react-native-permissions": { + "android": { + "package": "com.zoontek.rnpermissions.RNPermissionsPackage" + }, + "androidtv": { + "package": "com.zoontek.rnpermissions.RNPermissionsPackage" + }, + "ios": { + "podName": "RNPermissions" + }, + "macos": { + "podName": "RNPermissions" + }, + "tvos": { + "podName": "RNPermissions" + }, + "version": "4.1.5" + }, + "react-native-permissions-pods": { + "ios": { + "podNames": [ + "Permission-BluetoothPeripheral', :path => '{{PLUGIN_ROOT}}/ios/BluetoothPeripheral", + "Permission-Calendars', :path => '{{PLUGIN_ROOT}}/ios/Calendars", + "Permission-Camera', :path => '{{PLUGIN_ROOT}}/ios/Camera", + "Permission-Contacts', :path => '{{PLUGIN_ROOT}}/ios/Contacts", + "Permission-FaceID', :path => '{{PLUGIN_ROOT}}/ios/FaceID", + "Permission-LocationAlways', :path => '{{PLUGIN_ROOT}}/ios/LocationAlways", + "Permission-LocationWhenInUse', :path => '{{PLUGIN_ROOT}}/ios/LocationWhenInUse", + "Permission-MediaLibrary', :path => '{{PLUGIN_ROOT}}/ios/MediaLibrary", + "Permission-Microphone', :path => '{{PLUGIN_ROOT}}/ios/Microphone", + "Permission-Motion', :path => '{{PLUGIN_ROOT}}/ios/Motion", + "Permission-Notifications', :path => '{{PLUGIN_ROOT}}/ios/Notifications", + "Permission-PhotoLibrary', :path => '{{PLUGIN_ROOT}}/ios/PhotoLibrary", + "Permission-Reminders', :path => '{{PLUGIN_ROOT}}/ios/Reminders", + "Permission-SpeechRecognition', :path => '{{PLUGIN_ROOT}}/ios/SpeechRecognition", + "Permission-StoreKit', :path => '{{PLUGIN_ROOT}}/ios/StoreKit" + ] + }, + "macos": { + "podNames": [ + "Permission-BluetoothPeripheral', :path => '{{PLUGIN_ROOT}}/ios/BluetoothPeripheral", + "Permission-Calendars', :path => '{{PLUGIN_ROOT}}/ios/Calendars", + "Permission-Camera', :path => '{{PLUGIN_ROOT}}/ios/Camera", + "Permission-Contacts', :path => '{{PLUGIN_ROOT}}/ios/Contacts", + "Permission-FaceID', :path => '{{PLUGIN_ROOT}}/ios/FaceID", + "Permission-LocationAlways', :path => '{{PLUGIN_ROOT}}/ios/LocationAlways", + "Permission-LocationWhenInUse', :path => '{{PLUGIN_ROOT}}/ios/LocationWhenInUse", + "Permission-MediaLibrary', :path => '{{PLUGIN_ROOT}}/ios/MediaLibrary", + "Permission-Microphone', :path => '{{PLUGIN_ROOT}}/ios/Microphone", + "Permission-Motion', :path => '{{PLUGIN_ROOT}}/ios/Motion", + "Permission-Notifications', :path => '{{PLUGIN_ROOT}}/ios/Notifications", + "Permission-PhotoLibrary', :path => '{{PLUGIN_ROOT}}/ios/PhotoLibrary", + "Permission-Reminders', :path => '{{PLUGIN_ROOT}}/ios/Reminders", + "Permission-SpeechRecognition', :path => '{{PLUGIN_ROOT}}/ios/SpeechRecognition", + "Permission-StoreKit', :path => '{{PLUGIN_ROOT}}/ios/StoreKit" + ] + }, + "disableNpm": true, + "packageName": "react-native-permissions" + }, + "react-native-photo-editor": { + "android": { + "templateAndroid": { + "AndroidManifest_xml": { + "tag": "application", + "children": [ + { + "android:name": ".MainApplication", + "children": [ + { + "android:name": "com.ahmedadeltito.photoeditor.PhotoEditorActivity", + "tag": "activity" + } + ], + "tag": "application" + } + ] + } + }, + "package": "ui.photoeditor.RNPhotoEditorPackage" + }, + "androidtv": { + "package": "ui.photoeditor.RNPhotoEditorPackage" + }, + "firetv": { + "package": "ui.photoeditor.RNPhotoEditorPackage" + }, + "ios": { + "path": "{{PLUGIN_ROOT}}/ios", + "podName": "RNPhotoEditor" + }, + "pluginDependencies": { + "iOSPhotoEditor": "source:rnv" + }, + "version": "1.0.5" + }, + "react-native-picker": { + "android": { + "package": "com.beefe.picker.PickerViewPackage" + }, + "androidtv": { + "package": "com.beefe.picker.PickerViewPackage" + }, + "firetv": { + "package": "com.beefe.picker.PickerViewPackage" + }, + "ios": { + "podName": "Picker" + }, + "macos": { + "podName": "Picker" + }, + "version": "4.3.7" + }, + "react-native-picker-select": { + "version": "8.0.4" + }, + "react-native-progress": { + "version": "5.0.1" + }, + "react-native-prompt-android": { + "android": { + "package": "im.shimo.react.prompt.RNPromptPackage" + }, + "androidtv": { + "package": "im.shimo.react.prompt.RNPromptPackage" + }, + "firetv": { + "package": "im.shimo.react.prompt.RNPromptPackage" + }, + "version": "1.1.0" + }, + "react-native-reanimated": { + "android": { + "package": "com.swmansion.reanimated.ReanimatedPackage" + }, + "androidtv": { + "package": "com.swmansion.reanimated.ReanimatedPackage" + }, + "androidwear": { + "package": "com.swmansion.reanimated.ReanimatedPackage" + }, + "firetv": { + "package": "com.swmansion.reanimated.ReanimatedPackage" + }, + "ios": { + "podName": "RNReanimated" + }, + "macos": { + "podName": "RNReanimated" + }, + "tvos": { + "podName": "RNReanimated" + }, + "version": "3.11.0", + "disablePluginTemplateOverrides": true, + "webpackConfig": { + "modulePaths": true + } + }, + "react-native-render-html": { + "ios": { + "podName": "react-native-render-html" + }, + "version": "6.3.4", + "webpackConfig": { + "modulePaths": true + } + }, + "react-native-root-toast": { + "version": "3.6.0", + "webpackConfig": { + "nextTranspileModules": ["react-native-root-siblings", "static-container"] + } + }, + "react-native-safe-area-context": { + "android": { + "package": "com.th3rdwave.safeareacontext.SafeAreaContextPackage" + }, + "androidtv": { + "package": "com.th3rdwave.safeareacontext.SafeAreaContextPackage" + }, + "androidwear": { + "package": "com.th3rdwave.safeareacontext.SafeAreaContextPackage" + }, + "firetv": { + "package": "com.th3rdwave.safeareacontext.SafeAreaContextPackage" + }, + "ios": { + "podName": "react-native-safe-area-context" + }, + "tvos": { + "podName": "react-native-safe-area-context" + }, + "webpackConfig": { + "modulePaths": true + }, + "version": "4.10.3" + }, + "react-native-safe-area-view": { + "version": "4.9.0", + "webpackConfig": { + "modulePaths": true + } + }, + "react-native-screens": { + "android": { + "package": "com.swmansion.rnscreens.RNScreensPackage" + }, + "androidtv": { + "package": "com.swmansion.rnscreens.RNScreensPackage" + }, + "firetv": { + "package": "com.swmansion.rnscreens.RNScreensPackage" + }, + "ios": { + "isStatic": true, + "podName": "RNScreens" + }, + "macos": { + "podName": "RNScreens" + }, + "tvos": { + "isStatic": true, + "podName": "RNScreens" + }, + "version": "3.29.0", + "webpackConfig": { + "modulePaths": true + } + }, + "react-native-select-dropdown": { + "version": "3.3.4" + }, + "react-native-sensors": { + "android": { + "package": "com.sensors.RNSensorsPackage" + }, + "androidtv": { + "package": "com.sensors.RNSensorsPackage" + }, + "firetv": { + "package": "com.sensors.RNSensorsPackage" + }, + "ios": { + "podName": "RNSensors" + }, + "version": "7.3.6" + }, + "react-native-signature-capture": { + "android": { + "package": "com.rssignaturecapture.RSSignatureCapturePackage", + "projectName": "reactnativesignaturecapture" + }, + "androidtv": { + "package": "com.rssignaturecapture.RSSignatureCapturePackage", + "projectName": "reactnativesignaturecapture" + }, + "firetv": { + "package": "com.rssignaturecapture.RSSignatureCapturePackage", + "projectName": "reactnativesignaturecapture" + }, + "ios": { + "podName": "react-native-signature-capture" + }, + "macos": null, + "version": "0.4.12" + }, + "react-native-simple-compass": { + "android": { + "package": "com.reactlibrary.RNSimpleCompassPackage" + }, + "androidtv": { + "package": "com.reactlibrary.RNSimpleCompassPackage" + }, + "firetv": { + "package": "com.reactlibrary.RNSimpleCompassPackage" + }, + "ios": { + "podName": "react-native-simple-compass" + }, + "version": "git+https://github.com/cjrorvik/react-native-simple-compass.git" + }, + "react-native-simple-radio-button": { + "version": "2.7.4" + }, + "react-native-simple-shadow-view": { + "android": { + "package": "com.como.RNTShadowView.ShadowViewPackage" + }, + "version": "1.6.3" + }, + "react-native-snap-carousel": { + "version": "3.9.1", + "webpackConfig": { + "modulePaths": true + } + }, + "react-native-snap-scrollview": { + "android": { + "package": "com.reactlibrary.SnapScrollviewPackage" + }, + "androidtv": { + "package": "com.reactlibrary.SnapScrollviewPackage" + }, + "firetv": { + "package": "com.reactlibrary.SnapScrollviewPackage" + }, + "ios": { + "podName": "react-native-snap-scrollview" + }, + "tvos": { + "podName": "react-native-snap-scrollview" + }, + "version": "github:reactseals/react-native-snap-scrollview#master" + }, + "react-native-sound": { + "android": { + "package": "com.zmxv.RNSound.RNSoundPackage" + }, + "ios": { + "podName": "RNSound" + }, + "macos": { + "podName": "RNSound" + }, + "version": "0.11.2" + }, + "react-native-splash-screen": { + "supportedPlatforms": ["android", "androidtv", "firetv", "ios", "androidwear"], + "android": { + "templateAndroid": { + "MainActivity_kt": { + "createMethods": ["SplashScreen.show(this)"], + "imports": ["org.devio.rn.splashscreen.SplashScreen"] + } + }, + "package": "org.devio.rn.splashscreen.SplashScreenReactPackage" + }, + "androidwear": { + "templateAndroid": { + "MainActivity_kt": { + "createMethods": ["SplashScreen.show(this)"], + "imports": ["org.devio.rn.splashscreen.SplashScreen"] + } + }, + "package": "org.devio.rn.splashscreen.SplashScreenReactPackage" + }, + "androidtv": { + "templateAndroid": { + "MainActivity_kt": { + "createMethods": ["SplashScreen.show(this)"], + "imports": ["org.devio.rn.splashscreen.SplashScreen"] + } + }, + "package": "org.devio.rn.splashscreen.SplashScreenReactPackage" + }, + "firetv": { + "templateAndroid": { + "MainActivity_kt": { + "createMethods": ["SplashScreen.show(this)"], + "imports": ["org.devio.rn.splashscreen.SplashScreen"] + } + }, + "package": "org.devio.rn.splashscreen.SplashScreenReactPackage" + }, + "ios": { + "templateXcode": { + "AppDelegate_mm": { + "appDelegateImports": ["RNSplashScreen.h"], + "appDelegateMethods": { + "application": { + "didFinishLaunchingWithOptions": ["[RNSplashScreen show]"] + } + } + } + }, + "podName": "react-native-splash-screen" + }, + "version": "3.3.0" + }, + "react-native-sqlite-2": { + "ios": { + "podName": "RNSqlite2" + }, + "version": "3.0.1" + }, + "react-native-sqlite-storage": { + "android": { + "package": "org.pgsqlite.SQLitePluginPackage", + "path": "{{PLUGIN_ROOT}}/platforms/android" + }, + "androidtv": { + "package": "org.pgsqlite.SQLitePluginPackage", + "path": "{{PLUGIN_ROOT}}/platforms/android" + }, + "firetv": { + "package": "org.pgsqlite.SQLitePluginPackage", + "path": "{{PLUGIN_ROOT}}/platforms/android" + }, + "ios": { + "podName": "react-native-sqlite-storage" + }, + "tvos": { + "podName": "react-native-sqlite-storage" + }, + "version": "6.0.1" + }, + "react-native-super-grid": { + "version": "5.0.0" + }, + "react-native-svg": { + "android": { + "package": "com.horcrux.svg.SvgPackage" + }, + "androidtv": { + "package": "com.horcrux.svg.SvgPackage" + }, + "androidwear": { + "package": "com.horcrux.svg.SvgPackage" + }, + "firetv": { + "package": "com.horcrux.svg.SvgPackage" + }, + "ios": { + "podName": "RNSVG" + }, + "macos": { + "podName": "RNSVG" + }, + "pluginDependencies": { + "svgs": "source:rnv" + }, + "tvos": { + "podName": "RNSVG" + }, + "version": "13.7.0", + "webpackConfig": { + "moduleAliases": { + "react-native-svg": "svgs" + } + } + }, + "react-native-svg-charts": { + "version": "5.3.0" + }, + "react-native-swipeout": { + "version": "2.3.3" + }, + "react-native-swiper": { + "version": "github:reactseals/react-native-swiper#2.0.1" + }, + "react-native-system-setting": { + "android": { + "package": "com.ninty.system.setting.SystemSettingPackage" + }, + "androidtv": { + "package": "com.ninty.system.setting.SystemSettingPackage" + }, + "firetv": { + "package": "com.ninty.system.setting.SystemSettingPackage" + }, + "ios": { + "podName": "RCTSystemSetting" + }, + "version": "1.7.2" + }, + "react-native-tab-view": { + "version": "2.13.0", + "webpackConfig": { + "modulePaths": true + } + }, + "react-native-tvos": { + "version": "0.73.6-0", + "supportedPlatforms": ["tvos", "firetv", "androidtv"] + }, + "react-native-tvos-controller": { + "ios": { + "podName": "RNTVOSController" + }, + "tvos": { + "podName": "RNTVOSController" + }, + "version": "0.2.4" + }, + "react-native-uri-scheme": { + "android": { + "package": "com.rs.RNUriScheme.RNUriSchemePackage" + }, + "ios": { + "podName": "RNUriScheme" + }, + "version": "1.0.16" + }, + "react-native-v8": { + "android": { + "package": "io.csie.kudo.reactnative.v8.ReactNativeV8Package", + "path": "{{PLUGIN_ROOT}}/android" + }, + "version": "1.6.0" + }, + "react-native-vector-icons": { + "android": { + "package": "com.oblador.vectoricons.VectorIconsPackage" + }, + "androidtv": { + "package": "com.oblador.vectoricons.VectorIconsPackage" + }, + "androidwear": { + "package": "com.oblador.vectoricons.VectorIconsPackage" + }, + "firetv": { + "package": "com.oblador.vectoricons.VectorIconsPackage" + }, + "ios": { + "ignoreProjectFonts": [ + "FontAwesome.ttf", + "FontAwesome5_Solid.ttf", + "FontAwesome5_Regular.ttf", + "FontAwesome5_Brands.ttf", + "Feather.ttf", + "AntDesign.ttf", + "Entypo.ttf", + "EvilIcons.ttf", + "Foundation.ttf", + "Ionicons.ttf", + "MaterialCommunityIcons.ttf", + "MaterialIcons.ttf", + "Octicons.ttf", + "SimpleLineIcons.ttf", + "Zocial.ttf" + ], + "podName": "RNVectorIcons" + }, + "version": "10.0.3", + "tvos": { + "podNames": [ + "pod 'RNVectorIcons', :path => \"#{Pod::Config.instance.installation_root}/../../node_modules/react-native-vector-icons\"" + ], + "ignoreProjectFonts": [ + "FontAwesome.ttf", + "FontAwesome5_Solid.ttf", + "FontAwesome5_Regular.ttf", + "FontAwesome5_Brands.ttf", + "Feather.ttf", + "AntDesign.ttf", + "Entypo.ttf", + "EvilIcons.ttf", + "Foundation.ttf", + "Ionicons.ttf", + "MaterialCommunityIcons.ttf", + "MaterialIcons.ttf", + "Octicons.ttf", + "SimpleLineIcons.ttf", + "Zocial.ttf" + ], + "podName": "RNVectorIcons" + }, + "webpackConfig": { + "moduleAliases": true, + "modulePaths": true + } + }, + "react-native-video": { + "android": { + "package": "com.brentvatne.react.ReactVideoPackage", + "path": "{{PLUGIN_ROOT}}/android-exoplayer" + }, + "androidtv": { + "package": "com.brentvatne.react.ReactVideoPackage", + "path": "{{PLUGIN_ROOT}}/android-exoplayer" + }, + "firetv": { + "package": "com.brentvatne.react.ReactVideoPackage", + "path": "{{PLUGIN_ROOT}}/android-exoplayer" + }, + "ios": { + "podName": "react-native-video" + }, + "macos": { + "podName": "react-native-video" + }, + "tvos": { + "podName": "react-native-video" + }, + "version": "6.1.0", + "webpackConfig": { + "modulePaths": true + } + }, + "react-native-video-controls": { + "version": "^2.8.1" + }, + "react-native-view-overflow": { + "android": { + "package": "com.entria.views.RNViewOverflowPackage" + }, + "version": "0.0.5", + "webpackConfig": { + "moduleAliases": true, + "modulePaths": true + } + }, + "react-native-view-shot": { + "android": { + "package": "fr.greweb.reactnativeviewshot.RNViewShotPackage" + }, + "ios": { + "podName": "react-native-view-shot" + }, + "version": "3.6.0" + }, + "react-native-viewpager": { + "version": "0.2.13" + }, + "react-native-web": { + "version": "0.19.12", + "supportedPlatforms": [ + "web", + "tizen", + "webos", + "macos", + "linux", + "windows", + "chromecast", + "kaios", + "tizenwatch" + ], + "pluginDependencies": { + "react": "source:rnv" + }, + "webpackConfig": { + "modulePaths": true + } + }, + "react-native-web-image-loader": { + "version": "0.1.1" + }, + "react-native-webrtc": { + "android": { + "package": "com.oney.WebRTCModule.WebRTCModulePackage", + "path": "{{PLUGIN_ROOT}}/android" + }, + "androidtv": { + "package": "com.oney.WebRTCModule.WebRTCModulePackage", + "path": "{{PLUGIN_ROOT}}/android" + }, + "firetv": { + "package": "com.oney.WebRTCModule.WebRTCModulePackage", + "path": "{{PLUGIN_ROOT}}/android" + }, + "ios": { + "path": "{{PLUGIN_ROOT}}", + "podName": "react-native-webrtc" + }, + "version": "106.0.6" + }, + "react-native-webview": { + "android": { + "package": "com.reactnativecommunity.webview.RNCWebViewPackage" + }, + "androidtv": { + "package": "com.reactnativecommunity.webview.RNCWebViewPackage" + }, + "firetv": { + "package": "com.reactnativecommunity.webview.RNCWebViewPackage" + }, + "ios": { + "podName": "react-native-webview" + }, + "macos": { + "podName": "react-native-webview" + }, + "version": "13.10.2", + "webpackConfig": { + "modulePaths": true + } + }, + "react-native-webview-bridge": { + "android": { + "package": "com.github.alinz.reactnativewebviewbridge.WebViewBridgePackage" + }, + "androidtv": { + "package": "com.github.alinz.reactnativewebviewbridge.WebViewBridgePackage" + }, + "firetv": { + "package": "com.github.alinz.reactnativewebviewbridge.WebViewBridgePackage" + }, + "ios": { + "podName": "react-native-webview-bridge" + }, + "version": "0.40.1" + }, + "react-native-windows": { + "version": "0.67.3" + }, + "react-native-zip-archive": { + "android": { + "package": "com.rnziparchive.RNZipArchivePackage" + }, + "androidtv": { + "package": "com.rnziparchive.RNZipArchivePackage" + }, + "firetv": { + "package": "com.rnziparchive.RNZipArchivePackage" + }, + "ios": { + "podName": "RNZipArchive" + }, + "version": "6.1.1" + }, + "react-native-zss-rich-text-editor": { + "android": { + "afterEvaluate": [ + "apply from: '{{PLUGIN_ROOT}}/htmlCopy.gradle';", + "copyEditorHtmlToAppAssets(file('{{PLUGIN_ROOT}}'))" + ], + "skipImplementation": true + }, + "ios": {}, + "macos": {}, + "version": "1.1.0" + }, + "react-navigation-drawer": { + "version": "2.3.3", + "webpackConfig": { + "moduleAliases": true, + "modulePaths": true + } + }, + "react-navigation-stack": { + "version": "1.4.0", + "webpackConfig": { + "moduleAliases": true, + "modulePaths": true + } + }, + "react-navigation-tabs": { + "version": "2.0.0-alpha.0", + "webpackConfig": { + "moduleAliases": true, + "modulePaths": true + } + }, + "react-outside-click-handler": "1.3.0", + "react-redux": { + "version": "7.2.8" + }, + "react-web-vector-icons": { + "version": "1.0.2" + }, + "recyclerlistview": { + "version": "4.2.0", + "webpackConfig": { + "moduleAliases": true, + "modulePaths": true, + "nextTranspileModules": ["recyclerlistview"] + } + }, + "renative": { + "version": "0.36.0-canary.4", + "webpackConfig": { + "moduleAliases": true, + "modulePaths": true + } + }, + "rn-fetch-blob": { + "tvos": { + "disabled": true + }, + "android": { + "package": "com.RNFetchBlob.RNFetchBlobPackage" + }, + "androidtv": { + "package": "com.RNFetchBlob.RNFetchBlobPackage" + }, + "firetv": { + "package": "com.RNFetchBlob.RNFetchBlobPackage" + }, + "ios": { + "podName": "rn-fetch-blob" + }, + "version": "0.12.0", + "webpackConfig": { + "modulePaths": true + } + }, + "rnv-platform-info": { + "version": "1.0.16", + "webpackConfig": { + "nextTranspileModules": ["rnv-platform-info"] + } + }, + "Sentry": { + "ios": { + "podName": "Sentry", + "version": "5.2.0" + }, + "disableNpm": true + }, + "static-container": { + "version": "1.7.1", + "webpackConfig": { + "modulePaths": true + } + }, + "styled-jsx": "5.0.1", + "svgs": { + "version": "4.2.0", + "webpackConfig": { + "moduleAliases": true + } + }, + "swiper": { + "version": "6.8.4" + }, + "theoplayer": "3.0.0", + "tipsi-stripe": { + "android": { + "afterEvaluate": [ + "com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true" + ], + "implementations": ["'com.google.android.gms:play-services-wallet:16.0.0'"], + "package": "com.gettipsi.stripe.StripeReactPackage" + }, + "ios": { + "podName": "tipsi-stripe" + }, + "version": "github:tipsi/tipsi-stripe#experimental" + }, + "tslib": "2.3.1" + } + } +} diff --git a/packages/core/jsonSchema/renative-1.0.schema.json b/packages/core/jsonSchema/renative-1.0.schema.json index 6ad8705ea..3dccb80df 100644 --- a/packages/core/jsonSchema/renative-1.0.schema.json +++ b/packages/core/jsonSchema/renative-1.0.schema.json @@ -5286,6 +5286,11 @@ } } }, + "required": [ + "name", + "engineExtension", + "plugins" + ], "additionalProperties": false }, "plugin": { @@ -5636,7 +5641,7 @@ }, "additionalProperties": false }, - "configTemplates": { + "templates": { "type": "object", "properties": { "projectTemplates": { @@ -5816,20 +5821,6 @@ "description": "schema definition" } }, - "required": [ - "app", - "project", - "local", - "overrides", - "integration", - "engine", - "plugin", - "private", - "template", - "configTemplates", - "workspace", - "workspaces" - ], "additionalProperties": false } }, diff --git a/packages/core/src/__tests/_sanity.tstest.ts b/packages/core/src/__tests/_sanity.tstest.ts index 315fab0c6..ff7a2bdb5 100644 --- a/packages/core/src/__tests/_sanity.tstest.ts +++ b/packages/core/src/__tests/_sanity.tstest.ts @@ -204,7 +204,17 @@ console.log(gcEngine3().payload.UNTYPED); const engine1 = createRnvEngine({ tasks: [task1, task2, task3, task4, task5, task6], - config: {}, + config: { + engine: { + engineExtension: 'js', + name: 'test', + npm: {}, + overview: '', + platforms: {}, + plugins: {}, + custom: {}, + }, + }, platforms: {}, }); type GCEngine1 = GetContextType; @@ -234,7 +244,17 @@ console.log(gcEngine1().program.opts().preset1Key1); const engine2 = createRnvEngine({ tasks: [], - config: {}, + config: { + engine: { + engineExtension: 'js', + name: 'test', + npm: {}, + overview: '', + platforms: {}, + plugins: {}, + custom: {}, + }, + }, platforms: {}, }); type GCEngine2 = GetContextType; @@ -254,7 +274,17 @@ console.log(gcEngine2().payload.UNTYPED); const engine3 = createRnvEngine({ extendModules: [module1, module3], tasks: [], - config: {}, + config: { + engine: { + engineExtension: 'js', + name: 'test', + npm: {}, + overview: '', + platforms: {}, + plugins: {}, + custom: {}, + }, + }, platforms: {}, }); type GCEngine3 = GetContextType; @@ -289,7 +319,17 @@ console.log(gcEngine3().payload.UNTYPED); const engine4 = createRnvEngine({ extendModules: [module1, module2, module3], tasks: [task2, task3, task4, task5, task6], - config: {}, + config: { + engine: { + engineExtension: 'js', + name: 'test', + npm: {}, + overview: '', + platforms: {}, + plugins: {}, + custom: {}, + }, + }, platforms: {}, }); type GCEngine4 = GetContextType; diff --git a/packages/core/src/configs/appConfigs.ts b/packages/core/src/configs/appConfigs.ts index b926190b8..84cbee052 100644 --- a/packages/core/src/configs/appConfigs.ts +++ b/packages/core/src/configs/appConfigs.ts @@ -5,38 +5,45 @@ import { logDefault, logWarning } from '../logger'; import { RnvFileName } from '../enums/fileName'; import { getContext } from '../context/provider'; import { ConfigFileApp } from '../schema/types'; +import { getUpdatedConfigFile } from './utils'; const IGNORE_FOLDERS = ['.git']; -export const listAppConfigsFoldersSync = (ignoreHiddenConfigs: boolean, appConfigsDirPath?: string) => { - logDefault('listAppConfigsFoldersSync', `ignoreHiddenConfigs:${!!ignoreHiddenConfigs}`); +export const listAppConfigsFoldersAsync = async (ignoreHiddenConfigs: boolean, appConfigsDirPath?: string) => { + logDefault('listAppConfigsFoldersAsync', `ignoreHiddenConfigs:${!!ignoreHiddenConfigs}`); const c = getContext(); if (!c.paths?.project) return []; const dirPath = appConfigsDirPath || c.paths.project.appConfigsDir; - if (!fsExistsSync(dirPath)) return []; const appConfigsDirs: Array = []; - fsReaddirSync(dirPath).forEach((dir) => { + + for (const dir of fsReaddirSync(dirPath)) { const appConfigDir = path.join(dirPath, dir); + if (!IGNORE_FOLDERS.includes(dir) && fsLstatSync(appConfigDir).isDirectory()) { if (ignoreHiddenConfigs) { - const appConfig = path.join(appConfigDir, RnvFileName.renative); + const isNewConfigPath = fsExistsSync(path.join(appConfigDir, RnvFileName.rnv)); + const appConfig = path.join(appConfigDir, isNewConfigPath ? RnvFileName.rnv : RnvFileName.renative); if (fsExistsSync(appConfig)) { try { const config = readObjectSync(appConfig); - if (config?.hidden !== true) { - appConfigsDirs.push(dir); + if (config) { + const updatedConfig = await getUpdatedConfigFile(config, appConfig, 'app'); + + if (updatedConfig?.app?.hidden !== true) { + appConfigsDirs.push(dir); + } } } catch (e) { - logWarning(`_listAppConfigsFoldersSync: ${e}`); + logWarning(`_listAppConfigsFoldersAsync: ${e}`); } } } else { appConfigsDirs.push(dir); } } - }); + } return appConfigsDirs; }; diff --git a/packages/core/src/configs/buildConfig.ts b/packages/core/src/configs/buildConfig.ts index 0e0304f11..d5512318b 100644 --- a/packages/core/src/configs/buildConfig.ts +++ b/packages/core/src/configs/buildConfig.ts @@ -7,13 +7,15 @@ import { fsExistsSync, formatBytes, mkdirSync, - writeFileSync + writeFileSync, } from '../system/fs'; import { chalk, logDefault, logWarning, logDebug } from '../logger'; import { getContext } from '../context/provider'; import type { RnvContext, RnvContextBuildConfig } from '../context/types'; import type { FileUtilsPropConfig } from '../system/types'; import type { RnvPlatformKey } from '../types'; +import { ConfigFileRenative, FlatConfigFile } from '../schema/types'; +import { renativeKeys } from '../enums/fileName'; const _arrayMergeOverride = (_destinationArray: Array, sourceArray: Array) => sourceArray; @@ -27,16 +29,17 @@ const getEnginesPluginDelta = () => { const missingEnginePlugins: Record = {}; const engineConfig = c.platform ? c.runtime.enginesByPlatform[c.platform]?.config : undefined; - if (engineConfig?.plugins) { - const ePlugins = Object.keys(engineConfig.plugins); + const ePluginVals = engineConfig?.engine?.plugins; + if (ePluginVals) { + const ePlugins = Object.keys(ePluginVals); if (ePlugins?.length) { ePlugins.forEach((pluginKey) => { - if (!c.files?.project?.config?.plugins?.[pluginKey] && engineConfig.plugins?.[pluginKey]) { - missingEnginePlugins[pluginKey] = engineConfig.plugins?.[pluginKey]; + if (!c.files?.project?.config?.project?.plugins?.[pluginKey] && ePluginVals[pluginKey]) { + missingEnginePlugins[pluginKey] = ePluginVals[pluginKey]; } - if (engineConfig.plugins?.[pluginKey]) { - enginePlugins[pluginKey] = engineConfig.plugins?.[pluginKey]; + if (ePluginVals[pluginKey]) { + enginePlugins[pluginKey] = ePluginVals[pluginKey]; } }); } @@ -76,6 +79,9 @@ export const generateBuildConfig = () => { ]; const mergePaths = [...mergePathsPublic, ...mergePathsPrivate]; + const namespaceFiles: ConfigFileRenative[] = []; + const nonNamespaceFiles: FlatConfigFile[] = []; + const mergeFilesPublic = [ // TODO: do we need to merge .rnv/renative.json with .customWorkspace/reantive.json ? // c.files.dotRnv.config, @@ -103,7 +109,8 @@ export const generateBuildConfig = () => { ]; const mergeFiles = [...mergeFilesPublic, ...mergeFilesPrivate]; - _generateBuildConfig(mergePaths, mergeFiles); + mergeFiles.forEach((file) => _categorizeFiles(file, namespaceFiles, nonNamespaceFiles)); + _generateBuildConfig(mergePaths, [...namespaceFiles, ...nonNamespaceFiles]); }; const _generateBuildConfig = (mergePaths: string[], mergeFiles: Array) => { @@ -122,7 +129,7 @@ const _generateBuildConfig = (mergePaths: string[], mergeFiles: Array = {}; if (c.files.scopedConfigTemplates) { Object.keys(c.files.scopedConfigTemplates).forEach((v) => { - const plgs = c.files.scopedConfigTemplates[v].pluginTemplates; + const plgs = c.files.scopedConfigTemplates[v]; scopedPluginTemplates[v] = plgs; }); } @@ -215,3 +222,46 @@ const _checkEngineOverride = (c: RnvContext) => { platform.engine = definedEngine; } }; + +const _transformConfig = (config: ConfigFileRenative): FlatConfigFile => { + const transformedConfig: FlatConfigFile = {}; + Object.entries(config).forEach(([key, value]) => { + if (renativeKeys.includes(key as keyof ConfigFileRenative)) { + if (typeof value === 'object' && value !== null) { + Object.entries(value).forEach(([nestedKey, nestedValue]) => { + if (nestedKey === '$schema') { + transformedConfig[nestedKey] = nestedValue; + } else { + if (transformedConfig[nestedKey] && typeof transformedConfig[nestedKey] === 'object') { + transformedConfig[nestedKey] = merge(transformedConfig[nestedKey], nestedValue); + } else { + transformedConfig[nestedKey] = nestedValue; + } + } + }); + } else { + transformedConfig[key] = value; + } + } + }); + return transformedConfig; +}; +const _categorizeFiles = ( + file: ConfigFileRenative | FlatConfigFile | undefined, + namespaceFiles: FlatConfigFile[], + nonNamespaceFiles: FlatConfigFile[] +) => { + if (file) { + if (_isConfigFileNamespace(file)) { + const transformedFile = _transformConfig(file); + namespaceFiles.push(transformedFile); + } else { + nonNamespaceFiles.push(file); + } + } +}; + +const _isConfigFileNamespace = (file: ConfigFileRenative | FlatConfigFile): file is ConfigFileRenative => { + if (!file || typeof file !== 'object') return false; + return renativeKeys.some((key) => key in file); +}; diff --git a/packages/core/src/configs/configLocal.ts b/packages/core/src/configs/configLocal.ts index 6af61257c..e0178c789 100644 --- a/packages/core/src/configs/configLocal.ts +++ b/packages/core/src/configs/configLocal.ts @@ -1,17 +1,28 @@ import { getContext } from '../context/provider'; import { logDefault } from '../logger'; import { writeFileSync } from '../system/fs'; +import { generateNewSchemaPath } from './utils'; export const generateLocalConfig = (resetAppId?: boolean) => { logDefault('generateLocalConfig', `resetAppId:${!!resetAppId}`); const c = getContext(); + const relativeShemePath = generateNewSchemaPath(c.paths.project.configLocal); + const configLocal = c.files.project.configLocal || {}; - configLocal._meta = configLocal._meta || {}; + if (!configLocal?.$schema) { + configLocal.$schema = relativeShemePath; + } + if (!configLocal?.local) { + configLocal.local = {}; + } + + configLocal.local._meta = configLocal.local._meta || {}; + if (resetAppId) { - delete configLocal._meta.currentAppConfigId; + delete configLocal.local._meta.currentAppConfigId; } else { - configLocal._meta.currentAppConfigId = c.runtime.appId; + configLocal.local._meta.currentAppConfigId = c.runtime.appId; } c.files.project.configLocal = configLocal; writeFileSync(c.paths.project.configLocal, configLocal); diff --git a/packages/core/src/configs/configProject.ts b/packages/core/src/configs/configProject.ts index 9c85816af..53c49f5b3 100644 --- a/packages/core/src/configs/configProject.ts +++ b/packages/core/src/configs/configProject.ts @@ -52,8 +52,8 @@ export const upgradeDependencies = ( _fixDeps(packageFile?.devDependencies, version); _fixDeps(packageFile?.dependencies, version); _fixDeps(packageFile?.peerDependencies, version); - if (configFile?.templateConfig) { - configFile.templateConfig.version = version; + if (configFile?.project?.templateConfig) { + configFile.project.templateConfig.version = version; } if (packageFile) { @@ -86,8 +86,8 @@ export const updateProjectPlatforms = (platforms: Array) => { } = c.paths; const currentConfig = c.files.project.config; if (currentConfig) { - currentConfig.defaults = currentConfig.defaults || {}; - currentConfig.defaults.supportedPlatforms = platforms; + currentConfig.project.defaults = currentConfig.project.defaults || {}; + currentConfig.project.defaults.supportedPlatforms = platforms; writeFileSync(config, currentConfig); } else { logWarning('Config not loaded yet. skipping updateProjectPlatforms'); @@ -108,8 +108,8 @@ export const generatePlatformTemplatePaths = () => { const pt = c.buildConfig.paths?.platformTemplatesDirs || {}; const result: Record = {}; - if (c.buildConfig.defaults) { - c.buildConfig.defaults?.supportedPlatforms?.forEach((platform: RnvPlatform) => { + if (c.buildConfig?.defaults) { + c.buildConfig?.defaults?.supportedPlatforms?.forEach((platform: RnvPlatform) => { if (platform) { const engine = c.runtime.enginesByPlatform[platform]; if (engine) { diff --git a/packages/core/src/configs/engines.ts b/packages/core/src/configs/engines.ts index dc7d6bb8b..bc28d4ff5 100644 --- a/packages/core/src/configs/engines.ts +++ b/packages/core/src/configs/engines.ts @@ -38,11 +38,13 @@ export const getEngineTemplateByPlatform = (platform: RnvPlatform): RnvEngineTem const c = getContext(); const mergedEngineConfigs = _getMergedEngineConfigs(c); if (!platform) return null; + const engineId = c.program.opts().engine || getConfigProp('engine') || //Adding this as default engines moved from platforms into platformTemplates - c.files.rnvConfigTemplates.config?.platformTemplates?.[platform]?.engine; + c.files.rnvConfigTemplates.config?.templates?.platformTemplates?.[platform]?.engine; + let selectedEngineConfig: RnvEngineTemplate | null = null; Object.values(mergedEngineConfigs).forEach((engineConfig) => { diff --git a/packages/core/src/configs/index.ts b/packages/core/src/configs/index.ts index dfb150dbd..00d4957df 100644 --- a/packages/core/src/configs/index.ts +++ b/packages/core/src/configs/index.ts @@ -13,18 +13,25 @@ import { generatePlatformTemplatePaths } from './configProject'; import { RnvFileName } from '../enums/fileName'; import { getContext } from '../context/provider'; import { RnvFolderName } from '../enums/folderName'; -import type { ConfigFileTemplates } from '../schema/types'; +import type { ConfigFileRenative, ConfigFileTemplates } from '../schema/types'; +import { getUpdatedConfigFile } from './utils'; -export const loadFileExtended = (fileObj: Record, pathObj: RnvContextPathObj, key: RnvContextFileKey) => { +export const loadFileExtended = async ( + fileObj: Record, + pathObj: RnvContextPathObj, + key: RnvContextFileKey, + namespace?: keyof ConfigFileRenative +) => { const c = getContext(); - const result = loadFile(fileObj, pathObj, key); + const result = await loadFile(fileObj, pathObj, key, namespace); if (fileObj[key]) { fileObj[`${key}_original`] = { ...fileObj[key] }; } - const extendsTemplate = fileObj[key]?.extendsTemplate; + const extendsTemplate = fileObj[key]?.project?.extendsTemplate || fileObj[key]?.app?.extendsTemplate; + if (key === 'config' && extendsTemplate) { // extendsTemplate only applies to standard 'config' - let currTemplate = c.files.project[key]?.templateConfig?.name || fileObj[key].templateConfig?.name; + let currTemplate = c.files.project[key]?.template?.templateConfig?.name || fileObj[key].templateConfig?.name; if (!currTemplate) { if (extendsTemplate.startsWith('@')) { currTemplate = extendsTemplate.split('/').slice(0, 2).join('/'); @@ -44,8 +51,9 @@ export const loadFileExtended = (fileObj: Record, pathObj: RnvConte if (fsExistsSync(extendsPath)) { const extendsFile = readObjectSync(extendsPath) || {}; + const updatedExtendsFile = await getUpdatedConfigFile(extendsFile, extendsPath, namespace); - fileObj[key] = mergeObjects(c, extendsFile, fileObj[key], false, true); + fileObj[key] = mergeObjects(c, updatedExtendsFile, fileObj[key], false, true); // CLEAN props which should not be inherited delete fileObj[key].isTemplate; delete fileObj[key].tasks; @@ -60,31 +68,32 @@ export const loadFileExtended = (fileObj: Record, pathObj: RnvConte return result; }; -const _loadConfigFiles = ( +const _loadConfigFiles = async ( fileObj: RnvContextFileObj, pathObj: RnvContextPathObj, - parseAppConfigs?: boolean + parseAppConfigs?: boolean, + namespace?: keyof ConfigFileRenative ) => { // let result = false; let extendAppId: string | undefined; - const extendedFileLoadResult = loadFileExtended(fileObj, pathObj, 'config'); + const extendedFileLoadResult = await loadFileExtended(fileObj, pathObj, 'config', namespace); const fileObjConfig = fileObj.config; if (fileObjConfig && 'extend' in fileObjConfig && extendedFileLoadResult) { extendAppId = (fileObjConfig.extend as string) || extendAppId; // result = true; } - loadFileExtended(fileObj, pathObj, 'configLocal'); - loadFileExtended(fileObj, pathObj, 'configPrivate'); + await loadFileExtended(fileObj, pathObj, 'configLocal', 'local'); + await loadFileExtended(fileObj, pathObj, 'configPrivate', 'private'); //Do not Extend local configs - // if (loadFileExtended(c, fileObj, pathObj, 'configLocal')) { + // if ( loadFileExtended(c, fileObj, pathObj, 'configLocal')) { // extendAppId = fileObj.configLocal?.extend || extendAppId; // result = true; // } //Do not Extend private configs - // if (loadFileExtended(c, fileObj, pathObj, 'configPrivate')) { + // if ( loadFileExtended(c, fileObj, pathObj, 'configPrivate')) { // extendAppId = fileObj?.configPrivate?.extend || extendAppId; // result = true; // } @@ -111,9 +120,9 @@ const _loadConfigFiles = ( const pathObj1: RnvContextPathObj = { ...generateRnvConfigPathObj(), - config: path.join(path1, RnvFileName.renative), - configLocal: path.join(path1, RnvFileName.renativeLocal), - configPrivate: path.join(path1, RnvFileName.renativePrivate), + config: path.join(path1, RnvFileName.rnv), + configLocal: path.join(path1, RnvFileName.rnvLocal), + configPrivate: path.join(path1, RnvFileName.rnvPrivate), }; pathObj.dirs.push(path1); pathObj.fontsDirs.push(path.join(path1, 'fonts')); @@ -122,9 +131,9 @@ const _loadConfigFiles = ( pathObj.configsPrivate.push(pathObj1.configPrivate); pathObj.configsLocal.push(pathObj1.configLocal); // FILE1: appConfigs/base - loadFileExtended(fileObj1, pathObj1, 'config'); - loadFileExtended(fileObj1, pathObj1, 'configPrivate'); - loadFileExtended(fileObj1, pathObj1, 'configLocal'); + await loadFileExtended(fileObj1, pathObj1, 'config', 'app'); + await loadFileExtended(fileObj1, pathObj1, 'configPrivate', 'private'); + await loadFileExtended(fileObj1, pathObj1, 'configLocal', 'local'); if (fileObj1.config) fileObj.configs.push(fileObj1.config); if (fileObj1.configPrivate) fileObj.configsPrivate.push(fileObj1.configPrivate); if (fileObj1.configLocal) fileObj.configsLocal.push(fileObj1.configLocal); @@ -152,9 +161,9 @@ const _loadConfigFiles = ( pathObj.configsLocal.push(pathObj2.configLocal); pathObj.configsPrivate.push(pathObj2.configPrivate); // FILE2: appConfigs/ - loadFileExtended(fileObj2, pathObj2, 'config'); - loadFileExtended(fileObj2, pathObj2, 'configPrivate'); - loadFileExtended(fileObj2, pathObj2, 'configLocal'); + await loadFileExtended(fileObj2, pathObj2, 'config', 'app'); + await loadFileExtended(fileObj2, pathObj2, 'configPrivate', 'private'); + await loadFileExtended(fileObj2, pathObj2, 'configLocal', 'local'); if (fileObj2.config) fileObj.configs.push(fileObj2.config); if (fileObj2.configLocal) fileObj.configsLocal.push(fileObj2.configLocal); @@ -171,9 +180,9 @@ const _loadConfigFiles = ( pathObj.configsLocal.push(path.join(path3, RnvFileName.renativeLocal)); pathObj.configsPrivate.push(path.join(path3, RnvFileName.renativePrivate)); // FILE3: appConfigs/ - loadFileExtended(fileObj, pathObj, 'config'); - loadFileExtended(fileObj, pathObj, 'configPrivate'); - loadFileExtended(fileObj, pathObj, 'configLocal'); + await loadFileExtended(fileObj, pathObj, 'config', 'app'); + await loadFileExtended(fileObj, pathObj, 'configPrivate', 'private'); + await loadFileExtended(fileObj, pathObj, 'configLocal', 'local'); if (fileObj.config) fileObj.configs.push(fileObj.config); if (fileObj.configPrivate) fileObj.configsPrivate.push(fileObj.configPrivate); if (fileObj.configLocal) fileObj.configsLocal.push(fileObj.configLocal); @@ -220,14 +229,14 @@ export const loadDefaultConfigTemplates = async () => { if (!configTemplatesPath) return Promise.reject(`@rnv/config-templates missing`); ctx.paths.rnvConfigTemplates.pluginTemplatesDir = path.join(configTemplatesPath, 'pluginTemplates'); - ctx.paths.rnvConfigTemplates.config = path.join(configTemplatesPath, 'renative.templates.json'); - + ctx.paths.rnvConfigTemplates.config = path.join(configTemplatesPath, RnvFileName.rnv); + console.log('ctx.paths.rnvConfigTemplates.config', ctx.paths.rnvConfigTemplates.config); const rnvConfigTemplates = readObjectSync(ctx.paths.rnvConfigTemplates.config); if (rnvConfigTemplates) { ctx.files.rnvConfigTemplates.config = rnvConfigTemplates; ctx.files.scopedConfigTemplates = { - rnv: rnvConfigTemplates, + rnv: rnvConfigTemplates.templates?.pluginTemplates, }; } @@ -246,10 +255,10 @@ export const parseRenativeConfigs = async () => { const c = getContext(); // LOAD ./package.json - loadFile(c.files.project, c.paths.project, 'package'); + await loadFile(c.files.project, c.paths.project, 'package'); // LOAD ./RENATIVE.*.JSON - _loadConfigFiles(c.files.project, c.paths.project); + await _loadConfigFiles(c.files.project, c.paths.project, false, 'project'); if (c.runtime.appId) { c.paths.project.builds.config = path.join(c.paths.project.builds.dir, `${c.runtime.appId}_${c.platform}.json`); @@ -258,13 +267,13 @@ export const parseRenativeConfigs = async () => { } // LOAD ./platformBuilds/RENATIVE.BUILLD.JSON - loadFile(c.files.project.builds, c.paths.project.builds, 'config'); + await loadFile(c.files.project.builds, c.paths.project.builds, 'config'); // LOAD WORKSPACE /RENATIVE.*.JSON const wsDir = getRealPath(await getWorkspaceDirPath(c)); if (wsDir) { generateContextPaths(c.paths.workspace, wsDir); - _loadConfigFiles(c.files.workspace, c.paths.workspace); + await _loadConfigFiles(c.files.workspace, c.paths.workspace, false, 'workspace'); } // LOAD DEFAULT WORKSPACE //not needed anymore. loaded at the initial stage @@ -285,23 +294,22 @@ export const parseRenativeConfigs = async () => { } // LOAD WORKSPACE /[PROJECT_NAME]/RENATIVE.*.JSON - if (!c.files.project.config.projectName) { + if (!c.files.project.config?.project?.projectName) { return Promise.reject('Your renative.json is missing required property: projectName '); } generateContextPaths( c.paths.workspace.project, - path.join(c.paths.workspace.dir, c.files.project.config.projectName) + path.join(c.paths.workspace.dir, c.files.project.config?.project?.projectName) ); - _loadConfigFiles(c.files.workspace.project, c.paths.workspace.project); + await _loadConfigFiles(c.files.workspace.project, c.paths.workspace.project); c.paths.workspace.project.appConfigBase.dir = path.join(c.paths.workspace.project.dir, 'appConfigs', 'base'); generatePlatformTemplatePaths(); - if (c.runtime.appId) { if (c.runtime.appConfigDir) { generateContextPaths(c.paths.appConfig, c.runtime.appConfigDir); - _loadConfigFiles(c.files.appConfig, c.paths.appConfig, true); + await _loadConfigFiles(c.files.appConfig, c.paths.appConfig, true, 'app'); } const workspaceAppConfigsDir = getRealPath(c.buildConfig.workspaceAppConfigsDir); @@ -313,17 +321,18 @@ export const parseRenativeConfigs = async () => { path.join(c.paths.workspace.project.appConfigsDir, c.runtime.appId) ); - _loadConfigFiles(c.files.workspace.appConfig, c.paths.workspace.appConfig, true); + await _loadConfigFiles(c.files.workspace.appConfig, c.paths.workspace.appConfig, true); - loadFile(c.files.project.assets, c.paths.project.assets, 'config'); + await loadFile(c.files.project.assets, c.paths.project.assets, 'config'); // LOAD WORKSPACE /RENATIVE.*.JSON const wsPath = await getWorkspaceDirPath(c); + console.log('wsPath', wsPath); if (wsPath) { const wsPathReal = getRealPath(wsPath); if (wsPathReal) { generateContextPaths(c.paths.workspace, wsPathReal); - _loadConfigFiles(c.files.workspace, c.paths.workspace); + await _loadConfigFiles(c.files.workspace, c.paths.workspace); } } diff --git a/packages/core/src/configs/utils.ts b/packages/core/src/configs/utils.ts index b7f4c739f..f560401ff 100644 --- a/packages/core/src/configs/utils.ts +++ b/packages/core/src/configs/utils.ts @@ -1,4 +1,11 @@ +import path from 'path'; +import merge from 'deepmerge'; +// import { inquirerPrompt } from '../api'; +import { getConfigRootProp } from '../context/contextProps'; +import { getContext } from '../context/provider'; +import { RnvFileName } from '../enums/fileName'; import { logDebug } from '../logger'; +import { ConfigFileRenative } from '../schema/types'; import { writeFileSync } from '../system/fs'; import { generateBuildConfig } from './buildConfig'; @@ -7,3 +14,70 @@ export const writeRenativeConfigFile = (configPath: string | undefined, configDa writeFileSync(configPath, configData); generateBuildConfig(); }; + +export const getUpdatedConfigFile = async >( + configFile: T, + configPath?: string, + namespace?: keyof ConfigFileRenative +): Promise => { + let updatedConfigFile: Record = {}; + + // let isOldFile = false; + let misNamespace = namespace; + if (!configFile?.$schema && misNamespace) { + // isOldFile = true; + if (configFile[misNamespace]) { + delete configFile.$schema; + + updatedConfigFile = merge({}, configFile); + } else { + delete configFile.$schema; + updatedConfigFile[misNamespace] = merge({}, configFile); + } + } + if (configFile?.$schema && !configFile.$schema.includes(RnvFileName.schema)) { + // isOldFile = true; + const currentScheme = configFile.$schema; + misNamespace = namespace || _getNameSpace(currentScheme); + if (misNamespace) { + delete configFile.$schema; + updatedConfigFile[misNamespace] = { ...configFile }; + } + } + + // if (isOldFile) { + // const { confirm } = await inquirerPrompt({ + // type: 'confirm', + // name: 'confirm', + // message: `Your config file does not match the new schema structure ${configPath}. Fix it now?`, + // }); + // if (confirm) { + // const relativeShemePath = generateNewSchemaPath(configPath || ''); + // if (misNamespace) { + // delete updatedConfigFile[misNamespace].$schema; + // } + // updatedConfigFile.$schema = relativeShemePath; + // // writeFileSync(configPath, updatedConfigFile); + // logInfo(`Config file has been updated to support the new schema structure ${configPath}`); + // } + // } + return Object.keys(updatedConfigFile).length ? (updatedConfigFile as T) : configFile; +}; + +const _getNameSpace = (currentScheme: string) => { + const parts = currentScheme.split('/'); + const filename = parts[parts.length - 1]; + const namespace = filename.split('.')[1]; + return namespace as keyof ConfigFileRenative; +}; + +export const generateNewSchemaPath = (configPath: string) => { + logDebug('getNewSchemaPath', `path:${configPath}`); + const c = getContext(); + const isMonorepo = getConfigRootProp('isMonorepo'); + const rootPath = isMonorepo ? path.join(c.paths.project.dir, '../..') : c.paths.project.dir; + + const schemaPath = path.join(rootPath, '.rnv/schema', RnvFileName.schema); + const relativeSchemaPath = path.relative(path.dirname(configPath), schemaPath); + return relativeSchemaPath; +}; diff --git a/packages/core/src/configs/workspaces.ts b/packages/core/src/configs/workspaces.ts index 1d6633e0a..0e2356671 100644 --- a/packages/core/src/configs/workspaces.ts +++ b/packages/core/src/configs/workspaces.ts @@ -1,10 +1,12 @@ import { fsExistsSync, writeFileSync, readObjectSync, mkdirSync } from '../system/fs'; import { getContext } from '../context/provider'; import path from 'path'; +import merge from 'deepmerge'; import { chalk, logDefault, logDebug, logInfo, logWarning } from '../logger'; import type { RnvContext } from '../context/types'; import { generateOptions, inquirerPrompt } from '../api'; import type { ConfigFileWorkspace, ConfigFileWorkspaces } from '../schema/types'; +import { RnvFileName } from '../enums/fileName'; export const createWorkspace = async (workspaceID: string, workspacePath: string) => { const c = getContext(); @@ -25,7 +27,7 @@ export const createWorkspace = async (workspaceID: string, workspacePath: string }; mkdirSync(workspacePath); - writeFileSync(path.join(workspacePath, 'renative.json'), workspaceConfig); + writeFileSync(path.join(workspacePath, RnvFileName.renative), workspaceConfig); writeFileSync(c.paths.dotRnv.configWorkspaces, cnf); return true; @@ -34,7 +36,7 @@ export const createWorkspace = async (workspaceID: string, workspacePath: string export const getWorkspaceDirPath = async (c: RnvContext) => { logDefault('getWorkspaceDirPath'); const wss = c.files.dotRnv.configWorkspaces; - const ws = c.runtime.selectedWorkspace || c.buildConfig?.workspaceID; + const ws = c.runtime.selectedWorkspace || c.buildConfig?.project?.workspaceID; let dirPath; if (wss?.workspaces && ws) { dirPath = wss.workspaces[ws]?.path; @@ -129,8 +131,10 @@ export const loadWorkspacesConfigSync = () => { } const defWsPath = c.paths.dotRnv.config; - if (defWsPath && fsExistsSync(defWsPath)) { - c.files.dotRnv.config = readObjectSync(defWsPath) || {}; + const configFile = readObjectSync(defWsPath) || { workspace: {} }; + if (!configFile?.workspace) { + c.files.dotRnv.config = merge(configFile, { workspace: {} }); + } } }; diff --git a/packages/core/src/context/defaults.ts b/packages/core/src/context/defaults.ts index 4380664aa..779d3ba31 100644 --- a/packages/core/src/context/defaults.ts +++ b/packages/core/src/context/defaults.ts @@ -224,13 +224,16 @@ export const generateContextDefaults = (): RnvContext => ({ configWorkspaces: { workspaces: {}, }, - config: {}, + config: { + workspace: {}, + }, }, rnvCore: { package: {}, }, rnvConfigTemplates: { - config: {}, + // config: {}, + ...generateRnvConfigFileObj(), package: {}, }, scopedConfigTemplates: {}, diff --git a/packages/core/src/context/index.ts b/packages/core/src/context/index.ts index 6014fc5a3..15c4f9f2d 100644 --- a/packages/core/src/context/index.ts +++ b/packages/core/src/context/index.ts @@ -10,9 +10,9 @@ import { RnvFolderName } from '../enums/folderName'; export const generateContextPaths = (pathObj: RnvContextPathObj, dir: string, configName?: string) => { pathObj.dir = dir; - pathObj.config = path.join(dir, configName || RnvFileName.renative); - pathObj.configLocal = path.join(dir, RnvFileName.renativeLocal); - pathObj.configPrivate = path.join(dir, RnvFileName.renativePrivate); + pathObj.config = path.join(dir, configName ? `${configName}.json` : RnvFileName.rnv); + pathObj.configLocal = path.join(dir, configName ? `${configName}.local.json` : RnvFileName.rnvLocal); + pathObj.configPrivate = path.join(dir, configName ? `${configName}.private.json` : RnvFileName.rnvPrivate); pathObj.appConfigsDir = path.join(dir, '..'); }; @@ -97,6 +97,7 @@ ${msg} }; export const populateContextPaths = (c: RnvContext, RNV_HOME_DIR: string | undefined) => { + const currentConfigName = c.program.opts().configName; // user ------------------ c.paths.user.homeDir = homedir(); c.paths.user.currentDir = path.resolve('.'); @@ -121,8 +122,16 @@ export const populateContextPaths = (c: RnvContext, RNV_HOME_DIR: string | undef if (!fsExistsSync(c.paths.dotRnv.dir)) { mkdirSync(c.paths.dotRnv.dir); } - c.paths.dotRnv.config = path.join(c.paths.dotRnv.dir, RnvFileName.renative); - c.paths.dotRnv.configWorkspaces = path.join(c.paths.dotRnv.dir, RnvFileName.renativeWorkspaces); + c.paths.dotRnv.config = path.join( + c.paths.dotRnv.dir, + // currentConfigName ? `${currentConfigName}.json` : RnvFileName.rnv + RnvFileName.rnv + ); + c.paths.dotRnv.configWorkspaces = path.join( + c.paths.dotRnv.dir, + // currentConfigName ? `${currentConfigName}.workspaces.json` : RnvFileName.rnv + RnvFileName.rnv + ); // workspace ------------------ generateContextPaths(c.paths.workspace, c.paths.dotRnv.dir); @@ -131,7 +140,7 @@ export const populateContextPaths = (c: RnvContext, RNV_HOME_DIR: string | undef // TODO: generate solution root paths // project ------------------ - generateContextPaths(c.paths.project, c.paths.user.currentDir, c.program.opts().configName); + generateContextPaths(c.paths.project, c.paths.user.currentDir, currentConfigName); c.paths.buildHooks.dir = path.join(c.paths.project.dir, 'buildHooks'); c.paths.buildHooks.src.dir = path.join(c.paths.buildHooks.dir, 'src'); c.paths.buildHooks.dist.dir = path.join(c.paths.buildHooks.dir, 'dist'); @@ -150,7 +159,11 @@ export const populateContextPaths = (c: RnvContext, RNV_HOME_DIR: string | undef c.paths.project.appConfigBase.fontsDirs = [c.paths.project.appConfigBase.fontsDir]; c.paths.project.assets.dir = path.join(c.paths.project.dir, 'platformAssets'); c.paths.project.assets.runtimeDir = path.join(c.paths.project.assets.dir, 'runtime'); - c.paths.project.assets.config = path.join(c.paths.project.assets.dir, RnvFileName.renativeRuntime); + c.paths.project.assets.config = path.join( + c.paths.project.assets.dir, + // currentConfigName ? `${currentConfigName}.runtime.json` : RnvFileName.rnvRuntime + RnvFileName.renativeRuntime + ); c.paths.project.builds.dir = path.join(c.paths.project.dir, 'platformBuilds'); // runtime diff --git a/packages/core/src/context/runtime.ts b/packages/core/src/context/runtime.ts index 6c7f77bec..67c7db32c 100644 --- a/packages/core/src/context/runtime.ts +++ b/packages/core/src/context/runtime.ts @@ -9,8 +9,7 @@ import { getContext } from './provider'; export const configureRuntimeDefaults = async () => { const c = getContext(); - - c.runtime.appId = c.files.project?.configLocal?._meta?.currentAppConfigId || _getAppId(c); + c.runtime.appId = c.files.project?.configLocal?.local?._meta?.currentAppConfigId || _getAppId(c); if (c.runtime.appId) { c.runtime.appConfigDir = path.join(c.paths.project.appConfigsDir, c.runtime.appId); } @@ -87,12 +86,14 @@ export const configureRuntimeDefaults = async () => { const _getAppId = (c: RnvContext) => { logDebug(`_getAppId`); const localConfigPath = path.join(c.paths.project.dir, 'renative.local.json'); + if (!fsExistsSync(localConfigPath)) return undefined; try { const fileAsString = fsReadFileSync(localConfigPath).toString(); + if (!fileAsString) return undefined; - const appId = JSON.parse(fileAsString)?._meta?.currentAppConfigId; + const appId = JSON.parse(fileAsString)?.local?._meta?.currentAppConfigId; return appId; } catch (error) { return undefined; diff --git a/packages/core/src/context/types.ts b/packages/core/src/context/types.ts index 9ef3ddab8..8386caadc 100644 --- a/packages/core/src/context/types.ts +++ b/packages/core/src/context/types.ts @@ -6,6 +6,7 @@ import type { ConfigFilePlugin, ConfigFilePrivate, ConfigFileProject, + ConfigFileRenative, ConfigFileRuntime, ConfigFileTemplates, ConfigFileWorkspace, @@ -175,7 +176,7 @@ export type RnvContextFiles = { package?: NpmPackageFile; config?: ConfigFileTemplates; }; - scopedConfigTemplates: Record; + scopedConfigTemplates: Record; workspace: RnvContextFileObj & { project: RnvContextFileObj; appConfig: RnvContextFileObj; @@ -184,7 +185,7 @@ export type RnvContextFiles = { // project: RnvContextFileObj; // appConfig: RnvContextFileObj; // }; - project: RnvContextFileObj & { + project: RnvContextFileObj & { builds: Record; assets: { config?: ConfigFileRuntime; @@ -197,11 +198,11 @@ export type RnvContextFiles = { export type RnvContextFileObj = { config?: T; config_original?: T; - configLocal?: ConfigFileLocal; - configPrivate?: ConfigFilePrivate; + configLocal?: Partial & { $schema?: string }; + configPrivate?: Partial; configs: Array; - configsLocal: Array; - configsPrivate: Array; + configsLocal: Array>; + configsPrivate: Array>; }; export type RnvContextPaths = { diff --git a/packages/core/src/engines/creators.ts b/packages/core/src/engines/creators.ts index c8425ae35..c7c0e05cf 100644 --- a/packages/core/src/engines/creators.ts +++ b/packages/core/src/engines/creators.ts @@ -12,31 +12,31 @@ export const createRnvEngine = < >( opts: CreateRnvEngineOpts ) => { - if (!opts.config.name) { + if (!opts.config.engine.name) { throw new Error('Engine name is required. check your renative.engine.json file'); } // This allows users to use shortcut of the full engine names // ie: "-e engine-rn" instead of "-e @rnv/engine-rn" - const id = extractEngineId(opts.config.name); + const id = extractEngineId(opts.config.engine.name); const platforms: RnvEnginePlatforms = opts?.platforms; Object.keys(platforms).forEach((k) => { const p = k as RnvPlatformKey; const plat = platforms[p]; if (plat) { - plat.extensions = generateEngineExtensions(id, plat.extensions, opts.config.engineExtension); + plat.extensions = generateEngineExtensions(id, plat.extensions, opts.config.engine.engineExtension); } }); const engine: RnvEngine = { ...opts, platforms, - id: opts.config.name, + id: opts.config.engine.name, serverDirName: opts.serverDirName || '', projectDirName: opts.projectDirName || '', runtimeExtraProps: opts.runtimeExtraProps || {}, tasks: createTaskMap({ tasks: [...opts.tasks, ...(opts.extendModules?.flatMap((m) => m.originalTasks) ?? [])], - ownerID: opts.config.name, + ownerID: opts.config.engine.name, ownerType: 'engine', }), initContextPayload: () => { diff --git a/packages/core/src/engines/dependencyResolver.ts b/packages/core/src/engines/dependencyResolver.ts index 88207124f..29085bd7f 100644 --- a/packages/core/src/engines/dependencyResolver.ts +++ b/packages/core/src/engines/dependencyResolver.ts @@ -10,8 +10,8 @@ export const resolveEngineDependencies = async () => { const c = getContext(); const { platform } = c; const engine = getEngineRunnerByPlatform(platform); - const npmDepsBase = engine?.config?.npm || {}; - const npmDepsExt = platform ? engine?.config?.platforms?.[platform]?.npm || {} : {}; + const npmDepsBase = engine?.config?.engine?.npm || {}; + const npmDepsExt = platform ? engine?.config?.engine?.platforms?.[platform]?.npm || {} : {}; const npmDeps = merge>(npmDepsBase, npmDepsExt); @@ -30,7 +30,7 @@ export const resolveEngineDependencies = async () => { }, type: depType, msg: 'Missing dependency', - source: 'engine.npm (renative.engine.json)', + source: 'engine.npm (rnv.json)', targetPath: c.paths.project.package, }); } else if (ver !== deps[k]) { @@ -44,7 +44,7 @@ export const resolveEngineDependencies = async () => { }, type: depType, msg: 'Outdated dependency', - source: 'engine.npm (renative.engine.json)', + source: 'engine.npm (rnv.json)', targetPath: c.paths.project.package, }); } diff --git a/packages/core/src/engines/index.ts b/packages/core/src/engines/index.ts index 262f365e6..368899e61 100644 --- a/packages/core/src/engines/index.ts +++ b/packages/core/src/engines/index.ts @@ -9,7 +9,7 @@ import type { RenativeConfigVersion, RnvPlatform } from '../types'; import type { RnvEngine, RnvEngineInstallConfig, RnvEngineTemplate } from './types'; import { inquirerPrompt } from '../api'; import { getContext } from '../context/provider'; -import { writeRenativeConfigFile } from '../configs/utils'; +import { getUpdatedConfigFile, writeRenativeConfigFile } from '../configs/utils'; import { checkAndCreateProjectPackage } from '../projects/package'; import { getEngineTemplateByPlatform } from '../configs/engines'; import { getConfigRootProp } from '../context/contextProps'; @@ -18,6 +18,7 @@ import { createDependencyMutation } from '../projects/mutations'; import type { ConfigFileEngine } from '../schema/types'; import { generateLookupPaths } from '../configs'; import { extractEngineName } from './nameExtractor'; +import { RnvFileName } from '../enums/fileName'; export const registerEngine = async (engine: RnvEngine, platform?: RnvPlatform, engConfig?: RnvEngineTemplate) => { const c = getContext(); @@ -181,26 +182,29 @@ export const loadEnginePluginDeps = async (engineConfigs: Array> = {}; let hasAddedPlugins = false; - const originalProjectPlugins = cnf.plugins || {}; - engineConfigs.forEach((ecf) => { - const engineConfig = readObjectSync(ecf.configPath); - - const engPlugins = engineConfig?.plugins; - if (engPlugins) { - const projectPlugins = c.files.project.config?.plugins; - // Comparing original config causes engine think that template is not extended with additional deps - if (projectPlugins) { - Object.keys(engPlugins).forEach((k) => { - if (!projectPlugins[k]) { - hasAddedPlugins = true; - originalProjectPlugins[k] = engPlugins[k]; - addedPlugins[k] = addedPlugins[k] || []; - addedPlugins[k].push(k); - } - }); + const originalProjectPlugins = cnf.engine?.plugins || {}; + + for (const ecf of engineConfigs) { + const originalEngineConfig = readObjectSync(ecf.configPath); + if (originalEngineConfig) { + const engineConfig = await getUpdatedConfigFile(originalEngineConfig, ecf.configPath); + const engPlugins = engineConfig.engine.plugins; + if (engPlugins) { + const projectPlugins = c.files.project.config?.project.plugins; + // Comparing original config causes engine think that template is not extended with additional deps + if (projectPlugins) { + Object.keys(engPlugins).forEach((k) => { + if (!projectPlugins[k]) { + hasAddedPlugins = true; + originalProjectPlugins[k] = engPlugins[k]; + addedPlugins[k] = addedPlugins[k] || []; + addedPlugins[k].push(k); + } + }); + } } } - }); + } if (hasAddedPlugins) { const engineKeys = engineConfigs.map((v) => v.key); @@ -220,7 +224,7 @@ If you don't want to use this dependency make sure you remove platform which req if (confirm) { logInfo(`Adding ${addedPluginsKeys.join(',')}. ...DONE`); // Prepare original file to be decorated (as addon plugins as we can't edit template itself) - cnf.plugins = originalProjectPlugins; + cnf.project.plugins = originalProjectPlugins; writeRenativeConfigFile(c.paths.project.config, cnf); } } @@ -240,7 +244,7 @@ export const loadEnginePackageDeps = async (engineConfigs: Array { - const npm = engineConfig?.platforms?.[platform]?.npm || {}; + const npm = engineConfig?.engine.platforms?.[platform]?.npm || {}; if (npm) { if (npm.devDependencies) { const deps = c.files.project.package.devDependencies || {}; @@ -351,17 +355,17 @@ export const loadEnginePackageDeps = async (engineConfigs: Array { const engines = c.buildConfig?.engines; if (!engines) { - logError('Engine configs missing in your renative.json. FIXING...DONE'); + logError('Engine configs missing in your rnv.json. FIXING...DONE'); return {}; } - const rnvPlatforms = c.files.rnvConfigTemplates.config?.platformTemplates; - const supportedPlatforms = c.files.project.config?.defaults?.supportedPlatforms || []; + const rnvPlatforms = c.files.rnvConfigTemplates.config?.templates?.platformTemplates; + const supportedPlatforms = c.files.project.config?.project?.defaults?.supportedPlatforms || []; const filteredEngines: Record = {}; supportedPlatforms.forEach((v) => { if (c.files.project.config) { - const platforms = c.files.project.config?.platforms || {}; + const platforms = c.files.project.config?.project.platforms || {}; const engineId = platforms[v]?.engine || rnvPlatforms?.[v]?.engine; if (engineId) { @@ -426,7 +430,8 @@ export const installEngines = async (failOnMissingDeps?: boolean): Promise fsExistsSync(v)); - const configPath = engineRootPath ? path.join(engineRootPath, 'renative.engine.json') : null; + const configPath = engineRootPath ? path.join(engineRootPath, RnvFileName.rnv) : null; + console.log('configPath', configPath); if (!configPath || !fsExistsSync(configPath)) { const engVer = getScopedVersion(c, k, filteredEngines[k], 'engineTemplates'); if (engVer) { @@ -555,7 +560,7 @@ export const getEngineRunnerByPlatform = (platform: RnvPlatform, ignoreMissingEr export const getEngineRunnerByOwnerID = (task: RnvTask) => { const ctx = getContext(); - const engine = ctx.runtime.enginesByIndex.find((v) => v.config.name === task.ownerID); + const engine = ctx.runtime.enginesByIndex.find((v) => v.config.engine.name === task.ownerID); return engine; }; diff --git a/packages/core/src/enums/fileName.ts b/packages/core/src/enums/fileName.ts index f47489b60..571831047 100644 --- a/packages/core/src/enums/fileName.ts +++ b/packages/core/src/enums/fileName.ts @@ -1,3 +1,5 @@ +import { ConfigFileRenative } from '../schema/types'; + export const RnvFileName = { renative: 'renative.json', renativeLocal: 'renative.local.json', @@ -11,5 +13,26 @@ export const RnvFileName = { renativeEngine: 'renative.engine.json', package: 'package.json', appliedOverride: 'applied_overrides.json', + schema: 'renative-1.0.schema.json', + rnv: 'rnv.json', + rnvLocal: 'rnv.local.json', + rnvPrivate: 'rnv.private.json', + rnvRuntime: 'rnv.runtime.json', // renativeProject: 'renative.project.json', } as const; + +export const renativeKeys: (keyof ConfigFileRenative)[] = [ + 'app', + 'project', + 'workspace', + 'local', + 'overrides', + 'integration', + 'engine', + 'plugin', + 'private', + 'integration', + 'template', + 'templates', + 'workspaces', +]; diff --git a/packages/core/src/plugins/index.ts b/packages/core/src/plugins/index.ts index e641719bf..1b7a8cdd8 100644 --- a/packages/core/src/plugins/index.ts +++ b/packages/core/src/plugins/index.ts @@ -424,8 +424,8 @@ const _resolvePluginDependencies = async ( scope )} required by ${chalk().red(parentKey)} is not installed`, }); - if (confirm && c.files.project.config_original?.plugins) { - c.files.project.config_original.plugins[key] = `source:${scope}`; + if (confirm && c.files.project.config_original?.project?.plugins) { + c.files.project.config_original.project.plugins[key] = `source:${scope}`; writeRenativeConfigFile(c.paths.project.config, c.files.project.config_original); logSuccess(`Plugin ${key} sucessfully installed`); c._requiresNpmInstall = true; @@ -469,7 +469,7 @@ export const parsePlugins = ( const includedPlugins = includedPluginsConfig === undefined ? ['*'] : includedPluginsConfig; const excludedPlugins = getConfigProp('excludedPlugins') || []; - const supportedPlatforms = c.files.project.config?.defaults?.supportedPlatforms || []; + const supportedPlatforms = c.files.project.config?.project?.defaults?.supportedPlatforms || []; const platformsToCheck = platform ? [platform] : supportedPlatforms; const parsedPlugins: string[] = []; @@ -570,7 +570,7 @@ export const loadPluginTemplates = async () => { const c = getContext(); - const customPluginTemplates = c.files.project.config?.paths?.pluginTemplates; + const customPluginTemplates = c.files.project.config?.project?.paths?.pluginTemplates; if (customPluginTemplates) { const missingDeps = _parsePluginTemplateDependencies(c, customPluginTemplates); @@ -1014,15 +1014,13 @@ export const checkForPluginDependencies = async (postInjectHandler?: AsyncCallba if (!c.buildConfig.plugins) return; const bcPlugins = c.buildConfig.plugins; - Object.keys(c.buildConfig.plugins).forEach((pluginName) => { const renativePluginConfig = _getPluginConfiguration(c, pluginName); if (renativePluginConfig) { c._renativePluginCache[pluginName] = renativePluginConfig; } - - const pluginDeps = renativePluginConfig?.pluginDependencies; + const pluginDeps = renativePluginConfig?.plugin?.pluginDependencies; if (pluginDeps) { // we have dependencies for this plugin Object.keys(pluginDeps).forEach((p) => { @@ -1057,8 +1055,8 @@ export const checkForPluginDependencies = async (postInjectHandler?: AsyncCallba } if (install && c.files.project.config_original) { - c.files.project.config_original.plugins = { - ...(c.files.project.config_original.plugins || {}), + c.files.project.config_original.project.plugins = { + ...(c.files.project.config_original.project.plugins || {}), ...toAdd, }; writeRenativeConfigFile(c.paths.project.config, c.files.project.config_original); diff --git a/packages/core/src/projects/__tests__/update.test.ts b/packages/core/src/projects/__tests__/update.test.ts index 6ffd3d8fc..b7cf277a7 100644 --- a/packages/core/src/projects/__tests__/update.test.ts +++ b/packages/core/src/projects/__tests__/update.test.ts @@ -6,6 +6,7 @@ import { generateContextDefaults } from '../../context/defaults'; import { copyFileSync, fsExistsSync, fsLstatSync, readObjectSync, writeFileSync } from '../../system/fs'; import { inquirerPrompt } from '../../api'; import { RnvPlatform } from '../../types'; +import { getUpdatedConfigFile } from '../../configs/utils'; jest.mock('path'); jest.mock('../../api'); @@ -13,6 +14,7 @@ jest.mock('../../context/provider'); jest.mock('../../system/fs'); jest.mock('../../logger'); jest.mock('../../templates'); +jest.mock('../../configs/utils'); afterEach(() => { jest.resetAllMocks(); @@ -48,11 +50,16 @@ describe('checkAndUpdateProjectIfRequired', () => { const c = getContext(); c.platform = 'test' as RnvPlatform; c.buildConfig.isMonorepo = false; - c.files.project.config = { defaults: { supportedPlatforms: ['ios'] } }; + c.files.project.config = { project: { defaults: { supportedPlatforms: ['ios'] } } }; c.paths.template.configTemplate = '/path/to/template'; jest.mocked(readObjectSync).mockReturnValue({ templateConfig: { includedPaths: [{ platforms: ['android'], paths: ['mockFile.js'] }] }, }); + jest.mocked(getUpdatedConfigFile).mockResolvedValue({ + template: { + templateConfig: { includedPaths: [{ platforms: ['android'], paths: ['mockFile.js'] }] }, + }, + }); jest.mocked(inquirerPrompt).mockResolvedValue({ confirm: true }); //WHEN await expect(checkAndUpdateProjectIfRequired()).rejects.toEqual('Platform test is not supported!'); @@ -65,11 +72,16 @@ describe('checkAndUpdateProjectIfRequired', () => { const c = getContext(); c.platform = 'android'; c.buildConfig.isMonorepo = false; - c.files.project.config = { defaults: { supportedPlatforms: ['ios'] } }; + c.files.project.config = { project: { defaults: { supportedPlatforms: ['ios'] } } }; c.paths.template.configTemplate = '/path/to/template'; jest.mocked(readObjectSync).mockReturnValue({ templateConfig: { includedPaths: [{ platforms: ['android'], paths: ['mockFile.js'] }] }, }); + jest.mocked(getUpdatedConfigFile).mockResolvedValue({ + template: { + templateConfig: { includedPaths: [{ platforms: ['android'], paths: ['mockFile.js'] }] }, + }, + }); jest.mocked(inquirerPrompt).mockResolvedValue({ confirm: false }); //WHEN //THEN @@ -81,7 +93,7 @@ describe('checkAndUpdateProjectIfRequired', () => { const c = getContext(); c.platform = 'android'; c.buildConfig.isMonorepo = false; - c.files.project.config = { defaults: { supportedPlatforms: ['ios'] } }; + c.files.project.config = { project: { defaults: { supportedPlatforms: ['ios'] } } }; c.paths.project.dir = '/project/dir'; c.paths.project.config = '/project/dir/renative.json'; c.paths.template.dir = '/template/dir'; @@ -89,6 +101,11 @@ describe('checkAndUpdateProjectIfRequired', () => { jest.mocked(readObjectSync).mockReturnValue({ templateConfig: { includedPaths: [{ platforms: ['android'], paths: ['mockFile.js'] }] }, }); + jest.mocked(getUpdatedConfigFile).mockResolvedValue({ + template: { + templateConfig: { includedPaths: [{ platforms: ['android'], paths: ['mockFile.js'] }] }, + }, + }); jest.mocked(inquirerPrompt).mockResolvedValue({ confirm: true }); jest.mocked(fsExistsSync) .mockReturnValueOnce(false) @@ -104,7 +121,7 @@ describe('checkAndUpdateProjectIfRequired', () => { await expect(checkAndUpdateProjectIfRequired()).resolves.toEqual(true); //THEN expect(writeFileSync).toHaveBeenCalledWith('/project/dir/renative.json', { - defaults: { supportedPlatforms: ['ios', 'android'] }, + project: { defaults: { supportedPlatforms: ['ios', 'android'] } }, }); expect(copyFileSync).toHaveBeenCalledWith(sourcePath, destPath); expect(logInfo).toHaveBeenCalledWith(expect.stringContaining('COPYING from TEMPLATE...DONE')); @@ -115,7 +132,7 @@ describe('checkAndUpdateProjectIfRequired', () => { const c = getContext(); c.platform = 'android'; c.buildConfig.isMonorepo = false; - c.files.project.config = { defaults: { supportedPlatforms: ['ios', 'android'] } }; + c.files.project.config = { project: { defaults: { supportedPlatforms: ['ios', 'android'] } } }; c.paths.project.dir = '/project/dir'; c.paths.project.config = '/project/dir/renative.json'; c.paths.template.dir = '/template/dir'; @@ -123,6 +140,11 @@ describe('checkAndUpdateProjectIfRequired', () => { jest.mocked(readObjectSync).mockReturnValue({ templateConfig: { includedPaths: [{ platforms: ['android'], paths: ['mockFile.js'] }] }, }); + jest.mocked(getUpdatedConfigFile).mockResolvedValue({ + template: { + templateConfig: { includedPaths: [{ platforms: ['android'], paths: ['mockFile.js'] }] }, + }, + }); jest.mocked(inquirerPrompt).mockResolvedValue({ confirm: true }); jest.mocked(fsExistsSync) .mockReturnValueOnce(false) diff --git a/packages/core/src/projects/fonts.ts b/packages/core/src/projects/fonts.ts index 713d5feee..451d6b884 100644 --- a/packages/core/src/projects/fonts.ts +++ b/packages/core/src/projects/fonts.ts @@ -38,8 +38,8 @@ export const parseFonts = (callback: ParseFontsCallback) => { _parseFontSources(c, getConfigProp('fontSources') || [], callback); // PLUGIN FONTS parsePlugins((plugin) => { - if (plugin.config?.fontSources) { - _parseFontSources(c, plugin.config?.fontSources, callback); + if (plugin.config?.plugin?.fontSources) { + _parseFontSources(c, plugin.config?.plugin?.fontSources, callback); } }, true); } diff --git a/packages/core/src/projects/npm.ts b/packages/core/src/projects/npm.ts index b87ac6834..a8a9e7d6d 100644 --- a/packages/core/src/projects/npm.ts +++ b/packages/core/src/projects/npm.ts @@ -224,7 +224,7 @@ export const installPackageDependencies = async (failOnError = false) => { } } try { - const plats = c.files.project.config?.defaults?.supportedPlatforms; + const plats = c.files.project.config?.project?.defaults?.supportedPlatforms; if ( Array.isArray(plats) && (plats.includes('android') || @@ -235,10 +235,12 @@ export const installPackageDependencies = async (failOnError = false) => { if (!c.files.project.configLocal) { c.files.project.configLocal = {}; } - if (!c.files.project.configLocal?._meta) { - c.files.project.configLocal._meta = {}; + if (!c.files.project.configLocal?.local?._meta) { + c.files.project.configLocal.local = c.files.project.configLocal.local || {}; + + c.files.project.configLocal.local._meta = {}; } - c.files.project.configLocal._meta.requiresJetify = true; + c.files.project.configLocal.local._meta.requiresJetify = true; writeFileSync(c.paths.project.configLocal, c.files.project.configLocal); } c._requiresNpmInstall = false; diff --git a/packages/core/src/projects/package.ts b/packages/core/src/projects/package.ts index 46c745b30..99a167423 100644 --- a/packages/core/src/projects/package.ts +++ b/packages/core/src/projects/package.ts @@ -5,7 +5,7 @@ import { logDefault, logWarning, logInfo } from '../logger'; import { RnvFileName } from '../enums/fileName'; import { getContext } from '../context/provider'; import { type NpmPackageFile } from '../configs/types'; -import { writeRenativeConfigFile } from '../configs/utils'; +import { getUpdatedConfigFile, writeRenativeConfigFile } from '../configs/utils'; import type { ConfigFileTemplate } from '../schema/types'; export const updatePackage = (override: Partial) => { @@ -34,11 +34,11 @@ export const checkAndCreateProjectPackage = async () => { if (!packageJsonIsValid()) { logInfo(`Your ${c.paths.project.package} is missing. CREATING...DONE`); - const packageName = c.files.project.config?.projectName || c.paths.project.dir.split('/').pop(); - const packageVersion = c.files.project.config?.projectVersion || '0.1.0'; - const templateName = c.files.project.config?.templateConfig?.name; + const packageName = c.files.project.config?.project?.projectName || c.paths.project.dir.split('/').pop(); + const packageVersion = c.files.project.config?.project?.projectVersion || '0.1.0'; + const templateName = c.files.project.config?.template?.templateConfig?.name; if (!templateName) { - logWarning('You are missing currentTemplate in your renative.json'); + logWarning('You are missing currentTemplate in your renative config file'); } const rnvVersion = c.files.rnvCore.package.version; @@ -51,27 +51,30 @@ export const checkAndCreateProjectPackage = async () => { ); } - const templateObj = readObjectSync(c.paths.template.configTemplate); + const originalTemplateObj = readObjectSync(c.paths.template.configTemplate); + if (originalTemplateObj) { + const templateObj = await getUpdatedConfigFile(originalTemplateObj); + const pkgJson = templateObj?.template?.templateConfig?.package_json || {}; + pkgJson.name = packageName; + pkgJson.version = packageVersion; + pkgJson.dependencies = pkgJson.dependencies || {}; + // No longer good option to assume same version + // pkgJson.dependencies.renative = rnvVersion; + pkgJson.devDependencies = pkgJson.devDependencies || {}; + if (rnvVersion) { + pkgJson.devDependencies.rnv = rnvVersion; + } - const pkgJson = templateObj?.templateConfig?.package_json || {}; - pkgJson.name = packageName; - pkgJson.version = packageVersion; - pkgJson.dependencies = pkgJson.dependencies || {}; - // No longer good option to assume same version - // pkgJson.dependencies.renative = rnvVersion; - pkgJson.devDependencies = pkgJson.devDependencies || {}; - if (rnvVersion) { - pkgJson.devDependencies.rnv = rnvVersion; + if (templateName) { + pkgJson.devDependencies[templateName] = + c.files.project.config?.template?.templateConfig?.version || 'latest'; + } + const pkgJsonStringClean = JSON.stringify(pkgJson, null, 2); + fsWriteFileSync(c.paths.project.package, pkgJsonStringClean); } - - if (templateName) { - pkgJson.devDependencies[templateName] = c.files.project.config?.templateConfig?.version || 'latest'; - } - const pkgJsonStringClean = JSON.stringify(pkgJson, null, 2); - fsWriteFileSync(c.paths.project.package, pkgJsonStringClean); } - loadFile(c.files.project, c.paths.project, 'package'); + await loadFile(c.files.project, c.paths.project, 'package'); return true; }; diff --git a/packages/core/src/projects/update.ts b/packages/core/src/projects/update.ts index c72428b8f..d54efa3e7 100644 --- a/packages/core/src/projects/update.ts +++ b/packages/core/src/projects/update.ts @@ -13,21 +13,26 @@ import { ConfigFileTemplate } from '../schema/types'; import { inquirerPrompt } from '../api'; import { applyTemplate } from '../templates'; import { RnvPlatform } from '../types'; +import { getUpdatedConfigFile } from '../configs/utils'; export const checkAndUpdateProjectIfRequired = async () => { logDefault('checkAndUpdateIfRequired'); const c = getContext(); const { platform } = c; - const supportedPlatforms = c.files.project.config?.defaults?.supportedPlatforms; + const supportedPlatforms = c.files.project.config?.project?.defaults?.supportedPlatforms; if (!platform) return; const { isMonorepo } = c.buildConfig; if (isMonorepo) return true; await applyTemplate(); - const templateConfigFile = readObjectSync(c.paths.template.configTemplate); + const originalTemplateConfigFile = readObjectSync(c.paths.template.configTemplate); + if (originalTemplateConfigFile) { + const templateConfigFile = await getUpdatedConfigFile( + originalTemplateConfigFile, + c.paths.template.configTemplate + ); - if (templateConfigFile) { const availablePlatforms = _getAllAvailablePlatforms(templateConfigFile); if (!availablePlatforms.includes(platform)) { logError(`Platform ${platform} is not supported!`); @@ -85,8 +90,9 @@ export const checkAndUpdateProjectIfRequired = async () => { return true; }; + const _getAllAvailablePlatforms = (templateConfigFile: ConfigFileTemplate): string[] => { - const includedPaths = templateConfigFile.templateConfig?.includedPaths || []; + const includedPaths = templateConfigFile?.template?.templateConfig?.includedPaths || []; return includedPaths.reduce((acc, item) => { if (typeof item !== 'string' && item.platforms) { acc.push(...item.platforms); @@ -101,7 +107,7 @@ const _getMisFilesForPlatform = (opts: { templatePath: string; }) => { const { templateConfigFile, platform, projectPath, templatePath } = opts; - const includedPaths = templateConfigFile.templateConfig?.includedPaths || []; + const includedPaths = templateConfigFile?.template?.templateConfig?.includedPaths || []; const result = includedPaths.find( (item) => typeof item !== 'string' && item.platforms && item.platforms.includes(platform!) ); diff --git a/packages/core/src/projects/version.ts b/packages/core/src/projects/version.ts index 9b8434b26..64f85307e 100644 --- a/packages/core/src/projects/version.ts +++ b/packages/core/src/projects/version.ts @@ -8,7 +8,7 @@ export const versionCheck = async (c: RnvContext) => { if ( c.runtime.versionCheckCompleted || - c.files.project?.config?.skipAutoUpdate || + c.files.project?.config?.project?.skipAutoUpdate || c.program.opts().skipDependencyCheck ) { return true; diff --git a/packages/core/src/schema/configFiles/engine.ts b/packages/core/src/schema/configFiles/engine.ts index ba88d0357..a00f985c7 100644 --- a/packages/core/src/schema/configFiles/engine.ts +++ b/packages/core/src/schema/configFiles/engine.ts @@ -17,14 +17,13 @@ const zodEnginePlatform = z.object({ npm: z.optional(zodEngineNpm), }); -export const zodConfigFileEngine = z - .object({ - custom: z.optional(zodExt), - name: z.string().describe('Name of the engine (best to use name of the actual package)'), - engineExtension: z.string().describe('Engine extension used by rnv during compilation'), - overview: z.string().describe('Overview description of engine'), - plugins: z.record(z.string(), z.string()).describe('List of required plugins for this engine to work properly'), - npm: zodEngineNpm, - platforms: z.record(zodPlatformsKeys, zodEnginePlatform), - }) - .partial(); +export const zodConfigFileEngine = z.object({ + custom: z.optional(zodExt), + name: z.string().describe('Name of the engine (best to use name of the actual package)'), + engineExtension: z.string().describe('Engine extension used by rnv during compilation'), + overview: z.string().describe('Overview description of engine').optional(), + plugins: z.record(z.string(), z.string()).describe('List of required plugins for this engine to work properly'), + npm: z.optional(zodEngineNpm), + platforms: z.record(zodPlatformsKeys, zodEnginePlatform).optional(), +}); +// .partial(); diff --git a/packages/core/src/schema/configFiles/root.ts b/packages/core/src/schema/configFiles/root.ts index dd1436956..fc882c3ec 100644 --- a/packages/core/src/schema/configFiles/root.ts +++ b/packages/core/src/schema/configFiles/root.ts @@ -12,17 +12,19 @@ import { zodConfigFileEngine } from './engine'; import { zodConfigFilePlugin } from './plugin'; import { zodConfigFilePrivate } from './private'; -export const zodConfigFileRoot: AnyZodObject = z.object({ - app: zodRootAppBaseFragment, - project: zodConfigFileProject, - local: zodConfigFileLocal, - overrides: zodConfigFileOverrides, - integration: zodConfigFileIntegration, - engine: zodConfigFileEngine, - plugin: zodConfigFilePlugin, - private: zodConfigFilePrivate, - template: zodConfigFileTemplate, - configTemplates: zodConfigFileTemplates, - workspace: zodConfigFileWorkspace, - workspaces: zodConfigFileWorkspaces, -}); +export const zodConfigFileRoot: AnyZodObject = z + .object({ + app: zodRootAppBaseFragment, + project: zodConfigFileProject, + local: zodConfigFileLocal, + overrides: zodConfigFileOverrides, + integration: zodConfigFileIntegration, + engine: zodConfigFileEngine, + plugin: zodConfigFilePlugin, + private: zodConfigFilePrivate, + template: zodConfigFileTemplate, + templates: zodConfigFileTemplates, + workspace: zodConfigFileWorkspace, + workspaces: zodConfigFileWorkspaces, + }) + .partial(); diff --git a/packages/core/src/schema/configFiles/template.ts b/packages/core/src/schema/configFiles/template.ts index b54d45487..ef99020c7 100644 --- a/packages/core/src/schema/configFiles/template.ts +++ b/packages/core/src/schema/configFiles/template.ts @@ -68,7 +68,7 @@ export const zodConfigFileTemplate: AnyZodObject = z // type: 'list', // configProp: { // key: 'runtime.myServiceConfig', -// file: 'renative.json', +// file: 'RnvFileName.renative', // }, // options: [ // { diff --git a/packages/core/src/schema/index.ts b/packages/core/src/schema/index.ts index 9bad23522..8186165c8 100644 --- a/packages/core/src/schema/index.ts +++ b/packages/core/src/schema/index.ts @@ -19,36 +19,36 @@ import * as _platformsFragmentsTemplateAndroid from './platforms/fragments/templ import * as _platformsFragmentsTemplateXcode from './platforms/fragments/templateXcode'; import * as _platformsFragmentsElectron from './platforms/fragments/electron'; import * as _platformsFragmentsWebos from './platforms/fragments/webos'; -import * as _app from './configFiles/app'; -import * as _engine from './configFiles/engine'; -import * as _integration from './configFiles/integration'; -import * as _local from './configFiles/local'; -import * as _overrides from './configFiles/overrides'; -import * as _plugin from './configFiles/plugin'; -import * as _private from './configFiles/private'; -import * as _project from './configFiles/project'; +// import * as _app from './configFiles/app'; +// import * as _engine from './configFiles/engine'; +// import * as _integration from './configFiles/integration'; +// import * as _local from './configFiles/local'; +// import * as _overrides from './configFiles/overrides'; +// import * as _plugin from './configFiles/plugin'; +// import * as _private from './configFiles/private'; +// import * as _project from './configFiles/project'; import * as _root from './configFiles/root'; import * as _runtime from './configFiles/runtime'; -import * as _template from './configFiles/template'; -import * as _templates from './configFiles/templates'; -import * as _workspace from './configFiles/workspace'; -import * as _workspaces from './configFiles/workspaces'; +// import * as _template from './configFiles/template'; +// import * as _templates from './configFiles/templates'; +// import * as _workspace from './configFiles/workspace'; +// import * as _workspaces from './configFiles/workspaces'; export const ZodFileSchema = { - zodConfigFileApp: _app.zodConfigFileApp, - zodConfigFileEngine: _engine.zodConfigFileEngine, - zodConfigFileIntegration: _integration.zodConfigFileIntegration, - zodConfigFileLocal: _local.zodConfigFileLocal, - zodConfigFileOverrides: _overrides.zodConfigFileOverrides, - zodConfigFilePlugin: _plugin.zodConfigFilePlugin, - zodConfigFilePrivate: _private.zodConfigFilePrivate, - zodConfigFileProject: _project.zodConfigFileProject, + // zodConfigFileApp: _app.zodConfigFileApp, + // zodConfigFileEngine: _engine.zodConfigFileEngine, + // zodConfigFileIntegration: _integration.zodConfigFileIntegration, + // zodConfigFileLocal: _local.zodConfigFileLocal, + // zodConfigFileOverrides: _overrides.zodConfigFileOverrides, + // zodConfigFilePlugin: _plugin.zodConfigFilePlugin, + // zodConfigFilePrivate: _private.zodConfigFilePrivate, + // zodConfigFileProject: _project.zodConfigFileProject, zodConfigFileRoot: _root.zodConfigFileRoot, zodConfigFileRuntime: _runtime.zodConfigFileRuntime, - zodConfigFileTemplate: _template.zodConfigFileTemplate, - zodConfigFileTemplates: _templates.zodConfigFileTemplates, - zodConfigFileWorkspace: _workspace.zodConfigFileWorkspace, - zodConfigFileWorkspaces: _workspaces.zodConfigFileWorkspaces, + // zodConfigFileTemplate: _template.zodConfigFileTemplate, + // zodConfigFileTemplates: _templates.zodConfigFileTemplates, + // zodConfigFileWorkspace: _workspace.zodConfigFileWorkspace, + // zodConfigFileWorkspaces: _workspaces.zodConfigFileWorkspaces, }; export const ZodSharedSchema = { diff --git a/packages/core/src/schema/types.ts b/packages/core/src/schema/types.ts index 06f2ccf8f..e784deedb 100644 --- a/packages/core/src/schema/types.ts +++ b/packages/core/src/schema/types.ts @@ -128,7 +128,7 @@ export type ConfigPlatformsSchema = Partial; -export type ConfigFileApp = ConfigRootAppBaseFragment & { +type ConfigFileSectionApp = ConfigRootAppBaseFragment & { common?: ConfigCommonSchema; platforms?: ConfigPlatformsSchema; plugins?: ConfigPluginsSchema; @@ -138,17 +138,51 @@ export type ConfigFileApp = ConfigRootAppBaseFragment & { // BuildConfig ----------------------- // type RootPluginsMerged = { - scopedPluginTemplates: Record; + scopedPluginTemplates: Record; }; -// renative.build.json -export type ConfigFileBuildConfig = ConfigFileTemplates & - ConfigFileWorkspace & +// renative.build.json; +export type ConfigFileBuildConfig = ConfigFileSectionTemplates & + ConfigFileSectionWorkspace & RootPluginsMerged & - ConfigFileProject & - ConfigFileLocal & + ConfigFileSectionProject & + ConfigFileSectionLocal & ConfigRootAppBaseFragment; +// renative.build.json + +// export type ConfigFileBuildConfig = { +// template: { +// templateProject: ConfigFileSectionTemplate; +// templateIntegrations: ConfigFileSectionTemplates; +// templateProjects: ConfigFileSectionTemplates; +// templatePlugins: ConfigFileSectionTemplates; +// }; +// workspace: ConfigFileSectionWorkspace; +// project: ConfigFileSectionProject & RootPluginsMerged; +// local: ConfigFileSectionLocal; +// app: ConfigFileSectionApp; +// }; + +// export type ConfigFileRenative = { +// app: ConfigFileSectionApp; +// project: ConfigFileSectionProject; +// local: ConfigFileSectionLocal; +// overrides: ConfigFileSectionOverrides; +// integration: ConfigFileSectionIntegration; +// engine: ConfigFileSectionEngine; +// plugin: ConfigFileSectionPlugin; +// private: ConfigFileSectionPrivate; +// template: { +// templateProject: ConfigFileSectionTemplate; +// templateIntegrations: ConfigFileSectionTemplates; +// templateProjects: ConfigFileSectionTemplates; +// templatePlugins: ConfigFileSectionTemplates; +// }; +// workspace: ConfigFileSectionWorkspace; +// // workspaces: ConfigFileSectionWorkspaces; +// } & ConfigFileSectionWorkspaces; + export type BuildConfigKey = keyof ConfigFileBuildConfig; export type ConfigPropRootMerged = ConfigFileBuildConfig & T; @@ -158,22 +192,22 @@ export type GetConfigRootPropVal> = Conf // Engine ----------------------- // // renative.engine.json -export type ConfigFileEngine = z.infer; +type ConfigFileSectionEngine = z.infer; // Integration ----------------------- // // renative.integration.json -export type ConfigFileIntegration = z.infer; +type ConfigFileSectionIntegration = z.infer; // Local ----------------------- // // renative.local.json -export type ConfigFileLocal = z.infer; +type ConfigFileSectionLocal = z.infer; // Overrides ----------------------- // //overrides.json -export type ConfigFileOverrides = z.infer; +type ConfigFileSectionOverrides = z.infer; // Plugin ----------------------- // @@ -188,13 +222,13 @@ export type ConfigPluginPlatformsSchema = Record; export type ConfigPluginsSchema = Record; // renative.plugin.json -export type ConfigFilePlugin = ConfigPluginSchema & z.infer; +type ConfigFileSectionPlugin = ConfigPluginSchema & z.infer; // Private ----------------------- // export type ConfigPrivatePlatformAndroid = z.infer; // renative.private.json -export type ConfigFilePrivate = z.infer; +type ConfigFileSectionPrivate = z.infer; // Project ----------------------- // @@ -203,7 +237,7 @@ export type ConfigRootProjectBaseFragment = z.infer['paths']; // renative.json -export type ConfigFileProject = ConfigRootProjectBaseFragment & { +type ConfigFileSectionProject = ConfigRootProjectBaseFragment & { common?: ConfigCommonSchema; platforms?: ConfigPlatformsSchema; plugins?: ConfigPluginsSchema; @@ -213,7 +247,7 @@ export type ConfigFileProject = ConfigRootProjectBaseFragment & { // type ConfigTemplateBootstrapConfig = z.infer; // renative.template.json -export type ConfigFileTemplate = { +type ConfigFileSectionTemplate = { // defaults: ConfigDefault, // engines: z.optional(EnginesSchema), templateConfig?: ConfigTemplateConfigFragment; @@ -223,40 +257,54 @@ export type ConfigFileTemplate = { // Templates ----------------------- // // renative.templates.json -export type ConfigFileTemplates = z.infer; +type ConfigFileSectionTemplates = z.infer; // Workspace ----------------------- // // renative.workspace.json -export type ConfigFileWorkspace = z.infer; +type ConfigFileSectionWorkspace = z.infer; // Workspaces ----------------------- // // renative.workspaces.json -export type ConfigFileWorkspaces = z.infer; - -export type ConfigFileRenative = { - app: ConfigFileApp; - project: ConfigFileProject; - local: ConfigFileLocal; - overrides: ConfigFileOverrides; - integration: ConfigFileIntegration; - engine: ConfigFileEngine; - plugin: ConfigFilePlugin; - private: ConfigFilePrivate; - templateProject: ConfigFileTemplate; - templateIntegrations: ConfigFileTemplates; - templateProjects: ConfigFileTemplates; - templatePlugins: ConfigFileTemplates; - workspace: ConfigFileWorkspace; - workspaces: ConfigFileWorkspaces; -}; +type ConfigFileSectionWorkspaces = z.infer; // Runtime ----------------------- // // renative.runtime.json export type ConfigFileRuntime = z.infer; +export type ConfigFileRenative = { + app: ConfigFileSectionApp; + project: ConfigFileSectionProject; + local: ConfigFileSectionLocal; + overrides: ConfigFileSectionOverrides['overrides']; + integration: ConfigFileSectionIntegration; + engine: ConfigFileSectionEngine; + plugin: ConfigFileSectionPlugin; + private: ConfigFileSectionPrivate; + template: ConfigFileSectionTemplate; + templates: ConfigFileSectionTemplates; + workspace: ConfigFileSectionWorkspace; + workspaces: ConfigFileSectionWorkspaces['workspaces']; +}; +// & ConfigFileSectionLocal; + +export type ConfigFileEngine = Pick; +export type ConfigFileIntegration = Pick; +export type ConfigFileLocal = ConfigFileRenative; +export type ConfigFileOverrides = Pick; +// export type ConfigFileRuntime = ConfigFileRenative; +export type ConfigFilePlugin = Pick; +export type ConfigFileApp = Pick; +export type ConfigFilePrivate = ConfigFileRenative; +export type ConfigFileProject = Pick; + +export type ConfigFileTemplate = Pick; +export type ConfigFileTemplates = Pick; +export type ConfigFileWorkspace = Pick; +export type ConfigFileWorkspaces = Pick; + // ConfigProp ----------------------- // export type ConfigProp = ConfigPlatformSchemaFragment; @@ -264,3 +312,4 @@ export type ConfigPropKey = keyof ConfigProp; export type ConfigPropMerged = ConfigProp & T; export type ConfigPropKeyMerged = keyof ConfigPropMerged; export type GetConfigPropVal> = ConfigPropMerged[K] | undefined; +export type FlatConfigFile = Record; diff --git a/packages/core/src/system/__tests__/exec.test.ts b/packages/core/src/system/__tests__/exec.test.ts index 54550ee92..ec6fe1249 100644 --- a/packages/core/src/system/__tests__/exec.test.ts +++ b/packages/core/src/system/__tests__/exec.test.ts @@ -1,3 +1,4 @@ +import { createRnvApi } from '../../api'; import { generateApiDefaults } from '../../api/defaults'; import { getApi } from '../../api/provider'; import { generateContextDefaults } from '../../context/defaults'; @@ -8,6 +9,9 @@ jest.mock('../../logger'); jest.mock('../../context/provider'); jest.mock('../../api/provider'); +beforeAll(() => { + createRnvApi(); +}); beforeEach(() => { // NOTE: do not call createRnvContext() in core library itself. It is not a mock jest.mocked(getApi).mockReturnValue(generateApiDefaults()); diff --git a/packages/core/src/system/fs.ts b/packages/core/src/system/fs.ts index 96545c4f5..cf4acba03 100755 --- a/packages/core/src/system/fs.ts +++ b/packages/core/src/system/fs.ts @@ -11,8 +11,9 @@ import type { FileUtilsPropConfig, OverridesOptions, TimestampPathsConfig } from import { getApi } from '../api/provider'; import { getContext } from '../context/provider'; import { matchRegEx } from './regEx'; -import type { ConfigPropKey } from '../schema/types'; +import type { ConfigFileRenative, ConfigPropKey } from '../schema/types'; import lGet from 'lodash/get'; +import { getUpdatedConfigFile } from '../configs/utils'; export const fsWriteFileSync = (dest: string | undefined, data: string, options?: fs.WriteFileOptions) => { // if (dest && dest.includes('renative.json')) { @@ -755,10 +756,11 @@ export const getFileListSync = (dir: fs.PathLike) => { return results; }; -export const loadFile = >( +export const loadFile = async >( fileObj: T, pathObj: Partial>, - key: K + key: K, + namespace?: keyof ConfigFileRenative ) => { const pKey = `${key}Exists` as K; const pth = pathObj[key]; @@ -773,7 +775,10 @@ export const loadFile = >( try { if (typeof pth === 'string') { const fileString = fsReadFileSync(pth).toString(); - fileObj[key] = JSON.parse(fileString); + const configFile = JSON.parse(fileString); + + const updatedConfigFile = await getUpdatedConfigFile(configFile, pth, namespace); + fileObj[key] = updatedConfigFile; pathObj[pKey] = true; logDebug(`FILE_EXISTS: ${key}:true size:${formatBytes(Buffer.byteLength(fileString, 'utf8'))}`); // if (validateRuntimeObjectSchema && fileObj[key]) { @@ -782,7 +787,7 @@ export const loadFile = >( // logWarning(`Invalid schema in ${pathObj[key]}. ISSUES: ${JSON.stringify(ajv.errors, null, 2)}`); // } // } - // if (pathObj[key].includes?.('renative.json')) { + // if (pathObj[key].includes?.(RnvFileName.renative)) { // console.log(`FILE_EXISTS: ${key}:true size:${formatBytes(Buffer.byteLength(fileString, 'utf8'))}`); // } } diff --git a/packages/core/src/tasks/taskFinder.ts b/packages/core/src/tasks/taskFinder.ts index 2b580f7ac..757ef4dfe 100644 --- a/packages/core/src/tasks/taskFinder.ts +++ b/packages/core/src/tasks/taskFinder.ts @@ -31,7 +31,7 @@ export const findTasksByTaskName = (taskName: string) => { // If we found a task with platform restriction and it does not match current platform we skip it return; } - if (ctx.runtime.engine && v.ownerID !== ctx.runtime.engine?.config?.name) { + if (ctx.runtime.engine && v.ownerID !== ctx.runtime.engine?.config?.engine?.name) { // If we already know specific engine to be used and task is not from that engine we skip it return; } diff --git a/packages/core/src/tasks/taskOptions.ts b/packages/core/src/tasks/taskOptions.ts index cd6bc414d..e7a9d1db6 100644 --- a/packages/core/src/tasks/taskOptions.ts +++ b/packages/core/src/tasks/taskOptions.ts @@ -238,6 +238,7 @@ export const RnvTaskCoreOptionPresets = createTaskOptionsPreset({ RnvTaskOptions.noIntro, RnvTaskOptions.offline, RnvTaskOptions.skipDependencyCheck, + RnvTaskOptions.configName, ], }); diff --git a/packages/core/src/tasks/wizard.ts b/packages/core/src/tasks/wizard.ts index f7823c9c1..837bc6c65 100644 --- a/packages/core/src/tasks/wizard.ts +++ b/packages/core/src/tasks/wizard.ts @@ -10,7 +10,7 @@ import { RnvTask } from './types'; const isTaskSupportedOnPlatform = (task: RnvTask, platform: RnvPlatform) => { if (!task.platforms) return true; - const selectedEngineID = getEngineRunnerByPlatform(platform)?.config.name; + const selectedEngineID = getEngineRunnerByPlatform(platform)?.config.engine.name; if (task.ownerType === 'engine' && selectedEngineID && task.ownerID && task.ownerID !== selectedEngineID) { // If we already specified platform we can skip tasks registered to unsupported engines return false; diff --git a/packages/core/src/templates/index.ts b/packages/core/src/templates/index.ts index 346c31313..3d35cb716 100644 --- a/packages/core/src/templates/index.ts +++ b/packages/core/src/templates/index.ts @@ -15,6 +15,7 @@ import { getContext } from '../context/provider'; import { RnvFolderName } from '../enums/folderName'; import { checkIfProjectAndNodeModulesExists } from '../projects/npm'; import type { ConfigFileProject, ConfigFileTemplate } from '../schema/types'; +import { getUpdatedConfigFile } from '../configs/utils'; export const configureTemplateFiles = async () => { logDefault('configureTemplateFiles'); @@ -22,9 +23,13 @@ export const configureTemplateFiles = async () => { const c = getContext(); const templateConfig = readObjectSync(c.paths.template.configTemplate); - - let mergedObj = _getProjectTemplateMergedConfig(templateConfig); - const includedPaths = mergedObj?.templateConfig?.includedPaths; + const updatedTemplateConfig = await getUpdatedConfigFile( + templateConfig!, + c.paths.template.configTemplate, + 'template' + ); + let mergedObj = _getProjectTemplateMergedConfig(updatedTemplateConfig); + const includedPaths = mergedObj?.template.templateConfig?.includedPaths; if (includedPaths) { includedPaths.forEach((pth) => { @@ -65,6 +70,7 @@ export const isTemplateInstalled = () => { export const applyTemplate = async () => { const c = getContext(); logDefault('applyTemplate'); + if (c.buildConfig?.isTemplate) return true; if (!c.files.project.config) { logError('Project config not loaded. cannot apply template'); @@ -80,7 +86,7 @@ export const applyTemplate = async () => { const _applyTemplate = async (c: RnvContext) => { logDefault('_applyTemplate'); - const tplName = c.buildConfig.templateConfig?.name; + const tplName = c.buildConfig?.templateConfig?.name; if (!tplName) { logError(`Template config missing. Make sure renative.json >> templateConfig.name is set`); return; @@ -91,11 +97,15 @@ const _applyTemplate = async (c: RnvContext) => { return; } c.paths.template.dir = tpPath; - if (c.paths.template.dir) { - c.paths.template.configTemplate = path.join(c.paths.template.dir, RnvFileName.renativeTemplate); + const isNewConfigPath = fsExistsSync(path.join(c.paths.template.dir, RnvFileName.rnv)); + const templateConfigPath = isNewConfigPath + ? path.join(c.paths.template.dir, RnvFileName.rnv) + : path.join(c.paths.template.dir, RnvFileName.renativeTemplate); + + c.paths.template.configTemplate = path.join(templateConfigPath); - c.paths.template.config = path.join(c.paths.template.dir, RnvFileName.renative); + c.paths.template.config = path.join(templateConfigPath); } if (!fsExistsSync(c.paths.template.configTemplate)) { logWarning( diff --git a/packages/engine-core/src/buildSchemes.ts b/packages/engine-core/src/buildSchemes.ts index 30fcc95c8..8827f0b7f 100644 --- a/packages/engine-core/src/buildSchemes.ts +++ b/packages/engine-core/src/buildSchemes.ts @@ -18,7 +18,6 @@ export const isBuildSchemeSupported = async () => { const baseBuildSchemes = c.buildConfig.common?.buildSchemes || {}; const platformBuildSchemes = platforms[c.platform]?.buildSchemes || {}; - const buildSchemes = merge(baseBuildSchemes, platformBuildSchemes); c.buildConfig.platforms = platforms; diff --git a/packages/engine-core/src/index.ts b/packages/engine-core/src/index.ts index 5ab72dfd5..9c8324781 100644 --- a/packages/engine-core/src/index.ts +++ b/packages/engine-core/src/index.ts @@ -36,10 +36,13 @@ import taskUnlink from './tasks/linking/taskUnlink'; import taskSwitch from './tasks/app/taskAppSwitch'; import taskPatchReset from './tasks/patch/taskPatchReset'; const Config: ConfigFileEngine = { - platforms: {}, - npm: {}, - engineExtension: 'core', - name: '@rnv/engine-core', + engine: { + platforms: {}, + npm: {}, + engineExtension: 'core', + name: '@rnv/engine-core', + plugins: {}, + }, }; const Engine = createRnvEngine({ diff --git a/packages/engine-core/src/tasks/app/taskAppConfigure.ts b/packages/engine-core/src/tasks/app/taskAppConfigure.ts index 5ad4186b6..88e97049c 100644 --- a/packages/engine-core/src/tasks/app/taskAppConfigure.ts +++ b/packages/engine-core/src/tasks/app/taskAppConfigure.ts @@ -13,7 +13,7 @@ import { fsReadFileSync, fsRenameSync, RnvTaskOptionPresets, - listAppConfigsFoldersSync, + listAppConfigsFoldersAsync, updateRenativeConfigs, inquirerPrompt, RnvContext, @@ -22,11 +22,12 @@ import { createTask, checkAndInstallPackageDependenciesIfRequired, getContext, + RnvFileName, } from '@rnv/core'; const _loadAppConfigIDfromDir = (dirName: string, appConfigsDir: string) => { logDebug(`_loadAppConfigIDfromDir:${dirName}:${appConfigsDir}`, chalk().grey); - const filePath = path.join(appConfigsDir, 'renative.json'); + const filePath = path.join(appConfigsDir, RnvFileName.renative); if (fsExistsSync(filePath)) { try { const renativeConf = JSON.parse(fsReadFileSync(filePath).toString()); @@ -79,7 +80,7 @@ const _askUserAboutConfigs = async (ctx: RnvContext, dir: string, id: string, ba } if (choice === 'keepFolder') { - const filePath = path.join(basePath, dir, 'renative.json'); + const filePath = path.join(basePath, dir, RnvFileName.renative); const fileContents = JSON.parse(fsReadFileSync(filePath).toString()); fileContents.id = dir; conf.id = dir; @@ -141,7 +142,7 @@ const _findAndSwitchAppConfigDir = async (ctx: RnvContext) => { }; const _setAppId = (ctx: RnvContext, appId: string) => { - const currentAppConfigId = ctx.files.project?.configLocal?._meta?.currentAppConfigId; + const currentAppConfigId = ctx.files.project?.configLocal?.local?._meta?.currentAppConfigId; logTask('_setAppId', `appId:${appId} runtime.appId:${ctx.runtime.appId} _meta.appId:${currentAppConfigId}`); ctx.runtime.appId = appId || ctx.runtime.appId || currentAppConfigId; @@ -150,20 +151,20 @@ const _setAppId = (ctx: RnvContext, appId: string) => { const appConfigure = async () => { const ctx = getContext(); - ctx.paths.project.appConfigsDirNames = listAppConfigsFoldersSync(true); + ctx.paths.project.appConfigsDirNames = await listAppConfigsFoldersAsync(true); ctx.paths.project.appConfigsDirNames.forEach((dirName) => { ctx.paths.project.appConfigsDirs.push(path.join(ctx.paths.project.appConfigsDir, dirName)); }); const appConfigsDirsExt = ctx.buildConfig?.paths?.appConfigsDirs; if (appConfigsDirsExt) { - appConfigsDirsExt.forEach((apePath) => { - const appConfigsExt = listAppConfigsFoldersSync(true, apePath); + for (const apePath of appConfigsDirsExt) { + const appConfigsExt: string[] = await listAppConfigsFoldersAsync(true, apePath); appConfigsExt.forEach((appExtName) => { ctx.paths.project.appConfigsDirNames.push(appExtName); ctx.paths.project.appConfigsDirs.push(path.join(apePath, appExtName)); }); - }); + } } // Reset appId if appConfig no longer exists but renative.local.json still has reference to it diff --git a/packages/engine-core/src/tasks/app/taskAppCreate.ts b/packages/engine-core/src/tasks/app/taskAppCreate.ts index 1f75c73b5..85781a0cc 100644 --- a/packages/engine-core/src/tasks/app/taskAppCreate.ts +++ b/packages/engine-core/src/tasks/app/taskAppCreate.ts @@ -14,6 +14,7 @@ import { ConfigFileApp, RnvTaskName, createTask, + RnvFileName, } from '@rnv/core'; import { getContext } from '../../getContext'; @@ -117,11 +118,11 @@ export default createTask({ if (sourcePath) await copyFolderContentsRecursive(sourcePath, destPath); logInfo('Copying new app config...DONE'); - const confObjPath = path.join(destPath, 'renative.json'); - const confObj = readObjectSync(confObjPath) || {}; + const confObjPath = path.join(destPath, RnvFileName.renative); + const confObj = readObjectSync(confObjPath) || { app: {}, project: {} }; - confObj.id = appConfigId; - confObj.common = confObj.common || {}; + confObj.app.id = appConfigId; + confObj.app.common = confObj.app.common || {}; let appConfigTitle; if (c.program.opts().title) { @@ -132,12 +133,12 @@ export default createTask({ const { confTitle } = await inquirerPrompt({ name: 'confTitle', type: 'input', - default: confObj.common?.title || '', + default: confObj.app.common?.title || '', message: 'Type the title of the app', }); appConfigTitle = confTitle; } - confObj.common.title = appConfigTitle || confObj.common.title; + confObj.app.common.title = appConfigTitle || confObj.app.common.title; let bundleId; if (c.program.opts().id) { @@ -148,12 +149,12 @@ export default createTask({ const { confId } = await inquirerPrompt({ name: 'confId', type: 'input', - default: confObj.common?.id || '', + default: confObj.app.common?.id || '', message: 'Type the id of the app (bundle identifier)', }); bundleId = confId; } - confObj.common.id = bundleId || confObj.common.id; + confObj.app.common.id = bundleId || confObj.app.common.id; writeFileSync(confObjPath, confObj); diff --git a/packages/engine-core/src/tasks/bootstrap/__tests__/questionHelpers.test.ts b/packages/engine-core/src/tasks/bootstrap/__tests__/questionHelpers.test.ts index 883485252..5acfcc17d 100644 --- a/packages/engine-core/src/tasks/bootstrap/__tests__/questionHelpers.test.ts +++ b/packages/engine-core/src/tasks/bootstrap/__tests__/questionHelpers.test.ts @@ -61,10 +61,12 @@ describe('configureConfigOverrides', () => { files: { project: { renativeConfig: { - platforms: { - platform1: {}, - platform2: {}, - platform3: {}, + project: { + platforms: { + platform1: {}, + platform2: {}, + platform3: {}, + }, }, }, }, @@ -73,11 +75,11 @@ describe('configureConfigOverrides', () => { await configureConfigOverrides(data as any); - expect(data.files.project.renativeConfig.platforms).toEqual({ + expect(data.files.project.renativeConfig.project.platforms).toEqual({ platform1: {}, platform2: {}, }); - expect((data.files.project.renativeConfig as any).defaults).toEqual({ + expect((data.files.project.renativeConfig.project as any).defaults).toEqual({ supportedPlatforms: ['platform1', 'platform2'], }); }); diff --git a/packages/engine-core/src/tasks/bootstrap/questionHelpers.ts b/packages/engine-core/src/tasks/bootstrap/questionHelpers.ts index 716a26eb9..b89907ea9 100644 --- a/packages/engine-core/src/tasks/bootstrap/questionHelpers.ts +++ b/packages/engine-core/src/tasks/bootstrap/questionHelpers.ts @@ -71,7 +71,7 @@ export const initNewProject = async () => { const c = getContext(); c.paths.project.package = path.join(c.paths.project.dir, RnvFileName.package); - c.paths.project.config = path.join(c.paths.project.dir, RnvFileName.renative); + c.paths.project.config = path.join(c.paths.project.dir, RnvFileName.rnv); const data: NewProjectData = { defaults: { @@ -84,12 +84,16 @@ export const initNewProject = async () => { inputs: {}, files: { project: { - renativeConfig: {}, + renativeConfig: { + project: {}, + }, packageJson: {}, }, configTemplates: {}, template: { - renativeTemplateConfig: {}, + renativeTemplateConfig: { + template: {}, + }, renativeConfig: {}, }, }, @@ -108,25 +112,25 @@ export const configureConfigOverrides = async (data: NewProjectData) => { const supPlats = inputs.supportedPlatforms || []; // In case of copied config instead of extended we want to cleanup unused platforms - if (renativeConfig.platforms) { - Object.keys(renativeConfig.platforms).forEach((k) => { + if (renativeConfig.project?.platforms) { + Object.keys(renativeConfig.project.platforms).forEach((k) => { const key = k as RnvPlatformKey; - if (!supPlats.includes(key) && renativeConfig.platforms) { - delete renativeConfig.platforms[key]; + if (!supPlats.includes(key) && renativeConfig.project?.platforms) { + delete renativeConfig.project.platforms[key]; } }); } // This is project config override only - renativeConfig.defaults = renativeConfig.defaults || {}; - renativeConfig.defaults.supportedPlatforms = supPlats; + renativeConfig.project.defaults = renativeConfig.project?.defaults || {}; + renativeConfig.project.defaults.supportedPlatforms = supPlats; // renativeConfig.engines = renativeConfig.engines || {}; // This is merged config result // const loadedConf = c.files.project.config; // Configure only required engines based on supportedPlatforms - const engines = renativeConfig?.engines; + const engines = renativeConfig?.project.engines; if (engines) { // Remove unused engines based on selected platforms // TODO: old logic, this need to be reworked. diff --git a/packages/engine-core/src/tasks/bootstrap/questions/appConfigs.ts b/packages/engine-core/src/tasks/bootstrap/questions/appConfigs.ts index 37447e577..ac4e78c0d 100644 --- a/packages/engine-core/src/tasks/bootstrap/questions/appConfigs.ts +++ b/packages/engine-core/src/tasks/bootstrap/questions/appConfigs.ts @@ -1,12 +1,16 @@ import { type ConfigFileApp, getContext, - listAppConfigsFoldersSync, + listAppConfigsFoldersAsync, readObjectSync, logInfo, chalk, RnvFileName, writeFileSync, + getUpdatedConfigFile, + fsExistsSync, + removeFilesSync, + generateNewSchemaPath, } from '@rnv/core'; import type { NewProjectData } from '../types'; import path from 'path'; @@ -15,24 +19,44 @@ const Question = async (data: NewProjectData): Promise => { const c = getContext(); const { inputs } = data; // Update appConfigs with new appTitle and appID - const appConfigs = listAppConfigsFoldersSync(true); + + const appConfigs = await listAppConfigsFoldersAsync(true); if (appConfigs && appConfigs.length > 0) { - appConfigs.forEach((appConfigID) => { - const appCnfPath = path.join(c.paths.project.appConfigsDir, appConfigID, RnvFileName.renative); - const appConfig = readObjectSync(appCnfPath); - if (appConfig) { - appConfig.common = appConfig.common || {}; - appConfig.common.title = inputs.appTitle; - appConfig.common.id = inputs.appID; - appConfig.common.description = `This is ${inputs.appTitle} app!`; + for (const appConfigID of appConfigs) { + const isNewConfigPath = fsExistsSync( + path.join(c.paths.project.appConfigsDir, appConfigID, RnvFileName.rnv) + ); + + const appCnfPath = isNewConfigPath + ? path.join(c.paths.project.appConfigsDir, appConfigID, RnvFileName.rnv) + : path.join(c.paths.project.appConfigsDir, appConfigID, RnvFileName.renative); + const appConfig = readObjectSync(appCnfPath); + const updatedAppConfig = await getUpdatedConfigFile(appConfig!, appCnfPath, 'app'); + + if (updatedAppConfig) { + updatedAppConfig.project = updatedAppConfig.project || {}; + updatedAppConfig.project.common = updatedAppConfig.app.common || updatedAppConfig.project.common || {}; + updatedAppConfig.project.common.title = inputs.appTitle; + updatedAppConfig.project.common.id = inputs.appID; + updatedAppConfig.project.common.description = `This is ${inputs.appTitle} app!`; + updatedAppConfig.$schema = generateNewSchemaPath( + path.join(c.paths.project.appConfigsDir, appConfigID, RnvFileName.rnv) + ); logInfo( `Updating appConfig ${chalk().bold.white(appConfigID)} with title: ${chalk().bold.white( inputs.appTitle )} and id: ${chalk().bold.white(inputs.appID)}` ); - writeFileSync(appCnfPath, appConfig); + + writeFileSync(path.join(c.paths.project.appConfigsDir, appConfigID, RnvFileName.rnv), updatedAppConfig); + if (!isNewConfigPath) { + removeFilesSync([appCnfPath]); + } + if (fsExistsSync(path.join(c.paths.project.appConfigsDir, appConfigID, RnvFileName.renative))) { + removeFilesSync([path.join(c.paths.project.appConfigsDir, appConfigID, RnvFileName.renative)]); + } } - }); + } } }; diff --git a/packages/engine-core/src/tasks/bootstrap/questions/applyTemplate.ts b/packages/engine-core/src/tasks/bootstrap/questions/applyTemplate.ts index 5c4257e2b..e42e0c46c 100644 --- a/packages/engine-core/src/tasks/bootstrap/questions/applyTemplate.ts +++ b/packages/engine-core/src/tasks/bootstrap/questions/applyTemplate.ts @@ -1,4 +1,4 @@ -import { getContext, inquirerPrompt, mergeObjects } from '@rnv/core'; +import { generateNewSchemaPath, getContext, inquirerPrompt, mergeObjects } from '@rnv/core'; import type { NewProjectData } from '../types'; const Question = async (data: NewProjectData): Promise => { @@ -16,7 +16,7 @@ const Question = async (data: NewProjectData): Promise => { const { configOption } = await inquirerPrompt({ name: 'configOption', type: 'list', - message: 'How to create config renative.json?', + message: 'How to create config?', default: optExtend, choices: options, }); @@ -26,10 +26,32 @@ const Question = async (data: NewProjectData): Promise => { } if (configOption === optExtend) { - const rnvConfig = files.template.renativeTemplateConfig.templateConfig?.renative_json || { - extendsTemplate: `${tplName}/renative.json`, + const rnvConfig = files.template.renativeTemplateConfig?.template?.templateConfig?.renative_json || { + extendsTemplate: `${tplName}/rnv.json`, }; - files.project.renativeConfig = { ...rnvConfig, ...files.project.renativeConfig }; + + if (rnvConfig?.$schema) { + const { $schema, ...restRnvConfig } = rnvConfig; + const projectConfig = { + $schema: generateNewSchemaPath(c.paths.project.config), + project: { + ...restRnvConfig, + ...files.project.renativeConfig.project, + }, + }; + files.project.renativeConfig = { + ...files.project.renativeConfig, + ...projectConfig, + }; + } else { + files.project.renativeConfig = { + ...files.project.renativeConfig, + project: { + ...files.project.renativeConfig.project, + ...rnvConfig, + }, + }; + } } else if (configOption === optCopy) { files.project.renativeConfig = { ...files.template.renativeConfig, @@ -37,7 +59,7 @@ const Question = async (data: NewProjectData): Promise => { }; } - const packageJson = files.template.renativeTemplateConfig.templateConfig?.package_json || {}; + const packageJson = files.template.renativeTemplateConfig?.template.templateConfig?.package_json || {}; files.project.packageJson = mergeObjects(c, files.project.packageJson, packageJson); }; diff --git a/packages/engine-core/src/tasks/bootstrap/questions/bookmarkTemplate.ts b/packages/engine-core/src/tasks/bootstrap/questions/bookmarkTemplate.ts index 7bfe26fa5..c4a58529d 100644 --- a/packages/engine-core/src/tasks/bootstrap/questions/bookmarkTemplate.ts +++ b/packages/engine-core/src/tasks/bootstrap/questions/bookmarkTemplate.ts @@ -10,7 +10,7 @@ const Question = async (data: NewProjectData) => { return Promise.reject('Template not selected'); } - const configFile = c.files.workspace.config || {}; + const configFile = c.files.workspace.config || { workspace: {} }; // const defProjTemplates = c.files.rnvConfigTemplates.config?.projectTemplates || {}; // const wsProjTemplates = configFile.projectTemplates || {}; const projTemplates = c.buildConfig.projectTemplates || {}; @@ -38,10 +38,13 @@ const Question = async (data: NewProjectData) => { if (configFile) { if (confirmAddTemplate) { - if (!configFile.projectTemplates) { - configFile.projectTemplates = {}; + if (!configFile.workspace) { + configFile.workspace = {}; } - configFile.projectTemplates[templateName] = { + if (!configFile.workspace.projectTemplates) { + configFile.workspace.projectTemplates = {}; + } + configFile.workspace.projectTemplates[templateName] = { packageName: inputs.template.packageName, localPath: inputs.template.localPath, description: inputs.template.description, diff --git a/packages/engine-core/src/tasks/bootstrap/questions/bootstrapQuestions.ts b/packages/engine-core/src/tasks/bootstrap/questions/bootstrapQuestions.ts index 799d47b25..9c84e92fb 100644 --- a/packages/engine-core/src/tasks/bootstrap/questions/bootstrapQuestions.ts +++ b/packages/engine-core/src/tasks/bootstrap/questions/bootstrapQuestions.ts @@ -3,8 +3,12 @@ import lSet from 'lodash/set'; import type { NewProjectData } from '../types'; import { getContext } from '../../../getContext'; -type ConfigProp = Required['bootstrapConfig']>['bootstrapQuestions'][number]['configProp']; -type BootstrapQuestions = Required['bootstrapConfig']>['bootstrapQuestions']; +type ConfigProp = Required< + Required['template']>['bootstrapConfig'] +>['bootstrapQuestions'][number]['configProp']; +type BootstrapQuestions = Required< + Required['template']>['bootstrapConfig'] +>['bootstrapQuestions']; type QuestionResults = Record< string, { @@ -18,7 +22,8 @@ const Question = async (data: NewProjectData) => { const c = getContext(); const { inputs, files } = data; inputs.bootstrapQuestions = {}; - const bootstrapQuestions = files.template.renativeTemplateConfig?.bootstrapConfig?.bootstrapQuestions || []; + const bootstrapQuestions = + files.template.renativeTemplateConfig?.template?.bootstrapConfig?.bootstrapQuestions || []; const results: QuestionResults = {}; const providedAnswers: Record = {}; diff --git a/packages/engine-core/src/tasks/bootstrap/questions/configTemplates.ts b/packages/engine-core/src/tasks/bootstrap/questions/configTemplates.ts index 6ba3e76ab..635682592 100644 --- a/packages/engine-core/src/tasks/bootstrap/questions/configTemplates.ts +++ b/packages/engine-core/src/tasks/bootstrap/questions/configTemplates.ts @@ -16,14 +16,16 @@ const Question = async (data: NewProjectData): Promise => { const cnfTemplatesName = '@rnv/config-templates'; const cnfDepVer = - files.template.renativeTemplateConfig?.templateConfig?.package_json?.devDependencies?.[cnfTemplatesName]; + files.template.renativeTemplateConfig?.template?.templateConfig?.package_json?.devDependencies?.[ + cnfTemplatesName + ]; if (cnfDepVer) { // If we find the config-templates package in the devDependencies of the project's package.json, // we will use it as source for engines await executeAsync(`${isYarnInstalled() ? 'yarn' : 'npm'} add ${cnfTemplatesName}@${cnfDepVer} --dev`, { cwd: c.paths.project.dir, }); - const ctCnfPath = path.join(c.paths.project.nodeModulesDir, cnfTemplatesName, RnvFileName.renativeTemplates); + const ctCnfPath = path.join(c.paths.project.nodeModulesDir, cnfTemplatesName, RnvFileName.rnv); if (fsExistsSync(ctCnfPath)) { files.configTemplates.config = readObjectSync(ctCnfPath) || undefined; } diff --git a/packages/engine-core/src/tasks/bootstrap/questions/installEngines.ts b/packages/engine-core/src/tasks/bootstrap/questions/installEngines.ts index 13906fcb4..fb6ae61d3 100644 --- a/packages/engine-core/src/tasks/bootstrap/questions/installEngines.ts +++ b/packages/engine-core/src/tasks/bootstrap/questions/installEngines.ts @@ -74,20 +74,26 @@ const Question = async (data: NewProjectData) => { devDeps[key] = version; const nmDir = path.join(cwd, 'node_modules'); - const engineConfigPath = path.join(nmDir, key, RnvFileName.renativeEngine); + const isNewConfigPath = fsExistsSync(path.join(nmDir, key, RnvFileName.rnv)); + + const engineConfigPath = path.join( + nmDir, + key, + isNewConfigPath ? RnvFileName.rnv : RnvFileName.renativeEngine + ); const engineConfig = readObjectSync(engineConfigPath); if (engineConfig && supportedPlatforms) { supportedPlatforms.forEach((platform) => { - const npmDeps = engineConfig?.platforms?.[platform]?.npm; + const npmDeps = engineConfig?.engine?.platforms?.[platform]?.npm; if (npmDeps) { _mergeDependencies(deps, npmDeps.dependencies); _mergeDependencies(devDeps, npmDeps.devDependencies); } }); - if (engineConfig?.npm) { - _mergeDependencies(deps, engineConfig.npm.dependencies); - _mergeDependencies(devDeps, engineConfig.npm.devDependencies); + if (engineConfig?.engine?.npm) { + _mergeDependencies(deps, engineConfig.engine.npm.dependencies); + _mergeDependencies(devDeps, engineConfig.engine.npm.devDependencies); } } } diff --git a/packages/engine-core/src/tasks/bootstrap/questions/installTemplate.ts b/packages/engine-core/src/tasks/bootstrap/questions/installTemplate.ts index 65d95b480..9c6a1e61f 100644 --- a/packages/engine-core/src/tasks/bootstrap/questions/installTemplate.ts +++ b/packages/engine-core/src/tasks/bootstrap/questions/installTemplate.ts @@ -11,6 +11,7 @@ import { fsExistsSync, fsLstatSync, fsReaddirSync, + getUpdatedConfigFile, inquirerPrompt, inquirerSeparator, isYarnInstalled, @@ -27,7 +28,7 @@ import { saveProgressIntoProjectConfig } from '../questionHelpers'; import { merge } from 'lodash'; import { getContext } from '../../../getContext'; -const mergeIntoProjectConfig = (data: NewProjectData, updateObj: ConfigFileProject) => { +const mergeIntoProjectConfig = (data: NewProjectData, updateObj: ConfigFileTemplate) => { const { files } = data; files.project.renativeConfig = merge(files.project.renativeConfig, updateObj); }; @@ -49,7 +50,6 @@ const Question = async (data: NewProjectData) => { const projectTemplates = c.buildConfig.projectTemplates || {}; // c.files.rnvConfigTemplates.config?.projectTemplates || {}; const projectTemplateKeys = Object.keys(projectTemplates); - inputs.template = {}; if (checkInputValue(projectTemplate)) { @@ -118,7 +118,8 @@ const Question = async (data: NewProjectData) => { if (!fsExistsSync(localTemplatePath)) { return Promise.reject(`Local template path ${localTemplatePath} does not exist`); } - const templateConfigPath = path.join(localTemplatePath, RnvFileName.renativeTemplate); + const templateConfigPath = path.join(localTemplatePath, RnvFileName.rnv || RnvFileName.renativeTemplate); + if (!fsExistsSync(templateConfigPath)) { return Promise.reject( `Renative template config path ${templateConfigPath} does not exist. Are you sure the path provided is a correct template folder?` @@ -163,7 +164,9 @@ const Question = async (data: NewProjectData) => { RnvFolderName.platformAssets, RnvFolderName.secrets, RnvFolderName.dotRnv, + RnvFileName.renative, ]; + fsReaddirSync(localTemplatePath).forEach((file) => { if (!ignorePaths.includes(file) && localTemplatePath) { const sourcePath = path.join(localTemplatePath, file); @@ -197,9 +200,11 @@ const Question = async (data: NewProjectData) => { }, }); mergeIntoProjectConfig(data, { - templateConfig: { - name: inputs.template.packageName, - version: filePath, + template: { + templateConfig: { + name: inputs.template.packageName, + version: filePath, + }, }, }); await saveProgressIntoProjectConfig(data); @@ -231,9 +236,11 @@ const Question = async (data: NewProjectData) => { }); } mergeIntoProjectConfig(data, { - templateConfig: { - name: inputs.template.packageName, - version: inputs.template.version, + template: { + templateConfig: { + name: inputs.template.packageName, + version: inputs.template.version, + }, }, }); await saveProgressIntoProjectConfig(data); @@ -254,15 +261,30 @@ const Question = async (data: NewProjectData) => { const templateDir = path.join(c.paths.project.dir, 'node_modules', inputs.template.packageName); - const renativeTemplateConfig = - readObjectSync(path.join(templateDir, RnvFileName.renativeTemplate)) || {}; + const isNewConfigPath = fsExistsSync(path.join(templateDir, RnvFileName.rnv)); + const templateConfigPath = isNewConfigPath + ? path.join(templateDir, RnvFileName.rnv) + : path.join(templateDir, RnvFileName.renativeTemplate); + const renativeTemplateConfig: ConfigFileTemplate = readObjectSync(templateConfigPath) || { + template: {}, + }; if (renativeTemplateConfig) { - files.template.renativeTemplateConfig = renativeTemplateConfig; - } + const updatedRenativeTemplateConfig = await getUpdatedConfigFile( + renativeTemplateConfig, + templateConfigPath, + 'template' + ); - const renativeConfig = readObjectSync(path.join(templateDir, RnvFileName.renative)); + files.template.renativeTemplateConfig = updatedRenativeTemplateConfig; + } + const configPath = isNewConfigPath + ? path.join(templateDir, RnvFileName.rnv) + : path.join(templateDir, RnvFileName.renative); + const renativeConfig = readObjectSync(configPath); if (renativeConfig) { - files.template.renativeConfig = renativeConfig; + const updatedRenativeConfig = await getUpdatedConfigFile(renativeConfig, configPath, 'project'); + + files.template.renativeConfig = updatedRenativeConfig; } }; diff --git a/packages/engine-core/src/tasks/bootstrap/questions/projectFolder.ts b/packages/engine-core/src/tasks/bootstrap/questions/projectFolder.ts index 3ee11ede4..d96ba21ac 100644 --- a/packages/engine-core/src/tasks/bootstrap/questions/projectFolder.ts +++ b/packages/engine-core/src/tasks/bootstrap/questions/projectFolder.ts @@ -20,9 +20,9 @@ const Question = async (data: NewProjectData): Promise => { inputs.packageName = inputs.projectName?.replace(/\s+/g, '-').toLowerCase(); c.paths.project.dir = path.join(c.paths.user.currentDir, inputs.projectFolderName || ''); c.paths.project.package = path.join(c.paths.project.dir, RnvFileName.package); - c.paths.project.config = path.join(c.paths.project.dir, RnvFileName.renative); + c.paths.project.config = path.join(c.paths.project.dir, RnvFileName.rnv); - files.project.renativeConfig.projectName = inputs.projectName; + files.project.renativeConfig.project.projectName = inputs.projectName; files.project.packageJson.name = inputs.packageName; if (fsExistsSync(c.paths.project.dir)) { diff --git a/packages/engine-core/src/tasks/bootstrap/questions/supportedPlatforms.ts b/packages/engine-core/src/tasks/bootstrap/questions/supportedPlatforms.ts index fece6d12a..24a2cf3e3 100644 --- a/packages/engine-core/src/tasks/bootstrap/questions/supportedPlatforms.ts +++ b/packages/engine-core/src/tasks/bootstrap/questions/supportedPlatforms.ts @@ -41,14 +41,14 @@ const Question = async (data: NewProjectData) => { const supportedPlatforms = // files.template.renativeTemplateConfig?.templateConfig?.renative_json?..supportedPlatforms || - files.template.renativeConfig?.defaults?.supportedPlatforms || []; + files.template.renativeConfig?.project?.defaults?.supportedPlatforms || []; supportedPlatforms.sort((a, b) => RnvPlatforms.indexOf(a) - RnvPlatforms.indexOf(b)); const optsPlatforms = c.program.opts().platform && [c.program.opts().platform]; const selectedPlatforms = optsPlatforms || - files.template.renativeTemplateConfig?.bootstrapConfig?.defaultSelectedPlatforms || + files.template.renativeTemplateConfig?.template?.bootstrapConfig?.defaultSelectedPlatforms || supportedPlatforms; if (supportedPlatforms.length === 0) { diff --git a/packages/engine-core/src/tasks/bootstrap/questions/workspace.ts b/packages/engine-core/src/tasks/bootstrap/questions/workspace.ts index 49c790eda..d0d23020e 100644 --- a/packages/engine-core/src/tasks/bootstrap/questions/workspace.ts +++ b/packages/engine-core/src/tasks/bootstrap/questions/workspace.ts @@ -23,7 +23,7 @@ const Question = async (data: NewProjectData) => { } c.runtime.selectedWorkspace = data.inputs.workspaceID; - data.files.project.renativeConfig.workspaceID = data.inputs.workspaceID; + data.files.project.renativeConfig.project.workspaceID = data.inputs.workspaceID; }; export default Question; diff --git a/packages/engine-core/src/tasks/bootstrap/types.ts b/packages/engine-core/src/tasks/bootstrap/types.ts index 79024f876..cc0acbde6 100644 --- a/packages/engine-core/src/tasks/bootstrap/types.ts +++ b/packages/engine-core/src/tasks/bootstrap/types.ts @@ -34,13 +34,13 @@ export type NewProjectData = { files: { template: { renativeTemplateConfig: ConfigFileTemplate; - renativeConfig: ConfigFileProject; + renativeConfig: Partial; }; configTemplates: { config?: ConfigFileTemplates; }; project: { - renativeConfig: ConfigFileProject; + renativeConfig: Partial & Pick; packageJson: NpmPackageFile; // renativeAppConfig: ConfigFileApp; }; diff --git a/packages/engine-core/src/tasks/crypto/__tests__/taskCryptoDecrypt.test.ts b/packages/engine-core/src/tasks/crypto/__tests__/taskCryptoDecrypt.test.ts index 2a66920cb..a053299ef 100644 --- a/packages/engine-core/src/tasks/crypto/__tests__/taskCryptoDecrypt.test.ts +++ b/packages/engine-core/src/tasks/crypto/__tests__/taskCryptoDecrypt.test.ts @@ -39,12 +39,11 @@ const updateContext = () => { const ctx = getContext(); ctx.paths.workspace.dir = 'workspace/path/.rnv'; ctx.files.project.config = { - projectName: 'testProject', - crypto: { path: './secrets/privateConfigs.enc' }, + project: { projectName: 'testProject', crypto: { path: './secrets/privateConfigs.enc' } }, }; ctx.command = 'crypto'; ctx.paths.project.dir = 'project/path'; - ctx.files.project.config_original = {}; + ctx.files.project.config_original = { project: {} }; ctx.program.opts = jest.fn().mockReturnValue({ key: 'testKey', reset: false, ci: false }); return ctx; }; @@ -67,7 +66,7 @@ describe('taskCryptoDecrypt tests', () => { // GIVEN const ctx = getContext(); ctx.files.project.config = { - projectName: '@rnv/testProject', + project: { projectName: '@rnv/testProject' }, }; // WHEN // THEN @@ -86,7 +85,10 @@ describe('taskCryptoDecrypt tests', () => { }); it('should prompt user if decrypted file already exists and use existing file if confirmed', async () => { const ctx = updateContext(); - const decryptedFilePath = path.join(ctx.paths.workspace.dir, `${ctx.files.project.config?.projectName}.tgz`); + const decryptedFilePath = path.join( + ctx.paths.workspace.dir, + `${ctx.files.project.config?.project?.projectName}.tgz` + ); jest.mocked(getEnvVar).mockReturnValue('CRYPTO_RNV_TESTPROJECT'); jest.mocked(fsExistsSync).mockReturnValueOnce(true).mockReturnValueOnce(true).mockReturnValueOnce(true); jest.mocked(inquirerPrompt).mockResolvedValue({ confirm: true }); @@ -110,7 +112,7 @@ describe('taskCryptoDecrypt tests', () => { }); expect(removeFilesSync).toHaveBeenCalledWith([decryptedFilePath]); expect(logSuccess).toHaveBeenCalledWith( - `Files successfully extracted into ${ctx.paths.workspace.dir}/${ctx.files.project.config?.projectName}` + `Files successfully extracted into ${ctx.paths.workspace.dir}/${ctx.files.project.config?.project?.projectName}` ); }); it('should prompt user if decrypted folder already exists and skip decryption if user selects skip option', async () => { @@ -134,7 +136,7 @@ describe('taskCryptoDecrypt tests', () => { name: 'option', type: 'list', choices: ['Yes - override (recommended)', 'Yes - merge', 'Skip'], - message: `How to decrypt to ${ctx.paths.workspace.dir}/${ctx.files.project.config?.projectName} ?`, + message: `How to decrypt to ${ctx.paths.workspace.dir}/${ctx.files.project.config?.project?.projectName} ?`, }); }); diff --git a/packages/engine-core/src/tasks/crypto/__tests__/taskCryptoEncrypt.test.ts b/packages/engine-core/src/tasks/crypto/__tests__/taskCryptoEncrypt.test.ts index b704a66a5..ae628564a 100644 --- a/packages/engine-core/src/tasks/crypto/__tests__/taskCryptoEncrypt.test.ts +++ b/packages/engine-core/src/tasks/crypto/__tests__/taskCryptoEncrypt.test.ts @@ -35,11 +35,13 @@ const updateContext = () => { const ctx = getContext(); ctx.paths.workspace.dir = 'workspace/path/.rnv'; ctx.files.project.config = { - projectName: 'testProject', - crypto: { path: './secrets/privateConfigs.enc' }, + project: { + projectName: 'testProject', + crypto: { path: './secrets/privateConfigs.enc' }, + }, }; ctx.paths.project.dir = 'project/path'; - ctx.files.project.config_original = {}; + ctx.files.project.config_original = { project: {} }; ctx.program.opts = jest.fn().mockReturnValue({ key: 'testKey' }); return ctx; }; @@ -79,7 +81,7 @@ describe('taskCryptoEncrypt tests', () => { //GIVEN const ctx = getContext(); ctx.files.project.config = { - projectName: '@rnv/testProject', + project: { projectName: '@rnv/testProject' }, }; ctx.paths.workspace.dir = 'workspace/dir'; ctx.program.opts = jest.fn().mockReturnValue({ key: 'testKey' }); @@ -207,9 +209,9 @@ describe('taskCryptoEncrypt tests', () => { ctx.paths.project.configPrivate = 'project/path/renative.private.json'; ctx.paths.project.appConfigsDir = 'project/path/appConfigs'; ctx.paths.project.configPrivateExists = true; - ctx.files.project.config = { projectName: 'testProject' }; + ctx.files.project.config = { project: { projectName: 'testProject' } }; - const sourceFolder = `${ctx.paths.workspace.dir}/${ctx.files.project.config.projectName}`; + const sourceFolder = `${ctx.paths.workspace.dir}/${ctx.files.project.config.project.projectName}`; const appConfigsDir = path.join(sourceFolder, 'appConfigs'); const targetFile = 'renative.private.json'; diff --git a/packages/engine-core/src/tasks/crypto/common.ts b/packages/engine-core/src/tasks/crypto/common.ts index 48e15d19f..23d83027a 100644 --- a/packages/engine-core/src/tasks/crypto/common.ts +++ b/packages/engine-core/src/tasks/crypto/common.ts @@ -40,9 +40,9 @@ export const checkCrypto = async (parentTaskName?: string, originTaskName?: stri const c = getContext(); logTask('checkCrypto'); - if (c.program.opts().ci || c.files.project.config?.crypto?.isOptional) return; + if (c.program.opts().ci || c.files.project.config?.project?.crypto?.isOptional) return; - const sourceRaw = c.files.project.config?.crypto?.path; + const sourceRaw = c.files.project.config?.project?.crypto?.path; if (!c.files.project.package.name) { logError('package.json requires `name` field. cannot check crypto'); return; diff --git a/packages/engine-core/src/tasks/crypto/taskCryptoDecrypt.ts b/packages/engine-core/src/tasks/crypto/taskCryptoDecrypt.ts index e5e60f236..42da5a17e 100644 --- a/packages/engine-core/src/tasks/crypto/taskCryptoDecrypt.ts +++ b/packages/engine-core/src/tasks/crypto/taskCryptoDecrypt.ts @@ -49,9 +49,9 @@ export default createTask({ description: 'Decrypt encrypted project files into local `~///..`', dependsOn: [RnvTaskName.configureSoft], fn: async ({ ctx }) => { - const crypto = ctx.files.project.config?.crypto; + const crypto = ctx.files.project.config?.project?.crypto; const sourceRaw = crypto?.path; - const projectName = ctx.files.project.config?.projectName; + const projectName = ctx.files.project.config?.project?.projectName; if (!crypto?.isOptional && sourceRaw) { const envVar = getEnvVar(); diff --git a/packages/engine-core/src/tasks/crypto/taskCryptoEncrypt.ts b/packages/engine-core/src/tasks/crypto/taskCryptoEncrypt.ts index 62f311134..bd3479cfc 100644 --- a/packages/engine-core/src/tasks/crypto/taskCryptoEncrypt.ts +++ b/packages/engine-core/src/tasks/crypto/taskCryptoEncrypt.ts @@ -95,14 +95,14 @@ const initializeCryptoDirectory = async (sourceFolder: string) => { const _checkAndConfigureCrypto = async () => { const ctx = getContext(); // handle missing config - const source = `./${ctx.files.project.config?.projectName}`; + const source = `./${ctx.files.project.config?.project?.projectName}`; const cnf = ctx.files.project.config_original; if (!cnf) return; const envVar = getEnvVar(); if (!envVar) return; - if (ctx.files.project.config && !ctx.files.project.config.crypto) { + if (ctx.files.project.config && !ctx.files.project.config.project.crypto) { const { location } = await inquirerPrompt({ type: 'input', name: 'location', @@ -110,10 +110,10 @@ const _checkAndConfigureCrypto = async () => { 'Where would you like your secrets to be residing? (path relative to renative project root, without leading or trailing slash. Ex. `myPrivateConfig/encrypt`)', default: 'secrets', }); - cnf.crypto = { + cnf.project.crypto = { path: `./${location}/privateConfigs.enc`, }; - ctx.files.project.config.crypto = cnf.crypto; + ctx.files.project.config.project.crypto = cnf.project.crypto; writeFileSync(ctx.paths.project.config, cnf); } @@ -178,7 +178,7 @@ export default createTask({ description: 'Encrypts secure files from `~///..` to project', dependsOn: [RnvTaskName.configureSoft], fn: async ({ ctx }) => { - const projectName = ctx.files.project.config?.projectName; + const projectName = ctx.files.project.config?.project?.projectName; if (!projectName) { return Promise.reject( `projectName is missing. Make sure you're in a ReNative project or integration and have projectName defined.` @@ -189,7 +189,7 @@ export default createTask({ await _checkAndConfigureCrypto(); - const destRaw = ctx.files.project.config?.crypto?.path; + const destRaw = ctx.files.project.config?.project?.crypto?.path; const tsWorkspacePath = path.join(ctx.paths.workspace.dir, projectName, 'timestamp'); const envVar = getEnvVar(); diff --git a/packages/engine-core/src/tasks/platform/__tests__/taskPlatformConnect.test.ts b/packages/engine-core/src/tasks/platform/__tests__/taskPlatformConnect.test.ts index 8a20909e5..0e56b5e7e 100644 --- a/packages/engine-core/src/tasks/platform/__tests__/taskPlatformConnect.test.ts +++ b/packages/engine-core/src/tasks/platform/__tests__/taskPlatformConnect.test.ts @@ -31,16 +31,20 @@ describe('taskPlatformEject', () => { files: { project: { config_original: { - paths: { - platformTemplatesDirs: { - android: './path/to/android', + project: { + paths: { + platformTemplatesDirs: { + android: './path/to/android', + }, }, }, }, config: { - paths: { - platformTemplatesDirs: { - android: './path/to/android', + project: { + paths: { + platformTemplatesDirs: { + android: './path/to/android', + }, }, }, }, @@ -69,18 +73,22 @@ describe('taskPlatformEject', () => { files: { project: { config_original: { - paths: { - platformTemplatesDirs: { - android: './path/to/android', - ios: './path/to/ios', + project: { + paths: { + platformTemplatesDirs: { + android: './path/to/android', + ios: './path/to/ios', + }, }, }, }, config: { - paths: { - platformTemplatesDirs: { - android: './path/to/android', - ios: './path/to/ios', + project: { + paths: { + platformTemplatesDirs: { + android: './path/to/android', + ios: './path/to/ios', + }, }, }, }, diff --git a/packages/engine-core/src/tasks/platform/__tests__/taskPlatformEject.test.ts b/packages/engine-core/src/tasks/platform/__tests__/taskPlatformEject.test.ts index e279aa358..4cdd0aa1b 100644 --- a/packages/engine-core/src/tasks/platform/__tests__/taskPlatformEject.test.ts +++ b/packages/engine-core/src/tasks/platform/__tests__/taskPlatformEject.test.ts @@ -36,16 +36,20 @@ describe('taskPlatformEject', () => { files: { project: { config: { - paths: { - platformTemplatesDirs: { - android: './platformTemplates', + project: { + paths: { + platformTemplatesDirs: { + android: './platformTemplates', + }, }, }, }, config_original: { - paths: { - platformTemplatesDirs: { - android: './platformTemplates', + project: { + paths: { + platformTemplatesDirs: { + android: './platformTemplates', + }, }, }, }, @@ -64,9 +68,11 @@ describe('taskPlatformEject', () => { // THEN expect(ejectPlatform).toHaveBeenCalledWith('android'); expect(writeFileSync).toHaveBeenCalledWith('/path/to/project/config', { - paths: { - platformTemplatesDirs: { - android: './platformTemplates', + project: { + paths: { + platformTemplatesDirs: { + android: './platformTemplates', + }, }, }, }); diff --git a/packages/engine-core/src/tasks/platform/taskPlatformConnect.ts b/packages/engine-core/src/tasks/platform/taskPlatformConnect.ts index 705f3ddaa..eb5f3bac4 100644 --- a/packages/engine-core/src/tasks/platform/taskPlatformConnect.ts +++ b/packages/engine-core/src/tasks/platform/taskPlatformConnect.ts @@ -21,7 +21,7 @@ export default createTask({ return; } - if (!ctx.files.project.config?.paths?.platformTemplatesDirs) { + if (!ctx.files.project.config?.project?.paths?.platformTemplatesDirs) { logToSummary('All supported platforms are connected. nothing to do.'); return; } @@ -45,12 +45,12 @@ export default createTask({ if (selectedPlatforms.length) { selectedPlatforms.forEach((platform) => { - if (configOriginal.paths?.platformTemplatesDirs?.[platform]) { - delete configOriginal.paths.platformTemplatesDirs[platform]; + if (configOriginal.project?.paths?.platformTemplatesDirs?.[platform]) { + delete configOriginal.project.paths.platformTemplatesDirs[platform]; } - if (!Object.keys(configOriginal.paths?.platformTemplatesDirs || {}).length) { - delete configOriginal.paths?.platformTemplatesDirs; // also cleanup the empty object + if (!Object.keys(configOriginal.project?.paths?.platformTemplatesDirs || {}).length) { + delete configOriginal.project.paths?.platformTemplatesDirs; // also cleanup the empty object } writeFileSync(ctx.paths.project.config, configOriginal); diff --git a/packages/engine-core/src/tasks/platform/taskPlatformEject.ts b/packages/engine-core/src/tasks/platform/taskPlatformEject.ts index 649dddb71..37e547ad1 100644 --- a/packages/engine-core/src/tasks/platform/taskPlatformEject.ts +++ b/packages/engine-core/src/tasks/platform/taskPlatformEject.ts @@ -46,10 +46,11 @@ export default createTask({ // engine.ejectPlatform(c, platform, destDir); ejectPlatform(platform); - configOriginal.paths = configOriginal.paths || {}; + configOriginal.project.paths = configOriginal.project.paths || {}; - configOriginal.paths.platformTemplatesDirs = configOriginal.paths.platformTemplatesDirs || {}; - configOriginal.paths.platformTemplatesDirs[platform] = `./${'platformTemplates'}`; + configOriginal.project.paths.platformTemplatesDirs = + configOriginal.project.paths.platformTemplatesDirs || {}; + configOriginal.project.paths.platformTemplatesDirs[platform] = `./${'platformTemplates'}`; writeFileSync(ctx.paths.project.config, configOriginal); }); @@ -57,7 +58,7 @@ export default createTask({ `${chalk().bold.white( selectedPlatforms.join(',') )} platform templates are located in ${chalk().bold.white( - ctx.files.project.config?.paths?.platformTemplatesDirs?.[selectedPlatforms[0]] + ctx.files.project.config?.project?.paths?.platformTemplatesDirs?.[selectedPlatforms[0]] )} now. You can edit them directly!` ); } else { diff --git a/packages/engine-core/src/tasks/plugin/taskHelpers.ts b/packages/engine-core/src/tasks/plugin/taskHelpers.ts index 6c5a573f5..010e73cf4 100644 --- a/packages/engine-core/src/tasks/plugin/taskHelpers.ts +++ b/packages/engine-core/src/tasks/plugin/taskHelpers.ts @@ -3,7 +3,7 @@ import intersection from 'lodash/intersection'; export const getPluginList = (isUpdate = false) => { const c = getContext(); - + console.log(); const output: PluginListResponse = { asString: '', asArray: [], @@ -14,7 +14,7 @@ export const getPluginList = (isUpdate = false) => { let i = 1; Object.keys(c.files.scopedConfigTemplates).forEach((pk) => { - const plugins = c.files.scopedConfigTemplates[pk]?.pluginTemplates; + const plugins = c.files.scopedConfigTemplates[pk]?.templates?.pluginTemplates; if (!plugins) return; Object.keys(plugins).forEach((k) => { const plugin = plugins[k]; diff --git a/packages/engine-core/src/tasks/plugin/taskPluginAdd.ts b/packages/engine-core/src/tasks/plugin/taskPluginAdd.ts index c883048d3..1ac030ca6 100644 --- a/packages/engine-core/src/tasks/plugin/taskPluginAdd.ts +++ b/packages/engine-core/src/tasks/plugin/taskPluginAdd.ts @@ -48,8 +48,8 @@ export default createTask({ return; } - const cnfPlugins = cnfOriginal.plugins || {}; - cnfOriginal.plugins = cnfPlugins; + const cnfPlugins = cnfOriginal.project.plugins || {}; + cnfOriginal.project.plugins = cnfPlugins; Object.keys(selectedPlugins).forEach((key) => { // c.buildConfig.plugins[key] = 'source:rnv'; diff --git a/packages/engine-core/src/tasks/plugin/taskPluginUpdate.ts b/packages/engine-core/src/tasks/plugin/taskPluginUpdate.ts index d5c36cc3a..8e8b63663 100644 --- a/packages/engine-core/src/tasks/plugin/taskPluginUpdate.ts +++ b/packages/engine-core/src/tasks/plugin/taskPluginUpdate.ts @@ -19,7 +19,7 @@ export default createTask({ Object.keys(plugins).forEach((_key) => { //TODO: fix this. not working // c.buildConfig.plugins[key] = o.json[key]; - cnf.plugins = cnf.plugins || {}; + cnf.project.plugins = cnf.project.plugins || {}; // cnf.plugins[key] = pluginList.json[key]; }); diff --git a/packages/engine-core/src/tasks/project/taskProjectPlatforms.ts b/packages/engine-core/src/tasks/project/taskProjectPlatforms.ts index 3db1c5244..2cda32861 100644 --- a/packages/engine-core/src/tasks/project/taskProjectPlatforms.ts +++ b/packages/engine-core/src/tasks/project/taskProjectPlatforms.ts @@ -4,7 +4,7 @@ export default createTask({ description: 'Allows you to change supportedPlatforms for your project', dependsOn: [RnvTaskName.projectConfigure], fn: async ({ ctx }) => { - const currentPlatforms = ctx.files.project.config?.defaults?.supportedPlatforms || []; + const currentPlatforms = ctx.files.project.config?.project?.defaults?.supportedPlatforms || []; const { inputSupportedPlatforms } = await inquirerPrompt({ name: 'inputSupportedPlatforms', diff --git a/packages/engine-core/src/tasks/workspace/taskWorkspaceConfigure.ts b/packages/engine-core/src/tasks/workspace/taskWorkspaceConfigure.ts index 3d5235da6..782e3c2a5 100644 --- a/packages/engine-core/src/tasks/workspace/taskWorkspaceConfigure.ts +++ b/packages/engine-core/src/tasks/workspace/taskWorkspaceConfigure.ts @@ -1,4 +1,5 @@ import path from 'path'; +import merge from 'deepmerge'; import { copyFileSync, mkdirSync, @@ -12,6 +13,7 @@ import { createTask, RnvTaskName, RnvFileName, + // getUpdatedConfigFile, } from '@rnv/core'; import { writeFileSync } from 'fs'; @@ -29,50 +31,48 @@ export default createTask({ // Check globalConfig if (fsExistsSync(paths.workspace.config)) { - logDebug(`${paths.workspace.dir}/${RnvFileName.renative} file exists!`); + logDebug(`${paths.workspace.dir}/${RnvFileName.rnv} file exists!`); } else { const oldGlobalConfigPath = path.join(paths.workspace.dir, 'config.json'); if (fsExistsSync(oldGlobalConfigPath)) { logWarning('Found old version of your config. will copy it to new renative.json config'); copyFileSync(oldGlobalConfigPath, paths.workspace.config); } else { - logInfo(`${paths.workspace.dir}/${RnvFileName.renative} file missing! Creating one for you...`); + logInfo(`${paths.workspace.dir}/${RnvFileName.rnv} file missing! Creating one for you...`); writeFileSync(paths.workspace.config, '{}'); } } if (fsExistsSync(paths.workspace.config)) { - files.workspace.config = JSON.parse(fsReadFileSync(paths.workspace.config).toString()); + const configFile = JSON.parse(fsReadFileSync(paths.workspace.config).toString()); + // const updatedFile = await getUpdatedConfigFile(configFile, paths.workspace.config, 'workspace'); + // console.log('updatedFile', updatedFile); + files.workspace.config = configFile; - if (files.workspace.config?.appConfigsPath) { - if (!fsExistsSync(files.workspace.config.appConfigsPath)) { + if (files.workspace.config?.workspace?.appConfigsPath) { + if (!fsExistsSync(files.workspace.config.workspace?.appConfigsPath)) { logWarning( `Your custom global appConfig is pointing to ${chalk().bold.white( - files.workspace.config.appConfigsPath + files.workspace.config.workspace.appConfigsPath )} which doesn't exist! Make sure you create one in that location` ); } else { logInfo( `Found custom appConfing location pointing to ${chalk().bold.white( - files.workspace.config.appConfigsPath + files.workspace.config.workspace.appConfigsPath )}. ReNativewill now swith to that location!` ); - paths.project.appConfigsDir = files.workspace.config.appConfigsPath; + paths.project.appConfigsDir = files.workspace.config.workspace.appConfigsPath; } } - // Check config sanity - if (files.workspace.config?.defaultTargets === undefined) { + if (files.workspace.config?.workspace?.defaultTargets === undefined) { logWarning( `You're missing defaultTargets in your config ${chalk().bold.white( paths.workspace.config )}. Let's add them!` ); - - const newConfig = { - ...files.workspace.config, - defaultTargets: {}, - }; + const newConfig = merge(files.workspace.config || {}, { workspace: { defaultTargets: {} } }); fsWriteFileSync(paths.workspace.config, JSON.stringify(newConfig, null, 2)); } } diff --git a/packages/engine-core/src/tasks/workspace/taskWorkspaceConnect.ts b/packages/engine-core/src/tasks/workspace/taskWorkspaceConnect.ts index d587014b9..dc1367b97 100644 --- a/packages/engine-core/src/tasks/workspace/taskWorkspaceConnect.ts +++ b/packages/engine-core/src/tasks/workspace/taskWorkspaceConnect.ts @@ -5,7 +5,7 @@ export default createTask({ dependsOn: [RnvTaskName.projectConfigure], fn: async ({ ctx }) => { const cnf = ctx.files.dotRnv.configWorkspaces; - if (!cnf) return; + if (!cnf?.workspaces) return; const opts = Object.keys(cnf.workspaces).map((v) => `${v} ${getWorkspaceConnectionString(cnf.workspaces[v])}`); diff --git a/packages/engine-lightning/package.json b/packages/engine-lightning/package.json index 3ec72d658..5ee20b45a 100644 --- a/packages/engine-lightning/package.json +++ b/packages/engine-lightning/package.json @@ -15,7 +15,7 @@ "files": [ "LICENSE", "lib", - "renative.engine.json", + "rnv.json", "templates" ], "main": "lib/index.js", diff --git a/packages/engine-lightning/rnv.json b/packages/engine-lightning/rnv.json new file mode 100644 index 000000000..e2246cb7f --- /dev/null +++ b/packages/engine-lightning/rnv.json @@ -0,0 +1,18 @@ +{ + "$schema": "../../.rnv/schema/renative-1.0.schema.json", + "engine": { + "name": "@rnv/engine-lightning", + "overview": "ReNative Engine to build lightning based apps.", + "plugins": { + "@lightningjs/sdk": "source:rnv", + "@lightningjs/cli": "source:rnv" + }, + "npm": { + "devDependencies": {} + }, + "platforms": { + "tizen": {}, + "webos": {} + } + } +} diff --git a/packages/engine-lightning/src/config.ts b/packages/engine-lightning/src/config.ts index 6eadb226b..51c92cd3d 100644 --- a/packages/engine-lightning/src/config.ts +++ b/packages/engine-lightning/src/config.ts @@ -1,4 +1,4 @@ import type { ConfigFileEngine } from '@rnv/core'; //@ts-ignore -import CNF from '../renative.engine.json'; +import CNF from '../rnv.json'; export const Config: ConfigFileEngine = CNF; diff --git a/packages/engine-rn-electron/package.json b/packages/engine-rn-electron/package.json index ccfb04835..040fde318 100644 --- a/packages/engine-rn-electron/package.json +++ b/packages/engine-rn-electron/package.json @@ -16,7 +16,7 @@ "files": [ "LICENSE", "lib", - "renative.engine.json", + "rnv.json", "templates" ], "main": "lib/index.js", diff --git a/packages/engine-rn-electron/rnv.json b/packages/engine-rn-electron/rnv.json new file mode 100644 index 000000000..585ee0d24 --- /dev/null +++ b/packages/engine-rn-electron/rnv.json @@ -0,0 +1,35 @@ +{ + "$schema": "../../.rnv/schema/renative-1.0.schema.json", + "engine": { + "name": "@rnv/engine-rn-electron", + "engineExtension": "rne", + "overview": "React native based engine with web transpiler provided by react-native-web and native desktop wrapper provided by electron", + "plugins": { + "react": "source:rnv", + "react-art": "source:rnv", + "react-dom": "source:rnv", + "react-native": "source:rnv", + "react-native-web": "source:rnv" + }, + "npm": { + "devDependencies": {} + }, + "platforms": { + "macos": { + "npm": { + "devDependencies": {} + } + }, + "windows": { + "npm": { + "devDependencies": {} + } + }, + "linux": { + "npm": { + "devDependencies": {} + } + } + } + } +} diff --git a/packages/engine-rn-electron/src/config.ts b/packages/engine-rn-electron/src/config.ts index 6eadb226b..51c92cd3d 100644 --- a/packages/engine-rn-electron/src/config.ts +++ b/packages/engine-rn-electron/src/config.ts @@ -1,4 +1,4 @@ import type { ConfigFileEngine } from '@rnv/core'; //@ts-ignore -import CNF from '../renative.engine.json'; +import CNF from '../rnv.json'; export const Config: ConfigFileEngine = CNF; diff --git a/packages/engine-rn-macos/package.json b/packages/engine-rn-macos/package.json index e6326f9d0..ceca8d1a9 100644 --- a/packages/engine-rn-macos/package.json +++ b/packages/engine-rn-macos/package.json @@ -15,7 +15,7 @@ "files": [ "LICENSE", "lib", - "renative.engine.json", + "rnv.json", "templates" ], "main": "lib/index.js", diff --git a/packages/engine-rn-macos/rnv.json b/packages/engine-rn-macos/rnv.json new file mode 100644 index 000000000..e41de6c78 --- /dev/null +++ b/packages/engine-rn-macos/rnv.json @@ -0,0 +1,25 @@ +{ + "$schema": "../../.rnv/schema/renative-1.0.schema.json", + "engine": { + "name": "@rnv/engine-rn-macos", + "engineExtension": "rnm", + "overview": "React native based engine with react-native-macos extension which adds support for macOS platform.", + "plugins": { + "react": "source:rnv", + "react-art": "source:rnv", + "react-dom": "source:rnv", + "react-native": "source:rnv", + "react-native-macos": "source:rnv" + }, + "npm": { + "devDependencies": {} + }, + "platforms": { + "macos": { + "npm": { + "devDependencies": {} + } + } + } + } +} diff --git a/packages/engine-rn-macos/src/config.ts b/packages/engine-rn-macos/src/config.ts index 6eadb226b..51c92cd3d 100644 --- a/packages/engine-rn-macos/src/config.ts +++ b/packages/engine-rn-macos/src/config.ts @@ -1,4 +1,4 @@ import type { ConfigFileEngine } from '@rnv/core'; //@ts-ignore -import CNF from '../renative.engine.json'; +import CNF from '../rnv.json'; export const Config: ConfigFileEngine = CNF; diff --git a/packages/engine-rn-next/package.json b/packages/engine-rn-next/package.json index d798433a8..27bb71a63 100644 --- a/packages/engine-rn-next/package.json +++ b/packages/engine-rn-next/package.json @@ -16,7 +16,7 @@ "files": [ "LICENSE", "lib", - "renative.engine.json", + "rnv.json", "templates" ], "main": "lib/index.js", diff --git a/packages/engine-rn-next/rnv.json b/packages/engine-rn-next/rnv.json new file mode 100644 index 000000000..d9454a387 --- /dev/null +++ b/packages/engine-rn-next/rnv.json @@ -0,0 +1,22 @@ +{ + "$schema": "../../.rnv/schema/renative-1.0.schema.json", + "engine": { + "name": "@rnv/engine-rn-next", + "engineExtension": "rnx", + "overview": "React native based engine with web transpiler provided by react-native-web and render by nextjs", + "plugins": { + "react": "source:rnv", + "react-art": "source:rnv", + "react-dom": "source:rnv", + "react-native": "source:rnv", + "react-native-web": "source:rnv", + "next": "source:rnv" + }, + "npm": { + "devDependencies": {} + }, + "platforms": { + "web": {} + } + } +} diff --git a/packages/engine-rn-next/src/config.ts b/packages/engine-rn-next/src/config.ts index 6eadb226b..51c92cd3d 100644 --- a/packages/engine-rn-next/src/config.ts +++ b/packages/engine-rn-next/src/config.ts @@ -1,4 +1,4 @@ import type { ConfigFileEngine } from '@rnv/core'; //@ts-ignore -import CNF from '../renative.engine.json'; +import CNF from '../rnv.json'; export const Config: ConfigFileEngine = CNF; diff --git a/packages/engine-rn-tvos/package.json b/packages/engine-rn-tvos/package.json index 7db6a0d9e..5544ff434 100644 --- a/packages/engine-rn-tvos/package.json +++ b/packages/engine-rn-tvos/package.json @@ -15,7 +15,7 @@ "files": [ "LICENSE", "lib", - "renative.engine.json", + "rnv.json", "templates" ], "main": "lib/index.js", diff --git a/packages/engine-rn-tvos/rnv.json b/packages/engine-rn-tvos/rnv.json new file mode 100644 index 000000000..00a22d728 --- /dev/null +++ b/packages/engine-rn-tvos/rnv.json @@ -0,0 +1,28 @@ +{ + "$schema": "../../.rnv/schema/renative-1.0.schema.json", + "engine": { + "name": "@rnv/engine-rn-tvos", + "engineExtension": "rntvos", + "overview": "React native based engine with added support for tvOS platform. Runs standard react native apps with native support", + "plugins": { + "react": "source:rnv", + "react-art": "source:rnv", + "react-dom": "source:rnv", + "react-native": "source:rnv", + "react-native-tvos": "source:rnv" + }, + "npm": { + "devDependencies": {} + }, + "platforms": { + "tvos": { + "engine": "engine-rn-tvos", + "npm": { + "dependencies": { + "dotenv": "16.4.5" + } + } + } + } + } +} diff --git a/packages/engine-rn-tvos/src/config.ts b/packages/engine-rn-tvos/src/config.ts index 6eadb226b..51c92cd3d 100644 --- a/packages/engine-rn-tvos/src/config.ts +++ b/packages/engine-rn-tvos/src/config.ts @@ -1,4 +1,4 @@ import type { ConfigFileEngine } from '@rnv/core'; //@ts-ignore -import CNF from '../renative.engine.json'; +import CNF from '../rnv.json'; export const Config: ConfigFileEngine = CNF; diff --git a/packages/engine-rn-web/package.json b/packages/engine-rn-web/package.json index 1c5faa294..d5723c7d2 100644 --- a/packages/engine-rn-web/package.json +++ b/packages/engine-rn-web/package.json @@ -15,7 +15,7 @@ "files": [ "LICENSE", "lib", - "renative.engine.json", + "rnv.json", "templates" ], "main": "lib/index.js", diff --git a/packages/engine-rn-web/rnv.json b/packages/engine-rn-web/rnv.json new file mode 100644 index 000000000..a971c9466 --- /dev/null +++ b/packages/engine-rn-web/rnv.json @@ -0,0 +1,34 @@ +{ + "$schema": "../../.rnv/schema/renative-1.0.schema.json", + "engine": { + "engineExtension": "rnw", + "name": "@rnv/engine-rn-web", + "overview": "React native based engine with web transpiler provided by react-native-web", + "plugins": { + "react": "source:rnv", + "react-art": "source:rnv", + "react-dom": "source:rnv", + "react-native": "source:rnv", + "react-native-web": "source:rnv" + }, + "npm": { + "devDependencies": {} + }, + "platforms": { + "tizen": { + "npm": { + "dependencies": { + "raf": "3.4.1" + } + } + }, + "web": {}, + "webtv": {}, + "webos": {}, + "tizenwatch": {}, + "tizenmobile": {}, + "chromecast": {}, + "kaios": {} + } + } +} diff --git a/packages/engine-rn-web/src/config.ts b/packages/engine-rn-web/src/config.ts index 6eadb226b..51c92cd3d 100644 --- a/packages/engine-rn-web/src/config.ts +++ b/packages/engine-rn-web/src/config.ts @@ -1,4 +1,4 @@ import type { ConfigFileEngine } from '@rnv/core'; //@ts-ignore -import CNF from '../renative.engine.json'; +import CNF from '../rnv.json'; export const Config: ConfigFileEngine = CNF; diff --git a/packages/engine-rn-windows/package.json b/packages/engine-rn-windows/package.json index fa41bc899..058c08631 100644 --- a/packages/engine-rn-windows/package.json +++ b/packages/engine-rn-windows/package.json @@ -17,7 +17,7 @@ "LICENSE", "lib", "pluginTemplates", - "renative.engine.json", + "rnv.json", "templateFiles" ], "main": "lib/index.js", diff --git a/packages/engine-rn-windows/rnv.json b/packages/engine-rn-windows/rnv.json new file mode 100644 index 000000000..83395c6d8 --- /dev/null +++ b/packages/engine-rn-windows/rnv.json @@ -0,0 +1,28 @@ +{ + "$schema": "../../.rnv/schema/renative-1.0.schema.json", + "engine": { + "name": "@rnv/engine-rn-windows", + "engineExtension": "rnwin", + "overview": "React native based engine with react-native-windows cli tool", + "plugins": { + "react": "source:rnv", + "react-art": "source:rnv", + "react-dom": "source:rnv", + "react-native": "source:rnv", + "react-native-windows": "source:rnv", + "@react-native-windows/cli": "source:rnv" + }, + "platforms": { + "windows": { + "npm": { + "dependencies": {} + } + }, + "xbox": { + "npm": { + "dependencies": {} + } + } + } + } +} diff --git a/packages/engine-rn-windows/src/config.ts b/packages/engine-rn-windows/src/config.ts index 6eadb226b..51c92cd3d 100644 --- a/packages/engine-rn-windows/src/config.ts +++ b/packages/engine-rn-windows/src/config.ts @@ -1,4 +1,4 @@ import type { ConfigFileEngine } from '@rnv/core'; //@ts-ignore -import CNF from '../renative.engine.json'; +import CNF from '../rnv.json'; export const Config: ConfigFileEngine = CNF; diff --git a/packages/engine-rn/package.json b/packages/engine-rn/package.json index df56b3440..5fdd90c78 100644 --- a/packages/engine-rn/package.json +++ b/packages/engine-rn/package.json @@ -15,7 +15,7 @@ "files": [ "LICENSE", "lib", - "renative.engine.json", + "rnv.json", "templates" ], "main": "lib/index.js", diff --git a/packages/engine-rn/rnv.json b/packages/engine-rn/rnv.json new file mode 100644 index 000000000..4d60ac58a --- /dev/null +++ b/packages/engine-rn/rnv.json @@ -0,0 +1,36 @@ +{ + "engine": { + "name": "@rnv/engine-rn", + "engineExtension": "rn", + "overview": "Default react-native based engine. Runs standard react native apps with native support", + "plugins": { + "react": "source:rnv", + "react-art": "source:rnv", + "react-dom": "source:rnv", + "react-native": "source:rnv" + }, + "npm": { + "devDependencies": {} + }, + "platforms": { + "ios": { + "engine": "engine-rn", + "npm": { + "dependencies": { + "dotenv": "16.4.5" + } + } + }, + "macos": { + "engine": "engine-rn" + }, + "android": { + "engine": "engine-rn" + }, + "androidwear": { + "engine": "engine-rn" + } + } + }, + "$schema": "../../.rnv/schema/renative-1.0.schema.json" +} diff --git a/packages/engine-rn/src/config.ts b/packages/engine-rn/src/config.ts index 6eadb226b..51c92cd3d 100644 --- a/packages/engine-rn/src/config.ts +++ b/packages/engine-rn/src/config.ts @@ -1,4 +1,4 @@ import type { ConfigFileEngine } from '@rnv/core'; //@ts-ignore -import CNF from '../renative.engine.json'; +import CNF from '../rnv.json'; export const Config: ConfigFileEngine = CNF; diff --git a/packages/engine-roku/package.json b/packages/engine-roku/package.json index 8e21adc5d..1b7f3ca67 100644 --- a/packages/engine-roku/package.json +++ b/packages/engine-roku/package.json @@ -15,7 +15,7 @@ "files": [ "LICENSE", "lib", - "renative.engine.json" + "rnv.json" ], "main": "lib/index.js", "repository": { diff --git a/packages/engine-roku/rnv.json b/packages/engine-roku/rnv.json new file mode 100644 index 000000000..3adc841ca --- /dev/null +++ b/packages/engine-roku/rnv.json @@ -0,0 +1,13 @@ +{ + "$schema": "../../.rnv/schema/renative-1.0.schema.json", + "engine": { + "name": "@rnv/engine-roku", + "engineExtension": "rk", + "overview": "ReNative Roku Engine", + "plugins": {}, + "npm": { + "devDependencies": {} + }, + "platforms": {} + } +} diff --git a/packages/integration-docker/src/index.ts b/packages/integration-docker/src/index.ts index 07f8e1726..57fbd0946 100644 --- a/packages/integration-docker/src/index.ts +++ b/packages/integration-docker/src/index.ts @@ -5,7 +5,7 @@ import { createRnvModule } from '@rnv/core'; const Integration = createRnvModule({ tasks: [taskDockerExport, taskDockerDeploy] as const, - name: Config.name, + name: Config.integration.name, type: 'public', }); diff --git a/packages/integration-starter/src/index.ts b/packages/integration-starter/src/index.ts index 99aad9d41..be686dc59 100644 --- a/packages/integration-starter/src/index.ts +++ b/packages/integration-starter/src/index.ts @@ -5,7 +5,7 @@ import { createRnvModule } from '@rnv/core'; const Integration = createRnvModule({ tasks: [taskStarterHello, taskSingleCommand] as const, - name: Config.name, + name: Config.integration.name, type: 'public', }); diff --git a/packages/renative/renative.plugin.json b/packages/renative/renative.plugin.json index 5bd61206c..0655e63a0 100644 --- a/packages/renative/renative.plugin.json +++ b/packages/renative/renative.plugin.json @@ -1,4 +1,4 @@ { - "$schema": "../../.rnv/schema/rnv.plugin.json", - "plugins": {} + "$schema": "../../.rnv/schema/renative-1.0.schema.json", + "plugin": {} } diff --git a/packages/sdk-android/src/deviceManager.ts b/packages/sdk-android/src/deviceManager.ts index 9c58e4f81..d9e80f569 100644 --- a/packages/sdk-android/src/deviceManager.ts +++ b/packages/sdk-android/src/deviceManager.ts @@ -635,7 +635,7 @@ export const askForNewEmulator = async () => { logDefault('askForNewEmulator'); if (!platform) return; - let emuName = c.files.workspace.config?.defaultTargets?.[platform]; + let emuName = c.files.workspace.config?.workspace?.defaultTargets?.[platform]; const { confirm } = await inquirerPrompt({ name: 'confirm', type: 'confirm', diff --git a/packages/sdk-android/src/gradleParser.ts b/packages/sdk-android/src/gradleParser.ts index 05c4eb2d9..2fb15af82 100644 --- a/packages/sdk-android/src/gradleParser.ts +++ b/packages/sdk-android/src/gradleParser.ts @@ -28,7 +28,6 @@ export const parseBuildGradleSync = () => { const c = getContext(); const appFolder = getAppFolder(); - const templateAndroid = getConfigProp('templateAndroid'); const buildscript = templateAndroid?.build_gradle?.buildscript; @@ -522,7 +521,7 @@ export const parseSettingsGradleSync = () => { }, { pattern: '{{RN_GRADLE_PROJECT_NAME}}', - override: c.files.project.config?.projectName?.replace('/', '-'), + override: c.files.project.config?.project?.projectName?.replace('/', '-'), }, { pattern: '{{SETTINGS_GRADLE_INCLUDE}}', diff --git a/packages/sdk-android/src/installer.ts b/packages/sdk-android/src/installer.ts index 2d2d87401..cda618d52 100644 --- a/packages/sdk-android/src/installer.ts +++ b/packages/sdk-android/src/installer.ts @@ -21,7 +21,7 @@ import { import { CLI_ANDROID_EMULATOR, CLI_ANDROID_ADB, CLI_ANDROID_AVDMANAGER, CLI_ANDROID_SDKMANAGER } from './constants'; -type SDKKey = keyof Required['sdks']; +type SDKKey = keyof Required['workspace']>['sdks']; const getSdkLocations = () => { const ctx = getContext(); @@ -155,8 +155,10 @@ const _attemptAutoFix = async (c: RnvContext, sdkPlatform: string, sdkKey: SDKKe if (confirmSdk && c.files.workspace.config) { try { - if (!c.files.workspace.config?.sdks) c.files.workspace.config.sdks = {}; - c.files.workspace.config.sdks[sdkKey] = result; + if (!c.files.workspace.config?.workspace?.sdks) { + c.files.workspace.config.workspace.sdks = {}; + } + c.files.workspace.config.workspace.sdks[sdkKey] = result; writeFileSync(c.paths.workspace.config, c.files.workspace.config); generateBuildConfig(); await checkAndConfigureAndroidSdks(); diff --git a/packages/sdk-android/src/jetifier.ts b/packages/sdk-android/src/jetifier.ts index 1bbde35f5..7af7749f7 100644 --- a/packages/sdk-android/src/jetifier.ts +++ b/packages/sdk-android/src/jetifier.ts @@ -3,10 +3,10 @@ import { doResolve, executeAsync, getContext, logDefault, writeFileSync } from ' export const jetifyIfRequired = async () => { const c = getContext(); logDefault('jetifyIfRequired'); - if (c.files.project.configLocal?._meta?.requiresJetify) { + if (c.files.project.configLocal?.local?._meta?.requiresJetify) { if (doResolve('jetifier')) { await executeAsync('npx jetify'); - c.files.project.configLocal._meta.requiresJetify = false; + c.files.project.configLocal.local._meta.requiresJetify = false; writeFileSync(c.paths.project.configLocal, c.files.project.configLocal); } } diff --git a/packages/sdk-android/src/runner.ts b/packages/sdk-android/src/runner.ts index 475f01494..25f6b4656 100644 --- a/packages/sdk-android/src/runner.ts +++ b/packages/sdk-android/src/runner.ts @@ -224,13 +224,13 @@ const _checkSigningCerts = async (c: Context) => { message: 'Do you want to generate new keystore as well?', }); - const platforms = c.files.workspace.appConfig.configPrivate?.platforms || {}; + const platforms = c.files.workspace.appConfig.configPrivate?.project?.platforms || {}; if (c.files.workspace.appConfig.configPrivate) { const platCandidates: RnvPlatformKey[] = ['androidwear', 'androidtv', 'android', 'firetv']; platCandidates.forEach((v) => { - if (c.files.workspace.appConfig.configPrivate?.platforms?.[v]) { + if (c.files.workspace.appConfig.configPrivate?.project?.platforms?.[v]) { platCandidate = v; } }); @@ -294,7 +294,9 @@ const _checkSigningCerts = async (c: Context) => { if (c.paths.workspace.appConfig.dir) { mkdirSync(c.paths.workspace.appConfig.dir); c.files.workspace.appConfig.configPrivate = { - platforms: {}, + project: { + platforms: {}, + }, }; if (storeFile) { platforms[c.platform] = { diff --git a/packages/sdk-apple/src/runner.ts b/packages/sdk-apple/src/runner.ts index 9788fa626..2527770e5 100644 --- a/packages/sdk-apple/src/runner.ts +++ b/packages/sdk-apple/src/runner.ts @@ -176,7 +176,7 @@ export const getIosDeviceToRunOn = async (c: Context) => { })), }); desiredSim = currentTarget; - const localOverridden = !!c.files.project.configLocal?.defaultTargets?.[c.platform]; + const localOverridden = !!c.files.project.configLocal?.local?.defaultTargets?.[c.platform]; const actionLocalUpdate = `Update ${chalk().green('project')} default target for platform ${c.platform}`; const actionGlobalUpdate = `Update ${chalk().green('global')}${ @@ -196,8 +196,11 @@ export const getIosDeviceToRunOn = async (c: Context) => { if (chosenAction === actionLocalUpdate || (chosenAction === actionGlobalUpdate && localOverridden)) { const configLocal = c.files.project.configLocal || {}; - if (!configLocal.defaultTargets) configLocal.defaultTargets = {}; - configLocal.defaultTargets[c.platform] = currentTarget.name; + if (!configLocal?.local?.defaultTargets) { + configLocal.local = configLocal.local || {}; + configLocal.local.defaultTargets = {}; + } + configLocal.local.defaultTargets[c.platform] = currentTarget.name; c.files.project.configLocal = configLocal; writeFileSync(c.paths.project.configLocal, configLocal); @@ -206,8 +209,8 @@ export const getIosDeviceToRunOn = async (c: Context) => { if (chosenAction === actionGlobalUpdate) { const configGlobal = c.files.workspace.config; if (configGlobal) { - if (!configGlobal.defaultTargets) configGlobal.defaultTargets = {}; - configGlobal.defaultTargets[c.platform] = currentTarget.name; + if (!configGlobal.workspace.defaultTargets) configGlobal.workspace.defaultTargets = {}; + configGlobal.workspace.defaultTargets[c.platform] = currentTarget.name; c.files.workspace.config = configGlobal; writeFileSync(c.paths.workspace.config, configGlobal); @@ -494,7 +497,7 @@ const _setAutomaticSigning = async (c: Context) => { const cnf = c.files.appConfig.config; if (!cnf) return; - const scheme = c.runtime.scheme && cnf.platforms?.[c.platform]?.buildSchemes?.[c.runtime.scheme]; + const scheme = c.runtime.scheme && cnf.app.platforms?.[c.platform]?.buildSchemes?.[c.runtime.scheme]; if (scheme && 'provisioningStyle' in scheme) { scheme.provisioningStyle = 'Automatic'; writeFileSync(c.paths.appConfig.config, cnf); @@ -515,12 +518,12 @@ const _setDevelopmentTeam = async (c: Context, teamID: string) => { try { // initialize if it doesn't exist, assume everything is set up, if it throws yell - const platforms = cnf.platforms || {}; + const platforms = cnf.app.platforms || {}; const plat = platforms[c.platform] || {}; - cnf.platforms = platforms; + cnf.app.platforms = platforms; platforms[c.platform] = plat; if (!platforms[c.platform]) { - cnf.platforms[c.platform] = {}; + cnf.app.platforms[c.platform] = {}; } if ('teamID' in plat) { plat.teamID = teamID; diff --git a/packages/sdk-apple/src/tasks/taskCryptoUpdateProfiles.ts b/packages/sdk-apple/src/tasks/taskCryptoUpdateProfiles.ts index 903e2dbf0..418b1ba47 100644 --- a/packages/sdk-apple/src/tasks/taskCryptoUpdateProfiles.ts +++ b/packages/sdk-apple/src/tasks/taskCryptoUpdateProfiles.ts @@ -1,4 +1,4 @@ -import { listAppConfigsFoldersSync, chalk, logTask, createTask, RnvTaskName } from '@rnv/core'; +import { listAppConfigsFoldersAsync, chalk, logTask, createTask, RnvTaskName } from '@rnv/core'; import { updateProfile } from '../fastlane'; import { SdkPlatforms } from '../common'; @@ -14,7 +14,7 @@ export default createTask({ description: 'Will attempt to update all provisioning profiles (mac only)', dependsOn: [RnvTaskName.projectConfigure], fn: async () => { - const acList = listAppConfigsFoldersSync(true); + const acList: string[] = await listAppConfigsFoldersAsync(true); return acList.reduce((previousPromise, v) => previousPromise.then(() => _updateProfile(v)), Promise.resolve()); }, diff --git a/packages/sdk-apple/src/xcodeParser.ts b/packages/sdk-apple/src/xcodeParser.ts index 0244cd24a..8673cbb46 100644 --- a/packages/sdk-apple/src/xcodeParser.ts +++ b/packages/sdk-apple/src/xcodeParser.ts @@ -70,7 +70,7 @@ export const parseXcodeProject = async () => { 'No provisionProfileSpecifier configured in appConfig despite setting provisioningStyle to manual', }); const schemeToUpdate = - c.files.appConfig.config?.platforms?.[platform]?.buildSchemes?.[c.program.opts().scheme]; + c.files.appConfig.config?.project?.platforms?.[platform]?.buildSchemes?.[c.program.opts().scheme]; if (autoFix && schemeToUpdate && c.files.appConfig.config) { c.payload.xcodeProj.provisionProfileSpecifier = eligibleProfile.Name; if ('provisionProfileSpecifier' in schemeToUpdate) { diff --git a/packages/sdk-telemetry/src/runner.ts b/packages/sdk-telemetry/src/runner.ts index 0aebeb5c0..37251e10c 100644 --- a/packages/sdk-telemetry/src/runner.ts +++ b/packages/sdk-telemetry/src/runner.ts @@ -56,7 +56,7 @@ export class AnalyticsCls { get isAnalyticsEnabled() { const c = getContext(); - return !c.files.dotRnv?.config?.disableTelemetry && c.process.env.RNV_TELEMETRY_DISABLED !== '1'; + return !c.files.dotRnv?.config?.workspace?.disableTelemetry && c.process.env.RNV_TELEMETRY_DISABLED !== '1'; } initialize() { diff --git a/packages/sdk-telemetry/src/tasks/taskTelemetryDisable.ts b/packages/sdk-telemetry/src/tasks/taskTelemetryDisable.ts index f01f87857..5aa3768c5 100644 --- a/packages/sdk-telemetry/src/tasks/taskTelemetryDisable.ts +++ b/packages/sdk-telemetry/src/tasks/taskTelemetryDisable.ts @@ -5,7 +5,7 @@ export default createTask({ fn: async ({ ctx }) => { const { config } = ctx.files.dotRnv; if (config) { - config.disableTelemetry = true; + config.workspace.disableTelemetry = true; writeFileSync(ctx.paths.dotRnv.config, config); diff --git a/packages/sdk-telemetry/src/tasks/taskTelemetryEnable.ts b/packages/sdk-telemetry/src/tasks/taskTelemetryEnable.ts index d9bfbdf2e..43189306a 100644 --- a/packages/sdk-telemetry/src/tasks/taskTelemetryEnable.ts +++ b/packages/sdk-telemetry/src/tasks/taskTelemetryEnable.ts @@ -5,7 +5,7 @@ export default createTask({ fn: async ({ ctx }) => { const { config } = ctx.files.dotRnv; if (config) { - config.disableTelemetry = false; + config.workspace.disableTelemetry = false; writeFileSync(ctx.paths.dotRnv.config, config); diff --git a/packages/sdk-telemetry/src/tasks/taskTelemetryStatus.ts b/packages/sdk-telemetry/src/tasks/taskTelemetryStatus.ts index c085aa7ef..95ebc3f28 100644 --- a/packages/sdk-telemetry/src/tasks/taskTelemetryStatus.ts +++ b/packages/sdk-telemetry/src/tasks/taskTelemetryStatus.ts @@ -3,7 +3,7 @@ import { chalk, logToSummary, createTask, RnvTaskName } from '@rnv/core'; export default createTask({ description: 'Show current rnv telemetry status on your machine', fn: async ({ ctx }) => { - const disableTelemetry = ctx.files.dotRnv.config?.disableTelemetry; + const disableTelemetry = ctx.files.dotRnv.config?.workspace?.disableTelemetry; if (disableTelemetry) { logToSummary( diff --git a/packages/sdk-tizen/src/deviceManager.ts b/packages/sdk-tizen/src/deviceManager.ts index 7b3669dc1..3b96f716f 100644 --- a/packages/sdk-tizen/src/deviceManager.ts +++ b/packages/sdk-tizen/src/deviceManager.ts @@ -439,7 +439,7 @@ export const runTizenSimOrDevice = async () => { if (startEmulator) { isRunningEmulator = true; - const defaultTarget = c.files.workspace.config?.defaultTargets?.[platform]; + const defaultTarget = c.files.workspace.config?.workspace?.defaultTargets?.[platform]; if (!defaultTarget) { logError('No default target found for tizen. please provide one using -t option'); return; diff --git a/packages/sdk-tizen/src/installer.ts b/packages/sdk-tizen/src/installer.ts index 3374b7707..3a196bff8 100644 --- a/packages/sdk-tizen/src/installer.ts +++ b/packages/sdk-tizen/src/installer.ts @@ -84,8 +84,8 @@ const _attemptAutoFix = async (c: RnvContext, shouldThrow?: boolean) => { if (confirmSdk) { try { - if (!c.files.workspace.config?.sdks) c.files.workspace.config.sdks = {}; - c.files.workspace.config.sdks.TIZEN_SDK = result; + if (!c.files.workspace.config?.workspace?.sdks) c.files.workspace.config.workspace.sdks = {}; + c.files.workspace.config.workspace.sdks.TIZEN_SDK = result; //TODO: use config_original here? writeFileSync(c.paths.workspace.config, c.files.workspace.config); generateBuildConfig(); @@ -98,7 +98,6 @@ const _attemptAutoFix = async (c: RnvContext, shouldThrow?: boolean) => { } } - if (shouldThrow) { throw new Error(`_attemptAutoFix: no sdks found. searched at: ${getSdkLocations().join(', ')}`); } else logDefault(`_attemptAutoFix: no sdks found. searched at: ${getSdkLocations().join(', ')}`); diff --git a/packages/sdk-utils/src/target.ts b/packages/sdk-utils/src/target.ts index 64974e030..54e401398 100644 --- a/packages/sdk-utils/src/target.ts +++ b/packages/sdk-utils/src/target.ts @@ -7,11 +7,11 @@ export const getTargetWithOptionalPrompt = async () => { const options = []; if (platform && !target) { - const projectTarget = ctx.files.project.configLocal?.defaultTargets?.[platform]; + const projectTarget = ctx.files.project.configLocal?.local?.defaultTargets?.[platform]; if (projectTarget) { options.push({ name: `${projectTarget} (project default)`, value: projectTarget }); } - const workspaceTarget = ctx.files.workspace.config?.defaultTargets?.[platform]; + const workspaceTarget = ctx.files.workspace.config?.workspace.defaultTargets?.[platform]; if (workspaceTarget) { options.push({ name: `${workspaceTarget} (global default)`, value: workspaceTarget }); } diff --git a/packages/sdk-webos/src/deviceManager.ts b/packages/sdk-webos/src/deviceManager.ts index 85bf59ff3..13828e31b 100644 --- a/packages/sdk-webos/src/deviceManager.ts +++ b/packages/sdk-webos/src/deviceManager.ts @@ -208,9 +208,9 @@ const _updateDefaultTargets = async (c: RnvContext, selectedSimulator: string) = const workspaceConfig = c.files.workspace.config; if (workspaceConfig && c.platform) { - if (!workspaceConfig.defaultTargets) workspaceConfig.defaultTargets = {}; + if (!workspaceConfig.workspace.defaultTargets) workspaceConfig.workspace.defaultTargets = {}; - workspaceConfig.defaultTargets[c.platform] = selectedSimulator; + workspaceConfig.workspace.defaultTargets[c.platform] = selectedSimulator; c.files.workspace.config = workspaceConfig; writeFileSync(c.paths.workspace.config, workspaceConfig); diff --git a/packages/sdk-webos/src/installer.ts b/packages/sdk-webos/src/installer.ts index e807d0384..335915be7 100644 --- a/packages/sdk-webos/src/installer.ts +++ b/packages/sdk-webos/src/installer.ts @@ -130,8 +130,8 @@ const _attemptAutoFix = async (c: RnvContext, shouldThrow?: boolean) => { const cnf = c.files.workspace.config; if (!cnf) return false; try { - if (!cnf.sdks) cnf.sdks = {}; - cnf.sdks.WEBOS_SDK = result; + if (!cnf.workspace.sdks) cnf.workspace.sdks = {}; + cnf.workspace.sdks.WEBOS_SDK = result; writeFileSync(c.paths.workspace.config, cnf); generateBuildConfig(); await checkAndConfigureWebosSdks(); diff --git a/packages/template-starter/Gemfile b/packages/template-starter/Gemfile index 133890902..87da7ba2f 100644 --- a/packages/template-starter/Gemfile +++ b/packages/template-starter/Gemfile @@ -6,3 +6,4 @@ ruby ">= 2.6.10" gem 'cocoapods', '~> 1.13', '< 1.15' gem 'activesupport', '>= 6.1.7.3', '< 7.1.0' +gem 'xcodeproj', '1.25.1' \ No newline at end of file diff --git a/packages/template-starter/appConfigs/app/rnv.json b/packages/template-starter/appConfigs/app/rnv.json index 96d99d3ed..3d5262686 100644 --- a/packages/template-starter/appConfigs/app/rnv.json +++ b/packages/template-starter/appConfigs/app/rnv.json @@ -4,5 +4,11 @@ "extendsTemplate": "@rnv/template-starter/appConfigs/base/rnv.json", "id": "app" }, - "project": {} + "project": { + "common": { + "runtime": { + "welcomeMessage": "Hello ReNative!" + } + } + } } diff --git a/packages/template-starter/appConfigs/base/rnv.json b/packages/template-starter/appConfigs/base/rnv.json index 8e306938a..fdfb252cb 100644 --- a/packages/template-starter/appConfigs/base/rnv.json +++ b/packages/template-starter/appConfigs/base/rnv.json @@ -4,5 +4,384 @@ "id": "base", "hidden": true }, - "project": {} + "project": { + "common": { + "author": "Pavel Jacko (https://github.com/pavjacko)", + "license": "MIT", + "includedPlugins": ["*"], + "includedFonts": ["*"], + "includedPermissions": ["INTERNET"], + "buildSchemes": { + "debug": { + "description": "Hello ReNative - Use for local development" + }, + "test": { + "description": "Hello ReNative - Use to run automation" + }, + "release": { + "description": "Hello ReNative - Use for production deployments" + } + }, + "backgroundColor": "#FFFFFF", + "fontSources": ["{{resolvePackage(react-native-vector-icons)}}/Fonts"], + "assetSources": ["{{resolvePackage(@flexn/assets-renative-outline)}}/assets"] + }, + "platforms": { + "ios": { + "entryFile": "index", + "provisioningStyle": "Automatic", + "systemCapabilities": { + "com.apple.AccessWiFi": false, + "com.apple.ApplePay": false, + "com.apple.ApplicationGroups.iOS": false, + "com.apple.AutoFillCredentialProvider": false, + "com.apple.BackgroundModes": false, + "com.apple.ClassKit": false, + "com.apple.DataProtection": false, + "com.apple.GameCenter.iOS": false, + "com.apple.HealthKit": false, + "com.apple.HomeKit": false, + "com.apple.HotspotConfiguration": false, + "com.apple.InAppPurchase": false, + "com.apple.InterAppAudio": false, + "com.apple.Keychain": false, + "com.apple.Maps.iOS": false, + "com.apple.Multipath": false, + "com.apple.NearFieldCommunicationTagReading": false, + "com.apple.NetworkExtensions.iOS": false, + "com.apple.Push": false, + "com.apple.SafariKeychain": false, + "com.apple.Siri": false, + "com.apple.VPNLite": false, + "com.apple.WAC": false, + "com.apple.Wallet": false, + "com.apple.iCloud": false + }, + "entitlements": {}, + "includedPermissions": ["*"], + "buildSchemes": { + "debug": { + "runScheme": "Debug", + "bundleAssets": false + }, + "test": { + "runScheme": "Debug", + "bundleAssets": false, + "sdk": "iphonesimulator" + }, + "release": { + "runScheme": "Release", + "bundleAssets": true, + "bundleIsDev": false + } + } + }, + "tvos": { + "entryFile": "index", + "provisioningStyle": "Automatic", + "entitlements": {}, + "includedPermissions": ["*"], + "buildSchemes": { + "debug": { + "runScheme": "Debug", + "bundleAssets": false + }, + "test": { + "runScheme": "Debug", + "bundleAssets": false, + "sdk": "appletvsimulator" + }, + "release": { + "runScheme": "Release", + "bundleAssets": true, + "bundleIsDev": false + } + } + }, + "macos": { + "entryFile": "index", + "provisioningStyle": "Automatic", + "includedPermissions": ["*"], + "buildSchemes": { + "debug": { + "runScheme": "Debug", + "bundleAssets": false + }, + "test": { + "runScheme": "Debug", + "bundleAssets": true + }, + "release": { + "runScheme": "Release", + "bundleAssets": true, + "bundleIsDev": false + } + } + }, + "android": { + "entryFile": "index", + "includedPermissions": ["INTERNET"], + "buildSchemes": { + "debug": { + "signingConfig": "Debug", + "bundleAssets": false + }, + "test": { + "signingConfig": "Debug", + "bundleAssets": false + }, + "canary": { + "signingConfig": "Release", + "bundleAssets": true, + "bundleIsDev": false, + "multipleAPKs": false + }, + "release": { + "signingConfig": "Release", + "multipleAPKs": true, + "bundleAssets": true, + "bundleIsDev": false + } + } + }, + "androidtv": { + "entryFile": "index", + "multipleAPKs": false, + "assetFolderPlatform": "android", + "includedPermissions": ["*"], + "buildSchemes": { + "debug": { + "signingConfig": "Debug", + "bundleAssets": false + }, + "test": { + "signingConfig": "Debug", + "bundleAssets": false + }, + "release": { + "signingConfig": "Release", + "multipleAPKs": true, + "bundleAssets": true, + "bundleIsDev": false + } + } + }, + "firetv": { + "entryFile": "index", + "multipleAPKs": false, + "assetFolderPlatform": "android", + "includedPermissions": ["*"], + "buildSchemes": { + "debug": { + "signingConfig": "Debug", + "bundleAssets": false + }, + "test": { + "signingConfig": "Debug", + "bundleAssets": false + }, + "release": { + "signingConfig": "Release", + "multipleAPKs": true, + "bundleAssets": true, + "bundleIsDev": false + } + } + }, + "androidwear": { + "entryFile": "index", + "multipleAPKs": false, + "assetFolderPlatform": "android", + "includedPermissions": ["*"], + "buildSchemes": { + "debug": { + "signingConfig": "Debug", + "bundleAssets": false + }, + "test": { + "signingConfig": "Debug", + "bundleAssets": false + }, + "release": { + "signingConfig": "Release", + "bundleAssets": true, + "bundleIsDev": false + } + } + }, + "tizen": { + "appName": "RNVanillaTV", + "entryFile": "index", + "certificateProfile": "RNVanillaCert", + "package": "NkVRhWHJSX", + "id": "NkVRhWHJSX.RNVanillaTV", + "buildSchemes": { + "debug": { + "bundleAssets": false + }, + "release": { + "bundleAssets": true, + "bundleIsDev": false + } + } + }, + "tizenwatch": { + "appName": "RNVanillaWatch", + "entryFile": "index", + "certificateProfile": "RNVanillaCert", + "package": "cHIP2fIRQZ", + "id": "cHIP2fIRQZ.RNVanillaWatch", + "buildSchemes": { + "debug": { + "bundleAssets": false + }, + "release": { + "bundleAssets": true, + "bundleIsDev": false + } + } + }, + "tizenmobile": { + "appName": "RNVanillaMobile", + "entryFile": "index", + "certificateProfile": "RNVanillaCert", + "package": "PauodvCU2r", + "id": "PauodvCU2r.RNVanillaMobile", + "buildSchemes": { + "debug": { + "bundleAssets": false + }, + "release": { + "bundleAssets": true, + "bundleIsDev": false + } + } + }, + "web": { + "entryFile": "index", + "pagesDir": "src/pages", + "devServerHost": "0.0.0.0", + "buildSchemes": { + "debug": { + "bundleAssets": false, + "environment": "development" + }, + "test": { + "bundleAssets": false, + "environment": "development" + }, + "release": { + "bundleAssets": true, + "bundleIsDev": false, + "environment": "production" + } + }, + "custom": { + "deploy": { + "type": "none" + } + } + }, + "webtv": { + "entryFile": "index", + "pagesDir": "src/pages", + "devServerHost": "0.0.0.0", + "buildSchemes": { + "debug": { + "bundleAssets": false, + "environment": "development" + }, + "release": { + "bundleAssets": true, + "bundleIsDev": false, + "environment": "production" + } + }, + "custom": { + "deploy": { + "type": "none" + } + } + }, + "webos": { + "entryFile": "index", + "buildSchemes": { + "debug": { + "bundleAssets": false + }, + "release": { + "bundleAssets": true, + "bundleIsDev": false + } + } + }, + "windows": { + "entryFile": "index", + "templateVSProject": { + "language": "cpp" + }, + "buildSchemes": { + "debug": { + "bundleAssets": false + }, + "release": { + "bundleAssets": true, + "bundleIsDev": false, + "enableSourceMaps": true + } + } + }, + "linux": { + "entryFile": "index", + "buildSchemes": { + "debug": { + "bundleAssets": false + }, + "release": { + "bundleAssets": true, + "bundleIsDev": false, + "enableSourceMaps": true + } + } + }, + "xbox": { + "entryFile": "index", + "templateVSProject": { + "language": "cpp", + "arch": "x64" + }, + "buildSchemes": { + "debug": { + "bundleAssets": false + }, + "release": { + "bundleAssets": true, + "bundleIsDev": false, + "enableSourceMaps": true + } + } + }, + "kaios": { + "entryFile": "index", + "buildSchemes": { + "debug": { + "bundleAssets": false + }, + "release": { + "bundleAssets": true, + "bundleIsDev": false + } + } + }, + "chromecast": { + "entryFile": "index", + "webpackConfig": { + "customScripts": [ + "www.gstatic.com/cast/sdk/libs/caf_receiver/v3/cast_receiver_framework.js", + "www.gstatic.com/cast/sdk/libs/devtools/debug_layer/caf_receiver_logger.js" + ] + } + } + } + } } diff --git a/packages/template-starter/appConfigs/template/rnv.json b/packages/template-starter/appConfigs/template/rnv.json index c88c8ecb3..5ec216d9b 100644 --- a/packages/template-starter/appConfigs/template/rnv.json +++ b/packages/template-starter/appConfigs/template/rnv.json @@ -1,7 +1,102 @@ { "$schema": "../../.rnv/schema/renative-1.0.schema.json", "app": { + "extend": "base", "id": "template" }, - "project": {} + "project": { + "isTemplate": true, + "isMonorepo": true, + "defaults": { + "ports": { + "ios": 8082, + "android": 8083, + "androidtv": 8084, + "firetv": 8098, + "tvos": 8085, + "macos": 8086, + "web": 8080, + "tizen": 8087, + "webos": 8088, + "androidwear": 8089, + "tizenwatch": 8090, + "tizenmobile": 8091, + "windows": 8092, + "xbox": 8099, + "kaios": 8093 + } + }, + "common": { + "id": "renative.helloworld", + "title": "ReNative", + "description": "Cross-platform application project based on ReNative", + "buildSchemes": { + "debug": { + "id": "renative.helloworld.debug", + "title": "ReNative Debug" + }, + "test": { + "id": "renative.helloworld.test", + "title": "ReNative Test" + } + }, + "runtime": { + "welcomeMessage": "Hello ReNative!" + } + }, + "platforms": { + "android": { + "buildSchemes": { + "debug": {} + } + }, + "androidtv": { + "buildSchemes": { + "debug": {} + } + }, + "firetv": { + "buildSchemes": { + "debug": {} + } + }, + "androidwear": { + "buildSchemes": { + "debug": {} + } + }, + "ios": { + "buildSchemes": { + "debug": {} + } + }, + "tvos": { + "buildSchemes": { + "debug": {} + } + }, + "macos": { + "buildSchemes": { + "debug": {} + } + }, + "linux": { + "buildSchemes": { + "debug": {} + } + }, + "tizen": { + "package": "NkVRhWHJSX", + "id": "NkVRhWHJSX.RNVanillaTV" + }, + "tizenwatch": { + "package": "cHIP2fIRQZ", + "id": "cHIP2fIRQZ.RNVanillaWatch" + }, + "tizenmobile": { + "package": "PauodvCU2r", + "id": "PauodvCU2r.RNVanillaMobile" + } + } + } } diff --git a/packages/template-starter/next-env.d.ts b/packages/template-starter/next-env.d.ts index 53e1f3374..a8465e5a5 100644 --- a/packages/template-starter/next-env.d.ts +++ b/packages/template-starter/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. +// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. diff --git a/packages/template-starter/package.json b/packages/template-starter/package.json index dd575ca1a..eb5649db7 100644 --- a/packages/template-starter/package.json +++ b/packages/template-starter/package.json @@ -47,10 +47,10 @@ "Gemfile.lock", "LICENSE", "README.md", - "appConfigs/app/renative.json", + "appConfigs/app/rnv.json", "appConfigs/base/assets/runtime", "appConfigs/base/fonts", - "appConfigs/base/renative.json", + "appConfigs/base/rnv.json", "babel.config.js", "buildHooks/src", "index.js", @@ -58,14 +58,14 @@ "next-env.d.ts", "next.config.js", "react-native.config.js", - "renative.json", - "renative.template.json", + "rnv.json", "scripts", "src", "templateOverrides", "tsconfig.json", "typings", - "webpack.config.js" + "webpack.config.js", + "scripts" ], "repository": { "type": "git", diff --git a/packages/template-starter/renative.json b/packages/template-starter/renative.json index bc16ec411..17a210734 100644 --- a/packages/template-starter/renative.json +++ b/packages/template-starter/renative.json @@ -84,9 +84,7 @@ "minSdkVersion": 21, "extendPlatform": "android", "engine": "engine-rn-tvos", - "includedPermissions": [ - "INTERNET" - ] + "includedPermissions": ["INTERNET"] }, "web": { "engine": "engine-rn-next" @@ -101,9 +99,7 @@ "engine": "engine-rn-electron", "assetFolderPlatform": "electron", "webpackConfig": { - "excludedPaths": [ - "pages" - ] + "excludedPaths": ["pages"] } }, "windows": { diff --git a/packages/template-starter/renative.template.json b/packages/template-starter/renative.template.json index 82808269e..a21c2a24d 100644 --- a/packages/template-starter/renative.template.json +++ b/packages/template-starter/renative.template.json @@ -21,35 +21,15 @@ ] }, { - "paths": [ - "Gemfile", - "metro.config.js", - ".bundle", - "react-native.config.js" - ], - "platforms": [ - "ios", - "android", - "androidwear", - "tvos", - "firetv", - "androidtv" - ] + "paths": ["Gemfile", "metro.config.js", ".bundle", "react-native.config.js"], + "platforms": ["ios", "android", "androidwear", "tvos", "firetv", "androidtv"] }, { - "paths": [ - "next.config.js", - "next-env.d.ts", - "src/pages" - ], - "platforms": [ - "web" - ] + "paths": ["next.config.js", "next-env.d.ts", "src/pages"], + "platforms": ["web"] }, { - "paths": [ - "webpack.config.js" - ], + "paths": ["webpack.config.js"], "platforms": [ "windows", "macos", @@ -84,10 +64,7 @@ "minipass": "7.1.2", "readable-stream": "4.5.2" }, - "browserslist": [ - ">0.2%", - "not op_mini all" - ], + "browserslist": [">0.2%", "not op_mini all"], "scripts": { "postinstall": "node scripts/postinstall.js" } @@ -98,10 +75,6 @@ "pkg-dir": "7.0.0", "xmlbuilder": "^15.1.1" }, - "defaultSelectedPlatforms": [ - "web", - "ios", - "android" - ] + "defaultSelectedPlatforms": ["web", "ios", "android"] } } diff --git a/packages/template-starter/rnv.json b/packages/template-starter/rnv.json index 7dfea8c3f..705f743ac 100644 --- a/packages/template-starter/rnv.json +++ b/packages/template-starter/rnv.json @@ -1,4 +1,222 @@ { "$schema": ".rnv/schema/renative-1.0.schema.json", - "project": {} + "project": { + "engines": { + "@rnv/engine-lightning": "source:rnv", + "@rnv/engine-rn": "source:rnv", + "@rnv/engine-rn-electron": "source:rnv", + "@rnv/engine-rn-next": "source:rnv", + "@rnv/engine-rn-tvos": "source:rnv", + "@rnv/engine-rn-web": "source:rnv" + }, + "projectName": "@rnv/template-starter", + "enableHookRebuild": false, + "workspaceID": "rnv", + "paths": { + "appConfigsDir": "./appConfigs", + "platformAssetsDir": "./platformAssets", + "platformBuildsDir": "./platformBuilds" + }, + "defaults": { + "supportedPlatforms": [ + "ios", + "android", + "androidtv", + "firetv", + "androidwear", + "web", + "tizen", + "tvos", + "webos", + "macos", + "tizenwatch", + "kaios", + "chromecast", + "linux", + "windows" + ], + "defaultCommandSchemes": { + "run": "debug", + "build": "release", + "export": "release" + }, + "targets": {} + }, + "templateConfig": { + "name": "@rnv/template-starter", + "version": "1.4.0-rc.0" + }, + "platforms": { + "android": { + "minSdkVersion": 26, + "targetSdkVersion": 34, + "compileSdkVersion": 34, + "buildToolsVersion": "34.0.0", + "gradleBuildToolsVersion": "4.2.2", + "gradleWrapperVersion": "8.3", + "ndkVersion": "25.1.8937393", + "kotlinVersion": "1.8.0", + "reactNativeEngine": "hermes", + "enableAndroidX": true, + "enableJetifier": true, + "templateAndroid": { + "gradle_properties": { + "android.useDeprecatedNdk": true, + "android.debug.obsoleteApi": true, + "org.gradle.jvmargs": "-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8", + "org.gradle.daemon": true, + "org.gradle.parallel": true, + "org.gradle.configureondemand": true + }, + "MainActivity_kt": { + "onCreate": "super.onCreate(savedInstanceState)" + } + }, + "engine": "engine-rn" + }, + "androidtv": { + "extendPlatform": "android", + "engine": "engine-rn-tvos" + }, + "androidwear": { + "extendPlatform": "android" + }, + "firetv": { + "minSdkVersion": 21, + "extendPlatform": "android", + "engine": "engine-rn-tvos", + "includedPermissions": ["INTERNET"] + }, + "web": { + "engine": "engine-rn-next" + }, + "tvos": { + "engine": "engine-rn-tvos", + "schemeTarget": "RNVApp-tvOS", + "deploymentTarget": "15.5", + "reactNativeEngine": "hermes" + }, + "macos": { + "engine": "engine-rn-electron", + "assetFolderPlatform": "electron", + "webpackConfig": { + "excludedPaths": ["pages"] + } + }, + "windows": { + "engine": "engine-rn-electron", + "assetFolderPlatform": "electron" + }, + "ios": { + "engine": "engine-rn", + "deploymentTarget": "15.5", + "reactNativeEngine": "hermes" + } + }, + "plugins": { + "@rnv/renative": "source:rnv", + "react": "source:rnv", + "react-art": "source:rnv", + "react-dom": "source:rnv", + "react-native-gesture-handler": "source:rnv", + "@react-native-community/cli-platform-ios": "source:rnv", + "@react-native-community/cli": "source:rnv", + "react-native": "source:rnv", + "next": "source:rnv", + "react-native-web": "source:rnv", + "react-native-tvos": "source:rnv" + }, + "permissions": { + "ios": {}, + "android": { + "INTERNET": { + "key": "android.permission.INTERNET", + "security": "normal" + }, + "SYSTEM_ALERT_WINDOW": { + "key": "android.permission.SYSTEM_ALERT_WINDOW", + "security": "signature" + } + } + } + }, + "template": { + "templateConfig": { + "disabled": false, + "includedPaths": [ + { + "paths": [ + "buildHooks", + "src/app", + "src/entry", + "src/config.tsx", + "index.js", + "tsconfig.json", + "babel.config.js", + "typings", + ".gitignore", + "appConfigs/app", + "appConfigs/base/assets", + "appConfigs/base/fonts", + "scripts" + ] + }, + { + "paths": ["Gemfile", "metro.config.js", ".bundle", "react-native.config.js"], + "platforms": ["ios", "android", "androidwear", "tvos", "firetv", "androidtv"] + }, + { + "paths": ["next.config.js", "next-env.d.ts", "src/pages"], + "platforms": ["web"] + }, + { + "paths": ["webpack.config.js"], + "platforms": [ + "windows", + "macos", + "tizen", + "webos", + "tizenwatch", + "tizenmobile", + "linux", + "chromecast", + "kaios" + ] + } + ], + "renative_json": { + "$schema": ".rnv/schema/renative-1.0.schema.json", + "extendsTemplate": "@rnv/template-starter/rnv.json" + }, + "package_json": { + "devDependencies": { + "typescript": "5.2.2", + "@types/react": "18.3.3", + "@types/react-dom": "18.3.0", + "@types/react-native": "0.72.3", + "@flexn/typescript-config": "1.0.0", + "@flexn/assets-renative-outline": "0.3.5", + "@rnv/core": "1.4.0-rc.0", + "@rnv/cli": "1.4.0-rc.0", + "@rnv/adapter": "1.4.0-rc.0", + "@rnv/config-templates": "1.4.0-rc.0", + "babel-loader": "9.1.3", + "dotenv": "16.4.5", + "minipass": "7.1.2", + "readable-stream": "4.5.2" + }, + "browserslist": [">0.2%", "not op_mini all"], + "scripts": { + "postinstall": "node scripts/postinstall.js" + } + } + }, + "bootstrapConfig": { + "rnvNewPatchDependencies": { + "pkg-dir": "7.0.0", + "xmlbuilder": "^15.1.1" + }, + "defaultSelectedPlatforms": ["web", "ios", "android"] + } + } } diff --git a/packages/template-starter/rnv.template.json b/packages/template-starter/rnv.template.json deleted file mode 100644 index 9f44e21b4..000000000 --- a/packages/template-starter/rnv.template.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": ".rnv/schema/renative-1.0.schema.json", - "template": {} -}