mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-22 16:11:29 +00:00
feat: migrate to Nuxt 4 (Nitro) and Tailwind CSS v3
This commit is contained in:
parent
f4959eebf8
commit
b139712a91
166 changed files with 19790 additions and 5539 deletions
|
|
@ -1,88 +0,0 @@
|
|||
import type { NeutralMessage, NeutralAuthor } from "../types";
|
||||
import { GITHUB_COLORS } from "./colors";
|
||||
import { branchLink, emojiPrefix, tagLink, type T, buildMessage, repoBaseUrl } from "./helpers";
|
||||
|
||||
export function formatCreate(
|
||||
payload: Record<string, unknown>,
|
||||
repo: string | undefined,
|
||||
author: NeutralAuthor,
|
||||
t: T,
|
||||
showEmoji: boolean,
|
||||
): NeutralMessage {
|
||||
const refType = (payload.ref_type as string) ?? "branch";
|
||||
const ref = (payload.ref as string) ?? t("common.unknown");
|
||||
const baseUrl = repoBaseUrl(payload, repo);
|
||||
const refText = refType === "tag" ? tagLink(baseUrl, ref) : branchLink(baseUrl, ref);
|
||||
|
||||
const emoji = refType === "tag" ? "🏷️" : "🌿";
|
||||
const em = (e: string): string => emojiPrefix(e, showEmoji);
|
||||
|
||||
const fields: Array<{ name: string; value: string; inline?: boolean }> = [];
|
||||
|
||||
fields.push({
|
||||
name: t("fields.type"),
|
||||
value: refType,
|
||||
inline: true,
|
||||
});
|
||||
|
||||
fields.push({
|
||||
name: t("fields.name"),
|
||||
value: refText,
|
||||
inline: true,
|
||||
});
|
||||
|
||||
if (payload.description) {
|
||||
fields.push({
|
||||
name: t("fields.description"),
|
||||
value: payload.description as string,
|
||||
inline: false,
|
||||
});
|
||||
}
|
||||
|
||||
return buildMessage(
|
||||
{
|
||||
author,
|
||||
title: t("events.create.title", {
|
||||
repo: repo ?? t("common.repository"),
|
||||
emoji: em(emoji),
|
||||
type: refType,
|
||||
ref: refText,
|
||||
}),
|
||||
color: GITHUB_COLORS.create,
|
||||
fields,
|
||||
},
|
||||
t,
|
||||
repo,
|
||||
);
|
||||
}
|
||||
|
||||
export function formatDelete(
|
||||
payload: Record<string, unknown>,
|
||||
repo: string | undefined,
|
||||
author: NeutralAuthor,
|
||||
t: T,
|
||||
showEmoji: boolean,
|
||||
): NeutralMessage {
|
||||
const refType = (payload.ref_type as string) ?? "branch";
|
||||
const ref = (payload.ref as string) ?? t("common.unknown");
|
||||
const baseUrl = repoBaseUrl(payload, repo);
|
||||
const refText = refType === "tag" ? tagLink(baseUrl, ref) : branchLink(baseUrl, ref);
|
||||
|
||||
const emoji = refType === "tag" ? "🏷️" : "🌿";
|
||||
const em = (e: string): string => emojiPrefix(e, showEmoji);
|
||||
|
||||
return buildMessage(
|
||||
{
|
||||
author,
|
||||
title: t("events.delete.title", {
|
||||
repo: repo ?? t("common.repository"),
|
||||
emoji: em(emoji),
|
||||
type: refType,
|
||||
ref: refText,
|
||||
}),
|
||||
color: GITHUB_COLORS.delete,
|
||||
},
|
||||
t,
|
||||
repo,
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue