Skip to content

Commit

Permalink
Merge pull request #2452 from Flow-Launcher/dev
Browse files Browse the repository at this point in the history
Release 1.17.0 | Plugin 4.2.0
  • Loading branch information
jjw24 committed Feb 4, 2024
2 parents 12263fe + 694e504 commit cec8a73
Show file tree
Hide file tree
Showing 201 changed files with 5,710 additions and 3,363 deletions.
11 changes: 4 additions & 7 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
crowdin
DWM
workflows
Wpf
wpf
actionkeyword
stackoverflow
Expand All @@ -20,9 +19,7 @@ Prioritise
Segoe
Google
Customise
UWP
uwp
Uwp
Bokmal
Bokm
uninstallation
Expand Down Expand Up @@ -61,7 +58,6 @@ popup
ptr
pluginindicator
TobiasSekan
Img
img
resx
bak
Expand All @@ -78,7 +74,6 @@ WCA_ACCENT_POLICY
HGlobal
dopusrt
firefox
Firefox
msedge
svgc
ime
Expand All @@ -87,7 +82,6 @@ txb
btn
otf
searchplugin
Noresult
wpftk
mkv
flac
Expand All @@ -108,4 +102,7 @@ Preinstalled
errormetadatafile
noresult
pluginsmanager
alreadyexists
alreadyexists
JsonRPC
JsonRPCV2
Softpedia
3 changes: 3 additions & 0 deletions .github/actions/spelling/patterns.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,6 @@

# UWP
[Uu][Ww][Pp]

# version suffix <word>v#
(?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_]))
5 changes: 3 additions & 2 deletions .github/workflows/default_plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Publish Default Plugins

on:
push:
branches: ['master']
branches: ['dev']
paths: ['Plugins/**']
workflow_dispatch:

Expand All @@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x

Expand Down Expand Up @@ -46,6 +46,7 @@ jobs:
- 'Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json'
windowssettings:
- 'Plugins/Flow.Launcher.Plugin.WindowsSettings/plugin.json'
base: 'master'

- name: Get BrowserBookmark Version
if: steps.changes.outputs.browserbookmark == 'true'
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/spelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
steps:
- name: check-spelling
id: spelling
uses: check-spelling/check-spelling@main
uses: check-spelling/check-spelling@prerelease
with:
suppress_push_for_open_pull_request: 1
checkout: true
Expand All @@ -89,12 +89,12 @@ jobs:
check_extra_dictionaries: ''
quit_without_error: true
extra_dictionaries:
cspell:software-terms/src/software-terms.txt
cspell:software-terms/dict/softwareTerms.txt
cspell:win32/src/win32.txt
cspell:php/php.txt
cspell:filetypes/filetypes.txt
cspell:csharp/csharp.txt
cspell:dotnet/dotnet.txt
cspell:dotnet/dict/dotnet.txt
cspell:python/src/common/extra.txt
cspell:python/src/python/python-lib.txt
cspell:aws/aws.txt
cspell:companies/src/companies.txt
Expand All @@ -113,7 +113,7 @@ jobs:
# if: (success() || failure()) && needs.spelling.outputs.followup && github.event_name == 'push'
# steps:
# - name: comment
# uses: check-spelling/check-spelling@main
# uses: check-spelling/check-spelling@@v0.0.22
# with:
# checkout: true
# spell_check_this: check-spelling/spell-check-this@main
Expand All @@ -129,7 +129,7 @@ jobs:
if: (success() || failure()) && needs.spelling.outputs.followup && contains(github.event_name, 'pull_request')
steps:
- name: comment
uses: check-spelling/check-spelling@main
uses: check-spelling/check-spelling@prerelease
with:
checkout: true
spell_check_this: check-spelling/spell-check-this@main
Expand All @@ -153,7 +153,7 @@ jobs:
# cancel-in-progress: false
# steps:
# - name: apply spelling updates
# uses: check-spelling/check-spelling@main
# uses: check-spelling/check-spelling@v0.0.22
# with:
# experimental_apply_changes_via_bot: 1
# checkout: true
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,26 @@ on:
schedule:
- cron: '30 1 * * *'

env:
days-before-stale: 60
days-before-close: 7
exempt-issue-labels: 'keep-fresh'

jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v8
- uses: actions/stale@v9
with:
stale-issue-message: 'This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
days-before-stale: 45
days-before-close: 7
stale-issue-message: 'This issue is stale because it has been open ${{ env.days-before-stale }} days with no activity. Remove stale label or comment or this will be closed in ${{ env.days-before-stale }} days.\n\nAlternatively this issue can be kept open by adding one of the following labels:\n${{ env.exempt-issue-labels }}'
days-before-stale: ${{ env.days-before-stale }}
days-before-close: ${{ env.days-before-close }}
days-before-pr-close: -1
exempt-all-milestones: true
close-issue-message: 'This issue was closed because it has been stale for 7 days with no activity. If you feel this issue still needs attention please feel free to reopen.'
stale-pr-label: 'no-pr-activity'
exempt-issue-labels: 'keep-fresh'
exempt-issue-labels: ${{ env.exempt-issue-labels }}
exempt-pr-labels: 'keep-fresh,awaiting-approval,work-in-progress'
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ internal IEnumerable<PluginPair> Setup()
string.Empty, MessageBoxButtons.YesNo) == DialogResult.No)
{
var msg = $"Please select the {EnvName} executable";
var selectedFile = string.Empty;
string selectedFile;

selectedFile = GetFileFromDialog(msg, FileDialogFilter);

Expand Down Expand Up @@ -131,14 +131,8 @@ private string GetFileFromDialog(string title, string filter = "")
};

