Skip to content

Commit

Permalink
Merge tag 'v1.36.4' into feature/staging-rollout12-v1.36.4
Browse files Browse the repository at this point in the history
  • Loading branch information
DenSmolonski committed Jun 12, 2024
2 parents ae21ffb + 5dd3246 commit 44794a4
Show file tree
Hide file tree
Showing 465 changed files with 17,298 additions and 5,584 deletions.
25 changes: 21 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{
"extends": ["next", "prettier", "plugin:prettier/recommended"],
"extends": [
"next",
"prettier",
"plugin:prettier/recommended",
"plugin:storybook/recommended"
],
"parser": "@typescript-eslint/parser",
"rules": {
"@next/next/no-img-element": "off",
"@next/next/google-font-display": "off",
Expand All @@ -14,8 +20,19 @@
"additionalHooks": "useAsync"
}
],
"no-only-tests/no-only-tests": "error"
"no-only-tests/no-only-tests": "error",
"object-shorthand": ["error", "properties"],
"jsx-quotes": ["error", "prefer-double"],
"react/jsx-curly-brace-presence": ["error", { "props": "never", "children": "never" }]
},
"ignorePatterns": ["node_modules/", ".next/", ".github/"],
"plugins": ["unused-imports", "@typescript-eslint", "no-only-tests"]
"ignorePatterns": [
"node_modules/",
".next/",
".github/"
],
"plugins": [
"unused-imports",
"@typescript-eslint",
"no-only-tests"
]
}
14 changes: 14 additions & 0 deletions .github/workflows/build-storybook/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: 'Build Storybook'

description: 'Build the storybook'

inputs:
secrets:
required: true

runs:
using: 'composite'
steps:
- name: Build Storybook
shell: bash
run: yarn build-storybook -o ./out/storybook
1 change: 1 addition & 0 deletions .github/workflows/cypress/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ runs:
CYPRESS_RECORD_KEY: ${{ inputs.record_key || fromJSON(inputs.secrets).CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ fromJSON(inputs.secrets).GITHUB_TOKEN }}
CYPRESS_PROJECT_ID: ${{ inputs.project_id }}
CYPRESS_WALLET_CREDENTIALS: ${{ fromJSON(inputs.secrets).CYPRESS_WALLET_CREDENTIALS }}
18 changes: 12 additions & 6 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
pull-requests: write
id-token: write

name: Deploy to dev/staging

Expand All @@ -33,7 +34,7 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]'

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: ./.github/workflows/yarn

Expand All @@ -42,12 +43,13 @@ jobs:
secrets: ${{ toJSON(secrets) }}
prod: ${{ github.ref == 'refs/heads/main' }}

- uses: ./.github/workflows/build-storybook

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
role-to-assume: ${{ secrets.AWS_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}

# Staging
- name: Deploy to the staging S3
Expand Down Expand Up @@ -90,7 +92,11 @@ jobs:
## Branch preview
✅ Deploy successful!
https://${{ steps.extract_branch.outputs.branch }}--walletweb.review-wallet-web.5afe.dev/home?safe=eth:0xA77DE01e157f9f57C7c4A326eeE9C4874D0598b6
**Website:**
https://${{ steps.extract_branch.outputs.branch }}--walletweb.review.5afe.dev/home?safe=eth:0xA77DE01e157f9f57C7c4A326eeE9C4874D0598b6
**Storybook:**
https://${{ steps.extract_branch.outputs.branch }}--walletweb.review.5afe.dev/storybook/
message-failure: |
## Branch preview
❌ Deploy failed!
47 changes: 25 additions & 22 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ on:

jobs:
release:
permissions:
id-token: write

runs-on: ubuntu-latest
name: Deploy release
env:
ARCHIVE_NAME: ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: ./.github/workflows/yarn

Expand All @@ -26,6 +29,27 @@ jobs:
- name: Create checksum
run: sha256sum "$ARCHIVE_NAME".tar.gz > ${{ env.ARCHIVE_NAME }}-sha256-checksum.txt

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_ROLE }}
aws-region: ${{ secrets.AWS_REGION }}

# Script to upload release files
- name: 'Upload release build files for production'
env:
BUCKET: s3://${{ secrets.AWS_STAGING_BUCKET_NAME }}/releases/${{ github.event.release.tag_name }}
CHECKSUM_FILE: ${{ env.ARCHIVE_NAME }}-sha256-checksum.txt
run: bash ./scripts/github/s3_upload.sh

# Script to prepare production deployments
- run: bash ./scripts/github/prepare_production_deployment.sh
env:
PROD_DEPLOYMENT_HOOK_TOKEN: ${{ secrets.PROD_DEPLOYMENT_HOOK_TOKEN }}
PROD_DEPLOYMENT_HOOK_URL: ${{ secrets.PROD_DEPLOYMENT_HOOK_URL }}
VERSION_TAG: ${{ github.event.release.tag_name }}

# Update the GitHub release with a checksummed archive
- name: Upload archive
uses: actions/upload-release-asset@v1
with:
Expand All @@ -45,24 +69,3 @@ jobs:
asset_content_type: text/plain
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}

# Script to upload release files
- name: 'Upload release build files for production'
env:
BUCKET: s3://${{ secrets.AWS_STAGING_BUCKET_NAME }}/releases/${{ github.event.release.tag_name }}
CHECKSUM_FILE: ${{ env.ARCHIVE_NAME }}-sha256-checksum.txt
run: bash ./scripts/github/s3_upload.sh

