feat: remove SML references (#64)
* feat: update ficsit-resolver * feat: remove SML references * feat: read GameVersion from uplugin * ci: docker-compose => docker compose
This commit is contained in:
parent
d051b5800a
commit
d744884f25
17 changed files with 26 additions and 203 deletions
2
.github/workflows/push.yaml
vendored
2
.github/workflows/push.yaml
vendored
|
@ -96,7 +96,7 @@ jobs:
|
||||||
|
|
||||||
- name: Boot ftp and sftp
|
- name: Boot ftp and sftp
|
||||||
if: ${{ matrix.os == 'ubuntu-latest' }}
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
||||||
run: docker-compose -f docker-compose-test.yml up -d
|
run: docker compose -f docker-compose-test.yml up -d
|
||||||
|
|
||||||
- name: Download GQL schema
|
- name: Download GQL schema
|
||||||
run: "npx graphqurl https://api.ficsit.dev/v2/query --introspect -H 'content-type: application/json' > schema.graphql"
|
run: "npx graphqurl https://api.ficsit.dev/v2/query --introspect -H 'content-type: application/json' > schema.graphql"
|
||||||
|
|
1
cli/cache/uplugin.go
vendored
1
cli/cache/uplugin.go
vendored
|
@ -5,6 +5,7 @@ type UPlugin struct {
|
||||||
FriendlyName string `json:"FriendlyName"`
|
FriendlyName string `json:"FriendlyName"`
|
||||||
Description string `json:"Description"`
|
Description string `json:"Description"`
|
||||||
CreatedBy string `json:"CreatedBy"`
|
CreatedBy string `json:"CreatedBy"`
|
||||||
|
GameVersion string `json:"GameVersion"`
|
||||||
Plugins []Plugins `json:"Plugins"`
|
Plugins []Plugins `json:"Plugins"`
|
||||||
}
|
}
|
||||||
type Plugins struct {
|
type Plugins struct {
|
||||||
|
|
|
@ -332,7 +332,7 @@ func (i *Installation) resolveProfile(ctx *GlobalContext, platform *Platform) (*
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
depResolver := resolver.NewDependencyResolver(ctx.Provider, viper.GetString("api-base"))
|
depResolver := resolver.NewDependencyResolver(ctx.Provider)
|
||||||
|
|
||||||
gameVersion, err := i.getGameVersion(platform)
|
gameVersion, err := i.getGameVersion(platform)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -548,7 +548,7 @@ func (i *Installation) UpdateMods(ctx *GlobalContext, mods []string) error {
|
||||||
return fmt.Errorf("failed to read lock file: %w", err)
|
return fmt.Errorf("failed to read lock file: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resolver := resolver.NewDependencyResolver(ctx.Provider, viper.GetString("api-base"))
|
resolver := resolver.NewDependencyResolver(ctx.Provider)
|
||||||
|
|
||||||
gameVersion, err := i.getGameVersion(platform)
|
gameVersion, err := i.getGameVersion(platform)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package cli
|
package cli
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
@ -299,7 +298,7 @@ func (p *Profile) Resolve(resolver resolver.DependencyResolver, lockFile *resolv
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resultLockfile, err := resolver.ResolveModDependencies(context.TODO(), toResolve, lockFile, gameVersion, p.RequiredTargets)
|
resultLockfile, err := resolver.ResolveModDependencies(toResolve, lockFile, gameVersion, p.RequiredTargets)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed resolving profile dependencies: %w", err)
|
return nil, fmt.Errorf("failed resolving profile dependencies: %w", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import (
|
||||||
|
|
||||||
"github.com/Khan/genqlient/graphql"
|
"github.com/Khan/genqlient/graphql"
|
||||||
resolver "github.com/satisfactorymodding/ficsit-resolver"
|
resolver "github.com/satisfactorymodding/ficsit-resolver"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
|
||||||
"github.com/satisfactorymodding/ficsit-cli/ficsit"
|
"github.com/satisfactorymodding/ficsit-cli/ficsit"
|
||||||
)
|
)
|
||||||
|
@ -32,34 +33,6 @@ func (p FicsitProvider) ModVersions(context context.Context, modReference string
|
||||||
return ficsit.ModVersions(context, p.client, modReference, filter)
|
return ficsit.ModVersions(context, p.client, modReference, filter)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p FicsitProvider) SMLVersions(context context.Context) ([]resolver.SMLVersion, error) {
|
|
||||||
response, err := ficsit.SMLVersions(context, p.client)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
smlVersions := make([]resolver.SMLVersion, len(response.SmlVersions.Sml_versions))
|
|
||||||
for i, version := range response.GetSmlVersions().Sml_versions {
|
|
||||||
targets := make([]resolver.SMLVersionTarget, len(version.Targets))
|
|
||||||
|
|
||||||
for j, target := range version.Targets {
|
|
||||||
targets[j] = resolver.SMLVersionTarget{
|
|
||||||
TargetName: resolver.TargetName(target.TargetName),
|
|
||||||
Link: target.Link,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
smlVersions[i] = resolver.SMLVersion{
|
|
||||||
ID: version.Id,
|
|
||||||
Version: version.Version,
|
|
||||||
SatisfactoryVersion: version.Satisfactory_version,
|
|
||||||
Targets: targets,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return smlVersions, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p FicsitProvider) ModVersionsWithDependencies(_ context.Context, modID string) ([]resolver.ModVersion, error) {
|
func (p FicsitProvider) ModVersionsWithDependencies(_ context.Context, modID string) ([]resolver.ModVersion, error) {
|
||||||
response, err := ficsit.GetAllModVersions(modID)
|
response, err := ficsit.GetAllModVersions(modID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -84,8 +57,8 @@ func (p FicsitProvider) ModVersionsWithDependencies(_ context.Context, modID str
|
||||||
targets := make([]resolver.Target, len(modVersion.Targets))
|
targets := make([]resolver.Target, len(modVersion.Targets))
|
||||||
for j, target := range modVersion.Targets {
|
for j, target := range modVersion.Targets {
|
||||||
targets[j] = resolver.Target{
|
targets[j] = resolver.Target{
|
||||||
VersionID: target.VersionID,
|
|
||||||
TargetName: resolver.TargetName(target.TargetName),
|
TargetName: resolver.TargetName(target.TargetName),
|
||||||
|
Link: viper.GetString("api-base") + target.Link,
|
||||||
Hash: target.Hash,
|
Hash: target.Hash,
|
||||||
Size: target.Size,
|
Size: target.Size,
|
||||||
}
|
}
|
||||||
|
@ -94,6 +67,7 @@ func (p FicsitProvider) ModVersionsWithDependencies(_ context.Context, modID str
|
||||||
modVersions[i] = resolver.ModVersion{
|
modVersions[i] = resolver.ModVersion{
|
||||||
ID: modVersion.ID,
|
ID: modVersion.ID,
|
||||||
Version: modVersion.Version,
|
Version: modVersion.Version,
|
||||||
|
GameVersion: modVersion.GameVersion,
|
||||||
Dependencies: dependencies,
|
Dependencies: dependencies,
|
||||||
Targets: targets,
|
Targets: targets,
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,10 +28,6 @@ func (p LocalProvider) Mods(_ context.Context, filter ficsit.ModFilter) (*ficsit
|
||||||
mods := make([]ficsit.ModsModsGetModsModsMod, 0)
|
mods := make([]ficsit.ModsModsGetModsModsMod, 0)
|
||||||
|
|
||||||
cachedMods.Range(func(modReference string, files []cache.File) bool {
|
cachedMods.Range(func(modReference string, files []cache.File) bool {
|
||||||
if modReference == "SML" {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(filter.References) > 0 {
|
if len(filter.References) > 0 {
|
||||||
skip := true
|
skip := true
|
||||||
|
|
||||||
|
@ -127,25 +123,6 @@ func (p LocalProvider) GetMod(_ context.Context, modReference string) (*ficsit.G
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p LocalProvider) SMLVersions(_ context.Context) ([]resolver.SMLVersion, error) {
|
|
||||||
cachedSMLFiles, err := cache.GetCacheMod("SML")
|
|
||||||
if err != nil {
|
|
||||||
return nil, fmt.Errorf("failed to get cache: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
smlVersions := make([]resolver.SMLVersion, 0)
|
|
||||||
|
|
||||||
for _, smlFile := range cachedSMLFiles {
|
|
||||||
smlVersions = append(smlVersions, resolver.SMLVersion{
|
|
||||||
ID: "SML:" + smlFile.Plugin.SemVersion,
|
|
||||||
Version: smlFile.Plugin.SemVersion,
|
|
||||||
SatisfactoryVersion: 0, // TODO: where can this be obtained from?
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return smlVersions, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p LocalProvider) ModVersionsWithDependencies(_ context.Context, modID string) ([]resolver.ModVersion, error) {
|
func (p LocalProvider) ModVersionsWithDependencies(_ context.Context, modID string) ([]resolver.ModVersion, error) {
|
||||||
cachedModFiles, err := cache.GetCacheMod(modID)
|
cachedModFiles, err := cache.GetCacheMod(modID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -156,8 +133,9 @@ func (p LocalProvider) ModVersionsWithDependencies(_ context.Context, modID stri
|
||||||
|
|
||||||
for _, modFile := range cachedModFiles {
|
for _, modFile := range cachedModFiles {
|
||||||
versions = append(versions, resolver.ModVersion{
|
versions = append(versions, resolver.ModVersion{
|
||||||
ID: modID + ":" + modFile.Plugin.SemVersion,
|
ID: modID + ":" + modFile.Plugin.SemVersion,
|
||||||
Version: modFile.Plugin.SemVersion,
|
Version: modFile.Plugin.SemVersion,
|
||||||
|
GameVersion: modFile.Plugin.GameVersion,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,13 +36,6 @@ func (p MixedProvider) GetMod(context context.Context, modReference string) (*fi
|
||||||
return p.onlineProvider.GetMod(context, modReference)
|
return p.onlineProvider.GetMod(context, modReference)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p MixedProvider) SMLVersions(context context.Context) ([]resolver.SMLVersion, error) {
|
|
||||||
if p.Offline {
|
|
||||||
return p.offlineProvider.SMLVersions(context) // nolint
|
|
||||||
}
|
|
||||||
return p.onlineProvider.SMLVersions(context) // nolint
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p MixedProvider) ModVersionsWithDependencies(context context.Context, modID string) ([]resolver.ModVersion, error) {
|
func (p MixedProvider) ModVersionsWithDependencies(context context.Context, modID string) ([]resolver.ModVersion, error) {
|
||||||
if p.Offline {
|
if p.Offline {
|
||||||
return p.offlineProvider.ModVersionsWithDependencies(context, modID) // nolint
|
return p.offlineProvider.ModVersionsWithDependencies(context, modID) // nolint
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package cli
|
package cli
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"math"
|
"math"
|
||||||
"os"
|
"os"
|
||||||
|
@ -9,7 +8,6 @@ import (
|
||||||
|
|
||||||
"github.com/MarvinJWendt/testza"
|
"github.com/MarvinJWendt/testza"
|
||||||
resolver "github.com/satisfactorymodding/ficsit-resolver"
|
resolver "github.com/satisfactorymodding/ficsit-resolver"
|
||||||
"github.com/spf13/viper"
|
|
||||||
|
|
||||||
"github.com/satisfactorymodding/ficsit-cli/cfg"
|
"github.com/satisfactorymodding/ficsit-cli/cfg"
|
||||||
)
|
)
|
||||||
|
@ -43,9 +41,9 @@ func TestUpdateMods(t *testing.T) {
|
||||||
|
|
||||||
ctx.Provider = MockProvider{}
|
ctx.Provider = MockProvider{}
|
||||||
|
|
||||||
depResolver := resolver.NewDependencyResolver(ctx.Provider, viper.GetString("api-base"))
|
depResolver := resolver.NewDependencyResolver(ctx.Provider)
|
||||||
|
|
||||||
oldLockfile, err := depResolver.ResolveModDependencies(context.Background(), map[string]string{
|
oldLockfile, err := depResolver.ResolveModDependencies(map[string]string{
|
||||||
"FicsitRemoteMonitoring": "0.9.8",
|
"FicsitRemoteMonitoring": "0.9.8",
|
||||||
}, nil, math.MaxInt, nil)
|
}, nil, math.MaxInt, nil)
|
||||||
|
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
# @genqlient(omitempty: true)
|
|
||||||
query SMLVersions {
|
|
||||||
smlVersions: getSMLVersions(filter: {limit: 100}) {
|
|
||||||
count
|
|
||||||
sml_versions {
|
|
||||||
id
|
|
||||||
version
|
|
||||||
satisfactory_version
|
|
||||||
targets {
|
|
||||||
targetName
|
|
||||||
link
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
106
ficsit/types.go
106
ficsit/types.go
|
@ -675,72 +675,6 @@ const (
|
||||||
OrderDesc Order = "desc"
|
OrderDesc Order = "desc"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SMLVersionsResponse is returned by SMLVersions on success.
|
|
||||||
type SMLVersionsResponse struct {
|
|
||||||
SmlVersions SMLVersionsSmlVersionsGetSMLVersions `json:"smlVersions"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSmlVersions returns SMLVersionsResponse.SmlVersions, and is useful for accessing the field via an interface.
|
|
||||||
func (v *SMLVersionsResponse) GetSmlVersions() SMLVersionsSmlVersionsGetSMLVersions {
|
|
||||||
return v.SmlVersions
|
|
||||||
}
|
|
||||||
|
|
||||||
// SMLVersionsSmlVersionsGetSMLVersions includes the requested fields of the GraphQL type GetSMLVersions.
|
|
||||||
type SMLVersionsSmlVersionsGetSMLVersions struct {
|
|
||||||
Count int `json:"count"`
|
|
||||||
Sml_versions []SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersion `json:"sml_versions"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetCount returns SMLVersionsSmlVersionsGetSMLVersions.Count, and is useful for accessing the field via an interface.
|
|
||||||
func (v *SMLVersionsSmlVersionsGetSMLVersions) GetCount() int { return v.Count }
|
|
||||||
|
|
||||||
// GetSml_versions returns SMLVersionsSmlVersionsGetSMLVersions.Sml_versions, and is useful for accessing the field via an interface.
|
|
||||||
func (v *SMLVersionsSmlVersionsGetSMLVersions) GetSml_versions() []SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersion {
|
|
||||||
return v.Sml_versions
|
|
||||||
}
|
|
||||||
|
|
||||||
// SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersion includes the requested fields of the GraphQL type SMLVersion.
|
|
||||||
type SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersion struct {
|
|
||||||
Id string `json:"id"`
|
|
||||||
Version string `json:"version"`
|
|
||||||
Satisfactory_version int `json:"satisfactory_version"`
|
|
||||||
Targets []SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersionTargetsSMLVersionTarget `json:"targets"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetId returns SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersion.Id, and is useful for accessing the field via an interface.
|
|
||||||
func (v *SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersion) GetId() string { return v.Id }
|
|
||||||
|
|
||||||
// GetVersion returns SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersion.Version, and is useful for accessing the field via an interface.
|
|
||||||
func (v *SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersion) GetVersion() string {
|
|
||||||
return v.Version
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSatisfactory_version returns SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersion.Satisfactory_version, and is useful for accessing the field via an interface.
|
|
||||||
func (v *SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersion) GetSatisfactory_version() int {
|
|
||||||
return v.Satisfactory_version
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetTargets returns SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersion.Targets, and is useful for accessing the field via an interface.
|
|
||||||
func (v *SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersion) GetTargets() []SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersionTargetsSMLVersionTarget {
|
|
||||||
return v.Targets
|
|
||||||
}
|
|
||||||
|
|
||||||
// SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersionTargetsSMLVersionTarget includes the requested fields of the GraphQL type SMLVersionTarget.
|
|
||||||
type SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersionTargetsSMLVersionTarget struct {
|
|
||||||
TargetName TargetName `json:"targetName"`
|
|
||||||
Link string `json:"link"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetTargetName returns SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersionTargetsSMLVersionTarget.TargetName, and is useful for accessing the field via an interface.
|
|
||||||
func (v *SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersionTargetsSMLVersionTarget) GetTargetName() TargetName {
|
|
||||||
return v.TargetName
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetLink returns SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersionTargetsSMLVersionTarget.Link, and is useful for accessing the field via an interface.
|
|
||||||
func (v *SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersionTargetsSMLVersionTarget) GetLink() string {
|
|
||||||
return v.Link
|
|
||||||
}
|
|
||||||
|
|
||||||
type TargetName string
|
type TargetName string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -1267,46 +1201,6 @@ func Mods(
|
||||||
return &data, err
|
return &data, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// The query or mutation executed by SMLVersions.
|
|
||||||
const SMLVersions_Operation = `
|
|
||||||
query SMLVersions {
|
|
||||||
smlVersions: getSMLVersions(filter: {limit:100}) {
|
|
||||||
count
|
|
||||||
sml_versions {
|
|
||||||
id
|
|
||||||
version
|
|
||||||
satisfactory_version
|
|
||||||
targets {
|
|
||||||
targetName
|
|
||||||
link
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`
|
|
||||||
|
|
||||||
func SMLVersions(
|
|
||||||
ctx context.Context,
|
|
||||||
client graphql.Client,
|
|
||||||
) (*SMLVersionsResponse, error) {
|
|
||||||
req := &graphql.Request{
|
|
||||||
OpName: "SMLVersions",
|
|
||||||
Query: SMLVersions_Operation,
|
|
||||||
}
|
|
||||||
var err error
|
|
||||||
|
|
||||||
var data SMLVersionsResponse
|
|
||||||
resp := &graphql.Response{Data: &data}
|
|
||||||
|
|
||||||
err = client.MakeRequest(
|
|
||||||
ctx,
|
|
||||||
req,
|
|
||||||
resp,
|
|
||||||
)
|
|
||||||
|
|
||||||
return &data, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// The query or mutation executed by Version.
|
// The query or mutation executed by Version.
|
||||||
const Version_Operation = `
|
const Version_Operation = `
|
||||||
query Version ($modId: String!, $version: String!) {
|
query Version ($modId: String!, $version: String!) {
|
||||||
|
|
|
@ -9,6 +9,7 @@ type AllVersionsResponse struct {
|
||||||
type ModVersion struct {
|
type ModVersion struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
Version string `json:"version"`
|
Version string `json:"version"`
|
||||||
|
GameVersion string `json:"game_version"`
|
||||||
Dependencies []Dependency `json:"dependencies"`
|
Dependencies []Dependency `json:"dependencies"`
|
||||||
Targets []Target `json:"targets"`
|
Targets []Target `json:"targets"`
|
||||||
}
|
}
|
||||||
|
@ -22,6 +23,7 @@ type Dependency struct {
|
||||||
type Target struct {
|
type Target struct {
|
||||||
VersionID string `json:"version_id"`
|
VersionID string `json:"version_id"`
|
||||||
TargetName string `json:"target_name"`
|
TargetName string `json:"target_name"`
|
||||||
|
Link string `json:"link"`
|
||||||
Hash string `json:"hash"`
|
Hash string `json:"hash"`
|
||||||
Size int64 `json:"size"`
|
Size int64 `json:"size"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,8 +17,6 @@ bindings:
|
||||||
type: string
|
type: string
|
||||||
GuideID:
|
GuideID:
|
||||||
type: string
|
type: string
|
||||||
SMLVersionID:
|
|
||||||
type: string
|
|
||||||
Date:
|
Date:
|
||||||
type: time.Time
|
type: time.Time
|
||||||
unmarshaler: github.com/satisfactorymodding/ficsit-cli/ficsit/utils.UnmarshalDateTime
|
unmarshaler: github.com/satisfactorymodding/ficsit-cli/ficsit/utils.UnmarshalDateTime
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -25,7 +25,7 @@ require (
|
||||||
github.com/puzpuzpuz/xsync/v3 v3.0.2
|
github.com/puzpuzpuz/xsync/v3 v3.0.2
|
||||||
github.com/sahilm/fuzzy v0.1.1-0.20230530133925-c48e322e2a8f
|
github.com/sahilm/fuzzy v0.1.1-0.20230530133925-c48e322e2a8f
|
||||||
github.com/samber/slog-multi v1.0.2
|
github.com/samber/slog-multi v1.0.2
|
||||||
github.com/satisfactorymodding/ficsit-resolver v0.0.2
|
github.com/satisfactorymodding/ficsit-resolver v0.0.3
|
||||||
github.com/spf13/cobra v1.8.0
|
github.com/spf13/cobra v1.8.0
|
||||||
github.com/spf13/viper v1.18.1
|
github.com/spf13/viper v1.18.1
|
||||||
goftp.io/server/v2 v2.0.1
|
goftp.io/server/v2 v2.0.1
|
||||||
|
|
4
go.sum
4
go.sum
|
@ -205,8 +205,8 @@ github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM=
|
||||||
github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA=
|
github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA=
|
||||||
github.com/samber/slog-multi v1.0.2 h1:6BVH9uHGAsiGkbbtQgAOQJMpKgV8unMrHhhJaw+X1EQ=
|
github.com/samber/slog-multi v1.0.2 h1:6BVH9uHGAsiGkbbtQgAOQJMpKgV8unMrHhhJaw+X1EQ=
|
||||||
github.com/samber/slog-multi v1.0.2/go.mod h1:uLAvHpGqbYgX4FSL0p1ZwoLuveIAJvBECtE07XmYvFo=
|
github.com/samber/slog-multi v1.0.2/go.mod h1:uLAvHpGqbYgX4FSL0p1ZwoLuveIAJvBECtE07XmYvFo=
|
||||||
github.com/satisfactorymodding/ficsit-resolver v0.0.2 h1:dj/OsDLpaMUqCHpfBVHvDMUv2nf5gT4HS2ydBMkmtcQ=
|
github.com/satisfactorymodding/ficsit-resolver v0.0.3 h1:Q+BV1w1S42accsHbew9BmwcYdbAtSYfeVlQpRJiBhGg=
|
||||||
github.com/satisfactorymodding/ficsit-resolver v0.0.2/go.mod h1:ckKMmMvDoYbbkEbWXEsMes608uvv6EKphXPhHX8LKSc=
|
github.com/satisfactorymodding/ficsit-resolver v0.0.3/go.mod h1:ckKMmMvDoYbbkEbWXEsMes608uvv6EKphXPhHX8LKSc=
|
||||||
github.com/sebdah/goldie/v2 v2.5.3 h1:9ES/mNN+HNUbNWpVAlrzuZ7jE+Nrczbj8uFRjM7624Y=
|
github.com/sebdah/goldie/v2 v2.5.3 h1:9ES/mNN+HNUbNWpVAlrzuZ7jE+Nrczbj8uFRjM7624Y=
|
||||||
github.com/sebdah/goldie/v2 v2.5.3/go.mod h1:oZ9fp0+se1eapSRjfYbsV/0Hqhbuu3bJVvKI/NNtssI=
|
github.com/sebdah/goldie/v2 v2.5.3/go.mod h1:oZ9fp0+se1eapSRjfYbsV/0Hqhbuu3bJVvKI/NNtssI=
|
||||||
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
|
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
|
||||||
|
|
|
@ -3,6 +3,7 @@ package components
|
||||||
import (
|
import (
|
||||||
"github.com/Khan/genqlient/graphql"
|
"github.com/Khan/genqlient/graphql"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
|
resolver "github.com/satisfactorymodding/ficsit-resolver"
|
||||||
|
|
||||||
"github.com/satisfactorymodding/ficsit-cli/cli"
|
"github.com/satisfactorymodding/ficsit-cli/cli"
|
||||||
"github.com/satisfactorymodding/ficsit-cli/cli/provider"
|
"github.com/satisfactorymodding/ficsit-cli/cli/provider"
|
||||||
|
@ -19,6 +20,7 @@ type RootModel interface {
|
||||||
|
|
||||||
GetAPIClient() graphql.Client
|
GetAPIClient() graphql.Client
|
||||||
GetProvider() provider.Provider
|
GetProvider() provider.Provider
|
||||||
|
GetResolver() resolver.DependencyResolver
|
||||||
|
|
||||||
Size() tea.WindowSizeMsg
|
Size() tea.WindowSizeMsg
|
||||||
SetSize(size tea.WindowSizeMsg)
|
SetSize(size tea.WindowSizeMsg)
|
||||||
|
|
|
@ -7,7 +7,6 @@ import (
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
resolver "github.com/satisfactorymodding/ficsit-resolver"
|
resolver "github.com/satisfactorymodding/ficsit-resolver"
|
||||||
"github.com/spf13/viper"
|
|
||||||
|
|
||||||
"github.com/satisfactorymodding/ficsit-cli/cli"
|
"github.com/satisfactorymodding/ficsit-cli/cli"
|
||||||
"github.com/satisfactorymodding/ficsit-cli/cli/provider"
|
"github.com/satisfactorymodding/ficsit-cli/cli/provider"
|
||||||
|
@ -29,7 +28,7 @@ func newModel(global *cli.GlobalContext) *rootModel {
|
||||||
Width: 20,
|
Width: 20,
|
||||||
Height: 14,
|
Height: 14,
|
||||||
},
|
},
|
||||||
dependencyResolver: resolver.NewDependencyResolver(global.Provider, viper.GetString("api-base")),
|
dependencyResolver: resolver.NewDependencyResolver(global.Provider),
|
||||||
}
|
}
|
||||||
|
|
||||||
m.headerComponent = components.NewHeaderComponent(m)
|
m.headerComponent = components.NewHeaderComponent(m)
|
||||||
|
@ -71,6 +70,10 @@ func (m *rootModel) GetProvider() provider.Provider {
|
||||||
return m.global.Provider
|
return m.global.Provider
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *rootModel) GetResolver() resolver.DependencyResolver {
|
||||||
|
return m.dependencyResolver
|
||||||
|
}
|
||||||
|
|
||||||
func (m *rootModel) Size() tea.WindowSizeMsg {
|
func (m *rootModel) Size() tea.WindowSizeMsg {
|
||||||
return m.currentSize
|
return m.currentSize
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,6 @@ import (
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
"github.com/muesli/reflow/truncate"
|
"github.com/muesli/reflow/truncate"
|
||||||
resolver "github.com/satisfactorymodding/ficsit-resolver"
|
|
||||||
"github.com/spf13/viper"
|
|
||||||
|
|
||||||
"github.com/satisfactorymodding/ficsit-cli/ficsit"
|
"github.com/satisfactorymodding/ficsit-cli/ficsit"
|
||||||
"github.com/satisfactorymodding/ficsit-cli/tea/components"
|
"github.com/satisfactorymodding/ficsit-cli/tea/components"
|
||||||
|
@ -112,9 +110,7 @@ func (m updateModsList) LoadModData() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
resolver := resolver.NewDependencyResolver(m.root.GetProvider(), viper.GetString("api-base"))
|
updatedLockfile, err := currentProfile.Resolve(m.root.GetResolver(), nil, gameVersion)
|
||||||
|
|
||||||
updatedLockfile, err := currentProfile.Resolve(resolver, nil, gameVersion)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue