mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
[PR #249] [CLOSED] Hecatron pull 1 #1118
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ElectronNET/Electron.NET/pull/249
Author: @Hecatron
Created: 5/17/2019
Status: ❌ Closed
Base:
master← Head:hecatron-pull-1📝 Commits (10+)
9dd920aInitial re-write of the configuration parsingd63917fInitial re-write of the configuration parsing3925da1fixes for the start and init commands after the first batch of testingda8eda3fixes added for add command after testing0ac6b00additional fixes, and build is now in a working stateb5a47e4final set of fixesc5f6ba1update to build scripts32b8c9aupdate to readme, minor update to build path8166f85Fixes after rebase / bug fixesbe16413removed build output option📊 Changes
36 files changed (+2104 additions, -940 deletions)
View changed files
📝
ElectronNET.CLI/Commands/Actions/DeployEmbeddedElectronFiles.cs(+11 -12)➕
ElectronNET.CLI/Commands/Actions/DesiredPlatformInfo.cs(+123 -0)📝
ElectronNET.CLI/Commands/Actions/DirectoryCopy.cs(+28 -32)➖
ElectronNET.CLI/Commands/Actions/GetTargetPlatformInformation.cs(+0 -70)📝
ElectronNET.CLI/Commands/AddCommand.cs(+98 -85)📝
ElectronNET.CLI/Commands/BuildCommand.cs(+131 -148)➖
ElectronNET.CLI/Commands/CommandOption.cs(+0 -53)➕
ElectronNET.CLI/Commands/CommandType.cs(+68 -0)📝
ElectronNET.CLI/Commands/InitCommand.cs(+116 -115)➕
ElectronNET.CLI/Commands/StartCommand.cs(+151 -0)➖
ElectronNET.CLI/Commands/StartElectronCommand.cs(+0 -108)📝
ElectronNET.CLI/Commands/VersionCommand.cs(+40 -23)➕
ElectronNET.CLI/Config/AppSettings.cs(+122 -0)➕
ElectronNET.CLI/Config/CmdLineProvider/CallbackExtensions.cs(+27 -0)➕
ElectronNET.CLI/Config/CmdLineProvider/DirectCallbackProvider.cs(+36 -0)➕
ElectronNET.CLI/Config/CmdLineProvider/DirectCallbackSource.cs(+22 -0)➕
ElectronNET.CLI/Config/Commands/AddConfig.cs(+149 -0)➕
ElectronNET.CLI/Config/Commands/BuildConfig.cs(+244 -0)➕
ElectronNET.CLI/Config/Commands/ICommandConfig.cs(+17 -0)➕
ElectronNET.CLI/Config/Commands/InitConfig.cs(+102 -0)...and 16 more files
📄 Description
Hi,
I've recently made an attempt at redoing the configuration for Electron.Net
I'd imagine this might not make it through as it's a large number of changes.
But i'd be interested in any feedback and I have tried testing all the different options / commands.
Configuration
I've set things up to use Microsoft.Extensions.Configuration
The way this works is that it first parses multiple sources into key value pairs
then binds those key value pairs to properties of a class.
First it attempts to load settings from a json file - "ElectronNetSettings.json" in the current directory
These can all be overriden by command line options such as "--npmcommand=npm" or "/npmcommand=npm"
The command line is split into arguments and switches, the switches can start with --, -, /
so --npmcommand -npmcommand /npmcommand are all the same
It supports multiple arguments
Each command now has a seperate configuration class to store and parse it's settings.
I've tried to keep the command line options the same as before but with just additional options
The one exception might be manually specifying the runtimeid / electronpacker settings in build
The way that works is that it can auto detect the values, and then the user can just override the settings it pulls back with options if needed
Json file
For the configuration to give an example looking at the "start" command
it has a setting of builder["start:runtimeid"]
this can be set via "--runtimeid=" on the command line
for the json file it can be picked up via
Other changes
Usually with C# projects everything built ends up in bin and it's likley the first place someone will look for a built project
I had to remove --production from the npm install during the build command.
A different solution would have been to move some of the devDependencies into dependencies within package.json
I suspect it's working for some users but not others with --production if they have some of the tools installed globaly at the right versions such as typescript
Anyway let me know what you think
Doing it this way might make it easier to add in other commands / options / arguments later on
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.