akileez / test-npinit

Documenting the process of re-working "npinit" and re-learning git.
ISC License
1 stars 0 forks source link

consider reading a configuration file from outside the program #12

Open akileez opened 3 years ago

akileez commented 3 years ago

gives another option and opens the door for automation

akileez commented 3 years ago

think i will use yaml and/or js for outside config files yaml ensures another large dependency...but for dumping object data, another story.

akileez commented 3 years ago

this will make using a cache a certainty.

akileez commented 3 years ago

will need to sketch out how this would work.

for instance, I could bypass the init process (in conf_v2) entirely which would speed up the process of obtaining user data. a command line option would satisfy here, such that if called, the program would read a user provided config, set the internal config cache and run next step of the process. Slowdown of reading in data not taken into account.

akileez commented 3 years ago

further thought..the reading of the user config could occur during init just after the setting of options and before the global config gets set.

akileez commented 3 years ago

commit 9047a903b2a0eaebd33e041ef789c2d9184b0d11 addresses this issue. decided to require a .js file. A javascript file allows the the easy creation of three objects, separately exported which facilitates the importing of data.

akileez commented 3 years ago

initial scaffolding works like a charm. time is also significantly faster than using npm config command mentioned in #6

npconf-user_provided_file_output

akileez commented 3 years ago

this process by-passes init:configuration settings and does not sanitize the input. therefore command line options become irrelevant and unknown input errors could/will pop up.

akileez commented 3 years ago

running a user config file from update f5f71942ae5c04d312256df99beb313107dc687f and I happened to delete my /tmp directory in the process of building this update. lost 6 months worth of research!!!

npi js — devtoolz 2021-05-07 09-10-24

results:

npi js — devtoolz 2021-05-07 09-10-50

akileez commented 3 years ago

compare to above: running build without a user provided config

npi js — devtoolz 2021-05-07 09-11-14

results:

npi js — devtoolz 2021-05-07 09-11-37