2025-11-14 17:15:09 +00:00
|
|
|
import { GenericModrinthClient, type Labrinth } from '@modrinth/api-client'
|
2025-09-16 16:57:34 +01:00
|
|
|
import serverSidedVue from '@vitejs/plugin-vue'
|
2026-01-08 11:25:45 -05:00
|
|
|
import fs from 'fs/promises'
|
2025-08-14 21:48:38 +01:00
|
|
|
import { defineNuxtConfig } from 'nuxt/config'
|
|
|
|
|
import svgLoader from 'vite-svg-loader'
|
|
|
|
|
|
|
|
|
|
const STAGING_API_URL = 'https://staging-api.modrinth.com/v2/'
|
Rewrite Parity (#647)
* Rewrite Parity
* Update SEO, fix modals, add dashes to changelog
* Edit create version title
* Cache tags, SEO for search/partial noscript support, notifications fix
* Deploy?
* Fix vercel config
* Fix it again
* Finish user editing
* Remove broken docker build
* Switch reports to modals
* Update project card
* Navbar line animation in most places
* Add chips
* Move to navlink query params
* remove autogen file
* Add copy code
* Fix webkit text box outlines, port report modal
* Update error page
* Switch to avatar component
* Make keyboard nav work
* Fix team member spacing
* improve project ID display (#676)
* Bug fixes
* Update OG site title
* More fixes
* Design tweaks
* Fix card wrapping on mobile
* Darken light theme color a little
* Sidebar navigation for settings, notifications, and moderation
* Change follow icon from a heart to a bell
* Revert "Change follow icon from a heart to a bell"
This reverts commit e30b46ec5d93c57df847be88eba123c7419dd03b.
* Change follows icon in settings
* AaaaUUUUUUUGghghhhhhhhh
* Project sidebar transparent button animations
* Update file input button styling and change icon remove button text
* Fix environments filter condition being inverted
* Remove -> revert
* Improve readability of warning banners on light mode
* Fix mobile menu button colors
* Clean up notifications page more
* Creator dashboard and monetization work
* Add processing fees declarations and acknowledgement box
* Beta badges
* Downgrade Nuxt Vercel Builder
* Update the style of button groups to be more consistent
* More button consistency
* Remove desktop navbar on mobile
* Update home page progress indicators
* Fix page jumping (Thanks @stairman06)
* Make checkbox checked style consistent with other selection indicators
* More home page updates
* Properly reset NavRows
* Move filters menu on mobile
* Stylized checkbox updated to match active styling
* Filters icon
* Respect prefers-reduced-motion
* Add most backend payouts changes (untested)
* Finish tested payouts code
* Allow monetization unenrolling
* No longer use brand color for active highlights on standard nav elements
* More consistent button group on project page
* Rounded tables
* Fix some things (#716)
* Team member fixes + re-add changelog/versions stuff
* Remove dummy data
* The great CSS refactor
* Remove commented out css
* Give modals the legacy label styles and update profile edit labels
* Fix active chip size
* Remove shadow from selected chip
* Require email set for CMP
* Update styles of notifications to universal-card
* Equivalent exchange, trading some jank for some less bad jank
* Fix all gallery buttons being missing when there is only 1 image
* Update project creation modal
* Make beta badge less bright
* Beta badge heading styling
* Update withdraw processing fees info
* Remove redundant label
* be
* Fix inverted logic
* 2% is 0.02
* Add toggle to turn off alpha modpacks banner
* Why warning button?
* Add more footer links (#719)
* Add more footer links
* Move twitter
* Make items on user pages less comically large and move ad above navigation
* Bump text down a little on home page
* Update favicon colors
* Remove task list package and change default description to use bullet points
* I don't remember why I made this important but let's not
* Ah, yes
* this doesn't actually need to be important
* Align items in input groups
* Adjust some spacings and clear creation modal on opening
* Versions now clickable
* Add link to edit page to default description
* Improve monetization information text
* Make wrapped text inputs not shrink
* Make chips work better
* smol margin on clear mod message button
* Allow non-authenticated users to access settings
* Remove settings anchors
* Fix versions page button style on firefox
* Add advanced rendering toggle
* Update slug input and icon card in project edit page
* Legal sidebar
* h1 at beginning of description no longer has top margin
* Use universal card for legal pages
* Update email addresses on legal pages
* Update various page titles and descriptions for consistency
* Various fixes and consolidation to API URL retrieval
Prevents a bug where it's possible to generate the tags under one API, switch the API, and still have tags leftover from the old API
Also finally fixes staging URL being jank
* Make the theme button show regardless of login state
Also remove the change theme from the user dropdown because it's very redundant with the several other ways of changing theme
* Make mobile profile dropdown ordering consistent with desktop
* Change the base url back
* Revert "Change the base url back"
This reverts commit c1da89fddb83776b39f626eab33c8dc67f8a75e4.
* constantize
* Tiny fixes (#722)
* Box-shadow chip outlines
* Show settings when signed out
* mods -> projects
* space
* Beta badge border
* Slug input overflow fix, scrollable
* 🙈 it will all be okay 🙊 this is just temporary 🙉 😭😭 forgive me
* Fix minor bugs
* fix moderation page
* More fixes
* Temp fix for download button
* BEGONE TABLES
* Fix download button
Co-authored-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
Co-authored-by: Prospector <prospectordev@gmail.com>
Co-authored-by: stairman06 <36215135+stairman06@users.noreply.github.com>
Co-authored-by: triphora <emmaffle@modrinth.com>
2022-11-12 17:57:40 -07:00
|
|
|
|
2023-05-06 22:17:43 +03:00
|
|
|
const preloadedFonts = [
|
2025-08-14 21:48:38 +01:00
|
|
|
'inter/Inter-Regular.woff2',
|
|
|
|
|
'inter/Inter-Medium.woff2',
|
|
|
|
|
'inter/Inter-SemiBold.woff2',
|
|
|
|
|
'inter/Inter-Bold.woff2',
|
|
|
|
|
]
|
2023-05-06 22:17:43 +03:00
|
|
|
|
|
|
|
|
const favicons = {
|
2025-08-14 21:48:38 +01:00
|
|
|
'(prefers-color-scheme:no-preference)': '/favicon-light.ico',
|
|
|
|
|
'(prefers-color-scheme:light)': '/favicon-light.ico',
|
|
|
|
|
'(prefers-color-scheme:dark)': '/favicon.ico',
|
|
|
|
|
}
|
2023-05-06 22:17:43 +03:00
|
|
|
|
2026-01-12 03:54:21 -08:00
|
|
|
const PROD_MODRINTH_URL = 'https://modrinth.com'
|
|
|
|
|
const STAGING_MODRINTH_URL = 'https://staging.modrinth.com'
|
|
|
|
|
|
2023-03-09 10:05:32 -07:00
|
|
|
export default defineNuxtConfig({
|
2025-08-14 21:48:38 +01:00
|
|
|
srcDir: 'src/',
|
|
|
|
|
app: {
|
|
|
|
|
head: {
|
|
|
|
|
htmlAttrs: {
|
|
|
|
|
lang: 'en',
|
|
|
|
|
},
|
|
|
|
|
title: 'Modrinth',
|
|
|
|
|
link: [
|
|
|
|
|
// The type is necessary because the linter can't always compare this very nested/complex type on itself
|
|
|
|
|
...preloadedFonts.map((font): object => {
|
|
|
|
|
return {
|
|
|
|
|
rel: 'preload',
|
|
|
|
|
href: `https://cdn-raw.modrinth.com/fonts/${font}?v=3.19`,
|
|
|
|
|
as: 'font',
|
|
|
|
|
type: 'font/woff2',
|
|
|
|
|
crossorigin: 'anonymous',
|
|
|
|
|
}
|
|
|
|
|
}),
|
|
|
|
|
...Object.entries(favicons).map(([media, href]): object => {
|
|
|
|
|
return { rel: 'icon', type: 'image/x-icon', href, media }
|
|
|
|
|
}),
|
|
|
|
|
...Object.entries(favicons).map(([media, href]): object => {
|
|
|
|
|
return { rel: 'apple-touch-icon', type: 'image/x-icon', href, media, sizes: '64x64' }
|
|
|
|
|
}),
|
|
|
|
|
{
|
|
|
|
|
rel: 'search',
|
|
|
|
|
type: 'application/opensearchdescription+xml',
|
|
|
|
|
href: '/opensearch.xml',
|
|
|
|
|
title: 'Modrinth mods',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
vite: {
|
2025-12-30 15:06:52 +00:00
|
|
|
css: {
|
|
|
|
|
preprocessorOptions: {
|
|
|
|
|
scss: {
|
|
|
|
|
// TODO: dont forget about this
|
|
|
|
|
silenceDeprecations: ['import'],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
ssr: {
|
|
|
|
|
// https://github.com/Akryum/floating-vue/issues/809#issuecomment-1002996240
|
|
|
|
|
noExternal: ['v-tooltip'],
|
|
|
|
|
},
|
2025-08-14 21:48:38 +01:00
|
|
|
define: {
|
|
|
|
|
global: {},
|
|
|
|
|
},
|
|
|
|
|
esbuild: {
|
|
|
|
|
define: {
|
|
|
|
|
global: 'globalThis',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
cacheDir: '../../node_modules/.vite/apps/knossos',
|
|
|
|
|
resolve: {
|
|
|
|
|
dedupe: ['vue'],
|
|
|
|
|
},
|
|
|
|
|
plugins: [
|
|
|
|
|
svgLoader({
|
|
|
|
|
svgoConfig: {
|
|
|
|
|
plugins: [
|
|
|
|
|
{
|
|
|
|
|
name: 'preset-default',
|
|
|
|
|
params: {
|
|
|
|
|
overrides: {
|
|
|
|
|
removeViewBox: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
}),
|
|
|
|
|
],
|
2026-01-08 11:25:45 -05:00
|
|
|
build: {
|
|
|
|
|
rollupOptions: {
|
|
|
|
|
external: ['cloudflare:workers'],
|
|
|
|
|
},
|
|
|
|
|
},
|
2025-08-14 21:48:38 +01:00
|
|
|
},
|
|
|
|
|
hooks: {
|
2025-09-16 16:57:34 +01:00
|
|
|
async 'nitro:config'(nitroConfig) {
|
|
|
|
|
const emailTemplates = Object.keys(
|
2025-10-07 11:47:59 +01:00
|
|
|
await import('./src/templates/emails/index.ts').then((m) => m.default),
|
|
|
|
|
)
|
|
|
|
|
const docTemplates = Object.keys(
|
|
|
|
|
await import('./src/templates/docs/index.ts').then((m) => m.default),
|
2025-09-16 16:57:34 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
nitroConfig.prerender = nitroConfig.prerender || {}
|
|
|
|
|
nitroConfig.prerender.routes = nitroConfig.prerender.routes || []
|
|
|
|
|
for (const template of emailTemplates) {
|
2025-10-07 11:47:59 +01:00
|
|
|
nitroConfig.prerender.routes.push(`/_internal/templates/email/${template}`)
|
|
|
|
|
}
|
|
|
|
|
for (const template of docTemplates) {
|
|
|
|
|
nitroConfig.prerender.routes.push(`/_internal/templates/doc/${template}`)
|
2025-09-16 16:57:34 +01:00
|
|
|
}
|
|
|
|
|
},
|
2025-08-14 21:48:38 +01:00
|
|
|
async 'build:before'() {
|
|
|
|
|
// 30 minutes
|
|
|
|
|
const TTL = 30 * 60 * 1000
|
|
|
|
|
|
2025-11-14 17:15:09 +00:00
|
|
|
let state: Partial<Labrinth.State.GeneratedState & Record<string, any>> = {}
|
2025-08-14 21:48:38 +01:00
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
state = JSON.parse(await fs.readFile('./src/generated/state.json', 'utf8'))
|
|
|
|
|
} catch {
|
|
|
|
|
// File doesn't exist, create folder
|
|
|
|
|
await fs.mkdir('./src/generated', { recursive: true })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const API_URL = getApiUrl()
|
|
|
|
|
|
|
|
|
|
if (
|
|
|
|
|
// Skip regeneration if within TTL...
|
|
|
|
|
state.lastGenerated &&
|
|
|
|
|
new Date(state.lastGenerated).getTime() + TTL > new Date().getTime() &&
|
|
|
|
|
// ...but only if the API URL is the same
|
|
|
|
|
state.apiUrl === API_URL &&
|
|
|
|
|
// ...and if no errors were caught during the last generation
|
|
|
|
|
(state.errors ?? []).length === 0
|
|
|
|
|
) {
|
|
|
|
|
console.log(
|
2025-12-20 11:43:04 +00:00
|
|
|
'Tags already recently generated. Delete apps/frontend/src/generated/state.json to force regeneration.',
|
2025-08-14 21:48:38 +01:00
|
|
|
)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-14 17:15:09 +00:00
|
|
|
const client = new GenericModrinthClient({
|
|
|
|
|
labrinthBaseUrl: API_URL.replace('/v2/', ''),
|
|
|
|
|
userAgent: 'Knossos generator (support@modrinth.com)',
|
|
|
|
|
})
|
2025-08-14 21:48:38 +01:00
|
|
|
|
2025-11-14 17:15:09 +00:00
|
|
|
const generatedState = await client.labrinth.state.build()
|
|
|
|
|
state.lastGenerated = new Date().toISOString()
|
2025-08-14 21:48:38 +01:00
|
|
|
state.apiUrl = API_URL
|
2025-11-14 17:15:09 +00:00
|
|
|
state = {
|
|
|
|
|
...state,
|
|
|
|
|
...generatedState,
|
2025-08-14 21:48:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await fs.writeFile('./src/generated/state.json', JSON.stringify(state))
|
|
|
|
|
|
|
|
|
|
console.log('Tags generated!')
|
2026-01-12 03:54:21 -08:00
|
|
|
|
|
|
|
|
const robotsContent =
|
|
|
|
|
getDomain() === PROD_MODRINTH_URL
|
|
|
|
|
? 'User-agent: *\nDisallow: /_internal/'
|
|
|
|
|
: 'User-agent: *\nDisallow: /'
|
|
|
|
|
|
|
|
|
|
await fs.writeFile('./src/public/robots.txt', robotsContent)
|
2025-08-14 21:48:38 +01:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
runtimeConfig: {
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
apiBaseUrl: process.env.BASE_URL ?? globalThis.BASE_URL ?? getApiUrl(),
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
rateLimitKey: process.env.RATE_LIMIT_IGNORE_KEY ?? globalThis.RATE_LIMIT_IGNORE_KEY,
|
|
|
|
|
pyroBaseUrl: process.env.PYRO_BASE_URL,
|
|
|
|
|
public: {
|
|
|
|
|
apiBaseUrl: getApiUrl(),
|
|
|
|
|
pyroBaseUrl: process.env.PYRO_BASE_URL,
|
|
|
|
|
siteUrl: getDomain(),
|
|
|
|
|
production: isProduction(),
|
|
|
|
|
featureFlagOverrides: getFeatureFlagOverrides(),
|
|
|
|
|
|
|
|
|
|
owner: process.env.VERCEL_GIT_REPO_OWNER || 'modrinth',
|
|
|
|
|
slug: process.env.VERCEL_GIT_REPO_SLUG || 'code',
|
|
|
|
|
branch:
|
|
|
|
|
process.env.VERCEL_GIT_COMMIT_REF ||
|
|
|
|
|
process.env.CF_PAGES_BRANCH ||
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
globalThis.CF_PAGES_BRANCH ||
|
2026-01-08 11:25:45 -05:00
|
|
|
'main',
|
2025-08-14 21:48:38 +01:00
|
|
|
hash:
|
|
|
|
|
process.env.VERCEL_GIT_COMMIT_SHA ||
|
|
|
|
|
process.env.CF_PAGES_COMMIT_SHA ||
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
globalThis.CF_PAGES_COMMIT_SHA ||
|
|
|
|
|
'unknown',
|
|
|
|
|
|
|
|
|
|
stripePublishableKey:
|
|
|
|
|
process.env.STRIPE_PUBLISHABLE_KEY ||
|
|
|
|
|
globalThis.STRIPE_PUBLISHABLE_KEY ||
|
|
|
|
|
'pk_test_51JbFxJJygY5LJFfKV50mnXzz3YLvBVe2Gd1jn7ljWAkaBlRz3VQdxN9mXcPSrFbSqxwAb0svte9yhnsmm7qHfcWn00R611Ce7b',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
typescript: {
|
|
|
|
|
shim: false,
|
|
|
|
|
strict: true,
|
|
|
|
|
typeCheck: false,
|
|
|
|
|
tsConfig: {
|
|
|
|
|
compilerOptions: {
|
|
|
|
|
moduleResolution: 'bundler',
|
|
|
|
|
allowImportingTsExtensions: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2026-01-15 00:38:23 +00:00
|
|
|
modules: [
|
|
|
|
|
'@pinia/nuxt',
|
|
|
|
|
'floating-vue/nuxt',
|
|
|
|
|
// Sentry causes rollup-plugin-inject errors in dev, only enable in production
|
|
|
|
|
...(isProduction() ? ['@sentry/nuxt/module'] : []),
|
|
|
|
|
],
|
2025-12-30 15:06:52 +00:00
|
|
|
floatingVue: {
|
|
|
|
|
themes: {
|
|
|
|
|
'ribbit-popout': {
|
|
|
|
|
$extend: 'dropdown',
|
|
|
|
|
placement: 'bottom-end',
|
|
|
|
|
instantMove: true,
|
|
|
|
|
distance: 8,
|
|
|
|
|
},
|
|
|
|
|
'dismissable-prompt': {
|
|
|
|
|
$extend: 'dropdown',
|
|
|
|
|
placement: 'bottom-start',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2025-08-14 21:48:38 +01:00
|
|
|
nitro: {
|
2025-09-16 16:57:34 +01:00
|
|
|
rollupConfig: {
|
2025-12-30 15:06:52 +00:00
|
|
|
// @ts-expect-error because of rolldown-vite - completely fine though
|
2025-09-16 16:57:34 +01:00
|
|
|
plugins: [serverSidedVue()],
|
2026-01-08 11:25:45 -05:00
|
|
|
external: ['cloudflare:workers'],
|
|
|
|
|
},
|
|
|
|
|
preset: 'cloudflare_module',
|
|
|
|
|
cloudflare: {
|
|
|
|
|
nodeCompat: true,
|
2025-09-16 16:57:34 +01:00
|
|
|
},
|
2026-01-14 18:46:55 +01:00
|
|
|
replace: {
|
|
|
|
|
__SENTRY_RELEASE__: JSON.stringify(process.env.CF_PAGES_COMMIT_SHA || 'unknown'),
|
|
|
|
|
},
|
2025-08-14 21:48:38 +01:00
|
|
|
},
|
|
|
|
|
devtools: {
|
|
|
|
|
enabled: true,
|
|
|
|
|
},
|
|
|
|
|
css: ['~/assets/styles/tailwind.css'],
|
|
|
|
|
postcss: {
|
|
|
|
|
plugins: {
|
|
|
|
|
tailwindcss: {},
|
|
|
|
|
autoprefixer: {},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
routeRules: {
|
|
|
|
|
'/**': {
|
|
|
|
|
headers: {
|
|
|
|
|
'Accept-CH': 'Sec-CH-Prefers-Color-Scheme',
|
|
|
|
|
'Critical-CH': 'Sec-CH-Prefers-Color-Scheme',
|
|
|
|
|
},
|
|
|
|
|
},
|
2025-11-03 23:15:25 +00:00
|
|
|
'/dashboard/revenue/withdraw': {
|
|
|
|
|
redirect: {
|
|
|
|
|
to: '/dashboard/revenue',
|
|
|
|
|
statusCode: 410,
|
|
|
|
|
},
|
|
|
|
|
},
|
2025-09-16 16:57:34 +01:00
|
|
|
'/email/**': {
|
2025-10-07 11:47:59 +01:00
|
|
|
redirect: '/_internal/templates/email/**',
|
|
|
|
|
},
|
|
|
|
|
'/_internal/templates/email/**': {
|
|
|
|
|
prerender: true,
|
|
|
|
|
headers: {
|
|
|
|
|
'Content-Type': 'text/html',
|
|
|
|
|
'Cache-Control': 'public, max-age=3600',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
'/_internal/templates/doc/**': {
|
2025-09-16 16:57:34 +01:00
|
|
|
prerender: true,
|
|
|
|
|
headers: {
|
|
|
|
|
'Content-Type': 'text/html',
|
|
|
|
|
'Cache-Control': 'public, max-age=3600',
|
|
|
|
|
},
|
|
|
|
|
},
|
2025-08-14 21:48:38 +01:00
|
|
|
},
|
2025-12-30 15:06:52 +00:00
|
|
|
compatibilityDate: '2025-01-01',
|
2025-08-14 21:48:38 +01:00
|
|
|
telemetry: false,
|
2026-01-10 12:43:21 -05:00
|
|
|
experimental: {
|
2026-01-15 20:41:01 +00:00
|
|
|
asyncContext: true,
|
2026-01-10 12:43:21 -05:00
|
|
|
},
|
2026-01-14 18:46:55 +01:00
|
|
|
sourcemap: { client: 'hidden' },
|
|
|
|
|
sentry: {
|
|
|
|
|
sourcemaps: {
|
|
|
|
|
disable: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
2025-08-14 21:48:38 +01:00
|
|
|
})
|
2021-05-27 09:27:13 -07:00
|
|
|
|
Rewrite Parity (#647)
* Rewrite Parity
* Update SEO, fix modals, add dashes to changelog
* Edit create version title
* Cache tags, SEO for search/partial noscript support, notifications fix
* Deploy?
* Fix vercel config
* Fix it again
* Finish user editing
* Remove broken docker build
* Switch reports to modals
* Update project card
* Navbar line animation in most places
* Add chips
* Move to navlink query params
* remove autogen file
* Add copy code
* Fix webkit text box outlines, port report modal
* Update error page
* Switch to avatar component
* Make keyboard nav work
* Fix team member spacing
* improve project ID display (#676)
* Bug fixes
* Update OG site title
* More fixes
* Design tweaks
* Fix card wrapping on mobile
* Darken light theme color a little
* Sidebar navigation for settings, notifications, and moderation
* Change follow icon from a heart to a bell
* Revert "Change follow icon from a heart to a bell"
This reverts commit e30b46ec5d93c57df847be88eba123c7419dd03b.
* Change follows icon in settings
* AaaaUUUUUUUGghghhhhhhhh
* Project sidebar transparent button animations
* Update file input button styling and change icon remove button text
* Fix environments filter condition being inverted
* Remove -> revert
* Improve readability of warning banners on light mode
* Fix mobile menu button colors
* Clean up notifications page more
* Creator dashboard and monetization work
* Add processing fees declarations and acknowledgement box
* Beta badges
* Downgrade Nuxt Vercel Builder
* Update the style of button groups to be more consistent
* More button consistency
* Remove desktop navbar on mobile
* Update home page progress indicators
* Fix page jumping (Thanks @stairman06)
* Make checkbox checked style consistent with other selection indicators
* More home page updates
* Properly reset NavRows
* Move filters menu on mobile
* Stylized checkbox updated to match active styling
* Filters icon
* Respect prefers-reduced-motion
* Add most backend payouts changes (untested)
* Finish tested payouts code
* Allow monetization unenrolling
* No longer use brand color for active highlights on standard nav elements
* More consistent button group on project page
* Rounded tables
* Fix some things (#716)
* Team member fixes + re-add changelog/versions stuff
* Remove dummy data
* The great CSS refactor
* Remove commented out css
* Give modals the legacy label styles and update profile edit labels
* Fix active chip size
* Remove shadow from selected chip
* Require email set for CMP
* Update styles of notifications to universal-card
* Equivalent exchange, trading some jank for some less bad jank
* Fix all gallery buttons being missing when there is only 1 image
* Update project creation modal
* Make beta badge less bright
* Beta badge heading styling
* Update withdraw processing fees info
* Remove redundant label
* be
* Fix inverted logic
* 2% is 0.02
* Add toggle to turn off alpha modpacks banner
* Why warning button?
* Add more footer links (#719)
* Add more footer links
* Move twitter
* Make items on user pages less comically large and move ad above navigation
* Bump text down a little on home page
* Update favicon colors
* Remove task list package and change default description to use bullet points
* I don't remember why I made this important but let's not
* Ah, yes
* this doesn't actually need to be important
* Align items in input groups
* Adjust some spacings and clear creation modal on opening
* Versions now clickable
* Add link to edit page to default description
* Improve monetization information text
* Make wrapped text inputs not shrink
* Make chips work better
* smol margin on clear mod message button
* Allow non-authenticated users to access settings
* Remove settings anchors
* Fix versions page button style on firefox
* Add advanced rendering toggle
* Update slug input and icon card in project edit page
* Legal sidebar
* h1 at beginning of description no longer has top margin
* Use universal card for legal pages
* Update email addresses on legal pages
* Update various page titles and descriptions for consistency
* Various fixes and consolidation to API URL retrieval
Prevents a bug where it's possible to generate the tags under one API, switch the API, and still have tags leftover from the old API
Also finally fixes staging URL being jank
* Make the theme button show regardless of login state
Also remove the change theme from the user dropdown because it's very redundant with the several other ways of changing theme
* Make mobile profile dropdown ordering consistent with desktop
* Change the base url back
* Revert "Change the base url back"
This reverts commit c1da89fddb83776b39f626eab33c8dc67f8a75e4.
* constantize
* Tiny fixes (#722)
* Box-shadow chip outlines
* Show settings when signed out
* mods -> projects
* space
* Beta badge border
* Slug input overflow fix, scrollable
* 🙈 it will all be okay 🙊 this is just temporary 🙉 😭😭 forgive me
* Fix minor bugs
* fix moderation page
* More fixes
* Temp fix for download button
* BEGONE TABLES
* Fix download button
Co-authored-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
Co-authored-by: Prospector <prospectordev@gmail.com>
Co-authored-by: stairman06 <36215135+stairman06@users.noreply.github.com>
Co-authored-by: triphora <emmaffle@modrinth.com>
2022-11-12 17:57:40 -07:00
|
|
|
function getApiUrl() {
|
2025-08-14 21:48:38 +01:00
|
|
|
// @ts-ignore
|
|
|
|
|
return process.env.BROWSER_BASE_URL ?? globalThis.BROWSER_BASE_URL ?? STAGING_API_URL
|
Rewrite Parity (#647)
* Rewrite Parity
* Update SEO, fix modals, add dashes to changelog
* Edit create version title
* Cache tags, SEO for search/partial noscript support, notifications fix
* Deploy?
* Fix vercel config
* Fix it again
* Finish user editing
* Remove broken docker build
* Switch reports to modals
* Update project card
* Navbar line animation in most places
* Add chips
* Move to navlink query params
* remove autogen file
* Add copy code
* Fix webkit text box outlines, port report modal
* Update error page
* Switch to avatar component
* Make keyboard nav work
* Fix team member spacing
* improve project ID display (#676)
* Bug fixes
* Update OG site title
* More fixes
* Design tweaks
* Fix card wrapping on mobile
* Darken light theme color a little
* Sidebar navigation for settings, notifications, and moderation
* Change follow icon from a heart to a bell
* Revert "Change follow icon from a heart to a bell"
This reverts commit e30b46ec5d93c57df847be88eba123c7419dd03b.
* Change follows icon in settings
* AaaaUUUUUUUGghghhhhhhhh
* Project sidebar transparent button animations
* Update file input button styling and change icon remove button text
* Fix environments filter condition being inverted
* Remove -> revert
* Improve readability of warning banners on light mode
* Fix mobile menu button colors
* Clean up notifications page more
* Creator dashboard and monetization work
* Add processing fees declarations and acknowledgement box
* Beta badges
* Downgrade Nuxt Vercel Builder
* Update the style of button groups to be more consistent
* More button consistency
* Remove desktop navbar on mobile
* Update home page progress indicators
* Fix page jumping (Thanks @stairman06)
* Make checkbox checked style consistent with other selection indicators
* More home page updates
* Properly reset NavRows
* Move filters menu on mobile
* Stylized checkbox updated to match active styling
* Filters icon
* Respect prefers-reduced-motion
* Add most backend payouts changes (untested)
* Finish tested payouts code
* Allow monetization unenrolling
* No longer use brand color for active highlights on standard nav elements
* More consistent button group on project page
* Rounded tables
* Fix some things (#716)
* Team member fixes + re-add changelog/versions stuff
* Remove dummy data
* The great CSS refactor
* Remove commented out css
* Give modals the legacy label styles and update profile edit labels
* Fix active chip size
* Remove shadow from selected chip
* Require email set for CMP
* Update styles of notifications to universal-card
* Equivalent exchange, trading some jank for some less bad jank
* Fix all gallery buttons being missing when there is only 1 image
* Update project creation modal
* Make beta badge less bright
* Beta badge heading styling
* Update withdraw processing fees info
* Remove redundant label
* be
* Fix inverted logic
* 2% is 0.02
* Add toggle to turn off alpha modpacks banner
* Why warning button?
* Add more footer links (#719)
* Add more footer links
* Move twitter
* Make items on user pages less comically large and move ad above navigation
* Bump text down a little on home page
* Update favicon colors
* Remove task list package and change default description to use bullet points
* I don't remember why I made this important but let's not
* Ah, yes
* this doesn't actually need to be important
* Align items in input groups
* Adjust some spacings and clear creation modal on opening
* Versions now clickable
* Add link to edit page to default description
* Improve monetization information text
* Make wrapped text inputs not shrink
* Make chips work better
* smol margin on clear mod message button
* Allow non-authenticated users to access settings
* Remove settings anchors
* Fix versions page button style on firefox
* Add advanced rendering toggle
* Update slug input and icon card in project edit page
* Legal sidebar
* h1 at beginning of description no longer has top margin
* Use universal card for legal pages
* Update email addresses on legal pages
* Update various page titles and descriptions for consistency
* Various fixes and consolidation to API URL retrieval
Prevents a bug where it's possible to generate the tags under one API, switch the API, and still have tags leftover from the old API
Also finally fixes staging URL being jank
* Make the theme button show regardless of login state
Also remove the change theme from the user dropdown because it's very redundant with the several other ways of changing theme
* Make mobile profile dropdown ordering consistent with desktop
* Change the base url back
* Revert "Change the base url back"
This reverts commit c1da89fddb83776b39f626eab33c8dc67f8a75e4.
* constantize
* Tiny fixes (#722)
* Box-shadow chip outlines
* Show settings when signed out
* mods -> projects
* space
* Beta badge border
* Slug input overflow fix, scrollable
* 🙈 it will all be okay 🙊 this is just temporary 🙉 😭😭 forgive me
* Fix minor bugs
* fix moderation page
* More fixes
* Temp fix for download button
* BEGONE TABLES
* Fix download button
Co-authored-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
Co-authored-by: Prospector <prospectordev@gmail.com>
Co-authored-by: stairman06 <36215135+stairman06@users.noreply.github.com>
Co-authored-by: triphora <emmaffle@modrinth.com>
2022-11-12 17:57:40 -07:00
|
|
|
}
|
|
|
|
|
|
2024-06-11 19:46:07 -07:00
|
|
|
function isProduction() {
|
2025-08-14 21:48:38 +01:00
|
|
|
return process.env.NODE_ENV === 'production'
|
2024-06-11 19:46:07 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getFeatureFlagOverrides() {
|
2025-08-14 21:48:38 +01:00
|
|
|
return JSON.parse(process.env.FLAG_OVERRIDES ?? '{}')
|
2024-06-11 19:46:07 -07:00
|
|
|
}
|
|
|
|
|
|
2021-05-27 09:27:13 -07:00
|
|
|
function getDomain() {
|
2025-08-14 21:48:38 +01:00
|
|
|
if (process.env.NODE_ENV === 'production') {
|
|
|
|
|
// @ts-ignore
|
2026-01-08 11:25:45 -05:00
|
|
|
if (process.env.CF_PAGES_URL || globalThis.CF_PAGES_URL) {
|
2025-08-14 21:48:38 +01:00
|
|
|
// @ts-ignore
|
|
|
|
|
return process.env.CF_PAGES_URL ?? globalThis.CF_PAGES_URL
|
|
|
|
|
} else if (process.env.HEROKU_APP_NAME) {
|
|
|
|
|
return `https://${process.env.HEROKU_APP_NAME}.herokuapp.com`
|
|
|
|
|
} else if (process.env.VERCEL_URL) {
|
|
|
|
|
return `https://${process.env.VERCEL_URL}`
|
|
|
|
|
} else if (getApiUrl() === STAGING_API_URL) {
|
2026-01-12 03:54:21 -08:00
|
|
|
return STAGING_MODRINTH_URL
|
2025-08-14 21:48:38 +01:00
|
|
|
} else {
|
2026-01-12 03:54:21 -08:00
|
|
|
return PROD_MODRINTH_URL
|
2025-08-14 21:48:38 +01:00
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
const port = process.env.PORT || 3000
|
|
|
|
|
return `http://localhost:${port}`
|
|
|
|
|
}
|
2021-05-27 09:27:13 -07:00
|
|
|
}
|