Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 160 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
const excludeFolders = ['node_modules', 'build', 'dist', ''];
const excludedFiles = `**/(${excludeFolders.join('|')})/**`;

module.exports = {
env: {
browser: true,
es6: true,
},
parserOptions: {
project: ['tsconfig.json'],
},
root: true,
ignorePatterns: excludeFolders.map((folder) => `**/${folder}/**`),
extends: [
'eslint:recommended',
'plugin:import/recommended',
'plugin:json/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'prettier',
],
rules: {
'@typescript-eslint/no-misused-promises': 'off',
'object-shorthand': 'error',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'import/no-cycle': [
2,
{
ignoreExternal: false,
maxDepth: 3,
},
],
'import/no-absolute-path': 'error',
'import/no-dynamic-require': 'error',
'import/no-self-import': 'error',
'import/no-useless-path-segments': 'error',
'import/no-named-as-default': 'error',
'import/no-named-as-default-member': 'error',
'import/no-deprecated': 'off',
'import/no-default-export': 'error',
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
'react/jsx-curly-brace-presence': ['error', 'never'],
'react/display-name': 'off',
'one-var': ['error', 'never'],
'no-console': 'error',
'no-alert': 'error',
'arrow-body-style': 'error',
'object-curly-newline': [
'error',
{
ObjectExpression: {
multiline: true,
consistent: true,
},
ObjectPattern: {
multiline: true,
consistent: true,
},
ImportDeclaration: {
multiline: true,
consistent: true,
},
ExportDeclaration: {
multiline: true,
consistent: true,
},
},
],
'max-len': [
'error',
{
code: 120,
ignoreUrls: true,
ignoreStrings: true,
ignoreRegExpLiterals: true,
ignoreComments: true,
ignoreTemplateLiterals: true,
},
],
'max-lines': 'error',
radix: 'error',
'react-hooks/exhaustive-deps': 'error',
'react/jsx-boolean-value': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{
vars: 'all',
args: 'after-used',
ignoreRestSiblings: true,
varsIgnorePattern: '^_',
argsIgnorePattern: '^_'
}
],
},
overrides: [
{
files: ['**/*.spec.*'],
plugins: ['jest', 'jest-dom', 'no-only-tests'],
extends: ['plugin:jest/recommended', 'plugin:jest/style', 'plugin:jest-dom/recommended'],
rules: {
'jest/consistent-test-it': [
'error',
{
fn: 'it',
},
],
'jest/no-focused-tests': 'off',
'jest/no-disabled-tests': 'off',
'jest/expect-expect': 'off',
'no-only-tests/no-only-tests': [
'error',
{
block: ['it', 'specify', 'describe'],
focus: ['only', 'skip'],
},
],
},
excludedFiles,
env: {
jest: true,
},
},
{
files: ['**/*.ts', '**/*.tsx'],
excludedFiles,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'simple-import-sort'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:import/typescript',
],
rules: {
'@typescript-eslint/no-redundant-type-constituents': 'off',
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'typeLike',
format: ['PascalCase'],
},
],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/no-non-null-assertion': 'error',
},
},
],
settings: {
react: {
version: 'detect',
},
'import/resolver': {
typescript: {},
},
},
};
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build

on:
pull_request:

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

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies
run: pnpm i

- name: Build app
run: pnpm run build
42 changes: 42 additions & 0 deletions .github/workflows/deploy-to-s3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy to Amazon S3

on:
push:
branches:
- main
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v3
with:
version: 9

- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm run build
env:
VITE_ENV: 'dev'
VITE_WHITELIST_MODE: true
- name: Deploy to S3
uses: jakejarvis/s3-sync-action@v0.5.1
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ github.ref == 'refs/heads/main' && 'app.grix.finance' || 'v0.grix.finance' }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }}
AWS_REGION: us-east-1
SOURCE_DIR: 'dist'
28 changes: 28 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Lint

on:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies
run: pnpm i

- name: Run ESLint
run: pnpm run lint

- name: Run prettier
run: pnpm run prettier
29 changes: 29 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Playwright Tests
on:
pull_request:
branches: [main, master]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install -g pnpm && pnpm install
- name: Install Playwright Browsers
run: pnpm exec playwright install chromium --with-deps
- name: Run Playwright tests
run: pnpm exec playwright test
env:
# Add environment variables to ensure tests work with new navigation
PLAYWRIGHT_NAVIGATION_TIMEOUT: 60000
PLAYWRIGHT_EXPECT_TIMEOUT: 30000
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
6 changes: 6 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
trailingComma: "es5",
tabWidth: 2,
singleQuote: true,
printWidth: 120,
};
24 changes: 24 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Brave",
"url": "http://localhost:4000",
"webRoot": "${workspaceFolder}",
"runtimeExecutable": "/Applications/Brave Browser.app"
},
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome with pnpm",
"url": "http://localhost:5173",
"webRoot": "${workspaceFolder}",
"preLaunchTask": "pnpm: dev"
}
]
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cSpell.words": ["Grix"],
"colorize.languages": ["css", "sass", "scss", "less", "sss", "stylus", "xml", "svg", "typescript"],
"git.allowNoVerifyCommit": false
}
43 changes: 43 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "pnpm: dev",
"type": "shell",
"command": "pnpm",
"args": ["run", "dev"],
"isBackground": true,
"problemMatcher": {
"owner": "custom",
"pattern": [
{
"regexp": ".",
"file": 1,
"location": 2,
"message": 3
}
],
"background": {
"activeOnStart": true,
"beginsPattern": ".*VITE v.*",
"endsPattern": ".*Local:.*"
}
},
"detail": "This task runs pnpm run dev"
},
{
"label": "Format before merge",
"type": "shell",
"command": "pnpm run prettier:fix && pnpm lint --fix",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [],
"presentation": {
"reveal": "always",
"close": false
}
}
]
}
Binary file removed favicon-old.ico
Binary file not shown.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"playwright:e2e": "pnpm exec playwright test --ui -c playwright.e2e.config.ts",
"playwright:stats": "pnpm exec playwright test tests/integrations/StatsPage.spec.ts --headed",
"postinstall": "sed -i.bak 's/COMMIT_HASH_PLACEHOLDER/$(git rev-parse HEAD)/g; s/DATETIME_PLACEHOLDER/$(date -u +\"%Y-%m-%dT%H:%M:%SZ\")/g' src/utils/commitHash.ts && rm src/utils/commitHash.ts.bak",
"prepare": "husky install",
"lint": "eslint src",
"lint:fix": "eslint src --fix",
"prettier": "prettier --check 'src/**/*.{ts,tsx,js,jsx,json,css,scss}'",
Expand Down Expand Up @@ -87,7 +86,6 @@
"eslint-plugin-jest-dom": "^5.5.0",
"eslint-plugin-json": "^3.1.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"husky": "^8.0.3",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"lint-staged": "^13.3.0",
Expand Down
Loading