X Tutup
Skip to content

Commit 426c8da

Browse files
Introduce Launch.GetTargets, revamp launch flow in general
1 parent deaee84 commit 426c8da

File tree

26 files changed

+756
-738
lines changed

26 files changed

+756
-738
lines changed

butlerd/generous/docs/README.md

Lines changed: 132 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5385,7 +5385,7 @@ sandbox is set up (if enabled), and the game is actually running.</p>
53855385
</p>
53865386
</div>
53875387

5388-
### <em class="request-client-caller"></em>Launch.GetCandidates
5388+
### <em class="request-client-caller"></em>Launch.GetTargets
53895389

53905390

53915391

@@ -5398,14 +5398,14 @@ sandbox is set up (if enabled), and the game is actually running.</p>
53985398
<tr>
53995399
<td><code>caveId</code></td>
54005400
<td><code class="typename"><span class="type builtin-type">string</span></code></td>
5401-
<td><p>The ID of the cave to retrieve the launch candidates of</p>
5401+
<td><p>The ID of the cave to retrieve the launch targets of</p>
54025402
</td>
54035403
</tr>
54045404
<tr>
54055405
<td><code>nonNativePlatforms</code></td>
54065406
<td><code class="typename"><span class="type builtin-type">Platform</span>[]</code></td>
54075407
<td><p>A list of platforms that should be included when looking
5408-
for candidates, even though they&rsquo;re not the current platform.</p>
5408+
for launch targets, even though they&rsquo;re not the current platform.</p>
54095409
</td>
54105410
</tr>
54115411
</table>
@@ -5419,16 +5419,16 @@ for candidates, even though they&rsquo;re not the current platform.</p>
54195419

54205420
<table class="field-table">
54215421
<tr>
5422-
<td><code>candidates</code></td>
5423-
<td><code class="typename"><span class="type struct-type" data-tip-selector="#Candidate__TypeHint">Candidate</span>[]</code></td>
5424-
<td><p>All launch candidates found</p>
5422+
<td><code>targets</code></td>
5423+
<td><code class="typename"><span class="type struct-type" data-tip-selector="#LaunchTarget__TypeHint">LaunchTarget</span>[]</code></td>
5424+
<td><p>All launch targets found</p>
54255425
</td>
54265426
</tr>
54275427
</table>
54285428

54295429

5430-
<div id="LaunchGetCandidatesParams__TypeHint" style="display: none;" class="tip-content">
5431-
<p><em class="request-client-caller"></em>Launch.GetCandidates <a href="#/?id=launchgetcandidates">(Go to definition)</a></p>
5430+
<div id="LaunchGetTargetsParams__TypeHint" style="display: none;" class="tip-content">
5431+
<p><em class="request-client-caller"></em>Launch.GetTargets <a href="#/?id=launchgettargets">(Go to definition)</a></p>
54325432

54335433

54345434
<table class="field-table">
@@ -5445,14 +5445,14 @@ for candidates, even though they&rsquo;re not the current platform.</p>
54455445
</div>
54465446

54475447

5448-
<div id="LaunchGetCandidatesResult__TypeHint" style="display: none;" class="tip-content">
5449-
<p>LaunchGetCandidates <a href="#/?id=launchgetcandidates">(Go to definition)</a></p>
5448+
<div id="LaunchGetTargetsResult__TypeHint" style="display: none;" class="tip-content">
5449+
<p>LaunchGetTargets <a href="#/?id=launchgettargets">(Go to definition)</a></p>
54505450

54515451

54525452
<table class="field-table">
54535453
<tr>
5454-
<td><code>candidates</code></td>
5455-
<td><code class="typename"><span class="type struct-type">Candidate</span>[]</code></td>
5454+
<td><code>targets</code></td>
5455+
<td><code class="typename"><span class="type struct-type">LaunchTarget</span>[]</code></td>
54565456
</tr>
54575457
</table>
54585458

@@ -8291,6 +8291,125 @@ can be part of an issue report if something goes wrong.</p>
82918291

82928292
</div>
82938293

