Skip to content

Commit c45e982

Browse files
committed
feat: 创建股票投资收益计算工具项目
- 初始化项目结构和依赖 - 实现卡片视图、表格视图和图表视图 - 添加数据导入导出功能 - 优化性能,使用虚拟列表技术 - 适配响应式设计 - 编写项目文档和使用说明
0 parents  commit c45e982

Some content is hidden

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

72 files changed

+10892
-0
lines changed

.github/CONTRIBUTING.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# 贡献指南
2+
3+
感谢您考虑为股票投资收益计算工具项目做出贡献!这是一个开源项目,我们非常欢迎社区成员的贡献和参与。
4+
5+
## 如何贡献
6+
7+
### 报告问题
8+
9+
如果您发现了问题或有新功能建议,请[提交一个 issue](https://github.com/crper/next-stock-return-calc/issues/new)。请尽可能详细地描述问题或建议,包括:
10+
11+
- 对于问题:描述问题、复现步骤、预期行为和实际行为
12+
- 对于功能建议:描述功能、使用场景和潜在实现方式
13+
14+
### 提交代码
15+
16+
如果您想直接贡献代码,请按照以下步骤操作:
17+
18+
1. Fork 本仓库
19+
2. 创建您的特性分支 (`git checkout -b feature/amazing-feature`)
20+
3. 提交您的修改 (`git commit -m '添加一些惊人的特性'`)
21+
4. 推送到分支 (`git push origin feature/amazing-feature`)
22+
5. 创建一个 Pull Request
23+
24+
### Pull Request 流程
25+
26+
1. 确保您的代码符合项目的代码规范
27+
2. 更新相关文档(如有必要)
28+
3. Pull Request 将由项目维护者审核和合并
29+
30+
## 开发指南
31+
32+
### 环境设置
33+
34+
请确保您的开发环境满足以下要求:
35+
36+
- Node.js 18.17.0 或更高版本
37+
- pnpm 10.x(推荐)或 npm/yarn
38+
39+
### 代码规范
40+
41+
本项目遵循以下代码规范:
42+
43+
- 使用 TypeScript 编写代码,并确保类型完整
44+
- 使用 ES6+ 语法特性
45+
- 遵循 ESLint 配置的代码风格
46+
- 组件和函数长度适中,单一职责原则
47+
- 添加适当的注释和文档
48+
49+
### 提交信息规范
50+
51+
提交信息应遵循以下格式:
52+
53+
```
54+
<类型>: <描述>
55+
56+
[可选的详细描述]
57+
58+
[可选的关闭 issue]
59+
```
60+
61+
类型包括:
62+
- `feat`: 新功能
63+
- `fix`: 修复bug
64+
- `docs`: 文档修改
65+
- `style`: 代码格式修改(不影响代码运行)
66+
- `refactor`: 代码重构
67+
- `perf`: 性能优化
68+
- `test`: 测试相关
69+
- `chore`: 构建过程或辅助工具的变动
70+
71+
例如:
72+
```
73+
fix: 修复涨跌幅计算精度问题
74+
75+
修复了涨跌幅超过10%时的计算精度问题,使用mathjs库确保精确计算。
76+
77+
Closes #42
78+
```
79+
80+
## 联系方式
81+
82+
如果您有任何疑问,可以通过以下方式联系项目维护者:
83+
84+
- GitHub Issues: https://github.com/crper/next-stock-return-calc/issues
85+
- 邮箱: crper@outlook.com
86+
87+
感谢您的贡献!

.github/workflows/deploy.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: "20"
28+
29+
- name: Setup Pages
30+
uses: actions/configure-pages@v4
31+
32+
- name: Install pnpm
33+
uses: pnpm/action-setup@v3
34+
with:
35+
version: 10.8.1
36+
37+
- name: Get pnpm store directory
38+
shell: bash
39+
run: |
40+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
41+
42+
- name: Setup pnpm cache
43+
uses: actions/cache@v4
44+
with:
45+
path: ${{ env.STORE_PATH }}
46+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
47+
restore-keys: |
48+
${{ runner.os }}-pnpm-store-
49+
50+
- name: Install dependencies
51+
run: pnpm install
52+
53+
- name: Build
54+
run: pnpm build
55+
56+
- name: Create .nojekyll file
57+
run: touch out/.nojekyll
58+
59+
- name: Upload artifact
60+
uses: actions/upload-pages-artifact@v3
61+
with:
62+
path: ./out
63+
64+
deploy:
65+
environment:
66+
name: github-pages
67+
url: ${{ steps.deployment.outputs.page_url }}
68+
runs-on: ubuntu-latest
69+
needs: build
70+
steps:
71+
- name: Deploy to GitHub Pages
72+
id: deployment
73+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.*
7+
.yarn/*
8+
!.yarn/patches
9+
!.yarn/plugins
10+
!.yarn/releases
11+
!.yarn/versions
12+
13+
# testing
14+
/coverage
15+
16+
# next.js
17+
/.next/
18+
/out/
19+
20+
# production
21+
/build
22+
23+
# misc
24+
.DS_Store
25+
*.pem
26+
27+
# debug
28+
npm-debug.log*
29+
yarn-debug.log*
30+
yarn-error.log*
31+
.pnpm-debug.log*
32+
33+
# env files (can opt-in for committing if needed)
34+
.env*
35+
36+
# vercel
37+
.vercel
38+
39+
# typescript
40+
*.tsbuildinfo
41+
next-env.d.ts
42+
43+
.cursor

.nojekyll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# 更新日志
2+
3+
所有项目的显著变更都将记录在此文件中。
4+
5+
格式基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.0.0/)
6+
并且本项目遵循 [语义化版本](https://semver.org/lang/zh-CN/)
7+
8+
## [0.1.0] - 2023-10-01
9+
10+
### 新增
11+
- 🎉 项目初始版本
12+
- 实现股票投资收益计算的核心功能
13+
- 支持卡片、表格和图表三种视图方式展示数据
14+
- 实现导入导出功能,方便保存和共享计算参数
15+
- 添加响应式设计,支持多种设备浏览
16+
17+
### 技术特性
18+
- 使用 Next.js 15.3 和 React 19 构建
19+
- 采用 TypeScript 进行类型检查
20+
- 使用 Tailwind CSS 4.1 进行样式设计
21+
- 实现虚拟列表技术,优化大数据量渲染性能
22+
- 使用 mathjs 库处理精确数学计算

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)