var result = dlg.ShowDialog();
if (result == DialogResult.OK)
{
return dlg.FileName;
}
else
{
return string.Empty;
}
return result == DialogResult.OK ? dlg.FileName : string.Empty;

}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.Collections.Generic;
using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin;

namespace Flow.Launcher.Core.ExternalPlugins.Environments
{

internal class JavaScriptV2Environment : TypeScriptV2Environment
{
internal override string Language => AllowedLanguage.JavaScriptV2;

internal JavaScriptV2Environment(List<PluginMetadata> pluginMetadataList, PluginsSettings pluginSettings) : base(pluginMetadataList, pluginSettings) { }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System.Collections.Generic;
using Flow.Launcher.Core.Plugin;
using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin;

namespace Flow.Launcher.Core.ExternalPlugins.Environments
{
internal class PythonV2Environment : PythonEnvironment
{
internal override string Language => AllowedLanguage.PythonV2;

internal override PluginPair CreatePluginPair(string filePath, PluginMetadata metadata)
{
return new PluginPair
{
Plugin = new PythonPluginV2(filePath),
Metadata = metadata
};
}

internal PythonV2Environment(List<PluginMetadata> pluginMetadataList, PluginsSettings pluginSettings) : base(pluginMetadataList, pluginSettings) { }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System.Collections.Generic;
using Droplex;
using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin.SharedCommands;
using Flow.Launcher.Plugin;
using System.IO;
using Flow.Launcher.Core.Plugin;

namespace Flow.Launcher.Core.ExternalPlugins.Environments
{
internal class TypeScriptV2Environment : AbstractPluginEnvironment
{
internal override string Language => AllowedLanguage.TypeScriptV2;

internal override string EnvName => DataLocation.NodeEnvironmentName;

internal override string EnvPath => Path.Combine(DataLocation.PluginEnvironmentsPath, EnvName);

internal override string InstallPath => Path.Combine(EnvPath, "Node-v16.18.0");
internal override string ExecutablePath => Path.Combine(InstallPath, "node-v16.18.0-win-x64\\node.exe");

internal override string PluginsSettingsFilePath { get => PluginSettings.NodeExecutablePath; set => PluginSettings.NodeExecutablePath = value; }

internal TypeScriptV2Environment(List<PluginMetadata> pluginMetadataList, PluginsSettings pluginSettings) : base(pluginMetadataList, pluginSettings) { }

internal override void InstallEnvironment()
{
FilesFolders.RemoveFolderIfExists(InstallPath);

DroplexPackage.Drop(App.nodejs_16_18_0, InstallPath).Wait();

PluginsSettingsFilePath = ExecutablePath;
}

internal override PluginPair CreatePluginPair(string filePath, PluginMetadata metadata)
{
return new PluginPair
{
Plugin = new NodePluginV2(filePath),
Metadata = metadata
};
}
}
}
2 changes: 1 addition & 1 deletion Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Flow.Launcher.Infrastructure.Logger;
using Flow.Launcher.Infrastructure.Logger;
using System;
using System.Collections.Generic;
using System.Threading;
Expand Down
3 changes: 2 additions & 1 deletion Flow.Launcher.Core/Flow.Launcher.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@

<ItemGroup>
<PackageReference Include="Droplex" Version="1.7.0" />
<PackageReference Include="FSharp.Core" Version="7.0.400" />
<PackageReference Include="FSharp.Core" Version="7.0.401" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="2.3.2" />
<PackageReference Include="squirrel.windows" Version="1.5.2" NoWarn="NU1701" />
<PackageReference Include="StreamJsonRpc" Version="2.17.8" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 3 additions & 2 deletions Flow.Launcher.Core/Plugin/ExecutablePlugin.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Diagnostics;
using System.IO;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;

Expand Down Expand Up @@ -27,14 +28,14 @@ public ExecutablePlugin(string filename)
protected override Task<Stream> RequestAsync(JsonRPCRequestModel request, CancellationToken token = default)
{
// since this is not static, request strings will build up in ArgumentList if index is not specified
_startInfo.ArgumentList[0] = request.ToString();
_startInfo.ArgumentList[0] = JsonSerializer.Serialize(request, RequestSerializeOption);
return ExecuteAsync(_startInfo, token);
}

protected override string Request(JsonRPCRequestModel rpcRequest, CancellationToken token = default)
{
// since this is not static, request strings will build up in ArgumentList if index is not specified
_startInfo.ArgumentList[0] = rpcRequest.ToString();
_startInfo.ArgumentList[0] = JsonSerializer.Serialize(rpcRequest, RequestSerializeOption);
return Execute(_startInfo);
}
}
Expand Down
26 changes: 26 additions & 0 deletions Flow.Launcher.Core/Plugin/ExecutablePluginV2.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System.Diagnostics;
using System.IO;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;

namespace Flow.Launcher.Core.Plugin
{
internal sealed class ExecutablePluginV2 : ProcessStreamPluginV2
{
protected override ProcessStartInfo StartInfo { get; set; }

public ExecutablePluginV2(string filename)
{
StartInfo = new ProcessStartInfo
{
FileName = filename,
UseShellExecute = false,
CreateNoWindow = true,
RedirectStandardOutput = true,
RedirectStandardError = true
};
}

}
}
Loading

0 comments on commit cec8a73

Please sign in to comment.