Skip to content

Commit 4fc3030

Browse files
authored
Merge pull request #2887 from Flow-Launcher/dev
Release 1.19.0 | Plugin 4.4.0
2 parents 7ea5c68 + eec252e commit 4fc3030

File tree

373 files changed

+21055
-12615
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

373 files changed

+21055
-12615
lines changed

.cm/gitstream.cm

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# -*- mode: yaml -*-
2+
# This example configuration for provides basic automations to get started with gitStream.
3+
# View the gitStream quickstart for more examples: https://docs.gitstream.cm/examples/
4+
manifest:
5+
version: 1.0
6+
7+
8+
triggers:
9+
exclude:
10+
branch:
11+
- l10n_dev
12+
- dev
13+
14+
15+
automations:
16+
# Add a label that indicates how many minutes it will take to review the PR.
17+
estimated_time_to_review:
18+
if:
19+
- true
20+
run:
21+
- action: add-label@v1
22+
args:
23+
label: "{{ calc.etr }} min review"
24+
color: {{ colors.red if (calc.etr >= 20) else ( colors.yellow if (calc.etr >= 5) else colors.green ) }}
25+
# Post a comment that lists the best experts for the files that were modified.
26+
explain_code_experts:
27+
if:
28+
- true
29+
run:
30+
- action: explain-code-experts@v1
31+
args:
32+
gt: 10
33+
# Post a comment notifying that the PR contains a TODO statement.
34+
review_todo_comments:
35+
if:
36+
- {{ source.diff.files | matchDiffLines(regex=r/^[+].*\b(TODO|todo)\b/) | some }}
37+
run:
38+
- action: add-comment@v1
39+
args:
40+
comment: |
41+
This PR contains a TODO statement. Please check to see if they should be removed.
42+
# Post a comment that request a before and after screenshot
43+
request_screenshot:
44+
# Triggered for PRs that lack an image file or link to an image in the PR description
45+
if:
46+
- {{ not (has.screenshot_link or has.image_uploaded) }}
47+
run:
48+
- action: add-comment@v1
49+
args:
50+
comment: |
51+
Be a legend :trophy: by adding a before and after screenshot of the changes you made, especially if they are around UI/UX.
52+
53+
54+
# +----------------------------------------------------------------------------+
55+
# | Custom Expressions |
56+
# | https://docs.gitstream.cm/how-it-works/#custom-expressions |
57+
# +----------------------------------------------------------------------------+
58+
59+
calc:
60+
etr: {{ branch | estimatedReviewTime }}
61+
62+
colors:
63+
red: 'b60205'
64+
yellow: 'fbca04'
65+
green: '0e8a16'
66+
67+
changes:
68+
# Sum all the lines added/edited in the PR
69+
additions: {{ branch.diff.files_metadata | map(attr='additions') | sum }}
70+
# Sum all the line removed in the PR
71+
deletions: {{ branch.diff.files_metadata | map(attr='deletions') | sum }}
72+
# Calculate the ratio of new code
73+
ratio: {{ (changes.additions / (changes.additions + changes.deletions)) * 100 | round(2) }}
74+
75+
has:
76+
screenshot_link: {{ pr.description | includes(regex=r/!\[.*\]\(.*(jpg|svg|png|gif|psd).*\)/) }}
77+
image_uploaded: {{ pr.description | includes(regex=r/(<img.*src.*(jpg|svg|png|gif|psd).*>)|!\[image\]\(.*github\.com.*\)/) }}

.github/actions/spelling/allow.txt

+3
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ https
33
ssh
44
ubuntu
55
runcount
6+
Firefox
7+
Português
8+
Português (Brasil)

.github/actions/spelling/expect.txt

+3
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ WCA_ACCENT_POLICY
7474
HGlobal
7575
dopusrt
7676
firefox
77+
Firefox
7778
msedge
7879
svgc
7980
ime
@@ -97,6 +98,8 @@ Português
9798
Português (Brasil)
9899
Italiano
99100
Slovenský
101+
quicklook
102+
Tiếng Việt
100103
Droplex
101104
Preinstalled
102105
errormetadatafile

.github/pr-labeler.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# The bot always updates the labels, add/remove as necessary [default: false]
2+
alwaysReplace: false
3+
# Treats the text and labels as case sensitive [default: true]
4+
caseSensitive: false
5+
# Array of labels to be applied to the PR [default: []]
6+
customLabels:
7+
# Finds the `text` within the PR title and body and applies the `label`
8+
- text: 'bug'
9+
label: 'bug'
10+
- text: 'fix'
11+
label: 'bug'
12+
- text: 'dependabot'
13+
label: 'bug'
14+
- text: 'New Crowdin updates'
15+
label: 'bug'
16+
- text: 'New Crowdin updates'
17+
label: 'kind/i18n'
18+
- text: 'feature'
19+
label: 'enhancement'
20+
- text: 'add new'
21+
label: 'enhancement'
22+
- text: 'refactor'
23+
label: 'enhancement'
24+
- text: 'refactor'
25+
label: 'Code Refactor'
26+
# Search the body of the PR for the `text` [default: true]
27+
searchBody: true
28+
# Search the title of the PR for the `text` [default: true]
29+
searchTitle: true
30+
# Search for whole words only [default: false]
31+
wholeWords: false

.github/workflows/gitstream.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Code generated by gitStream GitHub app - DO NOT EDIT
2+
3+
name: gitStream workflow automation
4+
run-name: |
5+
/:\ gitStream: PR #${{ fromJSON(fromJSON(github.event.inputs.client_payload)).pullRequestNumber }} from ${{ github.event.inputs.full_repository }}
6+
7+
on:
8+
workflow_dispatch:
9+
inputs:
10+
client_payload:
11+
description: The Client payload
12+
required: true
13+
full_repository:
14+
description: the repository name include the owner in `owner/repo_name` format
15+
required: true
16+
head_ref:
17+
description: the head sha
18+
required: true
19+
base_ref:
20+
description: the base ref
21+
required: true
22+
installation_id:
23+
description: the installation id
24+
required: false
25+
resolver_url:
26+
description: the resolver url to pass results to
27+
required: true
28+
resolver_token:
29+
description: Optional resolver token for resolver service
30+
required: false
31+
default: ''
32+
33+
jobs:
34+
gitStream:
35+
timeout-minutes: 5
36+
runs-on: ubuntu-latest
37+
name: gitStream workflow automation
38+
steps:
39+
- name: Evaluate Rules
40+
uses: linear-b/gitstream-github-action@v2
41+
id: rules-engine
42+
with:
43+
full_repository: ${{ github.event.inputs.full_repository }}
44+
head_ref: ${{ github.event.inputs.head_ref }}
45+
base_ref: ${{ github.event.inputs.base_ref }}
46+
client_payload: ${{ github.event.inputs.client_payload }}
47+
installation_id: ${{ github.event.inputs.installation_id }}
48+
resolver_url: ${{ github.event.inputs.resolver_url }}
49+
resolver_token: ${{ github.event.inputs.resolver_token }}

.github/workflows/pr_assignee.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Assign PR to creator
2+
3+
# Due to GitHub token limitation, only able to assign org members not authors from forks.
4+
# https://github.com/thomaseizinger/assign-pr-creator-action/issues/3
5+
6+
on:
7+
pull_request:
8+
types: [opened]
9+
branches-ignore:
10+
- l10n_dev
11+
12+
jobs:
13+
automation:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Assign PR to creator
17+
uses: thomaseizinger/[email protected]
18+
with:
19+
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pr_milestone.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Set Milestone
2+
3+
# Assigns the earliest created milestone that matches the below glob pattern.
4+
5+
on:
6+
pull_request:
7+
types: [opened]
8+
9+
jobs:
10+
automation:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: set-milestone
15+
uses: andrefcdias/[email protected]
16+
with:
17+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
18+
milestone: "+([0-9]).+([0-9]).+([0-9])"
19+
use-expression: true

Flow.Launcher.Core/ExternalPlugins/Environments/AbstractPluginEnvironment.cs

+10-9
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.IO;
88
using System.Linq;
99
using System.Windows.Forms;
10+
using Flow.Launcher.Core.Resource;
1011

1112
namespace Flow.Launcher.Core.ExternalPlugins.Environments
1213
{
@@ -50,14 +51,15 @@ internal IEnumerable<PluginPair> Setup()
5051
return SetPathForPluginPairs(PluginsSettingsFilePath, Language);
5152
}
5253

