More monorepo migration fixes (#1257)

* fix: More monorepo migration fixes

* fix: Corrected icon sizes & other fixes

* fix(theseus): Change color of mod installation button

* fix(theseus): More Turborepo fixes

* chore: Prettier

---------

Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
This commit is contained in:
Norbiros 2024-07-18 07:01:58 +02:00 committed by GitHub
parent 8704d3acb3
commit f1713647cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 141 additions and 197 deletions

View File

@ -19,7 +19,6 @@
"floating-vue": "^5.2.2",
"mixpanel-browser": "^2.49.0",
"ofetch": "^1.3.4",
"omorphia": "^0.4.41",
"pinia": "^2.1.7",
"tauri-plugin-window-state-api": "github:tauri-apps/tauri-plugin-window-state#v1",
"vite-svg-loader": "^5.1.0",

View File

@ -243,7 +243,7 @@ const filteredResults = computed(() => {
<div class="iconified-input">
<SearchIcon />
<input v-model="search" type="text" placeholder="Search" class="search-input" />
<Button @click="() => (search = '')">
<Button class="r-btn" @click="() => (search = '')">
<XIcon />
</Button>
</div>

View File

@ -0,0 +1,64 @@
<script setup lang="ts">
import { DropdownIcon, FolderOpenIcon, SearchIcon } from '@modrinth/assets'
import { Button, OverflowMenu } from '@modrinth/ui'
import { open } from '@tauri-apps/api/dialog'
import { add_project_from_path, get } from '@/helpers/profile.js'
import { handleError } from '@/store/notifications.js'
import { useRouter } from 'vue-router'
const props = defineProps({
instance: {
type: Object,
required: true,
},
})
const router = useRouter()
const handleAddContentFromFile = async () => {
const newProject = await open({ multiple: true })
if (!newProject) return
for (const project of newProject) {
await add_project_from_path(props.instance.path, project, 'mod').catch(handleError)
}
props.instance.initProjects(await get(props.instance.path).catch(handleError))
}
const handleSearchContent = async () => {
await router.push({
path: `/browse/${props.instance.metadata.loader === 'vanilla' ? 'datapack' : 'mod'}`,
query: { i: props.instance.path },
})
}
</script>
<template>
<div class="joined-buttons">
<Button color="primary" @click="handleSearchContent"><SearchIcon /> Add content </Button>
<OverflowMenu
:options="[
{
id: 'search',
action: () => handleSearchContent,
},
{
id: 'from_file',
action: () => handleAddContentFromFile,
},
]"
class="btn btn-primary btn-dropdown-animation icon-only"
>
<DropdownIcon />
<template #search>
<SearchIcon />
<span class="no-wrap"> Search </span>
</template>
<template #from_file>
<FolderOpenIcon />
<span class="no-wrap"> Add from file </span>
</template>
</OverflowMenu>
</div>
</template>

View File

@ -113,7 +113,7 @@ const exportPack = async () => {
<div class="iconified-input">
<PackageIcon />
<input v-model="nameInput" type="text" placeholder="Modpack name" class="input" />
<Button @click="nameInput = ''">
<Button class="r-btn" @click="nameInput = ''">
<XIcon />
</Button>
</div>
@ -123,7 +123,7 @@ const exportPack = async () => {
<div class="iconified-input">
<VersionIcon />
<input v-model="versionInput" type="text" placeholder="1.0.0" class="input" />
<Button @click="versionInput = ''">
<Button class="r-btn" @click="versionInput = ''">
<XIcon />
</Button>
</div>

View File

@ -110,7 +110,7 @@
placeholder="Path to launcher"
@change="setPath"
/>
<Button @click="() => (selectedLauncherPath = '')">
<Button class="r-btn" @click="() => (selectedLauncherPath = '')">
<XIcon />
</Button>
</div>

View File

@ -228,7 +228,7 @@ const check_valid = computed(() => {
<div class="profiles" :class="{ 'hide-creation': !showCreation }">
<div v-for="profile in profiles" :key="profile.metadata.name" class="option">
<Button
color="raised"
transparent
class="profile-button"
@click="$router.push(`/instance/${encodeURIComponent(profile.path)}`)"
>

View File

@ -335,8 +335,12 @@ onBeforeUnmount(() => {
width: 1.25rem !important;
height: 1.25rem !important;
svg {
min-width: 1.25rem;
}
&.stop {
--text-color: var(--color-red) !important;
color: var(--color-red);
}
}

View File

@ -703,7 +703,7 @@ onUnmounted(() => unlistenOffline())
:placeholder="`Search ${projectType}s...`"
@input="onSearchChange(1)"
/>
<Button @click="() => clearSearch()">
<Button class="r-btn" @click="() => clearSearch()">
<XIcon />
</Button>
</div>

View File

@ -165,7 +165,7 @@ async function refreshDir() {
<div class="iconified-input">
<BoxIcon />
<input id="appDir" v-model="settingsDir" type="text" class="input" />
<Button @click="findLauncherDir">
<Button class="r-btn" @click="findLauncherDir">
<FolderSearchIcon />
</Button>
</div>

View File

@ -20,7 +20,7 @@
class="text-input"
autocomplete="off"
/>
<Button @click="() => (searchFilter = '')">
<Button class="r-btn" @click="() => (searchFilter = '')">
<XIcon />
</Button>
</div>
@ -42,24 +42,7 @@
<UpdatedIcon />
Update all
</Button>
<!-- <DropdownButton-->
<!-- v-if="!isPackLocked"-->
<!-- :options="['search', 'from_file']"-->
<!-- default-value="search"-->
<!-- name="add-content-dropdown"-->
<!-- color="primary"-->
<!-- @option-click="handleContentOptionClick"-->
<!-- >-->
<!-- <template #search>-->
<!-- <SearchIcon />-->
<!-- <span class="no-wrap"> Add content </span>-->
<!-- </template>-->
<!-- <template #from_file>-->
<!-- <FolderOpenIcon />-->
<!-- <span class="no-wrap"> Add from file </span>-->
<!-- </template>-->
<!-- </DropdownButton>-->
<AddContentButton v-if="!isPackLocked" :instance="instance" />
</Card>
<Pagination
v-if="projects.length > 0"
@ -241,7 +224,7 @@
<TrashIcon />
</Button>
</div>
<AnimatedLogo v-if="mod.updating" class="btn icon-only updating-indicator"></AnimatedLogo>
<AnimatedLogo v-if="mod.updating" class="btn icon-only updating-indicator" />
<div
v-else
v-tooltip="isPackLocked ? 'Unlock this instance to update mods.' : 'Update project'"
@ -283,24 +266,7 @@
</div>
<h3>No projects found</h3>
<p class="empty-subtitle">Add a project to get started</p>
<div class="empty-action">
<DropdownButton
:options="['search', 'from_file']"
default-value="search"
name="add-content-dropdown-from-empty"
color="primary"
@option-click="handleContentOptionClick"
>
<template #search>
<SearchIcon />
<span class="no-wrap"> Add content </span>
</template>
<template #from_file>
<FolderOpenIcon />
<span class="no-wrap"> Add from file </span>
</template>
</DropdownButton>
</div>
<AddContentButton :instance="instance" />
</div>
<Pagination
v-if="projects.length > 0"
@ -372,7 +338,6 @@ import {
SearchIcon,
UpdatedIcon,
FolderOpenIcon,
// DropdownButton,
XIcon,
ShareIcon,
DropdownIcon,
@ -395,7 +360,6 @@ import {
} from '@modrinth/ui'
import { formatProjectType } from '@modrinth/utils'
import { computed, onUnmounted, ref, watch } from 'vue'
import { useRouter } from 'vue-router'
import {
add_project_from_path,
get,
@ -406,15 +370,13 @@ import {
} from '@/helpers/profile.js'
import { handleError } from '@/store/notifications.js'
import { mixpanel_track } from '@/helpers/mixpanel'
import { open } from '@tauri-apps/api/dialog'
import { listen } from '@tauri-apps/api/event'
import { convertFileSrc } from '@tauri-apps/api/tauri'
import { highlightModInProfile } from '@/helpers/utils.js'
import { MenuIcon, ToggleIcon, TextInputIcon, AddProjectImage, PackageIcon } from '@/assets/icons'
import ExportModal from '@/components/ui/ExportModal.vue'
import ModpackVersionModal from '@/components/ui/ModpackVersionModal.vue'
const router = useRouter()
import AddContentButton from '@/components/ui/AddContentButton.vue'
const props = defineProps({
instance: {
@ -846,23 +808,6 @@ const handleRightClick = (event, mod) => {
}
}
const handleContentOptionClick = async (args) => {
if (args.option === 'search') {
await router.push({
path: `/browse/${props.instance.metadata.loader === 'vanilla' ? 'datapack' : 'mod'}`,
query: { i: props.instance.path },
})
} else if (args.option === 'from_file') {
const newProject = await open({ multiple: true })
if (!newProject) return
for (const project of newProject) {
await add_project_from_path(props.instance.path, project, 'mod').catch(handleError)
}
initProjects(await get(props.instance.path).catch(handleError))
}
}
watch(selectAll, () => {
for (const [key, value] of Array.from(selectionMap.value)) {
if (value !== selectAll.value) {
@ -967,13 +912,21 @@ onUnmounted(() => {
}
}
.btn {
:deep(.btn) {
height: 2.5rem;
}
.dropdown-input {
flex-grow: 1;
.animated-dropdown {
width: unset;
:deep(.selected) {
border-radius: var(--radius-md) 0 0 var(--radius-md);
}
}
.iconified-input {
width: 100%;
@ -1159,8 +1112,12 @@ onUnmounted(() => {
</style>
<style lang="scss">
.updating-indicator {
height: 2.25rem !important;
width: 2.25rem !important;
svg {
margin-left: 0.5rem !important;
height: 1.25rem !important;
width: 1.25rem !important;
}
}

View File

@ -78,7 +78,7 @@
}
},
"security": {
"csp": "default-src 'self'; connect-src https://modrinth.com https://*.modrinth.com https://mixpanel.com https://*.mixpanel.com https://*.cloudflare.com https://api.mclo.gs; font-src https://cdn-raw.modrinth.com/fonts/inter/; img-src tauri: https: data: blob: 'unsafe-inline' asset: https://asset.localhost; script-src https://*.cloudflare.com 'self'; frame-src https://*.cloudflare.com https://www.youtube.com https://www.youtube-nocookie.com https://discord.com 'self'; style-src unsafe-inline 'self'"
"csp": "default-src 'self'; connect-src https://modrinth.com https://*.modrinth.com https://mixpanel.com https://*.mixpanel.com https://*.cloudflare.com https://api.mclo.gs; font-src https://cdn-raw.modrinth.com/fonts/inter/; img-src tauri: https: data: blob: 'unsafe-inline' asset: https://asset.localhost; script-src https://*.cloudflare.com 'self'; frame-src https://*.cloudflare.com https://www.youtube.com https://www.youtube-nocookie.com https://discord.com 'self'; style-src 'unsafe-inline' 'self'"
},
"updater": {
"active": false

View File

@ -3,10 +3,11 @@
"version": "0.0.0",
"private": true,
"scripts": {
"web:build": "turbo run build --filter=@modrinth/frontend",
"pages:build": "NITRO_PRESET=cloudflare-pages pnpm --filter frontend run build",
"web:dev": "turbo run dev --filter=@modrinth/frontend",
"web:build": "turbo run build --filter=@modrinth/frontend",
"app:dev": "turbo run dev --filter=@modrinth/app",
"app:build": "turbo run build --filter=@modrinth/app",
"pages:build": "NITRO_PRESET=cloudflare-pages pnpm --filter frontend run build",
"build": "turbo run build --continue",
"lint": "turbo run lint --continue",
"test": "turbo run test --continue"

View File

@ -3,11 +3,6 @@ html {
--dark-color-base: #b0bac5;
--dark-color-contrast: #ecf9fb;
--color-ad: rgba(125, 75, 162, 0.2);
--color-ad-raised: rgba(190, 140, 243, 0.5);
--color-ad-contrast: black;
--color-ad-highlight: var(--color-purple);
--gap-xs: 0.25rem;
--gap-sm: 0.5rem;
--gap-md: 0.75rem;
@ -60,6 +55,11 @@ html {
--color-tooltip-text: var(--color-accent-contrast);
--color-tooltip-bg: var(--color-base);
--color-ad: #d6e6f9;
--color-ad-raised: #b1c8e4;
--color-ad-contrast: var(--color-text);
--color-ad-highlight: #088cdb;
}
.dark-mode,
@ -98,6 +98,11 @@ html {
--color-tooltip-text: var(--color-base);
--color-tooltip-bg: var(--color-button-bg);
--color-ad: #1f324a;
--color-ad-raised: #2e4057;
--color-ad-contrast: var(--color-text);
--color-ad-highlight: #088cdb;
}
.oled-mode {
@ -105,4 +110,6 @@ html {
--color-bg: #000000;
--color-raised-bg: #101013;
--color-button-bg: #222329;
--color-ad: #0d1828;
}

View File

@ -48,31 +48,36 @@ const props = defineProps({
const accentedButton = computed(() =>
['danger', 'primary', 'red', 'orange', 'green', 'blue', 'purple', 'gray'].includes(props.color),
)
const classes = computed(() => {
const color = props.color
return {
'icon-only': props.iconOnly,
'btn-large': props.large,
'btn-danger': color === 'danger',
'btn-primary': color === 'primary',
'btn-secondary': color === 'secondary',
'btn-highlight': color === 'highlight',
'btn-red': color === 'red',
'btn-orange': color === 'orange',
'btn-green': color === 'green',
'btn-blue': color === 'blue',
'btn-purple': color === 'purple',
'btn-gray': color === 'gray',
'btn-transparent': props.transparent,
'btn-hover-filled': props.hoverFilled,
'btn-hover-filled-only': props.hoverFilledOnly,
'btn-outline': props.outline,
'color-accent-contrast': accentedButton,
}
})
</script>
<template>
<router-link
v-if="link && link.startsWith('/')"
class="btn"
:class="{
'icon-only': iconOnly,
'btn-large': large,
'btn-danger': color === 'danger',
'btn-primary': color === 'primary',
'btn-secondary': color === 'secondary',
'btn-highlight': color === 'highlight',
'btn-red': color === 'red',
'btn-orange': color === 'orange',
'btn-green': color === 'green',
'btn-blue': color === 'blue',
'btn-purple': color === 'purple',
'btn-gray': color === 'gray',
'btn-transparent': transparent,
'btn-hover-filled': hoverFilled,
'btn-hover-filled-only': hoverFilledOnly,
'btn-outline': outline,
'color-accent-contrast': accentedButton,
}"
:class="classes"
:to="link"
:target="external ? '_blank' : '_self'"
>
@ -83,25 +88,7 @@ const accentedButton = computed(() =>
<a
v-else-if="link"
class="btn"
:class="{
'icon-only': iconOnly,
'btn-large': large,
'btn-danger': color === 'danger',
'btn-primary': color === 'primary',
'btn-secondary': color === 'secondary',
'btn-highlight': color === 'highlight',
'btn-red': color === 'red',
'btn-orange': color === 'orange',
'btn-green': color === 'green',
'btn-blue': color === 'blue',
'btn-purple': color === 'purple',
'btn-gray': color === 'gray',
'btn-transparent': transparent,
'btn-hover-filled': hoverFilled,
'btn-hover-filled-only': hoverFilledOnly,
'btn-outline': outline,
'color-accent-contrast': accentedButton,
}"
:class="classes"
:href="link"
:target="external ? '_blank' : '_self'"
>
@ -109,30 +96,7 @@ const accentedButton = computed(() =>
<ExternalIcon v-if="external && !iconOnly" class="external-icon" />
<UnknownIcon v-if="!$slots.default" />
</a>
<button
v-else
class="btn"
:class="{
'icon-only': iconOnly,
'btn-large': large,
'btn-danger': color === 'danger',
'btn-primary': color === 'primary',
'btn-secondary': color === 'secondary',
'btn-highlight': color === 'highlight',
'btn-red': color === 'red',
'btn-orange': color === 'orange',
'btn-green': color === 'green',
'btn-blue': color === 'blue',
'btn-purple': color === 'purple',
'btn-gray': color === 'gray',
'btn-transparent': transparent,
'btn-hover-filled': hoverFilled,
'btn-hover-filled-only': hoverFilledOnly,
'btn-outline': outline,
'color-accent-contrast': accentedButton,
}"
@click="action"
>
<button v-else class="btn" :class="classes" @click="action">
<slot />
<UnknownIcon v-if="!$slots.default" />
</button>

55
pnpm-lock.yaml generated
View File

@ -65,9 +65,6 @@ importers:
ofetch:
specifier: ^1.3.4
version: 1.3.4
omorphia:
specifier: ^0.4.41
version: 0.4.41(@nuxt/kit@3.12.3)(typescript@5.5.3)
pinia:
specifier: ^2.1.7
version: 2.1.7(typescript@5.5.3)(vue@3.4.31(typescript@5.5.3))
@ -1361,9 +1358,6 @@ packages:
'@js-sdsl/ordered-map@4.4.2':
resolution: {integrity: sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==}
'@kurkle/color@0.3.2':
resolution: {integrity: sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw==}
'@kwsites/file-exists@1.1.1':
resolution: {integrity: sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==}
@ -2641,10 +2635,6 @@ packages:
resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==}
engines: {node: ^12.17.0 || ^14.13 || >=16.0.0}
chart.js@4.4.3:
resolution: {integrity: sha512-qK1gkGSRYcJzqrrzdR6a+I0vQ4/R+SoODXyAjscQ/4mzuNzySaMCd+hyVxitSY1+L2fjPD1Gbn+ibNqRmwQeLw==}
engines: {pnpm: '>=8'}
chokidar@3.6.0:
resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==}
engines: {node: '>= 8.10.0'}
@ -4392,9 +4382,6 @@ packages:
ohash@1.1.3:
resolution: {integrity: sha512-zuHHiGTYTA1sYJ/wZN+t5HKZaH23i4yI1HMwbuXm24Nid7Dv0KcuRlKoNKS9UNfAVSBlnGLcuQrnOKWOZoEGaw==}
omorphia@0.4.41:
resolution: {integrity: sha512-/FiV8msK78HQe0Mem2xyuxdjRQTK3OUG0/twGIh/DE5RCzGUchblV9QUdqEYXGXeGbjdIkLFFI8EXs/0exROmg==}
on-finished@2.4.1:
resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==}
engines: {node: '>= 0.8'}
@ -5745,12 +5732,6 @@ packages:
vue-bundle-renderer@2.1.0:
resolution: {integrity: sha512-uZ+5ZJdZ/b43gMblWtcpikY6spJd0nERaM/1RtgioXNfWFbjKlUwrS8HlrddN6T2xtptmOouWclxLUkpgcVX3Q==}
vue-chartjs@5.3.1:
resolution: {integrity: sha512-rZjqcHBxKiHrBl0CIvcOlVEBwRhpWAVf6rDU3vUfa7HuSRmGtCslc0Oc8m16oAVuk0erzc1FCtH1VCriHsrz+A==}
peerDependencies:
chart.js: ^4.1.1
vue: ^3.0.0-0 || ^2.7.0
vue-demi@0.14.8:
resolution: {integrity: sha512-Uuqnk9YE9SsWeReYqK2alDI5YzciATE0r2SkA6iMAtuXvNTMNACJLJEXNXaEy94ECuBe4Sk6RzRU80kjdbIo1Q==}
engines: {node: '>=12'}
@ -6779,8 +6760,6 @@ snapshots:
'@js-sdsl/ordered-map@4.4.2': {}
'@kurkle/color@0.3.2': {}
'@kwsites/file-exists@1.1.1':
dependencies:
debug: 4.3.5
@ -8594,10 +8573,6 @@ snapshots:
chalk@5.3.0: {}
chart.js@4.4.3:
dependencies:
'@kurkle/color': 0.3.2
chokidar@3.6.0:
dependencies:
anymatch: 3.1.3
@ -9642,14 +9617,6 @@ snapshots:
optionalDependencies:
'@nuxt/kit': 3.12.3(rollup@3.29.4)
floating-vue@2.0.0-beta.24(@nuxt/kit@3.12.3)(vue@3.4.31(typescript@5.5.3)):
dependencies:
'@floating-ui/dom': 1.1.1
vue: 3.4.31(typescript@5.5.3)
vue-resize: 2.0.0-alpha.1(vue@3.4.31(typescript@5.5.3))
optionalDependencies:
'@nuxt/kit': 3.12.3
floating-vue@5.2.2(@nuxt/kit@3.12.3)(vue@3.4.31(typescript@5.5.3)):
dependencies:
'@floating-ui/dom': 1.1.1
@ -10747,23 +10714,6 @@ snapshots:
ohash@1.1.3: {}
omorphia@0.4.41(@nuxt/kit@3.12.3)(typescript@5.5.3):
dependencies:
chart.js: 4.4.3
dayjs: 1.11.11
floating-vue: 2.0.0-beta.24(@nuxt/kit@3.12.3)(vue@3.4.31(typescript@5.5.3))
highlight.js: 11.9.0
markdown-it: 13.0.2
qrcode.vue: 3.4.1(vue@3.4.31(typescript@5.5.3))
vue: 3.4.31(typescript@5.5.3)
vue-chartjs: 5.3.1(chart.js@4.4.3)(vue@3.4.31(typescript@5.5.3))
vue-router: 4.3.0(vue@3.4.31(typescript@5.5.3))
vue-select: 4.0.0-beta.6(vue@3.4.31(typescript@5.5.3))
xss: 1.0.15
transitivePeerDependencies:
- '@nuxt/kit'
- typescript
on-finished@2.4.1:
dependencies:
ee-first: 1.1.1
@ -12162,11 +12112,6 @@ snapshots:
dependencies:
ufo: 1.5.3
vue-chartjs@5.3.1(chart.js@4.4.3)(vue@3.4.31(typescript@5.5.3)):
dependencies:
chart.js: 4.4.3
vue: 3.4.31(typescript@5.5.3)
vue-demi@0.14.8(vue@3.4.31(typescript@5.5.3)):
dependencies:
vue: 3.4.31(typescript@5.5.3)

View File

@ -20,7 +20,10 @@
"lint": {},
"dev": {
"cache": false,
"persistent": true
"persistent": true,
"env": [
"*"
]
},
"test": {}
},