Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.github
.husky
.vscode/
dist/
node_modules/
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
root = true

[*]
charset=utf-8
end_of_line=lf
insert_final_newline=true
indent_style=space
indent_size=2
max_line_length = 100

[*.{yml,yaml,json}]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
23 changes: 23 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
*.sh
node_modules
*.lock
**/*.svg
**/*.md
**/*.svg
**/*.ejs
**/*.html
**/*.png
**/*.toml
**/*.md
.vscode
.idea
dist
/public
/docs
.husky
.local
/bin
Dockerfile
pnpm-lock.yaml
tsconfig.node.json
/src/_mock
140 changes: 140 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
module.exports = {
root: true,
env: { browser: true, es2020: true, node: true },

parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.eslint.json',
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
extraFileExtensions: ['.json'],
},
settings: {
'import/resolver': {
alias: {
map: [
['@', './src'],
['#', './types'],
['msw/browser', './node_modules/msw/browser']
],
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
},
},
},

extends: [
'airbnb',
'airbnb-typescript',
'airbnb/hooks',
'plugin:@typescript-eslint/recommended',
'plugin:jsx-a11y/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'prettier',
'plugin:prettier/recommended',
],

plugins: [
'@typescript-eslint',
'prettier',
'react',
'react-hooks',
'jsx-a11y',
'import',
'unused-imports',
],

rules: {
semi: ['error', 'always'],
'no-console': 'off',
'no-unused-vars': 'off',
'no-case-declarations': 'off',
'no-use-before-define': 'off',
'no-param-reassign': 'off',
'space-before-function-paren': 'off',
'class-methods-use-this': 'off',

'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/interactive-supports-focus': 'off',
'jsx-a11y/no-noninteractive-element-interactions': 'off',
'jsx-a11y/no-static-element-interactions': 'off',

'react/react-in-jsx-scope': 'off',
'react/button-has-type': 'off',
'react/require-default-props': 'off',
'react/no-array-index-key': 'off',
'react/jsx-props-no-spreading': 'off',

'import/first': 'warn',
'import/newline-after-import': 'warn',
'import/no-duplicates': 'warn',
'import/no-extraneous-dependencies': 'off',
'import/prefer-default-export': 'off',
'import/no-cycle': 'off',
'import/order': [
'warn',
{
groups: [
'builtin',
'external',
'internal',
'parent',
['sibling', 'index'],
'object',
'type',
],
pathGroups: [
{
pattern: '@/**',
group: 'internal',
},
{
pattern: '#/**',
group: 'type',
},
{
pattern: '*.{scss,css,less,styl,stylus}',
group: 'parent',
},
{
pattern: '*.{js,jsx,ts,tsx}',
group: 'sibling',
},
],
'newlines-between': 'always',
pathGroupsExcludedImportTypes: ['sibling', 'index'],
warnOnUnassignedImports: true,
alphabetize: { order: 'asc', caseInsensitive: true },
},
],

'unused-imports/no-unused-imports-ts': 'warn',
'unused-imports/no-unused-vars-ts': [
'warn',
{ vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' },
],

'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-shadow': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
},
};
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: 👾 Bug Report
about: Report a bug or issue with the project.
title: ''
labels: 'bug'
assignees: ''

---

### Description
A clear and concise description of what the bug is.

### Steps To Reproduce
1. Log in...
2. Ensure that...
3. Allow a long period of inactivity to pass...
4. Observe that...
5. Attempt to log in...

### Current Behavior
- After the period of inactivity...
- When the user tries to log in using another method...
- This causes a bug due to...

### Expected Behavior
- After a long period of inactivity...
- When a user logs in successfully...
- This ensures that only...

### Environment
- Platform: PC
- Node: v18.18.0
- Browser: Chrome 126.0.6478.56
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
blank_issues_enabled: false
issue_template:
- name: 👾 Bug Report
description: Report a bug or issue with the project.
labels: ["bug"]
template: bug_report.md
- name: 💡 Feature Request
description: Create a new ticket for a new feature request.
labels: ["enhancement"]
template: feature_request.md
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: 💡 Feature Request
about: Create a new ticket for a new feature request
title: ''
labels: 'enhancement'
assignees: ''

---

### Expected Behavior
Describe the expected behavior here.

### Specifications
As a `user`, I would like to `action` so that `reason`.

**Features:**
- describe feature details here.

**Development Tasks:**
- [ ] Task 1
- [ ] Task 2

### Dependencies
List any dependencies that are required for this feature by providing links to the issues or repositories.

### References
List any references that are related to this feature request.
54 changes: 54 additions & 0 deletions .github/workflows/deploy-tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build and Deploy Production

on:
push:
tags:
- 'v*.*.*'

jobs:
build-and-push-image:
runs-on: aelfscan-runner
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create image tag
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.REPOSITORY_REGION }}-docker.pkg.dev/${{ secrets.PROJECT_ID }}/${{ secrets.REPOSITORY }}/aelfscan-advertising-web
tags: |
type=ref,event=tag
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
dispatch:
runs-on: aelfscan-runner
needs: build-and-push-image
steps:
- name: Deploy
uses: actions/github-script@v6
with:
github-token: ${{ secrets.TOK }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'AelfScanProject',
repo: 'devops',
workflow_id: 'aelf-explorer-server-deploy.yaml',
ref: 'main',
inputs: {
env: 'production',
appName: 'aelfscan-advertising-web',
commit_sha: '${{ github.ref_name }}',
}
})
61 changes: 61 additions & 0 deletions .github/workflows/deploy-testnet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build and Deploy Testnet

on:
push:
branches:
- 'release/*'

jobs:
build-and-push-image:
runs-on: aelfscan-runner
permissions:
contents: read
outputs:
short_sha: ${{ steps.vars.outputs.short_sha }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set short git commit SHA
id: vars
run: |
calculatedSha=$(git rev-parse --short ${{ github.sha }})
echo "short_sha=$calculatedSha" >> "$GITHUB_OUTPUT"
- name: Create image tag
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.REPOSITORY_REGION }}-docker.pkg.dev/${{ secrets.PROJECT_ID }}/${{ secrets.REPOSITORY }}/aelfscan-advertising-web
tags: |
type=sha
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
dispatch:
runs-on: aelfscan-runner
needs: build-and-push-image
steps:
- name: Deploy
uses: actions/github-script@v6
with:
github-token: ${{ secrets.TOK }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'AelfScanProject',
repo: 'devops',
workflow_id: 'aelf-explorer-server-deploy.yaml',
ref: 'main',
inputs: {
env: 'testnet',
appName: 'aelfscan-advertising-web',
commit_sha: 'sha-${{ needs.build-and-push-image.outputs.short_sha }}',
}
})
Loading
Loading