digidem / mapeo-default-config

Default config (categories, icons, questions) for Mapeo Mobile
Other
2 stars 4 forks source link

Consider removing settings builder as a local dep #23

Open achou11 opened 2 years ago

achou11 commented 2 years ago

Stemmed from a conversation with @rudokemper while doing some debugging work on mapeo-settings-builder. Based on programs usage, there's no consensus on how the build step is done i.e. via the local npm run script command (npm run build) or using a globally installed executable mapeo-settings .... Documentation seems to be somewhat conflicting as well.

Seems like defaulting to using a global install would require less technical overhead for end-users (less of a need to understand node/npm intricacies), but it comes at the cost of some customization regarding the version of the builder you use (e.g. maybe a more recent version of the executable isn't compatible with the project being worked on).

Wanted to bring this up for discussion and see if there are any additional thoughts on it

@gmaclennan

rudokemper commented 2 years ago

(cross-posted from Dd #programs for transparency):

So what this means in practice is that you only have to install mapeo-settings-builder once, and then you can just run a command like mapeo-settings build in any config directory and it will just work ™.

This would differ from one of the current workflows, which involves installing mapeo-settings-builder locally within a config directory, and then running npm run build to execute a specific build script within the config's package.json file.

This latter workflow involves more steps (and requires internet access to download all of the dependencies if they haven't been set up already as we had to do recently), but does give more leverage for any specific build specs that were written into the config (such as language localization choice I believe). However I don't know how many configs are using this currently. For all the ones I've built, they've been clones of the default config with no changes made to the build script.

So that could be the norm and the global mapeo-settings-builder install could riff off of that, and if we do need a specific build script, then that one could benefit from using the local npm run script command.

achou11 commented 2 years ago

(also cross-posted from Dd #programs):

for programs side, i guess the question boils down to choosing between which workflow is easier to understand/use by default:

  1. install mapeo-settings-builder globally i.e. npm install -g mapeo-settings-builder (only need to do this once, unless you’re updating the version of it)
  2. create a project for custom config from the default template
  3. run mapeo-settings on project directory to build the config (potentially with any flags that may be needed)

or

  1. create a project for custom config from the default template
  2. (optionally) update the build field in package.json to provide any flags that may be needed
  3. run npm run build on project directory to build the config