mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-04 05:34:51 +00:00
[PR #249] Hecatron pull 1 #1122
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?
Original Pull Request: https://github.com/ElectronNET/Electron.NET/pull/249
State: closed
Merged: No
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