Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lukachi committed Mar 26, 2024
0 parents commit fd34fb7
Show file tree
Hide file tree
Showing 187 changed files with 28,154 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
> 1%
last 2 versions
not dead
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
.git
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 100
9 changes: 9 additions & 0 deletions .env-development
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
VITE_MODE=development
VITE_PORT=8095

VITE_APP_NAME='Voting App'
VITE_API_URL=https://api.stage.freedomtool.org

VITE_RPC_URL='https://rpc.qtestnet.org'
VITE_VOTING_REGISTRY_CONTRACT_ADDRESS=0x17C1B9e65e1c243df59Ef0ce0778B687Cf287718
VITE_VOTING_DEPLOYER_CONTRACT_ADDRESS=0xf41ceE234219D6cc3d90A6996dC3276aD378cfCF
8 changes: 8 additions & 0 deletions .env-production
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
VITE_MODE=production

VITE_APP_NAME='Voting App'
VITE_API_URL=https://api.stage.freedomtool.org

VITE_RPC_URL='https://rpc.qtestnet.org'
VITE_VOTING_REGISTRY_CONTRACT_ADDRESS=0x17C1B9e65e1c243df59Ef0ce0778B687Cf287718
VITE_VOTING_DEPLOYER_CONTRACT_ADDRESS=0xf41ceE234219D6cc3d90A6996dC3276aD378cfCF
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist/*.js
index.html
*.md
static/env.js
node_modules
91 changes: 91 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
module.exports = {
root: true,
env: {browser: true, es2021: true},
extends: [
'eslint:recommended',
'plugin:import/recommended',
'plugin:jsx-a11y/recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
'plugin:react-i18n/recommended',
'prettier',
],
overrides: [
{
files: ['**/*.ts?(x)'],
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:import/typescript',
],
},
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
plugins: ['simple-import-sort', 'prettier', '@typescript-eslint', 'react-i18n'],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: '.',
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {},
node: {
paths: ['src'],
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
react: {
version: 'detect',
},
},
rules: {
'prettier/prettier': ['error', {}, {usePrettierrc: true}],
'arrow-parens': 0,
'no-debugger': 1,
'no-warning-comments': [
1,
{
terms: ['hardcoded'],
location: 'anywhere',
},
],
'no-return-await': 0,
'object-curly-spacing': ['error', 'always'],
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'no-var': 'error',
'comma-dangle': [1, 'always-multiline'],
'linebreak-style': ['error', 'unix'],
'max-len': [
1,
{
code: 100,
comments: 100,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
},
],
'no-console': [
1,
{
allow: ['warn', 'error'],
},
],
'react-i18n/no-dynamic-translation-keys': 'error',
'react-i18n/no-missing-interpolation-keys': 'error',
// disable unnecessary rules from recommendations
'react/display-name': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
},
}
16 changes: 16 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Set the default behavior, in case devs don't have core.autocrlf set.
* text=auto

# Declare files that will always have LF line endings on checkout.
*.* text eol=lf

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.webp binary
*.otf binary
*.ttf binary
*.woff binary
*.woff2 binary
*.wasm binary
*.zkey binary
50 changes: 50 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
on:
push:
branches:
- 'main'

jobs:
converge:
name: Converge
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install werf
uses: werf/actions/[email protected]

- name: Log in to registry
# This is where you will update the personal access token to GITHUB_TOKEN
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: Run echo
run: |
werf version
docker version
echo $GITHUB_REPOSITORY
echo $GITHUB_SHA
- name: Run Build
run: |
cp .env-development .env
. $(werf ci-env github --as-file)
werf export --dev web --tag ghcr.io/$GITHUB_REPOSITORY:$GITHUB_SHA
# deploy:
# name: Deploy
# needs: converge
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# with:
# fetch-depth: 0
# - name: ConfigCreate
# run: |
# mkdir ~/.kube/
# echo "${{ secrets.K8SCONFIG_DEV }}" | base64 -d > config
# mv config ~/.kube/
# kubectl set image deployment example-web template=ghcr.io/$GITHUB_REPOSITORY:$GITHUB_SHA -n orgs
37 changes: 37 additions & 0 deletions .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-stable.[0-9]+'

jobs:
converge:
name: Converge
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install werf
uses: werf/actions/[email protected]

- name: Log in to registry
# This is where you will update the personal access token to GITHUB_TOKEN
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: Run echo
run: |
werf version
docker version
echo $GITHUB_REPOSITORY
echo $GITHUB_REF_NAME
- name: Run Build
run: |
cp .env-production .env
. $(werf ci-env github --as-file)
werf export --dev web --tag ghcr.io/$GITHUB_REPOSITORY:$GITHUB_REF_NAME
56 changes: 56 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# dependencies
/node_modules
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
package-lock.json

# build
dist/

# tests
test/unit/coverage

# os
.DS_Store

# linters
.eslintcache

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
selenium-debug.log
stats.html

# typescript
*.tsbuildinfo

# editor directories and files
.vscode/*
!.vscode/settings.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# env files
.env.analyze
.env.development
.env.production
.env.local

# Sentry Auth Token
.env.sentry-build-plugin

# IDE files
.idea
.vscode
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules
dist
coverage
.eslintcache
yarn.lock
scripts/*.js
index.html
stats.html
*.md
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"printWidth": 100,
"semi": false,
"singleQuote": true,
"jsxSingleQuote": true,
"arrowParens": "avoid",
"trailingComma": "all"
}
Loading

0 comments on commit fd34fb7

Please sign in to comment.