You've already forked AstralRinth
forked from didirus/AstralRinth
chore: update dependencies (#1103)
* update trivial dependencies * switch to sha1_smol * update async_zip * fix cli * clippy & fmt * js lints * fix build for ci
This commit is contained in:
@@ -75,7 +75,7 @@ const ignoreInstanceGameVersions = ref(false)
|
||||
|
||||
const results = shallowRef([])
|
||||
const pageCount = computed(() =>
|
||||
results.value ? Math.ceil(results.value.total_hits / results.value.limit) : 1
|
||||
results.value ? Math.ceil(results.value.total_hits / results.value.limit) : 1,
|
||||
)
|
||||
|
||||
function getArrayOrString(x) {
|
||||
@@ -179,7 +179,9 @@ async function refreshSearch() {
|
||||
formattedFacets.push(orFacets.value)
|
||||
} else if (projectType.value === 'mod') {
|
||||
formattedFacets.push(
|
||||
['forge', 'fabric', 'quilt', 'neoforge'].map((x) => `categories:'${encodeURIComponent(x)}'`)
|
||||
['forge', 'fabric', 'quilt', 'neoforge'].map(
|
||||
(x) => `categories:'${encodeURIComponent(x)}'`,
|
||||
),
|
||||
)
|
||||
} else if (projectType.value === 'datapack') {
|
||||
formattedFacets.push(['datapack'].map((x) => `categories:'${encodeURIComponent(x)}'`))
|
||||
@@ -230,7 +232,7 @@ async function refreshSearch() {
|
||||
const installedMods = await get(instanceContext.value.path, false).then((x) =>
|
||||
Object.values(x.projects)
|
||||
.filter((x) => x.metadata.project)
|
||||
.map((x) => x.metadata.project.id)
|
||||
.map((x) => x.metadata.project.id),
|
||||
)
|
||||
installedMods.map((x) => [`project_id != ${x}`]).forEach((x) => formattedFacets.push(x))
|
||||
console.log(`facets=${JSON.stringify(formattedFacets)}`)
|
||||
@@ -262,7 +264,7 @@ async function refreshSearch() {
|
||||
if (instanceContext.value) {
|
||||
for (val of rawResults.hits) {
|
||||
val.installed = await check_installed(instanceContext.value.path, val.project_id).then(
|
||||
(x) => (val.installed = x)
|
||||
(x) => (val.installed = x),
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -374,7 +376,7 @@ function getSearchUrl(offset, useObj) {
|
||||
const sortedCategories = computed(() => {
|
||||
const values = new Map()
|
||||
for (const category of categories.value.filter(
|
||||
(cat) => cat.project_type === (projectType.value === 'datapack' ? 'mod' : projectType.value)
|
||||
(cat) => cat.project_type === (projectType.value === 'datapack' ? 'mod' : projectType.value),
|
||||
)) {
|
||||
if (!values.has(category.header)) {
|
||||
values.set(category.header, [])
|
||||
@@ -478,7 +480,7 @@ watch(
|
||||
loading.value = true
|
||||
await clearFilters()
|
||||
loading.value = false
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
const [categories, loaders, availableGameVersions] = await Promise.all([
|
||||
@@ -500,7 +502,7 @@ const selectableProjectTypes = computed(() => {
|
||||
if (instanceContext.value) {
|
||||
if (
|
||||
availableGameVersions.value.findIndex(
|
||||
(x) => x.version === instanceContext.value.metadata.game_version
|
||||
(x) => x.version === instanceContext.value.metadata.game_version,
|
||||
) <= availableGameVersions.value.findIndex((x) => x.version === '1.13')
|
||||
) {
|
||||
values.unshift({ label: 'Data Packs', href: `/browse/datapack` })
|
||||
@@ -519,7 +521,7 @@ const selectableProjectTypes = computed(() => {
|
||||
})
|
||||
|
||||
const showVersions = computed(
|
||||
() => instanceContext.value === null || ignoreInstanceGameVersions.value
|
||||
() => instanceContext.value === null || ignoreInstanceGameVersions.value,
|
||||
)
|
||||
const showLoaders = computed(
|
||||
() =>
|
||||
@@ -527,7 +529,7 @@ const showLoaders = computed(
|
||||
projectType.value !== 'resourcepack' &&
|
||||
projectType.value !== 'shader' &&
|
||||
instanceContext.value === null) ||
|
||||
ignoreInstanceLoaders.value
|
||||
ignoreInstanceLoaders.value,
|
||||
)
|
||||
|
||||
onUnmounted(() => unlistenOffline())
|
||||
@@ -605,7 +607,8 @@ onUnmounted(() => unlistenOffline())
|
||||
v-for="loader in loaders.filter(
|
||||
(l) =>
|
||||
(projectType !== 'mod' && l.supported_project_types?.includes(projectType)) ||
|
||||
(projectType === 'mod' && ['fabric', 'forge', 'quilt', 'neoforge'].includes(l.name))
|
||||
(projectType === 'mod' &&
|
||||
['fabric', 'forge', 'quilt', 'neoforge'].includes(l.name)),
|
||||
)"
|
||||
:key="loader"
|
||||
>
|
||||
@@ -752,12 +755,12 @@ onUnmounted(() => unlistenOffline())
|
||||
:categories="[
|
||||
...categories.filter(
|
||||
(cat) =>
|
||||
result?.display_categories.includes(cat.name) && cat.project_type === projectType
|
||||
result?.display_categories.includes(cat.name) && cat.project_type === projectType,
|
||||
),
|
||||
...loaders.filter(
|
||||
(loader) =>
|
||||
result?.display_categories.includes(loader.name) &&
|
||||
loader.supported_project_types?.includes(projectType)
|
||||
loader.supported_project_types?.includes(projectType),
|
||||
),
|
||||
]"
|
||||
:confirm-modal="confirmModal"
|
||||
|
||||
@@ -42,7 +42,7 @@ const getFeaturedModpacks = async () => {
|
||||
const response = await useFetch(
|
||||
`https://api.modrinth.com/v2/search?facets=[["project_type:modpack"]]&limit=10&index=follows&filters=${filter.value}`,
|
||||
'featured modpacks',
|
||||
offline.value
|
||||
offline.value,
|
||||
)
|
||||
if (response) {
|
||||
featuredModpacks.value = response.hits
|
||||
@@ -54,7 +54,7 @@ const getFeaturedMods = async () => {
|
||||
const response = await useFetch(
|
||||
'https://api.modrinth.com/v2/search?facets=[["project_type:mod"]]&limit=10&index=follows',
|
||||
'featured mods',
|
||||
offline.value
|
||||
offline.value,
|
||||
)
|
||||
if (response) {
|
||||
featuredMods.value = response.hits
|
||||
|
||||
@@ -73,13 +73,13 @@ watch(
|
||||
if (setSettings.java_globals.JAVA_8?.path) {
|
||||
setSettings.java_globals.JAVA_8.path = setSettings.java_globals.JAVA_8.path.replace(
|
||||
'java.exe',
|
||||
'javaw.exe'
|
||||
'javaw.exe',
|
||||
)
|
||||
}
|
||||
if (setSettings.java_globals.JAVA_17?.path) {
|
||||
setSettings.java_globals.JAVA_17.path = setSettings.java_globals.JAVA_17?.path.replace(
|
||||
'java.exe',
|
||||
'javaw.exe'
|
||||
'javaw.exe',
|
||||
)
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ watch(
|
||||
|
||||
await set(setSettings)
|
||||
},
|
||||
{ deep: true }
|
||||
{ deep: true },
|
||||
)
|
||||
|
||||
const credentials = ref(await getCreds().catch(handleError))
|
||||
|
||||
@@ -165,7 +165,7 @@ breadcrumbs.setName(
|
||||
'Instance',
|
||||
instance.value.metadata.name.length > 40
|
||||
? instance.value.metadata.name.substring(0, 40) + '...'
|
||||
: instance.value.metadata.name
|
||||
: instance.value.metadata.name,
|
||||
)
|
||||
|
||||
breadcrumbs.setContext({
|
||||
@@ -212,7 +212,7 @@ const modrinthVersions = ref([])
|
||||
if (!(await isOffline()) && instance.value.metadata.linked_data?.project_id) {
|
||||
modrinthVersions.value = await useFetch(
|
||||
`https://api.modrinth.com/v2/project/${instance.value.metadata.linked_data.project_id}/version`,
|
||||
'project'
|
||||
'project',
|
||||
)
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ const handleRightClick = (event) => {
|
||||
color: 'primary',
|
||||
},
|
||||
...baseOptions,
|
||||
]
|
||||
],
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@ async function getLiveStdLog() {
|
||||
} else {
|
||||
const logCursor = await get_latest_log_cursor(
|
||||
props.instance.path,
|
||||
currentLiveLogCursor.value
|
||||
currentLiveLogCursor.value,
|
||||
).catch(handleError)
|
||||
if (logCursor.new_file) {
|
||||
currentLiveLog.value = ''
|
||||
@@ -248,7 +248,7 @@ async function getLogs() {
|
||||
log.filename !== 'latest_stdout.log' &&
|
||||
log.filename !== 'latest_stdout' &&
|
||||
log.stdout !== '' &&
|
||||
log.filename.includes('.log')
|
||||
log.filename.includes('.log'),
|
||||
)
|
||||
.map((log) => {
|
||||
log.name = log.filename || 'Unknown'
|
||||
@@ -291,7 +291,7 @@ watch(selectedLogIndex, async (newIndex) => {
|
||||
logs.value[newIndex].stdout = 'Loading...'
|
||||
logs.value[newIndex].stdout = await get_output_by_filename(
|
||||
props.instance.path,
|
||||
logs.value[newIndex].filename
|
||||
logs.value[newIndex].filename,
|
||||
).catch(handleError)
|
||||
}
|
||||
})
|
||||
@@ -307,7 +307,7 @@ const deleteLog = async () => {
|
||||
let deleteIndex = selectedLogIndex.value
|
||||
selectedLogIndex.value = deleteIndex - 1
|
||||
await delete_logs_by_filename(props.instance.path, logs.value[deleteIndex].filename).catch(
|
||||
handleError
|
||||
handleError,
|
||||
)
|
||||
await setLogs()
|
||||
}
|
||||
|
||||
@@ -505,7 +505,7 @@ const initProjects = (initInstance) => {
|
||||
selectionMap.value.get(project.path) ??
|
||||
selectionMap.value.get(project.path.slice(0, -9)) ??
|
||||
selectionMap.value.get(project.path + '.disabled') ??
|
||||
false
|
||||
false,
|
||||
)
|
||||
}
|
||||
selectionMap.value = newSelectionMap
|
||||
@@ -517,14 +517,14 @@ watch(
|
||||
() => props.instance.projects,
|
||||
() => {
|
||||
initProjects(props.instance)
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
watch(
|
||||
() => props.offline,
|
||||
() => {
|
||||
if (props.instance) initProjects(props.instance)
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
const modpackVersionModal = ref(null)
|
||||
@@ -551,11 +551,11 @@ const selected = computed(() =>
|
||||
})
|
||||
.map((args) => {
|
||||
return projects.value.find((x) => x.path === args[0])
|
||||
})
|
||||
}),
|
||||
)
|
||||
|
||||
const functionValues = computed(() =>
|
||||
selected.value.length > 0 ? selected.value : Array.from(projects.value.values())
|
||||
selected.value.length > 0 ? selected.value : Array.from(projects.value.values()),
|
||||
)
|
||||
|
||||
const selectableProjectTypes = computed(() => {
|
||||
@@ -781,7 +781,7 @@ const shareUrls = async () => {
|
||||
functionValues.value
|
||||
.filter((x) => x.slug)
|
||||
.map((x) => `https://modrinth.com/${x.project_type}/${x.slug}`)
|
||||
.join('\n')
|
||||
.join('\n'),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -794,7 +794,7 @@ const shareMarkdown = async () => {
|
||||
}
|
||||
return x.name
|
||||
})
|
||||
.join('\n')
|
||||
.join('\n'),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -839,7 +839,7 @@ const handleRightClick = (event, mod) => {
|
||||
{
|
||||
link: `https://modrinth.com/${mod.project_type}/${mod.slug}`,
|
||||
},
|
||||
[{ name: 'open_link' }, { name: 'copy_link' }]
|
||||
[{ name: 'open_link' }, { name: 'copy_link' }],
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -596,7 +596,7 @@ const availableGroups = ref([
|
||||
...new Set(
|
||||
instancesList.reduce((acc, obj) => {
|
||||
return acc.concat(obj.metadata.groups)
|
||||
}, [])
|
||||
}, []),
|
||||
),
|
||||
])
|
||||
|
||||
@@ -641,7 +641,9 @@ const javaArgs = ref((javaSettings.extra_arguments ?? globalSettings.custom_java
|
||||
|
||||
const overrideEnvVars = ref(!!javaSettings.custom_env_args)
|
||||
const envVars = ref(
|
||||
(javaSettings.custom_env_args ?? globalSettings.custom_env_args).map((x) => x.join('=')).join(' ')
|
||||
(javaSettings.custom_env_args ?? globalSettings.custom_env_args)
|
||||
.map((x) => x.join('='))
|
||||
.join(' '),
|
||||
)
|
||||
|
||||
const overrideMemorySettings = ref(!!props.instance.memory)
|
||||
@@ -688,7 +690,7 @@ watch(
|
||||
async () => {
|
||||
await edit(props.instance.path, editProfileObject.value)
|
||||
},
|
||||
{ deep: true }
|
||||
{ deep: true },
|
||||
)
|
||||
|
||||
const getLocalVersion = (path) => {
|
||||
@@ -716,7 +718,7 @@ const editProfileObject = computed(() => {
|
||||
editProfile.java.override_version = javaInstall.value
|
||||
editProfile.java.override_version.path = editProfile.java.override_version.path.replace(
|
||||
'java.exe',
|
||||
'javaw.exe'
|
||||
'javaw.exe',
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -848,7 +850,7 @@ const [
|
||||
.then((value) =>
|
||||
value
|
||||
.filter((item) => item.supported_project_types.includes('modpack'))
|
||||
.map((item) => item.name.toLowerCase())
|
||||
.map((item) => item.name.toLowerCase()),
|
||||
)
|
||||
.then(ref)
|
||||
.catch(handleError),
|
||||
@@ -893,8 +895,8 @@ const selectableLoaderVersions = computed(() => {
|
||||
})
|
||||
const loaderVersionIndex = ref(
|
||||
selectableLoaderVersions.value.findIndex(
|
||||
(x) => x.id === props.instance.metadata.loader_version?.id
|
||||
)
|
||||
(x) => x.id === props.instance.metadata.loader_version?.id,
|
||||
),
|
||||
)
|
||||
|
||||
const isValid = computed(() => {
|
||||
|
||||
@@ -276,7 +276,9 @@ const expandImage = (item, index) => {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-width: 40rem;
|
||||
transition: opacity 0.25s ease-in-out, transform 0.25s ease-in-out;
|
||||
transition:
|
||||
opacity 0.25s ease-in-out,
|
||||
transform 0.25s ease-in-out;
|
||||
text-shadow: 1px 1px 10px #000000d4;
|
||||
margin-bottom: 0.25rem;
|
||||
gap: 0.5rem;
|
||||
@@ -297,7 +299,9 @@ const expandImage = (item, index) => {
|
||||
background-color: var(--color-raised-bg);
|
||||
padding: var(--gap-md);
|
||||
border-radius: var(--radius-md);
|
||||
transition: opacity 0.25s ease-in-out, transform 0.25s ease-in-out;
|
||||
transition:
|
||||
opacity 0.25s ease-in-out,
|
||||
transform 0.25s ease-in-out;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
class="tags"
|
||||
:categories="
|
||||
categories.filter(
|
||||
(cat) => data.categories.includes(cat.name) && cat.project_type === 'mod'
|
||||
(cat) => data.categories.includes(cat.name) && cat.project_type === 'mod',
|
||||
)
|
||||
"
|
||||
type="ignored"
|
||||
@@ -328,7 +328,7 @@ async function fetchProjectData() {
|
||||
breadcrumbs.setName('Project', data.value.title)
|
||||
installedVersion.value = instance.value
|
||||
? Object.values(instance.value.projects).find(
|
||||
(p) => p?.metadata?.version?.project_id === data.value.id
|
||||
(p) => p?.metadata?.version?.project_id === data.value.id,
|
||||
)?.metadata?.version?.id
|
||||
: null
|
||||
}
|
||||
@@ -341,7 +341,7 @@ watch(
|
||||
if (route.params.id && route.path.startsWith('/project')) {
|
||||
await fetchProjectData()
|
||||
}
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
dayjs.extend(relativeTime)
|
||||
@@ -380,7 +380,7 @@ async function install(version) {
|
||||
queuedVersionData = versions.value[0]
|
||||
} else {
|
||||
queuedVersionData = versions.value.find((v) =>
|
||||
v.game_versions.includes(data.value.game_versions[0])
|
||||
v.game_versions.includes(data.value.game_versions[0]),
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -397,7 +397,7 @@ async function install(version) {
|
||||
data.value.id,
|
||||
queuedVersionData.id,
|
||||
data.value.title,
|
||||
data.value.icon_url
|
||||
data.value.icon_url,
|
||||
).catch(handleError)
|
||||
|
||||
mixpanel_track('PackInstall', {
|
||||
@@ -411,7 +411,7 @@ async function install(version) {
|
||||
data.value.id,
|
||||
queuedVersionData.id,
|
||||
data.value.title,
|
||||
data.value.icon_url
|
||||
data.value.icon_url,
|
||||
)
|
||||
}
|
||||
} else {
|
||||
@@ -424,7 +424,7 @@ async function install(version) {
|
||||
v.game_versions.includes(gameVersion) &&
|
||||
(data.value.project_type === 'mod'
|
||||
? v.loaders.includes(loader) || v.loaders.includes('minecraft')
|
||||
: true)
|
||||
: true),
|
||||
)
|
||||
if (!selectedVersion) {
|
||||
incompatibilityWarning.value.show(
|
||||
@@ -433,7 +433,7 @@ async function install(version) {
|
||||
versions.value,
|
||||
markInstalled,
|
||||
data.value.id,
|
||||
data.value.project_type
|
||||
data.value.project_type,
|
||||
)
|
||||
installing.value = false
|
||||
return
|
||||
@@ -460,7 +460,7 @@ async function install(version) {
|
||||
v.game_versions.includes(gameVersion) &&
|
||||
(data.value.project_type === 'mod'
|
||||
? v.loaders.includes(loader) || v.loaders.includes('minecraft')
|
||||
: true)
|
||||
: true),
|
||||
)
|
||||
if (compatible) {
|
||||
await installMod(instance.value.path, queuedVersionData.id).catch(handleError)
|
||||
@@ -482,7 +482,7 @@ async function install(version) {
|
||||
[queuedVersionData],
|
||||
markInstalled,
|
||||
data.value.id,
|
||||
data.value.project_type
|
||||
data.value.project_type,
|
||||
)
|
||||
installing.value = false
|
||||
return
|
||||
@@ -494,7 +494,7 @@ async function install(version) {
|
||||
data.value.id,
|
||||
version ? [versions.value.find((v) => v.id === queuedVersionData.id)] : versions.value,
|
||||
data.value.title,
|
||||
data.value.project_type
|
||||
data.value.project_type,
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -527,7 +527,7 @@ const handleOptionsClick = (args) => {
|
||||
break
|
||||
case 'copy_link':
|
||||
navigator.clipboard.writeText(
|
||||
`https://modrinth.com/${args.item.project_type}/${args.item.slug}`
|
||||
`https://modrinth.com/${args.item.project_type}/${args.item.slug}`,
|
||||
)
|
||||
break
|
||||
}
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
installing
|
||||
? 'Installing...'
|
||||
: installed && installedVersion === version.id
|
||||
? 'Installed'
|
||||
: 'Install'
|
||||
? 'Installed'
|
||||
: 'Install'
|
||||
}}
|
||||
</Button>
|
||||
<Button>
|
||||
@@ -252,11 +252,11 @@ watch(
|
||||
version.value = props.versions.find((version) => version.id === route.params.version)
|
||||
breadcrumbs.setName('Version', version.value.name)
|
||||
}
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
const author = computed(() =>
|
||||
props.members.find((member) => member.user.id === version.value.author_id)
|
||||
props.members.find((member) => member.user.id === version.value.author_id),
|
||||
)
|
||||
|
||||
const displayDependencies = computed(() =>
|
||||
@@ -264,7 +264,7 @@ const displayDependencies = computed(() =>
|
||||
const version = props.dependencies.versions.find((obj) => obj.id === dependency.version_id)
|
||||
if (version) {
|
||||
const project = props.dependencies.projects.find(
|
||||
(obj) => obj.id === version.project_id || obj.id === dependency.project_id
|
||||
(obj) => obj.id === version.project_id || obj.id === dependency.project_id,
|
||||
)
|
||||
return {
|
||||
icon: project?.icon_url,
|
||||
@@ -291,7 +291,7 @@ const displayDependencies = computed(() =>
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}),
|
||||
)
|
||||
</script>
|
||||
|
||||
|
||||
@@ -210,12 +210,12 @@ const filteredVersions = computed(() => {
|
||||
(projectVersion) =>
|
||||
(filterGameVersions.value.length === 0 ||
|
||||
filterGameVersions.value.some((gameVersion) =>
|
||||
projectVersion.game_versions.includes(gameVersion)
|
||||
projectVersion.game_versions.includes(gameVersion),
|
||||
)) &&
|
||||
(filterLoader.value.length === 0 ||
|
||||
filterLoader.value.some((loader) => projectVersion.loaders.includes(loader))) &&
|
||||
(filterVersions.value.length === 0 ||
|
||||
filterVersions.value.includes(projectVersion.version_type))
|
||||
filterVersions.value.includes(projectVersion.version_type)),
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user