[PR #249] Hecatron pull 1 #1122

Open
opened 2026-01-29 16:57:34 +00:00 by claunia · 0 comments
Owner

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

{
  "start": {
    "runtimeid": "<value here>"
  }
}

Other changes

  • Some of the code in the commands has been split into seperate functions just to make it easier to read / follow
  • Help text is now nicely formatted
  • I've not tested it yet but I added a target for the 32bit rasberry pi
  • The build output I've set to be a subdirectory under bin (such as bin/Host for start, bin/desktop for build)
    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

**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=<value>" on the command line for the json file it can be picked up via ``` { "start": { "runtimeid": "<value here>" } } ``` ## Other changes * Some of the code in the commands has been split into seperate functions just to make it easier to read / follow * Help text is now nicely formatted * I've not tested it yet but I added a target for the 32bit rasberry pi * The build output I've set to be a subdirectory under bin (such as bin/Host for start, bin/desktop for build) 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
claunia added the pull-request label 2026-01-29 16:57:34 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#1122