You've already forked AstralRinth
forked from didirus/AstralRinth
fix(theseus): Fixed multiple bugs (#1304)
* fix(theseus): Resolve log tab freezing entire app (#1127, #1237) Switched to `vue-typed-virtual-list` due to freezing issues in WebKit caused by `vue-virtual-scroller`, which were difficult to resolve with the previous library. * fix(theseus): Double opening of Socials Share link (#1136, #1074) * fix(theseus): Proper symlinks resolution (#1236) Ensures correct symlink resolution for specific mods, the mods directory, and the entire profile directory. * fix(theseus): Correctly recognize NeoForge mods (#1215) * fix(theseus): Corrected `Environments` and `Loaders` filters (#899) * fix(theseus): Remove `_JAVA_OPTIONS` when testing JRE (#1171) * fix(theseus): Fixed opening files using `show_in_folder` Previously, opening a mod would display the contents of the JAR file instead of its location. * fix(theseus): Hide `.DS_Store` files (#1274, #1002, #1174) * fix(theseus): Corrected tooltip color * fix(theseus): Fixed white mode issues (#1144, #1010) * fix: Corrected `Slider` min and max value handling (#1008) * fix: Fixed rebase problems * fix: Fixed `:deep` usage warning * chore: Updated eslint plugins to fix conflicts with Prettier
This commit is contained in:
@@ -22,6 +22,8 @@ use serde::{Deserialize, Serialize};
|
||||
use std::io::Cursor;
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
ffi::OsStr,
|
||||
path,
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
use uuid::Uuid;
|
||||
@@ -65,7 +67,6 @@ impl ProfilePathId {
|
||||
.ok_or_else(|| {
|
||||
crate::ErrorKind::FSError(format!(
|
||||
"Path {path:?} does not correspond to a profile",
|
||||
path = path
|
||||
))
|
||||
})?;
|
||||
Ok(Self(path))
|
||||
@@ -150,14 +151,15 @@ impl From<InnerProjectPathUnix> for RawProjectPath {
|
||||
pub struct ProjectPathId(pub PathBuf);
|
||||
impl ProjectPathId {
|
||||
// Create a new ProjectPathId from a full file path
|
||||
pub async fn from_fs_path(path: &PathBuf) -> crate::Result<Self> {
|
||||
pub async fn from_fs_path(path: &Path) -> crate::Result<Self> {
|
||||
// This is avoiding dunce::canonicalize deliberately. On Windows, paths will always be convert to UNC,
|
||||
// but this is ok because we are stripping that with the prefix. Using std::fs avoids different behaviors with dunce that
|
||||
// come with too-long paths
|
||||
let profiles_dir: PathBuf = std::fs::canonicalize(
|
||||
State::get().await?.directories.profiles_dir().await,
|
||||
)?;
|
||||
let path: PathBuf = std::fs::canonicalize(path)?;
|
||||
// Normal canonizing resolves symlinks, which results in "path not corresponding to profile" error
|
||||
let path = path::absolute(path)?;
|
||||
let path = path
|
||||
.strip_prefix(profiles_dir)
|
||||
.ok()
|
||||
@@ -165,7 +167,6 @@ impl ProjectPathId {
|
||||
.ok_or_else(|| {
|
||||
crate::ErrorKind::FSError(format!(
|
||||
"Path {path:?} does not correspond to a profile",
|
||||
path = path
|
||||
))
|
||||
})?;
|
||||
Ok(Self(path))
|
||||
@@ -485,7 +486,9 @@ impl Profile {
|
||||
.map_err(|e| IOError::with_path(e, &new_path))?
|
||||
{
|
||||
let subpath = subpath.map_err(IOError::from)?.path();
|
||||
if subpath.is_file() {
|
||||
if subpath.is_file()
|
||||
&& subpath.file_name() != Some(OsStr::new(".DS_Store"))
|
||||
{
|
||||
files.push(subpath);
|
||||
}
|
||||
}
|
||||
@@ -609,6 +612,7 @@ impl Profile {
|
||||
})?;
|
||||
if archive.by_name("fabric.mod.json").is_ok()
|
||||
|| archive.by_name("quilt.mod.json").is_ok()
|
||||
|| archive.by_name("META-INF/neoforge.mods.toml").is_ok()
|
||||
|| archive.by_name("META-INF/mods.toml").is_ok()
|
||||
|| archive.by_name("mcmod.info").is_ok()
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ impl ProjectType {
|
||||
pub fn get_from_loaders(loaders: Vec<String>) -> Option<Self> {
|
||||
if loaders
|
||||
.iter()
|
||||
.any(|x| ["fabric", "forge", "quilt"].contains(&&**x))
|
||||
.any(|x| ["fabric", "forge", "quilt", "neoforge"].contains(&&**x))
|
||||
{
|
||||
Some(ProjectType::Mod)
|
||||
} else if loaders.iter().any(|x| x == "datapack") {
|
||||
|
||||
@@ -294,6 +294,7 @@ pub async fn check_java_at_filepath(path: &Path) -> Option<JavaVersion> {
|
||||
.arg("-cp")
|
||||
.arg(file_path.parent().unwrap())
|
||||
.arg("JavaInfo")
|
||||
.env_remove("_JAVA_OPTIONS")
|
||||
.output()
|
||||
.ok()?;
|
||||
|
||||
|
||||
@@ -15,6 +15,9 @@ html {
|
||||
--radius-lg: 1rem;
|
||||
--radius-xl: 1.25rem;
|
||||
--radius-max: 999999999px;
|
||||
|
||||
--color-tooltip-text: var(--color-base);
|
||||
--color-tooltip-bg: var(--color-button-bg);
|
||||
}
|
||||
|
||||
.light-mode,
|
||||
@@ -23,6 +26,7 @@ html {
|
||||
--color-raised-bg: #ffffff;
|
||||
--color-super-raised-bg: #e9e9e9;
|
||||
--color-button-bg: hsl(220, 13%, 91%);
|
||||
--color-scrollbar: #96a2b0;
|
||||
|
||||
--color-base: hsl(221, 39%, 11%);
|
||||
--color-secondary: #6b7280;
|
||||
@@ -40,9 +44,9 @@ html {
|
||||
--color-brand-highlight: rgba(0, 175, 92, 0.25);
|
||||
--color-brand-shadow: rgba(0, 175, 92, 0.7);
|
||||
|
||||
--shadow-inset-lg: inset 0px -2px 2px hsla(221, 39%, 11%, 0.1);
|
||||
--shadow-inset: inset 0px -2px 2px hsla(221, 39%, 11%, 0.05);
|
||||
--shadow-inset-sm: inset 0px -1px 2px hsla(221, 39%, 11%, 0.15);
|
||||
--shadow-inset-lg: inset 0px -2px 2px hsla(221, 39%, 91%, 0.1);
|
||||
--shadow-inset: inset 0px -2px 2px hsla(221, 39%, 91%, 0.05);
|
||||
--shadow-inset-sm: inset 0px -1px 2px hsla(221, 39%, 91%, 0.15);
|
||||
|
||||
--shadow-raised-lg: 0px 2px 4px hsla(221, 39%, 11%, 0.2);
|
||||
--shadow-raised: 0.3px 0.5px 0.6px hsl(var(--shadow-color) / 0.15),
|
||||
@@ -53,9 +57,6 @@ html {
|
||||
|
||||
--shadow-card: rgba(50, 50, 100, 0.1) 0px 2px 4px 0px;
|
||||
|
||||
--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);
|
||||
@@ -68,6 +69,7 @@ html {
|
||||
--color-raised-bg: #26292f;
|
||||
--color-super-raised-bg: #40434a;
|
||||
--color-button-bg: hsl(222, 13%, 30%);
|
||||
--color-scrollbar: var(--color-button-bg);
|
||||
|
||||
--color-base: var(--dark-color-base);
|
||||
--color-secondary: #96a2b0;
|
||||
@@ -96,9 +98,6 @@ html {
|
||||
|
||||
--shadow-card: rgba(0, 0, 0, 0.25) 0px 2px 4px 0px;
|
||||
|
||||
--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);
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
"@nuxtjs/eslint-config-typescript": "^12.1.0",
|
||||
"@vue/eslint-config-typescript": "^13.0.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-config-turbo": "^2.0.6",
|
||||
"eslint-plugin-prettier": "^5.1.3",
|
||||
"typescript": "^5.5.3",
|
||||
"eslint-plugin-unicorn": "^54.0.0"
|
||||
"eslint-config-turbo": "^2.0.7",
|
||||
"eslint-plugin-prettier": "^5.2.1",
|
||||
"eslint-plugin-unicorn": "^54.0.0",
|
||||
"typescript": "^5.5.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,17 +80,15 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
|
||||
const currentValue = ref(Math.max(props.min, props.modelValue))
|
||||
|
||||
const inputValueValid = (newValue: number) => {
|
||||
if (newValue < props.min) {
|
||||
currentValue.value = props.min
|
||||
} else if (newValue > props.max) {
|
||||
currentValue.value = props.max
|
||||
} else if (!newValue) {
|
||||
currentValue.value = props.min
|
||||
} else {
|
||||
currentValue.value = newValue - (props.forceStep ? newValue % props.step : 0)
|
||||
}
|
||||
const inputValueValid = (inputValue: number) => {
|
||||
let newValue = inputValue || props.min
|
||||
|
||||
if (props.forceStep) {
|
||||
newValue -= newValue % props.step
|
||||
}
|
||||
newValue = Math.max(props.min, Math.min(newValue, props.max))
|
||||
|
||||
currentValue.value = newValue
|
||||
emit('update:modelValue', currentValue.value)
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,10 @@ const props = defineProps({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
openInNewTab: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
})
|
||||
|
||||
const shareModal = ref(null)
|
||||
@@ -90,6 +94,8 @@ const sendEmail = computed(
|
||||
&body=${encodeURIComponent(content.value)}`,
|
||||
)
|
||||
|
||||
const targetParameter = computed(() => (props.openInNewTab ? '_blank' : '_self'))
|
||||
|
||||
const sendTweet = computed(
|
||||
() => `https://twitter.com/intent/tweet?text=${encodeURIComponent(content.value)}`,
|
||||
)
|
||||
@@ -137,14 +143,19 @@ defineExpose({
|
||||
<Button v-if="canShare" v-tooltip="'Share'" icon-only @click="share">
|
||||
<ShareIcon />
|
||||
</Button>
|
||||
<a v-tooltip="'Send as an email'" class="btn icon-only" target="_blank" :href="sendEmail">
|
||||
<a
|
||||
v-tooltip="'Send as an email'"
|
||||
class="btn icon-only"
|
||||
:href="sendEmail"
|
||||
:target="targetParameter"
|
||||
>
|
||||
<MailIcon />
|
||||
</a>
|
||||
<a
|
||||
v-if="link"
|
||||
v-tooltip="'Open link in browser'"
|
||||
class="btn icon-only"
|
||||
target="_blank"
|
||||
:target="targetParameter"
|
||||
:href="url"
|
||||
>
|
||||
<GlobeIcon />
|
||||
@@ -152,7 +163,7 @@ defineExpose({
|
||||
<a
|
||||
v-tooltip="'Toot about it'"
|
||||
class="btn mastodon icon-only"
|
||||
target="_blank"
|
||||
:target="targetParameter"
|
||||
:href="sendToot"
|
||||
>
|
||||
<MastodonIcon />
|
||||
@@ -160,7 +171,7 @@ defineExpose({
|
||||
<a
|
||||
v-tooltip="'Tweet about it'"
|
||||
class="btn twitter icon-only"
|
||||
target="_blank"
|
||||
:target="targetParameter"
|
||||
:href="sendTweet"
|
||||
>
|
||||
<TwitterIcon />
|
||||
@@ -168,7 +179,7 @@ defineExpose({
|
||||
<a
|
||||
v-tooltip="'Share on Reddit'"
|
||||
class="btn reddit icon-only"
|
||||
target="_blank"
|
||||
:target="targetParameter"
|
||||
:href="postOnReddit"
|
||||
>
|
||||
<RedditIcon />
|
||||
|
||||
Reference in New Issue
Block a user