Skip to content

Commit 5b15ca0

Browse files
authored
feat!: alpha version (#126)
1 parent ed38ae4 commit 5b15ca0

File tree

166 files changed

+8075
-1637
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+8075
-1637
lines changed

.env.development

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
REACT_APP_AUTO_CONNECT=true
2-
# 10 seconds
3-
REACT_APP_POLL_BLOCK_NUMBER_INTERVAL=10000
1+
REACT_APP_AUTO_CONNECT=false
2+
# 20 seconds
3+
REACT_APP_POLL_BLOCK_NUMBER_INTERVAL=20000
44
# goerli testnet
55
REACT_APP_SUPPORTED_CHAIN_IDS=5
6+
REACT_APP_STARKNET_CONTRACT_ADDRESS=0xde29d060D45901Fb19ED6C6e959EB22d8626708e
7+
REACT_APP_ETHERSCAN_URL=https://goerli.etherscan.io
8+
REACT_APP_VOYAGER_URL=https://goerli.voyager.online
9+
REACT_APP_LOCAL_STORAGE_TRANSFERS_LOG_KEY=STARKGATE_TRANSFERS
10+
REACT_APP_LOCAL_STORAGE_ONBOARDING_TIMESTAMP_KEY=STARKGATE_ONBOARDING_TIMESTAMP
11+
REACT_APP_ONBOARDING_MODAL_TIMEOUT_HRS=24
12+
REACT_APP_SUPPORTED_TOKENS=ETH,WBTC,USDC,USDT,DAI,SLF

.env.production

+12-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
REACT_APP_AUTO_CONNECT=true
2-
# 30 seconds
3-
REACT_APP_POLL_BLOCK_NUMBER_INTERVAL=30000
4-
# mainnet
5-
REACT_APP_SUPPORTED_CHAIN_IDS=1
1+
REACT_APP_AUTO_CONNECT=false
2+
# 30 seconds
3+
REACT_APP_POLL_BLOCK_NUMBER_INTERVAL=30000
4+
# mainnet
5+
REACT_APP_SUPPORTED_CHAIN_IDS=1
6+
REACT_APP_STARKNET_CONTRACT_ADDRESS=
7+
REACT_APP_ETHERSCAN_URL=https://etherscan.io
8+
REACT_APP_VOYAGER_URL=https://voyager.online
9+
REACT_APP_LOCAL_STORAGE_TRANSFERS_LOG_KEY=STARKGATE_TRANSFERS
10+
REACT_APP_LOCAL_STORAGE_ONBOARDING_TIMESTAMP_KEY=STARKGATE_ONBOARDING_TIMESTAMP
11+
REACT_APP_ONBOARDING_MODAL_TIMEOUT_HRS=24
12+
REACT_APP_SUPPORTED_TOKENS=ETH

.env.testing

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
REACT_APP_AUTO_CONNECT=true
2-
# 20 seconds
3-
REACT_APP_POLL_BLOCK_NUMBER_INTERVAL=20000
4-
# goerli testnet
5-
REACT_APP_SUPPORTED_CHAIN_IDS=5
1+
REACT_APP_AUTO_CONNECT=false
2+
# 20 seconds
3+
REACT_APP_POLL_BLOCK_NUMBER_INTERVAL=20000
4+
# goerli testnet
5+
REACT_APP_SUPPORTED_CHAIN_IDS=5
6+
REACT_APP_STARKNET_CONTRACT_ADDRESS=0xde29d060D45901Fb19ED6C6e959EB22d8626708e
7+
REACT_APP_ETHERSCAN_URL=https://goerli.etherscan.io
8+
REACT_APP_VOYAGER_URL=https://goerli.voyager.online
9+
REACT_APP_LOCAL_STORAGE_TRANSFERS_LOG_KEY=STARKGATE_TRANSFERS
10+
REACT_APP_SUPPORTED_TOKENS=ETH

.eslintrc.js

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
node: true,
6+
amd: true,
7+
es6: true,
8+
es2020: true,
9+
jquery: false
10+
},
11+
extends: [
12+
'eslint:recommended',
13+
'react-app',
14+
'plugin:react/recommended',
15+
'plugin:react-hooks/recommended',
16+
'plugin:jsx-a11y/recommended'
17+
],
18+
parser: '@babel/eslint-parser',
19+
parserOptions: {
20+
babelOptions: {
21+
presets: ['@babel/preset-react']
22+
},
23+
requireConfigFile: false,
24+
sourceType: 'module'
25+
},
26+
plugins: ['@babel', 'import', 'react', 'react-hooks', 'jest', 'jsx-a11y', 'prettier'],
27+
settings: {
28+
'import/core-modules': [],
29+
'import/ignore': ['node_modules', '\\.(coffee|scss|css|less|hbs|svg|json)$'],
30+
react: {
31+
pragma: 'React', // Pragma to use, default to "React"
32+
version: 'detect' // React version. "detect" automatically picks the version you have installed.
33+
},
34+
jest: {
35+
// version: require('jest/package.json').version,
36+
}
37+
},
38+
rules: {
39+
'no-confusing-arrow': ['error', {allowParens: true}],
40+
'no-console': 'warn',
41+
'no-var': 'warn',
42+
'object-shorthand': 'error',
43+
'prefer-const': 'warn',
44+
'prefer-template': 'warn',
45+
'prettier/prettier': 'error',
46+
'react/react-in-jsx-scope': 'off',
47+
'react-hooks/rules-of-hooks': 'error',
48+
'react-hooks/exhaustive-deps': 'off',
49+
quotes: ['error', 'single', {avoidEscape: true}],
50+
'comma-dangle': [
51+
'off',
52+
{
53+
arrays: 'always-multiline',
54+
objects: 'always-multiline',
55+
imports: 'always-multiline',
56+
exports: 'always-multiline',
57+
functions: 'ignore'
58+
}
59+
],
60+
'react/jsx-sort-props': [
61+
2,
62+
{
63+
callbacksLast: true,
64+
shorthandFirst: true,
65+
reservedFirst: true
66+
}
67+
],
68+
'prefer-destructuring': [
69+
'warn',
70+
{
71+
object: true,
72+
array: false
73+
}
74+
],
75+
'jsx-a11y/click-events-have-key-events': 'off',
76+
'jsx-a11y/no-static-element-interactions': 'off'
77+
}
78+
};