8294+
### Cursor
8295+
8296+
8297+
Type alias for string
8298+
8299+
<div id="Cursor__TypeHint" style="display: none;" class="tip-content">
8300+
<p>Cursor <a href="#/?id=cursor">(Go to definition)</a></p>
8301+
</div>
8302+
8303+
### <em class="struct-type"></em>LaunchTarget
8304+
8305+
8306+
8307+
<p>
8308+
<span class="header">Fields</span>
8309+
</p>
8310+
8311+
8312+
<table class="field-table">
8313+
<tr>
8314+
<td><code>action</code></td>
8315+
<td><code class="typename"><span class="type struct-type" data-tip-selector="#Action__TypeHint">Action</span></code></td>
8316+
<td><p>The manifest action corresponding to this launch target.
8317+
For implicit launch targets, a minimal one will be generated.</p>
8318+
</td>
8319+
</tr>
8320+
<tr>
8321+
<td><code>platform</code></td>
8322+
<td><code class="typename"><span class="type builtin-type">Platform</span></code></td>
8323+
<td><p>Platform this launch target was found for</p>
8324+
</td>
8325+
</tr>
8326+
<tr>
8327+
<td><code>strategy</code></td>
8328+
<td><code class="typename"><span class="type struct-type" data-tip-selector="#StrategyResult__TypeHint">Strategy</span></code></td>
8329+
<td><p>Detailed launch strategy</p>
8330+
</td>
8331+
</tr>
8332+
</table>
8333+
8334+
8335+
<div id="LaunchTarget__TypeHint" style="display: none;" class="tip-content">
8336+
<p><em class="struct-type"></em>LaunchTarget <a href="#/?id=launchtarget">(Go to definition)</a></p>
8337+
8338+
8339+
<table class="field-table">
8340+
<tr>
8341+
<td><code>action</code></td>
8342+
<td><code class="typename"><span class="type struct-type">Action</span></code></td>
8343+
</tr>
8344+
<tr>
8345+
<td><code>platform</code></td>
8346+
<td><code class="typename"><span class="type builtin-type">Platform</span></code></td>
8347+
</tr>
8348+
<tr>
8349+
<td><code>strategy</code></td>
8350+
<td><code class="typename"><span class="type struct-type">Strategy</span></code></td>
8351+
</tr>
8352+
</table>
8353+
8354+
</div>
8355+
8356+
### <em class="enum-type"></em>LaunchStrategy
8357+
8358+
8359+
8360+
<p>
8361+
<span class="header">Values</span>
8362+
</p>
8363+
8364+
8365+
<table class="field-table">
8366+
<tr>
8367+
<td><code>""</code></td>
8368+
<td></td>
8369+
</tr>
8370+
<tr>
8371+
<td><code>"native"</code></td>
8372+
<td></td>
8373+
</tr>
8374+
<tr>
8375+
<td><code>"html"</code></td>
8376+
<td></td>
8377+
</tr>
8378+
<tr>
8379+
<td><code>"url"</code></td>
8380+
<td></td>
8381+
</tr>
8382+
<tr>
8383+
<td><code>"shell"</code></td>
8384+
<td></td>
8385+
</tr>
8386+
</table>
8387+
8388+
8389+
<div id="LaunchStrategy__TypeHint" style="display: none;" class="tip-content">
8390+
<p><em class="enum-type"></em>LaunchStrategy <a href="#/?id=launchstrategy">(Go to definition)</a></p>
8391+
8392+
8393+
<table class="field-table">
8394+
<tr>
8395+
<td><code>""</code></td>
8396+
</tr>
8397+
<tr>
8398+
<td><code>"native"</code></td>
8399+
</tr>
8400+
<tr>
8401+
<td><code>"html"</code></td>
8402+
</tr>
8403+
<tr>
8404+
<td><code>"url"</code></td>
8405+
</tr>
8406+
<tr>
8407+
<td><code>"shell"</code></td>
8408+
</tr>
8409+
</table>
8410+
8411+
</div>
8412+
82948413
### <em class="struct-type"></em>Manifest
82958414

82968415

@@ -8405,7 +8524,7 @@ can be taken while launching a game.</p>
84058524
<tr>
84068525
<td><code>platform</code></td>
84078526
<td><code class="typename"><span class="type builtin-type">Platform</span></code></td>
8408-
<td><p>platform to restrict this action too</p>
8527+
<td><p>platform to restrict this action to</p>
84098528
</td>
84108529
</tr>
84118530
<tr>
@@ -8532,15 +8651,6 @@ can be taken while launching a game.</p>
85328651

85338652
</div>
85348653

8535-
### Cursor
8536-
8537-
8538-
Type alias for string
8539-
8540-
<div id="Cursor__TypeHint" style="display: none;" class="tip-content">
8541-
<p>Cursor <a href="#/?id=cursor">(Go to definition)</a></p>
8542-
</div>
8543-
85448654
### <em class="struct-type"></em>User
85458655

85468656

