Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: react-native-community/template
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.75.7
Choose a base ref
...
head repository: react-native-community/template
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.76.0
Choose a head ref

Commits on Jun 19, 2024

  1. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    cortinico Nicola Corti
    Copy the full SHA
    2a4c86e View commit details
  2. Add release workflow

    cortinico committed Jun 19, 2024

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    cortinico Nicola Corti
    Copy the full SHA
    a6dd664 View commit details
  3. Add branch tag also

    cortinico committed Jun 19, 2024

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    cortinico Nicola Corti
    Copy the full SHA
    c51c16b View commit details
  4. Update .github/workflows/release.yaml

    Co-authored-by: Riccardo Cipolleschi <cipolleschi@meta.com>
    cortinico and cipolleschi authored Jun 19, 2024

    Partially verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
    Copy the full SHA
    f39d18e View commit details
  5. Update .github/workflows/release.yaml

    Co-authored-by: Riccardo Cipolleschi <cipolleschi@meta.com>
    cortinico and cipolleschi authored Jun 19, 2024

    Partially verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
    Copy the full SHA
    dcef464 View commit details
  6. Review feedback

    cortinico committed Jun 19, 2024

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    cortinico Nicola Corti
    Copy the full SHA
    3afd696 View commit details
  7. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    cortinico Nicola Corti
    Copy the full SHA
    aeefcc3 View commit details
  8. Merge pull request #19 from react-native-community/nc/nightlies-workflow

    Add nightlies/release workflow for the template
    cortinico authored Jun 19, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    c7ced57 View commit details
  9. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    7d31142 View commit details
  10. Merge pull request #20 from react-native-community/nc/remove-extra-tags

    [GHA] Remove extra --tags from publish
    cortinico authored Jun 19, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    5162086 View commit details

