Skip to content

Commit

Permalink
Merge pull request #38 from ngocle2497/feat/rn074
Browse files Browse the repository at this point in the history
Feat: Upgrade rn 0.74.5
  • Loading branch information
ngocle2497 authored Aug 11, 2024
2 parents 71b0538 + 57f608b commit 8f24500
Show file tree
Hide file tree
Showing 223 changed files with 2,475 additions and 15,955 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rn-boiler-template",
"private": false,
"version": "1.72.38",
"version": "1.74.0",
"description": "Clean and minimalist React Native template for a quick start with TypeScript and components",
"scripts": {
"test": "exit 0"
Expand Down
63 changes: 28 additions & 35 deletions template/GITLABRUNNER.MD
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

You can config gitlab CI runner to create build automatically.

## Config workflow
Expand All @@ -24,7 +23,6 @@ You can config gitlab CI runner to create build automatically.
- Step 2: Add 2 variable:
- BRANCH_NAME: branch of repo want to build. ex: develop, main, ...
- BASE_ENV_ARGS: env want to build. String with "," separator. This will use for fastlane. ex: dev,prod

```

### .gitlab-ci.yml
Expand All @@ -38,13 +36,13 @@ default:
- macos_shared

variables:
GIT_CLEAN_FLAGS: "none"
GIT_CLEAN_FLAGS: 'none'
# BRANCH_NAME: "develop"
FASTLANE_SCRIPT_ANDROID: "bundle exec fastlane android"
FASTLANE_SCRIPT_IOS: "bundle exec fastlane ios"
FASTLANE_SCRIPT_ANDROID: 'bundle exec fastlane android'
FASTLANE_SCRIPT_IOS: 'bundle exec fastlane ios'
# BASE_ENV_ARGS: "dev"
EXPORT_DIR_ARGS_NAME: "export_dir"
EXPORT_FOLDER: "export/$BRANCH_NAME"
EXPORT_DIR_ARGS_NAME: 'export_dir'
EXPORT_FOLDER: 'export/$BRANCH_NAME'

clone-code-project:
stage: clone
Expand Down Expand Up @@ -97,7 +95,7 @@ build-android:
- fnm use $NODE_VERSION
script:
- echo "sdk.dir=$ANDROID_HOME" > android/local.properties
- npx ts-node build_script/build-android.ts $BASE_ENV_ARGS $EXPORT_FOLDER
- node build-ci/build-android.js $BASE_ENV_ARGS $EXPORT_FOLDER
needs:
- job: install-dependencies
allow_failure: true
Expand All @@ -108,7 +106,7 @@ deploy-android:
- echo "Deploy android app ..."
- cd repo/$BRANCH_NAME
script:
- npx ts-node build_script/deploy-android.ts $BASE_ENV_ARGS $EXPORT_FOLDER
- node build-ci/deploy-android.js $BASE_ENV_ARGS $EXPORT_FOLDER
needs:
- job: build-android
allow_failure: true
Expand All @@ -120,7 +118,7 @@ build-ios:
- cd repo/$BRANCH_NAME
- fnm use $NODE_VERSION
script:
- npx ts-node build_script/build-ios.ts $BASE_ENV_ARGS $EXPORT_FOLDER
- node build-ci/build-ios.js $BASE_ENV_ARGS $EXPORT_FOLDER
needs:
- job: install-dependencies
allow_failure: true
Expand All @@ -131,7 +129,7 @@ deploy-ios:
- echo "Deploy ios app ..."
- cd repo/$BRANCH_NAME
script:
- npx ts-node build_script/deploy-ios.ts $BASE_ENV_ARGS $EXPORT_FOLDER
- node build-ci/deploy-ios.js $BASE_ENV_ARGS $EXPORT_FOLDER
needs:
- job: build-ios
allow_failure: true
Expand All @@ -154,7 +152,6 @@ clean-up:
script:
- rm -rf $BRANCH_NAME
needs: [release, deploy-ios, deploy-android]

```
### pull_repo.sh
Expand All @@ -168,9 +165,9 @@ mkdir -p repo/$branch
cd repo/$branch
rm -rf fastlane
git clone $repo -b $branch .
# copy fastlane and build_script to $branch folder
# copy fastlane and build-ci to $branch folder
cp -r ../../fastlane .
cp -r ../../build_script .
cp -r ../../build-ci .

```

Expand Down Expand Up @@ -203,9 +200,9 @@ done

### build-ci

#### build-android.ts
#### build-android.js

```ts
```js
import { execSync } from 'child_process';

(() => {
Expand All @@ -231,12 +228,11 @@ import { execSync } from 'child_process';
);
});
})();

```

#### deploy-android.ts
#### deploy-android.js

```ts
```js
import { execSync } from 'child_process';

(() => {
Expand All @@ -255,12 +251,11 @@ import { execSync } from 'child_process';
);
});
})();

```

#### build-ios.ts
#### build-ios.js

```ts
```js
import { execSync } from 'child_process';

(() => {
Expand All @@ -279,12 +274,11 @@ import { execSync } from 'child_process';
);
});
})();

```

#### deploy-ios.ts
#### deploy-ios.js

```ts
```js
import { execSync } from 'child_process';

(() => {
Expand All @@ -303,19 +297,18 @@ import { execSync } from 'child_process';
);
});
})();

```

> Folder structure like:
.
├── fastlane
├── build-ci
│ ├── build-android.ts
│ ├── deploy-android.ts
│ ├── build-ios.ts
│ └── deploy-ios.ts
├── .gitlab-ci.yml
├── pull_repo.sh
├── release.sh
├── fastlane
├── build-ci
│ ├── build-android.js
│ ├── deploy-android.js
│ ├── build-ios.js
│ └── deploy-ios.js
├── .gitlab-ci.yml
├── pull_repo.sh
├── release.sh
└── README.md
2 changes: 2 additions & 0 deletions template/Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"

# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
# bound in the template on Cocoapods with next React Native release.
gem 'cocoapods', '>= 1.13', '< 1.15'
Expand Down
14 changes: 14 additions & 0 deletions template/__tests__/App.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* @format
*/

import 'react-native';
import React from 'react';

import renderer from 'react-test-renderer';

import { MyApp } from '../src/app';

it('renders correctly', () => {
renderer.create(<MyApp />);
});
39 changes: 0 additions & 39 deletions template/_babelrc

This file was deleted.

2 changes: 1 addition & 1 deletion template/_bundle/config
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: 1
BUNDLE_FORCE_RUBY_PLATFORM: 1
Loading

0 comments on commit 8f24500

Please sign in to comment.