forked from didirus/AstralRinth
Merge commit 'a8caa1afc3115cc79da25d8129e749932c7dc2a5' into feature-elyby-account
This commit is contained in:
@@ -67,9 +67,8 @@ export async function determineModelType(texture: string): Promise<'SLIM' | 'CLA
|
||||
const armWidth = 2
|
||||
const armHeight = 12
|
||||
const imageData = context.getImageData(armX, armY, armWidth, armHeight).data
|
||||
for (let index = 1; index <= imageData.length; index++) {
|
||||
//every fourth value in RGBA is the alpha channel
|
||||
if (index % 4 == 0 && imageData[index - 1] !== 0) {
|
||||
for (let alphaIndex = 3; alphaIndex < imageData.length; alphaIndex += 4) {
|
||||
if (imageData[alphaIndex] !== 0) {
|
||||
resolve('CLASSIC')
|
||||
return
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ async function refreshSearch() {
|
||||
}
|
||||
}
|
||||
results.value = rawResults.result
|
||||
currentPage.value = Math.max(1, Math.min(pageCount.value, currentPage.value))
|
||||
currentPage.value = 1
|
||||
|
||||
const persistentParams: LocationQuery = {}
|
||||
|
||||
@@ -266,6 +266,7 @@ async function onSearchChangeToTop() {
|
||||
|
||||
function clearSearch() {
|
||||
query.value = ''
|
||||
currentPage.value = 1
|
||||
}
|
||||
|
||||
watch(
|
||||
|
||||
@@ -34,7 +34,7 @@ const enabledLocales: string[] = [];
|
||||
/**
|
||||
* Overrides for the categories of the certain locales.
|
||||
*/
|
||||
const localesCategoriesOverrides: Partial<Record<string, "fun" | "experimental">> = {
|
||||
const localesCategoriesOverrides: Partial = {
|
||||
"en-x-pirate": "fun",
|
||||
"en-x-updown": "fun",
|
||||
"en-x-lolcat": "fun",
|
||||
@@ -260,21 +260,28 @@ export default defineNuxtConfig({
|
||||
const omorphiaLocales: string[] = [];
|
||||
const omorphiaLocaleSets = new Map<string, { files: { from: string }[] }>();
|
||||
|
||||
for await (const localeDir of globIterate("node_modules/@modrinth/ui/src/locales/*", {
|
||||
posix: true,
|
||||
})) {
|
||||
const tag = basename(localeDir);
|
||||
omorphiaLocales.push(tag);
|
||||
const externalLocales = [
|
||||
"node_modules/@modrinth/ui/src/locales/en-US",
|
||||
"node_modules/@modrinth/moderation/locales/en-US",
|
||||
];
|
||||
|
||||
const localeFiles: { from: string; format?: string }[] = [];
|
||||
for (const localePath of externalLocales) {
|
||||
for await (const localeDir of globIterate(localePath, {
|
||||
posix: true,
|
||||
})) {
|
||||
const tag = basename(localeDir);
|
||||
omorphiaLocales.push(tag);
|
||||
|
||||
omorphiaLocaleSets.set(tag, { files: localeFiles });
|
||||
const localeFiles: { from: string; format?: string }[] = [];
|
||||
|
||||
for await (const localeFile of globIterate(`${localeDir}/*`, { posix: true })) {
|
||||
localeFiles.push({
|
||||
from: pathToFileURL(localeFile).toString(),
|
||||
format: "default",
|
||||
});
|
||||
omorphiaLocaleSets.set(tag, { files: localeFiles });
|
||||
|
||||
for await (const localeFile of globIterate(`${localeDir}/*`, { posix: true })) {
|
||||
localeFiles.push({
|
||||
from: pathToFileURL(localeFile).toString(),
|
||||
format: "default",
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -301,7 +308,7 @@ export default defineNuxtConfig({
|
||||
format: "crowdin",
|
||||
});
|
||||
} else if (fileName === "meta.json") {
|
||||
const meta: Record<string, { message: string }> = await fs
|
||||
const meta: Record = await fs
|
||||
.readFile(localeFile, "utf8")
|
||||
.then((date) => JSON.parse(date));
|
||||
const localeMeta = (locale.meta ??= {});
|
||||
|
||||
@@ -1,510 +1,442 @@
|
||||
<template>
|
||||
<div v-if="showInvitation" class="universal-card information invited">
|
||||
<h2>Invitation to join project</h2>
|
||||
<p>
|
||||
You've been invited be a member of this project with the role of '{{ currentMember.role }}'.
|
||||
<div v-if="showInvitation" class="universal-card information invited my-4">
|
||||
<h2>{{ getFormattedMessage(messages.invitationTitle) }}</h2>
|
||||
<p v-if="currentMember?.project_role">
|
||||
{{ formatMessage(messages.invitationWithRole, { role: currentMember.project_role }) }}
|
||||
</p>
|
||||
<p v-else>{{ getFormattedMessage(messages.invitationNoRole) }}</p>
|
||||
<div class="input-group">
|
||||
<button class="iconified-button brand-button" @click="acceptInvite()">
|
||||
<CheckIcon />
|
||||
Accept
|
||||
</button>
|
||||
<button class="iconified-button danger-button" @click="declineInvite()">
|
||||
<XIcon />
|
||||
Decline
|
||||
</button>
|
||||
<ButtonStyled color="brand">
|
||||
<button class="brand-button" @click="acceptInvite()">
|
||||
<CheckIcon />
|
||||
{{ getFormattedMessage(messages.accept) }}
|
||||
</button>
|
||||
</ButtonStyled>
|
||||
<ButtonStyled color="red">
|
||||
<button @click="declineInvite">
|
||||
<XIcon />
|
||||
{{ getFormattedMessage(messages.decline) }}
|
||||
</button>
|
||||
</ButtonStyled>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="
|
||||
currentMember &&
|
||||
nags.filter((x) => x.condition).length > 0 &&
|
||||
visibleNags.length > 0 &&
|
||||
(project.status === 'draft' || tags.rejectedStatuses.includes(project.status))
|
||||
"
|
||||
class="author-actions universal-card mb-4"
|
||||
class="universal-card my-4"
|
||||
>
|
||||
<div class="header__row">
|
||||
<div class="header__title">
|
||||
<h2>Publishing checklist</h2>
|
||||
<div class="checklist">
|
||||
<span class="checklist__title">Progress:</span>
|
||||
<div class="checklist__items">
|
||||
<div
|
||||
v-for="nag in nags"
|
||||
:key="`checklist-${nag.id}`"
|
||||
v-tooltip="nag.title"
|
||||
:aria-label="nag.title"
|
||||
:class="'circle ' + (!nag.condition ? 'done' : '') + nag.status"
|
||||
class="circle"
|
||||
>
|
||||
<CheckIcon v-if="!nag.condition" />
|
||||
<AsteriskIcon v-else-if="nag.status === 'required'" />
|
||||
<LightBulbIcon v-else-if="nag.status === 'suggestion'" />
|
||||
<ScaleIcon v-else-if="nag.status === 'review'" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex max-w-full flex-wrap items-center gap-x-6 gap-y-4">
|
||||
<div class="flex flex-auto flex-wrap items-center gap-x-6 gap-y-4">
|
||||
<h2 class="my-0 mr-auto">{{ getFormattedMessage(messages.publishingChecklist) }}</h2>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<button
|
||||
:class="{ 'not-collapsed': !collapsed }"
|
||||
class="square-button"
|
||||
@click="toggleCollapsed()"
|
||||
>
|
||||
<DropdownIcon />
|
||||
</button>
|
||||
<ButtonStyled circular>
|
||||
<button :class="!collapsed && '[&>svg]:rotate-180'" @click="toggleCollapsed()">
|
||||
<DropdownIcon class="duration-250 transition-transform ease-in-out" />
|
||||
</button>
|
||||
</ButtonStyled>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!collapsed" class="grid-display width-16">
|
||||
<div
|
||||
v-for="nag in nags.filter((x) => x.condition && !x.hide)"
|
||||
:key="nag.id"
|
||||
class="grid-display__item"
|
||||
>
|
||||
<span class="label">
|
||||
<AsteriskIcon
|
||||
v-if="nag.status === 'required'"
|
||||
v-tooltip="'Required'"
|
||||
:class="nag.status"
|
||||
aria-label="Required"
|
||||
<div v-if="!collapsed" class="grid-display width-16 mt-4">
|
||||
<div v-for="nag in visibleNags" :key="nag.id" class="grid-display__item">
|
||||
<span class="flex items-center gap-2 font-semibold">
|
||||
<component
|
||||
:is="nag.icon || getDefaultIcon(nag.status)"
|
||||
v-tooltip="getStatusTooltip(nag.status)"
|
||||
:class="[
|
||||
'h-4 w-4',
|
||||
nag.status === 'required' && 'text-red',
|
||||
nag.status === 'warning' && 'text-orange',
|
||||
nag.status === 'suggestion' && 'text-purple',
|
||||
]"
|
||||
:aria-label="getStatusTooltip(nag.status)"
|
||||
/>
|
||||
<LightBulbIcon
|
||||
v-else-if="nag.status === 'suggestion'"
|
||||
v-tooltip="'Suggestion'"
|
||||
:class="nag.status"
|
||||
aria-label="Suggestion"
|
||||
/>
|
||||
<ScaleIcon
|
||||
v-else-if="nag.status === 'review'"
|
||||
v-tooltip="'Review'"
|
||||
:class="nag.status"
|
||||
aria-label="Review"
|
||||
/>{{ nag.title }}</span
|
||||
>
|
||||
{{ nag.description }}
|
||||
{{ getFormattedMessage(nag.title) }}
|
||||
</span>
|
||||
{{ getNagDescription(nag) }}
|
||||
<NuxtLink
|
||||
v-if="nag.link"
|
||||
:class="{ invisible: nag.link.hide }"
|
||||
v-if="nag.link && shouldShowLink(nag)"
|
||||
:to="`/${project.project_type}/${project.slug ? project.slug : project.id}/${
|
||||
nag.link.path
|
||||
}`"
|
||||
class="goto-link"
|
||||
>
|
||||
{{ nag.link.title }}
|
||||
{{ getFormattedMessage(nag.link.title) }}
|
||||
<ChevronRightIcon aria-hidden="true" class="featured-header-chevron" />
|
||||
</NuxtLink>
|
||||
<button
|
||||
v-else-if="nag.action"
|
||||
:disabled="nag.action.disabled()"
|
||||
class="btn btn-orange"
|
||||
@click="nag.action.onClick"
|
||||
<ButtonStyled
|
||||
v-if="nag.status === 'special-submit-action' && nag.id === 'submit-for-review'"
|
||||
color="orange"
|
||||
@click="submitForReview"
|
||||
>
|
||||
<SendIcon />
|
||||
{{ nag.action.title }}
|
||||
</button>
|
||||
<button
|
||||
:disabled="!canSubmitForReview"
|
||||
v-tooltip="
|
||||
!canSubmitForReview ? getFormattedMessage(messages.submitChecklistTooltip) : undefined
|
||||
"
|
||||
>
|
||||
<SendIcon />
|
||||
{{ getFormattedMessage(messages.submitForReview) }}
|
||||
</button>
|
||||
</ButtonStyled>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
ChevronRightIcon,
|
||||
CheckIcon,
|
||||
XIcon,
|
||||
AsteriskIcon,
|
||||
LightBulbIcon,
|
||||
TriangleAlertIcon,
|
||||
DropdownIcon,
|
||||
SendIcon,
|
||||
ScaleIcon,
|
||||
DropdownIcon,
|
||||
} from "@modrinth/assets";
|
||||
import { formatProjectType } from "@modrinth/utils";
|
||||
import { acceptTeamInvite, removeTeamMember } from "~/helpers/teams.js";
|
||||
import { nags } from "@modrinth/moderation";
|
||||
import { ButtonStyled } from "@modrinth/ui";
|
||||
import { useVIntl, defineMessages, type MessageDescriptor } from "@vintl/vintl";
|
||||
import type { Nag, NagContext, NagStatus } from "@modrinth/moderation";
|
||||
import type { Project, User, Version } from "@modrinth/utils";
|
||||
import type { Component } from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
project: {
|
||||
type: Object,
|
||||
required: true,
|
||||
interface Tags {
|
||||
rejectedStatuses: string[];
|
||||
}
|
||||
|
||||
interface Auth {
|
||||
user: {
|
||||
id: string;
|
||||
};
|
||||
}
|
||||
|
||||
interface Member {
|
||||
accepted?: boolean;
|
||||
project_role?: string;
|
||||
user?: Partial<User>;
|
||||
}
|
||||
|
||||
interface Props {
|
||||
project: Project;
|
||||
versions?: Version[];
|
||||
currentMember?: Member | null;
|
||||
allMembers?: Member[] | null;
|
||||
isSettings?: boolean;
|
||||
collapsed?: boolean;
|
||||
routeName?: string;
|
||||
auth: Auth;
|
||||
tags: Tags;
|
||||
setProcessing?: (processing: boolean) => void;
|
||||
toggleCollapsed?: () => void;
|
||||
updateMembers?: () => void | Promise<void>;
|
||||
}
|
||||
|
||||
const messages = defineMessages({
|
||||
invitationTitle: {
|
||||
id: "project-member-header.invitation-title",
|
||||
defaultMessage: "Invitation to join project",
|
||||
},
|
||||
versions: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
},
|
||||
invitationWithRole: {
|
||||
id: "project-member-header.invitation-with-role",
|
||||
defaultMessage: "You've been invited be a member of this project with the role of '{role}'.",
|
||||
},
|
||||
currentMember: {
|
||||
type: Object,
|
||||
default: null,
|
||||
invitationNoRole: {
|
||||
id: "project-member-header.invitation-no-role",
|
||||
defaultMessage:
|
||||
"You've been invited to join this project. Please accept or decline the invitation.",
|
||||
},
|
||||
allMembers: {
|
||||
type: Object,
|
||||
default: null,
|
||||
accept: {
|
||||
id: "project-member-header.accept",
|
||||
defaultMessage: "Accept",
|
||||
},
|
||||
isSettings: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
decline: {
|
||||
id: "project-member-header.decline",
|
||||
defaultMessage: "Decline",
|
||||
},
|
||||
collapsed: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
publishingChecklist: {
|
||||
id: "project-member-header.publishing-checklist",
|
||||
defaultMessage: "Publishing checklist",
|
||||
},
|
||||
routeName: {
|
||||
type: String,
|
||||
default: "",
|
||||
submitForReview: {
|
||||
id: "project-member-header.submit-for-review",
|
||||
defaultMessage: "Submit for review",
|
||||
},
|
||||
auth: {
|
||||
type: Object,
|
||||
required: true,
|
||||
submitForReviewDesc: {
|
||||
id: "project-member-header.submit-for-review-desc",
|
||||
defaultMessage:
|
||||
"Your project is only viewable by members of the project. It must be reviewed by moderators in order to be published.",
|
||||
},
|
||||
tags: {
|
||||
type: Object,
|
||||
required: true,
|
||||
resubmitForReview: {
|
||||
id: "project-member-header.resubmit-for-review",
|
||||
defaultMessage: "Resubmit for review",
|
||||
},
|
||||
setProcessing: {
|
||||
type: Function,
|
||||
default() {
|
||||
return () => {
|
||||
addNotification({
|
||||
group: "main",
|
||||
title: "An error occurred",
|
||||
text: "setProcessing function not found",
|
||||
type: "error",
|
||||
});
|
||||
};
|
||||
},
|
||||
resubmitForReviewDesc: {
|
||||
id: "project-member-header.resubmit-for-review-desc",
|
||||
defaultMessage:
|
||||
"Your project has been {status} by Modrinth's staff. In most cases, you can resubmit for review after addressing the staff's message.",
|
||||
},
|
||||
toggleCollapsed: {
|
||||
type: Function,
|
||||
default() {
|
||||
return () => {
|
||||
addNotification({
|
||||
group: "main",
|
||||
title: "An error occurred",
|
||||
text: "toggleCollapsed function not found",
|
||||
type: "error",
|
||||
});
|
||||
};
|
||||
},
|
||||
visitModerationPage: {
|
||||
id: "project-member-header.visit-moderation-page",
|
||||
defaultMessage: "Visit moderation page",
|
||||
},
|
||||
updateMembers: {
|
||||
type: Function,
|
||||
default() {
|
||||
return () => {
|
||||
addNotification({
|
||||
group: "main",
|
||||
title: "An error occurred",
|
||||
text: "updateMembers function not found",
|
||||
type: "error",
|
||||
});
|
||||
};
|
||||
},
|
||||
submitChecklistTooltip: {
|
||||
id: "project-member-header.submit-checklist-tooltip",
|
||||
defaultMessage: "You must complete the required steps in the publishing checklist!",
|
||||
},
|
||||
successJoin: {
|
||||
id: "project-member-header.success-join",
|
||||
defaultMessage: "You have joined the project team",
|
||||
},
|
||||
errorJoin: {
|
||||
id: "project-member-header.error-join",
|
||||
defaultMessage: "Failed to accept team invitation",
|
||||
},
|
||||
successDecline: {
|
||||
id: "project-member-header.success-decline",
|
||||
defaultMessage: "You have declined the team invitation",
|
||||
},
|
||||
errorDecline: {
|
||||
id: "project-member-header.error-decline",
|
||||
defaultMessage: "Failed to decline team invitation",
|
||||
},
|
||||
success: {
|
||||
id: "project-member-header.success",
|
||||
defaultMessage: "Success",
|
||||
},
|
||||
error: {
|
||||
id: "project-member-header.error",
|
||||
defaultMessage: "Error",
|
||||
},
|
||||
required: {
|
||||
id: "project-member-header.required",
|
||||
defaultMessage: "Required",
|
||||
},
|
||||
warning: {
|
||||
id: "project-member-header.warning",
|
||||
defaultMessage: "Warning",
|
||||
},
|
||||
suggestion: {
|
||||
id: "project-member-header.suggestion",
|
||||
defaultMessage: "Suggestion",
|
||||
},
|
||||
});
|
||||
|
||||
const featuredGalleryImage = computed(() => props.project.gallery.find((img) => img.featured));
|
||||
const { formatMessage } = useVIntl();
|
||||
|
||||
const nags = computed(() => [
|
||||
{
|
||||
condition: props.versions.length < 1,
|
||||
title: "Upload a version",
|
||||
id: "upload-version",
|
||||
description: "At least one version is required for a project to be submitted for review.",
|
||||
status: "required",
|
||||
link: {
|
||||
path: "versions",
|
||||
title: "Visit versions page",
|
||||
hide: props.routeName === "type-id-versions",
|
||||
},
|
||||
},
|
||||
{
|
||||
condition:
|
||||
props.project.body === "" || props.project.body.startsWith("# Placeholder description"),
|
||||
title: "Add a description",
|
||||
id: "add-description",
|
||||
description:
|
||||
"A description that clearly describes the project's purpose and function is required.",
|
||||
status: "required",
|
||||
link: {
|
||||
path: "settings/description",
|
||||
title: "Visit description settings",
|
||||
hide: props.routeName === "type-id-settings-description",
|
||||
},
|
||||
},
|
||||
{
|
||||
condition: !props.project.icon_url,
|
||||
title: "Add an icon",
|
||||
id: "add-icon",
|
||||
description:
|
||||
"Your project should have a nice-looking icon to uniquely identify your project at a glance.",
|
||||
status: "suggestion",
|
||||
link: {
|
||||
path: "settings",
|
||||
title: "Visit general settings",
|
||||
hide: props.routeName === "type-id-settings",
|
||||
},
|
||||
},
|
||||
{
|
||||
condition: props.project.gallery.length === 0 || !featuredGalleryImage,
|
||||
title: "Feature a gallery image",
|
||||
id: "feature-gallery-image",
|
||||
description: "Featured gallery images may be the first impression of many users.",
|
||||
status: "suggestion",
|
||||
link: {
|
||||
path: "gallery",
|
||||
title: "Visit gallery page",
|
||||
hide: props.routeName === "type-id-gallery",
|
||||
},
|
||||
},
|
||||
{
|
||||
hide: props.project.versions.length === 0,
|
||||
condition: props.project.categories.length < 1,
|
||||
title: "Select tags",
|
||||
id: "select-tags",
|
||||
description: "Select all tags that apply to your project.",
|
||||
status: "suggestion",
|
||||
link: {
|
||||
path: "settings/tags",
|
||||
title: "Visit tag settings",
|
||||
hide: props.routeName === "type-id-settings-tags",
|
||||
},
|
||||
},
|
||||
{
|
||||
condition: !(
|
||||
props.project.issues_url ||
|
||||
props.project.source_url ||
|
||||
props.project.wiki_url ||
|
||||
props.project.discord_url ||
|
||||
props.project.donation_urls.length > 0
|
||||
),
|
||||
title: "Add external links",
|
||||
id: "add-links",
|
||||
description:
|
||||
"Add any relevant links targeted outside of Modrinth, such as sources, issues, or a Discord invite.",
|
||||
status: "suggestion",
|
||||
link: {
|
||||
path: "settings/links",
|
||||
title: "Visit links settings",
|
||||
hide: props.routeName === "type-id-settings-links",
|
||||
},
|
||||
},
|
||||
{
|
||||
hide:
|
||||
props.project.versions.length === 0 ||
|
||||
props.project.project_type === "resourcepack" ||
|
||||
props.project.project_type === "plugin" ||
|
||||
props.project.project_type === "shader" ||
|
||||
props.project.project_type === "datapack",
|
||||
condition:
|
||||
props.project.client_side === "unknown" ||
|
||||
props.project.server_side === "unknown" ||
|
||||
(props.project.client_side === "unsupported" && props.project.server_side === "unsupported"),
|
||||
title: "Select supported environments",
|
||||
id: "select-environments",
|
||||
description: `Select if the ${formatProjectType(
|
||||
props.project.project_type,
|
||||
).toLowerCase()} functions on the client-side and/or server-side.`,
|
||||
status: "required",
|
||||
link: {
|
||||
path: "settings",
|
||||
title: "Visit general settings",
|
||||
hide: props.routeName === "type-id-settings",
|
||||
},
|
||||
},
|
||||
{
|
||||
condition: props.project.license.id === "LicenseRef-Unknown",
|
||||
title: "Select license",
|
||||
id: "select-license",
|
||||
description: `Select the license your ${formatProjectType(
|
||||
props.project.project_type,
|
||||
).toLowerCase()} is distributed under.`,
|
||||
status: "required",
|
||||
link: {
|
||||
path: "settings/license",
|
||||
title: "Visit license settings",
|
||||
hide: props.routeName === "type-id-settings-license",
|
||||
},
|
||||
},
|
||||
{
|
||||
condition: props.project.status === "draft",
|
||||
title: "Submit for review",
|
||||
id: "submit-for-review",
|
||||
description:
|
||||
"Your project is only viewable by members of the project. It must be reviewed by moderators in order to be published.",
|
||||
status: "review",
|
||||
link: null,
|
||||
action: {
|
||||
onClick: submitForReview,
|
||||
title: "Submit for review",
|
||||
disabled: () => nags.value.filter((x) => x.condition && x.status === "required").length > 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
hide: props.project.stats === "draft",
|
||||
condition: props.tags.rejectedStatuses.includes(props.project.status),
|
||||
title: "Resubmit for review",
|
||||
id: "resubmit-for-review",
|
||||
description: `Your project has been ${props.project.status} by
|
||||
Modrinth's staff. In most cases, you can resubmit for review after
|
||||
addressing the staff's message.`,
|
||||
status: "review",
|
||||
link: {
|
||||
path: "moderation",
|
||||
title: "Visit moderation page",
|
||||
hide: props.routeName === "type-id-moderation",
|
||||
},
|
||||
},
|
||||
]);
|
||||
function getNagDescription(nag: Nag): string {
|
||||
if (typeof nag.description === "function") {
|
||||
return nag.description(nagContext.value);
|
||||
}
|
||||
return formatMessage(nag.description);
|
||||
}
|
||||
|
||||
const showInvitation = computed(() => {
|
||||
function getFormattedMessage(message: string | MessageDescriptor): string {
|
||||
if (typeof message === "string") {
|
||||
return message;
|
||||
}
|
||||
return formatMessage(message);
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
versions: () => [],
|
||||
currentMember: null,
|
||||
allMembers: null,
|
||||
isSettings: false,
|
||||
collapsed: false,
|
||||
routeName: "",
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
toggleCollapsed: [];
|
||||
updateMembers: [];
|
||||
setProcessing: [processing: boolean];
|
||||
}>();
|
||||
|
||||
const nagContext = computed<NagContext>(() => ({
|
||||
project: props.project,
|
||||
versions: props.versions,
|
||||
currentMember: props.currentMember as User,
|
||||
currentRoute: props.routeName,
|
||||
tags: props.tags,
|
||||
submitProject: submitForReview,
|
||||
}));
|
||||
|
||||
const canSubmitForReview = computed(() => {
|
||||
return (
|
||||
applicableNags.value.filter((nag) => nag.status === "required" && !isNagComplete(nag))
|
||||
.length === 0
|
||||
);
|
||||
});
|
||||
|
||||
async function submitForReview() {
|
||||
if (canSubmitForReview) {
|
||||
await setProcessing(true);
|
||||
}
|
||||
}
|
||||
|
||||
const applicableNags = computed<Nag[]>(() => {
|
||||
return nags.filter((nag) => {
|
||||
return nag.shouldShow(nagContext.value);
|
||||
});
|
||||
});
|
||||
|
||||
function isNagComplete(nag: Nag): boolean {
|
||||
const context = nagContext.value;
|
||||
return !nag.shouldShow(context);
|
||||
}
|
||||
|
||||
const visibleNags = computed<Nag[]>(() => {
|
||||
const finalNags = applicableNags.value.filter((nag) => !isNagComplete(nag));
|
||||
|
||||
if (props.project.status === "draft") {
|
||||
finalNags.push({
|
||||
id: "submit-for-review",
|
||||
title: messages.submitForReview,
|
||||
description: () => formatMessage(messages.submitForReviewDesc),
|
||||
status: "special-submit-action",
|
||||
shouldShow: (ctx) => ctx.project.status === "draft",
|
||||
});
|
||||
}
|
||||
|
||||
if (props.tags.rejectedStatuses.includes(props.project.status)) {
|
||||
finalNags.push({
|
||||
id: "resubmit-for-review",
|
||||
title: messages.resubmitForReview,
|
||||
description: (ctx) =>
|
||||
formatMessage(messages.resubmitForReviewDesc, { status: ctx.project.status }),
|
||||
status: "special-submit-action",
|
||||
shouldShow: (ctx) => ctx.tags.rejectedStatuses.includes(ctx.project.status),
|
||||
link: {
|
||||
path: "moderation",
|
||||
title: messages.visitModerationPage,
|
||||
shouldShow: () => props.routeName !== "type-id-moderation",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return finalNags;
|
||||
});
|
||||
|
||||
function shouldShowLink(nag: Nag): boolean {
|
||||
return nag.link?.shouldShow ? nag.link.shouldShow(nagContext.value) : false;
|
||||
}
|
||||
|
||||
function getDefaultIcon(status: NagStatus): Component {
|
||||
switch (status) {
|
||||
case "required":
|
||||
return AsteriskIcon;
|
||||
case "warning":
|
||||
return TriangleAlertIcon;
|
||||
case "suggestion":
|
||||
return LightBulbIcon;
|
||||
case "special-submit-action":
|
||||
return ScaleIcon;
|
||||
default:
|
||||
return AsteriskIcon;
|
||||
}
|
||||
}
|
||||
|
||||
function getStatusTooltip(status: NagStatus): string {
|
||||
switch (status) {
|
||||
case "required":
|
||||
return formatMessage(messages.required);
|
||||
case "warning":
|
||||
return formatMessage(messages.warning);
|
||||
case "suggestion":
|
||||
return formatMessage(messages.suggestion);
|
||||
default:
|
||||
return formatMessage(messages.required);
|
||||
}
|
||||
}
|
||||
|
||||
const showInvitation = computed<boolean>(() => {
|
||||
if (props.allMembers && props.auth) {
|
||||
const member = props.allMembers.find((x) => x.user.id === props.auth.user.id);
|
||||
return member && !member.accepted;
|
||||
const member = props.allMembers.find((x) => x?.user?.id === props.auth.user.id);
|
||||
return !!member && !member.accepted;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
const acceptInvite = () => {
|
||||
acceptTeamInvite(props.project.team);
|
||||
props.updateMembers();
|
||||
};
|
||||
|
||||
const declineInvite = () => {
|
||||
removeTeamMember(props.project.team, props.auth.user.id);
|
||||
props.updateMembers();
|
||||
};
|
||||
|
||||
const submitForReview = async () => {
|
||||
if (
|
||||
!props.acknowledgedMessage ||
|
||||
nags.value.filter((x) => x.condition && x.status === "required").length === 0
|
||||
) {
|
||||
await props.setProcessing();
|
||||
function toggleCollapsed(): void {
|
||||
if (props.toggleCollapsed) {
|
||||
props.toggleCollapsed();
|
||||
} else {
|
||||
emit("toggleCollapsed");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
async function updateMembers(): Promise<void> {
|
||||
if (props.updateMembers) {
|
||||
await props.updateMembers();
|
||||
} else {
|
||||
emit("updateMembers");
|
||||
}
|
||||
}
|
||||
|
||||
function setProcessing(processing: boolean): void {
|
||||
if (props.setProcessing) {
|
||||
props.setProcessing(processing);
|
||||
} else {
|
||||
emit("setProcessing", processing);
|
||||
}
|
||||
}
|
||||
|
||||
async function acceptInvite(): Promise<void> {
|
||||
try {
|
||||
setProcessing(true);
|
||||
await acceptTeamInvite(props.project.team);
|
||||
await updateMembers();
|
||||
addNotification({
|
||||
group: "main",
|
||||
title: formatMessage(messages.success),
|
||||
text: formatMessage(messages.successJoin),
|
||||
type: "success",
|
||||
});
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
group: "main",
|
||||
title: formatMessage(messages.error),
|
||||
text: formatMessage(messages.errorJoin),
|
||||
type: "error",
|
||||
});
|
||||
} finally {
|
||||
setProcessing(false);
|
||||
}
|
||||
}
|
||||
|
||||
async function declineInvite(): Promise<void> {
|
||||
try {
|
||||
setProcessing(true);
|
||||
await removeTeamMember(props.project.team, props.auth.user.id);
|
||||
await updateMembers();
|
||||
addNotification({
|
||||
group: "main",
|
||||
title: formatMessage(messages.success),
|
||||
text: formatMessage(messages.successDecline),
|
||||
type: "success",
|
||||
});
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
group: "main",
|
||||
title: formatMessage(messages.error),
|
||||
text: formatMessage(messages.errorDecline),
|
||||
type: "error",
|
||||
});
|
||||
} finally {
|
||||
setProcessing(false);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.invited {
|
||||
}
|
||||
|
||||
.author-actions {
|
||||
margin-top: var(--spacing-card-md);
|
||||
|
||||
&:empty {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.invisible {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.header__row {
|
||||
align-items: center;
|
||||
column-gap: var(--spacing-card-lg);
|
||||
row-gap: var(--spacing-card-md);
|
||||
max-width: 100%;
|
||||
|
||||
.header__title {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
column-gap: var(--spacing-card-lg);
|
||||
row-gap: var(--spacing-card-md);
|
||||
flex-basis: min-content;
|
||||
|
||||
h2 {
|
||||
margin: 0 auto 0 0;
|
||||
}
|
||||
}
|
||||
|
||||
button {
|
||||
svg {
|
||||
transition: transform 0.25s ease-in-out;
|
||||
}
|
||||
|
||||
&.not-collapsed svg {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.grid-display__item .label {
|
||||
display: flex;
|
||||
gap: var(--spacing-card-xs);
|
||||
align-items: center;
|
||||
|
||||
.required {
|
||||
color: var(--color-red);
|
||||
}
|
||||
|
||||
.suggestion {
|
||||
color: var(--color-purple);
|
||||
}
|
||||
|
||||
.review {
|
||||
color: var(--color-orange);
|
||||
}
|
||||
}
|
||||
|
||||
.checklist {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: var(--spacing-card-xs);
|
||||
width: fit-content;
|
||||
flex-wrap: wrap;
|
||||
max-width: 100%;
|
||||
|
||||
.checklist__title {
|
||||
font-weight: bold;
|
||||
margin-right: var(--spacing-card-xs);
|
||||
color: var(--color-text-dark);
|
||||
}
|
||||
|
||||
.checklist__items {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: var(--spacing-card-xs);
|
||||
width: fit-content;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.circle {
|
||||
--circle-size: 2rem;
|
||||
--background-color: var(--color-bg);
|
||||
--content-color: var(--color-gray);
|
||||
width: var(--circle-size);
|
||||
height: var(--circle-size);
|
||||
border-radius: 50%;
|
||||
background-color: var(--background-color);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
svg {
|
||||
color: var(--content-color);
|
||||
width: calc(var(--circle-size) / 2);
|
||||
height: calc(var(--circle-size) / 2);
|
||||
}
|
||||
|
||||
&.required {
|
||||
--content-color: var(--color-red);
|
||||
}
|
||||
|
||||
&.suggestion {
|
||||
--content-color: var(--color-purple);
|
||||
}
|
||||
|
||||
&.review {
|
||||
--content-color: var(--color-orange);
|
||||
}
|
||||
|
||||
&.done {
|
||||
--background-color: var(--color-green);
|
||||
--content-color: var(--color-brand-inverted);
|
||||
}
|
||||
}
|
||||
}
|
||||
.duration-250 {
|
||||
transition-duration: 250ms;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -464,7 +464,7 @@ const stageTextExpanded = computedAsync(async () => {
|
||||
const stage = checklist[stageIndex];
|
||||
if (stage.text) {
|
||||
return renderHighlightedString(
|
||||
expandVariables(await stage.text(), props.project, variables.value),
|
||||
expandVariables(await stage.text(props.project), props.project, variables.value),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
@@ -980,6 +980,18 @@ async function processAction(
|
||||
}
|
||||
|
||||
function shouldShowStage(stage: Stage): boolean {
|
||||
let hasVisibleActions = false;
|
||||
|
||||
for (const a of stage.actions) {
|
||||
if (shouldShowAction(a)) {
|
||||
hasVisibleActions = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasVisibleActions) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (typeof stage.shouldShow === "function") {
|
||||
return stage.shouldShow(props.project);
|
||||
}
|
||||
|
||||
@@ -172,6 +172,7 @@ const flags = useFeatureFlags();
|
||||
|
||||
.markdown-body {
|
||||
grid-area: body;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.reporter-info {
|
||||
|
||||
@@ -194,13 +194,12 @@ export class ModrinthServer {
|
||||
}
|
||||
|
||||
async testNodeReachability(): Promise<boolean> {
|
||||
if (!this.general?.datacenter) {
|
||||
console.warn("No datacenter info available for ping test");
|
||||
if (!this.general?.node?.instance) {
|
||||
console.warn("No node instance available for ping test");
|
||||
return false;
|
||||
}
|
||||
|
||||
const datacenter = this.general.datacenter;
|
||||
const wsUrl = `wss://${datacenter}.nodes.modrinth.com/pingtest`;
|
||||
const wsUrl = `wss://${this.general.node.instance}/pingtest`;
|
||||
|
||||
try {
|
||||
return await new Promise((resolve) => {
|
||||
|
||||
@@ -700,7 +700,6 @@ import {
|
||||
PackageOpenIcon,
|
||||
DiscordIcon,
|
||||
BlueskyIcon,
|
||||
TumblrIcon,
|
||||
TwitterIcon,
|
||||
MastodonIcon,
|
||||
GithubIcon,
|
||||
@@ -1185,13 +1184,6 @@ const socialLinks = [
|
||||
icon: MastodonIcon,
|
||||
rel: "me",
|
||||
},
|
||||
{
|
||||
label: formatMessage(
|
||||
defineMessage({ id: "layout.footer.social.tumblr", defaultMessage: "Tumblr" }),
|
||||
),
|
||||
href: "https://tumblr.com/modrinth",
|
||||
icon: TumblrIcon,
|
||||
},
|
||||
{
|
||||
label: formatMessage(defineMessage({ id: "layout.footer.social.x", defaultMessage: "X" })),
|
||||
href: "https://x.com/modrinth",
|
||||
|
||||
@@ -461,9 +461,6 @@
|
||||
"layout.footer.social.mastodon": {
|
||||
"message": "Mastodon"
|
||||
},
|
||||
"layout.footer.social.tumblr": {
|
||||
"message": "Tumblr"
|
||||
},
|
||||
"layout.footer.social.x": {
|
||||
"message": "X"
|
||||
},
|
||||
@@ -536,6 +533,69 @@
|
||||
"profile.user-id": {
|
||||
"message": "User ID: {id}"
|
||||
},
|
||||
"project-member-header.accept": {
|
||||
"message": "Accept"
|
||||
},
|
||||
"project-member-header.decline": {
|
||||
"message": "Decline"
|
||||
},
|
||||
"project-member-header.error": {
|
||||
"message": "Error"
|
||||
},
|
||||
"project-member-header.error-decline": {
|
||||
"message": "Failed to decline team invitation"
|
||||
},
|
||||
"project-member-header.error-join": {
|
||||
"message": "Failed to accept team invitation"
|
||||
},
|
||||
"project-member-header.invitation-no-role": {
|
||||
"message": "You've been invited to join this project. Please accept or decline the invitation."
|
||||
},
|
||||
"project-member-header.invitation-title": {
|
||||
"message": "Invitation to join project"
|
||||
},
|
||||
"project-member-header.invitation-with-role": {
|
||||
"message": "You've been invited be a member of this project with the role of '{role}'."
|
||||
},
|
||||
"project-member-header.publishing-checklist": {
|
||||
"message": "Publishing checklist"
|
||||
},
|
||||
"project-member-header.required": {
|
||||
"message": "Required"
|
||||
},
|
||||
"project-member-header.resubmit-for-review": {
|
||||
"message": "Resubmit for review"
|
||||
},
|
||||
"project-member-header.resubmit-for-review-desc": {
|
||||
"message": "Your project has been {status} by Modrinth's staff. In most cases, you can resubmit for review after addressing the staff's message."
|
||||
},
|
||||
"project-member-header.submit-checklist-tooltip": {
|
||||
"message": "You must complete the required steps in the publishing checklist!"
|
||||
},
|
||||
"project-member-header.submit-for-review": {
|
||||
"message": "Submit for review"
|
||||
},
|
||||
"project-member-header.submit-for-review-desc": {
|
||||
"message": "Your project is only viewable by members of the project. It must be reviewed by moderators in order to be published."
|
||||
},
|
||||
"project-member-header.success": {
|
||||
"message": "Success"
|
||||
},
|
||||
"project-member-header.success-decline": {
|
||||
"message": "You have declined the team invitation"
|
||||
},
|
||||
"project-member-header.success-join": {
|
||||
"message": "You have joined the project team"
|
||||
},
|
||||
"project-member-header.suggestion": {
|
||||
"message": "Suggestion"
|
||||
},
|
||||
"project-member-header.visit-moderation-page": {
|
||||
"message": "Visit moderation page"
|
||||
},
|
||||
"project-member-header.warning": {
|
||||
"message": "Warning"
|
||||
},
|
||||
"project-type.collection.plural": {
|
||||
"message": "Collections"
|
||||
},
|
||||
|
||||
@@ -22,6 +22,10 @@
|
||||
"
|
||||
:on-image-upload="onUploadHandler"
|
||||
/>
|
||||
<div v-if="descriptionWarning" class="flex items-center gap-1.5 text-orange">
|
||||
<TriangleAlertIcon class="my-auto" />
|
||||
{{ descriptionWarning }}
|
||||
</div>
|
||||
<div class="input-group markdown-disclaimer">
|
||||
<button
|
||||
:disabled="!hasChanges"
|
||||
@@ -38,7 +42,8 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { SaveIcon } from "@modrinth/assets";
|
||||
import { SaveIcon, TriangleAlertIcon } from "@modrinth/assets";
|
||||
import { MIN_DESCRIPTION_CHARS } from "@modrinth/moderation";
|
||||
import { MarkdownEditor } from "@modrinth/ui";
|
||||
import { type Project, type TeamMember, TeamMemberPermission } from "@modrinth/utils";
|
||||
import { computed, ref } from "vue";
|
||||
@@ -53,6 +58,17 @@ const props = defineProps<{
|
||||
|
||||
const description = ref(props.project.body);
|
||||
|
||||
const descriptionWarning = computed(() => {
|
||||
const text = description.value?.trim() || "";
|
||||
const charCount = text.length;
|
||||
|
||||
if (charCount < MIN_DESCRIPTION_CHARS) {
|
||||
return `It's recommended to have a description with at least ${MIN_DESCRIPTION_CHARS} characters. (${charCount}/${MIN_DESCRIPTION_CHARS})`;
|
||||
}
|
||||
|
||||
return null;
|
||||
});
|
||||
|
||||
const patchRequestPayload = computed(() => {
|
||||
const payload: {
|
||||
body?: string;
|
||||
|
||||
@@ -82,6 +82,10 @@
|
||||
<label for="project-summary">
|
||||
<span class="label__title">Summary</span>
|
||||
</label>
|
||||
<div v-if="summaryWarning" class="my-2 flex items-center gap-1.5 text-orange">
|
||||
<TriangleAlertIcon class="my-auto" />
|
||||
{{ summaryWarning }}
|
||||
</div>
|
||||
<div class="textarea-wrapper summary-input">
|
||||
<textarea
|
||||
id="project-summary"
|
||||
@@ -240,9 +244,18 @@
|
||||
|
||||
<script setup>
|
||||
import { formatProjectStatus, formatProjectType } from "@modrinth/utils";
|
||||
import { UploadIcon, SaveIcon, TrashIcon, XIcon, IssuesIcon, CheckIcon } from "@modrinth/assets";
|
||||
import {
|
||||
UploadIcon,
|
||||
SaveIcon,
|
||||
TrashIcon,
|
||||
XIcon,
|
||||
IssuesIcon,
|
||||
CheckIcon,
|
||||
TriangleAlertIcon,
|
||||
} from "@modrinth/assets";
|
||||
import { Multiselect } from "vue-multiselect";
|
||||
import { ConfirmModal, Avatar } from "@modrinth/ui";
|
||||
import { MIN_SUMMARY_CHARS } from "@modrinth/moderation";
|
||||
import FileInput from "~/components/ui/FileInput.vue";
|
||||
|
||||
const props = defineProps({
|
||||
@@ -300,6 +313,17 @@ const hasDeletePermission = computed(() => {
|
||||
return (props.currentMember.permissions & DELETE_PROJECT) === DELETE_PROJECT;
|
||||
});
|
||||
|
||||
const summaryWarning = computed(() => {
|
||||
const text = summary.value?.trim() || "";
|
||||
const charCount = text.length;
|
||||
|
||||
if (charCount < MIN_SUMMARY_CHARS) {
|
||||
return `It's recommended to have a summary with at least ${MIN_SUMMARY_CHARS} characters. (${charCount}/${MIN_SUMMARY_CHARS})`;
|
||||
}
|
||||
|
||||
return null;
|
||||
});
|
||||
|
||||
const sideTypes = ["required", "optional", "unsupported"];
|
||||
|
||||
const patchData = computed(() => {
|
||||
|
||||
@@ -7,11 +7,16 @@
|
||||
id="project-issue-tracker"
|
||||
title="A place for users to report bugs, issues, and concerns about your project."
|
||||
>
|
||||
<span class="label__title">Issue tracker</span>
|
||||
<span class="label__title">Issue tracker </span>
|
||||
<span class="label__description">
|
||||
A place for users to report bugs, issues, and concerns about your project.
|
||||
</span>
|
||||
</label>
|
||||
<TriangleAlertIcon
|
||||
v-if="!isIssuesUrlCommon"
|
||||
v-tooltip="`You're using a link which isn't common for this link type.`"
|
||||
class="size-6 animate-pulse text-orange"
|
||||
/>
|
||||
<input
|
||||
id="project-issue-tracker"
|
||||
v-model="issuesUrl"
|
||||
@@ -26,11 +31,16 @@
|
||||
id="project-source-code"
|
||||
title="A page/repository containing the source code for your project"
|
||||
>
|
||||
<span class="label__title">Source code</span>
|
||||
<span class="label__title">Source code </span>
|
||||
<span class="label__description">
|
||||
A page/repository containing the source code for your project
|
||||
</span>
|
||||
</label>
|
||||
<TriangleAlertIcon
|
||||
v-if="!isSourceUrlCommon"
|
||||
v-tooltip="`You're using a link which isn't common for this link type.`"
|
||||
class="size-6 animate-pulse text-orange"
|
||||
/>
|
||||
<input
|
||||
id="project-source-code"
|
||||
v-model="sourceUrl"
|
||||
@@ -61,9 +71,14 @@
|
||||
</div>
|
||||
<div class="adjacent-input">
|
||||
<label id="project-discord-invite" title="An invitation link to your Discord server.">
|
||||
<span class="label__title">Discord invite</span>
|
||||
<span class="label__title">Discord invite </span>
|
||||
<span class="label__description"> An invitation link to your Discord server. </span>
|
||||
</label>
|
||||
<TriangleAlertIcon
|
||||
v-if="!isDiscordUrlCommon"
|
||||
v-tooltip="`You're using a link which isn't common for this link type.`"
|
||||
class="size-6 animate-pulse text-orange"
|
||||
/>
|
||||
<input
|
||||
id="project-discord-invite"
|
||||
v-model="discordUrl"
|
||||
@@ -123,7 +138,8 @@
|
||||
|
||||
<script setup>
|
||||
import { DropdownSelect } from "@modrinth/ui";
|
||||
import { SaveIcon } from "@modrinth/assets";
|
||||
import { SaveIcon, TriangleAlertIcon } from "@modrinth/assets";
|
||||
import { isCommonUrl, commonLinkDomains } from "@modrinth/moderation";
|
||||
|
||||
const tags = useTags();
|
||||
|
||||
@@ -153,6 +169,21 @@ const sourceUrl = ref(props.project.source_url);
|
||||
const wikiUrl = ref(props.project.wiki_url);
|
||||
const discordUrl = ref(props.project.discord_url);
|
||||
|
||||
const isIssuesUrlCommon = computed(() => {
|
||||
if (!issuesUrl.value || issuesUrl.value.trim().length === 0) return true;
|
||||
return isCommonUrl(issuesUrl.value, commonLinkDomains.issues);
|
||||
});
|
||||
|
||||
const isSourceUrlCommon = computed(() => {
|
||||
if (!sourceUrl.value || sourceUrl.value.trim().length === 0) return true;
|
||||
return isCommonUrl(sourceUrl.value, commonLinkDomains.source);
|
||||
});
|
||||
|
||||
const isDiscordUrlCommon = computed(() => {
|
||||
if (!discordUrl.value || discordUrl.value.trim().length === 0) return true;
|
||||
return isCommonUrl(discordUrl.value, commonLinkDomains.discord);
|
||||
});
|
||||
|
||||
const rawDonationLinks = JSON.parse(JSON.stringify(props.project.donation_urls));
|
||||
rawDonationLinks.push({
|
||||
id: null,
|
||||
|
||||
@@ -6,11 +6,31 @@
|
||||
<span class="label__title size-card-header">Tags</span>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="tooManyTagsWarning && !allTagsSelectedWarning"
|
||||
class="my-2 flex items-center gap-1.5 text-orange"
|
||||
>
|
||||
<TriangleAlertIcon class="my-auto" />
|
||||
{{ tooManyTagsWarning }}
|
||||
</div>
|
||||
|
||||
<div v-if="multipleResolutionTagsWarning" class="my-2 flex items-center gap-1.5 text-orange">
|
||||
<TriangleAlertIcon class="my-auto" />
|
||||
{{ multipleResolutionTagsWarning }}
|
||||
</div>
|
||||
|
||||
<div v-if="allTagsSelectedWarning" class="my-2 flex items-center gap-1.5 text-red">
|
||||
<TriangleAlertIcon class="my-auto" />
|
||||
<span>{{ allTagsSelectedWarning }}</span>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
Accurate tagging is important to help people find your
|
||||
{{ formatProjectType(project.project_type).toLowerCase() }}. Make sure to select all tags
|
||||
that apply.
|
||||
</p>
|
||||
|
||||
<p v-if="project.versions.length === 0" class="known-errors">
|
||||
Please upload a version first in order to select tags!
|
||||
</p>
|
||||
@@ -112,145 +132,181 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { StarIcon, SaveIcon } from "@modrinth/assets";
|
||||
import { formatCategory, formatCategoryHeader, formatProjectType } from "@modrinth/utils";
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from "vue";
|
||||
import { StarIcon, SaveIcon, TriangleAlertIcon } from "@modrinth/assets";
|
||||
import {
|
||||
formatCategory,
|
||||
formatCategoryHeader,
|
||||
formatProjectType,
|
||||
sortedCategories,
|
||||
type Project,
|
||||
} from "@modrinth/utils";
|
||||
import Checkbox from "~/components/ui/Checkbox.vue";
|
||||
|
||||
export default defineNuxtComponent({
|
||||
components: {
|
||||
Checkbox,
|
||||
SaveIcon,
|
||||
StarIcon,
|
||||
},
|
||||
props: {
|
||||
project: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {};
|
||||
},
|
||||
},
|
||||
allMembers: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
},
|
||||
},
|
||||
currentMember: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null;
|
||||
},
|
||||
},
|
||||
patchProject: {
|
||||
type: Function,
|
||||
default() {
|
||||
return () => {
|
||||
this.$notify({
|
||||
group: "main",
|
||||
title: "An error occurred",
|
||||
text: "Patch project function not found",
|
||||
type: "error",
|
||||
});
|
||||
};
|
||||
},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
selectedTags: this.$sortedCategories().filter(
|
||||
(x) =>
|
||||
x.project_type === this.project.actualProjectType &&
|
||||
(this.project.categories.includes(x.name) ||
|
||||
this.project.additional_categories.includes(x.name)),
|
||||
),
|
||||
featuredTags: this.$sortedCategories().filter(
|
||||
(x) =>
|
||||
x.project_type === this.project.actualProjectType &&
|
||||
this.project.categories.includes(x.name),
|
||||
),
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
categoryLists() {
|
||||
const lists = {};
|
||||
this.$sortedCategories().forEach((x) => {
|
||||
if (x.project_type === this.project.actualProjectType) {
|
||||
const header = x.header;
|
||||
if (!lists[header]) {
|
||||
lists[header] = [];
|
||||
}
|
||||
lists[header].push(x);
|
||||
}
|
||||
});
|
||||
return lists;
|
||||
},
|
||||
patchData() {
|
||||
const data = {};
|
||||
// Promote selected categories to featured if there are less than 3 featured
|
||||
const newFeaturedTags = this.featuredTags.slice();
|
||||
if (newFeaturedTags.length < 1 && this.selectedTags.length > newFeaturedTags.length) {
|
||||
const nonFeaturedCategories = this.selectedTags.filter((x) => !newFeaturedTags.includes(x));
|
||||
interface Category {
|
||||
name: string;
|
||||
header: string;
|
||||
icon?: string;
|
||||
project_type: string;
|
||||
}
|
||||
|
||||
nonFeaturedCategories
|
||||
.slice(0, Math.min(nonFeaturedCategories.length, 3 - newFeaturedTags.length))
|
||||
.forEach((x) => newFeaturedTags.push(x));
|
||||
}
|
||||
// Convert selected and featured categories to backend-usable arrays
|
||||
const categories = newFeaturedTags.map((x) => x.name);
|
||||
const additionalCategories = this.selectedTags
|
||||
.filter((x) => !newFeaturedTags.includes(x))
|
||||
.map((x) => x.name);
|
||||
interface Props {
|
||||
project: Project & {
|
||||
actualProjectType: string;
|
||||
};
|
||||
allMembers?: any[];
|
||||
currentMember?: any;
|
||||
patchProject?: (data: any) => void;
|
||||
}
|
||||
|
||||
if (
|
||||
categories.length !== this.project.categories.length ||
|
||||
categories.some((value) => !this.project.categories.includes(value))
|
||||
) {
|
||||
data.categories = categories;
|
||||
}
|
||||
const tags = useTags();
|
||||
|
||||
if (
|
||||
additionalCategories.length !== this.project.additional_categories.length ||
|
||||
additionalCategories.some((value) => !this.project.additional_categories.includes(value))
|
||||
) {
|
||||
data.additional_categories = additionalCategories;
|
||||
}
|
||||
|
||||
return data;
|
||||
},
|
||||
hasChanges() {
|
||||
return Object.keys(this.patchData).length > 0;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
formatProjectType,
|
||||
formatCategoryHeader,
|
||||
formatCategory,
|
||||
toggleCategory(category) {
|
||||
if (this.selectedTags.includes(category)) {
|
||||
this.selectedTags = this.selectedTags.filter((x) => x !== category);
|
||||
if (this.featuredTags.includes(category)) {
|
||||
this.featuredTags = this.featuredTags.filter((x) => x !== category);
|
||||
}
|
||||
} else {
|
||||
this.selectedTags.push(category);
|
||||
}
|
||||
},
|
||||
toggleFeaturedCategory(category) {
|
||||
if (this.featuredTags.includes(category)) {
|
||||
this.featuredTags = this.featuredTags.filter((x) => x !== category);
|
||||
} else {
|
||||
this.featuredTags.push(category);
|
||||
}
|
||||
},
|
||||
saveChanges() {
|
||||
if (this.hasChanges) {
|
||||
this.patchProject(this.patchData);
|
||||
}
|
||||
},
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
allMembers: () => [],
|
||||
currentMember: null,
|
||||
patchProject: () => {
|
||||
addNotification({
|
||||
title: "An error occurred",
|
||||
text: "Patch project function not found",
|
||||
type: "error",
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
const selectedTags = ref<Category[]>(
|
||||
sortedCategories(tags.value).filter(
|
||||
(x: Category) =>
|
||||
x.project_type === props.project.actualProjectType &&
|
||||
(props.project.categories.includes(x.name) ||
|
||||
props.project.additional_categories.includes(x.name)),
|
||||
),
|
||||
);
|
||||
|
||||
const featuredTags = ref<Category[]>(
|
||||
sortedCategories(tags.value).filter(
|
||||
(x: Category) =>
|
||||
x.project_type === props.project.actualProjectType &&
|
||||
props.project.categories.includes(x.name),
|
||||
),
|
||||
);
|
||||
|
||||
const categoryLists = computed(() => {
|
||||
const lists: Record<string, Category[]> = {};
|
||||
sortedCategories(tags.value).forEach((x: Category) => {
|
||||
if (x.project_type === props.project.actualProjectType) {
|
||||
const header = x.header;
|
||||
if (!lists[header]) {
|
||||
lists[header] = [];
|
||||
}
|
||||
lists[header].push(x);
|
||||
}
|
||||
});
|
||||
return lists;
|
||||
});
|
||||
|
||||
const tooManyTagsWarning = computed(() => {
|
||||
const tagCount = selectedTags.value.length;
|
||||
if (tagCount > 5) {
|
||||
return `You've selected ${tagCount} tags. Consider reducing to 5 or fewer to keep your project focused and easier to discover.`;
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
const multipleResolutionTagsWarning = computed(() => {
|
||||
if (props.project.project_type !== "resourcepack") return null;
|
||||
|
||||
const resolutionTags = selectedTags.value.filter((tag) =>
|
||||
["16x", "32x", "48x", "64x", "128x", "256x", "512x", "1024x"].includes(tag.name),
|
||||
);
|
||||
|
||||
if (resolutionTags.length > 1) {
|
||||
return `You've selected ${resolutionTags.length} resolution tags (${resolutionTags.map((t) => t.name).join(", ")}). Resource packs should typically only have one resolution tag.`;
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
const allTagsSelectedWarning = computed(() => {
|
||||
const categoriesForProjectType = sortedCategories(tags.value).filter(
|
||||
(x: Category) => x.project_type === props.project.actualProjectType,
|
||||
);
|
||||
const totalSelectedTags = selectedTags.value.length;
|
||||
|
||||
if (
|
||||
totalSelectedTags === categoriesForProjectType.length &&
|
||||
categoriesForProjectType.length > 0
|
||||
) {
|
||||
return `You've selected all ${categoriesForProjectType.length} available tags. Please select only the tags that truly apply to your project.`;
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
const patchData = computed(() => {
|
||||
const data: Record<string, string[]> = {};
|
||||
|
||||
// Promote selected categories to featured if there are less than 3 featured
|
||||
const newFeaturedTags = featuredTags.value.slice();
|
||||
if (newFeaturedTags.length < 1 && selectedTags.value.length > newFeaturedTags.length) {
|
||||
const nonFeaturedCategories = selectedTags.value.filter((x) => !newFeaturedTags.includes(x));
|
||||
|
||||
nonFeaturedCategories
|
||||
.slice(0, Math.min(nonFeaturedCategories.length, 3 - newFeaturedTags.length))
|
||||
.forEach((x) => newFeaturedTags.push(x));
|
||||
}
|
||||
|
||||
// Convert selected and featured categories to backend-usable arrays
|
||||
const categories = newFeaturedTags.map((x) => x.name);
|
||||
const additionalCategories = selectedTags.value
|
||||
.filter((x) => !newFeaturedTags.includes(x))
|
||||
.map((x) => x.name);
|
||||
|
||||
if (
|
||||
categories.length !== props.project.categories.length ||
|
||||
categories.some((value) => !props.project.categories.includes(value))
|
||||
) {
|
||||
data.categories = categories;
|
||||
}
|
||||
|
||||
if (
|
||||
additionalCategories.length !== props.project.additional_categories.length ||
|
||||
additionalCategories.some((value) => !props.project.additional_categories.includes(value))
|
||||
) {
|
||||
data.additional_categories = additionalCategories;
|
||||
}
|
||||
|
||||
return data;
|
||||
});
|
||||
|
||||
const hasChanges = computed(() => {
|
||||
return Object.keys(patchData.value).length > 0;
|
||||
});
|
||||
|
||||
const toggleCategory = (category: Category) => {
|
||||
if (selectedTags.value.includes(category)) {
|
||||
selectedTags.value = selectedTags.value.filter((x) => x !== category);
|
||||
if (featuredTags.value.includes(category)) {
|
||||
featuredTags.value = featuredTags.value.filter((x) => x !== category);
|
||||
}
|
||||
} else {
|
||||
selectedTags.value.push(category);
|
||||
}
|
||||
};
|
||||
|
||||
const toggleFeaturedCategory = (category: Category) => {
|
||||
if (featuredTags.value.includes(category)) {
|
||||
featuredTags.value = featuredTags.value.filter((x) => x !== category);
|
||||
} else {
|
||||
featuredTags.value.push(category);
|
||||
}
|
||||
};
|
||||
|
||||
const saveChanges = () => {
|
||||
if (hasChanges.value) {
|
||||
props.patchProject(patchData.value);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.label__title {
|
||||
display: flex;
|
||||
|
||||
@@ -45,8 +45,9 @@
|
||||
<h2
|
||||
class="relative m-0 max-w-2xl text-base font-normal leading-[155%] text-secondary md:text-[1.2rem]"
|
||||
>
|
||||
Modrinth Servers is the easiest way to host your own Minecraft server. Seamlessly install
|
||||
and play your favorite mods and modpacks, all within the Modrinth platform.
|
||||
Modrinth Servers is the easiest way to host your own Minecraft: Java Edition server.
|
||||
Seamlessly install and play your favorite mods and modpacks, all within the Modrinth
|
||||
platform.
|
||||
</h2>
|
||||
<div class="relative flex w-full flex-wrap items-center gap-8 align-middle sm:w-fit">
|
||||
<div
|
||||
@@ -459,7 +460,7 @@
|
||||
</p>
|
||||
</details>
|
||||
|
||||
<details pyro-hash="players" class="group" :open="$route.hash === '#players'">
|
||||
<details pyro-hash="performance" class="group" :open="$route.hash === '#performance'">
|
||||
<summary class="flex cursor-pointer items-center py-3 font-medium text-contrast">
|
||||
<span class="mr-2 transition-transform duration-200 group-open:rotate-90">
|
||||
<RightArrowIcon />
|
||||
@@ -480,7 +481,7 @@
|
||||
</p>
|
||||
</details>
|
||||
|
||||
<details pyro-hash="players" class="group" :open="$route.hash === '#prices'">
|
||||
<details pyro-hash="prices" class="group" :open="$route.hash === '#prices'">
|
||||
<summary class="flex cursor-pointer items-center py-3 font-medium text-contrast">
|
||||
<span class="mr-2 transition-transform duration-200 group-open:rotate-90">
|
||||
<RightArrowIcon />
|
||||
@@ -491,6 +492,24 @@
|
||||
All prices are listed in United States Dollars (USD).
|
||||
</p>
|
||||
</details>
|
||||
|
||||
<details pyro-hash="versions" class="group" :open="$route.hash === '#versions'">
|
||||
<summary class="flex cursor-pointer items-center py-3 font-medium text-contrast">
|
||||
<span class="mr-2 transition-transform duration-200 group-open:rotate-90">
|
||||
<RightArrowIcon />
|
||||
</span>
|
||||
What Minecraft versions and loaders can be used?
|
||||
</summary>
|
||||
<p class="m-0 ml-6 leading-[160%]">
|
||||
Modrinth Servers can run any version of Minecraft: Java Edition going all the way
|
||||
back to version 1.2.5, including snapshot versions.
|
||||
</p>
|
||||
<p class="m-0 ml-6 mt-3 leading-[160%]">
|
||||
We also support a wide range of mod and plugin loaders, including Fabric, Quilt,
|
||||
Forge, and NeoForge for mods, as well as Paper and Purpur for plugins. Availability
|
||||
depends on whether the mod or plugin loader supports the selected Minecraft version.
|
||||
</p>
|
||||
</details>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -98,13 +98,6 @@
|
||||
"date": "2023-02-01T20:00:00.000Z",
|
||||
"link": "https://modrinth.com/news/article/accelerating-development"
|
||||
},
|
||||
{
|
||||
"title": "Two years of Modrinth: a retrospective",
|
||||
"summary": "The history of Modrinth as we know it from December 2020 to December 2022.",
|
||||
"thumbnail": "https://modrinth.com/news/default.webp",
|
||||
"date": "2023-01-07T00:00:00.000Z",
|
||||
"link": "https://modrinth.com/news/article/two-years-of-modrinth-history"
|
||||
},
|
||||
{
|
||||
"title": "Modrinth's Anniversary Update",
|
||||
"summary": "Marking two years of Modrinth and discussing our New Year's Resolutions for 2023.",
|
||||
@@ -112,6 +105,13 @@
|
||||
"date": "2023-01-07T00:00:00.000Z",
|
||||
"link": "https://modrinth.com/news/article/two-years-of-modrinth"
|
||||
},
|
||||
{
|
||||
"title": "Two years of Modrinth: a retrospective",
|
||||
"summary": "The history of Modrinth as we know it from December 2020 to December 2022.",
|
||||
"thumbnail": "https://modrinth.com/news/default.webp",
|
||||
"date": "2023-01-07T00:00:00.000Z",
|
||||
"link": "https://modrinth.com/news/article/two-years-of-modrinth-history"
|
||||
},
|
||||
{
|
||||
"title": "Creators can now make money on Modrinth!",
|
||||
"summary": "Introducing the Creator Monetization Program allowing creators to earn revenue from their projects.",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -43,7 +43,9 @@ pub enum AuthenticationError {
|
||||
InvalidAuthMethod,
|
||||
#[error("GitHub Token from incorrect Client ID")]
|
||||
InvalidClientId,
|
||||
#[error("User email/account is already registered on Modrinth")]
|
||||
#[error(
|
||||
"User email is already registered on Modrinth. Try 'Forgot password' to access your account."
|
||||
)]
|
||||
DuplicateUser,
|
||||
#[error("Invalid state sent, you probably need to get a new websocket")]
|
||||
SocketError,
|
||||
|
||||
@@ -223,8 +223,8 @@ impl TempUser {
|
||||
stripe_customer_id: None,
|
||||
totp_secret: None,
|
||||
username,
|
||||
email: self.email,
|
||||
email_verified: true,
|
||||
email: self.email.clone(),
|
||||
email_verified: self.email.is_some(),
|
||||
avatar_url,
|
||||
raw_avatar_url,
|
||||
bio: self.bio,
|
||||
@@ -1419,15 +1419,15 @@ pub async fn create_account_with_password(
|
||||
.hash_password(new_account.password.as_bytes(), &salt)?
|
||||
.to_string();
|
||||
|
||||
if crate::database::models::DBUser::get_by_email(
|
||||
if !crate::database::models::DBUser::get_by_case_insensitive_email(
|
||||
&new_account.email,
|
||||
&**pool,
|
||||
)
|
||||
.await?
|
||||
.is_some()
|
||||
.is_empty()
|
||||
{
|
||||
return Err(ApiError::InvalidInput(
|
||||
"Email is already registered on Modrinth!".to_string(),
|
||||
"Email is already registered on Modrinth! Try 'Forgot password' to access your account.".to_string(),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -2220,6 +2220,18 @@ pub async fn set_email(
|
||||
.await?
|
||||
.1;
|
||||
|
||||
if !crate::database::models::DBUser::get_by_case_insensitive_email(
|
||||
&email.email,
|
||||
&**pool,
|
||||
)
|
||||
.await?
|
||||
.is_empty()
|
||||
{
|
||||
return Err(ApiError::InvalidInput(
|
||||
"Email is already registered on Modrinth! Try 'Forgot password' in incognito to access and delete your other account.".to_string(),
|
||||
));
|
||||
}
|
||||
|
||||
let mut transaction = pool.begin().await?;
|
||||
|
||||
sqlx::query!(
|
||||
|
||||
@@ -13,7 +13,9 @@
|
||||
"app:build": "turbo run build --filter=@modrinth/app",
|
||||
"app:fix": "turbo run fix --filter=@modrinth/app",
|
||||
"app:intl:extract": "pnpm run --filter=@modrinth/app-frontend intl:extract",
|
||||
"blog:fix": "turbo run fix --filter=@modrinth/blog",
|
||||
"pages:build": "NITRO_PRESET=cloudflare-pages pnpm --filter frontend run build",
|
||||
"moderation:fix": "turbo run fix --filter=@modrinth/moderation",
|
||||
"build": "turbo run build --continue",
|
||||
"lint": "turbo run lint --continue",
|
||||
"test": "turbo run test --continue",
|
||||
|
||||
@@ -284,6 +284,12 @@ async fn import_mmc_unmanaged(
|
||||
component.version.clone().unwrap_or_default(),
|
||||
));
|
||||
}
|
||||
if component.uid.starts_with("net.neoforged") {
|
||||
return Some((
|
||||
PackDependency::NeoForge,
|
||||
component.version.clone().unwrap_or_default(),
|
||||
));
|
||||
}
|
||||
if component.uid.starts_with("org.quiltmc.quilt-loader") {
|
||||
return Some((
|
||||
PackDependency::QuiltLoader,
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { promises as fs } from 'fs'
|
||||
import * as path from 'path'
|
||||
import fastGlob from 'fast-glob'
|
||||
import { repoPath, toVarName } from './utils'
|
||||
import { glob } from 'glob'
|
||||
|
||||
import { PUBLIC_SRC, PUBLIC_LOCATIONS, ARTICLES_GLOB, COMPILED_DIR } from './blog.config'
|
||||
|
||||
async function checkPublicAssets() {
|
||||
const srcFiles = await fastGlob(['**/*'], { cwd: PUBLIC_SRC, dot: true })
|
||||
const srcFiles = await glob('**/*', { cwd: PUBLIC_SRC, dot: true })
|
||||
let allOk = true
|
||||
for (const target of PUBLIC_LOCATIONS) {
|
||||
for (const relativeFile of srcFiles) {
|
||||
const shouldExist = path.join(target, relativeFile)
|
||||
const shouldExist = path.posix.join(target, relativeFile)
|
||||
try {
|
||||
await fs.access(shouldExist)
|
||||
} catch {
|
||||
@@ -26,15 +26,15 @@ async function checkPublicAssets() {
|
||||
}
|
||||
|
||||
async function checkCompiledArticles() {
|
||||
const mdFiles = await fastGlob([ARTICLES_GLOB])
|
||||
const compiledFiles = await fastGlob([`${COMPILED_DIR}/*.ts`])
|
||||
const mdFiles = await glob(ARTICLES_GLOB)
|
||||
const compiledFiles = await glob(`${COMPILED_DIR}/*.ts`)
|
||||
const compiledVarNames = compiledFiles.map((f) => path.basename(f, '.ts'))
|
||||
|
||||
// Check all .md have compiled .ts and .content.ts and the proper public thumbnail
|
||||
for (const file of mdFiles) {
|
||||
const varName = toVarName(path.basename(file, '.md'))
|
||||
const compiledPath = path.join(COMPILED_DIR, varName + '.ts')
|
||||
const contentPath = path.join(COMPILED_DIR, varName + '.content.ts')
|
||||
const compiledPath = path.posix.join(COMPILED_DIR, varName + '.ts')
|
||||
const contentPath = path.posix.join(COMPILED_DIR, varName + '.content.ts')
|
||||
if (!compiledVarNames.includes(varName)) {
|
||||
console.error(`⚠️ Missing compiled article for: ${file} (should be: ${compiledPath})`)
|
||||
process.exit(1)
|
||||
@@ -59,7 +59,7 @@ async function checkCompiledArticles() {
|
||||
if (varName === 'index' || varName.endsWith('.content')) continue
|
||||
|
||||
const mdPathGlob = repoPath(`packages/blog/articles/**/${varName.replace(/_/g, '*')}.md`)
|
||||
const found = await fastGlob([mdPathGlob])
|
||||
const found = await glob(mdPathGlob)
|
||||
if (!found.length) {
|
||||
console.error(`❌ Compiled article ${compiled} has no matching markdown source!`)
|
||||
process.exit(1)
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { promises as fs } from 'fs'
|
||||
import * as path from 'path'
|
||||
import fg from 'fast-glob'
|
||||
import matter from 'gray-matter'
|
||||
import { md } from '@modrinth/utils'
|
||||
import { minify } from 'html-minifier-terser'
|
||||
import { copyDir, toVarName } from './utils'
|
||||
import RSS from 'rss'
|
||||
import { parseStringPromise } from 'xml2js'
|
||||
import { glob } from 'glob'
|
||||
|
||||
import {
|
||||
ARTICLES_GLOB,
|
||||
@@ -24,7 +24,7 @@ async function ensureCompiledDir() {
|
||||
}
|
||||
|
||||
async function hasThumbnail(slug: string): Promise<boolean> {
|
||||
const thumbnailPath = path.join(PUBLIC_SRC, slug, 'thumbnail.webp')
|
||||
const thumbnailPath = path.posix.join(PUBLIC_SRC, slug, 'thumbnail.webp')
|
||||
try {
|
||||
await fs.access(thumbnailPath)
|
||||
return true
|
||||
@@ -48,7 +48,7 @@ function getThumbnailUrl(slug: string, hasThumb: boolean): string {
|
||||
async function compileArticles() {
|
||||
await ensureCompiledDir()
|
||||
|
||||
const files = await fg([ARTICLES_GLOB])
|
||||
const files = await glob(ARTICLES_GLOB)
|
||||
console.log(`🔎 Found ${files.length} markdown articles!`)
|
||||
const articleExports: string[] = []
|
||||
const articlesArray: string[] = []
|
||||
@@ -75,8 +75,8 @@ async function compileArticles() {
|
||||
|
||||
const slug = frontSlug || path.basename(file, '.md')
|
||||
const varName = toVarName(slug)
|
||||
const exportFile = path.join(COMPILED_DIR, `${varName}.ts`)
|
||||
const contentFile = path.join(COMPILED_DIR, `${varName}.content.ts`)
|
||||
const exportFile = path.posix.join(COMPILED_DIR, `${varName}.ts`)
|
||||
const contentFile = path.posix.join(COMPILED_DIR, `${varName}.content.ts`)
|
||||
const thumbnailPresent = await hasThumbnail(slug)
|
||||
|
||||
const contentTs = `
|
||||
@@ -221,7 +221,7 @@ async function deleteDirContents(dir: string) {
|
||||
const entries = await fs.readdir(dir, { withFileTypes: true })
|
||||
await Promise.all(
|
||||
entries.map(async (entry) => {
|
||||
const fullPath = path.join(dir, entry.name)
|
||||
const fullPath = path.posix.join(dir, entry.name)
|
||||
if (entry.isDirectory()) {
|
||||
await fs.rm(fullPath, { recursive: true, force: true })
|
||||
} else {
|
||||
|
||||
@@ -1,56 +1,56 @@
|
||||
// AUTO-GENERATED FILE - DO NOT EDIT
|
||||
import { article as a_new_chapter_for_modrinth_servers } from './a_new_chapter_for_modrinth_servers'
|
||||
import { article as accelerating_development } from './accelerating_development'
|
||||
import { article as becoming_sustainable } from './becoming_sustainable'
|
||||
import { article as capital_return } from './capital_return'
|
||||
import { article as carbon_ads } from './carbon_ads'
|
||||
import { article as creator_monetization } from './creator_monetization'
|
||||
import { article as creator_update } from './creator_update'
|
||||
import { article as creator_updates_july_2025 } from './creator_updates_july_2025'
|
||||
import { article as design_refresh } from './design_refresh'
|
||||
import { article as download_adjustment } from './download_adjustment'
|
||||
import { article as knossos_v2_1_0 } from './knossos_v2_1_0'
|
||||
import { article as licensing_guide } from './licensing_guide'
|
||||
import { article as modpack_changes } from './modpack_changes'
|
||||
import { article as modpacks_alpha } from './modpacks_alpha'
|
||||
import { article as modrinth_app_beta } from './modrinth_app_beta'
|
||||
import { article as modrinth_beta } from './modrinth_beta'
|
||||
import { article as modrinth_servers_beta } from './modrinth_servers_beta'
|
||||
import { article as new_site_beta } from './new_site_beta'
|
||||
import { article as plugins_resource_packs } from './plugins_resource_packs'
|
||||
import { article as pride_campaign_2025 } from './pride_campaign_2025'
|
||||
import { article as redesign } from './redesign'
|
||||
import { article as skins_now_in_modrinth_app } from './skins_now_in_modrinth_app'
|
||||
import { article as two_years_of_modrinth_history } from './two_years_of_modrinth_history'
|
||||
import { article as two_years_of_modrinth } from './two_years_of_modrinth'
|
||||
import { article as whats_modrinth } from './whats_modrinth'
|
||||
import { article as windows_borderless_malware_disclosure } from './windows_borderless_malware_disclosure'
|
||||
import { article as whats_modrinth } from './whats_modrinth'
|
||||
import { article as two_years_of_modrinth } from './two_years_of_modrinth'
|
||||
import { article as two_years_of_modrinth_history } from './two_years_of_modrinth_history'
|
||||
import { article as skins_now_in_modrinth_app } from './skins_now_in_modrinth_app'
|
||||
import { article as redesign } from './redesign'
|
||||
import { article as pride_campaign_2025 } from './pride_campaign_2025'
|
||||
import { article as plugins_resource_packs } from './plugins_resource_packs'
|
||||
import { article as new_site_beta } from './new_site_beta'
|
||||
import { article as modrinth_servers_beta } from './modrinth_servers_beta'
|
||||
import { article as modrinth_beta } from './modrinth_beta'
|
||||
import { article as modrinth_app_beta } from './modrinth_app_beta'
|
||||
import { article as modpacks_alpha } from './modpacks_alpha'
|
||||
import { article as modpack_changes } from './modpack_changes'
|
||||
import { article as licensing_guide } from './licensing_guide'
|
||||
import { article as knossos_v2_1_0 } from './knossos_v2_1_0'
|
||||
import { article as download_adjustment } from './download_adjustment'
|
||||
import { article as design_refresh } from './design_refresh'
|
||||
import { article as creator_updates_july_2025 } from './creator_updates_july_2025'
|
||||
import { article as creator_update } from './creator_update'
|
||||
import { article as creator_monetization } from './creator_monetization'
|
||||
import { article as carbon_ads } from './carbon_ads'
|
||||
import { article as capital_return } from './capital_return'
|
||||
import { article as becoming_sustainable } from './becoming_sustainable'
|
||||
import { article as accelerating_development } from './accelerating_development'
|
||||
import { article as a_new_chapter_for_modrinth_servers } from './a_new_chapter_for_modrinth_servers'
|
||||
|
||||
export const articles = [
|
||||
a_new_chapter_for_modrinth_servers,
|
||||
accelerating_development,
|
||||
becoming_sustainable,
|
||||
capital_return,
|
||||
carbon_ads,
|
||||
creator_monetization,
|
||||
creator_update,
|
||||
creator_updates_july_2025,
|
||||
design_refresh,
|
||||
download_adjustment,
|
||||
knossos_v2_1_0,
|
||||
licensing_guide,
|
||||
modpack_changes,
|
||||
modpacks_alpha,
|
||||
modrinth_app_beta,
|
||||
modrinth_beta,
|
||||
modrinth_servers_beta,
|
||||
new_site_beta,
|
||||
plugins_resource_packs,
|
||||
pride_campaign_2025,
|
||||
redesign,
|
||||
skins_now_in_modrinth_app,
|
||||
two_years_of_modrinth_history,
|
||||
two_years_of_modrinth,
|
||||
whats_modrinth,
|
||||
windows_borderless_malware_disclosure,
|
||||
whats_modrinth,
|
||||
two_years_of_modrinth,
|
||||
two_years_of_modrinth_history,
|
||||
skins_now_in_modrinth_app,
|
||||
redesign,
|
||||
pride_campaign_2025,
|
||||
plugins_resource_packs,
|
||||
new_site_beta,
|
||||
modrinth_servers_beta,
|
||||
modrinth_beta,
|
||||
modrinth_app_beta,
|
||||
modpacks_alpha,
|
||||
modpack_changes,
|
||||
licensing_guide,
|
||||
knossos_v2_1_0,
|
||||
download_adjustment,
|
||||
design_refresh,
|
||||
creator_updates_july_2025,
|
||||
creator_update,
|
||||
creator_monetization,
|
||||
carbon_ads,
|
||||
capital_return,
|
||||
becoming_sustainable,
|
||||
accelerating_development,
|
||||
a_new_chapter_for_modrinth_servers,
|
||||
]
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
"fix": "jiti ./compile.ts && eslint . --fix && prettier --write ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/glob": "^9.0.0",
|
||||
"@types/html-minifier-terser": "^7.0.2",
|
||||
"@types/rss": "^0.0.32",
|
||||
"@types/xml2js": "^0.4.14",
|
||||
@@ -19,7 +20,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@modrinth/utils": "workspace:*",
|
||||
"fast-glob": "^3.3.3",
|
||||
"glob": "^10.2.7",
|
||||
"gray-matter": "^4.0.3",
|
||||
"html-minifier-terser": "^7.2.0",
|
||||
"rss": "^1.2.2",
|
||||
|
||||
@@ -8,7 +8,7 @@ export function getRepoRoot(): string {
|
||||
}
|
||||
|
||||
export function repoPath(...segments: string[]): string {
|
||||
return path.join(getRepoRoot(), ...segments)
|
||||
return path.posix.join(getRepoRoot(), ...segments)
|
||||
}
|
||||
|
||||
export async function copyDir(
|
||||
@@ -20,8 +20,8 @@ export async function copyDir(
|
||||
await fs.mkdir(dest, { recursive: true })
|
||||
const entries = await fs.readdir(src, { withFileTypes: true })
|
||||
for (const entry of entries) {
|
||||
const srcPath = path.join(src, entry.name)
|
||||
const destPath = path.join(dest, entry.name)
|
||||
const srcPath = path.posix.join(src, entry.name)
|
||||
const destPath = path.posix.join(dest, entry.name)
|
||||
if (entry.isDirectory()) {
|
||||
await copyDir(srcPath, destPath, logFn)
|
||||
} else if (entry.isFile()) {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<!-- TODO: After checklist v1.5, move everything into src directory. -->
|
||||
|
||||
# @modrinth/moderation
|
||||
|
||||
This package contains the moderation checklist system used for reviewing projects on Modrinth. It provides a structured and transparent way to define moderation stages, actions, and messages that are displayed to moderators during the review process.
|
||||
This package contains both the moderation checklist system used by moderators for reviewing projects on Modrinth, and the publishing checklist (nag system) that provides automated feedback to project authors during the submission process.
|
||||
|
||||
## Structure
|
||||
|
||||
@@ -9,22 +11,31 @@ The package is organized as follows:
|
||||
```
|
||||
/packages/moderation/
|
||||
├── data/
|
||||
│ ├── checklist.ts # Main checklist definition - imports and exports all stages
|
||||
│ ├── messages/ # Markdown files containing message templates
|
||||
│ ├── checklist.ts # Main moderation checklist definition - imports and exports all stages
|
||||
│ ├── messages/ # Markdown files containing message templates for moderation
|
||||
│ │ ├── title/ # Messages for the title stage
|
||||
│ │ ├── description/ # Messages for the description stage
|
||||
│ │ └── ... # One directory per stage
|
||||
│ └── stages/ # Stage definition files
|
||||
│ ├── title.ts # Title stage definition
|
||||
│ ├── description.ts # Description stage definition
|
||||
│ └── ... # One file per stage
|
||||
│ ├── stages/ # Moderation stage definition files
|
||||
│ │ ├── title.ts # Title stage definition
|
||||
│ │ ├── description.ts # Description stage definition
|
||||
│ │ └── ... # One file per stage
|
||||
│ └── nags/ # Publishing checklist (nag system) files
|
||||
│ ├── core.ts # Core nags (required fields, basic validation)
|
||||
│ ├── core.i18n.ts # Internationalization messages for core nags
|
||||
│ └── ...
|
||||
└── types/ # Type definitions
|
||||
├── actions.ts # Action-related types
|
||||
├── messages.ts # Message-related types
|
||||
└── stage.ts # Stage-related types
|
||||
├── actions.ts # Action-related types (moderation)
|
||||
├── messages.ts # Message-related types (moderation)
|
||||
├── stage.ts # Stage-related types (moderation)
|
||||
└── nags.ts # Nag-related types (publishing checklist)
|
||||
```
|
||||
|
||||
## Stages
|
||||
## Moderation Checklist System
|
||||
|
||||
The moderation checklist provides a structured and transparent way to define moderation stages, actions, and messages that are displayed to moderators during the review process.
|
||||
|
||||
### Stages
|
||||
|
||||
A stage represents a discrete step in the moderation process, like checking a project's title, description, or links. Each stage has:
|
||||
|
||||
@@ -35,7 +46,7 @@ A stage represents a discrete step in the moderation process, like checking a pr
|
||||
|
||||
Stages are defined in individual files in the `data/stages` directory and are assembled into the complete checklist in `data/checklist.ts`.
|
||||
|
||||
## Actions
|
||||
### Actions
|
||||
|
||||
Actions represent decisions moderators can make for each stage. They can be buttons, dropdowns, toggles, etc. Actions can have:
|
||||
|
||||
@@ -47,11 +58,11 @@ Actions represent decisions moderators can make for each stage. They can be butt
|
||||
|
||||
Each action requires a unique `id` field that is used for conditional logic and action relationships. The `suggestedStatus` and `severity` fields help determine the overall moderation outcome.
|
||||
|
||||
## Messages
|
||||
### Messages
|
||||
|
||||
Messages are the actual text that will be included in communications to project authors. To promote maintainability and reuse, messages are stored as Markdown files in the `data/messages` directory, organized by stage.
|
||||
|
||||
### Variable replacement
|
||||
#### Variable replacement
|
||||
|
||||
You can use variables in your messages that will be replaced with user input:
|
||||
|
||||
@@ -81,11 +92,11 @@ More text after the variable.
|
||||
|
||||
The `%MESSAGE%` placeholder will be replaced with the text entered by the moderator.
|
||||
|
||||
## Conditional logic
|
||||
### Conditional logic
|
||||
|
||||
The moderation system supports conditional behavior that changes based on the selection of other actions.
|
||||
|
||||
### Conditional messages
|
||||
#### Conditional messages
|
||||
|
||||
You can define different messages for an action based on other selected actions:
|
||||
|
||||
@@ -108,7 +119,7 @@ You can define different messages for an action based on other selected actions:
|
||||
}
|
||||
```
|
||||
|
||||
### Enabling and disabling actions
|
||||
#### Enabling and disabling actions
|
||||
|
||||
Actions can enable or disable other actions when selected:
|
||||
|
||||
@@ -131,7 +142,7 @@ Actions can enable or disable other actions when selected:
|
||||
}
|
||||
```
|
||||
|
||||
### Conditional text inputs
|
||||
#### Conditional text inputs
|
||||
|
||||
Text inputs can be conditionally shown based on selected actions:
|
||||
|
||||
@@ -147,3 +158,101 @@ relevantExtraInput: [
|
||||
},
|
||||
]
|
||||
```
|
||||
|
||||
## Publishing Checklist (Nag System)
|
||||
|
||||
The nag system provides automated feedback to project authors during the submission process, helping them improve their projects before they reach moderation. It analyzes project data and provides suggestions, warnings, and requirements.
|
||||
|
||||
### Nags
|
||||
|
||||
A nag represents a specific issue or suggestion for improvement. Each nag has:
|
||||
|
||||
- A unique `id` for identification
|
||||
- A `title` and `description` displayed to the user
|
||||
- A `status` indicating severity: `'required'`, `'warning'`, or `'suggestion'`
|
||||
- A `shouldShow` function that determines when the nag should be displayed
|
||||
- An optional `link` to help users address the issue
|
||||
|
||||
### Internationalization
|
||||
|
||||
Each nag category has a corresponding `.i18n.ts` file containing message definitions:
|
||||
|
||||
```typescript
|
||||
// Example from core.i18n.ts
|
||||
export default defineMessages({
|
||||
addDescriptionTitle: {
|
||||
id: 'nags.add-description.title',
|
||||
defaultMessage: 'Add a description',
|
||||
},
|
||||
addDescriptionDescription: {
|
||||
id: 'nags.add-description.description',
|
||||
defaultMessage:
|
||||
"A description that clearly describes the project's purpose and function is required.",
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
If you want to use context in the messages, you can do so like this:
|
||||
|
||||
```typescript
|
||||
description: (context: NagContext) => {
|
||||
const { formatMessage } = useVIntl()
|
||||
|
||||
return formatMessage(messages.descriptionTooShortDescription, {
|
||||
length: context.project.body?.length || 0,
|
||||
minChars: MIN_DESCRIPTION_CHARS,
|
||||
})
|
||||
}
|
||||
```
|
||||
|
||||
### Nag Context
|
||||
|
||||
The `NagContext` type provides access to:
|
||||
|
||||
- `project`: Current project data
|
||||
- `versions`: Project versions
|
||||
- `tags`: Frontend "tags" (generated state)
|
||||
- `currentRoute`: Current page route
|
||||
- and other data...
|
||||
|
||||
### Adding New Nags
|
||||
|
||||
To add a new nag:
|
||||
|
||||
1. Add the nag definition to the appropriate category file (or make a new category file and add it to `data/nags.ts`)
|
||||
2. Add corresponding i18n messages to the `.i18n.ts` file
|
||||
3. Implement the `shouldShow` logic based on project state
|
||||
4. Add appropriate links to help users resolve the issue
|
||||
5. Run `pnpm run fix` to fix lint issues & generate the root locale index.json file.
|
||||
|
||||
Example:
|
||||
|
||||
```typescript
|
||||
// In description.ts
|
||||
{
|
||||
id: 'new-nag',
|
||||
title: messages.newNagTitle,
|
||||
description: messages.newNagDescription,
|
||||
status: 'warning',
|
||||
shouldShow: (context: NagContext) => {
|
||||
// Your validation logic here
|
||||
return someCondition
|
||||
},
|
||||
link: {
|
||||
path: 'settings/description',
|
||||
title: messages.editDescriptionTitle,
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings-description',
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
```typescript
|
||||
// In description.i18n.ts
|
||||
newNagTitle: {
|
||||
id: 'nags.new-nag.title',
|
||||
defaultMessage: 'New Nag Title',
|
||||
},
|
||||
newNagDescription: {
|
||||
id: 'nags.new-nag.description',
|
||||
defaultMessage: 'Description of the new nag issue.',
|
||||
```
|
||||
|
||||
@@ -1,28 +1,32 @@
|
||||
import type { Stage } from '../types/stage'
|
||||
import modpackPermissionsStage from './modpack-permissions-stage'
|
||||
import categories from './stages/categories'
|
||||
import copyright from './stages/copyright'
|
||||
import reupload from './stages/reupload'
|
||||
import description from './stages/description'
|
||||
import gallery from './stages/gallery'
|
||||
import links from './stages/links'
|
||||
import ruleFollowing from './stages/rule-following'
|
||||
import sideTypes from './stages/side-types'
|
||||
import slug from './stages/slug'
|
||||
import summary from './stages/summary'
|
||||
import title from './stages/title'
|
||||
import titleSlug from './stages/title-slug'
|
||||
import versions from './stages/versions'
|
||||
import license from './stages/license'
|
||||
import undefinedProject from './stages/undefined-project'
|
||||
import statusAlerts from './stages/status-alerts'
|
||||
|
||||
export default [
|
||||
title,
|
||||
slug,
|
||||
titleSlug,
|
||||
summary,
|
||||
description,
|
||||
links,
|
||||
license,
|
||||
categories,
|
||||
sideTypes,
|
||||
gallery,
|
||||
versions,
|
||||
copyright,
|
||||
reupload,
|
||||
ruleFollowing,
|
||||
modpackPermissionsStage,
|
||||
statusAlerts,
|
||||
undefinedProject,
|
||||
] as ReadonlyArray<Stage>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
## Misuse of Tags
|
||||
|
||||
Per section 5.1 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#miscellaneous), it is important that the metadata of your projects is accurate. Including that selected tags honestly represent your project.
|
||||
Per section 5.1 of %RULES%, it is important that the metadata of your projects is accurate. Including that selected tags honestly represent your project.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
It looks like the Optimization tag is not accurate for this project.
|
||||
@@ -0,0 +1,5 @@
|
||||
Currently, your pack has multiple Resolutions selected, in most cases, this will misrepresent your project.
|
||||
For a brief rundown of how this works:
|
||||
Vanilla Minecraft textures like blocks and items have a width and height of 16 pixels.
|
||||
This means that packs with textures the same size as the default are considered 16x.
|
||||
Some packs make the resolution of textures smaller than the default, such as 8x, and some bigger, such as 32x.
|
||||
@@ -0,0 +1,2 @@
|
||||
**Featured Tags:** %PROJECT_CATEGORIES% \
|
||||
**Additional Tags:** %PROJECT_ADDITIONAL_CATEGORIES%
|
||||
@@ -0,0 +1,2 @@
|
||||
**License id:** %PROJECT_LICENSE_ID% \
|
||||
**License Link:** %PROJECT_LICENSE_URL%
|
||||
@@ -0,0 +1,4 @@
|
||||
**Discord:** %PROJECT_DISCORD_URL% \
|
||||
**Issues:** %PROJECT_ISSUES_URL% \
|
||||
**Source:** %PROJECT_SOURCE_URL% \
|
||||
**Wiki:** %PROJECT_WIKI_URL%
|
||||
@@ -0,0 +1 @@
|
||||
> **{PLATFORM}:** {URL}<br />
|
||||
@@ -0,0 +1,2 @@
|
||||
<br />
|
||||
<u>**Donation Links:**</u><br />
|
||||
@@ -0,0 +1 @@
|
||||
**Applying for:** `%PROJECT_REQUESTED_STATUS%`
|
||||
@@ -0,0 +1,2 @@
|
||||
**Summary:**
|
||||
`%PROJECT_SUMMARY%`
|
||||
@@ -0,0 +1,4 @@
|
||||
**Title:** %PROJECT_TITLE% \
|
||||
**Slug:** `%PROJECT_SLUG%`
|
||||
|
||||
**Title issues?**
|
||||
@@ -1,7 +1,6 @@
|
||||
## Insufficient Description
|
||||
|
||||
Per section 2.1 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#general-expectations) your project's Description should clearly inform the reader of the content, purpose, and appeal of your project.
|
||||
Per section 2.1 of %RULES% your project's Description should clearly inform the reader of the content, purpose, and appeal of your project.
|
||||
|
||||
Currently, it looks like there are some missing details.
|
||||
|
||||
> %EXPLAINER%
|
||||
%EXPLAINER%
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
## No English Description
|
||||
|
||||
Per section 2.2 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#accessibility) a project's Summary and Description must be in English, unless meant exclusively for non-English use, such as translations.
|
||||
Per section 2.2 of %RULES% a project's [Summary](%PROJECT_SETTINGS_LINK%) and %PROJECT_DESCRIPTION_FLINK% must be in English, unless meant exclusively for non-English use, such as translations.
|
||||
|
||||
You may include your non-English Description if you would like but we ask that you also add an English translation of the Description to your Description page, if you would like to use an online translator to do this, we recommend [DeepL](https://www.deepl.com/translator).
|
||||
You may include your non-English Description if you would like but we ask that you also add an English translation of the Description to your project page, if you would like to use an online translator to do this, we recommend [DeepL](https://www.deepl.com/translator).
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## Description Accessibility
|
||||
|
||||
Per section 2 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#clear-and-honest-function) your description must be plainly readable and accessible.
|
||||
Per section 2 of %RULES% your description must be plainly readable and accessible.
|
||||
|
||||
Using non-standard text characters like Zalgo or "fancy text" in place of text anywhere in your project, including the Description, Summary, or Title can make your project pages inaccessible.
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
## Unfinished Description
|
||||
|
||||
It looks like your project Description is still a WIP (Work In Progress).
|
||||
|
||||
> %REASON%
|
||||
|
||||
Please remember to submit only when ready, as it is important your project meets the requirements of Section 2.1 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#general-expectations), if you have any questions on this feel free to reach out!
|
||||
It looks like your project Description is still a Work In Progress.
|
||||
Please remember to submit only when ready, as it is important your project meets the requirements of Section 2.1 of %RULES%.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## Insufficient Gallery Images
|
||||
|
||||
We ask that projects like yours show off their content using images in the Gallery, or optionally in the Description, in order to effectively and clearly inform users of its content per section 2.1 of [Modrinth's content rules](https://modrinth.com/legal/rules#general-expectations).
|
||||
We ask that projects like yours show off their content using images in the Gallery, or optionally in the Description, in order to effectively and clearly inform users of its content per section 2.1 of %RULES%.
|
||||
Keep in mind that you should:
|
||||
|
||||
- Set a featured image that best represents your project.
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
## Unrelated Gallery Images
|
||||
|
||||
Per section 5.5 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#miscellaneous) any images in your project's Gallery must be relevant to the project and also include a Title.
|
||||
Per section 5.5 of %RULES% any images in your project's Gallery must be relevant to the project and also include a Title.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
If this is a project-specific License you've written yourself, you must host the full License in a way that makes it publicly available, for instance, in a public source repository on a platform like GitHub.
|
||||
@@ -0,0 +1,4 @@
|
||||
## Invalid License Link
|
||||
|
||||
It's important that your project's License link is accurate and leads directly to a valid license for this content.
|
||||
Your current link: `%PROJECT_LICENSE_URL%` does not appear to lead to a valid license for this project, or it is not publicly accessable.
|
||||
@@ -0,0 +1,5 @@
|
||||
## No Source Code Provided
|
||||
|
||||
Your project's license of `%PROJECT_LICENSE_NAME%`, requires source disclosure.
|
||||
Consider adding a Source link to your project's repository, or including a Sources file for each version as an Additional File.
|
||||
Keep in mind this may be a requirement of the source work's licensing, which must be abided per section 4 of %RULES%.
|
||||
4
packages/moderation/data/messages/license/no_source.md
Normal file
4
packages/moderation/data/messages/license/no_source.md
Normal file
@@ -0,0 +1,4 @@
|
||||
## No Source Code Provided
|
||||
|
||||
Your project's license of `%PROJECT_LICENSE_NAME%`, requires source disclosure.
|
||||
Consider adding a Source link to your project's repository, or including a Sources file for each version as an Additional File. You may also want to refer to %LICENSING_GUIDE% if you wish to select a different License, remember to make sure your selected License is consistent with the license in your project's files as well.
|
||||
@@ -1,3 +1,4 @@
|
||||
## Misuse of External Resources
|
||||
## Misuse of Links
|
||||
|
||||
Per section 5.4 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#miscellaneous) all links must lead to correctly labeled publicly available resources that are directly related to your project.
|
||||
Per section 5.4 of %RULES% all %PROJECT_LINKS_FLINK% must lead to correctly labeled publicly available resources that are directly related to your project.
|
||||
Currently it looks like your %MISUSED_LINKS% link(s) are misused or incorrectly labeled.
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
## Unreachable Links
|
||||
|
||||
Per section 5.4 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#miscellaneous) all links must lead to correctly labeled publicly available resources that are directly related to your project.
|
||||
|
||||
Currently, your %LINK% link is inaccessible!
|
||||
@@ -1,5 +0,0 @@
|
||||
## Unreachable Links
|
||||
|
||||
Per section 5.4 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#miscellaneous) all links must lead to correctly labeled publicly available resources that are directly related to your project.
|
||||
|
||||
Currently, your Source link directs to a Page Not Found error, likely because your repository is private, make sure to make your repository public before resubmitting your project!
|
||||
@@ -0,0 +1 @@
|
||||
Currently, your Discord link directs to an invalid invite, likely because your invite has expired. Make sure to set your invite link to permanent with unlimited uses before resubmitting your project.
|
||||
@@ -0,0 +1 @@
|
||||
Currently, your Source link directs to a Page Not Found error, likely because your repository is private. Make sure to set your repository to public before resubmitting your project.
|
||||
@@ -0,0 +1,3 @@
|
||||
## Unreachable Links
|
||||
|
||||
Per section 5.4 of %RULES% all %PROJECT_LINKS_FLINK% must lead to correctly labeled publicly available resources that are directly related to your project.
|
||||
4
packages/moderation/data/messages/reupload/fork.md
Normal file
4
packages/moderation/data/messages/reupload/fork.md
Normal file
@@ -0,0 +1,4 @@
|
||||
## Forks and Reuploads
|
||||
|
||||
Per section 4 of %RULES%, please provide proof that this project is both license-abiding and significantly divergent from the source work.
|
||||
Alternatively, please provide proof of your explicit permission from the author of the source work to distribute this content on Modrinth.
|
||||
@@ -0,0 +1,6 @@
|
||||
## Identity Verification
|
||||
|
||||
**Welcome to Modrinth!** We're happy to see you here, we just want to make sure you're you.
|
||||
|
||||
Since this project already exists on the internet we ask that you provide evidence you are the rightful owner of this content.
|
||||
For instance, by submitting a screenshot accessing the settings of the project's existing pages such as %PLATFORM%.
|
||||
@@ -0,0 +1,4 @@
|
||||
## Insufficient Fork
|
||||
|
||||
This project does not appear to significantly diverge from the source work, or does not abide by the license of the source work as required by section 4 of %RULES%.
|
||||
Please provide proof of your explicit permission to distribute this project from the creator(s) of the source work.
|
||||
@@ -0,0 +1,5 @@
|
||||
## Proof of permissions
|
||||
|
||||
This project appears to contain content from other creators.
|
||||
Per section 4 of %RULES%, we ask that you provide proof of your permission to distribute this content, or derivatives of this content in your project on Modrinth.
|
||||
Either implicit permission abiding by the terms of the content's license(s) or explicit permission from the original creator of the content.
|
||||
@@ -1,7 +1,5 @@
|
||||
## Reuploads are forbidden
|
||||
|
||||
This project appears to contain content from %ORIGINAL_PROJECT% by %ORIGINAL_AUTHOR%.
|
||||
|
||||
Per section 4 of [Modrinth's Content Rules](https://modrinth.com/legal/rules) this is strictly forbidden.
|
||||
|
||||
If you believe this is an error, or you can verify you are the creator and rightful owner of this content please let us know. Otherwise, we ask that you **do not resubmit this project**.`,
|
||||
This project appears to contain content from %ORIGINAL_PROJECT% by %ORIGINAL_AUTHOR%.
|
||||
Per section 4 of %RULES% this is strictly forbidden.
|
||||
If you believe this is an error, or you can verify you are the creator and rightful owner of this content please let us know. Otherwise, we ask that you **do not resubmit this project**.
|
||||
@@ -1,5 +1 @@
|
||||
# Does not follow content rules
|
||||
|
||||
Our moderators have determined that your project does not follow Modrinth's Content Rules, and has been rejected.
|
||||
|
||||
%MESSAGE%
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## Environment Information
|
||||
|
||||
Per section 5.1 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#miscellaneous), it is important that the metadata of your projects is accurate, including whether the project runs on the client or server side.
|
||||
Per section 5.1 of %RULES%, it is important that the metadata of your projects is accurate, including whether the project runs on the client or server side.
|
||||
|
||||
For a brief rundown of how this works:
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## Incorrect Environment Information
|
||||
|
||||
Per section 5.1 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#miscellaneous), it is important that the metadata of your projects is accurate, including whether the project runs on the client or server side.
|
||||
Per section 5.1 of %RULES%, it is important that the metadata of your projects is accurate, including whether the project runs on the client or server side.
|
||||
|
||||
For a brief rundown of how this works:
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
## Misuse of Slug
|
||||
|
||||
Per section 5.2 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#miscellaneous) your project slug (URL) must accurately represent your project.
|
||||
Per section 5.2 of %RULES% must accurately represent your project.
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
|
||||
## Account Issues Indicated
|
||||
|
||||
We're sorry to hear you're having trouble accessing your accounts, unfortunately, our moderation team is unable to assist with account-related issues.
|
||||
Before resubmitting your project, %SUPPORT%.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
|
||||
Unfortunately, our AutoMod cannot read your project's Description or your messages to moderation.
|
||||
AutoMod will warn both you and our Moderation Staff about potential issues, but if you've already followed the necessary steps these warnings can safely be ignored.
|
||||
Note that if your project is being rejected by AutoMod this means your project has content that can not be included in your modpack and must be removed before resubmission, including deleting versions of your modpack that include the content.
|
||||
5
packages/moderation/data/messages/status-alerts/fixed.md
Normal file
5
packages/moderation/data/messages/status-alerts/fixed.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
|
||||
## Corrections Applied
|
||||
|
||||
I've gone ahead and corrected the issues listed above so your project can be Approved.
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
|
||||
## Private Use
|
||||
|
||||
Under normal circumstances, your project would be rejected due to the issues listed above.
|
||||
However, since your project is not intended for for public use, these requirements will be waived and your project will be unlisted. This means it will remain accessible through a direct link without appearing in public search results, allowing you to share it privately.
|
||||
If you're okay with this, or submitted your project to be unlisted already, than no further action is necessary.
|
||||
If you would like to publish your project publicly, please address all moderation concerns before resubmitting this project.
|
||||
@@ -0,0 +1,5 @@
|
||||
## Source Code Requested
|
||||
|
||||
To ensure the safety of all Modrinth users, we ask that you provide the source code for this project before resubmission so that it can be reviewed by our Moderation Team.
|
||||
We also ask that you provide the source for any included binary files, as well as detailed build instructions allowing us to verify that the compiled code you are distributing matches the provided source.
|
||||
We understand that you may not want to publish the source code for this project, so you are welcome to share it privately to the [Modrinth Content Moderation Team](https://github.com/ModrinthModeration) on GitHub.
|
||||
@@ -0,0 +1,4 @@
|
||||
## Source Code Requested
|
||||
|
||||
To ensure the safety of all Modrinth users, we ask that you provide the source code for this project and the process you used to obfuscate it before resubmission so that it can be reviewed by our Moderation Team.
|
||||
We understand that you may not want to publish the source code for this project, so you are welcome to share it privately to the [Modrinth Content Moderation Team](https://github.com/ModrinthModeration) on GitHub.
|
||||
@@ -1,6 +1,6 @@
|
||||
## Insufficient Summary
|
||||
|
||||
Per section 5.3 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#miscellaneous) your Summary can not include any extra formatting such as lists, or links.
|
||||
Per section 5.3 of %RULES% your Summary can not include any extra formatting such as lists, or links.
|
||||
|
||||
Your project summary should provide a brief overview of your project that informs and entices users.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
## Insufficient Summary
|
||||
|
||||
Per section 5.3 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#miscellaneous) your project summary should provide a brief overview of your project that informs and entices users.
|
||||
Per section 5.3 of %RULES% your project summary should provide a brief overview of your project that informs and entices users.
|
||||
|
||||
This is the first thing most people will see about your mod other than the Logo, so it's important it be accurate, reasonably detailed, and exciting.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
## No English Summary
|
||||
|
||||
Per section 2.2 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#accessibility) a project's Summary and Description must be in English, unless meant exclusively for non-English use, such as translations.
|
||||
Per section 2.2 of %RULES% a project's Summary and Description must be in English, unless meant exclusively for non-English use, such as translations.
|
||||
|
||||
You may include your non-English Summary but we ask that you also add an English translation.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## Insufficient Summary
|
||||
|
||||
Per section 5.3 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#miscellaneous) your Summary can not be the same as your project's Title.
|
||||
Per section 5.3 of %RULES% your Summary can not be the same as your project's Title.
|
||||
|
||||
Your project summary should provide a brief overview of your project that informs and entices users.
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
## Project Title
|
||||
## Minecraft Project Names
|
||||
|
||||
Projects must not use Minecraft's branding or include "Minecraft" as a significant part of the title.
|
||||
|
||||
The title of your project may be confusingly similar to the game, and we encourage you to change your title to avoid a potential violation of Minecraft's Usage Guidelines.
|
||||
|
||||
Abbreviations like "MC" or elaborate titles that do not make the name Minecraft a significant portion of the name are okay.
|
||||
Projects must not use Minecraft's branding or include "Minecraft" as a significant part of the title.
|
||||
Your project's current Name of `%PROJECT_TITLE%` may be confusingly similar to, or imply association with, the game Minecraft. We encourage you to change your project's [Name](%PROJECT_SETTINGS_LINK%) to avoid a potential violation of Minecraft's Usage Guidelines.
|
||||
Abbreviations like "MC" or elaborate titles that do not make the name Minecraft a significant portion of the name are okay.
|
||||
When editing your project's Name, remember to update its [URL](%PROJECT_SETTINGS_LINK%) to match.
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
You may reference the source work in the Description of your fork, however, you must do so in a way that is unlikely to cause confusion or imply association with or endorsement from the author of the source work.
|
||||
Additionally, per section 4 of %RULES%, we ask that you ensure your project's Name and Branding abide by the license of the source work.
|
||||
@@ -0,0 +1 @@
|
||||
You may reference the projects that make up the focus point of your modpack, however, you must do so in a way that is unlikely to cause confusion or imply association with or endorsement from the author of that content.
|
||||
@@ -1,3 +1,5 @@
|
||||
## Project Branding
|
||||
|
||||
Per section 1.8 of [Modrinth's Content Rules](https://modrinth.com/legal/rules) we ask that you change your project title and other relevant branding to avoid causing confusion or implying association with existing projects.
|
||||
Per section 1.8 of %RULES%, your project or its branding must not imply association or be easily confused with any other person or organization.
|
||||
We ask that you change your project's [Name](%PROJECT_SETTINGS_LINK%) and other relevant branding to avoid causing confusion or implying association with existing projects or individuals.
|
||||
When editing your project's Name, remember to update its [URL](%PROJECT_SETTINGS_LINK%) to match.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
## Misuse of Title
|
||||
## Misuse of Project Name
|
||||
|
||||
Per section 5.2 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#miscellaneous) we ask that you limit the title to just the name of your project.
|
||||
|
||||
Additional information, such as themes, tags, supported versions or loaders, etc. should be saved for the Summary or Description.
|
||||
|
||||
When changing your project title, remember to also ensure that your project slug (URL) matches and accurately represents your project.
|
||||
Per section 5.2 of %RULES%, your project's [Name](%PROJECT_SETTINGS_LINK%) should not include unnecessary information such as loaders, themes, tags, or versions.
|
||||
Your project's current Name of `%PROJECT_TITLE%` appears to contain extra information.
|
||||
We ask that you remove all additional information from the [Name](%PROJECT_SETTINGS_LINK%). Instead, consider including this in your project's Summary or Description, or as a part of its relevant metadata.
|
||||
When editing your project's Name, remember to update its [URL](%PROJECT_SETTINGS_LINK%) to match.
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
## No Versions
|
||||
|
||||
It looks like all versions of your project have been deleted, meaning that our Moderation Team cannot finish reviewing your project.
|
||||
Please resubmit your project once you've uploaded a new version.
|
||||
@@ -0,0 +1,5 @@
|
||||
## Unsupported Project
|
||||
|
||||
Per section 5.7 of [Modrinth's Content Rules](https://modrinth.com/legal/rules), Modrinth does not support uploading multiple variations of your project as Additional files.
|
||||
Having alternate versions of your content on the same project will hurt the functionality of the Modrinth App and other supported launchers as it would prevent users from updating your content, and may make it harder for your users to find the content they want.
|
||||
We ask that you upload each alternate version of your project as a new project, ensuring that all users will be able to access and easily find your content.
|
||||
@@ -0,0 +1,5 @@
|
||||
## Unsupported Project
|
||||
|
||||
Modrinth does not support uploading projects that have unnecessary or extraneous installation steps.
|
||||
Having alternate versions of your content on the same project will hurt the functionality of the Modrinth App and other supported launchers as it would prevent users from updating your content, and may make it harder for your users to find the content they want.
|
||||
We ask that you upload each alternate version of your project as a new project, ensuring that all users will be able to access and easily find your content.
|
||||
@@ -0,0 +1,6 @@
|
||||
## Unsupported Project
|
||||
|
||||
Modrinth does not support uploading multiple variations of your project as separate versions.
|
||||
New Versions of your project should strictly be a linear upgrade of the same content.
|
||||
Having alternate versions of your content on the same project will hurt the functionality of the Modrinth App and other supported launchers as it would prevent users from updating your content, and may make it harder for your users to find the content they want.
|
||||
We ask that you upload each alternate version of your project as a new project, ensuring that all users will be able to access and easily find your content.
|
||||
@@ -0,0 +1,4 @@
|
||||
## Incorrect Additional Files
|
||||
|
||||
Per section 5.7 of [Modrinth's Content Rules](https://modrinth.com/legal/rules) the additional files section should only be used for specific designated purposes such as a `Sources.jar`.
|
||||
To ensure a smooth experience for you and your users, please upload each alternate version of your modpack as its own Modpack project, thank you.
|
||||
@@ -0,0 +1,6 @@
|
||||
## Unsupported Project
|
||||
|
||||
Modrinth does not support uploading multiple variations of your project as separate versions.
|
||||
New Versions of your project should strictly be a linear upgrade of the same content.
|
||||
Having alternate versions of your content on the same project will hurt the functionality of the Modrinth App and other supported launchers as it would prevent users from updating your content, and may make it harder for your users to find the content they want.
|
||||
To ensure a smooth experience for you and your users, please upload each alternate version of your modpack as its own Modpack project, thank you.
|
||||
@@ -0,0 +1,5 @@
|
||||
## Incorrect Additional Files
|
||||
|
||||
Per section 5.7 of [Modrinth's Content Rules](https://modrinth.com/legal/rules) the additional files section should only be used for specific designated purposes such as a `Sources.jar`.
|
||||
Modrinth does not support the upload of modpacks in the `.zip` format, as this may cause issues for Modrinth users or distribute copyrighted content without the proper permissions.
|
||||
If you would like to upload a server-specific version of your modpack, consider creating a separate Modpack project.
|
||||
@@ -0,0 +1,5 @@
|
||||
## Broken Version
|
||||
|
||||
It looks like you've uploaded multiple files with the same name to the same version. This triggers a bug that produces duplicate primary file entries.
|
||||
This may cause issues for users and creators as it would prevent Modpacks that include this content from functioning in the Modrinth App and other launchers.
|
||||
We ask that you delete and reupload all applicable versions. Be sure to only upload one file to each version before resubmission.
|
||||
@@ -1,7 +0,0 @@
|
||||
## Incorrect Use of Additional Files
|
||||
|
||||
It looks like you've uploaded multiple `mod.jar` files to one Version as Additional Files. Per section 5.7 of [Modrinth's Content Rules](https://modrinth.com/legal/rules#miscellaneous) each Version of your project must include only one `mod.jar` that corresponds to its respective Minecraft and loader versions.
|
||||
|
||||
This allows users to easily find and download the file they need for the version they're on with ease. The Additional Files feature can be used for things like a `Sources.jar`.
|
||||
|
||||
Please upload each version of your mod separately, thank you.
|
||||
@@ -0,0 +1,5 @@
|
||||
## Incorrect Use of Additional Files
|
||||
|
||||
It looks like you've uploaded multiple primary files to one Version as Additional Files. Per section 5.7 of %RULES% each Version of your project must include only one primary file that corresponds to its respective Minecraft and loader versions.
|
||||
This allows users to easily find and download the content they need for their game profile with ease. The Additional Files feature can be used for things like a `Sources.jar`.
|
||||
Please upload each version of your project separately, thank you.
|
||||
@@ -0,0 +1,3 @@
|
||||
## Data Packs on Modrinth
|
||||
|
||||
It looks like you've selected loaders for your Data Pack that are causing it to be marked as a different project type. Data Packs must only be uploaded with the "Data Pack" loader selected. Please re-upload all versions of your data pack and make sure to only select "Data Pack" as the loader.
|
||||
@@ -1,3 +1,5 @@
|
||||
## Modpacks on Modrinth
|
||||
|
||||
It looks like you've uploaded your Modpack as a `.zip`, unfortunately, this is invalid and is why your project type is "Mod". I recommend taking a look at our support page about [Modrinth Modpacks](https://support.modrinth.com/en/articles/8802250-modpacks-on-modrinth), and once you're ready feel free to resubmit your project as a `.mrpack`. Don't forget to delete the old files from your Versions!
|
||||
It looks like you've uploaded your Modpack as a `.zip`, unfortunately, this is invalid and is why your project type is "Mod". Please refer to our support article to learn more about %MODPACKS_ON_MODRINTH%.
|
||||
Once you're ready feel free to resubmit your project as a `.mrpack`.
|
||||
Don't forget to delete the old files from your %PROJECT_VERSIONS_FLINK%!
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
## Excessive File Size
|
||||
|
||||
This project appears to include libs or dependencies, unnecessarily redistributing their entire contents.
|
||||
This is often due to an error in project structure or compilation, and in some cases, may violate the copyrights or licensing agreements of these libraries.
|
||||
We ask that you remove all unnecessary files, assets, and code from your project before resubmission.
|
||||
@@ -0,0 +1,4 @@
|
||||
## Vanilla Assets
|
||||
|
||||
Your resource pack currently includes an excessive amount of unmodified assets from vanilla Minecraft.
|
||||
Please remove these from your pack and ensure your project only contains original assets created by you, thank you.
|
||||
@@ -1,15 +1,22 @@
|
||||
import type { ModerationModpackPermissionApprovalType, Project } from '@modrinth/utils'
|
||||
import type { Stage } from '../types/stage'
|
||||
import { BoxIcon } from '@modrinth/assets'
|
||||
import { PackageOpenIcon } from '@modrinth/assets'
|
||||
|
||||
export default {
|
||||
id: 'modpack-permissions',
|
||||
title: 'Modpack Permissions',
|
||||
icon: BoxIcon,
|
||||
icon: PackageOpenIcon,
|
||||
// Replace me please.
|
||||
guidance_url: 'https://docs.modrinth.com/moderation/modpack-permissions',
|
||||
guidance_url:
|
||||
'https://www.notion.so/Content-Moderation-Cheat-Sheets-22d5ee711bf081a4920ef08879fe6bf5?source=copy_link#22d5ee711bf08116bd8bc1186f357062',
|
||||
shouldShow: (project: Project) => project.project_type === 'modpack',
|
||||
actions: [],
|
||||
actions: [
|
||||
{
|
||||
id: 'button',
|
||||
type: 'button',
|
||||
label: 'This dummy button must be present or the stage will not appear.',
|
||||
},
|
||||
],
|
||||
} as Stage
|
||||
|
||||
export const finalPermissionMessages: Record<
|
||||
@@ -18,7 +25,7 @@ export const finalPermissionMessages: Record<
|
||||
> = {
|
||||
yes: undefined,
|
||||
'with-attribution-and-source': undefined,
|
||||
'with-attribution': `The following content has attribution requirements, meaning that you must link back to the page where you originally found this content in your modpack description or version changelog (e.g. linking a mod's CurseForge page if you got it from CurseForge):`,
|
||||
'with-attribution': `The following content has attribution requirements, meaning that you must link back to the page where you originally found this content in your Modpack's description or version changelog (e.g. linking a mod's CurseForge page if you got it from CurseForge):`,
|
||||
no: 'The following content is not allowed in Modrinth modpacks due to licensing restrictions. Please contact the author(s) directly for permission or remove the content from your modpack:',
|
||||
'permanent-no': `The following content is not allowed in Modrinth modpacks, regardless of permission obtained. This may be because it breaks Modrinth's content rules or because the authors, upon being contacted for permission, have declined. Please remove the content from your modpack:`,
|
||||
unidentified: `The following content could not be identified. Please provide proof of its origin along with proof that you have permission to include it:`,
|
||||
|
||||
7
packages/moderation/data/nags.ts
Normal file
7
packages/moderation/data/nags.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { Nag } from '../types/nags'
|
||||
import { coreNags } from './nags/core'
|
||||
import { descriptionNags } from './nags/description'
|
||||
import { linksNags } from './nags/links'
|
||||
import { tagsNags } from './nags/tags'
|
||||
|
||||
export default [...coreNags, ...linksNags, ...descriptionNags, ...tagsNags] as Nag[]
|
||||
116
packages/moderation/data/nags/core.i18n.ts
Normal file
116
packages/moderation/data/nags/core.i18n.ts
Normal file
@@ -0,0 +1,116 @@
|
||||
import { defineMessages } from '@vintl/vintl'
|
||||
|
||||
export default defineMessages({
|
||||
moderatorFeedbackTitle: {
|
||||
id: 'nags.moderator-feedback.title',
|
||||
defaultMessage: 'Review moderator feedback',
|
||||
},
|
||||
moderatorFeedbackDescription: {
|
||||
id: 'nags.moderator-feedback.description',
|
||||
defaultMessage:
|
||||
'Review any feedback from moderators regarding your project before resubmitting.',
|
||||
},
|
||||
moderationTitle: {
|
||||
id: 'nags.moderation.title',
|
||||
defaultMessage: 'Visit moderation thread',
|
||||
},
|
||||
uploadVersionTitle: {
|
||||
id: 'nags.upload-version.title',
|
||||
defaultMessage: 'Upload a version',
|
||||
},
|
||||
uploadVersionDescription: {
|
||||
id: 'nags.upload-version.description',
|
||||
defaultMessage: 'At least one version is required for a project to be submitted for review.',
|
||||
},
|
||||
versionsTitle: {
|
||||
id: 'nags.versions.title',
|
||||
defaultMessage: 'Visit versions page',
|
||||
},
|
||||
addDescriptionTitle: {
|
||||
id: 'nags.add-description.title',
|
||||
defaultMessage: 'Add a description',
|
||||
},
|
||||
addDescriptionDescription: {
|
||||
id: 'nags.add-description.description',
|
||||
defaultMessage:
|
||||
"A description that clearly describes the project's purpose and function is required.",
|
||||
},
|
||||
settingsDescriptionTitle: {
|
||||
id: 'nags.settings.description.title',
|
||||
defaultMessage: 'Visit description settings',
|
||||
},
|
||||
addIconTitle: {
|
||||
id: 'nags.add-icon.title',
|
||||
defaultMessage: 'Add an icon',
|
||||
},
|
||||
addIconDescription: {
|
||||
id: 'nags.add-icon.description',
|
||||
defaultMessage:
|
||||
'Your project should have a nice-looking icon to uniquely identify your project at a glance.',
|
||||
},
|
||||
settingsTitle: {
|
||||
id: 'nags.settings.title',
|
||||
defaultMessage: 'Visit general settings',
|
||||
},
|
||||
featureGalleryImageTitle: {
|
||||
id: 'nags.feature-gallery-image.title',
|
||||
defaultMessage: 'Feature a gallery image',
|
||||
},
|
||||
featureGalleryImageDescription: {
|
||||
id: 'nags.feature-gallery-image.description',
|
||||
defaultMessage: 'Featured gallery images may be the first impression of many users.',
|
||||
},
|
||||
galleryTitle: {
|
||||
id: 'nags.gallery.title',
|
||||
defaultMessage: 'Visit gallery page',
|
||||
},
|
||||
selectTagsTitle: {
|
||||
id: 'nags.select-tags.title',
|
||||
defaultMessage: 'Select tags',
|
||||
},
|
||||
selectTagsDescription: {
|
||||
id: 'nags.select-tags.description',
|
||||
defaultMessage: 'Select all tags that apply to your project.',
|
||||
},
|
||||
settingsTagsTitle: {
|
||||
id: 'nags.settings.tags.title',
|
||||
defaultMessage: 'Visit tag settings',
|
||||
},
|
||||
addLinksTitle: {
|
||||
id: 'nags.add-links.title',
|
||||
defaultMessage: 'Add external links',
|
||||
},
|
||||
addLinksDescription: {
|
||||
id: 'nags.add-links.description',
|
||||
defaultMessage:
|
||||
'Add any relevant links targeted outside of Modrinth, such as sources, issues, or a Discord invite.',
|
||||
},
|
||||
settingsLinksTitle: {
|
||||
id: 'nags.settings.links.title',
|
||||
defaultMessage: 'Visit links settings',
|
||||
},
|
||||
selectEnvironmentsTitle: {
|
||||
id: 'nags.select-environments.title',
|
||||
defaultMessage: 'Select supported environments',
|
||||
},
|
||||
selectEnvironmentsDescription: {
|
||||
id: 'nags.select-environments.description',
|
||||
defaultMessage: `Select if the {projectType} functions on the client-side and/or server-side.`,
|
||||
},
|
||||
settingsEnvironmentsTitle: {
|
||||
id: 'nags.settings.environments.title',
|
||||
defaultMessage: 'Visit general settings',
|
||||
},
|
||||
selectLicenseTitle: {
|
||||
id: 'nags.select-license.title',
|
||||
defaultMessage: 'Select license',
|
||||
},
|
||||
selectLicenseDescription: {
|
||||
id: 'nags.select-license.description',
|
||||
defaultMessage: 'Select the license your {projectType} is distributed under.',
|
||||
},
|
||||
settingsLicenseTitle: {
|
||||
id: 'nags.settings.license.title',
|
||||
defaultMessage: 'Visit license settings',
|
||||
},
|
||||
})
|
||||
151
packages/moderation/data/nags/core.ts
Normal file
151
packages/moderation/data/nags/core.ts
Normal file
@@ -0,0 +1,151 @@
|
||||
import type { Nag, NagContext } from '../../types/nags'
|
||||
import { formatProjectType } from '@modrinth/utils'
|
||||
import { useVIntl } from '@vintl/vintl'
|
||||
|
||||
import messages from './core.i18n'
|
||||
|
||||
export const coreNags: Nag[] = [
|
||||
{
|
||||
id: 'moderator-feedback',
|
||||
title: messages.moderatorFeedbackTitle,
|
||||
description: messages.moderatorFeedbackDescription,
|
||||
status: 'suggestion',
|
||||
shouldShow: (context: NagContext) =>
|
||||
context.tags.rejectedStatuses.includes(context.project.status),
|
||||
link: {
|
||||
path: 'moderation',
|
||||
title: messages.moderationTitle,
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-moderation',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'upload-version',
|
||||
title: messages.uploadVersionTitle,
|
||||
description: messages.uploadVersionDescription,
|
||||
status: 'required',
|
||||
shouldShow: (context: NagContext) => context.versions.length < 1,
|
||||
link: {
|
||||
path: 'versions',
|
||||
title: messages.versionsTitle,
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-versions',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'add-description',
|
||||
title: messages.addDescriptionTitle,
|
||||
description: messages.addDescriptionDescription,
|
||||
status: 'required',
|
||||
shouldShow: (context: NagContext) =>
|
||||
context.project.body === '' || context.project.body.startsWith('# Placeholder description'),
|
||||
link: {
|
||||
path: 'settings/description',
|
||||
title: messages.settingsDescriptionTitle,
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings-description',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'add-icon',
|
||||
title: messages.addIconTitle,
|
||||
description: messages.addIconDescription,
|
||||
status: 'suggestion',
|
||||
shouldShow: (context: NagContext) => !context.project.icon_url,
|
||||
link: {
|
||||
path: 'settings',
|
||||
title: messages.settingsTitle,
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'feature-gallery-image',
|
||||
title: messages.featureGalleryImageTitle,
|
||||
description: messages.featureGalleryImageDescription,
|
||||
status: 'suggestion',
|
||||
shouldShow: (context: NagContext) => {
|
||||
const featuredGalleryImage = context.project.gallery?.find((img) => img.featured)
|
||||
return context.project?.gallery?.length === 0 || !featuredGalleryImage
|
||||
},
|
||||
link: {
|
||||
path: 'gallery',
|
||||
title: messages.galleryTitle,
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-gallery',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'select-tags',
|
||||
title: messages.selectTagsTitle,
|
||||
description: messages.selectTagsDescription,
|
||||
status: 'suggestion',
|
||||
shouldShow: (context: NagContext) =>
|
||||
context.project.versions.length > 0 && context.project.categories.length < 1,
|
||||
link: {
|
||||
path: 'settings/tags',
|
||||
title: messages.settingsTagsTitle,
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings-tags',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'add-links',
|
||||
title: messages.addLinksTitle,
|
||||
description: messages.addLinksDescription,
|
||||
status: 'suggestion',
|
||||
shouldShow: (context: NagContext) =>
|
||||
!(
|
||||
context.project.issues_url ||
|
||||
context.project.source_url ||
|
||||
context.project.wiki_url ||
|
||||
context.project.discord_url ||
|
||||
context.project.donation_urls.length > 0
|
||||
),
|
||||
link: {
|
||||
path: 'settings/links',
|
||||
title: messages.settingsLinksTitle,
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings-links',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'select-environments',
|
||||
title: messages.selectEnvironmentsTitle,
|
||||
description: (context: NagContext) => {
|
||||
const { formatMessage } = useVIntl()
|
||||
|
||||
return formatMessage(messages.selectEnvironmentsDescription, {
|
||||
projectType: formatProjectType(context.project.project_type).toLowerCase(),
|
||||
})
|
||||
},
|
||||
status: 'required',
|
||||
shouldShow: (context: NagContext) => {
|
||||
const excludedTypes = ['resourcepack', 'plugin', 'shader', 'datapack']
|
||||
return (
|
||||
context.project.versions.length > 0 &&
|
||||
!excludedTypes.includes(context.project.project_type) &&
|
||||
(context.project.client_side === 'unknown' ||
|
||||
context.project.server_side === 'unknown' ||
|
||||
(context.project.client_side === 'unsupported' &&
|
||||
context.project.server_side === 'unsupported'))
|
||||
)
|
||||
},
|
||||
link: {
|
||||
path: 'settings',
|
||||
title: messages.settingsEnvironmentsTitle,
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'select-license',
|
||||
title: messages.selectLicenseTitle,
|
||||
description: (context: NagContext) => {
|
||||
const { formatMessage } = useVIntl()
|
||||
|
||||
return formatMessage(messages.selectLicenseDescription, {
|
||||
projectType: formatProjectType(context.project.project_type).toLowerCase(),
|
||||
})
|
||||
},
|
||||
status: 'required',
|
||||
shouldShow: (context: NagContext) => context.project.license.id === 'LicenseRef-Unknown',
|
||||
link: {
|
||||
path: 'settings/license',
|
||||
title: messages.settingsLicenseTitle,
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings-license',
|
||||
},
|
||||
},
|
||||
]
|
||||
88
packages/moderation/data/nags/description.i18n.ts
Normal file
88
packages/moderation/data/nags/description.i18n.ts
Normal file
@@ -0,0 +1,88 @@
|
||||
import { defineMessages } from '@vintl/vintl'
|
||||
|
||||
export default defineMessages({
|
||||
descriptionTooShortTitle: {
|
||||
id: 'nags.description-too-short.title',
|
||||
defaultMessage: 'Description may be insufficient',
|
||||
},
|
||||
descriptionTooShortDescription: {
|
||||
id: 'nags.description-too-short.description',
|
||||
defaultMessage:
|
||||
"Your description is {length} characters. It's recommended to have at least {minChars} characters to provide users with enough information about your project.",
|
||||
},
|
||||
longHeadersTitle: {
|
||||
id: 'nags.long-headers.title',
|
||||
defaultMessage: 'Headers are too long',
|
||||
},
|
||||
longHeadersDescription: {
|
||||
id: 'nags.long-headers.description',
|
||||
defaultMessage:
|
||||
'{count, plural, one {# header} other {# headers}} in your description {count, plural, one {is} other {are}} too long. Headers should be concise and act as section titles, not full sentences.',
|
||||
},
|
||||
summaryTooShortTitle: {
|
||||
id: 'nags.summary-too-short.title',
|
||||
defaultMessage: 'Summary may be insufficient',
|
||||
},
|
||||
summaryTooShortDescription: {
|
||||
id: 'nags.summary-too-short.description',
|
||||
defaultMessage:
|
||||
"Your summary is {length} characters. It's recommended to have at least {minChars} characters to provide users with enough information about your project.",
|
||||
},
|
||||
minecraftTitleClauseTitle: {
|
||||
id: 'nags.minecraft-title-clause.title',
|
||||
defaultMessage: 'Title contains "Minecraft"',
|
||||
},
|
||||
minecraftTitleClauseDescription: {
|
||||
id: 'nags.minecraft-title-clause.description',
|
||||
defaultMessage:
|
||||
'Please remove "Minecraft" from your title. You cannot use "Minecraft" in your title for legal reasons.',
|
||||
},
|
||||
titleContainsTechnicalInfoTitle: {
|
||||
id: 'nags.title-contains-technical-info.title',
|
||||
defaultMessage: 'Title contains loader or version info',
|
||||
},
|
||||
titleContainsTechnicalInfoDescription: {
|
||||
id: 'nags.title-contains-technical-info.description',
|
||||
defaultMessage:
|
||||
'Removing these helps keep titles clean and makes your project easier to find. Version and loader information is automatically displayed alongside your project.',
|
||||
},
|
||||
summarySameAsTitleTitle: {
|
||||
id: 'nags.summary-same-as-title.title',
|
||||
defaultMessage: 'Summary is project name',
|
||||
},
|
||||
summarySameAsTitleDescription: {
|
||||
id: 'nags.summary-same-as-title.description',
|
||||
defaultMessage:
|
||||
"Your summary is the same as your project name. Please change it. It's recommended to have a unique summary to provide more context about your project.",
|
||||
},
|
||||
imageHeavyDescriptionTitle: {
|
||||
id: 'nags.image-heavy-description.title',
|
||||
defaultMessage: 'Description is mostly images',
|
||||
},
|
||||
imageHeavyDescriptionDescription: {
|
||||
id: 'nags.image-heavy-description.description',
|
||||
defaultMessage:
|
||||
'Please add more descriptive text to help users understand your project, especially those using screen readers or with slow internet connections.',
|
||||
},
|
||||
missingAltTextTitle: {
|
||||
id: 'nags.missing-alt-text.title',
|
||||
defaultMessage: 'Images missing alt text',
|
||||
},
|
||||
missingAltTextDescription: {
|
||||
id: 'nags.missing-alt-text.description',
|
||||
defaultMessage:
|
||||
'Some of your images are missing alt text, which is important for accessibility, especially for visually impaired users.',
|
||||
},
|
||||
editDescriptionTitle: {
|
||||
id: 'nags.edit-description.title',
|
||||
defaultMessage: 'Edit description',
|
||||
},
|
||||
editSummaryTitle: {
|
||||
id: 'nags.edit-summary.title',
|
||||
defaultMessage: 'Edit summary',
|
||||
},
|
||||
editTitleTitle: {
|
||||
id: 'nags.edit-title.title',
|
||||
defaultMessage: 'Edit title',
|
||||
},
|
||||
})
|
||||
226
packages/moderation/data/nags/description.ts
Normal file
226
packages/moderation/data/nags/description.ts
Normal file
@@ -0,0 +1,226 @@
|
||||
import type { Nag, NagContext } from '../../types/nags'
|
||||
import { useVIntl } from '@vintl/vintl'
|
||||
|
||||
import messages from './description.i18n'
|
||||
|
||||
export const MIN_DESCRIPTION_CHARS = 500
|
||||
export const MAX_HEADER_LENGTH = 100
|
||||
export const MIN_SUMMARY_CHARS = 125
|
||||
|
||||
function analyzeHeaderLength(markdown: string): { hasLongHeaders: boolean; longHeaders: string[] } {
|
||||
if (!markdown) return { hasLongHeaders: false, longHeaders: [] }
|
||||
|
||||
const withoutCodeBlocks = markdown.replace(/```[\s\S]*?```/g, '').replace(/`[^`]*`/g, '')
|
||||
|
||||
const headerRegex = /^(#{1,3})\s+(.+)$/gm
|
||||
const headers = [...withoutCodeBlocks.matchAll(headerRegex)]
|
||||
|
||||
const longHeaders: string[] = []
|
||||
|
||||
headers.forEach((match) => {
|
||||
const headerText = match[2].trim()
|
||||
const sentenceEnders = /[.!?]+/g
|
||||
const sentences = headerText.split(sentenceEnders).filter((s) => s.trim().length > 0)
|
||||
|
||||
const hasSentenceEnders = sentenceEnders.test(headerText)
|
||||
const isVeryLong = headerText.length > MAX_HEADER_LENGTH
|
||||
const hasMultipleSentences = sentences.length > 1
|
||||
|
||||
if (hasSentenceEnders || isVeryLong || hasMultipleSentences) {
|
||||
longHeaders.push(headerText)
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
hasLongHeaders: longHeaders.length > 0,
|
||||
longHeaders,
|
||||
}
|
||||
}
|
||||
|
||||
function analyzeImageContent(markdown: string): { imageHeavy: boolean; hasEmptyAltText: boolean } {
|
||||
if (!markdown) return { imageHeavy: false, hasEmptyAltText: false }
|
||||
|
||||
const withoutCodeBlocks = markdown.replace(/```[\s\S]*?```/g, '').replace(/`[^`]*`/g, '')
|
||||
|
||||
const imageRegex = /!\[([^\]]*)\]\([^)]+\)/g
|
||||
const images = [...withoutCodeBlocks.matchAll(imageRegex)]
|
||||
|
||||
const htmlImageRegex = /<img[^>]*>/gi
|
||||
const htmlImages = [...withoutCodeBlocks.matchAll(htmlImageRegex)]
|
||||
|
||||
const totalImages = images.length + htmlImages.length
|
||||
if (totalImages === 0) return { imageHeavy: false, hasEmptyAltText: false }
|
||||
|
||||
const textWithoutImages = withoutCodeBlocks
|
||||
.replace(/!\[([^\]]*)\]\([^)]+\)/g, '')
|
||||
.replace(/<img[^>]*>/gi, '')
|
||||
.replace(/\s+/g, ' ')
|
||||
.trim()
|
||||
|
||||
const textLength = textWithoutImages.length
|
||||
const imageHeavy = textLength < 100 || (totalImages >= 3 && textLength < 200)
|
||||
|
||||
const hasEmptyAltText =
|
||||
images.some((match) => !match[1]?.trim()) ||
|
||||
htmlImages.some((match) => {
|
||||
const altMatch = match[0].match(/alt\s*=\s*["']([^"']*)["']/i)
|
||||
return !altMatch || !altMatch[1]?.trim()
|
||||
})
|
||||
|
||||
return { imageHeavy, hasEmptyAltText }
|
||||
}
|
||||
|
||||
export const descriptionNags: Nag[] = [
|
||||
{
|
||||
id: 'description-too-short',
|
||||
title: messages.descriptionTooShortTitle,
|
||||
description: (context: NagContext) => {
|
||||
const { formatMessage } = useVIntl()
|
||||
|
||||
return formatMessage(messages.descriptionTooShortDescription, {
|
||||
length: context.project.body?.length || 0,
|
||||
minChars: MIN_DESCRIPTION_CHARS,
|
||||
})
|
||||
},
|
||||
status: 'warning',
|
||||
shouldShow: (context: NagContext) => {
|
||||
const bodyLength = context.project.body?.trim()?.length || 0
|
||||
return bodyLength < MIN_DESCRIPTION_CHARS && bodyLength !== 0
|
||||
},
|
||||
link: {
|
||||
path: 'settings/description',
|
||||
title: messages.editDescriptionTitle,
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings-description',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'long-headers',
|
||||
title: messages.longHeadersTitle,
|
||||
description: (context: NagContext) => {
|
||||
const { formatMessage } = useVIntl()
|
||||
const { longHeaders } = analyzeHeaderLength(context.project.body || '')
|
||||
const count = longHeaders.length
|
||||
|
||||
return formatMessage(messages.longHeadersDescription, {
|
||||
count,
|
||||
})
|
||||
},
|
||||
status: 'warning',
|
||||
shouldShow: (context: NagContext) => {
|
||||
const { hasLongHeaders } = analyzeHeaderLength(context.project.body || '')
|
||||
return hasLongHeaders
|
||||
},
|
||||
link: {
|
||||
path: 'settings/description',
|
||||
title: messages.editDescriptionTitle,
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings-description',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'summary-too-short',
|
||||
title: messages.summaryTooShortTitle,
|
||||
description: (context: NagContext) => {
|
||||
const { formatMessage } = useVIntl()
|
||||
|
||||
return formatMessage(messages.summaryTooShortDescription, {
|
||||
length: context.project.description?.length || 0,
|
||||
minChars: MIN_SUMMARY_CHARS,
|
||||
})
|
||||
},
|
||||
status: 'warning',
|
||||
shouldShow: (context: NagContext) => {
|
||||
const summaryLength = context.project.description?.trim()?.length || 0
|
||||
return summaryLength < MIN_SUMMARY_CHARS && summaryLength !== 0
|
||||
},
|
||||
link: {
|
||||
path: 'settings',
|
||||
title: messages.editSummaryTitle,
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'minecraft-title-clause',
|
||||
title: messages.minecraftTitleClauseTitle,
|
||||
description: messages.minecraftTitleClauseDescription,
|
||||
status: 'required',
|
||||
shouldShow: (context: NagContext) => {
|
||||
const title = context.project.title?.toLowerCase() || ''
|
||||
const wordsInTitle = title.split(' ').filter((word) => word.length > 0)
|
||||
return title.includes('minecraft') && title.length > 0 && wordsInTitle.length <= 3
|
||||
},
|
||||
link: {
|
||||
path: 'settings',
|
||||
title: messages.editTitleTitle,
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'title-contains-technical-info',
|
||||
title: messages.titleContainsTechnicalInfoTitle,
|
||||
description: messages.titleContainsTechnicalInfoDescription,
|
||||
status: 'warning',
|
||||
shouldShow: (context: NagContext) => {
|
||||
const title = context.project.title?.toLowerCase() || ''
|
||||
if (!title) return false
|
||||
|
||||
const loaderNames =
|
||||
context.tags.loaders?.map((loader: { name: string }) => loader.name?.toLowerCase()) || []
|
||||
const hasLoader = loaderNames.some((loader) => loader && title.includes(loader.toLowerCase()))
|
||||
const versionPatterns = [/\b1\.\d+(\.\d+)?\b/]
|
||||
const hasVersionPattern = versionPatterns.some((pattern) => pattern.test(title))
|
||||
|
||||
return hasLoader || hasVersionPattern
|
||||
},
|
||||
link: {
|
||||
path: 'settings',
|
||||
title: messages.editTitleTitle,
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'summary-same-as-title',
|
||||
title: messages.summarySameAsTitleTitle,
|
||||
description: messages.summarySameAsTitleDescription,
|
||||
status: 'required',
|
||||
shouldShow: (context: NagContext) => {
|
||||
const title = context.project.title?.trim() || ''
|
||||
const summary = context.project.description?.trim() || ''
|
||||
return title === summary && title.length > 0 && summary.length > 0
|
||||
},
|
||||
link: {
|
||||
path: 'settings',
|
||||
title: messages.editSummaryTitle,
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'image-heavy-description',
|
||||
title: messages.imageHeavyDescriptionTitle,
|
||||
description: messages.imageHeavyDescriptionDescription,
|
||||
status: 'warning',
|
||||
shouldShow: (context: NagContext) => {
|
||||
const { imageHeavy } = analyzeImageContent(context.project.body || '')
|
||||
return imageHeavy
|
||||
},
|
||||
link: {
|
||||
path: 'settings/description',
|
||||
title: messages.editDescriptionTitle,
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings-description',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'missing-alt-text',
|
||||
title: messages.missingAltTextTitle,
|
||||
description: messages.missingAltTextDescription,
|
||||
status: 'warning',
|
||||
shouldShow: (context: NagContext) => {
|
||||
const { hasEmptyAltText } = analyzeImageContent(context.project.body || '')
|
||||
return hasEmptyAltText
|
||||
},
|
||||
link: {
|
||||
path: 'settings/description',
|
||||
title: messages.editDescriptionTitle,
|
||||
shouldShow: (context: NagContext) => context.currentRoute !== 'type-id-settings-description',
|
||||
},
|
||||
},
|
||||
]
|
||||
4
packages/moderation/data/nags/index.ts
Normal file
4
packages/moderation/data/nags/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export * from './core'
|
||||
export * from './links'
|
||||
export * from './description'
|
||||
export * from './tags'
|
||||
48
packages/moderation/data/nags/links.i18n.ts
Normal file
48
packages/moderation/data/nags/links.i18n.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import { defineMessages } from '@vintl/vintl'
|
||||
|
||||
export default defineMessages({
|
||||
verifyExternalLinksTitle: {
|
||||
id: 'nags.verify-external-links.title',
|
||||
defaultMessage: 'Verify external links',
|
||||
},
|
||||
verifyExternalLinksDescription: {
|
||||
id: 'nags.verify-external-links.description',
|
||||
defaultMessage:
|
||||
"Some of your external links may be using domains that aren't recognized as common for their link type.",
|
||||
},
|
||||
invalidLicenseUrlTitle: {
|
||||
id: 'nags.invalid-license-url.title',
|
||||
defaultMessage: 'Invalid license URL',
|
||||
},
|
||||
invalidLicenseUrlDescriptionDefault: {
|
||||
id: 'nags.invalid-license-url.description.default',
|
||||
defaultMessage: 'License URL is invalid.',
|
||||
},
|
||||
invalidLicenseUrlDescriptionDomain: {
|
||||
id: 'nags.invalid-license-url.description.domain',
|
||||
defaultMessage:
|
||||
'Your license URL points to {domain}, which is not appropriate for license information. License URLs should link to the actual license text or legal documentation, not social media, gaming platforms etc.',
|
||||
},
|
||||
invalidLicenseUrlDescriptionMalformed: {
|
||||
id: 'nags.invalid-license-url.description.malformed',
|
||||
defaultMessage:
|
||||
'Your license URL appears to be malformed. Please provide a valid URL to your license text.',
|
||||
},
|
||||
gplLicenseSourceRequiredTitle: {
|
||||
id: 'nags.gpl-license-source-required.title',
|
||||
defaultMessage: 'GPL license requires source',
|
||||
},
|
||||
gplLicenseSourceRequiredDescription: {
|
||||
id: 'nags.gpl-license-source-required.description',
|
||||
defaultMessage:
|
||||
'Your {projectType} uses a GPL license which requires source code to be available. Please provide a source code link or consider using a different license.',
|
||||
},
|
||||
visitLinksSettingsTitle: {
|
||||
id: 'nags.visit-links-settings.title',
|
||||
defaultMessage: 'Visit links settings',
|
||||
},
|
||||
editLicenseTitle: {
|
||||
id: 'nags.edit-license.title',
|
||||
defaultMessage: 'Edit license',
|
||||
},
|
||||
})
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user