-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit bd5812f
Showing
205 changed files
with
29,125 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
WALLET_CONNECT_PROJECT_ID=b7b3d81af86feb2af54461f26b665ee4 | ||
SQUID_API_URL=https://squid.subsquid.io/subsquid-network-indexer/v/v7/graphql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
.yarn | ||
build | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
module.exports = { | ||
root: true, | ||
env: { | ||
browser: true, | ||
es2020: true, | ||
}, | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaVersion: 2020, | ||
sourceType: 'module', | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
plugins: ['@typescript-eslint', 'react', 'prettier'], | ||
extends: [ | ||
'plugin:import/errors', | ||
'plugin:import/warnings', | ||
'plugin:import/typescript', | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:react/recommended', | ||
'prettier', | ||
'plugin:react-hooks/recommended', | ||
], | ||
settings: { | ||
react: { | ||
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use | ||
}, | ||
'import/resolver': { | ||
node: { | ||
extensions: ['.js', '.jsx', '.ts', '.tsx'], | ||
}, | ||
}, | ||
}, | ||
rules: { | ||
quotes: ['error', 'single', { allowTemplateLiterals: true }], | ||
'prettier/prettier': 'error', | ||
'react/no-unescaped-entities': 'off', | ||
'react/jsx-curly-brace-presence': ['error', { props: "never", children: "never" }], | ||
'@typescript-eslint/no-empty-interface': 'off', | ||
'@typescript-eslint/no-unused-vars': 'warn', | ||
'@typescript-eslint/no-unsafe-declaration-merging': 'off', | ||
'import/order': [ | ||
'error', | ||
{ | ||
pathGroups: [ | ||
{ | ||
pattern: 'react', | ||
group: 'external', | ||
position: 'before', | ||
}, | ||
{ | ||
pattern: | ||
'{@{api,apps,components,hooks,contexts,layouts,pages,icons,models,network}/**,@apps}', | ||
group: 'internal', | ||
position: 'after', | ||
}, | ||
], | ||
'newlines-between': 'always', | ||
alphabetize: { | ||
/* sort in ascending order. Options: ['ignore', 'asc', 'desc'] */ | ||
order: 'asc', | ||
caseInsensitive: true /* ignore case. Options: [true, false] */, | ||
}, | ||
pathGroupsExcludedImportTypes: ['builtin'], | ||
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object'], | ||
}, | ||
], | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'import/no-unresolved': 'off', | ||
'import/namespace': 'off', | ||
'import/no-duplicates': 'off', | ||
'no-console': 'warn', | ||
'guard-for-in': 'off', | ||
'@typescript-eslint/no-explicit-any': 'warn', | ||
'react/prop-types': 'off', | ||
'react/display-name': 'off', | ||
'import/default': 'off', | ||
'import/no-named-as-default': 'off', | ||
'import/no-named-as-default-member': 'off', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
name: build | ||
|
||
on: | ||
workflow_dispatch: {} | ||
push: | ||
branches: [ main, develop ] | ||
|
||
env: | ||
PROJECT_ID: bright-meridian-316511 | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# - name: cancel previous runs | ||
# uses: styfle/[email protected] | ||
# with: | ||
# access_token: ${{ github.token }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install Yarn | ||
run: corepack enable | ||
|
||
# Yarn dependencies cannot be cached until yarn is installed | ||
# WORKAROUND: https://github.com/actions/setup-node/issues/531 | ||
- name: Extract cached dependencies | ||
uses: actions/setup-node@v4 | ||
with: | ||
cache: yarn | ||
|
||
- name: env | ||
id: env | ||
run: | | ||
echo "::set-output name=tag::$(git rev-parse --short HEAD)" | ||
if [ "$REF" = "refs/heads/main" ]; then | ||
echo "::set-output name=app_env::prod" | ||
echo "::set-output name=wc_project_id::475eff0658d0f3300ca18971418d261b" | ||
echo "::set-output name=enable_demo_features::false" | ||
echo "::set-output name=squid_api_url::https://subsquid.squids.live/subsquid-network-testnet/v/v1/graphql" | ||
echo "::set-output name=app_domain::app.subsquid.io" | ||
else | ||
echo "::set-output name=app_env::dev" | ||
echo "::set-output name=wc_project_id::ec2facac9eaaca7cc0584baadc935c01" | ||
echo "::set-output name=enable_demo_features::true" | ||
echo "::set-output name=squid_api_url::https://subsquid.squids.live/subsquid-network-testnet/v/v1/graphql" | ||
echo "::set-output name=app_domain::app.devsquid.net" | ||
fi | ||
env: | ||
REF: ${{ github.ref }} | ||
|
||
- run: yarn install --immutable | ||
|
||
- run: yarn build | ||
env: | ||
APP_ENV: ${{ steps.env.outputs.app_env }} | ||
APP_VERSION: ${{ steps.env.outputs.tag }} | ||
WALLET_CONNECT_PROJECT_ID: ${{ steps.env.outputs.wc_project_id }} | ||
ENABLE_DEMO_FEATURES: ${{ steps.env.outputs.enable_demo_features }} | ||
NETWORK: ${{ steps.env.outputs.network }} | ||
SQUID_API_URL: ${{ steps.env.outputs.squid_api_url }} | ||
|
||
|
||
# Build and push images to Google Container Registry | ||
- name: Build image | ||
run: docker build --progress=plain -t "gcr.io/${PROJECT_ID}/subsquid-network-app-${APP_ENV}:${TAG}" -t "gcr.io/${PROJECT_ID}/subsquid-network-app-${APP_ENV}:latest" . | ||
env: | ||
APP_ENV: ${{ steps.env.outputs.app_env }} | ||
TAG: ${{ steps.env.outputs.tag }} | ||
|
||
- id: auth | ||
uses: google-github-actions/[email protected] | ||
with: | ||
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }} | ||
|
||
- name: Set up Cloud SDK | ||
uses: google-github-actions/[email protected] | ||
|
||
# steps for push images to gcr | ||
- name: 'gcloud cli --> docker credential helper' | ||
run: gcloud auth configure-docker -q | ||
|
||
- name: Push image | ||
run: | | ||
docker push "gcr.io/${PROJECT_ID}/subsquid-network-app-${APP_ENV}:${TAG}" | ||
docker push "gcr.io/${PROJECT_ID}/subsquid-network-app-${APP_ENV}:latest" | ||
env: | ||
APP_ENV: ${{ steps.env.outputs.app_env }} | ||
TAG: ${{ steps.env.outputs.tag }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# yarn | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/plugins | ||
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions | ||
|
||
.git | ||
|
||
# dependencies | ||
node_modules | ||
.pnp | ||
.pnp.* | ||
|
||
# testing | ||
coverage | ||
|
||
# production | ||
build | ||
dist | ||
storybook | ||
.cache | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# IDE | ||
.idea | ||
/.idea | ||
**/.idea | ||
.vscode | ||
|
||
# envs | ||
.env | ||
.env.local | ||
.env.dev | ||
.env.prod | ||
.env.test | ||
.env.development | ||
.env.production | ||
.env.development.local | ||
.env.production.local | ||
.env.test.local | ||
|
||
# logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.pnpm-debug.log* | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
secrets.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
yarn lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default { | ||
singleQuote: true, | ||
trailingComma: "all", | ||
printWidth: 100, | ||
arrowParens: "avoid" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nodeLinker: node-modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM nginx | ||
|
||
COPY nginx/default.conf /etc/nginx/conf.d/default.conf | ||
COPY build/ /usr/share/nginx/html/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Subsquid Cloud UI | ||
|
||
## Run | ||
|
||
1) Copy `.env.example` to `.env` | ||
2) ```yarn install``` | ||
3) ```yarn start``` |
Oops, something went wrong.