Skip to content

Commit

Permalink
Merge pull request #2991 from thematters/develop
Browse files Browse the repository at this point in the history
Release: v4.13.0
  • Loading branch information
gary02 authored Dec 19, 2022
2 parents 7835d3e + 1eb1d70 commit 2fd6b25
Show file tree
Hide file tree
Showing 237 changed files with 41,391 additions and 58,419 deletions.
6 changes: 6 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ NEXT_PUBLIC_LOGBOOKS_URL=https://logbooks-vercel.matters.news
NEXT_PUBLIC_ALCHEMY_KEY=1dMo8xjAFo8M6Y4sQ45WTD3Zie2-MA4C
NEXT_PUBLIC_USDT_CONTRACT_ADDRESS=0xfe4F5145f6e09952a5ba9e956ED0C25e3Fa4c7F1
NEXT_PUBLIC_CURATION_CONTRACT_ADDRESS=0xa219c6722008aa22828b31a13ab9ba93bb91222c
PLAYWRIGHT_RUNTIME_ENV=local
PLAYWRIGHT_TEST_BASE_URL=https://web-develop.matters.news
PLAYWRIGHT_AUTH_EMAIL_ALICE=
PLAYWRIGHT_AUTH_PWD_ALICE=
PLAYWRIGHT_AUTH_EMAIL_BOB=
PLAYWRIGHT_AUTH_PWD_BOB=
16 changes: 8 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ jobs:
uses: actions/checkout@master

- name: Setup Node.js
uses: actions/setup-node@v2.5.0
uses: actions/setup-node@v3
with:
node-version: '16.14'
cache: 'npm'

- name: Cache Dependencies
id: cache
uses: actions/[email protected]
- name: Cache NPM dependencies
uses: actions/cache@v3
id: node_modules_cache
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
path: node_modules
key: ${{ runner.os }}-npm-v3-${{ hashFiles('package-lock.json') }}

- name: Install Dependencies
if: steps.node_modules_cache.outputs.cache-hit != 'true'
run: npm ci --legacy-peer-deps

- name: Generate Types (develop)
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ jobs:
uses: actions/checkout@master

- name: Setup Node.js
uses: actions/setup-node@v2.5.0
uses: actions/setup-node@v3
with:
node-version: '16.14'
cache: 'npm'

- name: Cache Dependencies
id: cache
uses: actions/[email protected]
- name: Cache NPM dependencies
uses: actions/cache@v3
id: node_modules_cache
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
path: node_modules
key: ${{ runner.os }}-npm-v3-${{ hashFiles('package-lock.json') }}

- name: Install Dependencies
run: npm ci
if: steps.node_modules_cache.outputs.cache-hit != 'true'
run: npm ci --legacy-peer-deps

- name: Generate Types
if: github.base_ref == 'develop'
Expand Down
68 changes: 0 additions & 68 deletions .github/workflows/test.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/test_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Test Build

on: push

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16.14'
cache: 'npm'

- name: Cache NPM dependencies
uses: actions/cache@v3
id: node_modules_cache
with:
path: node_modules
key: ${{ runner.os }}-npm-v3-${{ hashFiles('package-lock.json') }}

- name: Install Dependencies
if: steps.node_modules_cache.outputs.cache-hit != 'true'
run: npm ci --legacy-peer-deps

- name: Generate Types (Develop)
if: github.base_ref != 'master'
run: |
npm run gen:clean \
&& npm run gen:type
- name: Generate Types (production)
if: github.base_ref == 'master'
run: |
npm run gen:clean \
&& npm run gen:type:prod
- name: Lint
run: |
npm run lint \
&& npm run format:check
- name: Build
run: cp .env.dev .env && npm run build
75 changes: 75 additions & 0 deletions .github/workflows/test_e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Test E2E

on: push

env:
PLAYWRIGHT_TEST_BASE_URL: 'https://web-develop.matters.news'
PLAYWRIGHT_RUNTIME_ENV: 'ci'
PLAYWRIGHT_AUTH_EMAIL_ALICE: ${{ secrets.PLAYWRIGHT_AUTH_EMAIL_ALICE }}
PLAYWRIGHT_AUTH_PWD_ALICE: ${{ secrets.PLAYWRIGHT_AUTH_PWD_ALICE }}
PLAYWRIGHT_AUTH_EMAIL_BOB: ${{ secrets.PLAYWRIGHT_AUTH_EMAIL_BOB }}
PLAYWRIGHT_AUTH_PWD_BOB: ${{ secrets.PLAYWRIGHT_AUTH_PWD_BOB }}