Commits on Jun 20, 2024

  1. Bump deps to 0.76.0-main (#22)

    cortinico authored Jun 20, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    fb2483f View commit details
  2. Do not update template/package.json version upon publishing (#24)

    cortinico authored Jun 20, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    13f0c7d View commit details
  3. Enable New Architecture for 0.76 (#23)

    cortinico authored Jun 20, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    26a2381 View commit details
  4. Remove dry-run (#21)

    cortinico authored Jun 20, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    d73cca5 View commit details
  5. Specify registry-url: 'https://registry.npmjs.org'` for publishing (#25

    )
    cortinico authored Jun 20, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    823345a View commit details
  6. Create corresponding git tag on stable publishing (#26)

    cortinico authored Jun 20, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    5f5e366 View commit details
  7. Minor git cleanups for -stable branches (#27)

    cortinico authored Jun 20, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    bc28199 View commit details
  8. Add padstart in nightly version (#28)

    cortinico authored Jun 20, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    a976090 View commit details

Commits on Jun 21, 2024

  1. fix: indentation in PrivacyInfo.xcprivacy (#29)

    szymonrybczak authored Jun 21, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    3bb13d3 View commit details
  2. refactor: automation to tag and version the template when releasing (#30

    )
    
    There was a discussion on Discord, where we looked at implementing what was originally proposed.  This is that implementation.  It'll need to land with a [cli](react-native-community/cli#2422) change to use the update template + tagging.
    
    - feat: add mutating react-native & @react-native/ packages
    
        Support for doing this on nightly and release workflows
    
    - feat: added node ./scripts/updateReactNativeVersion.js <version>
    
        Sets the version of react-native and the @react-native/ scoped packages.
        It will also normalize tags to concrete versions. E.g. latest -> 0.74.2
    
    - refactor: move scripts into a ./scripts folder
    blakef authored Jun 21, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    893dcc8 View commit details
  3. fix: move updateTemplateVersion.js to commonjs + prettier (#31)

    blakef authored Jun 21, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    e2b44a9 View commit details

Commits on Jun 24, 2024

  1. chore: sync main with 0.75-stable (#34)

    There are some other minor commits, but the bulk are from:
    
    4b5bf97 fix: package.json + ci version pinning
    9738013 [LOCAL] Fix typo for input.version
    21fc022 [LOCAL] Fix quotes for input.version
    6ead588 [LOCAL] Make the template a non mjs module
    
    Refined from:
    
    $ git log --oneline origin/main..origin/0.75-stable | pbcopy
    $ git diff origin/main..origin/0.75-stable | git apply && git add -i
    blakef authored Jun 24, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    33cbbff View commit details

Commits on Jul 16, 2024

  1. Gradle to 8.9 (#37)

    cortinico authored Jul 16, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    fa868c5 View commit details
  2. chore: add explicit dependency on the community CLI (#39)

    blakef authored Jul 16, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    91dde91 View commit details

Commits on Aug 7, 2024

  1. Update minSdk 23 → 24 (#42)

    blakef authored Aug 7, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    8f93044 View commit details

Commits on Aug 21, 2024

  1. Bump min iOS to 15.1 (#44)

    realsoelynn authored Aug 21, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    28eaf0a View commit details

Commits on Sep 6, 2024

  1. Bump compileSdk to 35 (#47)

    cortinico authored Sep 6, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    8892cc1 View commit details
  2. Update Babel to 7.25.x (#48)

    cortinico authored Sep 6, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    2b2aac9 View commit details

Commits on Sep 8, 2024

  1. feat: create releases where PATCH doesn't have to match react-native (#…

    …43)
    
    This feature needs to be released with react-native-community/cli#2475,
    which decouples the 1:1 release model we have for templates and
    react-native.
    
    Switching users to this is going to be difficult, and should only be
    rolled asap before 0.76. If we have to release a template fix, then only
    users with the latest CLI will be able to use that and subsequent
    versions.
    
    I'm not sure of how to clearly communicate that to users.
    
    - Added tests
    - Set dry_run to default
    blakef authored Sep 8, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    b46b99f View commit details

Commits on Sep 9, 2024

  1. Fix release workflow (#49)

    - VERSION wasn't assigned correctly
    - Dry run wasn't working
    blakef authored Sep 9, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    7ee1fc3 View commit details
  2. Gradle to 8.10.1 (#50)

    cortinico authored Sep 9, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    8add14a View commit details
  3. Revert React from 19 to 18.3.1 (#40)

    * Revert "Mirror - Fix tests for React 19"
    
    This reverts commit 8ae99d9.
    
    * Revert "RN/Relay: Bump Dependency to React 19 (#44990)"
    
    This reverts commit 38dbc8c.
    cipolleschi committed Sep 9, 2024

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    f51d82a View commit details
  4. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    897b92d View commit details

Commits on Sep 10, 2024

  1. Copy the full SHA
    3834a87 View commit details

Commits on Sep 12, 2024

  1. Unverified

    The email in this signature doesn’t match the committer email.
    Copy the full SHA
    61e24ed View commit details
  2. Unverified

    The email in this signature doesn’t match the committer email.
    Copy the full SHA
    0fb9c7b View commit details

Commits on Sep 16, 2024

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    7345250 View commit details
  2. Copy the full SHA
    3b1a411 View commit details

Commits on Sep 24, 2024

  1. Copy the full SHA
    577ec06 View commit details

Commits on Oct 1, 2024

  1. Copy the full SHA
    8fbe281 View commit details

Commits on Oct 2, 2024

  1. Copy the full SHA
    a10830c View commit details
  2. fix release workflow

    Had a typo
    blakef committed Oct 2, 2024
    Copy the full SHA
    32324a4 View commit details
  3. Fix: continue attempting release nothing to commit

    This can happen if npm publish fails
    blakef committed Oct 2, 2024
    Copy the full SHA
    fa7ebf3 View commit details

Commits on Oct 8, 2024

  1. Copy the full SHA
    efb570b View commit details

Commits on Oct 15, 2024

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    140012e View commit details
  2. Copy the full SHA
    6e56f8a View commit details

Commits on Oct 17, 2024

  1. Copy the full SHA
    c2309dc View commit details

Commits on Oct 23, 2024

  1. Copy the full SHA
    8b95302 View commit details
30 changes: 30 additions & 0 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Nightly

on:
workflow_dispatch:
# Instead of running every night we run
# Once for every commit in main as the traffic on this repo
# is lower than facebook/react-native.
push:
branches:
- main

jobs:
publish_template_as_nightly:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup node.js
uses: actions/setup-node@v4.0.0
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- name: Update versions to nightly
run: node ./scripts/updateTemplateVersion.js nightly
- name: Update template/package.json to nightly react-native + @react-native
run: node ./scripts/updateReactNativeVersion.js nightly
- name: Publish NPM as Nightly
run: npm publish --tag nightly
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
76 changes: 76 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Release

on:
workflow_dispatch:
inputs:
version:
description: "The version of the react-native we the template to use in this release. For example 0.75.0-rc.0"
required: true
type: string
is_latest_on_npm:
description: "Whether we want to tag this template release as `latest` on NPM"
required: true
type: boolean
default: false
dry_run:
description: "Run without making persistent changes to git or npm"
type: boolean
default: true

jobs:
publish_template:
runs-on: ubuntu-latest
steps:
- name: Safeguard against branch name
run: |
if [[ "$GITHUB_REF_NAME" != *-stable ]]; then
echo "Error: This workflow can only be executed from a branch ending with '-stable'."
exit 1
fi
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup node.js
uses: actions/setup-node@v4.0.0
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- name: Determine new template version
run: echo "VERSION=$(./scripts/bumpedTemplateVersion.sh ${{ inputs.version }})" >> $GITHUB_ENV
- name: Update versions to input one
run: node ./scripts/updateTemplateVersion.js $VERSION
- name: Update template/package.json to nightly react-native + @react-native
run: node ./scripts/updateReactNativeVersion.js "${{ inputs.version }}"
- name: Create corresponding commit & git tag
run: |
GIT=(echo git)
if [ "${{ inputs.dry_run }}" = "false" ]; then
GIT=(git)
fi
"${GIT[@]}" config --global user.name 'React Native Bot'
"${GIT[@]}" config --global user.email 'bot@reactnative.dev'
if [ -z "$("${GIT[@]}" status --porcelain)" ]; then
echo "No changes, a previous release might have failed at the publish step. Continue to retry."
exit 0
fi
"${GIT[@]}" commit -am "Bumping template to $VERSION"
"${GIT[@]}" push
"${GIT[@]}" tag $VERSION
"${GIT[@]}" push --tags
- name: Publish on NPM (with tag if needed)
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
args=(--dry-run)
if [ "${{ inputs.dry_run }}" = "false" ]; then
args=()
fi
IS_LATEST_ON_NPM="${{ inputs.is_latest_on_npm }}"
if [[ "$IS_LATEST_ON_NPM" == "true" ]]; then
npm publish --tag latest "${args[@]}"
elif [[ "$VERSION" == *"rc"* ]]; then
npm publish --tag next "${args[@]}"
elif [[ "$GITHUB_REF_NAME" == *"-stable" ]]; then
npm publish --tag "$GITHUB_REF_NAME" "${args[@]}"
else
npm publish "${args[@]}"
fi
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
scripts/

9 changes: 9 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/** @type {import('jest').Config} */
const config = {
coverageProvider: "v8",
testMatch: [
"**/__tests__/*.js",
],
};

module.exports = config;
16 changes: 12 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
{
"name": "@react-native-community/template",
"version": "0.0.4",
"version": "0.76.0",
"description": "The template used by `npx @react-native-community/cli init` to bootstrap a React Native application.",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"scripts": {
"test": "jest",
"version": "0.76.0"
},
"type": "commonjs",
"files": [
"template/*",
"template.config.js"
],
"dependencies": {},
"devDependencies": {},
"devDependencies": {
"jest": "^29.7.0",
"semver": "^7.6.3"
},
"homepage": "https://github.com/react-native-community/template/tree/main",
"repository": {
"type": "git",
"url": "https://github.com/react-native-community/template.git"
"url": "git+https://github.com/react-native-community/template.git"
}
}
}
30 changes: 30 additions & 0 deletions scripts/__tests__/bumpTemplateVersion-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const {execSync} = require('child_process');
const semver = require('semver');

function run(version) {
return execSync(`./bumpedTemplateVersion.sh ${version}`, { cwd: 'scripts', stdio: ['ignore', 'pipe', 'ignore'] }).toString().trim();
}

describe('bumpTemplateVersion.sh', () => {

it('nightlies stay the same', () => {
expect(run('0.75.0-nightly-20240606-4324f0874')).toEqual('0.75.0-nightly-20240606-4324f0874');
});

it('release candidates appended with a sha', () => {
expect(run('0.74.0-rc.3')).toMatch(/0\.74\.0-rc\.3-.+/);
});

it('assumed it is the first version when no matching MAJOR.MINOR', () => {
const versionShouldNeverExist = '1111.0.1';
expect(run(versionShouldNeverExist)).toEqual('1111.0.0');
});

it('bumps the patch if a version of the template already exists', async () => {
// This sucks I know:
const {version} = await fetch('https://registry.npmjs.com/@react-native-community/template/latest').then(resp => resp.json());
const {major, minor, patch} = semver.parse(version);
expect(run(`${major}.${minor}.${patch}`)).toEqual(`${major}.${minor}.${patch+1}`);
});

});
50 changes: 50 additions & 0 deletions scripts/bumpedTemplateVersion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash

# What this does:
# 1. Take the version of react, use the MAJOR.MINOR
# - /nightly/ -> MAJOR.MINOR.PATCH-nightly-YYYYNN-HASH
# - /-rc.N/ -> MAJOR.MINOR.PATCH-rc.N-HASH
# - ELSE: continue
# 2. Look for the latest version of the template with that MAJOR.MINOR
# - No version -> then set to MAJOR.MINOR.0
# - MAJOR.MINOR.PATCH -> MAJOR.MINOR.PATCH+1

log() {
echo "$@" >&2
}

if [[ $# != 1 ]]; then
log "USAGE: bumpTemplateVersion.sh <react native version>"
exit 1
fi

if [[ $1 =~ -rc\.[0-9]+ ]]; then
log "Release candidate"
# Append a sha, so if we need to re-release for a RC we don't conflict
echo $1-$(git rev-parse --short HEAD)
exit 0
fi

if [[ $1 =~ -nightly- ]]; then
log "Nightly candidate"
# Once a day, we're not going to get conflicts using the given nightly tag
echo $1
exit 0
fi

# Find current version of template that matches this version of react-native.
if [[ $1 =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
MAJOR_MINOR=$(awk -F'.' '{ print $1"."$2 }' <<< $1)
CURRENT_VERSION=$(npm show --json "@react-native-community/template@^$MAJOR_MINOR")
if [ $? -ne 0 ]; then
echo "$MAJOR_MINOR.0";
exit 0;
fi
# Bump PATCH
PUBLISHED=$(jq -r 'last | .version' <<< $CURRENT_VERSION | awk -F'.' '{ print $1"."$2"."($3+1) }')
echo $PUBLISHED;
exit 0
fi

log "Unknown type of release: $RN_VERSION"
exit 1
108 changes: 108 additions & 0 deletions scripts/updateReactNativeVersion.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
const fs = require('fs');

function updateDependencies(pkgJson, update) {
console.log('Changing package.json dependencies:');

for (const [pkg, value] of Object.entries(update.dependencies ?? {})) {
const old = pkgJson.dependencies[pkg];
if (old) {
console.log(` - ${pkg}: ${old}${value}`);
} else {
console.log(` - ${pkg}: ${value}`);
}
pkgJson.dependencies[pkg] = value;
}

for (const [pkg, value] of Object.entries(update.devDependencies ?? {})) {
const old = pkgJson.devDependencies[pkg];
if (old) {
console.log(` - ${pkg}: ${old}${value}`);
} else {
console.log(` - ${pkg}: ${value}`);
}
pkgJson.devDependencies[pkg] = value;
}

return pkgJson;
}

const REACT_NATIVE_SCOPE = '@react-native/';

/**
* Packages that are scoped under @react-native need a consistent version
*/
function normalizeReactNativeDeps(deps, version) {
const updated = {};
for (const key of Object.keys(deps ?? {}).filter((pkg) =>
pkg.startsWith(REACT_NATIVE_SCOPE),
)) {
updated[key] = version;
}
return updated;
}

async function main(version) {
const PKG_JSON_PATH = 'template/package.json';
// Update the react-native dependency if using the new @react-native-community/template.
// We can figure this out as it ships with react-native@1000.0.0 set to a dummy version.
let pkgJson = JSON.parse(fs.readFileSync(PKG_JSON_PATH, 'utf8'));

pkgJson = updateDependencies(pkgJson, {
dependencies: {
'react-native': version,
...normalizeReactNativeDeps(pkgJson.dependencies, version),
},
devDependencies: {
...normalizeReactNativeDeps(pkgJson.devDependencies, version),
},
});

let updated = JSON.stringify(pkgJson, null, 2);
console.log(
`\nWriting update template/package.json to ${PKG_JSON_PATH}:\n\n${updated}`,
);
fs.writeFileSync(PKG_JSON_PATH, updated);

// 2. Update the scripts.version field in the top level package.json. This lets us leverage
// the https://registry.npmjs.org/@react-native-community/template API:
//
// "name": "@react-native-community/template",
// "dist-tags": {
// ...
// "0.75-stable": "0.75.0-rc.0"
// },
// "versions": {
// "0.75.0-rc.0": {
// "name": "@react-native-community/template",
// "version": "0.75.0-rc.0",
// "scripts": {
// "version": "0.75.1"
// ...
// },
//
// We can then correlate earlier version of react-native with earlier template. Significantly
// none of this is 'user facing'.
const PKG_JSON_ROOT_PATH = './package.json';
pkgJson = JSON.parse(fs.readFileSync(PKG_JSON_ROOT_PATH, 'utf8'));
pkgJson.scripts ??= {};
pkgJson.scripts.version = version;
updated = JSON.stringify(pkgJson, null, 2);
console.log(
`\nWriting update package.json to ${PKG_JSON_ROOT_PATH}:\n\n${updated}`,
);
fs.writeFileSync(PKG_JSON_ROOT_PATH, updated);
}

if (require.main === module) {
if (process.argv.length < 3) {
console.log(`USAGE: updateReactNativeVersion.js <version>
Updates 'react-native' and '@react-native/' scoped packages to a common version within
the template.
`);
process.exit(1);
}
main(process.argv.pop()).catch((e) => {
throw e;
});
}
35 changes: 35 additions & 0 deletions scripts/updateTemplateVersion.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
const { readFileSync, writeFileSync } = require('fs');

/**
* Function to get the Nightly version of the package, similar to the one used in React Native.
* Version will look as follows:
* `0.75.0-nightly-20241010-abcd1234`
*/
function getNightlyVersion(originalVersion) {
const version = originalVersion.split('-')[0];
const date = new Date();
const year = date.getFullYear();
const month = date.getMonth() + 1;
const day = date.getDate();
// Get the sha fromt he current commit on github actions
const sha = process.env.GITHUB_SHA.slice(0, 7);
return `${version}-nightly-${year}${month}${day}-${sha}`;
}

if (!process.argv[2]) {
console.error('Please provide a version to update the template to.');
process.exit(1);
}
const targetVersion = process.argv[2];

// We first update version of the template we're about to publish.
const packageJsonData = readFileSync('package.json', 'utf8');
const packageJson = JSON.parse(packageJsonData);
if (targetVersion === 'nightly') {
packageJson.version = getNightlyVersion(packageJson.version);
} else {
packageJson.version = targetVersion;
}
const updatedPackageJsonData = JSON.stringify(packageJson, null, 2);
writeFileSync('package.json', updatedPackageJsonData, 'utf8');
console.log(`Template version updated to ${packageJson.version}`);
8 changes: 3 additions & 5 deletions template/__tests__/App.test.tsx
Original file line number Diff line number Diff line change
@@ -10,10 +10,8 @@ import App from '../App';
import {it} from '@jest/globals';

// Note: test renderer must be required after react-native.
import ReactTestRenderer from 'react-test-renderer';
import renderer from 'react-test-renderer';

it('renders correctly', async () => {
await ReactTestRenderer.act(() => {
ReactTestRenderer.create(<App />);
});
it('renders correctly', () => {
renderer.create(<App />);
});
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@ import com.facebook.react.ReactPackage
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.soloader.OpenSourceMergedSoMapping
import com.facebook.soloader.SoLoader

class MainApplication : Application(), ReactApplication {
@@ -34,7 +35,7 @@ class MainApplication : Application(), ReactApplication {

override fun onCreate() {
super.onCreate()
SoLoader.init(this, false)
SoLoader.init(this, OpenSourceMergedSoMapping)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
load()
6 changes: 3 additions & 3 deletions template/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
buildscript {
ext {
buildToolsVersion = "34.0.0"
minSdkVersion = 23
compileSdkVersion = 34
buildToolsVersion = "35.0.0"
minSdkVersion = 24
compileSdkVersion = 35
targetSdkVersion = 34
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.24"
2 changes: 1 addition & 1 deletion template/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=false
newArchEnabled=true

# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
Binary file modified template/android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion template/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
5 changes: 4 additions & 1 deletion template/android/gradlew
Original file line number Diff line number Diff line change
@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
@@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
2 changes: 2 additions & 0 deletions template/android/gradlew.bat
Original file line number Diff line number Diff line change
@@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
10 changes: 6 additions & 4 deletions template/ios/HelloWorld.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -420,7 +420,7 @@
"$(inherited)",
);
INFOPLIST_FILE = HelloWorldTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -444,7 +444,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
COPY_PHASE_STRIP = NO;
INFOPLIST_FILE = HelloWorldTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -470,6 +470,7 @@
CURRENT_PROJECT_VERSION = 1;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = HelloWorld/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -496,6 +497,7 @@
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
INFOPLIST_FILE = HelloWorld/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -562,7 +564,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
@@ -628,7 +630,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
63 changes: 31 additions & 32 deletions template/ios/HelloWorld/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
@@ -2,37 +2,36 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyCollectedDataTypes</key>
<array>
</array>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>C617.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>35F9.1</string>
</array>
</dict>
</array>
<key>NSPrivacyTracking</key>
<false/>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>C617.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>35F9.1</string>
</array>
</dict>
</array>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyTracking</key>
<false/>
</dict>
</plist>
25 changes: 14 additions & 11 deletions template/package.json
Original file line number Diff line number Diff line change
@@ -10,27 +10,30 @@
"test": "jest"
},
"dependencies": {
"react": "19.0.0-rc-fb9a90fa48-20240614",
"react-native": "1000.0.0"
"react": "18.3.1",
"react-native": "0.76.0"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@react-native/babel-preset": "0.75.0-main",
"@react-native/eslint-config": "0.75.0-main",
"@react-native/metro-config": "0.75.0-main",
"@react-native/typescript-config": "0.75.0-main",
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/runtime": "^7.25.0",
"@react-native-community/cli": "15.0.0-alpha.2",
"@react-native-community/cli-platform-android": "15.0.0-alpha.2",
"@react-native-community/cli-platform-ios": "15.0.0-alpha.2",
"@react-native/babel-preset": "0.76.0",
"@react-native/eslint-config": "0.76.0",
"@react-native/metro-config": "0.76.0",
"@react-native/typescript-config": "0.76.0",
"@types/react": "^18.2.6",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.6.3",
"eslint": "^8.19.0",
"jest": "^29.6.3",
"prettier": "2.8.8",
"react-test-renderer": "19.0.0-rc-fb9a90fa48-20240614",
"react-test-renderer": "18.3.1",
"typescript": "5.0.4"
},
"engines": {
"node": ">=18"
}
}
}
2,129 changes: 2,129 additions & 0 deletions yarn.lock

Large diffs are not rendered by default.