Skip to content

Commit da02675

Browse files
authored
Merge pull request #6 from ProjectAthenia/dev
Release 0.1
2 parents 5e12b53 + 49d460c commit da02675

227 files changed

Lines changed: 17621 additions & 30955 deletions

File tree

Some content is hidden

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

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VITE_API_URL="http://localhost:8083"

.eslintrc.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
module.exports = {
2+
extends: [
3+
'react-app',
4+
'react-app/jest'
5+
],
6+
parserOptions: {
7+
project: './tsconfig.json',
8+
tsconfigRootDir: __dirname,
9+
warnOnUnsupportedTypeScriptVersion: false // Suppress TypeScript version warnings
10+
},
11+
rules: {
12+
// TypeScript rules - make them warnings instead of errors
13+
'@typescript-eslint/no-explicit-any': 'warn',
14+
'@typescript-eslint/explicit-function-return-type': 'off',
15+
'@typescript-eslint/explicit-module-boundary-types': 'off',
16+
'@typescript-eslint/no-unused-vars': ['warn', { 'vars': 'all', 'args': 'after-used', 'ignoreRestSiblings': true }],
17+
'@typescript-eslint/no-use-before-define': 'warn',
18+
'@typescript-eslint/no-useless-constructor': 'warn',
19+
20+
// React Hook rules - make them warnings
21+
'react-hooks/exhaustive-deps': 'warn',
22+
23+
// General JS rules
24+
'eqeqeq': ['warn', 'always'],
25+
'no-empty-pattern': 'warn',
26+
'no-useless-escape': 'warn',
27+
28+
// Testing Library rules - make critical ones errors, others warnings
29+
'testing-library/no-wait-for-multiple-assertions': 'warn',
30+
'testing-library/no-node-access': 'warn', // Made this a warning instead of error
31+
32+
// Turn off some overly strict rules
33+
'no-console': 'off',
34+
'@typescript-eslint/ban-ts-comment': 'off'
35+
},
36+
overrides: [
37+
{
38+
files: ['**/__tests__/**/*', '**/*.{test,spec}.*'],
39+
rules: {
40+
// Relax rules for test files
41+
'@typescript-eslint/no-explicit-any': 'off',
42+
'@typescript-eslint/no-unused-vars': 'off',
43+
'testing-library/no-node-access': 'off' // Allow direct node access in tests if needed
44+
}
45+
}
46+
],
47+
ignorePatterns: [
48+
'vite.config.ts',
49+
],
50+
};

.github/workflows/ci.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
test:
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
matrix:
12+
node-version: [18.x]
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Use Node.js ${{ matrix.node-version }}
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
cache: 'npm'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Run tests
27+
run: npm test -- --coverage --watchAll=false
28+
29+
- name: Upload coverage reports
30+
uses: codecov/codecov-action@v4
31+
with:
32+
token: ${{ secrets.CODECOV_TOKEN }}
33+
fail_ci_if_error: false
34+
35+
build:
36+
needs: test
37+
runs-on: ubuntu-latest
38+
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- name: Use Node.js
43+
uses: actions/setup-node@v4
44+
with:
45+
node-version: '18.x'
46+
cache: 'npm'
47+
48+
- name: Install dependencies
49+
run: npm ci
50+
51+
- name: Build
52+
run: npm run build
53+
54+
- name: Upload build artifacts
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: build
58+
path: build/

.github/workflows/code-quality.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Code Quality
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
lint:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Use Node.js
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: '18.x'
17+
cache: 'npm'
18+
19+
- name: Install dependencies
20+
run: npm ci
21+
22+
- name: Run ESLint
23+
run: |
24+
if npm list eslint &>/dev/null; then
25+
# Run ESLint and allow more warnings for legacy codebase
26+
npx eslint src --ext .ts,.tsx,.js,.jsx --max-warnings 300
27+
else
28+
echo "ESLint not configured, skipping"
29+
fi
30+
31+
- name: Type check
32+
run: npx tsc --noEmit
33+
34+
security:
35+
runs-on: ubuntu-latest
36+
37+
steps:
38+
- uses: actions/checkout@v4
39+
40+
- name: Use Node.js
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version: '18.x'
44+
cache: 'npm'
45+
46+
- name: Install dependencies
47+
run: npm ci
48+
49+
- name: Run npm audit
50+
run: npm audit --production --audit-level=critical
51+
52+
- name: Run Snyk to check for vulnerabilities
53+
if: env.SNYK_TOKEN != ''
54+
uses: snyk/actions/node@master
55+
env:
56+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
57+
with:
58+
args: --severity-threshold=critical

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313

1414
# misc
1515
.DS_Store
16+
.env
1617
.env.local
1718
.env.development.local
1819
.env.test.local
1920
.env.production.local
21+
**.orig
2022

2123
npm-debug.log*
2224
yarn-debug.log*

index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Athenia</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/index.tsx"></script>
12+
</body>
13+
</html>

jest.config.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
module.exports = {
2+
preset: 'ts-jest',
3+
testEnvironment: 'jsdom',
4+
setupFilesAfterEnv: ['<rootDir>/src/setupTests.ts'],
5+
testTimeout: 10000, // 10 second timeout for each test
6+
extensionsToTreatAsEsm: ['.ts', '.tsx'],
7+
moduleNameMapper: {
8+
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
9+
'^@/(.*)$': '<rootDir>/src/$1',
10+
'^src/services/api$': '<rootDir>/src/test-utils/mocks/__mocks__/api.ts',
11+
},
12+
transform: {
13+
'^.+\\.(ts|tsx)$': ['ts-jest', {
14+
useESM: true,
15+
tsconfig: {
16+
jsx: 'react-jsx',
17+
moduleResolution: 'node',
18+
target: 'ES2020',
19+
module: 'ESNext',
20+
esModuleInterop: true,
21+
allowSyntheticDefaultImports: true,
22+
}
23+
}],
24+
'^.+\\.(js|jsx)$': ['babel-jest', { presets: ['@babel/preset-env', '@babel/preset-react'] }],
25+
},
26+
transformIgnorePatterns: [
27+
'/node_modules/(?!(@mantine|@emotion|cheerio|parse5|entities|dom-serializer|htmlparser2|domelementtype|domhandler|domutils)/)',
28+
],
29+
testMatch: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
30+
collectCoverageFrom: [
31+
'src/**/*.{js,jsx,ts,tsx}',
32+
'!src/index.tsx',
33+
'!src/reportWebVitals.ts',
34+
'!src/setupTests.ts',
35+
],
36+
globals: {
37+
'ts-jest': {
38+
useESM: true,
39+
tsconfig: {
40+
jsx: 'react-jsx',
41+
}
42+
}
43+
}
44+
};

0 commit comments

Comments
 (0)