Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Epic: new mobile app (move to monorepo) #4698

Merged
merged 50 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
31656b0
refactor: move nextjs files to apps/web
compojoom Dec 19, 2024
a363a78
chore: setup monorepo
compojoom Dec 18, 2024
7825b1c
fix: github actions on monorepo
compojoom Dec 18, 2024
8a244b9
squashed history up to 7220c7613b425edc5597c61a6747570263478238
clovisdasilvaneto Oct 9, 2024
4a9ab2d
Fix tests (#13)
compojoom Nov 1, 2024
9c9072c
feat: Create Tx history page (#14)
clovisdasilvaneto Nov 5, 2024
947272f
chore: Use Alert component in the status banners components (#17)
clovisdasilvaneto Nov 7, 2024
a7d10c1
feat: Add chains and active chain slice (#16)
clovisdasilvaneto Nov 7, 2024
db8f9b8
featr: Create static pending transactions screen (#18)
clovisdasilvaneto Nov 11, 2024
ac072c6
chore: update to expo-52 and rn 0.76
compojoom Nov 11, 2024
c986a14
chore: update detox
compojoom Nov 11, 2024
104d687
refactor: safeThemeProvider
compojoom Nov 11, 2024
3cf0ba2
chore: update dependencies
compojoom Nov 11, 2024
639f5a7
feat: use react-navigation header in screens (#21)
compojoom Nov 18, 2024
52c3c7e
fix: app crashed due to syntax error (#23)
compojoom Nov 18, 2024
85b624d
chore: update expo to v52.0.7 (#24)
compojoom Nov 19, 2024
33f001d
fix: redux-devtools not working on expo52 (#25)
compojoom Nov 20, 2024
0103bc4
feat: use RTK code-generation for endpoints (#22)
compojoom Nov 20, 2024
9dc0821
Fix failing tests (#26)
compojoom Nov 20, 2024
e3c668f
Feat: active safe slice (#28)
katspaugh Nov 20, 2024
c84b5aa
feat: automatically run unit tests on new PRs (#27)
compojoom Nov 20, 2024
cfeb792
fix: wrong confirmationrequired/confirmation submitted (#30)
compojoom Nov 20, 2024
300a4af
feat: add storybook for web (#32)
compojoom Nov 21, 2024
049ac4f
feat: automatically run unit tests on new PRs (#27) (#29)
compojoom Nov 21, 2024
8bd4ae8
refactor: update the openAPI spec for RTK code generation (#33)
compojoom Nov 25, 2024
8d4f7da
fix: autogenerated response definition for getSafeOverview was missin…
compojoom Nov 26, 2024
e11eaf2
feat: Assets screen (#34)
clovisdasilvaneto Nov 26, 2024
bf63c3f
chore: enable eslint curly rule (#38)
compojoom Nov 26, 2024
c670453
feat: Cover assets screen with unit tests (#36)
clovisdasilvaneto Nov 26, 2024
69831ab
Feat: Settings Screen [SW-315] (#35)
compojoom Nov 26, 2024
8790c51
chore: adjust components folder structure (#40)
clovisdasilvaneto Nov 27, 2024
4ab9f18
fix: unit tests of Identicon component (#41)
clovisdasilvaneto Nov 27, 2024
b5ff1a8
fix: wrong color for settings (#39)
compojoom Nov 27, 2024
1fdbeb9
Chore: Refactor features folder to follow code guidelines (#43)
clovisdasilvaneto Nov 28, 2024
dc22e65
feat: blurred identicon header (#42)
compojoom Nov 28, 2024
3e1a251
fix: crash in production (#44)
compojoom Nov 28, 2024
6ea5053
fix: wrong background (#45)
compojoom Nov 28, 2024
d955405
chore: manual ios deployment (#46)
compojoom Nov 29, 2024
46dae03
Fix android UI glitches (#47)
compojoom Dec 2, 2024
d24abe2
fix: avoid using complex values to not have the UnhandledLinkingConte…
clovisdasilvaneto Dec 4, 2024
cac233e
Setup Maestro & remove detox (#48)
compojoom Dec 4, 2024
d9a3934
Eas (#49)
compojoom Dec 4, 2024
903f114
chore: clean up (#52)
compojoom Dec 5, 2024
ff2cb7a
refactor: repository now follows a Monorepo structure (#55)
compojoom Dec 6, 2024
3a12ca0
feat: Loading screen (#56)
clovisdasilvaneto Dec 9, 2024
951aae1
Refactor: extract CGW types into a package (#57)
compojoom Dec 16, 2024
013110a
feat: Create initial onboarding screens (#58)
clovisdasilvaneto Dec 17, 2024
0107aa7
Merge remote-tracking branch 'mobile-app/reorganised-history' into mo…
compojoom Dec 20, 2024
5e835f6
fix: tsc failing in web package
compojoom Dec 20, 2024
3b198da
fix: workflow names were not easily distinguishable
compojoom Dec 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/actions/build-storybook/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ runs:
steps:
- name: Build Storybook
shell: bash
run: yarn build-storybook -o ./out/storybook
run: yarn workspace @safe-global/web build-storybook -o ./out/storybook
2 changes: 1 addition & 1 deletion .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ runs:

- name: Build
shell: bash
run: yarn build
run: yarn workspace @safe-global/web build
env:
NEXT_PUBLIC_IS_PRODUCTION: ${{ inputs.prod }}
NEXT_PUBLIC_CYPRESS_MNEMONIC: ${{ inputs.e2e_mnemonic }}
Expand Down
12 changes: 6 additions & 6 deletions .github/actions/cache-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ runs:
**/node_modules
/home/runner/.cache/Cypress
${{ github.workspace }}/.yarn/install-state.gz
${{ github.workspace }}/src/types
${{ github.workspace }}/apps/web/src/types
key: ${{ runner.os }}-web-core-modules-${{ hashFiles('**/package.json','**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-web-core-modules-
Expand All @@ -54,7 +54,7 @@ runs:
**/node_modules
/home/runner/.cache/Cypress
${{ github.workspace }}/.yarn/install-state.gz
${{ github.workspace }}/src/types
${{ github.workspace }}/apps/web/src/types
key: ${{inputs.key}}

- name: Restore Next.js
Expand All @@ -63,10 +63,10 @@ runs:
uses: actions/cache/restore@v4
with:
path: |
${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-nextjs-cypress-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
${{ github.workspace }}/apps/web/.next/cache
key: ${{ runner.os }}-nextjs-cypress-${{ hashFiles('apps/web/package.json', 'apps/web/yarn.lock') }}-${{ hashFiles('apps/web/src/**/*', 'apps/web/public/**/*', 'apps/web/*.{js,jsx,cjs,ts,mjs,tsx,json} ') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-
${{ runner.os }}-nextjs-${{ hashFiles('apps/web/package.json', 'apps/web/yarn.lock') }}-

- name: Set composite outputs nc
if: ${{ inputs.mode == 'restore-nc' }}
Expand All @@ -81,5 +81,5 @@ runs:
uses: actions/cache/save@v4
with:
path: |
${{ github.workspace }}/.next/cache
${{ github.workspace }}/apps/web/.next/cache
key: ${{inputs.key}}
3 changes: 2 additions & 1 deletion .github/actions/cypress/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ runs:
tag: ${{ inputs.tag }}
config: baseUrl=http://localhost:8080
install: false
start: yarn serve
start: yarn workspace @safe-global/web serve
working-directory: apps/web
env:
CYPRESS_RECORD_KEY: ${{ inputs.record_key || fromJSON(inputs.secrets).CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ fromJSON(inputs.secrets).GITHUB_TOKEN }}
Expand Down
9 changes: 7 additions & 2 deletions .github/actions/yarn/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,17 @@ runs:
run: |
echo "Yarn cache hit: ${{ steps.restore-yarn-types.outputs.cache-hit-yarn }}"

- name: Yarn install & after-install generate types
- name: Yarn install
if: steps.restore-yarn-types.outputs.cache-hit-yarn != 'true'
shell: bash
run: |
yarn install --immutable
yarn after-install

- name: Yarn after-install to generate contracts types
if: steps.restore-yarn-types.outputs.cache-hit-yarn != 'true'
shell: bash
run: |
yarn workspace @safe-global/web after-install

- name: Save Yarn Cache & Types
if: steps.restore-yarn-types.outputs.cache-hit-yarn != 'true'
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/mobile-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Run Lint

on:
push:
branches:
- main
paths:
- apps/mobile/**
- packages/store/**
pull_request:
paths:
- apps/mobile/**
- packages/store/**

jobs:
lint:
runs-on: ubuntu-latest

steps:
# Checkout the code
- name: Checkout code
uses: actions/checkout@v4

- name: Enable Corepack
run: corepack enable

# Set up Node.js
- uses: actions/setup-node@v4
with:
node-version: '22.11.0' # jod
cache: 'yarn'

# Install dependencies
- name: Install dependencies
run: yarn install --immutable

# Run tests with coverage
- name: Run lint
run: |
yarn workspace @safe-global/mobile run lint
45 changes: 45 additions & 0 deletions .github/workflows/mobile-unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Run Tests and Coverage

on:
push:
branches:
- main
paths:
- apps/mobile/**
pull_request:
paths:
- apps/mobile/**

jobs:
test-and-coverage:
runs-on: ubuntu-latest

steps:
# Checkout the code
- name: Checkout code
uses: actions/checkout@v4

- name: Enable Corepack
run: corepack enable

# Set up Node.js
- uses: actions/setup-node@v4
with:
node-version: '22.11.0' # jod
cache: 'yarn'

# Install dependencies
- name: Install dependencies
run: yarn install --immutable

# Run tests with coverage
- name: Run Jest tests with coverage
run: |
yarn workspace @safe-global/mobile test:coverage --coverageReporters=text --coverageReporters=json-summary | tee ./coverage.txt && exit ${PIPESTATUS[0]}

- name: Jest Coverage Comment
uses: MishaKav/jest-coverage-comment@v1
with:
coverage-summary-path: ./coverage/coverage-summary.json
coverage-title: Coverage
coverage-path: ./coverage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
branches:
- dev
- main
paths:
- apps/web/**

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -56,14 +58,18 @@ jobs:
if: startsWith(github.ref, 'refs/heads/main')
env:
BUCKET: s3://${{ secrets.AWS_STAGING_BUCKET_NAME }}/current
run: bash ./scripts/github/s3_upload.sh
run: |
cd ./apps/web
bash ./scripts/github/s3_upload.sh

# Dev
- name: Deploy to the dev S3
if: startsWith(github.ref, 'refs/heads/dev')
env:
BUCKET: s3://${{ secrets.AWS_DEVELOPMENT_BUCKET_NAME }}
run: bash ./scripts/github/s3_upload.sh
run: |
cd ./apps/web
bash ./scripts/github/s3_upload.sh

### PRs ###

Expand All @@ -80,7 +86,9 @@ jobs:
if: github.event.number
env:
BUCKET: s3://${{ secrets.AWS_REVIEW_BUCKET_NAME }}/walletweb/${{ steps.extract_branch.outputs.branch }}
run: bash ./scripts/github/s3_upload.sh
run: |
cd ./apps/web
bash ./scripts/github/s3_upload.sh

# Comment
- name: Post a deployment link in the PR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
branches:
- main
- dev
paths:
- apps/web/**
release:
types: [ released ]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Safe Apps e2e

on:
pull_request:
paths:
- apps/web/**
workflow_dispatch:

concurrency:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Smoke tests

on:
pull_request:

paths:
- apps/web/**
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/lint.yml → .github/workflows/web-lint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Lint
on: [pull_request]
on:
pull_request:
paths:
- apps/web/**

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -24,5 +27,5 @@ jobs:
fail-check: true # optional
github-token: ${{ secrets.GITHUB_TOKEN }} # optional
directory: './' # optional
targets: 'src' # optional
config-path: './eslint.config.mjs'
targets: '/apps/web/src' # optional
config-path: './apps/web/eslint.config.mjs'
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ name: 'Next.js Bundle Analysis'

on:
pull_request:
paths:
- apps/web/**
push:
branches:
- dev

paths:
- apps/web/**
permissions:
contents: read # for checkout repository
actions: read # for fetching base branch bundle stats
Expand All @@ -29,29 +32,36 @@ jobs:
secrets: ${{ toJSON(secrets) }}

- name: Analyze bundle
run: npx -p nextjs-bundle-analysis report
run: |
cd apps/web
npx -p nextjs-bundle-analysis report

- name: Upload bundle
uses: actions/upload-artifact@v4
with:
name: bundle
path: .next/analyze/__bundle_analysis.json
path: apps/web/.next/analyze/__bundle_analysis.json

- name: Download base branch bundle stats
if: success() && github.event.number
run: bash ./scripts/github/download_bundle_analyser_artifact.sh
run: |
cd apps/web
bash ./scripts/github/download_bundle_analyser_artifact.sh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Compare with base branch bundle
if: success() && github.event.number
run: ls -laR .next/analyze/base && npx -p nextjs-bundle-analysis compare
run: |
cd apps/web
ls -laR .next/analyze/base && npx -p nextjs-bundle-analysis compare

- name: Get Comment Body
id: get-comment-body
if: success() && github.event.number
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
run: |
cd apps/web
echo "body<<EOF" >> $GITHUB_OUTPUT
echo "$(cat .next/analyze/__bundle_analysis_comment.txt)" >> $GITHUB_OUTPUT
echo EOF >> $GITHUB_OUTPUT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
branches:
- main
types: [closed]
paths:
- apps/web/**

jobs:
tag-release:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: Unit tests
on:
pull_request:
paths:
- apps/web/**

push:
branches:
- main

paths:
- apps/web/**
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -30,6 +33,7 @@ jobs:
annotations: failed-tests
package-manager: yarn
test-script: yarn test:ci
working-directory: apps/web
github-token: ${{ secrets.GITHUB_TOKEN }}
env:
NEXT_PUBLIC_IS_OFFICIAL_HOST: true
Loading
Loading