-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
1,722 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,8 @@ const RN_PROFILE_CHOICES = [ | |
'0.74', | ||
'0.75', | ||
'0.76', | ||
'0,77', | ||
'0.77', | ||
'0.78', | ||
] as const; | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
packages/plugin-transform-template/src/transforms/0.77/ios/project-pbxproj.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/// <reference types="@brandingbrand/code-cli-kit/types"/> | ||
|
||
import type {XcodeProject, PBXFile} from 'xcode'; | ||
|
||
import {default as projectPbxproj073} from '../../0.73/ios/project-pbxproj'; | ||
|
||
export default { | ||
...projectPbxproj073, | ||
addFileReferences: (project: XcodeProject): void => { | ||
const targetKey = project.findTargetKey('app'); | ||
|
||
if (!targetKey) { | ||
throw Error(`[PbxprojTransformerError]: cannot find target "app" uuid`); | ||
} | ||
|
||
const opt = {target: targetKey}; | ||
|
||
const groupKey = project.findPBXGroupKey({name: 'app'}); | ||
|
||
if (!groupKey) { | ||
throw Error(`[PbxprojTransformerError]: cannot find group "app" uuid`); | ||
} | ||
|
||
// These files exist as extras and need to be added to pbxproj file as | ||
// source files or header files | ||
project.addSourceFile('app/EnvSwitcher.m', opt, groupKey); | ||
project.addSourceFile('app/NativeConstants.m', opt, groupKey); | ||
|
||
// PrivacyInfo.xcprivacy is already included in the React Native 0.73 template from | ||
// https://github.com/facebook/react-native/blob/v0.73.9/packages/react-native/template/ios/HelloWorld/PrivacyInfo.xcprivacy | ||
|
||
// *.entitlements file can be treated same as a header file with | ||
// respect to "xcode" module, force lastKnownFileType and defaultEncoding | ||
// as this is not a detectble filetype by PBXFile. | ||
// https://github.com/apache/cordova-node-xcode/blob/e594cd453e8f26d8916e4be7bdfb309b8e820e2f/lib/pbxFile.js#L27 | ||
project.addHeaderFile( | ||
'app/app.entitlements', | ||
{ | ||
...opt, | ||
lastKnownFileType: 'text.plist.entitlements', | ||
defaultEncoding: 4, | ||
}, | ||
groupKey, | ||
) as PBXFile; | ||
|
||
// Required build setting when adding entitlements | ||
project.addToBuildSettings( | ||
'CODE_SIGN_ENTITLEMENTS', | ||
'app/app.entitlements', | ||
); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/** | ||
* Imports the base profile configuration from version 0.77 | ||
* @see ./0.77 | ||
*/ | ||
import {default as profile077} from './0.77'; | ||
|
||
/** | ||
* Default export containing dependency specifications and configurations | ||
* @exports {Object} Configuration object extending profile077 | ||
* @see profile077 | ||
*/ | ||
export default { | ||
...profile077, | ||
/** | ||
* React Native core package configuration | ||
* @property {string} version - The semantic version requirement | ||
* @property {string[]} capabilities - Required companion packages | ||
* @property {boolean} required - Indicates this is a required dependency | ||
* @see {@link https://reactnative.dev/} | ||
*/ | ||
'react-native': { | ||
version: '^0.78.0', | ||
capabilities: [ | ||
'react', | ||
'@react-native/babel-preset', | ||
'@react-native/metro-config', | ||
], | ||
required: true, | ||
}, | ||
/** | ||
* React Native Babel preset configuration | ||
* @property {string} version - The semantic version requirement | ||
* @property {string[]} capabilities - Required Babel dependencies | ||
* @property {boolean} devOnly - Indicates this is a development-only dependency | ||
* @see {@link https://github.com/facebook/react-native/tree/main/packages/babel-preset-react-native} | ||
*/ | ||
'@react-native/babel-preset': { | ||
version: '^0.78.0', | ||
capabilities: ['@babel/core', '@babel/preset-env', '@babel/runtime'], | ||
devOnly: true, | ||
}, | ||
/** | ||
* React Native Metro bundler configuration | ||
* @property {string} version - The semantic version requirement | ||
* @property {boolean} devOnly - Indicates this is a development-only dependency | ||
* @see {@link https://facebook.github.io/metro/} | ||
*/ | ||
'@react-native/metro-config': { | ||
version: '^0.78.0', | ||
devOnly: true, | ||
}, | ||
/** | ||
* React core library configuration | ||
* @property {string} version - The semantic version requirement | ||
* @property {string[]} capabilities - Required type definitions | ||
* @property {boolean} required - Indicates this is a required dependency | ||
* @see {@link https://reactjs.org/} | ||
*/ | ||
react: { | ||
version: '19.0.0', | ||
capabilities: ['@types/react'], | ||
required: true, | ||
}, | ||
/** | ||
* TypeScript definitions for React | ||
* @property {string} version - The semantic version requirement | ||
* @property {boolean} devOnly - Indicates this is a development-only dependency | ||
* @see {@link https://www.npmjs.com/package/@types/react} | ||
*/ | ||
'@types/react': { | ||
version: '^19.0.0', | ||
devOnly: true, | ||
}, | ||
}; |
119 changes: 119 additions & 0 deletions
119
packages/templates/react-native/0.78/android/app/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
apply plugin: "com.android.application" | ||
apply plugin: "org.jetbrains.kotlin.android" | ||
apply plugin: "com.facebook.react" | ||
|
||
/** | ||
* This is the configuration block to customize your React Native Android app. | ||
* By default you don't need to apply any configuration, just uncomment the lines you need. | ||
*/ | ||
react { | ||
/* Folders */ | ||
// The root of your project, i.e. where "package.json" lives. Default is '../..' | ||
// root = file("../../") | ||
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native | ||
// reactNativeDir = file("../../node_modules/react-native") | ||
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen | ||
// codegenDir = file("../../node_modules/@react-native/codegen") | ||
// The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js | ||
// cliFile = file("../../node_modules/react-native/cli.js") | ||
|
||
/* Variants */ | ||
// The list of variants to that are debuggable. For those we're going to | ||
// skip the bundling of the JS bundle and the assets. By default is just 'debug'. | ||
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants. | ||
// debuggableVariants = ["liteDebug", "prodDebug"] | ||
|
||
/* Bundling */ | ||
// A list containing the node command and its flags. Default is just 'node'. | ||
// nodeExecutableAndArgs = ["node"] | ||
// | ||
// The command to run when bundling. By default is 'bundle' | ||
// bundleCommand = "ram-bundle" | ||
// | ||
// The path to the CLI configuration file. Default is empty. | ||
// bundleConfig = file(../rn-cli.config.js) | ||
// | ||
// The name of the generated asset file containing your JS bundle | ||
// bundleAssetName = "MyApplication.android.bundle" | ||
// | ||
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js' | ||
// entryFile = file("../js/MyApplication.android.js") | ||
// | ||
// A list of extra flags to pass to the 'bundle' commands. | ||
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle | ||
// extraPackagerArgs = [] | ||
|
||
/* Hermes Commands */ | ||
// The hermes compiler command to run. By default it is 'hermesc' | ||
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc" | ||
// | ||
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map" | ||
// hermesFlags = ["-O", "-output-source-map"] | ||
|
||
/* Autolinking */ | ||
autolinkLibrariesWithApp() | ||
} | ||
|
||
/** | ||
* Set this to true to Run Proguard on Release builds to minify the Java bytecode. | ||
*/ | ||
def enableProguardInReleaseBuilds = false | ||
|
||
/** | ||
* The preferred build flavor of JavaScriptCore (JSC) | ||
* | ||
* For example, to use the international variant, you can use: | ||
* `def jscFlavor = io.github.react-native-community:jsc-android-intl:2026004.+` | ||
* | ||
* The international variant includes ICU i18n library and necessary data | ||
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that | ||
* give correct results when using with locales other than en-US. Note that | ||
* this variant is about 6MiB larger per architecture than default. | ||
*/ | ||
def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+' | ||
|
||
android { | ||
ndkVersion rootProject.ext.ndkVersion | ||
buildToolsVersion rootProject.ext.buildToolsVersion | ||
compileSdk rootProject.ext.compileSdkVersion | ||
|
||
namespace "com.app" | ||
defaultConfig { | ||
applicationId "com.app" | ||
minSdkVersion rootProject.ext.minSdkVersion | ||
targetSdkVersion rootProject.ext.targetSdkVersion | ||
versionCode 1 | ||
versionName "1.0" | ||
} | ||
signingConfigs { | ||
debug { | ||
storeFile file('debug.keystore') | ||
storePassword 'android' | ||
keyAlias 'androiddebugkey' | ||
keyPassword 'android' | ||
} | ||
} | ||
buildTypes { | ||
debug { | ||
signingConfig signingConfigs.debug | ||
} | ||
release { | ||
// Caution! In production, you need to generate your own keystore file. | ||
// see https://reactnative.dev/docs/signed-apk-android. | ||
signingConfig signingConfigs.debug | ||
minifyEnabled enableProguardInReleaseBuilds | ||
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
// The version of react-native is set by the React Native Gradle Plugin | ||
implementation("com.facebook.react:react-android") | ||
|
||
if (hermesEnabled.toBoolean()) { | ||
implementation("com.facebook.react:hermes-android") | ||
} else { | ||
implementation jscFlavor | ||
} | ||
} |
Binary file not shown.
10 changes: 10 additions & 0 deletions
10
packages/templates/react-native/0.78/android/app/proguard-rules.pro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: |
9 changes: 9 additions & 0 deletions
9
packages/templates/react-native/0.78/android/app/src/debug/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools"> | ||
|
||
<application | ||
android:usesCleartextTraffic="true" | ||
tools:targetApi="28" | ||
tools:ignore="GoogleAppIndexingWarning"/> | ||
</manifest> |
26 changes: 26 additions & 0 deletions
26
packages/templates/react-native/0.78/android/app/src/main/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<uses-permission android:name="android.permission.INTERNET" /> | ||
|
||
<application | ||
android:name=".MainApplication" | ||
android:label="@string/app_name" | ||
android:icon="@mipmap/ic_launcher" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:allowBackup="false" | ||
android:theme="@style/AppTheme" | ||
android:supportsRtl="true"> | ||
<activity | ||
android:name=".MainActivity" | ||
android:label="@string/app_name" | ||
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" | ||
android:launchMode="singleTask" | ||
android:windowSoftInputMode="adjustResize" | ||
android:exported="true"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
</manifest> |
Oops, something went wrong.