Commit Graph

16 Commits

Author SHA1 Message Date
0xYYBB | ZYY | Bobo
cad984b220 fix(web): restore ESLint, Prettier, and Husky code quality tools (#648)
## Problem
PR #647 accidentally removed all code quality tools when adding test dependencies:
-  ESLint (9 packages) - code linting
-  Prettier - code formatting
-  Husky - Git hooks
-  lint-staged - pre-commit checks
-  Related scripts (lint, format, prepare)

This significantly impacts code quality and team collaboration.

## Root Cause
When adding test dependencies (vitest, @testing-library/react), the package.json
was incorrectly edited, removing all existing devDependencies.

## Solution
Restore all code quality tools while keeping the new test dependencies:

###  Restored packages:
- @eslint/js
- @typescript-eslint/eslint-plugin
- @typescript-eslint/parser
- eslint + plugins (prettier, react, react-hooks, react-refresh)
- prettier
- husky
- lint-staged

###  Kept test packages:
- @testing-library/jest-dom
- @testing-library/react
- jsdom
- vitest

###  Restored scripts:
```json
{
  "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
  "lint:fix": "eslint . --ext ts,tsx --fix",
  "format": "prettier --write \"src/**/*.{ts,tsx,css,json}\"",
  "format:check": "prettier --check \"src/**/*.{ts,tsx,css,json}\"",
  "test": "vitest run",
  "prepare": "husky"
}
```

###  Restored lint-staged config

## Impact
This fix restores:
- Automated code style enforcement
- Pre-commit quality checks
- Consistent code formatting
- Team collaboration standards

## Testing
- [x] npm install succeeds
- [x] npm run build succeeds
- [x] All scripts are functional

Related-To: PR #647

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-07 01:30:13 +08:00
0xYYBB | ZYY | Bobo
d4f1e6a4d4 fix(web): resolve TypeScript type error in crypto.ts and add missing test dependencies (#647)
```
src/lib/crypto.ts(66,32): error TS2345: Argument of type 'Uint8Array<ArrayBuffer>'
is not assignable to parameter of type 'ArrayBuffer'.
```

`arrayBufferToBase64` function expected `ArrayBuffer` but received `Uint8Array.buffer`.
TypeScript strict type checking flagged the mismatch.

1. Update `arrayBufferToBase64` signature to accept `ArrayBuffer | Uint8Array`
2. Pass `result` directly instead of `result.buffer` (more accurate)
3. Add runtime type check with instanceof

```
error TS2307: Cannot find module 'vitest'
error TS2307: Cannot find module '@testing-library/react'
```

Install missing devDependencies:
- vitest
- @testing-library/react
- @testing-library/jest-dom

 Frontend builds successfully
 TypeScript compilation passes
 No type errors

Related-To: Docker frontend build failures
2025-11-07 01:19:48 +08:00
SkywalkerJi
eb515d74e9 Resolved front-end linting issues. (#533) 2025-11-05 20:41:41 +08:00
simon
fc63fe1835 Enforce minimum scan interval of three minutes 2025-11-05 12:25:47 +08:00
Ember
11c767cdda feat: add ESLint and Prettier with pre-commit hook
- Install ESLint 9 with TypeScript and React support
- Install Prettier with custom configuration (no semicolons)
- Add husky and lint-staged for pre-commit hooks
- Configure lint-staged to auto-fix and format on commit
- Relax ESLint rules to avoid large-scale code changes
- Format all existing code with Prettier (no semicolons)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 11:41:14 +08:00
icy
6eecd8b33a Merge branch 'dev' into beta 2025-11-04 01:45:21 +08:00
icy
5507ae7b13 Remove all test dependencies and configurations
- Removed test script from package.json
- Removed testing dependencies (@testing-library/react, vitest, jsdom)
- Deleted test directory and vitest.config.ts
- Updated package-lock.json to reflect changes
- Build still works perfectly without test dependencies

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 01:44:40 +08:00
icy
e25f04c642 Remove unused test files
Removed App.test.tsx and AITradersPage.test.tsx that were causing TypeScript build issues and are not currently in use.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 01:43:02 +08:00
Luna Martinez
9f03266fed Merge pull request #329 from zhouyongyou/chore/peer-dependency-markers
chore(web): add peer dependency markers to package-lock.json
2025-11-03 12:39:24 -05:00
ZhouYongyou
fd5c28c628 chore(web): add peer dependency markers to package-lock.json
npm v7+ automatically marks packages as peer dependencies when they are
declared in peerDependencies of installed packages. This commit adds
these markers to ensure consistent dependency resolution across all
development environments and CI/CD pipelines.

Affected packages (10):
- @babel/core (dev peer)
- @types/react (devOptional peer)
- browserslist
- jiti (dev peer)
- postcss
- react
- react-dom
- picomatch (2 instances, dev peer)
- vite (dev peer)

Benefits:
- Prevents duplicate installations of peer dependencies
- Ensures consistent package versions across the project
- Improves npm install performance
- Reduces package-lock.json conflicts
2025-11-03 20:47:25 +08:00
Liu Xiang Qian
9ab7a36fbb test: Add minimal UT infrastructure and fix Issue #227
This commit sets up a minimal, KISS-principle testing infrastructure
for both backend and frontend, and includes the fix for Issue #227.

Backend Changes:
- Add Makefile with test commands (test, test-backend, test-frontend, test-coverage)
- Add example test: config/database_test.go
- Fix Go 1.25 printf format string warnings in trader/auto_trader.go
  (Changed log.Printf to log.Print for non-format strings)
- All backend tests pass ✓

Frontend Changes:
- Add Vitest configuration: web/vitest.config.ts (minimal setup)
- Add test utilities: web/src/test/test-utils.tsx
- Add example test: web/src/App.test.tsx
- Add dependencies: vitest, jsdom, @testing-library/react
- All frontend tests pass ✓

Issue #227 Fix:
- Fix AITradersPage to allow editing traders with disabled models/exchanges
- Change validation to use allModels/allExchanges instead of enabledModels/enabledExchanges
- Add comprehensive tests in web/src/components/AITradersPage.test.tsx
- Fixes: https://github.com/tinkle-community/nofx/issues/227

CI/CD:
- Add GitHub Actions workflow: .github/workflows/test.yml
- Non-blocking tests (continue-on-error: true)
- Runs on push/PR to main and dev branches

Test Results:
- Backend: 1 test passing
- Frontend: 5 tests passing (including 4 for Issue #227)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 10:58:31 +08:00
Ember
9d4e86cbf5 feat(web): 新增 Landing 页面与 UI 优化\n\n- 新增 LandingPage、CryptoFeatureCard 等组件\n- 登录/注册页面与样式优化\n- 静态资源 images/main.png 2025-11-01 23:36:28 +08:00
Ember
9e64b1303f feat: enhance UI with Lucide icons across various components
- add logo
- Replaced emoji placeholders with Lucide icons in AITradersPage, CompetitionPage, EquityChart, Header, LoginPage, and RegisterPage for improved visual consistency.
- Updated button styles to include icons for actions like adding models and exchanges.
- Enhanced error and empty state displays with relevant icons to provide better user feedback.
2025-10-31 23:28:19 +08:00
tinkle
a4dd64910f sync: Sync codebase from nofx internal version
- Update .gitignore to align with nofx configuration
- Sync README files across all languages (EN/ZH/RU/UK)
- Update web/package-lock.json with latest dependencies

This commit synchronizes the open-nofx repository with the latest
changes from the internal nofx version to maintain consistency.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 11:15:08 +08:00
tinkle
ef2eda5037 fix 2025-10-29 10:59:14 +08:00
tinkle
7e8a494ed3 Initial commit: NOFX AI Trading System
- Multi-AI competition mode (Qwen vs DeepSeek)
- Binance Futures integration
- AI self-learning mechanism
- Professional web dashboard
- Complete risk management system
2025-10-28 15:47:34 +08:00