Skip to content

Commit

Permalink
refact: merge example and test example apps (software-mansion#2225)
Browse files Browse the repository at this point in the history
## Description

This PR intents to merge together the example and test-example apps
resulting in less configuration files.
TestsExample and FabricTestExample apps are removed so there's only
Example, FabricExample and TVOSExample app to take care of.

it is more convenient to use Example and FabricExample apps to run tests
as there is less configuration files to take care of, less building and
less metro restarting. Simply replace the returned component in
`apps/App.tsx` with the selected test and you're ready for testing. For
example replace `<Example/>` with `<Test.Test42/>`.

## Changes

- removed TestsExample and FabricTestExample apps
- allowed for source change in `apps/App.tsx` file to switch between
example and tests

<!--

## Screenshots / GIFs

Here you can add screenshots / GIFs documenting your change.

You can add before / after section if you're changing some behavior.

### Before

### After

-->

## Test code and steps to reproduce

Run the Example or FabricExample app and change source in `apps/App.tsx`
file.

## Checklist

- [x] Updated documentation: <!-- For adding new props to native-stack
-->
- [x]
https://github.com/software-mansion/react-native-screens/blob/main/guides/CONTRIBUTING.md
- [x] Ensured that CI passes

---------

Co-authored-by: maciekstosio <maciekstosio@icloud.com>
Co-authored-by: Kacper Kafara <kacper.kafara@swmansion.com>
  • Loading branch information
3 people authored and ja1ns committed Oct 9, 2024
1 parent 7bb6d26 commit d0ae2f5
Show file tree
Hide file tree
Showing 311 changed files with 157 additions and 28,288 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/android-build-test-fabric.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- 'android/**'
- 'common/**'
- 'src/fabric/**'
- 'FabricTestExample/**'
- 'FabricExample/**'
- 'package.json'
- '.github/workflows/android-build-test-fabric.yml'
push:
Expand All @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
env:
WORKING_DIRECTORY: FabricTestExample
WORKING_DIRECTORY: FabricExample
concurrency:
group: android-fabric-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -37,7 +37,7 @@ jobs:
with:
node-version: 18
cache: 'yarn'
cache-dependency-path: 'FabricTestExample/yarn.lock'
cache-dependency-path: 'FabricExample/yarn.lock'
- name: Install node dependencies
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/android-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
paths:
- 'android/**'
- 'package.json'
- 'TestsExample/**'
- 'Example/**'
- '.github/workflows/android-build-test.yml'
push:
branches:
Expand All @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
env:
WORKING_DIRECTORY: TestsExample
WORKING_DIRECTORY: Example
concurrency:
group: android-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -35,7 +35,7 @@ jobs:
with:
node-version: 18
cache: 'yarn'
cache-dependency-path: 'TestsExample/yarn.lock'
cache-dependency-path: 'Example/yarn.lock'
- name: Install node dependencies
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ios-build-test-fabric.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- 'ios/**'
- 'common/**'
- 'src/fabric/**'
- 'FabricTestExample/**'
- 'FabricExample/**'
push:
branches:
- main
Expand All @@ -20,7 +20,7 @@ jobs:
runs-on: macos-14
timeout-minutes: 60
env:
WORKING_DIRECTORY: FabricTestExample
WORKING_DIRECTORY: FabricExample
concurrency:
group: ios-fabric-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -33,7 +33,7 @@ jobs:
with:
node-version: 18
cache: 'yarn'
cache-dependency-path: 'FabricTestExample/yarn.lock'
cache-dependency-path: 'FabricExample/yarn.lock'
- name: Use latest stable Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ios-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- 'package.json'
- 'ios/**'
- 'common/**'
- 'TestsExample/**'
- 'Example/**'
push:
branches:
- main
Expand All @@ -19,7 +19,7 @@ jobs:
runs-on: macos-14
timeout-minutes: 60
env:
WORKING_DIRECTORY: TestsExample
WORKING_DIRECTORY: Example
concurrency:
group: ios-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -31,7 +31,7 @@ jobs:
with:
node-version: 18
cache: 'yarn'
cache-dependency-path: 'TestsExample/yarn.lock'
cache-dependency-path: 'Example/yarn.lock'
- name: Use latest stable Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion Example/App.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import App from '../apps/examples';
import App from '../apps';

export default App;
1 change: 0 additions & 1 deletion Example/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** @format */
import 'react-native-gesture-handler';
import { AppRegistry } from 'react-native';
import App from './App';
Expand Down
2 changes: 1 addition & 1 deletion FabricExample/App.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import App from '../apps/examples';
import App from '../apps';

export default App;
4 changes: 0 additions & 4 deletions FabricExample/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/**
* @format
*/

import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
Expand Down
2 changes: 0 additions & 2 deletions FabricTestExample/.bundle/config

This file was deleted.

74 changes: 0 additions & 74 deletions FabricTestExample/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion FabricTestExample/.watchmanconfig

This file was deleted.

3 changes: 0 additions & 3 deletions FabricTestExample/App.js

This file was deleted.

9 changes: 0 additions & 9 deletions FabricTestExample/Gemfile

This file was deleted.

105 changes: 0 additions & 105 deletions FabricTestExample/Gemfile.lock

This file was deleted.

14 changes: 0 additions & 14 deletions FabricTestExample/__tests__/App-test.js

This file was deleted.

Loading

0 comments on commit d0ae2f5

Please sign in to comment.