Skip to content

Commit 40710a3

Browse files
authored
Merge pull request #1 from nowscott/development
Development
2 parents e55cf65 + 4a39577 commit 40710a3

File tree

9 files changed

+91
-126
lines changed

9 files changed

+91
-126
lines changed

Diff for: .github/workflows/release.yml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Get current release version
17+
id: get_current_release
18+
run: |
19+
curl -s "https://api.github.com/repos/${{ github.repository }}/releases/latest" | jq -r '.tag_name' > current_version.txt
20+
continue-on-error: true
21+
22+
- name: Read package.json version
23+
id: read_package_version
24+
run: |
25+
PACKAGE_VERSION=$(node -p "require('./package.json').version")
26+
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
27+
28+
- name: Compare versions
29+
id: compare_versions
30+
run: |
31+
if [ -f current_version.txt ]; then
32+
CURRENT_VERSION=$(cat current_version.txt)
33+
else
34+
CURRENT_VERSION="v0.0.0"
35+
fi
36+
if [ "$CURRENT_VERSION" != "v${PACKAGE_VERSION}" ]; then
37+
echo "Version has changed, proceeding with release."
38+
echo "RELEASE=true" >> $GITHUB_ENV
39+
else
40+
echo "No version change detected."
41+
echo "RELEASE=false" >> $GITHUB_ENV
42+
exit 0
43+
fi
44+
45+
- name: Configure Git
46+
if: env.RELEASE == 'true'
47+
run: |
48+
git config --global user.name "GitHub Actions"
49+
git config --global user.email "[email protected]"
50+
51+
- name: Add package.json and commit changes
52+
if: env.RELEASE == 'true'
53+
run: |
54+
git add package.json
55+
git commit -m "Bump version to ${{ env.PACKAGE_VERSION }}" || echo "No changes to commit"
56+
57+
- name: Create and push tag
58+
if: env.RELEASE == 'true'
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
run: |
62+
NEW_VERSION=${{ env.PACKAGE_VERSION }}
63+
git tag v$NEW_VERSION
64+
git push origin main --tags
65+
66+
- name: Create Release
67+
if: env.RELEASE == 'true'
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
uses: actions/create-release@v1
71+
with:
72+
tag_name: v${{ env.PACKAGE_VERSION }}
73+
release_name: v${{ env.PACKAGE_VERSION }}

Diff for: README.md

+2-116
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ RepoShare 是一个强大的网页工具,专门用于生成 GitHub 仓库的
1414
- 实时响应样式调整
1515
- 快速预览不同模板效果
1616

17-
- 💾 一键下载分享图
18-
- 支持多种图片格式(PNG/JPG)
19-
- 自定义图片尺寸
20-
- 快速批量导出
21-
2217
- 🎯 支持自定义样式
2318
- 字体样式调整
2419
- 颜色主题定制
@@ -38,28 +33,19 @@ RepoShare 是一个强大的网页工具,专门用于生成 GitHub 仓库的
3833
2. 输入 GitHub 仓库信息
3934
- 填写仓库地址或用户名/仓库名
4035
- 自动获取仓库基本信息
41-
- 支持私有仓库(需要授权)
4236

4337
3. 选择喜欢的模板
4438
- 浏览预设模板列表
4539
- 预览模板效果
46-
- 根据需求筛选模板
47-
48-
4. 自定义样式(可选)
49-
- 调整字体大小和样式
50-
- 修改配色方案
51-
- 自定义组件位置
5240

53-
5. 预览并下载分享图
41+
4. 预览并下载分享图
5442
- 实时预览最终效果
55-
- 选择导出格式和尺寸
56-
- 一键下载或批量导出
43+
- 一键下载
5744

5845
### 🛠️ 技术栈
5946

6047
- 前端框架:React
6148
- 函数式组件开发
62-
- React Hooks 状态管理
6349
- 组件化架构设计
6450

6551
- UI 样式:
@@ -77,106 +63,6 @@ RepoShare 是一个强大的网页工具,专门用于生成 GitHub 仓库的
7763
- 模块化管理
7864
- 高效热更新
7965

