Skip to content

Commit fb6a324

Browse files
authored
Merge pull request #1 from chunshand/pr_buffer
chore(all): 🔧 合并上游仓库分支
2 parents 90a36a9 + 75d9f7c commit fb6a324

File tree

4 files changed

+133
-133
lines changed

4 files changed

+133
-133
lines changed

src/components/home.vue

Lines changed: 6 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,13 @@
5151
import { useMessage } from "naive-ui";
5252
import { nameToEmoji } from 'gemoji'
5353
import useUtools from "../composables/useUtools";
54+
import { rawEmojis, typeData } from "../data";
5455
const message = useMessage();
5556
const utools = useUtools()
56-
57-
5857
const { ctrl_alt } = useMagicKeys();
59-
6058
whenever(ctrl_alt, () => {
6159
handleCopy()
6260
})
63-
6461
const handleCopy = async () => {
6562
if (!subject.value) {
6663
message.error("必填项必填");
@@ -75,71 +72,14 @@ const handleCopy = async () => {
7572
// https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/config-conventional/index.js
7673
// TODO 后期引入默认emoji
7774
// TODO 后期引入国际化
78-
const typeOptions = ref([
79-
{
80-
value: "feat",
81-
label: "新功能(feat)",
82-
emoji: "",
83-
},
84-
{
85-
value: "fix",
86-
label: "修复bug(fix)",
87-
emoji: "🐛",
88-
},
89-
{
90-
value: "docs",
91-
label: "文档变更(docs)",
92-
emoji: "📝",
93-
},
94-
{
95-
value: "style",
96-
label: "无关代码的格式(style)",
97-
emoji: "🎨",
98-
},
99-
{
100-
value: "refactor",
101-
label: "重构(refactor)",
102-
emoji: "♻️",
103-
},
104-
{
105-
value: "perf",
106-
label: "优化性能(perf)",
107-
emoji: "⚡️",
108-
},
109-
{
110-
value: "test",
111-
label: "增加或更新测试(test)",
112-
emoji: "",
113-
},
114-
115-
{
116-
value: "build",
117-
label: "构建系统或外部依赖更改(build)",
118-
emoji: "🛠️",
119-
},
120-
{
121-
value: "ci",
122-
label: "CI配置或脚本变动(ci)",
123-
emoji: "👷",
124-
},
125-
{
126-
value: "chore",
127-
label: "不影响代码的其余变动(chore)",
128-
emoji: "🔧",
129-
},
130-
{
131-
value: "revert",
132-
label: "回退之前版本(revert)",
133-
emoji: "",
134-
},
135-
136-
]);
75+
const typeOptions = ref(typeData);
76+
// 默认emoji
77+
const defatltEmoji = ref("");
13778
// 类型
13879
const type = ref("feat");
139-
14080
watch(type, (val) => {
14181
// console.log(val)
142-
emoji.value = typeOptions.value.find((item) => item.value === val)?.emoji ?? ''
82+
emoji.value = typeOptions.value.find((item) => item.value === val)?.emoji ?? defatltEmoji
14383
})
14484
// 范围
14585
const scope = ref("");
@@ -152,74 +92,7 @@ const body = ref("");
15292
// 最后
15393
const footer = ref("");
15494
155-
const rawEmojis = [
156-
{ "name": "art", "description": "结构改进 / 格式化代码" },
157-
{ "name": "zap", "description": "性能改善" },
158-
{ "name": "fire", "description": "删除代码或者文件" },
159-
{ "name": "bug", "description": "修了一个 BUG" },
160-
{ "name": "ambulance", "description": "重大热修复" },
161-
{ "name": "sparkles", "description": "引入新的特性" },
162-
{ "name": "pencil", "description": "写文档" },
163-
{ "name": "rocket", "description": "部署相关" },
164-
{ "name": "lipstick", "description": "更新界面与样式文件" },
165-
{ "name": "tada", "description": "创世提交" },
166-
{ "name": "white_check_mark", "description": "更新测试" },
167-
{ "name": "lock", "description": "修复安全问题" },
168-
{ "name": "apple", "description": "修复在苹果系统上的问题" },
169-
{ "name": "penguin", "description": "修复在 Linux 系统上的问题" },
170-
{ "name": "checkered_flag", "description": "修复在 Windows 系统上的问题" },
171-
{ "name": "robot", "description": "修复在安卓系统上的问题" },
172-
{ "name": "green_apple", "description": "修复在 iOS 系统上的问题" },
173-
{ "name": "bookmark", "description": "发布 / 版本标签" },
174-
{ "name": "rotating_light", "description": "消除 linter 警告" },
175-
{ "name": "construction", "description": "进行中" },
176-
{ "name": "green_heart", "description": "修复持续集成构建" },
177-
{ "name": "arrow_down", "description": "降级依赖" },
178-
{ "name": "arrow_up", "description": "升级依赖" },
179-
{ "name": "pushpin", "description": "固定依赖在特定的版本" },
180-
{ "name": "construction_worker", "description": "添加持续集成构建系统" },
181-
{ "name": "chart_with_upwards_trend", "description": "添加分析或者跟踪代码" },
182-
{ "name": "recycle", "description": "代码重构" },
183-
{ "name": "whale", "description": "Docker 容器相关" },
184-
{ "name": "heavy_plus_sign", "description": "添加依赖" },
185-
{ "name": "heavy_minus_sign", "description": "删除依赖" },
186-
{ "name": "wrench", "description": "改变配置文件" },
187-
{ "name": "globe_with_meridians", "description": "国际化与本地化" },
188-
{ "name": "pencil2", "description": "修正拼写错误" },
189-
{ "name": "poop", "description": "写需要改进的坏代码" },
190-
{ "name": "rewind", "description": "回滚改动" },
191-
{ "name": "twisted_rightwards_arrows", "description": "合并分支" },
192-
{ "name": "package", "description": "更新编译后的文件或者包" },
193-
{ "name": "alien", "description": "由于外部 API 变动而更新代码" },
194-
{ "name": "truck", "description": "文件移动或者重命名" },
195-
{ "name": "page_facing_up", "description": "添加或者更新许可" },
196-
{ "name": "boom", "description": "引入破坏性的改动" },
197-
{ "name": "bento", "description": "添加或者更新静态资源" },
198-
{ "name": "ok_hand", "description": "代码审核后更新代码" },
199-
{ "name": "wheelchair", "description": "改进可访问性" },
200-
{ "name": "bulb", "description": "给源代码加文档" },
201-
{ "name": "beers", "description": "醉写代码" },
202-
{ "name": "speech_balloon", "description": "更新文本和字面" },
203-
{ "name": "card_file_box", "description": "执行数据库相关的改动" },
204-
{ "name": "loud_sound", "description": "添加日志" },
205-
{ "name": "mute", "description": "删除日志" },
206-
{ "name": "busts_in_silhouette", "description": "添加贡献者(们)" },
207-
{ "name": "children_crossing", "description": "改进用户体验 / 可用性" },
208-
{ "name": "building_construction", "description": "架构改动" },
209-
{ "name": "iphone", "description": "响应性设计相关" },
210-
{ "name": "clown_face", "description": "模拟相关" },
211-
{ "name": "egg", "description": "添加一个彩蛋" },
212-
{ "name": "see_no_evil", "description": "添加或者更新 .gitignore 文件" },
213-
{ "name": "camera_flash", "description": "添加或者更新快照" },
214-
{ "name": "alembic", "description": "研究新事物" },
215-
{ "name": "hammer_and_wrench", "description": "构建系统更改" },
216-
{ "name": "wrench", "description": "不影响代码的其余变动" },
217-
{ "name": "mag", "description": "改进搜索引擎优化" },
218-
{ "name": "wheel_of_dharma", "description": "Kubernetes 相关的工作" },
219-
{ "name": "label", "description": "添加或者更新类型(Flow, TypeScript)" },
220-
]
221-
222-
const emoji = ref('')
95+
const emoji = ref(defatltEmoji)
22396
22497
const emojiOptions = computed(() => {
22598
return rawEmojis.map((item) => {

src/data/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from "./rawEmojis";
2+
export * from "./type";

src/data/rawEmojis.ts

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
export const rawEmojis = [
2+
{ "name": "art", "description": "结构改进 / 格式化代码" },
3+
{ "name": "zap", "description": "性能改善" },
4+
{ "name": "fire", "description": "删除代码或者文件" },
5+
{ "name": "bug", "description": "修了一个 BUG" },
6+
{ "name": "ambulance", "description": "重大热修复" },
7+
{ "name": "sparkles", "description": "引入新的特性" },
8+
{ "name": "pencil", "description": "写文档" },
9+
{ "name": "rocket", "description": "部署相关" },
10+
{ "name": "lipstick", "description": "更新界面与样式文件" },
11+
{ "name": "tada", "description": "创世提交" },
12+
{ "name": "white_check_mark", "description": "更新测试" },
13+
{ "name": "lock", "description": "修复安全问题" },
14+
{ "name": "apple", "description": "修复在苹果系统上的问题" },
15+
{ "name": "penguin", "description": "修复在 Linux 系统上的问题" },
16+
{ "name": "checkered_flag", "description": "修复在 Windows 系统上的问题" },
17+
{ "name": "robot", "description": "修复在安卓系统上的问题" },
18+
{ "name": "green_apple", "description": "修复在 iOS 系统上的问题" },
19+
{ "name": "bookmark", "description": "发布 / 版本标签" },
20+
{ "name": "rotating_light", "description": "消除 linter 警告" },
21+
{ "name": "construction", "description": "进行中" },
22+
{ "name": "green_heart", "description": "修复持续集成构建" },
23+
{ "name": "arrow_down", "description": "降级依赖" },
24+
{ "name": "arrow_up", "description": "升级依赖" },
25+
{ "name": "pushpin", "description": "固定依赖在特定的版本" },
26+
{ "name": "construction_worker", "description": "添加持续集成构建系统" },
27+
{ "name": "chart_with_upwards_trend", "description": "添加分析或者跟踪代码" },
28+
{ "name": "recycle", "description": "代码重构" },
29+
{ "name": "whale", "description": "Docker 容器相关" },
30+
{ "name": "heavy_plus_sign", "description": "添加依赖" },
31+
{ "name": "heavy_minus_sign", "description": "删除依赖" },
32+
{ "name": "wrench", "description": "改变配置文件" },
33+
{ "name": "globe_with_meridians", "description": "国际化与本地化" },
34+
{ "name": "pencil2", "description": "修正拼写错误" },
35+
{ "name": "poop", "description": "写需要改进的坏代码" },
36+
{ "name": "rewind", "description": "回滚改动" },
37+
{ "name": "twisted_rightwards_arrows", "description": "合并分支" },
38+
{ "name": "package", "description": "更新编译后的文件或者包" },
39+
{ "name": "alien", "description": "由于外部 API 变动而更新代码" },
40+
{ "name": "truck", "description": "文件移动或者重命名" },
41+
{ "name": "page_facing_up", "description": "添加或者更新许可" },
42+
{ "name": "boom", "description": "引入破坏性的改动" },
43+
{ "name": "bento", "description": "添加或者更新静态资源" },
44+
{ "name": "ok_hand", "description": "代码审核后更新代码" },
45+
{ "name": "wheelchair", "description": "改进可访问性" },
46+
{ "name": "bulb", "description": "给源代码加文档" },
47+
{ "name": "beers", "description": "醉写代码" },
48+
{ "name": "speech_balloon", "description": "更新文本和字面" },
49+
{ "name": "card_file_box", "description": "执行数据库相关的改动" },
50+
{ "name": "loud_sound", "description": "添加日志" },
51+
{ "name": "mute", "description": "删除日志" },
52+
{ "name": "busts_in_silhouette", "description": "添加贡献者(们)" },
53+
{ "name": "children_crossing", "description": "改进用户体验 / 可用性" },
54+
{ "name": "building_construction", "description": "架构改动" },
55+
{ "name": "iphone", "description": "响应性设计相关" },
56+
{ "name": "clown_face", "description": "模拟相关" },
57+
{ "name": "egg", "description": "添加一个彩蛋" },
58+
{ "name": "see_no_evil", "description": "添加或者更新 .gitignore 文件" },
59+
{ "name": "camera_flash", "description": "添加或者更新快照" },
60+
{ "name": "alembic", "description": "研究新事物" },
61+
{ "name": "hammer_and_wrench", "description": "构建系统更改" },
62+
{ "name": "wrench", "description": "不影响代码的其余变动" },
63+
{ "name": "mag", "description": "改进搜索引擎优化" },
64+
{ "name": "wheel_of_dharma", "description": "Kubernetes 相关的工作" },
65+
{ "name": "label", "description": "添加或者更新类型(Flow, TypeScript)" },
66+
]

src/data/type.ts

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
export const typeData = [
2+
{
3+
value: "feat",
4+
label: "新功能(feat)",
5+
emoji: "✨",
6+
},
7+
{
8+
value: "fix",
9+
label: "修复bug(fix)",
10+
emoji: "🐛",
11+
},
12+
{
13+
value: "docs",
14+
label: "文档变更(docs)",
15+
emoji: "📝",
16+
},
17+
{
18+
value: "style",
19+
label: "无关代码的格式(style)",
20+
emoji: "🎨",
21+
},
22+
{
23+
value: "refactor",
24+
label: "重构(refactor)",
25+
emoji: "♻️",
26+
},
27+
{
28+
value: "perf",
29+
label: "优化性能(perf)",
30+
emoji: "⚡️",
31+
},
32+
{
33+
value: "test",
34+
label: "增加或更新测试(test)",
35+
emoji: "✅",
36+
},
37+
38+
{
39+
value: "build",
40+
label: "构建系统或外部依赖更改(build)",
41+
emoji: "🛠️",
42+
},
43+
{
44+
value: "ci",
45+
label: "CI配置或脚本变动(ci)",
46+
emoji: "👷",
47+
},
48+
{
49+
value: "chore",
50+
label: "不影响代码的其余变动(chore)",
51+
emoji: "🔧",
52+
},
53+
{
54+
value: "revert",
55+
label: "回退之前版本(revert)",
56+
emoji: "⏪",
57+
},
58+
59+
];

0 commit comments

Comments
 (0)