.eslintrc.json

-41
This file was deleted.

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ If the PR is related to an open issue please link to it.
99
- [ ] New unit / functional tests have been added (whenever applicable)
1010
- [ ] Test are passing in local environment
1111
- [ ] Docs have been updated
12-
- [ ] PR title is follow the [standard-version](https://www.conventionalcommits.org/) convention: `<type>(optional subject): <description>`, e.g: `fix: minor typos in code`
12+
- [ ] PR title is follow the [Conventional Commits](https://www.conventionalcommits.org/) convention: `<type>[optional scope]: <description>`, e.g: `fix: prevent racing of requests`
+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Push docker image to GCR reusable workflow
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
image_name:
7+
required: true
8+
type: string
9+
branch_name:
10+
required: true
11+
type: string
12+
dockerfile:
13+
required: true
14+
type: string
15+
secrets:
16+
gcp_token:
17+
required: true
18+
19+
jobs:
20+
deploy:
21+
name: Build tag and push docker images to GCR.
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Login to Gcloud using starkgate service account.
25+
uses: google-github-actions/setup-gcloud@v0
26+
with:
27+
project_id: starkware-dev
28+
service_account_email: [email protected]
29+
service_account_key: ${{ secrets.gcp_token }}
30+
31+
- name: Configure Docker
32+
run: gcloud auth configure-docker --quiet
33+
34+
- name: Checkout repository
35+
uses: actions/checkout@v2
36+
37+
- name: Build and push images to GCR, with tag latest and git tag.
38+
if: ${{ inputs.branch_name == 'refs/heads/dev' }}
39+
run: |
40+
docker build . -t ${{ inputs.image_name }} -f ${{ inputs.dockerfile }} --build-arg BUILD_ENV=testing
41+
docker tag ${{ inputs.image_name }} ${{ inputs.image_name }}:${{ github.ref_name }}
42+
docker push ${{ inputs.image_name }}:${{ github.ref_name }}
43+
docker push ${{ inputs.image_name }}
44+
45+
- name: Build with production env and push with mainnet and stable tags.
46+
if: ${{ inputs.branch_name == 'refs/heads/master' }}
47+
run: |
48+
docker build . -t ${{ inputs.image_name }}:stable -f ${{ inputs.dockerfile }} --build-arg BUILD_ENV=production
49+
docker tag ${{ inputs.image_name }}:stable ${{ inputs.image_name }}:${{ github.ref_name }}-mainnet
50+
51+
docker push ${{ inputs.image_name }}:${{ github.ref_name }}-mainnet
52+
docker push ${{ inputs.image_name }}:stable
53+
54+
- name: Build with testing env and push with goerli tag.
55+
if: ${{ inputs.branch_name == 'refs/heads/master' }}
56+
run: |
57+
docker build . -t ${{ inputs.image_name }} -f ${{ inputs.dockerfile }} --build-arg BUILD_ENV=testing
58+
docker tag ${{ inputs.image_name }} ${{ inputs.image_name }}:${{ github.ref_name }}-goerli
59+
60+
docker push ${{ inputs.image_name }}:${{ github.ref_name }}-goerli

.github/workflows/pull_request.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: Pull request workflow
22

3-
on:
4-
pull_request
3+
on: pull_request
54

65
jobs:
76
lint:

.github/workflows/push.yml

+4-19
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
release-version:
1111
name: Releasing a version
1212
runs-on: ubuntu-latest
13-
if: ${{ !contains(github.event.head_commit.message, 'chore') || (github.ref_name == 'master' && !contains(github.event.head_commit.message, 'chore(release)')) }}
13+
if: ${{ !contains(github.event.head_commit.message, 'release') || (github.ref_name == 'master' && !contains(github.event.head_commit.message, 'release')) }}
1414
steps:
1515
- uses: actions/checkout@v2
1616
with:
@@ -24,23 +24,8 @@ jobs:
2424
- name: Install node_modules
2525
run: yarn
2626

27-
- name: Authenticate with GitHub
28-
run: |
29-
git config --global user.name "${{ secrets.USER_NAME }}"
30-
git config --global user.email "${{ secrets.USER_EMAIL }}"
31-
32-
- name: Run pre-release script
33-
if: ${{ github.ref_name == 'dev' }}
34-
run: yarn run pre-release
35-
3627
- name: Run release script
37-
if: ${{ github.ref_name == 'master' }}
3828
run: yarn run release
39-
40-
- name: Push to remote branch
41-
uses: ad-m/github-push-action@master
42-
with:
43-
github_token: ${{ secrets.USER_TOKEN }}
44-
branch: ${{ github.ref }}
45-
tags: true
46-
force: true
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.USER_TOKEN }}
31+
GH_TOKEN: ${{ secrets.USER_TOKEN }}
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Docker build tag and push backend images to GCR workflow.
2+
3+
on:
4+
push:
5+
tags:
6+
- backend*
7+
8+
jobs:
9+
push-backend-image:
10+
uses: ./.github/workflows/gcr_push_workflow.yml
11+
with:
12+
image_name: us.gcr.io/starkware-dev/starknet/starkgate/backend
13+
branch_name: ${{ github.event.base_ref }}
14+
dockerfile: Dockerfile.backend
15+
secrets:
16+
gcp_token: ${{ secrets.STARKGATE_SA }}
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Docker build tag and push frontend images to GCR workflow.
2+
3+
on:
4+
push:
5+
tags:
6+
- v*.*.*
7+
8+
jobs:
9+
push-frontend-image:
10+
uses: ./.github/workflows/gcr_push_workflow.yml
11+
with:
12+
image_name: us.gcr.io/starkware-dev/starknet/starkgate/frontend
13+
branch_name: ${{ github.event.base_ref }}
14+
dockerfile: Dockerfile.frontend
15+
secrets:
16+
gcp_token: ${{ secrets.STARKGATE_SA }}

.github/workflows/tag.yml

-46
This file was deleted.

.stylelintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

0 commit comments

Comments
 (0)