jobs:
e2e:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16.14'
cache: 'npm'

- name: Cache NPM dependencies
uses: actions/cache@v3
id: node_modules_cache
with:
path: node_modules
key: ${{ runner.os }}-npm-v3-${{ hashFiles('package-lock.json') }}

- name: Install Dependencies
if: steps.node_modules_cache.outputs.cache-hit != 'true'
run: npm ci --legacy-peer-deps

- name: Get installed Playwright version
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').dependencies['@playwright/test'].version)")" >> $GITHUB_ENV

- name: Cache playwright binaries
uses: actions/cache@v3
id: playwright_cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}

- name: Install Playwright Browsers
run: npm run test:prepare
if: steps.playwright_cache.outputs.cache-hit != 'true'

- name: Generate Types (Develop)
if: github.base_ref != 'master'
run: |
npm run gen:clean \
&& npm run gen:type
- name: Generate Types (production)
if: github.base_ref == 'master'
run: |
npm run gen:clean \
&& npm run gen:type:prod
- name: Run Playwright tests
run: npm run test

- name: Output Playwright tests
uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
49 changes: 10 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# matters-web

![Deployment Status](https://github.com/thematters/matters-web/workflows/Deployment/badge.svg) ![Test Status](https://github.com/thematters/matters-web/workflows/Test/badge.svg) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
![Deployment Status](https://github.com/thematters/matters-web/workflows/Deployment/badge.svg) ![Build Status](https://github.com/thematters/matters-web/workflows/Test%20Build/badge.svg) ![Test Status](https://github.com/thematters/matters-web/workflows/Test%20E2E/badge.svg) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

## Getting Started

Expand Down Expand Up @@ -44,7 +44,15 @@
- `docker pull 903380195283.dkr.ecr.ap-southeast-1.amazonaws.com/matters-web:latest`
- `docker tag 903380195283.dkr.ecr.ap-southeast-1.amazonaws.com/matters-web:latest matters-web:latest`

## Static File
## Testing

See [Playwright Testing Guide](https://www.notion.so/matterslab/Playwright-Testing-Guide-60caa248d5ce4d70938b7b2f2c7e9139).

## Conventions

See [Conventions](https://www.notion.so/matterslab/Conventions-acbed6763f6746319396978c19340d78).

## Static Files

```bash
./public/static/
Expand All @@ -55,18 +63,6 @@
│   ├── 12px
│   │   ├── ...
│   │   └── draft-edit.svg
│   ├── 16px
│   │   ├── ...
│   │   └── world.svg
│   ├── 24px
│   │   ├── ...
│   │   └── wallet.svg
│   ├── 32px
│   │   ├── ...
│   │   └── warning.svg
│   ├── 40px
│   │   ├── ...
│   │   └── share-whatsapp-circle.svg
│   ├── 72px
│   │   ├── ...
│   │   └── empty-warning.svg
Expand All @@ -87,31 +83,6 @@ We use [SVGR](https://react-svgr.com/) to transform SVGs into React components.
- Add `fill="none"` to `<svg>`.
- If the icon is resuable, create a component file under `components/Icon` and export it from `components/Icon/index.tsx`.

## Conventions

[Matters Design System](https://paper.dropbox.com/doc/Matters-Design-System--AXX9x2tuPldQFCWTN0Mt~_itAQ-klFuV5yv3ZlqpqHL0w0kU)

[Matters 3.0: Design System](https://paper.dropbox.com/doc/Matters-3.0-Design-System--AqXF9GXfYqC18yjAQzN5l02BAg-Sp6ANp5EXAdnzSK3adqNS)

### Naming

#### React Component/Page

foldername: `PascalCase`

filename: `camelCase`

```tree
├── pages
│ └── ArticleDetail
│ ├── styles.css
│ └── index.tsx
└── components
└── Layout
├── styles.css
└── index.tsx
```

## Tools

### VS Code
Expand Down
5 changes: 0 additions & 5 deletions jest.setup.js

This file was deleted.

Loading

0 comments on commit 2fd6b25

Please sign in to comment.