53-
if (MessageBox.Show($"Flow detected you have installed {Language} plugins, which " +
54-
$"will require {EnvName} to run. Would you like to download {EnvName}? " +
55-
Environment.NewLine + Environment.NewLine +
56-
"Click no if it's already installed, " +
57-
$"and you will be prompted to select the folder that contains the {EnvName} executable",
58-
string.Empty, MessageBoxButtons.YesNo) == DialogResult.No)
54+
var noRuntimeMessage = string.Format(
55+
InternationalizationManager.Instance.GetTranslation("runtimePluginInstalledChooseRuntimePrompt"),
56+
Language,
57+
EnvName,
58+
Environment.NewLine
59+
);
60+
if (MessageBox.Show(noRuntimeMessage, string.Empty, MessageBoxButtons.YesNo) == DialogResult.No)
5961
{
60-
var msg = $"Please select the {EnvName} executable";
62+
var msg = string.Format(InternationalizationManager.Instance.GetTranslation("runtimePluginChooseRuntimeExecutable"), EnvName);
6163
string selectedFile;
6264

6365
selectedFile = GetFileFromDialog(msg, FileDialogFilter);
@@ -80,8 +82,7 @@ internal IEnumerable<PluginPair> Setup()
8082
}
8183
else
8284
{
83-
MessageBox.Show(
84-
$"Unable to set {Language} executable path, please try from Flow's settings (scroll down to the bottom).");
85+
MessageBox.Show(string.Format(InternationalizationManager.Instance.GetTranslation("runtimePluginUnableToSetExecutablePath"), Language));
8586
Log.Error("PluginsLoader",
8687
$"Not able to successfully set {EnvName} path, setting's plugin executable path variable is still an empty string.",
8788
$"{Language}Environment");

Flow.Launcher.Core/ExternalPlugins/UserPlugin.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22

33
namespace Flow.Launcher.Core.ExternalPlugins
44
{
@@ -13,9 +13,11 @@ public record UserPlugin
1313
public string Website { get; set; }
1414
public string UrlDownload { get; set; }
1515
public string UrlSourceCode { get; set; }
16+
public string LocalInstallPath { get; set; }
1617
public string IcoPath { get; set; }
1718
public DateTime? LatestReleaseDate { get; set; }
1819
public DateTime? DateAdded { get; set; }
1920

21+
public bool IsFromLocalInstallPath => !string.IsNullOrEmpty(LocalInstallPath);
2022
}
2123
}

Flow.Launcher.Core/Flow.Launcher.Core.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@
5454

5555
<ItemGroup>
5656
<PackageReference Include="Droplex" Version="1.7.0" />
57-
<PackageReference Include="FSharp.Core" Version="7.0.401" />
58-
<PackageReference Include="Meziantou.Framework.Win32.Jobs" Version="3.2.1" />
59-
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.0" />
57+
<PackageReference Include="FSharp.Core" Version="8.0.301" />
58+
<PackageReference Include="Meziantou.Framework.Win32.Jobs" Version="3.4.0" />
59+
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
6060
<PackageReference Include="squirrel.windows" Version="1.5.2" NoWarn="NU1701" />
61-
<PackageReference Include="StreamJsonRpc" Version="2.17.11" />
61+
<PackageReference Include="StreamJsonRpc" Version="2.18.48" />
6262
</ItemGroup>
6363

6464
<ItemGroup>

Flow.Launcher.Core/Plugin/JsonRPCPluginV2.cs

+13-4
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,20 @@ public virtual Task ReloadDataAsync()
139139
return Task.CompletedTask;
140140
}
141141

142-
public virtual ValueTask DisposeAsync()
142+
public virtual async ValueTask DisposeAsync()
143143
{
144-
RPC?.Dispose();
145-
ErrorStream?.Dispose();
146-
return ValueTask.CompletedTask;
144+
try
145+
{
146+
await RPC.InvokeAsync("close");
147+
}
148+
catch (RemoteMethodNotFoundException e)
149+
{
150+
}
151+
finally
152+
{
153+
RPC?.Dispose();
154+
ErrorStream?.Dispose();
155+
}
147156
}
148157
}
149158
}

0 commit comments

Comments
 (0)