Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: match API arch->target changes #121

Merged
merged 25 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
baa02e8
chore: match API arch->target changes
mircearoata May 9, 2023
bf5a24f
feat: match mod file validation to API's
mircearoata May 9, 2023
65258f1
feat: validate SML version target uniqueness
mircearoata May 9, 2023
414dc88
chore: include all typescript files in tsconfig
mircearoata May 9, 2023
7473a03
chore: restore pre-commit hook to pnpm check
mircearoata May 9, 2023
f6220bc
feat: make boostrap_version optional
mircearoata May 9, 2023
9dd9c2e
feat: link users to docs page for multi-target format packaging
budak7273 Jun 12, 2023
c1d3e84
feat: clarify latest versions section, closes #75
budak7273 Jun 12, 2023
ecf332d
fix: move ModLatestVersion above ModInfo, closes #79
budak7273 Jun 12, 2023
f333791
feat: make LatestVersions buttons call install via SMM, closes #59
budak7273 Jun 12, 2023
322a118
feat: ctrl-click and Open Link in New Tab support for image element o…
budak7273 Jun 12, 2023
b92cd61
feat: release as default new version stability, closes #76
budak7273 Jun 12, 2023
dd4d15f
chore: match tsconfig from staging a04c199 to fix merge conflicts
budak7273 Jun 23, 2023
5e3256f
chore(dedi): Bring in changes from Staging (#86)
budak7273 Jun 23, 2023
639cae6
chore: rename WindowsNoEditor to Windows
mircearoata Aug 19, 2023
10025b2
fix: handle null in trimNonSchema
mircearoata Aug 20, 2023
92cf19a
feat: allow adding targets to SML versions when editing
mircearoata Aug 20, 2023
04f394e
fix: display SML version target link validation errors
mircearoata Aug 20, 2023
4b0758a
chore: use GQL TargetName enum
mircearoata Aug 21, 2023
cfe479c
feat: target compatibility, mod dependency display (#81)
porisius Oct 19, 2023
ce97321
Merge branch 'staging' into dedicated-server-updates
Vilsol Oct 19, 2023
fbf3915
chore: lint
Vilsol Oct 19, 2023
2102898
fix: check if state exists
Vilsol Oct 19, 2023
e1c11b0
chore: temporarily allow only single-target mods
mircearoata Oct 19, 2023
312fa17
chore: allow both single-target and multi-target
mircearoata Oct 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ At the highest level you must at least have:

* [NodeJS](https://nodejs.org/en/)
* [pnpm](https://pnpm.io/)
* terminal
* terminal (Bash is suggested but not required.)

### pnpm installation

Expand Down Expand Up @@ -39,6 +39,8 @@ Now you're good to go!

## Local Development

See the [Readme](README.md) for how to point your local frontend to the staging or production API.

After you've installed everything, start the project via:

```sh
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ The `dev` script executes several processes:

* Development Server
* Svelte Checker
* GraphQL Code Generator
* ESLint

```shell
Expand Down
2 changes: 1 addition & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// language - current active spelling language
"language": "en",
// words - list of words to be always considered correct
"words": ["cfworker", "felte", "prismjs", "smui", "urql", "wonka"],
"words": ["cfworker", "felte", "ficsit", "pnpx", "prismjs", "smui", "urql", "webp", "wonka"],
// flagWords - list of words to be always considered incorrect
// This is useful for offensive words and common spelling errors.
// cSpell:disable (don't complain about the words we listed here)
Expand Down
6 changes: 3 additions & 3 deletions src/gql/admin/sml-versions/sml_version_admin.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ query GetSMLVersionAdmin($smlVersionID: SMLVersionID!) {
version
stability
link
arch {
id
platform
targets {
targetName
link
}
changelog
created_at
date
satisfactory_version
bootstrap_version
engine_version
}
}
6 changes: 3 additions & 3 deletions src/gql/admin/sml-versions/sml_versions_admin.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ query GetSMLVersionsAdmin($filter: SMLVersionFilter) {
version
stability
link
arch {
id
platform
targets {
targetName
link
}
changelog
created_at
date
satisfactory_version
bootstrap_version
engine_version
}
count
}
Expand Down
7 changes: 3 additions & 4 deletions src/gql/admin/version/unapproved_versions.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ query GetUnapprovedVersions($filter: VersionFilter) {
version
stability
link
arch {
id
platform
asset
targets {
targetName
link
}
changelog
created_at
Expand Down
36 changes: 21 additions & 15 deletions src/gql/mods/mod.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,50 @@ query GetMod($mod: String!) {
alpha {
id
link
arch {
id
ModVersionID
platform
asset
targets {
targetName
link
hash
size
}
dependencies {
mod_id
condition
}
version
created_at
sml_version
}
beta {
id
link
arch {
id
ModVersionID
platform
asset
targets {
targetName
link
hash
size
}
dependencies {
mod_id
condition
}
version
created_at
sml_version
}
release {
id
link
arch {
id
ModVersionID
platform
asset
targets {
targetName
link
hash
size
}
dependencies {
mod_id
condition
}
version
created_at
sml_version
Expand Down
8 changes: 3 additions & 5 deletions src/gql/mods/versions.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ query GetModVersions($mod: ModID!, $limit: Int!, $offset: Int!) {
link
hash
size
arch {
id
ModVersionID
platform
asset
targets {
targetName
link
hash
size
}
Expand Down
5 changes: 2 additions & 3 deletions src/gql/sml/sml_versions.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ query GetSMLVersions($limit: Int!, $offset: Int!) {
stability
changelog
link
arch {
id
platform
targets {
targetName
link
}
date
Expand Down
12 changes: 7 additions & 5 deletions src/gql/versions/mod_version.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ query GetModVersion($version: VersionID!) {
link
hash
size
arch {
id
ModVersionID
platform
asset
targets {
targetName
link
hash
size
}
Expand All @@ -27,5 +25,9 @@ query GetModVersion($version: VersionID!) {
user_id
}
}
dependencies {
mod_id
condition
}
}
}
14 changes: 8 additions & 6 deletions src/lib/components/general/FicsitCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@
class:text-gray-500={fake}
class:font-flow={fake}
class="grid grid-max-auto sm:grid-cols-2 grid-cols-1 justify-items-center">
<div class="cursor-pointer card-image-container" on:click={() => goto(link)} on:keypress={() => goto(link)}>
{#if fake}
<div class="bg-gray-500 logo min-w-full min-h-full max-w-full max-h-full" />
{:else}
<img src={renderedLogo} alt="{renderedName} Logo" class="logo max-w-full max-h-full" />
{/if}
<div class="cursor-pointer card-image-container">
<a href={link} on:keypress={() => goto(link)}>
{#if fake}
<div class="bg-gray-500 logo min-w-full min-h-full max-w-full max-h-full" />
{:else}
<img src={renderedLogo} alt="{renderedName} Logo" class="logo max-w-full max-h-full" />
{/if}
</a>
</div>
<div class="w-full flex flex-col justify-between">
<Content class="flex flex-col pb-0">
Expand Down
8 changes: 8 additions & 0 deletions src/lib/components/mods/ModInfo.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@
<Content>
<div class="text-lg break-words">
<h3 class="text-2xl my-4 font-bold">Info</h3>
<span
><strong>Tags:</strong>
{#if mod.tags.length === 0}
<div class="tags">(No tags assigned)</div>
{:else}
<TagList tags={mod.tags} />
{/if}
</span>
<span
><strong>{$t('entry.source')}:</strong>
<a class="underline text-yellow-500" href={mod.source_url}>{mod.source_url}</a></span
Expand Down
32 changes: 21 additions & 11 deletions src/lib/components/mods/ModLatestVersions.svelte
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
<script lang="ts">
import type { Version } from '$lib/generated';
import { API_REST } from '$lib/core';
import { base } from '$app/paths';
import Card, { Content } from '@smui/card';
import { Icon } from '@smui/common';
import { prettyDate } from '$lib/utils/formatting';
import { getTranslate } from '@tolgee/svelte';
import { installMod } from '$lib/stores/launcher';
import VersionTargetSupportGrid from '$lib/components/versions/VersionTargetSupportGrid.svelte';
import VersionDependenciesGrid from '$lib/components/versions/VersionDependenciesGrid.svelte';
import type { Version, VersionDependency, VersionTarget } from '$lib/generated';

type IVersion = Pick<Version, 'id' | 'link' | 'version' | 'created_at'> & {
targets?: Pick<VersionTarget, 'targetName' | 'size' | 'hash'>[];
} & { dependencies?: Pick<VersionDependency, 'mod_id' | 'condition'>[] };

type ILatestVersions = {
alpha?: Pick<Version, 'id' | 'link' | 'version' | 'created_at'>;
beta?: Pick<Version, 'id' | 'link' | 'version' | 'created_at'>;
release?: Pick<Version, 'id' | 'link' | 'version' | 'created_at'>;
alpha?: IVersion;
beta?: IVersion;
release?: IVersion;
};

const stabilities = {
Expand All @@ -33,22 +39,26 @@
{#each Object.keys(stabilities) as stability}
{#if latestVersions[stability]}
<div class="version">
<div class="text-4xl w-14 h-14 p-2.5">
<div class="text-4xl w-14 h-14 p-2.5" title={`Latest ${stability} release`}>
<Icon class="material-icons">{stabilities[stability]}</Icon>
</div>
<div class="grid grid-flow-row">
<a href="{base}/mod/{modId}/version/{latestVersions[stability].id}/" class="text-yellow-500 underline"
>Version {latestVersions[stability].version}</a>
>Version {latestVersions[stability].version} ({stability})</a>
<div>{prettyDate(latestVersions[stability].created_at)}</div>
</div>
<div class="text-3xl w-14 h-14 p-2.5">
<div class="text-1xl col-span-3 w-auto h-auto p-2.5">
<a
href={API_REST + '/mod/' + modId + '/versions/' + latestVersions[stability].id + '/download'}
class="text-yellow-500 underline">
<Icon class="material-icons">download</Icon>
href="#top"
on:click={() => installMod(modId)}
title="Install via Satisfactory Mod Manager"
class="text-yellow-500">
<Icon class="material-icons align-middle" style="font-size: 118x;">download</Icon> <u>Download</u>
</a>
</div>
</div>
<VersionTargetSupportGrid targets={latestVersions[stability].targets} />
<VersionDependenciesGrid dependencies={latestVersions[stability].dependencies} />
{/if}
{/each}
</div>
Expand Down
6 changes: 4 additions & 2 deletions src/lib/components/mods/ModLogo.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
</script>

<div class="relative overflow-hidden">
<OutdatedBanner {compatibility} logo={true} />
<img class="rounded-lg sm:max-w-lg max-w-full w-full" src={logo} alt="Logo for {modName}" />
<div class="sm:max-w-lg max-w-full w-full">
<OutdatedBanner {compatibility} logo={true} />
<img class="rounded-lg" src={logo} alt="Logo for {modName}" />
</div>
</div>
10 changes: 5 additions & 5 deletions src/lib/components/mods/ModVersions.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import List, { Item } from '@smui/list';
import Button, { Group, GroupItem, Label, Icon } from '@smui/button';
import { installMod } from '$lib/stores/launcher';
import { prettyDate, prettyNumber, prettyBytes, prettyArch } from '$lib/utils/formatting';
import { prettyDate, prettyNumber, prettyBytes, prettyTarget } from '$lib/utils/formatting';
import { getTranslate } from '@tolgee/svelte';

export let modId!: string;
Expand Down Expand Up @@ -79,7 +79,7 @@
}}>
<Button variant="outlined" href={base + '/mod/' + modId + '/version/' + version.id}
>{$t('view')}</Button>
{#if version.arch.length != 0}
{#if version.targets.length !== 0}
<Group variant="outlined">
<Button
variant="outlined"
Expand All @@ -96,7 +96,7 @@
</Button>
<Menu bind:this={menus[i]} anchorCorner="TOP_LEFT">
<List>
{#each version.arch as arch, _}
{#each version.targets as target, _}
<Item>
<Button
class="w-full"
Expand All @@ -107,8 +107,8 @@
'/versions/' +
version.id +
'/' +
arch.platform +
'/download'}>{$t('download')} {prettyArch(arch.platform)}</Button>
target.targetName +
'/download'}>{$t('download')} {prettyTarget(target.targetName)}</Button>
</Item>
{/each}
</List>
Expand Down
Loading
Loading