Fix nuxt3 issues (#1035)

* Fix nuxt3 issues

* fix unintentional npm use
This commit is contained in:
Geometrically 2023-03-10 14:51:48 -07:00 committed by GitHub
parent 3825575f70
commit ba220abbbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 822 additions and 826 deletions

View File

@ -1,4 +1,4 @@
import TOML from 'toml' import TOML from '@ltd/j-toml'
import JSZip from 'jszip' import JSZip from 'jszip'
import yaml from 'js-yaml' import yaml from 'js-yaml'

View File

@ -1,5 +1,5 @@
import JSZip from 'jszip' import JSZip from 'jszip'
import TOML from 'toml' import TOML from '@ltd/j-toml'
export const createDataPackVersion = async function ( export const createDataPackVersion = async function (
project, project,
@ -24,6 +24,8 @@ export const createDataPackVersion = async function (
const iconPath = `${project.slug}_pack.png` const iconPath = `${project.slug}_pack.png`
const config = useRuntimeConfig()
const fabricModJson = { const fabricModJson = {
schemaVersion: 1, schemaVersion: 1,
id: newSlug, id: newSlug,
@ -32,7 +34,7 @@ export const createDataPackVersion = async function (
description: project.description, description: project.description,
authors: members.map((x) => x.name), authors: members.map((x) => x.name),
contact: { contact: {
homepage: `${process.env.domain}/${project.project_type}/${project.slug ?? project.id}`, homepage: `${config.public.siteUrl}/${project.project_type}/${project.slug ?? project.id}`,
}, },
license: project.license.id, license: project.license.id,
icon: iconPath, icon: iconPath,
@ -59,7 +61,9 @@ export const createDataPackVersion = async function (
{} {}
), ),
contact: { contact: {
homepage: `${process.env.domain}/${project.project_type}/${project.slug ?? project.id}`, homepage: `${config.public.siteUrl}/${project.project_type}/${
project.slug ?? project.id
}`,
}, },
icon: iconPath, icon: iconPath,
}, },
@ -103,7 +107,9 @@ export const createDataPackVersion = async function (
}/forge_updates.json`, }/forge_updates.json`,
credits: 'Generated by Modrinth', credits: 'Generated by Modrinth',
authors: members.map((x) => x.name).join(', '), authors: members.map((x) => x.name).join(', '),
displayURL: `${process.env.domain}/${project.project_type}/${project.slug ?? project.id}`, displayURL: `${config.public.siteUrl}/${project.project_type}/${
project.slug ?? project.id
}`,
}, },
], ],
} }

View File

@ -103,8 +103,9 @@ export const md = (options = {}) => {
if (index !== -1) { if (index !== -1) {
const src = token.attrs[index][1] const src = token.attrs[index][1]
const url = new URL(src)
try { try {
const url = new URL(src)
const allowedHostnames = [ const allowedHostnames = [
'i.imgur.com', 'i.imgur.com',
'cdn-raw.modrinth.com', 'cdn-raw.modrinth.com',

View File

@ -25,13 +25,13 @@
"vite-svg-loader": "^4.0.0" "vite-svg-loader": "^4.0.0"
}, },
"dependencies": { "dependencies": {
"@ltd/j-toml": "^1.38.0",
"dayjs": "^1.11.7", "dayjs": "^1.11.7",
"floating-vue": "^2.0.0-beta.20", "floating-vue": "^2.0.0-beta.20",
"highlight.js": "^11.7.0", "highlight.js": "^11.7.0",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"jszip": "^3.10.1", "jszip": "^3.10.1",
"markdown-it": "^13.0.1", "markdown-it": "^13.0.1",
"toml": "^3.0.0",
"vue-multiselect": "^3.0.0-alpha.2", "vue-multiselect": "^3.0.0-alpha.2",
"xss": "^1.0.14" "xss": "^1.0.14"
} }

View File

@ -5,8 +5,11 @@ export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.provide('defaultHeaders', () => { nuxtApp.provide('defaultHeaders', () => {
const obj = { headers: {} } const obj = { headers: {} }
if (process.server && process.env.RATE_LIMIT_IGNORE_KEY) { if (process.server) {
obj.headers['x-ratelimit-key'] = process.env.RATE_LIMIT_IGNORE_KEY || '' const config = useRuntimeConfig()
if (config.rateLimitKey) {
obj.headers['x-ratelimit-key'] = config.rateLimitKey || ''
}
} }
if (authStore.user) { if (authStore.user) {

1620
yarn.lock

File diff suppressed because it is too large Load Diff