80-
### 📝 开发计划
81-
82-
- [ ] 项目基础搭建
83-
- [ ] 使用 Create React App 初始化项目
84-
- [ ] 配置 ESLint 和 Prettier
85-
- [ ] 搭建基础路由系统
86-
- [ ] 设计项目目录结构
87-
88-
- [ ] GitHub 数据层实现
89-
- [ ] 封装 GitHub API 请求模块
90-
- [ ] 设计仓库数据模型和类型
91-
- [ ] 实现本地存储缓存系统
92-
- [ ] 开发数据更新策略
93-
94-
- [ ] 核心功能开发
95-
- [ ] 实现仓库信息展示组件
96-
- [ ] 开发模板选择系统
97-
- [ ] 构建画布渲染引擎
98-
- [ ] 完成图片导出功能
99-
100-
- [ ] 用户界面优化
101-
- [ ] 实现响应式布局
102-
- [ ] 添加深色模式支持
103-
- [ ] 优化加载状态展示
104-
- [ ] 完善错误处理机制
105-
106-
- [ ] 性能优化和部署
107-
- [ ] 实现组件懒加载
108-
- [ ] 优化缓存策略
109-
- [ ] 配置 CI/CD 流程
110-
- [ ] 部署到生产环境
111-
112-
### 📁 项目结构
113-
114-
```
115-
src/
116-
├── components/ # 组件目录
117-
│ ├── Preview/ # 预览组件
118-
│ │ ├── index.tsx
119-
│ │ └── style.css
120-
│ ├── Input/ # 仓库信息输入组件
121-
│ │ ├── index.tsx
122-
│ │ └── style.css
123-
│ └── Sidebar/ # 模板选择侧边栏
124-
│ ├── index.tsx
125-
│ └── style.css
126-
├── templates/ # 模板目录
127-
│ ├── Template1/ # 模板1
128-
│ │ ├── index.tsx
129-
│ │ └── style.css
130-
│ └── Template2/ # 模板2
131-
│ ├── index.tsx
132-
│ └── style.css
133-
├── services/ # 服务层
134-
│ └── github.ts # GitHub API 请求封装
135-
├── utils/ # 工具函数
136-
│ ├── canvas.ts # Canvas 绘图工具
137-
│ └── template.ts # 模板处理工具
138-
├── types/ # 类型定义
139-
│ ├── github.ts # GitHub 相关类型
140-
│ └── template.ts # 模板相关类型
141-
├── hooks/ # 自定义 Hooks
142-
│ ├── useGithubRepo.ts
143-
│ └── useTemplate.ts
144-
├── constants/ # 常量定义
145-
│ └── config.ts
146-
└── App.tsx # 应用入口
147-
```
148-
149-
### 目录说明
150-
151-
- **components/**: 存放所有 React 组件
152-
- Preview: 负责展示模板预览效果
153-
- Input: 处理用户输入的仓库信息
154-
- Sidebar: 提供模板选择功能
155-
156-
- **templates/**: 存放所有模板组件
157-
- 每个模板都是独立的组件
158-
- 包含样式和逻辑的完整实现
159-
160-
- **services/**: API 服务封装
161-
- 处理与 GitHub API 的交互
162-
- 封装数据请求和处理逻辑
163-
164-
- **utils/**: 工具函数集合
165-
- 提供通用的工具方法
166-
- 处理画布渲染和模板转换
167-
168-
- **types/**: TypeScript 类型定义
169-
- 确保代码类型安全
170-
- 提供清晰的接口定义
171-
172-
- **hooks/**: React 自定义 Hooks
173-
- 封装可复用的状态逻辑
174-
- 提供数据管理功能
175-
176-
- **constants/**: 常量配置
177-
- 存放全局配置信息
178-
- 定义通用常量
179-
18066
## 📄 License
18167

18268
MIT License

Diff for: index.html

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<link rel='stylesheet' href='https://chinese-fonts-cdn.deno.dev/packages/dyh/dist/SmileySans-Oblique/result.css' crossorigin="anonymous"/>
1010
<link rel='stylesheet' href='https://chinese-fonts-cdn.deno.dev/packages/zhbtt/dist/字魂扁桃体/result.css' crossorigin="anonymous" />
1111
<link rel='stylesheet' href='https://chinese-fonts-cdn.deno.dev/packages/jhlst/dist/京華老宋体v1_007/result.css' crossorigin="anonymous" />
12+
<link rel='stylesheet' href='https://chinese-fonts-cdn.deno.dev/packages/kksjt/dist/kuaikanshijieti20231213/result.css' crossorigin="anonymous" />
1213
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
1314
<title>RepoShare</title>
1415
</head>

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "reposhare",
33
"private": true,
4-
"version": "0.0.0",
4+
"version": "0.6.5",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

Diff for: src/App.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ import MainContent from './components/MainContent';
88
const octokit = new Octokit();
99

1010
function App() {
11-
const [selectedTemplate, setSelectedTemplate] = useState('basic');
11+
const [selectedTemplate, setSelectedTemplate] = useState('card');
1212
const [isDarkMode, setIsDarkMode] = useState(false);
1313
const [messageApi, contextHolder] = message.useMessage();
1414
const [repoData, setRepoData] = useState({
1515
repoName: 'RepoShare',
16-
repoDescription: '一个用于生成 GitHub 仓库预览图的工具,支持多种模板和自定义样式。',
17-
repoStars: 100,
18-
repoForks: 20,
16+
repoDescription: '一个用于生成 GitHub 仓库预览图的工具,支持卡片、深色、现代等多种精美模板。可自定义显示仓库信息、作者信息、语言标签等元素,让你的仓库展示更加专业和吸引人。适用于 README 展示、社交分享、项目文档等多种场景。',
17+
repoStars: 999,
18+
repoForks: 66,
1919
repoLanguages: ['TypeScript','CSS'],
2020
authorName: 'NowScott',
2121
authorAvatar: "https://avatars.githubusercontent.com/u/86339284?v=4",

Diff for: src/components/MainContent/index.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,23 @@ const MainContent: React.FC<MainContentProps> = ({
4949
width={160}
5050
className="app-sider"
5151
theme={isDarkMode ? 'dark' : 'light'}
52+
style={{ position: 'fixed', left: 0, height: '90vh', top: '64px', zIndex: 20 }}
5253
>
5354
<Sidebar
5455
selectedTemplate={selectedTemplate}
5556
onTemplateSelect={onTemplateSelect}
5657
/>
5758
</Sider>
58-
<Content className="app-content" style={{ padding: '24px', minHeight: '90vh', display: 'flex', justifyContent: 'center', alignItems: 'center', backgroundColor: isDarkMode ? '#141414' : '#fff', borderLeft: `1px solid ${isDarkMode ? '#303030' : '#f0f0f0'}`, borderRight: `1px solid ${isDarkMode ? '#303030' : '#f0f0f0'}` }}>
59-
<div style={{ width: '750px', minWidth: '750px', flex: '0 0 750px' }}>
59+
<Content className="app-content" style={{ padding: '24px', minHeight: '90vh', display: 'flex', justifyContent: 'center', alignItems: 'center', backgroundColor: isDarkMode ? '#141414' : '#fff', borderLeft: `1px solid ${isDarkMode ? '#303030' : '#f0f0f0'}`, borderRight: `1px solid ${isDarkMode ? '#303030' : '#f0f0f0'}`, overflow: 'auto' }}>
60+
<div style={{ width: '750px', flex: 'none' }}>
6061
<Preview selectedTemplate={selectedTemplate} {...repoData} {...controls} />
6162
</div>
6263
</Content>
6364
<Sider
6465
width={160}
6566
className="app-sider"
6667
theme={isDarkMode ? 'dark' : 'light'}
68+
style={{ position: 'fixed', right: 0, height: '90vh', top: '64px', zIndex: 20 }}
6769
>
6870
<PreviewControl
6971
controls={controls}

Diff for: src/components/Sidebar/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ interface SidebarProps {
99

1010
const Sidebar: React.FC<SidebarProps> = ({ selectedTemplate, onTemplateSelect }) => {
1111
const templates = [
12-
{ id: 'basic', name: '基础模板', icon: <LayoutOutlined /> },
13-
{ id: 'dark', name: '深色模板', icon: <BgColorsOutlined /> },
1412
{ id: 'card', name: '卡片模板', icon: <CreditCardOutlined /> },
13+
{ id: 'dark', name: '深色模板', icon: <BgColorsOutlined /> },
1514
{ id: 'modern', name: '现代模板', icon: <AppstoreOutlined /> },
1615
{ id: 'elegant', name: '优雅模板', icon: <CrownOutlined /> },
1716
{ id: 'luxury', name: '黑金模板', icon: <GoldOutlined /> },
17+
{ id: 'basic', name: '基础模板', icon: <LayoutOutlined /> },
1818
];
1919

2020
const items = [

Diff for: src/templates/Card/style.css

+3
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@
9494
margin: 0;
9595
flex: 1;
9696
min-width: 200px;
97+
color: #58a6ff;
98+
font-size: 2.5rem;
99+
text-shadow: 0 0 20px rgba(88, 166, 255, 0.3);
97100
}
98101

99102
.card-template .language-tags {

Diff for: src/templates/Luxury/style.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
display: flex;
88
justify-content: center;
99
align-items: center;
10-
font-family:'zihunbiantaoti';
10+
font-family:'快看世界体';
1111
font-weight:'400'
1212
}
1313

0 commit comments

Comments
 (0)