butlerd/generous/docsgen.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ func (bc *generousContext) generateDocs() error {
1414

1515
scope := newScope(bc)
1616
must(scope.assimilate("github.com/itchio/butler/butlerd", "types.go"))
17+
must(scope.assimilate("github.com/itchio/butler/butlerd", "types_launch.go"))
18+
must(scope.assimilate("github.com/itchio/butler/endpoints/launch/manifest", "manifest.go"))
1719
must(scope.assimilate("github.com/itchio/go-itchio", "types.go"))
1820
must(scope.assimilate("github.com/itchio/dash", "types.go"))
1921
must(scope.assimilate("github.com/itchio/butler/installer/bfs", "receipt.go"))

butlerd/generous/spec/butlerd.json

Lines changed: 6 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,29 +1664,29 @@
16641664
}
16651665
},
16661666
{
1667-
"method": "Launch.GetCandidates",
1667+
"method": "Launch.GetTargets",
16681668
"doc": "",
16691669
"caller": "client",
16701670
"params": {
16711671
"fields": [
16721672
{
16731673
"name": "caveId",
1674-
"doc": "The ID of the cave to retrieve the launch candidates of",
1674+
"doc": "The ID of the cave to retrieve the launch targets of",
16751675
"type": "string"
16761676
},
16771677
{
16781678
"name": "nonNativePlatforms",
1679-
"doc": "A list of platforms that should be included when looking\nfor candidates, even though they're not the current platform.",
1679+
"doc": "A list of platforms that should be included when looking\nfor launch targets, even though they're not the current platform.",
16801680
"type": "Platform[]"
16811681
}
16821682
]
16831683
},
16841684
"result": {
16851685
"fields": [
16861686
{
1687-
"name": "candidates",
1688-
"doc": "All launch candidates found",
1689-
"type": "Candidate[]"
1687+
"name": "targets",
1688+
"doc": "All launch targets found",
1689+
"type": "LaunchTarget[]"
16901690
}
16911691
]
16921692
}
@@ -2735,95 +2735,6 @@
27352735
}
27362736
]
27372737
},
2738-
{
2739-
"name": "Manifest",
2740-
"doc": "A Manifest describes prerequisites (dependencies) and actions that\ncan be taken while launching a game.",
2741-
"fields": [
2742-
{
2743-
"name": "actions",
2744-
"doc": "Actions are a list of options to give the user when launching a game.",
2745-
"type": "Action[]"
2746-
},
2747-
{
2748-
"name": "prereqs",
2749-
"doc": "Prereqs describe libraries or frameworks that must be installed\nprior to launching a game",
2750-
"type": "Prereq[]"
2751-
}
2752-
]
2753-
},
2754-
{
2755-
"name": "Action",
2756-
"doc": "An Action is a choice for the user to pick when launching a game.\n\nsee https://itch.io/docs/itch/integrating/manifest.html",
2757-
"fields": [
2758-
{
2759-
"name": "name",
2760-
"doc": "human-readable or standard name",
2761-
"type": "string"
2762-
},
2763-
{
2764-
"name": "path",
2765-
"doc": "file path (relative to manifest or absolute), URL, etc.",
2766-
"type": "string"
2767-
},
2768-
{
2769-
"name": "icon",
2770-
"doc": "icon name (see static/fonts/icomoon/demo.html, don't include `icon-` prefix)",
2771-
"type": "string"
2772-
},
2773-
{
2774-
"name": "args",
2775-
"doc": "command-line arguments",
2776-
"type": "string[]"
2777-
},
2778-
{
2779-
"name": "sandbox",
2780-
"doc": "sandbox opt-in",
2781-
"type": "boolean"
2782-
},
2783-
{
2784-
"name": "scope",
2785-
"doc": "requested API scope",
2786-
"type": "string"
2787-
},
2788-
{
2789-
"name": "console",
2790-
"doc": "don't redirect stdout/stderr, open in new console window",
2791-
"type": "boolean"
2792-
},
2793-
{
2794-
"name": "platform",
2795-
"doc": "platform to restrict this action too",
2796-
"type": "Platform"
2797-
},
2798-
{
2799-
"name": "locales",
2800-
"doc": "localized action name",
2801-
"type": "{ [key: string]: ActionLocale }"
2802-
}
2803-
]
2804-
},
2805-
{
2806-
"name": "Prereq",
2807-
"doc": "",
2808-
"fields": [
2809-
{
2810-
"name": "name",
2811-
"doc": "A prerequisite to be installed, see \u003chttps://itch.io/docs/itch/integrating/prereqs/\u003e for the full list.",
2812-
"type": "string"
2813-
}
2814-
]
2815-
},
2816-
{
2817-
"name": "ActionLocale",
2818-
"doc": "",
2819-
"fields": [
2820-
{
2821-
"name": "name",
2822-
"doc": "A localized action name",
2823-
"type": "string"
2824-
}
2825-
]
2826-
},
28272738
{
28282739
"name": "User",
28292740
"doc": "User represents an itch.io account, with basic profile info",

0 commit comments

Comments
 (0)
X Tutup