Skip to content

Commit 62f5a23

Browse files
coolbot100sIMB11
andauthored
Moderation Checklist V1.5 (#3980)
* starting on new checklist implementation Change default shouldShow behavior for stages. add new messages and stages. Change some existing stage logic. Add placeholder var for the rules. Co-Authored-By: @coolbot100s * misc fixes + corrections * Add clickable link previews to links stage * Correct mislabeled title message and add new title messages * Change message formatting, use rules variable, correct wip desc and title 1.8 messages, add tags buttons * More applications of rules placeholder * Add new status alerts stage * change order of statusAlerts * Update title related messages, add navigation based vars * Overhaul Links stage and add new messages. * Set message weights, add some disables * message.mds now obey lint >:( * fixed links text message formatting and changed an icon * Combine title and slug stages * Add more info to some stages and properly case stage ids * tweak summary text formatting * Improved tags stage info and more navigation placeholders * redo reupload stage, more navigation placeholders, licensing stage improvements, versions stage improvements, status alerts stage improvements * Allow modpack permissions stage to appear again by adding a dummy button. * Update modpack permissions guidance * fix: blog path issues * fix: lint issues * fix license stage text formatting * Improve license stage * feat: move links into one md file to be cleaner * Update packages/moderation/data/stages/links.ts Signed-off-by: IMB11 <hendersoncal117@gmail.com> --------- Signed-off-by: IMB11 <hendersoncal117@gmail.com> Co-authored-by: IMB11 <hendersoncal117@gmail.com> Co-authored-by: IMB11 <calum@modrinth.com>
1 parent eb595cd commit 62f5a23

File tree

93 files changed

+951
-363
lines changed

Some content is hidden

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

93 files changed

+951
-363
lines changed

apps/frontend/src/components/ui/moderation/NewModerationChecklist.vue

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ const stageTextExpanded = computedAsync(async () => {
464464
const stage = checklist[stageIndex];
465465
if (stage.text) {
466466
return renderHighlightedString(
467-
expandVariables(await stage.text(), props.project, variables.value),
467+
expandVariables(await stage.text(props.project), props.project, variables.value),
468468
);
469469
}
470470
return null;
@@ -980,6 +980,18 @@ async function processAction(
980980
}
981981
982982
function shouldShowStage(stage: Stage): boolean {
983+
let hasVisibleActions = false;
984+
985+
for (const a of stage.actions) {
986+
if (shouldShowAction(a)) {
987+
hasVisibleActions = true;
988+
}
989+
}
990+
991+
if (!hasVisibleActions) {
992+
return false;
993+
}
994+
983995
if (typeof stage.shouldShow === "function") {
984996
return stage.shouldShow(props.project);
985997
}

apps/frontend/src/public/news/feed/articles.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,20 @@
9898
"date": "2023-02-01T20:00:00.000Z",
9999
"link": "https://modrinth.com/news/article/accelerating-development"
100100
},
101-
{
102-
"title": "Two years of Modrinth: a retrospective",
103-
"summary": "The history of Modrinth as we know it from December 2020 to December 2022.",
104-
"thumbnail": "https://modrinth.com/news/default.webp",
105-
"date": "2023-01-07T00:00:00.000Z",
106-
"link": "https://modrinth.com/news/article/two-years-of-modrinth-history"
107-
},
108101
{
109102
"title": "Modrinth's Anniversary Update",
110103
"summary": "Marking two years of Modrinth and discussing our New Year's Resolutions for 2023.",
111104
"thumbnail": "https://modrinth.com/news/article/two-years-of-modrinth/thumbnail.webp",
112105
"date": "2023-01-07T00:00:00.000Z",
113106
"link": "https://modrinth.com/news/article/two-years-of-modrinth"
114107
},
108+
{
109+
"title": "Two years of Modrinth: a retrospective",
110+
"summary": "The history of Modrinth as we know it from December 2020 to December 2022.",
111+
"thumbnail": "https://modrinth.com/news/default.webp",
112+
"date": "2023-01-07T00:00:00.000Z",
113+
"link": "https://modrinth.com/news/article/two-years-of-modrinth-history"
114+
},
115115
{
116116
"title": "Creators can now make money on Modrinth!",
117117
"summary": "Introducing the Creator Monetization Program allowing creators to earn revenue from their projects.",

apps/frontend/src/public/news/feed/rss.xml

Lines changed: 15 additions & 15 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"app:build": "turbo run build --filter=@modrinth/app",
1414
"app:fix": "turbo run fix --filter=@modrinth/app",
1515
"app:intl:extract": "pnpm run --filter=@modrinth/app-frontend intl:extract",
16+
"blog:fix": "turbo run fix --filter=@modrinth/blog",
1617
"pages:build": "NITRO_PRESET=cloudflare-pages pnpm --filter frontend run build",
1718
"build": "turbo run build --continue",
1819
"lint": "turbo run lint --continue",

packages/blog/check.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import { promises as fs } from 'fs'
22
import * as path from 'path'
3-
import fastGlob from 'fast-glob'
43
import { repoPath, toVarName } from './utils'
4+
import { glob } from 'glob'
55

66
import { PUBLIC_SRC, PUBLIC_LOCATIONS, ARTICLES_GLOB, COMPILED_DIR } from './blog.config'
77

88
async function checkPublicAssets() {
9-
const srcFiles = await fastGlob(['**/*'], { cwd: PUBLIC_SRC, dot: true })
9+
const srcFiles = await glob('**/*', { cwd: PUBLIC_SRC, dot: true })
1010
let allOk = true
1111
for (const target of PUBLIC_LOCATIONS) {
1212
for (const relativeFile of srcFiles) {
13-
const shouldExist = path.join(target, relativeFile)
13+
const shouldExist = path.posix.join(target, relativeFile)
1414
try {
1515
await fs.access(shouldExist)
1616
} catch {
@@ -26,15 +26,15 @@ async function checkPublicAssets() {
2626
}
2727

2828
async function checkCompiledArticles() {
29-
const mdFiles = await fastGlob([ARTICLES_GLOB])
30-
const compiledFiles = await fastGlob([`${COMPILED_DIR}/*.ts`])
29+
const mdFiles = await glob(ARTICLES_GLOB)
30+
const compiledFiles = await glob(`${COMPILED_DIR}/*.ts`)
3131
const compiledVarNames = compiledFiles.map((f) => path.basename(f, '.ts'))
3232

3333
// Check all .md have compiled .ts and .content.ts and the proper public thumbnail
3434
for (const file of mdFiles) {
3535
const varName = toVarName(path.basename(file, '.md'))
36-
const compiledPath = path.join(COMPILED_DIR, varName + '.ts')
37-
const contentPath = path.join(COMPILED_DIR, varName + '.content.ts')
36+
const compiledPath = path.posix.join(COMPILED_DIR, varName + '.ts')
37+
const contentPath = path.posix.join(COMPILED_DIR, varName + '.content.ts')
3838
if (!compiledVarNames.includes(varName)) {
3939
console.error(`⚠️ Missing compiled article for: ${file} (should be: ${compiledPath})`)
4040
process.exit(1)
@@ -59,7 +59,7 @@ async function checkCompiledArticles() {
5959
if (varName === 'index' || varName.endsWith('.content')) continue
6060

6161
const mdPathGlob = repoPath(`packages/blog/articles/**/${varName.replace(/_/g, '*')}.md`)
62-
const found = await fastGlob([mdPathGlob])
62+
const found = await glob(mdPathGlob)
6363
if (!found.length) {
6464
console.error(`❌ Compiled article ${compiled} has no matching markdown source!`)
6565
process.exit(1)

packages/blog/compile.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { promises as fs } from 'fs'
22
import * as path from 'path'
3-
import fg from 'fast-glob'
43
import matter from 'gray-matter'
54
import { md } from '@modrinth/utils'
65
import { minify } from 'html-minifier-terser'
76
import { copyDir, toVarName } from './utils'
87
import RSS from 'rss'
98
import { parseStringPromise } from 'xml2js'
9+
import { glob } from 'glob'
1010

1111
import {
1212
ARTICLES_GLOB,
@@ -24,7 +24,7 @@ async function ensureCompiledDir() {
2424
}
2525

2626
async function hasThumbnail(slug: string): Promise<boolean> {
27-
const thumbnailPath = path.join(PUBLIC_SRC, slug, 'thumbnail.webp')
27+
const thumbnailPath = path.posix.join(PUBLIC_SRC, slug, 'thumbnail.webp')
2828
try {
2929
await fs.access(thumbnailPath)
3030
return true
@@ -48,7 +48,7 @@ function getThumbnailUrl(slug: string, hasThumb: boolean): string {
4848
async function compileArticles() {
4949
await ensureCompiledDir()
5050

51-
const files = await fg([ARTICLES_GLOB])
51+
const files = await glob(ARTICLES_GLOB)
5252
console.log(`🔎 Found ${files.length} markdown articles!`)
5353
const articleExports: string[] = []
5454
const articlesArray: string[] = []
@@ -75,8 +75,8 @@ async function compileArticles() {
7575

7676
const slug = frontSlug || path.basename(file, '.md')
7777
const varName = toVarName(slug)
78-
const exportFile = path.join(COMPILED_DIR, `${varName}.ts`)
79-
const contentFile = path.join(COMPILED_DIR, `${varName}.content.ts`)
78+
const exportFile = path.posix.join(COMPILED_DIR, `${varName}.ts`)
79+
const contentFile = path.posix.join(COMPILED_DIR, `${varName}.content.ts`)
8080
const thumbnailPresent = await hasThumbnail(slug)
8181

8282
const contentTs = `
@@ -221,7 +221,7 @@ async function deleteDirContents(dir: string) {
221221
const entries = await fs.readdir(dir, { withFileTypes: true })
222222
await Promise.all(
223223
entries.map(async (entry) => {
224-
const fullPath = path.join(dir, entry.name)
224+
const fullPath = path.posix.join(dir, entry.name)
225225
if (entry.isDirectory()) {
226226
await fs.rm(fullPath, { recursive: true, force: true })
227227
} else {

packages/blog/compiled/index.ts

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,56 @@
11
// AUTO-GENERATED FILE - DO NOT EDIT
2-
import { article as a_new_chapter_for_modrinth_servers } from './a_new_chapter_for_modrinth_servers'
3-
import { article as accelerating_development } from './accelerating_development'
4-
import { article as becoming_sustainable } from './becoming_sustainable'
5-
import { article as capital_return } from './capital_return'
6-
import { article as carbon_ads } from './carbon_ads'
7-
import { article as creator_monetization } from './creator_monetization'
8-
import { article as creator_update } from './creator_update'
9-
import { article as creator_updates_july_2025 } from './creator_updates_july_2025'
10-
import { article as design_refresh } from './design_refresh'
11-
import { article as download_adjustment } from './download_adjustment'
12-
import { article as knossos_v2_1_0 } from './knossos_v2_1_0'
13-
import { article as licensing_guide } from './licensing_guide'
14-
import { article as modpack_changes } from './modpack_changes'
15-
import { article as modpacks_alpha } from './modpacks_alpha'
16-
import { article as modrinth_app_beta } from './modrinth_app_beta'
17-
import { article as modrinth_beta } from './modrinth_beta'
18-
import { article as modrinth_servers_beta } from './modrinth_servers_beta'
19-
import { article as new_site_beta } from './new_site_beta'
20-
import { article as plugins_resource_packs } from './plugins_resource_packs'
21-
import { article as pride_campaign_2025 } from './pride_campaign_2025'
22-
import { article as redesign } from './redesign'
23-
import { article as skins_now_in_modrinth_app } from './skins_now_in_modrinth_app'
24-
import { article as two_years_of_modrinth_history } from './two_years_of_modrinth_history'
25-
import { article as two_years_of_modrinth } from './two_years_of_modrinth'
26-
import { article as whats_modrinth } from './whats_modrinth'
272
import { article as windows_borderless_malware_disclosure } from './windows_borderless_malware_disclosure'
3+
import { article as whats_modrinth } from './whats_modrinth'
4+
import { article as two_years_of_modrinth } from './two_years_of_modrinth'
5+
import { article as two_years_of_modrinth_history } from './two_years_of_modrinth_history'
6+
import { article as skins_now_in_modrinth_app } from './skins_now_in_modrinth_app'
7+
import { article as redesign } from './redesign'
8+
import { article as pride_campaign_2025 } from './pride_campaign_2025'
9+
import { article as plugins_resource_packs } from './plugins_resource_packs'
10+
import { article as new_site_beta } from './new_site_beta'
11+
import { article as modrinth_servers_beta } from './modrinth_servers_beta'
12+
import { article as modrinth_beta } from './modrinth_beta'
13+
import { article as modrinth_app_beta } from './modrinth_app_beta'
14+
import { article as modpacks_alpha } from './modpacks_alpha'
15+
import { article as modpack_changes } from './modpack_changes'
16+
import { article as licensing_guide } from './licensing_guide'
17+
import { article as knossos_v2_1_0 } from './knossos_v2_1_0'
18+
import { article as download_adjustment } from './download_adjustment'
19+
import { article as design_refresh } from './design_refresh'
20+
import { article as creator_updates_july_2025 } from './creator_updates_july_2025'
21+
import { article as creator_update } from './creator_update'
22+
import { article as creator_monetization } from './creator_monetization'
23+
import { article as carbon_ads } from './carbon_ads'
24+
import { article as capital_return } from './capital_return'
25+
import { article as becoming_sustainable } from './becoming_sustainable'
26+
import { article as accelerating_development } from './accelerating_development'
27+
import { article as a_new_chapter_for_modrinth_servers } from './a_new_chapter_for_modrinth_servers'
2828

2929
export const articles = [
30-
a_new_chapter_for_modrinth_servers,
31-
accelerating_development,
32-
becoming_sustainable,
33-
capital_return,
34-
carbon_ads,
35-
creator_monetization,
36-
creator_update,
37-
creator_updates_july_2025,
38-
design_refresh,
39-
download_adjustment,
40-
knossos_v2_1_0,
41-
licensing_guide,
42-
modpack_changes,
43-
modpacks_alpha,
44-
modrinth_app_beta,
45-
modrinth_beta,
46-
modrinth_servers_beta,
47-
new_site_beta,
48-
plugins_resource_packs,
49-
pride_campaign_2025,
50-
redesign,
51-
skins_now_in_modrinth_app,
52-
two_years_of_modrinth_history,
53-
two_years_of_modrinth,
54-
whats_modrinth,
5530
windows_borderless_malware_disclosure,
31+
whats_modrinth,
32+
two_years_of_modrinth,
33+
two_years_of_modrinth_history,
34+
skins_now_in_modrinth_app,
35+
redesign,
36+
pride_campaign_2025,
37+
plugins_resource_packs,
38+
new_site_beta,
39+
modrinth_servers_beta,
40+
modrinth_beta,
41+
modrinth_app_beta,
42+
modpacks_alpha,
43+
modpack_changes,
44+
licensing_guide,
45+
knossos_v2_1_0,
46+
download_adjustment,
47+
design_refresh,
48+
creator_updates_july_2025,
49+
creator_update,
50+
creator_monetization,
51+
carbon_ads,
52+
capital_return,
53+
becoming_sustainable,
54+
accelerating_development,
55+
a_new_chapter_for_modrinth_servers,
5656
]

packages/blog/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"fix": "jiti ./compile.ts && eslint . --fix && prettier --write ."
1010
},
1111
"devDependencies": {
12+
"@types/glob": "^9.0.0",
1213
"@types/html-minifier-terser": "^7.0.2",
1314
"@types/rss": "^0.0.32",
1415
"@types/xml2js": "^0.4.14",
@@ -19,7 +20,7 @@
1920
},
2021
"dependencies": {
2122
"@modrinth/utils": "workspace:*",
22-
"fast-glob": "^3.3.3",
23+
"glob": "^10.2.7",
2324
"gray-matter": "^4.0.3",
2425
"html-minifier-terser": "^7.2.0",
2526
"rss": "^1.2.2",

packages/blog/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function getRepoRoot(): string {
88
}
99

1010
export function repoPath(...segments: string[]): string {
11-
return path.join(getRepoRoot(), ...segments)
11+
return path.posix.join(getRepoRoot(), ...segments)
1212
}
1313

1414
export async function copyDir(
@@ -20,8 +20,8 @@ export async function copyDir(
2020
await fs.mkdir(dest, { recursive: true })
2121
const entries = await fs.readdir(src, { withFileTypes: true })
2222
for (const entry of entries) {
23-
const srcPath = path.join(src, entry.name)
24-
const destPath = path.join(dest, entry.name)
23+
const srcPath = path.posix.join(src, entry.name)
24+
const destPath = path.posix.join(dest, entry.name)
2525
if (entry.isDirectory()) {
2626
await copyDir(srcPath, destPath, logFn)
2727
} else if (entry.isFile()) {
Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,32 @@
11
import type { Stage } from '../types/stage'
22
import modpackPermissionsStage from './modpack-permissions-stage'
33
import categories from './stages/categories'
4-
import copyright from './stages/copyright'
4+
import reupload from './stages/reupload'
55
import description from './stages/description'
66
import gallery from './stages/gallery'
77
import links from './stages/links'
88
import ruleFollowing from './stages/rule-following'
99
import sideTypes from './stages/side-types'
10-
import slug from './stages/slug'
1110
import summary from './stages/summary'
12-
import title from './stages/title'
11+
import titleSlug from './stages/title-slug'
1312
import versions from './stages/versions'
13+
import license from './stages/license'
14+
import undefinedProject from './stages/undefined-project'
15+
import statusAlerts from './stages/status-alerts'
1416

1517
export default [
16-
title,
17-
slug,
18+
titleSlug,
1819
summary,
1920
description,
2021
links,
22+
license,
2123
categories,
2224
sideTypes,
2325
gallery,
2426
versions,
25-
copyright,
27+
reupload,
2628
ruleFollowing,
2729
modpackPermissionsStage,
30+
statusAlerts,
31+
undefinedProject,
2832
] as ReadonlyArray<Stage>

0 commit comments

Comments
 (0)