forked from Flow-Launcher/Flow.Launcher
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Flow-Launcher#1353 from Flow-Launcher/jsonrpc_v2
Implement JSONRPC V2
- Loading branch information
Showing
26 changed files
with
1,399 additions
and
562 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
Flow.Launcher.Core/ExternalPlugins/Environments/JavaScriptV2Environment.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { } | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
Flow.Launcher.Core/ExternalPlugins/Environments/PythonV2Environment.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { } | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
Flow.Launcher.Core/ExternalPlugins/Environments/TypeScriptV2Environment.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}; | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.