mirror of
https://github.com/modrinth/code.git
synced 2026-09-05 06:19:11 +00:00
refactor: moderation package left over stuf
This commit is contained in:
+1
-8
@@ -6,15 +6,8 @@ extend-exclude = [
|
||||
"packages/utils/",
|
||||
"packages/ui/",
|
||||
"packages/blog/",
|
||||
# contains licenses like `CC-BY-ND-4.0`
|
||||
"packages/moderation/src/data/stages/license.ts",
|
||||
"packages/moderation/src/utils.ts",
|
||||
# contains profanity word lists with deliberate misspellings
|
||||
"packages/moderation/src/validators/profanity/",
|
||||
# contains payment card IDs like `IY1VMST1MOXS` which are flagged
|
||||
"apps/labrinth/src/queue/payouts/mod.rs",
|
||||
# contains domain names with deliberate typos
|
||||
"apps/labrinth/assets/disposable_email_blocklist.txt"
|
||||
"apps/labrinth/src/queue/payouts/mod.rs"
|
||||
]
|
||||
|
||||
[default]
|
||||
|
||||
@@ -19,7 +19,12 @@ function parseProjectIds(value: string): string[] {
|
||||
...new Set(
|
||||
normalizedValue
|
||||
.split(/[,\r\n]+/)
|
||||
.map((id) => id.trim().replace(/^(['"])(.*)\1$/, '$2').replace(/\s+/g, ''))
|
||||
.map((id) =>
|
||||
id
|
||||
.trim()
|
||||
.replace(/^(['"])(.*)\1$/, '$2')
|
||||
.replace(/\s+/g, ''),
|
||||
)
|
||||
.filter(Boolean),
|
||||
),
|
||||
]
|
||||
@@ -71,8 +76,8 @@ defineExpose({ show, hide })
|
||||
/>
|
||||
<span v-if="error" class="text-sm font-semibold text-red">{{ error }}</span>
|
||||
<span v-else class="text-sm text-secondary">
|
||||
Accepts comma- or newline-separated IDs, including quoted IDs and array syntax.
|
||||
Whitespace and duplicates are removed.
|
||||
Accepts comma- or newline-separated IDs, including quoted IDs and array syntax. Whitespace
|
||||
and duplicates are removed.
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -2,17 +2,16 @@
|
||||
"name": "@modrinth/moderation",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"main": "./src/index.ts",
|
||||
"scripts": {
|
||||
"lint": "eslint . && prettier --check .",
|
||||
"fix": "eslint . --fix && prettier --write .",
|
||||
"test": "node --test src/data/nags/tests.ts",
|
||||
"intl:extract": "formatjs extract \"**/*.{vue,ts,tsx,js,jsx,mts,cts,mjs,cjs}\" --ignore \"**/*.d.ts\" --ignore \"node_modules/**/*\" --out-file src/locales/en-US/index.json --preserve-whitespace",
|
||||
"intl:prune-local": "pnpm -w scripts i18n-icu-contract prune-local --scope packages/moderation"
|
||||
},
|
||||
"dependencies": {
|
||||
"@modrinth/api-client": "workspace:*",
|
||||
"@modrinth/assets": "workspace:*",
|
||||
"@modrinth/utils": "workspace:*",
|
||||
"vue": "^3.5.13"
|
||||
},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineMessages } from '@modrinth/ui/i18n'
|
||||
import { defineMessages } from '@modrinth/ui'
|
||||
|
||||
import type { NagDefinitions } from './types.ts'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineMessages } from '@modrinth/ui/i18n'
|
||||
import { defineMessages } from '@modrinth/ui'
|
||||
|
||||
import type { NagDestinationId, NagLink } from '../../types/nags.ts'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineMessages } from '@modrinth/ui/i18n'
|
||||
import { defineMessages } from '@modrinth/ui'
|
||||
|
||||
import type { NagDefinitions } from './types.ts'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineMessages } from '@modrinth/ui/i18n'
|
||||
import { defineMessages } from '@modrinth/ui'
|
||||
|
||||
import type { NagDefinitions } from './types.ts'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineMessages } from '@modrinth/ui/i18n'
|
||||
import { defineMessages } from '@modrinth/ui'
|
||||
|
||||
import type { NagDefinitions } from './types.ts'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineMessages } from '@modrinth/ui/i18n'
|
||||
import { defineMessages } from '@modrinth/ui'
|
||||
|
||||
import type { NagDefinitions } from './types.ts'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineMessages } from '@modrinth/ui/i18n'
|
||||
import { defineMessages } from '@modrinth/ui'
|
||||
|
||||
import type { NagDefinitions } from './types.ts'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineMessages } from '@modrinth/ui/i18n'
|
||||
import { defineMessages } from '@modrinth/ui'
|
||||
|
||||
import type { NagDefinitions } from './types.ts'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineMessages } from '@modrinth/ui/i18n'
|
||||
import { defineMessages } from '@modrinth/ui'
|
||||
|
||||
import type { NagDefinitions } from './types.ts'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineMessages } from '@modrinth/ui/i18n'
|
||||
import { defineMessages } from '@modrinth/ui'
|
||||
|
||||
import type { NagDefinitions } from './types.ts'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineMessages } from '@modrinth/ui/i18n'
|
||||
import { defineMessages } from '@modrinth/ui'
|
||||
|
||||
import type { NagDefinitions } from './types.ts'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineMessages } from '@modrinth/ui/i18n'
|
||||
import { defineMessages } from '@modrinth/ui'
|
||||
|
||||
import type { NagDefinitions } from './types.ts'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineMessages } from '@modrinth/ui/i18n'
|
||||
import { defineMessages } from '@modrinth/ui'
|
||||
|
||||
import type { NagDefinitions } from './types.ts'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineMessages } from '@modrinth/ui/i18n'
|
||||
import { defineMessages } from '@modrinth/ui'
|
||||
|
||||
import type { NagDefinitions } from './types.ts'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineMessages } from '@modrinth/ui/i18n'
|
||||
import { defineMessages } from '@modrinth/ui'
|
||||
|
||||
import type { NagDefinitions } from './types.ts'
|
||||
|
||||
|
||||
@@ -13,10 +13,6 @@
|
||||
"types": "./index.ts",
|
||||
"default": "./index.ts"
|
||||
},
|
||||
"./i18n": {
|
||||
"types": "./src/composables/i18n.ts",
|
||||
"default": "./src/composables/i18n.ts"
|
||||
},
|
||||
"./pages": {
|
||||
"types": "./src/pages/index.ts",
|
||||
"default": "./src/pages/index.ts"
|
||||
|
||||
@@ -2,8 +2,8 @@ import IntlMessageFormat from 'intl-messageformat'
|
||||
import type { Ref } from 'vue'
|
||||
import type { CompileError, MessageCompiler, MessageContext } from 'vue-i18n'
|
||||
|
||||
import { injectI18n } from '../providers/i18n.ts'
|
||||
import { injectI18nDebug } from './i18n-debug.ts'
|
||||
import { injectI18n } from '../providers/i18n'
|
||||
import { injectI18nDebug } from './i18n-debug'
|
||||
|
||||
export interface MessageDescriptor {
|
||||
id: string
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Labrinth } from '@modrinth/api-client'
|
||||
import { capitalizeString } from '@modrinth/utils/utils.ts'
|
||||
import { capitalizeString } from '@modrinth/utils'
|
||||
|
||||
import { defineMessage, defineMessages, type MessageDescriptor } from '../composables/i18n.ts'
|
||||
import { defineMessage, defineMessages, type MessageDescriptor } from '../composables/i18n'
|
||||
|
||||
export const commonMessages = defineMessages({
|
||||
acceptButton: {
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
import { capitalizeString } from '@modrinth/utils/utils.ts'
|
||||
import { capitalizeString } from '@modrinth/utils'
|
||||
|
||||
import {
|
||||
defineMessages,
|
||||
type MessageDescriptor,
|
||||
type VIntlFormatters,
|
||||
} from '../composables/i18n.ts'
|
||||
import { defineMessages, type MessageDescriptor, type VIntlFormatters } from '../composables/i18n'
|
||||
|
||||
export const loaderMessages = defineMessages({
|
||||
babric: {
|
||||
|
||||
Generated
+3
-46
@@ -557,6 +557,9 @@ importers:
|
||||
'@modrinth/api-client':
|
||||
specifier: workspace:*
|
||||
version: link:../api-client
|
||||
'@modrinth/assets':
|
||||
specifier: workspace:*
|
||||
version: link:../assets
|
||||
'@modrinth/utils':
|
||||
specifier: workspace:*
|
||||
version: link:../utils
|
||||
@@ -6228,10 +6231,6 @@ packages:
|
||||
resolution: {integrity: sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==}
|
||||
engines: {node: '>=0.12'}
|
||||
|
||||
entities@8.0.0:
|
||||
resolution: {integrity: sha512-zwfzJecQ/Uej6tusMqwAqU/6KL2XaB2VZ2Jg54Je6ahNBGNH6Ek6g3jjNCF0fG9EWQKGZNddNjU5F1ZQn/sBnA==}
|
||||
engines: {node: '>=20.19.0'}
|
||||
|
||||
error-ex@1.3.4:
|
||||
resolution: {integrity: sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==}
|
||||
|
||||
@@ -6693,9 +6692,6 @@ packages:
|
||||
react-dom:
|
||||
optional: true
|
||||
|
||||
franc-min@6.2.0:
|
||||
resolution: {integrity: sha512-1uDIEUSlUZgvJa2AKYR/dmJC66v/PvGQ9mWfI9nOr/kPpMFyvswK0gPXOwpYJYiYD008PpHLkGfG58SPjQJFxw==}
|
||||
|
||||
fresh@2.0.0:
|
||||
resolution: {integrity: sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==}
|
||||
engines: {node: '>= 0.8'}
|
||||
@@ -7985,9 +7981,6 @@ packages:
|
||||
mz@2.7.0:
|
||||
resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==}
|
||||
|
||||
n-gram@2.0.2:
|
||||
resolution: {integrity: sha512-S24aGsn+HLBxUGVAUFOwGpKs7LBcG4RudKU//eWzt/mQ97/NMKQxDWHyHx63UNWk/OOdihgmzoETn1tf5nQDzQ==}
|
||||
|
||||
nanoid@3.3.11:
|
||||
resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==}
|
||||
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
|
||||
@@ -8062,9 +8055,6 @@ packages:
|
||||
resolution: {integrity: sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==}
|
||||
hasBin: true
|
||||
|
||||
node-html-parser@9.0.1:
|
||||
resolution: {integrity: sha512-QrdiYYm1NnLRXsMXThUgVcF/syWfWIgHFmy8hylWMGFbHFtnRuXLBxxGQvIm3xaIJMUDJ0ayOmT/FGJYT3pZIw==}
|
||||
|
||||
node-mock-http@1.0.4:
|
||||
resolution: {integrity: sha512-8DY+kFsDkNXy1sJglUfuODx1/opAGJGyrTuFqEoN90oRc2Vk0ZbD4K2qmKXBBEhZQzdKHIVfEJpDU8Ak2NJEvQ==}
|
||||
|
||||
@@ -8136,10 +8126,6 @@ packages:
|
||||
resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
obscenity@0.4.6:
|
||||
resolution: {integrity: sha512-pHk7kNN7j3L3zGhhGnwxjvXIGsPpLrcZl2r58fqWh/V/rH6b/dafscj2sMmAY+A/9/wPsocLmimgGk2DKeKsFQ==}
|
||||
engines: {node: '>=18.0.0'}
|
||||
|
||||
obug@2.1.1:
|
||||
resolution: {integrity: sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ==}
|
||||
|
||||
@@ -9628,10 +9614,6 @@ packages:
|
||||
resolution: {integrity: sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==}
|
||||
engines: {node: '>=14.0.0'}
|
||||
|
||||
tlds@1.261.0:
|
||||
resolution: {integrity: sha512-QXqwfEl9ddlGBaRFXIvNKK6OhipSiLXuRuLJX5DErz0o0Q0rYxulWLdFryTkV5PkdZct5iMInwYEGe/eR++1AA==}
|
||||
hasBin: true
|
||||
|
||||
tldts-core@6.1.86:
|
||||
resolution: {integrity: sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==}
|
||||
|
||||
@@ -9665,9 +9647,6 @@ packages:
|
||||
resolution: {integrity: sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
trigram-utils@2.0.1:
|
||||
resolution: {integrity: sha512-nfWIXHEaB+HdyslAfMxSqWKDdmqY9I32jS7GnqpdWQnLH89r6A5sdk3fDVYqGAZ0CrT8ovAFSAo6HRiWcWNIGQ==}
|
||||
|
||||
trim-lines@3.0.1:
|
||||
resolution: {integrity: sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==}
|
||||
|
||||
@@ -16297,8 +16276,6 @@ snapshots:
|
||||
|
||||
entities@7.0.1: {}
|
||||
|
||||
entities@8.0.0: {}
|
||||
|
||||
error-ex@1.3.4:
|
||||
dependencies:
|
||||
is-arrayish: 0.2.1
|
||||
@@ -17073,10 +17050,6 @@ snapshots:
|
||||
react: 19.2.8
|
||||
react-dom: 19.2.8(react@19.2.8)
|
||||
|
||||
franc-min@6.2.0:
|
||||
dependencies:
|
||||
trigram-utils: 2.0.1
|
||||
|
||||
fresh@2.0.0: {}
|
||||
|
||||
fs-constants@1.0.0:
|
||||
@@ -18747,8 +18720,6 @@ snapshots:
|
||||
object-assign: 4.1.1
|
||||
thenify-all: 1.6.0
|
||||
|
||||
n-gram@2.0.2: {}
|
||||
|
||||
nanoid@3.3.11: {}
|
||||
|
||||
nanoid@5.1.6: {}
|
||||
@@ -18896,11 +18867,6 @@ snapshots:
|
||||
|
||||
node-gyp-build@4.8.4: {}
|
||||
|
||||
node-html-parser@9.0.1:
|
||||
dependencies:
|
||||
css-select: 5.2.2
|
||||
entities: 8.0.0
|
||||
|
||||
node-mock-http@1.0.4: {}
|
||||
|
||||
node-releases@2.0.27: {}
|
||||
@@ -19077,8 +19043,6 @@ snapshots:
|
||||
|
||||
object-inspect@1.13.4: {}
|
||||
|
||||
obscenity@0.4.6: {}
|
||||
|
||||
obug@2.1.1: {}
|
||||
|
||||
ofetch@1.5.1:
|
||||
@@ -20880,8 +20844,6 @@ snapshots:
|
||||
|
||||
tinyspy@4.0.4: {}
|
||||
|
||||
tlds@1.261.0: {}
|
||||
|
||||
tldts-core@6.1.86:
|
||||
optional: true
|
||||
|
||||
@@ -20912,11 +20874,6 @@ snapshots:
|
||||
punycode: 2.3.1
|
||||
optional: true
|
||||
|
||||
trigram-utils@2.0.1:
|
||||
dependencies:
|
||||
collapse-white-space: 2.1.0
|
||||
n-gram: 2.0.2
|
||||
|
||||
trim-lines@3.0.1: {}
|
||||
|
||||
trough@2.2.0: {}
|
||||
|
||||
Reference in New Issue
Block a user