# Script to prepare production deployments
- run: bash ./scripts/github/prepare_production_deployment.sh
env:
PROD_DEPLOYMENT_HOOK_TOKEN: ${{ secrets.PROD_DEPLOYMENT_HOOK_TOKEN }}
PROD_DEPLOYMENT_HOOK_URL: ${{ secrets.PROD_DEPLOYMENT_HOOK_URL }}
VERSION_TAG: ${{ github.event.release.tag_name }}
2 changes: 1 addition & 1 deletion .github/workflows/e2e-hp-ondemand.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
matrix:
containers: [1, 2, 3]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: ./.github/workflows/cypress
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-ondemand.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
matrix:
containers: [1, 2, 3, 4, 5]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: ./.github/workflows/cypress
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
matrix:
containers: [1, 2, 3]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: ./.github/workflows/cypress
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-safe-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
matrix:
containers: [1, 2]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: ./.github/workflows/cypress
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
containers: [1, 2, 3, 4, 5]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: ./.github/workflows/cypress
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Lint'
name: Lint
on: [pull_request]

concurrency:
Expand All @@ -9,7 +9,7 @@ jobs:
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: ./.github/workflows/yarn

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/nextjs-bundle-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install dependencies
uses: ./.github/workflows/yarn
Expand All @@ -42,7 +42,6 @@ jobs:
run: 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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: ./.github/workflows/yarn

Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,6 @@ yalc.lock
/public/workbox-*.js
/public/workbox-*.js.map
/public/fallback*
/public/*.js.LICENSE.txt
/public/*.js.LICENSE.txt
certificates
*storybook.log
79 changes: 79 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import type { StorybookConfig } from '@storybook/nextjs'

const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
'@storybook/addon-onboarding',
'@storybook/addon-links',
'@storybook/addon-essentials',
'@chromatic-com/storybook',
'@storybook/addon-interactions',
'@storybook/addon-themes',
'@storybook/addon-designs'
],
framework: {
name: '@storybook/nextjs',
options: {},
},
webpackFinal: async (config) => {
config.module = config.module || {};
config.module.rules = config.module.rules || [];

// This modifies the existing image rule to exclude .svg files
// since you want to handle those files with @svgr/webpack
const imageRule = config.module.rules.find((rule) => rule?.['test']?.test('.svg'));
if (imageRule) {
imageRule['exclude'] = /\.svg$/;
}

config.module.rules.push({
test: /\.svg$/i,
issuer: { and: [/\.(js|ts|md)x?$/] },
use: [
{
loader: '@svgr/webpack',
options: {
prettier: false,
svgo: false,
svgoConfig: {
plugins: [
{
name: 'preset-default',
params: {
overrides: { removeViewBox: false },
},
},
],
},
titleProp: true,
},
},
],
})

return config;
},
docs: {
autodocs: 'tag',
},
staticDirs: ['../public'],

typescript: {
reactDocgen: 'react-docgen-typescript',
reactDocgenTypescriptOptions: {
// Speeds up Storybook build time
compilerOptions: {
allowSyntheticDefaultImports: false,
esModuleInterop: false,
},
// Makes union prop types like variant and size appear as select controls
shouldExtractLiteralValuesFromEnum: true,
// Makes string and boolean types that can be undefined appear as inputs and switches
shouldRemoveUndefinedFromOptional: true,
// Filter out third-party props from node_modules except @mui packages
propFilter: (prop) =>
prop.parent ? !/node_modules\/(?!@mui)/.test(prop.parent.fileName) : true,
},
},
}
export default config
32 changes: 32 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import type { Preview } from '@storybook/react'

import { ThemeProvider, CssBaseline } from '@mui/material'
import { withThemeFromJSXProvider } from '@storybook/addon-themes'
import createSafeTheme from '../src/components/theme/safeTheme'

import '../src/styles/globals.css'

const preview: Preview = {
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},

decorators: [
withThemeFromJSXProvider({
GlobalStyles: CssBaseline,
Provider: ThemeProvider,
themes: {
light: createSafeTheme('light'),
dark: createSafeTheme('dark'),
},
defaultTheme: 'light',
}),
],
}

export default preview
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ Here's the list of all the environment variables:
| `NEXT_PUBLIC_GOOGLE_TAG_MANAGER_LATEST_AUTH` | Preview GTM key
| `NEXT_PUBLIC_GOOGLE_TAG_MANAGER_LIVE_AUTH` | Production GTM key
| `NEXT_PUBLIC_SENTRY_DSN` | [Sentry](https://sentry.io) id for tracking runtime errors
| `NEXT_PUBLIC_SAFE_GELATO_RELAY_SERVICE_URL_PRODUCTION` | [Safe Gelato Relay Service](https://github.com/safe-global/safe-gelato-relay-service) URL to allow relaying transactions via Gelato
| `NEXT_PUBLIC_SAFE_GELATO_RELAY_SERVICE_URL_STAGING` | Relay URL on staging
| `NEXT_PUBLIC_IS_OFFICIAL_HOST` | Whether it's the official distribution of the app, or a fork; has legal implications. Set to true only if you also update the legal pages like Imprint and Terms of use
| `NEXT_PUBLIC_REDEFINE_API` | Redefine API base URL
| `NEXT_PUBLIC_FIREBASE_OPTIONS_PRODUCTION` | Firebase Cloud Messaging (FCM) `initializeApp` options on production
Expand Down
Loading

0 comments on commit 44794a4

Please sign in to comment.